Skip to content

feat: normalize all package manager execute commands#333

Open
Inv1x wants to merge 6 commits intoTanStack:mainfrom
Inv1x:feat/normalize-execute-commands
Open

feat: normalize all package manager execute commands#333
Inv1x wants to merge 6 commits intoTanStack:mainfrom
Inv1x:feat/normalize-execute-commands

Conversation

@Inv1x
Copy link

@Inv1x Inv1x commented Feb 6, 2026

Summary

Currently, add-on commands only work correctly when specified as npx. If a custom or external add-on uses a different format (like bunx, pnpx, pnpm dlx, etc.), the command passes through untranslated — which breaks things for users on a different package manager.

This PR fixes that by:

  • Adding a translateExecuteCommand function 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 chose
  • Adding a getPackageManagerExecuteScript EJS template helper so add-on templates can also emit the right execute command
  • Converting several add-on templates (READMEs, env files, demo routes) to EJS so they use the new helper instead of hardcoding npx

Non-execute commands (like node script.js or pnpm install) pass through unchanged.

Test plan

  • 16 new tests covering all input formats, flag stripping (-y, --bun, npm: prefix), and passthrough behavior
  • New test for the EJS template helper
  • All 178 existing tests still pass
  • Manually verified the built output against yarn and bun targets

Inv1x added 4 commits February 6, 2026 21:35
…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.
Copilot AI review requested due to automatic review settings February 6, 2026 18:40
Copy link

Copilot AI left a 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 translateExecuteCommand to normalize/translate execute-style commands and applied it when running add-on/starter commands.
  • Added getPackageManagerExecuteScript EJS 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.

Copy link

Copilot AI left a 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.

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.

1 participant