Skip to content

Keep consumer packages small and publish independent runtime releases to R2 - #1200

Merged
mikebarkmin merged 6 commits into
mainfrom
ccr-dc12b6f7-p2rfkj
Oct 10, 2026
Merged

mikebarkmin merged 6 commits into
mainfrom
ccr-dc12b6f7-p2rfkj

Conversation

@mikebarkmin

@mikebarkmin mikebarkmin commented Oct 10, 2026 •

Copy link
Copy Markdown
Member

Large element runtimes are excluded from the CLI, Markdown package and VS Code extension. The extension uses the configured CDN or the CLI's shared, verified asset cache, and provides commands to download runtimes for offline previews.

PyIDE now uses Pyodide's pinned jsDelivr CDN by default because the complete local distribution is very large. CLI prefetching and builds skip its runtime when cdn is omitted. Explicit elements.pyide.cdn: false retains local and offline builds, and VS Code follows the same default even when a local runtime is cached. English and German element/configuration docs explain the default and offline setup. New hosting guides cover the shared runtime cache, GitHub Actions cache reuse, HTML revalidation and immutable caching only for versioned asset URLs.

Online IDE, SQL IDE and OpenSCAD defaults now point to immutable releases on cdn.openpatch.org, independently of the Markdown npm package. The IDE source repositories publish their own verified GitHub release archives to R2 (Online IDE PR, SQL IDE PR); Hyperbook publishes OpenSCAD directly from pinned upstream WASM, fonts and libraries. New CDN releases preserve all older files and are checked through the public hostname. Hyperbook's package release workflow verifies every pinned CDN file against its local runtime payload before publishing.

Wrangler uses organization secret CLOUDFLARE_R2_CDN and variable or secret CLOUDFLARE_ACCOUNT_ID. Cloudflare API operations require Account → Workers R2 Storage → Edit (R2 Admin Read & Write). Full setup and retry commands are in docs/cdn-releases.md.

Validation: all 874 Hyperbook tests and 8 publisher tests pass; CLI, Markdown and VS Code builds and type checks succeed; actionlint passes. Actual npm tarballs and VSIX were checked for excluded runtimes and isolated consumer startup. Both documentation translations build offline; the new hosting links, anchors and workflow examples render correctly.

The initial R2 uploads succeeded for Online IDE v2.2.1-hyperbook.28, SQL IDE v2.0.0-hyperbook.4 and OpenSCAD 2026.10.08-1. All 532 runtime files pass live public CDN checks for SHA-256, MIME type, CORS and immutable caching against Hyperbook's local payloads. Chromium loaded the actual CDNs, executed Java and SQL, and rendered an OpenSCAD cube with no browser errors. A separate generated book with no PyIDE configuration loaded the actual jsDelivr runtime and NumPy, executed Python with the expected output, and exported no local Pyodide distribution. Merge the owning repository workflows to enable publication for future releases.

mikebarkmin and others added 5 commits October 10, 2026 09:57
The Markdown npm package and the VS Code extension shipped every large
element runtime and grew too big to publish. Markdown 0.85.0 never
reached npm.

- Markdown's npm package leaves out the Pyodide, GeoGebra, Typst,
  Blockflow and Excalidraw runtimes and keeps their integration files.
  Blockflow's default CDN is now blockflow.openpatch.org and Excalidraw's
  is its own packages on UNPKG, so every `cdn: true` default still
  resolves. OpenSCAD, Online IDE and SQL IDE stay, because their default
  CDN is this package on UNPKG. A test packs a fixture with npm and
  enforces this split.
- The VS Code extension leaves all eight runtimes out through
  .vscodeignore. The preview detects a missing runtime and loads it from
  the element's default CDN, unless the book sets its own CDN URL. A
  test lists the package with vsce.
- @hyperbook/types exports elementRuntimeFiles, now shared by the CLI's
  asset manager and the VS Code preview.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MsgtLGX2AgDYCZnqCYUHhz
The VS Code preview now resolves element runtimes like a Hyperbook build
instead of always falling back to a CDN.

- Elements with a `cdn` setting load from that CDN, as in a build.
- Other elements use their runtime from the Hyperbook CLI's asset cache.
  The extension ships the CLI's asset manifest and shares the CLI's
  content-addressed, SHA-256 verified bundles, so a runtime fetched by
  either one works for both.
- Runtimes that are not downloaded yet load from their default CDN, and
  the preview offers to download the ones the page uses.
- New commands "Download Element Runtimes..." and "Download All Element
  Runtimes" mirror `hyperbook assets fetch` and `--all`.

The asset manager moves from the CLI into @hyperbook/fs so both can use
it. The CLI keeps a thin wrapper with its default paths. The shared
build script now treats Node built-ins as external, which leaves the
other packages' bundles unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MsgtLGX2AgDYCZnqCYUHhz
@vercel

vercel Bot commented Oct 10, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
hyperbook-4fwa Ready Ready Preview Oct 10, 2026 9:56am UTC

@mikebarkmin
mikebarkmin marked this pull request as ready for review October 10, 2026 10:00
@mikebarkmin
mikebarkmin merged commit 261f2e5 into main Oct 10, 2026
3 checks passed
@mikebarkmin
mikebarkmin deleted the ccr-dc12b6f7-p2rfkj branch October 10, 2026 10:00
@github-actions github-actions Bot mentioned this pull request Oct 10, 2026

This branch was successfully deployed

1 active deployment
Preview — 6ac3fab8 Deployed Oct 10, 2026 by vercel[bot]
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