Skip to content

Commit eb48d1f

Browse files
chore: add changeset for 0.1.1 (SSR fix + README refresh) (#18)
* chore: add changeset for 0.1.1 (SSR fix + README refresh) Queues the next version bump. Once this lands on main, the changesets GitHub Action will open a "chore: version packages" PR that bumps @kripa006/404-ui 0.1.0 -> 0.1.1 and updates the changelog. Merging that auto-PR triggers Release on push, which runs `changeset publish` and uploads 0.1.1 to npm. The headline change is the SSR fix from PR #10 — vanilla entries no longer throw `HTMLElement is not defined` under Node. The README refresh ensures npmjs.com displays the up-to-date gallery + snippets on the 0.1.1 version page (the 0.1.0 publish stored `readme: null` so npmjs is currently falling back to a much older 0.0.0 readme). Per the original ship plan, this is a patch bump (bug fix + docs). The framework example apps that were originally bundled with PR #4 were deferred to a follow-up, so no minor bump is warranted yet. * ci: ensure local base branch exists before running changeset status PR Validation's `release-check` job was failing on the first PR that actually contains a changeset (#18) with: 🦋 Error: Failed to find where HEAD diverged from "main". Does "main" exist and it's synced with remote? Root cause: actions/checkout@v4 with `fetch-depth: 0` fetches every commit but only sets up a remote-tracking ref (`origin/main`). The local `main` branch never gets created. `pnpm changeset status` reads `baseBranch: "main"` from `.changeset/config.json` and runs `git merge-base HEAD main`, which fails because `main` doesn't exist locally. Adding a small step that creates the local base ref from the remote- tracking one before any changeset commands run. Uses `${{ github.base_ref }}` so it works on any base branch (not just main). Also de-duplicates the `git fetch` previously inlined in the "Check for changeset files" step — the new step covers it. Latent for previous PRs because none had a changeset to validate. PR #18 is the first to surface it; this fix unblocks the entire release flow.
1 parent dc7afa5 commit eb48d1f

2 files changed

Lines changed: 37 additions & 3 deletions

File tree

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
"@kripa006/404-ui": patch
3+
---
4+
5+
Make the vanilla entry SSR-safe and refresh the package README.
6+
7+
**SSR fix.** Each vanilla theme used to declare `export class
8+
<Theme>404Element extends HTMLElement` at module top, which threw
9+
`HTMLElement is not defined` the moment the package was imported
10+
under Node — Next.js SSR, Nuxt SSG, Astro build, Remix server. The
11+
class now extends a `SafeHTMLElement` reference that resolves to the
12+
real `HTMLElement` in browsers and to a dummy class in Node. The class
13+
is still only ever instantiated by `customElements.define` inside the
14+
existing `typeof window !== "undefined"` guard, so behavior in the
15+
browser is unchanged.
16+
17+
**README refresh.** The npm-rendered README now shows the live
18+
4-template gallery (Space, Glitch, Ocean, Forest), per-framework
19+
code snippets, and the bundle-size badge. The previous publish
20+
stored an empty README in the version metadata; this version sets
21+
it correctly.

.github/workflows/pr-validation.yml

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -181,12 +181,25 @@ jobs:
181181
- name: Install dependencies
182182
run: pnpm install --frozen-lockfile
183183

184+
# `pnpm changeset status` (run further down) compares HEAD against
185+
# the local branch named in `.changeset/config.json` (`baseBranch:
186+
# "main"`). actions/checkout@v4 with fetch-depth: 0 fetches all
187+
# commits but only sets up a remote-tracking ref `origin/main` —
188+
# the local `main` branch doesn't exist, so changeset's
189+
# `getDivergedCommit` aborts with "Failed to find where HEAD
190+
# diverged from main". Create the local `main` ref so the status
191+
# command can find its base.
192+
- name: Ensure base branch is available locally
193+
run: |
194+
git fetch origin ${{ github.base_ref }}:${{ github.base_ref }} || true
195+
git branch --list ${{ github.base_ref }} || \
196+
git branch ${{ github.base_ref }} origin/${{ github.base_ref }}
197+
184198
- name: Check for changeset files
185199
id: check-changeset
186200
run: |
187-
# Check if any changeset files were added or modified in this PR
188-
# Compare against the base branch to find changed files
189-
git fetch origin ${{ github.base_ref }}
201+
# Check if any changeset files were added or modified in this PR.
202+
# Compare against the base branch to find changed files.
190203
CHANGED_FILES=$(git diff --name-only origin/${{ github.base_ref }}...HEAD)
191204
192205
# Check if any .md files in .changeset directory (excluding README.md specifically)

0 commit comments

Comments
 (0)