rainbo 0.1.6 → 0.1.8

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
@@ -2,10 +2,15 @@
2
2
 
3
3
  Rainbo command line tools for data migration workflows.
4
4
 
5
+ The published `rainbo` npm package is a lightweight meta package. It installs
6
+ the matching platform binary package for the current machine at install time.
7
+ Those platform packages are published under the `@singdata` scope.
8
+
5
9
  ## Requirements
6
10
 
7
11
  - Node.js 16+
8
12
  - Rust toolchain for source development. End users installing from npm get a prebuilt binary.
13
+ - Supported CI release platforms: macOS x64/arm64 and Windows x64/arm64.
9
14
 
10
15
  ## Install
11
16
 
@@ -89,8 +94,9 @@ rainbo auth logout
89
94
 
90
95
  Generate the connection URL from the logged-in Rainbo web UI user menu. `auth
91
96
  connect` exchanges the one-time connection code for a revocable CLI bearer token
92
- and stores it under `~/.config/rainbo/auth.json` with `0600` permissions on
93
- Unix-like systems.
97
+ and stores it under `~/.config/rainbo/auth.json` on Unix-like systems or
98
+ `%APPDATA%\rainbo\auth.json` on Windows. Unix-like systems use `0600`
99
+ permissions for this file.
94
100
 
95
101
  ## API Commands
96
102
 
@@ -141,6 +147,8 @@ npm run publish:npm:local
141
147
  The publish script refuses to continue if `package.json` and `rust/Cargo.toml`
142
148
  versions differ. After building the current-platform binary, it also runs the
143
149
  bundled binary and verifies `rainbo version` matches `package.json`.
150
+ The publish script is cross-platform and can be run from macOS shells,
151
+ Windows PowerShell, or Windows CMD.
144
152
 
145
153
  If npm returns `EOTP`, use an automation-capable publish token or pass the
146
154
  current OTP:
@@ -150,16 +158,22 @@ npm run publish:npm:local -- --otp=<code>
150
158
  ```
151
159
 
152
160
  By default the local script builds the current platform binary into
153
- `packaging/npm/bin/<platform>/`. To publish multiple bundled platforms from a
154
- machine with the required Rust targets/toolchains installed, set:
161
+ `packaging/npm/bin/<platform>/`. CI then uses those binaries to generate
162
+ temporary platform packages such as `rainbo-cli-darwin-arm64` and
163
+ `rainbo-cli-win32-x64`, followed by the top-level `rainbo` meta package.
164
+
165
+ To build multiple platforms from a machine with the required Rust
166
+ targets/toolchains installed, set:
155
167
 
156
168
  ```bash
157
- RAINBO_NPM_BUILD_TARGETS=darwin-arm64,darwin-x64 npm run publish:npm:local
169
+ RAINBO_NPM_BUILD_TARGETS=darwin-arm64,darwin-x64,win32-x64,win32-arm64 npm run publish:npm:local
158
170
  ```
159
171
 
160
172
  The package source lives under the Rainbo GitLab repository as
161
- `packages/rainbo`; npm publishing is intentionally local and does not depend
162
- on a separate repository or CI workflow.
173
+ `packages/rainbo`. Releases can be published locally or from the GitLab tag
174
+ pipeline after the required platform artifacts are built. The GitLab pipeline
175
+ generates platform npm packages dynamically in CI and then publishes the
176
+ top-level `rainbo` meta package that depends on those platform packages.
163
177
 
164
178
  ## Skills
165
179
 
package/package.json CHANGED
@@ -1,32 +1,21 @@
1
1
  {
2
2
  "name": "rainbo",
3
- "version": "0.1.6",
3
+ "version": "0.1.8",
4
4
  "description": "Rainbo command line tools for data migration workflows",
5
5
  "bin": {
6
6
  "rainbo": "packaging/npm/run.js"
7
7
  },
8
- "scripts": {
9
- "build:release": "cargo build --release --workspace",
10
- "build:npm:local": "node scripts/build-npm-local.js",
11
- "check:skills": "node scripts/skill-format-check/index.js",
12
- "pack:npm:local": "npm run build:npm:local && npm pack --dry-run",
13
- "publish:npm:local": "bash scripts/publish-npm-local.sh",
14
- "test": "cargo test --workspace && node packaging/npm/run.js version && node packaging/npm/run.js help"
15
- },
16
- "os": [
17
- "darwin",
18
- "win32"
19
- ],
20
- "cpu": [
21
- "x64",
22
- "arm64"
23
- ],
24
8
  "engines": {
25
9
  "node": ">=16"
26
10
  },
11
+ "optionalDependencies": {
12
+ "@singdata/rainbo-cli-darwin-x64": "0.1.8",
13
+ "@singdata/rainbo-cli-darwin-arm64": "0.1.8",
14
+ "@singdata/rainbo-cli-win32-x64": "0.1.8",
15
+ "@singdata/rainbo-cli-win32-arm64": "0.1.8"
16
+ },
27
17
  "license": "MIT",
28
18
  "files": [
29
- "packaging/npm/bin",
30
19
  "packaging/npm/platform.js",
31
20
  "packaging/npm/run.js",
32
21
  "README.md",
@@ -1,5 +1,6 @@
1
1
  const PLATFORM_PACKAGES = {
2
2
  "darwin-x64": {
3
+ packageName: "@singdata/rainbo-cli-darwin-x64",
3
4
  target: "x86_64-apple-darwin",
4
5
  binary: "rainbo",
5
6
  os: "darwin",
@@ -7,6 +8,7 @@ const PLATFORM_PACKAGES = {
7
8
  archiveExt: ".tar.xz",
8
9
  },
9
10
  "darwin-arm64": {
11
+ packageName: "@singdata/rainbo-cli-darwin-arm64",
10
12
  target: "aarch64-apple-darwin",
11
13
  binary: "rainbo",
12
14
  os: "darwin",
@@ -14,12 +16,21 @@ const PLATFORM_PACKAGES = {
14
16
  archiveExt: ".tar.xz",
15
17
  },
16
18
  "win32-x64": {
19
+ packageName: "@singdata/rainbo-cli-win32-x64",
17
20
  target: "x86_64-pc-windows-msvc",
18
21
  binary: "rainbo.exe",
19
22
  os: "win32",
20
23
  cpu: "x64",
21
24
  archiveExt: ".zip",
22
25
  },
26
+ "win32-arm64": {
27
+ packageName: "@singdata/rainbo-cli-win32-arm64",
28
+ target: "aarch64-pc-windows-msvc",
29
+ binary: "rainbo.exe",
30
+ os: "win32",
31
+ cpu: "arm64",
32
+ archiveExt: ".zip",
33
+ },
23
34
  };
24
35
 
25
36
  function currentPlatformKey() {
@@ -12,8 +12,16 @@ const sourceManifest = path.join(repoRoot, "rust", "Cargo.toml");
12
12
  function resolveBundledLauncher() {
13
13
  const platformPackage = currentPlatformPackage();
14
14
  if (!platformPackage) return null;
15
- const launcher = path.join(__dirname, "bin", currentPlatformKey(), platformPackage.binary);
16
- return fs.existsSync(launcher) ? launcher : null;
15
+ const localBundledLauncher = path.join(__dirname, "bin", currentPlatformKey(), platformPackage.binary);
16
+ if (fs.existsSync(localBundledLauncher)) return localBundledLauncher;
17
+
18
+ try {
19
+ const platformManifest = require.resolve(`${platformPackage.packageName}/package.json`);
20
+ const launcher = path.join(path.dirname(platformManifest), "bin", platformPackage.binary);
21
+ return fs.existsSync(launcher) ? launcher : null;
22
+ } catch (_err) {
23
+ return null;
24
+ }
17
25
  }
18
26
 
19
27
  function resolveLauncher() {
@@ -27,11 +35,11 @@ function installIfMissing() {
27
35
  if (resolveLauncher() || fs.existsSync(sourceManifest)) return;
28
36
  const platformPackage = currentPlatformPackage();
29
37
  const packageHint = platformPackage
30
- ? `${currentPlatformKey()} binary`
38
+ ? `${platformPackage.packageName} (${currentPlatformKey()})`
31
39
  : `unsupported platform ${currentPlatformKey()}`;
32
40
  console.error(`rainbo binary package is missing for ${currentPlatformKey()}.`);
33
- console.error(`Expected bundled npm binary: ${packageHint}`);
34
- console.error("Rebuild and reinstall the npm package from packages/rainbo.");
41
+ console.error(`Expected installed npm binary package: ${packageHint}`);
42
+ console.error("Reinstall the rainbo npm package so the matching optional dependency is installed.");
35
43
  process.exit(1);
36
44
  }
37
45