This is the release contract for every standalone @wornpage/* staging repository.
src/ is the only authored implementation. Change code there.
dist/ is not another source tree. It is committed generated output only when a package must support direct browser use without a Svelte build step. Never edit it by hand.
Every package declares one mode in package.json:
{
"wornpage": {
"contractVersion": 2,
"delivery": "source"
}
}| Mode | Use it when | Runtime entry | dist/ |
Required proof |
|---|---|---|---|---|
source |
Consumers compile the package | ./src/... |
Forbidden | tests and packed entries |
browser-bundle |
A plain <script type="module"> consumer is supported |
./dist/... |
Generated and committed | tests, reproducible build, consuming index.html, and packed entries |
Default to source. Add a browser bundle only for a real direct-browser consumer. A documentation screenshot or package test is not enough reason to maintain a second delivery artifact.
For a Svelte package with a browser bundle:
exports["."].sveltepoints tosrc/for Svelte-aware consumers.exports["."].defaultandmainpoint to the generated browser file indist/.filesincludes bothsrcanddist.
For a source-only package, the runtime and source entries both point into src/, and files must not include dist.
The declaration states intent. wornpage verify cross-checks that intent against the entries, files, build, demo, actual npm pack result, and the repository's shared release-workflow caller so duplicated metadata cannot silently drift.
Every component repository contains this rule:
* text=auto eol=lfBrowser bundlers can embed source line endings inside generated JavaScript. The rule keeps src/ inputs identical in Windows and Linux clean clones, allowing --frozen-dist to compare generated bytes instead of accepting platform-specific output. The verifier requires the rule for source-only packages too, so changing delivery mode cannot silently introduce a new platform dependency.
Every component README includes a short, versioned Delivery section. It states the canonical source and whether dist/ exists, so a maintainer does not need to infer the rule from export conditions. wornpage verify requires that section to match package.json#wornpage.delivery, and wornpage new adds it to new components automatically.
The package declaration is authoritative; the README section is its human-facing projection. Component-specific behavior and usage stay in the rest of the README instead of being duplicated in the shared contract.
- Edit
src/and package-specific tests. - Run
bun run test. - For
browser-bundle, build from an LF-normalized checkout withbun run buildand review the generateddist/diff. - From a pinned checkout of the CLI, run
bun run src/index.ts verify <component-directory> --frozen-dist. - Push the standalone component repository.
- Update the full Git commit pin and sole package lock in the consuming app.
- Run the consuming app's component import gate, type check, and production build.
The component CI performs step 4 through the reusable release workflow. Projects uses npm --prefix svelte-frontend run check:components for step 7. That consumer gate rejects a floating or mismatched GitHub revision, a deep import, or a missing Svelte source entry before the app build supplies the final integration proof. Component tests cannot prove dependency resolution or app compatibility.
From the staging parent, verify every standalone package with one command:
wornpage verify . --all --frozen-distThis discovers each standalone @wornpage/* repository and prints its declared source and runtime entries. A new component cannot pass until it declares and satisfies the same contract, including CI enforcement.
wornpage/wornpage/packages/ is a generated browsing and cross-package test
mirror. It is not published and no consumer installs from it. The standalone
repositories remain canonical, and bun run sync replaces the mirror from
their GitHub heads while omitting generated dist/ output.
The mirror workflow runs bun run sync --check on pushes, pull requests, and a
daily schedule. A mirror mismatch therefore fails explicitly instead of
creating another plausible source tree. Fix drift by shipping the standalone
repository first, then running bun run sync and committing the generated
mirror update.