@jk2908/solas 0.16.0 → 0.16.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.16.1
4
+
5
+ ### Fixes
6
+
7
+ - The build warns when `script-src` uses `'strict-dynamic'` and the build contains full prerendered routes. Their hashed bootstrap cannot load its dynamic import under `'strict-dynamic'`, so those routes need `'self'`, dynamic rendering, or PPR.
8
+
3
9
  ## 0.16.0
4
10
 
5
11
  ### Breaking
@@ -129,6 +129,14 @@ export async function postbuild(cwd = process.cwd(), options = {}) {
129
129
  await Promise.all(pendingWrites);
130
130
  }
131
131
  if (csp) {
132
+ const scriptSources = ['script-src-elem', 'script-src', 'default-src']
133
+ .map(name => Object.entries(csp.directives).find(([key]) => key.toLowerCase() === name)?.[1])
134
+ .find(Boolean);
135
+ const hasStrictDynamic = scriptSources?.some(value => value.trim().toLowerCase().replace(/^'|'$/g, '') === 'strict-dynamic');
136
+ const hasFullPrerender = Object.values(artfifactManifest).some(artifact => artifact.mode === 'full');
137
+ if (hasFullPrerender && hasStrictDynamic) {
138
+ logger.warn('[csp]', `'strict-dynamic' is set, but this build has full prerendered routes. Full pages use hashed bootstrap scripts, which cannot load their dynamic imports under 'strict-dynamic'. Use 'self' for those routes or make them dynamic or PPR.`);
139
+ }
132
140
  const styleHashes = [
133
141
  ...new Set(Object.values(artfifactManifest).flatMap(artifact => artifact.csp?.style ?? [])),
134
142
  ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jk2908/solas",
3
- "version": "0.16.0",
3
+ "version": "0.16.1",
4
4
  "description": "A Vite + React meta-framework exploring streaming, Server Components, and partial prerendering. Designed for simplicity and lightness",
5
5
  "keywords": [
6
6
  "framework",