From babce6c27f0780563d064b98f6522ad83367c940 Mon Sep 17 00:00:00 2001 From: Nick Frasser <1693461+nfrasser@users.noreply.github.com> Date: Wed, 8 Nov 2023 23:15:39 -0500 Subject: [PATCH] Update to correct rollup terser version --- package-lock.json | 123 ++++++++++------------------ package.json | 2 +- packages/linkifyjs/rollup.config.js | 8 +- rollup.config.js | 30 +++---- 4 files changed, 63 insertions(+), 100 deletions(-) diff --git a/package-lock.json b/package-lock.json index 3f1106a..4d08fa1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,11 +8,7 @@ "name": "linkify", "version": "4.1.1", "license": "MIT", - "workspaces": [ - "./packages/linkifyjs", - "./packages/linkify-plugin-*", - "./packages/*" - ], + "workspaces": ["./packages/linkifyjs", "./packages/linkify-plugin-*", "./packages/*"], "devDependencies": { "@babel/core": "^7.13.10", "@babel/eslint-parser": "^7.13.10", @@ -23,6 +19,7 @@ "@rollup/plugin-babel": "^6.0.3", "@rollup/plugin-commonjs": "^24.0.0", "@rollup/plugin-node-resolve": "^15.0.1", + "@rollup/plugin-terser": "^0.4.4", "chai": "^4.3.4", "copyfiles": "^2.4.1", "coveralls": "^3.1.0", @@ -47,7 +44,6 @@ "react-dom": "^18.0.0", "request": "^2.88.2", "rollup": "^2.42.1", - "rollup-plugin-terser": "^7.0.2", "sinon": "^17.0.0", "typescript": "^5.0.2" }, @@ -2193,6 +2189,37 @@ } } }, + "node_modules/@rollup/plugin-terser": { + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/@rollup/plugin-terser/-/plugin-terser-0.4.4.tgz", + "integrity": "sha512-XHeJC5Bgvs8LfukDwWZp7yeqin6ns8RTl2B9avbejt6tZqsqvVoWI7ZTQrcNsfKEDWBTnTxM8nMDkO2IFFbd0A==", + "dev": true, + "dependencies": { + "serialize-javascript": "^6.0.1", + "smob": "^1.0.0", + "terser": "^5.17.4" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "rollup": "^2.0.0||^3.0.0||^4.0.0" + }, + "peerDependenciesMeta": { + "rollup": { + "optional": true + } + } + }, + "node_modules/@rollup/plugin-terser/node_modules/serialize-javascript": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.1.tgz", + "integrity": "sha512-owoXEFjWRllis8/M1Q+Cw5k8ZH40e3zhp/ovX+Xr/vi1qj6QesbyXXViFbpNvWvPNAD62SutwEXavefrLJWj7w==", + "dev": true, + "dependencies": { + "randombytes": "^2.1.0" + } + }, "node_modules/@rollup/pluginutils": { "version": "5.0.5", "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-5.0.5.tgz", @@ -4248,9 +4275,7 @@ "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", "integrity": "sha512-11Ndz7Nv+mvAC1j0ktTa7fAb0vLyGGX+rMHNBYQviQDGU0Hw7lhctJANqbPhu9nV9/izT/IntTgZ7Im/9LJs9g==", "dev": true, - "engines": [ - "node >=0.6.0" - ] + "engines": ["node >=0.6.0"] }, "node_modules/fast-deep-equal": { "version": "3.1.3", @@ -4525,9 +4550,7 @@ "dev": true, "hasInstallScript": true, "optional": true, - "os": [ - "darwin" - ], + "os": ["darwin"], "engines": { "node": "^8.16.0 || ^10.6.0 || >=11.0.0" } @@ -5674,41 +5697,6 @@ "node": ">=8" } }, - "node_modules/jest-worker": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-26.6.2.tgz", - "integrity": "sha512-KWYVV1c4i+jbMpaBC+U++4Va0cp8OisU185o73T1vo99hqi7w8tSJfUXYswwqqrjzwxa6KpRK54WhPvwf5w6PQ==", - "dev": true, - "dependencies": { - "@types/node": "*", - "merge-stream": "^2.0.0", - "supports-color": "^7.0.0" - }, - "engines": { - "node": ">= 10.13.0" - } - }, - "node_modules/jest-worker/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/jest-worker/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/jquery": { "version": "3.7.1", "resolved": "https://registry.npmjs.org/jquery/-/jquery-3.7.1.tgz", @@ -6359,12 +6347,6 @@ "node": ">= 0.10.0" } }, - "node_modules/merge-stream": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", - "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", - "dev": true - }, "node_modules/mime": { "version": "2.6.0", "resolved": "https://registry.npmjs.org/mime/-/mime-2.6.0.tgz", @@ -8054,31 +8036,6 @@ "fsevents": "~2.3.2" } }, - "node_modules/rollup-plugin-terser": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/rollup-plugin-terser/-/rollup-plugin-terser-7.0.2.tgz", - "integrity": "sha512-w3iIaU4OxcF52UUXiZNsNeuXIMDvFrr+ZXK6bFZ0Q60qyVfq4uLptoS4bbq3paG3x216eQllFZX7zt6TIImguQ==", - "deprecated": "This package has been deprecated and is no longer maintained. Please use @rollup/plugin-terser", - "dev": true, - "dependencies": { - "@babel/code-frame": "^7.10.4", - "jest-worker": "^26.2.1", - "serialize-javascript": "^4.0.0", - "terser": "^5.0.0" - }, - "peerDependencies": { - "rollup": "^2.0.0" - } - }, - "node_modules/rollup-plugin-terser/node_modules/serialize-javascript": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-4.0.0.tgz", - "integrity": "sha512-GaNA54380uFefWghODBWEGisLZFj00nS5ACs6yHa9nLqlLpVLO8ChDGeKRjZnV4Nh4n0Qi7nhYZD/9fCPzEqkw==", - "dev": true, - "dependencies": { - "randombytes": "^2.1.0" - } - }, "node_modules/run-parallel": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", @@ -8365,6 +8322,12 @@ "node": ">=8" } }, + "node_modules/smob": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/smob/-/smob-1.4.1.tgz", + "integrity": "sha512-9LK+E7Hv5R9u4g4C3p+jjLstaLe11MDsL21UpYaCNmapvMkYhqCV4A/f/3gyH8QjMyh6l68q9xC85vihY9ahMQ==", + "dev": true + }, "node_modules/socket.io": { "version": "4.7.2", "resolved": "https://registry.npmjs.org/socket.io/-/socket.io-4.7.2.tgz", @@ -9333,9 +9296,7 @@ "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", "integrity": "sha512-ZZKSmDAEFOijERBLkmYfJ+vmk3w+7hOLYDNkRCuRuMJGEmqYNCNLyBBFwWKVMhfwaEF3WOd0Zlw86U/WC/+nYw==", "dev": true, - "engines": [ - "node >=0.6.0" - ], + "engines": ["node >=0.6.0"], "dependencies": { "assert-plus": "^1.0.0", "core-util-is": "1.0.2", diff --git a/package.json b/package.json index 2e473b7..108d34c 100644 --- a/package.json +++ b/package.json @@ -37,6 +37,7 @@ "@rollup/plugin-babel": "^6.0.3", "@rollup/plugin-commonjs": "^24.0.0", "@rollup/plugin-node-resolve": "^15.0.1", + "@rollup/plugin-terser": "^0.4.4", "chai": "^4.3.4", "copyfiles": "^2.4.1", "coveralls": "^3.1.0", @@ -61,7 +62,6 @@ "react-dom": "^18.0.0", "request": "^2.88.2", "rollup": "^2.42.1", - "rollup-plugin-terser": "^7.0.2", "sinon": "^17.0.0", "typescript": "^5.0.2" }, diff --git a/packages/linkifyjs/rollup.config.js b/packages/linkifyjs/rollup.config.js index 9ff7ea2..be57a97 100644 --- a/packages/linkifyjs/rollup.config.js +++ b/packages/linkifyjs/rollup.config.js @@ -1,4 +1,4 @@ -import { terser } from 'rollup-plugin-terser'; +import terser from '@rollup/plugin-terser'; import { plugins } from '../../rollup.config'; export default [ @@ -8,8 +8,8 @@ export default [ { file: 'dist/linkify.js', name: 'linkify', format: 'iife' }, { file: 'dist/linkify.min.js', name: 'linkify', format: 'iife', plugins: [terser()] }, { file: 'dist/linkify.cjs.js', format: 'cjs', exports: 'auto' }, - { file: 'dist/linkify.es.js', format: 'es' } + { file: 'dist/linkify.es.js', format: 'es' }, ], - plugins - } + plugins, + }, ]; diff --git a/rollup.config.js b/rollup.config.js index 3c7a5a2..3efdf44 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -1,22 +1,24 @@ -import { terser } from 'rollup-plugin-terser'; +import terser from '@rollup/plugin-terser'; import resolve from '@rollup/plugin-node-resolve'; import commonjs from '@rollup/plugin-commonjs'; import babel from '@rollup/plugin-babel'; -export const plugins = [ - resolve(), - commonjs(), - babel({ babelHelpers: 'bundled' }) -]; +export const plugins = [resolve(), commonjs(), babel({ babelHelpers: 'bundled' })]; // For interfaces in their dedicated packages export function linkifyInterface(name, opts = {}) { const iifeOpts = { name }; const globals = { linkifyjs: 'linkify' }; const external = ['linkifyjs']; - if ('globalName' in opts) { iifeOpts.name = opts.globalName; } - if ('globals' in opts) { Object.assign(globals, opts.globals); } - if ('external' in opts) { external.push(...opts.external); } + if ('globalName' in opts) { + iifeOpts.name = opts.globalName; + } + if ('globals' in opts) { + Object.assign(globals, opts.globals); + } + if ('external' in opts) { + external.push(...opts.external); + } return { input: `src/linkify-${name}.js`, @@ -27,7 +29,7 @@ export function linkifyInterface(name, opts = {}) { { file: `dist/linkify-${name}.cjs.js`, format: 'cjs', exports: 'auto' }, { file: `dist/linkify-${name}.es.js`, format: 'es' }, ], - plugins + plugins, }; } @@ -36,16 +38,16 @@ export function linkifyInterface(name, opts = {}) { // v2. Will change in v4 export function linkifyPlugin(plugin, opts = {}) { const name = opts.globalName || false; // Most plugins don't export anything - const globals = { linkifyjs: 'linkify' }; + const globals = { linkifyjs: 'linkify' }; return { input: 'src/index.js', external: ['linkifyjs'], output: [ { file: `dist/linkify-plugin-${plugin}.js`, format: 'iife', globals, name }, { file: `dist/linkify-plugin-${plugin}.min.js`, format: 'iife', globals, name, plugins: [terser()] }, - { file: `dist/linkify-plugin-${plugin}.cjs.js`, format: 'cjs', exports: 'auto'}, - { file: `dist/linkify-plugin-${plugin}.es.js`, format: 'es' } + { file: `dist/linkify-plugin-${plugin}.cjs.js`, format: 'cjs', exports: 'auto' }, + { file: `dist/linkify-plugin-${plugin}.es.js`, format: 'es' }, ], - plugins + plugins, }; }