fix(0.2.1): bundle dist CSS + JSON-attribute browser compat#27
Merged
Conversation
Three regressions shipped in 0.2.0 fixed in this patch: 1. dist/theme.min.css was not actually a bundle — postcss preserved the @import statements verbatim, so CDN consumers loading /corrupted-theme/@0.2.0/dist/theme.min.css got an empty stylesheet (all @imports 404'd against an R2 bucket that ships no sibling partials). Symptom: .card and every other foundational class lost its glass styling on cdn.whykusanagi.xyz / cdn.nikkers.cc. Fix: add postcss-import to the pipeline. Bundle grew from 3.9 kB (broken) to 79.5 kB (working). 2. toast.css and seamless-background.css were only reachable via deep-import endpoints; the main theme.css never @imported them. Fix: add both @imports to theme.css. 3. Five JS modules used `import x from '../data/foo.json' with { type: 'json' }`, which only parses in Chromium 123+. Safari and Firefox raised SyntaxError before any module code ran — silent breakage for CDN consumers loading the modules as <script type="module">. Fix: add scripts/inline-data.js codegen that emits src/data/*.data.js sibling ES modules from canonical JSON; rewire the 5 modules to import the .data.js files. Wired via prebuild/pretest/prepublishOnly so codegen always runs before publish. Canonical JSON source unchanged — cross-language consumers (Go CLI etc.) keep reading the JSON files as-is. All 166 tests pass. Local smoke test confirmed visual + browser-side. Version bumped 0.2.0 → 0.2.1 across the VERSION_REFERENCES.md checklist. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
corrupted-theme | ad5b2d0 | Commit Preview URL Branch Preview URL |
May 24 2026, 09:25 PM |
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
Patch release fixing three regressions shipped in 0.2.0. CDN consumers (
cdn.whykusanagi.xyz/cdn.nikkers.cc) are already fixed via @latest — this PR brings git + npm into alignment.dist/theme.min.csswas not a bundle. postcss preserved the seven@importstatements verbatim; the file is shipped to R2 with no sibling partials, so every@import './variables.css'etc. 404'd. Net effect:.card,.btn,.glass-container*, every component class missing from CDN consumers. Fix: addpostcss-importto the pipeline. Bundle: 3.9 kB → 79.5 kB.toast.cssandseamless-background.csswere orphans. Only reachable via deep-import endpoints; maintheme.cssnever@imported them. Fix: add both@imports.import x from '../data/foo.json' with { type: 'json' }— only parses in Chromium 123+; raisedSyntaxErrorin the other browsers before any code ran. Fix:scripts/inline-data.jscodegen emitssrc/data/*.data.jsES modules from canonical JSON; the 5 modules import the generated siblings instead. Wired viaprebuild/pretest/prepublishOnly. Canonical JSON unchanged — cross-language consumers keep reading the JSON files as-is.Verification done
dist/smoke-test.htmlagainstnpm run dev:static) — all CSS classes render with glass styling, all 5 JS modules import without errors, both visually and in browsercontent-length: 79569,.cardglass styling present, zero stray@importsFiles changed (high-signal)
postcss.config.js— addedpostcss-importpluginsrc/css/theme.css—@import './toast.css',@import './seamless-background.css'scripts/inline-data.js(new) — JSON → ES module codegensrc/data/{charsets,colors,phrases}.data.js(new, generated) — committed artifacts, header marks them auto-generatedwith { type: 'json' }→from '../data/<name>.data.js'package.json—postcss-import@^16.1.1,prebuild/pretest/prepublishOnlyhooksCHANGELOG.md—[0.2.1] - 2026-05-24entryNot in this PR
npm publish --access public)dist/topackage.json#files(out of scope; raised separately)Test plan
🤖 Generated with Claude Code