@trebired/bundler 3.7.0 → 4.1.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/CHANGELOG.md +22 -0
- package/README.md +198 -1
- package/dist/core/discovery/aggregate.d.ts +5 -1
- package/dist/core/discovery/aggregate.d.ts.map +1 -1
- package/dist/core/discovery/aggregate.js +4 -2
- package/dist/core/discovery/aggregate.js.map +1 -1
- package/dist/core/discovery/exports.d.ts +17 -0
- package/dist/core/discovery/exports.d.ts.map +1 -0
- package/dist/core/discovery/exports.js +106 -0
- package/dist/core/discovery/exports.js.map +1 -0
- package/dist/core/discovery/normalize.d.ts.map +1 -1
- package/dist/core/discovery/normalize.js +1 -0
- package/dist/core/discovery/normalize.js.map +1 -1
- package/dist/core/discovery/resolve.d.ts.map +1 -1
- package/dist/core/discovery/resolve.js +16 -8
- package/dist/core/discovery/resolve.js.map +1 -1
- package/dist/core/discovery/shared.d.ts +1 -0
- package/dist/core/discovery/shared.d.ts.map +1 -1
- package/dist/core/discovery/shared.js.map +1 -1
- package/dist/core/frontend_app/assets.d.ts +5 -0
- package/dist/core/frontend_app/assets.d.ts.map +1 -0
- package/dist/core/frontend_app/assets.js +74 -0
- package/dist/core/frontend_app/assets.js.map +1 -0
- package/dist/core/frontend_app/build.d.ts +5 -0
- package/dist/core/frontend_app/build.d.ts.map +1 -0
- package/dist/core/frontend_app/build.js +70 -0
- package/dist/core/frontend_app/build.js.map +1 -0
- package/dist/core/frontend_app/config.d.ts +6 -0
- package/dist/core/frontend_app/config.d.ts.map +1 -0
- package/dist/core/frontend_app/config.js +180 -0
- package/dist/core/frontend_app/config.js.map +1 -0
- package/dist/core/frontend_app/defaults.d.ts +18 -0
- package/dist/core/frontend_app/defaults.d.ts.map +1 -0
- package/dist/core/frontend_app/defaults.js +75 -0
- package/dist/core/frontend_app/defaults.js.map +1 -0
- package/dist/core/frontend_app/global.d.ts +11 -0
- package/dist/core/frontend_app/global.d.ts.map +1 -0
- package/dist/core/frontend_app/global.js +36 -0
- package/dist/core/frontend_app/global.js.map +1 -0
- package/dist/core/frontend_app/hygiene.d.ts +6 -0
- package/dist/core/frontend_app/hygiene.d.ts.map +1 -0
- package/dist/core/frontend_app/hygiene.js +46 -0
- package/dist/core/frontend_app/hygiene.js.map +1 -0
- package/dist/core/frontend_app/index.d.ts +13 -0
- package/dist/core/frontend_app/index.d.ts.map +1 -0
- package/dist/core/frontend_app/index.js +13 -0
- package/dist/core/frontend_app/index.js.map +1 -0
- package/dist/core/frontend_app/manifest.d.ts +16 -0
- package/dist/core/frontend_app/manifest.d.ts.map +1 -0
- package/dist/core/frontend_app/manifest.js +82 -0
- package/dist/core/frontend_app/manifest.js.map +1 -0
- package/dist/core/frontend_app/node_modules.d.ts +4 -0
- package/dist/core/frontend_app/node_modules.d.ts.map +1 -0
- package/dist/core/frontend_app/node_modules.js +25 -0
- package/dist/core/frontend_app/node_modules.js.map +1 -0
- package/dist/core/frontend_app/related.d.ts +4 -0
- package/dist/core/frontend_app/related.d.ts.map +1 -0
- package/dist/core/frontend_app/related.js +25 -0
- package/dist/core/frontend_app/related.js.map +1 -0
- package/dist/core/frontend_app/runtime.d.ts +4 -0
- package/dist/core/frontend_app/runtime.d.ts.map +1 -0
- package/dist/core/frontend_app/runtime.js +182 -0
- package/dist/core/frontend_app/runtime.js.map +1 -0
- package/dist/core/frontend_app/ssr.d.ts +6 -0
- package/dist/core/frontend_app/ssr.d.ts.map +1 -0
- package/dist/core/frontend_app/ssr.js +48 -0
- package/dist/core/frontend_app/ssr.js.map +1 -0
- package/dist/core/frontend_app/static.d.ts +5 -0
- package/dist/core/frontend_app/static.d.ts.map +1 -0
- package/dist/core/frontend_app/static.js +173 -0
- package/dist/core/frontend_app/static.js.map +1 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/src/core/discovery/aggregate.d.ts +5 -1
- package/dist/src/core/discovery/aggregate.d.ts.map +1 -1
- package/dist/src/core/discovery/aggregate.js +4 -2
- package/dist/src/core/discovery/aggregate.js.map +1 -1
- package/dist/src/core/discovery/exports.d.ts +17 -0
- package/dist/src/core/discovery/exports.d.ts.map +1 -0
- package/dist/src/core/discovery/exports.js +106 -0
- package/dist/src/core/discovery/exports.js.map +1 -0
- package/dist/src/core/discovery/normalize.d.ts.map +1 -1
- package/dist/src/core/discovery/normalize.js +1 -0
- package/dist/src/core/discovery/normalize.js.map +1 -1
- package/dist/src/core/discovery/resolve.d.ts.map +1 -1
- package/dist/src/core/discovery/resolve.js +16 -8
- package/dist/src/core/discovery/resolve.js.map +1 -1
- package/dist/src/core/discovery/shared.d.ts +1 -0
- package/dist/src/core/discovery/shared.d.ts.map +1 -1
- package/dist/src/core/discovery/shared.js.map +1 -1
- package/dist/src/core/frontend_app/assets.d.ts +5 -0
- package/dist/src/core/frontend_app/assets.d.ts.map +1 -0
- package/dist/src/core/frontend_app/assets.js +74 -0
- package/dist/src/core/frontend_app/assets.js.map +1 -0
- package/dist/src/core/frontend_app/build.d.ts +5 -0
- package/dist/src/core/frontend_app/build.d.ts.map +1 -0
- package/dist/src/core/frontend_app/build.js +70 -0
- package/dist/src/core/frontend_app/build.js.map +1 -0
- package/dist/src/core/frontend_app/config.d.ts +6 -0
- package/dist/src/core/frontend_app/config.d.ts.map +1 -0
- package/dist/src/core/frontend_app/config.js +180 -0
- package/dist/src/core/frontend_app/config.js.map +1 -0
- package/dist/src/core/frontend_app/defaults.d.ts +18 -0
- package/dist/src/core/frontend_app/defaults.d.ts.map +1 -0
- package/dist/src/core/frontend_app/defaults.js +75 -0
- package/dist/src/core/frontend_app/defaults.js.map +1 -0
- package/dist/src/core/frontend_app/global.d.ts +11 -0
- package/dist/src/core/frontend_app/global.d.ts.map +1 -0
- package/dist/src/core/frontend_app/global.js +36 -0
- package/dist/src/core/frontend_app/global.js.map +1 -0
- package/dist/src/core/frontend_app/hygiene.d.ts +6 -0
- package/dist/src/core/frontend_app/hygiene.d.ts.map +1 -0
- package/dist/src/core/frontend_app/hygiene.js +46 -0
- package/dist/src/core/frontend_app/hygiene.js.map +1 -0
- package/dist/src/core/frontend_app/index.d.ts +13 -0
- package/dist/src/core/frontend_app/index.d.ts.map +1 -0
- package/dist/src/core/frontend_app/index.js +13 -0
- package/dist/src/core/frontend_app/index.js.map +1 -0
- package/dist/src/core/frontend_app/manifest.d.ts +16 -0
- package/dist/src/core/frontend_app/manifest.d.ts.map +1 -0
- package/dist/src/core/frontend_app/manifest.js +82 -0
- package/dist/src/core/frontend_app/manifest.js.map +1 -0
- package/dist/src/core/frontend_app/node_modules.d.ts +4 -0
- package/dist/src/core/frontend_app/node_modules.d.ts.map +1 -0
- package/dist/src/core/frontend_app/node_modules.js +25 -0
- package/dist/src/core/frontend_app/node_modules.js.map +1 -0
- package/dist/src/core/frontend_app/related.d.ts +4 -0
- package/dist/src/core/frontend_app/related.d.ts.map +1 -0
- package/dist/src/core/frontend_app/related.js +25 -0
- package/dist/src/core/frontend_app/related.js.map +1 -0
- package/dist/src/core/frontend_app/runtime.d.ts +4 -0
- package/dist/src/core/frontend_app/runtime.d.ts.map +1 -0
- package/dist/src/core/frontend_app/runtime.js +182 -0
- package/dist/src/core/frontend_app/runtime.js.map +1 -0
- package/dist/src/core/frontend_app/ssr.d.ts +6 -0
- package/dist/src/core/frontend_app/ssr.d.ts.map +1 -0
- package/dist/src/core/frontend_app/ssr.js +48 -0
- package/dist/src/core/frontend_app/ssr.js.map +1 -0
- package/dist/src/core/frontend_app/static.d.ts +5 -0
- package/dist/src/core/frontend_app/static.d.ts.map +1 -0
- package/dist/src/core/frontend_app/static.js +173 -0
- package/dist/src/core/frontend_app/static.js.map +1 -0
- package/dist/src/index.d.ts +2 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +1 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/types/discovery.d.ts +3 -0
- package/dist/src/types/discovery.d.ts.map +1 -1
- package/dist/src/types/frontend_app.d.ts +219 -0
- package/dist/src/types/frontend_app.d.ts.map +1 -0
- package/dist/src/types/frontend_app.js +2 -0
- package/dist/src/types/frontend_app.js.map +1 -0
- package/dist/src/types.d.ts +1 -0
- package/dist/src/types.d.ts.map +1 -1
- package/dist/types/discovery.d.ts +3 -0
- package/dist/types/discovery.d.ts.map +1 -1
- package/dist/types/frontend_app.d.ts +219 -0
- package/dist/types/frontend_app.d.ts.map +1 -0
- package/dist/types/frontend_app.js +2 -0
- package/dist/types/frontend_app.js.map +1 -0
- package/dist/types.d.ts +1 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +3 -2
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { BundlerAssetManifest, BundlerFrontendAppBundlerConfig, BundlerFrontendGlobalClientEntries } from "../../src/types.d.ts";
|
|
2
|
+
declare function resolveFrontendGlobalClientEntries(args: {
|
|
3
|
+
entries: BundlerFrontendGlobalClientEntries;
|
|
4
|
+
exclude?: readonly string[];
|
|
5
|
+
frontendDir: string;
|
|
6
|
+
include: readonly string[];
|
|
7
|
+
manifest?: BundlerAssetManifest;
|
|
8
|
+
}): string[];
|
|
9
|
+
declare function resolveConfiguredFrontendGlobalClientEntries(config: BundlerFrontendAppBundlerConfig, manifest?: BundlerAssetManifest): string[];
|
|
10
|
+
export { resolveConfiguredFrontendGlobalClientEntries, resolveFrontendGlobalClientEntries, };
|
|
11
|
+
//# sourceMappingURL=global.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"global.d.ts","sourceRoot":"","sources":["../../../../src/core/frontend_app/global.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,oBAAoB,EACpB,+BAA+B,EAC/B,kCAAkC,EACnC,MAAM,eAAe,CAAC;AAGvB,iBAAS,kCAAkC,CAAC,IAAI,EAAE;IAChD,OAAO,EAAE,kCAAkC,CAAC;IAC5C,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC5B,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IAC3B,QAAQ,CAAC,EAAE,oBAAoB,CAAC;CACjC,GAAG,MAAM,EAAE,CAUX;AAED,iBAAS,4CAA4C,CACnD,MAAM,EAAE,+BAA+B,EACvC,QAAQ,CAAC,EAAE,oBAAoB,GAC9B,MAAM,EAAE,CAQV;AAYD,OAAO,EACL,4CAA4C,EAC5C,kCAAkC,GACnC,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { matchesAnyPattern, normalizePathValue } from "../../src/core/discovery/shared.js";
|
|
2
|
+
function resolveFrontendGlobalClientEntries(args) {
|
|
3
|
+
if (Array.isArray(args.entries))
|
|
4
|
+
return stableEntries(args.entries);
|
|
5
|
+
if (args.entries !== "auto" || !args.manifest)
|
|
6
|
+
return [];
|
|
7
|
+
const frontendDir = normalizePathValue(args.frontendDir);
|
|
8
|
+
return stableEntries(Object.keys(args.manifest.sources).filter((source) => {
|
|
9
|
+
const discoverRel = toFrontendRelativeSource(source, frontendDir);
|
|
10
|
+
if (!discoverRel)
|
|
11
|
+
return false;
|
|
12
|
+
if (!matchesAnyPattern(discoverRel, [...args.include]))
|
|
13
|
+
return false;
|
|
14
|
+
return !matchesAnyPattern(discoverRel, [...(args.exclude || [])]);
|
|
15
|
+
}));
|
|
16
|
+
}
|
|
17
|
+
function resolveConfiguredFrontendGlobalClientEntries(config, manifest) {
|
|
18
|
+
return resolveFrontendGlobalClientEntries({
|
|
19
|
+
entries: config.globalClientEntries,
|
|
20
|
+
exclude: config.globalClientEntryExclude,
|
|
21
|
+
frontendDir: config.frontendDir,
|
|
22
|
+
include: config.globalClientEntryInclude,
|
|
23
|
+
manifest,
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
function toFrontendRelativeSource(source, frontendDir) {
|
|
27
|
+
const normalized = normalizePathValue(source);
|
|
28
|
+
if (!frontendDir)
|
|
29
|
+
return normalized;
|
|
30
|
+
return normalized.startsWith(`${frontendDir}/`) ? normalized.slice(frontendDir.length + 1) : "";
|
|
31
|
+
}
|
|
32
|
+
function stableEntries(entries) {
|
|
33
|
+
return Array.from(new Set(entries.map(normalizePathValue).filter(Boolean))).sort();
|
|
34
|
+
}
|
|
35
|
+
export { resolveConfiguredFrontendGlobalClientEntries, resolveFrontendGlobalClientEntries, };
|
|
36
|
+
//# sourceMappingURL=global.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"global.js","sourceRoot":"","sources":["../../../../src/core/frontend_app/global.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAEtE,SAAS,kCAAkC,CAAC,IAM3C;IACC,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC;QAAE,OAAO,aAAa,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACpE,IAAI,IAAI,CAAC,OAAO,KAAK,MAAM,IAAI,CAAC,IAAI,CAAC,QAAQ;QAAE,OAAO,EAAE,CAAC;IACzD,MAAM,WAAW,GAAG,kBAAkB,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IACzD,OAAO,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,EAAE;QACxE,MAAM,WAAW,GAAG,wBAAwB,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;QAClE,IAAI,CAAC,WAAW;YAAE,OAAO,KAAK,CAAC;QAC/B,IAAI,CAAC,iBAAiB,CAAC,WAAW,EAAE,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC;YAAE,OAAO,KAAK,CAAC;QACrE,OAAO,CAAC,iBAAiB,CAAC,WAAW,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;IACpE,CAAC,CAAC,CAAC,CAAC;AACN,CAAC;AAED,SAAS,4CAA4C,CACnD,MAAuC,EACvC,QAA+B;IAE/B,OAAO,kCAAkC,CAAC;QACxC,OAAO,EAAE,MAAM,CAAC,mBAAmB;QACnC,OAAO,EAAE,MAAM,CAAC,wBAAwB;QACxC,WAAW,EAAE,MAAM,CAAC,WAAW;QAC/B,OAAO,EAAE,MAAM,CAAC,wBAAwB;QACxC,QAAQ;KACT,CAAC,CAAC;AACL,CAAC;AAED,SAAS,wBAAwB,CAAC,MAAc,EAAE,WAAmB;IACnE,MAAM,UAAU,GAAG,kBAAkB,CAAC,MAAM,CAAC,CAAC;IAC9C,IAAI,CAAC,WAAW;QAAE,OAAO,UAAU,CAAC;IACpC,OAAO,UAAU,CAAC,UAAU,CAAC,GAAG,WAAW,GAAG,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,KAAK,CAAC,WAAW,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AAClG,CAAC;AAED,SAAS,aAAa,CAAC,OAA0B;IAC/C,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;AACrF,CAAC;AAED,OAAO,EACL,4CAA4C,EAC5C,kCAAkC,GACnC,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { BundlerLogger, BundlerQuarantineResult } from "../../src/types.d.ts";
|
|
2
|
+
declare function quarantineUnwritableOutputDir(dir: string, options?: {
|
|
3
|
+
logger?: BundlerLogger;
|
|
4
|
+
}): Promise<BundlerQuarantineResult>;
|
|
5
|
+
export { quarantineUnwritableOutputDir, };
|
|
6
|
+
//# sourceMappingURL=hygiene.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hygiene.d.ts","sourceRoot":"","sources":["../../../../src/core/frontend_app/hygiene.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAE5E,iBAAe,6BAA6B,CAC1C,GAAG,EAAE,MAAM,EACX,OAAO,GAAE;IAAE,MAAM,CAAC,EAAE,aAAa,CAAA;CAAO,GACvC,OAAO,CAAC,uBAAuB,CAAC,CASlC;AAkCD,OAAO,EACL,6BAA6B,GAC9B,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { constants as fsConstants } from "node:fs";
|
|
2
|
+
import fs from "node:fs/promises";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
async function quarantineUnwritableOutputDir(dir, options = {}) {
|
|
5
|
+
const resolvedDir = path.resolve(dir);
|
|
6
|
+
if (!await exists(resolvedDir))
|
|
7
|
+
return { dir: resolvedDir, quarantined: false };
|
|
8
|
+
if (await canWriteDirectory(resolvedDir))
|
|
9
|
+
return { dir: resolvedDir, quarantined: false };
|
|
10
|
+
const quarantineDir = await resolveQuarantineDir(resolvedDir);
|
|
11
|
+
await fs.rename(resolvedDir, quarantineDir);
|
|
12
|
+
warnLogger(options.logger, `quarantine-output-dir :: ${resolvedDir} -> ${quarantineDir}`);
|
|
13
|
+
return { dir: resolvedDir, quarantineDir, quarantined: true };
|
|
14
|
+
}
|
|
15
|
+
async function canWriteDirectory(dir) {
|
|
16
|
+
try {
|
|
17
|
+
await fs.access(dir, fsConstants.W_OK);
|
|
18
|
+
const probe = path.join(dir, `.bundler-write-${process.pid}-${Date.now()}`);
|
|
19
|
+
await fs.writeFile(probe, "");
|
|
20
|
+
await fs.rm(probe, { force: true });
|
|
21
|
+
return true;
|
|
22
|
+
}
|
|
23
|
+
catch {
|
|
24
|
+
return false;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
async function resolveQuarantineDir(dir) {
|
|
28
|
+
const parent = path.dirname(dir);
|
|
29
|
+
const name = path.basename(dir);
|
|
30
|
+
for (let index = 0; index < 100; index += 1) {
|
|
31
|
+
const suffix = index === 0 ? "" : `-${index}`;
|
|
32
|
+
const candidate = path.join(parent, `${name}.quarantine-${Date.now()}${suffix}`);
|
|
33
|
+
if (!await exists(candidate))
|
|
34
|
+
return candidate;
|
|
35
|
+
}
|
|
36
|
+
throw new Error(`bundler-output-dir-quarantine-conflict :: ${dir}`);
|
|
37
|
+
}
|
|
38
|
+
async function exists(filePath) {
|
|
39
|
+
return fs.access(filePath).then(() => true, () => false);
|
|
40
|
+
}
|
|
41
|
+
function warnLogger(logger, message) {
|
|
42
|
+
const candidate = logger;
|
|
43
|
+
candidate?.warn?.("build", message);
|
|
44
|
+
}
|
|
45
|
+
export { quarantineUnwritableOutputDir, };
|
|
46
|
+
//# sourceMappingURL=hygiene.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hygiene.js","sourceRoot":"","sources":["../../../../src/core/frontend_app/hygiene.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,IAAI,WAAW,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClC,OAAO,IAAI,MAAM,WAAW,CAAC;AAI7B,KAAK,UAAU,6BAA6B,CAC1C,GAAW,EACX,UAAsC,EAAE;IAExC,MAAM,WAAW,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACtC,IAAI,CAAC,MAAM,MAAM,CAAC,WAAW,CAAC;QAAE,OAAO,EAAE,GAAG,EAAE,WAAW,EAAE,WAAW,EAAE,KAAK,EAAE,CAAC;IAChF,IAAI,MAAM,iBAAiB,CAAC,WAAW,CAAC;QAAE,OAAO,EAAE,GAAG,EAAE,WAAW,EAAE,WAAW,EAAE,KAAK,EAAE,CAAC;IAE1F,MAAM,aAAa,GAAG,MAAM,oBAAoB,CAAC,WAAW,CAAC,CAAC;IAC9D,MAAM,EAAE,CAAC,MAAM,CAAC,WAAW,EAAE,aAAa,CAAC,CAAC;IAC5C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,MAAM,MAAM,CAAC,SAAS,CAAC;YAAE,OAAO,SAAS,CAAC;IACjD,CAAC;IACD,MAAM,IAAI,KAAK,CAAC,6CAA6C,GAAG,EAAE,CAAC,CAAC;AACtE,CAAC;AAED,KAAK,UAAU,MAAM,CAAC,QAAgB;IACpC,OAAO,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,IAAI,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,CAAC;AAC3D,CAAC;AAED,SAAS,UAAU,CAAC,MAAiC,EAAE,OAAe;IACpE,MAAM,SAAS,GAAG,MAAyE,CAAC;IAC5F,SAAS,EAAE,IAAI,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;AACtC,CAAC;AAED,OAAO,EACL,6BAA6B,GAC9B,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export { collectFrontendAssetLinks, renderAssetLinkTags, } from "./assets.js";
|
|
2
|
+
export { buildFrontendApp, copyPublicDir, } from "./build.js";
|
|
3
|
+
export { createFrontendAppBundlerOptions, createFrontendBundlerRuntimeConfig, defineFrontendBundlerConfig, } from "./config.js";
|
|
4
|
+
export { DEFAULT_FRONTEND_CLIENT_ENTRY_KEY, DEFAULT_FRONTEND_DEFERRED_CLIENT_ENTRY_KEY, DEFAULT_FRONTEND_GLOBAL_CLIENT_ENTRY_PATTERNS, DEFAULT_FRONTEND_GLOBAL_STYLE_PATTERNS, DEFAULT_FRONTEND_GLOBAL_STYLE_RULE_KEY, DEFAULT_FRONTEND_IGNORED_SOURCE_PATTERNS, DEFAULT_FRONTEND_PUBLIC_DIR, DEFAULT_FRONTEND_RUNTIME_SOURCE_PATTERNS, DEFAULT_FRONTEND_SOURCE_DIR, DEFAULT_FRONTEND_SSR_MAP_EXPORT, DEFAULT_FRONTEND_SSR_MATCHED_EXPORT, DEFAULT_FRONTEND_SSR_PAGE_PATTERNS, DEFAULT_FRONTEND_SSR_RESOLVER_EXPORT, DEFAULT_FRONTEND_SSR_ROOT_EXPORT, DEFAULT_FRONTEND_SSR_ROOT_MODULE_EXPORT, DEFAULT_FRONTEND_SSR_RULE_KEY, } from "./defaults.js";
|
|
5
|
+
export { resolveConfiguredFrontendGlobalClientEntries, resolveFrontendGlobalClientEntries, } from "./global.js";
|
|
6
|
+
export { quarantineUnwritableOutputDir, } from "./hygiene.js";
|
|
7
|
+
export { collectAggregateMatchedSourcesByRuleKey, createAggregateSourceIdMap, createEmptyAssetManifest, extractAssetManifest, normalizeAggregateSourceId, readBundlerManifest, resolveAggregateEntryByRuleKey, resolveAssetManifestEntryOutputPath, } from "./manifest.js";
|
|
8
|
+
export { buildRelatedClientEntryMap, } from "./related.js";
|
|
9
|
+
export { prepareSsrNodeModules, } from "./node_modules.js";
|
|
10
|
+
export { createFrontendBundlerRuntime, } from "./runtime.js";
|
|
11
|
+
export { createReactSsrModuleMapRule, createSsrModuleMapRule, resolveSsrModuleMapRuleOptions, } from "./ssr.js";
|
|
12
|
+
export { createStaticAssetMiddleware, serveStaticAsset, } from "./static.js";
|
|
13
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/frontend_app/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,yBAAyB,EACzB,mBAAmB,GACpB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,gBAAgB,EAChB,aAAa,GACd,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,+BAA+B,EAC/B,kCAAkC,EAClC,2BAA2B,GAC5B,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,iCAAiC,EACjC,0CAA0C,EAC1C,6CAA6C,EAC7C,sCAAsC,EACtC,sCAAsC,EACtC,wCAAwC,EACxC,2BAA2B,EAC3B,wCAAwC,EACxC,2BAA2B,EAC3B,+BAA+B,EAC/B,mCAAmC,EACnC,kCAAkC,EAClC,oCAAoC,EACpC,gCAAgC,EAChC,uCAAuC,EACvC,6BAA6B,GAC9B,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,4CAA4C,EAC5C,kCAAkC,GACnC,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,6BAA6B,GAC9B,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,uCAAuC,EACvC,0BAA0B,EAC1B,wBAAwB,EACxB,oBAAoB,EACpB,0BAA0B,EAC1B,mBAAmB,EACnB,8BAA8B,EAC9B,mCAAmC,GACpC,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,0BAA0B,GAC3B,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,qBAAqB,GACtB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,4BAA4B,GAC7B,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,2BAA2B,EAC3B,sBAAsB,EACtB,8BAA8B,GAC/B,MAAM,UAAU,CAAC;AAClB,OAAO,EACL,2BAA2B,EAC3B,gBAAgB,GACjB,MAAM,aAAa,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export { collectFrontendAssetLinks, renderAssetLinkTags, } from "./assets.js";
|
|
2
|
+
export { buildFrontendApp, copyPublicDir, } from "./build.js";
|
|
3
|
+
export { createFrontendAppBundlerOptions, createFrontendBundlerRuntimeConfig, defineFrontendBundlerConfig, } from "./config.js";
|
|
4
|
+
export { DEFAULT_FRONTEND_CLIENT_ENTRY_KEY, DEFAULT_FRONTEND_DEFERRED_CLIENT_ENTRY_KEY, DEFAULT_FRONTEND_GLOBAL_CLIENT_ENTRY_PATTERNS, DEFAULT_FRONTEND_GLOBAL_STYLE_PATTERNS, DEFAULT_FRONTEND_GLOBAL_STYLE_RULE_KEY, DEFAULT_FRONTEND_IGNORED_SOURCE_PATTERNS, DEFAULT_FRONTEND_PUBLIC_DIR, DEFAULT_FRONTEND_RUNTIME_SOURCE_PATTERNS, DEFAULT_FRONTEND_SOURCE_DIR, DEFAULT_FRONTEND_SSR_MAP_EXPORT, DEFAULT_FRONTEND_SSR_MATCHED_EXPORT, DEFAULT_FRONTEND_SSR_PAGE_PATTERNS, DEFAULT_FRONTEND_SSR_RESOLVER_EXPORT, DEFAULT_FRONTEND_SSR_ROOT_EXPORT, DEFAULT_FRONTEND_SSR_ROOT_MODULE_EXPORT, DEFAULT_FRONTEND_SSR_RULE_KEY, } from "./defaults.js";
|
|
5
|
+
export { resolveConfiguredFrontendGlobalClientEntries, resolveFrontendGlobalClientEntries, } from "./global.js";
|
|
6
|
+
export { quarantineUnwritableOutputDir, } from "./hygiene.js";
|
|
7
|
+
export { collectAggregateMatchedSourcesByRuleKey, createAggregateSourceIdMap, createEmptyAssetManifest, extractAssetManifest, normalizeAggregateSourceId, readBundlerManifest, resolveAggregateEntryByRuleKey, resolveAssetManifestEntryOutputPath, } from "./manifest.js";
|
|
8
|
+
export { buildRelatedClientEntryMap, } from "./related.js";
|
|
9
|
+
export { prepareSsrNodeModules, } from "./node_modules.js";
|
|
10
|
+
export { createFrontendBundlerRuntime, } from "./runtime.js";
|
|
11
|
+
export { createReactSsrModuleMapRule, createSsrModuleMapRule, resolveSsrModuleMapRuleOptions, } from "./ssr.js";
|
|
12
|
+
export { createStaticAssetMiddleware, serveStaticAsset, } from "./static.js";
|
|
13
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/core/frontend_app/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,yBAAyB,EACzB,mBAAmB,GACpB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,gBAAgB,EAChB,aAAa,GACd,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,+BAA+B,EAC/B,kCAAkC,EAClC,2BAA2B,GAC5B,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,iCAAiC,EACjC,0CAA0C,EAC1C,6CAA6C,EAC7C,sCAAsC,EACtC,sCAAsC,EACtC,wCAAwC,EACxC,2BAA2B,EAC3B,wCAAwC,EACxC,2BAA2B,EAC3B,+BAA+B,EAC/B,mCAAmC,EACnC,kCAAkC,EAClC,oCAAoC,EACpC,gCAAgC,EAChC,uCAAuC,EACvC,6BAA6B,GAC9B,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,4CAA4C,EAC5C,kCAAkC,GACnC,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,6BAA6B,GAC9B,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,uCAAuC,EACvC,0BAA0B,EAC1B,wBAAwB,EACxB,oBAAoB,EACpB,0BAA0B,EAC1B,mBAAmB,EACnB,8BAA8B,EAC9B,mCAAmC,GACpC,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,0BAA0B,GAC3B,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,qBAAqB,GACtB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,4BAA4B,GAC7B,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,2BAA2B,EAC3B,sBAAsB,EACtB,8BAA8B,GAC/B,MAAM,UAAU,CAAC;AAClB,OAAO,EACL,2BAA2B,EAC3B,gBAAgB,GACjB,MAAM,aAAa,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { BundlerAggregateSourceIdOptions, BundlerAssetManifest, BundlerAssetManifestEntry, BundlerBuildResult, BundlerCollectAssetLinksLookup } from "../../src/types.d.ts";
|
|
2
|
+
declare function createEmptyAssetManifest(): BundlerAssetManifest;
|
|
3
|
+
declare function readBundlerManifest(filePath: string): Promise<Record<string, unknown>>;
|
|
4
|
+
declare function extractAssetManifest(value: BundlerAssetManifest | BundlerBuildResult | Record<string, unknown>): BundlerAssetManifest;
|
|
5
|
+
declare function resolveAssetManifestEntryOutputPath(args: {
|
|
6
|
+
entryId: string;
|
|
7
|
+
from?: BundlerCollectAssetLinksLookup;
|
|
8
|
+
manifest: BundlerAssetManifest | BundlerBuildResult | Record<string, unknown>;
|
|
9
|
+
outDir: string;
|
|
10
|
+
}): string | undefined;
|
|
11
|
+
declare function resolveAggregateEntryByRuleKey(manifestValue: BundlerAssetManifest | BundlerBuildResult | Record<string, unknown>, ruleKey: string): BundlerAssetManifestEntry | undefined;
|
|
12
|
+
declare function collectAggregateMatchedSourcesByRuleKey(manifestValue: BundlerAssetManifest | BundlerBuildResult | Record<string, unknown>, ruleKey: string): string[];
|
|
13
|
+
declare function normalizeAggregateSourceId(sourcePath: string, options?: BundlerAggregateSourceIdOptions): string;
|
|
14
|
+
declare function createAggregateSourceIdMap(sources: readonly string[], options?: BundlerAggregateSourceIdOptions): Record<string, string>;
|
|
15
|
+
export { collectAggregateMatchedSourcesByRuleKey, createAggregateSourceIdMap, createEmptyAssetManifest, extractAssetManifest, normalizeAggregateSourceId, readBundlerManifest, resolveAggregateEntryByRuleKey, resolveAssetManifestEntryOutputPath, };
|
|
16
|
+
//# sourceMappingURL=manifest.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../../../../src/core/frontend_app/manifest.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,+BAA+B,EAC/B,oBAAoB,EACpB,yBAAyB,EACzB,kBAAkB,EAClB,8BAA8B,EAC/B,MAAM,eAAe,CAAC;AAKvB,iBAAS,wBAAwB,IAAI,oBAAoB,CAQxD;AAED,iBAAe,mBAAmB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAKrF;AAED,iBAAS,oBAAoB,CAAC,KAAK,EAAE,oBAAoB,GAAG,kBAAkB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,oBAAoB,CAI9H;AAED,iBAAS,mCAAmC,CAAC,IAAI,EAAE;IACjD,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,8BAA8B,CAAC;IACtC,QAAQ,EAAE,oBAAoB,GAAG,kBAAkB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC9E,MAAM,EAAE,MAAM,CAAC;CAChB,GAAG,MAAM,GAAG,SAAS,CAGrB;AAED,iBAAS,8BAA8B,CACrC,aAAa,EAAE,oBAAoB,GAAG,kBAAkB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAClF,OAAO,EAAE,MAAM,GACd,yBAAyB,GAAG,SAAS,CAMvC;AAED,iBAAS,uCAAuC,CAC9C,aAAa,EAAE,oBAAoB,GAAG,kBAAkB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAClF,OAAO,EAAE,MAAM,GACd,MAAM,EAAE,CAEV;AAED,iBAAS,0BAA0B,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,GAAE,+BAAoC,GAAG,MAAM,CAS7G;AAED,iBAAS,0BAA0B,CACjC,OAAO,EAAE,SAAS,MAAM,EAAE,EAC1B,OAAO,GAAE,+BAAoC,GAC5C,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAExB;AAoCD,OAAO,EACL,uCAAuC,EACvC,0BAA0B,EAC1B,wBAAwB,EACxB,oBAAoB,EACpB,0BAA0B,EAC1B,mBAAmB,EACnB,8BAA8B,EAC9B,mCAAmC,GACpC,CAAC"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import fs from "node:fs/promises";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { normalizePathValue } from "../../src/core/discovery/shared.js";
|
|
4
|
+
const DEFAULT_ROUTE_EXTENSIONS = [".tsx", ".ts", ".jsx", ".js", ".mts", ".mjs", ".cts", ".cjs"];
|
|
5
|
+
function createEmptyAssetManifest() {
|
|
6
|
+
return {
|
|
7
|
+
entries: {},
|
|
8
|
+
entryOutputs: {},
|
|
9
|
+
outputs: {},
|
|
10
|
+
rules: {},
|
|
11
|
+
sources: {},
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
async function readBundlerManifest(filePath) {
|
|
15
|
+
const body = await fs.readFile(path.resolve(filePath), "utf8");
|
|
16
|
+
const parsed = JSON.parse(body);
|
|
17
|
+
if (!parsed || typeof parsed !== "object")
|
|
18
|
+
throw new Error(`bundler-manifest-invalid :: ${filePath}`);
|
|
19
|
+
return parsed;
|
|
20
|
+
}
|
|
21
|
+
function extractAssetManifest(value) {
|
|
22
|
+
const candidate = "assetManifest" in value ? value.assetManifest : value;
|
|
23
|
+
if (!isAssetManifest(candidate))
|
|
24
|
+
throw new Error("bundler-asset-manifest-missing");
|
|
25
|
+
return candidate;
|
|
26
|
+
}
|
|
27
|
+
function resolveAssetManifestEntryOutputPath(args) {
|
|
28
|
+
const entry = resolveAssetManifestEntry(args.manifest, args.entryId, args.from || "auto");
|
|
29
|
+
return entry ? path.resolve(args.outDir, entry.file) : undefined;
|
|
30
|
+
}
|
|
31
|
+
function resolveAggregateEntryByRuleKey(manifestValue, ruleKey) {
|
|
32
|
+
const manifest = extractAssetManifest(manifestValue);
|
|
33
|
+
const normalizedRuleKey = normalizePathValue(ruleKey);
|
|
34
|
+
const rule = manifest.rules[normalizedRuleKey];
|
|
35
|
+
const aggregateKey = rule?.entryKeys.find((entryKey) => manifest.entries[entryKey]?.aggregate);
|
|
36
|
+
return aggregateKey ? manifest.entries[aggregateKey] : undefined;
|
|
37
|
+
}
|
|
38
|
+
function collectAggregateMatchedSourcesByRuleKey(manifestValue, ruleKey) {
|
|
39
|
+
return resolveAggregateEntryByRuleKey(manifestValue, ruleKey)?.aggregate?.matchedSources.slice().sort() || [];
|
|
40
|
+
}
|
|
41
|
+
function normalizeAggregateSourceId(sourcePath, options = {}) {
|
|
42
|
+
const prefix = normalizePathValue(options.sourcePrefix || "");
|
|
43
|
+
const normalized = normalizePathValue(sourcePath);
|
|
44
|
+
const withoutPrefix = prefix && normalized.startsWith(`${prefix}/`) ? normalized.slice(prefix.length + 1) : normalized;
|
|
45
|
+
const withoutExtension = stripKnownExtension(withoutPrefix, options.extensions || DEFAULT_ROUTE_EXTENSIONS);
|
|
46
|
+
const collapsed = options.collapseIndex !== false && withoutExtension.endsWith("/index")
|
|
47
|
+
? withoutExtension.slice(0, -"/index".length)
|
|
48
|
+
: withoutExtension;
|
|
49
|
+
return normalizePathValue(collapsed);
|
|
50
|
+
}
|
|
51
|
+
function createAggregateSourceIdMap(sources, options = {}) {
|
|
52
|
+
return Object.fromEntries(sources.map((source) => [source, normalizeAggregateSourceId(source, options)]));
|
|
53
|
+
}
|
|
54
|
+
function resolveAssetManifestEntry(manifestValue, entryId, from) {
|
|
55
|
+
const manifest = extractAssetManifest(manifestValue);
|
|
56
|
+
const key = resolveEntryKey(manifest, normalizePathValue(entryId), from);
|
|
57
|
+
return key ? manifest.entries[key] : undefined;
|
|
58
|
+
}
|
|
59
|
+
function resolveEntryKey(manifest, entryId, from) {
|
|
60
|
+
if (from === "entryKey")
|
|
61
|
+
return manifest.entries[entryId] ? entryId : undefined;
|
|
62
|
+
if (from === "source")
|
|
63
|
+
return manifest.sources[entryId]?.entryKey;
|
|
64
|
+
if (from === "entryOutput")
|
|
65
|
+
return manifest.entryOutputs[entryId];
|
|
66
|
+
if (from === "ruleKey")
|
|
67
|
+
return manifest.rules[entryId]?.entryKeys[0];
|
|
68
|
+
return manifest.entries[entryId] ? entryId : manifest.sources[entryId]?.entryKey || manifest.entryOutputs[entryId] || manifest.rules[entryId]?.entryKeys[0];
|
|
69
|
+
}
|
|
70
|
+
function stripKnownExtension(sourcePath, extensions) {
|
|
71
|
+
const sorted = [...extensions].map((item) => item.startsWith(".") ? item : `.${item}`).sort((a, b) => b.length - a.length);
|
|
72
|
+
const extension = sorted.find((item) => sourcePath.endsWith(item));
|
|
73
|
+
return extension ? sourcePath.slice(0, -extension.length) : sourcePath;
|
|
74
|
+
}
|
|
75
|
+
function isAssetManifest(value) {
|
|
76
|
+
if (!value || typeof value !== "object")
|
|
77
|
+
return false;
|
|
78
|
+
const record = value;
|
|
79
|
+
return Boolean(record.entries && record.entryOutputs && record.outputs && record.rules && record.sources);
|
|
80
|
+
}
|
|
81
|
+
export { collectAggregateMatchedSourcesByRuleKey, createAggregateSourceIdMap, createEmptyAssetManifest, extractAssetManifest, normalizeAggregateSourceId, readBundlerManifest, resolveAggregateEntryByRuleKey, resolveAssetManifestEntryOutputPath, };
|
|
82
|
+
//# sourceMappingURL=manifest.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manifest.js","sourceRoot":"","sources":["../../../../src/core/frontend_app/manifest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClC,OAAO,IAAI,MAAM,WAAW,CAAC;AAS7B,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAEnD,MAAM,wBAAwB,GAAG,CAAC,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AAEhG,SAAS,wBAAwB;IAC/B,OAAO;QACL,OAAO,EAAE,EAAE;QACX,YAAY,EAAE,EAAE;QAChB,OAAO,EAAE,EAAE;QACX,KAAK,EAAE,EAAE;QACT,OAAO,EAAE,EAAE;KACZ,CAAC;AACJ,CAAC;AAED,KAAK,UAAU,mBAAmB,CAAC,QAAgB;IACjD,MAAM,IAAI,GAAG,MAAM,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC,CAAC;IAC/D,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAY,CAAC;IAC3C,IAAI,CAAC,MAAM,IAAI,OAAO,MAAM,KAAK,QAAQ;QAAE,MAAM,IAAI,KAAK,CAAC,+BAA+B,QAAQ,EAAE,CAAC,CAAC;IACtG,OAAO,MAAiC,CAAC;AAC3C,CAAC;AAED,SAAS,oBAAoB,CAAC,KAA0E;IACtG,MAAM,SAAS,GAAG,eAAe,IAAI,KAAK,CAAC,CAAC,CAAC,K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,EAAE,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;IACnE,OAAO,SAAS,CAAC,CAAC,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC;AACzE,CAAC;AAED,SAAS,eAAe,CAAC,KAAc;IACrC,IAAI,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IACtD,MAAM,MAAM,GAAG,KAAgC,CAAC;IAChD,OAAO,OAAO,CAAC,MAAM,CAAC,OAAO,IAAI,MAAM,CAAC,YAAY,IAAI,MAAM,CAAC,OAAO,IAAI,MAAM,CAAC,KAAK,IAAI,MAAM,CAAC,OAAO,CAAC,CAAC;AAC5G,CAAC;AAED,OAAO,EACL,uCAAuC,EACvC,0BAA0B,EAC1B,wBAAwB,EACxB,oBAAoB,EACpB,0BAA0B,EAC1B,mBAAmB,EACnB,8BAA8B,EAC9B,mCAAmC,GACpC,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { BundlerFrontendAppBundlerConfig, BundlerSsrNodeModulesOptions, BundlerSsrNodeModulesResult } from "../../src/types.d.ts";
|
|
2
|
+
declare function prepareSsrNodeModules(config: Pick<BundlerFrontendAppBundlerConfig, "rootDir" | "ssrOutDir">, options: BundlerSsrNodeModulesOptions | undefined): Promise<BundlerSsrNodeModulesResult | undefined>;
|
|
3
|
+
export { prepareSsrNodeModules, };
|
|
4
|
+
//# sourceMappingURL=node_modules.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node_modules.d.ts","sourceRoot":"","sources":["../../../../src/core/frontend_app/node_modules.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,+BAA+B,EAC/B,4BAA4B,EAC5B,2BAA2B,EAC5B,MAAM,eAAe,CAAC;AAEvB,iBAAe,qBAAqB,CAClC,MAAM,EAAE,IAAI,CAAC,+BAA+B,EAAE,SAAS,GAAG,WAAW,CAAC,EACtE,OAAO,EAAE,4BAA4B,GAAG,SAAS,GAChD,OAAO,CAAC,2BAA2B,GAAG,SAAS,CAAC,CASlD;AASD,OAAO,EACL,qBAAqB,GACtB,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import fs from "node:fs/promises";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
async function prepareSsrNodeModules(config, options) {
|
|
4
|
+
const strategy = options?.strategy || "none";
|
|
5
|
+
if (strategy === "none" || !config.ssrOutDir)
|
|
6
|
+
return undefined;
|
|
7
|
+
const sourceDir = path.resolve(config.rootDir, options?.sourceDir || "node_modules");
|
|
8
|
+
const targetDir = path.resolve(config.rootDir, options?.targetDir || path.join(config.ssrOutDir, "node_modules"));
|
|
9
|
+
if (options?.force)
|
|
10
|
+
await fs.rm(targetDir, { force: true, recursive: true });
|
|
11
|
+
if (strategy === "symlink")
|
|
12
|
+
await createNodeModulesSymlink(sourceDir, targetDir);
|
|
13
|
+
else
|
|
14
|
+
await fs.cp(sourceDir, targetDir, { recursive: true, force: true });
|
|
15
|
+
return { path: targetDir, strategy };
|
|
16
|
+
}
|
|
17
|
+
async function createNodeModulesSymlink(sourceDir, targetDir) {
|
|
18
|
+
await fs.mkdir(path.dirname(targetDir), { recursive: true });
|
|
19
|
+
await fs.symlink(sourceDir, targetDir, "junction").catch(async (error) => {
|
|
20
|
+
if (error.code !== "EEXIST")
|
|
21
|
+
throw error;
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
export { prepareSsrNodeModules, };
|
|
25
|
+
//# sourceMappingURL=node_modules.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node_modules.js","sourceRoot":"","sources":["../../../../src/core/frontend_app/node_modules.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClC,OAAO,IAAI,MAAM,WAAW,CAAC;AAQ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AK,CAAC,IAAI,KAAK,QAAQ;YAAE,MAAM,KAAK,CAAC;IAC3C,CAAC,CAAC,CAAC;AACL,CAAC;AAED,OAAO,EACL,qBAAqB,GACtB,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { BundlerRelatedClientEntryMapOptions } from "../../src/types.d.ts";
|
|
2
|
+
declare function buildRelatedClientEntryMap(options: BundlerRelatedClientEntryMapOptions): Promise<Record<string, string[]>>;
|
|
3
|
+
export { buildRelatedClientEntryMap, };
|
|
4
|
+
//# sourceMappingURL=related.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"related.d.ts","sourceRoot":"","sources":["../../../../src/core/frontend_app/related.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,mCAAmC,EACpC,MAAM,eAAe,CAAC;AAOvB,iBAAe,0BAA0B,CACvC,OAAO,EAAE,mCAAmC,GAC3C,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC,CAInC;AAqBD,OAAO,EACL,0BAA0B,GAC3B,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { collectRelatedFrontendEntries } from "../../src/core/frontend.js";
|
|
2
|
+
import { collectAggregateMatchedSourcesByRuleKey, normalizeAggregateSourceId, } from "./manifest.js";
|
|
3
|
+
async function buildRelatedClientEntryMap(options) {
|
|
4
|
+
const sources = resolveRelatedMapSources(options);
|
|
5
|
+
const entries = await Promise.all(sources.map((source) => resolveRelatedEntriesForSource(options, source)));
|
|
6
|
+
return Object.fromEntries(entries.sort(([a], [b]) => a.localeCompare(b)));
|
|
7
|
+
}
|
|
8
|
+
function resolveRelatedMapSources(options) {
|
|
9
|
+
if (options.aggregateSources?.length)
|
|
10
|
+
return Array.from(new Set(options.aggregateSources)).sort();
|
|
11
|
+
if (!options.manifest || !options.ruleKey)
|
|
12
|
+
return [];
|
|
13
|
+
return collectAggregateMatchedSourcesByRuleKey(options.manifest, options.ruleKey);
|
|
14
|
+
}
|
|
15
|
+
async function resolveRelatedEntriesForSource(options, source) {
|
|
16
|
+
const pageId = normalizeAggregateSourceId(source, options.pageId);
|
|
17
|
+
const related = await collectRelatedFrontendEntries({
|
|
18
|
+
rootDir: options.rootDir,
|
|
19
|
+
sources: source,
|
|
20
|
+
tsconfig: options.tsconfig,
|
|
21
|
+
});
|
|
22
|
+
return [pageId, related.entries];
|
|
23
|
+
}
|
|
24
|
+
export { buildRelatedClientEntryMap, };
|
|
25
|
+
//# sourceMappingURL=related.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"related.js","sourceRoot":"","sources":["../../../../src/core/frontend_app/related.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,6BAA6B,EAAE,MAAM,eAAe,CAAC;AAC9D,OAAO,EACL,uCAAuC,EACvC,0BAA0B,GAC3B,MAAM,eAAe,CAAC;AAEvB,KAAK,UAAU,0BAA0B,CACvC,OAA4C;IAE5C,MAAM,OAAO,GAAG,wBAAwB,CAAC,OAAO,CAAC,CAAC;IAClD,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,8BAA8B,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;IAC5G,OAAO,MAAM,CAAC,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAC5E,CAAC;AAED,SAAS,wBAAwB,CAAC,OAA4C;IAC5E,IAAI,OAAO,CAAC,gBAAgB,EAAE,MAAM;QAAE,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;IAClG,IAAI,CAAC,OAAO,CAAC,QAAQ,IAAI,CAAC,OAAO,CAAC,OAAO;QAAE,OAAO,EAAE,CAAC;IACrD,OAAO,uCAAuC,CAAC,OAAO,CAAC,QAAQ,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;AACpF,CAAC;AAED,KAAK,UAAU,8BAA8B,CAC3C,OAA4C,EAC5C,MAAc;IAEd,MAAM,MAAM,GAAG,0BAA0B,CAAC,MAAM,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;IAClE,MAAM,OAAO,GAAG,MAAM,6BAA6B,CAAC;QAClD,OAAO,EAAE,OAAO,CAAC,OAAO;QACxB,OAAO,EAAE,MAAM;QACf,QAAQ,EAAE,OAAO,CAAC,QAAQ;KAC3B,CAAC,CAAC;IACH,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;AACnC,CAAC;AAED,OAAO,EACL,0BAA0B,GAC3B,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { BundlerFrontendAppBundlerConfig, BundlerFrontendAppBundlerConfigOptions, BundlerFrontendRuntime, BundlerFrontendRuntimeConfig } from "../../src/types.d.ts";
|
|
2
|
+
declare function createFrontendBundlerRuntime(input: BundlerFrontendRuntimeConfig | BundlerFrontendAppBundlerConfig | BundlerFrontendAppBundlerConfigOptions): BundlerFrontendRuntime;
|
|
3
|
+
export { createFrontendBundlerRuntime, };
|
|
4
|
+
//# sourceMappingURL=runtime.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../../../src/core/frontend_app/runtime.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAGV,+BAA+B,EAC/B,sCAAsC,EACtC,sBAAsB,EACtB,4BAA4B,EAG7B,MAAM,eAAe,CAAC;AAqBvB,iBAAS,4BAA4B,CACnC,KAAK,EAAE,4BAA4B,GAAG,+BAA+B,GAAG,sCAAsC,GAC7G,sBAAsB,CAaxB;AAqLD,OAAO,EACL,4BAA4B,GAC7B,CAAC"}
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
import fs from "node:fs/promises";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { pathToFileURL } from "node:url";
|
|
4
|
+
import { watch } from "../../src/core/watch.js";
|
|
5
|
+
import { collectFrontendAssetLinks } from "./assets.js";
|
|
6
|
+
import { createFrontendBundlerRuntimeConfig } from "./config.js";
|
|
7
|
+
import { resolveConfiguredFrontendGlobalClientEntries } from "./global.js";
|
|
8
|
+
import { extractAssetManifest, readBundlerManifest, resolveAssetManifestEntryOutputPath, } from "./manifest.js";
|
|
9
|
+
import { prepareSsrNodeModules } from "./node_modules.js";
|
|
10
|
+
import { buildRelatedClientEntryMap } from "./related.js";
|
|
11
|
+
function createFrontendBundlerRuntime(input) {
|
|
12
|
+
const state = { config: normalizeRuntimeConfig(input) };
|
|
13
|
+
return {
|
|
14
|
+
buildAssetLinks: (pageIds) => buildRuntimeAssetLinks(state, pageIds),
|
|
15
|
+
buildAssetLinksSync: (pageIds) => buildRuntimeAssetLinksSync(state, pageIds),
|
|
16
|
+
dispose: () => disposeRuntime(state),
|
|
17
|
+
ensure: () => ensureRuntime(state),
|
|
18
|
+
getRuntime: () => state.runtime,
|
|
19
|
+
resolvePageComponent: (pageId) => resolveRuntimePageComponent(state, pageId),
|
|
20
|
+
resolvePageComponentSync: (pageId) => resolveRuntimePageComponentSync(state, pageId),
|
|
21
|
+
resolveRootDocument: () => resolveRuntimeRootDocument(state),
|
|
22
|
+
resolveRootDocumentSync: () => resolveRuntimeRootDocumentSync(state),
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
async function ensureRuntime(state) {
|
|
26
|
+
return state.config.mode === "development" ? ensureDevelopmentRuntime(state) : ensureProductionRuntime(state);
|
|
27
|
+
}
|
|
28
|
+
async function ensureDevelopmentRuntime(state) {
|
|
29
|
+
if (!state.clientWatch)
|
|
30
|
+
state.clientWatch = await watch(createWatchedOptions(state, "client"));
|
|
31
|
+
const client = await state.clientWatch.rebuild();
|
|
32
|
+
const ssr = state.config.ssrOptions ? await ensureDevelopmentSsr(state) : undefined;
|
|
33
|
+
await updateRuntimeFromBuilds(state, client, ssr);
|
|
34
|
+
return state.runtime;
|
|
35
|
+
}
|
|
36
|
+
async function ensureDevelopmentSsr(state) {
|
|
37
|
+
if (!state.config.ssrOptions)
|
|
38
|
+
return undefined;
|
|
39
|
+
if (!state.ssrWatch)
|
|
40
|
+
state.ssrWatch = await watch(createWatchedOptions(state, "ssr"));
|
|
41
|
+
return state.ssrWatch.rebuild();
|
|
42
|
+
}
|
|
43
|
+
async function ensureProductionRuntime(state) {
|
|
44
|
+
if (state.runtime)
|
|
45
|
+
return state.runtime;
|
|
46
|
+
const clientManifest = await readRuntimeAssetManifest(state.config.clientManifestPath);
|
|
47
|
+
const ssrManifest = await readRuntimeAssetManifest(state.config.ssrManifestPath);
|
|
48
|
+
const globalClientEntries = resolveConfiguredFrontendGlobalClientEntries(state.config, clientManifest);
|
|
49
|
+
const relatedClientEntryMap = ssrManifest ? await buildRuntimeRelatedMap(state.config, ssrManifest) : {};
|
|
50
|
+
const nodeModules = ssrManifest ? await prepareSsrNodeModules(state.config, state.config.nodeModules) : undefined;
|
|
51
|
+
const ssrModule = ssrManifest ? await importSsrModule(state, ssrManifest) : undefined;
|
|
52
|
+
state.runtime = { clientManifest, globalClientEntries, nodeModules, relatedClientEntryMap, ssrManifest, ssrModule };
|
|
53
|
+
return state.runtime;
|
|
54
|
+
}
|
|
55
|
+
async function updateRuntimeFromBuilds(state, client, ssr) {
|
|
56
|
+
const ssrManifest = ssr?.assetManifest;
|
|
57
|
+
const globalClientEntries = resolveConfiguredFrontendGlobalClientEntries(state.config, client.assetManifest);
|
|
58
|
+
const relatedClientEntryMap = ssrManifest ? await buildRuntimeRelatedMap(state.config, ssrManifest) : {};
|
|
59
|
+
const nodeModules = ssrManifest ? await prepareSsrNodeModules(state.config, state.config.nodeModules) : undefined;
|
|
60
|
+
const ssrModule = ssrManifest ? await importSsrModule(state, ssrManifest) : undefined;
|
|
61
|
+
state.runtime = {
|
|
62
|
+
client,
|
|
63
|
+
clientManifest: client.assetManifest,
|
|
64
|
+
globalClientEntries,
|
|
65
|
+
nodeModules,
|
|
66
|
+
relatedClientEntryMap,
|
|
67
|
+
ssr,
|
|
68
|
+
ssrManifest,
|
|
69
|
+
ssrModule,
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
function createWatchedOptions(state, kind) {
|
|
73
|
+
const options = kind === "client" ? state.config.clientOptions : state.config.ssrOptions;
|
|
74
|
+
const originalHook = options.onRebuilt;
|
|
75
|
+
return {
|
|
76
|
+
...options,
|
|
77
|
+
onRebuilt: async (result) => {
|
|
78
|
+
await originalHook?.(result);
|
|
79
|
+
if (kind === "client" && state.runtime)
|
|
80
|
+
state.runtime.client = result;
|
|
81
|
+
if (kind === "ssr" && state.runtime?.client)
|
|
82
|
+
await updateRuntimeFromBuilds(state, state.runtime.client, result);
|
|
83
|
+
},
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
async function importSsrModule(state, manifest) {
|
|
87
|
+
const entryPath = resolveRuntimeSsrEntryPath(state.config, manifest);
|
|
88
|
+
if (!entryPath)
|
|
89
|
+
return undefined;
|
|
90
|
+
const stats = await fs.stat(entryPath);
|
|
91
|
+
if (state.runtime?.ssrModule && state.ssrEntryMtime === stats.mtimeMs)
|
|
92
|
+
return state.runtime.ssrModule;
|
|
93
|
+
state.ssrEntryMtime = stats.mtimeMs;
|
|
94
|
+
return import(`${pathToFileURL(entryPath).href}?mtime=${stats.mtimeMs}`);
|
|
95
|
+
}
|
|
96
|
+
async function buildRuntimeRelatedMap(config, ssrManifest) {
|
|
97
|
+
if (!config.ssr)
|
|
98
|
+
return {};
|
|
99
|
+
return buildRelatedClientEntryMap({
|
|
100
|
+
manifest: ssrManifest,
|
|
101
|
+
pageId: config.pageId || { collapseIndex: config.ssr.collapseIndex, sourcePrefix: `${config.frontendDir}/pages` },
|
|
102
|
+
rootDir: config.rootDir,
|
|
103
|
+
ruleKey: config.ssr.key,
|
|
104
|
+
tsconfig: config.tsconfig,
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
async function buildRuntimeAssetLinks(state, pageIds = []) {
|
|
108
|
+
await ensureRuntime(state);
|
|
109
|
+
return buildRuntimeAssetLinksSync(state, pageIds);
|
|
110
|
+
}
|
|
111
|
+
function buildRuntimeAssetLinksSync(state, pageIds = []) {
|
|
112
|
+
const runtime = getEnsuredRuntime(state);
|
|
113
|
+
if (!runtime.clientManifest)
|
|
114
|
+
throw new Error("bundler-frontend-runtime-client-manifest-missing");
|
|
115
|
+
return collectFrontendAssetLinks({
|
|
116
|
+
collect: { publicPath: state.config.clientOptions.publicPath },
|
|
117
|
+
globalEntryIds: runtime.globalClientEntries,
|
|
118
|
+
globalStyleRuleKey: state.config.globalStyleRuleKey,
|
|
119
|
+
manifest: runtime.clientManifest,
|
|
120
|
+
pageIds,
|
|
121
|
+
relatedEntryMap: runtime.relatedClientEntryMap,
|
|
122
|
+
renderTags: state.config.renderTags,
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
async function resolveRuntimePageComponent(state, pageId) {
|
|
126
|
+
await ensureRuntime(state);
|
|
127
|
+
return resolveRuntimePageComponentSync(state, pageId);
|
|
128
|
+
}
|
|
129
|
+
function resolveRuntimePageComponentSync(state, pageId) {
|
|
130
|
+
const runtime = getEnsuredRuntime(state);
|
|
131
|
+
const resolver = runtime.ssrModule?.[state.config.ssr?.resolverExport || "getModule"];
|
|
132
|
+
if (typeof resolver === "function")
|
|
133
|
+
return resolver(pageId);
|
|
134
|
+
const modules = runtime.ssrModule?.[state.config.ssr?.mapExport || "modules"];
|
|
135
|
+
return modules && typeof modules === "object" ? modules[pageId] : undefined;
|
|
136
|
+
}
|
|
137
|
+
async function resolveRuntimeRootDocument(state) {
|
|
138
|
+
await ensureRuntime(state);
|
|
139
|
+
return resolveRuntimeRootDocumentSync(state);
|
|
140
|
+
}
|
|
141
|
+
function resolveRuntimeRootDocumentSync(state) {
|
|
142
|
+
const runtime = getEnsuredRuntime(state);
|
|
143
|
+
return runtime.ssrModule?.[state.config.ssr?.rootExport || "rootModule"];
|
|
144
|
+
}
|
|
145
|
+
function resolveRuntimeSsrEntryPath(config, manifest) {
|
|
146
|
+
if (!config.ssr || !config.ssrOutDir)
|
|
147
|
+
return undefined;
|
|
148
|
+
return resolveAssetManifestEntryOutputPath({
|
|
149
|
+
entryId: config.ssr.key,
|
|
150
|
+
from: "ruleKey",
|
|
151
|
+
manifest,
|
|
152
|
+
outDir: path.resolve(config.rootDir, config.ssrOutDir),
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
async function readRuntimeAssetManifest(filePath) {
|
|
156
|
+
if (!filePath)
|
|
157
|
+
return undefined;
|
|
158
|
+
const raw = await readBundlerManifest(filePath).catch((error) => {
|
|
159
|
+
if (error.code === "ENOENT")
|
|
160
|
+
return undefined;
|
|
161
|
+
throw error;
|
|
162
|
+
});
|
|
163
|
+
if (!raw)
|
|
164
|
+
return undefined;
|
|
165
|
+
return extractAssetManifest(raw);
|
|
166
|
+
}
|
|
167
|
+
async function disposeRuntime(state) {
|
|
168
|
+
await state.clientWatch?.dispose();
|
|
169
|
+
await state.ssrWatch?.dispose();
|
|
170
|
+
}
|
|
171
|
+
function normalizeRuntimeConfig(input) {
|
|
172
|
+
if ("clientManifestPath" in input)
|
|
173
|
+
return input;
|
|
174
|
+
return createFrontendBundlerRuntimeConfig(input);
|
|
175
|
+
}
|
|
176
|
+
function getEnsuredRuntime(state) {
|
|
177
|
+
if (!state.runtime)
|
|
178
|
+
throw new Error("bundler-frontend-runtime-not-ensured");
|
|
179
|
+
return state.runtime;
|
|
180
|
+
}
|
|
181
|
+
export { createFrontendBundlerRuntime, };
|
|
182
|
+
//# sourceMappingURL=runtime.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime.js","sourceRoot":"","sources":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E9G,IAAI,oBAAoB,IAAI,KAAK;QAAE,OAAO,KAAK,CAAC;IAChD,OAAO,kCAAkC,CAAC,KAAK,CAAC,CAAC;AACnD,CAAC;AAED,SAAS,iBAAiB,CAAC,KAA0B;IACnD,IAAI,CAAC,KAAK,CAAC,OAAO;QAAE,MAAM,IAAI,KAAK,CAAC,sCAAsC,CAAC,CAAC;IAC5E,OAAO,KAAK,CAAC,OAAO,CAAC;AACvB,CAAC;AAED,OAAO,EACL,4BAA4B,GAC7B,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { BundlerResolvedSsrModuleMapRuleOptions, BundlerSsrModuleMapRule, BundlerSsrModuleMapRuleOptions } from "../../src/types.d.ts";
|
|
2
|
+
declare function createSsrModuleMapRule(options?: BundlerSsrModuleMapRuleOptions): BundlerSsrModuleMapRule;
|
|
3
|
+
declare function createReactSsrModuleMapRule(options?: BundlerSsrModuleMapRuleOptions): BundlerSsrModuleMapRule;
|
|
4
|
+
declare function resolveSsrModuleMapRuleOptions(options?: BundlerSsrModuleMapRuleOptions): BundlerResolvedSsrModuleMapRuleOptions;
|
|
5
|
+
export { createReactSsrModuleMapRule, createSsrModuleMapRule, resolveSsrModuleMapRuleOptions, };
|
|
6
|
+
//# sourceMappingURL=ssr.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ssr.d.ts","sourceRoot":"","sources":["../../../../src/core/frontend_app/ssr.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,sCAAsC,EACtC,uBAAuB,EACvB,8BAA8B,EAC/B,MAAM,eAAe,CAAC;AAWvB,iBAAS,sBAAsB,CAAC,OAAO,GAAE,8BAAmC,GAAG,uBAAuB,CAuBrG;AAED,iBAAS,2BAA2B,CAAC,OAAO,GAAE,8BAAmC,GAAG,uBAAuB,CAE1G;AAED,iBAAS,8BAA8B,CACrC,OAAO,GAAE,8BAAmC,GAC3C,sCAAsC,CAiBxC;AAED,OAAO,EACL,2BAA2B,EAC3B,sBAAsB,EACtB,8BAA8B,GAC/B,CAAC"}
|