@powerhousedao/builder-tools 6.2.0-dev.8 → 6.2.0-rc.0
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 +48 -4
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +872 -164
- package/dist/index.mjs.map +1 -1
- package/package.json +27 -7
package/dist/index.d.mts
CHANGED
|
@@ -8,6 +8,47 @@ declare const IMPORT_SCRIPT_FILE = "external-packages.js";
|
|
|
8
8
|
declare const LOCAL_PACKAGE_ID = "ph:local-package";
|
|
9
9
|
declare const PH_DIR_NAME = ".ph";
|
|
10
10
|
//#endregion
|
|
11
|
+
//#region connect-utils/externalize-vendor.d.ts
|
|
12
|
+
interface VendorPrebuildOptions {
|
|
13
|
+
/** Project root (the reactor-project dir). */
|
|
14
|
+
dirname: string;
|
|
15
|
+
/** Bare specifiers to bundle into the vendor (defaults to the heavy libs). */
|
|
16
|
+
include?: string[];
|
|
17
|
+
/** Specifiers left external to the build (defaults to the React family). */
|
|
18
|
+
external?: string[];
|
|
19
|
+
/** Directory to hold the static vendor bundle + import map. */
|
|
20
|
+
vendorDir?: string;
|
|
21
|
+
/** Filled with the failure cause when the prebuild returns null. */
|
|
22
|
+
errorRef?: {
|
|
23
|
+
message?: string;
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* The stable Connect libraries worth prebuilding. The React family is NOT here —
|
|
28
|
+
* it's externalized from the build (see `VENDOR_EXTERNAL`) so the vendor shares
|
|
29
|
+
* the dev server's single React instance via the import map.
|
|
30
|
+
*/
|
|
31
|
+
declare const DEFAULT_VENDOR_INCLUDE: string[];
|
|
32
|
+
/**
|
|
33
|
+
* React-family specifiers kept external to the vendor build. The vendor's chunks
|
|
34
|
+
* emit bare imports for these; `devReactImportmapPlugin`'s import map resolves
|
|
35
|
+
* them to Vite's pre-bundled React, so there is exactly one React instance.
|
|
36
|
+
*/
|
|
37
|
+
declare const VENDOR_EXTERNAL: string[];
|
|
38
|
+
interface PrebuiltVendor {
|
|
39
|
+
vendorDir: string;
|
|
40
|
+
/** import map: bare specifier -> "/__vendor__/<entry>.js". */
|
|
41
|
+
imports: Record<string, string>;
|
|
42
|
+
}
|
|
43
|
+
/** URL prefix the vendor bundle is served under by the dev middleware. */
|
|
44
|
+
declare const VENDOR_URL_PREFIX = "/__vendor__/";
|
|
45
|
+
/**
|
|
46
|
+
* Build the prebuilt vendor (once, in a throwaway subprocess) and return its dir
|
|
47
|
+
* + import map. Idempotent: reuses a cached vendor built for the same dep set.
|
|
48
|
+
* Returns null on any failure (caller falls back to a normal dev server).
|
|
49
|
+
*/
|
|
50
|
+
declare function prebuildConnectVendor(options: VendorPrebuildOptions): Promise<PrebuiltVendor | null>;
|
|
51
|
+
//#endregion
|
|
11
52
|
//#region connect-utils/types.d.ts
|
|
12
53
|
type IConnectOptions = {
|
|
13
54
|
mode: string;
|
|
@@ -21,8 +62,10 @@ type IConnectOptions = {
|
|
|
21
62
|
* from `ph connect build`'s `--json` + individual `--flag` parsing.
|
|
22
63
|
*
|
|
23
64
|
* Order: DEFAULT_CONNECT_CONFIG < source.connect < cliConnectOverride.
|
|
24
|
-
* Env vars are NOT part of this merge;
|
|
25
|
-
* container start
|
|
65
|
+
* Env vars are NOT part of this merge; PH_CONNECT_CONFIG_JSON is applied
|
|
66
|
+
* to the dist file at container start by the Docker entrypoint
|
|
67
|
+
* (operator-wins: concrete values override the baked file, null/omitted
|
|
68
|
+
* keep it; connect.app.basePath excluded).
|
|
26
69
|
*/
|
|
27
70
|
cliConnectOverride?: PHConnectRuntimeConfig;
|
|
28
71
|
/**
|
|
@@ -375,7 +418,7 @@ declare function getConnectHtmlTags(options?: {
|
|
|
375
418
|
readonly tag: "meta";
|
|
376
419
|
readonly attrs: {
|
|
377
420
|
readonly "http-equiv": "Content-Security-Policy";
|
|
378
|
-
readonly content: `script-src 'self' 'unsafe-inline' 'unsafe-eval'
|
|
421
|
+
readonly content: `script-src 'self' 'unsafe-inline' 'unsafe-eval'${string}; worker-src 'self' blob:; object-src 'none'; base-uri 'self';`;
|
|
379
422
|
};
|
|
380
423
|
readonly injectTo: "head" | "body" | "head-prepend" | "body-prepend";
|
|
381
424
|
}, {
|
|
@@ -485,6 +528,7 @@ declare const DYNAMIC_BASE_PLACEHOLDER = "/__PH_DYNAMIC_BASE__/";
|
|
|
485
528
|
*/
|
|
486
529
|
declare function connectDynamicBasePlugin(options?: {
|
|
487
530
|
forWorker?: boolean;
|
|
531
|
+
workerStripPrefix?: string;
|
|
488
532
|
}): Plugin;
|
|
489
533
|
//#endregion
|
|
490
534
|
//#region connect-utils/vite-plugins/ph-config.d.ts
|
|
@@ -508,5 +552,5 @@ type PhConfigPluginOptions = {
|
|
|
508
552
|
};
|
|
509
553
|
declare function phConfigPlugin(options: PhConfigPluginOptions): Plugin;
|
|
510
554
|
//#endregion
|
|
511
|
-
export { ConnectBuildOptions, ConnectCommonOptions, ConnectPreviewOptions, ConnectStudioOptions, DEFAULT_CONNECT_OUTDIR, DYNAMIC_BASE_PLACEHOLDER, EXTERNAL_PACKAGES_IMPORT, IConnectOptions, IMPORT_SCRIPT_FILE, LOCAL_PACKAGE_ID, PH_DIR_NAME, PhConfigPluginOptions, RUNTIME_CONFIG_SCHEMA_ID, RUNTIME_CONFIG_SCHEMA_URL, ViteDevOptions, appendToHtmlHead, backupIndexHtml, connectDynamicBasePlugin, copyConnect, ensureNodeVersion, getConnectBaseViteConfig, getConnectHtmlTags, makeImportScriptFromPackages, phConfigPlugin, prependToHtmlHead, readJsonFile, removeBase64EnvValues, resolveConnectBundle, resolveConnectPackageJson, resolveConnectPublicDir, resolvePackage, resolveViteConfigPath, runShellScriptPlugin, runTsc, runtimeConfigSchema, stripVersionFromPackage };
|
|
555
|
+
export { ConnectBuildOptions, ConnectCommonOptions, ConnectPreviewOptions, ConnectStudioOptions, DEFAULT_CONNECT_OUTDIR, DEFAULT_VENDOR_INCLUDE, DYNAMIC_BASE_PLACEHOLDER, EXTERNAL_PACKAGES_IMPORT, IConnectOptions, IMPORT_SCRIPT_FILE, LOCAL_PACKAGE_ID, PH_DIR_NAME, PhConfigPluginOptions, PrebuiltVendor, RUNTIME_CONFIG_SCHEMA_ID, RUNTIME_CONFIG_SCHEMA_URL, VENDOR_EXTERNAL, VENDOR_URL_PREFIX, VendorPrebuildOptions, ViteDevOptions, appendToHtmlHead, backupIndexHtml, connectDynamicBasePlugin, copyConnect, ensureNodeVersion, getConnectBaseViteConfig, getConnectHtmlTags, makeImportScriptFromPackages, phConfigPlugin, prebuildConnectVendor, prependToHtmlHead, readJsonFile, removeBase64EnvValues, resolveConnectBundle, resolveConnectPackageJson, resolveConnectPublicDir, resolvePackage, resolveViteConfigPath, runShellScriptPlugin, runTsc, runtimeConfigSchema, stripVersionFromPackage };
|
|
512
556
|
//# sourceMappingURL=index.d.mts.map
|
package/dist/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../connect-utils/constants.ts","../connect-utils/types.ts","../connect-utils/helpers.ts","../connect-utils/runtime-config-schema.ts","../connect-utils/vite-config.ts","../connect-utils/vite-plugins/dynamic-base.ts","../connect-utils/vite-plugins/ph-config.ts"],"mappings":";;;;;cAAa,wBAAA;AAAA,cACA,kBAAA;AAAA,cACA,gBAAA;AAAA,cACA,WAAA;;;
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../connect-utils/constants.ts","../connect-utils/externalize-vendor.ts","../connect-utils/types.ts","../connect-utils/helpers.ts","../connect-utils/runtime-config-schema.ts","../connect-utils/vite-config.ts","../connect-utils/vite-plugins/dynamic-base.ts","../connect-utils/vite-plugins/ph-config.ts"],"mappings":";;;;;cAAa,wBAAA;AAAA,cACA,kBAAA;AAAA,cACA,gBAAA;AAAA,cACA,WAAA;;;UC6CI,qBAAA;;EAEf,OAAA;;EAEA,OAAA;EDpDW;ECsDX,QAAA;;EAEA,SAAA;E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