Skip to content

fix(targets): Add missing spawnProcess imports in pypi and crates#746

Merged
BYK merged 1 commit intomasterfrom
fix/missing-spawnprocess-imports
Feb 7, 2026
Merged

fix(targets): Add missing spawnProcess imports in pypi and crates#746
BYK merged 1 commit intomasterfrom
fix/missing-spawnprocess-imports

Conversation

@BYK
Copy link
Member

@BYK BYK commented Feb 7, 2026

Summary

Fixes runtime error spawnProcess is not defined when publishing to PyPI target.

Problem

The pypi.ts and crates.ts targets used spawnProcess without importing it, causing runtime errors:

Error: spawnProcess is not defined
  at _PypiTarget.uploadAssets (/usr/local/bin/craft:128938:9)

This was not caught because:

  • esbuild (used for builds) doesn't perform type checking
  • Tests mocked the entire uploadAssets method instead of testing the real implementation

Changes

  • Add missing spawnProcess import to pypi.ts and crates.ts
  • Add test that exercises the real uploadAssets implementation (mocks spawnProcess dependency instead of the method)
  • Add typecheck script to package.json for local development

Note

Full CI type checking was considered but deferred - the codebase has ~150 pre-existing type errors that would need to be fixed first. The pnpm typecheck script is available for developers to catch similar issues locally.

The pypi and crates targets used spawnProcess without importing it,
causing runtime errors during publishing. This was not caught because:
- esbuild (used for builds) doesn't perform type checking
- Tests mocked the entire method instead of the dependency

Changes:
- Add missing spawnProcess import to pypi.ts and crates.ts
- Add test that exercises real uploadAssets implementation
- Add typecheck script for local development
@BYK BYK marked this pull request as ready for review February 7, 2026 02:13
@BYK BYK merged commit 6816252 into master Feb 7, 2026
16 checks passed
@BYK BYK deleted the fix/missing-spawnprocess-imports branch February 7, 2026 10:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant