@powerhousedao/builder-tools 6.2.3-dev.7 → 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/dist/index.d.mts +656 -670
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +2644 -278
- package/dist/index.mjs.map +1 -1
- package/dist/service-worker/service-worker.ts +23 -23
- package/package.json +14 -11
package/dist/index.d.mts
CHANGED
|
@@ -1,17 +1,103 @@
|
|
|
1
|
-
import { CommonServerOptions, HtmlTagDescriptor, InlineConfig, Plugin } from "vite";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
1
|
+
import { Alias, CommonServerOptions, HtmlTagDescriptor, InlineConfig, Plugin, PluginOption } from "vite";
|
|
2
|
+
import { GeneratorPlugin } from "@tanstack/router-generator";
|
|
3
|
+
import { DYNAMIC_BASE_PLACEHOLDER } from "@powerhousedao/shared/connect";
|
|
4
|
+
import { PHConnectBranding, PHConnectLoader, PHConnectRuntimeConfig, PowerhouseConfig } from "@powerhousedao/shared/clis";
|
|
5
|
+
import { PowerhouseConfig as PowerhouseConfig$1, PowerhousePackage } from "@powerhousedao/config";
|
|
5
6
|
//#region connect-utils/constants.d.ts
|
|
6
|
-
declare const EXTERNAL_PACKAGES_IMPORT = "PH:EXTERNAL_PACKAGES";
|
|
7
|
-
declare const IMPORT_SCRIPT_FILE = "external-packages.js";
|
|
8
|
-
declare const LOCAL_PACKAGE_ID = "ph:local-package";
|
|
9
|
-
declare const PH_DIR_NAME = ".ph";
|
|
7
|
+
export declare const EXTERNAL_PACKAGES_IMPORT = "PH:EXTERNAL_PACKAGES";
|
|
8
|
+
export declare const IMPORT_SCRIPT_FILE = "external-packages.js";
|
|
9
|
+
export declare const LOCAL_PACKAGE_ID = "ph:local-package";
|
|
10
|
+
export declare const PH_DIR_NAME = ".ph";
|
|
11
|
+
//#endregion
|
|
12
|
+
//#region connect-utils/vite-plugins/project-brand.d.ts
|
|
13
|
+
type ProjectAsset = {
|
|
14
|
+
/** Emitted next to index.html under this name. */
|
|
15
|
+
fileName: string;
|
|
16
|
+
/** Absolute source file. */
|
|
17
|
+
file: string;
|
|
18
|
+
contentType: string;
|
|
19
|
+
};
|
|
20
|
+
type ProjectLoader = ProjectAsset & {
|
|
21
|
+
animation: NonNullable<PHConnectLoader["animation"]>;
|
|
22
|
+
size: number;
|
|
23
|
+
};
|
|
24
|
+
//#endregion
|
|
25
|
+
//#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
|
+
/** The shell manifest of the installed Connect, if it ships one. */
|
|
51
|
+
export declare function readShellPlugins(projectRoot: string): ShellPlugins | undefined;
|
|
52
|
+
/** The shell Connect's build prerendered, if the installed Connect ships one. */
|
|
53
|
+
export declare function readAppShell(projectRoot: string, variant?: AppShellVariant): AppShell | undefined;
|
|
54
|
+
/** Every variant the installed Connect ships. */
|
|
55
|
+
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
|
+
export type ConnectAppShellOptions = {
|
|
77
|
+
/** The composition the app boots with; picks the variant. */
|
|
78
|
+
composition?: readonly {
|
|
79
|
+
module: string;
|
|
80
|
+
}[] | null;
|
|
81
|
+
/** The served `connect.branding.appName`. */
|
|
82
|
+
appName?: string;
|
|
83
|
+
/** With the project's routes: the aliases that point Connect at its tree. */
|
|
84
|
+
routeAliases?: Alias[];
|
|
85
|
+
/** The project's routes folder; dev renders the shell again when it changes. */
|
|
86
|
+
routesDir?: string;
|
|
87
|
+
/** The project's loading image, in place of the shell's logo. */
|
|
88
|
+
loader?: ProjectLoader;
|
|
89
|
+
/** The host's stylesheet, which the page's build adds to the project's. */
|
|
90
|
+
hostStylesheet?: string;
|
|
91
|
+
};
|
|
92
|
+
/** Build: the composition's shell in #root and every variant in the dist, from
|
|
93
|
+
* the project's routes when it has them. Dev: the shell from the project's routes
|
|
94
|
+
* when it has them, else core's for a core composition. */
|
|
95
|
+
export declare function connectAppShellPlugin(projectRoot: string, { composition, appName, routeAliases, routesDir, loader, hostStylesheet }?: ConnectAppShellOptions): Plugin;
|
|
10
96
|
//#endregion
|
|
11
97
|
//#region connect-utils/vite-plugins/build-hash.d.ts
|
|
12
98
|
/** Name of the build-identity file emitted into the build output. */
|
|
13
|
-
declare const BUILD_HASH_FILE: "build-hash.json";
|
|
14
|
-
interface BuildHashInput {
|
|
99
|
+
export declare const BUILD_HASH_FILE: "build-hash.json";
|
|
100
|
+
export interface BuildHashInput {
|
|
15
101
|
/** Monorepo workspace git SHA (CI/dev builds); empty outside the monorepo. */
|
|
16
102
|
workspaceGitSha: string;
|
|
17
103
|
/** Monorepo workspace version (CI/dev builds); empty outside it. */
|
|
@@ -38,8 +124,8 @@ interface BuildHashInput {
|
|
|
38
124
|
* (define `PH_CONNECT_BUILD_HASH`) to `build-hash.json`, which the build
|
|
39
125
|
* emits alongside the app and the server must serve no-cache.
|
|
40
126
|
*/
|
|
41
|
-
declare function computeBuildHash(input: BuildHashInput): string;
|
|
42
|
-
declare function buildHashFromBuildOptions(options: {
|
|
127
|
+
export declare function computeBuildHash(input: BuildHashInput): string;
|
|
128
|
+
export declare function buildHashFromBuildOptions(options: {
|
|
43
129
|
dirname: string;
|
|
44
130
|
phConfig: unknown;
|
|
45
131
|
packages: ReadonlyArray<{
|
|
@@ -57,13 +143,173 @@ declare function buildHashFromBuildOptions(options: {
|
|
|
57
143
|
* Build-only: dev (studio) never runs generateBundle, and the SPA check
|
|
58
144
|
* treats a missing file as "nothing to compare" and stays silent.
|
|
59
145
|
*/
|
|
60
|
-
declare function connectBuildHashPlugin(buildHash: string): Plugin;
|
|
146
|
+
export declare function connectBuildHashPlugin(buildHash: string): Plugin;
|
|
147
|
+
//#endregion
|
|
148
|
+
//#region connect-utils/vite-plugins/connect-routes.d.ts
|
|
149
|
+
/** A project's routes for its Connect deployment, beside Connect's own. */
|
|
150
|
+
export declare const HOST_ROUTES_DIR = "hosts/connect/routes";
|
|
151
|
+
/** The generated tree of Connect's and the project's routes. */
|
|
152
|
+
export declare const CONNECT_ROUTES_GEN = ".ph/connect-routes.gen.ts";
|
|
153
|
+
/** Connect's dist imports its route tree by this specifier. */
|
|
154
|
+
export declare const ROUTE_TREE_SPECIFIER = "@powerhousedao/connect/route-tree";
|
|
155
|
+
/** Core's types name the app's tree by this one; both resolve to one tree. */
|
|
156
|
+
export declare const CORE_ROUTE_TREE_SPECIFIER = "@powerhousedao/connect-core/route-tree";
|
|
157
|
+
/** A host's routes folder: `routes` (a host's `runner.routes`), relative to the
|
|
158
|
+
* project, else `hosts/connect/routes/`; undefined if none or `false`. */
|
|
159
|
+
export declare function resolveConnectRoutesDir(projectRoot: string, routes?: string | false): string | undefined;
|
|
160
|
+
/** The tree generated from `routesDir`: `.ph/connect-routes.gen.ts` for
|
|
161
|
+
* `hosts/connect/routes/`, else `.ph/<folder>.gen.ts`. */
|
|
162
|
+
export declare function connectRoutesTreeOf(projectRoot: string, routesDir: string): string;
|
|
163
|
+
/** Connect's pathless sidebar layout; a project's routes in `_app/` render in it. */
|
|
164
|
+
export declare const APP_LAYOUT = "_app";
|
|
165
|
+
/** Whether the project's `_app` replaces Connect's layout (and its chrome). */
|
|
166
|
+
export declare function hasProjectAppLayout(routesDir: string | undefined): boolean;
|
|
167
|
+
export type ConnectRoutes = {
|
|
168
|
+
/** Points Connect at the tree to route with, then at what its route files render. */
|
|
169
|
+
aliases: Alias[];
|
|
170
|
+
/** The router plugin, only when the project has routes. */
|
|
171
|
+
plugins: PluginOption[];
|
|
172
|
+
/** Connect's route files and the project's share one router. */
|
|
173
|
+
dedupe: string[];
|
|
174
|
+
/** Pre-bundled for Connect's route files; see connectRouteFileDeps. */
|
|
175
|
+
include: string[];
|
|
176
|
+
};
|
|
177
|
+
/** Connect's route files: core's routes with Connect's views. */
|
|
178
|
+
export declare function connectRoutesDirOf(connectDir: string): string;
|
|
179
|
+
/** A route file's id below its folder: route groups and `route` files
|
|
180
|
+
* resolved, flat `a.b` names read as folders. */
|
|
181
|
+
export declare function routeIdOf(file: string): string;
|
|
182
|
+
/** Connect's `_app/` route files that a project file at the same id replaces. */
|
|
183
|
+
export declare function overriddenConnectRoutes(connectAppDir: string, projectAppDir: string): Set<string>;
|
|
184
|
+
/** The routes a package offers other Connects, as `ph build` publishes them
|
|
185
|
+
* (`./connect-routes`); generated beside the route tree. */
|
|
186
|
+
export declare const PACKAGE_ROUTES_MODULE = ".ph/connect-routes.package.ts";
|
|
187
|
+
/** The router plugin's config: Connect's root and routes, and the project's. */
|
|
188
|
+
export declare function connectRoutesGeneratorConfig(connectDir: string, projectRoot: string, projectRoutes: string): {
|
|
189
|
+
target: "react" | "solid" | "vue";
|
|
190
|
+
virtualRouteConfig?: string | import("@tanstack/virtual-file-routes").VirtualRootRoute | undefined;
|
|
191
|
+
routeFilePrefix?: string | undefined;
|
|
192
|
+
routeFileIgnorePrefix: string;
|
|
193
|
+
routeFileIgnorePattern?: string | undefined;
|
|
194
|
+
routesDirectory: string;
|
|
195
|
+
quoteStyle: "double" | "single";
|
|
196
|
+
semicolons: boolean;
|
|
197
|
+
disableLogging: boolean;
|
|
198
|
+
routeTreeFileHeader: string[];
|
|
199
|
+
indexToken: string | RegExp | {
|
|
200
|
+
regex: string;
|
|
201
|
+
flags?: string | undefined;
|
|
202
|
+
};
|
|
203
|
+
routeToken: string | RegExp | {
|
|
204
|
+
regex: string;
|
|
205
|
+
flags?: string | undefined;
|
|
206
|
+
};
|
|
207
|
+
pathParamsAllowedCharacters?: ("$" | "&" | "+" | "," | ":" | ";" | "=" | "@")[] | undefined;
|
|
208
|
+
generatedRouteTree: string;
|
|
209
|
+
disableTypes: boolean;
|
|
210
|
+
addExtensions: string | boolean;
|
|
211
|
+
enableRouteTreeFormatting: boolean;
|
|
212
|
+
routeTreeFileFooter?: string[] | (() => Array<string>) | undefined;
|
|
213
|
+
autoCodeSplitting?: boolean | undefined;
|
|
214
|
+
customScaffolding?: {
|
|
215
|
+
routeTemplate?: string | undefined;
|
|
216
|
+
lazyRouteTemplate?: string | undefined;
|
|
217
|
+
} | undefined;
|
|
218
|
+
experimental?: {
|
|
219
|
+
enableCodeSplitting?: boolean | undefined;
|
|
220
|
+
} | undefined;
|
|
221
|
+
plugins?: GeneratorPlugin[] | undefined;
|
|
222
|
+
tmpDir: string;
|
|
223
|
+
importRoutesUsingAbsolutePaths: boolean;
|
|
224
|
+
};
|
|
225
|
+
/** Writes the route tree of Connect's and the project's routes; throws on a
|
|
226
|
+
* collision that is not an override, which the router plugin would only log. */
|
|
227
|
+
export declare function generateConnectRoutes(projectRoot: string, routesDir: string, config?: {
|
|
228
|
+
target: "react" | "solid" | "vue";
|
|
229
|
+
virtualRouteConfig?: string | import("@tanstack/virtual-file-routes").VirtualRootRoute | undefined;
|
|
230
|
+
routeFilePrefix?: string | undefined;
|
|
231
|
+
routeFileIgnorePrefix: string;
|
|
232
|
+
routeFileIgnorePattern?: string | undefined;
|
|
233
|
+
routesDirectory: string;
|
|
234
|
+
quoteStyle: "double" | "single";
|
|
235
|
+
semicolons: boolean;
|
|
236
|
+
disableLogging: boolean;
|
|
237
|
+
routeTreeFileHeader: string[];
|
|
238
|
+
indexToken: string | RegExp | {
|
|
239
|
+
regex: string;
|
|
240
|
+
flags?: string | undefined;
|
|
241
|
+
};
|
|
242
|
+
routeToken: string | RegExp | {
|
|
243
|
+
regex: string;
|
|
244
|
+
flags?: string | undefined;
|
|
245
|
+
};
|
|
246
|
+
pathParamsAllowedCharacters?: ("$" | "&" | "+" | "," | ":" | ";" | "=" | "@")[] | undefined;
|
|
247
|
+
generatedRouteTree: string;
|
|
248
|
+
disableTypes: boolean;
|
|
249
|
+
addExtensions: string | boolean;
|
|
250
|
+
enableRouteTreeFormatting: boolean;
|
|
251
|
+
routeTreeFileFooter?: string[] | (() => Array<string>) | undefined;
|
|
252
|
+
autoCodeSplitting?: boolean | undefined;
|
|
253
|
+
customScaffolding?: {
|
|
254
|
+
routeTemplate?: string | undefined;
|
|
255
|
+
lazyRouteTemplate?: string | undefined;
|
|
256
|
+
} | undefined;
|
|
257
|
+
experimental?: {
|
|
258
|
+
enableCodeSplitting?: boolean | undefined;
|
|
259
|
+
} | undefined;
|
|
260
|
+
plugins?: GeneratorPlugin[] | undefined;
|
|
261
|
+
tmpDir: string;
|
|
262
|
+
importRoutesUsingAbsolutePaths: boolean;
|
|
263
|
+
}): Promise<void>;
|
|
264
|
+
/** Connect's route files, as the generated tree imports them: by Connect's
|
|
265
|
+
* package name, which a project depends on. */
|
|
266
|
+
export declare const CONNECT_ROUTES_SPECIFIER = "@powerhousedao/connect/routes";
|
|
267
|
+
/** Generates the tree when the project has routes, else drops a stale one. */
|
|
268
|
+
export declare function syncConnectRoutes(projectRoot: string, routesDir?: string | undefined): Promise<void>;
|
|
269
|
+
/**
|
|
270
|
+
* The `optimizeDeps.include` entries an installed Connect's route files need.
|
|
271
|
+
*
|
|
272
|
+
* Connect and core ship their route files as `.tsx`, which Vite never
|
|
273
|
+
* pre-bundles, so the dev server serves them as they are. Vite also discovers
|
|
274
|
+
* no dependency for a module inside node_modules, so their bare imports load
|
|
275
|
+
* unbundled too, and the CommonJS packages under the router
|
|
276
|
+
* (use-sync-external-store, safe-stable-stringify) then fail in the browser.
|
|
277
|
+
* Pre-bundling these by Connect's name gives the route files the copies they
|
|
278
|
+
* resolve to; core need not be resolvable from the project. A Connect outside
|
|
279
|
+
* node_modules (the monorepo, a linked checkout) is source to Vite, so its
|
|
280
|
+
* imports are discovered and pre-bundled anyway.
|
|
281
|
+
*/
|
|
282
|
+
export declare function connectRouteFileDeps(connectDir: string): string[];
|
|
283
|
+
/** Mounts a project's routes folder over Connect's routes; without one,
|
|
284
|
+
* Connect keeps its prebuilt tree and no router plugin runs. */
|
|
285
|
+
export declare function connectRoutes(projectRoot: string, routesDir?: string | false | undefined): ConnectRoutes;
|
|
286
|
+
/** One chunk for the router and the project's route configs, which the split
|
|
287
|
+
* route components would otherwise spread over several shared chunks. */
|
|
288
|
+
export declare function connectRouterChunkGroups(routesDir?: string | false): ({
|
|
289
|
+
name: string;
|
|
290
|
+
test: RegExp;
|
|
291
|
+
priority: number;
|
|
292
|
+
} | {
|
|
293
|
+
priority?: undefined;
|
|
294
|
+
name: string;
|
|
295
|
+
test: (id: string) => boolean;
|
|
296
|
+
})[];
|
|
297
|
+
//#endregion
|
|
298
|
+
//#region connect-utils/vite-plugins/host-stylesheet.d.ts
|
|
299
|
+
/** The host's stylesheet, which may not exist yet: `style.css` beside its routes
|
|
300
|
+
* folder, so `hosts/connect/style.css` by default. `ph build` never reads it. */
|
|
301
|
+
export declare function hostStylesheetPath(projectRoot: string, routesDir?: string | false): string;
|
|
302
|
+
/** The project's `style.css` with the host's stylesheet imported last when it
|
|
303
|
+
* exists (else `missing`), so the host's theme wins in the page's one build. */
|
|
304
|
+
export declare function withHostStylesheet(css: string, stylesheet: string, hostStylesheet: string | undefined, missing?: string): string;
|
|
305
|
+
/** Serves the project's `style.css` with the host's stylesheet in it. */
|
|
306
|
+
export declare function hostStylesheetPlugin(projectRoot: string, hostStylesheet: string): Plugin;
|
|
61
307
|
//#endregion
|
|
62
308
|
//#region connect-utils/externalize-vendor.d.ts
|
|
63
|
-
interface VendorPrebuildOptions {
|
|
64
|
-
/** Project root
|
|
309
|
+
export interface VendorPrebuildOptions {
|
|
310
|
+
/** Project root the vendor deps resolve from. */
|
|
65
311
|
dirname: string;
|
|
66
|
-
/**
|
|
312
|
+
/** Specifiers to prebuild into the vendor (defaults to the dev set). */
|
|
67
313
|
include?: string[];
|
|
68
314
|
/** Specifiers left external to the build (defaults to the React family). */
|
|
69
315
|
external?: string[];
|
|
@@ -73,39 +319,332 @@ interface VendorPrebuildOptions {
|
|
|
73
319
|
errorRef?: {
|
|
74
320
|
message?: string;
|
|
75
321
|
};
|
|
322
|
+
/**
|
|
323
|
+
* The APP's base — the same string the app build uses (the dynamic-base
|
|
324
|
+
* placeholder, or a normalized deploy base like "/app/"). The vendor's own
|
|
325
|
+
* build base is this plus the vendor segment, so emitted asset URLs land
|
|
326
|
+
* under <app-base>__vendor__/. Default: the dynamic placeholder (dev
|
|
327
|
+
* behavior; the segment is still appended once by the build worker).
|
|
328
|
+
* Import-map values stay base-relative; the production
|
|
329
|
+
* build strips the leading slash (values then resolve against the page URL
|
|
330
|
+
* under any deploy base), the dev flow prefixes its own base.
|
|
331
|
+
*/
|
|
332
|
+
base?: string;
|
|
333
|
+
/** NODE_ENV define for the vendor build (default "development"). */
|
|
334
|
+
nodeEnv?: "development" | "production";
|
|
335
|
+
/** The app's own deps the vendored packages also bundle: vendored as listed,
|
|
336
|
+
* resolved from `from` (projects don't install them). */
|
|
337
|
+
ownDeps?: {
|
|
338
|
+
specs: string[];
|
|
339
|
+
from: string;
|
|
340
|
+
};
|
|
76
341
|
}
|
|
77
342
|
/**
|
|
78
343
|
* The stable Connect libraries worth prebuilding. The React family is NOT here —
|
|
79
344
|
* it's externalized from the build (see `VENDOR_EXTERNAL`) so the vendor shares
|
|
80
345
|
* the dev server's single React instance via the import map.
|
|
81
346
|
*/
|
|
82
|
-
declare const DEFAULT_VENDOR_INCLUDE: string[];
|
|
347
|
+
export declare const DEFAULT_VENDOR_INCLUDE: string[];
|
|
348
|
+
/** Never vendored: the route tree is the project's, the config path the app's
|
|
349
|
+
* base, and SSR server-only. */
|
|
350
|
+
export declare const VENDOR_SKIP_SUBPATHS: Set<string>;
|
|
83
351
|
/**
|
|
84
352
|
* React-family specifiers kept external to the vendor build. The vendor's chunks
|
|
85
353
|
* emit bare imports for these; `devReactImportmapPlugin`'s import map resolves
|
|
86
354
|
* them to Vite's pre-bundled React, so there is exactly one React instance.
|
|
87
355
|
*/
|
|
88
|
-
declare const VENDOR_EXTERNAL: string[];
|
|
89
|
-
interface PrebuiltVendor {
|
|
356
|
+
export declare const VENDOR_EXTERNAL: string[];
|
|
357
|
+
export interface PrebuiltVendor {
|
|
90
358
|
vendorDir: string;
|
|
91
|
-
/** import map: bare specifier -> "/__vendor__/<entry>.js". */
|
|
359
|
+
/** import map: bare specifier -> "/__vendor__/<entry>-<hash>.js" (base-relative). */
|
|
92
360
|
imports: Record<string, string>;
|
|
361
|
+
/** Resolved versions of every included + external package. */
|
|
362
|
+
versions: Record<string, string>;
|
|
363
|
+
/** Content-hashed shared-deps module ("/__vendor__/shared-deps-<hash>.js", base-relative). */
|
|
364
|
+
sharedDeps: string;
|
|
93
365
|
}
|
|
94
366
|
/** URL prefix the vendor bundle is served under by the dev middleware. */
|
|
95
|
-
declare const VENDOR_URL_PREFIX = "/__vendor__/";
|
|
367
|
+
export declare const VENDOR_URL_PREFIX = "/__vendor__/";
|
|
96
368
|
/**
|
|
97
369
|
* Build the prebuilt vendor (once, in a throwaway subprocess) and return its dir
|
|
98
370
|
* + import map. Idempotent: reuses a cached vendor built for the same dep set.
|
|
99
371
|
* Returns null on any failure (caller falls back to a normal dev server).
|
|
100
372
|
*/
|
|
101
|
-
declare function prebuildConnectVendor(options: VendorPrebuildOptions): Promise<PrebuiltVendor | null>;
|
|
373
|
+
export declare function prebuildConnectVendor(options: VendorPrebuildOptions): Promise<PrebuiltVendor | null>;
|
|
374
|
+
export declare function linkedBuildStamp(pkgRoot: string): string;
|
|
375
|
+
export declare function resolveVersionDigest(versions: Record<string, string>, own: Record<string, string>, stamps: Map<string, string>, build: {
|
|
376
|
+
base: string;
|
|
377
|
+
nodeEnv: string;
|
|
378
|
+
}): string;
|
|
379
|
+
export declare const LOCK_STALE_MS: number;
|
|
380
|
+
export interface VendorLock {
|
|
381
|
+
dir: string;
|
|
382
|
+
token: string;
|
|
383
|
+
timer: ReturnType<typeof setInterval>;
|
|
384
|
+
}
|
|
385
|
+
export declare function acquireLock(lockDir: string): VendorLock | null;
|
|
386
|
+
export declare function releaseLock(lock: VendorLock): void;
|
|
387
|
+
/** The package root at or above `from` that Node would load `pkg` from, or null. */
|
|
388
|
+
export declare function findPackageRoot(from: string, pkg: string): string | null;
|
|
389
|
+
/** Each spec's browser/import entry file when resolved from `from`; unresolvable specs are left out. */
|
|
390
|
+
export declare function resolveOwnDeps(from: string, specs: string[]): Record<string, string>;
|
|
391
|
+
/**
|
|
392
|
+
* The published specifiers whose entry file the vendor build never emitted.
|
|
393
|
+
* URLs are base-less (`/__vendor__/x.js`) and resolve inside `vendorDir`.
|
|
394
|
+
*/
|
|
395
|
+
export declare function missingVendorEntries(vendorDir: string, imports: Record<string, string>): {
|
|
396
|
+
spec: string;
|
|
397
|
+
url: string;
|
|
398
|
+
}[];
|
|
399
|
+
/**
|
|
400
|
+
* Rebase the vendor's base-less entry URLs (`/__vendor__/x.js`) onto the
|
|
401
|
+
* deploy base, so a consumer that resolves them against the page origin lands
|
|
402
|
+
* under that base rather than the server root. A dynamic-base build keeps its
|
|
403
|
+
* placeholder, which the runtime substitutes.
|
|
404
|
+
*
|
|
405
|
+
* `base` is the app base from `prebuildConnectVendor` callers; a base that
|
|
406
|
+
* already carries the vendor segment has it dropped first so it is never
|
|
407
|
+
* doubled.
|
|
408
|
+
*/
|
|
409
|
+
export declare function withVendorBase(imports: Record<string, string>, base: string): Record<string, string>;
|
|
410
|
+
//#endregion
|
|
411
|
+
//#region connect-utils/reactor-worker-build.d.ts
|
|
412
|
+
/** URL prefix the worker bundle is served under, next to `__vendor__/`. */
|
|
413
|
+
export declare const REACTOR_WORKER_URL_PREFIX = "/__reactor_worker__/";
|
|
414
|
+
/** Entry filename of the bundle; the tab constructs its SharedWorker from it. */
|
|
415
|
+
export declare const REACTOR_WORKER_ENTRY = "reactor.worker.js";
|
|
416
|
+
/** Content-Type for the extensions the worker build emits; JS is the default. */
|
|
417
|
+
export declare const REACTOR_WORKER_MIME: Record<string, string>;
|
|
418
|
+
export interface ReactorWorkerVendorOptions {
|
|
419
|
+
/** The vendor's import map (`spec -> /__vendor__/<entry>.js`). */
|
|
420
|
+
imports: Record<string, string>;
|
|
421
|
+
/** The built vendor dir, needed to verify which entries are worker-safe. */
|
|
422
|
+
dir: string;
|
|
423
|
+
}
|
|
424
|
+
export interface ReactorWorkerBuildOptions {
|
|
425
|
+
/** Project root the worker's dependencies resolve from. */
|
|
426
|
+
dirname: string;
|
|
427
|
+
/** Directory to hold the bundle (e.g. `<dist>/__reactor_worker__`). */
|
|
428
|
+
outDir: string;
|
|
429
|
+
/**
|
|
430
|
+
* The prebuilt vendor to share dependencies with. Only the worker-safe
|
|
431
|
+
* subset of its entries is externalized (see
|
|
432
|
+
* {@link workerSafeVendorImports}); omit to bundle everything.
|
|
433
|
+
*/
|
|
434
|
+
vendor?: ReactorWorkerVendorOptions;
|
|
435
|
+
/**
|
|
436
|
+
* Worker entry to build. Defaults to the installed Connect dist's
|
|
437
|
+
* `reactor.worker.js`; tests inject a fixture entry here.
|
|
438
|
+
*/
|
|
439
|
+
entryPath?: string;
|
|
440
|
+
/** NODE_ENV define for the build (default "development"). */
|
|
441
|
+
nodeEnv?: "development" | "production";
|
|
442
|
+
/** Filled with the failure cause when the prebuild returns null. */
|
|
443
|
+
errorRef?: {
|
|
444
|
+
message?: string;
|
|
445
|
+
};
|
|
446
|
+
}
|
|
447
|
+
export interface PrebuiltReactorWorker {
|
|
448
|
+
outDir: string;
|
|
449
|
+
/** Entry filename inside outDir ({@link REACTOR_WORKER_ENTRY}). */
|
|
450
|
+
entry: string;
|
|
451
|
+
/**
|
|
452
|
+
* Digest of everything that shaped this bundle's output (see
|
|
453
|
+
* {@link computeSourceDigest}); identical for a cache hit and a fresh
|
|
454
|
+
* build. The dev plugin serves it in `worker-meta.json` next to the
|
|
455
|
+
* bundle; `apps/connect/src/utils/reactor-worker-url.ts` fetches it to
|
|
456
|
+
* fold the actual built worker code into the tab's version fingerprint
|
|
457
|
+
* (W0.6).
|
|
458
|
+
*/
|
|
459
|
+
sourceDigest: string;
|
|
460
|
+
/**
|
|
461
|
+
* The worker-safe vendor subset this bundle externalizes (see
|
|
462
|
+
* {@link workerSafeVendorImports}); empty without a vendor.
|
|
463
|
+
*/
|
|
464
|
+
vendorImports: Record<string, string>;
|
|
465
|
+
}
|
|
466
|
+
/**
|
|
467
|
+
* The installed Connect dist's worker entry, or null when the installed
|
|
468
|
+
* version predates the worker (the feature is then unavailable, not broken).
|
|
469
|
+
*/
|
|
470
|
+
export declare function resolveReactorWorkerSource(dirname: string): string | null;
|
|
471
|
+
/** `/__vendor__/<entry>.js` -> `../__vendor__/<entry>.js` (sibling dirs). */
|
|
472
|
+
export declare function vendorRelativePath(vendorUrl: string): string;
|
|
473
|
+
/**
|
|
474
|
+
* Module specifiers a worker cannot resolve: anything that is not relative,
|
|
475
|
+
* root-relative, or an http(s)/data/blob URL. Used as a post-build guard so a
|
|
476
|
+
* leftover bare (or `node:`) import fails the build with a name instead of
|
|
477
|
+
* shipping a worker that dies on its first import statement.
|
|
478
|
+
*
|
|
479
|
+
* Expects minified (comment-free) output: a raw-text scan cannot tell a real
|
|
480
|
+
* import from a JSDoc code sample, and unminified kysely/viem are full of the
|
|
481
|
+
* latter. The build below always minifies for exactly this reason.
|
|
482
|
+
*/
|
|
483
|
+
export declare function findDisallowedSpecifiers(code: string): string[];
|
|
484
|
+
/**
|
|
485
|
+
* Packages whose BUILT dist shapes the worker bundle's output even when
|
|
486
|
+
* connect's own dist/reactor.worker.js entry file did not change.
|
|
487
|
+
*
|
|
488
|
+
* That entry is a library artifact whose bare imports this build resolves
|
|
489
|
+
* through node_modules at BUILD time, so a rebuilt dist anywhere in its
|
|
490
|
+
* closure changes the bundle output without touching the entry file's own
|
|
491
|
+
* size/mtime. The list is DERIVED from the installed Connect's own
|
|
492
|
+
* dependencies rather than hardcoded: the bundle pulls `@renown/sdk`,
|
|
493
|
+
* `@powerhousedao/powerhouse-vetra-packages` and `@powerhousedao/shared` out
|
|
494
|
+
* of node_modules too, and a hardcoded pair left every one of those able to be
|
|
495
|
+
* rebuilt behind a cache hit. Connect's dependency list is the cheap stand-in
|
|
496
|
+
* for the resolved bundle graph: every workspace package the worker can reach
|
|
497
|
+
* is reachable through it, and a package not in the bundle only costs a readdir.
|
|
498
|
+
*/
|
|
499
|
+
export declare function upstreamWorkerPackages(dirname: string): string[];
|
|
500
|
+
/**
|
|
501
|
+
* This module's own installed version, read by walking up from its file to
|
|
502
|
+
* the nearest `package.json` named "@powerhousedao/builder-tools" (same
|
|
503
|
+
* technique as `build-hash.ts`'s `readConnectVersion`: builder-tools'
|
|
504
|
+
* `exports` map has no `./package.json` subpath, so node resolution can't
|
|
505
|
+
* get there). Works whether this runs from source (tests, this monorepo) or
|
|
506
|
+
* the built dist.
|
|
507
|
+
*/
|
|
508
|
+
export declare function resolveOwnPackageVersion(): string;
|
|
509
|
+
/**
|
|
510
|
+
* This package's own version, computed once. Folded into the worker bundle
|
|
511
|
+
* cache key so a builder-tools release — which can change how the bundle is
|
|
512
|
+
* built (anything in this module beyond {@link WORKER_BUILD_WORKER} itself,
|
|
513
|
+
* e.g. `workerSafeVendorImports`, the resolve plugin) — invalidates bundles
|
|
514
|
+
* a prior builder-tools version cached.
|
|
515
|
+
*/
|
|
516
|
+
export declare const BUILDER_TOOLS_VERSION: string;
|
|
517
|
+
/**
|
|
518
|
+
* A workspace package's real directory, resolved the way Node's resolver
|
|
519
|
+
* would (through `node_modules`), or null when it is not installed (e.g. a
|
|
520
|
+
* non-monorepo consumer project — graceful, not an error). pnpm's
|
|
521
|
+
* node_modules symlinks resolve to the real package directory, so this
|
|
522
|
+
* reflects the monorepo's actual dist state, not a stale symlink target.
|
|
523
|
+
*/
|
|
524
|
+
export declare function resolveWorkspacePackageDir(dirname: string, pkgName: string): string | null;
|
|
525
|
+
/**
|
|
526
|
+
* Cheap content fingerprint of a directory's immediate files: no file bytes
|
|
527
|
+
* are read, just each entry's name/size/mtime, so it stays fast even for a
|
|
528
|
+
* large dist. Sensitive to a rebuild in the common cases: Vite's
|
|
529
|
+
* content-hashed chunk filenames change the name itself; a stable-named file
|
|
530
|
+
* (an entry point) changes size or mtime. Bounded (`maxFiles`) so a
|
|
531
|
+
* pathological directory cannot make this slow — deliberately not a
|
|
532
|
+
* full-tree hash.
|
|
533
|
+
*
|
|
534
|
+
* The names are sorted BEFORE the bound is applied, so the subset the bound
|
|
535
|
+
* keeps is the same subset on every run: readdir order is unspecified, and
|
|
536
|
+
* truncating it first made the fingerprint of a directory past the bound a
|
|
537
|
+
* function of whatever order the filesystem happened to report.
|
|
538
|
+
*/
|
|
539
|
+
export declare function distDirFingerprint(dir: string, maxFiles?: number): string;
|
|
540
|
+
export declare function computeSourceDigest(dirname: string, entryPath: string, vendorDir?: string, builderToolsVersion?: string): string;
|
|
541
|
+
/** Content digest of a directory tree (relative paths + bytes; source maps skipped). */
|
|
542
|
+
export declare function directoryContentDigest(dir: string): string;
|
|
543
|
+
/**
|
|
544
|
+
* Build the worker bundle (once, in a throwaway subprocess) into `outDir`.
|
|
545
|
+
* Idempotent: reuses a cached bundle built from the same connect dist, vendor
|
|
546
|
+
* mapping, and builder logic. Returns null on failure (`errorRef` carries the
|
|
547
|
+
* cause) or when the installed Connect has no worker entry.
|
|
548
|
+
*/
|
|
549
|
+
export declare function prebuildReactorWorker(options: ReactorWorkerBuildOptions): Promise<PrebuiltReactorWorker | null>;
|
|
550
|
+
/** Replace `outDir` with the finished `tmpDir`, old contents removed last. */
|
|
551
|
+
export declare function publishDirAtomic(tmpDir: string, outDir: string): void;
|
|
552
|
+
/**
|
|
553
|
+
* Scan the emitted JS files REACHABLE from the entry via import statements
|
|
554
|
+
* for specifiers a worker cannot resolve. Vendor externals were rewritten to
|
|
555
|
+
* ../__vendor__/ relative paths, so anything bare that survives in the graph
|
|
556
|
+
* is a real defect.
|
|
557
|
+
*
|
|
558
|
+
* Deliberately a graph walk, not a directory walk: the bundled reactor code
|
|
559
|
+
* carries `new URL(..., import.meta.url)` references to its node
|
|
560
|
+
* worker-thread entries (executor/projection workers), which Vite emits as
|
|
561
|
+
* stray assets full of node-only imports. They are unreachable dead weight in
|
|
562
|
+
* a browser bundle — the production vendor output tolerates the same files —
|
|
563
|
+
* and must not fail the build.
|
|
564
|
+
*/
|
|
565
|
+
export declare function findBundleSpecifierOffenders(bundleDir: string, entry?: string): {
|
|
566
|
+
file: string;
|
|
567
|
+
specs: string[];
|
|
568
|
+
}[];
|
|
569
|
+
/** The page-only markers present in `code`, in a fixed order. */
|
|
570
|
+
export declare function findWorkerUnsafeMarkers(code: string): string[];
|
|
571
|
+
/**
|
|
572
|
+
* The subset of the vendor's entries a worker may import.
|
|
573
|
+
*
|
|
574
|
+
* The vendor build keeps the React family external: its chunks carry bare
|
|
575
|
+
* `import "react"` statements that the PAGE resolves through its import map.
|
|
576
|
+
* A worker resolves no import map, so externalizing a vendor spec whose chunk
|
|
577
|
+
* closure reaches such an import would kill the worker on its first load —
|
|
578
|
+
* and the chunk graph is shared across vendor entries, so even a React-free
|
|
579
|
+
* module (e.g. an rpc subpath) can be entangled with React through a shared
|
|
580
|
+
* chunk. The vendor is also built for the page: a dynamic-base build rewrites
|
|
581
|
+
* its asset URLs onto a global only the page sets, and its dynamic imports go
|
|
582
|
+
* through Vite's preload helper, which needs `document`. Each entry's own
|
|
583
|
+
* closure inside the vendor dir decides: clean closure, worker-safe; anything
|
|
584
|
+
* bare or page-only in it (see {@link findWorkerUnsafeMarkers}), or a missing
|
|
585
|
+
* entry file, bundled into the worker instead.
|
|
586
|
+
*/
|
|
587
|
+
export declare function workerSafeVendorImports(vendorDir: string, vendorImports: Record<string, string>): Record<string, string>;
|
|
588
|
+
/**
|
|
589
|
+
* Builds arbitrary worker-loadable entries with the worker build config.
|
|
590
|
+
* Exported for the local-package bundles, which need the same self-contained
|
|
591
|
+
* output and vendor externalization at a different depth.
|
|
592
|
+
*/
|
|
593
|
+
export declare function runWorkerBuildEntries(dirname: string, outDir: string, entries: Record<string, string>, vendorImports: Record<string, string>, nodeEnv: "development" | "production", vendorPrefix?: string): Promise<{
|
|
594
|
+
ok: boolean;
|
|
595
|
+
stderr: string;
|
|
596
|
+
}>;
|
|
597
|
+
//#endregion
|
|
598
|
+
//#region connect-utils/worker-packages-build.d.ts
|
|
599
|
+
/** Served under `<base>__reactor_worker__/packages/`. */
|
|
600
|
+
export declare const WORKER_PACKAGES_MANIFEST = "manifest.json";
|
|
601
|
+
export interface WorkerPackagesBuildOptions {
|
|
602
|
+
/** Project root the packages resolve from. */
|
|
603
|
+
dirname: string;
|
|
604
|
+
/** Local package names (`provider: "local"` in powerhouse.config.json). */
|
|
605
|
+
packages: string[];
|
|
606
|
+
/** Directory to hold the bundles (`<dist>/__reactor_worker__/packages`). */
|
|
607
|
+
outDir: string;
|
|
608
|
+
/** The prebuilt vendor to share dependencies with, when one was built. */
|
|
609
|
+
vendor?: ReactorWorkerVendorOptions;
|
|
610
|
+
/**
|
|
611
|
+
* The vendor's worker-safe subset, when the caller already computed it
|
|
612
|
+
* (`PrebuiltReactorWorker.vendorImports`); skips walking the vendor again.
|
|
613
|
+
*/
|
|
614
|
+
safeVendorImports?: Record<string, string>;
|
|
615
|
+
nodeEnv?: "development" | "production";
|
|
616
|
+
errorRef?: {
|
|
617
|
+
message?: string;
|
|
618
|
+
};
|
|
619
|
+
}
|
|
620
|
+
export interface WorkerPackageManifestEntry {
|
|
621
|
+
name: string;
|
|
622
|
+
version?: string;
|
|
623
|
+
/** Filename inside outDir, as {@link workerPackageFileName} spells it. */
|
|
624
|
+
file: string;
|
|
625
|
+
}
|
|
626
|
+
/**
|
|
627
|
+
* The project's own package name when it ships a models bundle, so a caller
|
|
628
|
+
* can include it beside the configured `provider: "local"` packages. A vetra
|
|
629
|
+
* project declares no package entry for itself, yet its models are exactly
|
|
630
|
+
* the ones the worker is missing.
|
|
631
|
+
*/
|
|
632
|
+
export declare function ownProjectPackage(dirname: string): string | undefined;
|
|
633
|
+
/**
|
|
634
|
+
* Build each local package's models entry into `outDir` and write the
|
|
635
|
+
* manifest the tab reads. Returns the manifest entries (empty when no local
|
|
636
|
+
* package ships a models bundle), or null when the build itself failed -
|
|
637
|
+
* `errorRef` then carries the cause. Both of those remove `outDir`, so a
|
|
638
|
+
* previous build's bundles never outlive the packages they came from.
|
|
639
|
+
*/
|
|
640
|
+
export declare function prebuildWorkerPackages(options: WorkerPackagesBuildOptions): Promise<WorkerPackageManifestEntry[] | null>;
|
|
102
641
|
//#endregion
|
|
103
642
|
//#region connect-utils/types.d.ts
|
|
104
|
-
type IConnectOptions = {
|
|
643
|
+
export type IConnectOptions = {
|
|
105
644
|
mode: string;
|
|
106
645
|
dirname: string;
|
|
107
646
|
envDir?: string;
|
|
108
|
-
powerhouseConfig?: PowerhouseConfig;
|
|
647
|
+
powerhouseConfig?: PowerhouseConfig$1;
|
|
109
648
|
watchTimeout?: number;
|
|
110
649
|
/**
|
|
111
650
|
* CLI-supplied connect override. Final (highest precedence) layer of the
|
|
@@ -127,8 +666,25 @@ type IConnectOptions = {
|
|
|
127
666
|
cliPackageRegistryUrl?: string;
|
|
128
667
|
dynamicBase?: boolean;
|
|
129
668
|
favicon?: string;
|
|
669
|
+
/** The routes folder, relative to the project (a host's `runner.routes`);
|
|
670
|
+
* `false` for none. Default: `hosts/connect/routes/` when it exists. */
|
|
671
|
+
routes?: string | false;
|
|
672
|
+
/**
|
|
673
|
+
* Production vendor: the prebuilt shared-dependency bundle's import map and
|
|
674
|
+
* version table (from `prebuildConnectVendor`). When set on a production
|
|
675
|
+
* build, the shared specifiers are externalized from the app bundle and
|
|
676
|
+
* merged into the page import map. Build input only.
|
|
677
|
+
*/
|
|
678
|
+
vendor?: {
|
|
679
|
+
imports: Record<string, string>;
|
|
680
|
+
versions: Record<string, string>;
|
|
681
|
+
/** Base-applied URL of the content-hashed shared-deps module. */
|
|
682
|
+
sharedDeps?: string;
|
|
683
|
+
};
|
|
684
|
+
/** Content digest of the prebuilt reactor worker dir; versions its URLs. */
|
|
685
|
+
reactorWorkerVersion?: string;
|
|
130
686
|
};
|
|
131
|
-
type ConnectCommonOptions = {
|
|
687
|
+
export type ConnectCommonOptions = {
|
|
132
688
|
base?: string;
|
|
133
689
|
mode?: string;
|
|
134
690
|
configFile?: string;
|
|
@@ -138,71 +694,71 @@ type ConnectCommonOptions = {
|
|
|
138
694
|
defaultDrivesUrl?: string[];
|
|
139
695
|
drivesPreserveStrategy?: "preserve-all" | "preserve-by-url-and-detach";
|
|
140
696
|
};
|
|
141
|
-
type ViteDevOptions = Pick<CommonServerOptions, "port" | "host" | "open" | "cors" | "strictPort"> & {
|
|
697
|
+
export type ViteDevOptions = Pick<CommonServerOptions, "port" | "host" | "open" | "cors" | "strictPort"> & {
|
|
142
698
|
force?: boolean;
|
|
143
699
|
};
|
|
144
|
-
type ConnectStudioOptions = ConnectCommonOptions & {
|
|
700
|
+
export type ConnectStudioOptions = ConnectCommonOptions & {
|
|
145
701
|
devServerOptions?: ViteDevOptions;
|
|
146
702
|
printUrls?: boolean;
|
|
147
703
|
bindCLIShortcuts?: boolean;
|
|
148
704
|
};
|
|
149
|
-
type ConnectBuildOptions = ConnectCommonOptions & {
|
|
705
|
+
export type ConnectBuildOptions = ConnectCommonOptions & {
|
|
150
706
|
outDir?: string;
|
|
151
707
|
};
|
|
152
|
-
type ConnectPreviewOptions = ConnectCommonOptions & Omit<ViteDevOptions, "cors"> & {
|
|
708
|
+
export type ConnectPreviewOptions = ConnectCommonOptions & Omit<ViteDevOptions, "cors"> & {
|
|
153
709
|
outDir?: string;
|
|
154
710
|
printUrls?: boolean;
|
|
155
711
|
bindCLIShortcuts?: boolean;
|
|
156
712
|
};
|
|
157
713
|
//#endregion
|
|
158
714
|
//#region connect-utils/helpers.d.ts
|
|
159
|
-
declare const DEFAULT_CONNECT_OUTDIR: ".ph/connect-build/dist/";
|
|
160
|
-
declare function resolveViteConfigPath(options: Pick<ConnectCommonOptions, "projectRoot" | "viteConfigFile">): string;
|
|
161
|
-
declare function resolvePackage(packageName: string, root?: string): string;
|
|
162
|
-
declare function resolveConnectPackageJson(root?: string): JSON | null;
|
|
715
|
+
export declare const DEFAULT_CONNECT_OUTDIR: ".ph/connect-build/dist/";
|
|
716
|
+
export declare function resolveViteConfigPath(options: Pick<ConnectCommonOptions, "projectRoot" | "viteConfigFile">): string;
|
|
717
|
+
export declare function resolvePackage(packageName: string, root?: string): string;
|
|
718
|
+
export declare function resolveConnectPackageJson(root?: string): JSON | null;
|
|
163
719
|
/**
|
|
164
720
|
* Finds the dist dir of Connect on the local machine
|
|
165
721
|
*/
|
|
166
|
-
declare function resolveConnectBundle(root?: string): string;
|
|
167
|
-
declare function resolveConnectPublicDir(root?: string): string;
|
|
722
|
+
export declare function resolveConnectBundle(root?: string): string;
|
|
723
|
+
export declare function resolveConnectPublicDir(root?: string): string;
|
|
168
724
|
/**
|
|
169
725
|
* Copies the Connect dist dir to the target path
|
|
170
726
|
*/
|
|
171
|
-
declare function copyConnect(sourcePath: string, targetPath: string): void;
|
|
727
|
+
export declare function copyConnect(sourcePath: string, targetPath: string): void;
|
|
172
728
|
/**
|
|
173
729
|
* Backs up the index.html file
|
|
174
730
|
*
|
|
175
731
|
* Needed when running the Connect Studio dev server on Windows
|
|
176
732
|
*/
|
|
177
|
-
declare function backupIndexHtml(appPath: string, restore?: boolean): void;
|
|
178
|
-
declare function removeBase64EnvValues(appPath: string): void;
|
|
179
|
-
declare function readJsonFile(filePath: string): PowerhouseConfig | null;
|
|
733
|
+
export declare function backupIndexHtml(appPath: string, restore?: boolean): void;
|
|
734
|
+
export declare function removeBase64EnvValues(appPath: string): void;
|
|
735
|
+
export declare function readJsonFile(filePath: string): PowerhouseConfig$1 | null;
|
|
180
736
|
/**
|
|
181
737
|
* Takes a list of Powerhouse project packages and optionally local Powerhouse packages and outputs a js file which exports those packages for use in Connect Studio.
|
|
182
738
|
*/
|
|
183
|
-
declare function makeImportScriptFromPackages(args: {
|
|
739
|
+
export declare function makeImportScriptFromPackages(args: {
|
|
184
740
|
packages: string[];
|
|
185
741
|
importStyles?: boolean;
|
|
186
742
|
localJsPath?: string;
|
|
187
743
|
localCssPath?: string;
|
|
188
744
|
}): string;
|
|
189
|
-
declare function ensureNodeVersion(minVersion?: string): void;
|
|
190
|
-
declare function runShellScriptPlugin(scriptName: string, connectPath: string): Plugin;
|
|
745
|
+
export declare function ensureNodeVersion(minVersion?: string): void;
|
|
746
|
+
export declare function runShellScriptPlugin(scriptName: string, connectPath: string): Plugin;
|
|
191
747
|
/**
|
|
192
748
|
* Appends the contents to the <head> tag of the index.html file
|
|
193
749
|
*/
|
|
194
|
-
declare function appendToHtmlHead(pathToHtml: string, contents: string): Promise<void>;
|
|
750
|
+
export declare function appendToHtmlHead(pathToHtml: string, contents: string): Promise<void>;
|
|
195
751
|
/**
|
|
196
752
|
* Prepends the contents to the <head> tag of the index.html file
|
|
197
753
|
*/
|
|
198
|
-
declare function prependToHtmlHead(pathToHtml: string, contents: string): Promise<void>;
|
|
199
|
-
declare function runTsc(outDir: string): void;
|
|
200
|
-
declare function stripVersionFromPackage(packageName: string): string;
|
|
754
|
+
export declare function prependToHtmlHead(pathToHtml: string, contents: string): Promise<void>;
|
|
755
|
+
export declare function runTsc(outDir: string): void;
|
|
756
|
+
export declare function stripVersionFromPackage(packageName: string): string;
|
|
201
757
|
//#endregion
|
|
202
758
|
//#region connect-utils/runtime-config-schema.d.ts
|
|
203
|
-
declare const RUNTIME_CONFIG_SCHEMA_ID = "https://powerhouse.inc/schemas/powerhouse.config.json";
|
|
204
|
-
declare const RUNTIME_CONFIG_SCHEMA_URL = "https://raw.githubusercontent.com/powerhouse-inc/powerhouse/main/packages/builder-tools/connect-utils/runtime-config.schema.json";
|
|
205
|
-
declare const runtimeConfigSchema: {
|
|
759
|
+
export declare const RUNTIME_CONFIG_SCHEMA_ID = "https://powerhouse.inc/schemas/powerhouse.config.json";
|
|
760
|
+
export declare const RUNTIME_CONFIG_SCHEMA_URL = "https://raw.githubusercontent.com/powerhouse-inc/powerhouse/main/packages/builder-tools/connect-utils/runtime-config.schema.json";
|
|
761
|
+
export declare const runtimeConfigSchema: {
|
|
206
762
|
readonly $schema: "http://json-schema.org/draft-07/schema#";
|
|
207
763
|
readonly $id: "https://powerhouse.inc/schemas/powerhouse.config.json";
|
|
208
764
|
readonly title: "Powerhouse Connect runtime configuration";
|
|
@@ -269,600 +825,12 @@ declare const runtimeConfigSchema: {
|
|
|
269
825
|
};
|
|
270
826
|
}];
|
|
271
827
|
};
|
|
272
|
-
readonly connect:
|
|
273
|
-
readonly type: "object";
|
|
274
|
-
readonly additionalProperties: false;
|
|
275
|
-
readonly description: "Connect-specific UI customisations. All fields optional; omit the section entirely for default behaviour.";
|
|
276
|
-
readonly properties: {
|
|
277
|
-
readonly branding: {
|
|
278
|
-
readonly type: "object";
|
|
279
|
-
readonly additionalProperties: false;
|
|
280
|
-
readonly description: "App identity and visual branding.";
|
|
281
|
-
readonly properties: {
|
|
282
|
-
readonly appName: {
|
|
283
|
-
readonly type: "string";
|
|
284
|
-
readonly description: "Browser tab title and any in-app brand text. Defaults to 'Powerhouse Connect'.";
|
|
285
|
-
};
|
|
286
|
-
readonly homeBackground: {
|
|
287
|
-
readonly type: readonly ["string", "null"];
|
|
288
|
-
readonly description: "Hero image on the empty home screen. URL or path to override; null or omitted uses the bundled default image.";
|
|
289
|
-
};
|
|
290
|
-
};
|
|
291
|
-
};
|
|
292
|
-
readonly app: {
|
|
293
|
-
readonly type: "object";
|
|
294
|
-
readonly additionalProperties: false;
|
|
295
|
-
readonly description: "Top-level Connect application behaviour.";
|
|
296
|
-
readonly properties: {
|
|
297
|
-
readonly logLevel: {
|
|
298
|
-
readonly type: "string";
|
|
299
|
-
readonly enum: readonly ["debug", "info", "warn", "error"];
|
|
300
|
-
readonly description: "Log level applied by Connect's logger at boot. Affects browser-side output only.";
|
|
301
|
-
readonly default: "info";
|
|
302
|
-
};
|
|
303
|
-
readonly basePath: {
|
|
304
|
-
readonly type: "string";
|
|
305
|
-
readonly description: "Base path Connect is mounted under (e.g. '/connect' for subpath deploys). Normalised at runtime to start and end with '/'. Defaults to the build-time BASE_URL.";
|
|
306
|
-
readonly default: "/";
|
|
307
|
-
};
|
|
308
|
-
readonly offline: {
|
|
309
|
-
readonly type: "boolean";
|
|
310
|
-
readonly description: "When true (default), the build emits a precaching service worker so Connect's app shell works offline, and the SPA registers it at boot. Set false to opt this deployment out: no service worker is built, the SPA skips registration, and any previously-installed worker is unregistered.";
|
|
311
|
-
readonly default: true;
|
|
312
|
-
};
|
|
313
|
-
readonly studioMode: {
|
|
314
|
-
readonly type: "boolean";
|
|
315
|
-
readonly description: "Studio mode. Enables builder-only capabilities: Connect loads the vetra package and exposes DocumentModel (and vetra spec types) as creatable documents. Forced on by `ph vetra` / `ph connect studio`; false by default.";
|
|
316
|
-
readonly default: false;
|
|
317
|
-
};
|
|
318
|
-
};
|
|
319
|
-
};
|
|
320
|
-
readonly ai: {
|
|
321
|
-
readonly type: "object";
|
|
322
|
-
readonly additionalProperties: false;
|
|
323
|
-
readonly description: "AI assistant (chat) behaviour.";
|
|
324
|
-
readonly properties: {
|
|
325
|
-
readonly assistantEnabled: {
|
|
326
|
-
readonly type: "boolean";
|
|
327
|
-
readonly description: "When true, Connect mounts the in-browser AI assistant (bottom-right chat FAB that talks to a user-configured OpenAI-compatible endpoint and acts on the reactor). Disabled by default.";
|
|
328
|
-
readonly default: false;
|
|
329
|
-
};
|
|
330
|
-
};
|
|
331
|
-
};
|
|
332
|
-
readonly packages: {
|
|
333
|
-
readonly type: "object";
|
|
334
|
-
readonly additionalProperties: false;
|
|
335
|
-
readonly description: "Runtime behaviour for the Connect package manager (separate from top-level `packages[]`, which lists which packages to load).";
|
|
336
|
-
readonly properties: {
|
|
337
|
-
readonly externalEnabled: {
|
|
338
|
-
readonly type: "boolean";
|
|
339
|
-
readonly description: "When false, Connect refuses to load any package that wasn't bundled at build time. Affirmative replacement for the legacy PH_CONNECT_EXTERNAL_PACKAGES_DISABLED env var.";
|
|
340
|
-
readonly default: true;
|
|
341
|
-
};
|
|
342
|
-
readonly liveReload: {
|
|
343
|
-
readonly type: "boolean";
|
|
344
|
-
readonly description: "When true, Connect subscribes to the static-mode `/__packages` SSE channel so live publishes flow into the running tab without a page reload. Only works under hosting that serves this channel (e.g. ph-clint static mode).";
|
|
345
|
-
readonly default: false;
|
|
346
|
-
};
|
|
347
|
-
};
|
|
348
|
-
};
|
|
349
|
-
readonly drives: {
|
|
350
|
-
readonly type: "object";
|
|
351
|
-
readonly additionalProperties: false;
|
|
352
|
-
readonly description: "Default-drive and add-drive UI behaviour.";
|
|
353
|
-
readonly properties: {
|
|
354
|
-
readonly allowAddDrive: {
|
|
355
|
-
readonly type: "boolean";
|
|
356
|
-
readonly description: "When false, the SPA hides the 'add drive' affordance entirely (top-level). Per-section overrides live in `sections.{remote,local}.allowAdd`.";
|
|
357
|
-
readonly default: true;
|
|
358
|
-
};
|
|
359
|
-
readonly defaultDrives: {
|
|
360
|
-
readonly type: "array";
|
|
361
|
-
readonly description: "Drives the SPA auto-connects to on first load. Each entry is either a remote drive (a URL, with optional name/icon overrides) or a local drive (created locally on first boot, with a stable id and optional name/icon/app).";
|
|
362
|
-
readonly default: readonly [];
|
|
363
|
-
readonly items: {
|
|
364
|
-
readonly oneOf: readonly [{
|
|
365
|
-
readonly type: "object";
|
|
366
|
-
readonly additionalProperties: false;
|
|
367
|
-
readonly required: readonly ["url"];
|
|
368
|
-
readonly properties: {
|
|
369
|
-
readonly url: {
|
|
370
|
-
readonly type: "string";
|
|
371
|
-
};
|
|
372
|
-
readonly name: {
|
|
373
|
-
readonly type: readonly ["string", "null"];
|
|
374
|
-
};
|
|
375
|
-
readonly icon: {
|
|
376
|
-
readonly type: readonly ["string", "null"];
|
|
377
|
-
};
|
|
378
|
-
};
|
|
379
|
-
}, {
|
|
380
|
-
readonly type: "object";
|
|
381
|
-
readonly additionalProperties: false;
|
|
382
|
-
readonly required: readonly ["local", "id"];
|
|
383
|
-
readonly properties: {
|
|
384
|
-
readonly local: {
|
|
385
|
-
readonly const: true;
|
|
386
|
-
readonly description: "Discriminator: this entry is a local drive created on first boot.";
|
|
387
|
-
};
|
|
388
|
-
readonly id: {
|
|
389
|
-
readonly type: "string";
|
|
390
|
-
readonly description: "Stable drive id. The drive is created with this id on first boot and is not re-created on later boots.";
|
|
391
|
-
};
|
|
392
|
-
readonly name: {
|
|
393
|
-
readonly type: readonly ["string", "null"];
|
|
394
|
-
};
|
|
395
|
-
readonly icon: {
|
|
396
|
-
readonly type: readonly ["string", "null"];
|
|
397
|
-
};
|
|
398
|
-
readonly app: {
|
|
399
|
-
readonly type: "string";
|
|
400
|
-
readonly description: "Drive app (preferred editor) to open on the drive.";
|
|
401
|
-
};
|
|
402
|
-
};
|
|
403
|
-
}];
|
|
404
|
-
};
|
|
405
|
-
};
|
|
406
|
-
readonly preserveStrategy: {
|
|
407
|
-
readonly type: "string";
|
|
408
|
-
readonly enum: readonly ["preserve-all", "preserve-by-url-and-detach"];
|
|
409
|
-
readonly description: "Strategy applied when defaultDrives change between deploys. 'preserve-all' keeps user-added drives untouched; 'preserve-by-url-and-detach' detaches removed default drives. No schema default \u2014 opt-in only.";
|
|
410
|
-
};
|
|
411
|
-
readonly sections: {
|
|
412
|
-
readonly type: "object";
|
|
413
|
-
readonly additionalProperties: false;
|
|
414
|
-
readonly description: "Per-section visibility and affordance toggles. `remote` covers what was historically split into 'public' + 'cloud'; `local` is browser-local drives.";
|
|
415
|
-
readonly properties: {
|
|
416
|
-
readonly remote: {
|
|
417
|
-
readonly type: "object";
|
|
418
|
-
readonly additionalProperties: false;
|
|
419
|
-
readonly description: "Visibility and add/delete affordances for a drive section in the sidebar.";
|
|
420
|
-
readonly properties: {
|
|
421
|
-
readonly enabled: {
|
|
422
|
-
readonly type: "boolean";
|
|
423
|
-
readonly description: "When false, the section is hidden in the sidebar.";
|
|
424
|
-
readonly default: true;
|
|
425
|
-
};
|
|
426
|
-
readonly allowAdd: {
|
|
427
|
-
readonly type: "boolean";
|
|
428
|
-
readonly description: "When false, the section's 'add drive' affordance is hidden.";
|
|
429
|
-
readonly default: true;
|
|
430
|
-
};
|
|
431
|
-
readonly allowDelete: {
|
|
432
|
-
readonly type: "boolean";
|
|
433
|
-
readonly description: "When false, drives in this section cannot be deleted from the UI.";
|
|
434
|
-
readonly default: true;
|
|
435
|
-
};
|
|
436
|
-
};
|
|
437
|
-
};
|
|
438
|
-
readonly local: {
|
|
439
|
-
readonly type: "object";
|
|
440
|
-
readonly additionalProperties: false;
|
|
441
|
-
readonly description: "Visibility and add/delete affordances for a drive section in the sidebar.";
|
|
442
|
-
readonly properties: {
|
|
443
|
-
readonly enabled: {
|
|
444
|
-
readonly type: "boolean";
|
|
445
|
-
readonly description: "When false, the section is hidden in the sidebar.";
|
|
446
|
-
readonly default: true;
|
|
447
|
-
};
|
|
448
|
-
readonly allowAdd: {
|
|
449
|
-
readonly type: "boolean";
|
|
450
|
-
readonly description: "When false, the section's 'add drive' affordance is hidden.";
|
|
451
|
-
readonly default: true;
|
|
452
|
-
};
|
|
453
|
-
readonly allowDelete: {
|
|
454
|
-
readonly type: "boolean";
|
|
455
|
-
readonly description: "When false, drives in this section cannot be deleted from the UI.";
|
|
456
|
-
readonly default: true;
|
|
457
|
-
};
|
|
458
|
-
};
|
|
459
|
-
};
|
|
460
|
-
};
|
|
461
|
-
};
|
|
462
|
-
};
|
|
463
|
-
};
|
|
464
|
-
readonly renown: {
|
|
465
|
-
readonly type: "object";
|
|
466
|
-
readonly additionalProperties: false;
|
|
467
|
-
readonly description: "Renown identity / authentication coordinates.";
|
|
468
|
-
readonly properties: {
|
|
469
|
-
readonly url: {
|
|
470
|
-
readonly type: "string";
|
|
471
|
-
readonly description: "Renown auth service URL.";
|
|
472
|
-
readonly default: "https://www.renown.id";
|
|
473
|
-
};
|
|
474
|
-
readonly networkId: {
|
|
475
|
-
readonly type: "string";
|
|
476
|
-
readonly description: "CAIP-2 network namespace (e.g. 'eip155').";
|
|
477
|
-
readonly default: "eip155";
|
|
478
|
-
};
|
|
479
|
-
readonly chainId: {
|
|
480
|
-
readonly type: "number";
|
|
481
|
-
readonly description: "CAIP-2 chain reference within the network namespace.";
|
|
482
|
-
readonly default: 1;
|
|
483
|
-
};
|
|
484
|
-
readonly namespace: {
|
|
485
|
-
readonly type: "string";
|
|
486
|
-
readonly description: "Renown localStorage namespace; share it across Connects to share login.";
|
|
487
|
-
};
|
|
488
|
-
readonly switchboardUrl: {
|
|
489
|
-
readonly type: "string";
|
|
490
|
-
readonly description: "Switchboard GraphQL URL. When set, Connect enables in-page (no-redirect) Renown sign-in; otherwise it falls back to the redirect flow via `url`.";
|
|
491
|
-
};
|
|
492
|
-
readonly adapters: {
|
|
493
|
-
readonly type: "object";
|
|
494
|
-
readonly additionalProperties: false;
|
|
495
|
-
readonly description: "Per-adapter wallet config for in-page auth. Presence of an adapter key enables it; omit or leave empty for redirect-only behaviour.";
|
|
496
|
-
readonly properties: {
|
|
497
|
-
readonly rainbow: {
|
|
498
|
-
readonly type: "object";
|
|
499
|
-
readonly additionalProperties: false;
|
|
500
|
-
readonly description: "wagmi + RainbowKit external-wallet adapter config.";
|
|
501
|
-
readonly properties: {
|
|
502
|
-
readonly walletConnectProjectId: {
|
|
503
|
-
readonly type: "string";
|
|
504
|
-
readonly description: "WalletConnect project id; required for this adapter to function.";
|
|
505
|
-
};
|
|
506
|
-
readonly infuraProjectId: {
|
|
507
|
-
readonly type: "string";
|
|
508
|
-
readonly description: "Optional Infura project id used to build RPC transports.";
|
|
509
|
-
};
|
|
510
|
-
};
|
|
511
|
-
};
|
|
512
|
-
readonly privy: {
|
|
513
|
-
readonly type: "object";
|
|
514
|
-
readonly additionalProperties: false;
|
|
515
|
-
readonly description: "Privy embedded/social adapter config.";
|
|
516
|
-
readonly properties: {
|
|
517
|
-
readonly appId: {
|
|
518
|
-
readonly type: "string";
|
|
519
|
-
readonly description: "Privy application id; required for this adapter to function.";
|
|
520
|
-
};
|
|
521
|
-
readonly clientId: {
|
|
522
|
-
readonly type: "string";
|
|
523
|
-
readonly description: "Optional Privy client id.";
|
|
524
|
-
};
|
|
525
|
-
readonly methods: {
|
|
526
|
-
readonly type: "array";
|
|
527
|
-
readonly description: "Login methods this adapter offers; default per adapter when omitted.";
|
|
528
|
-
readonly items: {
|
|
529
|
-
readonly type: "string";
|
|
530
|
-
};
|
|
531
|
-
};
|
|
532
|
-
};
|
|
533
|
-
};
|
|
534
|
-
};
|
|
535
|
-
};
|
|
536
|
-
};
|
|
537
|
-
};
|
|
538
|
-
readonly sentry: {
|
|
539
|
-
readonly type: "object";
|
|
540
|
-
readonly additionalProperties: false;
|
|
541
|
-
readonly description: "Sentry error-tracking coordinates. Set `dsn` to enable Sentry; leave `dsn` null to disable. The Sentry release tag stays build-time (stamped via Vite's `define` from WORKSPACE_VERSION) so it always matches the sourcemaps uploaded by CI.";
|
|
542
|
-
readonly properties: {
|
|
543
|
-
readonly dsn: {
|
|
544
|
-
readonly type: readonly ["string", "null"];
|
|
545
|
-
readonly description: "Sentry DSN URL. `null` disables Sentry entirely; the SPA never loads the Sentry SDK chunk.";
|
|
546
|
-
readonly default: null;
|
|
547
|
-
};
|
|
548
|
-
readonly env: {
|
|
549
|
-
readonly type: "string";
|
|
550
|
-
readonly description: "Sentry environment label, surfaced as the `environment` tag on every event.";
|
|
551
|
-
readonly default: "dev";
|
|
552
|
-
};
|
|
553
|
-
readonly tracing: {
|
|
554
|
-
readonly type: "boolean";
|
|
555
|
-
readonly description: "Enable Sentry performance tracing.";
|
|
556
|
-
readonly default: false;
|
|
557
|
-
};
|
|
558
|
-
};
|
|
559
|
-
};
|
|
560
|
-
readonly instance: {
|
|
561
|
-
readonly type: "object";
|
|
562
|
-
readonly additionalProperties: false;
|
|
563
|
-
readonly required: readonly ["namespace", "reactorWorker"];
|
|
564
|
-
readonly description: "Per-instance identity. Lets one origin host multiple isolated Connect instances, each with its own storage + SharedWorker namespace.";
|
|
565
|
-
readonly properties: {
|
|
566
|
-
readonly namespace: {
|
|
567
|
-
readonly type: readonly ["string", "null"];
|
|
568
|
-
readonly description: "Explicit storage/SharedWorker namespace for this instance. `null` derives it from the base path (and, later, the configured endpoint), so root deployments stay byte-identical.";
|
|
569
|
-
readonly default: null;
|
|
570
|
-
};
|
|
571
|
-
readonly reactorWorker: {
|
|
572
|
-
readonly type: "boolean";
|
|
573
|
-
readonly description: "Host the reactor in a shared worker instead of on the main thread. Off by default; the main-thread reactor stays the proven path until cutover is verified.";
|
|
574
|
-
readonly default: false;
|
|
575
|
-
};
|
|
576
|
-
};
|
|
577
|
-
};
|
|
578
|
-
readonly reactor: {
|
|
579
|
-
readonly type: "object";
|
|
580
|
-
readonly additionalProperties: false;
|
|
581
|
-
readonly description: "Settings for the reactor Connect runs in the browser, on the main thread or in the shared worker alike.";
|
|
582
|
-
readonly properties: {
|
|
583
|
-
readonly featureFlags: {
|
|
584
|
-
readonly type: "object";
|
|
585
|
-
readonly additionalProperties: false;
|
|
586
|
-
readonly description: "Enforcement flags. Each implies its predecessors, and the reactor refuses to boot on a set that names a later flag without an earlier one. These are consensus settings: a Connect syncing with a fleet must carry the same flags the fleet does, or the two reach different replay outcomes for the same history and diverge.";
|
|
587
|
-
readonly properties: {
|
|
588
|
-
readonly documentDecisions: {
|
|
589
|
-
readonly type: "boolean";
|
|
590
|
-
readonly description: "Decide writes from the document stream rather than the document meta cache, so a backdated deletion denies the operations that sort after it.";
|
|
591
|
-
readonly default: false;
|
|
592
|
-
};
|
|
593
|
-
readonly authEnforcement: {
|
|
594
|
-
readonly type: "boolean";
|
|
595
|
-
readonly description: "Enforce the auth scope's policy at admission, replay, and read. Requires documentDecisions.";
|
|
596
|
-
readonly default: false;
|
|
597
|
-
};
|
|
598
|
-
readonly authGroups: {
|
|
599
|
-
readonly type: "boolean";
|
|
600
|
-
readonly description: "Let `{ group }` principals match against the rosters of the group documents a policy names. Requires authEnforcement.";
|
|
601
|
-
readonly default: false;
|
|
602
|
-
};
|
|
603
|
-
readonly authConditions: {
|
|
604
|
-
readonly type: "boolean";
|
|
605
|
-
readonly description: "Evaluate `where` and `match` conditions on grants. Requires authGroups. Do not enable on a fleet `preflight:auth` reports as crossing a reducer version.";
|
|
606
|
-
readonly default: false;
|
|
607
|
-
};
|
|
608
|
-
};
|
|
609
|
-
};
|
|
610
|
-
};
|
|
611
|
-
};
|
|
612
|
-
readonly pwa: {
|
|
613
|
-
readonly type: "object";
|
|
614
|
-
readonly additionalProperties: false;
|
|
615
|
-
readonly description: "Progressive-web-app / service-worker overrides, layered on Connect's built-in PWA defaults at build time. Scalar fields deep-merge (this layer wins); the array members (icons, file_handlers, globs, runtimeCaching and denylist patterns) are additive; maximumFileSizeToCacheInBytes takes the max across contributors. (categories is not set here \u2014 it is derived from the manifest's category field.) Only applied when connect.app.offline is true.";
|
|
616
|
-
readonly properties: {
|
|
617
|
-
readonly manifest: {
|
|
618
|
-
readonly type: "object";
|
|
619
|
-
readonly additionalProperties: false;
|
|
620
|
-
readonly description: "Web-app-manifest field overrides.";
|
|
621
|
-
readonly properties: {
|
|
622
|
-
readonly name: {
|
|
623
|
-
readonly type: "string";
|
|
624
|
-
};
|
|
625
|
-
readonly short_name: {
|
|
626
|
-
readonly type: "string";
|
|
627
|
-
};
|
|
628
|
-
readonly description: {
|
|
629
|
-
readonly type: "string";
|
|
630
|
-
};
|
|
631
|
-
readonly theme_color: {
|
|
632
|
-
readonly type: "string";
|
|
633
|
-
};
|
|
634
|
-
readonly background_color: {
|
|
635
|
-
readonly type: "string";
|
|
636
|
-
};
|
|
637
|
-
readonly display: {
|
|
638
|
-
readonly type: "string";
|
|
639
|
-
readonly enum: readonly ["fullscreen", "standalone", "minimal-ui", "browser"];
|
|
640
|
-
};
|
|
641
|
-
readonly start_url: {
|
|
642
|
-
readonly type: "string";
|
|
643
|
-
};
|
|
644
|
-
readonly scope: {
|
|
645
|
-
readonly type: "string";
|
|
646
|
-
};
|
|
647
|
-
readonly icons: {
|
|
648
|
-
readonly type: "array";
|
|
649
|
-
readonly description: "Icons appended to the built-in set and de-duplicated by (src, sizes, purpose).";
|
|
650
|
-
readonly items: {
|
|
651
|
-
readonly type: "object";
|
|
652
|
-
readonly additionalProperties: false;
|
|
653
|
-
readonly required: readonly ["src"];
|
|
654
|
-
readonly properties: {
|
|
655
|
-
readonly src: {
|
|
656
|
-
readonly type: "string";
|
|
657
|
-
};
|
|
658
|
-
readonly sizes: {
|
|
659
|
-
readonly type: "string";
|
|
660
|
-
};
|
|
661
|
-
readonly type: {
|
|
662
|
-
readonly type: "string";
|
|
663
|
-
};
|
|
664
|
-
readonly purpose: {
|
|
665
|
-
readonly type: "string";
|
|
666
|
-
};
|
|
667
|
-
};
|
|
668
|
-
};
|
|
669
|
-
};
|
|
670
|
-
readonly file_handlers: {
|
|
671
|
-
readonly type: "array";
|
|
672
|
-
readonly description: "File associations appended after Connect's built-in .phd/.phdm handler and de-duplicated on the whole entry. Entries only declare accepted types; there is no action field, because opening the files requires Connect's own runtime handling, so every handler opens at the app root.";
|
|
673
|
-
readonly items: {
|
|
674
|
-
readonly type: "object";
|
|
675
|
-
readonly additionalProperties: false;
|
|
676
|
-
readonly required: readonly ["accept"];
|
|
677
|
-
readonly properties: {
|
|
678
|
-
readonly accept: {
|
|
679
|
-
readonly type: "object";
|
|
680
|
-
readonly description: "MIME type \u2192 file extensions. Each extension must start with '.'; browsers ignore entries without it.";
|
|
681
|
-
readonly additionalProperties: {
|
|
682
|
-
readonly type: "array";
|
|
683
|
-
readonly items: {
|
|
684
|
-
readonly type: "string";
|
|
685
|
-
readonly pattern: "^\\.";
|
|
686
|
-
};
|
|
687
|
-
};
|
|
688
|
-
};
|
|
689
|
-
readonly icons: {
|
|
690
|
-
readonly type: "array";
|
|
691
|
-
readonly description: "OS-level file-type icons.";
|
|
692
|
-
readonly items: {
|
|
693
|
-
readonly type: "object";
|
|
694
|
-
readonly additionalProperties: false;
|
|
695
|
-
readonly required: readonly ["src"];
|
|
696
|
-
readonly properties: {
|
|
697
|
-
readonly src: {
|
|
698
|
-
readonly type: "string";
|
|
699
|
-
};
|
|
700
|
-
readonly sizes: {
|
|
701
|
-
readonly type: "string";
|
|
702
|
-
};
|
|
703
|
-
readonly type: {
|
|
704
|
-
readonly type: "string";
|
|
705
|
-
};
|
|
706
|
-
readonly purpose: {
|
|
707
|
-
readonly type: "string";
|
|
708
|
-
};
|
|
709
|
-
};
|
|
710
|
-
};
|
|
711
|
-
};
|
|
712
|
-
readonly launch_type: {
|
|
713
|
-
readonly type: "string";
|
|
714
|
-
readonly enum: readonly ["single-client", "multiple-clients"];
|
|
715
|
-
};
|
|
716
|
-
};
|
|
717
|
-
};
|
|
718
|
-
};
|
|
719
|
-
readonly launch_handler: {
|
|
720
|
-
readonly type: "object";
|
|
721
|
-
readonly additionalProperties: false;
|
|
722
|
-
readonly required: readonly ["client_mode"];
|
|
723
|
-
readonly description: "How the OS launches the app for handled files/links. Connect defaults to focus-existing.";
|
|
724
|
-
readonly properties: {
|
|
725
|
-
readonly client_mode: {
|
|
726
|
-
readonly type: "string";
|
|
727
|
-
readonly enum: readonly ["auto", "focus-existing", "navigate-existing", "navigate-new"];
|
|
728
|
-
};
|
|
729
|
-
};
|
|
730
|
-
};
|
|
731
|
-
};
|
|
732
|
-
};
|
|
733
|
-
readonly globPatterns: {
|
|
734
|
-
readonly type: "array";
|
|
735
|
-
readonly items: {
|
|
736
|
-
readonly type: "string";
|
|
737
|
-
};
|
|
738
|
-
readonly description: "Extra Workbox precache globs, unioned with the built-ins.";
|
|
739
|
-
};
|
|
740
|
-
readonly globIgnores: {
|
|
741
|
-
readonly type: "array";
|
|
742
|
-
readonly items: {
|
|
743
|
-
readonly type: "string";
|
|
744
|
-
};
|
|
745
|
-
readonly description: "Extra precache ignore globs, unioned with the built-ins.";
|
|
746
|
-
};
|
|
747
|
-
readonly maximumFileSizeToCacheInBytes: {
|
|
748
|
-
readonly type: "number";
|
|
749
|
-
readonly description: "Raise the precache file-size ceiling. The max across all contributors wins, so no contributor can shrink another's limit.";
|
|
750
|
-
};
|
|
751
|
-
readonly runtimeCaching: {
|
|
752
|
-
readonly type: "array";
|
|
753
|
-
readonly description: "Runtime-caching rules appended after the built-in rules. Workbox is first-match-wins, so these cannot override a built-in rule matching the same URL.";
|
|
754
|
-
readonly items: {
|
|
755
|
-
readonly type: "object";
|
|
756
|
-
readonly additionalProperties: false;
|
|
757
|
-
readonly required: readonly ["urlPattern", "handler"];
|
|
758
|
-
readonly properties: {
|
|
759
|
-
readonly urlPattern: {
|
|
760
|
-
readonly description: "URL match. A string is matched verbatim by Workbox; { source, flags } is rebuilt into a RegExp at build time.";
|
|
761
|
-
readonly oneOf: readonly [{
|
|
762
|
-
readonly type: "string";
|
|
763
|
-
}, {
|
|
764
|
-
readonly type: "object";
|
|
765
|
-
readonly additionalProperties: false;
|
|
766
|
-
readonly required: readonly ["source"];
|
|
767
|
-
readonly properties: {
|
|
768
|
-
readonly source: {
|
|
769
|
-
readonly type: "string";
|
|
770
|
-
readonly description: "RegExp source.";
|
|
771
|
-
};
|
|
772
|
-
readonly flags: {
|
|
773
|
-
readonly type: "string";
|
|
774
|
-
readonly description: "RegExp flags (e.g. 'i').";
|
|
775
|
-
};
|
|
776
|
-
};
|
|
777
|
-
}];
|
|
778
|
-
};
|
|
779
|
-
readonly handler: {
|
|
780
|
-
readonly type: "string";
|
|
781
|
-
readonly enum: readonly ["CacheFirst", "CacheOnly", "NetworkFirst", "NetworkOnly", "StaleWhileRevalidate"];
|
|
782
|
-
};
|
|
783
|
-
readonly method: {
|
|
784
|
-
readonly type: "string";
|
|
785
|
-
readonly enum: readonly ["GET", "POST", "PUT", "DELETE", "HEAD", "PATCH"];
|
|
786
|
-
};
|
|
787
|
-
readonly options: {
|
|
788
|
-
readonly type: "object";
|
|
789
|
-
readonly additionalProperties: false;
|
|
790
|
-
readonly properties: {
|
|
791
|
-
readonly cacheName: {
|
|
792
|
-
readonly type: "string";
|
|
793
|
-
};
|
|
794
|
-
readonly networkTimeoutSeconds: {
|
|
795
|
-
readonly type: "number";
|
|
796
|
-
readonly description: "Seconds a NetworkFirst rule waits for the network before falling back to the cache.";
|
|
797
|
-
};
|
|
798
|
-
readonly expiration: {
|
|
799
|
-
readonly type: "object";
|
|
800
|
-
readonly additionalProperties: false;
|
|
801
|
-
readonly properties: {
|
|
802
|
-
readonly maxEntries: {
|
|
803
|
-
readonly type: "number";
|
|
804
|
-
};
|
|
805
|
-
readonly maxAgeSeconds: {
|
|
806
|
-
readonly type: "number";
|
|
807
|
-
};
|
|
808
|
-
};
|
|
809
|
-
};
|
|
810
|
-
readonly cacheableResponse: {
|
|
811
|
-
readonly type: "object";
|
|
812
|
-
readonly additionalProperties: false;
|
|
813
|
-
readonly properties: {
|
|
814
|
-
readonly statuses: {
|
|
815
|
-
readonly type: "array";
|
|
816
|
-
readonly items: {
|
|
817
|
-
readonly type: "number";
|
|
818
|
-
};
|
|
819
|
-
};
|
|
820
|
-
readonly headers: {
|
|
821
|
-
readonly type: "object";
|
|
822
|
-
readonly additionalProperties: {
|
|
823
|
-
readonly type: "string";
|
|
824
|
-
};
|
|
825
|
-
};
|
|
826
|
-
};
|
|
827
|
-
};
|
|
828
|
-
};
|
|
829
|
-
};
|
|
830
|
-
};
|
|
831
|
-
};
|
|
832
|
-
};
|
|
833
|
-
readonly navigateFallbackDenylist: {
|
|
834
|
-
readonly type: "array";
|
|
835
|
-
readonly description: "Extra SPA navigate-fallback denylist patterns, unioned with the built-ins.";
|
|
836
|
-
readonly items: {
|
|
837
|
-
readonly description: "URL match. A string is matched verbatim by Workbox; { source, flags } is rebuilt into a RegExp at build time.";
|
|
838
|
-
readonly oneOf: readonly [{
|
|
839
|
-
readonly type: "string";
|
|
840
|
-
}, {
|
|
841
|
-
readonly type: "object";
|
|
842
|
-
readonly additionalProperties: false;
|
|
843
|
-
readonly required: readonly ["source"];
|
|
844
|
-
readonly properties: {
|
|
845
|
-
readonly source: {
|
|
846
|
-
readonly type: "string";
|
|
847
|
-
readonly description: "RegExp source.";
|
|
848
|
-
};
|
|
849
|
-
readonly flags: {
|
|
850
|
-
readonly type: "string";
|
|
851
|
-
readonly description: "RegExp flags (e.g. 'i').";
|
|
852
|
-
};
|
|
853
|
-
};
|
|
854
|
-
}];
|
|
855
|
-
};
|
|
856
|
-
};
|
|
857
|
-
};
|
|
858
|
-
};
|
|
859
|
-
};
|
|
860
|
-
};
|
|
828
|
+
readonly connect: import("@powerhousedao/shared/connect").JsonSchemaFragment;
|
|
861
829
|
};
|
|
862
830
|
};
|
|
863
831
|
//#endregion
|
|
864
832
|
//#region connect-utils/vite-config.d.ts
|
|
865
|
-
declare function getConnectHtmlTags(options?: {
|
|
833
|
+
export declare function getConnectHtmlTags(options?: {
|
|
866
834
|
registryUrl?: string | null;
|
|
867
835
|
injectTo?: HtmlTagDescriptor["injectTo"];
|
|
868
836
|
}): [{
|
|
@@ -871,84 +839,76 @@ declare function getConnectHtmlTags(options?: {
|
|
|
871
839
|
readonly "http-equiv": "Content-Security-Policy";
|
|
872
840
|
readonly content: `script-src 'self' 'unsafe-inline' 'unsafe-eval'${string}; worker-src 'self' blob:; object-src 'none'; base-uri 'self';`;
|
|
873
841
|
};
|
|
874
|
-
readonly injectTo: "
|
|
842
|
+
readonly injectTo: "body" | "body-prepend" | "head" | "head-prepend";
|
|
875
843
|
}, {
|
|
876
844
|
readonly tag: "meta";
|
|
877
845
|
readonly attrs: {
|
|
878
846
|
readonly property: "og:title";
|
|
879
847
|
readonly content: "Connect";
|
|
880
848
|
};
|
|
881
|
-
readonly injectTo: "
|
|
849
|
+
readonly injectTo: "body" | "body-prepend" | "head" | "head-prepend";
|
|
882
850
|
}, {
|
|
883
851
|
readonly tag: "meta";
|
|
884
852
|
readonly attrs: {
|
|
885
853
|
readonly property: "og:type";
|
|
886
854
|
readonly content: "website";
|
|
887
855
|
};
|
|
888
|
-
readonly injectTo: "
|
|
856
|
+
readonly injectTo: "body" | "body-prepend" | "head" | "head-prepend";
|
|
889
857
|
}, {
|
|
890
858
|
readonly tag: "meta";
|
|
891
859
|
readonly attrs: {
|
|
892
860
|
readonly property: "og:url";
|
|
893
861
|
readonly content: "https://apps.powerhouse.io/powerhouse/connect/";
|
|
894
862
|
};
|
|
895
|
-
readonly injectTo: "
|
|
863
|
+
readonly injectTo: "body" | "body-prepend" | "head" | "head-prepend";
|
|
896
864
|
}, {
|
|
897
865
|
readonly tag: "meta";
|
|
898
866
|
readonly attrs: {
|
|
899
867
|
readonly property: "og:description";
|
|
900
868
|
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.";
|
|
901
869
|
};
|
|
902
|
-
readonly injectTo: "
|
|
870
|
+
readonly injectTo: "body" | "body-prepend" | "head" | "head-prepend";
|
|
903
871
|
}, {
|
|
904
872
|
readonly tag: "meta";
|
|
905
873
|
readonly attrs: {
|
|
906
874
|
readonly property: "og:image";
|
|
907
875
|
readonly content: "https://cf-ipfs.com/ipfs/bafkreigrmclndf2jpbolaq22535q2sw5t44uad3az3dpvkzrnt4lpjt63e";
|
|
908
876
|
};
|
|
909
|
-
readonly injectTo: "
|
|
877
|
+
readonly injectTo: "body" | "body-prepend" | "head" | "head-prepend";
|
|
910
878
|
}, {
|
|
911
879
|
readonly tag: "meta";
|
|
912
880
|
readonly attrs: {
|
|
913
881
|
readonly name: "twitter:card";
|
|
914
882
|
readonly content: "summary_large_image";
|
|
915
883
|
};
|
|
916
|
-
readonly injectTo: "
|
|
884
|
+
readonly injectTo: "body" | "body-prepend" | "head" | "head-prepend";
|
|
917
885
|
}, {
|
|
918
886
|
readonly tag: "meta";
|
|
919
887
|
readonly attrs: {
|
|
920
888
|
readonly name: "twitter:image";
|
|
921
889
|
readonly content: "https://cf-ipfs.com/ipfs/bafkreigrmclndf2jpbolaq22535q2sw5t44uad3az3dpvkzrnt4lpjt63e";
|
|
922
890
|
};
|
|
923
|
-
readonly injectTo: "
|
|
891
|
+
readonly injectTo: "body" | "body-prepend" | "head" | "head-prepend";
|
|
924
892
|
}, {
|
|
925
893
|
readonly tag: "meta";
|
|
926
894
|
readonly attrs: {
|
|
927
895
|
readonly name: "twitter:title";
|
|
928
896
|
readonly content: "Connect";
|
|
929
897
|
};
|
|
930
|
-
readonly injectTo: "
|
|
898
|
+
readonly injectTo: "body" | "body-prepend" | "head" | "head-prepend";
|
|
931
899
|
}, {
|
|
932
900
|
readonly tag: "meta";
|
|
933
901
|
readonly attrs: {
|
|
934
902
|
readonly name: "twitter:description";
|
|
935
903
|
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.";
|
|
936
904
|
};
|
|
937
|
-
readonly injectTo: "
|
|
905
|
+
readonly injectTo: "body" | "body-prepend" | "head" | "head-prepend";
|
|
938
906
|
}];
|
|
939
|
-
declare function getConnectBaseViteConfig(options: IConnectOptions): InlineConfig;
|
|
907
|
+
export declare function getConnectBaseViteConfig(options: IConnectOptions): InlineConfig;
|
|
940
908
|
//#endregion
|
|
941
909
|
//#region connect-utils/vite-plugins/dynamic-base.d.ts
|
|
942
|
-
/**
|
|
943
|
-
|
|
944
|
-
* `base` option is set to this token; this plugin rewrites it in the emitted
|
|
945
|
-
* output so the effective base is resolved at serve time from a global instead
|
|
946
|
-
* of being baked at build time.
|
|
947
|
-
*
|
|
948
|
-
* Trailing slash matches `normalizeBasePath` output, so the token sits in the
|
|
949
|
-
* same syntactic position as a concrete base would.
|
|
950
|
-
*/
|
|
951
|
-
declare const DYNAMIC_BASE_PLACEHOLDER = "/__PH_DYNAMIC_BASE__/";
|
|
910
|
+
/** Rewrites `url(<placeholder>assets/x)` relative to the stylesheet at `fileName`. */
|
|
911
|
+
export declare function relativeCssUrls(css: string, fileName: string): string;
|
|
952
912
|
/**
|
|
953
913
|
* Rewrites the placeholder base in emitted JS chunks to a runtime expression so
|
|
954
914
|
* one built `dist/connect` serves under any subpath. Rolldown-native: per-match
|
|
@@ -973,21 +933,23 @@ declare const DYNAMIC_BASE_PLACEHOLDER = "/__PH_DYNAMIC_BASE__/";
|
|
|
973
933
|
* (the same proxy also sets the runtime global for the JS rewrite). See the
|
|
974
934
|
* plugin's module doc / report for the exact serve-time contract.
|
|
975
935
|
*
|
|
976
|
-
* CSS `url(...)` references
|
|
977
|
-
*
|
|
978
|
-
*
|
|
936
|
+
* CSS `url(...)` references that Vite emits with the placeholder (e.g. bundled
|
|
937
|
+
* fonts) are rewritten relative to the stylesheet, which the HTML substitution
|
|
938
|
+
* already loads from the right prefix.
|
|
979
939
|
*/
|
|
980
|
-
declare function connectDynamicBasePlugin(options?: {
|
|
940
|
+
export declare function connectDynamicBasePlugin(options?: {
|
|
981
941
|
forWorker?: boolean;
|
|
982
942
|
workerStripPrefix?: string;
|
|
983
943
|
}): Plugin;
|
|
984
|
-
declare function escapeForRegExp(s: string): string;
|
|
944
|
+
export declare function escapeForRegExp(s: string): string;
|
|
985
945
|
//#endregion
|
|
986
946
|
//#region connect-utils/vite-plugins/ph-config.d.ts
|
|
987
|
-
type PhConfigPluginOptions = {
|
|
947
|
+
export type PhConfigPluginOptions = {
|
|
988
948
|
packages: PowerhousePackage[];
|
|
989
949
|
projectRoot?: string;
|
|
990
950
|
connect?: PHConnectRuntimeConfig;
|
|
951
|
+
/** The source's top-level `workflows` block; `connect.app.workflowsEnabled` falls back to it. */
|
|
952
|
+
workflows?: PowerhouseConfig["workflows"];
|
|
991
953
|
/**
|
|
992
954
|
* Project-wide package registry URL — the effective value (CLI override
|
|
993
955
|
* `??` source) the caller has already resolved. Copied verbatim into the
|
|
@@ -1001,8 +963,24 @@ type PhConfigPluginOptions = {
|
|
|
1001
963
|
* See clis/ph-cli/src/utils/cli-connect-override.ts.
|
|
1002
964
|
*/
|
|
1003
965
|
cliConnectOverride?: PHConnectRuntimeConfig;
|
|
966
|
+
/**
|
|
967
|
+
* The resolved `connect.branding` (images as data URIs, null = default),
|
|
968
|
+
* computed once by the Vite config from the same ladder. Replaces the
|
|
969
|
+
* merged block, so the browser never sees a project path.
|
|
970
|
+
*/
|
|
971
|
+
branding?: PHConnectBranding;
|
|
972
|
+
};
|
|
973
|
+
/** `html` with its `<title>` text set to `appName`, when one is configured. */
|
|
974
|
+
export declare function withAppTitle(html: string, appName: string | undefined): string;
|
|
975
|
+
type PhConfigApi = {
|
|
976
|
+
connect: PHConnectRuntimeConfig;
|
|
977
|
+
favicon?: string;
|
|
978
|
+
};
|
|
979
|
+
/** `api.connect`: the connect config the app is served, for plugins that render
|
|
980
|
+
* ahead of it; `api.favicon`: its `branding.favicon`, which it leaves out. */
|
|
981
|
+
export declare function phConfigPlugin(options: PhConfigPluginOptions): Plugin<PhConfigApi> & {
|
|
982
|
+
api: PhConfigApi;
|
|
1004
983
|
};
|
|
1005
|
-
declare function phConfigPlugin(options: PhConfigPluginOptions): Plugin;
|
|
1006
984
|
//#endregion
|
|
1007
985
|
//#region connect-utils/vite-plugins/theme-boot.d.ts
|
|
1008
986
|
/**
|
|
@@ -1010,13 +988,21 @@ declare function phConfigPlugin(options: PhConfigPluginOptions): Plugin;
|
|
|
1010
988
|
* ph-clint connect proxy) and this plugin both check it, so the script is
|
|
1011
989
|
* applied exactly once no matter which layer runs first.
|
|
1012
990
|
*/
|
|
1013
|
-
declare const THEME_BOOT_MARKER = "data-ph-theme-boot";
|
|
991
|
+
export declare const THEME_BOOT_MARKER = "data-ph-theme-boot";
|
|
1014
992
|
/**
|
|
1015
993
|
* Injects the theme boot script at the top of `<head>` of every emitted
|
|
1016
994
|
* index.html, so built Connect apps render the stored theme from first paint
|
|
1017
995
|
* without depending on a serve-time injector.
|
|
1018
996
|
*/
|
|
1019
|
-
declare function connectThemeBootPlugin(): Plugin;
|
|
997
|
+
export declare function connectThemeBootPlugin(): Plugin;
|
|
998
|
+
//#endregion
|
|
999
|
+
//#region connect-utils/vite-plugins/vendor-import-map.d.ts
|
|
1000
|
+
export type VendorImportMapOptions = {
|
|
1001
|
+
/** bare specifier -> URL (already base-prefixed by the caller). */
|
|
1002
|
+
imports: Record<string, string>;
|
|
1003
|
+
};
|
|
1004
|
+
export declare function vendorImportMapPlugin(options: VendorImportMapOptions): Plugin;
|
|
1020
1005
|
//#endregion
|
|
1021
|
-
export {
|
|
1006
|
+
export { DYNAMIC_BASE_PLACEHOLDER };
|
|
1007
|
+
export {};
|
|
1022
1008
|
//# sourceMappingURL=index.d.mts.map
|