sproutboat 0.17.0 → 0.19.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/CHANGELOG.md CHANGED
@@ -10,6 +10,52 @@ maintained going forward by the `release` skill.
10
10
 
11
11
  ## Unreleased
12
12
 
13
+ ## [0.19.0] - 2026-10-21
14
+
15
+ ### Added
16
+
17
+ - From compatibility date `2026-10-21`, `Response.body` and `Request.body` are
18
+ `ReadableStream`s for every body type, as in Fetch and workerd: `res.body.getReader()`,
19
+ `res.body.pipeThrough(...)` and `new Response(upstream.body)` work on any response,
20
+ including the incoming request. Apps with an earlier `compatibility_date` keep the raw
21
+ body (`JSON.parse(request.body)`, as the examples do); move the date and rebuild to opt in.
22
+
23
+ ### Fixed
24
+
25
+ - `env.BUCKET.put(key, request.body)`, `env.KV.put(key, request.body)` and
26
+ `fetch(url, { body: request.body })` take the request body, stream or not.
27
+ - A non-ASCII request body is no longer UTF-8 encoded twice by `arrayBuffer()`,
28
+ `blob()` or KV `put` (`é` arrived as `é`), and R2 `put` accepts bytes.
29
+
30
+ ## [0.18.0] - 2026-10-20
31
+
32
+ ### Added
33
+
34
+ - Porffor Alpha 18 (`@sproutboat/toolchain` 0.9, `@sproutboat/runtime` 0.18).
35
+ - Standalone sprouts stream `ReadableStream` response bodies chunk by chunk, so
36
+ Server-Sent Events and long responses work; a client that disconnects cancels
37
+ the stream.
38
+ - `HTMLRewriter` (Cloudflare's API, output matching lol-html),
39
+ `CompressionStream`/`DecompressionStream` (gzip, deflate, deflate-raw),
40
+ `structuredClone`, `Event`/`EventTarget`/`AbortController`,
41
+ `TextEncoderStream`/`TextDecoderStream`, and more Web Crypto (SHA-1, MD5,
42
+ HMAC-SHA1, `exportKey`, `generateKey`).
43
+ - Fetch-spec `Request`, `Response`, `Headers`, `Blob` and `FormData`: byte bodies
44
+ go out as bytes, body readers read `ReadableStream` bodies, and `JSON.parse`
45
+ applies its reviver.
46
+
47
+ ### Fixed
48
+
49
+ - `ctx.waitUntil` work no longer delays the response.
50
+ - `setTimeout(fn, 0)` fires on Linux.
51
+ - An edited compiler patch no longer hides behind a stale Porffor cache.
52
+
53
+ ### Changed
54
+
55
+ - `Response.redirect` sends the serialized URL (`https://example.com/`), and a
56
+ 204/205/304 response with a body throws, per Fetch and workerd.
57
+ - Porffor's build cache keeps the 100 most recent builds.
58
+
13
59
  ## [0.17.0] - 2026-10-11
14
60
 
15
61
  ### Added
@@ -877,7 +923,11 @@ its own package.
877
923
  - Renamed the package to `sproutboat` (was `@sproutboat/cli`); dropped the
878
924
  `sprout` bin alias in favour of a user-defined shell alias.
879
925
 
880
- [Unreleased]: https://github.com/baronunread/sproutboat-cli/compare/v0.15.0...HEAD
926
+ [Unreleased]: https://github.com/baronunread/sproutboat-cli/compare/v0.19.0...HEAD
927
+ [0.19.0]: https://github.com/baronunread/sproutboat-cli/compare/v0.18.0...v0.19.0
928
+ [0.18.0]: https://github.com/baronunread/sproutboat-cli/compare/v0.17.0...v0.18.0
929
+ [0.17.0]: https://github.com/baronunread/sproutboat-cli/compare/v0.16.0...v0.17.0
930
+ [0.16.0]: https://github.com/baronunread/sproutboat-cli/compare/v0.15.0...v0.16.0
881
931
  [0.15.0]: https://github.com/baronunread/sproutboat-cli/compare/v0.14.0...v0.15.0
882
932
  [0.14.0]: https://github.com/baronunread/sproutboat-cli/compare/v0.13.0...v0.14.0
883
933
  [0.13.0]: https://github.com/baronunread/sproutboat-cli/compare/v0.12.7...v0.13.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.17.0
6
+ **Package:** `sproutboat` 0.19.0
7
7
 
8
8
  ## Commands
9
9
 
@@ -76,7 +76,7 @@ usage: sproutboat <init [name] | check [project-dir] | types [project-dir] | dev
76
76
  | | |
77
77
  | --- | --- |
78
78
  | Zig | `0.16.0` (`zig cc -target x86_64-linux-musl`, static) |
79
- | Provenance stamp | `zig-musl/0.16.0+porffor/731f1b2+uws/360c276d` |
79
+ | Provenance stamp | `zig-musl/0.16.0+porffor/deda494+uws/360c276d` |
80
80
  | Artifact schema | `2` |
81
81
  | Runtime | `native-fetch` |
82
82
  | Capability profile | `http-sync-v0` |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sproutboat",
3
- "version": "0.17.0",
3
+ "version": "0.19.0",
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",
@@ -64,9 +64,9 @@
64
64
  "@sproutboat/artifact": "^0.3.0",
65
65
  "@sproutboat/assets": "^0.3.0",
66
66
  "@sproutboat/config": "^0.5.0",
67
- "@sproutboat/runtime": "^0.16.0",
68
- "@sproutboat/toolchain": "^0.7.0",
69
- "@sproutboat/wire": "^0.12.2"
67
+ "@sproutboat/runtime": "^0.19.2",
68
+ "@sproutboat/toolchain": "^0.10.2",
69
+ "@sproutboat/wire": "^0.13.2"
70
70
  },
71
71
  "devDependencies": {
72
72
  "@oxlint/plugins": "1.85.0",
@@ -78,10 +78,10 @@
78
78
  "typescript": "7.0.2"
79
79
  },
80
80
  "optionalDependencies": {
81
- "@sproutboat/cli-darwin-arm64": "0.17.0",
82
- "@sproutboat/cli-darwin-x64": "0.17.0",
83
- "@sproutboat/cli-linux-arm64": "0.17.0",
84
- "@sproutboat/cli-linux-x64": "0.17.0"
81
+ "@sproutboat/cli-darwin-arm64": "0.19.0",
82
+ "@sproutboat/cli-darwin-x64": "0.19.0",
83
+ "@sproutboat/cli-linux-arm64": "0.19.0",
84
+ "@sproutboat/cli-linux-x64": "0.19.0"
85
85
  },
86
86
  "engines": {
87
87
  "node": ">=18"
package/src/compile.ts CHANGED
@@ -120,19 +120,29 @@ let porfforBuildsPruned = false;
120
120
  * never removes any (one machine had 1,395 of them, 6.3 GB). Drop the ones not
121
121
  * compiled in for a week; the only cost is a recompile. Each dir's `flags`
122
122
  * stamp is rewritten on every compile, so its mtime is "last used".
123
+ *
124
+ * Age alone does not bound it: every dev session, temp-dir test and scratch
125
+ * build is a new entry path, so another machine reached 923 dirs (10 GB) in
126
+ * three days. Keep only the `keep` most recently used as well (~11 MB each).
123
127
  */
124
128
  export async function prunePorfforBuilds(
125
129
  root = resolve(process.env.HOME ?? homedir(), ".cache/porffor/build"),
126
130
  now = Date.now(),
131
+ keep = 100,
127
132
  ): Promise<number> {
128
133
  porfforBuildsPruned = true;
129
134
  const cutoff = now - 7 * 24 * 60 * 60 * 1000;
130
135
  const entries: string[] = await readdir(root).catch(() => []);
131
- let removed = 0;
136
+ const dirs: { dir: string; used: number }[] = [];
132
137
  for (const name of entries) {
133
138
  const dir = resolve(root, name);
134
139
  const used = (await stat(resolve(dir, "flags")).catch(() => null)) ?? (await stat(dir).catch(() => null));
135
- if (used && used.mtimeMs < cutoff) {
140
+ if (used) dirs.push({ dir, used: used.mtimeMs });
141
+ }
142
+ dirs.sort((a, b) => b.used - a.used);
143
+ let removed = 0;
144
+ for (const [index, { dir, used }] of dirs.entries()) {
145
+ if (used < cutoff || index >= keep) {
136
146
  await rm(dir, { recursive: true, force: true });
137
147
  removed++;
138
148
  }