diff --git a/.changeset/chilly-fireants-reflect.md b/.changeset/chilly-fireants-reflect.md new file mode 100644 index 00000000..7b442f1f --- /dev/null +++ b/.changeset/chilly-fireants-reflect.md @@ -0,0 +1,5 @@ +--- +'@bnb-chain/reed-solomon': patch +--- + +chore: Update Rollup Config - terser diff --git a/package.json b/package.json index 3f9b09d3..a0175a7d 100644 --- a/package.json +++ b/package.json @@ -47,7 +47,6 @@ "rimraf": "^3.0.2", "rollup": "^2.79.1", "rollup-plugin-auto-external": "^2.0.0", - "rollup-plugin-polyfill-node": "^0.10.2", - "rollup-plugin-terser": "^7.0.2" + "rollup-plugin-polyfill-node": "^0.10.2" } } diff --git a/packages/reed-solomon/examples/node-worker.js b/packages/reed-solomon/examples/node-worker.js index 712a27d7..c46e3d41 100644 --- a/packages/reed-solomon/examples/node-worker.js +++ b/packages/reed-solomon/examples/node-worker.js @@ -9,7 +9,7 @@ const fileBuffer = fs.readFileSync('./README.md'); const rs = new NodeAdapterReedSolomon(); console.time('cost worker_threads'); - console.log('file size', sourceData.length / 1024 / 1024, 'm'); + console.log('file size', fileBuffer.length / 1024 / 1024, 'm'); const res = await rs.encodeInWorker(__filename, Uint8Array.from(fileBuffer)); console.log('res', res); console.timeEnd('cost worker_threads'); diff --git a/packages/reed-solomon/package.json b/packages/reed-solomon/package.json index bc091991..b9d283ce 100644 --- a/packages/reed-solomon/package.json +++ b/packages/reed-solomon/package.json @@ -74,5 +74,8 @@ "dependencies": { "@ethersproject/base64": "^5.7.0", "ethereum-cryptography": "^2.0.0" + }, + "devDependencies": { + "@rollup/plugin-terser": "^0.4.4" } } diff --git a/packages/reed-solomon/rollup.config.js b/packages/reed-solomon/rollup.config.js index d7f4349d..ba6956e3 100644 --- a/packages/reed-solomon/rollup.config.js +++ b/packages/reed-solomon/rollup.config.js @@ -1,5 +1,6 @@ import commonjs from '@rollup/plugin-commonjs'; import resolve from '@rollup/plugin-node-resolve'; +import terser from '@rollup/plugin-terser'; import pkg from './package.json'; // const pathResolve = (p) => path.resolve(__dirname, p); @@ -27,6 +28,7 @@ export default async () => { browser: true, preferBuiltins: false, }), + terser(), ], }, @@ -64,6 +66,7 @@ export default async () => { browser: true, preferBuiltins: false, }), + terser(), ], }, { @@ -80,6 +83,7 @@ export default async () => { browser: true, preferBuiltins: false, }), + terser(), ], }, { @@ -96,6 +100,7 @@ export default async () => { browser: true, preferBuiltins: false, }), + terser(), ], }, ]; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 262555d2..5f558304 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -104,9 +104,6 @@ importers: rollup-plugin-polyfill-node: specifier: ^0.10.2 version: 0.10.2(rollup@2.79.1) - rollup-plugin-terser: - specifier: ^7.0.2 - version: 7.0.2(rollup@2.79.1) doc-site: dependencies: @@ -454,6 +451,10 @@ importers: ethereum-cryptography: specifier: ^2.0.0 version: 2.0.0 + devDependencies: + '@rollup/plugin-terser': + specifier: ^0.4.4 + version: 0.4.4 packages/zk-crypto: devDependencies: @@ -6367,6 +6368,20 @@ packages: rollup: 2.79.1 dev: true + /@rollup/plugin-terser@0.4.4: + resolution: {integrity: sha512-XHeJC5Bgvs8LfukDwWZp7yeqin6ns8RTl2B9avbejt6tZqsqvVoWI7ZTQrcNsfKEDWBTnTxM8nMDkO2IFFbd0A==} + engines: {node: '>=14.0.0'} + peerDependencies: + rollup: ^2.0.0||^3.0.0||^4.0.0 + peerDependenciesMeta: + rollup: + optional: true + dependencies: + serialize-javascript: 6.0.1 + smob: 1.4.1 + terser: 5.24.0 + dev: true + /@rollup/plugin-typescript@11.1.3(rollup@2.79.1)(tslib@2.5.2)(typescript@4.9.5): resolution: {integrity: sha512-8o6cNgN44kQBcpsUJTbTXMTtb87oR1O0zgP3Dxm71hrNgparap3VujgofEilTYJo+ivf2ke6uy3/E5QEaiRlDA==} engines: {node: '>=14.0.0'} @@ -7369,7 +7384,7 @@ packages: resolution: {integrity: sha512-jGjmu/ZqS7FjSH6owMcD5qpq19+1RS9DeVRqfl1FeBMxTDQAGwlMWOcs52NDoXaNKyG3d1cYQFMs9rCrb88o9Q==} dependencies: '@types/history': 4.7.11 - '@types/react': 18.2.37 + '@types/react': 18.2.41 /@types/react@18.2.12: resolution: {integrity: sha512-ndmBMLCgn38v3SntMeoJaIrO6tGHYKMEBohCUmw8HoLLQdRMOIGXfeYaBTLe2lsFaSB3MOK1VXscYFnmLtTSmw==} @@ -14199,15 +14214,6 @@ packages: string-length: 4.0.2 dev: true - /jest-worker@26.6.2: - resolution: {integrity: sha512-KWYVV1c4i+jbMpaBC+U++4Va0cp8OisU185o73T1vo99hqi7w8tSJfUXYswwqqrjzwxa6KpRK54WhPvwf5w6PQ==} - engines: {node: '>= 10.13.0'} - dependencies: - '@types/node': 18.16.18 - merge-stream: 2.0.0 - supports-color: 7.2.0 - dev: true - /jest-worker@27.5.1: resolution: {integrity: sha512-7vuh85V5cdDofPyxn58nrPjBktZo0u9x1g8WtjQol+jZDaE+fhN+cIvTj11GndBnMnyfrUOG1sZQxCdjKh+DKg==} engines: {node: '>= 10.13.0'} @@ -17955,19 +17961,6 @@ packages: rollup: 2.79.1 dev: true - /rollup-plugin-terser@7.0.2(rollup@2.79.1): - resolution: {integrity: sha512-w3iIaU4OxcF52UUXiZNsNeuXIMDvFrr+ZXK6bFZ0Q60qyVfq4uLptoS4bbq3paG3x216eQllFZX7zt6TIImguQ==} - deprecated: This package has been deprecated and is no longer maintained. Please use @rollup/plugin-terser - peerDependencies: - rollup: ^2.0.0 - dependencies: - '@babel/code-frame': 7.22.13 - jest-worker: 26.6.2 - rollup: 2.79.1 - serialize-javascript: 4.0.0 - terser: 5.19.2 - dev: true - /rollup@2.79.1: resolution: {integrity: sha512-uKxbd0IhMZOhjAiD5oAFp7BqvkA4Dv47qpOCtaNvng4HBwdbWtdOh8f5nZNuk2rp51PMGk3bzfWu5oayNEuYnw==} engines: {node: '>=10.0.0'} @@ -18182,12 +18175,6 @@ packages: - supports-color dev: false - /serialize-javascript@4.0.0: - resolution: {integrity: sha512-GaNA54380uFefWghODBWEGisLZFj00nS5ACs6yHa9nLqlLpVLO8ChDGeKRjZnV4Nh4n0Qi7nhYZD/9fCPzEqkw==} - dependencies: - randombytes: 2.1.0 - dev: true - /serialize-javascript@6.0.0: resolution: {integrity: sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag==} dependencies: @@ -18457,6 +18444,10 @@ packages: yargs: 15.4.1 dev: true + /smob@1.4.1: + resolution: {integrity: sha512-9LK+E7Hv5R9u4g4C3p+jjLstaLe11MDsL21UpYaCNmapvMkYhqCV4A/f/3gyH8QjMyh6l68q9xC85vihY9ahMQ==} + dev: true + /sockjs@0.3.24: resolution: {integrity: sha512-GJgLTZ7vYb/JtPSSZ10hsOYIvEYsjbNU+zPdIHcUaWVNUEPivzxku31865sSSud0Da0W4lEeOPlmw93zLQchuQ==} dependencies: @@ -19081,7 +19072,6 @@ packages: acorn: 8.11.2 commander: 2.20.3 source-map-support: 0.5.21 - dev: false /test-exclude@6.0.0: resolution: {integrity: sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==}