sproutboat 0.12.6 → 0.13.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,34 @@ maintained going forward by the `release` skill.
10
10
 
11
11
  ## Unreleased
12
12
 
13
+ ## [0.13.0] - 2026-10-04
14
+
15
+ ### Added
16
+
17
+ - `sproutboat build` reads `_headers` and `_redirects` (Cloudflare Pages
18
+ format) from the assets directory and writes the rules into `assets.json`.
19
+ The deployed edge applies them: redirects before any file lookup, header
20
+ rules on edge-served files (baronunread/sproutboat#61).
21
+
22
+ ## [0.12.7] - 2026-10-03
23
+
24
+ ### Fixed
25
+
26
+ - Writing past the end of a typed array is ignored instead of overwriting
27
+ neighbouring memory. `a[-1] = x` no longer writes `a[0]`
28
+ (`@sproutboat/toolchain` 0.4.23, baronunread/sproutboat#241).
29
+ - `join()` and `toString()` work on typed arrays. `Uint8Array.join` returned
30
+ garbage, and a `Uint16Array.join` could kill the process
31
+ (`@sproutboat/toolchain` 0.4.24, baronunread/sproutboat#242).
32
+ - KV stores binary values: `put()` of an `ArrayBuffer` or typed array keeps
33
+ its bytes instead of storing `"0,1,2,..."`. `get(key, type)` supports
34
+ `"text"`, `"json"` and `"arrayBuffer"` (baronunread/sproutboat#233).
35
+ - `fetch()` and service-binding request bodies send an `ArrayBuffer` or typed
36
+ array as its exact bytes, in standalone builds and through the broker. The
37
+ standalone client also no longer cuts a body off at its first zero byte
38
+ (`@sproutboat/runtime` 0.13.5, `@sproutboat/wire` 0.9.3,
39
+ baronunread/sproutboat#232).
40
+
13
41
  ## [0.12.6] - 2026-10-03
14
42
 
15
43
  ### Fixed
@@ -754,7 +782,9 @@ its own package.
754
782
  - Renamed the package to `sproutboat` (was `@sproutboat/cli`); dropped the
755
783
  `sprout` bin alias in favour of a user-defined shell alias.
756
784
 
757
- [Unreleased]: https://github.com/baronunread/sproutboat-cli/compare/v0.12.6...HEAD
785
+ [Unreleased]: https://github.com/baronunread/sproutboat-cli/compare/v0.13.0...HEAD
786
+ [0.13.0]: https://github.com/baronunread/sproutboat-cli/compare/v0.12.7...v0.13.0
787
+ [0.12.7]: https://github.com/baronunread/sproutboat-cli/compare/v0.12.6...v0.12.7
758
788
  [0.12.6]: https://github.com/baronunread/sproutboat-cli/compare/v0.12.5...v0.12.6
759
789
  [0.12.5]: https://github.com/baronunread/sproutboat-cli/compare/v0.12.4...v0.12.5
760
790
  [0.12.4]: https://github.com/baronunread/sproutboat-cli/compare/v0.12.3...v0.12.4
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.12.6
6
+ **Package:** `sproutboat` 0.13.0
7
7
 
8
8
  ## Commands
9
9
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sproutboat",
3
- "version": "0.12.6",
3
+ "version": "0.13.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.4.0",
67
- "@sproutboat/runtime": "^0.13.4",
68
- "@sproutboat/toolchain": "^0.4.22",
69
- "@sproutboat/wire": "^0.9.2"
67
+ "@sproutboat/runtime": "^0.13.5",
68
+ "@sproutboat/toolchain": "^0.4.24",
69
+ "@sproutboat/wire": "^0.9.3"
70
70
  },
71
71
  "devDependencies": {
72
72
  "@oxlint/plugins": "1.81.0",
@@ -78,10 +78,10 @@
78
78
  "typescript": "7.0.2"
79
79
  },
80
80
  "optionalDependencies": {
81
- "@sproutboat/cli-darwin-arm64": "0.12.6",
82
- "@sproutboat/cli-darwin-x64": "0.12.6",
83
- "@sproutboat/cli-linux-arm64": "0.12.6",
84
- "@sproutboat/cli-linux-x64": "0.12.6"
81
+ "@sproutboat/cli-darwin-arm64": "0.13.0",
82
+ "@sproutboat/cli-darwin-x64": "0.13.0",
83
+ "@sproutboat/cli-linux-arm64": "0.13.0",
84
+ "@sproutboat/cli-linux-x64": "0.13.0"
85
85
  },
86
86
  "engines": {
87
87
  "node": ">=18"
package/src/build.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { createHash, randomUUID } from "node:crypto";
2
2
  import { cp, mkdir, readFile, readdir, rename, rm, stat, writeFile } from "node:fs/promises";
3
3
  import { dirname, resolve } from "node:path";
4
- import { walkAssets, type AssetManifest } from "./assets";
4
+ import { readAssetRules, walkAssets, type AssetManifest } from "./assets";
5
5
  import { resourceRefs, type SproutboatConfig } from "./config";
6
6
  import { ensureSqliteObject } from "./sqlite";
7
7
  import { sqliteStamp } from "./sqlite";
@@ -166,14 +166,18 @@ export async function buildArtifact(input: BuildInput): Promise<BuildOutput> {
166
166
  ) {
167
167
  throw new Error(`assets.directory "${input.config.assets?.directory}" not found — run your site build first`);
168
168
  }
169
- const assetManifest: AssetManifest | undefined =
170
- assetDir && input.config.assets
171
- ? {
172
- notFound: input.config.assets.not_found_handling ?? "none",
173
- runSproutFirst: input.config.assets.run_sprout_first ?? false,
174
- files: walkAssets(assetDir),
175
- }
176
- : undefined;
169
+ let assetManifest: AssetManifest | undefined;
170
+ if (assetDir && input.config.assets) {
171
+ assetManifest = {
172
+ notFound: input.config.assets.not_found_handling ?? "none",
173
+ runSproutFirst: input.config.assets.run_sprout_first ?? false,
174
+ files: walkAssets(assetDir),
175
+ };
176
+ // #61 — `_headers`/`_redirects` ride along for the edge to apply.
177
+ const rules = readAssetRules(assetDir);
178
+ if (rules.headers.length) assetManifest.headers = rules.headers;
179
+ if (rules.redirects.length) assetManifest.redirects = rules.redirects;
180
+ }
177
181
  // #15 — an embedded binary has no files beside it, so assets are baked into
178
182
  // the module. Read them from the source directory: the artifact copy happens
179
183
  // after the compile, and the compile is what needs them. Bytes travel as a