@absolutejs/absolute 0.20.0-beta.1 → 0.20.0-beta.10
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/README.md +45 -0
- package/dist/angular/components/core/streamingSlotRegistrar.js +1 -1
- package/dist/angular/components/core/streamingSlotRegistry.js +2 -2
- package/dist/angular/index.js +341 -22
- package/dist/angular/index.js.map +8 -5
- package/dist/angular/server.js +341 -22
- package/dist/angular/server.js.map +8 -5
- package/dist/build.js +537 -313
- package/dist/build.js.map +14 -13
- package/dist/cli/index.js +4171 -970
- package/dist/dev/client/cssUtils.ts +16 -2
- package/dist/dev/client/handlers/rebuild.ts +11 -1
- package/dist/dev/client/hmrTiming.ts +14 -7
- package/dist/index.js +857 -513
- package/dist/index.js.map +22 -21
- package/dist/mobile/browser.js +14 -1
- package/dist/mobile/browser.js.map +3 -3
- package/dist/mobile/index.js +2900 -244
- package/dist/mobile/index.js.map +23 -14
- package/dist/mobile/remoteMacAgentEntry.js +29 -0
- package/dist/mobile/shellAuth.js +43 -0
- package/dist/mobile/shellBootstrap.js +581 -0
- package/dist/mobile/shellSync.js +74 -0
- package/dist/src/angular/pageHandler.d.ts +3 -0
- package/dist/src/build/pwa.d.ts +15 -0
- package/dist/src/cli/config/server.d.ts +1 -1
- package/dist/src/core/pageHandlers.d.ts +11 -2
- package/dist/src/core/prepare.d.ts +6 -0
- package/dist/src/dev/clientManager.d.ts +2 -0
- package/dist/src/mobile/androidEmulatorController.d.ts +7 -1
- package/dist/src/mobile/androidRelease.d.ts +4 -0
- package/dist/src/mobile/buildPipeline.d.ts +1 -0
- package/dist/src/mobile/capacitorBundle.d.ts +15 -1
- package/dist/src/mobile/client.d.ts +4 -0
- package/dist/src/mobile/config.d.ts +1 -0
- package/dist/src/mobile/index.d.ts +7 -0
- package/dist/src/mobile/iosConformance.d.ts +15 -0
- package/dist/src/mobile/iosNativeWatcher.d.ts +19 -0
- package/dist/src/mobile/iosRelease.d.ts +61 -0
- package/dist/src/mobile/iosSimulatorController.d.ts +89 -0
- package/dist/src/mobile/nativeAuth.d.ts +17 -0
- package/dist/src/mobile/nativeBackgroundSync.d.ts +4 -0
- package/dist/src/mobile/releaseArtifact.d.ts +2 -0
- package/dist/src/mobile/releasePublisher.d.ts +130 -0
- package/dist/src/mobile/remoteMacAgent.d.ts +2 -0
- package/dist/src/mobile/remoteMacAgentEntry.d.ts +1 -0
- package/dist/src/mobile/remoteMacProtocol.d.ts +114 -0
- package/dist/src/mobile/remoteMacWire.d.ts +2 -0
- package/dist/src/mobile/shellAuth.d.ts +13 -0
- package/dist/src/mobile/shellBootstrap.d.ts +18 -1
- package/dist/src/mobile/shellSync.d.ts +19 -0
- package/dist/src/mobile/staticDocument.d.ts +5 -0
- package/dist/src/mobile/transport.d.ts +13 -1
- package/dist/src/plugins/hmr.d.ts +3 -0
- package/dist/src/plugins/imageOptimizer.d.ts +1 -1
- package/dist/src/svelte/pageHandler.d.ts +3 -0
- package/dist/src/utils/loadConfig.d.ts +1 -0
- package/dist/src/vue/pageHandler.d.ts +3 -0
- package/dist/svelte/index.js +312 -23
- package/dist/svelte/index.js.map +7 -4
- package/dist/svelte/server.js +307 -18
- package/dist/svelte/server.js.map +7 -4
- package/dist/types/build.d.ts +18 -0
- package/dist/vue/index.js +312 -23
- package/dist/vue/index.js.map +7 -4
- package/dist/vue/server.js +307 -18
- package/dist/vue/server.js.map +7 -4
- package/package.json +25 -9
package/dist/build.js
CHANGED
|
@@ -969,9 +969,10 @@ var indexContentCache, resolveDevClientDir = () => {
|
|
|
969
969
|
`}
|
|
970
970
|
`,
|
|
971
971
|
`// Attempt hydration with error handling`,
|
|
972
|
+
`const shouldClientRender = window.__ABSOLUTE_PAGE_RENDER_MODE__ === 'client';`,
|
|
972
973
|
`// Use document (not document.body) when the page renders <html><head><body>`,
|
|
973
974
|
`// to avoid "In HTML, <html> cannot be a child of <body>" hydration error`,
|
|
974
|
-
`const container = typeof document !== 'undefined' ? document : null;`,
|
|
975
|
+
`const container = typeof document !== 'undefined' ? (shouldClientRender ? document.getElementById('root') : document) : null;`,
|
|
975
976
|
`if (!container) {`,
|
|
976
977
|
` throw new Error('React root container not found: document is null');`,
|
|
977
978
|
`}
|
|
@@ -997,7 +998,6 @@ var indexContentCache, resolveDevClientDir = () => {
|
|
|
997
998
|
`if (!window.__REACT_ROOT__) {`,
|
|
998
999
|
` let root;`,
|
|
999
1000
|
` // Mobile data envelopes and dirty HMR pages have no matching SSR markup.`,
|
|
1000
|
-
` const shouldClientRender = window.__ABSOLUTE_PAGE_RENDER_MODE__ === 'client';`,
|
|
1001
1001
|
` if (window.__SSR_DIRTY__ || shouldClientRender) {`,
|
|
1002
1002
|
` root = createRoot(container);`,
|
|
1003
1003
|
` root.render(${isDev ? `createElement(ErrorBoundary, null, createElement(PageComponent, mergedProps))` : `createElement(PageComponent, mergedProps)`});`,
|
|
@@ -1077,6 +1077,15 @@ var indexContentCache, resolveDevClientDir = () => {
|
|
|
1077
1077
|
` };`,
|
|
1078
1078
|
` }`,
|
|
1079
1079
|
`}`,
|
|
1080
|
+
`if (typeof window !== 'undefined') {`,
|
|
1081
|
+
` window.__ABSOLUTE_PAGE_READY__ = Promise.resolve();`,
|
|
1082
|
+
` window.__ABSOLUTE_PAGE_DISPOSE__ = function() {`,
|
|
1083
|
+
` if (window.__REACT_ROOT__ && typeof window.__REACT_ROOT__.unmount === 'function') {`,
|
|
1084
|
+
` window.__REACT_ROOT__.unmount();`,
|
|
1085
|
+
` }`,
|
|
1086
|
+
` window.__REACT_ROOT__ = null;`,
|
|
1087
|
+
` };`,
|
|
1088
|
+
`}`,
|
|
1080
1089
|
...isDev ? [
|
|
1081
1090
|
`
|
|
1082
1091
|
// Pre-warm: import the page module from the module server`,
|
|
@@ -12355,7 +12364,8 @@ var heldLocks, HELD_LOCKS_ENV = "ABSOLUTE_HELD_BUILD_DIRECTORY_LOCKS", exitHandl
|
|
|
12355
12364
|
});
|
|
12356
12365
|
process.on("uncaughtException", (err) => {
|
|
12357
12366
|
releaseAllSync();
|
|
12358
|
-
|
|
12367
|
+
console.error(err);
|
|
12368
|
+
process.exit(1);
|
|
12359
12369
|
});
|
|
12360
12370
|
}, isAlreadyExistsError = (error) => error instanceof Error && ("code" in error) && Reflect.get(error, "code") === "EEXIST", lockPathForBuildDirectory = (buildDirectory) => join23(dirname12(buildDirectory), ".absolutejs", "build.lock"), readHeldLockEnv = () => new Set((process.env[HELD_LOCKS_ENV] ?? "").split(`
|
|
12361
12371
|
`).filter((entry) => entry.length > 0)), writeHeldLockEnv = (locks) => {
|
|
@@ -12849,13 +12859,135 @@ var isTestSourcePath = (file) => {
|
|
|
12849
12859
|
return normalized.includes("/__tests__/") || /\.(?:test|spec)\.[cm]?[jt]sx?$/.test(normalized);
|
|
12850
12860
|
};
|
|
12851
12861
|
|
|
12862
|
+
// src/build/pwa.ts
|
|
12863
|
+
import { mkdir as mkdir5, rm as rm4, writeFile as writeFile5 } from "fs/promises";
|
|
12864
|
+
import { dirname as dirname13, join as join24 } from "path";
|
|
12865
|
+
var BOOTSTRAP_PUBLIC_PATH = "/__absolute/pwa/bootstrap.js", BOOTSTRAP_MARKER = "data-absolute-pwa", publicFilePath = (value, fallback, field) => {
|
|
12866
|
+
const input = value ?? fallback;
|
|
12867
|
+
if (!input.startsWith("/") || input.startsWith("//")) {
|
|
12868
|
+
throw new TypeError(`${field} must be an absolute same-origin path.`);
|
|
12869
|
+
}
|
|
12870
|
+
let url;
|
|
12871
|
+
try {
|
|
12872
|
+
url = new URL(input, "https://absolute.invalid");
|
|
12873
|
+
} catch {
|
|
12874
|
+
throw new TypeError(`${field} must be an absolute same-origin path.`);
|
|
12875
|
+
}
|
|
12876
|
+
if (url.origin !== "https://absolute.invalid" || url.search || url.hash || url.pathname === "/") {
|
|
12877
|
+
throw new TypeError(`${field} must be a file path without query or hash.`);
|
|
12878
|
+
}
|
|
12879
|
+
for (const part of input.split("/")) {
|
|
12880
|
+
let decoded;
|
|
12881
|
+
try {
|
|
12882
|
+
decoded = decodeURIComponent(part);
|
|
12883
|
+
} catch {
|
|
12884
|
+
throw new TypeError(`${field} contains invalid URL encoding.`);
|
|
12885
|
+
}
|
|
12886
|
+
if (decoded === "." || decoded === ".." || decoded.includes("\\")) {
|
|
12887
|
+
throw new TypeError(`${field} must not contain traversal segments.`);
|
|
12888
|
+
}
|
|
12889
|
+
}
|
|
12890
|
+
return url.pathname;
|
|
12891
|
+
}, destinationFor = (buildPath, publicPath) => join24(buildPath, ...publicPath.split("/").filter(Boolean)), bootstrapEntrySource = ({
|
|
12892
|
+
clientModule,
|
|
12893
|
+
manifestPath,
|
|
12894
|
+
serviceWorkerPath,
|
|
12895
|
+
sync
|
|
12896
|
+
}) => `import { registerServiceWorker } from ${JSON.stringify(clientModule)};
|
|
12897
|
+
${manifestPath ? `const manifest = document.querySelector('link[rel="manifest"]') ?? document.createElement('link');
|
|
12898
|
+
manifest.setAttribute('rel', 'manifest');
|
|
12899
|
+
manifest.setAttribute('href', ${JSON.stringify(manifestPath)});
|
|
12900
|
+
if (!manifest.isConnected) document.head.append(manifest);
|
|
12901
|
+
` : ""}await registerServiceWorker(${JSON.stringify(serviceWorkerPath)}, {
|
|
12902
|
+
deferUntilLoad: false${sync ? `,
|
|
12903
|
+
sync: ${JSON.stringify(sync === true ? {} : sync)}` : ""}
|
|
12904
|
+
});
|
|
12905
|
+
`, injectionSource = () => `if (typeof window !== 'undefined') {
|
|
12906
|
+
await import(new URL(${JSON.stringify(BOOTSTRAP_PUBLIC_PATH)}, window.location.origin).href);
|
|
12907
|
+
}
|
|
12908
|
+
`, injectPwaBootstrapHtml = (html) => {
|
|
12909
|
+
if (html.includes(BOOTSTRAP_MARKER))
|
|
12910
|
+
return html;
|
|
12911
|
+
const script = `<script type="module" src="${BOOTSTRAP_PUBLIC_PATH}" ${BOOTSTRAP_MARKER}></script>`;
|
|
12912
|
+
const closingHead = html.toLowerCase().indexOf("</head>");
|
|
12913
|
+
if (closingHead >= 0) {
|
|
12914
|
+
return `${html.slice(0, closingHead)}${script}${html.slice(closingHead)}`;
|
|
12915
|
+
}
|
|
12916
|
+
return `${script}${html}`;
|
|
12917
|
+
}, materializeAbsolutePwa = async ({
|
|
12918
|
+
buildPath,
|
|
12919
|
+
config,
|
|
12920
|
+
generatedRoot,
|
|
12921
|
+
write: write2 = true
|
|
12922
|
+
}) => {
|
|
12923
|
+
const serviceWorkerPath = publicFilePath(config.serviceWorkerPath, "/sw.js", "pwa.serviceWorkerPath");
|
|
12924
|
+
if (serviceWorkerPath.slice(1).includes("/")) {
|
|
12925
|
+
throw new TypeError("pwa.serviceWorkerPath must be a root-level file so its default service-worker scope covers the application.");
|
|
12926
|
+
}
|
|
12927
|
+
const manifestPath = config.manifest ? publicFilePath(config.manifest.path, "/manifest.webmanifest", "pwa.manifest.path") : undefined;
|
|
12928
|
+
const artifacts = {
|
|
12929
|
+
bootstrapBanner: injectionSource(),
|
|
12930
|
+
bootstrapPublicPath: BOOTSTRAP_PUBLIC_PATH,
|
|
12931
|
+
manifestPath,
|
|
12932
|
+
serviceWorkerPath
|
|
12933
|
+
};
|
|
12934
|
+
if (!write2)
|
|
12935
|
+
return artifacts;
|
|
12936
|
+
const { createWebAppManifest, pushServiceWorker } = await import("@absolutejs/pwa");
|
|
12937
|
+
const workerDestination = destinationFor(buildPath, serviceWorkerPath);
|
|
12938
|
+
await mkdir5(dirname13(workerDestination), { recursive: true });
|
|
12939
|
+
await writeFile5(workerDestination, `${pushServiceWorker({
|
|
12940
|
+
...config.serviceWorker ?? {},
|
|
12941
|
+
sync: Boolean(config.sync)
|
|
12942
|
+
})}
|
|
12943
|
+
`);
|
|
12944
|
+
if (config.manifest && manifestPath) {
|
|
12945
|
+
const { path: _path, ...manifestConfig } = config.manifest;
|
|
12946
|
+
const manifestDestination = destinationFor(buildPath, manifestPath);
|
|
12947
|
+
await mkdir5(dirname13(manifestDestination), { recursive: true });
|
|
12948
|
+
await writeFile5(manifestDestination, `${JSON.stringify(createWebAppManifest(manifestConfig), null, "\t")}
|
|
12949
|
+
`);
|
|
12950
|
+
}
|
|
12951
|
+
const generatedDirectory = join24(generatedRoot, "pwa");
|
|
12952
|
+
const bootstrapEntry = join24(generatedDirectory, "bootstrap.ts");
|
|
12953
|
+
const clientModule = Bun.resolveSync("@absolutejs/pwa/client", import.meta.dir);
|
|
12954
|
+
await mkdir5(generatedDirectory, { recursive: true });
|
|
12955
|
+
await writeFile5(bootstrapEntry, bootstrapEntrySource({
|
|
12956
|
+
clientModule,
|
|
12957
|
+
manifestPath,
|
|
12958
|
+
serviceWorkerPath,
|
|
12959
|
+
sync: config.sync
|
|
12960
|
+
}));
|
|
12961
|
+
const browserDirectory = destinationFor(buildPath, "/__absolute/pwa");
|
|
12962
|
+
await rm4(browserDirectory, { force: true, recursive: true });
|
|
12963
|
+
await mkdir5(browserDirectory, { recursive: true });
|
|
12964
|
+
const result = await Bun.build({
|
|
12965
|
+
entrypoints: [bootstrapEntry],
|
|
12966
|
+
format: "esm",
|
|
12967
|
+
minify: true,
|
|
12968
|
+
naming: {
|
|
12969
|
+
asset: "asset-[hash].[ext]",
|
|
12970
|
+
chunk: "chunk-[hash].[ext]",
|
|
12971
|
+
entry: "bootstrap.js"
|
|
12972
|
+
},
|
|
12973
|
+
outdir: browserDirectory,
|
|
12974
|
+
splitting: true,
|
|
12975
|
+
target: "browser"
|
|
12976
|
+
});
|
|
12977
|
+
if (!result.success) {
|
|
12978
|
+
throw new AggregateError(result.logs, "Failed to build the AbsoluteJS PWA bootstrap.");
|
|
12979
|
+
}
|
|
12980
|
+
return artifacts;
|
|
12981
|
+
};
|
|
12982
|
+
var init_pwa = () => {};
|
|
12983
|
+
|
|
12852
12984
|
// src/build/scanVueSsrOnlyPages.ts
|
|
12853
12985
|
var exports_scanVueSsrOnlyPages = {};
|
|
12854
12986
|
__export(exports_scanVueSsrOnlyPages, {
|
|
12855
12987
|
scanVueSsrOnlyPages: () => scanVueSsrOnlyPages
|
|
12856
12988
|
});
|
|
12857
12989
|
import { readdirSync as readdirSync2, readFileSync as readFileSync13 } from "fs";
|
|
12858
|
-
import { join as
|
|
12990
|
+
import { join as join25 } from "path";
|
|
12859
12991
|
import ts8 from "typescript";
|
|
12860
12992
|
var SKIP_DIRS2, SOURCE_EXTENSIONS2, getScriptKind3 = (filePath) => {
|
|
12861
12993
|
if (filePath.endsWith(".tsx"))
|
|
@@ -12888,9 +13020,9 @@ var SKIP_DIRS2, SOURCE_EXTENSIONS2, getScriptKind3 = (filePath) => {
|
|
|
12888
13020
|
continue;
|
|
12889
13021
|
if (entry.name.startsWith("."))
|
|
12890
13022
|
continue;
|
|
12891
|
-
stack.push(
|
|
13023
|
+
stack.push(join25(dir, entry.name));
|
|
12892
13024
|
} else if (entry.isFile() && hasSourceExtension2(entry.name)) {
|
|
12893
|
-
out.push(
|
|
13025
|
+
out.push(join25(dir, entry.name));
|
|
12894
13026
|
}
|
|
12895
13027
|
}
|
|
12896
13028
|
}
|
|
@@ -13002,7 +13134,7 @@ var init_scanVueSsrOnlyPages = __esm(() => {
|
|
|
13002
13134
|
|
|
13003
13135
|
// src/build/scanAngularHandlerCalls.ts
|
|
13004
13136
|
import { readdirSync as readdirSync3, readFileSync as readFileSync14 } from "fs";
|
|
13005
|
-
import { join as
|
|
13137
|
+
import { join as join26 } from "path";
|
|
13006
13138
|
import ts9 from "typescript";
|
|
13007
13139
|
var ELYSIA_ROUTE_METHODS2, SKIP_DIRS3, SOURCE_EXTENSIONS3, SERVER_ENTRY_COPY_PREFIX = ".absolutejs-hmr-", getScriptKind4 = (filePath) => {
|
|
13008
13140
|
if (filePath.endsWith(".tsx"))
|
|
@@ -13035,9 +13167,9 @@ var ELYSIA_ROUTE_METHODS2, SKIP_DIRS3, SOURCE_EXTENSIONS3, SERVER_ENTRY_COPY_PRE
|
|
|
13035
13167
|
continue;
|
|
13036
13168
|
if (entry.name.startsWith("."))
|
|
13037
13169
|
continue;
|
|
13038
|
-
stack.push(
|
|
13170
|
+
stack.push(join26(dir, entry.name));
|
|
13039
13171
|
} else if (entry.isFile() && !entry.name.startsWith(SERVER_ENTRY_COPY_PREFIX) && hasSourceExtension3(entry.name)) {
|
|
13040
|
-
out.push(
|
|
13172
|
+
out.push(join26(dir, entry.name));
|
|
13041
13173
|
}
|
|
13042
13174
|
}
|
|
13043
13175
|
}
|
|
@@ -13152,7 +13284,7 @@ var init_scanAngularHandlerCalls = __esm(() => {
|
|
|
13152
13284
|
|
|
13153
13285
|
// src/build/scanAngularPageRoutes.ts
|
|
13154
13286
|
import { readdirSync as readdirSync4, readFileSync as readFileSync15 } from "fs";
|
|
13155
|
-
import { basename as basename9, join as
|
|
13287
|
+
import { basename as basename9, join as join27 } from "path";
|
|
13156
13288
|
import ts10 from "typescript";
|
|
13157
13289
|
var SOURCE_EXTENSIONS4, SKIP_DIRS4, hasSourceExtension4 = (filePath) => {
|
|
13158
13290
|
const idx = filePath.lastIndexOf(".");
|
|
@@ -13192,9 +13324,9 @@ var SOURCE_EXTENSIONS4, SKIP_DIRS4, hasSourceExtension4 = (filePath) => {
|
|
|
13192
13324
|
continue;
|
|
13193
13325
|
if (entry.name.startsWith("."))
|
|
13194
13326
|
continue;
|
|
13195
|
-
stack.push(
|
|
13327
|
+
stack.push(join27(dir, entry.name));
|
|
13196
13328
|
} else if (entry.isFile() && isPageFile(entry.name)) {
|
|
13197
|
-
out.push(
|
|
13329
|
+
out.push(join27(dir, entry.name));
|
|
13198
13330
|
}
|
|
13199
13331
|
}
|
|
13200
13332
|
}
|
|
@@ -13271,7 +13403,7 @@ __export(exports_parseAngularConfigImports, {
|
|
|
13271
13403
|
parseAngularProvidersImport: () => parseAngularProvidersImport
|
|
13272
13404
|
});
|
|
13273
13405
|
import { existsSync as existsSync20, readFileSync as readFileSync16 } from "fs";
|
|
13274
|
-
import { dirname as
|
|
13406
|
+
import { dirname as dirname14, isAbsolute as isAbsolute3, join as join28 } from "path";
|
|
13275
13407
|
import ts11 from "typescript";
|
|
13276
13408
|
var findDefineConfigCall = (sf) => {
|
|
13277
13409
|
let result = null;
|
|
@@ -13326,15 +13458,15 @@ var findDefineConfigCall = (sf) => {
|
|
|
13326
13458
|
}, resolveConfigPath = (projectRoot) => {
|
|
13327
13459
|
const envOverride = process.env.ABSOLUTE_CONFIG;
|
|
13328
13460
|
if (envOverride) {
|
|
13329
|
-
const resolved = isAbsolute3(envOverride) ? envOverride :
|
|
13461
|
+
const resolved = isAbsolute3(envOverride) ? envOverride : join28(projectRoot, envOverride);
|
|
13330
13462
|
if (existsSync20(resolved))
|
|
13331
13463
|
return resolved;
|
|
13332
13464
|
}
|
|
13333
13465
|
const candidates = [
|
|
13334
|
-
|
|
13335
|
-
|
|
13336
|
-
|
|
13337
|
-
|
|
13466
|
+
join28(projectRoot, "absolute.config.ts"),
|
|
13467
|
+
join28(projectRoot, "absolute.config.mts"),
|
|
13468
|
+
join28(projectRoot, "absolute.config.js"),
|
|
13469
|
+
join28(projectRoot, "absolute.config.mjs")
|
|
13338
13470
|
];
|
|
13339
13471
|
for (const candidate of candidates) {
|
|
13340
13472
|
if (existsSync20(candidate))
|
|
@@ -13366,8 +13498,8 @@ var findDefineConfigCall = (sf) => {
|
|
|
13366
13498
|
const importInfo = findImportForBinding(sf, binding);
|
|
13367
13499
|
if (!importInfo)
|
|
13368
13500
|
return null;
|
|
13369
|
-
const configDir2 =
|
|
13370
|
-
const absolutePath = importInfo.source.startsWith(".") ?
|
|
13501
|
+
const configDir2 = dirname14(configPath2);
|
|
13502
|
+
const absolutePath = importInfo.source.startsWith(".") ? join28(configDir2, importInfo.source).replace(/\.[cm]?[tj]sx?$/, "") : isAbsolute3(importInfo.source) ? importInfo.source.replace(/\.[cm]?[tj]sx?$/, "") : importInfo.source;
|
|
13371
13503
|
return {
|
|
13372
13504
|
absolutePath,
|
|
13373
13505
|
bindingName: binding,
|
|
@@ -13516,10 +13648,10 @@ __export(exports_compileSvelte, {
|
|
|
13516
13648
|
clearSvelteCompilerCache: () => clearSvelteCompilerCache
|
|
13517
13649
|
});
|
|
13518
13650
|
import { existsSync as existsSync21 } from "fs";
|
|
13519
|
-
import { mkdir as
|
|
13651
|
+
import { mkdir as mkdir6, stat as stat2 } from "fs/promises";
|
|
13520
13652
|
import {
|
|
13521
|
-
dirname as
|
|
13522
|
-
join as
|
|
13653
|
+
dirname as dirname15,
|
|
13654
|
+
join as join29,
|
|
13523
13655
|
basename as basename10,
|
|
13524
13656
|
extname as extname7,
|
|
13525
13657
|
resolve as resolve20,
|
|
@@ -13567,7 +13699,7 @@ var resolveDevClientDir2 = () => {
|
|
|
13567
13699
|
}, resolveRelativeModule2 = async (spec, from) => {
|
|
13568
13700
|
if (!spec.startsWith("."))
|
|
13569
13701
|
return null;
|
|
13570
|
-
const basePath = resolve20(
|
|
13702
|
+
const basePath = resolve20(dirname15(from), spec);
|
|
13571
13703
|
const candidates = [
|
|
13572
13704
|
basePath,
|
|
13573
13705
|
`${basePath}.ts`,
|
|
@@ -13578,14 +13710,14 @@ var resolveDevClientDir2 = () => {
|
|
|
13578
13710
|
`${basePath}.svelte`,
|
|
13579
13711
|
`${basePath}.svelte.ts`,
|
|
13580
13712
|
`${basePath}.svelte.js`,
|
|
13581
|
-
|
|
13582
|
-
|
|
13583
|
-
|
|
13584
|
-
|
|
13585
|
-
|
|
13586
|
-
|
|
13587
|
-
|
|
13588
|
-
|
|
13713
|
+
join29(basePath, "index.ts"),
|
|
13714
|
+
join29(basePath, "index.js"),
|
|
13715
|
+
join29(basePath, "index.mjs"),
|
|
13716
|
+
join29(basePath, "index.cjs"),
|
|
13717
|
+
join29(basePath, "index.json"),
|
|
13718
|
+
join29(basePath, "index.svelte"),
|
|
13719
|
+
join29(basePath, "index.svelte.ts"),
|
|
13720
|
+
join29(basePath, "index.svelte.js")
|
|
13589
13721
|
];
|
|
13590
13722
|
const checks = await Promise.all(candidates.map(exists));
|
|
13591
13723
|
return candidates.find((_2, index) => checks[index]) ?? null;
|
|
@@ -13594,7 +13726,7 @@ var resolveDevClientDir2 = () => {
|
|
|
13594
13726
|
const resolved = resolvePackageImport(spec);
|
|
13595
13727
|
return resolved && /\.svelte(\.(?:ts|js))?$/.test(resolved) ? resolved : null;
|
|
13596
13728
|
}
|
|
13597
|
-
const basePath = resolve20(
|
|
13729
|
+
const basePath = resolve20(dirname15(from), spec);
|
|
13598
13730
|
const explicit = /\.(svelte|svelte\.(?:ts|js))$/.test(basePath);
|
|
13599
13731
|
if (!explicit) {
|
|
13600
13732
|
const extensions = [".svelte", ".svelte.ts", ".svelte.js"];
|
|
@@ -13624,10 +13756,10 @@ var resolveDevClientDir2 = () => {
|
|
|
13624
13756
|
}, compileSvelte = async (entryPoints, svelteRoot, cache = new Map, isDev2 = false, stylePreprocessors) => {
|
|
13625
13757
|
const { compile, compileModule, preprocess } = await import("svelte/compiler");
|
|
13626
13758
|
const generatedDir = getFrameworkGeneratedDir("svelte");
|
|
13627
|
-
const clientDir =
|
|
13628
|
-
const indexDir =
|
|
13629
|
-
const serverDir =
|
|
13630
|
-
await Promise.all([clientDir, indexDir, serverDir].map((dir) =>
|
|
13759
|
+
const clientDir = join29(generatedDir, "client");
|
|
13760
|
+
const indexDir = join29(generatedDir, "indexes");
|
|
13761
|
+
const serverDir = join29(generatedDir, "server");
|
|
13762
|
+
await Promise.all([clientDir, indexDir, serverDir].map((dir) => mkdir6(dir, { recursive: true })));
|
|
13631
13763
|
const dev = env.NODE_ENV !== "production";
|
|
13632
13764
|
const build = async (src) => {
|
|
13633
13765
|
const memoized = cache.get(src);
|
|
@@ -13654,8 +13786,8 @@ var resolveDevClientDir2 = () => {
|
|
|
13654
13786
|
const preprocessedClient = isModule ? loweredClientSource.code : (await preprocess(loweredClientSource.code, svelteStylePreprocessor)).code;
|
|
13655
13787
|
const transpiledServer = src.endsWith(".ts") || src.endsWith(".svelte.ts") ? transpiler3.transformSync(preprocessedServer) : preprocessedServer;
|
|
13656
13788
|
const transpiledClient = src.endsWith(".ts") || src.endsWith(".svelte.ts") ? transpiler3.transformSync(preprocessedClient) : preprocessedClient;
|
|
13657
|
-
const rawRel =
|
|
13658
|
-
const relDir = rawRel.startsWith("..") ? `_ext/${relative11(process.cwd(),
|
|
13789
|
+
const rawRel = dirname15(relative11(svelteRoot, src)).replace(/\\/g, "/");
|
|
13790
|
+
const relDir = rawRel.startsWith("..") ? `_ext/${relative11(process.cwd(), dirname15(src)).replace(/\\/g, "/")}` : rawRel;
|
|
13659
13791
|
const baseName = basename10(src).replace(/\.svelte(\.(ts|js))?$/, "");
|
|
13660
13792
|
const importPaths = Array.from(transpiledServer.matchAll(/from\s+['"]([^'"]+)['"]/g)).map((match) => match[1]).filter((path) => path !== undefined);
|
|
13661
13793
|
const resolvedModuleImports = await Promise.all(importPaths.map((importPath) => resolveRelativeModule2(importPath, src)));
|
|
@@ -13664,8 +13796,8 @@ var resolveDevClientDir2 = () => {
|
|
|
13664
13796
|
const childBuilt = await Promise.all(childSources.map((child) => build(child)));
|
|
13665
13797
|
const hasAwaitSlotFromChildren = childBuilt.some((child) => child.hasAwaitSlot);
|
|
13666
13798
|
const externalRewrites = new Map;
|
|
13667
|
-
const ssrOutputDir =
|
|
13668
|
-
const clientOutputDir =
|
|
13799
|
+
const ssrOutputDir = dirname15(join29(serverDir, relDir, `${baseName}.js`));
|
|
13800
|
+
const clientOutputDir = dirname15(join29(clientDir, relDir, `${baseName}.js`));
|
|
13669
13801
|
for (let idx = 0;idx < importPaths.length; idx++) {
|
|
13670
13802
|
const rawSpec = importPaths[idx];
|
|
13671
13803
|
if (!rawSpec)
|
|
@@ -13730,11 +13862,11 @@ var resolveDevClientDir2 = () => {
|
|
|
13730
13862
|
code += islandMetadataExports;
|
|
13731
13863
|
return { code, map: compiledJs.map };
|
|
13732
13864
|
};
|
|
13733
|
-
const ssrPath =
|
|
13734
|
-
const clientPath =
|
|
13865
|
+
const ssrPath = join29(serverDir, relDir, `${baseName}.js`);
|
|
13866
|
+
const clientPath = join29(clientDir, relDir, `${baseName}.js`);
|
|
13735
13867
|
await Promise.all([
|
|
13736
|
-
|
|
13737
|
-
|
|
13868
|
+
mkdir6(dirname15(ssrPath), { recursive: true }),
|
|
13869
|
+
mkdir6(dirname15(clientPath), { recursive: true })
|
|
13738
13870
|
]);
|
|
13739
13871
|
const inlineMap = (map) => map ? `
|
|
13740
13872
|
//# sourceMappingURL=data:application/json;base64,${Buffer.from(JSON.stringify(map)).toString("base64")}
|
|
@@ -13769,10 +13901,10 @@ var resolveDevClientDir2 = () => {
|
|
|
13769
13901
|
const roots = await Promise.all(entryPoints.map(build));
|
|
13770
13902
|
const componentRoots = roots.filter((root) => !root.isModule);
|
|
13771
13903
|
await Promise.all(componentRoots.map(async ({ client, hasAwaitSlot }) => {
|
|
13772
|
-
const relClientDir =
|
|
13904
|
+
const relClientDir = dirname15(relative11(clientDir, client));
|
|
13773
13905
|
const name = basename10(client, extname7(client));
|
|
13774
|
-
const indexPath =
|
|
13775
|
-
const importRaw = relative11(
|
|
13906
|
+
const indexPath = join29(indexDir, relClientDir, `${name}.js`);
|
|
13907
|
+
const importRaw = relative11(dirname15(indexPath), client).split(sep2).join("/");
|
|
13776
13908
|
const importPath = importRaw.startsWith(".") || importRaw.startsWith("/") ? importRaw : `./${importRaw}`;
|
|
13777
13909
|
const hmrImports = isDev2 ? `window.__HMR_FRAMEWORK__ = "svelte";
|
|
13778
13910
|
import "${hmrClientPath3}";
|
|
@@ -13783,8 +13915,9 @@ import { hydrate, mount, unmount } from "svelte";
|
|
|
13783
13915
|
var initialProps = (typeof window !== "undefined" && window.__INITIAL_PROPS__) ? window.__INITIAL_PROPS__ : {};
|
|
13784
13916
|
var isHMR = typeof window !== "undefined" && window.__SVELTE_COMPONENT__ !== undefined;
|
|
13785
13917
|
var isSsrDirty = typeof window !== "undefined" && window.__SSR_DIRTY__;
|
|
13918
|
+
var isClientRender = typeof window !== "undefined" && window.__ABSOLUTE_PAGE_RENDER_MODE__ === "client";
|
|
13786
13919
|
var hasIslandHtml = false;
|
|
13787
|
-
var shouldHydrate = typeof window === "undefined" ? false : ${hasAwaitSlot ? "false" : "true"};
|
|
13920
|
+
var shouldHydrate = typeof window === "undefined" || isClientRender ? false : ${hasAwaitSlot ? "false" : "true"};
|
|
13788
13921
|
var component;
|
|
13789
13922
|
var target = document.getElementById(${JSON.stringify(SVELTE_PAGE_ROOT_ID)}) || document.body;
|
|
13790
13923
|
|
|
@@ -13815,6 +13948,8 @@ if (isHMR) {
|
|
|
13815
13948
|
}
|
|
13816
13949
|
component = mount(Component, { target, props: mergedProps });
|
|
13817
13950
|
window.__HMR_PRESERVED_STATE__ = undefined;
|
|
13951
|
+
} else if (isClientRender) {
|
|
13952
|
+
component = mount(Component, { target, props: initialProps });
|
|
13818
13953
|
} else if (!shouldHydrate) {
|
|
13819
13954
|
component = undefined;
|
|
13820
13955
|
} else if (isSsrDirty || hasIslandHtml) {
|
|
@@ -13826,6 +13961,13 @@ if (isHMR) {
|
|
|
13826
13961
|
if (typeof window !== "undefined") {
|
|
13827
13962
|
window.__SVELTE_COMPONENT__ = component;
|
|
13828
13963
|
window.__SVELTE_UNMOUNT__ = function() { if (component) { unmount(component); } };
|
|
13964
|
+
window.__ABSOLUTE_PAGE_READY__ = Promise.resolve();
|
|
13965
|
+
window.__ABSOLUTE_PAGE_DISPOSE__ = function() {
|
|
13966
|
+
if (component) { unmount(component); }
|
|
13967
|
+
component = undefined;
|
|
13968
|
+
window.__SVELTE_COMPONENT__ = undefined;
|
|
13969
|
+
window.__SVELTE_UNMOUNT__ = undefined;
|
|
13970
|
+
};
|
|
13829
13971
|
window.__SVELTE_REMOUNT__ = function(props) {
|
|
13830
13972
|
if (typeof window.__SVELTE_UNMOUNT__ === "function") {
|
|
13831
13973
|
try { window.__SVELTE_UNMOUNT__(); } catch (err) { /* ignore */ }
|
|
@@ -13851,14 +13993,14 @@ if (typeof window !== "undefined") {
|
|
|
13851
13993
|
setTimeout(releaseStreamingSlots, 0);
|
|
13852
13994
|
}
|
|
13853
13995
|
}`;
|
|
13854
|
-
await
|
|
13996
|
+
await mkdir6(dirname15(indexPath), { recursive: true });
|
|
13855
13997
|
return write2(indexPath, bootstrap);
|
|
13856
13998
|
}));
|
|
13857
13999
|
return {
|
|
13858
14000
|
svelteClientPaths: roots.map(({ client }) => client),
|
|
13859
14001
|
svelteIndexPaths: componentRoots.map(({ client }) => {
|
|
13860
|
-
const rel =
|
|
13861
|
-
return
|
|
14002
|
+
const rel = dirname15(relative11(clientDir, client));
|
|
14003
|
+
return join29(indexDir, rel, basename10(client));
|
|
13862
14004
|
}),
|
|
13863
14005
|
svelteServerPaths: roots.map(({ ssr }) => ssr)
|
|
13864
14006
|
};
|
|
@@ -13873,7 +14015,7 @@ var init_compileSvelte = __esm(() => {
|
|
|
13873
14015
|
init_lowerAwaitSlotSyntax();
|
|
13874
14016
|
init_renderToReadableStream();
|
|
13875
14017
|
devClientDir2 = resolveDevClientDir2();
|
|
13876
|
-
hmrClientPath3 =
|
|
14018
|
+
hmrClientPath3 = join29(devClientDir2, "hmrClient.ts").replace(/\\/g, "/");
|
|
13877
14019
|
persistentCache = new Map;
|
|
13878
14020
|
sourceHashCache = new Map;
|
|
13879
14021
|
transpiler3 = new Transpiler2({ loader: "ts", target: "browser" });
|
|
@@ -14351,12 +14493,12 @@ __export(exports_compileVue, {
|
|
|
14351
14493
|
clearVueHmrCaches: () => clearVueHmrCaches
|
|
14352
14494
|
});
|
|
14353
14495
|
import { existsSync as existsSync22, readFileSync as readFileSync18, realpathSync as realpathSync2 } from "fs";
|
|
14354
|
-
import { mkdir as
|
|
14496
|
+
import { mkdir as mkdir7 } from "fs/promises";
|
|
14355
14497
|
import {
|
|
14356
14498
|
basename as basename11,
|
|
14357
|
-
dirname as
|
|
14499
|
+
dirname as dirname16,
|
|
14358
14500
|
isAbsolute as isAbsolute4,
|
|
14359
|
-
join as
|
|
14501
|
+
join as join30,
|
|
14360
14502
|
relative as relative12,
|
|
14361
14503
|
resolve as resolve21
|
|
14362
14504
|
} from "path";
|
|
@@ -14420,7 +14562,7 @@ var resolveDevClientDir3 = () => {
|
|
|
14420
14562
|
visited.add(resolved);
|
|
14421
14563
|
const importRegex = /@import\s+(?:url\(\s*)?(['"])(\.{1,2}\/[^'"]+)\1\s*\)?\s*;?/g;
|
|
14422
14564
|
return cssContent.replace(importRegex, (match, _quote, relPath) => {
|
|
14423
|
-
const importedPath = resolve21(
|
|
14565
|
+
const importedPath = resolve21(dirname16(cssFilePath), relPath);
|
|
14424
14566
|
if (!existsSync22(importedPath))
|
|
14425
14567
|
return match;
|
|
14426
14568
|
const importedContent = readFileSync18(importedPath, "utf-8");
|
|
@@ -14542,12 +14684,12 @@ const ${localName} = (source) => ${importedName}(
|
|
|
14542
14684
|
const childComponentPaths = importPaths.filter((path) => path.startsWith(".") && path.endsWith(".vue"));
|
|
14543
14685
|
const packageComponentPaths = Array.from(resolvedPackageVueImports.entries());
|
|
14544
14686
|
const helperModulePaths = importPaths.filter((path) => path.startsWith(".") && !path.endsWith(".vue") && !isStylePath(path));
|
|
14545
|
-
const stylePathsImported = importPaths.filter((path) => (path.startsWith(".") || isAbsolute4(path)) && isStylePath(path)).map((path) => isAbsolute4(path) ? path : resolve21(
|
|
14687
|
+
const stylePathsImported = importPaths.filter((path) => (path.startsWith(".") || isAbsolute4(path)) && isStylePath(path)).map((path) => isAbsolute4(path) ? path : resolve21(dirname16(sourceFilePath), path));
|
|
14546
14688
|
for (const stylePath of stylePathsImported) {
|
|
14547
14689
|
addStyleImporter(sourceFilePath, stylePath);
|
|
14548
14690
|
}
|
|
14549
14691
|
const childBuildResults = await Promise.all([
|
|
14550
|
-
...childComponentPaths.map((relativeChildPath) => compileVueFile(resolve21(
|
|
14692
|
+
...childComponentPaths.map((relativeChildPath) => compileVueFile(resolve21(dirname16(sourceFilePath), relativeChildPath), outputDirs, cacheMap, false, vueRootDir, compiler, stylePreprocessors)),
|
|
14551
14693
|
...packageComponentPaths.map(([, absolutePath]) => compileVueFile(absolutePath, outputDirs, cacheMap, false, vueRootDir, compiler, stylePreprocessors))
|
|
14552
14694
|
]);
|
|
14553
14695
|
const hasScript = descriptor.script || descriptor.scriptSetup;
|
|
@@ -14562,7 +14704,7 @@ const ${localName} = (source) => ${importedName}(
|
|
|
14562
14704
|
sourceMap: true
|
|
14563
14705
|
}) : { bindings: {}, content: "export default {};", map: undefined };
|
|
14564
14706
|
const strippedScript = stripExports2(compiledScript.content);
|
|
14565
|
-
const sourceDir =
|
|
14707
|
+
const sourceDir = dirname16(sourceFilePath);
|
|
14566
14708
|
const transpiledScript = transpiler4.transformSync(strippedScript).replace(/(['"])(\.{1,2}\/[^'"]+)(['"])/g, (_2, quoteStart, relativeImport, quoteEnd) => `${quoteStart}${toJs(relativeImport, sourceDir)}${quoteEnd}`);
|
|
14567
14709
|
const packageImportRewrites = new Map;
|
|
14568
14710
|
for (const [bareImport, absolutePath] of packageComponentPaths) {
|
|
@@ -14607,8 +14749,8 @@ const ${localName} = (source) => ${importedName}(
|
|
|
14607
14749
|
];
|
|
14608
14750
|
let cssOutputPaths = [];
|
|
14609
14751
|
if (isEntryPoint && allCss.length) {
|
|
14610
|
-
const cssOutputFile =
|
|
14611
|
-
await
|
|
14752
|
+
const cssOutputFile = join30(outputDirs.css, `${toKebab(fileBaseName)}-compiled.css`);
|
|
14753
|
+
await mkdir7(dirname16(cssOutputFile), { recursive: true });
|
|
14612
14754
|
await write3(cssOutputFile, allCss.join(`
|
|
14613
14755
|
`));
|
|
14614
14756
|
cssOutputPaths = [cssOutputFile];
|
|
@@ -14638,21 +14780,21 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
14638
14780
|
};
|
|
14639
14781
|
const clientCode = assembleModule(generateRenderFunction(false), "render", true) + islandMetadataExports;
|
|
14640
14782
|
const serverCode = wrapServerAsyncComponentLoader(assembleModule(generateRenderFunction(true), "ssrRender", false)) + islandMetadataExports;
|
|
14641
|
-
const clientOutputPath =
|
|
14642
|
-
const serverOutputPath =
|
|
14783
|
+
const clientOutputPath = join30(outputDirs.client, `${relativeWithoutExtension}.js`);
|
|
14784
|
+
const serverOutputPath = join30(outputDirs.server, `${relativeWithoutExtension}.js`);
|
|
14643
14785
|
const rewritePackageImports = (code, outputPath, mode) => {
|
|
14644
14786
|
let result2 = code;
|
|
14645
14787
|
for (const [bareImport, paths] of packageImportRewrites) {
|
|
14646
14788
|
const targetPath = mode === "server" ? paths.server : paths.client;
|
|
14647
|
-
let rel = relative12(
|
|
14789
|
+
let rel = relative12(dirname16(outputPath), targetPath).replace(/\\/g, "/");
|
|
14648
14790
|
if (!rel.startsWith("."))
|
|
14649
14791
|
rel = `./${rel}`;
|
|
14650
14792
|
result2 = result2.replaceAll(bareImport, rel);
|
|
14651
14793
|
}
|
|
14652
14794
|
return result2;
|
|
14653
14795
|
};
|
|
14654
|
-
await
|
|
14655
|
-
await
|
|
14796
|
+
await mkdir7(dirname16(clientOutputPath), { recursive: true });
|
|
14797
|
+
await mkdir7(dirname16(serverOutputPath), { recursive: true });
|
|
14656
14798
|
const clientFinal = rewritePackageImports(clientCode, clientOutputPath, "client");
|
|
14657
14799
|
const serverFinal = rewritePackageImports(serverCode, serverOutputPath, "server");
|
|
14658
14800
|
const inlineSourceMapFor = (finalContent) => {
|
|
@@ -14675,7 +14817,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
14675
14817
|
serverPath: serverOutputPath,
|
|
14676
14818
|
spaRoutes: spaRoutes.length > 0 ? spaRoutes : undefined,
|
|
14677
14819
|
tsHelperPaths: [
|
|
14678
|
-
...helperModulePaths.map((helper) => resolveHelperTsPath(
|
|
14820
|
+
...helperModulePaths.map((helper) => resolveHelperTsPath(dirname16(sourceFilePath), helper)),
|
|
14679
14821
|
...childBuildResults.flatMap((child) => child.tsHelperPaths)
|
|
14680
14822
|
]
|
|
14681
14823
|
};
|
|
@@ -14685,15 +14827,15 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
14685
14827
|
}, compileVue = async (entryPoints, vueRootDir, isDev2 = false, stylePreprocessors, ssrOnlyEntries) => {
|
|
14686
14828
|
const compiler = await loadVueCompiler();
|
|
14687
14829
|
const generatedDir = getFrameworkGeneratedDir("vue");
|
|
14688
|
-
const clientOutputDir =
|
|
14689
|
-
const indexOutputDir =
|
|
14690
|
-
const serverOutputDir =
|
|
14691
|
-
const cssOutputDir =
|
|
14830
|
+
const clientOutputDir = join30(generatedDir, "client");
|
|
14831
|
+
const indexOutputDir = join30(generatedDir, "indexes");
|
|
14832
|
+
const serverOutputDir = join30(generatedDir, "server");
|
|
14833
|
+
const cssOutputDir = join30(generatedDir, "compiled");
|
|
14692
14834
|
await Promise.all([
|
|
14693
|
-
|
|
14694
|
-
|
|
14695
|
-
|
|
14696
|
-
|
|
14835
|
+
mkdir7(clientOutputDir, { recursive: true }),
|
|
14836
|
+
mkdir7(indexOutputDir, { recursive: true }),
|
|
14837
|
+
mkdir7(serverOutputDir, { recursive: true }),
|
|
14838
|
+
mkdir7(cssOutputDir, { recursive: true })
|
|
14697
14839
|
]);
|
|
14698
14840
|
const buildCache = new Map;
|
|
14699
14841
|
const allTsHelperPaths = new Set;
|
|
@@ -14715,7 +14857,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
14715
14857
|
});
|
|
14716
14858
|
const routes = parseVueSpaRoutes(descriptor.script?.content ?? "");
|
|
14717
14859
|
for (const { importPath } of routes) {
|
|
14718
|
-
const childPath = resolve21(
|
|
14860
|
+
const childPath = resolve21(dirname16(entryPath), importPath);
|
|
14719
14861
|
if (expanded.has(childPath) || !existsSync22(childPath)) {
|
|
14720
14862
|
continue;
|
|
14721
14863
|
}
|
|
@@ -14745,16 +14887,16 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
14745
14887
|
};
|
|
14746
14888
|
}
|
|
14747
14889
|
const entryBaseName = basename11(entryPath, ".vue");
|
|
14748
|
-
const indexOutputFile =
|
|
14749
|
-
const clientOutputFile =
|
|
14750
|
-
await
|
|
14890
|
+
const indexOutputFile = join30(indexOutputDir, `${entryBaseName}.js`);
|
|
14891
|
+
const clientOutputFile = join30(clientOutputDir, relative12(vueRootDir, entryPath).replace(/\\/g, "/").replace(/\.vue$/, ".js"));
|
|
14892
|
+
await mkdir7(dirname16(indexOutputFile), { recursive: true });
|
|
14751
14893
|
const vueHmrImports = isDev2 ? [
|
|
14752
14894
|
`window.__HMR_FRAMEWORK__ = "vue";`,
|
|
14753
14895
|
`import "${hmrClientPath4}";`
|
|
14754
14896
|
] : [];
|
|
14755
14897
|
await write3(indexOutputFile, [
|
|
14756
14898
|
...vueHmrImports,
|
|
14757
|
-
`import Comp, * as PageModule from "${relative12(
|
|
14899
|
+
`import Comp, * as PageModule from "${relative12(dirname16(indexOutputFile), clientOutputFile).replace(/\\/g, "/")}";`,
|
|
14758
14900
|
'import { createSSRApp, createApp } from "vue";',
|
|
14759
14901
|
"",
|
|
14760
14902
|
"// HMR State Preservation: Check for preserved state from HMR",
|
|
@@ -14801,7 +14943,8 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
14801
14943
|
"// client-side navigation after mount.",
|
|
14802
14944
|
'const isHMR = typeof window !== "undefined" && sessionStorage.getItem("__HMR_ACTIVE__");',
|
|
14803
14945
|
'const isSsrDirty = typeof window !== "undefined" && window.__SSR_DIRTY__;',
|
|
14804
|
-
'const
|
|
14946
|
+
'const isClientRender = typeof window !== "undefined" && window.__ABSOLUTE_PAGE_RENDER_MODE__ === "client";',
|
|
14947
|
+
'const shouldHydrate = typeof window === "undefined" ? false : !(isHMR || isSsrDirty || hasSpaRoutes || isClientRender);',
|
|
14805
14948
|
"const app = shouldHydrate ? createSSRApp(Comp, mergedProps) : createApp(Comp, mergedProps);",
|
|
14806
14949
|
"",
|
|
14807
14950
|
"async function bootstrapApp() {",
|
|
@@ -14819,11 +14962,17 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
14819
14962
|
" }",
|
|
14820
14963
|
' app.mount("#root");',
|
|
14821
14964
|
"}",
|
|
14822
|
-
"bootstrapApp();",
|
|
14965
|
+
"const absolutePageReady = bootstrapApp();",
|
|
14823
14966
|
"",
|
|
14824
14967
|
"// Store app instance for HMR - used for manual component updates",
|
|
14825
14968
|
'if (typeof window !== "undefined") {',
|
|
14826
14969
|
" window.__VUE_APP__ = app;",
|
|
14970
|
+
" window.__ABSOLUTE_PAGE_READY__ = absolutePageReady;",
|
|
14971
|
+
" window.__ABSOLUTE_PAGE_DISPOSE__ = async function() {",
|
|
14972
|
+
" await absolutePageReady;",
|
|
14973
|
+
" app.unmount();",
|
|
14974
|
+
" window.__VUE_APP__ = undefined;",
|
|
14975
|
+
" };",
|
|
14827
14976
|
"}",
|
|
14828
14977
|
"",
|
|
14829
14978
|
"// Post-mount: Apply preserved state to reactive refs in component tree",
|
|
@@ -14909,7 +15058,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
14909
15058
|
if (!tsPath)
|
|
14910
15059
|
continue;
|
|
14911
15060
|
const sourceCode = await file2(tsPath).text();
|
|
14912
|
-
const helperDir =
|
|
15061
|
+
const helperDir = dirname16(tsPath);
|
|
14913
15062
|
for (const dep of extractImports(sourceCode)) {
|
|
14914
15063
|
if (!dep.startsWith(".") || isStylePath(dep) || dep.endsWith(".vue")) {
|
|
14915
15064
|
continue;
|
|
@@ -14928,10 +15077,10 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
14928
15077
|
const transpiledCode = transpiler4.transformSync(sourceCode);
|
|
14929
15078
|
const withMap = transpiledCode + inlineLineMapComment(tsPath, sourceCode, transpiledCode);
|
|
14930
15079
|
const relativeJsPath = relative12(vueRootDir, tsPath).replace(/\.ts$/, ".js");
|
|
14931
|
-
const outClientPath =
|
|
14932
|
-
const outServerPath =
|
|
14933
|
-
await
|
|
14934
|
-
await
|
|
15080
|
+
const outClientPath = join30(clientOutputDir, relativeJsPath);
|
|
15081
|
+
const outServerPath = join30(serverOutputDir, relativeJsPath);
|
|
15082
|
+
await mkdir7(dirname16(outClientPath), { recursive: true });
|
|
15083
|
+
await mkdir7(dirname16(outServerPath), { recursive: true });
|
|
14935
15084
|
await write3(outClientPath, withMap);
|
|
14936
15085
|
await write3(outServerPath, withMap);
|
|
14937
15086
|
}));
|
|
@@ -14961,7 +15110,7 @@ var init_compileVue = __esm(() => {
|
|
|
14961
15110
|
init_vueAutoRouterTransform();
|
|
14962
15111
|
init_stylePreprocessor();
|
|
14963
15112
|
devClientDir3 = resolveDevClientDir3();
|
|
14964
|
-
hmrClientPath4 =
|
|
15113
|
+
hmrClientPath4 = join30(devClientDir3, "hmrClient.ts").replace(/\\/g, "/");
|
|
14965
15114
|
transpiler4 = new Transpiler3({ loader: "ts", target: "browser" });
|
|
14966
15115
|
scriptCache = new Map;
|
|
14967
15116
|
scriptSetupCache = new Map;
|
|
@@ -15443,7 +15592,7 @@ __export(exports_compileAngular, {
|
|
|
15443
15592
|
compileAngular: () => compileAngular
|
|
15444
15593
|
});
|
|
15445
15594
|
import { existsSync as existsSync23, readFileSync as readFileSync19, promises as fs5 } from "fs";
|
|
15446
|
-
import { join as
|
|
15595
|
+
import { join as join31, basename as basename12, sep as sep3, dirname as dirname17, resolve as resolve22, relative as relative13 } from "path";
|
|
15447
15596
|
var {Glob: Glob6 } = globalThis.Bun;
|
|
15448
15597
|
import ts13 from "typescript";
|
|
15449
15598
|
var traceAngularPhase = async (name, fn2, metadata) => {
|
|
@@ -15486,10 +15635,10 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
15486
15635
|
`${candidate}.tsx`,
|
|
15487
15636
|
`${candidate}.js`,
|
|
15488
15637
|
`${candidate}.jsx`,
|
|
15489
|
-
|
|
15490
|
-
|
|
15491
|
-
|
|
15492
|
-
|
|
15638
|
+
join31(candidate, "index.ts"),
|
|
15639
|
+
join31(candidate, "index.tsx"),
|
|
15640
|
+
join31(candidate, "index.js"),
|
|
15641
|
+
join31(candidate, "index.jsx")
|
|
15493
15642
|
];
|
|
15494
15643
|
return candidates.find((file3) => existsSync23(file3));
|
|
15495
15644
|
}, createLegacyAngularAnimationUsageResolver = (rootDir) => {
|
|
@@ -15561,7 +15710,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
15561
15710
|
if (scan.usesLegacyAnimations)
|
|
15562
15711
|
return true;
|
|
15563
15712
|
for (const specifier of scan.imports) {
|
|
15564
|
-
const importedPath = resolveLocalImport(specifier,
|
|
15713
|
+
const importedPath = resolveLocalImport(specifier, dirname17(resolved));
|
|
15565
15714
|
if (importedPath && await visit(importedPath, visited)) {
|
|
15566
15715
|
return true;
|
|
15567
15716
|
}
|
|
@@ -15620,7 +15769,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
15620
15769
|
return `${path.replace(/\.ts$/, ".js")}${query}`;
|
|
15621
15770
|
if (hasJsLikeExtension(path))
|
|
15622
15771
|
return `${path}${query}`;
|
|
15623
|
-
const importerDir =
|
|
15772
|
+
const importerDir = dirname17(importerOutputPath);
|
|
15624
15773
|
const fileCandidate = resolve22(importerDir, `${path}.js`);
|
|
15625
15774
|
if (outputFiles?.has(fileCandidate) || existsSync23(fileCandidate)) {
|
|
15626
15775
|
return `${path}.js${query}`;
|
|
@@ -15653,16 +15802,16 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
15653
15802
|
}, resolveLocalTsImport = (fromFile, specifier) => {
|
|
15654
15803
|
if (!isRelativeModuleSpecifier(specifier))
|
|
15655
15804
|
return null;
|
|
15656
|
-
const basePath = resolve22(
|
|
15805
|
+
const basePath = resolve22(dirname17(fromFile), specifier);
|
|
15657
15806
|
const candidates = /\.[cm]?[tj]sx?$/.test(basePath) ? [basePath] : [
|
|
15658
15807
|
`${basePath}.ts`,
|
|
15659
15808
|
`${basePath}.tsx`,
|
|
15660
15809
|
`${basePath}.mts`,
|
|
15661
15810
|
`${basePath}.cts`,
|
|
15662
|
-
|
|
15663
|
-
|
|
15664
|
-
|
|
15665
|
-
|
|
15811
|
+
join31(basePath, "index.ts"),
|
|
15812
|
+
join31(basePath, "index.tsx"),
|
|
15813
|
+
join31(basePath, "index.mts"),
|
|
15814
|
+
join31(basePath, "index.cts")
|
|
15666
15815
|
];
|
|
15667
15816
|
return candidates.map((candidate) => resolve22(candidate)).find((candidate) => existsSync23(candidate) && !candidate.endsWith(".d.ts")) ?? null;
|
|
15668
15817
|
}, readFileForAotTransform = async (fileName, readFile6) => {
|
|
@@ -15688,15 +15837,15 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
15688
15837
|
const paths = [];
|
|
15689
15838
|
const templateUrlMatch = findUncommentedMatch(source, /templateUrl\s*:\s*['"]([^'"]+)['"]/);
|
|
15690
15839
|
if (templateUrlMatch?.[1])
|
|
15691
|
-
paths.push(
|
|
15840
|
+
paths.push(join31(fileDir, templateUrlMatch[1]));
|
|
15692
15841
|
const styleUrlMatch = findUncommentedMatch(source, /styleUrl\s*:\s*['"]([^'"]+)['"]/);
|
|
15693
15842
|
if (styleUrlMatch?.[1])
|
|
15694
|
-
paths.push(
|
|
15843
|
+
paths.push(join31(fileDir, styleUrlMatch[1]));
|
|
15695
15844
|
const styleUrlsMatch = findUncommentedMatch(source, /styleUrls\s*:\s*\[([^\]]+)\]/);
|
|
15696
15845
|
const urlMatches = styleUrlsMatch?.[1]?.match(/['"]([^'"]+)['"]/g);
|
|
15697
15846
|
if (urlMatches) {
|
|
15698
15847
|
for (const urlMatch of urlMatches) {
|
|
15699
|
-
paths.push(
|
|
15848
|
+
paths.push(join31(fileDir, urlMatch.replace(/['"]/g, "")));
|
|
15700
15849
|
}
|
|
15701
15850
|
}
|
|
15702
15851
|
return paths.map((path) => resolve22(path));
|
|
@@ -15711,13 +15860,13 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
15711
15860
|
return null;
|
|
15712
15861
|
}
|
|
15713
15862
|
}, writeResourceCacheFile = async (cachePath, source) => {
|
|
15714
|
-
await fs5.mkdir(
|
|
15863
|
+
await fs5.mkdir(dirname17(cachePath), { recursive: true });
|
|
15715
15864
|
await fs5.writeFile(cachePath, JSON.stringify({
|
|
15716
15865
|
source,
|
|
15717
15866
|
version: 1
|
|
15718
15867
|
}), "utf-8");
|
|
15719
15868
|
}, resolveResourceTransformCachePath = async (filePath, source, stylePreprocessors) => {
|
|
15720
|
-
const resourcePaths = collectAngularResourcePaths(source,
|
|
15869
|
+
const resourcePaths = collectAngularResourcePaths(source, dirname17(filePath));
|
|
15721
15870
|
const resourceContents = await Promise.all(resourcePaths.map(async (resourcePath) => {
|
|
15722
15871
|
const content = await fs5.readFile(resourcePath, "utf-8");
|
|
15723
15872
|
return `${resourcePath}\x00${content}`;
|
|
@@ -15730,7 +15879,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
15730
15879
|
safeStableStringify(stylePreprocessors ?? null)
|
|
15731
15880
|
].join("\x00");
|
|
15732
15881
|
const cacheKey2 = Bun.hash(cacheInput).toString(BASE_36_RADIX);
|
|
15733
|
-
return
|
|
15882
|
+
return join31(process.cwd(), ".absolutejs", "cache", "angular-resources", `${cacheKey2}.json`);
|
|
15734
15883
|
}, precomputeAotResourceTransforms = async (inputPaths, readFile6, stylePreprocessors) => {
|
|
15735
15884
|
const transformedSources = new Map;
|
|
15736
15885
|
const visited = new Set;
|
|
@@ -15757,7 +15906,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
15757
15906
|
transformedSource = cached.source;
|
|
15758
15907
|
} else {
|
|
15759
15908
|
stats.cacheMisses += 1;
|
|
15760
|
-
const transformed = await inlineResources(source,
|
|
15909
|
+
const transformed = await inlineResources(source, dirname17(resolvedPath), stylePreprocessors);
|
|
15761
15910
|
transformedSource = transformed.source;
|
|
15762
15911
|
await writeResourceCacheFile(cachePath, transformedSource);
|
|
15763
15912
|
}
|
|
@@ -15776,7 +15925,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
15776
15925
|
return { stats, transformedSources };
|
|
15777
15926
|
}, compileAngularFiles = async (inputPaths, outDir, stylePreprocessors) => {
|
|
15778
15927
|
const islandMetadataByOutputPath = await traceAngularPhase("aot/island-metadata", () => new Map(inputPaths.map((inputPath) => {
|
|
15779
|
-
const outputPath = resolve22(
|
|
15928
|
+
const outputPath = resolve22(join31(outDir, relative13(process.cwd(), resolve22(inputPath)).replace(/\.[cm]?[tj]sx?$/, ".js")));
|
|
15780
15929
|
return [
|
|
15781
15930
|
outputPath,
|
|
15782
15931
|
buildIslandMetadataExports(readFileSync19(inputPath, "utf-8"))
|
|
@@ -15786,7 +15935,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
15786
15935
|
const { readConfiguration, performCompilation, EmitFlags } = await traceAngularPhase("aot/import-compiler-cli", () => import("@angular/compiler-cli"));
|
|
15787
15936
|
const tsLibDir = await traceAngularPhase("aot/resolve-typescript-lib", () => {
|
|
15788
15937
|
const tsPath = __require.resolve("typescript");
|
|
15789
|
-
const tsRootDir =
|
|
15938
|
+
const tsRootDir = dirname17(tsPath);
|
|
15790
15939
|
return tsRootDir.endsWith("lib") ? tsRootDir : resolve22(tsRootDir, "lib");
|
|
15791
15940
|
});
|
|
15792
15941
|
const config = await traceAngularPhase("aot/read-configuration", () => readConfiguration("./tsconfig.json"));
|
|
@@ -15823,7 +15972,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
15823
15972
|
const originalGetSourceFile = host.getSourceFile;
|
|
15824
15973
|
host.getSourceFile = (fileName, languageVersion, onError) => {
|
|
15825
15974
|
if (fileName.startsWith("lib.") && fileName.endsWith(".d.ts") && tsLibDir) {
|
|
15826
|
-
const resolvedPath =
|
|
15975
|
+
const resolvedPath = join31(tsLibDir, fileName);
|
|
15827
15976
|
return originalGetSourceFile?.call(host, resolvedPath, languageVersion, onError);
|
|
15828
15977
|
}
|
|
15829
15978
|
return originalGetSourceFile?.call(host, fileName, languageVersion, onError);
|
|
@@ -15878,7 +16027,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
15878
16027
|
const entries = await traceAngularPhase("aot/postprocess-emitted-js", () => {
|
|
15879
16028
|
const rawEntries = Object.entries(emitted).filter(([fileName]) => fileName.endsWith(".js")).map(([fileName, content]) => ({
|
|
15880
16029
|
content,
|
|
15881
|
-
target:
|
|
16030
|
+
target: join31(outDir, fileName)
|
|
15882
16031
|
}));
|
|
15883
16032
|
const outputFiles = new Set(rawEntries.map(({ target }) => resolve22(target)));
|
|
15884
16033
|
return rawEntries.map(({ content, target }) => {
|
|
@@ -15900,7 +16049,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
15900
16049
|
});
|
|
15901
16050
|
});
|
|
15902
16051
|
await traceAngularPhase("aot/write-output", () => Promise.all(entries.map(async ({ target, content }) => {
|
|
15903
|
-
await fs5.mkdir(
|
|
16052
|
+
await fs5.mkdir(dirname17(target), { recursive: true });
|
|
15904
16053
|
await fs5.writeFile(target, content, "utf-8");
|
|
15905
16054
|
})), { outputs: entries.length });
|
|
15906
16055
|
return await traceAngularPhase("aot/collect-output-paths", () => entries.map(({ target }) => target), { outputs: entries.length });
|
|
@@ -16055,7 +16204,7 @@ ${fields}
|
|
|
16055
16204
|
}, inlineTemplateAndLowerDefer = async (source, fileDir) => {
|
|
16056
16205
|
const templateUrlMatch = findUncommentedMatch(source, /templateUrl\s*:\s*['"]([^'"]+)['"]/);
|
|
16057
16206
|
if (templateUrlMatch?.[1]) {
|
|
16058
|
-
const templatePath =
|
|
16207
|
+
const templatePath = join31(fileDir, templateUrlMatch[1]);
|
|
16059
16208
|
if (!existsSync23(templatePath)) {
|
|
16060
16209
|
throw new Error(`Unable to inline Angular templateUrl "${templateUrlMatch[1]}": file not found at ${templatePath}`);
|
|
16061
16210
|
}
|
|
@@ -16086,7 +16235,7 @@ ${fields}
|
|
|
16086
16235
|
}, inlineTemplateAndLowerDeferSync = (source, fileDir) => {
|
|
16087
16236
|
const templateUrlMatch = findUncommentedMatch(source, /templateUrl\s*:\s*['"]([^'"]+)['"]/);
|
|
16088
16237
|
if (templateUrlMatch?.[1]) {
|
|
16089
|
-
const templatePath =
|
|
16238
|
+
const templatePath = join31(fileDir, templateUrlMatch[1]);
|
|
16090
16239
|
if (!existsSync23(templatePath)) {
|
|
16091
16240
|
throw new Error(`Unable to inline Angular templateUrl "${templateUrlMatch[1]}": file not found at ${templatePath}`);
|
|
16092
16241
|
}
|
|
@@ -16123,7 +16272,7 @@ ${fields}
|
|
|
16123
16272
|
return source;
|
|
16124
16273
|
const stylePromises = urlMatches.map((urlMatch) => {
|
|
16125
16274
|
const styleUrl = urlMatch.replace(/['"]/g, "");
|
|
16126
|
-
return readAndEscapeFile(
|
|
16275
|
+
return readAndEscapeFile(join31(fileDir, styleUrl), stylePreprocessors);
|
|
16127
16276
|
});
|
|
16128
16277
|
const results = await Promise.all(stylePromises);
|
|
16129
16278
|
const inlinedStyles = results.filter(Boolean).map((escaped) => `\`${escaped}\``);
|
|
@@ -16134,7 +16283,7 @@ ${fields}
|
|
|
16134
16283
|
const styleUrlMatch = findUncommentedMatch(source, /styleUrl\s*:\s*['"]([^'"]+)['"]/);
|
|
16135
16284
|
if (!styleUrlMatch?.[1])
|
|
16136
16285
|
return source;
|
|
16137
|
-
const escaped = await readAndEscapeFile(
|
|
16286
|
+
const escaped = await readAndEscapeFile(join31(fileDir, styleUrlMatch[1]), stylePreprocessors);
|
|
16138
16287
|
if (!escaped)
|
|
16139
16288
|
return source;
|
|
16140
16289
|
return source.slice(0, styleUrlMatch.index) + `styles: [\`${escaped}\`]` + source.slice(styleUrlMatch.index + styleUrlMatch[0].length);
|
|
@@ -16230,10 +16379,10 @@ ${fields}
|
|
|
16230
16379
|
`${candidate}.js`,
|
|
16231
16380
|
`${candidate}.jsx`,
|
|
16232
16381
|
`${candidate}.json`,
|
|
16233
|
-
|
|
16234
|
-
|
|
16235
|
-
|
|
16236
|
-
|
|
16382
|
+
join31(candidate, "index.ts"),
|
|
16383
|
+
join31(candidate, "index.tsx"),
|
|
16384
|
+
join31(candidate, "index.js"),
|
|
16385
|
+
join31(candidate, "index.jsx")
|
|
16237
16386
|
];
|
|
16238
16387
|
return candidates.find((file3) => existsSync23(file3));
|
|
16239
16388
|
};
|
|
@@ -16257,13 +16406,13 @@ ${fields}
|
|
|
16257
16406
|
}
|
|
16258
16407
|
};
|
|
16259
16408
|
const toOutputPath = (sourcePath) => {
|
|
16260
|
-
const inputDir =
|
|
16409
|
+
const inputDir = dirname17(sourcePath);
|
|
16261
16410
|
const fileBase = basename12(sourcePath).replace(/\.[cm]?[tj]sx?$/, ".js");
|
|
16262
16411
|
if (inputDir === outDir || inputDir.startsWith(`${outDir}${sep3}`)) {
|
|
16263
|
-
return
|
|
16412
|
+
return join31(inputDir, fileBase);
|
|
16264
16413
|
}
|
|
16265
16414
|
const relativeDir = inputDir.startsWith(baseDir) ? inputDir.substring(baseDir.length + 1) : inputDir;
|
|
16266
|
-
return
|
|
16415
|
+
return join31(outDir, relativeDir, fileBase);
|
|
16267
16416
|
};
|
|
16268
16417
|
const withCacheBuster = (specifier) => {
|
|
16269
16418
|
if (!cacheBuster)
|
|
@@ -16311,10 +16460,10 @@ ${fields}
|
|
|
16311
16460
|
return;
|
|
16312
16461
|
visited.add(resolved);
|
|
16313
16462
|
if (resolved.endsWith(".json") && existsSync23(resolved)) {
|
|
16314
|
-
const inputDir2 =
|
|
16463
|
+
const inputDir2 = dirname17(resolved);
|
|
16315
16464
|
const relativeDir2 = inputDir2.startsWith(baseDir) ? inputDir2.substring(baseDir.length + 1) : inputDir2;
|
|
16316
|
-
const targetDir2 =
|
|
16317
|
-
const targetPath2 =
|
|
16465
|
+
const targetDir2 = join31(outDir, relativeDir2);
|
|
16466
|
+
const targetPath2 = join31(targetDir2, basename12(resolved));
|
|
16318
16467
|
await fs5.mkdir(targetDir2, { recursive: true });
|
|
16319
16468
|
await fs5.copyFile(resolved, targetPath2);
|
|
16320
16469
|
allOutputs.push(targetPath2);
|
|
@@ -16326,12 +16475,12 @@ ${fields}
|
|
|
16326
16475
|
if (!existsSync23(actualPath))
|
|
16327
16476
|
return;
|
|
16328
16477
|
let sourceCode = await fs5.readFile(actualPath, "utf-8");
|
|
16329
|
-
const inlined = await inlineResources(sourceCode,
|
|
16330
|
-
sourceCode = inlineTemplateAndLowerDeferSync(inlined.source,
|
|
16331
|
-
const inputDir =
|
|
16478
|
+
const inlined = await inlineResources(sourceCode, dirname17(actualPath), stylePreprocessors);
|
|
16479
|
+
sourceCode = inlineTemplateAndLowerDeferSync(inlined.source, dirname17(actualPath)).source;
|
|
16480
|
+
const inputDir = dirname17(actualPath);
|
|
16332
16481
|
const fileBase = basename12(actualPath).replace(/\.[cm]?[tj]sx?$/, ".js");
|
|
16333
16482
|
const targetPath = toOutputPath(actualPath);
|
|
16334
|
-
const targetDir =
|
|
16483
|
+
const targetDir = dirname17(targetPath);
|
|
16335
16484
|
const relativeDir = relative13(outDir, targetDir).replace(/\\/g, "/");
|
|
16336
16485
|
const localImports = [];
|
|
16337
16486
|
const importRewrites = new Map;
|
|
@@ -16393,7 +16542,7 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
16393
16542
|
return { clientPaths: [...emptyPaths], serverPaths: [...emptyPaths] };
|
|
16394
16543
|
}
|
|
16395
16544
|
const compiledRoot = compiledParent;
|
|
16396
|
-
const indexesDir =
|
|
16545
|
+
const indexesDir = join31(compiledParent, "indexes");
|
|
16397
16546
|
await traceAngularPhase("setup/create-indexes-dir", () => fs5.mkdir(indexesDir, { recursive: true }));
|
|
16398
16547
|
const aotOutputs = hmr ? [] : await traceAngularPhase("aot/compile-files", () => compileAngularFiles(entryPoints.map((entry) => resolve22(entry)), compiledRoot, stylePreprocessors), { entries: entryPoints.length });
|
|
16399
16548
|
if (!hmr) {
|
|
@@ -16407,10 +16556,10 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
16407
16556
|
absolute: false,
|
|
16408
16557
|
cwd: angularSrcDir
|
|
16409
16558
|
})) {
|
|
16410
|
-
const sourcePath =
|
|
16559
|
+
const sourcePath = join31(angularSrcDir, rel);
|
|
16411
16560
|
const cwdRel = relative13(cwd, sourcePath);
|
|
16412
|
-
const targetPath =
|
|
16413
|
-
await fs5.mkdir(
|
|
16561
|
+
const targetPath = join31(compiledRoot, cwdRel);
|
|
16562
|
+
await fs5.mkdir(dirname17(targetPath), { recursive: true });
|
|
16414
16563
|
await fs5.copyFile(sourcePath, targetPath);
|
|
16415
16564
|
}
|
|
16416
16565
|
});
|
|
@@ -16426,9 +16575,9 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
16426
16575
|
const fileBase = basename12(resolvedEntry).replace(/\.[tj]s$/, "");
|
|
16427
16576
|
const jsName = `${fileBase}.js`;
|
|
16428
16577
|
const compiledFallbackPaths = [
|
|
16429
|
-
|
|
16430
|
-
|
|
16431
|
-
|
|
16578
|
+
join31(compiledRoot, relativeEntry),
|
|
16579
|
+
join31(compiledRoot, "pages", jsName),
|
|
16580
|
+
join31(compiledRoot, jsName)
|
|
16432
16581
|
].map((file3) => resolve22(file3));
|
|
16433
16582
|
const resolveRawServerFile = (candidatePaths) => {
|
|
16434
16583
|
const normalizedCandidates = [
|
|
@@ -16490,7 +16639,7 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
16490
16639
|
})() : "no-providers";
|
|
16491
16640
|
const serverContentHash = `${Bun.hash(original).toString(BASE_36_RADIX)}.${Bun.hash(providersHashInput).toString(BASE_36_RADIX)}`;
|
|
16492
16641
|
const cachedWrapper = wrapperOutputCache.get(resolvedEntry);
|
|
16493
|
-
const clientFile =
|
|
16642
|
+
const clientFile = join31(indexesDir, jsName);
|
|
16494
16643
|
if (hmr && cachedWrapper && cachedWrapper.serverHash === serverContentHash && existsSync23(clientFile) && (usesLegacyAnimations || !original.includes("__ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__")) && (!usesLegacyAnimations || original.includes("__ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__"))) {
|
|
16495
16644
|
return {
|
|
16496
16645
|
clientPath: clientFile,
|
|
@@ -16525,10 +16674,10 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
16525
16674
|
const angularDirAbs = resolve22(outRoot);
|
|
16526
16675
|
const appSourceAbs = resolve22(providersInjection.appProvidersSource);
|
|
16527
16676
|
const rel = relative13(angularDirAbs, appSourceAbs).replace(/\\/g, "/");
|
|
16528
|
-
return
|
|
16677
|
+
return join31(compiledParent, rel).replace(/\.[cm]?[tj]sx?$/, ".js");
|
|
16529
16678
|
})();
|
|
16530
16679
|
const appProvidersSpec = (() => {
|
|
16531
|
-
const rel = relative13(
|
|
16680
|
+
const rel = relative13(dirname17(rawServerFile), compiledAppProvidersPath).replace(/\\/g, "/");
|
|
16532
16681
|
return rel.startsWith(".") ? rel : `./${rel}`;
|
|
16533
16682
|
})();
|
|
16534
16683
|
importLines.push(`import { appProviders as __abs_globalProviders } from "${appProvidersSpec}";`);
|
|
@@ -16576,6 +16725,7 @@ var requestContext = Object.prototype.hasOwnProperty.call(window, '__ABS_ANGULAR
|
|
|
16576
16725
|
var pageHasIslands = Boolean(pageModule.__ABSOLUTE_PAGE_HAS_ISLANDS__) || Boolean(document.querySelector('[data-island="true"]'));
|
|
16577
16726
|
var pageHasRawStreamingSlots = Boolean(document.querySelector('[data-absolute-raw-slot="true"]'));
|
|
16578
16727
|
var pageHasStreamingSlots = Boolean(document.querySelector('[data-absolute-slot="true"]'));
|
|
16728
|
+
var isClientRender = window.__ABSOLUTE_PAGE_RENDER_MODE__ === 'client';
|
|
16579
16729
|
var contextProviders = [{ provide: REQUEST_CONTEXT, useValue: requestContext }];
|
|
16580
16730
|
// Page-level providers are injected directly into the page module's
|
|
16581
16731
|
// server output by \`compileAngular\`'s providers-injection step
|
|
@@ -16626,13 +16776,14 @@ if (!document.querySelector(_sel)) {
|
|
|
16626
16776
|
}
|
|
16627
16777
|
|
|
16628
16778
|
var providers = [provideZonelessChangeDetection()];
|
|
16629
|
-
if (!window.__HMR_SKIP_HYDRATION__ && !pageHasIslands) {
|
|
16779
|
+
if (!isClientRender && !window.__HMR_SKIP_HYDRATION__ && !pageHasIslands) {
|
|
16630
16780
|
providers.push(provideClientHydration(withHttpTransferCacheOptions(absoluteHttpTransferCacheOptions)));
|
|
16631
16781
|
}
|
|
16632
16782
|
delete window.__HMR_SKIP_HYDRATION__;
|
|
16633
16783
|
providers.push.apply(providers, pageProviders);
|
|
16634
16784
|
providers.push.apply(providers, contextProviders);
|
|
16635
16785
|
window.__ABS_SLOT_HYDRATION_PENDING__ = pageHasRawStreamingSlots;
|
|
16786
|
+
var absolutePageReady = Promise.resolve();
|
|
16636
16787
|
|
|
16637
16788
|
if (pageHasRawStreamingSlots) {
|
|
16638
16789
|
window.__ABS_SLOT_HYDRATION_PENDING__ = false;
|
|
@@ -16642,7 +16793,7 @@ if (pageHasRawStreamingSlots) {
|
|
|
16642
16793
|
});
|
|
16643
16794
|
}
|
|
16644
16795
|
} else {
|
|
16645
|
-
bootstrapApplication(${componentClassName}, {
|
|
16796
|
+
absolutePageReady = bootstrapApplication(${componentClassName}, {
|
|
16646
16797
|
providers: providers
|
|
16647
16798
|
}).then(function (appRef) {
|
|
16648
16799
|
window.__ANGULAR_APP__ = appRef;
|
|
@@ -16652,8 +16803,17 @@ if (pageHasRawStreamingSlots) {
|
|
|
16652
16803
|
window.__ABS_SLOT_FLUSH__();
|
|
16653
16804
|
});
|
|
16654
16805
|
}
|
|
16806
|
+
return appRef;
|
|
16655
16807
|
});
|
|
16656
16808
|
}
|
|
16809
|
+
window.__ABSOLUTE_PAGE_READY__ = absolutePageReady;
|
|
16810
|
+
window.__ABSOLUTE_PAGE_DISPOSE__ = async function() {
|
|
16811
|
+
await absolutePageReady;
|
|
16812
|
+
if (window.__ANGULAR_APP__) {
|
|
16813
|
+
window.__ANGULAR_APP__.destroy();
|
|
16814
|
+
window.__ANGULAR_APP__ = null;
|
|
16815
|
+
}
|
|
16816
|
+
};
|
|
16657
16817
|
`.trim() : `
|
|
16658
16818
|
import '@angular/compiler';
|
|
16659
16819
|
import { bootstrapApplication } from '@angular/platform-browser';
|
|
@@ -16672,6 +16832,7 @@ var requestContext = Object.prototype.hasOwnProperty.call(window, '__ABS_ANGULAR
|
|
|
16672
16832
|
var pageHasIslands = Boolean(pageModule.__ABSOLUTE_PAGE_HAS_ISLANDS__) || Boolean(document.querySelector('[data-island="true"]'));
|
|
16673
16833
|
var pageHasRawStreamingSlots = Boolean(document.querySelector('[data-absolute-raw-slot="true"]'));
|
|
16674
16834
|
var pageHasStreamingSlots = Boolean(document.querySelector('[data-absolute-slot="true"]'));
|
|
16835
|
+
var isClientRender = window.__ABSOLUTE_PAGE_RENDER_MODE__ === 'client';
|
|
16675
16836
|
var contextProviders = [{ provide: REQUEST_CONTEXT, useValue: requestContext }];
|
|
16676
16837
|
// Page-level providers are injected directly into the page module's
|
|
16677
16838
|
// server output by \`compileAngular\`'s providers-injection step
|
|
@@ -16691,11 +16852,21 @@ var absoluteHttpTransferCacheOptions = {
|
|
|
16691
16852
|
|
|
16692
16853
|
enableProdMode();
|
|
16693
16854
|
|
|
16855
|
+
// Production mobile/client-only activation starts from AbsoluteJS's empty
|
|
16856
|
+
// #root shell rather than server-rendered Angular markup. Create the page's
|
|
16857
|
+
// actual Angular host from its compiled selector so application authors do
|
|
16858
|
+
// not need framework-specific mobile configuration.
|
|
16859
|
+
var _sel = ${componentClassName}.\u0275cmp?.selectors?.[0]?.[0] || 'ng-app';
|
|
16860
|
+
if (!document.querySelector(_sel)) {
|
|
16861
|
+
(document.getElementById('root') || document.body).appendChild(document.createElement(_sel));
|
|
16862
|
+
}
|
|
16863
|
+
|
|
16694
16864
|
var providers = [provideZonelessChangeDetection()].concat(pageProviders).concat(contextProviders);
|
|
16695
|
-
if (!pageHasIslands) {
|
|
16865
|
+
if (!isClientRender && !pageHasIslands) {
|
|
16696
16866
|
providers.unshift(provideClientHydration(withHttpTransferCacheOptions(absoluteHttpTransferCacheOptions)));
|
|
16697
16867
|
}
|
|
16698
16868
|
window.__ABS_SLOT_HYDRATION_PENDING__ = pageHasRawStreamingSlots;
|
|
16869
|
+
var absolutePageReady = Promise.resolve();
|
|
16699
16870
|
|
|
16700
16871
|
if (pageHasRawStreamingSlots) {
|
|
16701
16872
|
window.__ABS_SLOT_HYDRATION_PENDING__ = false;
|
|
@@ -16705,7 +16876,7 @@ if (pageHasRawStreamingSlots) {
|
|
|
16705
16876
|
});
|
|
16706
16877
|
}
|
|
16707
16878
|
} else {
|
|
16708
|
-
bootstrapApplication(${componentClassName}, {
|
|
16879
|
+
absolutePageReady = bootstrapApplication(${componentClassName}, {
|
|
16709
16880
|
providers: providers
|
|
16710
16881
|
}).then(function (appRef) {
|
|
16711
16882
|
window.__ANGULAR_APP__ = appRef;
|
|
@@ -16715,8 +16886,17 @@ if (pageHasRawStreamingSlots) {
|
|
|
16715
16886
|
window.__ABS_SLOT_FLUSH__();
|
|
16716
16887
|
});
|
|
16717
16888
|
}
|
|
16889
|
+
return appRef;
|
|
16718
16890
|
});
|
|
16719
16891
|
}
|
|
16892
|
+
window.__ABSOLUTE_PAGE_READY__ = absolutePageReady;
|
|
16893
|
+
window.__ABSOLUTE_PAGE_DISPOSE__ = async function() {
|
|
16894
|
+
await absolutePageReady;
|
|
16895
|
+
if (window.__ANGULAR_APP__) {
|
|
16896
|
+
window.__ANGULAR_APP__.destroy();
|
|
16897
|
+
window.__ANGULAR_APP__ = null;
|
|
16898
|
+
}
|
|
16899
|
+
};
|
|
16720
16900
|
`.trim();
|
|
16721
16901
|
const indexHash = Bun.hash(hydration).toString(BASE_36_RADIX);
|
|
16722
16902
|
const indexUnchanged = cachedWrapper?.indexHash === indexHash;
|
|
@@ -16749,7 +16929,7 @@ var init_compileAngular = __esm(() => {
|
|
|
16749
16929
|
init_stylePreprocessor();
|
|
16750
16930
|
init_generatedDir();
|
|
16751
16931
|
devClientDir4 = resolveDevClientDir4();
|
|
16752
|
-
hmrClientPath5 =
|
|
16932
|
+
hmrClientPath5 = join31(devClientDir4, "hmrClient.ts").replace(/\\/g, "/");
|
|
16753
16933
|
jitContentCache = new Map;
|
|
16754
16934
|
wrapperOutputCache = new Map;
|
|
16755
16935
|
PROVIDERS_INJECTION_BLOCK_RE = /\n\/\* __ABS_PROVIDERS_INJECTION_START \*\/[\s\S]*?\/\* __ABS_PROVIDERS_INJECTION_END \*\/\n?/;
|
|
@@ -17474,7 +17654,7 @@ __export(exports_fastHmrCompiler, {
|
|
|
17474
17654
|
invalidateFingerprintCache: () => invalidateFingerprintCache
|
|
17475
17655
|
});
|
|
17476
17656
|
import { existsSync as existsSync24, readFileSync as readFileSync20, statSync as statSync2 } from "fs";
|
|
17477
|
-
import { dirname as
|
|
17657
|
+
import { dirname as dirname18, extname as extname8, relative as relative14, resolve as resolve23 } from "path";
|
|
17478
17658
|
import ts17 from "typescript";
|
|
17479
17659
|
var fail = (reason, detail, location) => ({
|
|
17480
17660
|
detail,
|
|
@@ -17604,7 +17784,7 @@ var fail = (reason, detail, location) => ({
|
|
|
17604
17784
|
continue;
|
|
17605
17785
|
const decoratorMeta = readDecoratorMeta(args);
|
|
17606
17786
|
const { inputs, outputs } = extractInputsAndOutputs(stmt, null);
|
|
17607
|
-
const componentDir =
|
|
17787
|
+
const componentDir = dirname18(componentFilePath);
|
|
17608
17788
|
const fingerprint = extractFingerprint(stmt, className, decoratorMeta, inputs, outputs, sourceFile, componentDir);
|
|
17609
17789
|
fingerprintCache.set(id, fingerprint);
|
|
17610
17790
|
} else {
|
|
@@ -18585,7 +18765,7 @@ var fail = (reason, detail, location) => ({
|
|
|
18585
18765
|
});
|
|
18586
18766
|
if (!names.includes(className))
|
|
18587
18767
|
continue;
|
|
18588
|
-
const nextDts = resolveDtsFromSpec(fromPath,
|
|
18768
|
+
const nextDts = resolveDtsFromSpec(fromPath, dirname18(startDtsPath));
|
|
18589
18769
|
if (!nextDts)
|
|
18590
18770
|
continue;
|
|
18591
18771
|
const found = findDtsContainingClass(nextDts, className, visited);
|
|
@@ -18595,7 +18775,7 @@ var fail = (reason, detail, location) => ({
|
|
|
18595
18775
|
const starReExportRe = /export\s*\*\s*from\s*["']([^"']+)["']/g;
|
|
18596
18776
|
while ((item = starReExportRe.exec(content)) !== null) {
|
|
18597
18777
|
const fromPath = item[1] || "";
|
|
18598
|
-
const nextDts = resolveDtsFromSpec(fromPath,
|
|
18778
|
+
const nextDts = resolveDtsFromSpec(fromPath, dirname18(startDtsPath));
|
|
18599
18779
|
if (!nextDts)
|
|
18600
18780
|
continue;
|
|
18601
18781
|
const found = findDtsContainingClass(nextDts, className, visited);
|
|
@@ -19196,7 +19376,7 @@ ${block}
|
|
|
19196
19376
|
rebootstrapRequired: false
|
|
19197
19377
|
};
|
|
19198
19378
|
}
|
|
19199
|
-
if (inheritsDecoratedClass(classNode, sourceFile,
|
|
19379
|
+
if (inheritsDecoratedClass(classNode, sourceFile, dirname18(componentFilePath), projectRoot)) {
|
|
19200
19380
|
return fail("inherits-decorated-class");
|
|
19201
19381
|
}
|
|
19202
19382
|
const decorator = findComponentDecorator(classNode);
|
|
@@ -19208,7 +19388,7 @@ ${block}
|
|
|
19208
19388
|
const projectDefaults = readProjectAngularCompilerOptions(projectRoot);
|
|
19209
19389
|
const decoratorMeta = readDecoratorMeta(decoratorArgs, projectDefaults);
|
|
19210
19390
|
const advancedMetadata = extractAdvancedMetadata(classNode, decoratorArgs, compiler);
|
|
19211
|
-
const componentDir =
|
|
19391
|
+
const componentDir = dirname18(componentFilePath);
|
|
19212
19392
|
let templateText;
|
|
19213
19393
|
let templatePath;
|
|
19214
19394
|
if (decoratorMeta.template !== null) {
|
|
@@ -19978,7 +20158,7 @@ __export(exports_compileEmber, {
|
|
|
19978
20158
|
getEmberServerCompiledDir: () => getEmberServerCompiledDir,
|
|
19979
20159
|
getEmberCompiledRoot: () => getEmberCompiledRoot,
|
|
19980
20160
|
getEmberClientCompiledDir: () => getEmberClientCompiledDir,
|
|
19981
|
-
dirname: () =>
|
|
20161
|
+
dirname: () => dirname19,
|
|
19982
20162
|
compileEmberFileSource: () => compileEmberFileSource,
|
|
19983
20163
|
compileEmberFile: () => compileEmberFile,
|
|
19984
20164
|
compileEmber: () => compileEmber,
|
|
@@ -19986,8 +20166,8 @@ __export(exports_compileEmber, {
|
|
|
19986
20166
|
basename: () => basename13
|
|
19987
20167
|
});
|
|
19988
20168
|
import { existsSync as existsSync25 } from "fs";
|
|
19989
|
-
import { mkdir as
|
|
19990
|
-
import { basename as basename13, dirname as
|
|
20169
|
+
import { mkdir as mkdir8, rm as rm5 } from "fs/promises";
|
|
20170
|
+
import { basename as basename13, dirname as dirname19, extname as extname9, join as join32, resolve as resolve24 } from "path";
|
|
19991
20171
|
var {build: bunBuild2, Transpiler: Transpiler4, write: write4, file: file3 } = globalThis.Bun;
|
|
19992
20172
|
var cachedPreprocessor = null, getPreprocessor = async () => {
|
|
19993
20173
|
if (cachedPreprocessor)
|
|
@@ -20083,7 +20263,7 @@ export const importSync = (specifier) => {
|
|
|
20083
20263
|
const originalImporter = stagedSourceMap.get(args.importer);
|
|
20084
20264
|
if (!originalImporter)
|
|
20085
20265
|
return;
|
|
20086
|
-
const candidateBase = resolve24(
|
|
20266
|
+
const candidateBase = resolve24(dirname19(originalImporter), args.path);
|
|
20087
20267
|
const extensionsToTry = ["", ".gts", ".gjs", ".ts", ".js"];
|
|
20088
20268
|
for (const ext of extensionsToTry) {
|
|
20089
20269
|
const candidate = candidateBase + ext;
|
|
@@ -20106,7 +20286,7 @@ export const importSync = (specifier) => {
|
|
|
20106
20286
|
build.onResolve({ filter: /^@(?:ember|glimmer|simple-dom)\// }, (args) => {
|
|
20107
20287
|
if (standalonePackages.has(args.path))
|
|
20108
20288
|
return;
|
|
20109
|
-
const internal =
|
|
20289
|
+
const internal = join32(cwd, "node_modules/ember-source/dist/packages", args.path, "index.js");
|
|
20110
20290
|
if (existsSync25(internal))
|
|
20111
20291
|
return { path: internal };
|
|
20112
20292
|
return;
|
|
@@ -20154,16 +20334,16 @@ export default PageComponent;
|
|
|
20154
20334
|
}
|
|
20155
20335
|
const transpiled = transpiler5.transformSync(preprocessed);
|
|
20156
20336
|
const baseName = basename13(resolvedEntry).replace(/\.(gjs|gts|ts|js)$/, "");
|
|
20157
|
-
const tmpDir =
|
|
20158
|
-
const serverDir =
|
|
20159
|
-
const clientDir =
|
|
20337
|
+
const tmpDir = join32(compiledRoot, "_tmp");
|
|
20338
|
+
const serverDir = join32(compiledRoot, "server");
|
|
20339
|
+
const clientDir = join32(compiledRoot, "client");
|
|
20160
20340
|
await Promise.all([
|
|
20161
|
-
|
|
20162
|
-
|
|
20163
|
-
|
|
20341
|
+
mkdir8(tmpDir, { recursive: true }),
|
|
20342
|
+
mkdir8(serverDir, { recursive: true }),
|
|
20343
|
+
mkdir8(clientDir, { recursive: true })
|
|
20164
20344
|
]);
|
|
20165
|
-
const tmpPagePath = resolve24(
|
|
20166
|
-
const tmpHarnessPath = resolve24(
|
|
20345
|
+
const tmpPagePath = resolve24(join32(tmpDir, `${baseName}.module.js`));
|
|
20346
|
+
const tmpHarnessPath = resolve24(join32(tmpDir, `${baseName}.harness.js`));
|
|
20167
20347
|
await Promise.all([
|
|
20168
20348
|
write4(tmpPagePath, transpiled),
|
|
20169
20349
|
write4(tmpHarnessPath, generateServerHarness(tmpPagePath))
|
|
@@ -20171,7 +20351,7 @@ export default PageComponent;
|
|
|
20171
20351
|
const stagedSourceMap = new Map([
|
|
20172
20352
|
[tmpPagePath, resolvedEntry]
|
|
20173
20353
|
]);
|
|
20174
|
-
const serverPath =
|
|
20354
|
+
const serverPath = join32(serverDir, `${baseName}.js`);
|
|
20175
20355
|
const buildResult = await bunBuild2({
|
|
20176
20356
|
entrypoints: [tmpHarnessPath],
|
|
20177
20357
|
format: "esm",
|
|
@@ -20187,8 +20367,8 @@ export default PageComponent;
|
|
|
20187
20367
|
if (!buildResult.success) {
|
|
20188
20368
|
console.warn(`\u26A0\uFE0F Ember server build for ${baseName} had errors:`, buildResult.logs);
|
|
20189
20369
|
}
|
|
20190
|
-
await
|
|
20191
|
-
const clientPath =
|
|
20370
|
+
await rm5(tmpDir, { force: true, recursive: true });
|
|
20371
|
+
const clientPath = join32(clientDir, `${baseName}.js`);
|
|
20192
20372
|
await write4(clientPath, transpiled);
|
|
20193
20373
|
return { clientPath, serverPath };
|
|
20194
20374
|
}, compileEmber = async (entries, emberDir, cwd = process.cwd(), _hmr = false) => {
|
|
@@ -20216,7 +20396,7 @@ export default PageComponent;
|
|
|
20216
20396
|
preprocessed = rewriteTemplateEvalToScope(result.code);
|
|
20217
20397
|
}
|
|
20218
20398
|
return transpiler5.transformSync(preprocessed);
|
|
20219
|
-
}, clearEmberCompilerCache = () => {}, getEmberCompiledRoot = (_emberDir) => getFrameworkGeneratedDir("ember"), getEmberServerCompiledDir = (emberDir) =>
|
|
20399
|
+
}, clearEmberCompilerCache = () => {}, getEmberCompiledRoot = (_emberDir) => getFrameworkGeneratedDir("ember"), getEmberServerCompiledDir = (emberDir) => join32(getEmberCompiledRoot(emberDir), "server"), getEmberClientCompiledDir = (emberDir) => join32(getEmberCompiledRoot(emberDir), "client");
|
|
20220
20400
|
var init_compileEmber = __esm(() => {
|
|
20221
20401
|
init_generatedDir();
|
|
20222
20402
|
transpiler5 = new Transpiler4({
|
|
@@ -20238,8 +20418,8 @@ __export(exports_buildReactVendor, {
|
|
|
20238
20418
|
buildReactVendor: () => buildReactVendor
|
|
20239
20419
|
});
|
|
20240
20420
|
import { existsSync as existsSync26, mkdirSync as mkdirSync8 } from "fs";
|
|
20241
|
-
import { join as
|
|
20242
|
-
import { rm as
|
|
20421
|
+
import { join as join33, resolve as resolve25 } from "path";
|
|
20422
|
+
import { rm as rm6 } from "fs/promises";
|
|
20243
20423
|
var {build: bunBuild3 } = globalThis.Bun;
|
|
20244
20424
|
var resolveJsxDevRuntimeCompatPath = () => {
|
|
20245
20425
|
const candidates = [
|
|
@@ -20288,14 +20468,14 @@ var resolveJsxDevRuntimeCompatPath = () => {
|
|
|
20288
20468
|
`)}
|
|
20289
20469
|
`;
|
|
20290
20470
|
}, buildReactVendor = async (buildDir) => {
|
|
20291
|
-
const vendorDir =
|
|
20471
|
+
const vendorDir = join33(buildDir, "react", "vendor");
|
|
20292
20472
|
mkdirSync8(vendorDir, { recursive: true });
|
|
20293
|
-
const tmpDir =
|
|
20473
|
+
const tmpDir = join33(buildDir, "_vendor_tmp");
|
|
20294
20474
|
mkdirSync8(tmpDir, { recursive: true });
|
|
20295
20475
|
const specifiers = reactSpecifiers;
|
|
20296
20476
|
const entrypoints = await Promise.all(specifiers.map(async (specifier) => {
|
|
20297
20477
|
const safeName = toSafeFileName(specifier);
|
|
20298
|
-
const entryPath =
|
|
20478
|
+
const entryPath = join33(tmpDir, `${safeName}.ts`);
|
|
20299
20479
|
const source = await generateEntrySource(specifier);
|
|
20300
20480
|
await Bun.write(entryPath, source);
|
|
20301
20481
|
return entryPath;
|
|
@@ -20310,7 +20490,7 @@ var resolveJsxDevRuntimeCompatPath = () => {
|
|
|
20310
20490
|
target: "browser",
|
|
20311
20491
|
throw: false
|
|
20312
20492
|
});
|
|
20313
|
-
await
|
|
20493
|
+
await rm6(tmpDir, { force: true, recursive: true });
|
|
20314
20494
|
if (!result.success) {
|
|
20315
20495
|
console.warn("\u26A0\uFE0F React vendor build had errors:", result.logs);
|
|
20316
20496
|
}
|
|
@@ -20363,8 +20543,8 @@ __export(exports_buildAngularVendor, {
|
|
|
20363
20543
|
buildAngularServerVendor: () => buildAngularServerVendor
|
|
20364
20544
|
});
|
|
20365
20545
|
import { mkdirSync as mkdirSync9 } from "fs";
|
|
20366
|
-
import { join as
|
|
20367
|
-
import { rm as
|
|
20546
|
+
import { join as join34 } from "path";
|
|
20547
|
+
import { rm as rm7 } from "fs/promises";
|
|
20368
20548
|
var {build: bunBuild4, Glob: Glob7 } = globalThis.Bun;
|
|
20369
20549
|
var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => jitMode ? [...REQUIRED_ANGULAR_SPECIFIERS_BASE, "@angular/compiler"] : REQUIRED_ANGULAR_SPECIFIERS_BASE, SERVER_ONLY_ANGULAR_SPECIFIERS, BUILD_ONLY_ANGULAR_SPECIFIER_PREFIXES, isBuildOnlyAngularSpecifier = (spec) => BUILD_ONLY_ANGULAR_SPECIFIER_PREFIXES.some((prefix) => spec === prefix || spec.startsWith(`${prefix}/`)), SCAN_SKIP_DIRS, isResolvable = (specifier) => {
|
|
20370
20550
|
try {
|
|
@@ -20460,14 +20640,14 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
|
|
|
20460
20640
|
await collectTransitiveAngularSpecs([...angular, ...transitiveRoots], angular);
|
|
20461
20641
|
return Array.from(angular).filter(isResolvable);
|
|
20462
20642
|
}, buildAngularVendor = async (buildDir, directories = [], linkerJitMode = false, depVendorSpecifiers = []) => {
|
|
20463
|
-
const vendorDir =
|
|
20643
|
+
const vendorDir = join34(buildDir, "angular", "vendor");
|
|
20464
20644
|
mkdirSync9(vendorDir, { recursive: true });
|
|
20465
|
-
const tmpDir =
|
|
20645
|
+
const tmpDir = join34(buildDir, "_angular_vendor_tmp");
|
|
20466
20646
|
mkdirSync9(tmpDir, { recursive: true });
|
|
20467
20647
|
const specifiers = await resolveAngularSpecifiers(directories, linkerJitMode);
|
|
20468
20648
|
const entrypoints = await Promise.all(specifiers.map(async (specifier) => {
|
|
20469
20649
|
const safeName = toSafeFileName2(specifier);
|
|
20470
|
-
const entryPath =
|
|
20650
|
+
const entryPath = join34(tmpDir, `${safeName}.ts`);
|
|
20471
20651
|
await Bun.write(entryPath, await generateVendorEntrySource(specifier));
|
|
20472
20652
|
return entryPath;
|
|
20473
20653
|
}));
|
|
@@ -20483,7 +20663,7 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
|
|
|
20483
20663
|
target: "browser",
|
|
20484
20664
|
throw: false
|
|
20485
20665
|
});
|
|
20486
|
-
await
|
|
20666
|
+
await rm7(tmpDir, { force: true, recursive: true });
|
|
20487
20667
|
if (!result.success) {
|
|
20488
20668
|
console.warn("\u26A0\uFE0F Angular vendor build had errors:", result.logs);
|
|
20489
20669
|
}
|
|
@@ -20498,9 +20678,9 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
|
|
|
20498
20678
|
const specifiers = await resolveAngularSpecifiers(directories, linkerJitMode);
|
|
20499
20679
|
return computeAngularVendorPaths(specifiers);
|
|
20500
20680
|
}, buildAngularServerVendor = async (buildDir, directories = [], linkerJitMode = false) => {
|
|
20501
|
-
const vendorDir =
|
|
20681
|
+
const vendorDir = join34(buildDir, "angular", "vendor", "server");
|
|
20502
20682
|
mkdirSync9(vendorDir, { recursive: true });
|
|
20503
|
-
const tmpDir =
|
|
20683
|
+
const tmpDir = join34(buildDir, "_angular_server_vendor_tmp");
|
|
20504
20684
|
mkdirSync9(tmpDir, { recursive: true });
|
|
20505
20685
|
const browserSpecs = await resolveAngularSpecifiers(directories, linkerJitMode);
|
|
20506
20686
|
const allSpecs = new Set(browserSpecs);
|
|
@@ -20511,7 +20691,7 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
|
|
|
20511
20691
|
const specifiers = Array.from(allSpecs);
|
|
20512
20692
|
const entrypoints = await Promise.all(specifiers.map(async (specifier) => {
|
|
20513
20693
|
const safeName = toSafeFileName2(specifier);
|
|
20514
|
-
const entryPath =
|
|
20694
|
+
const entryPath = join34(tmpDir, `${safeName}.ts`);
|
|
20515
20695
|
await Bun.write(entryPath, await generateVendorEntrySource(specifier));
|
|
20516
20696
|
return entryPath;
|
|
20517
20697
|
}));
|
|
@@ -20526,16 +20706,16 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
|
|
|
20526
20706
|
target: "bun",
|
|
20527
20707
|
throw: false
|
|
20528
20708
|
});
|
|
20529
|
-
await
|
|
20709
|
+
await rm7(tmpDir, { force: true, recursive: true });
|
|
20530
20710
|
if (!result.success) {
|
|
20531
20711
|
console.warn("\u26A0\uFE0F Angular server vendor build had errors:", result.logs);
|
|
20532
20712
|
}
|
|
20533
20713
|
return specifiers;
|
|
20534
20714
|
}, computeAngularServerVendorPaths = (buildDir, specifiers) => {
|
|
20535
20715
|
const paths = {};
|
|
20536
|
-
const vendorDir =
|
|
20716
|
+
const vendorDir = join34(buildDir, "angular", "vendor", "server");
|
|
20537
20717
|
for (const specifier of specifiers) {
|
|
20538
|
-
paths[specifier] =
|
|
20718
|
+
paths[specifier] = join34(vendorDir, `${toSafeFileName2(specifier)}.js`);
|
|
20539
20719
|
}
|
|
20540
20720
|
return paths;
|
|
20541
20721
|
}, computeAngularServerVendorPathsAsync = async (buildDir, directories = [], linkerJitMode = true) => {
|
|
@@ -20591,17 +20771,17 @@ __export(exports_buildVueVendor, {
|
|
|
20591
20771
|
buildVueVendor: () => buildVueVendor
|
|
20592
20772
|
});
|
|
20593
20773
|
import { mkdirSync as mkdirSync10 } from "fs";
|
|
20594
|
-
import { join as
|
|
20595
|
-
import { rm as
|
|
20774
|
+
import { join as join35 } from "path";
|
|
20775
|
+
import { rm as rm8 } from "fs/promises";
|
|
20596
20776
|
var {build: bunBuild5 } = globalThis.Bun;
|
|
20597
20777
|
var vueSpecifiers, toSafeFileName3 = (specifier) => specifier.replace(/\//g, "_"), buildVueVendor = async (buildDir) => {
|
|
20598
|
-
const vendorDir =
|
|
20778
|
+
const vendorDir = join35(buildDir, "vue", "vendor");
|
|
20599
20779
|
mkdirSync10(vendorDir, { recursive: true });
|
|
20600
|
-
const tmpDir =
|
|
20780
|
+
const tmpDir = join35(buildDir, "_vue_vendor_tmp");
|
|
20601
20781
|
mkdirSync10(tmpDir, { recursive: true });
|
|
20602
20782
|
const entrypoints = await Promise.all(vueSpecifiers.map(async (specifier) => {
|
|
20603
20783
|
const safeName = toSafeFileName3(specifier);
|
|
20604
|
-
const entryPath =
|
|
20784
|
+
const entryPath = join35(tmpDir, `${safeName}.ts`);
|
|
20605
20785
|
await Bun.write(entryPath, `export * from '${specifier}';
|
|
20606
20786
|
`);
|
|
20607
20787
|
return entryPath;
|
|
@@ -20621,7 +20801,7 @@ var vueSpecifiers, toSafeFileName3 = (specifier) => specifier.replace(/\//g, "_"
|
|
|
20621
20801
|
target: "browser",
|
|
20622
20802
|
throw: false
|
|
20623
20803
|
});
|
|
20624
|
-
await
|
|
20804
|
+
await rm8(tmpDir, { force: true, recursive: true });
|
|
20625
20805
|
if (!result.success) {
|
|
20626
20806
|
console.warn("\u26A0\uFE0F Vue vendor build had errors:", result.logs);
|
|
20627
20807
|
return;
|
|
@@ -20629,7 +20809,7 @@ var vueSpecifiers, toSafeFileName3 = (specifier) => specifier.replace(/\//g, "_"
|
|
|
20629
20809
|
const { readFileSync: readFileSync21, writeFileSync: writeFileSync8, readdirSync: readdirSync5 } = await import("fs");
|
|
20630
20810
|
const files = readdirSync5(vendorDir).filter((f2) => f2.endsWith(".js"));
|
|
20631
20811
|
for (const file4 of files) {
|
|
20632
|
-
const filePath =
|
|
20812
|
+
const filePath = join35(vendorDir, file4);
|
|
20633
20813
|
const content = readFileSync21(filePath, "utf-8");
|
|
20634
20814
|
if (!content.includes("__VUE_HMR_RUNTIME__"))
|
|
20635
20815
|
continue;
|
|
@@ -20656,8 +20836,8 @@ __export(exports_buildSvelteVendor, {
|
|
|
20656
20836
|
buildSvelteVendor: () => buildSvelteVendor
|
|
20657
20837
|
});
|
|
20658
20838
|
import { mkdirSync as mkdirSync11 } from "fs";
|
|
20659
|
-
import { join as
|
|
20660
|
-
import { rm as
|
|
20839
|
+
import { join as join36 } from "path";
|
|
20840
|
+
import { rm as rm9 } from "fs/promises";
|
|
20661
20841
|
var {build: bunBuild6 } = globalThis.Bun;
|
|
20662
20842
|
var svelteSpecifiers, isResolvable2 = (specifier) => {
|
|
20663
20843
|
try {
|
|
@@ -20670,13 +20850,13 @@ var svelteSpecifiers, isResolvable2 = (specifier) => {
|
|
|
20670
20850
|
const specifiers = resolveVendorSpecifiers();
|
|
20671
20851
|
if (specifiers.length === 0)
|
|
20672
20852
|
return;
|
|
20673
|
-
const vendorDir =
|
|
20853
|
+
const vendorDir = join36(buildDir, "svelte", "vendor");
|
|
20674
20854
|
mkdirSync11(vendorDir, { recursive: true });
|
|
20675
|
-
const tmpDir =
|
|
20855
|
+
const tmpDir = join36(buildDir, "_svelte_vendor_tmp");
|
|
20676
20856
|
mkdirSync11(tmpDir, { recursive: true });
|
|
20677
20857
|
const entrypoints = await Promise.all(specifiers.map(async (specifier) => {
|
|
20678
20858
|
const safeName = toSafeFileName4(specifier);
|
|
20679
|
-
const entryPath =
|
|
20859
|
+
const entryPath = join36(tmpDir, `${safeName}.ts`);
|
|
20680
20860
|
await Bun.write(entryPath, `export * from '${specifier}';
|
|
20681
20861
|
`);
|
|
20682
20862
|
return entryPath;
|
|
@@ -20691,7 +20871,7 @@ var svelteSpecifiers, isResolvable2 = (specifier) => {
|
|
|
20691
20871
|
target: "browser",
|
|
20692
20872
|
throw: false
|
|
20693
20873
|
});
|
|
20694
|
-
await
|
|
20874
|
+
await rm9(tmpDir, { force: true, recursive: true });
|
|
20695
20875
|
if (!result.success) {
|
|
20696
20876
|
console.warn("\u26A0\uFE0F Svelte vendor build had errors:", result.logs);
|
|
20697
20877
|
}
|
|
@@ -20727,7 +20907,7 @@ import {
|
|
|
20727
20907
|
statSync as statSync3,
|
|
20728
20908
|
writeFileSync as writeFileSync8
|
|
20729
20909
|
} from "fs";
|
|
20730
|
-
import { basename as basename14, dirname as
|
|
20910
|
+
import { basename as basename14, dirname as dirname20, extname as extname10, join as join37, relative as relative15, resolve as resolve26 } from "path";
|
|
20731
20911
|
import { cwd, env as env2, exit } from "process";
|
|
20732
20912
|
var {build: bunBuild7, Glob: Glob8 } = globalThis.Bun;
|
|
20733
20913
|
var isBuildTraceEnabled = () => {
|
|
@@ -20861,8 +21041,8 @@ ${offenders.map((o3) => ` \u2022 ${o3}`).join(`
|
|
|
20861
21041
|
mkdirSync12(htmxDestDir, { recursive: true });
|
|
20862
21042
|
const glob = new Glob8("htmx*.min.js");
|
|
20863
21043
|
for (const relPath of glob.scanSync({ cwd: htmxDir })) {
|
|
20864
|
-
const src =
|
|
20865
|
-
const dest =
|
|
21044
|
+
const src = join37(htmxDir, relPath);
|
|
21045
|
+
const dest = join37(htmxDestDir, "htmx.min.js");
|
|
20866
21046
|
copyFileSync2(src, dest);
|
|
20867
21047
|
return;
|
|
20868
21048
|
}
|
|
@@ -20939,7 +21119,7 @@ ${offenders.map((o3) => ` \u2022 ${o3}`).join(`
|
|
|
20939
21119
|
vuePagesPath
|
|
20940
21120
|
}) => {
|
|
20941
21121
|
const { readdirSync: readDir } = await import("fs");
|
|
20942
|
-
const devIndexDir =
|
|
21122
|
+
const devIndexDir = join37(buildPath, "_src_indexes");
|
|
20943
21123
|
mkdirSync12(devIndexDir, { recursive: true });
|
|
20944
21124
|
if (reactIndexesPath && reactPagesPath) {
|
|
20945
21125
|
copyReactDevIndexes(reactIndexesPath, reactPagesPath, devIndexDir, readDir);
|
|
@@ -20957,35 +21137,35 @@ ${offenders.map((o3) => ` \u2022 ${o3}`).join(`
|
|
|
20957
21137
|
const indexFiles = readDir(reactIndexesPath).filter((file4) => file4.endsWith(".tsx"));
|
|
20958
21138
|
const pagesRel = relative15(process.cwd(), resolve26(reactPagesPath)).replace(/\\/g, "/");
|
|
20959
21139
|
for (const file4 of indexFiles) {
|
|
20960
|
-
let content = readFileSync21(
|
|
21140
|
+
let content = readFileSync21(join37(reactIndexesPath, file4), "utf-8");
|
|
20961
21141
|
content = content.replace(/from\s*['"]([^'"]*\/pages\/([^'"]+))['"]/g, (_match, _fullPath, componentName) => `from '/@src/${pagesRel}/${componentName}'`);
|
|
20962
|
-
writeFileSync8(
|
|
21142
|
+
writeFileSync8(join37(devIndexDir, file4), content);
|
|
20963
21143
|
}
|
|
20964
21144
|
}, copySvelteDevIndexes = (svelteDir, sveltePagesPath, svelteEntries, devIndexDir) => {
|
|
20965
|
-
const svelteIndexDir =
|
|
21145
|
+
const svelteIndexDir = join37(getFrameworkGeneratedDir("svelte"), "indexes");
|
|
20966
21146
|
const sveltePageEntries = svelteEntries.filter((file4) => resolve26(file4).startsWith(resolve26(sveltePagesPath)));
|
|
20967
21147
|
for (const entry of sveltePageEntries) {
|
|
20968
21148
|
const name = basename14(entry).replace(/\.svelte(\.(ts|js))?$/, "");
|
|
20969
|
-
const indexFile =
|
|
21149
|
+
const indexFile = join37(svelteIndexDir, "pages", `${name}.js`);
|
|
20970
21150
|
if (!existsSync27(indexFile))
|
|
20971
21151
|
continue;
|
|
20972
21152
|
let content = readFileSync21(indexFile, "utf-8");
|
|
20973
21153
|
const srcRel = relative15(process.cwd(), resolve26(entry)).replace(/\\/g, "/");
|
|
20974
21154
|
content = content.replace(/import\s+Component\s+from\s+['"]([^'"]+)['"]/, `import Component from "/@src/${srcRel}"`);
|
|
20975
|
-
writeFileSync8(
|
|
21155
|
+
writeFileSync8(join37(devIndexDir, `${name}.svelte.js`), content);
|
|
20976
21156
|
}
|
|
20977
21157
|
}, copyVueDevIndexes = (vueDir, vuePagesPath, vueEntries, devIndexDir) => {
|
|
20978
|
-
const vueIndexDir =
|
|
21158
|
+
const vueIndexDir = join37(getFrameworkGeneratedDir("vue"), "indexes");
|
|
20979
21159
|
const vuePageEntries = vueEntries.filter((file4) => resolve26(file4).startsWith(resolve26(vuePagesPath)));
|
|
20980
21160
|
for (const entry of vuePageEntries) {
|
|
20981
21161
|
const name = basename14(entry, ".vue");
|
|
20982
|
-
const indexFile =
|
|
21162
|
+
const indexFile = join37(vueIndexDir, `${name}.js`);
|
|
20983
21163
|
if (!existsSync27(indexFile))
|
|
20984
21164
|
continue;
|
|
20985
21165
|
let content = readFileSync21(indexFile, "utf-8");
|
|
20986
21166
|
const srcRel = relative15(process.cwd(), resolve26(entry)).replace(/\\/g, "/");
|
|
20987
21167
|
content = content.replace(/import\s+Comp(?:\s*,\s*\*\s+as\s+\w+)?\s+from\s+['"]([^'"]+)['"]/, (match) => match.replace(/from\s+['"][^'"]+['"]/, `from "/@src/${srcRel}"`));
|
|
20988
|
-
writeFileSync8(
|
|
21168
|
+
writeFileSync8(join37(devIndexDir, `${name}.vue.js`), content);
|
|
20989
21169
|
}
|
|
20990
21170
|
}, resolveVueRuntimeId = (content, firstUseName, outputPath, projectRoot) => {
|
|
20991
21171
|
const varIdx = content.indexOf(`var ${firstUseName} =`);
|
|
@@ -21134,6 +21314,8 @@ ${content.slice(firstUseIdx)}`;
|
|
|
21134
21314
|
};
|
|
21135
21315
|
const result = {
|
|
21136
21316
|
...merged,
|
|
21317
|
+
banner: [base.banner, sanitized.banner].filter(Boolean).join(`
|
|
21318
|
+
`) || undefined,
|
|
21137
21319
|
define: base.define || sanitized.define ? {
|
|
21138
21320
|
...sanitized.define ?? {},
|
|
21139
21321
|
...base.define ?? {}
|
|
@@ -21155,6 +21337,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
21155
21337
|
htmxDirectory,
|
|
21156
21338
|
angularDirectory,
|
|
21157
21339
|
emberDirectory,
|
|
21340
|
+
pwa,
|
|
21158
21341
|
svelteDirectory,
|
|
21159
21342
|
vueDirectory,
|
|
21160
21343
|
stylesConfig,
|
|
@@ -21220,10 +21403,10 @@ ${content.slice(firstUseIdx)}`;
|
|
|
21220
21403
|
restoreTracePhase();
|
|
21221
21404
|
return;
|
|
21222
21405
|
}
|
|
21223
|
-
const traceDir =
|
|
21406
|
+
const traceDir = join37(buildPath2, ".absolute-trace");
|
|
21224
21407
|
const timestamp = new Date().toISOString().replace(/[:.]/g, "-");
|
|
21225
21408
|
mkdirSync12(traceDir, { recursive: true });
|
|
21226
|
-
writeFileSync8(
|
|
21409
|
+
writeFileSync8(join37(traceDir, `build-trace-${timestamp}.json`), JSON.stringify({
|
|
21227
21410
|
events: traceEvents,
|
|
21228
21411
|
frameworks: traceFrameworkNames,
|
|
21229
21412
|
generatedAt: new Date().toISOString(),
|
|
@@ -21254,16 +21437,16 @@ ${content.slice(firstUseIdx)}`;
|
|
|
21254
21437
|
const stylesPath = typeof stylesConfig === "string" ? stylesConfig : stylesConfig?.path;
|
|
21255
21438
|
const stylesIgnore = typeof stylesConfig === "object" ? stylesConfig.ignore : undefined;
|
|
21256
21439
|
const stylesDir = stylesPath && validateSafePath(stylesPath, projectRoot);
|
|
21257
|
-
const reactIndexesPath = reactDir &&
|
|
21258
|
-
const reactPagesPath = reactDir &&
|
|
21259
|
-
const htmlPagesPath = htmlDir &&
|
|
21260
|
-
const htmlScriptsPath = htmlDir &&
|
|
21261
|
-
const sveltePagesPath = svelteDir &&
|
|
21262
|
-
const vuePagesPath = vueDir &&
|
|
21263
|
-
const htmxPagesPath = htmxDir &&
|
|
21264
|
-
const htmxScriptsPath = htmxDir &&
|
|
21265
|
-
const angularPagesPath = angularDir &&
|
|
21266
|
-
const emberPagesPath = emberDir &&
|
|
21440
|
+
const reactIndexesPath = reactDir && join37(getFrameworkGeneratedDir("react"), "indexes");
|
|
21441
|
+
const reactPagesPath = reactDir && join37(reactDir, "pages");
|
|
21442
|
+
const htmlPagesPath = htmlDir && join37(htmlDir, "pages");
|
|
21443
|
+
const htmlScriptsPath = htmlDir && join37(htmlDir, "scripts");
|
|
21444
|
+
const sveltePagesPath = svelteDir && join37(svelteDir, "pages");
|
|
21445
|
+
const vuePagesPath = vueDir && join37(vueDir, "pages");
|
|
21446
|
+
const htmxPagesPath = htmxDir && join37(htmxDir, "pages");
|
|
21447
|
+
const htmxScriptsPath = htmxDir && join37(htmxDir, "scripts");
|
|
21448
|
+
const angularPagesPath = angularDir && join37(angularDir, "pages");
|
|
21449
|
+
const emberPagesPath = emberDir && join37(emberDir, "pages");
|
|
21267
21450
|
const frontends = [
|
|
21268
21451
|
reactDir,
|
|
21269
21452
|
htmlDir,
|
|
@@ -21288,13 +21471,15 @@ ${content.slice(firstUseIdx)}`;
|
|
|
21288
21471
|
framework: frameworkNames[0],
|
|
21289
21472
|
frameworks: frameworkNames,
|
|
21290
21473
|
mode: mode ?? (isDev2 ? "development" : "production"),
|
|
21474
|
+
pwa: Boolean(pwa),
|
|
21475
|
+
pwaSync: Boolean(pwa?.sync),
|
|
21291
21476
|
tailwind: Boolean(tailwind)
|
|
21292
21477
|
});
|
|
21293
21478
|
const generatedRoot = getGeneratedRoot(projectRoot);
|
|
21294
21479
|
const sourceClientRoots = [
|
|
21295
21480
|
htmlDir,
|
|
21296
21481
|
htmxDir,
|
|
21297
|
-
islandBootstrapPath &&
|
|
21482
|
+
islandBootstrapPath && dirname20(islandBootstrapPath)
|
|
21298
21483
|
].filter((dir) => Boolean(dir));
|
|
21299
21484
|
const usesGenerated = Boolean(reactDir) || Boolean(svelteDir) || Boolean(vueDir) || Boolean(angularDir);
|
|
21300
21485
|
if (usesGenerated)
|
|
@@ -21322,8 +21507,8 @@ ${content.slice(firstUseIdx)}`;
|
|
|
21322
21507
|
const [firstEntry] = serverDirMap;
|
|
21323
21508
|
if (!firstEntry)
|
|
21324
21509
|
throw new Error("Expected at least one server directory entry");
|
|
21325
|
-
serverRoot =
|
|
21326
|
-
serverOutDir =
|
|
21510
|
+
serverRoot = join37(firstEntry.dir, firstEntry.subdir);
|
|
21511
|
+
serverOutDir = join37(buildPath, basename14(firstEntry.dir));
|
|
21327
21512
|
} else if (serverDirMap.length > 1) {
|
|
21328
21513
|
serverRoot = commonAncestor(serverDirMap.map((entry) => entry.dir), projectRoot);
|
|
21329
21514
|
serverOutDir = buildPath;
|
|
@@ -21332,6 +21517,12 @@ ${content.slice(firstUseIdx)}`;
|
|
|
21332
21517
|
await tracePhase("build-dir/create", () => mkdirSync12(buildPath, { recursive: true }));
|
|
21333
21518
|
if (publicPath)
|
|
21334
21519
|
await tracePhase("public/copy", () => cpSync(publicPath, buildPath, { force: true, recursive: true }));
|
|
21520
|
+
const pwaArtifacts = pwa ? await tracePhase("pwa/materialize", () => materializeAbsolutePwa({
|
|
21521
|
+
buildPath,
|
|
21522
|
+
config: pwa,
|
|
21523
|
+
generatedRoot,
|
|
21524
|
+
write: !isIncremental
|
|
21525
|
+
})) : undefined;
|
|
21335
21526
|
const filterToIncrementalEntries = (entryPoints, mapToSource) => {
|
|
21336
21527
|
if (!isIncremental || !incrementalFiles)
|
|
21337
21528
|
return entryPoints;
|
|
@@ -21351,7 +21542,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
21351
21542
|
await tracePhase("react/index-generation", () => generateReactIndexFiles(reactPagesPath, reactIndexesPath, hmr));
|
|
21352
21543
|
}
|
|
21353
21544
|
if (assetsPath && (!isIncremental || normalizedIncrementalFiles?.some((f2) => f2.includes("/assets/")))) {
|
|
21354
|
-
await tracePhase("assets/copy", () => cpSync(assetsPath,
|
|
21545
|
+
await tracePhase("assets/copy", () => cpSync(assetsPath, join37(buildPath, "assets"), {
|
|
21355
21546
|
force: true,
|
|
21356
21547
|
recursive: true
|
|
21357
21548
|
}));
|
|
@@ -21465,11 +21656,11 @@ ${content.slice(firstUseIdx)}`;
|
|
|
21465
21656
|
}
|
|
21466
21657
|
}
|
|
21467
21658
|
if (htmlDefaults.error || htmlDefaults.notFound || htmlDefaults.loading || Object.keys(htmlPages).length > 0) {
|
|
21468
|
-
const htmlConventionsOutDir =
|
|
21659
|
+
const htmlConventionsOutDir = join37(buildPath, "conventions", "html");
|
|
21469
21660
|
mkdirSync12(htmlConventionsOutDir, { recursive: true });
|
|
21470
21661
|
const htmlPathRemap = new Map;
|
|
21471
21662
|
for (const sourcePath of htmlConventionSources) {
|
|
21472
|
-
const dest =
|
|
21663
|
+
const dest = join37(htmlConventionsOutDir, basename14(sourcePath));
|
|
21473
21664
|
cpSync(sourcePath, dest, { force: true });
|
|
21474
21665
|
htmlPathRemap.set(sourcePath, dest);
|
|
21475
21666
|
}
|
|
@@ -21512,7 +21703,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
21512
21703
|
const reactEntries = isIncremental && reactIndexesPath && reactPagesPath ? filterToIncrementalEntries(allReactEntries, (entry) => {
|
|
21513
21704
|
if (entry.startsWith(resolve26(reactIndexesPath))) {
|
|
21514
21705
|
const pageName = basename14(entry, ".tsx");
|
|
21515
|
-
return
|
|
21706
|
+
return join37(reactPagesPath, `${pageName}.tsx`);
|
|
21516
21707
|
}
|
|
21517
21708
|
return null;
|
|
21518
21709
|
}) : allReactEntries;
|
|
@@ -21708,7 +21899,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
21708
21899
|
const compileReactConventions = async () => {
|
|
21709
21900
|
if (reactConventionSources.length === 0)
|
|
21710
21901
|
return emptyStringArray;
|
|
21711
|
-
const destDir =
|
|
21902
|
+
const destDir = join37(buildPath, "conventions", "react");
|
|
21712
21903
|
rmSync2(destDir, { force: true, recursive: true });
|
|
21713
21904
|
mkdirSync12(destDir, { recursive: true });
|
|
21714
21905
|
const destPaths = await Promise.all(reactConventionSources.map(async (source, idx) => {
|
|
@@ -21723,7 +21914,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
21723
21914
|
stylePreprocessorPlugin2,
|
|
21724
21915
|
createBunStringRawUnicodePlugin()
|
|
21725
21916
|
],
|
|
21726
|
-
root:
|
|
21917
|
+
root: dirname20(source),
|
|
21727
21918
|
target: "bun",
|
|
21728
21919
|
throw: false,
|
|
21729
21920
|
tsconfig: "./tsconfig.json"
|
|
@@ -21751,7 +21942,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
21751
21942
|
angularConventionSources.length > 0 && angularDir ? tracePhase("compile/convention-angular", () => Promise.resolve().then(() => (init_compileAngular(), exports_compileAngular)).then((mod) => mod.compileAngular(angularConventionSources, angularDir, hmr, styleTransformConfig))) : { serverPaths: emptyStringArray }
|
|
21752
21943
|
]);
|
|
21753
21944
|
const bundleConventionFiles = async (framework, compiledPaths) => {
|
|
21754
|
-
const destDir =
|
|
21945
|
+
const destDir = join37(buildPath, "conventions", framework);
|
|
21755
21946
|
rmSync2(destDir, { force: true, recursive: true });
|
|
21756
21947
|
mkdirSync12(destDir, { recursive: true });
|
|
21757
21948
|
const destPaths = await Promise.all(compiledPaths.map(async (compiledPath, idx) => {
|
|
@@ -21812,7 +22003,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
21812
22003
|
...islandBootstrapPath ? [islandBootstrapPath] : []
|
|
21813
22004
|
];
|
|
21814
22005
|
const [onlyWorkerClientEntry] = urlReferencedFiles;
|
|
21815
|
-
const workerClientRoot = urlReferencedFiles.length === 1 && onlyWorkerClientEntry ?
|
|
22006
|
+
const workerClientRoot = urlReferencedFiles.length === 1 && onlyWorkerClientEntry ? dirname20(onlyWorkerClientEntry) : commonAncestor(urlReferencedFiles.map((file4) => dirname20(file4)), projectRoot);
|
|
21816
22007
|
const islandEntryResult = islandBuildInfo ? await tracePhase("islands/client-entry-generation", () => generateIslandEntryPoints({
|
|
21817
22008
|
buildInfo: islandBuildInfo,
|
|
21818
22009
|
buildPath,
|
|
@@ -21823,7 +22014,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
21823
22014
|
}
|
|
21824
22015
|
})) : {
|
|
21825
22016
|
entries: [],
|
|
21826
|
-
generatedRoot:
|
|
22017
|
+
generatedRoot: join37(buildPath, "_island_entries")
|
|
21827
22018
|
};
|
|
21828
22019
|
const islandClientEntryPoints = islandEntryResult.entries.map((entry) => entry.entryPath);
|
|
21829
22020
|
if (serverEntryPoints.length === 0 && reactClientEntryPoints.length === 0 && nonReactClientEntryPoints.length === 0 && urlReferencedFiles.length === 0 && islandClientEntryPoints.length === 0 && htmxDir === undefined && htmlDir === undefined) {
|
|
@@ -21859,7 +22050,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
21859
22050
|
return {};
|
|
21860
22051
|
}
|
|
21861
22052
|
if (hmr && reactIndexesPath && reactClientEntryPoints.length > 0) {
|
|
21862
|
-
const refreshEntry =
|
|
22053
|
+
const refreshEntry = join37(reactIndexesPath, "_refresh.tsx");
|
|
21863
22054
|
if (!reactClientEntryPoints.includes(refreshEntry))
|
|
21864
22055
|
reactClientEntryPoints.push(refreshEntry);
|
|
21865
22056
|
}
|
|
@@ -21948,6 +22139,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
21948
22139
|
const svelteResolveConditions = svelteDir ? ["svelte", "main"] : undefined;
|
|
21949
22140
|
const htmlScriptPlugin = hmr ? createHTMLScriptHMRPlugin(htmlDir, htmxDir) : undefined;
|
|
21950
22141
|
const reactBuildConfig = reactClientEntryPoints.length > 0 ? mergeBunBuildConfig({
|
|
22142
|
+
banner: pwaArtifacts?.bootstrapBanner,
|
|
21951
22143
|
entrypoints: reactClientEntryPoints,
|
|
21952
22144
|
...Object.keys(reactExternalPaths).length > 0 ? { external: Object.keys(reactExternalPaths) } : {},
|
|
21953
22145
|
format: "esm",
|
|
@@ -21969,19 +22161,19 @@ ${content.slice(firstUseIdx)}`;
|
|
|
21969
22161
|
throw: false
|
|
21970
22162
|
}, resolveBunBuildOverride(bunBuildConfig, "reactClient")) : undefined;
|
|
21971
22163
|
if (reactDir && reactClientEntryPoints.length > 0) {
|
|
21972
|
-
rmSync2(
|
|
22164
|
+
rmSync2(join37(buildPath, "react", "generated", "indexes"), {
|
|
21973
22165
|
force: true,
|
|
21974
22166
|
recursive: true
|
|
21975
22167
|
});
|
|
21976
22168
|
}
|
|
21977
22169
|
if (angularDir && angularClientPaths.length > 0) {
|
|
21978
|
-
rmSync2(
|
|
22170
|
+
rmSync2(join37(buildPath, "angular", "indexes"), {
|
|
21979
22171
|
force: true,
|
|
21980
22172
|
recursive: true
|
|
21981
22173
|
});
|
|
21982
22174
|
}
|
|
21983
22175
|
if (islandClientEntryPoints.length > 0) {
|
|
21984
|
-
rmSync2(
|
|
22176
|
+
rmSync2(join37(buildPath, "islands"), {
|
|
21985
22177
|
force: true,
|
|
21986
22178
|
recursive: true
|
|
21987
22179
|
});
|
|
@@ -22018,6 +22210,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
22018
22210
|
}, resolveBunBuildOverride(bunBuildConfig, "server")))) : undefined,
|
|
22019
22211
|
reactBuildConfig ? tracePhase("bun/react-client", () => bunBuild7(reactBuildConfig)) : undefined,
|
|
22020
22212
|
nonReactClientEntryPoints.length > 0 ? tracePhase("bun/non-react-client", () => bunBuild7(mergeBunBuildConfig({
|
|
22213
|
+
banner: pwaArtifacts?.bootstrapBanner,
|
|
22021
22214
|
conditions: svelteResolveConditions,
|
|
22022
22215
|
define: vueDirectory ? vueFeatureFlags : undefined,
|
|
22023
22216
|
entrypoints: nonReactClientEntryPoints,
|
|
@@ -22063,6 +22256,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
22063
22256
|
tsconfig: "./tsconfig.json"
|
|
22064
22257
|
}, resolveBunBuildOverride(bunBuildConfig, "nonReactClient")))) : undefined,
|
|
22065
22258
|
islandClientEntryPoints.length > 0 ? tracePhase("bun/island-client", () => bunBuild7(mergeBunBuildConfig({
|
|
22259
|
+
banner: pwaArtifacts?.bootstrapBanner,
|
|
22066
22260
|
conditions: svelteResolveConditions,
|
|
22067
22261
|
define: vueDirectory ? vueFeatureFlags : undefined,
|
|
22068
22262
|
entrypoints: islandClientEntryPoints,
|
|
@@ -22093,7 +22287,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
22093
22287
|
globalCssEntries.length > 0 ? tracePhase("bun/global-css", () => bunBuild7(mergeBunBuildConfig({
|
|
22094
22288
|
entrypoints: globalCssEntries,
|
|
22095
22289
|
naming: `[dir]/[name].[hash].[ext]`,
|
|
22096
|
-
outdir: stylesDir ?
|
|
22290
|
+
outdir: stylesDir ? join37(buildPath, basename14(stylesDir)) : buildPath,
|
|
22097
22291
|
plugins: [stylePreprocessorPlugin2],
|
|
22098
22292
|
root: stylesDir || clientRoot,
|
|
22099
22293
|
target: "browser",
|
|
@@ -22102,7 +22296,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
22102
22296
|
vueCssPaths.length > 0 ? tracePhase("bun/vue-css", () => bunBuild7(mergeBunBuildConfig({
|
|
22103
22297
|
entrypoints: vueCssPaths,
|
|
22104
22298
|
naming: `[name].[hash].[ext]`,
|
|
22105
|
-
outdir:
|
|
22299
|
+
outdir: join37(buildPath, assetsPath ? basename14(assetsPath) : "assets", "css"),
|
|
22106
22300
|
target: "browser",
|
|
22107
22301
|
throw: false
|
|
22108
22302
|
}, resolveBunBuildOverride(bunBuildConfig, "vueCss")))) : undefined
|
|
@@ -22126,15 +22320,15 @@ ${content.slice(firstUseIdx)}`;
|
|
|
22126
22320
|
}
|
|
22127
22321
|
if (!isDev2 && resolveClientSourcemap(sourcemaps, isDev2) === "external") {
|
|
22128
22322
|
const { chainExternalSourcemap: chainExternalSourcemap2 } = await Promise.resolve().then(() => (init_chainInlineSourcemaps(), exports_chainInlineSourcemaps));
|
|
22129
|
-
const sourcemapDir =
|
|
22323
|
+
const sourcemapDir = join37(projectRoot, "sourcemaps");
|
|
22130
22324
|
mkdirSync12(sourcemapDir, { recursive: true });
|
|
22131
22325
|
const mapFiles = readdirSync5(buildPath, {
|
|
22132
22326
|
encoding: "utf8",
|
|
22133
22327
|
recursive: true
|
|
22134
|
-
}).filter((entry) => entry.endsWith(".js.map") && !entry.includes("node_modules")).map((entry) =>
|
|
22328
|
+
}).filter((entry) => entry.endsWith(".js.map") && !entry.includes("node_modules")).map((entry) => join37(buildPath, entry));
|
|
22135
22329
|
for (const mapPath of mapFiles) {
|
|
22136
22330
|
chainExternalSourcemap2(mapPath);
|
|
22137
|
-
renameSync(mapPath,
|
|
22331
|
+
renameSync(mapPath, join37(sourcemapDir, basename14(mapPath)));
|
|
22138
22332
|
const jsPath = mapPath.slice(0, -4);
|
|
22139
22333
|
try {
|
|
22140
22334
|
const javascript = readFileSync21(jsPath, "utf-8").replace(/\n?\/\/# sourceMappingURL=[^\n]*\s*$/, `
|
|
@@ -22208,7 +22402,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
22208
22402
|
await tracePhase("postprocess/island-vendor-imports", () => rewriteBuildOutputs2(islandClientOutputs, allIslandVendorPaths));
|
|
22209
22403
|
}
|
|
22210
22404
|
if (!hmr) {
|
|
22211
|
-
const reactVendorDir =
|
|
22405
|
+
const reactVendorDir = join37(buildPath, "react", "vendor");
|
|
22212
22406
|
const vendorChunkPaths = existsSync27(reactVendorDir) ? [
|
|
22213
22407
|
...new Glob8("**/*.js").scanSync({
|
|
22214
22408
|
absolute: true,
|
|
@@ -22225,7 +22419,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
22225
22419
|
if (serverOutputs.length > 0 && angularServerVendorPaths2 && Object.keys(angularServerVendorPaths2).length > 0) {
|
|
22226
22420
|
const { rewriteBuildOutputsWith: rewriteBuildOutputsWith2 } = await Promise.resolve().then(() => (init_rewriteImportsPlugin(), exports_rewriteImportsPlugin));
|
|
22227
22421
|
await tracePhase("postprocess/server-angular-vendor-imports", () => rewriteBuildOutputsWith2(serverOutputs, (artifact) => {
|
|
22228
|
-
const fileDir =
|
|
22422
|
+
const fileDir = dirname20(artifact.path);
|
|
22229
22423
|
const relativePaths = {};
|
|
22230
22424
|
for (const [specifier, absolute] of Object.entries(angularServerVendorPaths2)) {
|
|
22231
22425
|
const rel = relative15(fileDir, absolute);
|
|
@@ -22364,7 +22558,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
22364
22558
|
const processHtmlPages = async () => {
|
|
22365
22559
|
if (!(htmlDir && htmlPagesPath))
|
|
22366
22560
|
return;
|
|
22367
|
-
const outputHtmlPages = isSingle ?
|
|
22561
|
+
const outputHtmlPages = isSingle ? join37(buildPath, "pages") : join37(buildPath, basename14(htmlDir), "pages");
|
|
22368
22562
|
mkdirSync12(outputHtmlPages, { recursive: true });
|
|
22369
22563
|
cpSync(htmlPagesPath, outputHtmlPages, {
|
|
22370
22564
|
force: true,
|
|
@@ -22379,6 +22573,10 @@ ${content.slice(firstUseIdx)}`;
|
|
|
22379
22573
|
for (const htmlFile of htmlPageFiles) {
|
|
22380
22574
|
if (hmr)
|
|
22381
22575
|
injectHMRIntoHTMLFile(htmlFile, "html");
|
|
22576
|
+
if (pwaArtifacts) {
|
|
22577
|
+
const source = readFileSync21(htmlFile, "utf8");
|
|
22578
|
+
writeFileSync8(htmlFile, injectPwaBootstrapHtml(source));
|
|
22579
|
+
}
|
|
22382
22580
|
const fileName = basename14(htmlFile, ".html");
|
|
22383
22581
|
if (manifest[fileName] && manifest[fileName] !== htmlFile) {
|
|
22384
22582
|
warnManifestKeyCollision(fileName, manifest[fileName], htmlFile);
|
|
@@ -22389,14 +22587,14 @@ ${content.slice(firstUseIdx)}`;
|
|
|
22389
22587
|
const processHtmxPages = async () => {
|
|
22390
22588
|
if (!(htmxDir && htmxPagesPath))
|
|
22391
22589
|
return;
|
|
22392
|
-
const outputHtmxPages = isSingle ?
|
|
22590
|
+
const outputHtmxPages = isSingle ? join37(buildPath, "pages") : join37(buildPath, basename14(htmxDir), "pages");
|
|
22393
22591
|
mkdirSync12(outputHtmxPages, { recursive: true });
|
|
22394
22592
|
cpSync(htmxPagesPath, outputHtmxPages, {
|
|
22395
22593
|
force: true,
|
|
22396
22594
|
recursive: true
|
|
22397
22595
|
});
|
|
22398
22596
|
if (shouldCopyHtmx) {
|
|
22399
|
-
const htmxDestDir = isSingle ? buildPath :
|
|
22597
|
+
const htmxDestDir = isSingle ? buildPath : join37(buildPath, basename14(htmxDir));
|
|
22400
22598
|
copyHtmxVendor(htmxDir, htmxDestDir);
|
|
22401
22599
|
}
|
|
22402
22600
|
if (shouldUpdateHtmxAssetPaths) {
|
|
@@ -22408,6 +22606,10 @@ ${content.slice(firstUseIdx)}`;
|
|
|
22408
22606
|
for (const htmxFile of htmxPageFiles) {
|
|
22409
22607
|
if (hmr)
|
|
22410
22608
|
injectHMRIntoHTMLFile(htmxFile, "htmx");
|
|
22609
|
+
if (pwaArtifacts) {
|
|
22610
|
+
const source = readFileSync21(htmxFile, "utf8");
|
|
22611
|
+
writeFileSync8(htmxFile, injectPwaBootstrapHtml(source));
|
|
22612
|
+
}
|
|
22411
22613
|
const fileName = basename14(htmxFile, ".html");
|
|
22412
22614
|
if (manifest[fileName] && manifest[fileName] !== htmxFile) {
|
|
22413
22615
|
warnManifestKeyCollision(fileName, manifest[fileName], htmxFile);
|
|
@@ -22457,7 +22659,9 @@ ${content.slice(firstUseIdx)}`;
|
|
|
22457
22659
|
sendTelemetryEvent("build:complete", {
|
|
22458
22660
|
durationMs: Math.round(performance.now() - buildStart),
|
|
22459
22661
|
frameworks: frameworkNames,
|
|
22460
|
-
mode: mode ?? (isDev2 ? "development" : "production")
|
|
22662
|
+
mode: mode ?? (isDev2 ? "development" : "production"),
|
|
22663
|
+
pwa: Boolean(pwa),
|
|
22664
|
+
pwaSync: Boolean(pwa?.sync)
|
|
22461
22665
|
});
|
|
22462
22666
|
const [reactSpaHosts, svelteSpaHosts, vueSpaHosts, angularSpaHosts] = await Promise.all([
|
|
22463
22667
|
reactDir ? Promise.resolve().then(() => (init_staticAnalyzeSpaRoutes2(), exports_staticAnalyzeSpaRoutes2)).then((module) => module.analyzeReactSpaRoutes(reactDir)) : [],
|
|
@@ -22481,7 +22685,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
22481
22685
|
}))
|
|
22482
22686
|
];
|
|
22483
22687
|
setSpaRouteManifest(spaRouteHosts);
|
|
22484
|
-
writeFileSync8(
|
|
22688
|
+
writeFileSync8(join37(buildPath, "spa-routes.json"), JSON.stringify(spaRouteHosts, null, "\t"));
|
|
22485
22689
|
if (isIncremental) {
|
|
22486
22690
|
writeBuildTrace(buildPath);
|
|
22487
22691
|
return {
|
|
@@ -22490,9 +22694,9 @@ ${content.slice(firstUseIdx)}`;
|
|
|
22490
22694
|
manifest
|
|
22491
22695
|
};
|
|
22492
22696
|
}
|
|
22493
|
-
writeFileSync8(
|
|
22697
|
+
writeFileSync8(join37(buildPath, "manifest.json"), JSON.stringify(manifest, null, "\t"));
|
|
22494
22698
|
if (Object.keys(conventionsMap).length > 0) {
|
|
22495
|
-
writeFileSync8(
|
|
22699
|
+
writeFileSync8(join37(buildPath, "conventions.json"), JSON.stringify(conventionsMap, null, "\t"));
|
|
22496
22700
|
}
|
|
22497
22701
|
writeBuildTrace(buildPath);
|
|
22498
22702
|
if (mode === "production") {
|
|
@@ -22563,6 +22767,7 @@ var init_build = __esm(() => {
|
|
|
22563
22767
|
init_logger();
|
|
22564
22768
|
init_validateSafePath();
|
|
22565
22769
|
init_spaRouteManifest();
|
|
22770
|
+
init_pwa();
|
|
22566
22771
|
REACT_VENDOR_SPECIFIERS = [
|
|
22567
22772
|
"react-dom/client",
|
|
22568
22773
|
"react-refresh/runtime",
|
|
@@ -22625,8 +22830,8 @@ var init_build = __esm(() => {
|
|
|
22625
22830
|
|
|
22626
22831
|
// src/build/buildEmberVendor.ts
|
|
22627
22832
|
import { mkdirSync as mkdirSync13, existsSync as existsSync28 } from "fs";
|
|
22628
|
-
import { join as
|
|
22629
|
-
import { rm as
|
|
22833
|
+
import { join as join38 } from "path";
|
|
22834
|
+
import { rm as rm10 } from "fs/promises";
|
|
22630
22835
|
var {build: bunBuild8 } = globalThis.Bun;
|
|
22631
22836
|
var toSafeFileName5 = (specifier) => specifier.replace(/^@/, "").replace(/\//g, "_"), generateMacrosShim = () => `// Generated shim for @embroider/macros \u2014 provides minimal runtime
|
|
22632
22837
|
// implementations for macros that would normally be replaced at
|
|
@@ -22677,7 +22882,7 @@ export const importSync = (specifier) => {
|
|
|
22677
22882
|
if (standaloneSpecifiers.has(specifier)) {
|
|
22678
22883
|
return { resolveTo: specifier, specifier };
|
|
22679
22884
|
}
|
|
22680
|
-
const emberInternalPath =
|
|
22885
|
+
const emberInternalPath = join38(cwd2, "node_modules/ember-source/dist/packages", specifier, "index.js");
|
|
22681
22886
|
if (!existsSync28(emberInternalPath)) {
|
|
22682
22887
|
throw new Error(`Ember vendor build: cannot find ${specifier} at ${emberInternalPath}. ` + `Is ember-source installed and at least 6.12?`);
|
|
22683
22888
|
}
|
|
@@ -22709,7 +22914,7 @@ export const importSync = (specifier) => {
|
|
|
22709
22914
|
if (standalonePackages.has(args.path)) {
|
|
22710
22915
|
return;
|
|
22711
22916
|
}
|
|
22712
|
-
const internal =
|
|
22917
|
+
const internal = join38(cwd2, "node_modules/ember-source/dist/packages", args.path, "index.js");
|
|
22713
22918
|
if (existsSync28(internal)) {
|
|
22714
22919
|
return { path: internal };
|
|
22715
22920
|
}
|
|
@@ -22717,16 +22922,16 @@ export const importSync = (specifier) => {
|
|
|
22717
22922
|
});
|
|
22718
22923
|
}
|
|
22719
22924
|
}), buildEmberVendor = async (buildDir, cwd2 = process.cwd()) => {
|
|
22720
|
-
const vendorDir =
|
|
22925
|
+
const vendorDir = join38(buildDir, "ember", "vendor");
|
|
22721
22926
|
mkdirSync13(vendorDir, { recursive: true });
|
|
22722
|
-
const tmpDir =
|
|
22927
|
+
const tmpDir = join38(buildDir, "_ember_vendor_tmp");
|
|
22723
22928
|
mkdirSync13(tmpDir, { recursive: true });
|
|
22724
|
-
const macrosShimPath =
|
|
22929
|
+
const macrosShimPath = join38(tmpDir, "embroider_macros_shim.js");
|
|
22725
22930
|
await Bun.write(macrosShimPath, generateMacrosShim());
|
|
22726
22931
|
const resolutions = REQUIRED_EMBER_SPECIFIERS.map((specifier) => resolveEmberSpecifier(specifier, cwd2));
|
|
22727
22932
|
const entrypoints = await Promise.all(resolutions.map(async (resolution) => {
|
|
22728
22933
|
const safeName = toSafeFileName5(resolution.specifier);
|
|
22729
|
-
const entryPath =
|
|
22934
|
+
const entryPath = join38(tmpDir, `${safeName}.js`);
|
|
22730
22935
|
const source = resolution.specifier === "@embroider/macros" ? `export * from ${JSON.stringify(macrosShimPath)};
|
|
22731
22936
|
` : generateVendorEntrySource2(resolution);
|
|
22732
22937
|
await Bun.write(entryPath, source);
|
|
@@ -22743,7 +22948,7 @@ export const importSync = (specifier) => {
|
|
|
22743
22948
|
target: "browser",
|
|
22744
22949
|
throw: false
|
|
22745
22950
|
});
|
|
22746
|
-
await
|
|
22951
|
+
await rm10(tmpDir, { force: true, recursive: true });
|
|
22747
22952
|
if (!result.success) {
|
|
22748
22953
|
console.warn("\u26A0\uFE0F Ember vendor build had errors:", result.logs);
|
|
22749
22954
|
}
|
|
@@ -23174,6 +23379,7 @@ var init_configResolver = () => {};
|
|
|
23174
23379
|
var createHMRState = (config) => ({
|
|
23175
23380
|
activeFrameworks: new Set,
|
|
23176
23381
|
assetStore: new Map,
|
|
23382
|
+
clientTargets: new Map,
|
|
23177
23383
|
config,
|
|
23178
23384
|
connectedClients: new Set,
|
|
23179
23385
|
debounceTimeout: null,
|
|
@@ -23209,7 +23415,7 @@ var init_clientManager = __esm(() => {
|
|
|
23209
23415
|
|
|
23210
23416
|
// src/dev/pathUtils.ts
|
|
23211
23417
|
import { existsSync as existsSync30, readdirSync as readdirSync6, readFileSync as readFileSync23 } from "fs";
|
|
23212
|
-
import { dirname as
|
|
23418
|
+
import { dirname as dirname21, resolve as resolve29 } from "path";
|
|
23213
23419
|
var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
23214
23420
|
if (shouldIgnorePath(filePath, resolved)) {
|
|
23215
23421
|
return "ignored";
|
|
@@ -23337,10 +23543,10 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
23337
23543
|
refs.push(strMatch[1]);
|
|
23338
23544
|
}
|
|
23339
23545
|
}
|
|
23340
|
-
const componentDir =
|
|
23546
|
+
const componentDir = dirname21(full);
|
|
23341
23547
|
for (const ref of refs) {
|
|
23342
23548
|
const refAbs = normalizePath(resolve29(componentDir, ref));
|
|
23343
|
-
const refDir = normalizePath(
|
|
23549
|
+
const refDir = normalizePath(dirname21(refAbs));
|
|
23344
23550
|
if (refDir === angularRootNormalized || refDir.startsWith(`${angularRootNormalized}/`)) {
|
|
23345
23551
|
continue;
|
|
23346
23552
|
}
|
|
@@ -23476,7 +23682,7 @@ var init_pathUtils = __esm(() => {
|
|
|
23476
23682
|
// src/dev/fileWatcher.ts
|
|
23477
23683
|
import { watch } from "fs";
|
|
23478
23684
|
import { existsSync as existsSync31, readdirSync as readdirSync7, statSync as statSync4 } from "fs";
|
|
23479
|
-
import { dirname as
|
|
23685
|
+
import { dirname as dirname22, join as join39, resolve as resolve30 } from "path";
|
|
23480
23686
|
var safeRemoveFromGraph = (graph, fullPath) => {
|
|
23481
23687
|
try {
|
|
23482
23688
|
removeFileFromGraph(graph, fullPath);
|
|
@@ -23508,7 +23714,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
23508
23714
|
for (const name of entries) {
|
|
23509
23715
|
if (shouldSkipFilename(name, isStylesDir))
|
|
23510
23716
|
continue;
|
|
23511
|
-
const child =
|
|
23717
|
+
const child = join39(eventDir, name).replace(/\\/g, "/");
|
|
23512
23718
|
let st2;
|
|
23513
23719
|
try {
|
|
23514
23720
|
st2 = statSync4(child);
|
|
@@ -23529,7 +23735,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
23529
23735
|
return;
|
|
23530
23736
|
if (shouldSkipFilename(filename, isStylesDir)) {
|
|
23531
23737
|
if (event === "rename") {
|
|
23532
|
-
const eventDir =
|
|
23738
|
+
const eventDir = dirname22(join39(absolutePath, filename)).replace(/\\/g, "/");
|
|
23533
23739
|
atomicRecoveryScan(eventDir);
|
|
23534
23740
|
for (const delay of [25, 100]) {
|
|
23535
23741
|
const timer = setTimeout(() => atomicRecoveryScan(eventDir), delay);
|
|
@@ -23538,7 +23744,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
23538
23744
|
}
|
|
23539
23745
|
return;
|
|
23540
23746
|
}
|
|
23541
|
-
const fullPath =
|
|
23747
|
+
const fullPath = join39(absolutePath, filename).replace(/\\/g, "/");
|
|
23542
23748
|
if (shouldIgnorePath(fullPath, state.resolvedPaths)) {
|
|
23543
23749
|
return;
|
|
23544
23750
|
}
|
|
@@ -23706,7 +23912,7 @@ var init_assetStore = __esm(() => {
|
|
|
23706
23912
|
|
|
23707
23913
|
// src/islands/pageMetadata.ts
|
|
23708
23914
|
import { readFileSync as readFileSync24 } from "fs";
|
|
23709
|
-
import { dirname as
|
|
23915
|
+
import { dirname as dirname23, resolve as resolve32 } from "path";
|
|
23710
23916
|
var pagePatterns, getPageDirs = (config) => [
|
|
23711
23917
|
{ dir: config.angularDirectory, framework: "angular" },
|
|
23712
23918
|
{ dir: config.emberDirectory, framework: "ember" },
|
|
@@ -23726,7 +23932,7 @@ var pagePatterns, getPageDirs = (config) => [
|
|
|
23726
23932
|
const source = definition.buildReference?.source;
|
|
23727
23933
|
if (!source)
|
|
23728
23934
|
continue;
|
|
23729
|
-
const resolvedSource = source.startsWith("file://") ? new URL(source).pathname : resolve32(
|
|
23935
|
+
const resolvedSource = source.startsWith("file://") ? new URL(source).pathname : resolve32(dirname23(buildInfo.resolvedRegistryPath), source);
|
|
23730
23936
|
lookup.set(`${definition.framework}:${definition.component}`, resolve32(resolvedSource));
|
|
23731
23937
|
}
|
|
23732
23938
|
return lookup;
|
|
@@ -23991,7 +24197,7 @@ var init_moduleMapper = __esm(() => {
|
|
|
23991
24197
|
|
|
23992
24198
|
// src/utils/spaRouteCss.ts
|
|
23993
24199
|
import { readFile as readFile6 } from "fs/promises";
|
|
23994
|
-
import { dirname as
|
|
24200
|
+
import { dirname as dirname24, isAbsolute as isAbsolute5, resolve as resolve35 } from "path";
|
|
23995
24201
|
var sideManifestCache, readSideManifest = async (sideManifestPath) => {
|
|
23996
24202
|
const cached = sideManifestCache.get(sideManifestPath);
|
|
23997
24203
|
if (cached !== undefined)
|
|
@@ -24029,7 +24235,7 @@ var sideManifestCache, readSideManifest = async (sideManifestPath) => {
|
|
|
24029
24235
|
}, readChildCss = async (cssPath, sideManifestPath) => {
|
|
24030
24236
|
if (!cssPath)
|
|
24031
24237
|
return "";
|
|
24032
|
-
const resolvedCssPath = isAbsolute5(cssPath) ? cssPath : resolve35(
|
|
24238
|
+
const resolvedCssPath = isAbsolute5(cssPath) ? cssPath : resolve35(dirname24(sideManifestPath), cssPath);
|
|
24033
24239
|
const cached = childCssCache.get(resolvedCssPath);
|
|
24034
24240
|
if (cached !== undefined)
|
|
24035
24241
|
return cached;
|
|
@@ -24113,7 +24319,7 @@ __export(exports_resolveOwningComponents, {
|
|
|
24113
24319
|
invalidateResourceIndex: () => invalidateResourceIndex
|
|
24114
24320
|
});
|
|
24115
24321
|
import { readdirSync as readdirSync8, readFileSync as readFileSync26, statSync as statSync5 } from "fs";
|
|
24116
|
-
import { dirname as
|
|
24322
|
+
import { dirname as dirname25, extname as extname11, join as join40, resolve as resolve36 } from "path";
|
|
24117
24323
|
import ts18 from "typescript";
|
|
24118
24324
|
var ENTITY_DECORATORS, isAngularSourceFile = (file4) => file4.endsWith(".ts") || file4.endsWith(".tsx"), walkAngularSourceFiles = (root) => {
|
|
24119
24325
|
const out = [];
|
|
@@ -24128,7 +24334,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file4) => file4.endsWith(".ts") ||
|
|
|
24128
24334
|
if (entry.name.startsWith(".") || entry.name === "node_modules") {
|
|
24129
24335
|
continue;
|
|
24130
24336
|
}
|
|
24131
|
-
const full =
|
|
24337
|
+
const full = join40(dir, entry.name);
|
|
24132
24338
|
if (entry.isDirectory()) {
|
|
24133
24339
|
visit(full);
|
|
24134
24340
|
} else if (entry.isFile() && isAngularSourceFile(entry.name)) {
|
|
@@ -24267,7 +24473,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file4) => file4.endsWith(".ts") ||
|
|
|
24267
24473
|
return null;
|
|
24268
24474
|
}
|
|
24269
24475
|
const sourceFile = ts18.createSourceFile(childFilePath, source, ts18.ScriptTarget.ES2022, true, ts18.ScriptKind.TS);
|
|
24270
|
-
const childDir =
|
|
24476
|
+
const childDir = dirname25(childFilePath);
|
|
24271
24477
|
for (const stmt of sourceFile.statements) {
|
|
24272
24478
|
if (!ts18.isImportDeclaration(stmt))
|
|
24273
24479
|
continue;
|
|
@@ -24324,7 +24530,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file4) => file4.endsWith(".ts") ||
|
|
|
24324
24530
|
const parentFile = new Map;
|
|
24325
24531
|
for (const tsPath of walkAngularSourceFiles(userAngularRoot)) {
|
|
24326
24532
|
const classes = parseDecoratedClasses(tsPath);
|
|
24327
|
-
const componentDir =
|
|
24533
|
+
const componentDir = dirname25(tsPath);
|
|
24328
24534
|
for (const cls of classes) {
|
|
24329
24535
|
const entity = {
|
|
24330
24536
|
className: cls.className,
|
|
@@ -24460,6 +24666,7 @@ var MAX_RETAINED_HMR_UPDATES = 100, normalizedHmrTarget = (value) => {
|
|
|
24460
24666
|
});
|
|
24461
24667
|
clientsToRemove.forEach((client) => {
|
|
24462
24668
|
state.connectedClients.delete(client);
|
|
24669
|
+
state.clientTargets.delete(client);
|
|
24463
24670
|
});
|
|
24464
24671
|
}, handleClientConnect = (state, client, manifest) => {
|
|
24465
24672
|
state.connectedClients.add(client);
|
|
@@ -24500,6 +24707,7 @@ var MAX_RETAINED_HMR_UPDATES = 100, normalizedHmrTarget = (value) => {
|
|
|
24500
24707
|
}
|
|
24501
24708
|
}, handleClientDisconnect = (state, client) => {
|
|
24502
24709
|
state.connectedClients.delete(client);
|
|
24710
|
+
state.clientTargets.delete(client);
|
|
24503
24711
|
}, parseJsonSafe = (raw) => JSON.parse(raw), parseMessage = (message) => {
|
|
24504
24712
|
if (typeof message === "string") {
|
|
24505
24713
|
return parseJsonSafe(message);
|
|
@@ -24529,11 +24737,13 @@ var MAX_RETAINED_HMR_UPDATES = 100, normalizedHmrTarget = (value) => {
|
|
|
24529
24737
|
case "request-rebuild":
|
|
24530
24738
|
break;
|
|
24531
24739
|
case "ready":
|
|
24740
|
+
state.clientTargets.set(client, normalizedHmrTarget(data.target));
|
|
24532
24741
|
if (data.framework) {
|
|
24533
24742
|
state.activeFrameworks.add(data.framework);
|
|
24534
24743
|
}
|
|
24535
24744
|
break;
|
|
24536
24745
|
case "hmr-timing": {
|
|
24746
|
+
state.clientTargets.set(client, normalizedHmrTarget(data.target));
|
|
24537
24747
|
const update = typeof data.updateId === "number" ? state.hmrUpdates.get(data.updateId) : undefined;
|
|
24538
24748
|
logHmrClientUpdate(update?.path ?? state.lastHmrPath ?? "", update?.framework ?? state.lastHmrFramework, data.duration, normalizedHmrTarget(data.target), data.serverMs, data.clientMs, data.outcome, data.kind);
|
|
24539
24749
|
sendTelemetryEvent("hmr:client-applied", {
|
|
@@ -24703,7 +24913,7 @@ __export(exports_moduleServer, {
|
|
|
24703
24913
|
SRC_URL_PREFIX: () => SRC_URL_PREFIX
|
|
24704
24914
|
});
|
|
24705
24915
|
import { existsSync as existsSync32, readFileSync as readFileSync27, realpathSync as realpathSync3, statSync as statSync6 } from "fs";
|
|
24706
|
-
import { basename as basename16, dirname as
|
|
24916
|
+
import { basename as basename16, dirname as dirname26, extname as extname12, join as join41, resolve as resolve38, relative as relative16 } from "path";
|
|
24707
24917
|
var SRC_PREFIX = "/@src/", BROWSER_DEFINE, jsTranspiler2, legacyDecoratorTsconfig, tsTranspiler2, tsxTranspiler, TRANSPILABLE, ALL_EXPORTS_RE, STRING_CONTENTS_RE, preserveTypeExports = (originalSource, transpiled, valueExports) => {
|
|
24708
24918
|
const codeOnly = originalSource.replace(STRING_CONTENTS_RE, '""');
|
|
24709
24919
|
const allExports = [];
|
|
@@ -24786,7 +24996,7 @@ ${stubs}
|
|
|
24786
24996
|
const subpath = isScoped ? parts.slice(2).join("/") : parts.slice(1).join("/");
|
|
24787
24997
|
if (!subpath) {
|
|
24788
24998
|
const pkgDir = resolve38(projectRoot, "node_modules", packageName ?? "");
|
|
24789
|
-
const pkgJsonPath =
|
|
24999
|
+
const pkgJsonPath = join41(pkgDir, "package.json");
|
|
24790
25000
|
if (existsSync32(pkgJsonPath)) {
|
|
24791
25001
|
const pkg = JSON.parse(readFileSync27(pkgJsonPath, "utf-8"));
|
|
24792
25002
|
const esmEntry = typeof pkg.module === "string" && pkg.module || typeof pkg.browser === "string" && pkg.browser;
|
|
@@ -24829,7 +25039,7 @@ ${stubs}
|
|
|
24829
25039
|
};
|
|
24830
25040
|
result = result.replace(/^((?:import\s+[^"'`;]+?\s+from|export\s+[^"'`;]+?\s+from|import)\s*["'])([^"'./][^"']*)(["'])/gm, stubReplace);
|
|
24831
25041
|
result = result.replace(/(import\s*\(\s*["'])([^"'./][^"']*)(["']\s*\))/g, stubReplace);
|
|
24832
|
-
const fileDir =
|
|
25042
|
+
const fileDir = dirname26(filePath);
|
|
24833
25043
|
result = result.replace(/(from\s*["'])(\.\.?\/[^"']+)(["'])/g, (_match, prefix, relPath, suffix) => isRealImport(relPath) ? `${prefix}${resolveRelativeImport(relPath, fileDir, projectRoot, IMPORT_EXTENSIONS)}${suffix}` : _match);
|
|
24834
25044
|
result = result.replace(/(import\s*\(\s*["'])(\.\.?\/[^"']+)(["']\s*\))/g, (_match, prefix, relPath, suffix) => isRealImport(relPath) ? `${prefix}${resolveRelativeImport(relPath, fileDir, projectRoot, IMPORT_EXTENSIONS)}${suffix}` : _match);
|
|
24835
25045
|
result = result.replace(/(import\s*["'])(\.\.?\/[^"']+)(["']\s*;?)/g, (_match, prefix, relPath, suffix) => isRealImport(relPath) ? `${prefix}${resolveRelativeImport(relPath, fileDir, projectRoot, SIDE_EFFECT_EXTENSIONS)}${suffix}` : _match);
|
|
@@ -25652,7 +25862,7 @@ __export(exports_hmrCompiler, {
|
|
|
25652
25862
|
getApplyMetadataModule: () => getApplyMetadataModule,
|
|
25653
25863
|
encodeHmrComponentId: () => encodeHmrComponentId
|
|
25654
25864
|
});
|
|
25655
|
-
import { dirname as
|
|
25865
|
+
import { dirname as dirname27, relative as relative17, resolve as resolve39 } from "path";
|
|
25656
25866
|
import { performance as performance2 } from "perf_hooks";
|
|
25657
25867
|
var encodeHmrComponentId = (absoluteFilePath, className) => {
|
|
25658
25868
|
const projectRel = relative17(process.cwd(), absoluteFilePath).replace(/\\/g, "/");
|
|
@@ -25675,7 +25885,7 @@ var encodeHmrComponentId = (absoluteFilePath, className) => {
|
|
|
25675
25885
|
const { resolveOwningComponents: resolveOwningComponents2 } = await Promise.resolve().then(() => (init_resolveOwningComponents(), exports_resolveOwningComponents));
|
|
25676
25886
|
const owners = resolveOwningComponents2({
|
|
25677
25887
|
changedFilePath: componentFilePath,
|
|
25678
|
-
userAngularRoot:
|
|
25888
|
+
userAngularRoot: dirname27(componentFilePath)
|
|
25679
25889
|
});
|
|
25680
25890
|
const owner = owners.find((o3) => o3.className === className);
|
|
25681
25891
|
const kind = owner?.kind ?? "component";
|
|
@@ -25929,9 +26139,9 @@ var init_simpleHTMXHMR = () => {};
|
|
|
25929
26139
|
import { existsSync as existsSync33, readdirSync as readdirSync9, rmSync as rmSync3 } from "fs";
|
|
25930
26140
|
import {
|
|
25931
26141
|
basename as basename17,
|
|
25932
|
-
dirname as
|
|
26142
|
+
dirname as dirname28,
|
|
25933
26143
|
isAbsolute as isAbsolute6,
|
|
25934
|
-
join as
|
|
26144
|
+
join as join42,
|
|
25935
26145
|
relative as relative18,
|
|
25936
26146
|
resolve as resolvePath,
|
|
25937
26147
|
sep as sep4
|
|
@@ -26058,8 +26268,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
26058
26268
|
const relJs = `${rel.slice(0, -ext[0].length)}.js`;
|
|
26059
26269
|
const generatedDir = getFrameworkGeneratedDir(framework, cwd2);
|
|
26060
26270
|
for (const candidate of [
|
|
26061
|
-
|
|
26062
|
-
`${
|
|
26271
|
+
join42(generatedDir, relJs),
|
|
26272
|
+
`${join42(generatedDir, relJs)}.map`
|
|
26063
26273
|
]) {
|
|
26064
26274
|
try {
|
|
26065
26275
|
rmSync3(candidate, { force: true });
|
|
@@ -26293,8 +26503,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
26293
26503
|
const relFromDir = normalizedSource.slice(normalizedDir.length + 1);
|
|
26294
26504
|
const { buildDir } = state.resolvedPaths;
|
|
26295
26505
|
const destPath = resolvePath(buildDir, urlPrefix ? `${urlPrefix}/${relFromDir}` : relFromDir);
|
|
26296
|
-
const { mkdir:
|
|
26297
|
-
await
|
|
26506
|
+
const { mkdir: mkdir9, copyFile, readFile: readFile7 } = await import("fs/promises");
|
|
26507
|
+
await mkdir9(dirname28(destPath), { recursive: true });
|
|
26298
26508
|
await copyFile(absSource, destPath);
|
|
26299
26509
|
const bytes = await readFile7(destPath);
|
|
26300
26510
|
const webPath = urlPrefix ? `/${urlPrefix}/${relFromDir}` : `/${relFromDir}`;
|
|
@@ -26475,7 +26685,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
26475
26685
|
const keepStemsByDir = new Map;
|
|
26476
26686
|
const prefixByDir = new Map;
|
|
26477
26687
|
for (const artifact of freshOutputs) {
|
|
26478
|
-
const dir =
|
|
26688
|
+
const dir = dirname28(artifact.path);
|
|
26479
26689
|
const name = basename17(artifact.path);
|
|
26480
26690
|
const [prefix] = name.split(".");
|
|
26481
26691
|
if (!prefix)
|
|
@@ -26961,7 +27171,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
26961
27171
|
const entries = await readdir5(dir, { withFileTypes: true });
|
|
26962
27172
|
const files = [];
|
|
26963
27173
|
for (const entry of entries) {
|
|
26964
|
-
const full =
|
|
27174
|
+
const full = join42(dir, entry.name);
|
|
26965
27175
|
if (entry.isDirectory()) {
|
|
26966
27176
|
files.push(...await walk(full));
|
|
26967
27177
|
} else if (entry.isFile() && entry.name.endsWith(".ts") && !entry.name.endsWith(".d.ts")) {
|
|
@@ -27521,7 +27731,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
27521
27731
|
} = await compileVue2(vueFiles, vueDir, true, getStyleTransformConfig(state.config));
|
|
27522
27732
|
const serverEntries = [...vueServerPaths];
|
|
27523
27733
|
const clientEntries = [...vueIndexPaths, ...vueClientPaths];
|
|
27524
|
-
const cssOutDir =
|
|
27734
|
+
const cssOutDir = join42(buildDir, state.resolvedPaths.assetsDir ? basename17(state.resolvedPaths.assetsDir) : "assets", "css");
|
|
27525
27735
|
const { serverRoot, serverOutDir } = await computeServerOutPaths(state.resolvedPaths, "vue");
|
|
27526
27736
|
const serverExternals = await getServerBundleExternals();
|
|
27527
27737
|
const clientVendorPaths = await getClientVendorPaths();
|
|
@@ -27733,7 +27943,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
27733
27943
|
});
|
|
27734
27944
|
});
|
|
27735
27945
|
return allModuleUpdates;
|
|
27736
|
-
}, handleReactHMR = (state, affectedFrameworks, filesToRebuild, manifest, duration) => {
|
|
27946
|
+
}, handleReactHMR = async (state, affectedFrameworks, filesToRebuild, manifest, duration) => {
|
|
27737
27947
|
if (!affectedFrameworks.includes("react") || !state.resolvedPaths.reactDir) {
|
|
27738
27948
|
return;
|
|
27739
27949
|
}
|
|
@@ -27745,14 +27955,21 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
27745
27955
|
const sourceFiles = reactPageFiles.length > 0 ? reactPageFiles : reactFiles;
|
|
27746
27956
|
const [primarySource] = sourceFiles;
|
|
27747
27957
|
try {
|
|
27748
|
-
const
|
|
27749
|
-
|
|
27958
|
+
const {
|
|
27959
|
+
isReactFastRefreshSupported: isReactFastRefreshSupported2,
|
|
27960
|
+
warnIfReactFastRefreshUnsupported: warnIfReactFastRefreshUnsupported2
|
|
27961
|
+
} = await Promise.resolve().then(() => (init_moduleServer(), exports_moduleServer));
|
|
27962
|
+
warnIfReactFastRefreshUnsupported2();
|
|
27963
|
+
await handleReactModuleServerPath(state, reactFiles, Date.now() - duration, isReactFastRefreshSupported2(), () => {
|
|
27964
|
+
return;
|
|
27965
|
+
});
|
|
27966
|
+
} catch (err) {
|
|
27750
27967
|
logHmrUpdate(primarySource ?? reactFiles[0] ?? "", "react", duration);
|
|
27751
27968
|
broadcastToClients(state, {
|
|
27752
27969
|
data: {
|
|
27753
27970
|
framework: "react",
|
|
27754
|
-
hasComponentChanges,
|
|
27755
|
-
hasCSSChanges,
|
|
27971
|
+
hasComponentChanges: true,
|
|
27972
|
+
hasCSSChanges: reactFiles.some(isStylePath),
|
|
27756
27973
|
manifest,
|
|
27757
27974
|
primarySource,
|
|
27758
27975
|
serverDuration: duration,
|
|
@@ -27760,7 +27977,6 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
27760
27977
|
},
|
|
27761
27978
|
type: "react-update"
|
|
27762
27979
|
});
|
|
27763
|
-
} catch (err) {
|
|
27764
27980
|
console.error("[hmr] react live update failed:", err instanceof Error ? err.message : err);
|
|
27765
27981
|
sendTelemetryEvent("hmr:error", {
|
|
27766
27982
|
framework: "react",
|
|
@@ -27791,7 +28007,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
27791
28007
|
if (!buildReference?.source) {
|
|
27792
28008
|
return;
|
|
27793
28009
|
}
|
|
27794
|
-
const sourcePath = buildReference.source.startsWith("file://") ? new URL(buildReference.source).pathname : resolvePath(
|
|
28010
|
+
const sourcePath = buildReference.source.startsWith("file://") ? new URL(buildReference.source).pathname : resolvePath(dirname28(buildInfo.resolvedRegistryPath), buildReference.source);
|
|
27795
28011
|
islandFiles.add(resolvePath(sourcePath));
|
|
27796
28012
|
}, resolveIslandSourceFiles = async (config) => {
|
|
27797
28013
|
const registryPath = config.islands?.registry;
|
|
@@ -27819,8 +28035,14 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
27819
28035
|
}
|
|
27820
28036
|
setCurrentPageIslandMetadata(await loadPageIslandMetadata(config));
|
|
27821
28037
|
const affectedPages = filesToRebuild.flatMap((file4) => getPagesUsingIslandSource(file4));
|
|
28038
|
+
if (affectedPages.length === 0)
|
|
28039
|
+
return true;
|
|
28040
|
+
const affectedFrameworks = [
|
|
28041
|
+
...new Set(affectedPages.map((page) => detectFramework(page, state.resolvedPaths)).filter((framework) => framework !== "ignored"))
|
|
28042
|
+
];
|
|
27822
28043
|
broadcastToClients(state, {
|
|
27823
28044
|
data: {
|
|
28045
|
+
affectedFrameworks,
|
|
27824
28046
|
affectedPages,
|
|
27825
28047
|
framework: "islands",
|
|
27826
28048
|
manifest,
|
|
@@ -28212,7 +28434,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
28212
28434
|
}
|
|
28213
28435
|
}, handleFullBuildHMR = async (state, config, affectedFrameworks, filesToRebuild, manifest, duration) => {
|
|
28214
28436
|
const allModuleUpdates = collectAllModuleUpdates(affectedFrameworks, filesToRebuild, manifest, state);
|
|
28215
|
-
handleReactHMR(state, affectedFrameworks, filesToRebuild, manifest, duration);
|
|
28437
|
+
await handleReactHMR(state, affectedFrameworks, filesToRebuild, manifest, duration);
|
|
28216
28438
|
handleHTMLScriptHMR(state, filesToRebuild, manifest, duration);
|
|
28217
28439
|
await handleHTMLPageHMR(state, config, filesToRebuild, manifest, duration);
|
|
28218
28440
|
await handleVueHMR(state, config, filesToRebuild, manifest, duration);
|
|
@@ -28439,7 +28661,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
28439
28661
|
message: "Rebuild completed successfully",
|
|
28440
28662
|
type: "rebuild-complete"
|
|
28441
28663
|
});
|
|
28442
|
-
|
|
28664
|
+
const hasDedicatedStyleUpdate = affectedFrameworks.some((framework) => framework === "styles" || framework === "assets");
|
|
28665
|
+
if (config.tailwind && filesToRebuild && filesToRebuild.some(isTailwindCandidate) && !hasDedicatedStyleUpdate) {
|
|
28443
28666
|
try {
|
|
28444
28667
|
const outputPath = resolvePath(state.resolvedPaths.buildDir, config.tailwind.output);
|
|
28445
28668
|
const bytes = await Bun.file(outputPath).bytes();
|
|
@@ -28460,6 +28683,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
28460
28683
|
const hasFilesToRebuild = filesToRebuild && filesToRebuild.length > 0;
|
|
28461
28684
|
const didReloadForIslandChange = hasFilesToRebuild ? await handleIslandSourceReload(state, config, filesToRebuild, manifest, duration) : false;
|
|
28462
28685
|
if (didReloadForIslandChange) {
|
|
28686
|
+
await runFrameworkFastPaths(state, config, affectedFrameworks, filesToRebuild ?? [], startTime, onRebuildComplete);
|
|
28463
28687
|
onRebuildComplete({ hmrState: state, manifest });
|
|
28464
28688
|
return manifest;
|
|
28465
28689
|
}
|
|
@@ -28616,8 +28840,8 @@ __export(exports_buildDepVendor, {
|
|
|
28616
28840
|
});
|
|
28617
28841
|
import { mkdirSync as mkdirSync14 } from "fs";
|
|
28618
28842
|
import { isBuiltin } from "module";
|
|
28619
|
-
import { join as
|
|
28620
|
-
import { rm as
|
|
28843
|
+
import { join as join43 } from "path";
|
|
28844
|
+
import { rm as rm11 } from "fs/promises";
|
|
28621
28845
|
var {build: bunBuild9, Glob: Glob10 } = globalThis.Bun;
|
|
28622
28846
|
var toSafeFileName6 = (specifier) => {
|
|
28623
28847
|
const prefix = specifier.startsWith("@") ? "_" : "";
|
|
@@ -28676,7 +28900,7 @@ var toSafeFileName6 = (specifier) => {
|
|
|
28676
28900
|
};
|
|
28677
28901
|
}, collectBareImportsFromFile = async (entryPath, transpiler6, maxDepth = 8) => {
|
|
28678
28902
|
const { readFileSync: readFileSync28 } = await import("fs");
|
|
28679
|
-
const { dirname:
|
|
28903
|
+
const { dirname: dirname29 } = await import("path");
|
|
28680
28904
|
const seenFiles = new Set;
|
|
28681
28905
|
const bareOut = new Set;
|
|
28682
28906
|
const queue = [
|
|
@@ -28701,7 +28925,7 @@ var toSafeFileName6 = (specifier) => {
|
|
|
28701
28925
|
} catch {
|
|
28702
28926
|
continue;
|
|
28703
28927
|
}
|
|
28704
|
-
const fromDir =
|
|
28928
|
+
const fromDir = dirname29(path);
|
|
28705
28929
|
for (const imp of imports) {
|
|
28706
28930
|
const child = imp.path;
|
|
28707
28931
|
if (child.startsWith(".") || child.startsWith("/")) {
|
|
@@ -28765,7 +28989,7 @@ var toSafeFileName6 = (specifier) => {
|
|
|
28765
28989
|
}), buildDepVendorPass = async (specifiers, vendorDir, tmpDir) => {
|
|
28766
28990
|
const entries = await Promise.all(specifiers.map(async (specifier) => {
|
|
28767
28991
|
const safeName = toSafeFileName6(specifier);
|
|
28768
|
-
const entryPath =
|
|
28992
|
+
const entryPath = join43(tmpDir, `${safeName}.ts`);
|
|
28769
28993
|
await Bun.write(entryPath, await generateVendorEntrySource(specifier));
|
|
28770
28994
|
return { entryPath, specifier };
|
|
28771
28995
|
}));
|
|
@@ -28856,9 +29080,9 @@ var toSafeFileName6 = (specifier) => {
|
|
|
28856
29080
|
const { dep: initialSpecs, framework: frameworkRoots } = await scanBareImports(directories);
|
|
28857
29081
|
if (initialSpecs.length === 0 && frameworkRoots.length === 0)
|
|
28858
29082
|
return {};
|
|
28859
|
-
const vendorDir =
|
|
29083
|
+
const vendorDir = join43(buildDir, "vendor");
|
|
28860
29084
|
mkdirSync14(vendorDir, { recursive: true });
|
|
28861
|
-
const tmpDir =
|
|
29085
|
+
const tmpDir = join43(buildDir, "_dep_vendor_tmp");
|
|
28862
29086
|
mkdirSync14(tmpDir, { recursive: true });
|
|
28863
29087
|
const allSpecs = new Set(initialSpecs);
|
|
28864
29088
|
const alreadyScanned = new Set;
|
|
@@ -28878,7 +29102,7 @@ var toSafeFileName6 = (specifier) => {
|
|
|
28878
29102
|
if (!success) {
|
|
28879
29103
|
console.warn("\u26A0\uFE0F Dependency vendor build had errors:", result.logs);
|
|
28880
29104
|
}
|
|
28881
|
-
await
|
|
29105
|
+
await rm11(tmpDir, { force: true, recursive: true });
|
|
28882
29106
|
const paths = {};
|
|
28883
29107
|
for (const specifier of allSpecs) {
|
|
28884
29108
|
paths[specifier] = `/vendor/${toSafeFileName6(specifier)}.js`;
|
|
@@ -29149,6 +29373,9 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
29149
29373
|
await handleCachedReload();
|
|
29150
29374
|
return cached;
|
|
29151
29375
|
}
|
|
29376
|
+
if (config.reactDirectory && !globalThis.__reactModuleRef) {
|
|
29377
|
+
globalThis.__reactModuleRef = await import("react");
|
|
29378
|
+
}
|
|
29152
29379
|
const startupSteps = [];
|
|
29153
29380
|
const recordStep = (label, startedAt) => {
|
|
29154
29381
|
const durationMs = performance.now() - startedAt;
|
|
@@ -29324,9 +29551,6 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
29324
29551
|
config.vueDirectory ? loadVendorFiles(state.assetStore, vueVendorDir, "vue") : Promise.resolve(),
|
|
29325
29552
|
loadVendorFiles(state.assetStore, depVendorDir, "vendor")
|
|
29326
29553
|
]);
|
|
29327
|
-
if (config.reactDirectory && !globalThis.__reactModuleRef) {
|
|
29328
|
-
globalThis.__reactModuleRef = await import("react");
|
|
29329
|
-
}
|
|
29330
29554
|
recordStep("load vendor files", stepStartedAt);
|
|
29331
29555
|
stepStartedAt = performance.now();
|
|
29332
29556
|
const { warmCompilers: warmCompilers2 } = await Promise.resolve().then(() => (init_moduleServer(), exports_moduleServer));
|
|
@@ -29398,5 +29622,5 @@ export {
|
|
|
29398
29622
|
build
|
|
29399
29623
|
};
|
|
29400
29624
|
|
|
29401
|
-
//# debugId=
|
|
29625
|
+
//# debugId=E8337E5C2B5EAADD64756E2164756E21
|
|
29402
29626
|
//# sourceMappingURL=build.js.map
|