cannwork-rehearsal 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -9,21 +9,27 @@ A terminal launcher for AI coding agents (starting with [opencode](https://openc
9
9
 
10
10
  ## Install
11
11
 
12
+ Trial-period name (currently available — the official scoped name is not published yet):
13
+
12
14
  ```bash
13
- npm install -g @zhoufangchaojs/cannwork
15
+ npm install -g cannwork-rehearsal
14
16
  # or run without installing
15
- npx @zhoufangchaojs/cannwork
17
+ npx cannwork-rehearsal
16
18
  ```
17
19
 
20
+ Official name (to be published later): `@zhoufangchaojs/cannwork`, same usage once available.
21
+
18
22
  The npm package ships standalone executables per platform. Supported platforms:
19
23
 
20
- | Platform | Package |
24
+ | Platform | Suffix |
21
25
  | --- | --- |
22
- | Windows x64 | `@zhoufangchaojs/cannwork-win32-x64` |
23
- | Linux x64 (glibc) | `@zhoufangchaojs/cannwork-linux-x64` |
24
- | Linux arm64 (glibc) | `@zhoufangchaojs/cannwork-linux-arm64` |
25
- | macOS x64 | `@zhoufangchaojs/cannwork-darwin-x64` |
26
- | macOS arm64 | `@zhoufangchaojs/cannwork-darwin-arm64` |
26
+ | Windows x64 | `win32-x64` |
27
+ | Linux x64 (glibc) | `linux-x64` |
28
+ | Linux arm64 (glibc) | `linux-arm64` |
29
+ | macOS x64 | `darwin-x64` |
30
+ | macOS arm64 | `darwin-arm64` |
31
+
32
+ The installed platform package is `<package-name>-<suffix>` (currently `cannwork-rehearsal-<suffix>`, later `@zhoufangchaojs/cannwork-<suffix>`).
27
33
 
28
34
  Notes:
29
35
 
@@ -31,9 +37,9 @@ Notes:
31
37
  - Linux binaries link glibc; Alpine/musl is not covered yet — `OPENTUI_LIBC`/musl builds are not published.
32
38
  - The macOS binaries are not codesigned/notarized. If Gatekeeper blocks the binary, clear the quarantine flag:
33
39
  ```bash
34
- xattr -d com.apple.quarantine "$(npm root -g)/@zhoufangchaojs/cannwork-darwin-arm64/bin/cannwork"
40
+ xattr -d com.apple.quarantine "$(npm root -g)/cannwork-rehearsal-darwin-arm64/bin/cannwork"
35
41
  ```
36
- - `cannwork-rehearsal` is a **temporary rehearsal name** used to dry-run the publish flow. It is not a production package and must not be installed.
42
+ - `cannwork-rehearsal` is the **trial-period release name**: it is published and installable on purpose so real users can try it while the official `@zhoufangchaojs/cannwork` name is not released yet. It will be retired (unpublished/deprecated) once the official name is published.
37
43
 
38
44
  ## Getting Started (from source)
39
45
 
@@ -67,23 +73,25 @@ Build artifacts are written to `dist/`.
67
73
 
68
74
  ## Maintainer release runbook
69
75
 
70
- Releases are published manually to <https://registry.npmjs.org/> in two phases: rehearse with a temporary unscoped name, then publish the real scoped name.
76
+ Releases are published manually to <https://registry.npmjs.org/> in two phases: an unscoped **trial release** that is kept live for real users, then (later) the official scoped release, after which the trial name is retired.
71
77
 
72
- ### Phase 1 — rehearsal with the temporary name
78
+ ### Phase 1 — unscoped trial release (kept live)
73
79
 
74
80
  1. Set `name` to `cannwork-rehearsal` and `version` to `0.1.0` in the root `package.json` (single source of truth).
75
81
  2. `npm login` (any account with publish rights).
76
82
  3. `bun run release` — runs typecheck + tests, cross-compiles, then publishes the 5 platform packages followed by the main package. Add `--dry-run` to pack and verify without uploading.
77
- 4. Smoke-test in a clean directory: `npx cannwork-rehearsal`. On success the script writes `dist/.rehearsal-ok`, which unlocks phase 2.
78
- 5. Clean up the rehearsal packages: `npm unpublish` all 6 (`cannwork-rehearsal` and `cannwork-rehearsal-*`) within the 72-hour window; afterwards use `npm deprecate` to mark them as test packages.
83
+ 4. Check each package on the registry (`npm view <pkg> version`). A `0.0.0-stage` value means npm staged the version for review; wait for it to go live (or approve it on npmjs.com) before smoke-testing.
84
+ 5. Smoke-test in a clean directory: `npx cannwork-rehearsal`. On success the script writes `dist/.rehearsal-ok`, which unlocks phase 2.
85
+ 6. **Keep it live**: do not unpublish. During the trial, ship updates by repeating steps 3–5 with a bumped version.
79
86
 
80
- ### Phase 2 — publish the official scoped name
87
+ ### Phase 2 — official scoped release (deferred), then retire the trial name
81
88
 
82
- 6. Set `name` to `@zhoufangchaojs/cannwork` (keep `version`), then `bun run release`. The script refuses to publish a scoped name until a rehearsal marker exists.
83
- 7. Verify: `npm view @zhoufangchaojs/cannwork version`, smoke-test `npx @zhoufangchaojs/cannwork`, then tag the release:
89
+ 7. Set `name` to `@zhoufangchaojs/cannwork`, then `bun run release`. The script refuses to publish a scoped name until the trial-release marker exists.
90
+ 8. Verify: `npm view @zhoufangchaojs/cannwork version`, smoke-test `npx @zhoufangchaojs/cannwork`, then tag the release:
84
91
  ```bash
85
- git tag v0.1.0
92
+ git tag <version>
86
93
  ```
94
+ 9. Retire the trial packages: `npm unpublish` all 6 (`cannwork-rehearsal` and `cannwork-rehearsal-*`) within the 72-hour window, otherwise `npm deprecate` them as trial packages. If the active credential is a `Granular access token` that bypasses 2FA, unpublish is rejected with 403 — delete the packages on npmjs.com instead, or run `npm login --auth-type=web` first.
87
95
 
88
96
  Rollback: `npm unpublish` the affected version within the allowed window; afterwards `npm deprecate` and publish a fixed version.
89
97
 
package/bin/cannwork.js CHANGED
@@ -86,13 +86,19 @@ export async function run(argv = process.argv.slice(2)) {
86
86
  const { platform: os, arch } = process;
87
87
 
88
88
  const requireFromHere = createRequire(import.meta.url);
89
- let mainName;
89
+ let manifest;
90
90
  try {
91
- mainName = requireFromHere("../package.json").name;
91
+ manifest = requireFromHere("../package.json");
92
92
  } catch {
93
93
  process.stderr.write("cannwork: 无法读取自身包清单,安装可能已损坏。\n");
94
94
  return 1;
95
95
  }
96
+ const mainName = manifest.name;
97
+
98
+ if (argv.includes("-v") || argv.includes("--version")) {
99
+ process.stdout.write(`${manifest.version}\n`);
100
+ return 0;
101
+ }
96
102
 
97
103
  const binaryPath = resolveBinaryPath(mainName, os, arch, requireFromHere);
98
104
  if (binaryPath === null) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cannwork-rehearsal",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "cannwork": "bin/cannwork.js"
@@ -10,11 +10,11 @@
10
10
  "README.md"
11
11
  ],
12
12
  "optionalDependencies": {
13
- "cannwork-rehearsal-win32-x64": "0.1.0",
14
- "cannwork-rehearsal-linux-x64": "0.1.0",
15
- "cannwork-rehearsal-linux-arm64": "0.1.0",
16
- "cannwork-rehearsal-darwin-x64": "0.1.0",
17
- "cannwork-rehearsal-darwin-arm64": "0.1.0"
13
+ "cannwork-rehearsal-win32-x64": "0.2.0",
14
+ "cannwork-rehearsal-linux-x64": "0.2.0",
15
+ "cannwork-rehearsal-linux-arm64": "0.2.0",
16
+ "cannwork-rehearsal-darwin-x64": "0.2.0",
17
+ "cannwork-rehearsal-darwin-arm64": "0.2.0"
18
18
  },
19
19
  "publishConfig": {
20
20
  "registry": "https://registry.npmjs.org/",