Improve npm alpha publishing readiness#107
Conversation
There was a problem hiding this comment.
1 issue found across 7 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="packages/codex-claw/scripts/install-smoke.mjs">
<violation number="1" location="packages/codex-claw/scripts/install-smoke.mjs:49">
P1: Escape backslashes as well as quotes when building shell arguments. This function currently escapes `"` only, so inputs containing backslashes can be parsed incorrectly when passed through `shell: true` on Windows.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
| if (/^[a-zA-Z0-9_./:@%+=,\\-]+$/.test(text)) { | ||
| return text | ||
| } | ||
| return '\"' + text.replace(/"/g, '\\\"') + '\"' |
There was a problem hiding this comment.
P1: Escape backslashes as well as quotes when building shell arguments. This function currently escapes " only, so inputs containing backslashes can be parsed incorrectly when passed through shell: true on Windows.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At packages/codex-claw/scripts/install-smoke.mjs, line 49:
<comment>Escape backslashes as well as quotes when building shell arguments. This function currently escapes `"` only, so inputs containing backslashes can be parsed incorrectly when passed through `shell: true` on Windows.</comment>
<file context>
@@ -0,0 +1,188 @@
+ if (/^[a-zA-Z0-9_./:@%+=,\\-]+$/.test(text)) {
+ return text
+ }
+ return '\"' + text.replace(/"/g, '\\\"') + '\"'
+}
+
</file context>
| return '\"' + text.replace(/"/g, '\\\"') + '\"' | |
| return '"' + text.replace(/[\\"]/g, '\\$&') + '"' |
There was a problem hiding this comment.
Pull request overview
This PR improves npm alpha publishing readiness for the codex-claw CLI by expanding diagnostics, adding install smoke coverage, and documenting alpha install/update troubleshooting.
Changes:
- Expands
codex-claw doctorwith Node, npm, auth, pnpm, Git, Codex CLI, state directory, and port checks. - Adds packed-tarball/npm alpha smoke scripts and wires packed smoke into CI/release workflows.
- Updates root and package README guidance for alpha install, update, publishing, and troubleshooting.
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
README.md |
Adds alpha install/update guidance, doctor output, smoke commands, and troubleshooting. |
packages/codex-claw/README.md |
Documents package install paths, doctor scope, publish checklist, and troubleshooting. |
packages/codex-claw/bin/codex-claw.js |
Reworks doctor into detailed environment checks. |
packages/codex-claw/scripts/install-smoke.mjs |
Adds local pack and npm alpha smoke test runner. |
package.json |
Adds root smoke test scripts. |
.github/workflows/ci.yml |
Runs packed CLI smoke test in CI. |
.github/workflows/release-package.yml |
Adds packed CLI smoke test to release packaging. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| pnpm smoke:codex-claw:npm | ||
| pnpm release:codex-claw |
| - name: Smoke packed CLI | ||
| run: pnpm smoke:codex-claw:pack |
There was a problem hiding this comment.
1 issue found across 1 file (changes from recent commits).
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="packages/codex-claw/scripts/install-smoke.mjs">
<violation number="1" location="packages/codex-claw/scripts/install-smoke.mjs:67">
P2: Windows fallback invokes `npm.cmd` directly with `spawnSync`, which can fail because `.cmd` files must be run through a shell/`cmd.exe` on Node’s Windows behavior. This can cause the smoke script to fail on Windows whenever npm CLI path resolution misses.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
| }) | ||
| } | ||
|
|
||
| return spawnSync(process.platform === 'win32' ? 'npm.cmd' : 'npm', args, { |
There was a problem hiding this comment.
P2: Windows fallback invokes npm.cmd directly with spawnSync, which can fail because .cmd files must be run through a shell/cmd.exe on Node’s Windows behavior. This can cause the smoke script to fail on Windows whenever npm CLI path resolution misses.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At packages/codex-claw/scripts/install-smoke.mjs, line 67:
<comment>Windows fallback invokes `npm.cmd` directly with `spawnSync`, which can fail because `.cmd` files must be run through a shell/`cmd.exe` on Node’s Windows behavior. This can cause the smoke script to fail on Windows whenever npm CLI path resolution misses.</comment>
<file context>
@@ -41,26 +41,30 @@ function parseArgs(args) {
}
- return spawnSync(command, args, {
+ return spawnSync(process.platform === 'win32' ? 'npm.cmd' : 'npm', args, {
cwd,
encoding: 'utf8',
</file context>
Summary\n- expands codex-claw doctor to check Node.js, npm auth, pnpm, Git, Codex CLI, state directory writability, and dev port availability\n- adds packed-tarball and npm-alpha install smoke scripts, then wires packed smoke coverage into CI and release packaging\n- documents Windows, macOS, and Linux alpha install/update paths with troubleshooting for npm auth, package-not-found, locked ports, and missing Codex CLI\n\n## Verification\n-
ode --check packages/codex-claw/bin/codex-claw.js\n-
ode --check packages/codex-claw/scripts/install-smoke.mjs\n-
ode packages/codex-claw/bin/codex-claw.js doctor --port 65534\n- pnpm smoke:codex-claw:pack\n- pnpm smoke:codex-claw:npm reports the expected package-not-found message until the first npm alpha publish\n- pnpm -C apps/codex-claw lint\n- pnpm -C apps/codex-claw test\n- pnpm -C apps/codex-claw build\n- pnpm pack:codex-claw\n\nCloses #94
Summary by cubic
Prepares
codex-clawfor npm alpha publishing by expandingdoctorchecks and adding cross‑platform smoke tests for packed tarballs and thealphatag. Wires smoke tests into CI/release and updates docs for install, update, and troubleshooting.New Features
doctor: checks Node.js (>=20),npmauth,pnpm,git+ worktree, Codex CLI (--codex-command), state dir (--state-dir), and dev port (--port,--no-port-check); prints ok/warn/fail with summary; exits non‑zero on failures.scripts/install-smoke.mjswithpnpm smoke:codex-claw(pack alias),pnpm smoke:codex-claw:pack(packed tarball), andpnpm smoke:codex-claw:npm(publishedalpha); integrated into CI and release.Bug Fixes
Written for commit 039fef9. Summary will update on new commits.