From 3b760d4bb7921bb96abf1f5ada4e83a890b87ead Mon Sep 17 00:00:00 2001 From: Jefferson Rylee Date: Mon, 21 Apr 2025 19:57:15 +0800 Subject: [PATCH 01/26] Update documentation --- README.md | 8 ++++---- src/types/core.types.ts | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 4cd19ad..98ae80d 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ A Rollup plugin that displays output bundle sizes. -> This project was inspired by [rollup-plugin-bundle-size](https://github.com/vimeo/rollup-plugin-bundle-size). +> This project was inspired by [rollup-plugin-bundle-size](https://www.npmjs.com/package/rollup-plugin-bundle-size). ![rollup-plugin-output-size example output][preview-img] @@ -65,9 +65,9 @@ Set to `true` to disable output for all output types, or set an array to specify Output types are: `asset`, `chunk`, and `entry`. -> Note: Both `chunk` and `entry` output types are `OutputChunk`s but `entry` chunks have `isEntry` values of `true`. +Both `chunk` and `entry` output types are `OutputChunk`s but `entry` chunks have `isEntry` values of `true`. -This option does not affect [`summary`](#summary) output. +This option does not affect the [`summary`](#summary) output. ### gzip @@ -90,7 +90,7 @@ Disables output. This will also skip the [`handle`](#handle) and [`summary`](#su Type: `boolean | 'always' | SummaryCallback`
Default: `true` -Displays summary output. +Displays the summary output. - Set to `false` to disable summary output. - Set to `'always'` to force summary output even if there is only one (1) output. diff --git a/src/types/core.types.ts b/src/types/core.types.ts index 7307f06..3b9d785 100644 --- a/src/types/core.types.ts +++ b/src/types/core.types.ts @@ -17,7 +17,7 @@ export interface Options { * Set to `true` to disable output for output types, or set * an array to specify which output types will not be displayed. * - * This option does not affect {@linkcode summary} output. + * This option does not affect the {@linkcode summary} output. * @default false */ hide?: boolean | OutputType[]; @@ -36,7 +36,7 @@ export interface Options { */ silent?: boolean; /** - * Displays summary output. + * Displays the summary output. * - Set to `false` to disable summary output. * - Set to `'always'` to force summary output even if there is only one (1) output. * - Set a callback to override default summary output. From 9791d6827f997161b935d0244451f84970b1ffa7 Mon Sep 17 00:00:00 2001 From: Jefferson Rylee Date: Tue, 22 Apr 2025 22:31:51 +0800 Subject: [PATCH 02/26] Add `--configImportAttributesKey` flag to rollup bundle script --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 6d9fa8e..846e626 100644 --- a/package.json +++ b/package.json @@ -41,7 +41,7 @@ "all": "concurrently -r --kill-others-on-fail", "build": "npm run all -- npm:bundle npm:check", "prebundle": "rimraf lib", - "bundle": "rollup -c rollup.config.ts --configPlugin \"esbuild={target:'esnext'}\"", + "bundle": "rollup -c rollup.config.ts --configPlugin \"esbuild={target:'esnext'}\" --configImportAttributesKey with", "check": "npm run all -- \"npm:lint -- --max-warnings 0\" tsc", "format": "npm run lint -- --fix && prettier -cw .", "lint": "eslint .", From 038854c4fcedff4e9b1dedb4a5de62d31f14e142 Mon Sep 17 00:00:00 2001 From: Jefferson Rylee Date: Tue, 22 Apr 2025 22:32:06 +0800 Subject: [PATCH 03/26] Update versions in workflow configs --- .github/workflows/node.js.yml | 2 +- .github/workflows/npm-publish.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 2a6f25b..2d4499d 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -15,7 +15,7 @@ jobs: strategy: matrix: - node-version: [18.x, 20.x] + node-version: [18.x, 20.x, 22.x] # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ steps: diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml index 0a6f8a1..738fbc1 100644 --- a/.github/workflows/npm-publish.yml +++ b/.github/workflows/npm-publish.yml @@ -14,7 +14,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: - node-version: 20 + node-version: 22 registry-url: https://registry.npmjs.org/ - run: npm ci - run: npm run build From 5d91b5194cfe812842b8bd5ff66e01342ca95e32 Mon Sep 17 00:00:00 2001 From: Jefferson Rylee Date: Wed, 7 May 2025 19:03:31 +0800 Subject: [PATCH 04/26] Remove `strip-ansi` dev dependency, use `util.stripVTControlCharacters` instead --- package-lock.json | 1 - package.json | 1 - test/format.spec.ts | 10 +++++----- test/summarize.spec.ts | 10 +++++----- 4 files changed, 10 insertions(+), 12 deletions(-) diff --git a/package-lock.json b/package-lock.json index 4265b83..5f9303d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -37,7 +37,6 @@ "rollup-plugin-esbuild": "^6.2.1", "rollup-plugin-node-externals": "^8.0.0", "sinon": "^20.0.0", - "strip-ansi": "^7.1.0", "tsx": "^4.19.3", "typescript": "^5.8.3", "typescript-eslint": "^8.30.1" diff --git a/package.json b/package.json index 846e626..ec93313 100644 --- a/package.json +++ b/package.json @@ -78,7 +78,6 @@ "rollup-plugin-esbuild": "^6.2.1", "rollup-plugin-node-externals": "^8.0.0", "sinon": "^20.0.0", - "strip-ansi": "^7.1.0", "tsx": "^4.19.3", "typescript": "^5.8.3", "typescript-eslint": "^8.30.1" diff --git a/test/format.spec.ts b/test/format.spec.ts index de1221c..f514659 100644 --- a/test/format.spec.ts +++ b/test/format.spec.ts @@ -1,6 +1,6 @@ import { expect } from 'chai'; import prettyBytes from 'pretty-bytes'; -import stripAnsi from 'strip-ansi'; +import util from 'util'; import { format, OutputInfo } from '../src'; describe('format', () => { @@ -18,7 +18,7 @@ describe('format', () => { }; const formatted = format(info); expect(formatted).to.be.a('string'); - const raw = stripAnsi(formatted); + const raw = util.stripVTControlCharacters(formatted); expect(raw).to.equal('[chunk] out/test/chunk.js is 30 B → 20 B (gzip)'); }); @@ -29,7 +29,7 @@ describe('format', () => { size: 100, hSize: '100 B' }; - const raw = stripAnsi(format(info)); + const raw = util.stripVTControlCharacters(format(info)); expect(raw).to.equal('[asset] out/test/asset.js.map is 100 B'); }); @@ -41,7 +41,7 @@ describe('format', () => { size, hSize: prettyBytes(size) }; - let raw = stripAnsi(format(info, { bytes: true })); + let raw = util.stripVTControlCharacters(format(info, { bytes: true })); expect(raw).to.equal('[entry] out/test/entry.js is 0 B'); size = 1234567890; @@ -51,7 +51,7 @@ describe('format', () => { size, hSize: prettyBytes(size) }; - raw = stripAnsi(format(info, { bytes: true })); + raw = util.stripVTControlCharacters(format(info, { bytes: true })); expect(raw).to.equal('[entry] out/test/entry.js is 1,234,567,890 B'); }); }); diff --git a/test/summarize.spec.ts b/test/summarize.spec.ts index ad299ae..f3f9f22 100644 --- a/test/summarize.spec.ts +++ b/test/summarize.spec.ts @@ -1,6 +1,6 @@ import { expect } from 'chai'; import prettyBytes from 'pretty-bytes'; -import stripAnsi from 'strip-ansi'; +import util from 'util'; import { Size, summarize, Summary, SummarySizes } from '../src'; function size(size: number): Size { @@ -21,7 +21,7 @@ describe('summarize', () => { const summary: Summary = { ...sizes, gzip: sizes }; const formatted = summarize(summary); expect(formatted).to.be.a('string'); - const raw = stripAnsi(formatted); + const raw = util.stripVTControlCharacters(formatted); const text = '[total] 40 B + 30 B + 20 B = 90 B'; expect(raw).to.equal(`${text}\n${text} (gzip)`); }); @@ -30,7 +30,7 @@ describe('summarize', () => { const summary: Summary = getSizes(); const formatted = summarize(summary); expect(formatted).to.be.a('string'); - const raw = stripAnsi(formatted); + const raw = util.stripVTControlCharacters(formatted); expect(raw).to.equal('[total] 40 B + 30 B + 20 B = 90 B'); }); @@ -39,7 +39,7 @@ describe('summarize', () => { const summary: Summary = { ...sizes, gzip: sizes }; const formatted = summarize(summary); expect(formatted).to.be.a('string'); - const raw = stripAnsi(formatted); + const raw = util.stripVTControlCharacters(formatted); expect(raw).to.equal('[total] 90 B\n[total] 90 B (gzip)'); }); @@ -52,7 +52,7 @@ describe('summarize', () => { }; const formatted = summarize(summary, { bytes: true }); expect(formatted).to.be.a('string'); - const raw = stripAnsi(formatted); + const raw = util.stripVTControlCharacters(formatted); expect(raw).to.equal('[total] 4,000 B + 3,000 B + 2,000 B = 9,000 B'); }); }); From 06ad0d0f28ca794a26b3f924337bed644fcc6a9a Mon Sep 17 00:00:00 2001 From: Jefferson Rylee Date: Wed, 7 May 2025 19:07:37 +0800 Subject: [PATCH 05/26] Update README - Replace `
` tags with backslashes - Move reference-style links --- README.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 98ae80d..bf99748 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,14 @@ +# rollup-plugin-output-size + +[![npm][npm-img]][npm-url] +[![Node.js CI][ci-img]][ci-url] + [npm-img]: https://img.shields.io/npm/v/rollup-plugin-output-size.svg [npm-url]: https://www.npmjs.com/package/rollup-plugin-output-size [ci-img]: https://github.com/Arnesfield/rollup-plugin-output-size/workflows/Node.js%20CI/badge.svg [ci-url]: https://github.com/Arnesfield/rollup-plugin-output-size/actions?query=workflow%3A"Node.js+CI" [preview-img]: https://gist.githubusercontent.com/Arnesfield/0f85b2ddfa1109aec6ed2ec46ee42b03/raw/7cc3b49fc8496cc71db41a0f273871636520a611/preview.png -# rollup-plugin-output-size - -[![npm][npm-img]][npm-url] -[![Node.js CI][ci-img]][ci-url] - A Rollup plugin that displays output bundle sizes. > This project was inspired by [rollup-plugin-bundle-size](https://www.npmjs.com/package/rollup-plugin-bundle-size). @@ -49,14 +49,14 @@ You can change and override the behavior of this plugin through its options. Not ### bytes -Type: `boolean`
+Type: `boolean`\ Default: `false` Displays the size in bytes for both the output info and [`summary`](#summary) output (e.g. `4,096 B` instead of `4.1 kB`). ### hide -Type: `boolean | OutputType[]`
+Type: `boolean | OutputType[]`\ Default: `false` Disables output types display. @@ -71,7 +71,7 @@ This option does not affect the [`summary`](#summary) output. ### gzip -Type: `boolean | OutputType[]`
+Type: `boolean | OutputType[]`\ Default: `true` Gets gzipped sizes of output. @@ -80,14 +80,14 @@ Set to `false` to skip getting gzipped size, or set an array to only get gzipped ### silent -Type: `boolean`
+Type: `boolean`\ Default: `false` Disables output. This will also skip the [`handle`](#handle) and [`summary`](#summary) callbacks. ### summary -Type: `boolean | 'always' | SummaryCallback`
+Type: `boolean | 'always' | SummaryCallback`\ Default: `true` Displays the summary output. From ad96be5e7b41bb7f7fa70f36134fcaa0dda6f1f1 Mon Sep 17 00:00:00 2001 From: Jefferson Rylee Date: Wed, 7 May 2025 22:06:20 +0800 Subject: [PATCH 06/26] Update imports for `gzip` util --- src/utils/gzip.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/utils/gzip.ts b/src/utils/gzip.ts index 94b5a1f..d1b67db 100644 --- a/src/utils/gzip.ts +++ b/src/utils/gzip.ts @@ -1,9 +1,9 @@ import prettyBytes from 'pretty-bytes'; -import { promisify } from 'util'; -import { gzip as __gzip } from 'zlib'; +import util from 'util'; +import zlib from 'zlib'; import { Size } from '../types/size.types'; -const _gzip = promisify(__gzip); +const _gzip = util.promisify(zlib.gzip); /** * Gets the gzipped size of input. From 0237f9eab47e94d4839a094c03a7cab4d01a4f05 Mon Sep 17 00:00:00 2001 From: Jefferson Rylee Date: Wed, 7 May 2025 22:04:33 +0800 Subject: [PATCH 07/26] Bundle ESM externals into the CJS build - Update rollup config for CJS build changes - Remove `@rollup/plugin-commonjs` dev dependency --- package-lock.json | 58 ----------------------------------------------- package.json | 1 - rollup.config.ts | 17 +++++++------- 3 files changed, 9 insertions(+), 67 deletions(-) diff --git a/package-lock.json b/package-lock.json index 5f9303d..2080fef 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,7 +14,6 @@ }, "devDependencies": { "@eslint/js": "^9.25.0", - "@rollup/plugin-commonjs": "^28.0.3", "@rollup/plugin-eslint": "^9.0.5", "@rollup/plugin-node-resolve": "^16.0.1", "@rollup/plugin-typescript": "^12.1.2", @@ -843,33 +842,6 @@ "node": ">=14" } }, - "node_modules/@rollup/plugin-commonjs": { - "version": "28.0.3", - "resolved": "https://registry.npmjs.org/@rollup/plugin-commonjs/-/plugin-commonjs-28.0.3.tgz", - "integrity": "sha512-pyltgilam1QPdn+Zd9gaCfOLcnjMEJ9gV+bTw6/r73INdvzf1ah9zLIJBm+kW7R6IUFIQ1YO+VqZtYxZNWFPEQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@rollup/pluginutils": "^5.0.1", - "commondir": "^1.0.1", - "estree-walker": "^2.0.2", - "fdir": "^6.2.0", - "is-reference": "1.2.1", - "magic-string": "^0.30.3", - "picomatch": "^4.0.2" - }, - "engines": { - "node": ">=16.0.0 || 14 >= 14.17" - }, - "peerDependencies": { - "rollup": "^2.68.0||^3.0.0||^4.0.0" - }, - "peerDependenciesMeta": { - "rollup": { - "optional": true - } - } - }, "node_modules/@rollup/plugin-eslint": { "version": "9.0.5", "resolved": "https://registry.npmjs.org/@rollup/plugin-eslint/-/plugin-eslint-9.0.5.tgz", @@ -1937,12 +1909,6 @@ "resolved": "https://registry.npmjs.org/colorette/-/colorette-2.0.20.tgz", "integrity": "sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==" }, - "node_modules/commondir": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", - "integrity": "sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==", - "dev": true - }, "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", @@ -2394,21 +2360,6 @@ "reusify": "^1.0.4" } }, - "node_modules/fdir": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.3.0.tgz", - "integrity": "sha512-QOnuT+BOtivR77wYvCWHfGt9s4Pz1VIMbD463vegT5MLqNXy8rYFT/lPVEqf/bhYeT6qmqrNHhsX+rWwe3rOCQ==", - "dev": true, - "license": "MIT", - "peerDependencies": { - "picomatch": "^3 || ^4" - }, - "peerDependenciesMeta": { - "picomatch": { - "optional": true - } - } - }, "node_modules/file-entry-cache": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-8.0.0.tgz", @@ -2772,15 +2723,6 @@ "node": ">=8" } }, - "node_modules/is-reference": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/is-reference/-/is-reference-1.2.1.tgz", - "integrity": "sha512-U82MsXXiFIrjCK4otLT+o2NA2Cd2g5MLoOVXUZjIOhLurrRxpEXzI8O0KZHr3IjLvlAH1kTPYSuqer5T9ZVBKQ==", - "dev": true, - "dependencies": { - "@types/estree": "*" - } - }, "node_modules/is-unicode-supported": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", diff --git a/package.json b/package.json index ec93313..8d7033a 100644 --- a/package.json +++ b/package.json @@ -55,7 +55,6 @@ }, "devDependencies": { "@eslint/js": "^9.25.0", - "@rollup/plugin-commonjs": "^28.0.3", "@rollup/plugin-eslint": "^9.0.5", "@rollup/plugin-node-resolve": "^16.0.1", "@rollup/plugin-typescript": "^12.1.2", diff --git a/rollup.config.ts b/rollup.config.ts index 65449cb..6b2ad7b 100644 --- a/rollup.config.ts +++ b/rollup.config.ts @@ -1,4 +1,3 @@ -import commonjs from '@rollup/plugin-commonjs'; import eslint from '@rollup/plugin-eslint'; import nodeResolve from '@rollup/plugin-node-resolve'; import typescript from '@rollup/plugin-typescript'; @@ -10,14 +9,16 @@ import nodeExternals from 'rollup-plugin-node-externals'; import pkg from './package.json' with { type: 'json' }; import outputSize from './src'; -const WATCH = process.env.ROLLUP_WATCH === 'true'; -const input = 'src/index.ts'; -// esm dependencies to bundle into vendor.cjs -const esmExternals = ['pretty-bytes']; // disable sourcemaps (enable only for preview) const preview = false; const bytes = true; +const WATCH = process.env.ROLLUP_WATCH === 'true'; +const input = 'src/index.ts'; + +// esm dependencies to be bundled into the cjs build +const esmExternals = ['pretty-bytes']; + function build() { return esbuild({ target: 'esnext' }); } @@ -52,15 +53,15 @@ export default defineConfig([ sourcemap: preview, entryFileNames: '[name].cjs', chunkFileNames: '[name].cjs', - manualChunks: { vendor: esmExternals } + // for preview mode, create a separate chunk for esm externals + manualChunks: preview ? { vendor: esmExternals } : undefined }, plugins: [ build(), clean(), - commonjs(), nodeResolve(), // exclude esm dependencies from external - // since they will be bundled into vendor.cjs + // since they will be bundled into the cjs build nodeExternals({ exclude: esmExternals }), size() ] From 11a6a9b90f2bf7606db5e2df1f862b855d36d536 Mon Sep 17 00:00:00 2001 From: Jefferson Rylee Date: Wed, 7 May 2025 22:24:09 +0800 Subject: [PATCH 08/26] Update dependencies - Skip `mocha` upgrade since the watch mode doesn't work properly --- package-lock.json | 438 ++++++++++++++++++++++++++-------------------- package.json | 18 +- 2 files changed, 258 insertions(+), 198 deletions(-) diff --git a/package-lock.json b/package-lock.json index 2080fef..13c5f05 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,35 +10,35 @@ "license": "MIT", "dependencies": { "colorette": "^2.0.20", - "pretty-bytes": "^6.1.1" + "pretty-bytes": "^7.0.0" }, "devDependencies": { - "@eslint/js": "^9.25.0", + "@eslint/js": "^9.27.0", "@rollup/plugin-eslint": "^9.0.5", "@rollup/plugin-node-resolve": "^16.0.1", "@rollup/plugin-typescript": "^12.1.2", - "@types/chai": "^5.2.1", + "@types/chai": "^5.2.2", "@types/mocha": "^10.0.10", - "@types/node": "^22.14.1", + "@types/node": "^22.15.27", "@types/rimraf": "^4.0.5", "@types/sinon": "^17.0.4", "chai": "^5.2.0", "concurrently": "^9.1.2", - "eslint": "^9.25.0", + "eslint": "^9.27.0", "eslint-plugin-chai-friendly": "^1.0.1", - "globals": "^16.0.0", + "globals": "^16.2.0", "mocha": "^11.1.0", "prettier": "^3.5.3", "rimraf": "^6.0.1", - "rollup": "^4.40.0", + "rollup": "^4.41.1", "rollup-plugin-cleanup": "^3.2.1", "rollup-plugin-dts": "^6.2.1", "rollup-plugin-esbuild": "^6.2.1", "rollup-plugin-node-externals": "^8.0.0", "sinon": "^20.0.0", - "tsx": "^4.19.3", + "tsx": "^4.19.4", "typescript": "^5.8.3", - "typescript-eslint": "^8.30.1" + "typescript-eslint": "^8.33.0" }, "engines": { "node": ">=14.16.0" @@ -514,16 +514,20 @@ } }, "node_modules/@eslint-community/eslint-utils": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", - "integrity": "sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==", + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.7.0.tgz", + "integrity": "sha512-dyybb3AcajC7uha6CvhdVRJqaKyn7w2YKqKyAN37NKYgZT36w+iRb0Dymmc5qEJ549c/S31cMMSFd75bteCpCw==", "dev": true, + "license": "MIT", "dependencies": { - "eslint-visitor-keys": "^3.3.0" + "eslint-visitor-keys": "^3.4.3" }, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, + "funding": { + "url": "https://opencollective.com/eslint" + }, "peerDependencies": { "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" } @@ -564,9 +568,9 @@ } }, "node_modules/@eslint/core": { - "version": "0.13.0", - "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.13.0.tgz", - "integrity": "sha512-yfkgDw1KR66rkT5A8ci4irzDysN7FRpq3ttJolR88OqQikAWqwA8j5VZyas+vjyBNFIJ7MfybJ9plMILI2UrCw==", + "version": "0.14.0", + "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.14.0.tgz", + "integrity": "sha512-qIbV0/JZr7iSDjqAc60IqbLdsj9GDt16xQtWD+B78d/HAlvysGdZZ6rpJHGAc2T0FQx1X6thsSPdnoiGKdNtdg==", "dev": true, "license": "Apache-2.0", "dependencies": { @@ -614,13 +618,16 @@ } }, "node_modules/@eslint/js": { - "version": "9.25.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.25.0.tgz", - "integrity": "sha512-iWhsUS8Wgxz9AXNfvfOPFSW4VfMXdVhp1hjkZVhXCrpgh/aLcc45rX6MPu+tIVUWDw0HfNwth7O28M1xDxNf9w==", + "version": "9.27.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.27.0.tgz", + "integrity": "sha512-G5JD9Tu5HJEu4z2Uo4aHY2sLV64B7CDMXxFzqzjl3NKd6RVzSXNoE80jk7Y0lJkTTkjiIhBAqmlYwjuBY3tvpA==", "dev": true, "license": "MIT", "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://eslint.org/donate" } }, "node_modules/@eslint/object-schema": { @@ -634,13 +641,13 @@ } }, "node_modules/@eslint/plugin-kit": { - "version": "0.2.8", - "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.2.8.tgz", - "integrity": "sha512-ZAoA40rNMPwSm+AeHpCq8STiNAwzWLJuP8Xv4CHIc9wv/PSuExjMrmjfYNj682vW0OOiZ1HKxzvjQr9XZIisQA==", + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.3.1.tgz", + "integrity": "sha512-0J+zgWxHN+xXONWIyPWKFMgVuJoZuGiIFu8yxk7RJjxkzpGmyja5wRFqZIVtjDVOQpV+Rw0iOAjYPE2eQyjr0w==", "dev": true, "license": "Apache-2.0", "dependencies": { - "@eslint/core": "^0.13.0", + "@eslint/core": "^0.14.0", "levn": "^0.4.1" }, "engines": { @@ -951,9 +958,9 @@ } }, "node_modules/@rollup/rollup-android-arm-eabi": { - "version": "4.40.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.40.0.tgz", - "integrity": "sha512-+Fbls/diZ0RDerhE8kyC6hjADCXA1K4yVNlH0EYfd2XjyH0UGgzaQ8MlT0pCXAThfxv3QUAczHaL+qSv1E4/Cg==", + "version": "4.41.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.41.1.tgz", + "integrity": "sha512-NELNvyEWZ6R9QMkiytB4/L4zSEaBC03KIXEghptLGLZWJ6VPrL63ooZQCOnlx36aQPGhzuOMwDerC1Eb2VmrLw==", "cpu": [ "arm" ], @@ -965,9 +972,9 @@ ] }, "node_modules/@rollup/rollup-android-arm64": { - "version": "4.40.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.40.0.tgz", - "integrity": "sha512-PPA6aEEsTPRz+/4xxAmaoWDqh67N7wFbgFUJGMnanCFs0TV99M0M8QhhaSCks+n6EbQoFvLQgYOGXxlMGQe/6w==", + "version": "4.41.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.41.1.tgz", + "integrity": "sha512-DXdQe1BJ6TK47ukAoZLehRHhfKnKg9BjnQYUu9gzhI8Mwa1d2fzxA1aw2JixHVl403bwp1+/o/NhhHtxWJBgEA==", "cpu": [ "arm64" ], @@ -979,9 +986,9 @@ ] }, "node_modules/@rollup/rollup-darwin-arm64": { - "version": "4.40.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.40.0.tgz", - "integrity": "sha512-GwYOcOakYHdfnjjKwqpTGgn5a6cUX7+Ra2HeNj/GdXvO2VJOOXCiYYlRFU4CubFM67EhbmzLOmACKEfvp3J1kQ==", + "version": "4.41.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.41.1.tgz", + "integrity": "sha512-5afxvwszzdulsU2w8JKWwY8/sJOLPzf0e1bFuvcW5h9zsEg+RQAojdW0ux2zyYAz7R8HvvzKCjLNJhVq965U7w==", "cpu": [ "arm64" ], @@ -993,9 +1000,9 @@ ] }, "node_modules/@rollup/rollup-darwin-x64": { - "version": "4.40.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.40.0.tgz", - "integrity": "sha512-CoLEGJ+2eheqD9KBSxmma6ld01czS52Iw0e2qMZNpPDlf7Z9mj8xmMemxEucinev4LgHalDPczMyxzbq+Q+EtA==", + "version": "4.41.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.41.1.tgz", + "integrity": "sha512-egpJACny8QOdHNNMZKf8xY0Is6gIMz+tuqXlusxquWu3F833DcMwmGM7WlvCO9sB3OsPjdC4U0wHw5FabzCGZg==", "cpu": [ "x64" ], @@ -1007,9 +1014,9 @@ ] }, "node_modules/@rollup/rollup-freebsd-arm64": { - "version": "4.40.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.40.0.tgz", - "integrity": "sha512-r7yGiS4HN/kibvESzmrOB/PxKMhPTlz+FcGvoUIKYoTyGd5toHp48g1uZy1o1xQvybwwpqpe010JrcGG2s5nkg==", + "version": "4.41.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.41.1.tgz", + "integrity": "sha512-DBVMZH5vbjgRk3r0OzgjS38z+atlupJ7xfKIDJdZZL6sM6wjfDNo64aowcLPKIx7LMQi8vybB56uh1Ftck/Atg==", "cpu": [ "arm64" ], @@ -1021,9 +1028,9 @@ ] }, "node_modules/@rollup/rollup-freebsd-x64": { - "version": "4.40.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.40.0.tgz", - "integrity": "sha512-mVDxzlf0oLzV3oZOr0SMJ0lSDd3xC4CmnWJ8Val8isp9jRGl5Dq//LLDSPFrasS7pSm6m5xAcKaw3sHXhBjoRw==", + "version": "4.41.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.41.1.tgz", + "integrity": "sha512-3FkydeohozEskBxNWEIbPfOE0aqQgB6ttTkJ159uWOFn42VLyfAiyD9UK5mhu+ItWzft60DycIN1Xdgiy8o/SA==", "cpu": [ "x64" ], @@ -1035,9 +1042,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm-gnueabihf": { - "version": "4.40.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.40.0.tgz", - "integrity": "sha512-y/qUMOpJxBMy8xCXD++jeu8t7kzjlOCkoxxajL58G62PJGBZVl/Gwpm7JK9+YvlB701rcQTzjUZ1JgUoPTnoQA==", + "version": "4.41.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.41.1.tgz", + "integrity": "sha512-wC53ZNDgt0pqx5xCAgNunkTzFE8GTgdZ9EwYGVcg+jEjJdZGtq9xPjDnFgfFozQI/Xm1mh+D9YlYtl+ueswNEg==", "cpu": [ "arm" ], @@ -1049,9 +1056,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm-musleabihf": { - "version": "4.40.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.40.0.tgz", - "integrity": "sha512-GoCsPibtVdJFPv/BOIvBKO/XmwZLwaNWdyD8TKlXuqp0veo2sHE+A/vpMQ5iSArRUz/uaoj4h5S6Pn0+PdhRjg==", + "version": "4.41.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.41.1.tgz", + "integrity": "sha512-jwKCca1gbZkZLhLRtsrka5N8sFAaxrGz/7wRJ8Wwvq3jug7toO21vWlViihG85ei7uJTpzbXZRcORotE+xyrLA==", "cpu": [ "arm" ], @@ -1063,9 +1070,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-gnu": { - "version": "4.40.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.40.0.tgz", - "integrity": "sha512-L5ZLphTjjAD9leJzSLI7rr8fNqJMlGDKlazW2tX4IUF9P7R5TMQPElpH82Q7eNIDQnQlAyiNVfRPfP2vM5Avvg==", + "version": "4.41.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.41.1.tgz", + "integrity": "sha512-g0UBcNknsmmNQ8V2d/zD2P7WWfJKU0F1nu0k5pW4rvdb+BIqMm8ToluW/eeRmxCared5dD76lS04uL4UaNgpNA==", "cpu": [ "arm64" ], @@ -1077,9 +1084,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-musl": { - "version": "4.40.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.40.0.tgz", - "integrity": "sha512-ATZvCRGCDtv1Y4gpDIXsS+wfFeFuLwVxyUBSLawjgXK2tRE6fnsQEkE4csQQYWlBlsFztRzCnBvWVfcae/1qxQ==", + "version": "4.41.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.41.1.tgz", + "integrity": "sha512-XZpeGB5TKEZWzIrj7sXr+BEaSgo/ma/kCgrZgL0oo5qdB1JlTzIYQKel/RmhT6vMAvOdM2teYlAaOGJpJ9lahg==", "cpu": [ "arm64" ], @@ -1091,9 +1098,9 @@ ] }, "node_modules/@rollup/rollup-linux-loongarch64-gnu": { - "version": "4.40.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loongarch64-gnu/-/rollup-linux-loongarch64-gnu-4.40.0.tgz", - "integrity": "sha512-wG9e2XtIhd++QugU5MD9i7OnpaVb08ji3P1y/hNbxrQ3sYEelKJOq1UJ5dXczeo6Hj2rfDEL5GdtkMSVLa/AOg==", + "version": "4.41.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loongarch64-gnu/-/rollup-linux-loongarch64-gnu-4.41.1.tgz", + "integrity": "sha512-bkCfDJ4qzWfFRCNt5RVV4DOw6KEgFTUZi2r2RuYhGWC8WhCA8lCAJhDeAmrM/fdiAH54m0mA0Vk2FGRPyzI+tw==", "cpu": [ "loong64" ], @@ -1105,9 +1112,9 @@ ] }, "node_modules/@rollup/rollup-linux-powerpc64le-gnu": { - "version": "4.40.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.40.0.tgz", - "integrity": "sha512-vgXfWmj0f3jAUvC7TZSU/m/cOE558ILWDzS7jBhiCAFpY2WEBn5jqgbqvmzlMjtp8KlLcBlXVD2mkTSEQE6Ixw==", + "version": "4.41.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.41.1.tgz", + "integrity": "sha512-3mr3Xm+gvMX+/8EKogIZSIEF0WUu0HL9di+YWlJpO8CQBnoLAEL/roTCxuLncEdgcfJcvA4UMOf+2dnjl4Ut1A==", "cpu": [ "ppc64" ], @@ -1119,9 +1126,9 @@ ] }, "node_modules/@rollup/rollup-linux-riscv64-gnu": { - "version": "4.40.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.40.0.tgz", - "integrity": "sha512-uJkYTugqtPZBS3Z136arevt/FsKTF/J9dEMTX/cwR7lsAW4bShzI2R0pJVw+hcBTWF4dxVckYh72Hk3/hWNKvA==", + "version": "4.41.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.41.1.tgz", + "integrity": "sha512-3rwCIh6MQ1LGrvKJitQjZFuQnT2wxfU+ivhNBzmxXTXPllewOF7JR1s2vMX/tWtUYFgphygxjqMl76q4aMotGw==", "cpu": [ "riscv64" ], @@ -1133,9 +1140,9 @@ ] }, "node_modules/@rollup/rollup-linux-riscv64-musl": { - "version": "4.40.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.40.0.tgz", - "integrity": "sha512-rKmSj6EXQRnhSkE22+WvrqOqRtk733x3p5sWpZilhmjnkHkpeCgWsFFo0dGnUGeA+OZjRl3+VYq+HyCOEuwcxQ==", + "version": "4.41.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.41.1.tgz", + "integrity": "sha512-LdIUOb3gvfmpkgFZuccNa2uYiqtgZAz3PTzjuM5bH3nvuy9ty6RGc/Q0+HDFrHrizJGVpjnTZ1yS5TNNjFlklw==", "cpu": [ "riscv64" ], @@ -1147,9 +1154,9 @@ ] }, "node_modules/@rollup/rollup-linux-s390x-gnu": { - "version": "4.40.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.40.0.tgz", - "integrity": "sha512-SpnYlAfKPOoVsQqmTFJ0usx0z84bzGOS9anAC0AZ3rdSo3snecihbhFTlJZ8XMwzqAcodjFU4+/SM311dqE5Sw==", + "version": "4.41.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.41.1.tgz", + "integrity": "sha512-oIE6M8WC9ma6xYqjvPhzZYk6NbobIURvP/lEbh7FWplcMO6gn7MM2yHKA1eC/GvYwzNKK/1LYgqzdkZ8YFxR8g==", "cpu": [ "s390x" ], @@ -1161,9 +1168,9 @@ ] }, "node_modules/@rollup/rollup-linux-x64-gnu": { - "version": "4.40.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.40.0.tgz", - "integrity": "sha512-RcDGMtqF9EFN8i2RYN2W+64CdHruJ5rPqrlYw+cgM3uOVPSsnAQps7cpjXe9be/yDp8UC7VLoCoKC8J3Kn2FkQ==", + "version": "4.41.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.41.1.tgz", + "integrity": "sha512-cWBOvayNvA+SyeQMp79BHPK8ws6sHSsYnK5zDcsC3Hsxr1dgTABKjMnMslPq1DvZIp6uO7kIWhiGwaTdR4Og9A==", "cpu": [ "x64" ], @@ -1175,9 +1182,9 @@ ] }, "node_modules/@rollup/rollup-linux-x64-musl": { - "version": "4.40.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.40.0.tgz", - "integrity": "sha512-HZvjpiUmSNx5zFgwtQAV1GaGazT2RWvqeDi0hV+AtC8unqqDSsaFjPxfsO6qPtKRRg25SisACWnJ37Yio8ttaw==", + "version": "4.41.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.41.1.tgz", + "integrity": "sha512-y5CbN44M+pUCdGDlZFzGGBSKCA4A/J2ZH4edTYSSxFg7ce1Xt3GtydbVKWLlzL+INfFIZAEg1ZV6hh9+QQf9YQ==", "cpu": [ "x64" ], @@ -1189,9 +1196,9 @@ ] }, "node_modules/@rollup/rollup-win32-arm64-msvc": { - "version": "4.40.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.40.0.tgz", - "integrity": "sha512-UtZQQI5k/b8d7d3i9AZmA/t+Q4tk3hOC0tMOMSq2GlMYOfxbesxG4mJSeDp0EHs30N9bsfwUvs3zF4v/RzOeTQ==", + "version": "4.41.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.41.1.tgz", + "integrity": "sha512-lZkCxIrjlJlMt1dLO/FbpZbzt6J/A8p4DnqzSa4PWqPEUUUnzXLeki/iyPLfV0BmHItlYgHUqJe+3KiyydmiNQ==", "cpu": [ "arm64" ], @@ -1203,9 +1210,9 @@ ] }, "node_modules/@rollup/rollup-win32-ia32-msvc": { - "version": "4.40.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.40.0.tgz", - "integrity": "sha512-+m03kvI2f5syIqHXCZLPVYplP8pQch9JHyXKZ3AGMKlg8dCyr2PKHjwRLiW53LTrN/Nc3EqHOKxUxzoSPdKddA==", + "version": "4.41.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.41.1.tgz", + "integrity": "sha512-+psFT9+pIh2iuGsxFYYa/LhS5MFKmuivRsx9iPJWNSGbh2XVEjk90fmpUEjCnILPEPJnikAU6SFDiEUyOv90Pg==", "cpu": [ "ia32" ], @@ -1217,9 +1224,9 @@ ] }, "node_modules/@rollup/rollup-win32-x64-msvc": { - "version": "4.40.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.40.0.tgz", - "integrity": "sha512-lpPE1cLfP5oPzVjKMx10pgBmKELQnFJXHgvtHCtuJWOv8MxqdEIMNtgHgBFf7Ea2/7EuVwa9fodWUfXAlXZLZQ==", + "version": "4.41.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.41.1.tgz", + "integrity": "sha512-Wq2zpapRYLfi4aKxf2Xff0tN+7slj2d4R87WEzqw7ZLsVvO5zwYCIuEGSZYiK41+GlwUo1HiR+GdkLEJnCKTCw==", "cpu": [ "x64" ], @@ -1273,9 +1280,9 @@ } }, "node_modules/@types/chai": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/@types/chai/-/chai-5.2.1.tgz", - "integrity": "sha512-iu1JLYmGmITRzUgNiLMZD3WCoFzpYtueuyAgHTXqgwSRAMIlFTnZqG6/xenkpUGRJEzSfklUTI4GNSzks/dc0w==", + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/@types/chai/-/chai-5.2.2.tgz", + "integrity": "sha512-8kB30R7Hwqf40JPiKhVzodJs2Qc1ZJ5zuT3uzw5Hq/dhNCl3G3l83jfpdI1e20BP348+fV7VIL/+FxaXkqBmWg==", "dev": true, "license": "MIT", "dependencies": { @@ -1311,9 +1318,9 @@ "license": "MIT" }, "node_modules/@types/node": { - "version": "22.14.1", - "resolved": "https://registry.npmjs.org/@types/node/-/node-22.14.1.tgz", - "integrity": "sha512-u0HuPQwe/dHrItgHHpmw3N2fYCR6x4ivMNbPHRkBVP4CvN+kiRrKHWk3i8tXiO/joPwXLMYvF9TTF0eqgHIuOw==", + "version": "22.15.27", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.15.27.tgz", + "integrity": "sha512-5fF+eu5mwihV2BeVtX5vijhdaZOfkQTATrePEaXTcKqI16LhJ7gi2/Vhd9OZM0UojcdmiOCVg5rrax+i1MdoQQ==", "dev": true, "license": "MIT", "dependencies": { @@ -1354,21 +1361,21 @@ "dev": true }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "8.30.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.30.1.tgz", - "integrity": "sha512-v+VWphxMjn+1t48/jO4t950D6KR8JaJuNXzi33Ve6P8sEmPr5k6CEXjdGwT6+LodVnEa91EQCtwjWNUCPweo+Q==", + "version": "8.33.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.33.0.tgz", + "integrity": "sha512-CACyQuqSHt7ma3Ns601xykeBK/rDeZa3w6IS6UtMQbixO5DWy+8TilKkviGDH6jtWCo8FGRKEK5cLLkPvEammQ==", "dev": true, "license": "MIT", "dependencies": { "@eslint-community/regexpp": "^4.10.0", - "@typescript-eslint/scope-manager": "8.30.1", - "@typescript-eslint/type-utils": "8.30.1", - "@typescript-eslint/utils": "8.30.1", - "@typescript-eslint/visitor-keys": "8.30.1", + "@typescript-eslint/scope-manager": "8.33.0", + "@typescript-eslint/type-utils": "8.33.0", + "@typescript-eslint/utils": "8.33.0", + "@typescript-eslint/visitor-keys": "8.33.0", "graphemer": "^1.4.0", - "ignore": "^5.3.1", + "ignore": "^7.0.0", "natural-compare": "^1.4.0", - "ts-api-utils": "^2.0.1" + "ts-api-utils": "^2.1.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -1378,22 +1385,32 @@ "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "@typescript-eslint/parser": "^8.0.0 || ^8.0.0-alpha.0", + "@typescript-eslint/parser": "^8.33.0", "eslint": "^8.57.0 || ^9.0.0", "typescript": ">=4.8.4 <5.9.0" } }, + "node_modules/@typescript-eslint/eslint-plugin/node_modules/ignore": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-7.0.4.tgz", + "integrity": "sha512-gJzzk+PQNznz8ysRrC0aOkBNVRBDtE1n53IqyqEf3PXrYwomFs5q4pGMizBMJF+ykh03insJ27hB8gSrD2Hn8A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 4" + } + }, "node_modules/@typescript-eslint/parser": { - "version": "8.30.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.30.1.tgz", - "integrity": "sha512-H+vqmWwT5xoNrXqWs/fesmssOW70gxFlgcMlYcBaWNPIEWDgLa4W9nkSPmhuOgLnXq9QYgkZ31fhDyLhleCsAg==", + "version": "8.33.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.33.0.tgz", + "integrity": "sha512-JaehZvf6m0yqYp34+RVnihBAChkqeH+tqqhS0GuX1qgPpwLvmTPheKEs6OeCK6hVJgXZHJ2vbjnC9j119auStQ==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/scope-manager": "8.30.1", - "@typescript-eslint/types": "8.30.1", - "@typescript-eslint/typescript-estree": "8.30.1", - "@typescript-eslint/visitor-keys": "8.30.1", + "@typescript-eslint/scope-manager": "8.33.0", + "@typescript-eslint/types": "8.33.0", + "@typescript-eslint/typescript-estree": "8.33.0", + "@typescript-eslint/visitor-keys": "8.33.0", "debug": "^4.3.4" }, "engines": { @@ -1408,15 +1425,34 @@ "typescript": ">=4.8.4 <5.9.0" } }, + "node_modules/@typescript-eslint/project-service": { + "version": "8.33.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.33.0.tgz", + "integrity": "sha512-d1hz0u9l6N+u/gcrk6s6gYdl7/+pp8yHheRTqP6X5hVDKALEaTn8WfGiit7G511yueBEL3OpOEpD+3/MBdoN+A==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/tsconfig-utils": "^8.33.0", + "@typescript-eslint/types": "^8.33.0", + "debug": "^4.3.4" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, "node_modules/@typescript-eslint/scope-manager": { - "version": "8.30.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.30.1.tgz", - "integrity": "sha512-+C0B6ChFXZkuaNDl73FJxRYT0G7ufVPOSQkqkpM/U198wUwUFOtgo1k/QzFh1KjpBitaK7R1tgjVz6o9HmsRPg==", + "version": "8.33.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.33.0.tgz", + "integrity": "sha512-LMi/oqrzpqxyO72ltP+dBSP6V0xiUb4saY7WLtxSfiNEBI8m321LLVFU9/QDJxjDQG9/tjSqKz/E3380TEqSTw==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.30.1", - "@typescript-eslint/visitor-keys": "8.30.1" + "@typescript-eslint/types": "8.33.0", + "@typescript-eslint/visitor-keys": "8.33.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -1426,17 +1462,34 @@ "url": "https://opencollective.com/typescript-eslint" } }, + "node_modules/@typescript-eslint/tsconfig-utils": { + "version": "8.33.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.33.0.tgz", + "integrity": "sha512-sTkETlbqhEoiFmGr1gsdq5HyVbSOF0145SYDJ/EQmXHtKViCaGvnyLqWFFHtEXoS0J1yU8Wyou2UGmgW88fEug==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "typescript": ">=4.8.4 <5.9.0" + } + }, "node_modules/@typescript-eslint/type-utils": { - "version": "8.30.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.30.1.tgz", - "integrity": "sha512-64uBF76bfQiJyHgZISC7vcNz3adqQKIccVoKubyQcOnNcdJBvYOILV1v22Qhsw3tw3VQu5ll8ND6hycgAR5fEA==", + "version": "8.33.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.33.0.tgz", + "integrity": "sha512-lScnHNCBqL1QayuSrWeqAL5GmqNdVUQAAMTaCwdYEdWfIrSrOGzyLGRCHXcCixa5NK6i5l0AfSO2oBSjCjf4XQ==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/typescript-estree": "8.30.1", - "@typescript-eslint/utils": "8.30.1", + "@typescript-eslint/typescript-estree": "8.33.0", + "@typescript-eslint/utils": "8.33.0", "debug": "^4.3.4", - "ts-api-utils": "^2.0.1" + "ts-api-utils": "^2.1.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -1451,9 +1504,9 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "8.30.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.30.1.tgz", - "integrity": "sha512-81KawPfkuulyWo5QdyG/LOKbspyyiW+p4vpn4bYO7DM/hZImlVnFwrpCTnmNMOt8CvLRr5ojI9nU1Ekpw4RcEw==", + "version": "8.33.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.33.0.tgz", + "integrity": "sha512-DKuXOKpM5IDT1FA2g9x9x1Ug81YuKrzf4mYX8FAVSNu5Wo/LELHWQyM1pQaDkI42bX15PWl0vNPt1uGiIFUOpg==", "dev": true, "license": "MIT", "engines": { @@ -1465,20 +1518,22 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "8.30.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.30.1.tgz", - "integrity": "sha512-kQQnxymiUy9tTb1F2uep9W6aBiYODgq5EMSk6Nxh4Z+BDUoYUSa029ISs5zTzKBFnexQEh71KqwjKnRz58lusQ==", + "version": "8.33.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.33.0.tgz", + "integrity": "sha512-vegY4FQoB6jL97Tu/lWRsAiUUp8qJTqzAmENH2k59SJhw0Th1oszb9Idq/FyyONLuNqT1OADJPXfyUNOR8SzAQ==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.30.1", - "@typescript-eslint/visitor-keys": "8.30.1", + "@typescript-eslint/project-service": "8.33.0", + "@typescript-eslint/tsconfig-utils": "8.33.0", + "@typescript-eslint/types": "8.33.0", + "@typescript-eslint/visitor-keys": "8.33.0", "debug": "^4.3.4", "fast-glob": "^3.3.2", "is-glob": "^4.0.3", "minimatch": "^9.0.4", "semver": "^7.6.0", - "ts-api-utils": "^2.0.1" + "ts-api-utils": "^2.1.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -1518,16 +1573,16 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "8.30.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.30.1.tgz", - "integrity": "sha512-T/8q4R9En2tcEsWPQgB5BQ0XJVOtfARcUvOa8yJP3fh9M/mXraLxZrkCfGb6ChrO/V3W+Xbd04RacUEqk1CFEQ==", + "version": "8.33.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.33.0.tgz", + "integrity": "sha512-lPFuQaLA9aSNa7D5u2EpRiqdAUhzShwGg/nhpBlc4GR6kcTABttCuyjFs8BcEZ8VWrjCBof/bePhP3Q3fS+Yrw==", "dev": true, "license": "MIT", "dependencies": { - "@eslint-community/eslint-utils": "^4.4.0", - "@typescript-eslint/scope-manager": "8.30.1", - "@typescript-eslint/types": "8.30.1", - "@typescript-eslint/typescript-estree": "8.30.1" + "@eslint-community/eslint-utils": "^4.7.0", + "@typescript-eslint/scope-manager": "8.33.0", + "@typescript-eslint/types": "8.33.0", + "@typescript-eslint/typescript-estree": "8.33.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -1542,13 +1597,13 @@ } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "8.30.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.30.1.tgz", - "integrity": "sha512-aEhgas7aJ6vZnNFC7K4/vMGDGyOiqWcYZPpIWrTKuTAlsvDNKy2GFDqh9smL+iq069ZvR0YzEeq0B8NJlLzjFA==", + "version": "8.33.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.33.0.tgz", + "integrity": "sha512-7RW7CMYoskiz5OOGAWjJFxgb7c5UNjTG292gYhWeOAcFmYCtVCSqjqSBj5zMhxbXo2JOW95YYrUWJfU0zrpaGQ==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.30.1", + "@typescript-eslint/types": "8.33.0", "eslint-visitor-keys": "^4.2.0" }, "engines": { @@ -2104,9 +2159,9 @@ } }, "node_modules/eslint": { - "version": "9.25.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.25.0.tgz", - "integrity": "sha512-MsBdObhM4cEwkzCiraDv7A6txFXEqtNXOb877TsSp2FCkBNl8JfVQrmiuDqC1IkejT6JLPzYBXx/xAiYhyzgGA==", + "version": "9.27.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.27.0.tgz", + "integrity": "sha512-ixRawFQuMB9DZ7fjU3iGGganFDp3+45bPOdaRurcFHSXO1e/sYwUX/FtQZpLZJR6SjMoJH8hR2pPEAfDyCoU2Q==", "dev": true, "license": "MIT", "dependencies": { @@ -2114,10 +2169,10 @@ "@eslint-community/regexpp": "^4.12.1", "@eslint/config-array": "^0.20.0", "@eslint/config-helpers": "^0.2.1", - "@eslint/core": "^0.13.0", + "@eslint/core": "^0.14.0", "@eslint/eslintrc": "^3.3.1", - "@eslint/js": "9.25.0", - "@eslint/plugin-kit": "^0.2.8", + "@eslint/js": "9.27.0", + "@eslint/plugin-kit": "^0.3.1", "@humanfs/node": "^0.16.6", "@humanwhocodes/module-importer": "^1.0.1", "@humanwhocodes/retry": "^0.4.2", @@ -2464,10 +2519,14 @@ } }, "node_modules/function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", - "dev": true + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } }, "node_modules/get-caller-file": { "version": "2.0.5", @@ -2560,9 +2619,9 @@ } }, "node_modules/globals": { - "version": "16.0.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-16.0.0.tgz", - "integrity": "sha512-iInW14XItCXET01CQFqudPOWP2jYMl7T+QRQT+UNcR/iQncN/F0UNpgd76iFkBPgNQb4+X3LV9tLJYzwh+Gl3A==", + "version": "16.2.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-16.2.0.tgz", + "integrity": "sha512-O+7l9tPdHCU320IigZZPj5zmRCFG9xHmx9cU8FqU2Rp+JN714seHV+2S9+JslCpY4gJwU2vOGox0wzgae/MCEg==", "dev": true, "license": "MIT", "engines": { @@ -3240,11 +3299,12 @@ } }, "node_modules/pretty-bytes": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/pretty-bytes/-/pretty-bytes-6.1.1.tgz", - "integrity": "sha512-mQUvGU6aUFQ+rNvTIAcZuWGRT9a6f6Yrg9bHs4ImKF+HZCEK+plBvnAZYSIQztknZF2qnzNtr6F8s0+IuptdlQ==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/pretty-bytes/-/pretty-bytes-7.0.0.tgz", + "integrity": "sha512-U5otLYPR3L0SVjHGrkEUx5mf7MxV2ceXeE7VwWPk+hyzC5drNohsOGNPDZqxCqyX1lkbEN4kl1LiI8QFd7r0ZA==", + "license": "MIT", "engines": { - "node": "^14.13.1 || >=16.0.0" + "node": ">=20" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -3489,9 +3549,9 @@ } }, "node_modules/rollup": { - "version": "4.40.0", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.40.0.tgz", - "integrity": "sha512-Noe455xmA96nnqH5piFtLobsGbCij7Tu+tb3c1vYjNbTkfzGqXqQXG3wJaYXkRZuQ0vEYN4bhwg7QnIrqB5B+w==", + "version": "4.41.1", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.41.1.tgz", + "integrity": "sha512-cPmwD3FnFv8rKMBc1MxWCwVQFxwf1JEmSX3iQXrRVVG15zerAIXRjMFVWnd5Q5QvgKF7Aj+5ykXFhUl+QGnyOw==", "dev": true, "license": "MIT", "dependencies": { @@ -3505,26 +3565,26 @@ "npm": ">=8.0.0" }, "optionalDependencies": { - "@rollup/rollup-android-arm-eabi": "4.40.0", - "@rollup/rollup-android-arm64": "4.40.0", - "@rollup/rollup-darwin-arm64": "4.40.0", - "@rollup/rollup-darwin-x64": "4.40.0", - "@rollup/rollup-freebsd-arm64": "4.40.0", - "@rollup/rollup-freebsd-x64": "4.40.0", - "@rollup/rollup-linux-arm-gnueabihf": "4.40.0", - "@rollup/rollup-linux-arm-musleabihf": "4.40.0", - "@rollup/rollup-linux-arm64-gnu": "4.40.0", - "@rollup/rollup-linux-arm64-musl": "4.40.0", - "@rollup/rollup-linux-loongarch64-gnu": "4.40.0", - "@rollup/rollup-linux-powerpc64le-gnu": "4.40.0", - "@rollup/rollup-linux-riscv64-gnu": "4.40.0", - "@rollup/rollup-linux-riscv64-musl": "4.40.0", - "@rollup/rollup-linux-s390x-gnu": "4.40.0", - "@rollup/rollup-linux-x64-gnu": "4.40.0", - "@rollup/rollup-linux-x64-musl": "4.40.0", - "@rollup/rollup-win32-arm64-msvc": "4.40.0", - "@rollup/rollup-win32-ia32-msvc": "4.40.0", - "@rollup/rollup-win32-x64-msvc": "4.40.0", + "@rollup/rollup-android-arm-eabi": "4.41.1", + "@rollup/rollup-android-arm64": "4.41.1", + "@rollup/rollup-darwin-arm64": "4.41.1", + "@rollup/rollup-darwin-x64": "4.41.1", + "@rollup/rollup-freebsd-arm64": "4.41.1", + "@rollup/rollup-freebsd-x64": "4.41.1", + "@rollup/rollup-linux-arm-gnueabihf": "4.41.1", + "@rollup/rollup-linux-arm-musleabihf": "4.41.1", + "@rollup/rollup-linux-arm64-gnu": "4.41.1", + "@rollup/rollup-linux-arm64-musl": "4.41.1", + "@rollup/rollup-linux-loongarch64-gnu": "4.41.1", + "@rollup/rollup-linux-powerpc64le-gnu": "4.41.1", + "@rollup/rollup-linux-riscv64-gnu": "4.41.1", + "@rollup/rollup-linux-riscv64-musl": "4.41.1", + "@rollup/rollup-linux-s390x-gnu": "4.41.1", + "@rollup/rollup-linux-x64-gnu": "4.41.1", + "@rollup/rollup-linux-x64-musl": "4.41.1", + "@rollup/rollup-win32-arm64-msvc": "4.41.1", + "@rollup/rollup-win32-ia32-msvc": "4.41.1", + "@rollup/rollup-win32-x64-msvc": "4.41.1", "fsevents": "~2.3.2" } }, @@ -3680,9 +3740,9 @@ "license": "MIT" }, "node_modules/semver": { - "version": "7.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.1.tgz", - "integrity": "sha512-hlq8tAfn0m/61p4BVRcPzIGr6LKiMwo4VM6dGi6pt4qcRkmNzTcWq6eCEjEh+qXjkMDvPlOFFSGwQjoEa6gyMA==", + "version": "7.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.2.tgz", + "integrity": "sha512-RF0Fw+rO5AMf9MAyaRXI4AV0Ulj5lMHqVxxdSgiVbixSCXoEmmX/jk0CuJw4+3SqroYO9VoUh+HcuJivvtJemA==", "dev": true, "license": "ISC", "bin": { @@ -3995,9 +4055,9 @@ "dev": true }, "node_modules/tsx": { - "version": "4.19.3", - "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.19.3.tgz", - "integrity": "sha512-4H8vUNGNjQ4V2EOoGw005+c+dGuPSnhpPBPHBtsZdGZBk/iJb4kguGlPWaZTZ3q5nMtFOEsY0nRDlh9PJyd6SQ==", + "version": "4.19.4", + "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.19.4.tgz", + "integrity": "sha512-gK5GVzDkJK1SI1zwHf32Mqxf2tSJkNx+eYcNly5+nHvWqXUJYUkWBQtKauoESz3ymezAI++ZwT855x5p5eop+Q==", "dev": true, "license": "MIT", "dependencies": { @@ -4050,15 +4110,15 @@ } }, "node_modules/typescript-eslint": { - "version": "8.30.1", - "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.30.1.tgz", - "integrity": "sha512-D7lC0kcehVH7Mb26MRQi64LMyRJsj3dToJxM1+JVTl53DQSV5/7oUGWQLcKl1C1KnoVHxMMU2FNQMffr7F3Row==", + "version": "8.33.0", + "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.33.0.tgz", + "integrity": "sha512-5YmNhF24ylCsvdNW2oJwMzTbaeO4bg90KeGtMjUw0AGtHksgEPLRTUil+coHwCfiu4QjVJFnjp94DmU6zV7DhQ==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/eslint-plugin": "8.30.1", - "@typescript-eslint/parser": "8.30.1", - "@typescript-eslint/utils": "8.30.1" + "@typescript-eslint/eslint-plugin": "8.33.0", + "@typescript-eslint/parser": "8.33.0", + "@typescript-eslint/utils": "8.33.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" diff --git a/package.json b/package.json index 8d7033a..cbb0b04 100644 --- a/package.json +++ b/package.json @@ -51,35 +51,35 @@ }, "dependencies": { "colorette": "^2.0.20", - "pretty-bytes": "^6.1.1" + "pretty-bytes": "^7.0.0" }, "devDependencies": { - "@eslint/js": "^9.25.0", + "@eslint/js": "^9.27.0", "@rollup/plugin-eslint": "^9.0.5", "@rollup/plugin-node-resolve": "^16.0.1", "@rollup/plugin-typescript": "^12.1.2", - "@types/chai": "^5.2.1", + "@types/chai": "^5.2.2", "@types/mocha": "^10.0.10", - "@types/node": "^22.14.1", + "@types/node": "^22.15.27", "@types/rimraf": "^4.0.5", "@types/sinon": "^17.0.4", "chai": "^5.2.0", "concurrently": "^9.1.2", - "eslint": "^9.25.0", + "eslint": "^9.27.0", "eslint-plugin-chai-friendly": "^1.0.1", - "globals": "^16.0.0", + "globals": "^16.2.0", "mocha": "^11.1.0", "prettier": "^3.5.3", "rimraf": "^6.0.1", - "rollup": "^4.40.0", + "rollup": "^4.41.1", "rollup-plugin-cleanup": "^3.2.1", "rollup-plugin-dts": "^6.2.1", "rollup-plugin-esbuild": "^6.2.1", "rollup-plugin-node-externals": "^8.0.0", "sinon": "^20.0.0", - "tsx": "^4.19.3", + "tsx": "^4.19.4", "typescript": "^5.8.3", - "typescript-eslint": "^8.30.1" + "typescript-eslint": "^8.33.0" }, "peerDependencies": { "rollup": "^2.0.0 || ^3.0.0 || ^4.0.0" From a49881d7adc7386ed7b83639dd1fb378f5fe5fab Mon Sep 17 00:00:00 2001 From: Jefferson Rylee Date: Fri, 30 May 2025 15:49:31 +0800 Subject: [PATCH 09/26] Use `util.styleText()` for log colors --- src/constants.ts | 5 ++--- src/utils/format.ts | 15 +++++++++++---- src/utils/summarize.ts | 20 ++++++++++++-------- 3 files changed, 25 insertions(+), 15 deletions(-) diff --git a/src/constants.ts b/src/constants.ts index 7c44b7d..2719f30 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -1,9 +1,8 @@ -import { blue, cyan, magenta } from 'colorette'; - // NOTE: internal export const OUTPUT_TYPES = ['entry', 'chunk', 'asset'] as const; export const TYPES = [...OUTPUT_TYPES, 'total'] as const; -export const COLOR = { asset: magenta, chunk: blue, entry: cyan } as const; +// prettier-ignore +export const COLOR = { asset: 'magenta', chunk: 'blue', entry: 'cyan' } as const; diff --git a/src/utils/format.ts b/src/utils/format.ts index e81a9bd..2301a6f 100644 --- a/src/utils/format.ts +++ b/src/utils/format.ts @@ -1,4 +1,4 @@ -import { dim, gray, red, yellow } from 'colorette'; +import util from 'util'; import { COLOR } from '../constants'; import { Options } from '../types/core.types'; import { OutputInfo } from '../types/output.types'; @@ -15,10 +15,17 @@ export function format( options: Pick = {} ): string { return ( - COLOR[info.type](dim(`[${info.type}] `) + info.path + dim(' is ')) + - yellow(getSize(info, options)) + + util.styleText( + COLOR[info.type], + util.styleText('dim', `[${info.type}] `) + + info.path + + util.styleText('dim', ' is ') + ) + + util.styleText('yellow', getSize(info, options)) + (info.gzip - ? red(' → ') + yellow(getSize(info.gzip, options)) + gray(' (gzip)') + ? util.styleText('red', ' → ') + + util.styleText('yellow', getSize(info.gzip, options)) + + util.styleText('gray', ' (gzip)') : '') ); } diff --git a/src/utils/summarize.ts b/src/utils/summarize.ts index f400890..b985ee8 100644 --- a/src/utils/summarize.ts +++ b/src/utils/summarize.ts @@ -1,4 +1,4 @@ -import { dim, gray, green, red, yellow } from 'colorette'; +import util from 'util'; import { COLOR, OUTPUT_TYPES } from '../constants'; import { Options } from '../types/core.types'; import { Summary } from '../types/summary.types'; @@ -10,11 +10,13 @@ import { getSize } from './size'; * @param total Total size. * @returns The summary line. */ -function line(sizes: string[], total: string | number) { +function line(sizes: string[], total: string) { return ( - dim(green('[total] ')) + - (sizes.length > 0 ? sizes.join(red(' + ')) + red(' = ') : '') + - yellow(total) + util.styleText(['dim', 'green'], '[total] ') + + (sizes.length > 0 + ? sizes.join(util.styleText('red', ' + ')) + util.styleText('red', ' = ') + : '') + + util.styleText('yellow', total) ); } @@ -37,17 +39,19 @@ export function summarize( const item = summary[type]; const gzipItem = gzip && gzip[type]; if (item && item.size > 0) { - sizes.push(color(getSize(item, options))); + sizes.push(util.styleText(color, getSize(item, options))); } if (gzipItem && gzipItem.size > 0) { - gzipSizes.push(color(getSize(gzipItem, options))); + gzipSizes.push(util.styleText(color, getSize(gzipItem, options))); } } return ( line(sizes, getSize(total, options)) + (gzip - ? '\n' + line(gzipSizes, getSize(gzip.total, options)) + gray(' (gzip)') + ? '\n' + + line(gzipSizes, getSize(gzip.total, options)) + + util.styleText('gray', ' (gzip)') : '') ); } From 513c83664e3af612db9aba12be91252c78adcef1 Mon Sep 17 00:00:00 2001 From: Jefferson Rylee Date: Fri, 30 May 2025 16:15:43 +0800 Subject: [PATCH 10/26] Add and use formatBytes util, update tests --- src/core/output-size.ts | 6 +++--- src/utils/format-bytes.ts | 24 ++++++++++++++++++++++++ src/utils/gzip.ts | 4 ++-- test/format.spec.ts | 6 +++--- test/summarize.spec.ts | 4 ++-- 5 files changed, 34 insertions(+), 10 deletions(-) create mode 100644 src/utils/format-bytes.ts diff --git a/src/core/output-size.ts b/src/core/output-size.ts index 19885ab..61947db 100644 --- a/src/core/output-size.ts +++ b/src/core/output-size.ts @@ -1,5 +1,4 @@ import path from 'path'; -import prettyBytes from 'pretty-bytes'; import { Plugin } from 'rollup'; import { TYPES } from '../constants'; import { Options } from '../types/core.types'; @@ -7,6 +6,7 @@ import { OutputInfo } from '../types/output.types'; import { Size } from '../types/size.types'; import { Summary, SummaryOutput } from '../types/summary.types'; import { format } from '../utils/format'; +import { formatBytes } from '../utils/format-bytes'; import { gzip as getGzip } from '../utils/gzip'; import { summarize } from '../utils/summarize'; @@ -44,7 +44,7 @@ export function outputSize(options: Options = {}): Plugin { const data = isChunk ? output.code : output.source; const size = typeof data === 'string' ? Buffer.byteLength(data) : data.byteLength; - const hSize = prettyBytes(size); + const hSize = formatBytes(size); const gzip = gzipOpts === true || gzipOpts.includes(type) ? await getGzip(data) @@ -91,7 +91,7 @@ export function outputSize(options: Options = {}): Plugin { } // update hSizes - const s = (size: Size) => (size.hSize = prettyBytes(size.size)); + const s = (size: Size) => (size.hSize = formatBytes(size.size)); for (const type of TYPES) { s(summary[type]!); summary.gzip && s(summary.gzip[type]!); diff --git a/src/utils/format-bytes.ts b/src/utils/format-bytes.ts new file mode 100644 index 0000000..c14d72e --- /dev/null +++ b/src/utils/format-bytes.ts @@ -0,0 +1,24 @@ +// NOTE: internal + +// probably don't need units after GB +// add these if needed for some reason: 'TB', 'PB', 'EB', 'ZB', 'YB' +const units = ['B', 'kB', 'MB', 'GB']; + +/** + * Formats bytes to human-readable string. + * - Assume no negative numbers. + * - Assume no file sizes that could reach TB and above. + * @param bytes The bytes to format. + * @returns The formatted bytes. + * @see https://github.com/sindresorhus/pretty-bytes + * @see https://gist.github.com/zentala/1e6f72438796d74531803cc3833c039c + */ +export function formatBytes(bytes: number): string { + if (bytes === 0) return '0 B'; + + // prettier-ignore + const e = Math.min(units.length - 1, Math.floor(Math.log(bytes) / Math.log(1000))); + return ( + Number((bytes / 1000 ** e).toFixed(2)).toLocaleString() + ' ' + units[e] + ); +} diff --git a/src/utils/gzip.ts b/src/utils/gzip.ts index d1b67db..776ab5b 100644 --- a/src/utils/gzip.ts +++ b/src/utils/gzip.ts @@ -1,7 +1,7 @@ -import prettyBytes from 'pretty-bytes'; import util from 'util'; import zlib from 'zlib'; import { Size } from '../types/size.types'; +import { formatBytes } from './format-bytes'; const _gzip = util.promisify(zlib.gzip); @@ -12,5 +12,5 @@ const _gzip = util.promisify(zlib.gzip); */ export async function gzip(input: string | Uint8Array): Promise { const size = input ? (await _gzip(input, { level: 9 })).byteLength : 0; - return { size, hSize: prettyBytes(size) }; + return { size, hSize: formatBytes(size) }; } diff --git a/test/format.spec.ts b/test/format.spec.ts index f514659..4ae1a26 100644 --- a/test/format.spec.ts +++ b/test/format.spec.ts @@ -1,7 +1,7 @@ import { expect } from 'chai'; -import prettyBytes from 'pretty-bytes'; import util from 'util'; import { format, OutputInfo } from '../src'; +import { formatBytes } from '../src/utils/format-bytes'; describe('format', () => { it('should be a function', () => { @@ -39,7 +39,7 @@ describe('format', () => { path: 'out/test/entry.js', type: 'entry', size, - hSize: prettyBytes(size) + hSize: formatBytes(size) }; let raw = util.stripVTControlCharacters(format(info, { bytes: true })); expect(raw).to.equal('[entry] out/test/entry.js is 0 B'); @@ -49,7 +49,7 @@ describe('format', () => { path: 'out/test/entry.js', type: 'entry', size, - hSize: prettyBytes(size) + hSize: formatBytes(size) }; raw = util.stripVTControlCharacters(format(info, { bytes: true })); expect(raw).to.equal('[entry] out/test/entry.js is 1,234,567,890 B'); diff --git a/test/summarize.spec.ts b/test/summarize.spec.ts index f3f9f22..5701239 100644 --- a/test/summarize.spec.ts +++ b/test/summarize.spec.ts @@ -1,10 +1,10 @@ import { expect } from 'chai'; -import prettyBytes from 'pretty-bytes'; import util from 'util'; import { Size, summarize, Summary, SummarySizes } from '../src'; +import { formatBytes } from '../src/utils/format-bytes'; function size(size: number): Size { - return { size, hSize: prettyBytes(size) }; + return { size, hSize: formatBytes(size) }; } function getSizes(): SummarySizes { From 170d37cb5a44c3de7afce1a395037549693a472c Mon Sep 17 00:00:00 2001 From: Jefferson Rylee Date: Fri, 30 May 2025 22:08:07 +0800 Subject: [PATCH 11/26] Update rollup config for preview mode --- rollup.config.ts | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/rollup.config.ts b/rollup.config.ts index 6b2ad7b..b8e4c7a 100644 --- a/rollup.config.ts +++ b/rollup.config.ts @@ -1,5 +1,4 @@ import eslint from '@rollup/plugin-eslint'; -import nodeResolve from '@rollup/plugin-node-resolve'; import typescript from '@rollup/plugin-typescript'; import { RollupOptions } from 'rollup'; import cleanup from 'rollup-plugin-cleanup'; @@ -16,8 +15,12 @@ const bytes = true; const WATCH = process.env.ROLLUP_WATCH === 'true'; const input = 'src/index.ts'; -// esm dependencies to be bundled into the cjs build -const esmExternals = ['pretty-bytes']; +// for preview mode utils chunk +const utils = [ + 'src/utils/format.ts', + 'src/utils/gzip.ts', + 'src/utils/summarize.ts' +]; function build() { return esbuild({ target: 'esnext' }); @@ -53,18 +56,10 @@ export default defineConfig([ sourcemap: preview, entryFileNames: '[name].cjs', chunkFileNames: '[name].cjs', - // for preview mode, create a separate chunk for esm externals - manualChunks: preview ? { vendor: esmExternals } : undefined + // for preview mode, create a separate chunk for utils + manualChunks: preview ? { utils } : undefined }, - plugins: [ - build(), - clean(), - nodeResolve(), - // exclude esm dependencies from external - // since they will be bundled into the cjs build - nodeExternals({ exclude: esmExternals }), - size() - ] + plugins: [build(), clean(), nodeExternals(), size()] }, { input, From 8d5cdce8588f4546320ae7cc628ad4c187980961 Mon Sep 17 00:00:00 2001 From: Jefferson Rylee Date: Fri, 30 May 2025 22:21:42 +0800 Subject: [PATCH 12/26] Rename constants for types --- src/constants.ts | 4 ++-- src/core/output-size.ts | 14 +++++++------- src/utils/summarize.ts | 4 ++-- test/output-size.spec.ts | 6 +++--- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/constants.ts b/src/constants.ts index 2719f30..fa8bc83 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -1,8 +1,8 @@ // NOTE: internal -export const OUTPUT_TYPES = ['entry', 'chunk', 'asset'] as const; +export const TYPES = ['entry', 'chunk', 'asset'] as const; -export const TYPES = [...OUTPUT_TYPES, 'total'] as const; +export const KEYS = [...TYPES, 'total'] as const; // prettier-ignore export const COLOR = { asset: 'magenta', chunk: 'blue', entry: 'cyan' } as const; diff --git a/src/core/output-size.ts b/src/core/output-size.ts index 61947db..453e0d4 100644 --- a/src/core/output-size.ts +++ b/src/core/output-size.ts @@ -1,6 +1,6 @@ import path from 'path'; import { Plugin } from 'rollup'; -import { TYPES } from '../constants'; +import { KEYS } from '../constants'; import { Options } from '../types/core.types'; import { OutputInfo } from '../types/output.types'; import { Size } from '../types/size.types'; @@ -71,9 +71,9 @@ export function outputSize(options: Options = {}): Plugin { // create summary const summary = { gzip: {} } as Summary; - for (const type of TYPES) { - summary[type] = { size: 0, hSize: '0 B' }; - summary.gzip![type] = { size: 0, hSize: '0 B' }; + for (const key of KEYS) { + summary[key] = { size: 0, hSize: '0 B' }; + summary.gzip![key] = { size: 0, hSize: '0 B' }; } // set summary sizes @@ -92,9 +92,9 @@ export function outputSize(options: Options = {}): Plugin { // update hSizes const s = (size: Size) => (size.hSize = formatBytes(size.size)); - for (const type of TYPES) { - s(summary[type]!); - summary.gzip && s(summary.gzip[type]!); + for (const key of KEYS) { + s(summary[key]!); + summary.gzip && s(summary.gzip[key]!); } // display summary (preserve `this` for callbacks) diff --git a/src/utils/summarize.ts b/src/utils/summarize.ts index b985ee8..499cff0 100644 --- a/src/utils/summarize.ts +++ b/src/utils/summarize.ts @@ -1,5 +1,5 @@ import util from 'util'; -import { COLOR, OUTPUT_TYPES } from '../constants'; +import { COLOR, TYPES } from '../constants'; import { Options } from '../types/core.types'; import { Summary } from '../types/summary.types'; import { getSize } from './size'; @@ -34,7 +34,7 @@ export function summarize( const sizes: string[] = []; const gzipSizes: string[] = []; - for (const type of OUTPUT_TYPES) { + for (const type of TYPES) { const color = COLOR[type]; const item = summary[type]; const gzipItem = gzip && gzip[type]; diff --git a/test/output-size.spec.ts b/test/output-size.spec.ts index 7262fa9..a65930c 100644 --- a/test/output-size.spec.ts +++ b/test/output-size.spec.ts @@ -4,7 +4,6 @@ import { rimraf } from 'rimraf'; import { rollup, RollupOptions } from 'rollup'; import { spy } from 'sinon'; import { fileURLToPath } from 'url'; -import { OUTPUT_TYPES } from '../src/constants'; import { Options, OutputInfo, @@ -12,6 +11,7 @@ import { OutputType, SummaryCallback } from '../src'; +import { TYPES } from '../src/constants'; type Handle = Exclude; @@ -335,7 +335,7 @@ describe('options', () => { expect(summary).to.have.property('total').that.is.an('object'); expect(summary).to.have.property('gzip').that.is.an('object'); expect(summary.gzip).to.have.property('total').that.is.an('object'); - for (const type of OUTPUT_TYPES) { + for (const type of TYPES) { expect(summary).to.have.property(type).that.is.an('object'); expect(summary.gzip).to.have.property(type).that.is.an('object'); } @@ -372,7 +372,7 @@ describe('options', () => { expect(output).to.have.property('info').that.is.an('object'); expect(output).to.have.property('output').that.is.an('object'); expect(output.info).to.be.an('object'); - expect(output.info.type).to.have.oneOf(OUTPUT_TYPES); + expect(output.info.type).to.have.oneOf(TYPES); } }); const plugin = outputSize({ hide: true, gzip: ['asset'], summary }); From d6169b6e138da3ef2f7542371c001f4b3b06624b Mon Sep 17 00:00:00 2001 From: Jefferson Rylee Date: Fri, 30 May 2025 22:50:09 +0800 Subject: [PATCH 13/26] Refactor plugin and rename some variables --- src/core/output-size.ts | 46 ++++++++++++++++++++++------------------- 1 file changed, 25 insertions(+), 21 deletions(-) diff --git a/src/core/output-size.ts b/src/core/output-size.ts index 453e0d4..1a8f5ad 100644 --- a/src/core/output-size.ts +++ b/src/core/output-size.ts @@ -4,12 +4,17 @@ import { KEYS } from '../constants'; import { Options } from '../types/core.types'; import { OutputInfo } from '../types/output.types'; import { Size } from '../types/size.types'; -import { Summary, SummaryOutput } from '../types/summary.types'; +import { SummaryOutput, SummarySizes } from '../types/summary.types'; import { format } from '../utils/format'; import { formatBytes } from '../utils/format-bytes'; -import { gzip as getGzip } from '../utils/gzip'; +import { gzip } from '../utils/gzip'; import { summarize } from '../utils/summarize'; +// same as Summary but props are required +interface PluginSummary extends Required { + gzip?: Required; +} + /** * A Rollup plugin that displays output bundle sizes. * @param options The plugin options. @@ -22,14 +27,13 @@ export function outputSize(options: Options = {}): Plugin { : options.gzip == null || !!options.gzip || []; const summaryOpts = options.summary == null || options.summary; - let summaries: SummaryOutput[]; - let didSummarize: boolean; + let summaries: SummaryOutput[], summarized: boolean; return { name: 'output-size', outputOptions() { summaries = []; - didSummarize = false; + summarized = false; }, async generateBundle(outputOpts, bundle) { if (options.silent) return; @@ -37,26 +41,26 @@ export function outputSize(options: Options = {}): Plugin { for (const output of Object.values(bundle)) { const isChunk = output.type === 'chunk'; const type = isChunk && output.isEntry ? 'entry' : output.type; - const shouldHide = hide === true || hide.includes(type); + const hidden = hide === true || hide.includes(type); // skip other checks if no summary is required - if (!summaryOpts && shouldHide) continue; + if (!summaryOpts && hidden) continue; const data = isChunk ? output.code : output.source; const size = typeof data === 'string' ? Buffer.byteLength(data) : data.byteLength; const hSize = formatBytes(size); - const gzip = - gzipOpts === true || gzipOpts.includes(type) - ? await getGzip(data) - : undefined; const filePath = path.join( outputOpts.dir || path.dirname(outputOpts.file || ''), output.fileName ); - const info: OutputInfo = { path: filePath, type, size, hSize, gzip }; + const info: OutputInfo = { path: filePath, type, size, hSize }; + if (gzipOpts === true || gzipOpts.includes(type)) { + info.gzip = await gzip(data); + } + summaries.push({ info, output }); - if (shouldHide) { + if (hidden) { // do nothing } else if (typeof options.handle === 'function') { await options.handle(info, output); @@ -66,11 +70,11 @@ export function outputSize(options: Options = {}): Plugin { } }, async writeBundle() { - if (didSummarize || !summaryOpts || options.silent) return; - didSummarize = true; + if (summarized || !summaryOpts || options.silent) return; + summarized = true; // create summary - const summary = { gzip: {} } as Summary; + const summary = { gzip: {} } as PluginSummary; for (const key of KEYS) { summary[key] = { size: 0, hSize: '0 B' }; summary.gzip![key] = { size: 0, hSize: '0 B' }; @@ -79,12 +83,12 @@ export function outputSize(options: Options = {}): Plugin { // set summary sizes for (const { info } of summaries) { summary.total.size += info.size; - summary[info.type]!.size += info.size; + summary[info.type].size += info.size; if (!summary.gzip) { // exclude gzip if an info does not have gzip size } else if (info.gzip) { summary.gzip.total.size += info.gzip.size; - summary.gzip[info.type]!.size += info.gzip.size; + summary.gzip[info.type].size += info.gzip.size; } else { delete summary.gzip; } @@ -93,14 +97,14 @@ export function outputSize(options: Options = {}): Plugin { // update hSizes const s = (size: Size) => (size.hSize = formatBytes(size.size)); for (const key of KEYS) { - s(summary[key]!); - summary.gzip && s(summary.gzip[key]!); + s(summary[key]); + summary.gzip && s(summary.gzip[key]); } // display summary (preserve `this` for callbacks) if (typeof options.summary === 'function') { await options.summary(summary, summaries); - } else if (summaryOpts === 'always' || summaries.length > 1) { + } else if (summaries.length > 1 || summaryOpts === 'always') { // by default, show summary only if more than 1 output console.log(summarize(summary, options)); } From be4431041bb577caa2e853f2f2fd0fbc32cb570a Mon Sep 17 00:00:00 2001 From: Jefferson Rylee Date: Fri, 30 May 2025 22:58:14 +0800 Subject: [PATCH 14/26] Require node >=20.12.0 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 13c5f05..211c559 100644 --- a/package-lock.json +++ b/package-lock.json @@ -41,7 +41,7 @@ "typescript-eslint": "^8.33.0" }, "engines": { - "node": ">=14.16.0" + "node": ">=20.12.0" }, "peerDependencies": { "rollup": "^2.0.0 || ^3.0.0 || ^4.0.0" diff --git a/package.json b/package.json index cbb0b04..33c2a56 100644 --- a/package.json +++ b/package.json @@ -90,7 +90,7 @@ } }, "engines": { - "node": ">=14.16.0" + "node": ">=20.12.0" }, "overrides": { "@rollup/plugin-eslint": { From 412b8dfff91ba309343f2f10fe71ce7b043c06c5 Mon Sep 17 00:00:00 2001 From: Jefferson Rylee Date: Sat, 31 May 2025 10:17:12 +0800 Subject: [PATCH 15/26] Update dependencies - Remove unused dependencies - Move pretty-bytes to dev dependencies --- package-lock.json | 96 ++++++++--------------------------------------- package.json | 13 ++----- 2 files changed, 19 insertions(+), 90 deletions(-) diff --git a/package-lock.json b/package-lock.json index 211c559..746ed6c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,27 +8,22 @@ "name": "rollup-plugin-output-size", "version": "1.6.1", "license": "MIT", - "dependencies": { - "colorette": "^2.0.20", - "pretty-bytes": "^7.0.0" - }, "devDependencies": { - "@eslint/js": "^9.27.0", + "@eslint/js": "^9.28.0", "@rollup/plugin-eslint": "^9.0.5", - "@rollup/plugin-node-resolve": "^16.0.1", "@rollup/plugin-typescript": "^12.1.2", "@types/chai": "^5.2.2", "@types/mocha": "^10.0.10", - "@types/node": "^22.15.27", - "@types/rimraf": "^4.0.5", + "@types/node": "^22.15.29", "@types/sinon": "^17.0.4", "chai": "^5.2.0", "concurrently": "^9.1.2", - "eslint": "^9.27.0", + "eslint": "^9.28.0", "eslint-plugin-chai-friendly": "^1.0.1", "globals": "^16.2.0", "mocha": "^11.1.0", "prettier": "^3.5.3", + "pretty-bytes": "^7.0.0", "rimraf": "^6.0.1", "rollup": "^4.41.1", "rollup-plugin-cleanup": "^3.2.1", @@ -618,9 +613,9 @@ } }, "node_modules/@eslint/js": { - "version": "9.27.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.27.0.tgz", - "integrity": "sha512-G5JD9Tu5HJEu4z2Uo4aHY2sLV64B7CDMXxFzqzjl3NKd6RVzSXNoE80jk7Y0lJkTTkjiIhBAqmlYwjuBY3tvpA==", + "version": "9.28.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.28.0.tgz", + "integrity": "sha512-fnqSjGWd/CoIp4EXIxWVK/sHA6DOHN4+8Ix2cX5ycOY7LG0UY8nHCU5pIp2eaE1Mc7Qd8kHspYNzYXT2ojPLzg==", "dev": true, "license": "MIT", "engines": { @@ -870,31 +865,6 @@ } } }, - "node_modules/@rollup/plugin-node-resolve": { - "version": "16.0.1", - "resolved": "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-16.0.1.tgz", - "integrity": "sha512-tk5YCxJWIG81umIvNkSod2qK5KyQW19qcBF/B78n1bjtOON6gzKoVeSzAE8yHCZEDmqkHKkxplExA8KzdJLJpA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@rollup/pluginutils": "^5.0.1", - "@types/resolve": "1.20.2", - "deepmerge": "^4.2.2", - "is-module": "^1.0.0", - "resolve": "^1.22.1" - }, - "engines": { - "node": ">=14.0.0" - }, - "peerDependencies": { - "rollup": "^2.78.0||^3.0.0||^4.0.0" - }, - "peerDependenciesMeta": { - "rollup": { - "optional": true - } - } - }, "node_modules/@rollup/plugin-typescript": { "version": "12.1.2", "resolved": "https://registry.npmjs.org/@rollup/plugin-typescript/-/plugin-typescript-12.1.2.tgz", @@ -1318,32 +1288,15 @@ "license": "MIT" }, "node_modules/@types/node": { - "version": "22.15.27", - "resolved": "https://registry.npmjs.org/@types/node/-/node-22.15.27.tgz", - "integrity": "sha512-5fF+eu5mwihV2BeVtX5vijhdaZOfkQTATrePEaXTcKqI16LhJ7gi2/Vhd9OZM0UojcdmiOCVg5rrax+i1MdoQQ==", + "version": "22.15.29", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.15.29.tgz", + "integrity": "sha512-LNdjOkUDlU1RZb8e1kOIUpN1qQUlzGkEtbVNo53vbrwDg5om6oduhm4SiUaPW5ASTXhAiP0jInWG8Qx9fVlOeQ==", "dev": true, "license": "MIT", "dependencies": { "undici-types": "~6.21.0" } }, - "node_modules/@types/resolve": { - "version": "1.20.2", - "resolved": "https://registry.npmjs.org/@types/resolve/-/resolve-1.20.2.tgz", - "integrity": "sha512-60BCwRFOZCQhDncwQdxxeOEEkbc5dIMccYLwbxsS4TUNeVECQ/pBJ0j09mrHOl/JJvpRPGwO9SvE4nR2Nb/a4Q==", - "dev": true - }, - "node_modules/@types/rimraf": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/@types/rimraf/-/rimraf-4.0.5.tgz", - "integrity": "sha512-DTCZoIQotB2SUJnYgrEx43cQIUYOlNZz0AZPbKU4PSLYTUdML5Gox0++z4F9kQocxStrCmRNhi4x5x/UlwtKUA==", - "deprecated": "This is a stub types definition. rimraf provides its own type definitions, so you do not need this installed.", - "dev": true, - "license": "MIT", - "dependencies": { - "rimraf": "*" - } - }, "node_modules/@types/sinon": { "version": "17.0.4", "resolved": "https://registry.npmjs.org/@types/sinon/-/sinon-17.0.4.tgz", @@ -1959,11 +1912,6 @@ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, - "node_modules/colorette": { - "version": "2.0.20", - "resolved": "https://registry.npmjs.org/colorette/-/colorette-2.0.20.tgz", - "integrity": "sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==" - }, "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", @@ -2057,15 +2005,6 @@ "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", "dev": true }, - "node_modules/deepmerge": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.2.2.tgz", - "integrity": "sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/diff": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/diff/-/diff-5.2.0.tgz", @@ -2159,9 +2098,9 @@ } }, "node_modules/eslint": { - "version": "9.27.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.27.0.tgz", - "integrity": "sha512-ixRawFQuMB9DZ7fjU3iGGganFDp3+45bPOdaRurcFHSXO1e/sYwUX/FtQZpLZJR6SjMoJH8hR2pPEAfDyCoU2Q==", + "version": "9.28.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.28.0.tgz", + "integrity": "sha512-ocgh41VhRlf9+fVpe7QKzwLj9c92fDiqOj8Y3Sd4/ZmVA4Btx4PlUYPq4pp9JDyupkf1upbEXecxL2mwNV7jPQ==", "dev": true, "license": "MIT", "dependencies": { @@ -2171,7 +2110,7 @@ "@eslint/config-helpers": "^0.2.1", "@eslint/core": "^0.14.0", "@eslint/eslintrc": "^3.3.1", - "@eslint/js": "9.27.0", + "@eslint/js": "9.28.0", "@eslint/plugin-kit": "^0.3.1", "@humanfs/node": "^0.16.6", "@humanwhocodes/module-importer": "^1.0.1", @@ -2757,12 +2696,6 @@ "node": ">=0.10.0" } }, - "node_modules/is-module": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-module/-/is-module-1.0.0.tgz", - "integrity": "sha512-51ypPSPCoTEIN9dy5Oy+h4pShgJmPCygKfyRCISBI+JoWT/2oJvK8QPxmwv7b/p239jXrm9M1mlQbyKJ5A152g==", - "dev": true - }, "node_modules/is-number": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", @@ -3302,6 +3235,7 @@ "version": "7.0.0", "resolved": "https://registry.npmjs.org/pretty-bytes/-/pretty-bytes-7.0.0.tgz", "integrity": "sha512-U5otLYPR3L0SVjHGrkEUx5mf7MxV2ceXeE7VwWPk+hyzC5drNohsOGNPDZqxCqyX1lkbEN4kl1LiI8QFd7r0ZA==", + "dev": true, "license": "MIT", "engines": { "node": ">=20" diff --git a/package.json b/package.json index 33c2a56..539a759 100644 --- a/package.json +++ b/package.json @@ -49,27 +49,22 @@ "test": "npm run all -- mocha npm:check", "test:watch": "mocha -w" }, - "dependencies": { - "colorette": "^2.0.20", - "pretty-bytes": "^7.0.0" - }, "devDependencies": { - "@eslint/js": "^9.27.0", + "@eslint/js": "^9.28.0", "@rollup/plugin-eslint": "^9.0.5", - "@rollup/plugin-node-resolve": "^16.0.1", "@rollup/plugin-typescript": "^12.1.2", "@types/chai": "^5.2.2", "@types/mocha": "^10.0.10", - "@types/node": "^22.15.27", - "@types/rimraf": "^4.0.5", + "@types/node": "^22.15.29", "@types/sinon": "^17.0.4", "chai": "^5.2.0", "concurrently": "^9.1.2", - "eslint": "^9.27.0", + "eslint": "^9.28.0", "eslint-plugin-chai-friendly": "^1.0.1", "globals": "^16.2.0", "mocha": "^11.1.0", "prettier": "^3.5.3", + "pretty-bytes": "^7.0.0", "rimraf": "^6.0.1", "rollup": "^4.41.1", "rollup-plugin-cleanup": "^3.2.1", From 37fe64aa8b2f954e340226ac016c5ea16f04cc7b Mon Sep 17 00:00:00 2001 From: Jefferson Rylee Date: Sat, 31 May 2025 10:40:03 +0800 Subject: [PATCH 16/26] Add formatBytes spec --- test/format-bytes.spec.ts | 46 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 test/format-bytes.spec.ts diff --git a/test/format-bytes.spec.ts b/test/format-bytes.spec.ts new file mode 100644 index 0000000..6ff1252 --- /dev/null +++ b/test/format-bytes.spec.ts @@ -0,0 +1,46 @@ +import { expect } from 'chai'; +import prettyBytes from 'pretty-bytes'; +import { formatBytes } from '../src/utils/format-bytes'; + +// NOTE: this is internal but test it anyway for correctness + +// expect not equal to prettyBytes output +function expectNotEqual(list: [number, string][]) { + for (const [bytes, actual] of list) { + const hBytes = formatBytes(bytes); + expect(hBytes).to.not.equal(prettyBytes(bytes)); + expect(hBytes).to.equal(actual); + } +} + +describe('formatBytes', () => { + it('should be a function', () => { + expect(formatBytes).to.be.a('function'); + }); + + it('should properly format bytes', () => { + const list = [0, 99, 999, 1_000, 1_337, 9_999, 1_234_567, 1_234_567_890]; + for (const bytes of list) { + expect(formatBytes(bytes)).to.equal(prettyBytes(bytes)); + } + }); + + it('should format with commas and decimals', () => { + expectNotEqual([ + [999.5, '999.5 B'], // 1000 B + [999_999, '1,000 kB'], // 1000 kB + [123_456, '123.46 kB'], // 123 kB + [999_999_999, '1,000 MB'], // 1000 MB + [123_456_789_000, '123.46 GB'], // 123 GB + [999_999_999_999, '1,000 GB'] // 1000 GB + ]); + }); + + it('should not format more than GB', () => { + expectNotEqual([ + [1_234_567_890_000, '1,234.57 GB'], // 1.23 TB + [123_456_789_876_543, '123,456.79 GB'], // 123 TB + [999_999_999_999_999, '1,000,000 GB'] // 1 PB + ]); + }); +}); From a756b7d900fd865658062bf8f4e43c0ddbd4d194 Mon Sep 17 00:00:00 2001 From: Jefferson Rylee Date: Sat, 31 May 2025 11:07:12 +0800 Subject: [PATCH 17/26] Remove deprecated RollupOutputSizeOptions interface --- src/types/core.types.ts | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/types/core.types.ts b/src/types/core.types.ts index 3b9d785..8e4161b 100644 --- a/src/types/core.types.ts +++ b/src/types/core.types.ts @@ -53,6 +53,3 @@ export interface Options { output: OutputBundle[keyof OutputBundle] ): void | Promise; } - -/** @deprecated Since v1.4.0. Use {@linkcode Options} instead. */ -export type RollupOutputSizeOptions = Options; From 2c63aa8679fe64e9468f60e4c1c4184a813a5fde Mon Sep 17 00:00:00 2001 From: Jefferson Rylee Date: Sat, 31 May 2025 11:08:32 +0800 Subject: [PATCH 18/26] Update OutputInfo.gzip doc --- src/types/output.types.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/types/output.types.ts b/src/types/output.types.ts index 5380160..f0770c7 100644 --- a/src/types/output.types.ts +++ b/src/types/output.types.ts @@ -17,8 +17,8 @@ export interface OutputInfo extends Size { /** Output type. */ type: OutputType; /** - * The gzipped size of the output. Provided unless the - * {@linkcode Options.gzip gzip} option is set to `false`. + * The gzipped size of the output. + * Provided unless {@linkcode Options.gzip} is set to `false`. */ gzip?: Size; } From 5ade6501e6b465da5dcc541a89b317264312c92e Mon Sep 17 00:00:00 2001 From: Jefferson Rylee Date: Sat, 31 May 2025 11:42:28 +0800 Subject: [PATCH 19/26] Update package.json scripts --- package.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 539a759..865b878 100644 --- a/package.json +++ b/package.json @@ -45,9 +45,10 @@ "check": "npm run all -- \"npm:lint -- --max-warnings 0\" tsc", "format": "npm run lint -- --fix && prettier -cw .", "lint": "eslint .", - "start": "npm run bundle -- -w --no-watch.clearScreen", + "start": "npm run watch -- --environment NODE_ENV:development", "test": "npm run all -- mocha npm:check", - "test:watch": "mocha -w" + "test:watch": "mocha -w", + "watch": "npm run bundle -- -w --no-watch.clearScreen" }, "devDependencies": { "@eslint/js": "^9.28.0", From 3121a8a26ba89d7bcba1545aa621e0d0d86cdce2 Mon Sep 17 00:00:00 2001 From: Jefferson Rylee Date: Sat, 31 May 2025 11:31:24 +0800 Subject: [PATCH 20/26] Add eslint-plugin-jsdoc dev dependency --- package-lock.json | 122 ++++++++++++++++++++++++++++++++++++++++++++-- package.json | 1 + 2 files changed, 120 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 746ed6c..1143893 100644 --- a/package-lock.json +++ b/package-lock.json @@ -20,6 +20,7 @@ "concurrently": "^9.1.2", "eslint": "^9.28.0", "eslint-plugin-chai-friendly": "^1.0.1", + "eslint-plugin-jsdoc": "^50.6.17", "globals": "^16.2.0", "mocha": "^11.1.0", "prettier": "^3.5.3", @@ -83,6 +84,23 @@ "node": ">=6.9.0" } }, + "node_modules/@es-joy/jsdoccomment": { + "version": "0.50.2", + "resolved": "https://registry.npmjs.org/@es-joy/jsdoccomment/-/jsdoccomment-0.50.2.tgz", + "integrity": "sha512-YAdE/IJSpwbOTiaURNCKECdAwqrJuFiZhylmesBcIRawtYKnBR2wxPhoIewMg+Yu+QuYvHfJNReWpoxGBKOChA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "^1.0.6", + "@typescript-eslint/types": "^8.11.0", + "comment-parser": "1.4.1", + "esquery": "^1.6.0", + "jsdoc-type-pratt-parser": "~4.1.0" + }, + "engines": { + "node": ">=18" + } + }, "node_modules/@esbuild/aix-ppc64": { "version": "0.25.2", "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.25.2.tgz", @@ -1683,6 +1701,16 @@ "url": "https://github.com/sponsors/jonschlinkert" } }, + "node_modules/are-docs-informative": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/are-docs-informative/-/are-docs-informative-0.0.2.tgz", + "integrity": "sha512-ixiS0nLNNG5jNQzgZJNoUpBKdo9yTYZMGJ+QgT2jmjR7G7+QHRCc4v6LQ3NgE7EBJq+o0ams3waJwkrlBom8Ig==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14" + } + }, "node_modules/argparse": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", @@ -1912,6 +1940,16 @@ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, + "node_modules/comment-parser": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/comment-parser/-/comment-parser-1.4.1.tgz", + "integrity": "sha512-buhp5kePrmda3vhc5B9t7pUQXAb2Tnd0qgpkIhPhkHXxJpiPJ11H0ZEU0oBpJ2QztSbzG/ZxMj/CHsYJqRHmyg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 12.0.0" + } + }, "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", @@ -2171,6 +2209,31 @@ "eslint": ">=3.0.0" } }, + "node_modules/eslint-plugin-jsdoc": { + "version": "50.6.17", + "resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-50.6.17.tgz", + "integrity": "sha512-hq+VQylhd12l8qjexyriDsejZhqiP33WgMTy2AmaGZ9+MrMWVqPECsM87GPxgHfQn0zw+YTuhqjUfk1f+q67aQ==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "@es-joy/jsdoccomment": "~0.50.1", + "are-docs-informative": "^0.0.2", + "comment-parser": "1.4.1", + "debug": "^4.3.6", + "escape-string-regexp": "^4.0.0", + "espree": "^10.1.0", + "esquery": "^1.6.0", + "parse-imports-exports": "^0.2.4", + "semver": "^7.6.3", + "spdx-expression-parse": "^4.0.0" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "eslint": "^7.0.0 || ^8.0.0 || ^9.0.0" + } + }, "node_modules/eslint-scope": { "version": "8.3.0", "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.3.0.tgz", @@ -2245,10 +2308,11 @@ } }, "node_modules/esquery": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.5.0.tgz", - "integrity": "sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.6.0.tgz", + "integrity": "sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg==", "dev": true, + "license": "BSD-3-Clause", "dependencies": { "estraverse": "^5.1.0" }, @@ -2792,6 +2856,16 @@ "js-yaml": "bin/js-yaml.js" } }, + "node_modules/jsdoc-type-pratt-parser": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/jsdoc-type-pratt-parser/-/jsdoc-type-pratt-parser-4.1.0.tgz", + "integrity": "sha512-Hicd6JK5Njt2QB6XYFS7ok9e37O8AYk3jTcppG4YVQnYjOemymvTcmc7OWsmq/Qqj5TdRFO5/x/tIPmBeRtGHg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12.0.0" + } + }, "node_modules/json-buffer": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", @@ -3119,6 +3193,23 @@ "node": ">=6" } }, + "node_modules/parse-imports-exports": { + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/parse-imports-exports/-/parse-imports-exports-0.2.4.tgz", + "integrity": "sha512-4s6vd6dx1AotCx/RCI2m7t7GCh5bDRUtGNvRfHSP2wbBQdMi67pPe7mtzmgwcaQ8VKK/6IB7Glfyu3qdZJPybQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "parse-statements": "1.0.11" + } + }, + "node_modules/parse-statements": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/parse-statements/-/parse-statements-1.0.11.tgz", + "integrity": "sha512-HlsyYdMBnbPQ9Jr/VgJ1YF4scnldvJpJxCVx6KgqPL4dxppsWrJHCIIxQXMJrqGnsRkNPATbeMJ8Yxu7JMsYcA==", + "dev": true, + "license": "MIT" + }, "node_modules/path-exists": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", @@ -3795,6 +3886,31 @@ "deprecated": "Please use @jridgewell/sourcemap-codec instead", "dev": true }, + "node_modules/spdx-exceptions": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.5.0.tgz", + "integrity": "sha512-PiU42r+xO4UbUS1buo3LPJkjlO7430Xn5SVAhdpzzsPHsjbYVflnnFdATgabnLude+Cqu25p6N+g2lw/PFsa4w==", + "dev": true, + "license": "CC-BY-3.0" + }, + "node_modules/spdx-expression-parse": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-4.0.0.tgz", + "integrity": "sha512-Clya5JIij/7C6bRR22+tnGXbc4VKlibKSVj2iHvVeX5iMW7s1SIQlqu699JkODJJIhh/pUu8L0/VLh8xflD+LQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, + "node_modules/spdx-license-ids": { + "version": "3.0.21", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.21.tgz", + "integrity": "sha512-Bvg/8F5XephndSK3JffaRqdT+gyhfqIPwDHpX80tJrF8QQRYMo8sNMeaZ2Dp5+jhwKnUmIOyFFQfHRkjJm5nXg==", + "dev": true, + "license": "CC0-1.0" + }, "node_modules/string-width": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", diff --git a/package.json b/package.json index 865b878..a4fd840 100644 --- a/package.json +++ b/package.json @@ -62,6 +62,7 @@ "concurrently": "^9.1.2", "eslint": "^9.28.0", "eslint-plugin-chai-friendly": "^1.0.1", + "eslint-plugin-jsdoc": "^50.6.17", "globals": "^16.2.0", "mocha": "^11.1.0", "prettier": "^3.5.3", From 21e5c367fc6db15804250fd8dc17a017947648b2 Mon Sep 17 00:00:00 2001 From: Jefferson Rylee Date: Sat, 31 May 2025 11:33:20 +0800 Subject: [PATCH 21/26] Add jsdoc eslint plugin to eslint config --- eslint.config.mjs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/eslint.config.mjs b/eslint.config.mjs index 7060ae1..9586471 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -2,6 +2,7 @@ import eslint from '@eslint/js'; // @ts-expect-error: package has no type declarations import pluginChaiFriendly from 'eslint-plugin-chai-friendly'; +import jsdoc from 'eslint-plugin-jsdoc'; import globals from 'globals'; import tseslint from 'typescript-eslint'; @@ -37,6 +38,7 @@ export default tseslint.config( eqeqeq: ['warn', 'always', { null: 'ignore' }], 'no-constant-condition': 'warn', 'no-empty': 'warn', + 'no-lonely-if': 'warn', 'no-throw-literal': 'warn', 'no-unused-expressions': 'off', // use typescript-eslint 'no-unused-private-class-members': 'warn', @@ -50,6 +52,11 @@ export default tseslint.config( semi: 'warn' } }, + { + // for imported types used only in jsdoc comments + plugins: { jsdoc }, + rules: { 'jsdoc/no-undefined-types': ['warn', { disableReporting: true }] } + }, { // for tests only, override no-unused-expressions files: ['**/*.spec.ts'], From bb332a5e52362efbe3246c62632e853bd39267a5 Mon Sep 17 00:00:00 2001 From: Jefferson Rylee Date: Sat, 31 May 2025 11:33:29 +0800 Subject: [PATCH 22/26] Fix eslint errors --- src/types/output.types.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/types/output.types.ts b/src/types/output.types.ts index f0770c7..e89fb8b 100644 --- a/src/types/output.types.ts +++ b/src/types/output.types.ts @@ -1,5 +1,4 @@ -// eslint-disable-next-line @typescript-eslint/no-unused-vars -import type { Options } from './core.types'; +import { Options } from './core.types'; import { Size } from './size.types'; /** From d0e49b41bb9b75dd721abbf4fca19c13c3fc9e57 Mon Sep 17 00:00:00 2001 From: Jefferson Rylee Date: Sat, 31 May 2025 11:42:53 +0800 Subject: [PATCH 23/26] Ignore node_modules in mocha config --- .mocharc.cjs | 1 + 1 file changed, 1 insertion(+) diff --git a/.mocharc.cjs b/.mocharc.cjs index 5539a8c..0039045 100644 --- a/.mocharc.cjs +++ b/.mocharc.cjs @@ -2,6 +2,7 @@ module.exports = { require: 'tsx', spec: ['**/*.spec.ts'], + ignore: ['node_modules/**/*'], watchFiles: ['src', 'test'], watchIgnore: ['test/fixtures'] }; From 3dbb3d6fe485f43e3d24023edeea5e22a9370b91 Mon Sep 17 00:00:00 2001 From: Jefferson Rylee Date: Sat, 31 May 2025 11:50:30 +0800 Subject: [PATCH 24/26] Update preview image --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index bf99748..d6f3171 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ [npm-url]: https://www.npmjs.com/package/rollup-plugin-output-size [ci-img]: https://github.com/Arnesfield/rollup-plugin-output-size/workflows/Node.js%20CI/badge.svg [ci-url]: https://github.com/Arnesfield/rollup-plugin-output-size/actions?query=workflow%3A"Node.js+CI" -[preview-img]: https://gist.githubusercontent.com/Arnesfield/0f85b2ddfa1109aec6ed2ec46ee42b03/raw/7cc3b49fc8496cc71db41a0f273871636520a611/preview.png +[preview-img]: https://gist.githubusercontent.com/Arnesfield/0f85b2ddfa1109aec6ed2ec46ee42b03/raw/916870f919fea8c8c61dfaf10afb32f892583111/preview.png A Rollup plugin that displays output bundle sizes. From 6eb1c0dfc76e5f03e9fb77e31b228e464f2eafb8 Mon Sep 17 00:00:00 2001 From: Jefferson Rylee Date: Sat, 31 May 2025 11:52:56 +0800 Subject: [PATCH 25/26] Update node version in workflow config --- .github/workflows/node.js.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 2d4499d..aa2aae9 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -15,7 +15,7 @@ jobs: strategy: matrix: - node-version: [18.x, 20.x, 22.x] + node-version: ['>=20.12.0', 22.x] # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ steps: From 51ddbd274a8e2916a80c723b357ac0cf384bfebb Mon Sep 17 00:00:00 2001 From: Jefferson Rylee Date: Sat, 31 May 2025 11:57:10 +0800 Subject: [PATCH 26/26] 2.0.0 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 1143893..e81e348 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "rollup-plugin-output-size", - "version": "1.6.1", + "version": "2.0.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "rollup-plugin-output-size", - "version": "1.6.1", + "version": "2.0.0", "license": "MIT", "devDependencies": { "@eslint/js": "^9.28.0", diff --git a/package.json b/package.json index a4fd840..f1606da 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rollup-plugin-output-size", - "version": "1.6.1", + "version": "2.0.0", "description": "A Rollup plugin that displays output bundle sizes.", "keywords": [ "rollup-plugin",