omnicell-router 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/RELEASING.md +238 -238
- package/RELEASING.zh-CN.md +230 -230
- package/backend/dist/capture/recorder.js +2 -1
- package/backend/dist/cli/clients/base.js +8 -16
- package/backend/dist/cli/clients/dsh.js +8 -16
- package/backend/dist/cli/clients/pi.js +16 -9
- package/backend/dist/cli/types.d.ts +5 -0
- package/backend/dist/config/env.js +2 -1
- package/backend/dist/config/index.js +2 -0
- package/backend/dist/config/types.d.ts +23 -0
- package/backend/dist/harness/adapters/amp.d.ts +2 -0
- package/backend/dist/harness/adapters/amp.js +7 -0
- package/backend/dist/harness/adapters/claude.d.ts +2 -0
- package/backend/dist/harness/adapters/claude.js +7 -0
- package/backend/dist/harness/adapters/cline.d.ts +2 -0
- package/backend/dist/harness/adapters/cline.js +6 -0
- package/backend/dist/harness/adapters/codex.d.ts +2 -0
- package/backend/dist/harness/adapters/codex.js +6 -0
- package/backend/dist/harness/adapters/cursor.d.ts +5 -0
- package/backend/dist/harness/adapters/cursor.js +10 -0
- package/backend/dist/harness/adapters/declarative.d.ts +62 -0
- package/backend/dist/harness/adapters/declarative.js +202 -0
- package/backend/dist/harness/adapters/dsh.d.ts +5 -0
- package/backend/dist/harness/adapters/dsh.js +6 -0
- package/backend/dist/harness/adapters/gemini-cli.d.ts +2 -0
- package/backend/dist/harness/adapters/gemini-cli.js +7 -0
- package/backend/dist/harness/adapters/github-copilot.d.ts +5 -0
- package/backend/dist/harness/adapters/github-copilot.js +10 -0
- package/backend/dist/harness/adapters/index.d.ts +44 -0
- package/backend/dist/harness/adapters/index.js +99 -0
- package/backend/dist/harness/adapters/opencode.d.ts +2 -0
- package/backend/dist/harness/adapters/opencode.js +55 -0
- package/backend/dist/harness/adapters/pi.d.ts +1 -0
- package/backend/dist/harness/adapters/pi.js +22 -0
- package/backend/dist/harness/adapters/skills-paths.d.ts +15 -0
- package/backend/dist/harness/adapters/skills-paths.js +17 -0
- package/backend/dist/harness/adapters/types.d.ts +174 -0
- package/backend/dist/harness/adapters/types.js +12 -0
- package/backend/dist/harness/adapters/universal.d.ts +6 -0
- package/backend/dist/harness/adapters/universal.js +10 -0
- package/backend/dist/harness/adapters/windsurf.d.ts +2 -0
- package/backend/dist/harness/adapters/windsurf.js +10 -0
- package/backend/dist/harness/adapters/zed.d.ts +2 -0
- package/backend/dist/harness/adapters/zed.js +6 -0
- package/backend/dist/harness/awesome-opencode.d.ts +40 -0
- package/backend/dist/harness/awesome-opencode.js +75 -0
- package/backend/dist/harness/browse.d.ts +202 -0
- package/backend/dist/harness/browse.js +1214 -0
- package/backend/dist/harness/catalog-npm.d.ts +59 -0
- package/backend/dist/harness/catalog-npm.js +145 -0
- package/backend/dist/harness/clawhub.d.ts +212 -0
- package/backend/dist/harness/clawhub.js +426 -0
- package/backend/dist/harness/config-file.d.ts +29 -0
- package/backend/dist/harness/config-file.js +35 -0
- package/backend/dist/harness/detail.d.ts +74 -0
- package/backend/dist/harness/detail.js +330 -0
- package/backend/dist/harness/discover.d.ts +118 -0
- package/backend/dist/harness/discover.js +507 -0
- package/backend/dist/harness/drift.d.ts +21 -0
- package/backend/dist/harness/drift.js +25 -0
- package/backend/dist/harness/hash.d.ts +10 -0
- package/backend/dist/harness/hash.js +63 -0
- package/backend/dist/harness/hosts.d.ts +18 -0
- package/backend/dist/harness/hosts.js +15 -0
- package/backend/dist/harness/install.d.ts +88 -0
- package/backend/dist/harness/install.js +301 -0
- package/backend/dist/harness/inventory.d.ts +10 -0
- package/backend/dist/harness/inventory.js +198 -0
- package/backend/dist/harness/ledger.d.ts +39 -0
- package/backend/dist/harness/ledger.js +83 -0
- package/backend/dist/harness/maintenance.d.ts +115 -0
- package/backend/dist/harness/maintenance.js +603 -0
- package/backend/dist/harness/manifest.d.ts +31 -0
- package/backend/dist/harness/manifest.js +234 -0
- package/backend/dist/harness/net.d.ts +86 -0
- package/backend/dist/harness/net.js +113 -0
- package/backend/dist/harness/opencode-cafe.d.ts +40 -0
- package/backend/dist/harness/opencode-cafe.js +85 -0
- package/backend/dist/harness/opencode-ecosystem.d.ts +34 -0
- package/backend/dist/harness/opencode-ecosystem.js +246 -0
- package/backend/dist/harness/pi-dev.d.ts +81 -0
- package/backend/dist/harness/pi-dev.js +187 -0
- package/backend/dist/harness/probe.d.ts +33 -0
- package/backend/dist/harness/probe.js +85 -0
- package/backend/dist/harness/registry.d.ts +2 -0
- package/backend/dist/harness/registry.js +26 -0
- package/backend/dist/harness/scopes.d.ts +21 -0
- package/backend/dist/harness/scopes.js +22 -0
- package/backend/dist/harness/skill-md.d.ts +18 -0
- package/backend/dist/harness/skill-md.js +71 -0
- package/backend/dist/harness/skills-sh.d.ts +109 -0
- package/backend/dist/harness/skills-sh.js +178 -0
- package/backend/dist/harness/smithery.d.ts +64 -0
- package/backend/dist/harness/smithery.js +146 -0
- package/backend/dist/harness/sources/awesome-opencode.d.ts +11 -0
- package/backend/dist/harness/sources/awesome-opencode.js +39 -0
- package/backend/dist/harness/sources/clawhub.d.ts +2 -0
- package/backend/dist/harness/sources/clawhub.js +83 -0
- package/backend/dist/harness/sources/github.d.ts +9 -0
- package/backend/dist/harness/sources/github.js +202 -0
- package/backend/dist/harness/sources/mcp-official.d.ts +2 -0
- package/backend/dist/harness/sources/mcp-official.js +110 -0
- package/backend/dist/harness/sources/npm.d.ts +2 -0
- package/backend/dist/harness/sources/npm.js +152 -0
- package/backend/dist/harness/sources/opencode-cafe.d.ts +11 -0
- package/backend/dist/harness/sources/opencode-cafe.js +41 -0
- package/backend/dist/harness/sources/smithery.d.ts +2 -0
- package/backend/dist/harness/sources/smithery.js +81 -0
- package/backend/dist/harness/spi.d.ts +98 -0
- package/backend/dist/harness/spi.js +8 -0
- package/backend/dist/harness/stars.d.ts +70 -0
- package/backend/dist/harness/stars.js +202 -0
- package/backend/dist/harness/translation.d.ts +142 -0
- package/backend/dist/harness/translation.js +567 -0
- package/backend/dist/harness/tree.d.ts +13 -0
- package/backend/dist/harness/tree.js +19 -0
- package/backend/dist/harness/types.d.ts +286 -0
- package/backend/dist/harness/types.js +8 -0
- package/backend/dist/harness/writers/extension.d.ts +116 -0
- package/backend/dist/harness/writers/extension.js +219 -0
- package/backend/dist/harness/writers/mcp.d.ts +72 -0
- package/backend/dist/harness/writers/mcp.js +195 -0
- package/backend/dist/harness/writers/skill.d.ts +60 -0
- package/backend/dist/harness/writers/skill.js +146 -0
- package/backend/dist/opencode/agents.d.ts +5 -0
- package/backend/dist/opencode/agents.js +10 -1
- package/backend/dist/opencode/catalog/cache.js +2 -1
- package/backend/dist/opencode/catalog/logos.js +2 -1
- package/backend/dist/opencode/catalog/ocr-store.js +2 -1
- package/backend/dist/opencode/catalog/overrides-store.js +2 -1
- package/backend/dist/opencode/credentials/factory.js +10 -27
- package/backend/dist/opencode/credentials/ocr-store.js +2 -1
- package/backend/dist/opencode/provider-defs.js +2 -1
- package/backend/dist/opencode/user-config.js +8 -16
- package/backend/dist/providers/registry.d.ts +15 -4
- package/backend/dist/providers/registry.js +29 -5
- package/backend/dist/providers/virtual-meta.d.ts +13 -0
- package/backend/dist/providers/virtual-meta.js +18 -0
- package/backend/dist/quota/store.js +2 -1
- package/backend/dist/resilience/breaker-state.js +2 -1
- package/backend/dist/resilience/credential-state.js +2 -1
- package/backend/dist/routes/console.js +137 -15
- package/backend/dist/routes/harness.d.ts +2 -0
- package/backend/dist/routes/harness.js +622 -0
- package/backend/dist/server.js +4 -0
- package/backend/dist/session/session-manager.js +2 -1
- package/backend/dist/surfaces/systemone-probe.d.ts +25 -0
- package/backend/dist/surfaces/systemone-probe.js +74 -0
- package/backend/dist/utils/atomic-write.d.ts +12 -0
- package/backend/dist/utils/atomic-write.js +29 -0
- package/bin/ocr.js +2 -2
- package/frontend/dist/assets/{index-DEo2iAT7.css → index-1o7qI-KJ.css} +1 -1
- package/frontend/dist/assets/index-DvXKvNxl.js +962 -0
- package/frontend/dist/index.html +2 -2
- package/package.json +87 -87
- package/backend/dist/budget/budget-manager.d.ts +0 -25
- package/backend/dist/budget/budget-manager.js +0 -54
- package/backend/dist/config/governance-limits.d.ts +0 -68
- package/backend/dist/config/governance-limits.js +0 -261
- package/backend/dist/flywheel/collector.d.ts +0 -74
- package/backend/dist/flywheel/collector.js +0 -235
- package/backend/dist/flywheel/dataset.d.ts +0 -130
- package/backend/dist/flywheel/dataset.js +0 -638
- package/backend/dist/flywheel/decision-capture.d.ts +0 -68
- package/backend/dist/flywheel/decision-capture.js +0 -85
- package/backend/dist/flywheel/prune.d.ts +0 -133
- package/backend/dist/flywheel/prune.js +0 -495
- package/backend/dist/flywheel/schema.d.ts +0 -108
- package/backend/dist/flywheel/schema.js +0 -117
- package/backend/dist/flywheel/trainer.d.ts +0 -84
- package/backend/dist/flywheel/trainer.js +0 -198
- package/backend/dist/opencode/catalog/custom-store.d.ts +0 -50
- package/backend/dist/opencode/catalog/custom-store.js +0 -144
- package/backend/dist/opencode/credentials/push.d.ts +0 -38
- package/backend/dist/opencode/credentials/push.js +0 -116
- package/backend/dist/opencode/credentials/reconcile.d.ts +0 -49
- package/backend/dist/opencode/credentials/reconcile.js +0 -216
- package/backend/dist/opencode/sync.d.ts +0 -29
- package/backend/dist/opencode/sync.js +0 -186
- package/backend/dist/pipeline/account-selection.d.ts +0 -101
- package/backend/dist/pipeline/account-selection.js +0 -112
- package/backend/dist/providers/systemone.d.ts +0 -29
- package/backend/dist/providers/systemone.js +0 -170
- package/backend/dist/ratelimit/duration.d.ts +0 -24
- package/backend/dist/ratelimit/duration.js +0 -43
- package/backend/dist/ratelimit/governance-runtime.d.ts +0 -121
- package/backend/dist/ratelimit/governance-runtime.js +0 -183
- package/backend/dist/ratelimit/index.d.ts +0 -4
- package/backend/dist/ratelimit/index.js +0 -4
- package/backend/dist/ratelimit/limiter.d.ts +0 -157
- package/backend/dist/ratelimit/limiter.js +0 -244
- package/backend/dist/ratelimit/sliding-window-counter.d.ts +0 -63
- package/backend/dist/ratelimit/sliding-window-counter.js +0 -103
- package/backend/dist/ratelimit/subject.d.ts +0 -26
- package/backend/dist/ratelimit/subject.js +0 -28
- package/backend/dist/resilience/account-state.d.ts +0 -84
- package/backend/dist/resilience/account-state.js +0 -228
- package/backend/dist/router/layer1-classifier.d.ts +0 -111
- package/backend/dist/router/layer1-classifier.js +0 -467
- package/backend/dist/router/layer2-judge.d.ts +0 -111
- package/backend/dist/router/layer2-judge.js +0 -373
- package/backend/dist/router/retry-escalation.d.ts +0 -89
- package/backend/dist/router/retry-escalation.js +0 -99
- package/backend/dist/routes/flywheel.d.ts +0 -3
- package/backend/dist/routes/flywheel.js +0 -268
- package/backend/dist/routes/systemone.d.ts +0 -3
- package/backend/dist/routes/systemone.js +0 -90
- package/backend/dist/surfaces/governance-envelope.d.ts +0 -34
- package/backend/dist/surfaces/governance-envelope.js +0 -47
- package/backend/dist/utils/token-estimator.d.ts +0 -7
- package/backend/dist/utils/token-estimator.js +0 -20
- package/frontend/dist/assets/index-nwgWkmU1.js +0 -840
package/RELEASING.md
CHANGED
|
@@ -1,238 +1,238 @@
|
|
|
1
|
-
# OmniCellRouter (OCR) Release & Packaging Guide
|
|
2
|
-
|
|
3
|
-
<div align="center">
|
|
4
|
-
|
|
5
|
-
[](https://www.npmjs.com/package/omnicell-router)
|
|
6
|
-
[](https://github.com/kenlin8827/omnicell-router/releases)
|
|
7
|
-
[](LICENSE)
|
|
8
|
-
|
|
9
|
-
[English Version](RELEASING.md) | [Chinese Version](RELEASING.zh-CN.md) | [User README](README.md)
|
|
10
|
-
|
|
11
|
-
</div>
|
|
12
|
-
|
|
13
|
-
This document describes how to package and publish **OmniCellRouter (OCR)** across its two distribution channels:
|
|
14
|
-
|
|
15
|
-
1. **npm Registry (`omnicell-router`)**: The CLI & Web Gateway package, installable globally via `npm install -g omnicell-router` or executable via `npx omnicell-router`.
|
|
16
|
-
2. **GitHub Releases (Desktop Applications)**: Multi-platform standalone desktop packages (Tauri v2 + embedded Bun gateway sidecar) for Windows (`.exe`), macOS (`.dmg`), and Linux (`.AppImage`, `.deb`).
|
|
17
|
-
|
|
18
|
-
---
|
|
19
|
-
|
|
20
|
-
## 1. Distribution Architecture Overview
|
|
21
|
-
|
|
22
|
-
```
|
|
23
|
-
┌──────────────────────────────────────────────┐
|
|
24
|
-
│ OmniCellRouter Repo │
|
|
25
|
-
└───────┬──────────────────────────────┬───────┘
|
|
26
|
-
│ │
|
|
27
|
-
npm Publish (Web/CLI) GitHub Actions Tag Push (Desktop)
|
|
28
|
-
│ │
|
|
29
|
-
▼ ▼
|
|
30
|
-
┌─────────────────────────┐ ┌───────────────────────────┐
|
|
31
|
-
│ npm registry │ │ GitHub Releases │
|
|
32
|
-
│ (omnicell-router) │ │ (Multi-Platform Assets) │
|
|
33
|
-
└────────────┬────────────┘ └─────────────┬─────────────┘
|
|
34
|
-
│ │
|
|
35
|
-
`npm i -g ...` Desktop Installers:
|
|
36
|
-
`npx ...` - Windows NSIS (.exe)
|
|
37
|
-
│ - macOS Apple Silicon (.dmg)
|
|
38
|
-
▼ - macOS Intel (.dmg)
|
|
39
|
-
CLI & Web Gateway - Linux AppImage & Deb
|
|
40
|
-
(`ocr start / web`) - Native Desktop Shell
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
---
|
|
44
|
-
|
|
45
|
-
## 2. Publishing to npm Registry (`omnicell-router`)
|
|
46
|
-
|
|
47
|
-
### 2.1 How the npm Package Works
|
|
48
|
-
|
|
49
|
-
When installed via npm:
|
|
50
|
-
- **Global Executables**: Installs `ocr` and `omnicell-router` commands on the system `PATH` via [bin/ocr.js](file:///d:/OpenHub/omnicell-router/bin/ocr.js).
|
|
51
|
-
- **Runtime Portability**: Runs natively on Node.js (>= 18.0.0) without requiring Bun or TypeScript compiler installed on the user's host.
|
|
52
|
-
- **Embedded Web Console**: Ships pre-compiled static assets ([frontend/dist](file:///d:/OpenHub/omnicell-router/frontend/dist)) and server dist ([backend/dist](file:///d:/OpenHub/omnicell-router/backend/dist)), keeping the unpacked download size around 28 MB.
|
|
53
|
-
- **Lifecycle Commands**: Users can run `ocr start`, `ocr web` (or `ocr ui`), `ocr status`, and `ocr stop`.
|
|
54
|
-
|
|
55
|
-
### 2.2 Prerequisites
|
|
56
|
-
|
|
57
|
-
1. An account on [npmjs.com](https://www.npmjs.com/).
|
|
58
|
-
2. npm CLI logged in to your account with 2FA configured.
|
|
59
|
-
3. Node.js (>= 18) or Bun installed locally.
|
|
60
|
-
|
|
61
|
-
### 2.3 Step-by-Step npm Publishing Procedure
|
|
62
|
-
|
|
63
|
-
#### Step 1: Ensure Official Registry
|
|
64
|
-
Ensure your npm client is pointed to the official registry rather than a private or third-party mirror:
|
|
65
|
-
|
|
66
|
-
```bash
|
|
67
|
-
npm config set registry https://registry.npmjs.org/
|
|
68
|
-
```
|
|
69
|
-
|
|
70
|
-
#### Step 2: Authenticate with npm
|
|
71
|
-
Log in to your npm account from the terminal:
|
|
72
|
-
|
|
73
|
-
```bash
|
|
74
|
-
npm login
|
|
75
|
-
```
|
|
76
|
-
Follow the interactive prompt in your browser or enter your credentials and OTP (One-Time Password). Verify authentication status:
|
|
77
|
-
|
|
78
|
-
```bash
|
|
79
|
-
npm whoami
|
|
80
|
-
```
|
|
81
|
-
|
|
82
|
-
#### Step 3: Bump the Package Version
|
|
83
|
-
Update the version in `package.json`:
|
|
84
|
-
|
|
85
|
-
```bash
|
|
86
|
-
# For a bug fix or patch:
|
|
87
|
-
npm version patch
|
|
88
|
-
|
|
89
|
-
# For new features (backward-compatible):
|
|
90
|
-
npm version minor
|
|
91
|
-
|
|
92
|
-
# For major breaking changes:
|
|
93
|
-
npm version major
|
|
94
|
-
```
|
|
95
|
-
|
|
96
|
-
#### Step 4: Pre-Publish Verification
|
|
97
|
-
Before publishing, run a dry-run pack to ensure the bundle contains only the required distributions:
|
|
98
|
-
|
|
99
|
-
```bash
|
|
100
|
-
npm pack --dry-run
|
|
101
|
-
# Or with Bun:
|
|
102
|
-
bun pm pack --dry-run
|
|
103
|
-
```
|
|
104
|
-
|
|
105
|
-
Verify that:
|
|
106
|
-
- `bin/ocr.js` is included.
|
|
107
|
-
- `backend/dist/` and `frontend/dist/` are included.
|
|
108
|
-
- `README.md`, `README.zh-CN.md`, and `LICENSE` are included.
|
|
109
|
-
- Source files (`*.ts`, `*.tsx`), tests, `.git`, and `desktop/` source are excluded.
|
|
110
|
-
|
|
111
|
-
#### Step 5: Publish the Package
|
|
112
|
-
Run the publish command:
|
|
113
|
-
|
|
114
|
-
```bash
|
|
115
|
-
npm publish --access public
|
|
116
|
-
```
|
|
117
|
-
|
|
118
|
-
> [!NOTE]
|
|
119
|
-
> `package.json` contains `"prepublishOnly": "bun run build"`, which automatically compiles both backend TypeScript and frontend Vite production bundles before the files are uploaded to npm.
|
|
120
|
-
|
|
121
|
-
#### Step 6: Verify User Installation
|
|
122
|
-
Test the published package on a clean machine or terminal:
|
|
123
|
-
|
|
124
|
-
```bash
|
|
125
|
-
# Global install test
|
|
126
|
-
npm install -g omnicell-router
|
|
127
|
-
|
|
128
|
-
# Verify version
|
|
129
|
-
ocr --version
|
|
130
|
-
|
|
131
|
-
# Verify help manual
|
|
132
|
-
ocr --help
|
|
133
|
-
|
|
134
|
-
# Start web console
|
|
135
|
-
ocr web
|
|
136
|
-
```
|
|
137
|
-
|
|
138
|
-
---
|
|
139
|
-
|
|
140
|
-
## 3. Publishing Multi-Platform Desktop Releases (GitHub Releases)
|
|
141
|
-
|
|
142
|
-
OCR provides native desktop shells for Windows, macOS, and Linux built using Tauri v2 and an embedded Bun sidecar binary.
|
|
143
|
-
|
|
144
|
-
### 3.1 Target Matrix & Artifacts
|
|
145
|
-
|
|
146
|
-
| Platform / Architecture | Target Triple | Bundle Type | Output Artifact Name Pattern |
|
|
147
|
-
| :--- | :--- | :--- | :--- |
|
|
148
|
-
| **Windows x64** | `x86_64-pc-windows-msvc` | NSIS | `OmniCellRouter_<ver>_x64-setup.exe` |
|
|
149
|
-
| **macOS Apple Silicon** | `aarch64-apple-darwin` | DMG | `OmniCellRouter_<ver>_aarch64.dmg` |
|
|
150
|
-
| **macOS Intel** | `x86_64-apple-darwin` | DMG | `OmniCellRouter_<ver>_x64.dmg` |
|
|
151
|
-
| **Linux x64** | `x86_64-unknown-linux-gnu` | AppImage & DEB | `OmniCellRouter_<ver>_amd64.AppImage`<br>`OmniCellRouter_<ver>_amd64.deb` |
|
|
152
|
-
|
|
153
|
-
### 3.2 Automated GitHub Actions Pipeline
|
|
154
|
-
|
|
155
|
-
The workflow defined in [.github/workflows/desktop-build.yml](file:///d:/OpenHub/omnicell-router/.github/workflows/desktop-build.yml) automatically triggers upon pushing any tag matching `v*` (e.g., `v0.1.0`):
|
|
156
|
-
|
|
157
|
-
1. **Parallel Cross-Compilation**:
|
|
158
|
-
- `windows-latest`: Builds Windows NSIS installer.
|
|
159
|
-
- `macos-latest`: Cross-compiles both ARM64 and x64 DMG images.
|
|
160
|
-
- `ubuntu-22.04`: Builds AppImage and Debian packages with webkit2gtk-4.1 dependencies.
|
|
161
|
-
2. **Sidecar Injection**:
|
|
162
|
-
- Compiles `backend/src/index.ts` using Bun's standalone executable compiler with compile-time version injection (`--define __OCR_VERSION__`).
|
|
163
|
-
3. **Automated Release Creation**:
|
|
164
|
-
- The `release` job collects artifacts from all four runners.
|
|
165
|
-
- Creates a GitHub Release tagged with your version.
|
|
166
|
-
- Generates release notes and attaches all desktop installers as release assets.
|
|
167
|
-
|
|
168
|
-
### 3.3 Desktop Release Steps
|
|
169
|
-
|
|
170
|
-
#### Step 1: Synchronize Versions
|
|
171
|
-
The root `package.json` is the single source of truth — edit the version there only. The remaining copies (workspace subpackages, `desktop/src-tauri/tauri.conf.json`, `Cargo.toml`, `Cargo.lock`) are mirrored automatically by the `npm version` lifecycle hook via [scripts/version-sync.ts](file:///d:/OpenHub/omnicell-router/scripts/version-sync.ts):
|
|
172
|
-
|
|
173
|
-
```bash
|
|
174
|
-
npm version minor # 0.1.0 -> 0.2.0, hook syncs every version copy
|
|
175
|
-
```
|
|
176
|
-
|
|
177
|
-
Drift is guarded in CI (`bun scripts/version-sync.ts --check` in `desktop-build.yml`); verify locally with:
|
|
178
|
-
|
|
179
|
-
```bash
|
|
180
|
-
bun scripts/version-sync.ts --check
|
|
181
|
-
```
|
|
182
|
-
|
|
183
|
-
#### Step 2: Commit and Create Tag
|
|
184
|
-
Commit any pending changes and tag the release:
|
|
185
|
-
|
|
186
|
-
```bash
|
|
187
|
-
git add .
|
|
188
|
-
git commit -m "chore: release v0.1.0"
|
|
189
|
-
git tag v0.1.0
|
|
190
|
-
```
|
|
191
|
-
|
|
192
|
-
#### Step 3: Push Tag to GitHub
|
|
193
|
-
Push the tag to your remote repository:
|
|
194
|
-
|
|
195
|
-
```bash
|
|
196
|
-
git push origin v0.1.0
|
|
197
|
-
```
|
|
198
|
-
|
|
199
|
-
#### Step 4: Monitor and Confirm Release
|
|
200
|
-
1. Open the GitHub repository **Actions** tab and watch the `desktop-build` workflow.
|
|
201
|
-
2. Once complete (~15-20 minutes for all runners), navigate to the **Releases** page.
|
|
202
|
-
3. Confirm that the new release is published with all `.exe`, `.dmg`, `.AppImage`, and `.deb` files attached.
|
|
203
|
-
|
|
204
|
-
---
|
|
205
|
-
|
|
206
|
-
### 3.4 Local Desktop Build (Optional / Development)
|
|
207
|
-
|
|
208
|
-
To test the desktop installer locally before tagging:
|
|
209
|
-
|
|
210
|
-
```bash
|
|
211
|
-
# 1. Build backend and frontend dist
|
|
212
|
-
bun run build
|
|
213
|
-
|
|
214
|
-
# 2. Build local platform sidecar binary
|
|
215
|
-
cd desktop
|
|
216
|
-
bun run sidecar
|
|
217
|
-
|
|
218
|
-
# 3. Build native desktop bundle
|
|
219
|
-
bun run build
|
|
220
|
-
```
|
|
221
|
-
|
|
222
|
-
Generated bundles are located under:
|
|
223
|
-
`desktop/src-tauri/target/release/bundle/`
|
|
224
|
-
|
|
225
|
-
---
|
|
226
|
-
|
|
227
|
-
## 4. Full Release Checklist
|
|
228
|
-
|
|
229
|
-
Follow this checklist for a unified public release:
|
|
230
|
-
|
|
231
|
-
- [ ] All test suites pass: `bun run test` (121 suites, 1600+ test cases).
|
|
232
|
-
- [ ] TypeScript type checks pass: `bun run typecheck`.
|
|
233
|
-
- [ ] Bump the version only in the root `package.json` via `npm version <patch|minor|major>` (the hook syncs every copy; `bun scripts/version-sync.ts --check` must pass).
|
|
234
|
-
- [ ] Commit changes: `git commit -m "chore: release vX.Y.Z"`.
|
|
235
|
-
- [ ] Push git tag: `git tag vX.Y.Z && git push origin vX.Y.Z`.
|
|
236
|
-
- [ ] Verify GitHub Actions release workflow finishes and desktop assets are attached.
|
|
237
|
-
- [ ] Publish npm package: `npm publish --access public`.
|
|
238
|
-
- [ ] Test fresh installation via `npm install -g omnicell-router` and `ocr web`.
|
|
1
|
+
# OmniCellRouter (OCR) Release & Packaging Guide
|
|
2
|
+
|
|
3
|
+
<div align="center">
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/omnicell-router)
|
|
6
|
+
[](https://github.com/kenlin8827/omnicell-router/releases)
|
|
7
|
+
[](LICENSE)
|
|
8
|
+
|
|
9
|
+
[English Version](RELEASING.md) | [Chinese Version](RELEASING.zh-CN.md) | [User README](README.md)
|
|
10
|
+
|
|
11
|
+
</div>
|
|
12
|
+
|
|
13
|
+
This document describes how to package and publish **OmniCellRouter (OCR)** across its two distribution channels:
|
|
14
|
+
|
|
15
|
+
1. **npm Registry (`omnicell-router`)**: The CLI & Web Gateway package, installable globally via `npm install -g omnicell-router` or executable via `npx omnicell-router`.
|
|
16
|
+
2. **GitHub Releases (Desktop Applications)**: Multi-platform standalone desktop packages (Tauri v2 + embedded Bun gateway sidecar) for Windows (`.exe`), macOS (`.dmg`), and Linux (`.AppImage`, `.deb`).
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## 1. Distribution Architecture Overview
|
|
21
|
+
|
|
22
|
+
```
|
|
23
|
+
┌──────────────────────────────────────────────┐
|
|
24
|
+
│ OmniCellRouter Repo │
|
|
25
|
+
└───────┬──────────────────────────────┬───────┘
|
|
26
|
+
│ │
|
|
27
|
+
npm Publish (Web/CLI) GitHub Actions Tag Push (Desktop)
|
|
28
|
+
│ │
|
|
29
|
+
▼ ▼
|
|
30
|
+
┌─────────────────────────┐ ┌───────────────────────────┐
|
|
31
|
+
│ npm registry │ │ GitHub Releases │
|
|
32
|
+
│ (omnicell-router) │ │ (Multi-Platform Assets) │
|
|
33
|
+
└────────────┬────────────┘ └─────────────┬─────────────┘
|
|
34
|
+
│ │
|
|
35
|
+
`npm i -g ...` Desktop Installers:
|
|
36
|
+
`npx ...` - Windows NSIS (.exe)
|
|
37
|
+
│ - macOS Apple Silicon (.dmg)
|
|
38
|
+
▼ - macOS Intel (.dmg)
|
|
39
|
+
CLI & Web Gateway - Linux AppImage & Deb
|
|
40
|
+
(`ocr start / web`) - Native Desktop Shell
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
## 2. Publishing to npm Registry (`omnicell-router`)
|
|
46
|
+
|
|
47
|
+
### 2.1 How the npm Package Works
|
|
48
|
+
|
|
49
|
+
When installed via npm:
|
|
50
|
+
- **Global Executables**: Installs `ocr` and `omnicell-router` commands on the system `PATH` via [bin/ocr.js](file:///d:/OpenHub/omnicell-router/bin/ocr.js).
|
|
51
|
+
- **Runtime Portability**: Runs natively on Node.js (>= 18.0.0) without requiring Bun or TypeScript compiler installed on the user's host.
|
|
52
|
+
- **Embedded Web Console**: Ships pre-compiled static assets ([frontend/dist](file:///d:/OpenHub/omnicell-router/frontend/dist)) and server dist ([backend/dist](file:///d:/OpenHub/omnicell-router/backend/dist)), keeping the unpacked download size around 28 MB.
|
|
53
|
+
- **Lifecycle Commands**: Users can run `ocr start`, `ocr web` (or `ocr ui`), `ocr status`, and `ocr stop`.
|
|
54
|
+
|
|
55
|
+
### 2.2 Prerequisites
|
|
56
|
+
|
|
57
|
+
1. An account on [npmjs.com](https://www.npmjs.com/).
|
|
58
|
+
2. npm CLI logged in to your account with 2FA configured.
|
|
59
|
+
3. Node.js (>= 18) or Bun installed locally.
|
|
60
|
+
|
|
61
|
+
### 2.3 Step-by-Step npm Publishing Procedure
|
|
62
|
+
|
|
63
|
+
#### Step 1: Ensure Official Registry
|
|
64
|
+
Ensure your npm client is pointed to the official registry rather than a private or third-party mirror:
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
npm config set registry https://registry.npmjs.org/
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
#### Step 2: Authenticate with npm
|
|
71
|
+
Log in to your npm account from the terminal:
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
npm login
|
|
75
|
+
```
|
|
76
|
+
Follow the interactive prompt in your browser or enter your credentials and OTP (One-Time Password). Verify authentication status:
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
npm whoami
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
#### Step 3: Bump the Package Version
|
|
83
|
+
Update the version in `package.json`:
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
# For a bug fix or patch:
|
|
87
|
+
npm version patch
|
|
88
|
+
|
|
89
|
+
# For new features (backward-compatible):
|
|
90
|
+
npm version minor
|
|
91
|
+
|
|
92
|
+
# For major breaking changes:
|
|
93
|
+
npm version major
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
#### Step 4: Pre-Publish Verification
|
|
97
|
+
Before publishing, run a dry-run pack to ensure the bundle contains only the required distributions:
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
npm pack --dry-run
|
|
101
|
+
# Or with Bun:
|
|
102
|
+
bun pm pack --dry-run
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
Verify that:
|
|
106
|
+
- `bin/ocr.js` is included.
|
|
107
|
+
- `backend/dist/` and `frontend/dist/` are included.
|
|
108
|
+
- `README.md`, `README.zh-CN.md`, and `LICENSE` are included.
|
|
109
|
+
- Source files (`*.ts`, `*.tsx`), tests, `.git`, and `desktop/` source are excluded.
|
|
110
|
+
|
|
111
|
+
#### Step 5: Publish the Package
|
|
112
|
+
Run the publish command:
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
npm publish --access public
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
> [!NOTE]
|
|
119
|
+
> `package.json` contains `"prepublishOnly": "bun run build"`, which automatically compiles both backend TypeScript and frontend Vite production bundles before the files are uploaded to npm.
|
|
120
|
+
|
|
121
|
+
#### Step 6: Verify User Installation
|
|
122
|
+
Test the published package on a clean machine or terminal:
|
|
123
|
+
|
|
124
|
+
```bash
|
|
125
|
+
# Global install test
|
|
126
|
+
npm install -g omnicell-router
|
|
127
|
+
|
|
128
|
+
# Verify version
|
|
129
|
+
ocr --version
|
|
130
|
+
|
|
131
|
+
# Verify help manual
|
|
132
|
+
ocr --help
|
|
133
|
+
|
|
134
|
+
# Start web console
|
|
135
|
+
ocr web
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
---
|
|
139
|
+
|
|
140
|
+
## 3. Publishing Multi-Platform Desktop Releases (GitHub Releases)
|
|
141
|
+
|
|
142
|
+
OCR provides native desktop shells for Windows, macOS, and Linux built using Tauri v2 and an embedded Bun sidecar binary.
|
|
143
|
+
|
|
144
|
+
### 3.1 Target Matrix & Artifacts
|
|
145
|
+
|
|
146
|
+
| Platform / Architecture | Target Triple | Bundle Type | Output Artifact Name Pattern |
|
|
147
|
+
| :--- | :--- | :--- | :--- |
|
|
148
|
+
| **Windows x64** | `x86_64-pc-windows-msvc` | NSIS | `OmniCellRouter_<ver>_x64-setup.exe` |
|
|
149
|
+
| **macOS Apple Silicon** | `aarch64-apple-darwin` | DMG | `OmniCellRouter_<ver>_aarch64.dmg` |
|
|
150
|
+
| **macOS Intel** | `x86_64-apple-darwin` | DMG | `OmniCellRouter_<ver>_x64.dmg` |
|
|
151
|
+
| **Linux x64** | `x86_64-unknown-linux-gnu` | AppImage & DEB | `OmniCellRouter_<ver>_amd64.AppImage`<br>`OmniCellRouter_<ver>_amd64.deb` |
|
|
152
|
+
|
|
153
|
+
### 3.2 Automated GitHub Actions Pipeline
|
|
154
|
+
|
|
155
|
+
The workflow defined in [.github/workflows/desktop-build.yml](file:///d:/OpenHub/omnicell-router/.github/workflows/desktop-build.yml) automatically triggers upon pushing any tag matching `v*` (e.g., `v0.1.0`):
|
|
156
|
+
|
|
157
|
+
1. **Parallel Cross-Compilation**:
|
|
158
|
+
- `windows-latest`: Builds Windows NSIS installer.
|
|
159
|
+
- `macos-latest`: Cross-compiles both ARM64 and x64 DMG images.
|
|
160
|
+
- `ubuntu-22.04`: Builds AppImage and Debian packages with webkit2gtk-4.1 dependencies.
|
|
161
|
+
2. **Sidecar Injection**:
|
|
162
|
+
- Compiles `backend/src/index.ts` using Bun's standalone executable compiler with compile-time version injection (`--define __OCR_VERSION__`).
|
|
163
|
+
3. **Automated Release Creation**:
|
|
164
|
+
- The `release` job collects artifacts from all four runners.
|
|
165
|
+
- Creates a GitHub Release tagged with your version.
|
|
166
|
+
- Generates release notes and attaches all desktop installers as release assets.
|
|
167
|
+
|
|
168
|
+
### 3.3 Desktop Release Steps
|
|
169
|
+
|
|
170
|
+
#### Step 1: Synchronize Versions
|
|
171
|
+
The root `package.json` is the single source of truth — edit the version there only. The remaining copies (workspace subpackages, `desktop/src-tauri/tauri.conf.json`, `Cargo.toml`, `Cargo.lock`) are mirrored automatically by the `npm version` lifecycle hook via [scripts/version-sync.ts](file:///d:/OpenHub/omnicell-router/scripts/version-sync.ts):
|
|
172
|
+
|
|
173
|
+
```bash
|
|
174
|
+
npm version minor # 0.1.0 -> 0.2.0, hook syncs every version copy
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
Drift is guarded in CI (`bun scripts/version-sync.ts --check` in `desktop-build.yml`); verify locally with:
|
|
178
|
+
|
|
179
|
+
```bash
|
|
180
|
+
bun scripts/version-sync.ts --check
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
#### Step 2: Commit and Create Tag
|
|
184
|
+
Commit any pending changes and tag the release:
|
|
185
|
+
|
|
186
|
+
```bash
|
|
187
|
+
git add .
|
|
188
|
+
git commit -m "chore: release v0.1.0"
|
|
189
|
+
git tag v0.1.0
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
#### Step 3: Push Tag to GitHub
|
|
193
|
+
Push the tag to your remote repository:
|
|
194
|
+
|
|
195
|
+
```bash
|
|
196
|
+
git push origin v0.1.0
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
#### Step 4: Monitor and Confirm Release
|
|
200
|
+
1. Open the GitHub repository **Actions** tab and watch the `desktop-build` workflow.
|
|
201
|
+
2. Once complete (~15-20 minutes for all runners), navigate to the **Releases** page.
|
|
202
|
+
3. Confirm that the new release is published with all `.exe`, `.dmg`, `.AppImage`, and `.deb` files attached.
|
|
203
|
+
|
|
204
|
+
---
|
|
205
|
+
|
|
206
|
+
### 3.4 Local Desktop Build (Optional / Development)
|
|
207
|
+
|
|
208
|
+
To test the desktop installer locally before tagging:
|
|
209
|
+
|
|
210
|
+
```bash
|
|
211
|
+
# 1. Build backend and frontend dist
|
|
212
|
+
bun run build
|
|
213
|
+
|
|
214
|
+
# 2. Build local platform sidecar binary
|
|
215
|
+
cd desktop
|
|
216
|
+
bun run sidecar
|
|
217
|
+
|
|
218
|
+
# 3. Build native desktop bundle
|
|
219
|
+
bun run build
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
Generated bundles are located under:
|
|
223
|
+
`desktop/src-tauri/target/release/bundle/`
|
|
224
|
+
|
|
225
|
+
---
|
|
226
|
+
|
|
227
|
+
## 4. Full Release Checklist
|
|
228
|
+
|
|
229
|
+
Follow this checklist for a unified public release:
|
|
230
|
+
|
|
231
|
+
- [ ] All test suites pass: `bun run test` (121 suites, 1600+ test cases).
|
|
232
|
+
- [ ] TypeScript type checks pass: `bun run typecheck`.
|
|
233
|
+
- [ ] Bump the version only in the root `package.json` via `npm version <patch|minor|major>` (the hook syncs every copy; `bun scripts/version-sync.ts --check` must pass).
|
|
234
|
+
- [ ] Commit changes: `git commit -m "chore: release vX.Y.Z"`.
|
|
235
|
+
- [ ] Push git tag: `git tag vX.Y.Z && git push origin vX.Y.Z`.
|
|
236
|
+
- [ ] Verify GitHub Actions release workflow finishes and desktop assets are attached.
|
|
237
|
+
- [ ] Publish npm package: `npm publish --access public`.
|
|
238
|
+
- [ ] Test fresh installation via `npm install -g omnicell-router` and `ocr web`.
|