Skip to content

[create-croco-app] Make the packaged CLI and generated scripts cross-platform #1321

Description

@kang-heewon

Priority

P1

Problem

The packaged scaffold CLI and several generated scripts assume POSIX path and shell behavior. Generated projects can therefore fail on Windows even when their TypeScript/application code is portable.

Evidence

  • packages/create-croco-app/src/template-path.ts:1 uses new URL(...).pathname instead of fileURLToPath(), which mishandles Windows drive paths and URL-encoded spaces.
  • packages/create-croco-app/src/cli-result.ts:96-139 emits shell commands using POSIX single-quote escaping.
  • SaaS and AI-SaaS package templates contain 20 NODE_PATH=... inline environment assignments, which are not portable to Windows command shells.
  • Several scripts call generated binaries through explicit POSIX-oriented paths instead of package-manager binary resolution.
  • Generated-app CI runs on Ubuntu only; there is no packed Windows scaffold smoke.
  • Existing cross-platform/Windows scaffold searches found no covering issue.

Desired outcome

The published CLI can locate templates and generate an application from Windows paths, and every generated validation command runs without requiring a POSIX compatibility shell.

Proposed implementation

  1. Resolve template URLs with fileURLToPath() and add encoded-space/Windows-drive fixtures.
  2. Remove inline NODE_PATH=... assignments by invoking declared package binaries through portable pnpm resolution.
  3. Keep machine-readable next steps structured rather than embedding POSIX quoting; render human commands for the current platform where needed.
  4. Audit generated package scripts for shell-specific environment assignment, quoting, separators, and executable paths.
  5. Add a windows-latest packed-CLI scaffold job for a representative goal.
  6. Run generated doctor, contract verification, typecheck, and build on Windows.

Acceptance criteria

  • The packed CLI locates templates from a Windows path containing spaces.
  • Generated package scripts contain no POSIX-only environment assignment syntax.
  • Machine-readable CLI output does not require consumers to parse shell-escaped command strings.
  • A generated SaaS or internal-tool project completes its declared validation path on windows-latest.
  • Existing Linux generated-app smoke remains green.
  • Failures retain stable diagnostics and recovery instructions.

Validation

  • pnpm --filter create-croco-app test
  • pnpm create-croco-app:smoke
  • Packed CLI generation on windows-latest.
  • In the generated project, run doctor, contract verification, typecheck, and build.
  • Add unit fixtures for URL-encoded spaces and Windows drive paths.

Scope boundaries

Do not promise support for package managers other than pnpm or redesign every human-facing shell example. The target is the published CLI and generated scripts required by the supported validation path.

Metadata

Metadata

Assignees

Labels

P1Priority 1 issuebugSomething isn't workingciContinuous integration checks and repository quality gatescreate-croco-appdeveloper-experienceDeveloper ergonomics and local workflow improvementstestingTesting utilities, harnesses, and verification workflows

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions