@powerhousedao/builder-tools 6.2.3-dev.6 → 6.2.3-dev.61
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 +406 -79
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +1059 -82
- package/dist/index.mjs.map +1 -1
- package/dist/service-worker/service-worker.ts +8 -2
- package/package.json +10 -10
package/dist/index.d.mts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
+
import { DYNAMIC_BASE_PLACEHOLDER } from "@powerhousedao/shared/connect";
|
|
1
2
|
import { CommonServerOptions, HtmlTagDescriptor, InlineConfig, Plugin } from "vite";
|
|
2
3
|
import { PowerhouseConfig, PowerhousePackage } from "@powerhousedao/config";
|
|
3
|
-
import { PHConnectRuntimeConfig } from "@powerhousedao/shared/clis";
|
|
4
|
-
|
|
4
|
+
import { PHConnectRuntimeConfig, PowerhouseConfig as PowerhouseConfig$1 } from "@powerhousedao/shared/clis";
|
|
5
5
|
//#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";
|
|
6
|
+
export declare const EXTERNAL_PACKAGES_IMPORT = "PH:EXTERNAL_PACKAGES";
|
|
7
|
+
export declare const IMPORT_SCRIPT_FILE = "external-packages.js";
|
|
8
|
+
export declare const LOCAL_PACKAGE_ID = "ph:local-package";
|
|
9
|
+
export declare const PH_DIR_NAME = ".ph";
|
|
10
10
|
//#endregion
|
|
11
11
|
//#region connect-utils/vite-plugins/build-hash.d.ts
|
|
12
12
|
/** Name of the build-identity file emitted into the build output. */
|
|
13
|
-
declare const BUILD_HASH_FILE: "build-hash.json";
|
|
14
|
-
interface BuildHashInput {
|
|
13
|
+
export declare const BUILD_HASH_FILE: "build-hash.json";
|
|
14
|
+
export interface BuildHashInput {
|
|
15
15
|
/** Monorepo workspace git SHA (CI/dev builds); empty outside the monorepo. */
|
|
16
16
|
workspaceGitSha: string;
|
|
17
17
|
/** Monorepo workspace version (CI/dev builds); empty outside it. */
|
|
@@ -38,8 +38,8 @@ interface BuildHashInput {
|
|
|
38
38
|
* (define `PH_CONNECT_BUILD_HASH`) to `build-hash.json`, which the build
|
|
39
39
|
* emits alongside the app and the server must serve no-cache.
|
|
40
40
|
*/
|
|
41
|
-
declare function computeBuildHash(input: BuildHashInput): string;
|
|
42
|
-
declare function buildHashFromBuildOptions(options: {
|
|
41
|
+
export declare function computeBuildHash(input: BuildHashInput): string;
|
|
42
|
+
export declare function buildHashFromBuildOptions(options: {
|
|
43
43
|
dirname: string;
|
|
44
44
|
phConfig: unknown;
|
|
45
45
|
packages: ReadonlyArray<{
|
|
@@ -57,13 +57,13 @@ declare function buildHashFromBuildOptions(options: {
|
|
|
57
57
|
* Build-only: dev (studio) never runs generateBundle, and the SPA check
|
|
58
58
|
* treats a missing file as "nothing to compare" and stays silent.
|
|
59
59
|
*/
|
|
60
|
-
declare function connectBuildHashPlugin(buildHash: string): Plugin;
|
|
60
|
+
export declare function connectBuildHashPlugin(buildHash: string): Plugin;
|
|
61
61
|
//#endregion
|
|
62
62
|
//#region connect-utils/externalize-vendor.d.ts
|
|
63
|
-
interface VendorPrebuildOptions {
|
|
64
|
-
/** Project root
|
|
63
|
+
export interface VendorPrebuildOptions {
|
|
64
|
+
/** Project root the vendor deps resolve from. */
|
|
65
65
|
dirname: string;
|
|
66
|
-
/**
|
|
66
|
+
/** Specifiers to prebuild into the vendor (defaults to the dev set). */
|
|
67
67
|
include?: string[];
|
|
68
68
|
/** Specifiers left external to the build (defaults to the React family). */
|
|
69
69
|
external?: string[];
|
|
@@ -73,35 +73,305 @@ interface VendorPrebuildOptions {
|
|
|
73
73
|
errorRef?: {
|
|
74
74
|
message?: string;
|
|
75
75
|
};
|
|
76
|
+
/**
|
|
77
|
+
* The APP's base — the same string the app build uses (the dynamic-base
|
|
78
|
+
* placeholder, or a normalized deploy base like "/app/"). The vendor's own
|
|
79
|
+
* build base is this plus the vendor segment, so emitted asset URLs land
|
|
80
|
+
* under <app-base>__vendor__/. Default: the dynamic placeholder + segment
|
|
81
|
+
* (dev behavior). Import-map values stay base-relative; the production
|
|
82
|
+
* build strips the leading slash (values then resolve against the page URL
|
|
83
|
+
* under any deploy base), the dev flow prefixes its own base.
|
|
84
|
+
*/
|
|
85
|
+
base?: string;
|
|
86
|
+
/** NODE_ENV define for the vendor build (default "development"). */
|
|
87
|
+
nodeEnv?: "development" | "production";
|
|
76
88
|
}
|
|
77
89
|
/**
|
|
78
90
|
* The stable Connect libraries worth prebuilding. The React family is NOT here —
|
|
79
91
|
* it's externalized from the build (see `VENDOR_EXTERNAL`) so the vendor shares
|
|
80
92
|
* the dev server's single React instance via the import map.
|
|
81
93
|
*/
|
|
82
|
-
declare const DEFAULT_VENDOR_INCLUDE: string[];
|
|
94
|
+
export declare const DEFAULT_VENDOR_INCLUDE: string[];
|
|
83
95
|
/**
|
|
84
96
|
* React-family specifiers kept external to the vendor build. The vendor's chunks
|
|
85
97
|
* emit bare imports for these; `devReactImportmapPlugin`'s import map resolves
|
|
86
98
|
* them to Vite's pre-bundled React, so there is exactly one React instance.
|
|
87
99
|
*/
|
|
88
|
-
declare const VENDOR_EXTERNAL: string[];
|
|
89
|
-
interface PrebuiltVendor {
|
|
100
|
+
export declare const VENDOR_EXTERNAL: string[];
|
|
101
|
+
export interface PrebuiltVendor {
|
|
90
102
|
vendorDir: string;
|
|
91
|
-
/** import map: bare specifier -> "/__vendor__/<entry>.js". */
|
|
103
|
+
/** import map: bare specifier -> "/__vendor__/<entry>.js" (base-relative). */
|
|
92
104
|
imports: Record<string, string>;
|
|
105
|
+
/** Resolved versions of every included + external package. */
|
|
106
|
+
versions: Record<string, string>;
|
|
93
107
|
}
|
|
94
108
|
/** URL prefix the vendor bundle is served under by the dev middleware. */
|
|
95
|
-
declare const VENDOR_URL_PREFIX = "/__vendor__/";
|
|
109
|
+
export declare const VENDOR_URL_PREFIX = "/__vendor__/";
|
|
96
110
|
/**
|
|
97
111
|
* Build the prebuilt vendor (once, in a throwaway subprocess) and return its dir
|
|
98
112
|
* + import map. Idempotent: reuses a cached vendor built for the same dep set.
|
|
99
113
|
* Returns null on any failure (caller falls back to a normal dev server).
|
|
100
114
|
*/
|
|
101
|
-
declare function prebuildConnectVendor(options: VendorPrebuildOptions): Promise<PrebuiltVendor | null>;
|
|
115
|
+
export declare function prebuildConnectVendor(options: VendorPrebuildOptions): Promise<PrebuiltVendor | null>;
|
|
116
|
+
export declare const LOCK_STALE_MS: number;
|
|
117
|
+
export interface VendorLock {
|
|
118
|
+
dir: string;
|
|
119
|
+
token: string;
|
|
120
|
+
timer: ReturnType<typeof setInterval>;
|
|
121
|
+
}
|
|
122
|
+
export declare function acquireLock(lockDir: string): VendorLock | null;
|
|
123
|
+
export declare function releaseLock(lock: VendorLock): void;
|
|
124
|
+
/**
|
|
125
|
+
* The published specifiers whose entry file the vendor build never emitted.
|
|
126
|
+
* URLs are base-less (`/__vendor__/x.js`) and resolve inside `vendorDir`.
|
|
127
|
+
*/
|
|
128
|
+
export declare function missingVendorEntries(vendorDir: string, imports: Record<string, string>): {
|
|
129
|
+
spec: string;
|
|
130
|
+
url: string;
|
|
131
|
+
}[];
|
|
132
|
+
/**
|
|
133
|
+
* Rebase the vendor's base-less entry URLs (`/__vendor__/x.js`) onto the
|
|
134
|
+
* deploy base, so a consumer that resolves them against the page origin lands
|
|
135
|
+
* under that base rather than the server root. A dynamic-base build keeps its
|
|
136
|
+
* placeholder, which the runtime substitutes.
|
|
137
|
+
*
|
|
138
|
+
* `base` is the app base from `prebuildConnectVendor` callers, but the
|
|
139
|
+
* VENDOR_DYNAMIC_BASE default already carries the vendor segment — that
|
|
140
|
+
* trailing segment is dropped first so it is never doubled.
|
|
141
|
+
*/
|
|
142
|
+
export declare function withVendorBase(imports: Record<string, string>, base: string): Record<string, string>;
|
|
143
|
+
//#endregion
|
|
144
|
+
//#region connect-utils/reactor-worker-build.d.ts
|
|
145
|
+
/** URL prefix the worker bundle is served under, next to `__vendor__/`. */
|
|
146
|
+
export declare const REACTOR_WORKER_URL_PREFIX = "/__reactor_worker__/";
|
|
147
|
+
/** Entry filename of the bundle; the tab constructs its SharedWorker from it. */
|
|
148
|
+
export declare const REACTOR_WORKER_ENTRY = "reactor.worker.js";
|
|
149
|
+
/** Content-Type for the extensions the worker build emits; JS is the default. */
|
|
150
|
+
export declare const REACTOR_WORKER_MIME: Record<string, string>;
|
|
151
|
+
export interface ReactorWorkerVendorOptions {
|
|
152
|
+
/** The vendor's import map (`spec -> /__vendor__/<entry>.js`). */
|
|
153
|
+
imports: Record<string, string>;
|
|
154
|
+
/** The built vendor dir, needed to verify which entries are worker-safe. */
|
|
155
|
+
dir: string;
|
|
156
|
+
}
|
|
157
|
+
export interface ReactorWorkerBuildOptions {
|
|
158
|
+
/** Project root the worker's dependencies resolve from. */
|
|
159
|
+
dirname: string;
|
|
160
|
+
/** Directory to hold the bundle (e.g. `<dist>/__reactor_worker__`). */
|
|
161
|
+
outDir: string;
|
|
162
|
+
/**
|
|
163
|
+
* The prebuilt vendor to share dependencies with. Only the worker-safe
|
|
164
|
+
* subset of its entries is externalized (see
|
|
165
|
+
* {@link workerSafeVendorImports}); omit to bundle everything.
|
|
166
|
+
*/
|
|
167
|
+
vendor?: ReactorWorkerVendorOptions;
|
|
168
|
+
/**
|
|
169
|
+
* Worker entry to build. Defaults to the installed Connect dist's
|
|
170
|
+
* `reactor.worker.js`; tests inject a fixture entry here.
|
|
171
|
+
*/
|
|
172
|
+
entryPath?: string;
|
|
173
|
+
/** NODE_ENV define for the build (default "development"). */
|
|
174
|
+
nodeEnv?: "development" | "production";
|
|
175
|
+
/** Filled with the failure cause when the prebuild returns null. */
|
|
176
|
+
errorRef?: {
|
|
177
|
+
message?: string;
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
export interface PrebuiltReactorWorker {
|
|
181
|
+
outDir: string;
|
|
182
|
+
/** Entry filename inside outDir ({@link REACTOR_WORKER_ENTRY}). */
|
|
183
|
+
entry: string;
|
|
184
|
+
/**
|
|
185
|
+
* Digest of everything that shaped this bundle's output (see
|
|
186
|
+
* {@link computeSourceDigest}); identical for a cache hit and a fresh
|
|
187
|
+
* build. The dev plugin serves it in `worker-meta.json` next to the
|
|
188
|
+
* bundle; `apps/connect/src/utils/reactor-worker-url.ts` fetches it to
|
|
189
|
+
* fold the actual built worker code into the tab's version fingerprint
|
|
190
|
+
* (W0.6).
|
|
191
|
+
*/
|
|
192
|
+
sourceDigest: string;
|
|
193
|
+
/**
|
|
194
|
+
* The worker-safe vendor subset this bundle externalizes (see
|
|
195
|
+
* {@link workerSafeVendorImports}); empty without a vendor.
|
|
196
|
+
*/
|
|
197
|
+
vendorImports: Record<string, string>;
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* The installed Connect dist's worker entry, or null when the installed
|
|
201
|
+
* version predates the worker (the feature is then unavailable, not broken).
|
|
202
|
+
*/
|
|
203
|
+
export declare function resolveReactorWorkerSource(dirname: string): string | null;
|
|
204
|
+
/** `/__vendor__/<entry>.js` -> `../__vendor__/<entry>.js` (sibling dirs). */
|
|
205
|
+
export declare function vendorRelativePath(vendorUrl: string): string;
|
|
206
|
+
/**
|
|
207
|
+
* Module specifiers a worker cannot resolve: anything that is not relative,
|
|
208
|
+
* root-relative, or an http(s)/data/blob URL. Used as a post-build guard so a
|
|
209
|
+
* leftover bare (or `node:`) import fails the build with a name instead of
|
|
210
|
+
* shipping a worker that dies on its first import statement.
|
|
211
|
+
*
|
|
212
|
+
* Expects minified (comment-free) output: a raw-text scan cannot tell a real
|
|
213
|
+
* import from a JSDoc code sample, and unminified kysely/viem are full of the
|
|
214
|
+
* latter. The build below always minifies for exactly this reason.
|
|
215
|
+
*/
|
|
216
|
+
export declare function findDisallowedSpecifiers(code: string): string[];
|
|
217
|
+
/**
|
|
218
|
+
* Packages whose BUILT dist shapes the worker bundle's output even when
|
|
219
|
+
* connect's own dist/reactor.worker.js entry file did not change.
|
|
220
|
+
*
|
|
221
|
+
* That entry is a library artifact whose bare imports this build resolves
|
|
222
|
+
* through node_modules at BUILD time, so a rebuilt dist anywhere in its
|
|
223
|
+
* closure changes the bundle output without touching the entry file's own
|
|
224
|
+
* size/mtime. The list is DERIVED from the installed Connect's own
|
|
225
|
+
* dependencies rather than hardcoded: the bundle pulls `@renown/sdk`,
|
|
226
|
+
* `@powerhousedao/powerhouse-vetra-packages` and `@powerhousedao/shared` out
|
|
227
|
+
* of node_modules too, and a hardcoded pair left every one of those able to be
|
|
228
|
+
* rebuilt behind a cache hit. Connect's dependency list is the cheap stand-in
|
|
229
|
+
* for the resolved bundle graph: every workspace package the worker can reach
|
|
230
|
+
* is reachable through it, and a package not in the bundle only costs a readdir.
|
|
231
|
+
*/
|
|
232
|
+
export declare function upstreamWorkerPackages(dirname: string): string[];
|
|
233
|
+
/**
|
|
234
|
+
* This module's own installed version, read by walking up from its file to
|
|
235
|
+
* the nearest `package.json` named "@powerhousedao/builder-tools" (same
|
|
236
|
+
* technique as `build-hash.ts`'s `readConnectVersion`: builder-tools'
|
|
237
|
+
* `exports` map has no `./package.json` subpath, so node resolution can't
|
|
238
|
+
* get there). Works whether this runs from source (tests, this monorepo) or
|
|
239
|
+
* the built dist.
|
|
240
|
+
*/
|
|
241
|
+
export declare function resolveOwnPackageVersion(): string;
|
|
242
|
+
/**
|
|
243
|
+
* This package's own version, computed once. Folded into the worker bundle
|
|
244
|
+
* cache key so a builder-tools release — which can change how the bundle is
|
|
245
|
+
* built (anything in this module beyond {@link WORKER_BUILD_WORKER} itself,
|
|
246
|
+
* e.g. `workerSafeVendorImports`, the resolve plugin) — invalidates bundles
|
|
247
|
+
* a prior builder-tools version cached.
|
|
248
|
+
*/
|
|
249
|
+
export declare const BUILDER_TOOLS_VERSION: string;
|
|
250
|
+
/**
|
|
251
|
+
* A workspace package's real directory, resolved the way Node's resolver
|
|
252
|
+
* would (through `node_modules`), or null when it is not installed (e.g. a
|
|
253
|
+
* non-monorepo consumer project — graceful, not an error). pnpm's
|
|
254
|
+
* node_modules symlinks resolve to the real package directory, so this
|
|
255
|
+
* reflects the monorepo's actual dist state, not a stale symlink target.
|
|
256
|
+
*/
|
|
257
|
+
export declare function resolveWorkspacePackageDir(dirname: string, pkgName: string): string | null;
|
|
258
|
+
/**
|
|
259
|
+
* Cheap content fingerprint of a directory's immediate files: no file bytes
|
|
260
|
+
* are read, just each entry's name/size/mtime, so it stays fast even for a
|
|
261
|
+
* large dist. Sensitive to a rebuild in the common cases: Vite's
|
|
262
|
+
* content-hashed chunk filenames change the name itself; a stable-named file
|
|
263
|
+
* (an entry point) changes size or mtime. Bounded (`maxFiles`) so a
|
|
264
|
+
* pathological directory cannot make this slow — deliberately not a
|
|
265
|
+
* full-tree hash.
|
|
266
|
+
*
|
|
267
|
+
* The names are sorted BEFORE the bound is applied, so the subset the bound
|
|
268
|
+
* keeps is the same subset on every run: readdir order is unspecified, and
|
|
269
|
+
* truncating it first made the fingerprint of a directory past the bound a
|
|
270
|
+
* function of whatever order the filesystem happened to report.
|
|
271
|
+
*/
|
|
272
|
+
export declare function distDirFingerprint(dir: string, maxFiles?: number): string;
|
|
273
|
+
export declare function computeSourceDigest(dirname: string, entryPath: string, vendorDir?: string, builderToolsVersion?: string): string;
|
|
274
|
+
/**
|
|
275
|
+
* Build the worker bundle (once, in a throwaway subprocess) into `outDir`.
|
|
276
|
+
* Idempotent: reuses a cached bundle built from the same connect dist, vendor
|
|
277
|
+
* mapping, and builder logic. Returns null on failure (`errorRef` carries the
|
|
278
|
+
* cause) or when the installed Connect has no worker entry.
|
|
279
|
+
*/
|
|
280
|
+
export declare function prebuildReactorWorker(options: ReactorWorkerBuildOptions): Promise<PrebuiltReactorWorker | null>;
|
|
281
|
+
/** Replace `outDir` with the finished `tmpDir`, old contents removed last. */
|
|
282
|
+
export declare function publishDirAtomic(tmpDir: string, outDir: string): void;
|
|
283
|
+
/**
|
|
284
|
+
* Scan the emitted JS files REACHABLE from the entry via import statements
|
|
285
|
+
* for specifiers a worker cannot resolve. Vendor externals were rewritten to
|
|
286
|
+
* ../__vendor__/ relative paths, so anything bare that survives in the graph
|
|
287
|
+
* is a real defect.
|
|
288
|
+
*
|
|
289
|
+
* Deliberately a graph walk, not a directory walk: the bundled reactor code
|
|
290
|
+
* carries `new URL(..., import.meta.url)` references to its node
|
|
291
|
+
* worker-thread entries (executor/projection workers), which Vite emits as
|
|
292
|
+
* stray assets full of node-only imports. They are unreachable dead weight in
|
|
293
|
+
* a browser bundle — the production vendor output tolerates the same files —
|
|
294
|
+
* and must not fail the build.
|
|
295
|
+
*/
|
|
296
|
+
export declare function findBundleSpecifierOffenders(bundleDir: string, entry?: string): {
|
|
297
|
+
file: string;
|
|
298
|
+
specs: string[];
|
|
299
|
+
}[];
|
|
300
|
+
/** The page-only markers present in `code`, in a fixed order. */
|
|
301
|
+
export declare function findWorkerUnsafeMarkers(code: string): string[];
|
|
302
|
+
/**
|
|
303
|
+
* The subset of the vendor's entries a worker may import.
|
|
304
|
+
*
|
|
305
|
+
* The vendor build keeps the React family external: its chunks carry bare
|
|
306
|
+
* `import "react"` statements that the PAGE resolves through its import map.
|
|
307
|
+
* A worker resolves no import map, so externalizing a vendor spec whose chunk
|
|
308
|
+
* closure reaches such an import would kill the worker on its first load —
|
|
309
|
+
* and the chunk graph is shared across vendor entries, so even a React-free
|
|
310
|
+
* module (e.g. an rpc subpath) can be entangled with React through a shared
|
|
311
|
+
* chunk. The vendor is also built for the page: a dynamic-base build rewrites
|
|
312
|
+
* its asset URLs onto a global only the page sets, and its dynamic imports go
|
|
313
|
+
* through Vite's preload helper, which needs `document`. Each entry's own
|
|
314
|
+
* closure inside the vendor dir decides: clean closure, worker-safe; anything
|
|
315
|
+
* bare or page-only in it (see {@link findWorkerUnsafeMarkers}), or a missing
|
|
316
|
+
* entry file, bundled into the worker instead.
|
|
317
|
+
*/
|
|
318
|
+
export declare function workerSafeVendorImports(vendorDir: string, vendorImports: Record<string, string>): Record<string, string>;
|
|
319
|
+
/**
|
|
320
|
+
* Builds arbitrary worker-loadable entries with the worker build config.
|
|
321
|
+
* Exported for the local-package bundles, which need the same self-contained
|
|
322
|
+
* output and vendor externalization at a different depth.
|
|
323
|
+
*/
|
|
324
|
+
export declare function runWorkerBuildEntries(dirname: string, outDir: string, entries: Record<string, string>, vendorImports: Record<string, string>, nodeEnv: "development" | "production", vendorPrefix?: string): Promise<{
|
|
325
|
+
ok: boolean;
|
|
326
|
+
stderr: string;
|
|
327
|
+
}>;
|
|
328
|
+
//#endregion
|
|
329
|
+
//#region connect-utils/worker-packages-build.d.ts
|
|
330
|
+
/** Served under `<base>__reactor_worker__/packages/`. */
|
|
331
|
+
export declare const WORKER_PACKAGES_MANIFEST = "manifest.json";
|
|
332
|
+
export interface WorkerPackagesBuildOptions {
|
|
333
|
+
/** Project root the packages resolve from. */
|
|
334
|
+
dirname: string;
|
|
335
|
+
/** Local package names (`provider: "local"` in powerhouse.config.json). */
|
|
336
|
+
packages: string[];
|
|
337
|
+
/** Directory to hold the bundles (`<dist>/__reactor_worker__/packages`). */
|
|
338
|
+
outDir: string;
|
|
339
|
+
/** The prebuilt vendor to share dependencies with, when one was built. */
|
|
340
|
+
vendor?: ReactorWorkerVendorOptions;
|
|
341
|
+
/**
|
|
342
|
+
* The vendor's worker-safe subset, when the caller already computed it
|
|
343
|
+
* (`PrebuiltReactorWorker.vendorImports`); skips walking the vendor again.
|
|
344
|
+
*/
|
|
345
|
+
safeVendorImports?: Record<string, string>;
|
|
346
|
+
nodeEnv?: "development" | "production";
|
|
347
|
+
errorRef?: {
|
|
348
|
+
message?: string;
|
|
349
|
+
};
|
|
350
|
+
}
|
|
351
|
+
export interface WorkerPackageManifestEntry {
|
|
352
|
+
name: string;
|
|
353
|
+
version?: string;
|
|
354
|
+
/** Filename inside outDir, as {@link workerPackageFileName} spells it. */
|
|
355
|
+
file: string;
|
|
356
|
+
}
|
|
357
|
+
/**
|
|
358
|
+
* The project's own package name when it ships a models bundle, so a caller
|
|
359
|
+
* can include it beside the configured `provider: "local"` packages. A vetra
|
|
360
|
+
* project declares no package entry for itself, yet its models are exactly
|
|
361
|
+
* the ones the worker is missing.
|
|
362
|
+
*/
|
|
363
|
+
export declare function ownProjectPackage(dirname: string): string | undefined;
|
|
364
|
+
/**
|
|
365
|
+
* Build each local package's models entry into `outDir` and write the
|
|
366
|
+
* manifest the tab reads. Returns the manifest entries (empty when no local
|
|
367
|
+
* package ships a models bundle), or null when the build itself failed -
|
|
368
|
+
* `errorRef` then carries the cause. Both of those remove `outDir`, so a
|
|
369
|
+
* previous build's bundles never outlive the packages they came from.
|
|
370
|
+
*/
|
|
371
|
+
export declare function prebuildWorkerPackages(options: WorkerPackagesBuildOptions): Promise<WorkerPackageManifestEntry[] | null>;
|
|
102
372
|
//#endregion
|
|
103
373
|
//#region connect-utils/types.d.ts
|
|
104
|
-
type IConnectOptions = {
|
|
374
|
+
export type IConnectOptions = {
|
|
105
375
|
mode: string;
|
|
106
376
|
dirname: string;
|
|
107
377
|
envDir?: string;
|
|
@@ -127,8 +397,18 @@ type IConnectOptions = {
|
|
|
127
397
|
cliPackageRegistryUrl?: string;
|
|
128
398
|
dynamicBase?: boolean;
|
|
129
399
|
favicon?: string;
|
|
400
|
+
/**
|
|
401
|
+
* Production vendor: the prebuilt shared-dependency bundle's import map and
|
|
402
|
+
* version table (from `prebuildConnectVendor`). When set on a production
|
|
403
|
+
* build, the shared specifiers are externalized from the app bundle and
|
|
404
|
+
* merged into the page import map. Build input only.
|
|
405
|
+
*/
|
|
406
|
+
vendor?: {
|
|
407
|
+
imports: Record<string, string>;
|
|
408
|
+
versions: Record<string, string>;
|
|
409
|
+
};
|
|
130
410
|
};
|
|
131
|
-
type ConnectCommonOptions = {
|
|
411
|
+
export type ConnectCommonOptions = {
|
|
132
412
|
base?: string;
|
|
133
413
|
mode?: string;
|
|
134
414
|
configFile?: string;
|
|
@@ -138,71 +418,71 @@ type ConnectCommonOptions = {
|
|
|
138
418
|
defaultDrivesUrl?: string[];
|
|
139
419
|
drivesPreserveStrategy?: "preserve-all" | "preserve-by-url-and-detach";
|
|
140
420
|
};
|
|
141
|
-
type ViteDevOptions = Pick<CommonServerOptions, "port" | "host" | "open" | "cors" | "strictPort"> & {
|
|
421
|
+
export type ViteDevOptions = Pick<CommonServerOptions, "port" | "host" | "open" | "cors" | "strictPort"> & {
|
|
142
422
|
force?: boolean;
|
|
143
423
|
};
|
|
144
|
-
type ConnectStudioOptions = ConnectCommonOptions & {
|
|
424
|
+
export type ConnectStudioOptions = ConnectCommonOptions & {
|
|
145
425
|
devServerOptions?: ViteDevOptions;
|
|
146
426
|
printUrls?: boolean;
|
|
147
427
|
bindCLIShortcuts?: boolean;
|
|
148
428
|
};
|
|
149
|
-
type ConnectBuildOptions = ConnectCommonOptions & {
|
|
429
|
+
export type ConnectBuildOptions = ConnectCommonOptions & {
|
|
150
430
|
outDir?: string;
|
|
151
431
|
};
|
|
152
|
-
type ConnectPreviewOptions = ConnectCommonOptions & Omit<ViteDevOptions, "cors"> & {
|
|
432
|
+
export type ConnectPreviewOptions = ConnectCommonOptions & Omit<ViteDevOptions, "cors"> & {
|
|
153
433
|
outDir?: string;
|
|
154
434
|
printUrls?: boolean;
|
|
155
435
|
bindCLIShortcuts?: boolean;
|
|
156
436
|
};
|
|
157
437
|
//#endregion
|
|
158
438
|
//#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;
|
|
439
|
+
export declare const DEFAULT_CONNECT_OUTDIR: ".ph/connect-build/dist/";
|
|
440
|
+
export declare function resolveViteConfigPath(options: Pick<ConnectCommonOptions, "projectRoot" | "viteConfigFile">): string;
|
|
441
|
+
export declare function resolvePackage(packageName: string, root?: string): string;
|
|
442
|
+
export declare function resolveConnectPackageJson(root?: string): JSON | null;
|
|
163
443
|
/**
|
|
164
444
|
* Finds the dist dir of Connect on the local machine
|
|
165
445
|
*/
|
|
166
|
-
declare function resolveConnectBundle(root?: string): string;
|
|
167
|
-
declare function resolveConnectPublicDir(root?: string): string;
|
|
446
|
+
export declare function resolveConnectBundle(root?: string): string;
|
|
447
|
+
export declare function resolveConnectPublicDir(root?: string): string;
|
|
168
448
|
/**
|
|
169
449
|
* Copies the Connect dist dir to the target path
|
|
170
450
|
*/
|
|
171
|
-
declare function copyConnect(sourcePath: string, targetPath: string): void;
|
|
451
|
+
export declare function copyConnect(sourcePath: string, targetPath: string): void;
|
|
172
452
|
/**
|
|
173
453
|
* Backs up the index.html file
|
|
174
454
|
*
|
|
175
455
|
* Needed when running the Connect Studio dev server on Windows
|
|
176
456
|
*/
|
|
177
|
-
declare function backupIndexHtml(appPath: string, restore?: boolean): void;
|
|
178
|
-
declare function removeBase64EnvValues(appPath: string): void;
|
|
179
|
-
declare function readJsonFile(filePath: string): PowerhouseConfig | null;
|
|
457
|
+
export declare function backupIndexHtml(appPath: string, restore?: boolean): void;
|
|
458
|
+
export declare function removeBase64EnvValues(appPath: string): void;
|
|
459
|
+
export declare function readJsonFile(filePath: string): PowerhouseConfig | null;
|
|
180
460
|
/**
|
|
181
461
|
* 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
462
|
*/
|
|
183
|
-
declare function makeImportScriptFromPackages(args: {
|
|
463
|
+
export declare function makeImportScriptFromPackages(args: {
|
|
184
464
|
packages: string[];
|
|
185
465
|
importStyles?: boolean;
|
|
186
466
|
localJsPath?: string;
|
|
187
467
|
localCssPath?: string;
|
|
188
468
|
}): string;
|
|
189
|
-
declare function ensureNodeVersion(minVersion?: string): void;
|
|
190
|
-
declare function runShellScriptPlugin(scriptName: string, connectPath: string): Plugin;
|
|
469
|
+
export declare function ensureNodeVersion(minVersion?: string): void;
|
|
470
|
+
export declare function runShellScriptPlugin(scriptName: string, connectPath: string): Plugin;
|
|
191
471
|
/**
|
|
192
472
|
* Appends the contents to the <head> tag of the index.html file
|
|
193
473
|
*/
|
|
194
|
-
declare function appendToHtmlHead(pathToHtml: string, contents: string): Promise<void>;
|
|
474
|
+
export declare function appendToHtmlHead(pathToHtml: string, contents: string): Promise<void>;
|
|
195
475
|
/**
|
|
196
476
|
* Prepends the contents to the <head> tag of the index.html file
|
|
197
477
|
*/
|
|
198
|
-
declare function prependToHtmlHead(pathToHtml: string, contents: string): Promise<void>;
|
|
199
|
-
declare function runTsc(outDir: string): void;
|
|
200
|
-
declare function stripVersionFromPackage(packageName: string): string;
|
|
478
|
+
export declare function prependToHtmlHead(pathToHtml: string, contents: string): Promise<void>;
|
|
479
|
+
export declare function runTsc(outDir: string): void;
|
|
480
|
+
export declare function stripVersionFromPackage(packageName: string): string;
|
|
201
481
|
//#endregion
|
|
202
482
|
//#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: {
|
|
483
|
+
export declare const RUNTIME_CONFIG_SCHEMA_ID = "https://powerhouse.inc/schemas/powerhouse.config.json";
|
|
484
|
+
export declare const RUNTIME_CONFIG_SCHEMA_URL = "https://raw.githubusercontent.com/powerhouse-inc/powerhouse/main/packages/builder-tools/connect-utils/runtime-config.schema.json";
|
|
485
|
+
export declare const runtimeConfigSchema: {
|
|
206
486
|
readonly $schema: "http://json-schema.org/draft-07/schema#";
|
|
207
487
|
readonly $id: "https://powerhouse.inc/schemas/powerhouse.config.json";
|
|
208
488
|
readonly title: "Powerhouse Connect runtime configuration";
|
|
@@ -315,6 +595,10 @@ declare const runtimeConfigSchema: {
|
|
|
315
595
|
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
596
|
readonly default: false;
|
|
317
597
|
};
|
|
598
|
+
readonly workflowsEnabled: {
|
|
599
|
+
readonly type: "boolean";
|
|
600
|
+
readonly description: "Powerhouse workflows in Connect. When true the tab loads the @powerhousedao/workflow package (workflow + connection documents, their editors and Workflow Studio) and the reactor worker registers its document models. Falls back to the top-level `workflows.enabled`; set it to override that for Connect. Independent of studioMode. False when neither is set.";
|
|
601
|
+
};
|
|
318
602
|
};
|
|
319
603
|
};
|
|
320
604
|
readonly ai: {
|
|
@@ -406,7 +690,7 @@ declare const runtimeConfigSchema: {
|
|
|
406
690
|
readonly preserveStrategy: {
|
|
407
691
|
readonly type: "string";
|
|
408
692
|
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
|
|
693
|
+
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 — opt-in only.";
|
|
410
694
|
};
|
|
411
695
|
readonly sections: {
|
|
412
696
|
readonly type: "object";
|
|
@@ -557,6 +841,32 @@ declare const runtimeConfigSchema: {
|
|
|
557
841
|
};
|
|
558
842
|
};
|
|
559
843
|
};
|
|
844
|
+
readonly openPanel: {
|
|
845
|
+
readonly type: "object";
|
|
846
|
+
readonly additionalProperties: false;
|
|
847
|
+
readonly description: "OpenPanel product analytics. Set `clientId` to enable; an empty `clientId` disables it. Events are only sent after the user accepts analytics cookies. Takes precedence over the build-time PH_CONNECT_OPENPANEL_* env vars.";
|
|
848
|
+
readonly properties: {
|
|
849
|
+
readonly clientId: {
|
|
850
|
+
readonly type: "string";
|
|
851
|
+
readonly description: "OpenPanel client id. Empty string disables OpenPanel entirely.";
|
|
852
|
+
readonly default: "";
|
|
853
|
+
};
|
|
854
|
+
readonly apiUrl: {
|
|
855
|
+
readonly type: "string";
|
|
856
|
+
readonly description: "OpenPanel API URL for self-hosted instances (e.g. 'https://openpanel.example/api'). Omit to use OpenPanel's hosted API.";
|
|
857
|
+
};
|
|
858
|
+
readonly trackUiEvents: {
|
|
859
|
+
readonly type: "boolean";
|
|
860
|
+
readonly description: "Track UI events.";
|
|
861
|
+
readonly default: true;
|
|
862
|
+
};
|
|
863
|
+
readonly trackOperations: {
|
|
864
|
+
readonly type: "boolean";
|
|
865
|
+
readonly description: "Track document operations.";
|
|
866
|
+
readonly default: true;
|
|
867
|
+
};
|
|
868
|
+
};
|
|
869
|
+
};
|
|
560
870
|
readonly instance: {
|
|
561
871
|
readonly type: "object";
|
|
562
872
|
readonly additionalProperties: false;
|
|
@@ -570,7 +880,12 @@ declare const runtimeConfigSchema: {
|
|
|
570
880
|
};
|
|
571
881
|
readonly reactorWorker: {
|
|
572
882
|
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.";
|
|
883
|
+
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. Packaged deployments load the worker from the prebuilt bundle `ph connect build` emits under __reactor_worker__/ (the dev server builds it lazily at the same path); when that bundle is absent the feature reports itself unavailable instead of starting a worker that cannot load.";
|
|
884
|
+
readonly default: false;
|
|
885
|
+
};
|
|
886
|
+
readonly multiReactor: {
|
|
887
|
+
readonly type: "boolean";
|
|
888
|
+
readonly description: "Opt-in multi-reactor routing. When on, Connect routes through the in-browser reactor plus remote backends instead of the single in-browser reactor. Off by default; the single-reactor path is unchanged.";
|
|
574
889
|
readonly default: false;
|
|
575
890
|
};
|
|
576
891
|
};
|
|
@@ -607,12 +922,24 @@ declare const runtimeConfigSchema: {
|
|
|
607
922
|
};
|
|
608
923
|
};
|
|
609
924
|
};
|
|
925
|
+
readonly createSignaturePolicy: {
|
|
926
|
+
readonly type: "string";
|
|
927
|
+
readonly enum: readonly ["legacy", "v2-required"];
|
|
928
|
+
readonly description: "What new documents are created as. `v2-required` documents accept only v2 action signatures and take content-addressed ids; set `legacy` while any peer Connect syncs with predates them. Existing documents keep their policy.";
|
|
929
|
+
readonly default: "v2-required";
|
|
930
|
+
};
|
|
931
|
+
readonly unsupportedStoredDocuments: {
|
|
932
|
+
readonly type: "string";
|
|
933
|
+
readonly enum: readonly ["refuse", "read-only"];
|
|
934
|
+
readonly description: "What the reactor does when this browser's store holds documents at protocol versions this build does not run. `refuse` fails the boot and names the versions; `read-only` boots and keeps those documents read-only.";
|
|
935
|
+
readonly default: "refuse";
|
|
936
|
+
};
|
|
610
937
|
};
|
|
611
938
|
};
|
|
612
939
|
readonly pwa: {
|
|
613
940
|
readonly type: "object";
|
|
614
941
|
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
|
|
942
|
+
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 — it is derived from the manifest's category field.) Only applied when connect.app.offline is true.";
|
|
616
943
|
readonly properties: {
|
|
617
944
|
readonly manifest: {
|
|
618
945
|
readonly type: "object";
|
|
@@ -677,7 +1004,7 @@ declare const runtimeConfigSchema: {
|
|
|
677
1004
|
readonly properties: {
|
|
678
1005
|
readonly accept: {
|
|
679
1006
|
readonly type: "object";
|
|
680
|
-
readonly description: "MIME type
|
|
1007
|
+
readonly description: "MIME type → file extensions. Each extension must start with '.'; browsers ignore entries without it.";
|
|
681
1008
|
readonly additionalProperties: {
|
|
682
1009
|
readonly type: "array";
|
|
683
1010
|
readonly items: {
|
|
@@ -862,7 +1189,7 @@ declare const runtimeConfigSchema: {
|
|
|
862
1189
|
};
|
|
863
1190
|
//#endregion
|
|
864
1191
|
//#region connect-utils/vite-config.d.ts
|
|
865
|
-
declare function getConnectHtmlTags(options?: {
|
|
1192
|
+
export declare function getConnectHtmlTags(options?: {
|
|
866
1193
|
registryUrl?: string | null;
|
|
867
1194
|
injectTo?: HtmlTagDescriptor["injectTo"];
|
|
868
1195
|
}): [{
|
|
@@ -871,84 +1198,74 @@ declare function getConnectHtmlTags(options?: {
|
|
|
871
1198
|
readonly "http-equiv": "Content-Security-Policy";
|
|
872
1199
|
readonly content: `script-src 'self' 'unsafe-inline' 'unsafe-eval'${string}; worker-src 'self' blob:; object-src 'none'; base-uri 'self';`;
|
|
873
1200
|
};
|
|
874
|
-
readonly injectTo: "
|
|
1201
|
+
readonly injectTo: "body" | "body-prepend" | "head" | "head-prepend";
|
|
875
1202
|
}, {
|
|
876
1203
|
readonly tag: "meta";
|
|
877
1204
|
readonly attrs: {
|
|
878
1205
|
readonly property: "og:title";
|
|
879
1206
|
readonly content: "Connect";
|
|
880
1207
|
};
|
|
881
|
-
readonly injectTo: "
|
|
1208
|
+
readonly injectTo: "body" | "body-prepend" | "head" | "head-prepend";
|
|
882
1209
|
}, {
|
|
883
1210
|
readonly tag: "meta";
|
|
884
1211
|
readonly attrs: {
|
|
885
1212
|
readonly property: "og:type";
|
|
886
1213
|
readonly content: "website";
|
|
887
1214
|
};
|
|
888
|
-
readonly injectTo: "
|
|
1215
|
+
readonly injectTo: "body" | "body-prepend" | "head" | "head-prepend";
|
|
889
1216
|
}, {
|
|
890
1217
|
readonly tag: "meta";
|
|
891
1218
|
readonly attrs: {
|
|
892
1219
|
readonly property: "og:url";
|
|
893
1220
|
readonly content: "https://apps.powerhouse.io/powerhouse/connect/";
|
|
894
1221
|
};
|
|
895
|
-
readonly injectTo: "
|
|
1222
|
+
readonly injectTo: "body" | "body-prepend" | "head" | "head-prepend";
|
|
896
1223
|
}, {
|
|
897
1224
|
readonly tag: "meta";
|
|
898
1225
|
readonly attrs: {
|
|
899
1226
|
readonly property: "og:description";
|
|
900
1227
|
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
1228
|
};
|
|
902
|
-
readonly injectTo: "
|
|
1229
|
+
readonly injectTo: "body" | "body-prepend" | "head" | "head-prepend";
|
|
903
1230
|
}, {
|
|
904
1231
|
readonly tag: "meta";
|
|
905
1232
|
readonly attrs: {
|
|
906
1233
|
readonly property: "og:image";
|
|
907
1234
|
readonly content: "https://cf-ipfs.com/ipfs/bafkreigrmclndf2jpbolaq22535q2sw5t44uad3az3dpvkzrnt4lpjt63e";
|
|
908
1235
|
};
|
|
909
|
-
readonly injectTo: "
|
|
1236
|
+
readonly injectTo: "body" | "body-prepend" | "head" | "head-prepend";
|
|
910
1237
|
}, {
|
|
911
1238
|
readonly tag: "meta";
|
|
912
1239
|
readonly attrs: {
|
|
913
1240
|
readonly name: "twitter:card";
|
|
914
1241
|
readonly content: "summary_large_image";
|
|
915
1242
|
};
|
|
916
|
-
readonly injectTo: "
|
|
1243
|
+
readonly injectTo: "body" | "body-prepend" | "head" | "head-prepend";
|
|
917
1244
|
}, {
|
|
918
1245
|
readonly tag: "meta";
|
|
919
1246
|
readonly attrs: {
|
|
920
1247
|
readonly name: "twitter:image";
|
|
921
1248
|
readonly content: "https://cf-ipfs.com/ipfs/bafkreigrmclndf2jpbolaq22535q2sw5t44uad3az3dpvkzrnt4lpjt63e";
|
|
922
1249
|
};
|
|
923
|
-
readonly injectTo: "
|
|
1250
|
+
readonly injectTo: "body" | "body-prepend" | "head" | "head-prepend";
|
|
924
1251
|
}, {
|
|
925
1252
|
readonly tag: "meta";
|
|
926
1253
|
readonly attrs: {
|
|
927
1254
|
readonly name: "twitter:title";
|
|
928
1255
|
readonly content: "Connect";
|
|
929
1256
|
};
|
|
930
|
-
readonly injectTo: "
|
|
1257
|
+
readonly injectTo: "body" | "body-prepend" | "head" | "head-prepend";
|
|
931
1258
|
}, {
|
|
932
1259
|
readonly tag: "meta";
|
|
933
1260
|
readonly attrs: {
|
|
934
1261
|
readonly name: "twitter:description";
|
|
935
1262
|
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
1263
|
};
|
|
937
|
-
readonly injectTo: "
|
|
1264
|
+
readonly injectTo: "body" | "body-prepend" | "head" | "head-prepend";
|
|
938
1265
|
}];
|
|
939
|
-
declare function getConnectBaseViteConfig(options: IConnectOptions): InlineConfig;
|
|
1266
|
+
export declare function getConnectBaseViteConfig(options: IConnectOptions): InlineConfig;
|
|
940
1267
|
//#endregion
|
|
941
1268
|
//#region connect-utils/vite-plugins/dynamic-base.d.ts
|
|
942
|
-
/**
|
|
943
|
-
* Placeholder base used when Connect is built in dynamic-base mode. The Vite
|
|
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__/";
|
|
952
1269
|
/**
|
|
953
1270
|
* Rewrites the placeholder base in emitted JS chunks to a runtime expression so
|
|
954
1271
|
* one built `dist/connect` serves under any subpath. Rolldown-native: per-match
|
|
@@ -977,17 +1294,19 @@ declare const DYNAMIC_BASE_PLACEHOLDER = "/__PH_DYNAMIC_BASE__/";
|
|
|
977
1294
|
* they need no rewrite once the stylesheet itself is loaded from the right
|
|
978
1295
|
* prefix (which the HTML substitution handles).
|
|
979
1296
|
*/
|
|
980
|
-
declare function connectDynamicBasePlugin(options?: {
|
|
1297
|
+
export declare function connectDynamicBasePlugin(options?: {
|
|
981
1298
|
forWorker?: boolean;
|
|
982
1299
|
workerStripPrefix?: string;
|
|
983
1300
|
}): Plugin;
|
|
984
|
-
declare function escapeForRegExp(s: string): string;
|
|
1301
|
+
export declare function escapeForRegExp(s: string): string;
|
|
985
1302
|
//#endregion
|
|
986
1303
|
//#region connect-utils/vite-plugins/ph-config.d.ts
|
|
987
|
-
type PhConfigPluginOptions = {
|
|
1304
|
+
export type PhConfigPluginOptions = {
|
|
988
1305
|
packages: PowerhousePackage[];
|
|
989
1306
|
projectRoot?: string;
|
|
990
1307
|
connect?: PHConnectRuntimeConfig;
|
|
1308
|
+
/** The source's top-level `workflows` block; `connect.app.workflowsEnabled` falls back to it. */
|
|
1309
|
+
workflows?: PowerhouseConfig$1["workflows"];
|
|
991
1310
|
/**
|
|
992
1311
|
* Project-wide package registry URL — the effective value (CLI override
|
|
993
1312
|
* `??` source) the caller has already resolved. Copied verbatim into the
|
|
@@ -1002,7 +1321,7 @@ type PhConfigPluginOptions = {
|
|
|
1002
1321
|
*/
|
|
1003
1322
|
cliConnectOverride?: PHConnectRuntimeConfig;
|
|
1004
1323
|
};
|
|
1005
|
-
declare function phConfigPlugin(options: PhConfigPluginOptions): Plugin;
|
|
1324
|
+
export declare function phConfigPlugin(options: PhConfigPluginOptions): Plugin;
|
|
1006
1325
|
//#endregion
|
|
1007
1326
|
//#region connect-utils/vite-plugins/theme-boot.d.ts
|
|
1008
1327
|
/**
|
|
@@ -1010,13 +1329,21 @@ declare function phConfigPlugin(options: PhConfigPluginOptions): Plugin;
|
|
|
1010
1329
|
* ph-clint connect proxy) and this plugin both check it, so the script is
|
|
1011
1330
|
* applied exactly once no matter which layer runs first.
|
|
1012
1331
|
*/
|
|
1013
|
-
declare const THEME_BOOT_MARKER = "data-ph-theme-boot";
|
|
1332
|
+
export declare const THEME_BOOT_MARKER = "data-ph-theme-boot";
|
|
1014
1333
|
/**
|
|
1015
1334
|
* Injects the theme boot script at the top of `<head>` of every emitted
|
|
1016
1335
|
* index.html, so built Connect apps render the stored theme from first paint
|
|
1017
1336
|
* without depending on a serve-time injector.
|
|
1018
1337
|
*/
|
|
1019
|
-
declare function connectThemeBootPlugin(): Plugin;
|
|
1338
|
+
export declare function connectThemeBootPlugin(): Plugin;
|
|
1339
|
+
//#endregion
|
|
1340
|
+
//#region connect-utils/vite-plugins/vendor-import-map.d.ts
|
|
1341
|
+
export type VendorImportMapOptions = {
|
|
1342
|
+
/** bare specifier -> URL (already base-prefixed by the caller). */
|
|
1343
|
+
imports: Record<string, string>;
|
|
1344
|
+
};
|
|
1345
|
+
export declare function vendorImportMapPlugin(options: VendorImportMapOptions): Plugin;
|
|
1020
1346
|
//#endregion
|
|
1021
|
-
export {
|
|
1347
|
+
export { DYNAMIC_BASE_PLACEHOLDER };
|
|
1348
|
+
export {};
|
|
1022
1349
|
//# sourceMappingURL=index.d.mts.map
|