@powerhousedao/builder-tools 6.2.3-dev.78 → 6.2.3-dev.79

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.
@@ -36,6 +36,7 @@ import {
36
36
  // the worker bundle. The IDB schema constants are shared with the SPA writer
37
37
  // (apps/connect/src/utils/pwa-idb.ts) so the two can't desync.
38
38
  import {
39
+ isAppShellNavigation,
39
40
  mergeManifest,
40
41
  type PHConnectPwaUrlPattern,
41
42
  PWA_IDB_KEY,
@@ -48,6 +49,7 @@ import {
48
49
  EMBEDDED_BASE_MANIFEST,
49
50
  EXTRA_RUNTIME_CACHING,
50
51
  NAVIGATE_FALLBACK_DENYLIST_EXTRA,
52
+ STATIC_FILES,
51
53
  } from "virtual:ph-sw-config";
52
54
 
53
55
  declare const self: ServiceWorkerGlobalScope &
@@ -335,10 +337,14 @@ const stripQueryCacheKey: WorkboxPlugin = {
335
337
  return request.url;
336
338
  },
337
339
  };
340
+ // A navigation to a file (icon.svg, a public/ file) is not the app's: it falls
341
+ // through to the precache or the network, as a fetch of it would.
342
+ const scopePath = new URL(self.registration.scope).pathname;
338
343
  registerRoute(
339
344
  new Route(
340
345
  ({ request, url }) =>
341
346
  request.mode === "navigate" &&
347
+ isAppShellNavigation(url.pathname, scopePath, STATIC_FILES) &&
342
348
  !denylist.some((re) => re.test(url.pathname + url.search)),
343
349
  new NetworkFirst({
344
350
  cacheName: "ph-shell",
@@ -19,4 +19,7 @@ declare module "virtual:ph-sw-config" {
19
19
 
20
20
  /** Extra SPA navigate-fallback denylist patterns. */
21
21
  export const NAVIGATE_FALLBACK_DENYLIST_EXTRA: PHConnectPwaUrlPattern[];
22
+
23
+ /** The project's public/ files, by path: a navigation to one is not the shell's. */
24
+ export const STATIC_FILES: string[];
22
25
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@powerhousedao/builder-tools",
3
- "version": "6.2.3-dev.78",
3
+ "version": "6.2.3-dev.79",
4
4
  "type": "module",
5
5
  "license": "AGPL-3.0-only",
6
6
  "publishConfig": {
@@ -23,18 +23,17 @@
23
23
  },
24
24
  "sideEffects": false,
25
25
  "dependencies": {
26
- "@powerhousedao/config": "6.2.3-dev.78",
27
- "@powerhousedao/shared": "6.2.3-dev.78",
26
+ "@powerhousedao/config": "6.2.3-dev.79",
27
+ "@powerhousedao/shared": "6.2.3-dev.79",
28
28
  "@tailwindcss/vite": "4.2.2",
29
29
  "@tanstack/router-generator": "1.167.40",
30
30
  "@tanstack/router-plugin": "1.168.42",
31
31
  "@tanstack/virtual-file-routes": "1.162.0",
32
32
  "@vitejs/plugin-react": "6.1.1",
33
- "document-model": "6.2.3-dev.78",
33
+ "document-model": "6.2.3-dev.79",
34
34
  "es-module-lexer": "^2.0.0",
35
35
  "magic-string": "^0.30.21",
36
36
  "vite": "8.3.4",
37
- "vite-plugin-html": "3.2.2",
38
37
  "vite-plugin-pwa": "1.3.0",
39
38
  "workbox-cacheable-response": "7.4.1",
40
39
  "workbox-core": "7.4.1",