Skip to content

feat(host): generate dist/index.html for Pulsar CEF + browser hosts#2

Merged
ClodoCapeo merged 1 commit intomainfrom
feat/host-html-bootstrap
May 2, 2026
Merged

feat(host): generate dist/index.html for Pulsar CEF + browser hosts#2
ClodoCapeo merged 1 commit intomainfrom
feat/host-html-bootstrap

Conversation

@ClodoCapeo
Copy link
Copy Markdown
Contributor

Summary

  • Solar's library mode produces no index.html. The broadcast host (Pulsar CEF, editor preview iframe) needs one to load solar.js and call mount().
  • This PR adds scripts/build-host-html.mjs — a postbuild step that generates dist/index.html with an inline ES-module bootstrap mirroring src/dev-entry.tsx but production-defaulted (broadcast mode, no test token, console.error only).
  • Bumps to v0.1.1. Tag v0.1.1 after merge → release workflow publishes the new tarball.

Why now

Wave 4 Pulsar wiring loads https://<gate>/orion/static/solar/v{N}/index.html?orion=...&token=...&mode=broadcast (chantier-pulsar-wiring § Scope > URL acceptance contract). Without index.html the URL contract is unfulfilled.

The Vite config already documented this gap inline:

// The HTML wrapper consumed by Pulsar CEF is built
// in a follow-up step (see scripts/build-html.* — out of scope for
// the initial scaffold).

This PR closes that follow-up.

Test plan

  • npm run lint clean
  • npm run typecheck clean
  • npm test 43/43
  • npm run build produces dist/index.html (1992 B) alongside the JS chunks
  • npm run check:bundle still passes (the host HTML is not gz-budgeted — it's a separate static file)
  • CI green on this PR before merge
  • Tag v0.1.1 after merge → release workflow publishes solar-v0.1.1.tgz with index.html included

🤖 Generated with Claude Code

Solar is a library bundle, but the broadcast host (Pulsar CEF, also
the editor preview iframe) loads it as a static URL — it needs an
HTML entry that imports solar.js, reads URL query params, and calls
mount(). Vite's library mode strips index.html ; this PR adds a
postbuild script that generates dist/index.html with an inline ES
module bootstrap mirroring the dev-entry harness, but production-
ready (defaults to broadcast mode, no test-token, console.error
only — no chrome on the broadcast surface).

The HTML is 1992 bytes raw, references ./solar.js relatively so any
host that serves the unpacked tarball at a path can load it without
template substitution.

Bumps to v0.1.1 ; release workflow on tag push will publish the
updated tarball with index.html alongside the chunks.
@ClodoCapeo ClodoCapeo merged commit f487831 into main May 2, 2026
5 checks passed
@ClodoCapeo ClodoCapeo deleted the feat/host-html-bootstrap branch May 2, 2026 20:34
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