Repository navigation
fix(cli): wait for the postInstall script before qwik add exits - #9371
Conversation
🦋 Changeset detectedLatest commit: a3279bf The changes in this PR will be included in the next version bump. This PR includes changesets to release 8 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
@qwik.dev/core
@qwik.dev/router
@qwik.dev/utils
eslint-plugin-qwik
create-qwik
@qwik.dev/optimizer
@qwik.dev/devtools
@qwik.dev/mcp
commit: |
|
⚡ Docs preview for a3279bf |
What is it?
Description
qwik add <integration>returns from the integration'spostInstallscript before that script has finished.runInPkgreturns{ install, abort }synchronously, andrunAddInteractiveawaits the object instead of theinstallpromise, so the spinner prints "Post install script complete" and the process hitsprocess.exit(0)while the child is still running. The child is killed with it.Three starters declare a
postInstalltoday:playwright install,panda codegen --silent, and the Prisma starter'sprisma contract emit(prisma migrate dev --name initialbefore #9358). None of them can finish unless they complete within a few milliseconds, and a failing script is never reported.Change
installpromise, the same waycheck-clientalready does.Post install script failed: <script>, print an "Action Required" note with the command to rerun (npx <script>for npm,<pkgManager> <script>otherwise), and exit with status 1 instead of printing the Success footer.runCommandalready logs the execa error above it.How I tested it
Built the CLI from this branch (
pnpm build.cli) and ranqwik add prisma --skipConfirmation=trueagainst a freshnpm create qwik@rc -- emptyapp (Qwik 2.0.0-rc.4, Node 24.11.1, npm 11.6.2), with the Prisma starter from #9358 copied intodist/starters:prisma/contract.jsonis never written.prisma/contract.jsonandprisma/contract.d.tsexist when the CLI exits, andnpm run buildpasses.postInstalledited toprisma no-such-command: the CLI logsCommand failed with exit code 2: npx prisma no-such-command, stops the spinner with "Post install script failed: prisma no-such-command", prints the Action Required note withnpx prisma no-such-command, does not print the Success footer, and exits with status 1.pnpm vitest run packages/qwik/src/cli: 152 tests pass.#9358 depends on this: its
postInstallgenerates the files the starter'sprisma/db.tsimports.Checklist
pnpm change