sproutboat 0.10.0 → 0.10.1
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/CHANGELOG.md +19 -1
- package/SURFACE.md +1 -1
- package/bin/sproutboat.cjs +34 -16
- package/package.json +1 -7
- package/src/compile.ts +14 -3
- package/src/report.ts +6 -3
package/CHANGELOG.md
CHANGED
|
@@ -10,6 +10,23 @@ maintained going forward by the `release` skill.
|
|
|
10
10
|
|
|
11
11
|
## [Unreleased]
|
|
12
12
|
|
|
13
|
+
## [0.10.1] - 2026-09-11
|
|
14
|
+
### Fixed
|
|
15
|
+
- `npm install sproutboat` / `bunx sproutboat` work again. 0.10.0's launcher
|
|
16
|
+
hard-required per-platform `@sproutboat/cli-*` packages that are not published
|
|
17
|
+
yet, so it always failed with "optional package … is missing". The launcher
|
|
18
|
+
now falls back to running `src/main.ts` with Bun when no platform binary is
|
|
19
|
+
installed (the v0.9.0 model), and `optionalDependencies` are dropped until the
|
|
20
|
+
binaries actually ship. 0.10.0 is deprecated on npm.
|
|
21
|
+
- `sproutboat --version` and the deploy banner report the real version instead
|
|
22
|
+
of a hard-coded `0.9.0` when run from the npm package rather than a
|
|
23
|
+
`bun build --compile` binary.
|
|
24
|
+
- `sproutboat build` / `deploy` locate `esbuild` via the installed dependency,
|
|
25
|
+
not just `process.execPath`'s directory, so bundling works on the Bun
|
|
26
|
+
fallback path.
|
|
27
|
+
- The launcher no longer hangs when it receives `SIGINT` / `SIGTERM` while
|
|
28
|
+
forwarding a signal to a running platform binary.
|
|
29
|
+
|
|
13
30
|
## [0.10.0] - 2026-09-11
|
|
14
31
|
### Added
|
|
15
32
|
- Per-platform native CLI: `npm install sproutboat` pulls a prebuilt binary for
|
|
@@ -341,7 +358,8 @@ its own package.
|
|
|
341
358
|
- Renamed the package to `sproutboat` (was `@sproutboat/cli`); dropped the
|
|
342
359
|
`sprout` bin alias in favour of a user-defined shell alias.
|
|
343
360
|
|
|
344
|
-
[Unreleased]: https://github.com/baronunread/sproutboat-cli/compare/v0.10.
|
|
361
|
+
[Unreleased]: https://github.com/baronunread/sproutboat-cli/compare/v0.10.1...HEAD
|
|
362
|
+
[0.10.1]: https://github.com/baronunread/sproutboat-cli/compare/v0.10.0...v0.10.1
|
|
345
363
|
[0.10.0]: https://github.com/baronunread/sproutboat-cli/compare/v0.9.0...v0.10.0
|
|
346
364
|
[0.9.0]: https://github.com/baronunread/sproutboat-cli/compare/v0.8.0...v0.9.0
|
|
347
365
|
[0.8.0]: https://github.com/baronunread/sproutboat-cli/compare/v0.7.0...v0.8.0
|
package/SURFACE.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
> Generated by `src/surface.test.ts` from `src/surface.ts` + the pinned
|
|
4
4
|
> toolchain constants. Do not edit by hand — run `UPDATE_SURFACE=1 bun test`.
|
|
5
5
|
|
|
6
|
-
**Package:** `sproutboat` 0.
|
|
6
|
+
**Package:** `sproutboat` 0.10.1 · runs on Bun (use `bunx`, not `npx`)
|
|
7
7
|
|
|
8
8
|
## Commands
|
|
9
9
|
|
package/bin/sproutboat.cjs
CHANGED
|
@@ -1,32 +1,50 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
// npm
|
|
2
|
+
// npm selects the packaged executable for this host when it is installed; that
|
|
3
|
+
// is a native single-file binary that needs no Bun. When it is absent (it is
|
|
4
|
+
// not published yet — see issue #134), fall back to running the TypeScript
|
|
5
|
+
// entry point with Bun, which is how the CLI shipped through v0.9.0.
|
|
3
6
|
const { spawn } = require("node:child_process");
|
|
4
|
-
const {
|
|
7
|
+
const { join } = require("node:path");
|
|
5
8
|
|
|
6
9
|
const platform = process.platform === "darwin" ? "darwin" : process.platform === "linux" ? "linux" : null;
|
|
7
10
|
const arch = process.arch === "arm64" ? "arm64" : process.arch === "x64" ? "x64" : null;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
const packageName = `@sproutboat/cli-${platform}-${arch}`;
|
|
13
|
-
let executable;
|
|
11
|
+
|
|
12
|
+
let command;
|
|
13
|
+
let args;
|
|
14
|
+
let viaBun = false;
|
|
14
15
|
try {
|
|
15
|
-
|
|
16
|
+
if (!platform || !arch) throw new Error(`unsupported host ${process.platform}/${process.arch}`);
|
|
17
|
+
command = require.resolve(`@sproutboat/cli-${platform}-${arch}/bin/sproutboat`);
|
|
18
|
+
args = process.argv.slice(2);
|
|
16
19
|
} catch {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
process.
|
|
20
|
+
viaBun = true;
|
|
21
|
+
// SPROUTBOAT_BUN is an escape hatch for an unusual install; otherwise PATH.
|
|
22
|
+
command = process.env.SPROUTBOAT_BUN || "bun";
|
|
23
|
+
args = [join(__dirname, "..", "src", "main.ts"), ...process.argv.slice(2)];
|
|
20
24
|
}
|
|
21
|
-
|
|
25
|
+
|
|
26
|
+
const child = spawn(command, args, { stdio: "inherit", windowsHide: true });
|
|
27
|
+
|
|
22
28
|
child.once("error", (error) => {
|
|
23
|
-
|
|
29
|
+
if (viaBun && error.code === "ENOENT") {
|
|
30
|
+
console.error("sproutboat: this build needs Bun on PATH. Install it: https://bun.sh");
|
|
31
|
+
} else {
|
|
32
|
+
console.error(`sproutboat: could not start: ${error.message}`);
|
|
33
|
+
}
|
|
24
34
|
process.exit(1);
|
|
25
35
|
});
|
|
36
|
+
|
|
26
37
|
for (const signal of ["SIGINT", "SIGTERM"]) {
|
|
27
38
|
process.on(signal, () => child.kill(signal));
|
|
28
39
|
}
|
|
40
|
+
|
|
29
41
|
child.once("exit", (code, signal) => {
|
|
30
|
-
if (signal)
|
|
31
|
-
|
|
42
|
+
if (signal) {
|
|
43
|
+
// Re-raise so the parent's exit reflects the signal — but drop our own
|
|
44
|
+
// handler first, or the re-raise re-enters it and the process hangs.
|
|
45
|
+
process.removeAllListeners(signal);
|
|
46
|
+
process.kill(process.pid, signal);
|
|
47
|
+
} else {
|
|
48
|
+
process.exit(code ?? 1);
|
|
49
|
+
}
|
|
32
50
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sproutboat",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.1",
|
|
4
4
|
"description": "Wrangler-shaped CLI for Sproutboat. Deploys workers to any control plane via --api-url / SPROUTBOAT_API_URL.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cli",
|
|
@@ -76,12 +76,6 @@
|
|
|
76
76
|
"oxlint": "1.81.0",
|
|
77
77
|
"typescript": "7.0.2"
|
|
78
78
|
},
|
|
79
|
-
"optionalDependencies": {
|
|
80
|
-
"@sproutboat/cli-darwin-arm64": "0.10.0",
|
|
81
|
-
"@sproutboat/cli-darwin-x64": "0.10.0",
|
|
82
|
-
"@sproutboat/cli-linux-arm64": "0.10.0",
|
|
83
|
-
"@sproutboat/cli-linux-x64": "0.10.0"
|
|
84
|
-
},
|
|
85
79
|
"engines": {
|
|
86
80
|
"node": ">=18"
|
|
87
81
|
}
|
package/src/compile.ts
CHANGED
|
@@ -201,10 +201,21 @@ export async function compileSprout(input: CompileInput): Promise<void> {
|
|
|
201
201
|
const launcher = resolve(porffor, "runtime/index.js");
|
|
202
202
|
// A host build never shells `zig`, so it has no zigBin to contribute.
|
|
203
203
|
const zigDir = input.zigBin ? `${dirname(input.zigBin)}:` : "";
|
|
204
|
+
// The per-platform binary ships esbuild next to it; a compiled build finds it
|
|
205
|
+
// there. Running from the npm package under Bun, `process.execPath` is Bun
|
|
206
|
+
// itself and `npm i -g` puts no dependency `.bin` on PATH, so resolve the
|
|
207
|
+
// esbuild dependency directly. `Bun.which` is the last resort.
|
|
204
208
|
const packagedEsbuild = resolve(dirname(process.execPath), "esbuild");
|
|
205
|
-
|
|
206
|
-
if (!esbuild)
|
|
207
|
-
|
|
209
|
+
let esbuild: string | null = existsSync(packagedEsbuild) ? packagedEsbuild : null;
|
|
210
|
+
if (!esbuild) {
|
|
211
|
+
try {
|
|
212
|
+
esbuild = Bun.resolveSync("esbuild/bin/esbuild", import.meta.dir);
|
|
213
|
+
} catch {
|
|
214
|
+
esbuild = null;
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
esbuild ??= Bun.which("esbuild");
|
|
218
|
+
if (!esbuild) throw new Error("esbuild could not be located; install it or reinstall sproutboat");
|
|
208
219
|
const path = `${zigDir}${dirname(esbuild)}:${process.env.PATH ?? ""}`;
|
|
209
220
|
const command = PACKAGED
|
|
210
221
|
? [process.execPath, "__porffor", launcher]
|
package/src/report.ts
CHANGED
|
@@ -2,10 +2,13 @@ import { gzipSync } from "bun";
|
|
|
2
2
|
import { resourceRefs, type SproutboatConfig } from "./config";
|
|
3
3
|
import type { ArtifactManifest } from "./manifest";
|
|
4
4
|
import { bold, dim, leaf, sprout } from "./style";
|
|
5
|
+
import pkg from "../package.json" with { type: "json" };
|
|
5
6
|
|
|
6
|
-
// `bun build --compile` has no package-relative filesystem at runtime
|
|
7
|
-
// release build injects this
|
|
8
|
-
|
|
7
|
+
// `bun build --compile` has no package-relative filesystem at runtime, so the
|
|
8
|
+
// release build injects this via `--define`. Running from source (or the npm
|
|
9
|
+
// package under Bun) falls back to the bundled package.json version — `bun build
|
|
10
|
+
// --compile` inlines the JSON import, so this branch is correct there too.
|
|
11
|
+
export const CLI_VERSION = process.env.SPROUTBOAT_CLI_VERSION ?? pkg.version;
|
|
9
12
|
|
|
10
13
|
function bytes(n: number): string {
|
|
11
14
|
if (n < 1024) return `${n} B`;
|