@engramresearch/srun 0.1.1 → 0.1.4

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 lazily on first run, 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,42 @@ 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, publishes `@engramresearch/srun` to npmjs, then publishes the same package as a GitHub Packages mirror.
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
+
173
+ GitHub Packages uses the workflow `GITHUB_TOKEN`; no extra secret is required.
174
+
142
175
  ## Current limitations
143
176
 
177
+ - Prebuilt npm binaries currently target Windows x64, Linux x64, and macOS arm64.
144
178
  - Monorepo scopes such as `srun dev web` are detected as a future extension but not fully implemented yet.
145
179
  - Interactive fallback for custom scripts is not implemented; `srun` reports candidates instead of guessing.
146
180
  - 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,6 +1,6 @@
1
1
  {
2
2
  "name": "@engramresearch/srun",
3
- "version": "0.1.1",
3
+ "version": "0.1.4",
4
4
  "description": "Universal Smart Project Runner",
5
5
  "license": "MIT",
6
6
  "bin": {
@@ -12,13 +12,12 @@
12
12
  "build": "cargo build",
13
13
  "test": "cargo test",
14
14
  "lint": "cargo clippy",
15
- "format": "cargo fmt"
15
+ "format": "cargo fmt",
16
+ "release:check": "node npm/check-release.js"
16
17
  },
17
18
  "files": [
18
- "Cargo.toml",
19
- "Cargo.lock",
20
- "src",
21
- "npm",
19
+ "npm/srun.js",
20
+ "npm/bin",
22
21
  "README.md",
23
22
  "LICENSE"
24
23
  ],
@@ -34,5 +33,9 @@
34
33
  ],
35
34
  "engines": {
36
35
  "node": ">=18"
36
+ },
37
+ "repository": {
38
+ "type": "git",
39
+ "url": "git+https://github.com/EngramResearch/srun.git"
37
40
  }
38
41
  }