|
| 1 | +// SPDX-License-Identifier: PMPL-1.0-or-later |
| 2 | +// SPDX-FileCopyrightText: 2026 hyperpolymath |
| 3 | += AffineScript Packaging & Distribution (INT-04) |
| 4 | +:toc: macro |
| 5 | +:icons: font |
| 6 | + |
| 7 | +INT-04 (#181). This documents what is publish-ready, the order, and the |
| 8 | +one open design question. *Nothing here publishes anything*: the |
| 9 | +workflow is manual-only and the owner dispatches it after review. |
| 10 | + |
| 11 | +toc::[] |
| 12 | + |
| 13 | +== JSR-publishable units (Deno/JSR-first) |
| 14 | + |
| 15 | +The JS runtime packages are JSR-publishable today. `deno publish |
| 16 | +--dry-run` succeeds for both (verified during INT-04 prep): |
| 17 | + |
| 18 | +[cols="2,2,3"] |
| 19 | +|=== |
| 20 | +|Package |Spec |Notes |
| 21 | + |
| 22 | +|`packages/affine-js` |`@hyperpolymath/affine-js` |Loader + marshal + |
| 23 | +runtime + ownership accessor. Tests excluded via `publish.exclude`. |
| 24 | +|`affinescript-tea` |`@hyperpolymath/affinescript-tea` |TEA runtime. |
| 25 | +Depends on `@hyperpolymath/affine-js/loader` (import map) — see order. |
| 26 | +|=== |
| 27 | + |
| 28 | +*Publish order is load-bearing*: `affine-js` **must** publish before |
| 29 | +`affinescript-tea` (the latter resolves `@hyperpolymath/affine-js/loader`). |
| 30 | + |
| 31 | +`affinescript-dom` is AffineScript source (`.affine`), not a JS package |
| 32 | +— it is consumed by the compiler, not JSR; out of scope for JSR. |
| 33 | + |
| 34 | +=== Slow types |
| 35 | + |
| 36 | +The JS entrypoints emit JSR's `unsupported-javascript-entrypoint` |
| 37 | +(slow-types) warning — expected for a JS-with-JSDoc package; it |
| 38 | +publishes, only `@hyperpolymath/affine-js`'s fast-check is skipped. |
| 39 | +`types.d.ts` already provides the consumer-facing contract. Converting |
| 40 | +entrypoints is out of scope for INT-04 (tracked separately if desired). |
| 41 | + |
| 42 | +== How to publish (owner, manual) |
| 43 | + |
| 44 | +. Review `deno publish --dry-run` (CI: `Publish to JSR (manual)` with |
| 45 | + `dry_run: true`, or locally `cd <pkg> && deno publish --dry-run`). |
| 46 | +. Dispatch `.github/workflows/publish-jsr.yml` for `affine-js` with |
| 47 | + `dry_run: false` (JSR OIDC via `id-token: write` — no token secret). |
| 48 | +. Then dispatch it for `affinescript-tea`. |
| 49 | + |
| 50 | +== npm tail |
| 51 | + |
| 52 | +"then npm" (#181) is a *separate, later* step and is **not** wired by |
| 53 | +this prep. If/when needed it follows the existing owner-sanctioned npm |
| 54 | +pattern (`.github/workflows/affine-vscode-publish.yml`, `NPM_TOKEN` |
| 55 | +scoped automation token) — a deliberate exception to Deno-first. |
| 56 | + |
| 57 | +== Open design question — the compiler itself |
| 58 | + |
| 59 | +#181 says "publish *compiler* + runtime". The runtime is the JS |
| 60 | +packages above. The **compiler is a native OCaml binary** — it is *not* |
| 61 | +a JSR or npm package. "Publishing the compiler" therefore needs a |
| 62 | +release-binary strategy decision (GitHub Releases artifacts, Guix/Nix |
| 63 | +channel, or a thin JSR/npm shim that fetches a pinned binary). This is |
| 64 | +a one-way-door design choice and is filed as a separate issue rather |
| 65 | +than guessed here. `affinescript-lsp` distribution (INT-10) depends on |
| 66 | +that decision. |
0 commit comments