@powerhousedao/builder-tools 6.2.3-dev.89 → 6.2.3-dev.90

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/dist/index.d.mts CHANGED
@@ -1,8 +1,10 @@
1
1
  import { Alias, CommonServerOptions, ErrorPayload, HtmlTagDescriptor, InlineConfig, Plugin, PluginOption } from "vite";
2
+ import { AppShell, AppShellVariant, AppShells, ShellPlugins } from "@powerhousedao/shared/connect/app-shell";
2
3
  import { GeneratorPlugin } from "@tanstack/router-generator";
3
4
  import { DYNAMIC_BASE_PLACEHOLDER } from "@powerhousedao/shared/connect";
4
5
  import { PHConnectBranding, PHConnectLoader, PHConnectRuntimeConfig, PowerhouseConfig } from "@powerhousedao/shared/clis";
5
6
  import { PowerhouseConfig as PowerhouseConfig$1, PowerhousePackage } from "@powerhousedao/config";
7
+ export * from "@powerhousedao/shared/connect/app-shell";
6
8
  //#region connect-utils/constants.d.ts
7
9
  export declare const EXTERNAL_PACKAGES_IMPORT = "PH:EXTERNAL_PACKAGES";
8
10
  export declare const IMPORT_SCRIPT_FILE = "external-packages.js";
@@ -23,56 +25,12 @@ type ProjectLoader = ProjectAsset & {
23
25
  };
24
26
  //#endregion
25
27
  //#region connect-utils/vite-plugins/app-shell.d.ts
26
- /** On the prerendered shell's elements; marks an index.html that has it. */
27
- export declare const APP_SHELL_MARKER = "data-ph-shell";
28
- export type AppShell = {
29
- /** `#root`'s markup. */
30
- body: string;
31
- /** Critical CSS and the pre-paint guard, for `<head>`. */
32
- head: string;
33
- };
34
- /** `generic`: Connect's chrome. `core`: core's views, for a composition without the generic plugin. */
35
- export type AppShellVariant = "generic" | "core";
36
- export type AppShells = Partial<Record<AppShellVariant, AppShell>>;
37
- /** Each plugin specifier Connect ships a shell for, to the variant it picks. */
38
- export type ShellPlugins = Record<string, AppShellVariant>;
39
- /** In Connect's dist, and copied to a project's: the plugins that pick a shell. */
40
- export declare const SHELL_PLUGINS_FILE = "shell-plugins.json";
41
- /** In a project's dist: every variant, for a server that swaps the shell to the served composition. */
42
- export declare const APP_SHELLS_FILE = "app-shells.json";
43
- /** The shell of the composition's first plugin that has one, else core's; no composition is classic.
44
- * Without `plugins` (an older Connect): core for a composition, generic for classic. */
45
- export declare function appShellVariant(composition: readonly {
46
- module: string;
47
- }[] | null | undefined, plugins: ShellPlugins | undefined): AppShellVariant;
48
- /** The plugins' shell manifest in `dir`, if there is a valid one. */
49
- export declare function readShellPluginsIn(dir: string): ShellPlugins | undefined;
50
28
  /** The shell manifest of the installed Connect, if it ships one. */
51
29
  export declare function readShellPlugins(projectRoot: string): ShellPlugins | undefined;
52
30
  /** The shell Connect's build prerendered, if the installed Connect ships one. */
53
31
  export declare function readAppShell(projectRoot: string, variant?: AppShellVariant): AppShell | undefined;
54
32
  /** Every variant the installed Connect ships. */
55
33
  export declare function readAppShells(projectRoot: string): AppShells;
56
- /** On the boot-recovery script; its sessionStorage key guards against reload loops. */
57
- export declare const BOOT_RECOVER_MARKER = "data-ph-boot-recover";
58
- export declare const BOOT_RECOVER_KEY = "ph:sw-recover";
59
- export declare const BOOT_RECOVER_SCRIPT: string;
60
- /** Prefixes the shell's root-relative links with the deploy base. */
61
- export declare function rebaseShellLinks(body: string, base: string): string;
62
- /** The app's title without `connect.branding.appName`; core's `appTitle` fallback. */
63
- export declare const DEFAULT_APP_NAME = "Connect";
64
- /** Fills the shell's app name as the app resolves it: the branding name, else the default. */
65
- export declare function withShellAppName(html: string, appName: string | undefined): string;
66
- /** Inlines `shell` into an empty `#root`, adds its critical CSS and, unless
67
- * `deferStyles` is false, defers the stylesheets; React replaces the markup when the app renders. */
68
- export declare function injectAppShell(html: string, shell: AppShell, base?: string, { deferStyles, appName }?: {
69
- deferStyles?: boolean;
70
- appName?: string;
71
- }): string;
72
- /** The variant an index.html carries, from its shell's marker value. */
73
- export declare function appShellVariantOf(html: string): AppShellVariant | undefined;
74
- /** Replaces the shell an index.html carries with `shell`, titled `appName`; a page without one is unchanged. */
75
- export declare function swapAppShell(html: string, shell: AppShell, base?: string, appName?: string): string;
76
34
  export type ConnectAppShellOptions = {
77
35
  /** The composition the app boots with; picks the variant. */
78
36
  composition?: readonly {
@@ -854,78 +812,10 @@ export declare const runtimeConfigSchema: {
854
812
  //#region connect-utils/vite-config.d.ts
855
813
  export declare function getConnectHtmlTags(options?: {
856
814
  registryUrl?: string | null;
815
+ /** The project's own name, from `connect.branding.appName`. */
816
+ appName?: string;
857
817
  injectTo?: HtmlTagDescriptor["injectTo"];
858
- }): [{
859
- readonly tag: "meta";
860
- readonly attrs: {
861
- readonly "http-equiv": "Content-Security-Policy";
862
- readonly content: `script-src 'self' 'unsafe-inline' 'unsafe-eval'${string}; worker-src 'self' blob:; object-src 'none'; base-uri 'self';`;
863
- };
864
- readonly injectTo: "body" | "body-prepend" | "head" | "head-prepend";
865
- }, {
866
- readonly tag: "meta";
867
- readonly attrs: {
868
- readonly property: "og:title";
869
- readonly content: "Connect";
870
- };
871
- readonly injectTo: "body" | "body-prepend" | "head" | "head-prepend";
872
- }, {
873
- readonly tag: "meta";
874
- readonly attrs: {
875
- readonly property: "og:type";
876
- readonly content: "website";
877
- };
878
- readonly injectTo: "body" | "body-prepend" | "head" | "head-prepend";
879
- }, {
880
- readonly tag: "meta";
881
- readonly attrs: {
882
- readonly property: "og:url";
883
- readonly content: "https://apps.powerhouse.io/powerhouse/connect/";
884
- };
885
- readonly injectTo: "body" | "body-prepend" | "head" | "head-prepend";
886
- }, {
887
- readonly tag: "meta";
888
- readonly attrs: {
889
- readonly property: "og:description";
890
- readonly content: "Navigate your organisation’s toughest operational challenges and steer your contributors to success with Connect. A navigation, collaboration and reporting tool for decentralised and open organisation.";
891
- };
892
- readonly injectTo: "body" | "body-prepend" | "head" | "head-prepend";
893
- }, {
894
- readonly tag: "meta";
895
- readonly attrs: {
896
- readonly property: "og:image";
897
- readonly content: "https://cf-ipfs.com/ipfs/bafkreigrmclndf2jpbolaq22535q2sw5t44uad3az3dpvkzrnt4lpjt63e";
898
- };
899
- readonly injectTo: "body" | "body-prepend" | "head" | "head-prepend";
900
- }, {
901
- readonly tag: "meta";
902
- readonly attrs: {
903
- readonly name: "twitter:card";
904
- readonly content: "summary_large_image";
905
- };
906
- readonly injectTo: "body" | "body-prepend" | "head" | "head-prepend";
907
- }, {
908
- readonly tag: "meta";
909
- readonly attrs: {
910
- readonly name: "twitter:image";
911
- readonly content: "https://cf-ipfs.com/ipfs/bafkreigrmclndf2jpbolaq22535q2sw5t44uad3az3dpvkzrnt4lpjt63e";
912
- };
913
- readonly injectTo: "body" | "body-prepend" | "head" | "head-prepend";
914
- }, {
915
- readonly tag: "meta";
916
- readonly attrs: {
917
- readonly name: "twitter:title";
918
- readonly content: "Connect";
919
- };
920
- readonly injectTo: "body" | "body-prepend" | "head" | "head-prepend";
921
- }, {
922
- readonly tag: "meta";
923
- readonly attrs: {
924
- readonly name: "twitter:description";
925
- readonly content: "Navigate your organisation’s toughest operational challenges and steer your contributors to success with Connect. A navigation, collaboration and reporting tool for decentralised and open organisation.";
926
- };
927
- readonly injectTo: "body" | "body-prepend" | "head" | "head-prepend";
928
- }];
818
+ }): HtmlTagDescriptor[];
929
819
  export declare function getConnectBaseViteConfig(options: IConnectOptions): InlineConfig;
930
820
  //#endregion
931
821
  //#region connect-utils/vite-plugins/dynamic-base.d.ts
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../connect-utils/constants.ts","../connect-utils/vite-plugins/project-brand.ts","../connect-utils/vite-plugins/app-shell.ts","../connect-utils/vite-plugins/build-hash.ts","../connect-utils/vite-plugins/connect-routes.ts","../connect-utils/vite-plugins/host-stylesheet.ts","../connect-utils/externalize-vendor.ts","../connect-utils/reactor-worker-build.ts","../connect-utils/worker-packages-build.ts","../connect-utils/types.ts","../connect-utils/helpers.ts","../connect-utils/runtime-config-schema.ts","../connect-utils/vite-config.ts","../connect-utils/vite-plugins/dynamic-base.ts","../connect-utils/vite-plugins/ph-config.ts","../connect-utils/vite-plugins/theme-boot.ts","../connect-utils/vite-plugins/vendor-import-map.ts"],"mappings":";;;;;;qBAAa;qBACA;qBACA;qBACA;;;KC4QD;;EAEV;;EAEA;EACA;;KAGU,gBAAgB;EAC1B,WAAW,YAAY;EACvB;;;;;qBCzQW;YAED;;EAEV;;EAEA;;;YAIU;YAEA,YAAY,QAAQ,OAAO,iBAAiB;;YAG5C,eAAe,eAAe;;qBAG7B;;qBAGA;;;wBASG,gBACd;EAAwB;wBACxB,SAAS,2BACR;;wBAuBa,mBAAmB,cAAc;;wBAqBjC,iBACd,sBACC;;wBAMa,aACd,qBACA,UAAS,kBACR;;wBAaa,cAAc,sBAAsB;;qBAUvC;qBACA;qBAIA;;wBAwBG,iBAAiB,cAAc;;qBAuBlC;;wBASG,iBAAiB,cAAc;;;wBAS/B,eACd,cACA,OAAO,UACP,iBAEE,aACA;EACG;EAAuB;;;wBAkBd,kBAAkB,eAAe;;wBAQjC,aACd,cACA,OAAO,UACP,eACA;YASU;;EAEV;IAAyB;;;EAEzB;;EAEA,eAAe;;EAEf;;EAEA,SAAS;;EAET;;;;wBAuFc,oBACd,gBACA,UAAU;;wBAuBI,iBACd,cACA,KAAK,qBACL;;;;wBAac,sBACd,uBAEE,aACA,SACA,cACA,WACA,QACA,mBACC,yBACF;;;;qBCnYU;iBAEI;;EAEf;;EAEA;;;EAGA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;;;;;;;;;wBAWc,iBAAiB,OAAO;wBAyCxB,0BAA0B;EACxC;EACA;EACA,UAAU;IACR;IACA;IACA;;EAEF;EACA;EACA;;;;;;;;wBAsBc,uBAAuB,oBAAoB;;;;qBCnF9C;;qBAEA;;qBAEA;;qBAEA;;;wBASG,wBACd,qBACA;;;wBAmBc,oBAAoB,qBAAqB;;;wBASzC,wBACd,qBACA,8BAA0B;;;;;;;wBAkBZ,kBAAkB,uBAAmB;;qBA6BxC;;wBASG,oBAAoB;YAIxB;;EAEV,SAAS;;EAET,SAAS;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9B;;EAEV,SAAS;;wBA4BK,sBAAsB,SAAS,yBAAyB"}
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../connect-utils/constants.ts","../connect-utils/vite-plugins/project-brand.ts","../connect-utils/vite-plugins/app-shell.ts","../connect-utils/vite-plugins/build-hash.ts","../connect-utils/vite-plugins/connect-routes.ts","../connect-utils/vite-plugins/host-stylesheet.ts","../connect-utils/externalize-vendor.ts","../connect-utils/reactor-worker-build.ts","../connect-utils/worker-packages-build.ts","../connect-utils/types.ts","../connect-utils/helpers.ts","../connect-utils/runtime-config-schema.ts","../connect-utils/vite-config.ts","../connect-utils/vite-plugins/dynamic-base.ts","../connect-utils/vite-plugins/ph-config.ts","../connect-utils/vite-plugins/theme-boot.ts","../connect-utils/vite-plugins/vendor-import-map.ts"],"mappings":";;;;;;;;qBAAa;qBACA;qBACA;qBACA;;;KC4QD;;EAEV;;EAEA;EACA;;KAGU,gBAAgB;EAC1B,WAAW,YAAY;EACvB;;;;;wBC1Oc,iBACd,sBACC;;wBAMa,aACd,qBACA,UAAS,kBACR;;wBAaa,cAAc,sBAAsB;YASxC;;EAEV;IAAyB;;;EAEzB;;EAEA,eAAe;;EAEf;;EAEA,SAAS;;EAET;;;;wBAuFc,oBACd,gBACA,UAAU;;wBAuBI,iBACd,cACA,KAAK,qBACL;;;;wBAac,sBACd,uBAEE,aACA,SACA,cACA,WACA,QACA,mBACC,yBACF;;;;qBChOU;iBAEI;;EAEf;;EAEA;;;EAGA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;;;;;;;;;wBAWc,iBAAiB,OAAO;wBAyCxB,0BAA0B;EACxC;EACA;EACA,UAAU;IACR;IACA;IACA;;EAEF;EACA;EACA;;;;;;;;wBAsBc,uBAAuB,oBAAoB;;;;qBCnF9C;;qBAEA;;qBAEA;;qBAEA;;;wBASG,wBACd,qBACA;;;wBAmBc,oBAAoB,qBAAqB;;;wBASzC,wBACd,qBACA,8BAA0B;;;;;;;wBAkBZ,kBAAkB,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SAAS,KAAK;wBAMA,eAAe,qBAAqB;wBAMpC,0BAA0B,gBAAoB;;;;wBAiB9C,qBAAqB;wBASrB,wBAAwB;;;;wBAWxB,YAAY,oBAAoB;;;;;;wBAiBhC,gBAAgB,iBAAiB;wBAWjC,sBAAsB;wBAmCtB,aAAa,mBAAmB;;;;wBAchC,6BAA6B;EAC3C;EACA;EACA;EACA;;wBAsDc,kBAAkB;wBAclB,qBACd,oBACA,sBACC;;;;wBAwCmB,iBAAiB,oBAAoB,mBAAgB;;;;wBAYrD,kBAAkB,oBAAoB,mBAAgB;wBAS5D,OAAO;wBAMP,wBAAwB;;;qBC5Q3B;qBAOA;qBAGA;WACX;WACA;WACA;WACA;WAEA;WACA;WACA;WACA;aACE;eACE;eACA;;aAGF;eACE;eACA;;aAGF;eACE;eACA;eAEA;;;;;;;;;;;;;;;;;;;;;;;;;aAEF;eACE;eACA;;aAGF;eACE;eAEA;iBACI;;iBAEA;iBACA;iBACA;iBACA;mBACE;qBAAQ;;mBACR;qBAAW;;;;;aAKnB,iDAAO;;;;;wBCDK,mBACd;EACE;;EAEA;EACA,WAAW;IACP;wBAuJQ,yBAAyB,SAAS,kBAAe;;;;wBCrKjD,gBAAgB,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAuC7B,yBACd;EAAW;EAAqB;IAC/B;wBA4Da,gBAAgB;;;YClJpB;EACV,UAAU;EACV;EACA,UAAU;;EAEV,YAAY;;;;;;;EAOZ;;;;;;EAMA,qBAAqB;;;;;;EAMrB,WAAW;;;wBAuBG,aAAa,cAAc;KAYtC;EAAgB,SAAS;EAAwB;;;;wBAItC,eACd,SAAS,wBACR,OAAO;EAAiB,KAAK;;;;;;;;;qBC3EnB;;;;;;wBA4BG,0BAA0B;;;YCxB9B;;EAEV,SAAS;;wBA4BK,sBAAsB,SAAS,yBAAyB"}
package/dist/index.mjs CHANGED
@@ -2,6 +2,7 @@ import { createRequire, registerHooks } from "node:module";
2
2
  import fs, { chmodSync, cpSync, createReadStream, existsSync, mkdirSync, mkdtempSync, readFileSync, readdirSync, realpathSync, renameSync, rmSync, statSync, utimesSync, writeFileSync } from "node:fs";
3
3
  import path, { dirname, extname, isAbsolute, join, relative, resolve, sep } from "node:path";
4
4
  import { createLogger, createServer, esmExternalRequirePlugin, loadEnv, normalizePath, searchForWorkspaceRoot } from "vite";
5
+ import { APP_SHELLS_FILE, SHELL_PLUGINS_FILE, appShellVariant, injectAppShell, readShellPluginsIn } from "@powerhousedao/shared/connect/app-shell";
5
6
  import { exec, execSync, spawn } from "node:child_process";
6
7
  import { readFile, writeFile } from "node:fs/promises";
7
8
  import { cwd } from "node:process";
@@ -20,6 +21,7 @@ import react from "@vitejs/plugin-react";
20
21
  import { PwaConfigSchema } from "@powerhousedao/shared/document-model";
21
22
  import { toCdnUrl } from "@powerhousedao/shared/registry/urls";
22
23
  import { VitePWA } from "vite-plugin-pwa";
24
+ export * from "@powerhousedao/shared/connect/app-shell";
23
25
  //#region connect-utils/constants.ts
24
26
  const EXTERNAL_PACKAGES_IMPORT = "PH:EXTERNAL_PACKAGES";
25
27
  const IMPORT_SCRIPT_FILE = "external-packages.js";
@@ -1120,6 +1122,15 @@ function withProjectFavicons(html, favicons, base = "/") {
1120
1122
  const links = favicons.map((icon) => `<link rel="icon" type="${icon.contentType}" sizes="${icon.sizes}" href="${escapeAttr(prefix + icon.fileName)}" />`).join("");
1121
1123
  return html.replace(ICON_LINK, "").replace("</head>", `${links}</head>`);
1122
1124
  }
1125
+ /** index.html with the icon an iPhone puts on its home screen: the first
1126
+ * installed-app icon covering its 180 px. Unchanged without one, as with
1127
+ * Connect's own icons or an SVG, which iOS can't use here. */
1128
+ function withAppleTouchIcon(html, icons = [], base = "/") {
1129
+ const icon = icons.find((candidate) => parseInt(candidate.sizes) >= 180);
1130
+ if (!icon) return html;
1131
+ const prefix = base.endsWith("/") ? base : `${base}/`;
1132
+ return html.replace("</head>", `<link rel="apple-touch-icon" href="${escapeAttr(prefix + icon.fileName)}" /></head>`);
1133
+ }
1123
1134
  /** Keyframes for the loader motions; shared by the shell and the app. */
1124
1135
  const LOADER_KEYFRAMES = "@keyframes ph-loader-pulse{0%,100%{opacity:1;transform:scale(1)}50%{opacity:.6;transform:scale(.94)}}@keyframes ph-loader-spin{to{transform:rotate(360deg)}}";
1125
1136
  const LOADER_ANIMATION = {
@@ -1142,7 +1153,7 @@ function replaceShellLoader(shellBody, loader, base = "/") {
1142
1153
  /**
1143
1154
  * Serves (dev) and emits (build) the branding files, and adds the tags
1144
1155
  * index.html carries before any JavaScript: the loader and custom-shell
1145
- * meta tags, and the favicon links.
1156
+ * meta tags, the favicon links and the iPhone's home-screen icon.
1146
1157
  */
1147
1158
  function connectProjectBrandPlugin(options) {
1148
1159
  const favicons = options.favicons ?? [];
@@ -1173,7 +1184,7 @@ function connectProjectBrandPlugin(options) {
1173
1184
  }
1174
1185
  },
1175
1186
  transformIndexHtml(html) {
1176
- return withProjectFavicons(meta ? html.replace("</head>", `${meta}</head>`) : html, favicons, base);
1187
+ return withAppleTouchIcon(withProjectFavicons(meta ? html.replace("</head>", `${meta}</head>`) : html, favicons, base), options.pwaIcons, base);
1177
1188
  },
1178
1189
  generateBundle(_options, bundle) {
1179
1190
  for (const file of files) {
@@ -1191,24 +1202,10 @@ function connectProjectBrandPlugin(options) {
1191
1202
  }
1192
1203
  //#endregion
1193
1204
  //#region connect-utils/vite-plugins/app-shell.ts
1194
- /** On the prerendered shell's elements; marks an index.html that has it. */
1195
- const APP_SHELL_MARKER = "data-ph-shell";
1196
- /** In Connect's dist, and copied to a project's: the plugins that pick a shell. */
1197
- const SHELL_PLUGINS_FILE = "shell-plugins.json";
1198
- /** In a project's dist: every variant, for a server that swaps the shell to the served composition. */
1199
- const APP_SHELLS_FILE = "app-shells.json";
1200
1205
  const SHELL_FILES = {
1201
1206
  generic: "shell",
1202
1207
  core: "shell-core"
1203
1208
  };
1204
- /** The shell of the composition's first plugin that has one, else core's; no composition is classic.
1205
- * Without `plugins` (an older Connect): core for a composition, generic for classic. */
1206
- function appShellVariant(composition, plugins) {
1207
- if (!plugins) return composition ? "core" : "generic";
1208
- if (!composition) return Object.values(plugins)[0] ?? "core";
1209
- for (const { module } of composition) if (Object.hasOwn(plugins, module)) return plugins[module];
1210
- return "core";
1211
- }
1212
1209
  function connectDistDir(projectRoot) {
1213
1210
  try {
1214
1211
  return join(dirname(resolvePackage("@powerhousedao/connect/package.json", projectRoot)), "dist");
@@ -1216,20 +1213,6 @@ function connectDistDir(projectRoot) {
1216
1213
  return;
1217
1214
  }
1218
1215
  }
1219
- /** The plugins' shell manifest in `dir`, if there is a valid one. */
1220
- function readShellPluginsIn(dir) {
1221
- const file = join(dir, SHELL_PLUGINS_FILE);
1222
- if (!existsSync(file)) return void 0;
1223
- try {
1224
- const manifest = JSON.parse(readFileSync(file, "utf8"));
1225
- if (!manifest || typeof manifest !== "object") return void 0;
1226
- const plugins = {};
1227
- for (const [module, variant] of Object.entries(manifest)) if (variant === "generic" || variant === "core") plugins[module] = variant;
1228
- return plugins;
1229
- } catch {
1230
- return;
1231
- }
1232
- }
1233
1216
  /** The shell manifest of the installed Connect, if it ships one. */
1234
1217
  function readShellPlugins(projectRoot) {
1235
1218
  const distDir = connectDistDir(projectRoot);
@@ -1256,61 +1239,6 @@ function readAppShells(projectRoot) {
1256
1239
  }
1257
1240
  return shells;
1258
1241
  }
1259
- /** On the boot-recovery script; its sessionStorage key guards against reload loops. */
1260
- const BOOT_RECOVER_MARKER = "data-ph-boot-recover";
1261
- const BOOT_RECOVER_KEY = "ph:sw-recover";
1262
- const BOOT_RECOVER_SCRIPT = `(function(){try{var K='${BOOT_RECOVER_KEY}',n=navigator.serviceWorker,done=0;if(!n||sessionStorage.getItem(K))return;var up=function(){return !document.querySelector('style[${APP_SHELL_MARKER}]')};var reload=function(){location.reload()};var skip=function(w){try{sessionStorage.setItem(K,'1')}catch(e){}n.addEventListener('controllerchange',reload);w.postMessage({type:'SKIP_WAITING'});setTimeout(reload,3000)};var watch=function(w){w.addEventListener('statechange',function(){if(w.state==='installed')skip(w)})};var go=function(){if(done||up())return;done=1;n.getRegistration().then(function(r){if(!r)return;if(r.waiting)return skip(r.waiting);if(r.installing)return watch(r.installing);r.addEventListener('updatefound',function(){if(r.installing)watch(r.installing)});return r.update()}).catch(function(){})};addEventListener('error',function(e){var t=e.target;if(e.error instanceof SyntaxError||e.error instanceof TypeError||(t&&t.tagName==='SCRIPT'))go()},true);addEventListener('unhandledrejection',function(e){if(e.reason instanceof SyntaxError||e.reason instanceof TypeError)go()});setTimeout(go,8000)}catch(e){}})();`;
1263
- /** Prefixes the shell's root-relative links with the deploy base. */
1264
- function rebaseShellLinks(body, base) {
1265
- if (base === "/" || !base) return body;
1266
- const prefix = base.endsWith("/") ? base : `${base}/`;
1267
- return body.replace(/(\shref=")\/(?!\/)/g, `$1${prefix}`);
1268
- }
1269
- const STYLESHEET_LINK = /<link\b(?=[^>]*\brel=["']?stylesheet\b)[^>]*>/gi;
1270
- function deferStylesheet(link) {
1271
- return `${link.replace(/\brel=["']?stylesheet["']?/i, "rel=\"preload\" as=\"style\"").replace(/\/?>$/, ` onload="this.onload=null;this.rel='stylesheet'">`)}<noscript>${link}</noscript>`;
1272
- }
1273
- const region = (name, content) => `<!--ph-shell:${name}-->${content}<!--/ph-shell:${name}-->`;
1274
- const REGION = (name) => new RegExp(`<!--ph-shell:${name}-->[\\s\\S]*?<!--/ph-shell:${name}-->`);
1275
- /** The app's title without `connect.branding.appName`; core's `appTitle` fallback. */
1276
- const DEFAULT_APP_NAME = "Connect";
1277
- const APP_NAME = /(<!--ph-shell:app-name-->)[\s\S]*?(<!--\/ph-shell:app-name-->)/g;
1278
- const escapeHtml = (text) => text.replaceAll("&", "&amp;").replaceAll("<", "&lt;").replaceAll(">", "&gt;");
1279
- /** Fills the shell's app name as the app resolves it: the branding name, else the default. */
1280
- function withShellAppName(html, appName) {
1281
- const name = escapeHtml(appName || "Connect");
1282
- return html.replace(APP_NAME, (_m, open, close) => [
1283
- open,
1284
- name,
1285
- close
1286
- ].join(""));
1287
- }
1288
- /** Inlines `shell` into an empty `#root`, adds its critical CSS and, unless
1289
- * `deferStyles` is false, defers the stylesheets; React replaces the markup when the app renders. */
1290
- function injectAppShell(html, shell, base = "/", { deferStyles = true, appName } = {}) {
1291
- if (html.includes("data-ph-shell")) return html;
1292
- const root = /<div id="root"><\/div>/;
1293
- if (!root.test(html)) return html;
1294
- const firstSheet = html.search(STYLESHEET_LINK);
1295
- const at = firstSheet >= 0 ? firstSheet : html.indexOf("</head>");
1296
- const recover = `<script ${BOOT_RECOVER_MARKER}>${BOOT_RECOVER_SCRIPT}<\/script>`;
1297
- const body = withShellAppName(rebaseShellLinks(shell.body, base), appName);
1298
- const withHead = html.slice(0, at) + region("head", shell.head) + recover + html.slice(at);
1299
- return (deferStyles ? withHead.replace(STYLESHEET_LINK, deferStylesheet) : withHead).replace(root, () => `<div id="root">${region("body", body)}</div>`);
1300
- }
1301
- /** The variant an index.html carries, from its shell's marker value. */
1302
- function appShellVariantOf(html) {
1303
- const head = REGION("head").exec(html)?.[0];
1304
- const value = head && new RegExp(`data-ph-shell="(\\w+)"`).exec(head);
1305
- if (!value) return void 0;
1306
- return value[1] === "core" ? "core" : "generic";
1307
- }
1308
- /** Replaces the shell an index.html carries with `shell`, titled `appName`; a page without one is unchanged. */
1309
- function swapAppShell(html, shell, base = "/", appName) {
1310
- if (!REGION("head").test(html) || !REGION("body").test(html)) return html;
1311
- const body = withShellAppName(rebaseShellLinks(shell.body, base), appName);
1312
- return html.replace(REGION("head"), () => region("head", shell.head)).replace(REGION("body"), () => region("body", body));
1313
- }
1314
1242
  const DEV_SHELL_WAIT_MS = 1e4;
1315
1243
  const CONNECT_PACKAGES = ["@powerhousedao/connect", "@powerhousedao/connect-core"];
1316
1244
  async function renderProjectAppShells(projectRoot, config, routeAliases, hostStylesheet) {
@@ -3774,6 +3702,15 @@ const PWA_ICONS = [
3774
3702
  function connectPwaIconsPlugin() {
3775
3703
  return {
3776
3704
  name: "copy-connect-pwa-icons",
3705
+ configureServer(server) {
3706
+ for (const icon of PWA_ICONS) server.middlewares.use(`${server.config.base}${icon}`, (_req, res, next) => {
3707
+ server.pluginContainer.resolveId(`@powerhousedao/connect/assets/${icon}`).then((resolved) => {
3708
+ if (!resolved) return next();
3709
+ res.setHeader("Content-Type", "image/png");
3710
+ res.end(readFileSync(resolved.id));
3711
+ }).catch(() => next());
3712
+ });
3713
+ },
3777
3714
  async generateBundle(_options, bundle) {
3778
3715
  for (const icon of PWA_ICONS) try {
3779
3716
  if (icon in bundle) continue;
@@ -3952,6 +3889,24 @@ function phSwConfigPlugin(data) {
3952
3889
  };
3953
3890
  }
3954
3891
  /**
3892
+ * Connect's `?ph-manifest-rev` link (pwa-manifest-link.ts) is the service
3893
+ * worker's to ignore. The dev server has none, and vite-plugin-pwa matches the
3894
+ * whole URL there, so without this the link would get index.html.
3895
+ */
3896
+ function devManifestRevisionPlugin() {
3897
+ return {
3898
+ name: "ph-connect-pwa-dev-manifest-revision",
3899
+ apply: "serve",
3900
+ configureServer(server) {
3901
+ const manifestUrl = `${server.config.base}manifest.webmanifest`;
3902
+ server.middlewares.use((req, _res, next) => {
3903
+ if (req.url?.startsWith(`${manifestUrl}?`)) req.url = manifestUrl;
3904
+ next();
3905
+ });
3906
+ }
3907
+ };
3908
+ }
3909
+ /**
3955
3910
  * Service-worker / PWA support for Connect, gated by `connect.app.offline`.
3956
3911
  *
3957
3912
  * When enabled (the default), Workbox `injectManifest` bundles Connect's
@@ -3989,22 +3944,26 @@ function connectPwaPlugins(options) {
3989
3944
  NAVIGATE_FALLBACK_DENYLIST_EXTRA: pwa?.navigateFallbackDenylist ?? [],
3990
3945
  STATIC_FILES: staticFiles
3991
3946
  };
3992
- return [connectPwaIconsPlugin(), VitePWA({
3993
- strategies: "injectManifest",
3994
- srcDir: resolveServiceWorkerDir(),
3995
- filename: SW_FILENAME,
3996
- registerType: "prompt",
3997
- injectRegister: null,
3998
- devOptions: { enabled: false },
3999
- includeManifestIcons: false,
4000
- manifest,
4001
- injectManifest: {
4002
- globPatterns: precache.globPatterns,
4003
- globIgnores: [...precache.globIgnores, "**/manifest.webmanifest"],
4004
- maximumFileSizeToCacheInBytes: precache.maximumFileSizeToCacheInBytes,
4005
- buildPlugins: { vite: [phSwConfigPlugin(swConfig)] }
4006
- }
4007
- })];
3947
+ return [
3948
+ connectPwaIconsPlugin(),
3949
+ devManifestRevisionPlugin(),
3950
+ VitePWA({
3951
+ strategies: "injectManifest",
3952
+ srcDir: resolveServiceWorkerDir(),
3953
+ filename: SW_FILENAME,
3954
+ registerType: "prompt",
3955
+ injectRegister: null,
3956
+ devOptions: { enabled: true },
3957
+ includeManifestIcons: false,
3958
+ manifest,
3959
+ injectManifest: {
3960
+ globPatterns: precache.globPatterns,
3961
+ globIgnores: [...precache.globIgnores, "**/manifest.webmanifest"],
3962
+ maximumFileSizeToCacheInBytes: precache.maximumFileSizeToCacheInBytes,
3963
+ buildPlugins: { vite: [phSwConfigPlugin(swConfig)] }
3964
+ }
3965
+ })
3966
+ ];
4008
3967
  }
4009
3968
  //#endregion
4010
3969
  //#region connect-utils/vite-plugins/react-self-host.ts
@@ -4387,88 +4346,91 @@ function vendorImportMapPlugin(options) {
4387
4346
  //#endregion
4388
4347
  //#region connect-utils/vite-config.ts
4389
4348
  function getConnectHtmlTags(options = {}) {
4390
- const { registryUrl, injectTo = "head" } = options;
4391
- return [
4349
+ const { registryUrl, appName, injectTo = "head" } = options;
4350
+ const connectCard = appName ? [] : [
4392
4351
  {
4393
4352
  tag: "meta",
4394
4353
  attrs: {
4395
- "http-equiv": "Content-Security-Policy",
4396
- content: `script-src 'self' 'unsafe-inline' 'unsafe-eval'${registryUrl ? " " + registryUrl : ""}; worker-src 'self' blob:; object-src 'none'; base-uri 'self';`
4354
+ property: "og:url",
4355
+ content: "https://apps.powerhouse.io/powerhouse/connect/"
4397
4356
  },
4398
4357
  injectTo
4399
4358
  },
4400
4359
  {
4401
4360
  tag: "meta",
4402
4361
  attrs: {
4403
- property: "og:title",
4404
- content: "Connect"
4362
+ property: "og:description",
4363
+ content: "Navigate your organisation’s toughest operational challenges and steer your contributors to success with Connect. A navigation, collaboration and reporting tool for decentralised and open organisation."
4405
4364
  },
4406
4365
  injectTo
4407
4366
  },
4408
4367
  {
4409
4368
  tag: "meta",
4410
4369
  attrs: {
4411
- property: "og:type",
4412
- content: "website"
4370
+ property: "og:image",
4371
+ content: "https://cf-ipfs.com/ipfs/bafkreigrmclndf2jpbolaq22535q2sw5t44uad3az3dpvkzrnt4lpjt63e"
4413
4372
  },
4414
4373
  injectTo
4415
4374
  },
4416
4375
  {
4417
4376
  tag: "meta",
4418
4377
  attrs: {
4419
- property: "og:url",
4420
- content: "https://apps.powerhouse.io/powerhouse/connect/"
4378
+ name: "twitter:card",
4379
+ content: "summary_large_image"
4421
4380
  },
4422
4381
  injectTo
4423
4382
  },
4424
4383
  {
4425
4384
  tag: "meta",
4426
4385
  attrs: {
4427
- property: "og:description",
4428
- content: "Navigate your organisation’s toughest operational challenges and steer your contributors to success with Connect. A navigation, collaboration and reporting tool for decentralised and open organisation."
4386
+ name: "twitter:image",
4387
+ content: "https://cf-ipfs.com/ipfs/bafkreigrmclndf2jpbolaq22535q2sw5t44uad3az3dpvkzrnt4lpjt63e"
4429
4388
  },
4430
4389
  injectTo
4431
4390
  },
4432
4391
  {
4433
4392
  tag: "meta",
4434
4393
  attrs: {
4435
- property: "og:image",
4436
- content: "https://cf-ipfs.com/ipfs/bafkreigrmclndf2jpbolaq22535q2sw5t44uad3az3dpvkzrnt4lpjt63e"
4394
+ name: "twitter:description",
4395
+ content: "Navigate your organisation’s toughest operational challenges and steer your contributors to success with Connect. A navigation, collaboration and reporting tool for decentralised and open organisation."
4437
4396
  },
4438
4397
  injectTo
4439
- },
4398
+ }
4399
+ ];
4400
+ return [
4440
4401
  {
4441
4402
  tag: "meta",
4442
4403
  attrs: {
4443
- name: "twitter:card",
4444
- content: "summary_large_image"
4404
+ "http-equiv": "Content-Security-Policy",
4405
+ content: `script-src 'self' 'unsafe-inline' 'unsafe-eval'${registryUrl ? " " + registryUrl : ""}; worker-src 'self' blob:; object-src 'none'; base-uri 'self';`
4445
4406
  },
4446
4407
  injectTo
4447
4408
  },
4448
4409
  {
4449
4410
  tag: "meta",
4450
4411
  attrs: {
4451
- name: "twitter:image",
4452
- content: "https://cf-ipfs.com/ipfs/bafkreigrmclndf2jpbolaq22535q2sw5t44uad3az3dpvkzrnt4lpjt63e"
4412
+ property: "og:title",
4413
+ content: appName ?? "Connect"
4453
4414
  },
4454
4415
  injectTo
4455
4416
  },
4456
4417
  {
4457
4418
  tag: "meta",
4458
4419
  attrs: {
4459
- name: "twitter:title",
4460
- content: "Connect"
4420
+ property: "og:type",
4421
+ content: "website"
4461
4422
  },
4462
4423
  injectTo
4463
4424
  },
4464
4425
  {
4465
4426
  tag: "meta",
4466
4427
  attrs: {
4467
- name: "twitter:description",
4468
- content: "Navigate your organisation’s toughest operational challenges and steer your contributors to success with Connect. A navigation, collaboration and reporting tool for decentralised and open organisation."
4428
+ name: "twitter:title",
4429
+ content: appName ?? "Connect"
4469
4430
  },
4470
4431
  injectTo
4471
- }
4432
+ },
4433
+ ...connectCard
4472
4434
  ];
4473
4435
  }
4474
4436
  function viteLogger({ silence }) {
@@ -4534,7 +4496,6 @@ function getConnectBaseViteConfig(options) {
4534
4496
  offlineEnabled,
4535
4497
  packageRegistryUrl: phPackageRegistryUrl
4536
4498
  });
4537
- const connectHtmlTags = getConnectHtmlTags({ registryUrl: phPackageRegistryUrl });
4538
4499
  const devImportmapTag = mode === "development" ? [{
4539
4500
  tag: "script",
4540
4501
  attrs: { type: "importmap" },
@@ -4548,7 +4509,10 @@ function getConnectBaseViteConfig(options) {
4548
4509
  name: "ph-connect-html-tags",
4549
4510
  transformIndexHtml: {
4550
4511
  order: "pre",
4551
- handler: () => [...connectHtmlTags, ...devImportmapTag]
4512
+ handler: () => [...getConnectHtmlTags({
4513
+ registryUrl: phPackageRegistryUrl,
4514
+ appName: projectBrand.name
4515
+ }), ...devImportmapTag]
4552
4516
  }
4553
4517
  }
4554
4518
  ];
@@ -4716,6 +4680,6 @@ function getConnectBaseViteConfig(options) {
4716
4680
  };
4717
4681
  }
4718
4682
  //#endregion
4719
- export { APP_LAYOUT, APP_SHELLS_FILE, APP_SHELL_MARKER, BOOT_RECOVER_KEY, BOOT_RECOVER_MARKER, BOOT_RECOVER_SCRIPT, BUILDER_TOOLS_VERSION, BUILD_HASH_FILE, CONNECT_ROUTES_GEN, CONNECT_ROUTES_SPECIFIER, CONNECT_ROUTE_FILE_DEPS, CORE_ROUTE_TREE_SPECIFIER, DEFAULT_APP_NAME, DEFAULT_CONNECT_OUTDIR, DEFAULT_VENDOR_INCLUDE, DYNAMIC_BASE_PLACEHOLDER, EXTERNAL_PACKAGES_IMPORT, HOST_ROUTES_DIR, IMPORT_SCRIPT_FILE, LOCAL_PACKAGE_ID, LOCK_STALE_MS, PACKAGE_ROUTES_MODULE, PH_DIR_NAME, REACTOR_WORKER_ENTRY, REACTOR_WORKER_MIME, REACTOR_WORKER_URL_PREFIX, ROUTE_TREE_SPECIFIER, RUNTIME_CONFIG_SCHEMA_ID, RUNTIME_CONFIG_SCHEMA_URL, SHELL_PLUGINS_FILE, THEME_BOOT_MARKER, VENDOR_EXTERNAL, VENDOR_SKIP_SUBPATHS, VENDOR_URL_PREFIX, WORKER_PACKAGES_MANIFEST, acquireLock, appShellVariant, appShellVariantOf, appendToHtmlHead, backupIndexHtml, buildHashFromBuildOptions, computeBuildHash, computeSourceDigest, connectAppShellPlugin, connectBuildHashPlugin, connectDynamicBasePlugin, connectRouteFileDeps, connectRouterChunkGroups, connectRoutes, connectRoutesDirOf, connectRoutesGeneratorConfig, connectRoutesTreeOf, connectRoutesWatcher, connectThemeBootPlugin, copyConnect, directoryContentDigest, distDirFingerprint, ensureNodeVersion, escapeForRegExp, findBundleSpecifierOffenders, findDisallowedSpecifiers, findPackageRoot, findWorkerUnsafeMarkers, generateConnectRoutes, getConnectBaseViteConfig, getConnectHtmlTags, hasProjectAppLayout, hostStylesheetPath, hostStylesheetPlugin, ignoreBuildOutput, ignoreDotPhButRouteTree, injectAppShell, linkedBuildStamp, makeImportScriptFromPackages, missingVendorEntries, overriddenConnectRoutes, ownProjectPackage, phConfigPlugin, prebuildConnectVendor, prebuildReactorWorker, prebuildWorkerPackages, prependToHtmlHead, publishDirAtomic, readAppShell, readAppShells, readJsonFile, readShellPlugins, readShellPluginsIn, rebaseShellLinks, relativeCssUrls, releaseLock, removeBase64EnvValues, resolveConnectBundle, resolveConnectPackageJson, resolveConnectPublicDir, resolveConnectRoutesDir, resolveOwnDeps, resolveOwnPackageVersion, resolvePackage, resolveReactorWorkerSource, resolveVersionDigest, resolveViteConfigPath, resolveWorkspacePackageDir, routeIdOf, runShellScriptPlugin, runTsc, runWorkerBuildEntries, runtimeConfigSchema, stripVersionFromPackage, swapAppShell, syncConnectRoutes, upstreamWorkerPackages, vendorImportMapPlugin, vendorRelativePath, withAppTitle, withErrorOverlay, withHostStylesheet, withShellAppName, withSourceLocations, withVendorBase, workerSafeVendorImports };
4683
+ export { APP_LAYOUT, BUILDER_TOOLS_VERSION, BUILD_HASH_FILE, CONNECT_ROUTES_GEN, CONNECT_ROUTES_SPECIFIER, CONNECT_ROUTE_FILE_DEPS, CORE_ROUTE_TREE_SPECIFIER, DEFAULT_CONNECT_OUTDIR, DEFAULT_VENDOR_INCLUDE, DYNAMIC_BASE_PLACEHOLDER, EXTERNAL_PACKAGES_IMPORT, HOST_ROUTES_DIR, IMPORT_SCRIPT_FILE, LOCAL_PACKAGE_ID, LOCK_STALE_MS, PACKAGE_ROUTES_MODULE, PH_DIR_NAME, REACTOR_WORKER_ENTRY, REACTOR_WORKER_MIME, REACTOR_WORKER_URL_PREFIX, ROUTE_TREE_SPECIFIER, RUNTIME_CONFIG_SCHEMA_ID, RUNTIME_CONFIG_SCHEMA_URL, THEME_BOOT_MARKER, VENDOR_EXTERNAL, VENDOR_SKIP_SUBPATHS, VENDOR_URL_PREFIX, WORKER_PACKAGES_MANIFEST, acquireLock, appendToHtmlHead, backupIndexHtml, buildHashFromBuildOptions, computeBuildHash, computeSourceDigest, connectAppShellPlugin, connectBuildHashPlugin, connectDynamicBasePlugin, connectRouteFileDeps, connectRouterChunkGroups, connectRoutes, connectRoutesDirOf, connectRoutesGeneratorConfig, connectRoutesTreeOf, connectRoutesWatcher, connectThemeBootPlugin, copyConnect, directoryContentDigest, distDirFingerprint, ensureNodeVersion, escapeForRegExp, findBundleSpecifierOffenders, findDisallowedSpecifiers, findPackageRoot, findWorkerUnsafeMarkers, generateConnectRoutes, getConnectBaseViteConfig, getConnectHtmlTags, hasProjectAppLayout, hostStylesheetPath, hostStylesheetPlugin, ignoreBuildOutput, ignoreDotPhButRouteTree, linkedBuildStamp, makeImportScriptFromPackages, missingVendorEntries, overriddenConnectRoutes, ownProjectPackage, phConfigPlugin, prebuildConnectVendor, prebuildReactorWorker, prebuildWorkerPackages, prependToHtmlHead, publishDirAtomic, readAppShell, readAppShells, readJsonFile, readShellPlugins, relativeCssUrls, releaseLock, removeBase64EnvValues, resolveConnectBundle, resolveConnectPackageJson, resolveConnectPublicDir, resolveConnectRoutesDir, resolveOwnDeps, resolveOwnPackageVersion, resolvePackage, resolveReactorWorkerSource, resolveVersionDigest, resolveViteConfigPath, resolveWorkspacePackageDir, routeIdOf, runShellScriptPlugin, runTsc, runWorkerBuildEntries, runtimeConfigSchema, stripVersionFromPackage, syncConnectRoutes, upstreamWorkerPackages, vendorImportMapPlugin, vendorRelativePath, withAppTitle, withErrorOverlay, withHostStylesheet, withSourceLocations, withVendorBase, workerSafeVendorImports };
4720
4684
 
4721
4685
  //# sourceMappingURL=index.mjs.map