@powerhousedao/connect 6.2.3-dev.70 → 6.2.3-dev.71
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/RUNTIME-CONFIG.md +29 -20
- package/dist/{ClearStorageModal-BwGVIuLX.js → ClearStorageModal-DxBXLSmH.js} +4 -4
- package/dist/{ClearStorageModal-BwGVIuLX.js.map → ClearStorageModal-DxBXLSmH.js.map} +1 -1
- package/dist/{DebugSettingsModal-DfOnR4iY.js → DebugSettingsModal-D1I-K2Gf.js} +4 -4
- package/dist/{DebugSettingsModal-DfOnR4iY.js.map → DebugSettingsModal-D1I-K2Gf.js.map} +1 -1
- package/dist/{InspectorModal-BVqRNFfP.js → InspectorModal-D85U4oKJ.js} +4 -4
- package/dist/{InspectorModal-BVqRNFfP.js.map → InspectorModal-D85U4oKJ.js.map} +1 -1
- package/dist/{OpenFileDocumentsModal-BNHD0vg9.js → OpenFileDocumentsModal-B9c-CsKT.js} +4 -4
- package/dist/{OpenFileDocumentsModal-BNHD0vg9.js.map → OpenFileDocumentsModal-B9c-CsKT.js.map} +1 -1
- package/dist/app-loader-D5GEwpML.js +4 -0
- package/dist/{app-loader-DtH6v5CE.js → app-loader-casiq2T2.js} +36 -27
- package/dist/{app-loader-DtH6v5CE.js.map → app-loader-casiq2T2.js.map} +1 -1
- package/dist/{app-skeleton-DFg65Rxa.js → app-skeleton-BHgmbYld.js} +3 -3
- package/dist/{app-skeleton-BFjvlTWd.js → app-skeleton-ClRUYLE_.js} +14 -5
- package/dist/app-skeleton-ClRUYLE_.js.map +1 -0
- package/dist/{boot-N7f3RrY_.js → boot-CFPdHSqB.js} +5 -5
- package/dist/{boot-N7f3RrY_.js.map → boot-CFPdHSqB.js.map} +1 -1
- package/dist/{build-info-TgBEqTq1.js → build-info-Cn2f6llN.js} +5 -5
- package/dist/{build-info-TgBEqTq1.js.map → build-info-Cn2f6llN.js.map} +1 -1
- package/dist/{components-B_wpF5Is.js → components-C4K5xyad.js} +7 -7
- package/dist/{components-B_wpF5Is.js.map → components-C4K5xyad.js.map} +1 -1
- package/dist/{drive-icon-BiVP8yJc.js → drive-icon-BIpd8edR.js} +14 -3
- package/dist/drive-icon-BIpd8edR.js.map +1 -0
- package/dist/generic.js +1 -1
- package/dist/{load-CkbGF6wB.js → load-DcDV9hi4.js} +6 -6
- package/dist/{load-CkbGF6wB.js.map → load-DcDV9hi4.js.map} +1 -1
- package/dist/{load-runtime-config-DXswYA71.js → load-runtime-config-Deq75NYr.js} +4 -4
- package/dist/{load-runtime-config-DXswYA71.js.map → load-runtime-config-Deq75NYr.js.map} +1 -1
- package/dist/main.js +2 -2
- package/dist/{package-manager-CPqbVSd8.js → package-manager-CzBsaUUd.js} +6 -6
- package/dist/{package-manager-CPqbVSd8.js.map → package-manager-CzBsaUUd.js.map} +1 -1
- package/dist/plugin-configs.d.ts +242 -0
- package/dist/plugin-configs.d.ts.map +1 -0
- package/dist/plugin-configs.js +26 -0
- package/dist/plugin-configs.js.map +1 -0
- package/dist/plugins-CegSox2x.js +263 -0
- package/dist/plugins-CegSox2x.js.map +1 -0
- package/dist/prerender.js +9 -5
- package/dist/prerender.js.map +1 -1
- package/dist/{reactor-DLCl-WHi.js → reactor-BGYR1N7Z.js} +5 -5
- package/dist/{reactor-DLCl-WHi.js.map → reactor-BGYR1N7Z.js.map} +1 -1
- package/dist/route-tree.js +1 -1
- package/dist/{route-views-CTARvT5N.js → route-views-2aB1ZZPP.js} +6 -6
- package/dist/route-views-2aB1ZZPP.js.map +1 -0
- package/dist/{route-views-BF0p-4Fi.js → route-views-CDVZytw4.js} +4 -4
- package/dist/{route-views-BF0p-4Fi.js.map → route-views-CDVZytw4.js.map} +1 -1
- package/dist/route-views-D_873yb_.js +4 -0
- package/dist/route-views.js +3 -3
- package/dist/router-B0OQvO11.js +4 -0
- package/dist/{router-L9X9U-97.js → router-Cu0PH6sh.js} +5 -5
- package/dist/router-Cu0PH6sh.js.map +1 -0
- package/dist/{settings-B-apZN_f.js → settings-CFn4TA0g.js} +13 -7
- package/dist/{settings-B-apZN_f.js.map → settings-CFn4TA0g.js.map} +1 -1
- package/dist/{settings-tabs-CRgiuZcb.js → settings-tabs-BC8gAacB.js} +31 -6
- package/dist/settings-tabs-BC8gAacB.js.map +1 -0
- package/dist/shell-core.html +1 -1
- package/dist/shell.html +1 -1
- package/dist/start-connect.js +2 -2
- package/dist/style.css +27 -4
- package/dist/{ui-CwbE23ra.js → ui-BOTsJPoc.js} +7 -7
- package/dist/{ui-CwbE23ra.js.map → ui-BOTsJPoc.js.map} +1 -1
- package/dist/workflows-C3qEvx1R.js +63 -0
- package/dist/workflows-C3qEvx1R.js.map +1 -0
- package/docs/customizing/styles-and-branding.md +1 -1
- package/package.json +23 -17
- package/scripts/assert-plugin-configs.mjs +47 -0
- package/dist/app-loader-BjAXSJQ6.js +0 -4
- package/dist/app-skeleton-BFjvlTWd.js.map +0 -1
- package/dist/drive-icon-BiVP8yJc.js.map +0 -1
- package/dist/plugins-CWbr0n_Q.js +0 -246
- package/dist/plugins-CWbr0n_Q.js.map +0 -1
- package/dist/route-views-CTARvT5N.js.map +0 -1
- package/dist/route-views-D8I-1PWU.js +0 -4
- package/dist/router-BguOMBUh.js +0 -4
- package/dist/router-L9X9U-97.js.map +0 -1
- package/dist/settings-tabs-CRgiuZcb.js.map +0 -1
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="5648c876-2263-515c-bec8-707bdf29a87a")}catch(e){}}();
|
|
3
|
+
import { a as genericConfigSchema, i as openPanelConfigSchema, n as vetraStudioConfigSchema, o as assistantConfigSchema, r as sentryConfigSchema, t as workflowsConnectConfigSchema } from "./workflows-C3qEvx1R.js";
|
|
4
|
+
import { DEFAULT_CONNECT_CONFIG } from "@powerhousedao/shared/connect";
|
|
5
|
+
import { z } from "zod";
|
|
6
|
+
import { PluginError } from "@powerhousedao/host-core/plugins";
|
|
7
|
+
import { findToken } from "@powerhousedao/host-core/schema";
|
|
8
|
+
//#region src/plugins/entry-config.ts
|
|
9
|
+
/**
|
|
10
|
+
* Validate a built-in plugin's entry config against its configSchema, the way
|
|
11
|
+
* host-core's resolveHostPlugins does on the server: a failure names the
|
|
12
|
+
* plugin and every offending key instead of surfacing a bare ZodError from
|
|
13
|
+
* the runtime-config load.
|
|
14
|
+
*/
|
|
15
|
+
function parseEntryConfig(specifier, schema, rawConfig) {
|
|
16
|
+
const parsed = schema.safeParse(rawConfig);
|
|
17
|
+
if (!parsed.success) throw new PluginError(`config for Connect plugin "${specifier}" is invalid:\n` + z.prettifyError(parsed.error), `Fix the entry's config in the host's runner.plugins.`);
|
|
18
|
+
return parsed.data;
|
|
19
|
+
}
|
|
20
|
+
//#endregion
|
|
21
|
+
//#region src/plugins/assistant.ts
|
|
22
|
+
const createAssistantPlugin = (rawConfig) => {
|
|
23
|
+
parseEntryConfig("@powerhousedao/connect/plugins/assistant", assistantConfigSchema, rawConfig);
|
|
24
|
+
return {
|
|
25
|
+
name: "connect-assistant",
|
|
26
|
+
appliesTo: "connect",
|
|
27
|
+
configSchema: assistantConfigSchema,
|
|
28
|
+
hooks: { transformConnectConfig(served) {
|
|
29
|
+
return {
|
|
30
|
+
...served,
|
|
31
|
+
ai: {
|
|
32
|
+
...served.ai,
|
|
33
|
+
assistantEnabled: true
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
} }
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
//#endregion
|
|
40
|
+
//#region src/plugins/generic.ts
|
|
41
|
+
const DEFAULT_DRIVES = DEFAULT_CONNECT_CONFIG.drives;
|
|
42
|
+
const DEFAULT_HOME = DEFAULT_CONNECT_CONFIG.home;
|
|
43
|
+
const createGenericPlugin = (rawConfig) => {
|
|
44
|
+
const config = parseEntryConfig("@powerhousedao/connect/plugins/generic", genericConfigSchema, rawConfig);
|
|
45
|
+
return {
|
|
46
|
+
name: "connect-generic",
|
|
47
|
+
appliesTo: "connect",
|
|
48
|
+
configSchema: genericConfigSchema,
|
|
49
|
+
hooks: { transformConnectConfig(served) {
|
|
50
|
+
const entrySections = config.sections ?? {};
|
|
51
|
+
return {
|
|
52
|
+
...served,
|
|
53
|
+
drives: {
|
|
54
|
+
...served.drives,
|
|
55
|
+
allowAddDrive: config.allowAddDrive ?? DEFAULT_DRIVES?.allowAddDrive,
|
|
56
|
+
sections: {
|
|
57
|
+
remote: {
|
|
58
|
+
...DEFAULT_DRIVES?.sections?.remote,
|
|
59
|
+
...entrySections.remote
|
|
60
|
+
},
|
|
61
|
+
local: {
|
|
62
|
+
...DEFAULT_DRIVES?.sections?.local,
|
|
63
|
+
...entrySections.local
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
icons: config.icons ?? null
|
|
67
|
+
},
|
|
68
|
+
home: {
|
|
69
|
+
...served.home,
|
|
70
|
+
background: config.homeBackground ?? DEFAULT_HOME?.background ?? null
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
} }
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
//#endregion
|
|
77
|
+
//#region src/plugins/openpanel.ts
|
|
78
|
+
const createOpenPanelPlugin = (rawConfig) => {
|
|
79
|
+
const config = parseEntryConfig("@powerhousedao/connect/plugins/openpanel", openPanelConfigSchema, rawConfig);
|
|
80
|
+
return {
|
|
81
|
+
name: "connect-openpanel",
|
|
82
|
+
appliesTo: "connect",
|
|
83
|
+
configSchema: openPanelConfigSchema,
|
|
84
|
+
hooks: { transformConnectConfig(served) {
|
|
85
|
+
return {
|
|
86
|
+
...served,
|
|
87
|
+
openPanel: {
|
|
88
|
+
...served.openPanel,
|
|
89
|
+
...config
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
} }
|
|
93
|
+
};
|
|
94
|
+
};
|
|
95
|
+
//#endregion
|
|
96
|
+
//#region src/plugins/sentry.ts
|
|
97
|
+
const createSentryPlugin = (rawConfig) => {
|
|
98
|
+
const config = parseEntryConfig("@powerhousedao/connect/plugins/sentry", sentryConfigSchema, rawConfig);
|
|
99
|
+
return {
|
|
100
|
+
name: "connect-sentry",
|
|
101
|
+
appliesTo: "connect",
|
|
102
|
+
configSchema: sentryConfigSchema,
|
|
103
|
+
hooks: { transformConnectConfig(served) {
|
|
104
|
+
return {
|
|
105
|
+
...served,
|
|
106
|
+
sentry: {
|
|
107
|
+
...served.sentry,
|
|
108
|
+
...config
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
} }
|
|
112
|
+
};
|
|
113
|
+
};
|
|
114
|
+
//#endregion
|
|
115
|
+
//#region src/plugins/ids.ts
|
|
116
|
+
/** The generic shell: Connect's sidebar, home screen and settings tabs. */
|
|
117
|
+
const GENERIC_PLUGIN = "@powerhousedao/connect/plugins/generic";
|
|
118
|
+
//#endregion
|
|
119
|
+
//#region src/plugins/vetra-studio.ts
|
|
120
|
+
const createVetraStudioPlugin = (rawConfig) => {
|
|
121
|
+
parseEntryConfig("@powerhousedao/vetra-studio/connect", vetraStudioConfigSchema, rawConfig);
|
|
122
|
+
return {
|
|
123
|
+
name: "vetra-studio-connect",
|
|
124
|
+
appliesTo: "connect",
|
|
125
|
+
configSchema: vetraStudioConfigSchema,
|
|
126
|
+
hooks: { transformConnectConfig(served) {
|
|
127
|
+
return {
|
|
128
|
+
...served,
|
|
129
|
+
app: {
|
|
130
|
+
...served.app,
|
|
131
|
+
studioMode: true
|
|
132
|
+
}
|
|
133
|
+
};
|
|
134
|
+
} }
|
|
135
|
+
};
|
|
136
|
+
};
|
|
137
|
+
//#endregion
|
|
138
|
+
//#region src/plugins/workflows.ts
|
|
139
|
+
const LOG = "[connect:plugins:workflows]";
|
|
140
|
+
function withDrive(drives, url, name) {
|
|
141
|
+
const existing = drives ?? [];
|
|
142
|
+
if (existing.some((drive) => "url" in drive && drive.url === url)) return existing;
|
|
143
|
+
return [...existing, {
|
|
144
|
+
url,
|
|
145
|
+
name: name ?? null,
|
|
146
|
+
icon: null
|
|
147
|
+
}];
|
|
148
|
+
}
|
|
149
|
+
const createWorkflowsPlugin = (rawConfig) => {
|
|
150
|
+
const config = parseEntryConfig("@powerhousedao/connect/plugins/workflows", workflowsConnectConfigSchema, rawConfig);
|
|
151
|
+
return {
|
|
152
|
+
name: "connect-workflows",
|
|
153
|
+
appliesTo: "connect",
|
|
154
|
+
configSchema: workflowsConnectConfigSchema,
|
|
155
|
+
hooks: { transformConnectConfig(served) {
|
|
156
|
+
const out = {
|
|
157
|
+
...served,
|
|
158
|
+
app: {
|
|
159
|
+
...served.app,
|
|
160
|
+
workflowsEnabled: true
|
|
161
|
+
}
|
|
162
|
+
};
|
|
163
|
+
const drive = config.drive;
|
|
164
|
+
if (typeof drive === "string") out.drives = {
|
|
165
|
+
...served.drives,
|
|
166
|
+
defaultDrives: withDrive(served.drives?.defaultDrives, drive, config.name)
|
|
167
|
+
};
|
|
168
|
+
else if (drive !== void 0) console.warn(`${LOG} drive is an unresolved output token (${findToken(drive)?.key ?? "unknown"}); no Workflows drive attached.`);
|
|
169
|
+
return out;
|
|
170
|
+
} }
|
|
171
|
+
};
|
|
172
|
+
};
|
|
173
|
+
//#endregion
|
|
174
|
+
//#region src/plugins/index.ts
|
|
175
|
+
const ANALYTICS_CONSENT = { consent: true };
|
|
176
|
+
const driveSectionOff = {
|
|
177
|
+
enabled: false,
|
|
178
|
+
allowAdd: false,
|
|
179
|
+
allowDelete: false
|
|
180
|
+
};
|
|
181
|
+
/** Connect's built-in plugins, by the specifier a composition names. */
|
|
182
|
+
const connectPlugins = {
|
|
183
|
+
[GENERIC_PLUGIN]: {
|
|
184
|
+
create: createGenericPlugin,
|
|
185
|
+
ui: () => import("./ui-BOTsJPoc.js").then((m) => m.default),
|
|
186
|
+
shell: "generic",
|
|
187
|
+
whenAbsent: (config) => ({
|
|
188
|
+
...config,
|
|
189
|
+
drives: {
|
|
190
|
+
...config.drives,
|
|
191
|
+
allowAddDrive: false,
|
|
192
|
+
sections: {
|
|
193
|
+
remote: driveSectionOff,
|
|
194
|
+
local: driveSectionOff
|
|
195
|
+
},
|
|
196
|
+
icons: null
|
|
197
|
+
},
|
|
198
|
+
home: {
|
|
199
|
+
...config.home,
|
|
200
|
+
background: null
|
|
201
|
+
}
|
|
202
|
+
})
|
|
203
|
+
},
|
|
204
|
+
"@powerhousedao/connect/plugins/sentry": {
|
|
205
|
+
create: createSentryPlugin,
|
|
206
|
+
ui: () => Promise.resolve(ANALYTICS_CONSENT),
|
|
207
|
+
whenAbsent: (config) => ({
|
|
208
|
+
...config,
|
|
209
|
+
sentry: {
|
|
210
|
+
...config.sentry,
|
|
211
|
+
dsn: null
|
|
212
|
+
}
|
|
213
|
+
})
|
|
214
|
+
},
|
|
215
|
+
"@powerhousedao/connect/plugins/openpanel": {
|
|
216
|
+
create: createOpenPanelPlugin,
|
|
217
|
+
ui: () => Promise.resolve(ANALYTICS_CONSENT),
|
|
218
|
+
whenAbsent: (config) => ({
|
|
219
|
+
...config,
|
|
220
|
+
openPanel: {
|
|
221
|
+
...config.openPanel,
|
|
222
|
+
clientId: "",
|
|
223
|
+
trackUiEvents: false,
|
|
224
|
+
trackOperations: false
|
|
225
|
+
}
|
|
226
|
+
})
|
|
227
|
+
},
|
|
228
|
+
"@powerhousedao/connect/plugins/assistant": {
|
|
229
|
+
create: createAssistantPlugin,
|
|
230
|
+
whenAbsent: (config) => ({
|
|
231
|
+
...config,
|
|
232
|
+
ai: {
|
|
233
|
+
...config.ai,
|
|
234
|
+
assistantEnabled: false
|
|
235
|
+
}
|
|
236
|
+
})
|
|
237
|
+
},
|
|
238
|
+
"@powerhousedao/connect/plugins/workflows": {
|
|
239
|
+
create: createWorkflowsPlugin,
|
|
240
|
+
whenAbsent: (config) => ({
|
|
241
|
+
...config,
|
|
242
|
+
app: {
|
|
243
|
+
...config.app,
|
|
244
|
+
workflowsEnabled: false
|
|
245
|
+
}
|
|
246
|
+
})
|
|
247
|
+
},
|
|
248
|
+
"@powerhousedao/vetra-studio/connect": {
|
|
249
|
+
create: createVetraStudioPlugin,
|
|
250
|
+
whenAbsent: (config) => ({
|
|
251
|
+
...config,
|
|
252
|
+
app: {
|
|
253
|
+
...config.app,
|
|
254
|
+
studioMode: false
|
|
255
|
+
}
|
|
256
|
+
})
|
|
257
|
+
}
|
|
258
|
+
};
|
|
259
|
+
//#endregion
|
|
260
|
+
export { connectPlugins };
|
|
261
|
+
|
|
262
|
+
//# sourceMappingURL=plugins-CegSox2x.js.map
|
|
263
|
+
//# debugId=5648c876-2263-515c-bec8-707bdf29a87a
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugins-CegSox2x.js","sources":["../src/plugins/entry-config.ts","../src/plugins/assistant.ts","../src/plugins/generic.ts","../src/plugins/openpanel.ts","../src/plugins/sentry.ts","../src/plugins/ids.ts","../src/plugins/vetra-studio.ts","../src/plugins/workflows.ts","../src/plugins/index.ts"],"sourcesContent":["import { PluginError } from \"@powerhousedao/host-core/plugins\";\nimport { z } from \"zod\";\n\n/**\n * Validate a built-in plugin's entry config against its configSchema, the way\n * host-core's resolveHostPlugins does on the server: a failure names the\n * plugin and every offending key instead of surfacing a bare ZodError from\n * the runtime-config load.\n */\nexport function parseEntryConfig<S extends z.ZodType>(\n specifier: string,\n schema: S,\n rawConfig: unknown,\n): z.output<S> {\n const parsed = schema.safeParse(rawConfig);\n if (!parsed.success) {\n throw new PluginError(\n `config for Connect plugin \"${specifier}\" is invalid:\\n` +\n z.prettifyError(parsed.error),\n `Fix the entry's config in the host's runner.plugins.`,\n );\n }\n return parsed.data;\n}\n","import type { PHConnectRuntimeConfig } from \"@powerhousedao/shared/clis\";\nimport type {\n ConnectPlugin,\n ConnectPluginFactory,\n} from \"@powerhousedao/connect-core/plugins\";\nimport { parseEntryConfig } from \"./entry-config.js\";\nimport {\n assistantConfigSchema,\n type AssistantConfigInput,\n} from \"../plugin-configs/assistant.js\";\n\n/**\n * The Connect AI assistant (`@powerhousedao/connect/plugins/assistant`).\n * Presence flips `ai.assistantEnabled` on; absence forces it off. The\n * assistant FAB in app.tsx already renders on `ai.assistantEnabled`, so this\n * plugin's config shuffle is immediately visible in the UI.\n *\n * It takes no entry config: `ai.assistantEnabled` is the only key of the\n * `connect.ai` slice, and presence is that switch. The endpoint and agent are\n * user settings in the browser, not host config.\n */\n\n// Schema and PHPluginConfigs augmentation: ../plugin-configs (zod-only).\nexport { assistantConfigSchema, type AssistantConfigInput };\n\nexport const createAssistantPlugin: ConnectPluginFactory = (rawConfig) => {\n parseEntryConfig(\n \"@powerhousedao/connect/plugins/assistant\",\n assistantConfigSchema,\n rawConfig,\n );\n const plugin: ConnectPlugin = {\n name: \"connect-assistant\",\n appliesTo: \"connect\",\n configSchema: assistantConfigSchema,\n hooks: {\n transformConnectConfig(served: PHConnectRuntimeConfig) {\n return {\n ...served,\n ai: { ...served.ai, assistantEnabled: true },\n };\n },\n },\n };\n return plugin;\n};\n\nexport default createAssistantPlugin;\n","import { DEFAULT_CONNECT_CONFIG } from \"@powerhousedao/shared/connect\";\nimport type {\n PHBackground,\n PHConnectExplorerIcons,\n PHConnectRuntimeConfig,\n} from \"@powerhousedao/shared/clis\";\nimport type {\n ConnectPlugin,\n ConnectPluginFactory,\n} from \"@powerhousedao/connect-core/plugins\";\nimport { parseEntryConfig } from \"./entry-config.js\";\nimport {\n genericConfigSchema,\n type GenericConfig,\n type GenericConfigInput,\n} from \"../plugin-configs/generic.js\";\n\n/**\n * The generic Connect shell plugin (`@powerhousedao/connect/plugins/generic`).\n *\n * It OWNS the drive-chrome UI toggles — `allowAddDrive` and the per-section\n * `sections.{remote,local}` switches (enabled / allowAdd / allowDelete) —\n * the explorer's `icons` (local/remote drive fallbacks, folder, document and\n * per-type document icons, which override the icons a package ships) and the\n * home screen's `homeBackground` (its layers over a page colour). These\n * describe nothing outside the generic chrome (connect.config.ts reads the\n * toggles to decide whether the add-drive affordance and the drive sections\n * render; the explorer components read the icons; the home screen is the\n * chrome's landing page), so under uniform runners they are configured HERE,\n * through this plugin's entry config, not as free-standing top-level\n * connect.drives / connect.home values:\n *\n * - present + entry provides a value -> that value\n * - present + entry omits it -> inherit DEFAULT_CONNECT_CONFIG\n * - absent from the composition -> zeroed off (see its whenAbsent\n * in ./index.ts — no chrome, no\n * toggles)\n *\n * The top-level served value is deliberately NOT a fallback: ownership means a\n * single source. `branding` is intentionally NOT handled here — it has reach\n * beyond the chrome (e.g. document.title), so it stays a Connect-level config\n * value that survives this plugin's absence.\n *\n * Icons and background images are image refs; a project path in host.js is\n * resolved to a data URI by the Connect build before the composition reaches\n * the browser, a URL or data URI passes through (the only forms for config\n * applied after the build). `null` keeps the built-in icon / gradient.\n */\n\n// Schema and PHPluginConfigs augmentation: ../plugin-configs (zod-only).\nexport { genericConfigSchema, type GenericConfig, type GenericConfigInput };\n\nconst DEFAULT_DRIVES = DEFAULT_CONNECT_CONFIG.drives;\nconst DEFAULT_HOME = DEFAULT_CONNECT_CONFIG.home;\n\nexport const createGenericPlugin: ConnectPluginFactory = (rawConfig) => {\n const config: GenericConfig = parseEntryConfig(\n \"@powerhousedao/connect/plugins/generic\",\n genericConfigSchema,\n rawConfig,\n );\n const plugin: ConnectPlugin = {\n name: \"connect-generic\",\n appliesTo: \"connect\",\n configSchema: genericConfigSchema,\n hooks: {\n transformConnectConfig(served: PHConnectRuntimeConfig) {\n const entrySections = config.sections ?? {};\n return {\n ...served,\n drives: {\n ...served.drives,\n // Owned: entry value, else the single-source default — never the\n // served top-level value.\n allowAddDrive:\n config.allowAddDrive ?? DEFAULT_DRIVES?.allowAddDrive,\n sections: {\n remote: {\n ...DEFAULT_DRIVES?.sections?.remote,\n ...entrySections.remote,\n },\n local: {\n ...DEFAULT_DRIVES?.sections?.local,\n ...entrySections.local,\n },\n },\n // Owned: the entry's icons (already resolved by the build), else\n // the default — the built-in icons.\n icons: (config.icons ?? null) as PHConnectExplorerIcons | null,\n } as never,\n home: {\n ...served.home,\n // Owned: the entry's background (images resolved by the build),\n // else the default — the bundled gradient.\n background: (config.homeBackground ??\n DEFAULT_HOME?.background ??\n null) as PHBackground | null,\n },\n };\n },\n },\n };\n return plugin;\n};\n\nexport default createGenericPlugin;\n","import type { PHConnectRuntimeConfig } from \"@powerhousedao/shared/clis\";\nimport type {\n ConnectPlugin,\n ConnectPluginFactory,\n} from \"@powerhousedao/connect-core/plugins\";\nimport { parseEntryConfig } from \"./entry-config.js\";\nimport {\n openPanelConfigSchema,\n type OpenPanelConfigInput,\n} from \"../plugin-configs/openpanel.js\";\n\n/**\n * OpenPanel analytics (`@powerhousedao/connect/plugins/openpanel`). Presence\n * is activation: the entry config (clientId, trackUiEvents, trackOperations)\n * merges into the served `openPanel` block; absence clears the clientId and\n * turns tracking off. Config shuffle today; the Analytics/OpenPanel\n * components that consume it already live in the app tree.\n *\n * The entry config IS the `connect.openPanel` slice, so it is typed and\n * validated by that slice's single-source schema (a typo'd key fails).\n */\n\n// Schema and PHPluginConfigs augmentation: ../plugin-configs (zod-only).\nexport { openPanelConfigSchema, type OpenPanelConfigInput };\n\nexport const createOpenPanelPlugin: ConnectPluginFactory = (rawConfig) => {\n const config = parseEntryConfig(\n \"@powerhousedao/connect/plugins/openpanel\",\n openPanelConfigSchema,\n rawConfig,\n );\n const plugin: ConnectPlugin = {\n name: \"connect-openpanel\",\n appliesTo: \"connect\",\n configSchema: openPanelConfigSchema,\n hooks: {\n transformConnectConfig(served: PHConnectRuntimeConfig) {\n return {\n ...served,\n openPanel: { ...served.openPanel, ...config } as never,\n };\n },\n },\n };\n return plugin;\n};\n\nexport default createOpenPanelPlugin;\n","import type { PHConnectRuntimeConfig } from \"@powerhousedao/shared/clis\";\nimport type {\n ConnectPlugin,\n ConnectPluginFactory,\n} from \"@powerhousedao/connect-core/plugins\";\nimport { parseEntryConfig } from \"./entry-config.js\";\nimport {\n sentryConfigSchema,\n type SentryConfigInput,\n} from \"../plugin-configs/sentry.js\";\n\n/**\n * Sentry error reporting (`@powerhousedao/connect/plugins/sentry`). Presence\n * is activation: listing it merges the entry config (dsn, env, tracing) into\n * the served `sentry` block; omitting it nulls the dsn (see the absence\n * zeroing in plugin-host). A thin config shuffle today — the SentryProvider\n * that reads this slice already exists in the app.\n *\n * The entry config IS the `connect.sentry` slice, so it is typed and\n * validated by that slice's single-source schema (a typo'd key fails).\n */\n\n// Schema and PHPluginConfigs augmentation: ../plugin-configs (zod-only).\nexport { sentryConfigSchema, type SentryConfigInput };\n\nexport const createSentryPlugin: ConnectPluginFactory = (rawConfig) => {\n const config = parseEntryConfig(\n \"@powerhousedao/connect/plugins/sentry\",\n sentryConfigSchema,\n rawConfig,\n );\n const plugin: ConnectPlugin = {\n name: \"connect-sentry\",\n appliesTo: \"connect\",\n configSchema: sentryConfigSchema,\n hooks: {\n transformConnectConfig(served: PHConnectRuntimeConfig) {\n return {\n ...served,\n sentry: { ...served.sentry, ...config } as never,\n };\n },\n },\n };\n return plugin;\n};\n\nexport default createSentryPlugin;\n","/** The generic shell: Connect's sidebar, home screen and settings tabs. */\nexport const GENERIC_PLUGIN = \"@powerhousedao/connect/plugins/generic\";\n","import type { PHConnectRuntimeConfig } from \"@powerhousedao/shared/clis\";\nimport type {\n ConnectPlugin,\n ConnectPluginFactory,\n} from \"@powerhousedao/connect-core/plugins\";\nimport { parseEntryConfig } from \"./entry-config.js\";\nimport {\n vetraStudioConfigSchema,\n type VetraStudioConfigInput,\n} from \"../plugin-configs/vetra-studio.js\";\n\n/**\n * Vetra Studio, browser side (`@powerhousedao/vetra-studio/connect`). Its\n * presence turns Connect's studio mode on; the classic `app.studioMode`\n * consumer paths run unchanged, and absence forces studio off (the zeroing in\n * plugin-host). Lives here, in Connect's own source, because the studio-mode\n * behaviour is Connect browser behaviour — the published vetra-studio/connect\n * module is only the server-resolvable identity of the same plugin.\n *\n * It takes no entry config: presence is the switch, and the rest of the\n * `connect.app` slice is Connect-level config, not this plugin's.\n */\n\n// Schema and PHPluginConfigs augmentation: ../plugin-configs (zod-only).\nexport { vetraStudioConfigSchema, type VetraStudioConfigInput };\n\nexport const createVetraStudioPlugin: ConnectPluginFactory = (rawConfig) => {\n parseEntryConfig(\n \"@powerhousedao/vetra-studio/connect\",\n vetraStudioConfigSchema,\n rawConfig,\n );\n const plugin: ConnectPlugin = {\n name: \"vetra-studio-connect\",\n appliesTo: \"connect\",\n configSchema: vetraStudioConfigSchema,\n hooks: {\n transformConnectConfig(served: PHConnectRuntimeConfig) {\n return {\n ...served,\n app: { ...served.app, studioMode: true },\n };\n },\n },\n };\n return plugin;\n};\n\nexport default createVetraStudioPlugin;\n","import { findToken } from \"@powerhousedao/host-core/schema\";\nimport type {\n PHConnectDefaultDrive,\n PHConnectRuntimeConfig,\n} from \"@powerhousedao/shared/clis\";\nimport type {\n ConnectPlugin,\n ConnectPluginFactory,\n} from \"@powerhousedao/connect-core/plugins\";\nimport { parseEntryConfig } from \"./entry-config.js\";\nimport {\n workflowsConnectConfigSchema,\n type WorkflowsConnectConfig,\n type WorkflowsConnectConfigInput,\n} from \"../plugin-configs/workflows.js\";\n\n/**\n * The workflows plugin, browser side (`@powerhousedao/connect/plugins/\n * workflows`) — the Connect half of the link whose server half is\n * `@powerhousedao/switchboard/plugins/workflows` (workflow-plugins plan).\n *\n * Presence is activation: listed, Connect loads the workflow package (so\n * Workflow Studio, the drive app the Workflows drive names as its preferred\n * editor, exists) and attaches the configured drive as a remote default\n * drive. Absent from a declared composition, `app.workflowsEnabled` is zeroed\n * (its whenAbsent in ./index.ts) — the classic `workflows.enabled` /\n * `connect.app.workflowsEnabled` values stop being the switch.\n *\n * `drive` is the switchboard's drive URL (`http://host:port/d/<slug>`). The\n * drive has to be a REMOTE of the switchboard that runs the workflow runtime:\n * Workflow Studio reaches that runtime through the selected drive's\n * switchboard, so a local copy would render the studio against the wrong\n * endpoint. Host files write it as the output token\n * `switchboard.drives.workflows.url`; `ph run` resolves it (from the\n * compound's live member or the switchboard's run record) before this\n * config reaches the browser.\n */\n\n// Schema and PHPluginConfigs augmentation: ../plugin-configs (zod-only).\nexport {\n workflowsConnectConfigSchema,\n type WorkflowsConnectConfig,\n type WorkflowsConnectConfigInput,\n};\n\nconst LOG = \"[connect:plugins:workflows]\";\n\nfunction withDrive(\n drives: PHConnectDefaultDrive[] | undefined,\n url: string,\n name: string | undefined,\n): PHConnectDefaultDrive[] {\n const existing = drives ?? [];\n if (existing.some((drive) => \"url\" in drive && drive.url === url)) {\n return existing;\n }\n return [...existing, { url, name: name ?? null, icon: null }];\n}\n\nexport const createWorkflowsPlugin: ConnectPluginFactory = (rawConfig) => {\n const config: WorkflowsConnectConfig = parseEntryConfig(\n \"@powerhousedao/connect/plugins/workflows\",\n workflowsConnectConfigSchema,\n rawConfig,\n );\n const plugin: ConnectPlugin = {\n name: \"connect-workflows\",\n appliesTo: \"connect\",\n configSchema: workflowsConnectConfigSchema,\n hooks: {\n transformConnectConfig(served: PHConnectRuntimeConfig) {\n const out: PHConnectRuntimeConfig = {\n ...served,\n app: { ...served.app, workflowsEnabled: true } as never,\n };\n const drive = config.drive;\n if (typeof drive === \"string\") {\n out.drives = {\n ...served.drives,\n defaultDrives: withDrive(\n served.drives?.defaultDrives,\n drive,\n config.name,\n ),\n } as never;\n } else if (drive !== undefined) {\n console.warn(\n `${LOG} drive is an unresolved output token (${findToken(drive)?.key ?? \"unknown\"}); no Workflows drive attached.`,\n );\n }\n return out;\n },\n },\n };\n return plugin;\n};\n\nexport default createWorkflowsPlugin;\n","import type { ConnectPluginDefinition } from \"@powerhousedao/connect-core/plugins\";\nimport createAssistantPlugin from \"./assistant.js\";\nimport createGenericPlugin from \"./generic.js\";\nimport createOpenPanelPlugin from \"./openpanel.js\";\nimport createSentryPlugin from \"./sentry.js\";\nimport { GENERIC_PLUGIN } from \"./ids.js\";\nimport createVetraStudioPlugin from \"./vetra-studio.js\";\nimport createWorkflowsPlugin from \"./workflows.js\";\n\nexport { GENERIC_PLUGIN };\n\n// Sentry and OpenPanel start only once the viewer accepts analytics cookies.\nconst ANALYTICS_CONSENT = { consent: true };\n\n// Each built-in zeroes the config slice it owns when a composition leaves it out.\nconst driveSectionOff = { enabled: false, allowAdd: false, allowDelete: false };\n\n/** Connect's built-in plugins, by the specifier a composition names. */\nexport const connectPlugins: Record<string, ConnectPluginDefinition> = {\n [GENERIC_PLUGIN]: {\n create: createGenericPlugin,\n ui: () => import(\"../generic/ui.js\").then((m) => m.default),\n shell: \"generic\",\n // The drive-chrome toggles, explorer icons and home screen go: no\n // add-drive affordance, the sections off, built-in icons, no home\n // background. Branding is not zeroed: it is Connect-level and outlives\n // the plugin.\n whenAbsent: (config) => ({\n ...config,\n drives: {\n ...config.drives,\n allowAddDrive: false,\n sections: { remote: driveSectionOff, local: driveSectionOff },\n icons: null,\n } as never,\n home: { ...config.home, background: null } as never,\n }),\n },\n \"@powerhousedao/connect/plugins/sentry\": {\n create: createSentryPlugin,\n ui: () => Promise.resolve(ANALYTICS_CONSENT),\n whenAbsent: (config) => ({\n ...config,\n sentry: { ...config.sentry, dsn: null } as never,\n }),\n },\n \"@powerhousedao/connect/plugins/openpanel\": {\n create: createOpenPanelPlugin,\n ui: () => Promise.resolve(ANALYTICS_CONSENT),\n whenAbsent: (config) => ({\n ...config,\n openPanel: {\n ...config.openPanel,\n clientId: \"\",\n trackUiEvents: false,\n trackOperations: false,\n } as never,\n }),\n },\n \"@powerhousedao/connect/plugins/assistant\": {\n create: createAssistantPlugin,\n whenAbsent: (config) => ({\n ...config,\n ai: { ...config.ai, assistantEnabled: false } as never,\n }),\n },\n \"@powerhousedao/connect/plugins/workflows\": {\n create: createWorkflowsPlugin,\n // The workflow package (Workflow Studio) loads only when the plugin is\n // composed in; the classic workflows.enabled value is not the switch.\n whenAbsent: (config) => ({\n ...config,\n app: { ...config.app, workflowsEnabled: false } as never,\n }),\n },\n \"@powerhousedao/vetra-studio/connect\": {\n create: createVetraStudioPlugin,\n whenAbsent: (config) => ({\n ...config,\n app: { ...config.app, studioMode: false } as never,\n }),\n },\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;AASA,SAAgB,iBACd,WACA,QACA,WACa;CACb,MAAM,SAAS,OAAO,UAAU,SAAS;CACzC,IAAI,CAAC,OAAO,SACV,MAAM,IAAI,YACR,8BAA8B,UAAU,mBACtC,EAAE,cAAc,OAAO,KAAK,GAC9B,sDACF;CAEF,OAAO,OAAO;AAChB;;;ACEA,MAAa,yBAA+C,cAAc;CACxE,iBACE,4CACA,uBACA,SACF;CAcA,OAAO;EAZL,MAAM;EACN,WAAW;EACX,cAAc;EACd,OAAO,EACL,uBAAuB,QAAgC;GACrD,OAAO;IACL,GAAG;IACH,IAAI;KAAE,GAAG,OAAO;KAAI,kBAAkB;IAAK;GAC7C;EACF,EACF;CAEU;AACd;;;ACOA,MAAM,iBAAiB,uBAAuB;AAC9C,MAAM,eAAe,uBAAuB;AAE5C,MAAa,uBAA6C,cAAc;CACtE,MAAM,SAAwB,iBAC5B,0CACA,qBACA,SACF;CA0CA,OAAO;EAxCL,MAAM;EACN,WAAW;EACX,cAAc;EACd,OAAO,EACL,uBAAuB,QAAgC;GACrD,MAAM,gBAAgB,OAAO,YAAY,CAAC;GAC1C,OAAO;IACL,GAAG;IACH,QAAQ;KACN,GAAG,OAAO;KAGV,eACE,OAAO,iBAAiB,gBAAgB;KAC1C,UAAU;MACR,QAAQ;OACN,GAAG,gBAAgB,UAAU;OAC7B,GAAG,cAAc;MACnB;MACA,OAAO;OACL,GAAG,gBAAgB,UAAU;OAC7B,GAAG,cAAc;MACnB;KACF;KAGA,OAAQ,OAAO,SAAS;IAC1B;IACA,MAAM;KACJ,GAAG,OAAO;KAGV,YAAa,OAAO,kBAClB,cAAc,cACd;IACJ;GACF;EACF,EACF;CAEU;AACd;;;AC9EA,MAAa,yBAA+C,cAAc;CACxE,MAAM,SAAS,iBACb,4CACA,uBACA,SACF;CAcA,OAAO;EAZL,MAAM;EACN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AAO;IAAK,YAAY;GAAM;EAC1C;CACF;AACF","debug_id":"5648c876-2263-515c-bec8-707bdf29a87a"}
|
package/dist/prerender.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="3b737e74-4acc-5d8c-af38-4a5b47101359")}catch(e){}}();
|
|
3
3
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
4
|
import { primeRuntimeConfig } from "@powerhousedao/connect-core/runtime-config";
|
|
5
5
|
import { PHStoreProvider, createPHStore } from "@powerhousedao/reactor-browser";
|
|
@@ -89,6 +89,7 @@ function ShellLoader() {
|
|
|
89
89
|
"aria-label": "Starting Connect",
|
|
90
90
|
className: `${SHELL_LOADER_CLASS} pointer-events-none fixed inset-0 z-10 flex items-center justify-center`,
|
|
91
91
|
children: /* @__PURE__ */ jsx("div", {
|
|
92
|
+
"data-ph-loader-slot": "",
|
|
92
93
|
className: "animate-pulse rounded-full bg-background p-4 text-foreground shadow-lg motion-reduce:animate-none",
|
|
93
94
|
children: /* @__PURE__ */ jsx(Icon, {
|
|
94
95
|
name: "ConnectSmall",
|
|
@@ -102,7 +103,10 @@ function CoreShellLoader() {
|
|
|
102
103
|
role: "status",
|
|
103
104
|
"aria-label": "Starting",
|
|
104
105
|
className: `${SHELL_LOADER_CLASS} pointer-events-none fixed inset-0 z-10 flex items-center justify-center`,
|
|
105
|
-
children: /* @__PURE__ */ jsx("div", {
|
|
106
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
107
|
+
"data-ph-loader-slot": "",
|
|
108
|
+
className: "size-5 animate-spin rounded-full border-2 border-core-border border-t-core-muted motion-reduce:animate-none"
|
|
109
|
+
})
|
|
106
110
|
});
|
|
107
111
|
}
|
|
108
112
|
//#endregion
|
|
@@ -116,7 +120,7 @@ async function loadDefaultConfig(variant) {
|
|
|
116
120
|
const plugin = (await shellPlugins())[variant];
|
|
117
121
|
await loadConnectPluginUi(plugin ? [{ module: plugin }] : []);
|
|
118
122
|
}
|
|
119
|
-
const connectPlugins = () => import("./plugins-
|
|
123
|
+
const connectPlugins = () => import("./plugins-CegSox2x.js").then((m) => m.connectPlugins);
|
|
120
124
|
/** Each prerendered shell's plugin, whose presence in a composition picks it; core's has none. */
|
|
121
125
|
async function shellPlugins() {
|
|
122
126
|
return Object.fromEntries(Object.entries(await connectPlugins()).flatMap(([module, definition]) => definition.shell ? [[definition.shell, module]] : []));
|
|
@@ -127,7 +131,7 @@ async function renderShell(variant = "generic", kind = variant) {
|
|
|
127
131
|
await loadDefaultConfig(variant);
|
|
128
132
|
const [{ routeTree }, { RouterChrome }, routerModule] = await Promise.all([
|
|
129
133
|
import("@powerhousedao/connect/route-tree"),
|
|
130
|
-
import("./route-views-
|
|
134
|
+
import("./route-views-D_873yb_.js"),
|
|
131
135
|
import("@powerhousedao/connect-core/router")
|
|
132
136
|
]);
|
|
133
137
|
const store = createPHStore();
|
|
@@ -174,4 +178,4 @@ async function renderProjectShells(stylesheet, css) {
|
|
|
174
178
|
export { APP_NAME_TOKEN, appShell, renderProjectShells, renderShell, shellCss, shellMarkup, shellPlugins };
|
|
175
179
|
|
|
176
180
|
//# sourceMappingURL=prerender.js.map
|
|
177
|
-
//# debugId=
|
|
181
|
+
//# debugId=3b737e74-4acc-5d8c-af38-4a5b47101359
|
package/dist/prerender.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prerender.js","sources":["../src/prerender/app-shell.ts","../src/prerender/shell-css.ts","../src/prerender/shell-loader.tsx","../src/prerender/shell.tsx"],"sourcesContent":["// Turns a rendered shell into what index.html carries: #root's markup and <head>'s CSS.\n\n/** The marker boot.tsx and the project build look for. */\nexport const SHELL_MARKER = \"data-ph-shell\";\n\n/** `generic`: Connect's chrome. `core`: core's views. `project`: a project's routes. */\nexport type AppShellKind = \"generic\" | \"core\" | \"project\";\n\n/** Rendered where the app's name goes. */\nexport const APP_NAME_TOKEN = \"__PH_SHELL_APP_NAME__\";\n\n// The app's name, delimited for the project build to fill in; the default is core's own.\n// Keep in sync with builder-tools' app-shell.ts.\nconst APP_NAME_REGION =\n \"<!--ph-shell:app-name-->Connect<!--/ph-shell:app-name-->\";\n\n// Before first paint: no sidebar in an embed, and the home view hidden off the home path.\nconst GUARD_SCRIPT =\n `(function(){try{var h=document.documentElement;` +\n `var e=new URLSearchParams(location.search).get('embed');` +\n `if(e!==null&&e!=='0'&&e!=='false')h.classList.add('ph-shell-embed');` +\n `var p=location.pathname;` +\n `if(!/\\\\/$/.test(p)||/\\\\/d\\\\//.test(p))h.classList.add('ph-shell-route')` +\n `}catch(x){}})();`;\n\n// The shell renders `/`: off it, its links mark no current page until the app routes.\nconst CURRENT_GUARD_SCRIPT =\n `(function(){if(!document.documentElement.classList.contains('ph-shell-route'))return;` +\n `document.querySelectorAll('[${SHELL_MARKER}] [aria-current]').forEach(function(e){` +\n `e.removeAttribute('aria-current');e.classList.remove('active')})})();`;\n\n// The loader fades in late so fast loads never show it; --ph-shell-t (set when\n// React re-renders the shell) keeps both animations on the navigation's clock.\nconst LOADER_CSS =\n `@keyframes ph-shell-loader-in{from{opacity:0}to{opacity:1}}` +\n `.ph-shell-loader{animation:ph-shell-loader-in .2s ease-in both;animation-delay:calc(.25s + var(--ph-shell-t,0ms))}` +\n `.ph-shell-loader>*{animation-delay:var(--ph-shell-t,0ms)}`;\n\n// The shell renders `/`: off the home path its content view hides until the app routes.\nconst ROUTE_GUARD = `.ph-shell-route [${SHELL_MARKER}] #content-view{visibility:hidden}`;\n\n// Core's header goes in an embed, and its static theme toggle shows the wrong glyph in one theme.\nconst GUARD_CSS: Record<AppShellKind, string> = {\n generic:\n `.ph-shell-embed [${SHELL_MARKER}] #sidebar{display:none}` +\n ROUTE_GUARD +\n LOADER_CSS,\n core:\n `.ph-shell-embed [${SHELL_MARKER}] header{display:none}` +\n `[${SHELL_MARKER}] header button{visibility:hidden}` +\n LOADER_CSS,\n project: ROUTE_GUARD + LOADER_CSS,\n};\n\n// Data-URI images (the login button's PNGs) weigh more than the rest of the\n// shell; a box of their size keeps the layout.\nfunction replaceInlineImages(html: string) {\n return html.replace(/<img\\b[^>]*\\bsrc=\"data:[^\"]*\"[^>]*>/g, (img) => {\n const attr = (name: string) =>\n new RegExp(`\\\\b${name}=\"([^\"]*)\"`).exec(img)?.[1];\n // A hidden variant (e.g. the hover image) needs no box.\n if (/(^| )hidden( |$)/.test(attr(\"class\") ?? \"\")) return \"\";\n const width = attr(\"width\");\n const height = attr(\"height\");\n const size = `${width ? `width:${width}px;` : \"\"}${height ? `height:${height}px;` : \"\"}`;\n return `<span style=\"display:inline-block;${size}\"></span>`;\n });\n}\n\n/** The rendered shell as #root's static markup: no scripts or title, images as\n * boxes, the app's name delimited. */\nexport function shellMarkup(rendered: string) {\n // The router's scroll restoration script is for hydration, and the page keeps\n // its own title until the app's routes set one.\n return replaceInlineImages(\n rendered\n .replace(/<script\\b[^>]*>[\\s\\S]*?<\\/script>/g, \"\")\n .replace(/<title\\b[^>]*>[\\s\\S]*?<\\/title>/g, \"\"),\n ).replaceAll(APP_NAME_TOKEN, APP_NAME_REGION);\n}\n\n/** #root's markup and <head>'s critical CSS (`css`, see shellCss) and guard.\n * `variant` names it for a server that swaps it. */\nexport function appShell(\n kind: AppShellKind,\n variant: \"generic\" | \"core\",\n markup: string,\n css: string,\n) {\n const guard = GUARD_CSS[kind];\n const marker = `${SHELL_MARKER}=\"${variant}\"`;\n return {\n // Inert: clicks and focus wait for the app; a static shell does nothing with them.\n body:\n `<div ${marker} inert style=\"display:contents\">${markup}</div>` +\n `<script ${marker}>${CURRENT_GUARD_SCRIPT}</script>`,\n head:\n `<style ${marker}>${css}${guard}</style>` +\n `<script ${marker}>${GUARD_SCRIPT}</script>`,\n };\n}\n","// The loading screen's CSS: Tailwind builds a stylesheet for just the classes its markup uses.\nimport { compile, optimize } from \"@tailwindcss/node\";\nimport { mkdtempSync, readFileSync, writeFileSync } from \"node:fs\";\nimport { tmpdir } from \"node:os\";\nimport { dirname, join } from \"node:path\";\n\nlet emptyFile: string | undefined;\nconst empty = () => {\n if (!emptyFile) {\n emptyFile = join(mkdtempSync(join(tmpdir(), \"ph-shell-\")), \"empty.css\");\n writeFileSync(emptyFile, \"\");\n }\n return emptyFile;\n};\n\n// Plain third-party CSS stays out: a vendor.css, or another package's stylesheet.\nconst isVendor = (id: string) =>\n id.endsWith(\"/vendor.css\") ||\n !(\n id.startsWith(\".\") ||\n id.startsWith(\"/\") ||\n id.startsWith(\"tailwindcss\") ||\n id.startsWith(\"@powerhousedao/\")\n );\n\nconst CLASS_ATTRIBUTE = /\\sclass=\"([^\"]*)\"/g;\n\n/** `entry`, a Tailwind stylesheet (its text `css` when given), built for the\n * classes in `markup` only: its tokens, reset and rules, without third-party CSS. */\nexport async function shellCss(\n entry: string,\n markup: string,\n css = readFileSync(entry, \"utf8\"),\n) {\n const compiler = await compile(css, {\n base: dirname(entry),\n from: entry,\n onDependency: () => {},\n customCssResolver: (id) =>\n Promise.resolve(isVendor(id) ? empty() : undefined),\n });\n const classes = new Set(\n [...markup.matchAll(CLASS_ATTRIBUTE)].flatMap((m) => m[1].split(/\\s+/)),\n );\n const built = compiler.build([...classes].filter(Boolean));\n return optimize(built, { file: entry, minify: true }).code;\n}\n","import { Icon } from \"@powerhousedao/design-system\";\n\n/** Class of the shell's loader; scripts/prerender-shell.ts fades it in. */\nexport const SHELL_LOADER_CLASS = \"ph-shell-loader\";\n\n// The static shell's \"starting\" state: a pulsing Powerhouse logo, CSS only.\nexport function ShellLoader() {\n return (\n <div\n role=\"status\"\n aria-label=\"Starting Connect\"\n className={`${SHELL_LOADER_CLASS} pointer-events-none fixed inset-0 z-10 flex items-center justify-center`}\n >\n <div className=\"animate-pulse rounded-full bg-background p-4 text-foreground shadow-lg motion-reduce:animate-none\">\n <Icon name=\"ConnectSmall\" size={40} />\n </div>\n </div>\n );\n}\n\n// Core's \"starting\" state: a small neutral spinner, no logo.\nexport function CoreShellLoader() {\n return (\n <div\n role=\"status\"\n aria-label=\"Starting\"\n className={`${SHELL_LOADER_CLASS} pointer-events-none fixed inset-0 z-10 flex items-center justify-center`}\n >\n <div className=\"size-5 animate-spin rounded-full border-2 border-core-border border-t-core-muted motion-reduce:animate-none\" />\n </div>\n );\n}\n","// Renders the app shell at `/` before the reactor is up; `pnpm build` writes it to dist/shell.html.\nimport { createPHStore, PHStoreProvider } from \"@powerhousedao/reactor-browser\";\nimport type { AnyRoute } from \"@tanstack/react-router\";\nimport { createMemoryHistory, RouterProvider } from \"@tanstack/react-router\";\nimport { prerender } from \"react-dom/static\";\nimport {\n getConnectPluginUi,\n loadConnectPluginUi,\n registerConnectPlugins,\n resetConnectPluginUi,\n} from \"@powerhousedao/connect-core/plugins\";\nimport { primeRuntimeConfig } from \"@powerhousedao/connect-core/runtime-config\";\nimport type { RuntimePowerhouseConfig } from \"@powerhousedao/shared/connect\";\nimport { DEFAULT_CONNECT_CONFIG } from \"@powerhousedao/shared/connect\";\nimport type { AppShellKind } from \"./app-shell.js\";\nimport { APP_NAME_TOKEN, appShell, shellMarkup } from \"./app-shell.js\";\nimport { shellCss } from \"./shell-css.js\";\nimport { CoreShellLoader, ShellLoader } from \"./shell-loader.js\";\n\nexport { appShell, shellCss, shellMarkup };\nexport type { AppShellKind };\n\nasync function loadDefaultConfig(variant: ShellVariant) {\n // The config file is read at runtime; the shell renders Connect's defaults.\n // Not through the config loader: its cache is the realm's, so a dev server's\n // next render would read the variant primed last.\n primeRuntimeConfig({\n connect: {\n ...DEFAULT_CONNECT_CONFIG,\n // Core's shell is the one for a composition without a plugin that has a shell.\n composition: variant === \"core\" ? [] : undefined,\n },\n } as RuntimePowerhouseConfig);\n registerConnectPlugins(connectPlugins);\n const plugin = (await shellPlugins())[variant];\n await loadConnectPluginUi(plugin ? [{ module: plugin }] : []);\n}\n\nconst connectPlugins = () =>\n import(\"../plugins/index.js\").then((m) => m.connectPlugins);\n\n/** Each prerendered shell's plugin, whose presence in a composition picks it; core's has none. */\nexport async function shellPlugins(): Promise<\n Partial<Record<ShellVariant, string>>\n> {\n return Object.fromEntries(\n Object.entries(await connectPlugins()).flatMap(([module, definition]) =>\n definition.shell ? [[definition.shell, module]] : [],\n ),\n );\n}\n\n/** `generic`: Connect's chrome. `core`: core's views, for a composition without the generic plugin. */\nexport type ShellVariant = \"generic\" | \"core\";\n\nexport { APP_NAME_TOKEN };\n\n/** Renders the route tree at `/` before the reactor is up. `kind` picks the\n * loader: Connect's logo for its chrome, core's spinner otherwise. */\nexport async function renderShell(\n variant: ShellVariant = \"generic\",\n kind: AppShellKind = variant,\n): Promise<string> {\n await loadDefaultConfig(variant);\n // After the config: these modules read it as they evaluate.\n const [{ routeTree }, { RouterChrome }, routerModule] = await Promise.all([\n import(\"@powerhousedao/connect/route-tree\"),\n import(\"../components/route-views.js\"),\n import(\"@powerhousedao/connect-core/router\"),\n ]);\n // No reactor and no drives, as the app is until the reactor is up.\n const store = createPHStore();\n // A server router reuses the tree processed for the last variant; plugins' routes change it.\n delete (globalThis as { __TSR_CACHE__?: unknown }).__TSR_CACHE__;\n const connectRouter = routerModule.createConnectRouter({\n routeTree,\n store,\n history: createMemoryHistory({ initialEntries: [\"/\"] }),\n InnerWrap: RouterChrome,\n // The project's name is only known at its build; scripts/prerender-shell.ts marks this.\n appName: APP_NAME_TOKEN,\n // A project's layout shows its pendingComponent in place of the page.\n shell: kind === \"project\",\n pluginUi: getConnectPluginUi(),\n });\n routerModule.bindConnectRouter(connectRouter, store);\n await connectRouter.router.load();\n // A project layout's own pending view is its loader; core's spinner without one.\n const { appRoute } = routerModule.connectRoutes(routeTree as AnyRoute);\n const layoutPending = appRoute.options.pendingComponent;\n const Loader =\n kind === \"generic\"\n ? ShellLoader\n : kind === \"project\" && layoutPending\n ? () => null\n : CoreShellLoader;\n\n const errors: unknown[] = [];\n const { prelude } = await prerender(\n <PHStoreProvider store={store}>\n <RouterProvider router={connectRouter.router} />\n <Loader />\n </PHStoreProvider>,\n {\n // Inline every boundary; outlined ones need React's runtime to reveal.\n progressiveChunkSize: Number.POSITIVE_INFINITY,\n onError: (error) => {\n errors.push(error);\n },\n },\n );\n // The next variant renders the tree with its own plugins' UI.\n resetConnectPluginUi(routeTree as AnyRoute);\n // A boundary that errored renders its fallback, which is not the shell.\n if (errors.length) {\n throw new AggregateError(errors, \"The app shell failed to prerender\");\n }\n return await new Response(prelude).text();\n}\n\n/** A project's shells, one per variant: its route tree rendered at `/`, with\n * CSS that `stylesheet`, its Tailwind entry (text `css`), builds for the markup's classes. */\nexport async function renderProjectShells(stylesheet: string, css?: string) {\n const shells: Partial<Record<ShellVariant, { body: string; head: string }>> =\n {};\n for (const variant of [\"generic\", \"core\"] as const) {\n const markup = shellMarkup(await renderShell(variant, \"project\"));\n const shellStyles = await shellCss(stylesheet, markup, css);\n shells[variant] = appShell(\"project\", variant, markup, shellStyles);\n }\n return shells;\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAGA,MAAa,eAAe;;AAM5B,MAAa,iBAAiB;AAI9B,MAAM,kBACJ;AAGF,MAAM,eACJ;AAQF,MAAM,uBACJ,oHAC+B,aAAa;AAK9C,MAAM,aACJ;AAKF,MAAM,cAAc,oBAAoB,aAAa;AAGrD,MAAM,YAA0C;CAC9C,SACE,oBAAoB,aAAa,4BACjC,cACA;CACF,MACE,oBAAoB,aAAa,yBAC7B,aAAa;CAEnB,SAAS,cAAc;AACzB;AAIA,SAAS,oBAAoB,MAAc;CACzC,OAAO,KAAK,QAAQ,yCAAyC,QAAQ;EACnE,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AClD,MAAM,SAAS,YAAY,MAAM,YAAY,SAAS,SAAS,CAAC;EAEhE,OAAO,WAAW,SAAS,WAAW,SAAS,QAAQ,MAD7B,SAAS,YAAY,QAAQ,GAAG,CACQ;CACpE;CACA,OAAO;AACT","debug_id":"30ded42a-4e06-5dae-bf27-075af6385f0d"}
|
|
1
|
+
{"version":3,"file":"prerender.js","sources":["../src/prerender/app-shell.ts","../src/prerender/shell-css.ts","../src/prerender/shell-loader.tsx","../src/prerender/shell.tsx"],"sourcesContent":["// Turns a rendered shell into what index.html carries: #root's markup and <head>'s CSS.\n\n/** The marker boot.tsx and the project build look for. */\nexport const SHELL_MARKER = \"data-ph-shell\";\n\n/** `generic`: Connect's chrome. `core`: core's views. `project`: a project's routes. */\nexport type AppShellKind = \"generic\" | \"core\" | \"project\";\n\n/** Rendered where the app's name goes. */\nexport const APP_NAME_TOKEN = \"__PH_SHELL_APP_NAME__\";\n\n// The app's name, delimited for the project build to fill in; the default is core's own.\n// Keep in sync with builder-tools' app-shell.ts.\nconst APP_NAME_REGION =\n \"<!--ph-shell:app-name-->Connect<!--/ph-shell:app-name-->\";\n\n// Before first paint: no sidebar in an embed, and the home view hidden off the home path.\nconst GUARD_SCRIPT =\n `(function(){try{var h=document.documentElement;` +\n `var e=new URLSearchParams(location.search).get('embed');` +\n `if(e!==null&&e!=='0'&&e!=='false')h.classList.add('ph-shell-embed');` +\n `var p=location.pathname;` +\n `if(!/\\\\/$/.test(p)||/\\\\/d\\\\//.test(p))h.classList.add('ph-shell-route')` +\n `}catch(x){}})();`;\n\n// The shell renders `/`: off it, its links mark no current page until the app routes.\nconst CURRENT_GUARD_SCRIPT =\n `(function(){if(!document.documentElement.classList.contains('ph-shell-route'))return;` +\n `document.querySelectorAll('[${SHELL_MARKER}] [aria-current]').forEach(function(e){` +\n `e.removeAttribute('aria-current');e.classList.remove('active')})})();`;\n\n// The loader fades in late so fast loads never show it; --ph-shell-t (set when\n// React re-renders the shell) keeps both animations on the navigation's clock.\nconst LOADER_CSS =\n `@keyframes ph-shell-loader-in{from{opacity:0}to{opacity:1}}` +\n `.ph-shell-loader{animation:ph-shell-loader-in .2s ease-in both;animation-delay:calc(.25s + var(--ph-shell-t,0ms))}` +\n `.ph-shell-loader>*{animation-delay:var(--ph-shell-t,0ms)}`;\n\n// The shell renders `/`: off the home path its content view hides until the app routes.\nconst ROUTE_GUARD = `.ph-shell-route [${SHELL_MARKER}] #content-view{visibility:hidden}`;\n\n// Core's header goes in an embed, and its static theme toggle shows the wrong glyph in one theme.\nconst GUARD_CSS: Record<AppShellKind, string> = {\n generic:\n `.ph-shell-embed [${SHELL_MARKER}] #sidebar{display:none}` +\n ROUTE_GUARD +\n LOADER_CSS,\n core:\n `.ph-shell-embed [${SHELL_MARKER}] header{display:none}` +\n `[${SHELL_MARKER}] header button{visibility:hidden}` +\n LOADER_CSS,\n project: ROUTE_GUARD + LOADER_CSS,\n};\n\n// Data-URI images (the login button's PNGs) weigh more than the rest of the\n// shell; a box of their size keeps the layout.\nfunction replaceInlineImages(html: string) {\n return html.replace(/<img\\b[^>]*\\bsrc=\"data:[^\"]*\"[^>]*>/g, (img) => {\n const attr = (name: string) =>\n new RegExp(`\\\\b${name}=\"([^\"]*)\"`).exec(img)?.[1];\n // A hidden variant (e.g. the hover image) needs no box.\n if (/(^| )hidden( |$)/.test(attr(\"class\") ?? \"\")) return \"\";\n const width = attr(\"width\");\n const height = attr(\"height\");\n const size = `${width ? `width:${width}px;` : \"\"}${height ? `height:${height}px;` : \"\"}`;\n return `<span style=\"display:inline-block;${size}\"></span>`;\n });\n}\n\n/** The rendered shell as #root's static markup: no scripts or title, images as\n * boxes, the app's name delimited. */\nexport function shellMarkup(rendered: string) {\n // The router's scroll restoration script is for hydration, and the page keeps\n // its own title until the app's routes set one.\n return replaceInlineImages(\n rendered\n .replace(/<script\\b[^>]*>[\\s\\S]*?<\\/script>/g, \"\")\n .replace(/<title\\b[^>]*>[\\s\\S]*?<\\/title>/g, \"\"),\n ).replaceAll(APP_NAME_TOKEN, APP_NAME_REGION);\n}\n\n/** #root's markup and <head>'s critical CSS (`css`, see shellCss) and guard.\n * `variant` names it for a server that swaps it. */\nexport function appShell(\n kind: AppShellKind,\n variant: \"generic\" | \"core\",\n markup: string,\n css: string,\n) {\n const guard = GUARD_CSS[kind];\n const marker = `${SHELL_MARKER}=\"${variant}\"`;\n return {\n // Inert: clicks and focus wait for the app; a static shell does nothing with them.\n body:\n `<div ${marker} inert style=\"display:contents\">${markup}</div>` +\n `<script ${marker}>${CURRENT_GUARD_SCRIPT}</script>`,\n head:\n `<style ${marker}>${css}${guard}</style>` +\n `<script ${marker}>${GUARD_SCRIPT}</script>`,\n };\n}\n","// The loading screen's CSS: Tailwind builds a stylesheet for just the classes its markup uses.\nimport { compile, optimize } from \"@tailwindcss/node\";\nimport { mkdtempSync, readFileSync, writeFileSync } from \"node:fs\";\nimport { tmpdir } from \"node:os\";\nimport { dirname, join } from \"node:path\";\n\nlet emptyFile: string | undefined;\nconst empty = () => {\n if (!emptyFile) {\n emptyFile = join(mkdtempSync(join(tmpdir(), \"ph-shell-\")), \"empty.css\");\n writeFileSync(emptyFile, \"\");\n }\n return emptyFile;\n};\n\n// Plain third-party CSS stays out: a vendor.css, or another package's stylesheet.\nconst isVendor = (id: string) =>\n id.endsWith(\"/vendor.css\") ||\n !(\n id.startsWith(\".\") ||\n id.startsWith(\"/\") ||\n id.startsWith(\"tailwindcss\") ||\n id.startsWith(\"@powerhousedao/\")\n );\n\nconst CLASS_ATTRIBUTE = /\\sclass=\"([^\"]*)\"/g;\n\n/** `entry`, a Tailwind stylesheet (its text `css` when given), built for the\n * classes in `markup` only: its tokens, reset and rules, without third-party CSS. */\nexport async function shellCss(\n entry: string,\n markup: string,\n css = readFileSync(entry, \"utf8\"),\n) {\n const compiler = await compile(css, {\n base: dirname(entry),\n from: entry,\n onDependency: () => {},\n customCssResolver: (id) =>\n Promise.resolve(isVendor(id) ? empty() : undefined),\n });\n const classes = new Set(\n [...markup.matchAll(CLASS_ATTRIBUTE)].flatMap((m) => m[1].split(/\\s+/)),\n );\n const built = compiler.build([...classes].filter(Boolean));\n return optimize(built, { file: entry, minify: true }).code;\n}\n","import { Icon } from \"@powerhousedao/design-system\";\n\n/** Class of the shell's loader; scripts/prerender-shell.ts fades it in. */\nexport const SHELL_LOADER_CLASS = \"ph-shell-loader\";\n\n// The static shell's \"starting\" state: a pulsing Powerhouse logo, CSS only.\nexport function ShellLoader() {\n return (\n <div\n role=\"status\"\n aria-label=\"Starting Connect\"\n className={`${SHELL_LOADER_CLASS} pointer-events-none fixed inset-0 z-10 flex items-center justify-center`}\n >\n {/* data-ph-loader-slot: a project build swaps this logo for its own\n loader (connect.branding.loader). */}\n <div\n data-ph-loader-slot=\"\"\n className=\"animate-pulse rounded-full bg-background p-4 text-foreground shadow-lg motion-reduce:animate-none\"\n >\n <Icon name=\"ConnectSmall\" size={40} />\n </div>\n </div>\n );\n}\n\n// Core's \"starting\" state: a small neutral spinner, no logo. The project's\n// loader (connect.branding.loader) is Connect-level branding, so a project\n// build swaps the spinner for it here too.\nexport function CoreShellLoader() {\n return (\n <div\n role=\"status\"\n aria-label=\"Starting\"\n className={`${SHELL_LOADER_CLASS} pointer-events-none fixed inset-0 z-10 flex items-center justify-center`}\n >\n <div\n data-ph-loader-slot=\"\"\n className=\"size-5 animate-spin rounded-full border-2 border-core-border border-t-core-muted motion-reduce:animate-none\"\n />\n </div>\n );\n}\n","// Renders the app shell at `/` before the reactor is up; `pnpm build` writes it to dist/shell.html.\nimport { createPHStore, PHStoreProvider } from \"@powerhousedao/reactor-browser\";\nimport type { AnyRoute } from \"@tanstack/react-router\";\nimport { createMemoryHistory, RouterProvider } from \"@tanstack/react-router\";\nimport { prerender } from \"react-dom/static\";\nimport {\n getConnectPluginUi,\n loadConnectPluginUi,\n registerConnectPlugins,\n resetConnectPluginUi,\n} from \"@powerhousedao/connect-core/plugins\";\nimport { primeRuntimeConfig } from \"@powerhousedao/connect-core/runtime-config\";\nimport type { RuntimePowerhouseConfig } from \"@powerhousedao/shared/connect\";\nimport { DEFAULT_CONNECT_CONFIG } from \"@powerhousedao/shared/connect\";\nimport type { AppShellKind } from \"./app-shell.js\";\nimport { APP_NAME_TOKEN, appShell, shellMarkup } from \"./app-shell.js\";\nimport { shellCss } from \"./shell-css.js\";\nimport { CoreShellLoader, ShellLoader } from \"./shell-loader.js\";\n\nexport { appShell, shellCss, shellMarkup };\nexport type { AppShellKind };\n\nasync function loadDefaultConfig(variant: ShellVariant) {\n // The config file is read at runtime; the shell renders Connect's defaults.\n // Not through the config loader: its cache is the realm's, so a dev server's\n // next render would read the variant primed last.\n primeRuntimeConfig({\n connect: {\n ...DEFAULT_CONNECT_CONFIG,\n // Core's shell is the one for a composition without a plugin that has a shell.\n composition: variant === \"core\" ? [] : undefined,\n },\n } as RuntimePowerhouseConfig);\n registerConnectPlugins(connectPlugins);\n const plugin = (await shellPlugins())[variant];\n await loadConnectPluginUi(plugin ? [{ module: plugin }] : []);\n}\n\nconst connectPlugins = () =>\n import(\"../plugins/index.js\").then((m) => m.connectPlugins);\n\n/** Each prerendered shell's plugin, whose presence in a composition picks it; core's has none. */\nexport async function shellPlugins(): Promise<\n Partial<Record<ShellVariant, string>>\n> {\n return Object.fromEntries(\n Object.entries(await connectPlugins()).flatMap(([module, definition]) =>\n definition.shell ? [[definition.shell, module]] : [],\n ),\n );\n}\n\n/** `generic`: Connect's chrome. `core`: core's views, for a composition without the generic plugin. */\nexport type ShellVariant = \"generic\" | \"core\";\n\nexport { APP_NAME_TOKEN };\n\n/** Renders the route tree at `/` before the reactor is up. `kind` picks the\n * loader: Connect's logo for its chrome, core's spinner otherwise. */\nexport async function renderShell(\n variant: ShellVariant = \"generic\",\n kind: AppShellKind = variant,\n): Promise<string> {\n await loadDefaultConfig(variant);\n // After the config: these modules read it as they evaluate.\n const [{ routeTree }, { RouterChrome }, routerModule] = await Promise.all([\n import(\"@powerhousedao/connect/route-tree\"),\n import(\"../components/route-views.js\"),\n import(\"@powerhousedao/connect-core/router\"),\n ]);\n // No reactor and no drives, as the app is until the reactor is up.\n const store = createPHStore();\n // A server router reuses the tree processed for the last variant; plugins' routes change it.\n delete (globalThis as { __TSR_CACHE__?: unknown }).__TSR_CACHE__;\n const connectRouter = routerModule.createConnectRouter({\n routeTree,\n store,\n history: createMemoryHistory({ initialEntries: [\"/\"] }),\n InnerWrap: RouterChrome,\n // The project's name is only known at its build; scripts/prerender-shell.ts marks this.\n appName: APP_NAME_TOKEN,\n // A project's layout shows its pendingComponent in place of the page.\n shell: kind === \"project\",\n pluginUi: getConnectPluginUi(),\n });\n routerModule.bindConnectRouter(connectRouter, store);\n await connectRouter.router.load();\n // A project layout's own pending view is its loader; core's spinner without one.\n const { appRoute } = routerModule.connectRoutes(routeTree as AnyRoute);\n const layoutPending = appRoute.options.pendingComponent;\n const Loader =\n kind === \"generic\"\n ? ShellLoader\n : kind === \"project\" && layoutPending\n ? () => null\n : CoreShellLoader;\n\n const errors: unknown[] = [];\n const { prelude } = await prerender(\n <PHStoreProvider store={store}>\n <RouterProvider router={connectRouter.router} />\n <Loader />\n </PHStoreProvider>,\n {\n // Inline every boundary; outlined ones need React's runtime to reveal.\n progressiveChunkSize: Number.POSITIVE_INFINITY,\n onError: (error) => {\n errors.push(error);\n },\n },\n );\n // The next variant renders the tree with its own plugins' UI.\n resetConnectPluginUi(routeTree as AnyRoute);\n // A boundary that errored renders its fallback, which is not the shell.\n if (errors.length) {\n throw new AggregateError(errors, \"The app shell failed to prerender\");\n }\n return await new Response(prelude).text();\n}\n\n/** A project's shells, one per variant: its route tree rendered at `/`, with\n * CSS that `stylesheet`, its Tailwind entry (text `css`), builds for the markup's classes. */\nexport async function renderProjectShells(stylesheet: string, css?: string) {\n const shells: Partial<Record<ShellVariant, { body: string; head: string }>> =\n {};\n for (const variant of [\"generic\", \"core\"] as const) {\n const markup = shellMarkup(await renderShell(variant, \"project\"));\n const shellStyles = await shellCss(stylesheet, markup, css);\n shells[variant]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;EAAwB;EAAxB,UAAA,CACE,oBAAC,gBAAD,EAAgB,QAAQ,cAAc,OAAS,CAAA,GAC/C,oBAAC,QAAD,CAAS,CAAA,CACM;CACjB,CAAA,GAAA;EAEE,sBAAsB,OAAO;EAC7B,UAAU,UAAU;GAClB,OAAO,KAAK,KAAK;EACnB;CACF,CACF;CAEA,qBAAqB,SAAqB;CAE1C,IAAI,OAAO,QACT,MAAM,IAAI,eAAe,QAAQ,mCAAmC;CAEtE,OAAO,MAAM,IAAI,SAAS,OAAO,CAAC,CAAC,KAAK;AAC1C;;;AAIA,eAAsB,oBAAoB,YAAoB,KAAc;CAC1E,MAAM,SACJ,CAAC;CACH,KAAK,MAAM,WAAW,CAAC,WAAW,MAAM,GAAY;EAClD,MAAM,SAAS,YAAY,MAAM,YAAY,SAAS,SAAS,CAAC;EAEhE,OAAO,WAAW,SAAS,WAAW,SAAS,QAAQ,MAD7B,SAAS,YAAY,QAAQ,GAAG,CACQ;CACpE;CACA,OAAO;AACT","debug_id":"3b737e74-4acc-5d8c-af38-4a5b47101359"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="4ee48edb-1b05-57c1-bcec-3faf4722f0db")}catch(e){}}();
|
|
3
3
|
import { n as buildPHGlobalConfig, o as phGlobalConfig, r as connectConfig } from "./connect.config-D1pGNmaF.js";
|
|
4
|
-
import { a as isPackagedConnectDist, i as getVersion, n as getGitSha } from "./build-info-
|
|
5
|
-
import { r as getSharedDeps, t as BrowserPackageManager } from "./package-manager-
|
|
4
|
+
import { a as isPackagedConnectDist, i as getVersion, n as getGitSha } from "./build-info-Cn2f6llN.js";
|
|
5
|
+
import { r as getSharedDeps, t as BrowserPackageManager } from "./package-manager-CzBsaUUd.js";
|
|
6
6
|
import { r as toast } from "./toast-C6WW-_O-.js";
|
|
7
7
|
import { a as closeWithin, n as watchStoreLockWait, o as configureConnectChannelScheme, s as createConnectSignerConfig } from "./store-lock-Bi3B9VJD.js";
|
|
8
8
|
import { a as resolvePgMajorForRuntime, f as toStoredDocumentsRefused, r as loadPGliteModule } from "./pglite-major-p4_YefAE.js";
|
|
@@ -1407,5 +1407,5 @@ function getDriveUrl() {
|
|
|
1407
1407
|
//#endregion
|
|
1408
1408
|
export { createReactor as n, clearReactorStorage as t };
|
|
1409
1409
|
|
|
1410
|
-
//# sourceMappingURL=reactor-
|
|
1411
|
-
//# debugId=
|
|
1410
|
+
//# sourceMappingURL=reactor-BGYR1N7Z.js.map
|
|
1411
|
+
//# debugId=4ee48edb-1b05-57c1-bcec-3faf4722f0db
|