Skip to content

feat(docs): update docs ui and examples#159

Merged
jaysin586 merged 22 commits into
mainfrom
codex/docs-ui-ux-update
Jun 3, 2026
Merged

feat(docs): update docs ui and examples#159
jaysin586 merged 22 commits into
mainfrom
codex/docs-ui-ux-update

Conversation

@jaysin586

Copy link
Copy Markdown
Contributor

Summary

This PR updates the docs site to the upstream brutalist V2 design system and moves generated docs artifacts into the Vite build. It refreshes the homepage, docs pages, and examples so the site feels consistent with the newer Humanspeak docs while keeping Memory Cache-specific content, examples, and API data.

Changes

✨ New features

  • Adds a redesigned homepage hero, package stats row, live cache telemetry demo, LLM-ready docs section, and big install CTA.
  • Adds V2 example shells with code panels and generated demo code loaders.
  • Adds spring-driven visual polish to TTL/LRU meters and homepage install copy feedback.

🔧 Refactoring/improvements

  • Reworks docs and examples layouts around the updated header/footer and brutalist docs surfaces.
  • Moves example demos into manifest-backed demo folders and lazy-loads code samples.
  • Updates example pages for basic cache, cache statistics, LRU eviction, and TTL expiration.

🐛 Bug fixes

  • Fixes CSP/theme first-paint behavior by using hash CSP for inline bootstrap scripts.
  • Removes Font Awesome from app shell usage and uses local icon/components instead.
  • Ensures generated demo and sitemap artifacts are ignored instead of tracked.

📦 Build changes

  • Moves sitemap manifest generation into the Vite/docs-kit plugin path.
  • Updates docs-kit to 2026.6.9 for split demo virtual type generation.
  • Adds docs-kit demo manifest generation and svelte-motion optimization/manual chunks.

🧪 Testing

  • Ran docs checks through pre-commit hooks on every commit.
  • Verified homepage sections, example pages, copy interactions, CSP, and mobile overflow locally in browser passes.

Commits

  • 05da058 feat(docs): add upstream install footer
  • ca18c3a feat(docs): add homepage llm section
  • beedd67 feat(docs): match upstream why section
  • 123a250 fix(docs): use hash csp for inline scripts
  • a404d5f feat(docs): add homepage cache telemetry demo
  • b371663 fix(docs): allow nonce scripts in csp
  • 8107af2 build(docs): update docs-kit demo type generation
  • 274d9fb perf: use generated demo code loaders
  • 36a09f0 docs: add homepage package stats row
  • 0a1eb75 fix: improve docs first paint theme
  • 1ece9ec docs: update homepage hero
  • 9023db9 perf: lazy load example code samples
  • 234553e docs: add spring capacity meter to lru example
  • b6d9c9c docs: update ttl expiration example shell
  • 72f107a docs: update lru eviction example shell
  • b1782fb docs: update cache statistics example shell
  • 5ff9389 docs: update basic cache example shell
  • 1ce1611 docs: add code panels to examples
  • 3530dbe docs: update examples index to V2 layout
  • e5cae17 docs: update docs pages to V2 layout
  • d865b11 docs: use updated docs header and footer
  • be96386 docs: generate sitemap manifest in Vite

jaysin586 added 22 commits June 2, 2026 17:28
- Use docs-kit V2 layout, sidebar, slug strip, and TOC components
- Import upstream docs-kit brutalist and prose styles
- Add Lucide section icons for docs navigation
- Use the upstream docs-kit examples shell and BrutIndexV2 index
- Drive example cards from the sitemap manifest and page metadata
- Update the examples sitemap lastmod
- Generate demo manifests for example source snippets
- Move demo components into the upstream demos/Default.svelte shape
- Wire CodeReferenceV2 copy panels into individual example pages
- Ignore generated docs manifest files
- Restyle the basic cache demo with the V2 example chrome
- Add miss-state telemetry and focused side-rail notes
- Restyle the statistics demo with the V2 example chrome
- Keep the event log scroll-contained inside the demo panel
- Restyle the LRU demo with the V2 example chrome
- Keep eviction history scroll-contained inside the demo panel
- Restyle the TTL demo with the V2 example chrome
- Add a spring-driven svelte-motion TTL meter
- Keep expiring entries scroll-contained inside the demo panel
- Update docs-kit to the split demo manifest release
- Load example code panels from virtual demo modules
- Add local virtual module typing for lazy code samples
Bring the homepage masthead in line with the upstream brutalist hero
while keeping the existing feature and code sections in place.
Set the stored theme class before generated CSS reaches the page and
mirror upstream chunking for motion and mode-watcher client code.
Fetch live npm package stats through docs-kit and surface the
version, tarball size, runtime deps, and API facts in the homepage
masthead area.
@jaysin586 jaysin586 added the skip-publish This is something important, but we dont want to publish it label Jun 3, 2026
@jaysin586 jaysin586 self-assigned this Jun 3, 2026
@coderabbitai

coderabbitai Bot commented Jun 3, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Documentation site migrated to docs-kit v2 with component upgrades (Header/Footer/layouts), Vite-integrated sitemap/demo manifest generation, dark-mode theme initialization, modular interactive demo restructuring, and a redesigned landing page integrating a live MemoryCache telemetry demo.

Changes

Docs Kit V2 Migration and Landing Page Redesign

Layer / File(s) Summary
Build Configuration and Vite Plugin Wiring
docs/vite.config.ts, docs/package.json, .github/workflows/cloudflare-deploy.yml
Vite config imports new docs-kit plugins (sitemapManifestPlugin, demoManifestPlugin, svelteMotionOptimize) and configures build-time manifest generation; npm scripts remove standalone sitemap generation; workflow removes explicit pre-build sitemap step; docs-kit dependency bumped to 2026.6.9.
Theme Initialization and App Shell
docs/src/app.html, docs/src/app.css, docs/src/routes/+layout.svelte, docs/svelte.config.js
App shell injects inline theme-initialization script that reads mode-watcher preference and applies dark class/colorScheme; comprehensive new CSS variables (theme token, dark-mode override, Shiki visibility) and component styles (shiny-button, component-source-dialog with code highlighting); mode-watcher hook repositioned; CSP relaxed for inline scripts.
Component Library Migration to V2
docs/src/lib/components/general/Header.svelte, docs/src/lib/components/general/Footer.svelte, docs/src/lib/docsNav.ts, docs/src/routes/docs/+layout.svelte, docs/src/routes/examples/+layout.svelte
Header → HeaderV2, Footer → FooterV2, and layouts use TableOfContentsV2/FooterV2 with package version injection; examples layout switches to ExampleLayoutV2 with motion config; docs layout refactored with kit-provided heading extraction and JSON-LD injection; navigation icons added (Rocket, Play, Database, Code); old TableOfContents component removed.
Interactive Demo Components Restructuring
docs/src/lib/examples/basic-cache/demos/Default.svelte, docs/src/lib/examples/cache-statistics/demos/Default.svelte, docs/src/lib/examples/lru-eviction/demos/Default.svelte, docs/src/lib/examples/ttl-expiration/demos/Default.svelte
Old single-file demo components (BasicCache.svelte, CacheStatistics.svelte, LruEviction.svelte, TtlExpiration.svelte) replaced with modular demos; each new Default.svelte is self-contained with reactive cache logic, state management, UI, and styling (516–655 lines per demo).
Example Pages Migrated to V2 Components and Snippets
docs/src/routes/examples/basic-cache/+page.svelte, docs/src/routes/examples/cache-statistics/+page.svelte, docs/src/routes/examples/lru-eviction/+page.svelte, docs/src/routes/examples/ttl-expiration/+page.svelte
Pages updated to CodeReferenceV2/ExampleV2 components with Svelte snippets (defaultCode, cacheNotes/statisticsNotes/lruNotes/ttlNotes); SOURCE_URL constants added for demo source links; SEO expanded with Open Graph metadata; demo imports point to new modular demo paths.
Examples Index Page Dynamic Generation
docs/src/routes/examples/+page.ts, docs/src/routes/examples/+page.svelte
Examples index derives dynamic list from sitemap-manifest.json (filtering /examples/* and computing title/slug/description); EXAMPLES TypeScript constant added; page layout replaced with BrutIndexV2 component; SEO expanded with Open Graph fields.
Landing Page Server Integration and Brut Redesign
docs/src/routes/+page.server.ts, docs/src/routes/+page.ts, docs/src/routes/+page.svelte
+page.server.ts exports prerender=false and loads package stats via createPackageStatsLoad; +page.ts updated to SvelteKit PageLoad type; +page.svelte completely redesigned with Svelte runes, MemoryCache live telemetry demo (hit/miss/set/eviction tracking), package metadata derivation, clipboard copy helper, and comprehensive brut-theme CSS (hero, stats grid, demo panel, feature cards, AI section, footer).

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

  • humanspeak/memory-cache#106: Directly related as it refactors the sitemap manifest generation that was previously a standalone script by moving it into the Vite build pipeline via sitemapManifestPlugin.
  • humanspeak/memory-cache#38: Both PRs touch docs/src/lib/sitemap-manifest.json output; this PR changes how it is generated while PR #38 formats and adds robots.txt integration.

Suggested labels

documentation, ui-components, build-system

Poem

🚀 From scripts to plugins, the build takes flight,
V2 components gleaming in crisp dark-mode light,
Demo caches dance with telemetry pride,
A landing page redesign, brut and bona fide.
Sitemap flows swiftly through Vite's pipeline now,
The docs sing their song—take a bow! 🎉

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title 'feat(docs): update docs ui and examples' directly reflects the main changes: comprehensive documentation UI redesign and example updates to the V2 design system.
Description check ✅ Passed The description thoroughly documents the PR scope including new features, refactoring, bug fixes, build changes, and testing, all aligned with the actual changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/docs-ui-ux-update

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (4)
docs/src/routes/examples/+page.ts (1)

3-6: ⚡ Quick win

Use interface for the ExampleEntry object shape.

♻️ Proposed change
-type ExampleEntry = {
-    title: string
-    description: string
-}
+interface ExampleEntry {
+    title: string
+    description: string
+}

As per coding guidelines: "Prefer interface for defining object shapes in TypeScript".

🤖 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/src/routes/examples/`+page.ts around lines 3 - 6, The type alias
ExampleEntry should be converted to an interface to follow the project's
TypeScript guideline; replace the type declaration named ExampleEntry with an
interface declaration (interface ExampleEntry { title: string; description:
string }) and update any usages if needed to ensure they still accept the same
shape.
docs/src/routes/examples/+page.svelte (1)

6-9: ⚡ Quick win

Use interface for the ExampleData object shape.

♻️ Proposed change
-    type ExampleData = {
-        title: string
-        description: string
-    }
+    interface ExampleData {
+        title: string
+        description: string
+    }

Note this duplicates ExampleEntry in +page.ts — consider sharing a single type if convenient. As per coding guidelines: "Prefer interface for defining object shapes in TypeScript".

🤖 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/src/routes/examples/`+page.svelte around lines 6 - 9, Replace the type
alias ExampleData with an interface declaration (i.e., declare interface
ExampleData { title: string; description: string }) to follow the guideline
preferring interfaces for object shapes; also consider consolidating or
re-exporting the shape used by ExampleEntry in +page.ts so both components share
the same interface rather than duplicating the definition.
docs/src/routes/+page.svelte (2)

77-81: ⚡ Quick win

Use const for these derived values (ESLint prefer-const errors).

$derived works with const in Svelte 5; none of these are reassigned, so the lint errors here will fail the build.

♻️ Proposed fix
-    let demoRequests = $derived(demoHits + demoMisses)
-    let demoHitRate = $derived(demoRequests > 0 ? Math.round((demoHits / demoRequests) * 100) : 100)
-    let demoLruKey = $derived(demoEntries[0]?.key ?? 'none')
-    let demoMruKey = $derived(demoEntries.at(-1)?.key ?? 'none')
-    let demoStatus = $derived(demoLastOp === 'miss' ? 'miss' : 'ready')
+    const demoRequests = $derived(demoHits + demoMisses)
+    const demoHitRate = $derived(demoRequests > 0 ? Math.round((demoHits / demoRequests) * 100) : 100)
+    const demoLruKey = $derived(demoEntries[0]?.key ?? 'none')
+    const demoMruKey = $derived(demoEntries.at(-1)?.key ?? 'none')
+    const demoStatus = $derived(demoLastOp === 'miss' ? 'miss' : 'ready')
🤖 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/src/routes/`+page.svelte around lines 77 - 81, Change the four derived
bindings from let to const since they are never reassigned; update demoRequests,
demoHitRate, demoLruKey, demoMruKey, and demoStatus to be declared with const
and continue using $derived (Svelte 5 supports const for derived stores) so
ESLint prefer-const errors are resolved.

41-45: ⚡ Quick win

Prefer interface for the DemoEntry object shape.

StatItem already uses interface; align DemoEntry for consistency.

♻️ Proposed fix
-    type DemoEntry = {
-        key: string
-        value: string
-        rank: number
-    }
+    interface DemoEntry {
+        key: string
+        value: string
+        rank: number
+    }
As per coding guidelines: "Prefer interface for defining object shapes in TypeScript".
🤖 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/src/routes/`+page.svelte around lines 41 - 45, Replace the object-style
type alias for DemoEntry with an interface to match StatItem: change the
declaration "type DemoEntry = { key: string; value: string; rank: number }" to
"interface DemoEntry { key: string; value: string; rank: number }" (keeping the
same property names and types) so the shape is defined consistently across the
module.
🤖 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.

Inline comments:
In `@docs/src/routes/docs/`+layout.svelte:
- Around line 54-72: The inline JSON-LD built by the template uses
JSON.stringify(...) inside the returned script tag and may contain "</script>"
in title/description which would terminate the script; fix by post-processing
the JSON string before interpolation — capture the JSON.stringify(...) output
and replace occurrences of "</script>" (or all "<" characters) with their
escaped form (e.g., "\u003C/script>" or "\u003C") so the serialized payload
cannot break out of the <script> tag; update the template return in
+layout.svelte to use the escaped JSON string instead of the raw JSON.stringify
result.

In `@docs/svelte.config.js`:
- Around line 45-49: The CSP in the svelte config sets mode: 'hash' but still
includes 'unsafe-inline' in the directives.script-src array; remove
'unsafe-inline' from the 'script-src' entry in the config (inside the directives
object) so inline scripts are only allowed via hashes/nonces, and ensure any
required script hashes or nonces are added to the CSP instead of using
'unsafe-inline'.

---

Nitpick comments:
In `@docs/src/routes/`+page.svelte:
- Around line 77-81: Change the four derived bindings from let to const since
they are never reassigned; update demoRequests, demoHitRate, demoLruKey,
demoMruKey, and demoStatus to be declared with const and continue using $derived
(Svelte 5 supports const for derived stores) so ESLint prefer-const errors are
resolved.
- Around line 41-45: Replace the object-style type alias for DemoEntry with an
interface to match StatItem: change the declaration "type DemoEntry = { key:
string; value: string; rank: number }" to "interface DemoEntry { key: string;
value: string; rank: number }" (keeping the same property names and types) so
the shape is defined consistently across the module.

In `@docs/src/routes/examples/`+page.svelte:
- Around line 6-9: Replace the type alias ExampleData with an interface
declaration (i.e., declare interface ExampleData { title: string; description:
string }) to follow the guideline preferring interfaces for object shapes; also
consider consolidating or re-exporting the shape used by ExampleEntry in
+page.ts so both components share the same interface rather than duplicating the
definition.

In `@docs/src/routes/examples/`+page.ts:
- Around line 3-6: The type alias ExampleEntry should be converted to an
interface to follow the project's TypeScript guideline; replace the type
declaration named ExampleEntry with an interface declaration (interface
ExampleEntry { title: string; description: string }) and update any usages if
needed to ensure they still accept the same shape.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: ecc2e239-f9b0-4e33-bf96-103a07862c5b

📥 Commits

Reviewing files that changed from the base of the PR and between fe49ee0 and 05da058.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml, !pnpm-lock.yaml
📒 Files selected for processing (34)
  • .github/workflows/cloudflare-deploy.yml
  • .gitignore
  • docs/.gitignore
  • docs/package.json
  • docs/scripts/generate-sitemap-manifest.mjs
  • docs/src/app.css
  • docs/src/app.html
  • docs/src/lib/components/general/Footer.svelte
  • docs/src/lib/components/general/Header.svelte
  • docs/src/lib/docsNav.ts
  • docs/src/lib/examples/BasicCache.svelte
  • docs/src/lib/examples/CacheStatistics.svelte
  • docs/src/lib/examples/LruEviction.svelte
  • docs/src/lib/examples/TtlExpiration.svelte
  • docs/src/lib/examples/basic-cache/demos/Default.svelte
  • docs/src/lib/examples/cache-statistics/demos/Default.svelte
  • docs/src/lib/examples/lru-eviction/demos/Default.svelte
  • docs/src/lib/examples/ttl-expiration/demos/Default.svelte
  • docs/src/lib/sitemap-manifest.json
  • docs/src/routes/+layout.svelte
  • docs/src/routes/+page.server.ts
  • docs/src/routes/+page.svelte
  • docs/src/routes/+page.ts
  • docs/src/routes/docs/+layout.svelte
  • docs/src/routes/docs/TableOfContents.svelte
  • docs/src/routes/examples/+layout.svelte
  • docs/src/routes/examples/+page.svelte
  • docs/src/routes/examples/+page.ts
  • docs/src/routes/examples/basic-cache/+page.svelte
  • docs/src/routes/examples/cache-statistics/+page.svelte
  • docs/src/routes/examples/lru-eviction/+page.svelte
  • docs/src/routes/examples/ttl-expiration/+page.svelte
  • docs/svelte.config.js
  • docs/vite.config.ts
💤 Files with no reviewable changes (7)
  • docs/src/lib/examples/LruEviction.svelte
  • docs/src/lib/sitemap-manifest.json
  • docs/src/lib/examples/TtlExpiration.svelte
  • docs/src/routes/docs/TableOfContents.svelte
  • docs/src/lib/examples/CacheStatistics.svelte
  • docs/src/lib/examples/BasicCache.svelte
  • docs/scripts/generate-sitemap-manifest.mjs

Comment on lines +54 to +72
return `<${'script'} type="application/ld+json">${JSON.stringify({
'@context': 'https://schema.org',
'@type': 'TechArticle',
headline: title,
description: description || title,
url: `${BASE_URL}${pathname}`,
dateModified: lastmod,
author: {
'@type': 'Organization',
name: 'Humanspeak',
url: 'https://humanspeak.com'
},
publisher: {
'@type': 'Organization',
name: 'Humanspeak',
url: 'https://humanspeak.com'
},
proficiencyLevel: 'Beginner'
})}</${'script'}>`

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Escape < in the JSON-LD payload to prevent early </script> termination.

JSON.stringify won't escape </script> inside title/description, so any such sequence would close the inline script tag and inject markup. The <${'script'}> split only protects the literal tags, not the serialized content.

🛡️ Proposed fix
-    })}</${'script'}>`
+    }).replace(/</g, '\\u003c')}</${'script'}>`
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
return `<${'script'} type="application/ld+json">${JSON.stringify({
'@context': 'https://schema.org',
'@type': 'TechArticle',
headline: title,
description: description || title,
url: `${BASE_URL}${pathname}`,
dateModified: lastmod,
author: {
'@type': 'Organization',
name: 'Humanspeak',
url: 'https://humanspeak.com'
},
publisher: {
'@type': 'Organization',
name: 'Humanspeak',
url: 'https://humanspeak.com'
},
proficiencyLevel: 'Beginner'
})}</${'script'}>`
return `<${'script'} type="application/ld+json">${JSON.stringify({
'`@context`': 'https://schema.org',
'`@type`': 'TechArticle',
headline: title,
description: description || title,
url: `${BASE_URL}${pathname}`,
dateModified: lastmod,
author: {
'`@type`': 'Organization',
name: 'Humanspeak',
url: 'https://humanspeak.com'
},
publisher: {
'`@type`': 'Organization',
name: 'Humanspeak',
url: 'https://humanspeak.com'
},
proficiencyLevel: 'Beginner'
}).replace(/</g, '\\u003c')}</${'script'}>`
🤖 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/src/routes/docs/`+layout.svelte around lines 54 - 72, The inline JSON-LD
built by the template uses JSON.stringify(...) inside the returned script tag
and may contain "</script>" in title/description which would terminate the
script; fix by post-processing the JSON string before interpolation — capture
the JSON.stringify(...) output and replace occurrences of "</script>" (or all
"<" characters) with their escaped form (e.g., "\u003C/script>" or "\u003C") so
the serialized payload cannot break out of the <script> tag; update the template
return in +layout.svelte to use the escaped JSON string instead of the raw
JSON.stringify result.

Comment thread docs/svelte.config.js
Comment on lines +45 to 49
mode: 'hash',
directives: {
'default-src': ['self'],
'script-src': ['self', 'https://analytics.ahrefs.com'],
'script-src': ['self', 'https://analytics.ahrefs.com', 'unsafe-inline'],
'style-src': ['self', 'unsafe-inline'],

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Remove 'unsafe-inline' from script-src in hash CSP mode.

Line 48 weakens CSP significantly; with hash mode, inline scripts should be allowed via hashes/nonces instead of a blanket inline allowance.

Suggested fix
         csp: {
             mode: 'hash',
             directives: {
                 'default-src': ['self'],
-                'script-src': ['self', 'https://analytics.ahrefs.com', 'unsafe-inline'],
+                'script-src': ['self', 'https://analytics.ahrefs.com'],
                 'style-src': ['self', 'unsafe-inline'],
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
mode: 'hash',
directives: {
'default-src': ['self'],
'script-src': ['self', 'https://analytics.ahrefs.com'],
'script-src': ['self', 'https://analytics.ahrefs.com', 'unsafe-inline'],
'style-src': ['self', 'unsafe-inline'],
mode: 'hash',
directives: {
'default-src': ['self'],
'script-src': ['self', 'https://analytics.ahrefs.com'],
'style-src': ['self', 'unsafe-inline'],
🤖 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/svelte.config.js` around lines 45 - 49, The CSP in the svelte config
sets mode: 'hash' but still includes 'unsafe-inline' in the
directives.script-src array; remove 'unsafe-inline' from the 'script-src' entry
in the config (inside the directives object) so inline scripts are only allowed
via hashes/nonces, and ensure any required script hashes or nonces are added to
the CSP instead of using 'unsafe-inline'.

@jaysin586 jaysin586 merged commit f68eadb into main Jun 3, 2026
7 checks passed
@jaysin586

Copy link
Copy Markdown
Contributor Author

⏭️ NPM publishing was skipped due to the skip-publish label.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip-publish This is something important, but we dont want to publish it

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant