Skip to content

ci(publish): reconcile JSR package settings (readme, description, runtime) on publish#126

Merged
rickylabs merged 2 commits into
mainfrom
ci/jsr-package-settings
Jun 25, 2026
Merged

ci(publish): reconcile JSR package settings (readme, description, runtime) on publish#126
rickylabs merged 2 commits into
mainfrom
ci/jsr-package-settings

Conversation

@rickylabs

Copy link
Copy Markdown
Owner

What

Reconcile JSR per-package presentation settings on every publish so each @netscript/* package page shows the README, a description, and the supported runtime — none of which can be baked into a published version.

Why this can't live in the package

readmeSource, description, and runtimeCompat are server-side JSR settings. They are not carried in the published tarball, cannot be set from deno.json, and persist across versions. All 31 published members were on JSR's default readmeSource=jsdoc, so package main pages rendered the root module @module JSDoc instead of the README, and descriptions were blank.

Changes

  • .llm/tools/jsr-set-package-settings.ts — idempotent reconciler over every publishable workspace member (packages/ + plugins/, reusing discoverWorkspaceMembers). For each package it diffs current vs desired and PATCHes only what changed:
    • readmeSource = "readme" → README renders on the main page (full symbol docs still live on the Docs tab).
    • description → derived dynamically from the README tagline (markdown flattened, capped at JSR's 250-char limit), so it stays in sync with the docs.
    • runtimeCompat = { deno: true }Deno-only for now. Deno shows as supported; Node/Bun/Browsers/Cloudflare Workers stay "unknown" rather than being falsely marked incompatible (some members like sdk/query-client and fresh-ui are browser-facing).
    • No token / --dry-run → read-only diff, no writes.
  • .github/workflows/publish.yml — new Apply JSR package settings step after Publish (real-publish only), reusing the existing secrets.JSR_TOKEN.

Token

Reuses the existing secrets.JSR_TOKEN already wired into the Ensure JSR packages exist step — no new secret required, provided that token has package-edit scope (the same scope it already uses to create/link packages).

Behavior on the next publish

Settings apply automatically on the next real publish (and cover any newly added package). Live 0.0.1-alpha.2 pages stay JSDoc-sourced until then.

Validation

  • deno check --unstable-kv
  • deno fmt --check
  • lint clean (0 occurrences across .llm/tools) ✓
  • dry-run against live JSR API discovered all 31 members and extracted clean descriptions for every package ✓

🤖 Generated with Claude Code

rickylabs and others added 2 commits June 25, 2026 16:21
JSR per-package presentation settings (readmeSource, description,
runtimeCompat) are server-side and not carried in the published tarball,
so they cannot be baked into a package version and persist across
versions. The 31 published members were all on JSR's default
readmeSource=jsdoc, so package main pages showed the root module @module
JSDoc instead of the README, and descriptions were empty.

Add .llm/tools/jsr-set-package-settings.ts, an idempotent reconciler that,
for every publishable workspace member:
- sets readmeSource=readme so the README renders on the main page
  (full symbol docs still live on the Docs tab),
- sets description dynamically from the README tagline (flattened,
  capped at JSR's 250-char limit),
- sets runtimeCompat={deno:true} (Deno-only for now; other runtimes stay
  "unknown" rather than falsely marked incompatible).

Wire it into publish.yml after the Publish step (real-publish only),
reusing the existing secrets.JSR_TOKEN. Without a token the tool runs a
read-only diff. Verified: deno check + fmt pass, lint clean, dry-run
discovers all 31 members and extracts clean descriptions.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014gW4zfhMMQU6txC828ijct
Add jsr-package-settings.json at the repo root as the single source of
truth for per-package JSR presentation settings, replacing the blanket
runtimeCompat={deno:true} baked into the reconciler.

- `defaults` applies to every publishable member (readmeSource=readme,
  runtimeCompat={deno:true}); `packages` overrides per field, keyed by the
  segment after @netscript/.
- Browser-facing members (sdk, fresh, fresh-ui) declare browser support in
  addition to Deno; server-only members stay Deno-only. Other runtimes are
  left "unknown" rather than falsely marked incompatible.
- description stays dynamic from each README tagline unless overridden.

jsr-set-package-settings.ts now loads the registry (--config to override),
validates readmeSource/runtimeCompat keys and value types, and fails fast
if the config names a package that is not a publishable workspace member.
Falls back to built-in defaults when the file is absent.

Verified: deno check + fmt pass, lint clean, dry-run loads 3 overrides and
resolves all 31 members.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014gW4zfhMMQU6txC828ijct
@rickylabs
rickylabs merged commit c0020a1 into main Jun 25, 2026
6 checks passed
@rickylabs
rickylabs deleted the ci/jsr-package-settings branch June 25, 2026 14:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant