Skip to content

bug/ux: --install flag fires postInstall hooks but never runs pnpm install #352

@perasperaactual

Description

@perasperaactual

Problem

scaffold() in packages/cli/src/commands/scaffold.ts checks if (opts.install) to run postInstall hooks — but never actually executes pnpm install.

The postInstall hooks are designed to run after packages are installed (verification, setup steps that require the packages to be present). But since install never runs, postInstall hooks never get a chance to do meaningful work.

Additionally, the --install flag name implies that passing it installs packages. It doesn't.

Impact

  • postInstall hooks are dead code in practice (nobody passes --install expecting hooks, not install)
  • Pro packages that verify installation in postInstall never actually verify anything
  • Workaround required: launch-stackwright-pro manually runs pnpm install via execSync after scaffold() returns, then manually fires postInstall hooks. This is unnecessary complexity.

Fix

When opts.install = true, exec pnpm install in targetDir before firing postInstall hooks:

if (opts.install) {
  execSync('pnpm install', { cwd: targetDir, stdio: 'inherit' });
  await runScaffoldHooks('postInstall', { ... });
}

UX Consideration

Per PHILOSOPHY.md: 'Day 0: A non-developer chats with a branding agent... The output is a complete, deployed site — all within a single conversation.'

launch-stackwright currently tells users to run pnpm install manually. Consider making --install default to true for the launch-stackwright launcher (not the raw stackwright scaffold command, which has different audiences).

Files: packages/cli/src/commands/scaffold.ts

Surfaced during audit of the pro scaffold hook pipeline — see stackwright-agent-coordination for full context.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions