npm.io
0.5.0 • Published 1 week ago

@spacefast/build-output

Licence
MIT
Version
0.5.0
Deps
1
Size
43 kB
Vulns
0
Weekly
0

@spacefast/build-output

The two on-disk contracts of Automagic Publish, defined once and imported by both sides:

  • spacefast.buildoutput.v1 — the manifest describing what a build produced: static tree with content hashes, immutable assets, the worker bundle, route claims, prerenders with their revalidation facts, route rules, tag→path index, capabilities, env var names, and Durable Object cache seeding. Loaded with loadBuildOutput(path).
  • Classification manifest (.spacefast/build.json) — the shared fact format adapters emit and the CLI classifier consumes: routes and their framework-declared render classes, middleware matchers, route rules, prerendered files, and implicit endpoints. Loaded with loadClassificationManifest(path).

Adapters emit facts only — how the framework built the app — never platform policy. Serving decisions belong to the classifier and the platform.

Both loaders are fail-closed and answer a three-way question: null means the file does not exist, a parsed document means it validated in full, and anything else — unreadable, malformed JSON, an unknown schema version, or a shape violation — throws a ContractFileError whose reason says which.