Skip to content

Improve npm alpha publishing readiness#107

Merged
slashdevcorpse merged 4 commits into
mainfrom
feature/npx-beta-doctor
May 31, 2026
Merged

Improve npm alpha publishing readiness#107
slashdevcorpse merged 4 commits into
mainfrom
feature/npx-beta-doctor

Conversation

@slashdevcorpse
Copy link
Copy Markdown
Owner

@slashdevcorpse slashdevcorpse commented May 31, 2026

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-claw for npm alpha publishing by expanding doctor checks and adding cross‑platform smoke tests for packed tarballs and the alpha tag. Wires smoke tests into CI/release and updates docs for install, update, and troubleshooting.

  • New Features

    • doctor: checks Node.js (>=20), npm auth, 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.
    • Smoke tests: scripts/install-smoke.mjs with pnpm smoke:codex-claw (pack alias), pnpm smoke:codex-claw:pack (packed tarball), and pnpm smoke:codex-claw:npm (published alpha); integrated into CI and release.
  • Bug Fixes

    • Install smoke avoids shell quoting by invoking the npm CLI directly, improving Windows/macOS/Linux reliability.

Written for commit 039fef9. Summary will update on new commits.

Review in cubic

Copilot AI review requested due to automatic review settings May 31, 2026 10:41
Comment thread packages/codex-claw/scripts/install-smoke.mjs Fixed
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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, '\\\"') + '\"'
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
Suggested change
return '\"' + text.replace(/"/g, '\\\"') + '\"'
return '"' + text.replace(/[\\"]/g, '\\$&') + '"'

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 doctor with 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.

Comment on lines +109 to 110
pnpm smoke:codex-claw:npm
pnpm release:codex-claw
Comment on lines +47 to +48
- name: Smoke packed CLI
run: pnpm smoke:codex-claw:pack
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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, {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>

@slashdevcorpse slashdevcorpse merged commit 3803d7d into main May 31, 2026
5 checks passed
@slashdevcorpse slashdevcorpse deleted the feature/npx-beta-doctor branch May 31, 2026 10:46
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.

3 participants