Skip to content

fix(cli): fix BUILTIN_MODULES Set syntax and add builtin module filtering - #11566

Open
waterWang wants to merge 1 commit into
shadcn-ui:mainfrom
waterWang:fix/builtin-modules-set-syntax
Open

fix(cli): fix BUILTIN_MODULES Set syntax and add builtin module filtering#11566
waterWang wants to merge 1 commit into
shadcn-ui:mainfrom
waterWang:fix/builtin-modules-set-syntax

Conversation

@waterWang

Copy link
Copy Markdown

Closes #11565

Changes

1. Fix BUILTIN_MODULES Set syntax (constants.ts)

The Set was defined with an extra outer array wrapper (new Set([[...]])), causing the Set to contain a single array element instead of individual strings. This made BUILTIN_MODULES.has() always return false.

2. Add builtin module filtering (utils.ts)

getDependencyFromModuleSpecifier now checks BUILTIN_MODULES before processing. Bare Node.js imports like path, fs/promises, crypto are no longer incorrectly added as npm dependencies in package.json.

…ring

- Fix BUILTIN_MODULES Set definition: remove outer array brackets that
  caused the Set to contain a single array element instead of individual
  strings, making BUILTIN_MODULES.has() always return false.
- Add BUILTIN_MODULES check in getDependencyFromModuleSpecifier to
  prevent Node.js built-in modules from being added as npm dependencies
  in package.json.

Closes shadcn-ui#11565
@vercel

vercel Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

@waterWang is attempting to deploy a commit to the shadcn-pro Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions

Copy link
Copy Markdown
Contributor

Can you sign the commits please? See https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits. Thank you.

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.

[bug]: fix(cli): BUILTIN_MODULES Set nested array bug and missing builtin filtering in getDependencyFromModuleSpecifier

1 participant