-
-
Notifications
You must be signed in to change notification settings - Fork 132
feat: normalize all package manager execute commands #333
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…ates to EJS Convert add-on README, env, and demo files to EJS templates so they can use package-manager-aware commands (e.g. npx/bunx/pnpm dlx) via the new getPackageManagerExecuteScript template helper.
…uteCommand Rename translateNpxCommand to translateExecuteCommand and extend it to recognize all known execute-command formats (npx, bunx, pnpx, pnpm dlx, yarn dlx, deno run npm:*). This ensures add-on commands specified in any format are correctly translated to the user's chosen package manager.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR standardizes “package manager execute” commands across the create flow and add-on templates, so external/add-on commands authored in various formats (npx, bunx, pnpm dlx, yarn dlx, deno run npm:*) can be translated to the user’s chosen package manager and rendered consistently in generated files.
Changes:
- Added
translateExecuteCommandto normalize/translate execute-style commands and applied it when running add-on/starter commands. - Added
getPackageManagerExecuteScriptEJS helper and migrated various add-on docs/env/demo templates to use it. - Added/expanded tests for execute-command translation and the new EJS helper.
Reviewed changes
Copilot reviewed 19 out of 19 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/create/tests/template-file.test.ts | Adds test coverage for the new EJS helper that emits package-manager-aware execute commands. |
| packages/create/tests/package-manager.test.ts | Adds test suite validating translateExecuteCommand across multiple execute-command formats and passthrough cases. |
| packages/create/src/template-file.ts | Introduces getPackageManagerExecuteScript and exposes it to EJS templates. |
| packages/create/src/package-manager.ts | Adds translateExecuteCommand and execute-command parsing to translate known execute formats into the target package manager. |
| packages/create/src/frameworks/solid/add-ons/solid-ui/README.md.ejs | Updates docs to render execute command via the new EJS helper. |
| packages/create/src/frameworks/solid/add-ons/convex/README.md.ejs | Converts Convex README to EJS template using the execute helper. |
| packages/create/src/frameworks/solid/add-ons/convex/README.md | Removes the non-templated Convex README. |
| packages/create/src/frameworks/solid/add-ons/better-auth/assets/_dot_env.local.append.ejs | Converts env append snippet to EJS and uses execute helper for CLI command display. |
| packages/create/src/frameworks/solid/add-ons/better-auth/assets/_dot_env.local.append | Removes non-templated env append snippet. |
| packages/create/src/frameworks/solid/add-ons/better-auth/README.md.ejs | Updates Better Auth README template to use execute helper for CLI commands. |
| packages/create/src/frameworks/react/add-ons/prisma/package.json.ejs | Uses execute helper to generate package-manager-aware post-init command. |
| packages/create/src/frameworks/react/add-ons/prisma/assets/src/routes/demo/prisma.tsx.ejs | Updates demo UI text to show package-manager-aware Prisma commands. |
| packages/create/src/frameworks/react/add-ons/drizzle/assets/src/routes/demo/drizzle.tsx.ejs | Updates demo UI text to show package-manager-aware Drizzle commands. |
| packages/create/src/frameworks/react/add-ons/convex/README.md.ejs | Converts Convex README to EJS template using the execute helper. |
| packages/create/src/frameworks/react/add-ons/convex/README.md | Removes the non-templated Convex README. |
| packages/create/src/frameworks/react/add-ons/better-auth/assets/_dot_env.local.append.ejs | Converts env append snippet to EJS and uses execute helper for CLI command display. |
| packages/create/src/frameworks/react/add-ons/better-auth/assets/_dot_env.local.append | Removes non-templated env append snippet. |
| packages/create/src/frameworks/react/add-ons/better-auth/README.md.ejs | Updates Better Auth README template to use execute helper for CLI commands. |
| packages/create/src/create-app.ts | Applies execute-command translation when running add-on and starter commands. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
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 23 out of 23 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary
Currently, add-on commands only work correctly when specified as
npx. If a custom or external add-on uses a different format (likebunx,pnpx,pnpm dlx, etc.), the command passes through untranslated — which breaks things for users on a different package manager.This PR fixes that by:
translateExecuteCommandfunction that recognizes all common execute-command formats (npx,bunx,pnpx,pnpm dlx,yarn dlx,deno run npm:*) and normalizes them to whatever package manager the user chosegetPackageManagerExecuteScriptEJS template helper so add-on templates can also emit the right execute commandnpxNon-execute commands (like
node script.jsorpnpm install) pass through unchanged.Test plan
-y,--bun,npm:prefix), and passthrough behavior