Skip to content

fix(create): clean pnpm scaffolds + package-manager-aware next steps#235

Merged
DylanPiercey merged 1 commit into
mainfrom
dpiercey-ws-cli-create-n9kgdk
Jul 22, 2026
Merged

fix(create): clean pnpm scaffolds + package-manager-aware next steps#235
DylanPiercey merged 1 commit into
mainfrom
dpiercey-ws-cli-create-n9kgdk

Conversation

@DylanPiercey

@DylanPiercey DylanPiercey commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Polish for pnpm create marko output:

  • esbuild build scripts: pnpm blocks build scripts by default, so vite-based templates errored with ERR_PNPM_IGNORED_BUILDS and left esbuild unbuilt. create now runs pnpm approve-builds esbuild (only esbuild, and only persists the allowBuilds config when esbuild was actually installed) and re-installs to confirm.
  • Quiet output: install and git now run captured behind the clack spinner, which transitions Downloading → Installing dependencies with pnpm → Setting up git repository → Project created. The noisy internals (the transient ignored-builds error, esbuild postinstall, the confirm re-install, husky's .git can't be found, and git probes like fatal: not a git repository) are hidden. Install output is surfaced only if it genuinely fails.
  • Next steps: uses the detected package manager (e.g. pnpm run dev) instead of always npm run dev.

Verified end-to-end: pnpm app scaffold shows clean spinner output, still approves + builds esbuild (allowBuilds: { esbuild: true }), inits git, and the app builds.

@changeset-bot

changeset-bot Bot commented Jul 22, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: fa76a42

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@marko/create Patch
create-marko Patch

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

@DylanPiercey
DylanPiercey merged commit 8e6cbbc into main Jul 22, 2026
9 checks passed
@DylanPiercey
DylanPiercey deleted the dpiercey-ws-cli-create-n9kgdk branch July 22, 2026 17:15
@github-actions github-actions Bot mentioned this pull request Jul 22, 2026
@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

Scaffolding now retries failed pnpm installations after approving esbuild build scripts. The CLI generates next-step commands using the detected package manager and the available dev or start script. The changeset records patch releases for @marko/create and create-marko and updates the scaffolding instructions.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the pnpm scaffold cleanup and package-manager-aware next steps.
Description check ✅ Passed The description directly matches the scaffold changes and pnpm/esbuild behavior updates.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dpiercey-ws-cli-create-n9kgdk

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/create/src/create.ts`:
- Around line 199-214: Update the retry logic around the pnpm fallback and the
error produced by exec so the catch can inspect preserved diagnostic output,
proceed only when the failure is ERR_PNPM_IGNORED_BUILDS and the report names
esbuild, and otherwise return false immediately. Keep the existing
approve-builds esbuild and install retry unchanged for the qualifying case,
while retaining the original error output for diagnostics.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 8a50d764-c77f-4a8a-bc97-46a748bbb675

📥 Commits

Reviewing files that changed from the base of the PR and between d3ab41b and fa76a42.

📒 Files selected for processing (3)
  • .changeset/scaffold-pnpm-polish.md
  • packages/create/src/cli.ts
  • packages/create/src/create.ts

Comment on lines +199 to +214
// pnpm exits non-zero when it blocks a dependency's build scripts. The
// vite-based templates rely on esbuild's, so approve just esbuild — pnpm
// writes nothing and no-ops if esbuild wasn't actually installed — then
// re-install to confirm that was the only problem. Any other package
// manager (or a genuine pnpm failure) is a real error.
if (installer !== "pnpm") return false;

try {
await exec(cwd, installer, ["approve-builds", "esbuild"], {
shell: true,
});
await exec(cwd, installer, ["install"], { shell: true });
return true;
} catch {
return false;
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Gate the retry on the actual esbuild ignored-build error.

packages/create/src/exec.ts rejects with only a generic exit-code error, so this catch cannot distinguish ERR_PNPM_IGNORED_BUILDS from network, authentication, lockfile, or unrelated dependency failures. Every pnpm failure therefore runs approve-builds esbuild, potentially persisting build configuration in templates without esbuild, before retrying. Preserve the diagnostic output and only approve/retry when the ignored-build report names esbuild; otherwise return false.

Suggested gating shape
-  } catch {
-    if (installer !== "pnpm") return false;
+  } catch (err) {
+    if (
+      installer !== "pnpm" ||
+      !isEsbuildIgnoredBuildError(err)
+    ) {
+      return false;
+    }
🧰 Tools
🪛 OpenGrep (1.25.0)

[ERROR] 207-209: Dynamic command passed to child_process.exec/execSync. Use child_process.execFile or spawn with an argument array instead.

(coderabbit.command-injection.exec-js)


[ERROR] 210-210: Dynamic command passed to child_process.exec/execSync. Use child_process.execFile or spawn with an argument array instead.

(coderabbit.command-injection.exec-js)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/create/src/create.ts` around lines 199 - 214, Update the retry logic
around the pnpm fallback and the error produced by exec so the catch can inspect
preserved diagnostic output, proceed only when the failure is
ERR_PNPM_IGNORED_BUILDS and the report names esbuild, and otherwise return false
immediately. Keep the existing approve-builds esbuild and install retry
unchanged for the qualifying case, while retaining the original error output for
diagnostics.

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