From f25dcbacf37be81af4e5693d65445b89f8977525 Mon Sep 17 00:00:00 2001 From: Jukka Kurkela Date: Sun, 17 Nov 2024 14:13:07 +0200 Subject: [PATCH] chore: build cleanup, include homepage (#862) --- package-lock.json | 80 +++++++++++++++++++++++++++++++++++++++++++++++ package.json | 2 ++ rollup.config.js | 13 +++++--- 3 files changed, 90 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 27c621ea..0f5c8186 100644 --- a/package-lock.json +++ b/package-lock.json @@ -49,6 +49,7 @@ "ng-hammerjs": "^2.0.8", "pixelmatch": "^5.2.1", "rollup": "^4.12.1", + "rollup-plugin-cleanup": "^3.2.1", "rollup-plugin-istanbul": "^5.0.0", "typedoc": "^0.26.11", "typedoc-plugin-markdown": "^4.2.10", @@ -12148,6 +12149,29 @@ "integrity": "sha512-JVAfqNPTvNq3sB/VHQJAFxN/sPgKnsKrCwyRt15zwNCdrMMJDdcEOdubuy+DuJYYdm0ox1J4uzEuYKkN+9yhVg==", "dev": true }, + "node_modules/js-cleanup": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/js-cleanup/-/js-cleanup-1.2.0.tgz", + "integrity": "sha512-JeDD0yiiSt80fXzAVa/crrS0JDPQljyBG/RpOtaSbyDq03VHa9szJWMaWOYU/bcTn412uMN2MxApXq8v79cUiQ==", + "dev": true, + "dependencies": { + "magic-string": "^0.25.7", + "perf-regexes": "^1.0.1", + "skip-regex": "^1.0.2" + }, + "engines": { + "node": "^10.14.2 || >=12.0.0" + } + }, + "node_modules/js-cleanup/node_modules/magic-string": { + "version": "0.25.9", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.9.tgz", + "integrity": "sha512-RmF0AsMzgt25qzqqLc1+MbHmhdx0ojF2Fvs4XnOqz2ZOBXzzkEwc/dJQZCYHAn7v1jbVOjAZfK8msRn4BxO4VQ==", + "dev": true, + "dependencies": { + "sourcemap-codec": "^1.4.8" + } + }, "node_modules/js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", @@ -14283,6 +14307,15 @@ "node": ">=0.12" } }, + "node_modules/perf-regexes": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/perf-regexes/-/perf-regexes-1.0.1.tgz", + "integrity": "sha512-L7MXxUDtqr4PUaLFCDCXBfGV/6KLIuSEccizDI7JxT+c9x1G1v04BQ4+4oag84SHaCdrBgQAIs/Cqn+flwFPng==", + "dev": true, + "engines": { + "node": ">=6.14" + } + }, "node_modules/perfect-scrollbar": { "version": "1.5.6", "resolved": "https://registry.npmjs.org/perfect-scrollbar/-/perfect-scrollbar-1.5.6.tgz", @@ -16983,6 +17016,22 @@ "fsevents": "~2.3.2" } }, + "node_modules/rollup-plugin-cleanup": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/rollup-plugin-cleanup/-/rollup-plugin-cleanup-3.2.1.tgz", + "integrity": "sha512-zuv8EhoO3TpnrU8MX8W7YxSbO4gmOR0ny06Lm3nkFfq0IVKdBUtHwhVzY1OAJyNCIAdLiyPnOrU0KnO0Fri1GQ==", + "dev": true, + "dependencies": { + "js-cleanup": "^1.2.0", + "rollup-pluginutils": "^2.8.2" + }, + "engines": { + "node": "^10.14.2 || >=12.0.0" + }, + "peerDependencies": { + "rollup": ">=2.0" + } + }, "node_modules/rollup-plugin-istanbul": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/rollup-plugin-istanbul/-/rollup-plugin-istanbul-5.0.0.tgz", @@ -17029,6 +17078,21 @@ "node": ">=10" } }, + "node_modules/rollup-pluginutils": { + "version": "2.8.2", + "resolved": "https://registry.npmjs.org/rollup-pluginutils/-/rollup-pluginutils-2.8.2.tgz", + "integrity": "sha512-EEp9NhnUkwY8aif6bxgovPHMoMoNr2FulJziTndpt5H9RdwC47GSGuII9XxpSdzVGM0GWrNPHV6ie1LTNJPaLQ==", + "dev": true, + "dependencies": { + "estree-walker": "^0.6.1" + } + }, + "node_modules/rollup-pluginutils/node_modules/estree-walker": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-0.6.1.tgz", + "integrity": "sha512-SqmZANLWS0mnatqbSfRP5g8OXZC12Fgg1IwNtLsyHDzJizORW4khDfjPqJZsemPWBB2uqykUah5YpQ6epsqC/w==", + "dev": true + }, "node_modules/run-parallel": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", @@ -17539,6 +17603,15 @@ "integrity": "sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ==", "dev": true }, + "node_modules/skip-regex": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/skip-regex/-/skip-regex-1.0.2.tgz", + "integrity": "sha512-pEjMUbwJ5Pl/6Vn6FsamXHXItJXSRftcibixDmNCWbWhic0hzHrwkMZo0IZ7fMRH9KxcWDFSkzhccB4285PutA==", + "dev": true, + "engines": { + "node": ">=4.2" + } + }, "node_modules/slash": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", @@ -17831,6 +17904,13 @@ "deprecated": "See https://github.com/lydell/source-map-url#deprecated", "dev": true }, + "node_modules/sourcemap-codec": { + "version": "1.4.8", + "resolved": "https://registry.npmjs.org/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz", + "integrity": "sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==", + "deprecated": "Please use @jridgewell/sourcemap-codec instead", + "dev": true + }, "node_modules/space-separated-tokens": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/space-separated-tokens/-/space-separated-tokens-2.0.2.tgz", diff --git a/package.json b/package.json index 382f0b24..381d4662 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,6 @@ { "name": "chartjs-plugin-zoom", + "homepage": "https://www.chartjs.org/chartjs-plugin-zoom/", "description": "Plugin that enables zoom and pan functionality in Chart.js charts.", "version": "2.0.1", "license": "MIT", @@ -69,6 +70,7 @@ "ng-hammerjs": "^2.0.8", "pixelmatch": "^5.2.1", "rollup": "^4.12.1", + "rollup-plugin-cleanup": "^3.2.1", "rollup-plugin-istanbul": "^5.0.0", "typedoc": "^0.26.11", "typedoc-plugin-markdown": "^4.2.10", diff --git a/rollup.config.js b/rollup.config.js index 499ab7fd..d930f114 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -1,6 +1,7 @@ const commonjs = require('@rollup/plugin-commonjs'); +const cleanup = require('rollup-plugin-cleanup'); const json = require('@rollup/plugin-json'); -const nodeResolve = require('@rollup/plugin-node-resolve'); +const resolve = require('@rollup/plugin-node-resolve'); const terser = require('@rollup/plugin-terser'); const pkg = require('./package.json'); @@ -10,7 +11,7 @@ const allDependencies = dependencies.concat(peerDependencies); const banner = `/*! * ${pkg.name} v${pkg.version} -* ${pkg.homepage} +* ${pkg.homepage}${pkg.version}/ * (c) 2016-${(new Date(process.env.SOURCE_DATE_EPOCH ? (process.env.SOURCE_DATE_EPOCH * 1000) : new Date().getTime())).getFullYear()} chartjs-plugin-zoom Contributors * Released under the MIT License */`; @@ -39,7 +40,8 @@ module.exports = [ include: 'node_modules/**', }), json(), - nodeResolve(), + resolve(), + cleanup({comments: ['some']}), ], external: allDependencies }, @@ -58,7 +60,7 @@ module.exports = [ include: 'node_modules/**', }), json(), - nodeResolve(), + resolve(), terser({output: {comments: 'some'}}) ], external: allDependencies @@ -67,7 +69,8 @@ module.exports = [ input: 'src/index.esm.js', plugins: [ json(), - nodeResolve() + resolve(), + cleanup({comments: ['some']}), ], output: { name,