sproutboat 0.12.7 → 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,15 @@ 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
+
13
22
  ## [0.12.7] - 2026-10-03
14
23
 
15
24
  ### Fixed
@@ -773,7 +782,8 @@ its own package.
773
782
  - Renamed the package to `sproutboat` (was `@sproutboat/cli`); dropped the
774
783
  `sprout` bin alias in favour of a user-defined shell alias.
775
784
 
776
- [Unreleased]: https://github.com/baronunread/sproutboat-cli/compare/v0.12.7...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
777
787
  [0.12.7]: https://github.com/baronunread/sproutboat-cli/compare/v0.12.6...v0.12.7
778
788
  [0.12.6]: https://github.com/baronunread/sproutboat-cli/compare/v0.12.5...v0.12.6
779
789
  [0.12.5]: https://github.com/baronunread/sproutboat-cli/compare/v0.12.4...v0.12.5
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.7
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.7",
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",
@@ -78,10 +78,10 @@
78
78
  "typescript": "7.0.2"
79
79
  },
80
80
  "optionalDependencies": {
81
- "@sproutboat/cli-darwin-arm64": "0.12.7",
82
- "@sproutboat/cli-darwin-x64": "0.12.7",
83
- "@sproutboat/cli-linux-arm64": "0.12.7",
84
- "@sproutboat/cli-linux-x64": "0.12.7"
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