Skip to content

feat: add @node-cli/bundlecheck package - #474

Merged
aversini merged 10 commits into
mainfrom
feat-add-@node-cli/bundlecheck-package
Jan 31, 2026
Merged

aversini merged 10 commits into
mainfrom
feat-add-@node-cli/bundlecheck-package

Conversation

@aversini

Copy link
Copy Markdown
Collaborator

Introduce a new CLI package to analyze npm package bundle sizes. Adds package metadata and README, TypeScript sources (CLI entry, bundler, parser, defaults), and build/test configs (.swcrc, tsconfig, vitest.config.ts). The tool uses esbuild to produce minified bundles and reports raw and gzip sizes, with support for selecting exports and marking externals.

Introduce a new CLI package to analyze npm package bundle sizes. Adds package metadata and README, TypeScript sources (CLI entry, bundler, parser, defaults), and build/test configs (.swcrc, tsconfig, vitest.config.ts). The tool uses esbuild to produce minified bundles and reports raw and gzip sizes, with support for selecting exports and marking externals.
Comment thread packages/bundlecheck/src/bundler.ts Fixed
Comment thread packages/bundlecheck/src/bundler.ts Fixed
Comment thread packages/bundlecheck/src/bundler.ts Fixed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new @node-cli/bundlecheck CLI package for measuring npm package bundle sizes (raw + gzip), including interactive version selection and multi-version “trend” output.

Changes:

  • Introduces the new packages/bundlecheck workspace package (CLI entrypoint, bundling logic via esbuild, version fetching/prompting, trend rendering).
  • Adds Vitest configuration and a fairly comprehensive unit test suite for the bundler, versions, and trend logic.
  • Updates pnpm-lock.yaml to include the new package and its dependency graph.

Reviewed changes

Copilot reviewed 14 out of 15 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
pnpm-lock.yaml Adds lockfile entries for the new bundlecheck package and updated dependency resolutions.
packages/bundlecheck/vitest.config.ts Vitest + coverage configuration for the new package.
packages/bundlecheck/tsconfig.json TypeScript build config for generating declarations.
packages/bundlecheck/src/versions.ts Fetches package versions from npm and prompts for interactive selection.
packages/bundlecheck/src/trend.ts Computes and renders multi-version bundle size trends.
packages/bundlecheck/src/parse.ts CLI argument/flag parsing via @node-cli/parser.
packages/bundlecheck/src/defaults.ts Defines default CLI flag values and constants.
packages/bundlecheck/src/bundler.ts Core bundling logic (temp install, entry generation, esbuild bundle, gzip sizing).
packages/bundlecheck/src/bundlecheck.ts CLI entrypoint wiring parsing → analysis → output.
packages/bundlecheck/src/tests/versions.test.ts Tests for npm registry version fetching and interactive prompt behavior.
packages/bundlecheck/src/tests/trend.test.ts Tests for trend selection, analysis, and rendering.
packages/bundlecheck/src/tests/bundler.test.ts Tests for package spec parsing and bundling behavior with extensive mocking.
packages/bundlecheck/package.json Package metadata, bin entry, scripts, and dependencies.
packages/bundlecheck/README.md User-facing documentation for installing and using bundlecheck.
packages/bundlecheck/.swcrc SWC build configuration for transpiling TS sources to dist.
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

Comment thread packages/bundlecheck/src/versions.ts Outdated
Comment thread packages/bundlecheck/src/defaults.ts
Comment thread packages/bundlecheck/src/bundler.ts Outdated
Comment thread packages/bundlecheck/src/bundlecheck.ts Outdated
Comment thread packages/bundlecheck/src/bundlecheck.ts Outdated
Comment thread packages/bundlecheck/package.json Outdated
Parse and preserve package subpaths from the package specifier. Construct a fullPackagePath (name[/subpath]) and use it for trend analysis and graph rendering so subpaths are not lost. Also rebuild the package specifier when a version is selected to keep any subpath (e.g. name/subpath@version).
Update packages/bundlecheck/package.json to require Node.js >=20 (previously >=18). This raises the minimum Node version for the bundlecheck package to align with updated runtime requirements and ensure compatibility with newer language/runtime features.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 14 out of 15 changed files in this pull request and generated 10 comments.

Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

Comment thread packages/bundlecheck/package.json
Comment thread packages/bundlecheck/README.md
Comment thread packages/bundlecheck/README.md
Comment thread packages/bundlecheck/src/trend.ts Outdated
Comment thread packages/bundlecheck/package.json
Comment thread packages/bundlecheck/src/parse.ts
Comment thread packages/bundlecheck/src/parse.ts
Comment thread packages/bundlecheck/src/versions.ts
Comment thread packages/bundlecheck/src/bundlecheck.ts
Comment thread packages/bundlecheck/src/__tests__/versions.test.ts Outdated
Set kleur.enabled = !flags?.boring so ANSI colors are disabled when the --boring flag is used. This change is applied before Logger is constructed to ensure color output is consistently turned off for subsequent logging and CLI output.
Ensure gzip and raw trend values always display an explicit sign. Change uses >= 0 to prefix a '+' for zero/positive values and formats negative values with '-' plus the absolute byte value to avoid double-negative output and keep sign presentation consistent for both gzip and raw sizes.
@aversini
aversini merged commit 8598892 into main Jan 31, 2026
6 checks passed
@aversini
aversini deleted the feat-add-@node-cli/bundlecheck-package branch January 31, 2026 02:02
@aversini aversini mentioned this pull request Jan 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants