Publish init.js drop-in so unpkg.com/playhtml/init.js works - #225
Open
spencerc99 wants to merge 2 commits into
Open
Publish init.js drop-in so unpkg.com/playhtml/init.js works#225spencerc99 wants to merge 2 commits into
spencerc99 wants to merge 2 commits into
Conversation
commit: |
spencerc99
force-pushed
the
worktree-agent-ac2706979716bee92
branch
from
June 28, 2026 05:50
dc0c7f7 to
65fbbf4
Compare
Deploying playhtml with
|
| Latest commit: |
8d85b19
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://1e963c4c.playhtml.pages.dev |
| Branch Preview URL: | https://worktree-agent-ac2706979716b.playhtml.pages.dev |
Owner
Author
Code review
|
Deploying we-were-online-website with
|
| Latest commit: |
8d85b19
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://92b0c307.we-were-online-website.pages.dev |
| Branch Preview URL: | https://worktree-agent-ac2706979716b.we-were-online-website.pages.dev |
Owner
Author
Code review
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
https://unpkg.com/playhtml/init.jshas never resolved (404) — the build only emitsdist/init.es.js, and the packagefiles/exportsonly exposeddist/. unpkg resolves real files in the published tarball for bare paths like/playhtml/init.js, so a real file must exist at the package root. This adds it.Closes #222.
What I did
packages/playhtml/init.jsat the package root that imports the built bundle and boots playhtml with defaults:// ABOUTME:header since it's hand-authored.)"init.js"topackage.jsonfilesso it ships in the tarball."./init.js": "./init.js"to theexportsmap so bundler imports ofplayhtml/init.jsalso resolve.playhtmlpatch).No change to
dist/init.es.js— the existing verbose path still works.How I verified
tsc && vite buildboth pass;dist/init.es.jsstill emitted).npm pack --dry-runconfirmsinit.jsis in the published tarball:vitest run --no-typecheck→ 207 passed (24 files), no regressions.Docs
Per the issue, docs are intentionally unchanged in this PR. After release,
apps/docs/src/content/docs/getting-started.mdxPath A (and the two prose mentions) can be simplified fromhttps://unpkg.com/playhtml/dist/init.es.jsback to the shorthttps://unpkg.com/playhtml/init.js.