Repository navigation
feat(release): publish @unixwin/codex and keep the wpm index current - #2
Merged
caomengxuan666 merged 2 commits intoOct 19, 2026
Merged
Conversation
… index current Three things the org needs from this repository, in one place. **The npm scope moves to the org.** `@cmx666/codex` becomes `@unixwin/codex` (40 references across the workflow, both package scripts, `codex.js`'s platform map / install hints / self-detection path, `RELEASE.md` and the verifier). The `unixwin` npm org exists, so the next publish goes there; the old package stays published and gets deprecated pointing at the new name. **The canonical zip becomes a release asset.** `wpm` needs a versioned URL, not a workflow artifact (those need auth and expire), so the zip this job already builds is attached to a `codex-v<version>` pre-release. The index points at it, so the move and the rename have to land before the next publish. **The WPM index updates itself.** `scripts/niu/update-wpm-index.ps1` creates or rewrites the `codex` entry in unixwin/wpm-source - `layout: shim`, `commands: ["codex"]`, and a mapping that keeps `bin/codex.exe` beside `codex-resources/` and `codex-path/` so the executable resolves its helpers exactly as in the npm platform package. It refuses to write an index that maps a file the archive does not carry, which is the failure that let a package ship without its payload once already (unixwin/WinuxCmd#1225). The workflow step clones wpm-source, runs it, opens the PR and merges it; without `WPM_SOURCE_TOKEN` it warns and skips instead of failing a good npm release. Verified on the `unixwin` side too: wpm now resolves a shim payload from the artifact's `files` mapping when it is not at the `opt/<pkg>/<cmd>.exe` convention (unixwin/WinuxCmd#1252), which is what makes `bin/codex.exe` work. Fixtures: the script creates the entry on first run (real size and digest, urls on unixwin/codex), is idempotent, and refuses an archive missing a mapped directory. Workflow YAML parses; `codex.js`, `build_npm_package.py` and the verifier pass their syntax checks.
…l one in the repo The npm package staged `README.md` from the repository root, so npmjs showed upstream's README - correct for the repository, misleading as the front page of an unofficial build. The stager now prefers `README-niu.md` when it exists, and that file says what this build is, how to install it (`@unixwin/codex`, or `wpm install codex` inside the niu stack), what differs, and that the official README still applies. Nothing in the repository's own README changes, so upstream merges stay clean. Verified by staging the meta package: `stage/README.md` is this file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Three things the org asked for, on top of your in-flight npm release work (this targets
niu-first-class-shell, notmain, because that is where the flow lives).1. The npm scope moves to the org
@cmx666/codex→@unixwin/codex— 40 references across the workflow,codex-cli/{bin/codex.js,package.json,scripts/*},RELEASE.mdandscripts/niu/verify-npm-package.sh. Theunixwinnpm org exists (verified:npm org ls unixwin→ owner) and theNPM_TOKENsecret already carries publish rights for it, so the nextpublish=truerun goes to the new name. The old package stays on npm and getsnpm deprecatepointing at the new one.2. The canonical zip becomes a release asset
wpmneeds a versioned URL; workflow artifacts need auth and expire. The zip this job already assembles is attached to acodex-v<version>pre-release, and the index points at that. Order matters: the repository has to move tounixwinbefore the next publish, or the URLs the script writes will 404.3. The WPM index keeps itself current
scripts/niu/update-wpm-index.ps1creates or rewrites thecodexentry inunixwin/wpm-source:{ "name": "codex", "version": "0.2.0", "kind": "external", "commands": ["codex"], "artifacts": { "windows-x64": { "type": "zip", "layout": "shim", "sha256": "…", "size": 1234567, "urls": ["https://github.com/unixwin/codex/releases/download/codex-v0.2.0/…zip"], "files": [ { "from": "bin/codex.exe", "to": "bin/codex.exe" }, { "from": "codex-resources", "to": "codex-resources", "kind": "dir" }, { "from": "codex-path", "to": "codex-path", "kind": "dir" }, { "from": "codex-package.json", "to": "codex-package.json" } ] } } }layout: shimkeeps the payload out of a%PATH%directory and the mapping preserves the relative layout the executable expects (bin/codex.exefindscodex-resources/one level up). The script refuses to map a file the archive does not carry — the failure that once shipped a package without its payload (unixwin/WinuxCmd#1225) — and the workflow step clones wpm-source, runs it, opens the PR and merges it. WithoutWPM_SOURCE_TOKENit warns and skips rather than failing a good npm release.Needs from the org
WPM_SOURCE_TOKENon this repository (a token withrepoonunixwin/wpm-source) — or as an org secret, which also fixes niu-git's manual index updates.unixwin/codexbefore the next publish (I can do it; it needs the admin I have).Verified
Fixtures: the script creates the entry on first run (real size/digest, urls on
unixwin/codex), is idempotent, and rejects an archive missing a mapped directory. Workflow YAML parses;codex.js,build_npm_package.pyand the verifier pass syntax checks. On the wpm side, payload resolution from the artifact mapping landed as unixwin/WinuxCmd#1252, which is what makesbin/codex.exeresolvable.