@engramresearch/srun 0.1.0 → 0.1.3

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
@@ -34,7 +34,7 @@ After publishing:
34
34
  npm install -g @engramresearch/srun
35
35
  ```
36
36
 
37
- Note: the npm package currently builds the Rust binary during install, so Rust/Cargo must be available on the target machine.
37
+ The npm package includes prebuilt binaries for supported platforms. Rust/Cargo is only required when building from source.
38
38
 
39
39
  Or run during development:
40
40
 
@@ -139,8 +139,40 @@ srun dev --verbose --dry-run
139
139
 
140
140
  Shows detection and resolution phases before printing the command.
141
141
 
142
+ ## Release process
143
+
144
+ Releases are published by GitHub Actions from version tags.
145
+
146
+ 1. Update the version in `package.json` and `Cargo.toml`.
147
+ 2. Run:
148
+
149
+ ```bash
150
+ npm run release:check
151
+ cargo fmt -- --check
152
+ cargo check
153
+ cargo test
154
+ ```
155
+
156
+ 3. Commit, push, and create a tag:
157
+
158
+ ```bash
159
+ git tag v0.1.3
160
+ git push origin main v0.1.3
161
+ ```
162
+
163
+ The workflow builds platform binaries, packages them into the single root npm package, then publishes `@engramresearch/srun`.
164
+
165
+ Required GitHub secret:
166
+
167
+ ```text
168
+ NPM_TOKEN
169
+ ```
170
+
171
+ Use an npm automation/granular token that can publish under `@engramresearch` and bypass 2FA for CI.
172
+
142
173
  ## Current limitations
143
174
 
175
+ - Prebuilt npm binaries currently target Windows x64, Linux x64, and macOS arm64.
144
176
  - Monorepo scopes such as `srun dev web` are detected as a future extension but not fully implemented yet.
145
177
  - Interactive fallback for custom scripts is not implemented; `srun` reports candidates instead of guessing.
146
178
  - Colors and shell integration are intentionally omitted from the MVP.
Binary file
Binary file
Binary file
package/npm/srun.js CHANGED
@@ -4,23 +4,30 @@ const { existsSync } = require("node:fs");
4
4
  const { join, resolve } = require("node:path");
5
5
 
6
6
  const root = resolve(__dirname, "..");
7
- const binary = join(root, "target", "release", process.platform === "win32" ? "srun.exe" : "srun");
8
-
9
- if (!existsSync(binary)) {
10
- const result = spawnSync("cargo", ["build", "--release"], {
11
- cwd: root,
12
- stdio: "inherit",
13
- shell: process.platform === "win32",
14
- });
15
-
16
- if (result.error) {
17
- console.error(`srun: failed to build Rust binary: ${result.error.message}`);
18
- process.exit(1);
7
+ const binaryName = process.platform === "win32" ? "srun.exe" : "srun";
8
+ const platformKey = `${process.platform}-${process.arch}`;
9
+ const packagedBinary = join(__dirname, "bin", platformKey, binaryName);
10
+ const localDevBinary = join(root, "target", "release", binaryName);
11
+
12
+ function resolveBinary() {
13
+ if (existsSync(packagedBinary)) {
14
+ return packagedBinary;
19
15
  }
20
16
 
21
- if (result.status !== 0) {
22
- process.exit(result.status ?? 1);
17
+ if (existsSync(localDevBinary)) {
18
+ return localDevBinary;
23
19
  }
20
+
21
+ return undefined;
22
+ }
23
+
24
+ const binary = resolveBinary();
25
+
26
+ if (!binary) {
27
+ console.error(`srun: no bundled binary found for ${platformKey}.`);
28
+ console.error("srun: supported npm platforms are win32-x64, linux-x64, and darwin-arm64.");
29
+ console.error("srun: if you are developing locally, run `cargo build --release` first.");
30
+ process.exit(1);
24
31
  }
25
32
 
26
33
  const result = spawnSync(binary, process.argv.slice(2), {
package/package.json CHANGED
@@ -1,25 +1,23 @@
1
1
  {
2
2
  "name": "@engramresearch/srun",
3
- "version": "0.1.0",
3
+ "version": "0.1.3",
4
4
  "description": "Universal Smart Project Runner",
5
5
  "license": "MIT",
6
6
  "bin": {
7
7
  "srun": "npm/srun.js"
8
8
  },
9
9
  "scripts": {
10
- "postinstall": "node npm/postinstall.js",
11
10
  "build:binary": "cargo build --release",
12
11
  "dev": "cargo run",
13
12
  "build": "cargo build",
14
13
  "test": "cargo test",
15
14
  "lint": "cargo clippy",
16
- "format": "cargo fmt"
15
+ "format": "cargo fmt",
16
+ "release:check": "node npm/check-release.js"
17
17
  },
18
18
  "files": [
19
- "Cargo.toml",
20
- "Cargo.lock",
21
- "src",
22
- "npm",
19
+ "npm/srun.js",
20
+ "npm/bin",
23
21
  "README.md",
24
22
  "LICENSE"
25
23
  ],