fix(demo): restore jsDelivr CDN link so demo works without local build - #64
Conversation
The previous local path (../dist/slashed.essential.css) requires 'npm run build' first, since dist/ is gitignored. Reverts the link tags introduced in 26658d5 back to the @main CDN URL so a fresh clone of the repo serves a working demo.html without setup. Co-authored-by: Jack Granatowski <contact@codeslash.net>
📝 WalkthroughWalkthroughThe PR updates ChangesDemo CSS CDN Migration
🎯 1 (Trivial) | ⏱️ ~2 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
docs/demo.html (1)
7-9: ⚡ Quick winRecommend pinning to a specific version tag instead of
@main.Using
@mainmeans the demo always loads the latest code from the main branch, which can break if there are structural changes, renames, or breaking changes merged to main. As you noted in the PR description, this could break ifdist/stops being published to main.For stability, consider pinning to a specific version tag (e.g.,
@v0.2.10or@latestrelease tag) instead of@main.Additionally, consider adding SRI (Subresource Integrity) attributes for CDN security best practice:
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/codeslash-dev/SLASHED@v0.2.10/dist/slashed.essential.css" integrity="sha384-..." crossorigin="anonymous">jsDelivr can generate SRI hashes automatically by appending
?integrityto the URL, or you can generate them using tools likeopenssl dgst -sha384 -binary <file> | openssl base64 -A.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@docs/demo.html` around lines 7 - 9, Update the two <link> tags that currently reference jsDelivr with `@main` so they pin to a specific release tag (e.g., replace `@main` with `@vX.Y.Z` or `@latest` release tag) and add Subresource Integrity and crossorigin attributes to each tag; locate the link elements referencing "https://cdn.jsdelivr.net/gh/codeslash-dev/SLASHED@main/dist/slashed.essential.css" and ".../optional/tokens.palette.css", change their version identifier, and include appropriate integrity="sha384-..." and crossorigin="anonymous" attributes (you can obtain SRI hashes by appending ?integrity to the jsDelivr URLs or generating them locally).
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@docs/demo.html`:
- Around line 7-9: Update the two <link> tags that currently reference jsDelivr
with `@main` so they pin to a specific release tag (e.g., replace `@main` with
`@vX.Y.Z` or `@latest` release tag) and add Subresource Integrity and crossorigin
attributes to each tag; locate the link elements referencing
"https://cdn.jsdelivr.net/gh/codeslash-dev/SLASHED@main/dist/slashed.essential.css"
and ".../optional/tokens.palette.css", change their version identifier, and
include appropriate integrity="sha384-..." and crossorigin="anonymous"
attributes (you can obtain SRI hashes by appending ?integrity to the jsDelivr
URLs or generating them locally).
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 6205bf61-8c65-4d64-a754-61283cec85b7
📒 Files selected for processing (1)
docs/demo.html
This pull request was created by @kiro-agent on behalf of @jackgranatowski 👻
Comment with /kiro fix to address specific feedback or /kiro all to address everything.
Learn about Kiro autonomous agent
Summary
<link>tags from local relative paths back to the jsDelivr@mainCDN URLs that were in use prior to commit26658d5.Why
Commit
26658d5("feat: update demo with local CSS paths...") changed the demo from CDN-loaded styles to../dist/slashed.essential.css. Sincedist/is gitignored, openingdocs/demo.htmlon a fresh clone (or after a clean) renders unstyled untilnpm run buildis run.Restoring the
@mainCDN URLs makes the demo work zero-setup again, matching the original behavior.Tested
<link>URLs and the surrounding comment changed.Note
Pinning to
@mainmeans the CDN serves whatever is currently on the main branch. Ifdist/ever stops being published to main, the demo will break the same way. A follow-up could pin to a specific version tag (e.g.@v0.2.10) for stability — happy to do that in a separate PR if desired.Summary by CodeRabbit