@powerhousedao/builder-tools 6.2.3-dev.7 → 6.2.3-dev.70

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.
@@ -174,28 +174,12 @@ registerRoute(
174
174
  // producer at that URL. The __WB_MANIFEST property below is the injectManifest
175
175
  // injection point — workbox-build replaces it with the precache list at build
176
176
  // time (the token is written once, on the code line, never in prose).
177
- precacheAndRoute(self.__WB_MANIFEST);
177
+ // `v` versions the reactor worker URLs; the precached copy is that same build's.
178
+ precacheAndRoute(self.__WB_MANIFEST, {
179
+ ignoreURLParametersMatching: [/^utm_/, /^fbclid$/, /^v$/],
180
+ });
178
181
 
179
- // ── runtime caching (ported 1:1 from the old BASE_WORKBOX, same order) ───────
180
- // Inter font stays on Google's CDN; cache it after the first online load.
181
- registerRoute(
182
- ({ url }) => url.origin === "https://fonts.googleapis.com",
183
- new StaleWhileRevalidate({ cacheName: "google-fonts-stylesheets" }),
184
- );
185
- registerRoute(
186
- ({ url }) => url.origin === "https://fonts.gstatic.com",
187
- new CacheFirst({
188
- cacheName: "google-fonts-webfonts",
189
- plugins: [
190
- new ExpirationPlugin({
191
- maxEntries: 30,
192
- maxAgeSeconds: 60 * 60 * 24 * 365,
193
- }),
194
- // statuses [0, 200]: 0 permits opaque cross-origin font responses.
195
- new CacheableResponsePlugin({ statuses: [0, 200] }),
196
- ],
197
- }),
198
- );
182
+ // ── runtime caching ──────────────────────────────────────────────────────────
199
183
  // Document-model editors/packages loaded at runtime from the registry CDN. The
200
184
  // registry ORIGIN is a runtime value, so match the stable "/-/cdn/" path. Two
201
185
  // rules (order matters): unversioned ENTRY points first (SWR — a newer editor
@@ -203,6 +187,14 @@ registerRoute(
203
187
  // for the content-hashed (immutable) assets. statuses [0, 200] on both — the
204
188
  // editor JS is a CORS import (200) but its stylesheet/assets are no-cors
205
189
  // (opaque/0); [200] alone silently dropped those and broke styles offline.
190
+ // A no-cors request (a stylesheet's @import) caches an opaque copy; a CORS one
191
+ // (a module import, fetch) fails on it, so it goes to the network instead.
192
+ const noOpaqueForCors: WorkboxPlugin = {
193
+ cachedResponseWillBeUsed: async ({ request, cachedResponse }) =>
194
+ request.mode === "cors" && cachedResponse?.type === "opaque"
195
+ ? null
196
+ : (cachedResponse ?? null),
197
+ };
206
198
  registerRoute(
207
199
  ({ url }) =>
208
200
  url.pathname.includes("/-/cdn/") &&
@@ -212,8 +204,12 @@ registerRoute(
212
204
  new StaleWhileRevalidate({
213
205
  cacheName: "ph-package-cdn-entry",
214
206
  plugins: [
215
- new ExpirationPlugin({ maxEntries: 60, maxAgeSeconds: 60 * 60 * 24 * 30 }),
207
+ new ExpirationPlugin({
208
+ maxEntries: 60,
209
+ maxAgeSeconds: 60 * 60 * 24 * 30,
210
+ }),
216
211
  new CacheableResponsePlugin({ statuses: [0, 200] }),
212
+ noOpaqueForCors,
217
213
  ],
218
214
  }),
219
215
  );
@@ -227,6 +223,7 @@ registerRoute(
227
223
  maxAgeSeconds: 60 * 60 * 24 * 30,
228
224
  }),
229
225
  new CacheableResponsePlugin({ statuses: [0, 200] }),
226
+ noOpaqueForCors,
230
227
  ],
231
228
  }),
232
229
  );
@@ -235,7 +232,10 @@ registerRoute(
235
232
  // boot until the browser's own fetch timeout.
236
233
  registerRoute(
237
234
  ({ url }) => url.pathname.endsWith("/powerhouse.config.json"),
238
- new NetworkFirst({ cacheName: "ph-runtime-config", networkTimeoutSeconds: 5 }),
235
+ new NetworkFirst({
236
+ cacheName: "ph-runtime-config",
237
+ networkTimeoutSeconds: 5,
238
+ }),
239
239
  );
240
240
 
241
241
  // ── extra runtime caching ────────────────────────────────────────────────────
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@powerhousedao/builder-tools",
3
- "version": "6.2.3-dev.7",
3
+ "version": "6.2.3-dev.70",
4
4
  "type": "module",
5
5
  "license": "AGPL-3.0-only",
6
6
  "publishConfig": {
@@ -23,13 +23,16 @@
23
23
  },
24
24
  "sideEffects": false,
25
25
  "dependencies": {
26
- "@powerhousedao/config": "6.2.3-dev.7",
27
- "@powerhousedao/shared": "6.2.3-dev.7",
26
+ "@powerhousedao/config": "6.2.3-dev.70",
27
+ "@powerhousedao/shared": "6.2.3-dev.70",
28
28
  "@tailwindcss/vite": "4.2.2",
29
- "@vitejs/plugin-react": "6.0.1",
30
- "document-model": "6.2.3-dev.7",
29
+ "@tanstack/router-generator": "1.167.40",
30
+ "@tanstack/router-plugin": "1.168.42",
31
+ "@tanstack/virtual-file-routes": "1.162.0",
32
+ "@vitejs/plugin-react": "6.1.1",
33
+ "document-model": "6.2.3-dev.70",
31
34
  "magic-string": "^0.30.21",
32
- "vite": "8.0.10",
35
+ "vite": "8.3.4",
33
36
  "vite-plugin-html": "3.2.2",
34
37
  "vite-plugin-pwa": "1.3.0",
35
38
  "workbox-cacheable-response": "7.4.1",
@@ -41,11 +44,11 @@
41
44
  },
42
45
  "devDependencies": {
43
46
  "@sentry/vite-plugin": "^4.3.0",
44
- "tsdown": "0.21.1",
45
- "tsx": "4.21.0",
47
+ "tsdown": "0.23.0",
48
+ "tsx": "4.23.13",
46
49
  "vite-plugin-externalize-dependencies": "^1.0.1",
47
- "vitest": "4.1.1",
48
- "zod": "4.3.6"
50
+ "vitest": "5.0.3",
51
+ "zod": "^4.5.4"
49
52
  },
50
53
  "peerDependencies": {
51
54
  "@sentry/vite-plugin": "^4.3.0",
@@ -75,7 +78,7 @@
75
78
  "homepage": "https://academy.vetra.io",
76
79
  "scripts": {
77
80
  "tsc": "tsc",
78
- "lint": "eslint",
81
+ "lint": "cd ../.. && oxlint packages/builder-tools",
79
82
  "build": "tsdown",
80
83
  "test": "vitest --run"
81
84
  }