Sites 0.3.0: library catalog #5

Merged
oliver.maklott merged 1 commit from phase-8 into main 2026-11-20 11:41:32 +01:00

Phase 8 of the Sites plan (spec S11): the library catalog.

  • Admin → Sites → libs. Choose an npm package and version (or latest) from registry.npmjs.org, fetched with an SSRF-guarded fetch limited to that host. The tarball is checked against dist.integrity (sha512) before anything is kept. The page shows the license; the operator picks files (no HTML; at most 300 files and 60 MiB per library) and sets the kind (ES module / classic script / stylesheet), the entry file and the import alias.
  • Catalog manifest. {v:1, kind:'libs', files} with paths <id>/<version>/…, canonical and content-addressed. It goes into every target's desired state (payload.libs), and referencedBy makes it and its objects fetchable for that target's deployer only.
  • Preview. Serves /_lib/… from the store with immutable caching. Publish checks now receive the catalog, so lib-unknown fires only for libraries that are really missing.
  • Folder panel. "Include a library" shows a snippet to copy: an import map plus script.js for modules; for classic libraries, the entry first and then any add-ons.
  • PixiJS suggestion. It is the classic build plus dist/packages/unsafe-eval.min.js. Checked in headless Chromium under the exact site CSP: PixiJS 8.23 renders through WebGL with no CSP violation. The ESM build fails there (script-src eval), so it is not suggested.

Tests: tar reader (pax/prefix/links), snippets, integrity mismatch, file and entry rules. A store and Redis case covers the full path: catalog → desired state → deployer references → preview /_lib/ → publish check → removal. Pack suite 58/58.

🤖 Generated with Claude Code

Phase 8 of the Sites plan (spec S11): the library catalog. - **Admin → Sites → libs.** Choose an npm package and version (or `latest`) from `registry.npmjs.org`, fetched with an SSRF-guarded fetch limited to that host. The tarball is checked against `dist.integrity` (sha512) before anything is kept. The page shows the license; the operator picks files (no HTML; at most 300 files and 60 MiB per library) and sets the kind (ES module / classic script / stylesheet), the entry file and the import alias. - **Catalog manifest.** `{v:1, kind:'libs', files}` with paths `<id>/<version>/…`, canonical and content-addressed. It goes into every target's desired state (`payload.libs`), and `referencedBy` makes it and its objects fetchable for that target's deployer only. - **Preview.** Serves `/_lib/…` from the store with `immutable` caching. Publish checks now receive the catalog, so `lib-unknown` fires only for libraries that are really missing. - **Folder panel.** "Include a library" shows a snippet to copy: an import map plus `script.js` for modules; for classic libraries, the entry first and then any add-ons. - **PixiJS suggestion.** It is the classic build plus `dist/packages/unsafe-eval.min.js`. Checked in headless Chromium under the exact site CSP: PixiJS 8.23 renders through WebGL with no CSP violation. The ESM build fails there (`script-src eval`), so it is not suggested. Tests: tar reader (pax/prefix/links), snippets, integrity mismatch, file and entry rules. A store and Redis case covers the full path: catalog → desired state → deployer references → preview `/_lib/` → publish check → removal. Pack suite 58/58. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Phase 8: library catalog. Release 0.3.0.
All checks were successful
Publish / dev-image (pull_request) Successful in 0s
Publish / test (pull_request) Successful in 41s
Publish / pack-and-publish (pull_request) Has been skipped
0a3bf46890
Operators add npm packages (tarball checked against dist.integrity,
license shown, files picked); the catalog manifest is part of every
target's desired state and fetchable by its deployer, the preview serves
/_lib/<id>/<version>/…, publish checks know the catalog, and the folder
panel shows the snippet to copy. PixiJS is suggested as classic build +
unsafe-eval add-on: the ESM build breaks under the site CSP (checked in
Chromium).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
limedoc-plugins/sites!5
No description provided.