You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
New `fledgling jsr` command — the same first-publish story, on [JSR](https://jsr.io). Scaffolds missing `jsr.json` manifests from `package.json`, claims each package on jsr.io (JSR has no create-on-first-publish), links your GitHub repo so CI publishes token-lessly via OIDC (`npx jsr publish`, no `JSR_TOKEN` secret), and syncs the score metadata JSR only stores server-side — package **description** (from `package.json`) and **runtime compatibility** (from `fledgling.jsr.runtimeCompat` config). Idempotent (reconciles metadata drift on every run), rate-limit aware, and stops cleanly at JSR's 20-new-packages-per-week scope quota. Auth via a full-access JSR token in `$JSR_TOKEN`; configure a default scope for unscoped packages with `fledgling.jsr.scope`. Thanks to [@Saeris](https://github.com/Saeris) for the proposal and reference implementation this is built on.
Copy file name to clipboardExpand all lines: README.md
+64Lines changed: 64 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -34,6 +34,7 @@ Run bare `fledgling` in a terminal and you get an interactive wizard (powered by
34
34
|`fledgling add [packages…]`| Claim names + set up trusted publishing for the given packages |
35
35
|`fledgling sync`| Reconcile trusted publishing on npm with your config |
36
36
|`fledgling init`| Write the trusted-publishing config to your `package.json`|
37
+
|`fledgling jsr [packages…]`| Claim packages on [JSR](https://jsr.io) + link the repo for OIDC publishing |
37
38
38
39
## Why
39
40
@@ -240,6 +241,69 @@ fledgling sync "@scope/*" # a subset
240
241
241
242
Use it after changing your `fledgling` config, or to set up trust on packages that were published without it. (It uses the same config/flags as the main command.)
242
243
244
+
## `fledgling jsr` — the same story on JSR
245
+
246
+
[JSR](https://jsr.io) has **no "create on first publish"** — every package must already exist on jsr.io before anything (CI or a human) can publish a version to it. For a monorepo that's the exact papercut fledgling exists to remove, so `fledgling jsr` does for JSR what the main command does for npm:
247
+
248
+
1.**Scaffold** — create a minimal `jsr.json` (name, version, a source `exports` entry) from each `package.json` where missing. An existing `jsr.json`/`deno.json` is authoritative and never rewritten.
249
+
2.**Claim** — create each missing package on jsr.io via the JSR management API.
250
+
3.**Link** — link your GitHub repo to each package, which is JSR's whole trusted-publishing setup: any workflow in the linked repo can then publish **token-lessly via OIDC** (`npx jsr publish` with `permissions: id-token: write` — no `JSR_TOKEN` secret in CI).
251
+
4.**Sync score metadata** — reconcile each package's **description** (from `package.json`) and **runtime compatibility** (from config) to jsr.io. [JSR scores packages](https://jsr.io/docs/scoring) partly on these, and — unlike npm — they live *only* on jsr.io (the `jsr.json` manifest has no `description` field), so they can't ride along at publish time. fledgling reconciles them here, where it already holds the token; only what's changed is pushed.
252
+
253
+
```sh
254
+
npx fledgling jsr # plan (interactive confirm in a terminal)
It's **idempotent** — claimed packages are skipped and the repo link is re-asserted, so re-run it whenever you add a package.
260
+
261
+
### Prerequisites
262
+
263
+
- A **JSR scope** you're a member of (create one at [jsr.io/new](https://jsr.io/new)) — fledgling doesn't create scopes.
264
+
- A JSR **personal access token** with **full access** in `$JSR_TOKEN` (jsr.io → Account → Tokens). A token restricted to "package publish" can publish versions but **cannot** create packages or link a repo — those are management operations. The token is used once, locally; it does **not** go into CI.
265
+
266
+
JSR names always have a scope. Packages whose npm name already has one (`@scope/pkg`) map straight across; for unscoped packages, set the scope once:
267
+
268
+
```jsonc
269
+
{
270
+
"fledgling": {
271
+
"jsr": {
272
+
"scope":"myscope", // JSR scope for unscoped npm names (or override with --scope)
273
+
"manifest":true, // set false to never scaffold jsr.json
274
+
"metadata":true, // set false to never sync description / runtime compat
275
+
"runtimeCompat": { // default runtime-compatibility flags (part of the JSR score)
The **description** is taken automatically from each package's `package.json` (collapsed to a single line and clamped to JSR's 250-char limit). **`runtimeCompat`** is deliberately *not* inferred — set it explicitly, either as the `fledgling.jsr.runtimeCompat` default above or per-package in that package's own `package.json` (a package's own value wins). Only runtimes you mark are changed; re-running reconciles drift, so edit `package.json` and re-run to update jsr.io.
284
+
285
+
### Flags
286
+
287
+
| Flag | Description |
288
+
|------|-------------|
289
+
|`-y, --yes`| Apply without prompting |
290
+
|`--dry-run`| Print a plan without prompting (non-interactive) |
291
+
|`--scope <scope>`| JSR scope for packages whose npm name has none (or to override it) |
292
+
|`--repo <owner/repo>`| GitHub repo to link (default: auto-detected from git `origin`) |
293
+
|`--token <token>`| JSR access token (prefer `$JSR_TOKEN` over the flag) |
-**Rate limits are handled.** JSR's management API throttles bulk operations aggressively; fledgling backs off (honouring `Retry-After`) and paces itself between packages.
301
+
-**20 new packages per scope per rolling week.** JSR hard-caps new package creation, so a larger monorepo can't be bootstrapped in one run. fledgling detects the quota, stops cleanly, and lists what's left — re-run after the reset (or ask jsr.io for a raise); it picks up where it left off.
302
+
-**JSR's OIDC is GitHub-only** today, and there's no per-workflow/environment config — the repo link is the whole setup.
303
+
-**JSR publishes TS source**, so scaffolded manifests point at your source entry (your `development`/`source` export condition, or `./src/index.ts`), not built output.
304
+
305
+
> 🙏 Thanks to [@Saeris](https://github.com/Saeris) for the groundwork that made this feature possible — the [proposal and reference implementation](https://github.com/mirrordown/mirrordown) (including the live findings on JSR's rate limits and weekly quota) that `fledgling jsr` is built on.
306
+
243
307
## Shell completions
244
308
245
309
`fledgling` ships tab-completion (via [`@bomb.sh/tab`](https://github.com/bombshell-dev/tab)) that completes package names and flags. Install it for your shell:
0 commit comments