Skip to content

fix: resolve Windows build/check crash and npm shrinkwrap registry 404#29

Merged
code-yeongyu merged 1 commit into
code-yeongyu:mainfrom
SHJordan:fix/windows-build-and-shrinkwrap
Jun 15, 2026
Merged

fix: resolve Windows build/check crash and npm shrinkwrap registry 404#29
code-yeongyu merged 1 commit into
code-yeongyu:mainfrom
SHJordan:fix/windows-build-and-shrinkwrap

Conversation

@SHJordan

@SHJordan SHJordan commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

This PR fixes two issues:

  1. Windows build/check crash:

    • In scripts/build-all.mjs and scripts/run-web-ui-check.mjs, the script was trying to evaluate native binaries (such as pnpm.exe on Windows, which is set in npm_execpath by newer pnpm installations) using Node.js, causing a SyntaxError. We fixed this by detecting if the execpath does not end in .js/.cjs (which indicates a native binary) and running it directly instead of wrapping it via Node.
  2. Package shrinkwrap dependency registry 404 error:

    • The generated npm-shrinkwrap.json for @code-yeongyu/senpi contained registry references to internal, private workspace packages (like @earendil-works/pi-tui) which are bundled but not actually published to the public registry. This resulted in 404 Not Found errors when users tried to install @code-yeongyu/senpi.
    • We updated scripts/generate-coding-agent-shrinkwrap.mjs to mark internal dependencies as "inBundle": true and omit resolved URL registry references, forcing npm to resolve them from the bundled contents.

Summary by cubic

Fixes Windows build/check crashes by executing native package manager binaries directly. Also updates shrinkwrap generation to bundle internal packages, avoiding registry 404s when installing @code-yeongyu/senpi.

  • Bug Fixes
    • Detect native package manager execpaths (e.g., pnpm.exe) and run them directly in build/check scripts; otherwise load .js/.cjs via Node.
    • Mark internal workspace deps (@earendil-works/pi-agent-core, @earendil-works/pi-ai, @earendil-works/pi-tui) as "inBundle": true and omit resolved URLs in the generated npm-shrinkwrap.json.

Written for commit 59e2bec. Summary will update on new commits.

Review in cubic

@cubic-dev-ai cubic-dev-ai 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.

No issues found across 4 files

Re-trigger cubic

- Fix scripts/build-all.mjs and scripts/run-web-ui-check.mjs to execute native package manager binaries directly instead of passing them to node on Windows.

- Fix generate-coding-agent-shrinkwrap.mjs to mark internal workspace dependencies with inBundle: true and avoid registry resolution paths.
@code-yeongyu code-yeongyu force-pushed the fix/windows-build-and-shrinkwrap branch from 5e3d7d1 to 59e2bec Compare June 15, 2026 03:34
@code-yeongyu code-yeongyu merged commit 1e49bdc into code-yeongyu:main Jun 15, 2026
1 check passed
@code-yeongyu

Copy link
Copy Markdown
Owner

[sisyphus-bot] Rebased this branch onto the latest main and merged it via a merge commit.

The only conflict was the generated packages/coding-agent/npm-shrinkwrap.json. Rather than hand-merging it, I resolved it by regenerating the lockfile from scratch (node scripts/generate-coding-agent-shrinkwrap.mjs) on top of current main, then validated with node scripts/generate-coding-agent-shrinkwrap.mjs --check, which exits 0. The regeneration preserved your core fix: the internal @earendil-works/pi-* workspace deps are marked inBundle: true instead of carrying a resolved registry URL that 404s.

I verified both fixes:

  • The native package-manager guard pm.execpath && (pm.cmd === "bun" || !/\.[cm]?js$/i.test(pm.execpath)) is present in both scripts/build-all.mjs and scripts/run-web-ui-check.mjs. This is backward-compatible: for bun/npm/pnpm-as-.js it behaves exactly as before, and the new branch only triggers for non-.js execpaths such as pnpm.exe. The Windows-specific path can't be exercised on the macOS CI here, so it was reviewed rather than run on Windows.
  • The shrinkwrap generator change (inBundle added to the field order and set on internal workspace deps) is in place, and the --check validation passes.

Thanks for the careful fix, @SHJordan.

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.

2 participants