@absolutejs/absolute 0.20.0-beta.0 → 0.20.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/angular/components/core/streamingSlotRegistrar.js +1 -1
- package/dist/angular/components/core/streamingSlotRegistry.js +2 -2
- package/dist/angular/index.js +14 -1
- package/dist/angular/index.js.map +3 -3
- package/dist/angular/server.js +14 -1
- package/dist/angular/server.js.map +3 -3
- package/dist/build.js +206 -47
- package/dist/build.js.map +20 -19
- package/dist/cli/config/server.js +2 -2
- package/dist/cli/index.js +16506 -11326
- package/dist/dev/client/cssUtils.ts +98 -41
- package/dist/dev/client/handlers/html.ts +75 -15
- package/dist/dev/client/handlers/htmx.ts +43 -8
- package/dist/dev/client/handlers/react.ts +114 -32
- package/dist/dev/client/handlers/rebuild.ts +28 -8
- package/dist/dev/client/handlers/svelte.ts +33 -50
- package/dist/dev/client/handlers/vue.ts +36 -45
- package/dist/dev/client/hmrClient.ts +38 -6
- package/dist/dev/client/hmrTiming.ts +141 -0
- package/dist/dev/serverBootstrap.js +20 -11
- package/dist/index.js +953 -423
- package/dist/index.js.map +27 -23
- package/dist/mobile/browser.js.map +1 -1
- package/dist/mobile/index.js +2667 -260
- package/dist/mobile/index.js.map +27 -7
- package/dist/react/index.js +16 -3
- package/dist/react/index.js.map +4 -4
- package/dist/react/jsxDevRuntimeCompat.js +22 -2
- package/dist/react/jsxDevRuntimeCompat.js.map +5 -4
- package/dist/react/jsxRuntimeCompat.js +90 -0
- package/dist/react/jsxRuntimeCompat.js.map +10 -0
- package/dist/react/server.js +16 -3
- package/dist/react/server.js.map +4 -4
- package/dist/src/build/compileVue.d.ts +1 -1
- package/dist/src/build/resolveBuildMode.d.ts +7 -0
- package/dist/src/cli/scripts/dev.d.ts +4 -1
- package/dist/src/cli/scripts/mobile.d.ts +1 -0
- package/dist/src/cli/utils.d.ts +2 -2
- package/dist/src/core/build.d.ts +1 -1
- package/dist/src/dev/clientManager.d.ts +7 -0
- package/dist/src/dev/configResolver.d.ts +2 -0
- package/dist/src/dev/moduleMapper.d.ts +1 -1
- package/dist/src/dev/moduleServer.d.ts +2 -1
- package/dist/src/dev/pathUtils.d.ts +1 -1
- package/dist/src/dev/reactComponentClassifier.d.ts +1 -1
- package/dist/src/mobile/androidConformance.d.ts +42 -0
- package/dist/src/mobile/androidEmulatorController.d.ts +100 -0
- package/dist/src/mobile/androidNativeWatcher.d.ts +19 -0
- package/dist/src/mobile/androidRelease.d.ts +51 -0
- package/dist/src/mobile/androidWebView.d.ts +46 -0
- package/dist/src/mobile/associationFiles.d.ts +49 -0
- package/dist/src/mobile/buildMetadata.d.ts +10 -0
- package/dist/src/mobile/buildPipeline.d.ts +8 -0
- package/dist/src/mobile/buildRelease.d.ts +24 -0
- package/dist/src/mobile/capacitorBundle.d.ts +28 -0
- package/dist/src/mobile/capacitorProject.d.ts +9 -0
- package/dist/src/mobile/client.d.ts +1 -1
- package/dist/src/mobile/config.d.ts +17 -0
- package/dist/src/mobile/emulatorDoctor.d.ts +25 -0
- package/dist/src/mobile/emulatorInstaller.d.ts +41 -0
- package/dist/src/mobile/index.d.ts +14 -0
- package/dist/src/mobile/iosRelease.d.ts +61 -0
- package/dist/src/mobile/materializedBundle.d.ts +14 -0
- package/dist/src/mobile/nativeDeepLinks.d.ts +5 -0
- package/dist/src/mobile/releaseArtifact.d.ts +1 -0
- package/dist/src/mobile/releaseDoctor.d.ts +13 -0
- package/dist/src/mobile/releasePublisher.d.ts +130 -0
- package/dist/src/mobile/routeMatcher.d.ts +3 -0
- package/dist/src/mobile/routeMetadataTransform.d.ts +13 -0
- package/dist/src/mobile/shellBootstrap.d.ts +1 -0
- package/dist/src/mobile/transport.d.ts +31 -0
- package/dist/src/react/hooks/useMediaQuery.d.ts +1 -1
- package/dist/src/react/jsxDevRuntimeCompat.d.ts +1 -1
- package/dist/src/react/jsxRuntimeCompat.d.ts +7 -0
- package/dist/src/react/pageHandler.d.ts +3 -0
- package/dist/src/utils/loadConfig.d.ts +1 -0
- package/dist/src/utils/logger.d.ts +2 -0
- package/dist/src/utils/userAgentFunctions.d.ts +1 -1
- package/dist/svelte/index.js +14 -1
- package/dist/svelte/index.js.map +3 -3
- package/dist/svelte/server.js +14 -1
- package/dist/svelte/server.js.map +3 -3
- package/dist/types/build.d.ts +45 -0
- package/dist/types/cli.d.ts +2 -0
- package/dist/types/globals.d.ts +14 -0
- package/dist/types/messages.d.ts +12 -0
- package/dist/vue/index.js +14 -1
- package/dist/vue/index.js.map +3 -3
- package/dist/vue/server.js +14 -1
- package/dist/vue/server.js.map +3 -3
- package/package.json +35 -7
package/dist/index.js
CHANGED
|
@@ -114,13 +114,14 @@ var isValidHMRClientMessage = (data) => {
|
|
|
114
114
|
case "ready":
|
|
115
115
|
case "request-rebuild":
|
|
116
116
|
case "hydration-error":
|
|
117
|
-
case "hmr-timing":
|
|
118
117
|
case "angular:hmr-ack":
|
|
119
118
|
return true;
|
|
119
|
+
case "hmr-timing":
|
|
120
|
+
return typeof Reflect.get(data, "duration") === "number" && Number.isFinite(Reflect.get(data, "duration")) && isOptionalHmrApplyKind(Reflect.get(data, "kind")) && isOptionalHmrApplyOutcome(Reflect.get(data, "outcome"));
|
|
120
121
|
default:
|
|
121
122
|
return false;
|
|
122
123
|
}
|
|
123
|
-
};
|
|
124
|
+
}, isOptionalHmrApplyKind = (value) => value === undefined || value === "component" || value === "css" || value === "full-reload" || value === "html" || value === "htmx" || value === "script", isOptionalHmrApplyOutcome = (value) => value === undefined || value === "applied" || value === "failed" || value === "reloaded";
|
|
124
125
|
|
|
125
126
|
// src/build/stylePreprocessor.ts
|
|
126
127
|
var exports_stylePreprocessor = {};
|
|
@@ -9010,6 +9011,7 @@ var init_loadConfig = __esm(() => {
|
|
|
9010
9011
|
"islands",
|
|
9011
9012
|
"kind",
|
|
9012
9013
|
"mode",
|
|
9014
|
+
"mobile",
|
|
9013
9015
|
"options",
|
|
9014
9016
|
"port",
|
|
9015
9017
|
"postcss",
|
|
@@ -9120,7 +9122,7 @@ var init_sourceMetadata = __esm(() => {
|
|
|
9120
9122
|
|
|
9121
9123
|
// src/islands/pageMetadata.ts
|
|
9122
9124
|
import { readFileSync as readFileSync10 } from "fs";
|
|
9123
|
-
import { dirname as dirname10, resolve as
|
|
9125
|
+
import { dirname as dirname10, resolve as resolve14 } from "path";
|
|
9124
9126
|
var pagePatterns, getPageDirs = (config) => [
|
|
9125
9127
|
{ dir: config.angularDirectory, framework: "angular" },
|
|
9126
9128
|
{ dir: config.emberDirectory, framework: "ember" },
|
|
@@ -9140,15 +9142,15 @@ var pagePatterns, getPageDirs = (config) => [
|
|
|
9140
9142
|
const source = definition.buildReference?.source;
|
|
9141
9143
|
if (!source)
|
|
9142
9144
|
continue;
|
|
9143
|
-
const resolvedSource = source.startsWith("file://") ? new URL(source).pathname :
|
|
9144
|
-
lookup.set(`${definition.framework}:${definition.component}`,
|
|
9145
|
+
const resolvedSource = source.startsWith("file://") ? new URL(source).pathname : resolve14(dirname10(buildInfo.resolvedRegistryPath), source);
|
|
9146
|
+
lookup.set(`${definition.framework}:${definition.component}`, resolve14(resolvedSource));
|
|
9145
9147
|
}
|
|
9146
9148
|
return lookup;
|
|
9147
9149
|
}, getCurrentPageIslandMetadata = () => globalThis.__absolutePageIslandMetadata ?? new Map, metadataUsesSource = (metadata2, target) => metadata2.islands.some((usage) => {
|
|
9148
9150
|
const candidate = usage.source;
|
|
9149
|
-
return candidate ?
|
|
9151
|
+
return candidate ? resolve14(candidate) === target : false;
|
|
9150
9152
|
}), getPagesUsingIslandSource = (sourcePath) => {
|
|
9151
|
-
const target =
|
|
9153
|
+
const target = resolve14(sourcePath);
|
|
9152
9154
|
return [...getCurrentPageIslandMetadata().values()].filter((metadata2) => metadataUsesSource(metadata2, target)).map((metadata2) => metadata2.pagePath);
|
|
9153
9155
|
}, resolveIslandUsages = (islands, islandSourceLookup) => islands.map((usage) => {
|
|
9154
9156
|
const sourcePath = islandSourceLookup.get(`${usage.framework}:${usage.component}`);
|
|
@@ -9160,13 +9162,13 @@ var pagePatterns, getPageDirs = (config) => [
|
|
|
9160
9162
|
const pattern = pagePatterns[entry.framework];
|
|
9161
9163
|
if (!pattern)
|
|
9162
9164
|
return;
|
|
9163
|
-
const files = await scanEntryPoints(
|
|
9165
|
+
const files = await scanEntryPoints(resolve14(entry.dir), pattern);
|
|
9164
9166
|
for (const filePath of files) {
|
|
9165
9167
|
const source = readFileSync10(filePath, "utf-8");
|
|
9166
9168
|
const islands = extractIslandUsagesFromSource(source);
|
|
9167
|
-
pageMetadata.set(
|
|
9169
|
+
pageMetadata.set(resolve14(filePath), {
|
|
9168
9170
|
islands: resolveIslandUsages(islands, islandSourceLookup),
|
|
9169
|
-
pagePath:
|
|
9171
|
+
pagePath: resolve14(filePath)
|
|
9170
9172
|
});
|
|
9171
9173
|
}
|
|
9172
9174
|
}, loadPageIslandMetadata = async (config) => {
|
|
@@ -9665,6 +9667,19 @@ var colors2, frameworkColors, formatPath = (filePath) => {
|
|
|
9665
9667
|
const errorMsg = error instanceof Error ? error.message : error;
|
|
9666
9668
|
const fullMessage = `${colors2.red}error${colors2.reset} ${message}${errorMsg ? `: ${errorMsg}` : ""}`;
|
|
9667
9669
|
console.error(`${timestamp} ${tag} ${fullMessage}`);
|
|
9670
|
+
}, logHmrClientUpdate = (path, framework, duration, target, serverMs, clientMs, outcome = "applied", kind) => {
|
|
9671
|
+
const timestamp = `${colors2.dim}${formatTimestamp()}${colors2.reset}`;
|
|
9672
|
+
const targetLabel = target.startsWith("capacitor-") ? target.slice("capacitor-".length) : target;
|
|
9673
|
+
const tag = `${colors2.cyan}[hmr:${targetLabel}]${colors2.reset}`;
|
|
9674
|
+
const pathColor = framework ? getFrameworkColor(framework) : colors2.white;
|
|
9675
|
+
const breakdown = serverMs === undefined || clientMs === undefined ? "" : `; server ${serverMs}ms, client ${clientMs}ms`;
|
|
9676
|
+
let action = "failed after";
|
|
9677
|
+
if (outcome === "applied")
|
|
9678
|
+
action = "applied in";
|
|
9679
|
+
else if (outcome === "reloaded")
|
|
9680
|
+
action = "falling back to reload after";
|
|
9681
|
+
const kindLabel = kind ? `${kind} ` : "";
|
|
9682
|
+
console.log(`${timestamp} ${tag} ${framework ?? "update"} ${kindLabel}${pathColor}${formatPath(path)}${colors2.reset} ${colors2.dim}${action} ${duration}ms${breakdown}${colors2.reset}`);
|
|
9668
9683
|
}, logHmrUpdate = (path, framework, duration) => {
|
|
9669
9684
|
log("hmr update", { duration, framework, path });
|
|
9670
9685
|
}, logInfo = (message) => {
|
|
@@ -9713,7 +9728,7 @@ __export(exports_devRouteRegistrationCallsite, {
|
|
|
9713
9728
|
getCurrentRouteRegistrationCallsite: () => getCurrentRouteRegistrationCallsite
|
|
9714
9729
|
});
|
|
9715
9730
|
import { AsyncLocalStorage as AsyncLocalStorage3 } from "async_hooks";
|
|
9716
|
-
import { Elysia as
|
|
9731
|
+
import { Elysia as Elysia4 } from "elysia";
|
|
9717
9732
|
var ROUTE_CALLSITE_STORAGE_KEY, ROUTE_CALLSITE_PATCHED_KEY, NODE_ENV_KEY = "NODE_ENV", ROUTE_METHOD_NAMES, PAGE_HANDLER_NAMES, pageHandlerWrappers, isPageHandlerFunction = (value) => typeof value === "function", handlerSourceMentionsPageHelper = (handler) => {
|
|
9718
9733
|
const source = handler.toString();
|
|
9719
9734
|
return PAGE_HANDLER_NAMES.some((name) => source.includes(name));
|
|
@@ -9780,7 +9795,7 @@ var ROUTE_CALLSITE_STORAGE_KEY, ROUTE_CALLSITE_PATCHED_KEY, NODE_ENV_KEY = "NODE
|
|
|
9780
9795
|
if (Reflect.get(globalThis, ROUTE_CALLSITE_PATCHED_KEY) === true) {
|
|
9781
9796
|
return;
|
|
9782
9797
|
}
|
|
9783
|
-
const { prototype } =
|
|
9798
|
+
const { prototype } = Elysia4;
|
|
9784
9799
|
ROUTE_METHOD_NAMES.forEach((methodName) => {
|
|
9785
9800
|
const originalMethod = Reflect.get(prototype, methodName);
|
|
9786
9801
|
if (!isRouteMethod(originalMethod))
|
|
@@ -9903,7 +9918,7 @@ var init_generateManifest = __esm(() => {
|
|
|
9903
9918
|
});
|
|
9904
9919
|
|
|
9905
9920
|
// src/build/verifyAngularCoreUniqueness.ts
|
|
9906
|
-
import { resolve as
|
|
9921
|
+
import { resolve as resolve15 } from "path";
|
|
9907
9922
|
var ANGULAR_CORE_IMPORT_RE, ANGULAR_CORE_PACKAGE_RE, classifySpecifier = (specifier, artifactPath, serverOutDir) => {
|
|
9908
9923
|
if (!ANGULAR_CORE_PACKAGE_RE.test(specifier))
|
|
9909
9924
|
return null;
|
|
@@ -9913,9 +9928,9 @@ var ANGULAR_CORE_IMPORT_RE, ANGULAR_CORE_PACKAGE_RE, classifySpecifier = (specif
|
|
|
9913
9928
|
if (specifier.startsWith("/")) {
|
|
9914
9929
|
absolute = specifier;
|
|
9915
9930
|
} else if (specifier.startsWith(".")) {
|
|
9916
|
-
absolute =
|
|
9931
|
+
absolute = resolve15(artifactPath, "..", specifier);
|
|
9917
9932
|
} else {
|
|
9918
|
-
absolute = serverOutDir ?
|
|
9933
|
+
absolute = serverOutDir ? resolve15(serverOutDir, specifier) : resolve15(artifactPath, "..", specifier);
|
|
9919
9934
|
}
|
|
9920
9935
|
return {
|
|
9921
9936
|
kind: "resolved",
|
|
@@ -9979,19 +9994,19 @@ var init_verifyAngularCoreUniqueness = __esm(() => {
|
|
|
9979
9994
|
|
|
9980
9995
|
// src/build/generateReactIndexes.ts
|
|
9981
9996
|
import { existsSync as existsSync10, mkdirSync as mkdirSync2 } from "fs";
|
|
9982
|
-
import { readdir as readdir4, rm as
|
|
9983
|
-
import { basename as basename4, join as join15, relative as relative6, resolve as
|
|
9997
|
+
import { readdir as readdir4, rm as rm4, writeFile as writeFile4 } from "fs/promises";
|
|
9998
|
+
import { basename as basename4, join as join15, relative as relative6, resolve as resolve16, sep } from "path";
|
|
9984
9999
|
var {Glob: Glob2 } = globalThis.Bun;
|
|
9985
10000
|
var indexContentCache, resolveDevClientDir = () => {
|
|
9986
10001
|
const projectRoot = process.cwd();
|
|
9987
|
-
const fromSource =
|
|
10002
|
+
const fromSource = resolve16(import.meta.dir, "../dev/client");
|
|
9988
10003
|
if (existsSync10(fromSource) && fromSource.startsWith(projectRoot)) {
|
|
9989
10004
|
return fromSource;
|
|
9990
10005
|
}
|
|
9991
|
-
const fromNodeModules =
|
|
10006
|
+
const fromNodeModules = resolve16(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client");
|
|
9992
10007
|
if (existsSync10(fromNodeModules))
|
|
9993
10008
|
return fromNodeModules;
|
|
9994
|
-
return
|
|
10009
|
+
return resolve16(import.meta.dir, "./dev/client");
|
|
9995
10010
|
}, devClientDir, errorOverlayPath, hmrClientPath, refreshSetupPath, reactRefreshRuntimePath, generateReactIndexFiles = async (reactPagesDirectory, reactIndexesDirectory, isDev2 = false) => {
|
|
9996
10011
|
if (!existsSync10(reactIndexesDirectory)) {
|
|
9997
10012
|
mkdirSync2(reactIndexesDirectory, { recursive: true });
|
|
@@ -10014,12 +10029,12 @@ var indexContentCache, resolveDevClientDir = () => {
|
|
|
10014
10029
|
if (staleIndexes.length > 0) {
|
|
10015
10030
|
await Promise.all(staleIndexes.map((indexFile) => {
|
|
10016
10031
|
indexContentCache.delete(join15(reactIndexesDirectory, indexFile));
|
|
10017
|
-
return
|
|
10032
|
+
return rm4(join15(reactIndexesDirectory, indexFile), {
|
|
10018
10033
|
force: true
|
|
10019
10034
|
});
|
|
10020
10035
|
}));
|
|
10021
10036
|
}
|
|
10022
|
-
const pagesRelPath = relative6(
|
|
10037
|
+
const pagesRelPath = relative6(resolve16(reactIndexesDirectory), resolve16(reactPagesDirectory)).split(sep).join("/");
|
|
10023
10038
|
const promises = files.map(async (file2) => {
|
|
10024
10039
|
const fileName = basename4(file2);
|
|
10025
10040
|
const componentName = fileName.split(".")[0];
|
|
@@ -10205,6 +10220,22 @@ var indexContentCache, resolveDevClientDir = () => {
|
|
|
10205
10220
|
` throw new Error('React root container not found: document is null');`,
|
|
10206
10221
|
`}
|
|
10207
10222
|
`,
|
|
10223
|
+
...isDev2 ? [
|
|
10224
|
+
`// Stock Bun cannot emit Fast Refresh registrations yet. Give the dev client`,
|
|
10225
|
+
`// a deterministic remount path that still imports only the changed module.`,
|
|
10226
|
+
`window.__ABS_REACT_REMOUNT__ = (nextModule) => {`,
|
|
10227
|
+
` const NextPageComponent = resolvePageComponent(nextModule, ['default', '${pascalComponentName}', '${componentName}']);`,
|
|
10228
|
+
` const element = createElement(ErrorBoundary, null, createElement(NextPageComponent, mergedProps));`,
|
|
10229
|
+
` if (window.__REACT_ROOT__) {`,
|
|
10230
|
+
` window.__REACT_ROOT__.render(element);`,
|
|
10231
|
+
` return;`,
|
|
10232
|
+
` }`,
|
|
10233
|
+
` const nextRoot = createRoot(container);`,
|
|
10234
|
+
` nextRoot.render(element);`,
|
|
10235
|
+
` window.__REACT_ROOT__ = nextRoot;`,
|
|
10236
|
+
`};
|
|
10237
|
+
`
|
|
10238
|
+
] : [],
|
|
10208
10239
|
`// Guard: only hydrate on first load. During HMR re-imports, skip hydration`,
|
|
10209
10240
|
`// so React Fast Refresh can swap components in-place and preserve state.`,
|
|
10210
10241
|
`if (!window.__REACT_ROOT__) {`,
|
|
@@ -10294,7 +10325,7 @@ var indexContentCache, resolveDevClientDir = () => {
|
|
|
10294
10325
|
`
|
|
10295
10326
|
// Pre-warm: import the page module from the module server`,
|
|
10296
10327
|
`// immediately so the browser caches all /@src/ URLs.`,
|
|
10297
|
-
`import('/@src/${relative6(process.cwd(),
|
|
10328
|
+
`import('/@src/${relative6(process.cwd(), resolve16(reactPagesDirectory, `${componentName}.tsx`)).replace(/\\/g, "/")}').catch(() => {});`
|
|
10298
10329
|
] : []
|
|
10299
10330
|
].join(`
|
|
10300
10331
|
`);
|
|
@@ -10306,7 +10337,7 @@ var indexContentCache, resolveDevClientDir = () => {
|
|
|
10306
10337
|
return;
|
|
10307
10338
|
}
|
|
10308
10339
|
indexContentCache.set(indexPath, contentHash);
|
|
10309
|
-
await
|
|
10340
|
+
await writeFile4(indexPath, content);
|
|
10310
10341
|
});
|
|
10311
10342
|
await Promise.all(promises);
|
|
10312
10343
|
if (!isDev2) {
|
|
@@ -10314,7 +10345,7 @@ var indexContentCache, resolveDevClientDir = () => {
|
|
|
10314
10345
|
}
|
|
10315
10346
|
const refreshPath = join15(reactIndexesDirectory, "_refresh.tsx");
|
|
10316
10347
|
if (!existsSync10(refreshPath)) {
|
|
10317
|
-
await
|
|
10348
|
+
await writeFile4(refreshPath, `import '${refreshSetupPath}';
|
|
10318
10349
|
import 'react';
|
|
10319
10350
|
import 'react-dom/client';
|
|
10320
10351
|
`);
|
|
@@ -10442,8 +10473,8 @@ var init_scanConventions = __esm(() => {
|
|
|
10442
10473
|
});
|
|
10443
10474
|
|
|
10444
10475
|
// src/build/spaSideManifests.ts
|
|
10445
|
-
import { writeFile as
|
|
10446
|
-
import { basename as basename6, dirname as dirname11, relative as relative7, resolve as
|
|
10476
|
+
import { writeFile as writeFile5 } from "fs/promises";
|
|
10477
|
+
import { basename as basename6, dirname as dirname11, relative as relative7, resolve as resolve17 } from "path";
|
|
10447
10478
|
var writeSpaSideManifests = async (spaRoutesBySource, resolveServerJsPath) => {
|
|
10448
10479
|
const manifestEntries = {};
|
|
10449
10480
|
await Promise.all([...spaRoutesBySource.entries()].map(async ([source, routes]) => {
|
|
@@ -10453,7 +10484,7 @@ var writeSpaSideManifests = async (spaRoutesBySource, resolveServerJsPath) => {
|
|
|
10453
10484
|
return;
|
|
10454
10485
|
const sourceDir = dirname11(source);
|
|
10455
10486
|
const entries = routes.flatMap(({ path, importPath }) => {
|
|
10456
|
-
const childSourcePath =
|
|
10487
|
+
const childSourcePath = resolve17(sourceDir, importPath);
|
|
10457
10488
|
const childName = basename6(childSourcePath, ".vue");
|
|
10458
10489
|
const childJsPath = resolveServerJsPath(childName);
|
|
10459
10490
|
if (!childJsPath)
|
|
@@ -10465,7 +10496,7 @@ var writeSpaSideManifests = async (spaRoutesBySource, resolveServerJsPath) => {
|
|
|
10465
10496
|
if (entries.length === 0)
|
|
10466
10497
|
return;
|
|
10467
10498
|
const sideManifestPath = parentJsPath.replace(/\.js$/, ".spa.json");
|
|
10468
|
-
await
|
|
10499
|
+
await writeFile5(sideManifestPath, JSON.stringify(entries));
|
|
10469
10500
|
manifestEntries[`${parentName}SpaManifest`] = sideManifestPath;
|
|
10470
10501
|
}));
|
|
10471
10502
|
return manifestEntries;
|
|
@@ -11701,7 +11732,7 @@ var init_scanCssEntryPoints = __esm(() => {
|
|
|
11701
11732
|
|
|
11702
11733
|
// src/utils/imageProcessing.ts
|
|
11703
11734
|
import { existsSync as existsSync17, mkdirSync as mkdirSync3, readFileSync as readFileSync12, writeFileSync as writeFileSync4 } from "fs";
|
|
11704
|
-
import { join as join21, resolve as
|
|
11735
|
+
import { join as join21, resolve as resolve18 } from "path";
|
|
11705
11736
|
var DEFAULT_DEVICE_SIZES, DEFAULT_IMAGE_SIZES, DEFAULT_QUALITY, OPTIMIZATION_ENDPOINT = "/_absolute/image", BLUR_DEVIATION = 20, sharpModule = undefined, sharpLoaded = false, sharpWarned = false, snapToSize = (target, sizes) => {
|
|
11706
11737
|
for (const size of sizes) {
|
|
11707
11738
|
if (size >= target)
|
|
@@ -11758,7 +11789,7 @@ var DEFAULT_DEVICE_SIZES, DEFAULT_IMAGE_SIZES, DEFAULT_QUALITY, OPTIMIZATION_END
|
|
|
11758
11789
|
const image2 = config?.imageSizes ?? DEFAULT_IMAGE_SIZES;
|
|
11759
11790
|
return [...device, ...image2].sort((left, right) => left - right);
|
|
11760
11791
|
}, getCacheDir = (buildDir, cacheDirectory) => {
|
|
11761
|
-
const dir = cacheDirectory ?
|
|
11792
|
+
const dir = cacheDirectory ? resolve18(cacheDirectory) : join21(buildDir, ".cache", "images");
|
|
11762
11793
|
if (!existsSync17(dir))
|
|
11763
11794
|
mkdirSync3(dir, { recursive: true });
|
|
11764
11795
|
return dir;
|
|
@@ -11851,7 +11882,7 @@ var DEFAULT_DEVICE_SIZES, DEFAULT_IMAGE_SIZES, DEFAULT_QUALITY, OPTIMIZATION_END
|
|
|
11851
11882
|
return sharpModule;
|
|
11852
11883
|
sharpLoaded = true;
|
|
11853
11884
|
try {
|
|
11854
|
-
const sharpPath =
|
|
11885
|
+
const sharpPath = resolve18(process.cwd(), "node_modules/sharp");
|
|
11855
11886
|
const mod = await import(sharpPath);
|
|
11856
11887
|
sharpModule = mod.default ?? mod;
|
|
11857
11888
|
return sharpModule;
|
|
@@ -11886,7 +11917,7 @@ var exports_optimizeHtmlImages = {};
|
|
|
11886
11917
|
__export(exports_optimizeHtmlImages, {
|
|
11887
11918
|
optimizeHtmlImages: () => optimizeHtmlImages
|
|
11888
11919
|
});
|
|
11889
|
-
import { readFile as
|
|
11920
|
+
import { readFile as readFile6, writeFile as writeFile6 } from "fs/promises";
|
|
11890
11921
|
var IMG_REGEX, getAttr = (attrs, name) => {
|
|
11891
11922
|
const regex = new RegExp(`${name}\\s*=\\s*["']([^"']*)["']`, "i");
|
|
11892
11923
|
const match = regex.exec(attrs);
|
|
@@ -11932,12 +11963,12 @@ var IMG_REGEX, getAttr = (attrs, name) => {
|
|
|
11932
11963
|
}, optimizeHtmlImages = async (directory, config) => {
|
|
11933
11964
|
const htmlFiles = await scanEntryPoints(directory, "*.html");
|
|
11934
11965
|
const tasks = htmlFiles.map(async (filePath) => {
|
|
11935
|
-
const original = await
|
|
11966
|
+
const original = await readFile6(filePath, "utf8");
|
|
11936
11967
|
if (!original.includes("data-optimized"))
|
|
11937
11968
|
return;
|
|
11938
11969
|
const updated = original.replace(IMG_REGEX, (match, before, after) => transformImgTag(match, before, after, config));
|
|
11939
11970
|
if (updated !== original) {
|
|
11940
|
-
await
|
|
11971
|
+
await writeFile6(filePath, updated, "utf8");
|
|
11941
11972
|
}
|
|
11942
11973
|
});
|
|
11943
11974
|
await Promise.all(tasks);
|
|
@@ -12035,7 +12066,7 @@ var exports_updateAssetPaths = {};
|
|
|
12035
12066
|
__export(exports_updateAssetPaths, {
|
|
12036
12067
|
updateAssetPaths: () => updateAssetPaths
|
|
12037
12068
|
});
|
|
12038
|
-
import { readFile as
|
|
12069
|
+
import { readFile as readFile7, writeFile as writeFile7 } from "fs/promises";
|
|
12039
12070
|
var replaceAssetRef = (match, prefix, dir, name, ext, suffix, manifest, filePath) => {
|
|
12040
12071
|
if (/data-external(?:\s*=\s*["'][^"']*["'])?/i.test(match)) {
|
|
12041
12072
|
return match;
|
|
@@ -12073,9 +12104,9 @@ var replaceAssetRef = (match, prefix, dir, name, ext, suffix, manifest, filePath
|
|
|
12073
12104
|
const htmlFiles = await scanEntryPoints(directory, "*.html");
|
|
12074
12105
|
const assetRegex = /((?:<script[^>]+src=|<link[^>]*?rel=["']stylesheet["'][^>]*?href=)["'])(?!\/?(?:.*\/)?htmx\.min\.js)(\/?(?:.*\/)?)([^./"']+)(?:\.[^."'/]+)?(\.(?:js|ts|css))(["'][^>]*>)/g;
|
|
12075
12106
|
const tasks = htmlFiles.map(async (filePath) => {
|
|
12076
|
-
const original = await
|
|
12107
|
+
const original = await readFile7(filePath, "utf8");
|
|
12077
12108
|
const updated = original.replace(assetRegex, (match, prefix, dir, name, ext, suffix) => replaceAssetRef(match, prefix, dir, name, ext, suffix, manifest, filePath));
|
|
12078
|
-
await
|
|
12109
|
+
await writeFile7(filePath, updated, "utf8");
|
|
12079
12110
|
});
|
|
12080
12111
|
await Promise.all(tasks);
|
|
12081
12112
|
};
|
|
@@ -12090,18 +12121,18 @@ __export(exports_buildHMRClient, {
|
|
|
12090
12121
|
buildHMRClient: () => buildHMRClient
|
|
12091
12122
|
});
|
|
12092
12123
|
import { existsSync as existsSync20 } from "fs";
|
|
12093
|
-
import { resolve as
|
|
12124
|
+
import { resolve as resolve19 } from "path";
|
|
12094
12125
|
var {build: bunBuild } = globalThis.Bun;
|
|
12095
12126
|
var resolveHmrClientPath = () => {
|
|
12096
12127
|
const projectRoot = process.cwd();
|
|
12097
|
-
const fromSource =
|
|
12128
|
+
const fromSource = resolve19(import.meta.dir, "client/hmrClient.ts");
|
|
12098
12129
|
if (existsSync20(fromSource) && fromSource.startsWith(projectRoot)) {
|
|
12099
12130
|
return fromSource;
|
|
12100
12131
|
}
|
|
12101
|
-
const fromNodeModules =
|
|
12132
|
+
const fromNodeModules = resolve19(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client/hmrClient.ts");
|
|
12102
12133
|
if (existsSync20(fromNodeModules))
|
|
12103
12134
|
return fromNodeModules;
|
|
12104
|
-
return
|
|
12135
|
+
return resolve19(import.meta.dir, "dev/client/hmrClient.ts");
|
|
12105
12136
|
}, hmrClientPath2, buildHMRClient = async () => {
|
|
12106
12137
|
const entryPoint = hmrClientPath2;
|
|
12107
12138
|
const result = await bunBuild({
|
|
@@ -12255,7 +12286,7 @@ var devVendorPaths = null, getDevVendorPaths = () => devVendorPaths, setDevVendo
|
|
|
12255
12286
|
|
|
12256
12287
|
// src/build/angularLinkerPlugin.ts
|
|
12257
12288
|
import { existsSync as existsSync21, mkdirSync as mkdirSync5, readFileSync as readFileSync15, writeFileSync as writeFileSync6 } from "fs";
|
|
12258
|
-
import { dirname as dirname13, join as join24, relative as relative8, resolve as
|
|
12289
|
+
import { dirname as dirname13, join as join24, relative as relative8, resolve as resolve20 } from "path";
|
|
12259
12290
|
import { createHash as createHash7 } from "crypto";
|
|
12260
12291
|
var CACHE_ROOT, ANGULAR_LINKER_CANDIDATE_RE, createAngularLinkerPlugin = (linkerJitMode) => ({
|
|
12261
12292
|
name: "angular-linker",
|
|
@@ -12297,7 +12328,7 @@ var CACHE_ROOT, ANGULAR_LINKER_CANDIDATE_RE, createAngularLinkerPlugin = (linker
|
|
|
12297
12328
|
exists: existsSync21,
|
|
12298
12329
|
readFile: readFileSync15,
|
|
12299
12330
|
relative: relative8,
|
|
12300
|
-
resolve:
|
|
12331
|
+
resolve: resolve20
|
|
12301
12332
|
},
|
|
12302
12333
|
linkerJitMode,
|
|
12303
12334
|
logger: {
|
|
@@ -12328,7 +12359,7 @@ var CACHE_ROOT, ANGULAR_LINKER_CANDIDATE_RE, createAngularLinkerPlugin = (linker
|
|
|
12328
12359
|
}
|
|
12329
12360
|
}), angularLinkerPlugin;
|
|
12330
12361
|
var init_angularLinkerPlugin = __esm(() => {
|
|
12331
|
-
CACHE_ROOT =
|
|
12362
|
+
CACHE_ROOT = resolve20(".absolutejs", "cache", "angular-linker");
|
|
12332
12363
|
ANGULAR_LINKER_CANDIDATE_RE = /[\\/]node_modules[\\/].*\.m?js$/;
|
|
12333
12364
|
angularLinkerPlugin = createAngularLinkerPlugin(false);
|
|
12334
12365
|
});
|
|
@@ -12410,12 +12441,12 @@ var init_bunStringRawUnicodePlugin = __esm(() => {
|
|
|
12410
12441
|
|
|
12411
12442
|
// src/build/externalAssetPlugin.ts
|
|
12412
12443
|
import { copyFileSync, existsSync as existsSync22, mkdirSync as mkdirSync6, statSync } from "fs";
|
|
12413
|
-
import { basename as basename7, dirname as dirname14, join as join25, resolve as
|
|
12444
|
+
import { basename as basename7, dirname as dirname14, join as join25, resolve as resolve21 } from "path";
|
|
12414
12445
|
var createExternalAssetPlugin = (outDir, userSourceRoots = []) => ({
|
|
12415
12446
|
name: "absolute-external-asset",
|
|
12416
12447
|
setup(bld) {
|
|
12417
12448
|
const urlPattern = /new\s+URL\(\s*["'](\.\.?\/[^"']+)["']\s*,\s*import\.meta\.url\s*\)/g;
|
|
12418
|
-
const skipRoots = userSourceRoots.map((root) =>
|
|
12449
|
+
const skipRoots = userSourceRoots.map((root) => resolve21(root));
|
|
12419
12450
|
const isUserSource = (path) => skipRoots.some((root) => path.startsWith(`${root}/`));
|
|
12420
12451
|
bld.onLoad({ filter: /\.[mc]?[jt]sx?$/ }, async (args) => {
|
|
12421
12452
|
if (isUserSource(args.path))
|
|
@@ -12430,7 +12461,7 @@ var createExternalAssetPlugin = (outDir, userSourceRoots = []) => ({
|
|
|
12430
12461
|
const relPath = match[1];
|
|
12431
12462
|
if (!relPath)
|
|
12432
12463
|
continue;
|
|
12433
|
-
const assetPath =
|
|
12464
|
+
const assetPath = resolve21(sourceDir, relPath);
|
|
12434
12465
|
if (!existsSync22(assetPath))
|
|
12435
12466
|
continue;
|
|
12436
12467
|
if (!statSync(assetPath).isFile())
|
|
@@ -12645,8 +12676,8 @@ __export(exports_hmrInjectionPlugin, {
|
|
|
12645
12676
|
createAngularHmrInjectionPlugin: () => createAngularHmrInjectionPlugin,
|
|
12646
12677
|
applyAngularHmrInjection: () => applyAngularHmrInjection
|
|
12647
12678
|
});
|
|
12648
|
-
import { readFile as
|
|
12649
|
-
import { relative as relative9, resolve as
|
|
12679
|
+
import { readFile as readFile8 } from "fs/promises";
|
|
12680
|
+
import { relative as relative9, resolve as resolve22 } from "path";
|
|
12650
12681
|
var ENTITY_DECORATOR_RE, IMPORT_RE, TOP_LEVEL_DECL_RE, extractAllTopLevelNames = (jsSource) => {
|
|
12651
12682
|
const names = new Set;
|
|
12652
12683
|
IMPORT_RE.lastIndex = 0;
|
|
@@ -12709,9 +12740,23 @@ var ENTITY_DECORATOR_RE, IMPORT_RE, TOP_LEVEL_DECL_RE, extractAllTopLevelNames =
|
|
|
12709
12740
|
// Send a server-side ack so the dev terminal can log the
|
|
12710
12741
|
// full HMR latency (server compile + WS hop + client apply +
|
|
12711
12742
|
// CD pulse) rather than just the server-side compile time.
|
|
12712
|
-
const __ng_hmr_ack = (tier, applyMs, error) => {
|
|
12743
|
+
const __ng_hmr_ack = (tier, applyMs, error, updateId) => {
|
|
12713
12744
|
try {
|
|
12714
12745
|
const ws = globalThis.__HMR_WS__;
|
|
12746
|
+
const target = globalThis.__ABS_HMR_TARGET__ || 'web';
|
|
12747
|
+
const timing = {
|
|
12748
|
+
clientMs: Math.round(applyMs),
|
|
12749
|
+
duration: Math.round(applyMs),
|
|
12750
|
+
kind: 'component',
|
|
12751
|
+
outcome: error ? 'failed' : 'applied',
|
|
12752
|
+
serverMs: 0,
|
|
12753
|
+
target,
|
|
12754
|
+
updateId
|
|
12755
|
+
};
|
|
12756
|
+
globalThis.__ABS_HMR_LAST_APPLY__ = timing;
|
|
12757
|
+
const applies = globalThis.__ABS_HMR_APPLIES__ || (globalThis.__ABS_HMR_APPLIES__ = []);
|
|
12758
|
+
applies.push(timing);
|
|
12759
|
+
if (applies.length > 50) applies.splice(0, applies.length - 50);
|
|
12715
12760
|
if (ws && ws.readyState === 1) {
|
|
12716
12761
|
ws.send(JSON.stringify({
|
|
12717
12762
|
type: 'angular:hmr-ack',
|
|
@@ -12719,7 +12764,9 @@ var ENTITY_DECORATOR_RE, IMPORT_RE, TOP_LEVEL_DECL_RE, extractAllTopLevelNames =
|
|
|
12719
12764
|
className: ${JSON.stringify(className)},
|
|
12720
12765
|
tier,
|
|
12721
12766
|
applyMs,
|
|
12722
|
-
error
|
|
12767
|
+
error,
|
|
12768
|
+
target,
|
|
12769
|
+
updateId
|
|
12723
12770
|
}));
|
|
12724
12771
|
}
|
|
12725
12772
|
} catch {}
|
|
@@ -12743,16 +12790,16 @@ var ENTITY_DECORATOR_RE, IMPORT_RE, TOP_LEVEL_DECL_RE, extractAllTopLevelNames =
|
|
|
12743
12790
|
import.meta,
|
|
12744
12791
|
__ng_hmr_id
|
|
12745
12792
|
);
|
|
12746
|
-
__ng_hmr_ack('tier-0', performance.now() - t0);
|
|
12793
|
+
__ng_hmr_ack('tier-0', performance.now() - t0, undefined, t);
|
|
12747
12794
|
} catch (err) {
|
|
12748
12795
|
console.error('[abs-hmr] \u0275\u0275replaceMetadata threw for ${className}:', err);
|
|
12749
|
-
__ng_hmr_ack('tier-0', performance.now() - t0, String(err && err.message || err));
|
|
12796
|
+
__ng_hmr_ack('tier-0', performance.now() - t0, String(err && err.message || err), t);
|
|
12750
12797
|
}
|
|
12751
12798
|
} else {
|
|
12752
12799
|
// Non-component entity (pipe / directive / service) \u2014 no
|
|
12753
12800
|
// LView tree to walk, just apply the prototype patch.
|
|
12754
12801
|
u.default(${className}, [core]);
|
|
12755
|
-
__ng_hmr_ack('tier-0', performance.now() - t0);
|
|
12802
|
+
__ng_hmr_ack('tier-0', performance.now() - t0, undefined, t);
|
|
12756
12803
|
}
|
|
12757
12804
|
};
|
|
12758
12805
|
// Tier 1 remount: structural changes (new ctor params / new field
|
|
@@ -12784,10 +12831,10 @@ var ENTITY_DECORATOR_RE, IMPORT_RE, TOP_LEVEL_DECL_RE, extractAllTopLevelNames =
|
|
|
12784
12831
|
${JSON.stringify(className)}
|
|
12785
12832
|
);
|
|
12786
12833
|
if (mySeq !== __ng_hmr_seq) return; // newer event arrived during remount
|
|
12787
|
-
__ng_hmr_ack('tier-1a', performance.now() - t0);
|
|
12834
|
+
__ng_hmr_ack('tier-1a', performance.now() - t0, undefined, t);
|
|
12788
12835
|
} catch (err) {
|
|
12789
12836
|
console.error('[abs-hmr] remount threw for ${className}:', err);
|
|
12790
|
-
__ng_hmr_ack('tier-1a', performance.now() - t0, String(err && err.message || err));
|
|
12837
|
+
__ng_hmr_ack('tier-1a', performance.now() - t0, String(err && err.message || err), t);
|
|
12791
12838
|
}
|
|
12792
12839
|
} else {
|
|
12793
12840
|
// No remount helper installed (older absolutejs runtime, or
|
|
@@ -12809,7 +12856,7 @@ var ENTITY_DECORATOR_RE, IMPORT_RE, TOP_LEVEL_DECL_RE, extractAllTopLevelNames =
|
|
|
12809
12856
|
}
|
|
12810
12857
|
`, applyAngularHmrInjection = (jsSource, componentJsAbsPath, params) => {
|
|
12811
12858
|
const { generatedAngularRoot, userAngularRoot, projectRoot } = params;
|
|
12812
|
-
const normalizedGenRoot =
|
|
12859
|
+
const normalizedGenRoot = resolve22(generatedAngularRoot).replace(/\\/g, "/");
|
|
12813
12860
|
const normalizedPath = componentJsAbsPath.replace(/\\/g, "/");
|
|
12814
12861
|
if (!normalizedPath.startsWith(`${normalizedGenRoot}/`))
|
|
12815
12862
|
return;
|
|
@@ -12827,7 +12874,7 @@ var ENTITY_DECORATOR_RE, IMPORT_RE, TOP_LEVEL_DECL_RE, extractAllTopLevelNames =
|
|
|
12827
12874
|
if (classNames.length === 0)
|
|
12828
12875
|
return;
|
|
12829
12876
|
const relFromGenRoot = relative9(generatedAngularRoot, componentJsAbsPath).replace(/\\/g, "/");
|
|
12830
|
-
const userTsPath =
|
|
12877
|
+
const userTsPath = resolve22(userAngularRoot, relFromGenRoot.replace(/\.js$/, ".ts"));
|
|
12831
12878
|
const projectRel = relative9(projectRoot, userTsPath).replace(/\\/g, "/");
|
|
12832
12879
|
const tail = classNames.map((className) => {
|
|
12833
12880
|
const id = `${projectRel}@${className}`;
|
|
@@ -12846,7 +12893,7 @@ ${classNames.map((c) => `try { ${c}.__abs_deps = { ${depsKeys} }; } catch {}`).j
|
|
|
12846
12893
|
name: "absolute-angular-hmr-injection",
|
|
12847
12894
|
setup(build2) {
|
|
12848
12895
|
build2.onLoad({ filter: /\.js$/ }, async (args) => {
|
|
12849
|
-
const text = await
|
|
12896
|
+
const text = await readFile8(args.path, "utf8");
|
|
12850
12897
|
const transformed = applyAngularHmrInjection(text, args.path, params);
|
|
12851
12898
|
if (transformed === undefined)
|
|
12852
12899
|
return;
|
|
@@ -12861,20 +12908,20 @@ var init_hmrInjectionPlugin = __esm(() => {
|
|
|
12861
12908
|
});
|
|
12862
12909
|
|
|
12863
12910
|
// src/utils/cleanStaleOutputs.ts
|
|
12864
|
-
import { rm as
|
|
12865
|
-
import { resolve as
|
|
12911
|
+
import { rm as rm5 } from "fs/promises";
|
|
12912
|
+
import { resolve as resolve23 } from "path";
|
|
12866
12913
|
var {Glob: Glob5 } = globalThis.Bun;
|
|
12867
12914
|
var HASHED_FILE_PATTERN, cleanStaleOutputs = async (buildPath, currentOutputPaths) => {
|
|
12868
|
-
const currentPaths = new Set(currentOutputPaths.map((path) =>
|
|
12915
|
+
const currentPaths = new Set(currentOutputPaths.map((path) => resolve23(path)));
|
|
12869
12916
|
const glob = new Glob5("**/*");
|
|
12870
12917
|
const removals = [];
|
|
12871
12918
|
for (const relative10 of glob.scanSync({ cwd: buildPath })) {
|
|
12872
|
-
const absolute =
|
|
12919
|
+
const absolute = resolve23(buildPath, relative10);
|
|
12873
12920
|
if (currentPaths.has(absolute))
|
|
12874
12921
|
continue;
|
|
12875
12922
|
if (!HASHED_FILE_PATTERN.test(relative10))
|
|
12876
12923
|
continue;
|
|
12877
|
-
removals.push(
|
|
12924
|
+
removals.push(rm5(absolute, { force: true }));
|
|
12878
12925
|
}
|
|
12879
12926
|
await Promise.all(removals);
|
|
12880
12927
|
};
|
|
@@ -12893,7 +12940,7 @@ var GENERATED_DIR_NAME = "generated", ABSOLUTE_CACHE_DIR_NAME = ".absolutejs", g
|
|
|
12893
12940
|
var init_generatedDir = () => {};
|
|
12894
12941
|
|
|
12895
12942
|
// src/utils/cleanup.ts
|
|
12896
|
-
import { lstat, rm as
|
|
12943
|
+
import { lstat, rm as rm6 } from "fs/promises";
|
|
12897
12944
|
import { join as join27 } from "path";
|
|
12898
12945
|
var isNotFoundError = (error) => error instanceof Error && ("code" in error) && Reflect.get(error, "code") === "ENOENT", removeIfExists = async (path) => {
|
|
12899
12946
|
try {
|
|
@@ -12903,7 +12950,7 @@ var isNotFoundError = (error) => error instanceof Error && ("code" in error) &&
|
|
|
12903
12950
|
return;
|
|
12904
12951
|
throw error;
|
|
12905
12952
|
}
|
|
12906
|
-
await
|
|
12953
|
+
await rm6(path, { force: true, recursive: true });
|
|
12907
12954
|
}, cleanFramework = (framework, frameworkDir, skipGenerated = false) => {
|
|
12908
12955
|
const tasks = [];
|
|
12909
12956
|
if (!skipGenerated) {
|
|
@@ -12934,6 +12981,13 @@ var init_cleanup = __esm(() => {
|
|
|
12934
12981
|
init_generatedDir();
|
|
12935
12982
|
});
|
|
12936
12983
|
|
|
12984
|
+
// src/build/resolveBuildMode.ts
|
|
12985
|
+
var resolveBuildDevelopmentMode = (mode, nodeEnv) => mode === "development" || mode === undefined && nodeEnv === "development", resolveVueFeatureFlags = (development) => ({
|
|
12986
|
+
__VUE_OPTIONS_API__: "true",
|
|
12987
|
+
__VUE_PROD_DEVTOOLS__: development ? "true" : "false",
|
|
12988
|
+
__VUE_PROD_HYDRATION_MISMATCH_DETAILS__: development ? "true" : "false"
|
|
12989
|
+
});
|
|
12990
|
+
|
|
12937
12991
|
// src/utils/commonAncestor.ts
|
|
12938
12992
|
var exports_commonAncestor = {};
|
|
12939
12993
|
__export(exports_commonAncestor, {
|
|
@@ -13116,10 +13170,10 @@ var init_buildDirectoryLock = __esm(() => {
|
|
|
13116
13170
|
});
|
|
13117
13171
|
|
|
13118
13172
|
// src/utils/validateSafePath.ts
|
|
13119
|
-
import { resolve as
|
|
13173
|
+
import { resolve as resolve24, relative as relative10 } from "path";
|
|
13120
13174
|
var validateSafePath = (targetPath, baseDirectory) => {
|
|
13121
|
-
const absoluteBase =
|
|
13122
|
-
const absoluteTarget =
|
|
13175
|
+
const absoluteBase = resolve24(baseDirectory);
|
|
13176
|
+
const absoluteTarget = resolve24(baseDirectory, targetPath);
|
|
13123
13177
|
const relativePath = normalizePath2(relative10(absoluteBase, absoluteTarget));
|
|
13124
13178
|
if (relativePath.startsWith("../") || relativePath === "..") {
|
|
13125
13179
|
throw new Error(`Unsafe path: ${targetPath}`);
|
|
@@ -13724,13 +13778,13 @@ __export(exports_compileSvelte, {
|
|
|
13724
13778
|
clearSvelteCompilerCache: () => clearSvelteCompilerCache
|
|
13725
13779
|
});
|
|
13726
13780
|
import { existsSync as existsSync24 } from "fs";
|
|
13727
|
-
import { mkdir as
|
|
13781
|
+
import { mkdir as mkdir8, stat as stat2 } from "fs/promises";
|
|
13728
13782
|
import {
|
|
13729
13783
|
dirname as dirname17,
|
|
13730
13784
|
join as join33,
|
|
13731
13785
|
basename as basename10,
|
|
13732
13786
|
extname as extname7,
|
|
13733
|
-
resolve as
|
|
13787
|
+
resolve as resolve25,
|
|
13734
13788
|
relative as relative11,
|
|
13735
13789
|
sep as sep2
|
|
13736
13790
|
} from "path";
|
|
@@ -13738,14 +13792,14 @@ import { env as env2 } from "process";
|
|
|
13738
13792
|
var {write: write2, file: file2, Transpiler: Transpiler2 } = globalThis.Bun;
|
|
13739
13793
|
var resolveDevClientDir2 = () => {
|
|
13740
13794
|
const projectRoot = process.cwd();
|
|
13741
|
-
const fromSource =
|
|
13795
|
+
const fromSource = resolve25(import.meta.dir, "../dev/client");
|
|
13742
13796
|
if (existsSync24(fromSource) && fromSource.startsWith(projectRoot)) {
|
|
13743
13797
|
return fromSource;
|
|
13744
13798
|
}
|
|
13745
|
-
const fromNodeModules =
|
|
13799
|
+
const fromNodeModules = resolve25(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client");
|
|
13746
13800
|
if (existsSync24(fromNodeModules))
|
|
13747
13801
|
return fromNodeModules;
|
|
13748
|
-
return
|
|
13802
|
+
return resolve25(import.meta.dir, "./dev/client");
|
|
13749
13803
|
}, devClientDir2, hmrClientPath3, persistentCache, sourceHashCache, clearSvelteCompilerCache = () => {
|
|
13750
13804
|
persistentCache.clear();
|
|
13751
13805
|
sourceHashCache.clear();
|
|
@@ -13765,7 +13819,7 @@ var resolveDevClientDir2 = () => {
|
|
|
13765
13819
|
}
|
|
13766
13820
|
const stripped = `${code.slice(0, helperStart)}${code.slice(statementEnd + 3)}`;
|
|
13767
13821
|
return /\b__require\b/.test(stripped) ? code : stripped;
|
|
13768
|
-
},
|
|
13822
|
+
}, exists2 = async (path) => {
|
|
13769
13823
|
try {
|
|
13770
13824
|
await stat2(path);
|
|
13771
13825
|
return true;
|
|
@@ -13775,7 +13829,7 @@ var resolveDevClientDir2 = () => {
|
|
|
13775
13829
|
}, resolveRelativeModule2 = async (spec, from) => {
|
|
13776
13830
|
if (!spec.startsWith("."))
|
|
13777
13831
|
return null;
|
|
13778
|
-
const basePath =
|
|
13832
|
+
const basePath = resolve25(dirname17(from), spec);
|
|
13779
13833
|
const candidates = [
|
|
13780
13834
|
basePath,
|
|
13781
13835
|
`${basePath}.ts`,
|
|
@@ -13795,31 +13849,31 @@ var resolveDevClientDir2 = () => {
|
|
|
13795
13849
|
join33(basePath, "index.svelte.ts"),
|
|
13796
13850
|
join33(basePath, "index.svelte.js")
|
|
13797
13851
|
];
|
|
13798
|
-
const checks = await Promise.all(candidates.map(
|
|
13852
|
+
const checks = await Promise.all(candidates.map(exists2));
|
|
13799
13853
|
return candidates.find((_2, index) => checks[index]) ?? null;
|
|
13800
13854
|
}, resolveSvelte = async (spec, from) => {
|
|
13801
13855
|
if (!spec.startsWith(".") && !spec.startsWith("/")) {
|
|
13802
13856
|
const resolved = resolvePackageImport(spec);
|
|
13803
13857
|
return resolved && /\.svelte(\.(?:ts|js))?$/.test(resolved) ? resolved : null;
|
|
13804
13858
|
}
|
|
13805
|
-
const basePath =
|
|
13859
|
+
const basePath = resolve25(dirname17(from), spec);
|
|
13806
13860
|
const explicit = /\.(svelte|svelte\.(?:ts|js))$/.test(basePath);
|
|
13807
13861
|
if (!explicit) {
|
|
13808
13862
|
const extensions = [".svelte", ".svelte.ts", ".svelte.js"];
|
|
13809
13863
|
const paths = extensions.map((ext) => `${basePath}${ext}`);
|
|
13810
|
-
const checks = await Promise.all(paths.map(
|
|
13864
|
+
const checks = await Promise.all(paths.map(exists2));
|
|
13811
13865
|
const match = paths.find((_2, index) => checks[index]);
|
|
13812
13866
|
return match ?? null;
|
|
13813
13867
|
}
|
|
13814
|
-
if (await
|
|
13868
|
+
if (await exists2(basePath))
|
|
13815
13869
|
return basePath;
|
|
13816
13870
|
if (!basePath.endsWith(".svelte"))
|
|
13817
13871
|
return null;
|
|
13818
13872
|
const tsPath = `${basePath}.ts`;
|
|
13819
|
-
if (await
|
|
13873
|
+
if (await exists2(tsPath))
|
|
13820
13874
|
return tsPath;
|
|
13821
13875
|
const jsPath = `${basePath}.js`;
|
|
13822
|
-
if (await
|
|
13876
|
+
if (await exists2(jsPath))
|
|
13823
13877
|
return jsPath;
|
|
13824
13878
|
return null;
|
|
13825
13879
|
}, addModuleRewrite = (rewrites, rawSpec, resolvedModule, ssrOutputDir, clientOutputDir) => {
|
|
@@ -13835,7 +13889,7 @@ var resolveDevClientDir2 = () => {
|
|
|
13835
13889
|
const clientDir = join33(generatedDir, "client");
|
|
13836
13890
|
const indexDir = join33(generatedDir, "indexes");
|
|
13837
13891
|
const serverDir = join33(generatedDir, "server");
|
|
13838
|
-
await Promise.all([clientDir, indexDir, serverDir].map((dir) =>
|
|
13892
|
+
await Promise.all([clientDir, indexDir, serverDir].map((dir) => mkdir8(dir, { recursive: true })));
|
|
13839
13893
|
const dev = env2.NODE_ENV !== "production";
|
|
13840
13894
|
const build2 = async (src) => {
|
|
13841
13895
|
const memoized = cache.get(src);
|
|
@@ -13941,8 +13995,8 @@ var resolveDevClientDir2 = () => {
|
|
|
13941
13995
|
const ssrPath = join33(serverDir, relDir, `${baseName}.js`);
|
|
13942
13996
|
const clientPath = join33(clientDir, relDir, `${baseName}.js`);
|
|
13943
13997
|
await Promise.all([
|
|
13944
|
-
|
|
13945
|
-
|
|
13998
|
+
mkdir8(dirname17(ssrPath), { recursive: true }),
|
|
13999
|
+
mkdir8(dirname17(clientPath), { recursive: true })
|
|
13946
14000
|
]);
|
|
13947
14001
|
const inlineMap = (map) => map ? `
|
|
13948
14002
|
//# sourceMappingURL=data:application/json;base64,${Buffer.from(JSON.stringify(map)).toString("base64")}
|
|
@@ -14059,7 +14113,7 @@ if (typeof window !== "undefined") {
|
|
|
14059
14113
|
setTimeout(releaseStreamingSlots, 0);
|
|
14060
14114
|
}
|
|
14061
14115
|
}`;
|
|
14062
|
-
await
|
|
14116
|
+
await mkdir8(dirname17(indexPath), { recursive: true });
|
|
14063
14117
|
return write2(indexPath, bootstrap);
|
|
14064
14118
|
}));
|
|
14065
14119
|
return {
|
|
@@ -14559,26 +14613,26 @@ __export(exports_compileVue, {
|
|
|
14559
14613
|
clearVueHmrCaches: () => clearVueHmrCaches
|
|
14560
14614
|
});
|
|
14561
14615
|
import { existsSync as existsSync25, readFileSync as readFileSync22, realpathSync as realpathSync2 } from "fs";
|
|
14562
|
-
import { mkdir as
|
|
14616
|
+
import { mkdir as mkdir9 } from "fs/promises";
|
|
14563
14617
|
import {
|
|
14564
14618
|
basename as basename11,
|
|
14565
14619
|
dirname as dirname18,
|
|
14566
14620
|
isAbsolute as isAbsolute4,
|
|
14567
14621
|
join as join34,
|
|
14568
14622
|
relative as relative12,
|
|
14569
|
-
resolve as
|
|
14623
|
+
resolve as resolve26
|
|
14570
14624
|
} from "path";
|
|
14571
14625
|
var {file: file3, write: write3, Transpiler: Transpiler3 } = globalThis.Bun;
|
|
14572
14626
|
var resolveDevClientDir3 = () => {
|
|
14573
14627
|
const projectRoot = process.cwd();
|
|
14574
|
-
const fromSource =
|
|
14628
|
+
const fromSource = resolve26(import.meta.dir, "../dev/client");
|
|
14575
14629
|
if (existsSync25(fromSource) && fromSource.startsWith(projectRoot)) {
|
|
14576
14630
|
return fromSource;
|
|
14577
14631
|
}
|
|
14578
|
-
const fromNodeModules =
|
|
14632
|
+
const fromNodeModules = resolve26(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client");
|
|
14579
14633
|
if (existsSync25(fromNodeModules))
|
|
14580
14634
|
return fromNodeModules;
|
|
14581
|
-
return
|
|
14635
|
+
return resolve26(import.meta.dir, "./dev/client");
|
|
14582
14636
|
}, devClientDir3, hmrClientPath4, transpiler4, scriptCache, scriptSetupCache, templateCache, styleCache, persistentBuildCache, vueSourceHashCache, vueHmrMetadata, clearVueHmrCaches = () => {
|
|
14583
14637
|
scriptCache.clear();
|
|
14584
14638
|
scriptSetupCache.clear();
|
|
@@ -14628,7 +14682,7 @@ var resolveDevClientDir3 = () => {
|
|
|
14628
14682
|
visited.add(resolved);
|
|
14629
14683
|
const importRegex = /@import\s+(?:url\(\s*)?(['"])(\.{1,2}\/[^'"]+)\1\s*\)?\s*;?/g;
|
|
14630
14684
|
return cssContent.replace(importRegex, (match, _quote, relPath) => {
|
|
14631
|
-
const importedPath =
|
|
14685
|
+
const importedPath = resolve26(dirname18(cssFilePath), relPath);
|
|
14632
14686
|
if (!existsSync25(importedPath))
|
|
14633
14687
|
return match;
|
|
14634
14688
|
const importedContent = readFileSync22(importedPath, "utf-8");
|
|
@@ -14636,11 +14690,11 @@ var resolveDevClientDir3 = () => {
|
|
|
14636
14690
|
});
|
|
14637
14691
|
}, resolveHelperTsPath = (sourceDir, helper) => {
|
|
14638
14692
|
if (helper.endsWith(".ts"))
|
|
14639
|
-
return
|
|
14640
|
-
const direct =
|
|
14693
|
+
return resolve26(sourceDir, helper);
|
|
14694
|
+
const direct = resolve26(sourceDir, `${helper}.ts`);
|
|
14641
14695
|
if (existsSync25(direct))
|
|
14642
14696
|
return direct;
|
|
14643
|
-
const indexed =
|
|
14697
|
+
const indexed = resolve26(sourceDir, helper, "index.ts");
|
|
14644
14698
|
if (existsSync25(indexed))
|
|
14645
14699
|
return indexed;
|
|
14646
14700
|
return direct;
|
|
@@ -14651,15 +14705,15 @@ var resolveDevClientDir3 = () => {
|
|
|
14651
14705
|
return filePath.replace(/\.ts$/, ".js");
|
|
14652
14706
|
if (isStylePath(filePath)) {
|
|
14653
14707
|
if (sourceDir && (filePath.startsWith("./") || filePath.startsWith("../"))) {
|
|
14654
|
-
return
|
|
14708
|
+
return resolve26(sourceDir, filePath);
|
|
14655
14709
|
}
|
|
14656
14710
|
return filePath;
|
|
14657
14711
|
}
|
|
14658
14712
|
if (sourceDir && (filePath.startsWith("./") || filePath.startsWith("../"))) {
|
|
14659
|
-
const directTs =
|
|
14713
|
+
const directTs = resolve26(sourceDir, `${filePath}.ts`);
|
|
14660
14714
|
if (existsSync25(directTs))
|
|
14661
14715
|
return `${filePath}.js`;
|
|
14662
|
-
const indexedTs =
|
|
14716
|
+
const indexedTs = resolve26(sourceDir, filePath, "index.ts");
|
|
14663
14717
|
if (existsSync25(indexedTs))
|
|
14664
14718
|
return `${filePath}/index.js`;
|
|
14665
14719
|
}
|
|
@@ -14750,12 +14804,12 @@ const ${localName} = (source) => ${importedName}(
|
|
|
14750
14804
|
const childComponentPaths = importPaths.filter((path) => path.startsWith(".") && path.endsWith(".vue"));
|
|
14751
14805
|
const packageComponentPaths = Array.from(resolvedPackageVueImports.entries());
|
|
14752
14806
|
const helperModulePaths = importPaths.filter((path) => path.startsWith(".") && !path.endsWith(".vue") && !isStylePath(path));
|
|
14753
|
-
const stylePathsImported = importPaths.filter((path) => (path.startsWith(".") || isAbsolute4(path)) && isStylePath(path)).map((path) => isAbsolute4(path) ? path :
|
|
14807
|
+
const stylePathsImported = importPaths.filter((path) => (path.startsWith(".") || isAbsolute4(path)) && isStylePath(path)).map((path) => isAbsolute4(path) ? path : resolve26(dirname18(sourceFilePath), path));
|
|
14754
14808
|
for (const stylePath of stylePathsImported) {
|
|
14755
14809
|
addStyleImporter(sourceFilePath, stylePath);
|
|
14756
14810
|
}
|
|
14757
14811
|
const childBuildResults = await Promise.all([
|
|
14758
|
-
...childComponentPaths.map((relativeChildPath) => compileVueFile(
|
|
14812
|
+
...childComponentPaths.map((relativeChildPath) => compileVueFile(resolve26(dirname18(sourceFilePath), relativeChildPath), outputDirs, cacheMap, false, vueRootDir, compiler, stylePreprocessors)),
|
|
14759
14813
|
...packageComponentPaths.map(([, absolutePath]) => compileVueFile(absolutePath, outputDirs, cacheMap, false, vueRootDir, compiler, stylePreprocessors))
|
|
14760
14814
|
]);
|
|
14761
14815
|
const hasScript = descriptor.script || descriptor.scriptSetup;
|
|
@@ -14816,7 +14870,7 @@ const ${localName} = (source) => ${importedName}(
|
|
|
14816
14870
|
let cssOutputPaths = [];
|
|
14817
14871
|
if (isEntryPoint && allCss.length) {
|
|
14818
14872
|
const cssOutputFile = join34(outputDirs.css, `${toKebab(fileBaseName)}-compiled.css`);
|
|
14819
|
-
await
|
|
14873
|
+
await mkdir9(dirname18(cssOutputFile), { recursive: true });
|
|
14820
14874
|
await write3(cssOutputFile, allCss.join(`
|
|
14821
14875
|
`));
|
|
14822
14876
|
cssOutputPaths = [cssOutputFile];
|
|
@@ -14859,8 +14913,8 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
14859
14913
|
}
|
|
14860
14914
|
return result2;
|
|
14861
14915
|
};
|
|
14862
|
-
await
|
|
14863
|
-
await
|
|
14916
|
+
await mkdir9(dirname18(clientOutputPath), { recursive: true });
|
|
14917
|
+
await mkdir9(dirname18(serverOutputPath), { recursive: true });
|
|
14864
14918
|
const clientFinal = rewritePackageImports(clientCode, clientOutputPath, "client");
|
|
14865
14919
|
const serverFinal = rewritePackageImports(serverCode, serverOutputPath, "server");
|
|
14866
14920
|
const inlineSourceMapFor = (finalContent) => {
|
|
@@ -14898,15 +14952,15 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
14898
14952
|
const serverOutputDir = join34(generatedDir, "server");
|
|
14899
14953
|
const cssOutputDir = join34(generatedDir, "compiled");
|
|
14900
14954
|
await Promise.all([
|
|
14901
|
-
|
|
14902
|
-
|
|
14903
|
-
|
|
14904
|
-
|
|
14955
|
+
mkdir9(clientOutputDir, { recursive: true }),
|
|
14956
|
+
mkdir9(indexOutputDir, { recursive: true }),
|
|
14957
|
+
mkdir9(serverOutputDir, { recursive: true }),
|
|
14958
|
+
mkdir9(cssOutputDir, { recursive: true })
|
|
14905
14959
|
]);
|
|
14906
14960
|
const buildCache = new Map;
|
|
14907
14961
|
const allTsHelperPaths = new Set;
|
|
14908
14962
|
const expandSpaRouteChildren = async (entries) => {
|
|
14909
|
-
const expanded = new Set(entries.map((entry) =>
|
|
14963
|
+
const expanded = new Set(entries.map((entry) => resolve26(entry)));
|
|
14910
14964
|
const queue2 = [...expanded];
|
|
14911
14965
|
while (queue2.length > 0) {
|
|
14912
14966
|
const entryPath = queue2.pop();
|
|
@@ -14923,7 +14977,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
14923
14977
|
});
|
|
14924
14978
|
const routes = parseVueSpaRoutes(descriptor.script?.content ?? "");
|
|
14925
14979
|
for (const { importPath } of routes) {
|
|
14926
|
-
const childPath =
|
|
14980
|
+
const childPath = resolve26(dirname18(entryPath), importPath);
|
|
14927
14981
|
if (expanded.has(childPath) || !existsSync25(childPath)) {
|
|
14928
14982
|
continue;
|
|
14929
14983
|
}
|
|
@@ -14935,7 +14989,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
14935
14989
|
};
|
|
14936
14990
|
const expandedEntryPoints = await expandSpaRouteChildren(entryPoints);
|
|
14937
14991
|
const compiledPages = await Promise.all(expandedEntryPoints.map(async (entryPath) => {
|
|
14938
|
-
const resolvedEntryPath =
|
|
14992
|
+
const resolvedEntryPath = resolve26(entryPath);
|
|
14939
14993
|
const result = await compileVueFile(resolvedEntryPath, {
|
|
14940
14994
|
client: clientOutputDir,
|
|
14941
14995
|
css: cssOutputDir,
|
|
@@ -14955,7 +15009,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
14955
15009
|
const entryBaseName = basename11(entryPath, ".vue");
|
|
14956
15010
|
const indexOutputFile = join34(indexOutputDir, `${entryBaseName}.js`);
|
|
14957
15011
|
const clientOutputFile = join34(clientOutputDir, relative12(vueRootDir, entryPath).replace(/\\/g, "/").replace(/\.vue$/, ".js"));
|
|
14958
|
-
await
|
|
15012
|
+
await mkdir9(dirname18(indexOutputFile), { recursive: true });
|
|
14959
15013
|
const vueHmrImports = isDev2 ? [
|
|
14960
15014
|
`window.__HMR_FRAMEWORK__ = "vue";`,
|
|
14961
15015
|
`import "${hmrClientPath4}";`
|
|
@@ -15138,8 +15192,8 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
15138
15192
|
const relativeJsPath = relative12(vueRootDir, tsPath).replace(/\.ts$/, ".js");
|
|
15139
15193
|
const outClientPath = join34(clientOutputDir, relativeJsPath);
|
|
15140
15194
|
const outServerPath = join34(serverOutputDir, relativeJsPath);
|
|
15141
|
-
await
|
|
15142
|
-
await
|
|
15195
|
+
await mkdir9(dirname18(outClientPath), { recursive: true });
|
|
15196
|
+
await mkdir9(dirname18(outServerPath), { recursive: true });
|
|
15143
15197
|
await write3(outClientPath, withMap);
|
|
15144
15198
|
await write3(outServerPath, withMap);
|
|
15145
15199
|
}));
|
|
@@ -15651,7 +15705,7 @@ __export(exports_compileAngular, {
|
|
|
15651
15705
|
compileAngular: () => compileAngular
|
|
15652
15706
|
});
|
|
15653
15707
|
import { existsSync as existsSync26, readFileSync as readFileSync23, promises as fs5 } from "fs";
|
|
15654
|
-
import { join as join35, basename as basename12, sep as sep3, dirname as dirname19, resolve as
|
|
15708
|
+
import { join as join35, basename as basename12, sep as sep3, dirname as dirname19, resolve as resolve27, relative as relative13 } from "path";
|
|
15655
15709
|
var {Glob: Glob6 } = globalThis.Bun;
|
|
15656
15710
|
import ts13 from "typescript";
|
|
15657
15711
|
var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
@@ -15659,10 +15713,10 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
15659
15713
|
return tracePhase ? tracePhase(`compile/angular/${name}`, fn2, metadata2) : await fn2();
|
|
15660
15714
|
}, readTsconfigPathAliases = () => {
|
|
15661
15715
|
try {
|
|
15662
|
-
const configPath2 =
|
|
15716
|
+
const configPath2 = resolve27(process.cwd(), "tsconfig.json");
|
|
15663
15717
|
const config = ts13.readConfigFile(configPath2, ts13.sys.readFile).config;
|
|
15664
15718
|
const compilerOptions = config?.compilerOptions ?? {};
|
|
15665
|
-
const baseUrl =
|
|
15719
|
+
const baseUrl = resolve27(process.cwd(), compilerOptions.baseUrl ?? ".");
|
|
15666
15720
|
const aliases = Object.entries(compilerOptions.paths ?? {}).map(([pattern, replacements]) => ({ pattern, replacements }));
|
|
15667
15721
|
return { aliases, baseUrl };
|
|
15668
15722
|
} catch {
|
|
@@ -15682,7 +15736,7 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
15682
15736
|
const wildcardValue = exactMatch ? "" : specifier.slice(prefix.length, specifier.length - suffix.length);
|
|
15683
15737
|
for (const replacement of alias.replacements) {
|
|
15684
15738
|
const candidate = replacement.replace("*", wildcardValue);
|
|
15685
|
-
const resolved = resolveSourceFile(
|
|
15739
|
+
const resolved = resolveSourceFile(resolve27(baseUrl, candidate));
|
|
15686
15740
|
if (resolved)
|
|
15687
15741
|
return resolved;
|
|
15688
15742
|
}
|
|
@@ -15701,13 +15755,13 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
15701
15755
|
];
|
|
15702
15756
|
return candidates.find((file4) => existsSync26(file4));
|
|
15703
15757
|
}, createLegacyAngularAnimationUsageResolver = (rootDir) => {
|
|
15704
|
-
const baseDir =
|
|
15758
|
+
const baseDir = resolve27(rootDir);
|
|
15705
15759
|
const tsconfigAliases = readTsconfigPathAliases();
|
|
15706
15760
|
const transpiler5 = new Bun.Transpiler({ loader: "tsx" });
|
|
15707
15761
|
const scanCache = new Map;
|
|
15708
15762
|
const resolveLocalImport = (specifier, fromDir) => {
|
|
15709
15763
|
if (specifier.startsWith(".") || specifier.startsWith("/")) {
|
|
15710
|
-
return resolveSourceFile(
|
|
15764
|
+
return resolveSourceFile(resolve27(fromDir, specifier));
|
|
15711
15765
|
}
|
|
15712
15766
|
const aliased = matchTsconfigAlias(specifier, tsconfigAliases.aliases, tsconfigAliases.baseUrl, resolveSourceFile);
|
|
15713
15767
|
if (aliased)
|
|
@@ -15716,7 +15770,7 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
15716
15770
|
const resolved = Bun.resolveSync(specifier, fromDir);
|
|
15717
15771
|
if (resolved.includes("/node_modules/"))
|
|
15718
15772
|
return;
|
|
15719
|
-
const absolute =
|
|
15773
|
+
const absolute = resolve27(resolved);
|
|
15720
15774
|
if (!absolute.startsWith(baseDir))
|
|
15721
15775
|
return;
|
|
15722
15776
|
return resolveSourceFile(absolute);
|
|
@@ -15732,7 +15786,7 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
15732
15786
|
usesLegacyAnimations: false
|
|
15733
15787
|
});
|
|
15734
15788
|
}
|
|
15735
|
-
const resolved =
|
|
15789
|
+
const resolved = resolve27(actualPath);
|
|
15736
15790
|
const cached = scanCache.get(resolved);
|
|
15737
15791
|
if (cached)
|
|
15738
15792
|
return cached;
|
|
@@ -15761,7 +15815,7 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
15761
15815
|
const actualPath = resolveSourceFile(filePath);
|
|
15762
15816
|
if (!actualPath)
|
|
15763
15817
|
return false;
|
|
15764
|
-
const resolved =
|
|
15818
|
+
const resolved = resolve27(actualPath);
|
|
15765
15819
|
if (visited.has(resolved))
|
|
15766
15820
|
return false;
|
|
15767
15821
|
visited.add(resolved);
|
|
@@ -15779,14 +15833,14 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
15779
15833
|
return (entryPath) => visit(entryPath);
|
|
15780
15834
|
}, resolveDevClientDir4 = () => {
|
|
15781
15835
|
const projectRoot = process.cwd();
|
|
15782
|
-
const fromSource =
|
|
15836
|
+
const fromSource = resolve27(import.meta.dir, "../dev/client");
|
|
15783
15837
|
if (existsSync26(fromSource) && fromSource.startsWith(projectRoot)) {
|
|
15784
15838
|
return fromSource;
|
|
15785
15839
|
}
|
|
15786
|
-
const fromNodeModules =
|
|
15840
|
+
const fromNodeModules = resolve27(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client");
|
|
15787
15841
|
if (existsSync26(fromNodeModules))
|
|
15788
15842
|
return fromNodeModules;
|
|
15789
|
-
return
|
|
15843
|
+
return resolve27(import.meta.dir, "./dev/client");
|
|
15790
15844
|
}, devClientDir4, hmrClientPath5, formatDiagnosticMessage = (diagnostic) => {
|
|
15791
15845
|
try {
|
|
15792
15846
|
return ts13.flattenDiagnosticMessageText(diagnostic.messageText, `
|
|
@@ -15829,11 +15883,11 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
15829
15883
|
if (hasJsLikeExtension(path))
|
|
15830
15884
|
return `${path}${query}`;
|
|
15831
15885
|
const importerDir = dirname19(importerOutputPath);
|
|
15832
|
-
const fileCandidate =
|
|
15886
|
+
const fileCandidate = resolve27(importerDir, `${path}.js`);
|
|
15833
15887
|
if (outputFiles?.has(fileCandidate) || existsSync26(fileCandidate)) {
|
|
15834
15888
|
return `${path}.js${query}`;
|
|
15835
15889
|
}
|
|
15836
|
-
const indexCandidate =
|
|
15890
|
+
const indexCandidate = resolve27(importerDir, path, "index.js");
|
|
15837
15891
|
if (outputFiles?.has(indexCandidate) || existsSync26(indexCandidate)) {
|
|
15838
15892
|
return `${path}/index.js${query}`;
|
|
15839
15893
|
}
|
|
@@ -15861,7 +15915,7 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
15861
15915
|
}, resolveLocalTsImport = (fromFile, specifier) => {
|
|
15862
15916
|
if (!isRelativeModuleSpecifier(specifier))
|
|
15863
15917
|
return null;
|
|
15864
|
-
const basePath =
|
|
15918
|
+
const basePath = resolve27(dirname19(fromFile), specifier);
|
|
15865
15919
|
const candidates = /\.[cm]?[tj]sx?$/.test(basePath) ? [basePath] : [
|
|
15866
15920
|
`${basePath}.ts`,
|
|
15867
15921
|
`${basePath}.tsx`,
|
|
@@ -15872,9 +15926,9 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
15872
15926
|
join35(basePath, "index.mts"),
|
|
15873
15927
|
join35(basePath, "index.cts")
|
|
15874
15928
|
];
|
|
15875
|
-
return candidates.map((candidate) =>
|
|
15876
|
-
}, readFileForAotTransform = async (fileName,
|
|
15877
|
-
const hostSource =
|
|
15929
|
+
return candidates.map((candidate) => resolve27(candidate)).find((candidate) => existsSync26(candidate) && !candidate.endsWith(".d.ts")) ?? null;
|
|
15930
|
+
}, readFileForAotTransform = async (fileName, readFile9) => {
|
|
15931
|
+
const hostSource = readFile9?.(fileName);
|
|
15878
15932
|
if (typeof hostSource === "string")
|
|
15879
15933
|
return hostSource;
|
|
15880
15934
|
return fs5.readFile(fileName, "utf-8");
|
|
@@ -15907,7 +15961,7 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
15907
15961
|
paths.push(join35(fileDir, urlMatch.replace(/['"]/g, "")));
|
|
15908
15962
|
}
|
|
15909
15963
|
}
|
|
15910
|
-
return paths.map((path) =>
|
|
15964
|
+
return paths.map((path) => resolve27(path));
|
|
15911
15965
|
}, readResourceCacheFile = async (cachePath) => {
|
|
15912
15966
|
try {
|
|
15913
15967
|
const entry = JSON.parse(await fs5.readFile(cachePath, "utf-8"));
|
|
@@ -15939,7 +15993,7 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
15939
15993
|
].join("\x00");
|
|
15940
15994
|
const cacheKey2 = Bun.hash(cacheInput).toString(BASE_36_RADIX);
|
|
15941
15995
|
return join35(process.cwd(), ".absolutejs", "cache", "angular-resources", `${cacheKey2}.json`);
|
|
15942
|
-
}, precomputeAotResourceTransforms = async (inputPaths,
|
|
15996
|
+
}, precomputeAotResourceTransforms = async (inputPaths, readFile9, stylePreprocessors) => {
|
|
15943
15997
|
const transformedSources = new Map;
|
|
15944
15998
|
const visited = new Set;
|
|
15945
15999
|
const stats = {
|
|
@@ -15949,14 +16003,14 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
15949
16003
|
transformedFiles: 0
|
|
15950
16004
|
};
|
|
15951
16005
|
const transformFile = async (filePath) => {
|
|
15952
|
-
const resolvedPath =
|
|
16006
|
+
const resolvedPath = resolve27(filePath);
|
|
15953
16007
|
if (visited.has(resolvedPath))
|
|
15954
16008
|
return;
|
|
15955
16009
|
visited.add(resolvedPath);
|
|
15956
16010
|
if (!existsSync26(resolvedPath) || resolvedPath.endsWith(".d.ts"))
|
|
15957
16011
|
return;
|
|
15958
16012
|
stats.filesVisited += 1;
|
|
15959
|
-
const source = await readFileForAotTransform(resolvedPath,
|
|
16013
|
+
const source = await readFileForAotTransform(resolvedPath, readFile9);
|
|
15960
16014
|
const cachePath = await resolveResourceTransformCachePath(resolvedPath, source, stylePreprocessors);
|
|
15961
16015
|
const cached = await readResourceCacheFile(cachePath);
|
|
15962
16016
|
let transformedSource;
|
|
@@ -15984,7 +16038,7 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
15984
16038
|
return { stats, transformedSources };
|
|
15985
16039
|
}, compileAngularFiles = async (inputPaths, outDir, stylePreprocessors) => {
|
|
15986
16040
|
const islandMetadataByOutputPath = await traceAngularPhase("aot/island-metadata", () => new Map(inputPaths.map((inputPath) => {
|
|
15987
|
-
const outputPath =
|
|
16041
|
+
const outputPath = resolve27(join35(outDir, relative13(process.cwd(), resolve27(inputPath)).replace(/\.[cm]?[tj]sx?$/, ".js")));
|
|
15988
16042
|
return [
|
|
15989
16043
|
outputPath,
|
|
15990
16044
|
buildIslandMetadataExports(readFileSync23(inputPath, "utf-8"))
|
|
@@ -15995,7 +16049,7 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
15995
16049
|
const tsLibDir = await traceAngularPhase("aot/resolve-typescript-lib", () => {
|
|
15996
16050
|
const tsPath = __require.resolve("typescript");
|
|
15997
16051
|
const tsRootDir = dirname19(tsPath);
|
|
15998
|
-
return tsRootDir.endsWith("lib") ? tsRootDir :
|
|
16052
|
+
return tsRootDir.endsWith("lib") ? tsRootDir : resolve27(tsRootDir, "lib");
|
|
15999
16053
|
});
|
|
16000
16054
|
const config = await traceAngularPhase("aot/read-configuration", () => readConfiguration("./tsconfig.json"));
|
|
16001
16055
|
const options = {
|
|
@@ -16037,7 +16091,7 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
16037
16091
|
return originalGetSourceFile?.call(host, fileName, languageVersion, onError);
|
|
16038
16092
|
};
|
|
16039
16093
|
const emitted = {};
|
|
16040
|
-
const resolvedOutDir =
|
|
16094
|
+
const resolvedOutDir = resolve27(outDir);
|
|
16041
16095
|
host.writeFile = (fileName, text) => {
|
|
16042
16096
|
const relativePath = resolveRelativePath(fileName, resolvedOutDir, outDir);
|
|
16043
16097
|
emitted[relativePath] = text;
|
|
@@ -16059,12 +16113,12 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
16059
16113
|
if (!fileName.endsWith(".ts") || fileName.endsWith(".d.ts")) {
|
|
16060
16114
|
return source;
|
|
16061
16115
|
}
|
|
16062
|
-
const resolvedPath =
|
|
16116
|
+
const resolvedPath = resolve27(fileName);
|
|
16063
16117
|
return transformedSources.get(resolvedPath) ?? source;
|
|
16064
16118
|
};
|
|
16065
16119
|
const originalGetSourceFileForCompile = host.getSourceFile;
|
|
16066
16120
|
host.getSourceFile = (fileName, languageVersion, onError) => {
|
|
16067
|
-
const source = transformedSources.get(
|
|
16121
|
+
const source = transformedSources.get(resolve27(fileName));
|
|
16068
16122
|
if (source) {
|
|
16069
16123
|
return ts13.createSourceFile(fileName, source, languageVersion, true);
|
|
16070
16124
|
}
|
|
@@ -16088,7 +16142,7 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
16088
16142
|
content,
|
|
16089
16143
|
target: join35(outDir, fileName)
|
|
16090
16144
|
}));
|
|
16091
|
-
const outputFiles = new Set(rawEntries.map(({ target }) =>
|
|
16145
|
+
const outputFiles = new Set(rawEntries.map(({ target }) => resolve27(target)));
|
|
16092
16146
|
return rawEntries.map(({ content, target }) => {
|
|
16093
16147
|
let processedContent = content.replace(/from\s+(['"])(\.\.?\/[^'"]+)(\1)/g, (match, quote, path) => {
|
|
16094
16148
|
const rewritten = rewriteRelativeJsSpecifier(target, path, outputFiles);
|
|
@@ -16103,7 +16157,7 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
16103
16157
|
return cleaned ? `import { ${cleaned}, InternalInjectFlags } from '@angular/core'` : `import { InternalInjectFlags } from '@angular/core'`;
|
|
16104
16158
|
});
|
|
16105
16159
|
processedContent = processedContent.replace(/\b(?<!Internal)InjectFlags\b/g, "InternalInjectFlags");
|
|
16106
|
-
processedContent += islandMetadataByOutputPath.get(
|
|
16160
|
+
processedContent += islandMetadataByOutputPath.get(resolve27(target)) ?? "";
|
|
16107
16161
|
return { content: processedContent, target };
|
|
16108
16162
|
});
|
|
16109
16163
|
});
|
|
@@ -16113,7 +16167,7 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
16113
16167
|
})), { outputs: entries.length });
|
|
16114
16168
|
return await traceAngularPhase("aot/collect-output-paths", () => entries.map(({ target }) => target), { outputs: entries.length });
|
|
16115
16169
|
}, compileAngularFile = async (inputPath, outDir, stylePreprocessors) => compileAngularFiles([inputPath], outDir, stylePreprocessors), jitContentCache, invalidateAngularJitCache = (filePath) => {
|
|
16116
|
-
jitContentCache.delete(
|
|
16170
|
+
jitContentCache.delete(resolve27(filePath));
|
|
16117
16171
|
}, wrapperOutputCache, escapeTemplateContent = (content) => content.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$\{/g, "\\${"), findUncommentedMatch = (source, pattern) => {
|
|
16118
16172
|
const re2 = new RegExp(pattern.source, pattern.flags.includes("g") ? pattern.flags : pattern.flags + "g");
|
|
16119
16173
|
let match;
|
|
@@ -16126,7 +16180,7 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
16126
16180
|
}
|
|
16127
16181
|
return null;
|
|
16128
16182
|
}, resolveAngularDeferImportSpecifier = () => {
|
|
16129
|
-
const sourceEntry =
|
|
16183
|
+
const sourceEntry = resolve27(import.meta.dir, "../angular/components/index.ts");
|
|
16130
16184
|
if (existsSync26(sourceEntry)) {
|
|
16131
16185
|
return sourceEntry.replace(/\\/g, "/");
|
|
16132
16186
|
}
|
|
@@ -16416,10 +16470,10 @@ ${fields}
|
|
|
16416
16470
|
return "";
|
|
16417
16471
|
}
|
|
16418
16472
|
}, compileAngularFileJIT = async (inputPath, outDir, rootDir, stylePreprocessors, cacheBuster) => {
|
|
16419
|
-
const entryPath =
|
|
16473
|
+
const entryPath = resolve27(inputPath);
|
|
16420
16474
|
const allOutputs = [];
|
|
16421
16475
|
const visited = new Set;
|
|
16422
|
-
const baseDir =
|
|
16476
|
+
const baseDir = resolve27(rootDir ?? process.cwd());
|
|
16423
16477
|
let usesLegacyAnimations = false;
|
|
16424
16478
|
const angularTranspiler = new Bun.Transpiler({
|
|
16425
16479
|
loader: "ts",
|
|
@@ -16447,7 +16501,7 @@ ${fields}
|
|
|
16447
16501
|
};
|
|
16448
16502
|
const resolveLocalImport = (specifier, fromDir) => {
|
|
16449
16503
|
if (specifier.startsWith(".") || specifier.startsWith("/")) {
|
|
16450
|
-
return resolveSourceFile2(
|
|
16504
|
+
return resolveSourceFile2(resolve27(fromDir, specifier));
|
|
16451
16505
|
}
|
|
16452
16506
|
const aliased = matchTsconfigAlias(specifier, tsconfigAliases.aliases, tsconfigAliases.baseUrl, resolveSourceFile2);
|
|
16453
16507
|
if (aliased)
|
|
@@ -16456,7 +16510,7 @@ ${fields}
|
|
|
16456
16510
|
const resolved = Bun.resolveSync(specifier, fromDir);
|
|
16457
16511
|
if (resolved.includes("/node_modules/"))
|
|
16458
16512
|
return;
|
|
16459
|
-
const absolute =
|
|
16513
|
+
const absolute = resolve27(resolved);
|
|
16460
16514
|
if (!absolute.startsWith(baseDir))
|
|
16461
16515
|
return;
|
|
16462
16516
|
return resolveSourceFile2(absolute);
|
|
@@ -16508,13 +16562,13 @@ ${fields}
|
|
|
16508
16562
|
return `${prefix}${dots}`;
|
|
16509
16563
|
return `${prefix}../${dots}`;
|
|
16510
16564
|
});
|
|
16511
|
-
if (
|
|
16565
|
+
if (resolve27(actualPath) === entryPath) {
|
|
16512
16566
|
processedContent += buildIslandMetadataExports(sourceCode);
|
|
16513
16567
|
}
|
|
16514
16568
|
return processedContent;
|
|
16515
16569
|
};
|
|
16516
16570
|
const transpileFile = async (filePath) => {
|
|
16517
|
-
const resolved =
|
|
16571
|
+
const resolved = resolve27(filePath);
|
|
16518
16572
|
if (visited.has(resolved))
|
|
16519
16573
|
return;
|
|
16520
16574
|
visited.add(resolved);
|
|
@@ -16566,7 +16620,7 @@ ${fields}
|
|
|
16566
16620
|
importRewrites.set(specifier, relativeRewrite);
|
|
16567
16621
|
return resolved2;
|
|
16568
16622
|
}).filter((path) => Boolean(path));
|
|
16569
|
-
const isEntry =
|
|
16623
|
+
const isEntry = resolve27(actualPath) === resolve27(entryPath);
|
|
16570
16624
|
const contentHash = Bun.hash(sourceCode).toString(BASE_36_RADIX);
|
|
16571
16625
|
const cacheKey2 = actualPath;
|
|
16572
16626
|
const shouldWriteFile = cacheBuster && isEntry ? true : jitContentCache.get(cacheKey2) !== contentHash || !existsSync26(targetPath);
|
|
@@ -16603,11 +16657,11 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
16603
16657
|
const compiledRoot = compiledParent;
|
|
16604
16658
|
const indexesDir = join35(compiledParent, "indexes");
|
|
16605
16659
|
await traceAngularPhase("setup/create-indexes-dir", () => fs5.mkdir(indexesDir, { recursive: true }));
|
|
16606
|
-
const aotOutputs = hmr ? [] : await traceAngularPhase("aot/compile-files", () => compileAngularFiles(entryPoints.map((entry) =>
|
|
16660
|
+
const aotOutputs = hmr ? [] : await traceAngularPhase("aot/compile-files", () => compileAngularFiles(entryPoints.map((entry) => resolve27(entry)), compiledRoot, stylePreprocessors), { entries: entryPoints.length });
|
|
16607
16661
|
if (!hmr) {
|
|
16608
16662
|
await traceAngularPhase("aot/copy-json-resources", async () => {
|
|
16609
16663
|
const cwd = process.cwd();
|
|
16610
|
-
const angularSrcDir =
|
|
16664
|
+
const angularSrcDir = resolve27(outRoot);
|
|
16611
16665
|
if (!existsSync26(angularSrcDir))
|
|
16612
16666
|
return;
|
|
16613
16667
|
const jsonGlob = new Glob6("**/*.json");
|
|
@@ -16625,7 +16679,7 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
16625
16679
|
}
|
|
16626
16680
|
const usesLegacyAngularAnimations = await traceAngularPhase("setup/legacy-animation-resolver", () => createLegacyAngularAnimationUsageResolver(outRoot));
|
|
16627
16681
|
const compileTasks = entryPoints.map(async (entry) => {
|
|
16628
|
-
const resolvedEntry =
|
|
16682
|
+
const resolvedEntry = resolve27(entry);
|
|
16629
16683
|
const relativeEntry = relative13(outRoot, resolvedEntry).replace(/\.[tj]s$/, ".js");
|
|
16630
16684
|
const compileEntry = () => compileAngularFileJIT(resolvedEntry, compiledRoot, outRoot, stylePreprocessors);
|
|
16631
16685
|
let outputs = hmr ? await traceAngularPhase("jit/compile-entry", compileEntry, {
|
|
@@ -16637,10 +16691,10 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
16637
16691
|
join35(compiledRoot, relativeEntry),
|
|
16638
16692
|
join35(compiledRoot, "pages", jsName),
|
|
16639
16693
|
join35(compiledRoot, jsName)
|
|
16640
|
-
].map((file4) =>
|
|
16694
|
+
].map((file4) => resolve27(file4));
|
|
16641
16695
|
const resolveRawServerFile = (candidatePaths) => {
|
|
16642
16696
|
const normalizedCandidates = [
|
|
16643
|
-
...candidatePaths.map((file4) =>
|
|
16697
|
+
...candidatePaths.map((file4) => resolve27(file4)),
|
|
16644
16698
|
...compiledFallbackPaths
|
|
16645
16699
|
];
|
|
16646
16700
|
let candidate = normalizedCandidates.find((file4) => existsSync26(file4) && file4.endsWith(`${sep3}${relativeEntry}`));
|
|
@@ -16730,8 +16784,8 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
16730
16784
|
const fragments = [];
|
|
16731
16785
|
if (providersInjection.appProvidersSource) {
|
|
16732
16786
|
const compiledAppProvidersPath = (() => {
|
|
16733
|
-
const angularDirAbs =
|
|
16734
|
-
const appSourceAbs =
|
|
16787
|
+
const angularDirAbs = resolve27(outRoot);
|
|
16788
|
+
const appSourceAbs = resolve27(providersInjection.appProvidersSource);
|
|
16735
16789
|
const rel = relative13(angularDirAbs, appSourceAbs).replace(/\\/g, "/");
|
|
16736
16790
|
return join35(compiledParent, rel).replace(/\.[cm]?[tj]sx?$/, ".js");
|
|
16737
16791
|
})();
|
|
@@ -17682,7 +17736,7 @@ __export(exports_fastHmrCompiler, {
|
|
|
17682
17736
|
invalidateFingerprintCache: () => invalidateFingerprintCache
|
|
17683
17737
|
});
|
|
17684
17738
|
import { existsSync as existsSync27, readFileSync as readFileSync24, statSync as statSync2 } from "fs";
|
|
17685
|
-
import { dirname as dirname20, extname as extname8, relative as relative14, resolve as
|
|
17739
|
+
import { dirname as dirname20, extname as extname8, relative as relative14, resolve as resolve28 } from "path";
|
|
17686
17740
|
import ts17 from "typescript";
|
|
17687
17741
|
var fail = (reason, detail, location) => ({
|
|
17688
17742
|
detail,
|
|
@@ -17997,7 +18051,7 @@ var fail = (reason, detail, location) => ({
|
|
|
17997
18051
|
if (!spec.startsWith(".") && !spec.startsWith("/")) {
|
|
17998
18052
|
return true;
|
|
17999
18053
|
}
|
|
18000
|
-
const base =
|
|
18054
|
+
const base = resolve28(componentDir, spec);
|
|
18001
18055
|
const candidates = [
|
|
18002
18056
|
`${base}.ts`,
|
|
18003
18057
|
`${base}.tsx`,
|
|
@@ -18813,7 +18867,7 @@ var fail = (reason, detail, location) => ({
|
|
|
18813
18867
|
return null;
|
|
18814
18868
|
}, resolveDtsFromSpec = (spec, fromDir) => {
|
|
18815
18869
|
const stripped = spec.replace(/\.[mc]?js$/, "");
|
|
18816
|
-
const base =
|
|
18870
|
+
const base = resolve28(fromDir, stripped);
|
|
18817
18871
|
const candidates = [
|
|
18818
18872
|
`${base}.d.ts`,
|
|
18819
18873
|
`${base}.d.mts`,
|
|
@@ -18837,7 +18891,7 @@ var fail = (reason, detail, location) => ({
|
|
|
18837
18891
|
return null;
|
|
18838
18892
|
}, resolveChildComponentInfo = (className, spec, componentDir, projectRoot) => {
|
|
18839
18893
|
if (spec.startsWith(".") || spec.startsWith("/")) {
|
|
18840
|
-
const base =
|
|
18894
|
+
const base = resolve28(componentDir, spec);
|
|
18841
18895
|
const candidates = [
|
|
18842
18896
|
`${base}.ts`,
|
|
18843
18897
|
`${base}.tsx`,
|
|
@@ -19056,13 +19110,13 @@ var fail = (reason, detail, location) => ({
|
|
|
19056
19110
|
}
|
|
19057
19111
|
if (!matches)
|
|
19058
19112
|
continue;
|
|
19059
|
-
const resolved =
|
|
19113
|
+
const resolved = resolve28(componentDir, spec);
|
|
19060
19114
|
for (const ext of TS_EXTENSIONS) {
|
|
19061
19115
|
const candidate = resolved + ext;
|
|
19062
19116
|
if (existsSync27(candidate))
|
|
19063
19117
|
return candidate;
|
|
19064
19118
|
}
|
|
19065
|
-
const indexCandidate =
|
|
19119
|
+
const indexCandidate = resolve28(resolved, "index.ts");
|
|
19066
19120
|
if (existsSync27(indexCandidate))
|
|
19067
19121
|
return indexCandidate;
|
|
19068
19122
|
}
|
|
@@ -19300,7 +19354,7 @@ ${transpiled}
|
|
|
19300
19354
|
}
|
|
19301
19355
|
}${staticPatch}`;
|
|
19302
19356
|
}, STYLE_PREPROCESSED_EXT, resolveAndReadStyleResource = (componentDir, url) => {
|
|
19303
|
-
const abs =
|
|
19357
|
+
const abs = resolve28(componentDir, url);
|
|
19304
19358
|
if (!existsSync27(abs))
|
|
19305
19359
|
return null;
|
|
19306
19360
|
const ext = extname8(abs).toLowerCase();
|
|
@@ -19339,7 +19393,7 @@ ${block}
|
|
|
19339
19393
|
const cached = projectOptionsCache.get(projectRoot);
|
|
19340
19394
|
if (cached !== undefined)
|
|
19341
19395
|
return cached;
|
|
19342
|
-
const tsconfigPath =
|
|
19396
|
+
const tsconfigPath = resolve28(projectRoot, "tsconfig.json");
|
|
19343
19397
|
const opts = {};
|
|
19344
19398
|
if (existsSync27(tsconfigPath)) {
|
|
19345
19399
|
try {
|
|
@@ -19423,7 +19477,7 @@ ${block}
|
|
|
19423
19477
|
templateText = decoratorMeta.template;
|
|
19424
19478
|
templatePath = componentFilePath;
|
|
19425
19479
|
} else if (decoratorMeta.templateUrl) {
|
|
19426
|
-
const tplAbs =
|
|
19480
|
+
const tplAbs = resolve28(componentDir, decoratorMeta.templateUrl);
|
|
19427
19481
|
if (!existsSync27(tplAbs)) {
|
|
19428
19482
|
return fail("template-resource-not-found", `Template file not found: ${tplAbs}`, { file: componentFilePath });
|
|
19429
19483
|
}
|
|
@@ -20194,8 +20248,8 @@ __export(exports_compileEmber, {
|
|
|
20194
20248
|
basename: () => basename13
|
|
20195
20249
|
});
|
|
20196
20250
|
import { existsSync as existsSync28 } from "fs";
|
|
20197
|
-
import { mkdir as
|
|
20198
|
-
import { basename as basename13, dirname as dirname21, extname as extname9, join as join36, resolve as
|
|
20251
|
+
import { mkdir as mkdir10, rm as rm7 } from "fs/promises";
|
|
20252
|
+
import { basename as basename13, dirname as dirname21, extname as extname9, join as join36, resolve as resolve29 } from "path";
|
|
20199
20253
|
var {build: bunBuild2, Transpiler: Transpiler4, write: write4, file: file4 } = globalThis.Bun;
|
|
20200
20254
|
var cachedPreprocessor = null, getPreprocessor = async () => {
|
|
20201
20255
|
if (cachedPreprocessor)
|
|
@@ -20291,7 +20345,7 @@ export const importSync = (specifier) => {
|
|
|
20291
20345
|
const originalImporter = stagedSourceMap.get(args.importer);
|
|
20292
20346
|
if (!originalImporter)
|
|
20293
20347
|
return;
|
|
20294
|
-
const candidateBase =
|
|
20348
|
+
const candidateBase = resolve29(dirname21(originalImporter), args.path);
|
|
20295
20349
|
const extensionsToTry = ["", ".gts", ".gjs", ".ts", ".js"];
|
|
20296
20350
|
for (const ext of extensionsToTry) {
|
|
20297
20351
|
const candidate = candidateBase + ext;
|
|
@@ -20350,7 +20404,7 @@ export const renderToHTML = (props = {}) => {
|
|
|
20350
20404
|
export { PageComponent };
|
|
20351
20405
|
export default PageComponent;
|
|
20352
20406
|
`, compileEmberFile = async (entry, compiledRoot, cwd = process.cwd()) => {
|
|
20353
|
-
const resolvedEntry =
|
|
20407
|
+
const resolvedEntry = resolve29(entry);
|
|
20354
20408
|
const source = await file4(resolvedEntry).text();
|
|
20355
20409
|
let preprocessed = source;
|
|
20356
20410
|
if (isTemplateTagFile(resolvedEntry)) {
|
|
@@ -20366,12 +20420,12 @@ export default PageComponent;
|
|
|
20366
20420
|
const serverDir = join36(compiledRoot, "server");
|
|
20367
20421
|
const clientDir = join36(compiledRoot, "client");
|
|
20368
20422
|
await Promise.all([
|
|
20369
|
-
|
|
20370
|
-
|
|
20371
|
-
|
|
20423
|
+
mkdir10(tmpDir, { recursive: true }),
|
|
20424
|
+
mkdir10(serverDir, { recursive: true }),
|
|
20425
|
+
mkdir10(clientDir, { recursive: true })
|
|
20372
20426
|
]);
|
|
20373
|
-
const tmpPagePath =
|
|
20374
|
-
const tmpHarnessPath =
|
|
20427
|
+
const tmpPagePath = resolve29(join36(tmpDir, `${baseName}.module.js`));
|
|
20428
|
+
const tmpHarnessPath = resolve29(join36(tmpDir, `${baseName}.harness.js`));
|
|
20375
20429
|
await Promise.all([
|
|
20376
20430
|
write4(tmpPagePath, transpiled),
|
|
20377
20431
|
write4(tmpHarnessPath, generateServerHarness(tmpPagePath))
|
|
@@ -20395,7 +20449,7 @@ export default PageComponent;
|
|
|
20395
20449
|
if (!buildResult.success) {
|
|
20396
20450
|
console.warn(`\u26A0\uFE0F Ember server build for ${baseName} had errors:`, buildResult.logs);
|
|
20397
20451
|
}
|
|
20398
|
-
await
|
|
20452
|
+
await rm7(tmpDir, { force: true, recursive: true });
|
|
20399
20453
|
const clientPath = join36(clientDir, `${baseName}.js`);
|
|
20400
20454
|
await write4(clientPath, transpiled);
|
|
20401
20455
|
return { clientPath, serverPath };
|
|
@@ -20413,7 +20467,7 @@ export default PageComponent;
|
|
|
20413
20467
|
serverPaths: outputs.map((o3) => o3.serverPath)
|
|
20414
20468
|
};
|
|
20415
20469
|
}, compileEmberFileSource = async (entry) => {
|
|
20416
|
-
const resolvedEntry =
|
|
20470
|
+
const resolvedEntry = resolve29(entry);
|
|
20417
20471
|
const source = await file4(resolvedEntry).text();
|
|
20418
20472
|
let preprocessed = source;
|
|
20419
20473
|
if (isTemplateTagFile(resolvedEntry)) {
|
|
@@ -20446,31 +20500,35 @@ __export(exports_buildReactVendor, {
|
|
|
20446
20500
|
buildReactVendor: () => buildReactVendor
|
|
20447
20501
|
});
|
|
20448
20502
|
import { existsSync as existsSync29, mkdirSync as mkdirSync8 } from "fs";
|
|
20449
|
-
import { join as join37, resolve as
|
|
20450
|
-
import { rm as
|
|
20503
|
+
import { join as join37, resolve as resolve30 } from "path";
|
|
20504
|
+
import { rm as rm8 } from "fs/promises";
|
|
20451
20505
|
var {build: bunBuild3 } = globalThis.Bun;
|
|
20452
20506
|
var resolveJsxDevRuntimeCompatPath = () => {
|
|
20453
20507
|
const candidates = [
|
|
20454
|
-
|
|
20455
|
-
|
|
20456
|
-
|
|
20457
|
-
|
|
20458
|
-
|
|
20459
|
-
|
|
20508
|
+
resolve30(import.meta.dir, "react", "jsxDevRuntimeCompat.js"),
|
|
20509
|
+
resolve30(import.meta.dir, "src", "react", "jsxDevRuntimeCompat.ts"),
|
|
20510
|
+
resolve30(import.meta.dir, "..", "react", "jsxDevRuntimeCompat.js"),
|
|
20511
|
+
resolve30(import.meta.dir, "..", "src", "react", "jsxDevRuntimeCompat.ts"),
|
|
20512
|
+
resolve30(import.meta.dir, "..", "..", "dist", "react", "jsxDevRuntimeCompat.js"),
|
|
20513
|
+
resolve30(import.meta.dir, "..", "..", "src", "react", "jsxDevRuntimeCompat.ts")
|
|
20460
20514
|
];
|
|
20461
20515
|
for (const candidate of candidates) {
|
|
20462
20516
|
if (existsSync29(candidate)) {
|
|
20463
20517
|
return candidate.replace(/\\/g, "/");
|
|
20464
20518
|
}
|
|
20465
20519
|
}
|
|
20466
|
-
return (candidates[0] ??
|
|
20467
|
-
}, jsxDevRuntimeCompatPath, reactSpecifiers, toSafeFileName = (specifier) => specifier.replace(/\//g, "_"), computeVendorPaths = () => {
|
|
20520
|
+
return (candidates[0] ?? resolve30(import.meta.dir, "react", "jsxDevRuntimeCompat.js")).replace(/\\/g, "/");
|
|
20521
|
+
}, jsxDevRuntimeCompatPath, jsxRuntimeCompatPath, reactSpecifiers, toSafeFileName = (specifier) => specifier.replace(/\//g, "_"), computeVendorPaths = () => {
|
|
20468
20522
|
const paths = {};
|
|
20469
20523
|
for (const specifier of reactSpecifiers) {
|
|
20470
20524
|
paths[specifier] = `/react/vendor/${toSafeFileName(specifier)}.js`;
|
|
20471
20525
|
}
|
|
20472
20526
|
return paths;
|
|
20473
20527
|
}, generateEntrySource = async (specifier) => {
|
|
20528
|
+
if (specifier === "react/jsx-runtime") {
|
|
20529
|
+
return `export { Fragment, jsx, jsxs } from '${jsxRuntimeCompatPath}';
|
|
20530
|
+
`;
|
|
20531
|
+
}
|
|
20474
20532
|
if (specifier === "react/jsx-dev-runtime") {
|
|
20475
20533
|
return `export { Fragment, jsxDEV } from '${jsxDevRuntimeCompatPath}';
|
|
20476
20534
|
`;
|
|
@@ -20514,7 +20572,7 @@ var resolveJsxDevRuntimeCompatPath = () => {
|
|
|
20514
20572
|
target: "browser",
|
|
20515
20573
|
throw: false
|
|
20516
20574
|
});
|
|
20517
|
-
await
|
|
20575
|
+
await rm8(tmpDir, { force: true, recursive: true });
|
|
20518
20576
|
if (!result.success) {
|
|
20519
20577
|
console.warn("\u26A0\uFE0F React vendor build had errors:", result.logs);
|
|
20520
20578
|
}
|
|
@@ -20522,6 +20580,7 @@ var resolveJsxDevRuntimeCompatPath = () => {
|
|
|
20522
20580
|
var init_buildReactVendor = __esm(() => {
|
|
20523
20581
|
init_generateReactIndexes();
|
|
20524
20582
|
jsxDevRuntimeCompatPath = resolveJsxDevRuntimeCompatPath();
|
|
20583
|
+
jsxRuntimeCompatPath = jsxDevRuntimeCompatPath.replace("jsxDevRuntimeCompat", "jsxRuntimeCompat");
|
|
20525
20584
|
reactSpecifiers = [
|
|
20526
20585
|
"react",
|
|
20527
20586
|
"react-dom",
|
|
@@ -20567,7 +20626,7 @@ __export(exports_buildAngularVendor, {
|
|
|
20567
20626
|
});
|
|
20568
20627
|
import { mkdirSync as mkdirSync9 } from "fs";
|
|
20569
20628
|
import { join as join38 } from "path";
|
|
20570
|
-
import { rm as
|
|
20629
|
+
import { rm as rm9 } from "fs/promises";
|
|
20571
20630
|
var {build: bunBuild4, Glob: Glob7 } = globalThis.Bun;
|
|
20572
20631
|
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) => {
|
|
20573
20632
|
try {
|
|
@@ -20686,7 +20745,7 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
|
|
|
20686
20745
|
target: "browser",
|
|
20687
20746
|
throw: false
|
|
20688
20747
|
});
|
|
20689
|
-
await
|
|
20748
|
+
await rm9(tmpDir, { force: true, recursive: true });
|
|
20690
20749
|
if (!result.success) {
|
|
20691
20750
|
console.warn("\u26A0\uFE0F Angular vendor build had errors:", result.logs);
|
|
20692
20751
|
}
|
|
@@ -20729,7 +20788,7 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
|
|
|
20729
20788
|
target: "bun",
|
|
20730
20789
|
throw: false
|
|
20731
20790
|
});
|
|
20732
|
-
await
|
|
20791
|
+
await rm9(tmpDir, { force: true, recursive: true });
|
|
20733
20792
|
if (!result.success) {
|
|
20734
20793
|
console.warn("\u26A0\uFE0F Angular server vendor build had errors:", result.logs);
|
|
20735
20794
|
}
|
|
@@ -20795,7 +20854,7 @@ __export(exports_buildVueVendor, {
|
|
|
20795
20854
|
});
|
|
20796
20855
|
import { mkdirSync as mkdirSync10 } from "fs";
|
|
20797
20856
|
import { join as join39 } from "path";
|
|
20798
|
-
import { rm as
|
|
20857
|
+
import { rm as rm10 } from "fs/promises";
|
|
20799
20858
|
var {build: bunBuild5 } = globalThis.Bun;
|
|
20800
20859
|
var vueSpecifiers, toSafeFileName3 = (specifier) => specifier.replace(/\//g, "_"), buildVueVendor = async (buildDir) => {
|
|
20801
20860
|
const vendorDir = join39(buildDir, "vue", "vendor");
|
|
@@ -20824,7 +20883,7 @@ var vueSpecifiers, toSafeFileName3 = (specifier) => specifier.replace(/\//g, "_"
|
|
|
20824
20883
|
target: "browser",
|
|
20825
20884
|
throw: false
|
|
20826
20885
|
});
|
|
20827
|
-
await
|
|
20886
|
+
await rm10(tmpDir, { force: true, recursive: true });
|
|
20828
20887
|
if (!result.success) {
|
|
20829
20888
|
console.warn("\u26A0\uFE0F Vue vendor build had errors:", result.logs);
|
|
20830
20889
|
return;
|
|
@@ -20860,7 +20919,7 @@ __export(exports_buildSvelteVendor, {
|
|
|
20860
20919
|
});
|
|
20861
20920
|
import { mkdirSync as mkdirSync11 } from "fs";
|
|
20862
20921
|
import { join as join40 } from "path";
|
|
20863
|
-
import { rm as
|
|
20922
|
+
import { rm as rm11 } from "fs/promises";
|
|
20864
20923
|
var {build: bunBuild6 } = globalThis.Bun;
|
|
20865
20924
|
var svelteSpecifiers, isResolvable2 = (specifier) => {
|
|
20866
20925
|
try {
|
|
@@ -20894,7 +20953,7 @@ var svelteSpecifiers, isResolvable2 = (specifier) => {
|
|
|
20894
20953
|
target: "browser",
|
|
20895
20954
|
throw: false
|
|
20896
20955
|
});
|
|
20897
|
-
await
|
|
20956
|
+
await rm11(tmpDir, { force: true, recursive: true });
|
|
20898
20957
|
if (!result.success) {
|
|
20899
20958
|
console.warn("\u26A0\uFE0F Svelte vendor build had errors:", result.logs);
|
|
20900
20959
|
}
|
|
@@ -20930,10 +20989,10 @@ import {
|
|
|
20930
20989
|
statSync as statSync3,
|
|
20931
20990
|
writeFileSync as writeFileSync9
|
|
20932
20991
|
} from "fs";
|
|
20933
|
-
import { basename as basename14, dirname as dirname22, extname as extname10, join as join41, relative as relative15, resolve as
|
|
20992
|
+
import { basename as basename14, dirname as dirname22, extname as extname10, join as join41, relative as relative15, resolve as resolve31 } from "path";
|
|
20934
20993
|
import { cwd, env as env3, exit } from "process";
|
|
20935
20994
|
var {build: bunBuild7, Glob: Glob8 } = globalThis.Bun;
|
|
20936
|
-
var
|
|
20995
|
+
var isBuildTraceEnabled = () => {
|
|
20937
20996
|
const value = env3.ABSOLUTE_BUILD_TRACE?.toLowerCase();
|
|
20938
20997
|
return value === "1" || value === "true" || value === "yes";
|
|
20939
20998
|
}, collectConventionSourceFiles = (entry) => {
|
|
@@ -21077,8 +21136,8 @@ ${offenders.map((o3) => ` \u2022 ${o3}`).join(`
|
|
|
21077
21136
|
}
|
|
21078
21137
|
}, resolveAbsoluteVersion = async () => {
|
|
21079
21138
|
const candidates = [
|
|
21080
|
-
|
|
21081
|
-
|
|
21139
|
+
resolve31(import.meta.dir, "..", "..", "package.json"),
|
|
21140
|
+
resolve31(import.meta.dir, "..", "package.json")
|
|
21082
21141
|
];
|
|
21083
21142
|
const resolveCandidate = async (remaining) => {
|
|
21084
21143
|
const [candidate, ...rest] = remaining;
|
|
@@ -21094,7 +21153,7 @@ ${offenders.map((o3) => ` \u2022 ${o3}`).join(`
|
|
|
21094
21153
|
};
|
|
21095
21154
|
await resolveCandidate(candidates);
|
|
21096
21155
|
}, SKIP_DIRS5, addWorkerPathIfExists = (file5, relPath, workerPaths) => {
|
|
21097
|
-
const absPath =
|
|
21156
|
+
const absPath = resolve31(file5, "..", relPath);
|
|
21098
21157
|
try {
|
|
21099
21158
|
statSync3(absPath);
|
|
21100
21159
|
workerPaths.add(absPath);
|
|
@@ -21158,7 +21217,7 @@ ${offenders.map((o3) => ` \u2022 ${o3}`).join(`
|
|
|
21158
21217
|
return;
|
|
21159
21218
|
}
|
|
21160
21219
|
const indexFiles = readDir(reactIndexesPath).filter((file5) => file5.endsWith(".tsx"));
|
|
21161
|
-
const pagesRel = relative15(process.cwd(),
|
|
21220
|
+
const pagesRel = relative15(process.cwd(), resolve31(reactPagesPath)).replace(/\\/g, "/");
|
|
21162
21221
|
for (const file5 of indexFiles) {
|
|
21163
21222
|
let content = readFileSync25(join41(reactIndexesPath, file5), "utf-8");
|
|
21164
21223
|
content = content.replace(/from\s*['"]([^'"]*\/pages\/([^'"]+))['"]/g, (_match, _fullPath, componentName) => `from '/@src/${pagesRel}/${componentName}'`);
|
|
@@ -21166,27 +21225,27 @@ ${offenders.map((o3) => ` \u2022 ${o3}`).join(`
|
|
|
21166
21225
|
}
|
|
21167
21226
|
}, copySvelteDevIndexes = (svelteDir, sveltePagesPath, svelteEntries, devIndexDir) => {
|
|
21168
21227
|
const svelteIndexDir = join41(getFrameworkGeneratedDir("svelte"), "indexes");
|
|
21169
|
-
const sveltePageEntries = svelteEntries.filter((file5) =>
|
|
21228
|
+
const sveltePageEntries = svelteEntries.filter((file5) => resolve31(file5).startsWith(resolve31(sveltePagesPath)));
|
|
21170
21229
|
for (const entry of sveltePageEntries) {
|
|
21171
21230
|
const name = basename14(entry).replace(/\.svelte(\.(ts|js))?$/, "");
|
|
21172
21231
|
const indexFile = join41(svelteIndexDir, "pages", `${name}.js`);
|
|
21173
21232
|
if (!existsSync30(indexFile))
|
|
21174
21233
|
continue;
|
|
21175
21234
|
let content = readFileSync25(indexFile, "utf-8");
|
|
21176
|
-
const srcRel = relative15(process.cwd(),
|
|
21235
|
+
const srcRel = relative15(process.cwd(), resolve31(entry)).replace(/\\/g, "/");
|
|
21177
21236
|
content = content.replace(/import\s+Component\s+from\s+['"]([^'"]+)['"]/, `import Component from "/@src/${srcRel}"`);
|
|
21178
21237
|
writeFileSync9(join41(devIndexDir, `${name}.svelte.js`), content);
|
|
21179
21238
|
}
|
|
21180
21239
|
}, copyVueDevIndexes = (vueDir, vuePagesPath, vueEntries, devIndexDir) => {
|
|
21181
21240
|
const vueIndexDir = join41(getFrameworkGeneratedDir("vue"), "indexes");
|
|
21182
|
-
const vuePageEntries = vueEntries.filter((file5) =>
|
|
21241
|
+
const vuePageEntries = vueEntries.filter((file5) => resolve31(file5).startsWith(resolve31(vuePagesPath)));
|
|
21183
21242
|
for (const entry of vuePageEntries) {
|
|
21184
21243
|
const name = basename14(entry, ".vue");
|
|
21185
21244
|
const indexFile = join41(vueIndexDir, `${name}.js`);
|
|
21186
21245
|
if (!existsSync30(indexFile))
|
|
21187
21246
|
continue;
|
|
21188
21247
|
let content = readFileSync25(indexFile, "utf-8");
|
|
21189
|
-
const srcRel = relative15(process.cwd(),
|
|
21248
|
+
const srcRel = relative15(process.cwd(), resolve31(entry)).replace(/\\/g, "/");
|
|
21190
21249
|
content = content.replace(/import\s+Comp(?:\s*,\s*\*\s+as\s+\w+)?\s+from\s+['"]([^'"]+)['"]/, (match) => match.replace(/from\s+['"][^'"]+['"]/, `from "/@src/${srcRel}"`));
|
|
21191
21250
|
writeFileSync9(join41(devIndexDir, `${name}.vue.js`), content);
|
|
21192
21251
|
}
|
|
@@ -21199,7 +21258,7 @@ ${offenders.map((o3) => ` \u2022 ${o3}`).join(`
|
|
|
21199
21258
|
const last = allComments[allComments.length - 1];
|
|
21200
21259
|
if (!last?.[1])
|
|
21201
21260
|
return JSON.stringify(outputPath);
|
|
21202
|
-
const srcPath =
|
|
21261
|
+
const srcPath = resolve31(projectRoot, last[1].replace("/client/", "/").replace(/\.js$/, ".ts"));
|
|
21203
21262
|
return JSON.stringify(srcPath);
|
|
21204
21263
|
}, QUOTE_CHARS, OPEN_BRACES, CLOSE_BRACES, findFunctionExpressionEnd = (content, startPos) => {
|
|
21205
21264
|
let depth = 0;
|
|
@@ -21299,7 +21358,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
21299
21358
|
if (changed)
|
|
21300
21359
|
writeFileSync9(outputPath, content);
|
|
21301
21360
|
}
|
|
21302
|
-
},
|
|
21361
|
+
}, bunBuildPassKeys, bunBuildPassKeySet, reservedBunBuildConfigKeys, passLockedKeys, isObject2 = (value) => typeof value === "object" && value !== null, isBunBuildPassConfig = (config) => isObject2(config) && Object.keys(config).some((key) => bunBuildPassKeySet.has(key)), sanitizeBunBuildOverride = (override, extraReservedKeys = new Set) => {
|
|
21303
21362
|
if (!override)
|
|
21304
21363
|
return {};
|
|
21305
21364
|
const sanitized = { ...override };
|
|
@@ -21372,6 +21431,8 @@ ${content.slice(firstUseIdx)}`;
|
|
|
21372
21431
|
sourcemaps
|
|
21373
21432
|
}) => {
|
|
21374
21433
|
const buildStart = performance.now();
|
|
21434
|
+
const isDev2 = resolveBuildDevelopmentMode(mode, env3.NODE_ENV);
|
|
21435
|
+
const vueFeatureFlags = resolveVueFeatureFlags(isDev2);
|
|
21375
21436
|
const projectRoot = cwd();
|
|
21376
21437
|
const traceEnabled = isBuildTraceEnabled();
|
|
21377
21438
|
const traceEvents = [];
|
|
@@ -21536,13 +21597,13 @@ ${content.slice(firstUseIdx)}`;
|
|
|
21536
21597
|
const filterToIncrementalEntries = (entryPoints, mapToSource) => {
|
|
21537
21598
|
if (!isIncremental || !incrementalFiles)
|
|
21538
21599
|
return entryPoints;
|
|
21539
|
-
const normalizedIncremental = new Set(incrementalFiles.map((f2) =>
|
|
21600
|
+
const normalizedIncremental = new Set(incrementalFiles.map((f2) => resolve31(f2)));
|
|
21540
21601
|
const matchingEntries = [];
|
|
21541
21602
|
for (const entry of entryPoints) {
|
|
21542
21603
|
const sourceFile = mapToSource(entry);
|
|
21543
21604
|
if (!sourceFile)
|
|
21544
21605
|
continue;
|
|
21545
|
-
if (!normalizedIncremental.has(
|
|
21606
|
+
if (!normalizedIncremental.has(resolve31(sourceFile)))
|
|
21546
21607
|
continue;
|
|
21547
21608
|
matchingEntries.push(entry);
|
|
21548
21609
|
}
|
|
@@ -21711,7 +21772,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
21711
21772
|
}
|
|
21712
21773
|
const shouldIncludeHtmlAssets = !isIncremental || normalizedIncrementalFiles?.some((f2) => f2.includes("/html/") && (f2.endsWith(".html") || isStylePath(f2)));
|
|
21713
21774
|
const reactEntries = isIncremental && reactIndexesPath && reactPagesPath ? filterToIncrementalEntries(allReactEntries, (entry) => {
|
|
21714
|
-
if (entry.startsWith(
|
|
21775
|
+
if (entry.startsWith(resolve31(reactIndexesPath))) {
|
|
21715
21776
|
const pageName = basename14(entry, ".tsx");
|
|
21716
21777
|
return join41(reactPagesPath, `${pageName}.tsx`);
|
|
21717
21778
|
}
|
|
@@ -21745,7 +21806,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
21745
21806
|
for (const entry of vueEntries) {
|
|
21746
21807
|
const name = basename14(entry, ".vue");
|
|
21747
21808
|
if (ssrOnlyPageNames.has(name)) {
|
|
21748
|
-
resolved.add(
|
|
21809
|
+
resolved.add(resolve31(entry));
|
|
21749
21810
|
}
|
|
21750
21811
|
}
|
|
21751
21812
|
return resolved;
|
|
@@ -21882,7 +21943,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
21882
21943
|
const clientPath = islandSvelteClientPaths[idx];
|
|
21883
21944
|
if (!sourcePath || !clientPath)
|
|
21884
21945
|
continue;
|
|
21885
|
-
islandSvelteClientPathMap.set(
|
|
21946
|
+
islandSvelteClientPathMap.set(resolve31(sourcePath), clientPath);
|
|
21886
21947
|
}
|
|
21887
21948
|
const islandVueClientPathMap = new Map;
|
|
21888
21949
|
for (let idx = 0;idx < islandVueSources.length; idx++) {
|
|
@@ -21890,7 +21951,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
21890
21951
|
const clientPath = islandVueClientPaths[idx];
|
|
21891
21952
|
if (!sourcePath || !clientPath)
|
|
21892
21953
|
continue;
|
|
21893
|
-
islandVueClientPathMap.set(
|
|
21954
|
+
islandVueClientPathMap.set(resolve31(sourcePath), clientPath);
|
|
21894
21955
|
}
|
|
21895
21956
|
const islandAngularClientPathMap = new Map;
|
|
21896
21957
|
for (let idx = 0;idx < islandAngularSources.length; idx++) {
|
|
@@ -21898,7 +21959,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
21898
21959
|
const clientPath = islandAngularClientPaths[idx];
|
|
21899
21960
|
if (!sourcePath || !clientPath)
|
|
21900
21961
|
continue;
|
|
21901
|
-
islandAngularClientPathMap.set(
|
|
21962
|
+
islandAngularClientPathMap.set(resolve31(sourcePath), clientPath);
|
|
21902
21963
|
}
|
|
21903
21964
|
const reactConventionSources = collectConventionSourceFiles(conventionsMap.react);
|
|
21904
21965
|
const svelteConventionSources = collectConventionSourceFiles(conventionsMap.svelte);
|
|
@@ -22647,7 +22708,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
22647
22708
|
}
|
|
22648
22709
|
await tracePhase("cleanup/generated", () => cleanup({
|
|
22649
22710
|
angularDir,
|
|
22650
|
-
preserveAngularGenerated:
|
|
22711
|
+
preserveAngularGenerated: hmr && angularDir !== undefined,
|
|
22651
22712
|
reactDir,
|
|
22652
22713
|
svelteDir,
|
|
22653
22714
|
vueDir
|
|
@@ -22764,7 +22825,6 @@ var init_build = __esm(() => {
|
|
|
22764
22825
|
init_logger();
|
|
22765
22826
|
init_validateSafePath();
|
|
22766
22827
|
init_spaRouteManifest();
|
|
22767
|
-
isDev2 = env3.NODE_ENV === "development";
|
|
22768
22828
|
REACT_VENDOR_SPECIFIERS = [
|
|
22769
22829
|
"react-dom/client",
|
|
22770
22830
|
"react-refresh/runtime",
|
|
@@ -22801,11 +22861,6 @@ var init_build = __esm(() => {
|
|
|
22801
22861
|
`if(nv&&ov&&typeof nv==="object"&&"value"in nv&&!nv.effect&&typeof nv.value===typeof ov.value)nv.value=ov.value;}`,
|
|
22802
22862
|
`}}return r;};}`
|
|
22803
22863
|
].join("");
|
|
22804
|
-
vueFeatureFlags = {
|
|
22805
|
-
__VUE_OPTIONS_API__: "true",
|
|
22806
|
-
__VUE_PROD_DEVTOOLS__: isDev2 ? "true" : "false",
|
|
22807
|
-
__VUE_PROD_HYDRATION_MISMATCH_DETAILS__: isDev2 ? "true" : "false"
|
|
22808
|
-
};
|
|
22809
22864
|
bunBuildPassKeys = [
|
|
22810
22865
|
"server",
|
|
22811
22866
|
"reactClient",
|
|
@@ -22833,7 +22888,7 @@ var init_build = __esm(() => {
|
|
|
22833
22888
|
// src/build/buildEmberVendor.ts
|
|
22834
22889
|
import { mkdirSync as mkdirSync13, existsSync as existsSync31 } from "fs";
|
|
22835
22890
|
import { join as join42 } from "path";
|
|
22836
|
-
import { rm as
|
|
22891
|
+
import { rm as rm12 } from "fs/promises";
|
|
22837
22892
|
var {build: bunBuild8 } = globalThis.Bun;
|
|
22838
22893
|
var toSafeFileName5 = (specifier) => specifier.replace(/^@/, "").replace(/\//g, "_"), generateMacrosShim = () => `// Generated shim for @embroider/macros \u2014 provides minimal runtime
|
|
22839
22894
|
// implementations for macros that would normally be replaced at
|
|
@@ -22950,7 +23005,7 @@ export const importSync = (specifier) => {
|
|
|
22950
23005
|
target: "browser",
|
|
22951
23006
|
throw: false
|
|
22952
23007
|
});
|
|
22953
|
-
await
|
|
23008
|
+
await rm12(tmpDir, { force: true, recursive: true });
|
|
22954
23009
|
if (!result.success) {
|
|
22955
23010
|
console.warn("\u26A0\uFE0F Ember vendor build had errors:", result.logs);
|
|
22956
23011
|
}
|
|
@@ -23091,7 +23146,7 @@ __export(exports_dependencyGraph, {
|
|
|
23091
23146
|
});
|
|
23092
23147
|
import { existsSync as existsSync32, readFileSync as readFileSync26 } from "fs";
|
|
23093
23148
|
var {Glob: Glob9 } = globalThis.Bun;
|
|
23094
|
-
import { resolve as
|
|
23149
|
+
import { resolve as resolve32 } from "path";
|
|
23095
23150
|
var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath) => {
|
|
23096
23151
|
const lower = filePath.toLowerCase();
|
|
23097
23152
|
if (lower.endsWith(".ts") || lower.endsWith(".tsx") || lower.endsWith(".jsx"))
|
|
@@ -23105,8 +23160,8 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
23105
23160
|
if (!importPath.startsWith(".") && !importPath.startsWith("/")) {
|
|
23106
23161
|
return null;
|
|
23107
23162
|
}
|
|
23108
|
-
const fromDir =
|
|
23109
|
-
const normalized =
|
|
23163
|
+
const fromDir = resolve32(fromFile, "..");
|
|
23164
|
+
const normalized = resolve32(fromDir, importPath);
|
|
23110
23165
|
const extensions = [
|
|
23111
23166
|
".ts",
|
|
23112
23167
|
".tsx",
|
|
@@ -23136,7 +23191,7 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
23136
23191
|
dependents.delete(normalizedPath);
|
|
23137
23192
|
}
|
|
23138
23193
|
}, addFileToGraph = (graph, filePath) => {
|
|
23139
|
-
const normalizedPath =
|
|
23194
|
+
const normalizedPath = resolve32(filePath);
|
|
23140
23195
|
if (!existsSync32(normalizedPath))
|
|
23141
23196
|
return;
|
|
23142
23197
|
const dependencies = extractDependencies(normalizedPath);
|
|
@@ -23163,10 +23218,10 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
23163
23218
|
}, IGNORED_SEGMENTS, buildInitialDependencyGraph = (graph, directories) => {
|
|
23164
23219
|
const processedFiles = new Set;
|
|
23165
23220
|
const glob = new Glob9("**/*.{ts,tsx,js,jsx,vue,svelte,html,htm}");
|
|
23166
|
-
const resolvedDirs = directories.map((dir) =>
|
|
23221
|
+
const resolvedDirs = directories.map((dir) => resolve32(dir)).filter((dir) => existsSync32(dir));
|
|
23167
23222
|
const allFiles = resolvedDirs.flatMap((dir) => Array.from(glob.scanSync({ absolute: true, cwd: dir })));
|
|
23168
23223
|
for (const file5 of allFiles) {
|
|
23169
|
-
const fullPath =
|
|
23224
|
+
const fullPath = resolve32(file5);
|
|
23170
23225
|
if (IGNORED_SEGMENTS.some((seg) => fullPath.includes(seg)))
|
|
23171
23226
|
continue;
|
|
23172
23227
|
if (processedFiles.has(fullPath))
|
|
@@ -23279,7 +23334,7 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
23279
23334
|
return [];
|
|
23280
23335
|
}
|
|
23281
23336
|
}, getAffectedFiles = (graph, changedFile) => {
|
|
23282
|
-
const normalizedPath =
|
|
23337
|
+
const normalizedPath = resolve32(changedFile);
|
|
23283
23338
|
const affected = new Set;
|
|
23284
23339
|
const toProcess = [normalizedPath];
|
|
23285
23340
|
const processNode = (current) => {
|
|
@@ -23310,7 +23365,7 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
23310
23365
|
}, removeDependentsForFile = (graph, normalizedPath) => {
|
|
23311
23366
|
graph.dependents.delete(normalizedPath);
|
|
23312
23367
|
}, removeFileFromGraph = (graph, filePath) => {
|
|
23313
|
-
const normalizedPath =
|
|
23368
|
+
const normalizedPath = resolve32(filePath);
|
|
23314
23369
|
removeDepsForFile(graph, normalizedPath);
|
|
23315
23370
|
removeDependentsForFile(graph, normalizedPath);
|
|
23316
23371
|
};
|
|
@@ -23353,12 +23408,12 @@ var globalVersionCounter = 0, createModuleVersionTracker = () => new Map, getNex
|
|
|
23353
23408
|
};
|
|
23354
23409
|
|
|
23355
23410
|
// src/dev/configResolver.ts
|
|
23356
|
-
import { resolve as
|
|
23411
|
+
import { resolve as resolve33 } from "path";
|
|
23357
23412
|
var resolveBuildPaths = (config) => {
|
|
23358
23413
|
const cwd2 = process.cwd();
|
|
23359
23414
|
const normalize = (path) => path.replace(/\\/g, "/");
|
|
23360
|
-
const withDefault = (value, fallback) => normalize(
|
|
23361
|
-
const optional = (value) => value ? normalize(
|
|
23415
|
+
const withDefault = (value, fallback) => normalize(resolve33(cwd2, value ?? fallback));
|
|
23416
|
+
const optional = (value) => value ? normalize(resolve33(cwd2, value)) : undefined;
|
|
23362
23417
|
return {
|
|
23363
23418
|
angularDir: optional(config.angularDirectory),
|
|
23364
23419
|
assetsDir: optional(config.assetsDirectory),
|
|
@@ -23366,6 +23421,8 @@ var resolveBuildPaths = (config) => {
|
|
|
23366
23421
|
emberDir: optional(config.emberDirectory),
|
|
23367
23422
|
htmlDir: optional(config.htmlDirectory),
|
|
23368
23423
|
htmxDir: optional(config.htmxDirectory),
|
|
23424
|
+
mobileBundleDir: optional(config.mobile?.bundleDirectory ?? (config.mobile ? ".absolutejs/mobile/web" : undefined)),
|
|
23425
|
+
mobileNativeDir: optional(config.mobile?.nativeProject?.directory ?? (config.mobile ? "mobile" : undefined)),
|
|
23369
23426
|
publicDir: optional(config.publicDirectory),
|
|
23370
23427
|
reactDir: optional(config.reactDirectory),
|
|
23371
23428
|
stylesDir: optional(typeof config.stylesConfig === "string" ? config.stylesConfig : config.stylesConfig?.path),
|
|
@@ -23385,7 +23442,9 @@ var createHMRState = (config) => ({
|
|
|
23385
23442
|
dependencyGraph: emptyDependencyGraph,
|
|
23386
23443
|
fileChangeQueue: new Map,
|
|
23387
23444
|
fileHashes: new Map,
|
|
23445
|
+
hmrUpdates: new Map,
|
|
23388
23446
|
isRebuilding: false,
|
|
23447
|
+
lastBroadcastTimestamp: 0,
|
|
23389
23448
|
manifest: {},
|
|
23390
23449
|
moduleVersions: createModuleVersionTracker(),
|
|
23391
23450
|
rebuildCount: 0,
|
|
@@ -23412,7 +23471,7 @@ var init_clientManager = __esm(() => {
|
|
|
23412
23471
|
|
|
23413
23472
|
// src/dev/pathUtils.ts
|
|
23414
23473
|
import { existsSync as existsSync33, readdirSync as readdirSync6, readFileSync as readFileSync27 } from "fs";
|
|
23415
|
-
import { dirname as dirname23, resolve as
|
|
23474
|
+
import { dirname as dirname23, resolve as resolve34 } from "path";
|
|
23416
23475
|
var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
23417
23476
|
if (shouldIgnorePath(filePath, resolved)) {
|
|
23418
23477
|
return "ignored";
|
|
@@ -23488,7 +23547,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
23488
23547
|
return "unknown";
|
|
23489
23548
|
}, collectAngularResourceDirs = (angularDir) => {
|
|
23490
23549
|
const out = new Set;
|
|
23491
|
-
const angularRoot =
|
|
23550
|
+
const angularRoot = resolve34(angularDir);
|
|
23492
23551
|
const angularRootNormalized = normalizePath2(angularRoot);
|
|
23493
23552
|
const walk = (dir) => {
|
|
23494
23553
|
let entries;
|
|
@@ -23501,7 +23560,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
23501
23560
|
if (entry.name.startsWith(".") || entry.name === "node_modules") {
|
|
23502
23561
|
continue;
|
|
23503
23562
|
}
|
|
23504
|
-
const full =
|
|
23563
|
+
const full = resolve34(dir, entry.name);
|
|
23505
23564
|
if (entry.isDirectory()) {
|
|
23506
23565
|
walk(full);
|
|
23507
23566
|
continue;
|
|
@@ -23542,7 +23601,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
23542
23601
|
}
|
|
23543
23602
|
const componentDir = dirname23(full);
|
|
23544
23603
|
for (const ref of refs) {
|
|
23545
|
-
const refAbs = normalizePath2(
|
|
23604
|
+
const refAbs = normalizePath2(resolve34(componentDir, ref));
|
|
23546
23605
|
const refDir = normalizePath2(dirname23(refAbs));
|
|
23547
23606
|
if (refDir === angularRootNormalized || refDir.startsWith(`${angularRootNormalized}/`)) {
|
|
23548
23607
|
continue;
|
|
@@ -23559,7 +23618,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
23559
23618
|
const push = (path) => {
|
|
23560
23619
|
if (!path)
|
|
23561
23620
|
return;
|
|
23562
|
-
const abs = normalizePath2(
|
|
23621
|
+
const abs = normalizePath2(resolve34(cwd2, path));
|
|
23563
23622
|
if (!roots.includes(abs))
|
|
23564
23623
|
roots.push(abs);
|
|
23565
23624
|
};
|
|
@@ -23584,7 +23643,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
23584
23643
|
push(cfg.assetsDir);
|
|
23585
23644
|
push(cfg.stylesDir);
|
|
23586
23645
|
for (const candidate of ["src", "db", "assets", "styles"]) {
|
|
23587
|
-
const abs = normalizePath2(
|
|
23646
|
+
const abs = normalizePath2(resolve34(cwd2, candidate));
|
|
23588
23647
|
if (existsSync33(abs) && !roots.includes(abs))
|
|
23589
23648
|
roots.push(abs);
|
|
23590
23649
|
}
|
|
@@ -23595,7 +23654,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
23595
23654
|
continue;
|
|
23596
23655
|
if (entry.name.startsWith("."))
|
|
23597
23656
|
continue;
|
|
23598
|
-
const abs = normalizePath2(
|
|
23657
|
+
const abs = normalizePath2(resolve34(cwd2, entry.name));
|
|
23599
23658
|
if (roots.includes(abs))
|
|
23600
23659
|
continue;
|
|
23601
23660
|
if (shouldIgnorePath(abs, resolved))
|
|
@@ -23652,6 +23711,15 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
23652
23711
|
if (styles)
|
|
23653
23712
|
return false;
|
|
23654
23713
|
}
|
|
23714
|
+
const isInside = (root) => {
|
|
23715
|
+
if (!root)
|
|
23716
|
+
return false;
|
|
23717
|
+
const normalizedRoot = root.replace(/\\/g, "/").replace(/\/$/, "");
|
|
23718
|
+
return normalized === normalizedRoot || normalized.startsWith(`${normalizedRoot}/`);
|
|
23719
|
+
};
|
|
23720
|
+
if (isInside(resolved?.buildDir) || isInside(resolved?.mobileBundleDir) || isInside(resolved?.mobileNativeDir)) {
|
|
23721
|
+
return true;
|
|
23722
|
+
}
|
|
23655
23723
|
if (HARD_DENY_PATTERN.test(normalized))
|
|
23656
23724
|
return true;
|
|
23657
23725
|
if (normalized.endsWith(".log"))
|
|
@@ -23670,7 +23738,7 @@ var init_pathUtils = __esm(() => {
|
|
|
23670
23738
|
// src/dev/fileWatcher.ts
|
|
23671
23739
|
import { watch } from "fs";
|
|
23672
23740
|
import { existsSync as existsSync34, readdirSync as readdirSync7, statSync as statSync4 } from "fs";
|
|
23673
|
-
import { dirname as dirname24, join as join43, resolve as
|
|
23741
|
+
import { dirname as dirname24, join as join43, resolve as resolve35 } from "path";
|
|
23674
23742
|
var safeRemoveFromGraph = (graph, fullPath) => {
|
|
23675
23743
|
try {
|
|
23676
23744
|
removeFileFromGraph(graph, fullPath);
|
|
@@ -23690,7 +23758,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
23690
23758
|
});
|
|
23691
23759
|
}
|
|
23692
23760
|
}, ATOMIC_WRITE_TEMP_PATTERNS, shouldSkipFilename = (filename, isStylesDir) => !isStylesDir && (filename === "compiled" || filename === "generated" || filename === "build" || filename === "indexes" || filename === "server" || filename === "client" || filename.includes("/compiled/") || filename.includes("/generated/") || filename.includes("/build/") || filename.includes("/indexes/") || filename.includes("/server/") || filename.includes("/client/") || filename.startsWith("compiled/") || filename.startsWith("generated/") || filename.startsWith("build/") || filename.startsWith("indexes/") || filename.startsWith("server/") || filename.startsWith("client/")) || filename.endsWith("/") || filename.includes(".tmp.") || filename.endsWith(".tmp") || filename.endsWith("~") || filename.startsWith(".#") || filename.startsWith(".absolutejs-hmr-") || ATOMIC_WRITE_TEMP_PATTERNS.some((pattern) => pattern.test(filename)), setupWatcher = (absolutePath, isStylesDir, state, onFileChange) => {
|
|
23693
|
-
const ATOMIC_RECOVERY_WINDOW_MS =
|
|
23761
|
+
const ATOMIC_RECOVERY_WINDOW_MS = 5000;
|
|
23694
23762
|
const atomicRecoveryScan = (eventDir) => {
|
|
23695
23763
|
let entries;
|
|
23696
23764
|
try {
|
|
@@ -23750,7 +23818,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
23750
23818
|
}, addFileWatchers = (state, paths, onFileChange) => {
|
|
23751
23819
|
const stylesDir = state.resolvedPaths?.stylesDir;
|
|
23752
23820
|
paths.forEach((path) => {
|
|
23753
|
-
const absolutePath =
|
|
23821
|
+
const absolutePath = resolve35(path).replace(/\\/g, "/");
|
|
23754
23822
|
if (!existsSync34(absolutePath)) {
|
|
23755
23823
|
return;
|
|
23756
23824
|
}
|
|
@@ -23761,7 +23829,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
23761
23829
|
const watchPaths = getWatchPaths(config, state.resolvedPaths);
|
|
23762
23830
|
const stylesDir = state.resolvedPaths?.stylesDir;
|
|
23763
23831
|
watchPaths.forEach((path) => {
|
|
23764
|
-
const absolutePath =
|
|
23832
|
+
const absolutePath = resolve35(path).replace(/\\/g, "/");
|
|
23765
23833
|
if (!existsSync34(absolutePath)) {
|
|
23766
23834
|
return;
|
|
23767
23835
|
}
|
|
@@ -23780,13 +23848,13 @@ var init_fileWatcher = __esm(() => {
|
|
|
23780
23848
|
});
|
|
23781
23849
|
|
|
23782
23850
|
// src/dev/assetStore.ts
|
|
23783
|
-
import { resolve as
|
|
23851
|
+
import { resolve as resolve36 } from "path";
|
|
23784
23852
|
import { readdir as readdir5, unlink } from "fs/promises";
|
|
23785
23853
|
var mimeTypes, getMimeType = (filePath) => {
|
|
23786
23854
|
const ext = filePath.slice(filePath.lastIndexOf("."));
|
|
23787
23855
|
return mimeTypes[ext] ?? "application/octet-stream";
|
|
23788
23856
|
}, HASHED_FILE_RE, stripHash = (webPath) => webPath.replace(/\.[a-z0-9]{8}(\.(js|css|mjs))$/, "$1"), processWalkEntry = (entry, dir, liveByIdentity, walkAndClean) => {
|
|
23789
|
-
const fullPath =
|
|
23857
|
+
const fullPath = resolve36(dir, entry.name);
|
|
23790
23858
|
if (entry.isDirectory()) {
|
|
23791
23859
|
return walkAndClean(fullPath);
|
|
23792
23860
|
}
|
|
@@ -23802,10 +23870,10 @@ var mimeTypes, getMimeType = (filePath) => {
|
|
|
23802
23870
|
}, cleanStaleAssets = async (store, manifest, buildDir) => {
|
|
23803
23871
|
const liveByIdentity = new Map;
|
|
23804
23872
|
for (const webPath of store.keys()) {
|
|
23805
|
-
const diskPath =
|
|
23873
|
+
const diskPath = resolve36(buildDir, webPath.slice(1));
|
|
23806
23874
|
liveByIdentity.set(stripHash(diskPath), diskPath);
|
|
23807
23875
|
}
|
|
23808
|
-
const absBuildDir =
|
|
23876
|
+
const absBuildDir = resolve36(buildDir);
|
|
23809
23877
|
Object.values(manifest).forEach((val) => {
|
|
23810
23878
|
if (!HASHED_FILE_RE.test(val))
|
|
23811
23879
|
return;
|
|
@@ -23823,7 +23891,7 @@ var mimeTypes, getMimeType = (filePath) => {
|
|
|
23823
23891
|
} catch {}
|
|
23824
23892
|
}, lookupAsset = (store, path) => store.get(path), processScanEntry = (entry, dir, prefix, store, scanDir) => {
|
|
23825
23893
|
if (entry.isDirectory()) {
|
|
23826
|
-
return scanDir(
|
|
23894
|
+
return scanDir(resolve36(dir, entry.name), `${prefix}${entry.name}/`);
|
|
23827
23895
|
}
|
|
23828
23896
|
if (!entry.name.startsWith("chunk-")) {
|
|
23829
23897
|
return null;
|
|
@@ -23832,7 +23900,7 @@ var mimeTypes, getMimeType = (filePath) => {
|
|
|
23832
23900
|
if (store.has(webPath)) {
|
|
23833
23901
|
return null;
|
|
23834
23902
|
}
|
|
23835
|
-
return Bun.file(
|
|
23903
|
+
return Bun.file(resolve36(dir, entry.name)).bytes().then((bytes) => {
|
|
23836
23904
|
store.set(webPath, bytes);
|
|
23837
23905
|
return;
|
|
23838
23906
|
}).catch(() => {});
|
|
@@ -23854,7 +23922,7 @@ var mimeTypes, getMimeType = (filePath) => {
|
|
|
23854
23922
|
for (const webPath of newIdentities.values()) {
|
|
23855
23923
|
if (store.has(webPath))
|
|
23856
23924
|
continue;
|
|
23857
|
-
loadPromises.push(Bun.file(
|
|
23925
|
+
loadPromises.push(Bun.file(resolve36(buildDir, webPath.slice(1))).bytes().then((bytes) => {
|
|
23858
23926
|
store.set(webPath, bytes);
|
|
23859
23927
|
return;
|
|
23860
23928
|
}).catch(() => {}));
|
|
@@ -23995,9 +24063,9 @@ var init_transformCache = __esm(() => {
|
|
|
23995
24063
|
});
|
|
23996
24064
|
|
|
23997
24065
|
// src/dev/reactComponentClassifier.ts
|
|
23998
|
-
import { resolve as
|
|
24066
|
+
import { resolve as resolve37 } from "path";
|
|
23999
24067
|
var classifyComponent = (filePath) => {
|
|
24000
|
-
const normalizedPath =
|
|
24068
|
+
const normalizedPath = resolve37(filePath);
|
|
24001
24069
|
if (normalizedPath.includes("/react/pages/")) {
|
|
24002
24070
|
return "server";
|
|
24003
24071
|
}
|
|
@@ -24009,7 +24077,7 @@ var classifyComponent = (filePath) => {
|
|
|
24009
24077
|
var init_reactComponentClassifier = () => {};
|
|
24010
24078
|
|
|
24011
24079
|
// src/dev/moduleMapper.ts
|
|
24012
|
-
import { basename as basename15, resolve as
|
|
24080
|
+
import { basename as basename15, resolve as resolve38 } from "path";
|
|
24013
24081
|
var buildModulePaths = (moduleKeys, manifest) => {
|
|
24014
24082
|
const modulePaths = {};
|
|
24015
24083
|
moduleKeys.forEach((key) => {
|
|
@@ -24019,7 +24087,7 @@ var buildModulePaths = (moduleKeys, manifest) => {
|
|
|
24019
24087
|
});
|
|
24020
24088
|
return modulePaths;
|
|
24021
24089
|
}, processChangedFile = (sourceFile, framework, manifest, resolvedPaths, processedFiles) => {
|
|
24022
|
-
const normalizedFile =
|
|
24090
|
+
const normalizedFile = resolve38(sourceFile);
|
|
24023
24091
|
const normalizedPath = normalizedFile.replace(/\\/g, "/");
|
|
24024
24092
|
if (processedFiles.has(normalizedFile)) {
|
|
24025
24093
|
return null;
|
|
@@ -24055,7 +24123,7 @@ var buildModulePaths = (moduleKeys, manifest) => {
|
|
|
24055
24123
|
});
|
|
24056
24124
|
return grouped;
|
|
24057
24125
|
}, mapSourceFileToManifestKeys = (sourceFile, framework, resolvedPaths) => {
|
|
24058
|
-
const normalizedFile =
|
|
24126
|
+
const normalizedFile = resolve38(sourceFile);
|
|
24059
24127
|
const fileName = basename15(normalizedFile);
|
|
24060
24128
|
const baseName = fileName.replace(/\.(tsx?|jsx?|vue|svelte|css|html)$/, "");
|
|
24061
24129
|
const pascalName = toPascal(baseName);
|
|
@@ -24110,14 +24178,14 @@ var init_moduleMapper = __esm(() => {
|
|
|
24110
24178
|
});
|
|
24111
24179
|
|
|
24112
24180
|
// src/utils/spaRouteCss.ts
|
|
24113
|
-
import { readFile as
|
|
24114
|
-
import { dirname as dirname25, isAbsolute as isAbsolute5, resolve as
|
|
24181
|
+
import { readFile as readFile9 } from "fs/promises";
|
|
24182
|
+
import { dirname as dirname25, isAbsolute as isAbsolute5, resolve as resolve39 } from "path";
|
|
24115
24183
|
var sideManifestCache, readSideManifest = async (sideManifestPath) => {
|
|
24116
24184
|
const cached = sideManifestCache.get(sideManifestPath);
|
|
24117
24185
|
if (cached !== undefined)
|
|
24118
24186
|
return cached;
|
|
24119
24187
|
try {
|
|
24120
|
-
const raw = await
|
|
24188
|
+
const raw = await readFile9(sideManifestPath, "utf-8");
|
|
24121
24189
|
const parsed = JSON.parse(raw);
|
|
24122
24190
|
const routes = Array.isArray(parsed) ? parsed : [];
|
|
24123
24191
|
sideManifestCache.set(sideManifestPath, routes);
|
|
@@ -24149,12 +24217,12 @@ var sideManifestCache, readSideManifest = async (sideManifestPath) => {
|
|
|
24149
24217
|
}, readChildCss = async (cssPath, sideManifestPath) => {
|
|
24150
24218
|
if (!cssPath)
|
|
24151
24219
|
return "";
|
|
24152
|
-
const resolvedCssPath = isAbsolute5(cssPath) ? cssPath :
|
|
24220
|
+
const resolvedCssPath = isAbsolute5(cssPath) ? cssPath : resolve39(dirname25(sideManifestPath), cssPath);
|
|
24153
24221
|
const cached = childCssCache.get(resolvedCssPath);
|
|
24154
24222
|
if (cached !== undefined)
|
|
24155
24223
|
return cached;
|
|
24156
24224
|
try {
|
|
24157
|
-
const css = await
|
|
24225
|
+
const css = await readFile9(resolvedCssPath, "utf-8");
|
|
24158
24226
|
childCssCache.set(resolvedCssPath, css);
|
|
24159
24227
|
return css;
|
|
24160
24228
|
} catch {
|
|
@@ -24211,9 +24279,9 @@ var siblingCssCache, clearSiblingCssCache = () => {
|
|
|
24211
24279
|
const cached = siblingCssCache.get(cssPath);
|
|
24212
24280
|
if (cached !== undefined)
|
|
24213
24281
|
return cached;
|
|
24214
|
-
const { readFile:
|
|
24282
|
+
const { readFile: readFile10 } = await import("fs/promises");
|
|
24215
24283
|
try {
|
|
24216
|
-
const css = await
|
|
24284
|
+
const css = await readFile10(cssPath, "utf-8");
|
|
24217
24285
|
siblingCssCache.set(cssPath, css);
|
|
24218
24286
|
return css;
|
|
24219
24287
|
} catch {
|
|
@@ -24233,7 +24301,7 @@ __export(exports_resolveOwningComponents, {
|
|
|
24233
24301
|
invalidateResourceIndex: () => invalidateResourceIndex
|
|
24234
24302
|
});
|
|
24235
24303
|
import { readdirSync as readdirSync8, readFileSync as readFileSync29, statSync as statSync5 } from "fs";
|
|
24236
|
-
import { dirname as dirname26, extname as extname11, join as join44, resolve as
|
|
24304
|
+
import { dirname as dirname26, extname as extname11, join as join44, resolve as resolve40 } from "path";
|
|
24237
24305
|
import ts18 from "typescript";
|
|
24238
24306
|
var ENTITY_DECORATORS, isAngularSourceFile = (file5) => file5.endsWith(".ts") || file5.endsWith(".tsx"), walkAngularSourceFiles = (root) => {
|
|
24239
24307
|
const out = [];
|
|
@@ -24346,7 +24414,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file5) => file5.endsWith(".ts") ||
|
|
|
24346
24414
|
};
|
|
24347
24415
|
visit(sourceFile);
|
|
24348
24416
|
return out;
|
|
24349
|
-
}, safeNormalize = (path) =>
|
|
24417
|
+
}, safeNormalize = (path) => resolve40(path).replace(/\\/g, "/"), resolveOwningComponents = (params) => {
|
|
24350
24418
|
const { changedFilePath, userAngularRoot } = params;
|
|
24351
24419
|
const changedAbs = safeNormalize(changedFilePath);
|
|
24352
24420
|
const out = [];
|
|
@@ -24415,7 +24483,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file5) => file5.endsWith(".ts") ||
|
|
|
24415
24483
|
if (!spec.startsWith(".") && !spec.startsWith("/")) {
|
|
24416
24484
|
return null;
|
|
24417
24485
|
}
|
|
24418
|
-
const base =
|
|
24486
|
+
const base = resolve40(childDir, spec);
|
|
24419
24487
|
const candidates = [
|
|
24420
24488
|
`${base}.ts`,
|
|
24421
24489
|
`${base}.tsx`,
|
|
@@ -24453,7 +24521,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file5) => file5.endsWith(".ts") ||
|
|
|
24453
24521
|
};
|
|
24454
24522
|
if (cls.kind === "component") {
|
|
24455
24523
|
for (const url of [...cls.templateUrls, ...cls.styleUrls]) {
|
|
24456
|
-
const abs = safeNormalize(
|
|
24524
|
+
const abs = safeNormalize(resolve40(componentDir, url));
|
|
24457
24525
|
const existing = resource.get(abs);
|
|
24458
24526
|
if (existing)
|
|
24459
24527
|
existing.push(entity);
|
|
@@ -24509,7 +24577,33 @@ __export(exports_webSocket, {
|
|
|
24509
24577
|
handleClientConnect: () => handleClientConnect,
|
|
24510
24578
|
broadcastToClients: () => broadcastToClients
|
|
24511
24579
|
});
|
|
24512
|
-
var
|
|
24580
|
+
var MAX_RETAINED_HMR_UPDATES = 100, normalizedHmrTarget = (value) => {
|
|
24581
|
+
if (value === "capacitor-android")
|
|
24582
|
+
return value;
|
|
24583
|
+
if (value === "capacitor-ios")
|
|
24584
|
+
return value;
|
|
24585
|
+
if (value === "capacitor-native")
|
|
24586
|
+
return value;
|
|
24587
|
+
return "web";
|
|
24588
|
+
}, hmrMessageMetadata = (state, message) => {
|
|
24589
|
+
const data = Reflect.get(message, "data");
|
|
24590
|
+
const framework = typeof data === "object" && data !== null && typeof Reflect.get(data, "framework") === "string" ? String(Reflect.get(data, "framework")) : state.lastHmrFramework;
|
|
24591
|
+
const source = typeof data === "object" && data !== null ? Reflect.get(data, "primarySource") ?? Reflect.get(data, "sourceFile") : undefined;
|
|
24592
|
+
return {
|
|
24593
|
+
framework,
|
|
24594
|
+
path: typeof source === "string" ? source : state.lastHmrPath
|
|
24595
|
+
};
|
|
24596
|
+
}, retainHmrUpdate = (state, updateId, message) => {
|
|
24597
|
+
const metadata2 = hmrMessageMetadata(state, message);
|
|
24598
|
+
if (!metadata2.framework && !metadata2.path)
|
|
24599
|
+
return;
|
|
24600
|
+
state.hmrUpdates.set(updateId, metadata2);
|
|
24601
|
+
if (state.hmrUpdates.size <= MAX_RETAINED_HMR_UPDATES)
|
|
24602
|
+
return;
|
|
24603
|
+
const oldest = state.hmrUpdates.keys().next().value;
|
|
24604
|
+
if (typeof oldest === "number")
|
|
24605
|
+
state.hmrUpdates.delete(oldest);
|
|
24606
|
+
}, trySendMessage = (client2, messageStr) => {
|
|
24513
24607
|
try {
|
|
24514
24608
|
client2.send(messageStr);
|
|
24515
24609
|
return true;
|
|
@@ -24517,9 +24611,12 @@ var trySendMessage = (client2, messageStr) => {
|
|
|
24517
24611
|
return false;
|
|
24518
24612
|
}
|
|
24519
24613
|
}, broadcastToClients = (state, message) => {
|
|
24614
|
+
const timestamp = Math.max(Date.now(), state.lastBroadcastTimestamp + 1);
|
|
24615
|
+
state.lastBroadcastTimestamp = timestamp;
|
|
24616
|
+
retainHmrUpdate(state, timestamp, message);
|
|
24520
24617
|
const messageStr = JSON.stringify({
|
|
24521
24618
|
...message,
|
|
24522
|
-
timestamp
|
|
24619
|
+
timestamp
|
|
24523
24620
|
});
|
|
24524
24621
|
const shouldRemove = (client2) => !trySendMessage(client2, messageStr);
|
|
24525
24622
|
const clientsToRemove = [];
|
|
@@ -24602,13 +24699,34 @@ var trySendMessage = (client2, messageStr) => {
|
|
|
24602
24699
|
state.activeFrameworks.add(data.framework);
|
|
24603
24700
|
}
|
|
24604
24701
|
break;
|
|
24605
|
-
case "hmr-timing":
|
|
24606
|
-
|
|
24702
|
+
case "hmr-timing": {
|
|
24703
|
+
const update = typeof data.updateId === "number" ? state.hmrUpdates.get(data.updateId) : undefined;
|
|
24704
|
+
logHmrClientUpdate(update?.path ?? state.lastHmrPath ?? "", update?.framework ?? state.lastHmrFramework, data.duration, normalizedHmrTarget(data.target), data.serverMs, data.clientMs, data.outcome, data.kind);
|
|
24705
|
+
sendTelemetryEvent("hmr:client-applied", {
|
|
24706
|
+
clientMs: data.clientMs,
|
|
24707
|
+
durationMs: data.duration,
|
|
24708
|
+
framework: update?.framework ?? state.lastHmrFramework ?? "unknown",
|
|
24709
|
+
kind: data.kind,
|
|
24710
|
+
outcome: data.outcome ?? "applied",
|
|
24711
|
+
serverMs: data.serverMs,
|
|
24712
|
+
success: (data.outcome ?? "applied") === "applied",
|
|
24713
|
+
target: normalizedHmrTarget(data.target)
|
|
24714
|
+
});
|
|
24607
24715
|
break;
|
|
24716
|
+
}
|
|
24608
24717
|
case "angular:hmr-ack": {
|
|
24609
24718
|
const tag = data.tier === "tier-0" ? "tier-0" : "tier-1a";
|
|
24610
24719
|
const suffix = data.error ? ` FAILED \u2014 ${data.error}` : ` applied in ${data.applyMs.toFixed(0)}ms`;
|
|
24611
|
-
|
|
24720
|
+
const target = normalizedHmrTarget(data.target);
|
|
24721
|
+
logInfo(`[ng-hmr:${target}] ${tag} ${data.className}${suffix}`);
|
|
24722
|
+
sendTelemetryEvent("hmr:client-applied", {
|
|
24723
|
+
clientMs: data.applyMs,
|
|
24724
|
+
durationMs: data.applyMs,
|
|
24725
|
+
framework: "angular",
|
|
24726
|
+
success: data.error === undefined,
|
|
24727
|
+
target,
|
|
24728
|
+
tier: data.tier
|
|
24729
|
+
});
|
|
24612
24730
|
break;
|
|
24613
24731
|
}
|
|
24614
24732
|
}
|
|
@@ -24625,6 +24743,7 @@ var trySendMessage = (client2, messageStr) => {
|
|
|
24625
24743
|
} catch {}
|
|
24626
24744
|
};
|
|
24627
24745
|
var init_webSocket = __esm(() => {
|
|
24746
|
+
init_telemetryEvent();
|
|
24628
24747
|
init_logger();
|
|
24629
24748
|
});
|
|
24630
24749
|
|
|
@@ -24635,12 +24754,13 @@ __export(exports_moduleServer, {
|
|
|
24635
24754
|
warmCompilers: () => warmCompilers,
|
|
24636
24755
|
warmCache: () => warmCache,
|
|
24637
24756
|
setGlobalModuleServer: () => setGlobalModuleServer,
|
|
24757
|
+
isReactFastRefreshSupported: () => isReactFastRefreshSupported,
|
|
24638
24758
|
invalidateModule: () => invalidateModule,
|
|
24639
24759
|
createModuleServer: () => createModuleServer,
|
|
24640
24760
|
SRC_URL_PREFIX: () => SRC_URL_PREFIX
|
|
24641
24761
|
});
|
|
24642
24762
|
import { existsSync as existsSync35, readFileSync as readFileSync30, realpathSync as realpathSync3, statSync as statSync6 } from "fs";
|
|
24643
|
-
import { basename as basename16, dirname as dirname27, extname as extname12, join as join45, resolve as
|
|
24763
|
+
import { basename as basename16, dirname as dirname27, extname as extname12, join as join45, resolve as resolve41, relative as relative16 } from "path";
|
|
24644
24764
|
var SRC_PREFIX = "/@src/", BROWSER_DEFINE, jsTranspiler2, legacyDecoratorTsconfig, tsTranspiler2, tsxTranspiler, TRANSPILABLE, ALL_EXPORTS_RE, STRING_CONTENTS_RE, preserveTypeExports = (originalSource, transpiled, valueExports) => {
|
|
24645
24765
|
const codeOnly = originalSource.replace(STRING_CONTENTS_RE, '""');
|
|
24646
24766
|
const allExports = [];
|
|
@@ -24660,10 +24780,10 @@ var SRC_PREFIX = "/@src/", BROWSER_DEFINE, jsTranspiler2, legacyDecoratorTsconfi
|
|
|
24660
24780
|
${stubs}
|
|
24661
24781
|
`;
|
|
24662
24782
|
}, resolveRelativeExtension = (srcPath, projectRoot, extensions) => {
|
|
24663
|
-
const directHit = extensions.find((ext) => existsSync35(
|
|
24783
|
+
const directHit = extensions.find((ext) => existsSync35(resolve41(projectRoot, srcPath + ext)));
|
|
24664
24784
|
if (directHit)
|
|
24665
24785
|
return srcPath + directHit;
|
|
24666
|
-
const indexHit = extensions.find((ext) => existsSync35(
|
|
24786
|
+
const indexHit = extensions.find((ext) => existsSync35(resolve41(projectRoot, srcPath, `index${ext}`)));
|
|
24667
24787
|
if (indexHit)
|
|
24668
24788
|
return `${srcPath}/index${indexHit}`;
|
|
24669
24789
|
return srcPath;
|
|
@@ -24686,7 +24806,7 @@ ${stubs}
|
|
|
24686
24806
|
return invalidationVersion > 0 ? `${mtime}.${invalidationVersion}` : `${mtime}`;
|
|
24687
24807
|
}, srcUrl = (relPath, projectRoot) => {
|
|
24688
24808
|
const base = `${SRC_PREFIX}${relPath.replace(/\\/g, "/")}`;
|
|
24689
|
-
const absPath =
|
|
24809
|
+
const absPath = resolve41(projectRoot, relPath);
|
|
24690
24810
|
const cached = mtimeCache.get(absPath);
|
|
24691
24811
|
if (cached !== undefined)
|
|
24692
24812
|
return `${base}?v=${buildVersion(cached, absPath)}`;
|
|
@@ -24698,12 +24818,12 @@ ${stubs}
|
|
|
24698
24818
|
return base;
|
|
24699
24819
|
}
|
|
24700
24820
|
}, resolveRelativeImport = (relPath, fileDir, projectRoot, extensions) => {
|
|
24701
|
-
const absPath =
|
|
24821
|
+
const absPath = resolve41(fileDir, relPath);
|
|
24702
24822
|
const rel = relative16(projectRoot, absPath);
|
|
24703
24823
|
const extension = extname12(rel);
|
|
24704
24824
|
let srcPath = RESOLVED_MODULE_EXTENSIONS.has(extension) ? rel : resolveRelativeExtension(rel, projectRoot, extensions);
|
|
24705
24825
|
if (extname12(srcPath) === ".svelte") {
|
|
24706
|
-
srcPath = relative16(projectRoot, resolveSvelteModulePath(
|
|
24826
|
+
srcPath = relative16(projectRoot, resolveSvelteModulePath(resolve41(projectRoot, srcPath)));
|
|
24707
24827
|
}
|
|
24708
24828
|
return srcUrl(srcPath, projectRoot);
|
|
24709
24829
|
}, NODE_BUILTIN_RE, resolveAbsoluteSpecifier = (specifier, projectRoot) => {
|
|
@@ -24722,13 +24842,13 @@ ${stubs}
|
|
|
24722
24842
|
const packageName = isScoped ? `${parts[0]}/${parts[1]}` : parts[0];
|
|
24723
24843
|
const subpath = isScoped ? parts.slice(2).join("/") : parts.slice(1).join("/");
|
|
24724
24844
|
if (!subpath) {
|
|
24725
|
-
const pkgDir =
|
|
24845
|
+
const pkgDir = resolve41(projectRoot, "node_modules", packageName ?? "");
|
|
24726
24846
|
const pkgJsonPath = join45(pkgDir, "package.json");
|
|
24727
24847
|
if (existsSync35(pkgJsonPath)) {
|
|
24728
24848
|
const pkg = JSON.parse(readFileSync30(pkgJsonPath, "utf-8"));
|
|
24729
24849
|
const esmEntry = typeof pkg.module === "string" && pkg.module || typeof pkg.browser === "string" && pkg.browser;
|
|
24730
24850
|
if (esmEntry) {
|
|
24731
|
-
const resolved =
|
|
24851
|
+
const resolved = resolve41(pkgDir, esmEntry);
|
|
24732
24852
|
if (existsSync35(resolved))
|
|
24733
24853
|
return relative16(projectRoot, resolved);
|
|
24734
24854
|
}
|
|
@@ -24781,12 +24901,12 @@ ${stubs}
|
|
|
24781
24901
|
result = result.replace(/((?:from|import)\s*["'])(\/[^"']+\.(tsx?|jsx?|ts))(["'])/g, rewriteAbsoluteToSrc);
|
|
24782
24902
|
result = result.replace(/(import\s*\(\s*["'])(\/[^"']+\.(tsx?|jsx?|ts))(["']\s*\))/g, rewriteAbsoluteToSrc);
|
|
24783
24903
|
result = result.replace(/new\s+URL\(\s*["'](\.\.?\/[^"']+)["']\s*,\s*import\.meta\.url\s*\)/g, (_match, relPath) => {
|
|
24784
|
-
const absPath =
|
|
24904
|
+
const absPath = resolve41(fileDir, relPath);
|
|
24785
24905
|
const rel = relative16(projectRoot, absPath);
|
|
24786
24906
|
return `new URL('${srcUrl(rel, projectRoot)}', import.meta.url)`;
|
|
24787
24907
|
});
|
|
24788
24908
|
result = result.replace(/import\.meta\.resolve\(\s*["'](\.\.?\/[^"']+)["']\s*\)/g, (_match, relPath) => {
|
|
24789
|
-
const absPath =
|
|
24909
|
+
const absPath = resolve41(fileDir, relPath);
|
|
24790
24910
|
const rel = relative16(projectRoot, absPath);
|
|
24791
24911
|
return `'${srcUrl(rel, projectRoot)}'`;
|
|
24792
24912
|
});
|
|
@@ -24826,11 +24946,11 @@ ${code}`;
|
|
|
24826
24946
|
} catch {
|
|
24827
24947
|
return false;
|
|
24828
24948
|
}
|
|
24829
|
-
}, reactFastRefreshSupported, reactFastRefreshWarningEmitted = false, warnIfReactFastRefreshUnsupported = () => {
|
|
24949
|
+
}, reactFastRefreshSupported, isReactFastRefreshSupported = () => reactFastRefreshSupported, reactFastRefreshWarningEmitted = false, warnIfReactFastRefreshUnsupported = () => {
|
|
24830
24950
|
if (reactFastRefreshSupported || reactFastRefreshWarningEmitted)
|
|
24831
24951
|
return;
|
|
24832
24952
|
reactFastRefreshWarningEmitted = true;
|
|
24833
|
-
logWarn("React HMR is blocked: this Bun build ignores " + "`reactFastRefresh` on Bun.Transpiler, so component state " + "cannot be preserved across edits. Tracking " + "https://github.com/oven-sh/bun/pull/28312 \u2014 if it still has " + "not merged, leave a \uD83D\uDC4D on the PR so the Bun team knows it " + "is blocking you. Until then, React edits trigger a
|
|
24953
|
+
logWarn("React HMR is blocked: this Bun build ignores " + "`reactFastRefresh` on Bun.Transpiler, so component state " + "cannot be preserved across edits. Tracking " + "https://github.com/oven-sh/bun/pull/28312 \u2014 if it still has " + "not merged, leave a \uD83D\uDC4D on the PR so the Bun team knows it " + "is blocking you. Until then, React edits trigger a targeted " + "page remount instead of a state-preserving fast refresh.");
|
|
24834
24954
|
}, transformReactFile = (filePath, projectRoot, rewriter) => {
|
|
24835
24955
|
const raw = readFileSync30(filePath, "utf-8");
|
|
24836
24956
|
const valueExports = tsxTranspiler.scan(raw).exports;
|
|
@@ -25108,7 +25228,7 @@ ${code}`;
|
|
|
25108
25228
|
code = injectVueHmr(code, filePath, projectRoot, vueDir);
|
|
25109
25229
|
return rewriteImports(code, filePath, projectRoot, rewriter);
|
|
25110
25230
|
}, injectVueHmr = (code, filePath, projectRoot, vueDir) => {
|
|
25111
|
-
const hmrBase = vueDir ?
|
|
25231
|
+
const hmrBase = vueDir ? resolve41(vueDir) : projectRoot;
|
|
25112
25232
|
const hmrId = relative16(hmrBase, filePath).replace(/\\/g, "/").replace(/\.vue$/, "");
|
|
25113
25233
|
let result = code.replace(/export\s+default\s+/, "var __hmr_comp__ = ");
|
|
25114
25234
|
result += [
|
|
@@ -25272,7 +25392,7 @@ export default {};
|
|
|
25272
25392
|
const escaped = virtualCss.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$/g, "\\$");
|
|
25273
25393
|
return jsResponse(`var s=document.createElement('style');s.textContent=\`${escaped}\`;s.dataset.svelteHmr=${JSON.stringify(cssCheckPath)};var p=document.querySelector('style[data-svelte-hmr="${cssCheckPath}"]');if(p)p.remove();document.head.appendChild(s);`);
|
|
25274
25394
|
}, resolveSourcePath = (relPath, projectRoot) => {
|
|
25275
|
-
const filePath =
|
|
25395
|
+
const filePath = resolve41(projectRoot, relPath);
|
|
25276
25396
|
const ext = extname12(filePath);
|
|
25277
25397
|
if (ext === ".svelte")
|
|
25278
25398
|
return { ext, filePath: resolveSvelteModulePath(filePath) };
|
|
@@ -25290,7 +25410,7 @@ export default {};
|
|
|
25290
25410
|
return jsResponse(handleCssRequest(filePath));
|
|
25291
25411
|
if (ext === ".json") {
|
|
25292
25412
|
try {
|
|
25293
|
-
const { readFile:
|
|
25413
|
+
const { readFile: readFile10, stat: stat4 } = await import("fs/promises");
|
|
25294
25414
|
const fileExists = async (p2) => {
|
|
25295
25415
|
try {
|
|
25296
25416
|
await stat4(p2);
|
|
@@ -25309,14 +25429,14 @@ export default {};
|
|
|
25309
25429
|
const absoluteCandidate = `/${tail.replace(/^\/+/, "")}`;
|
|
25310
25430
|
const candidates = [
|
|
25311
25431
|
absoluteCandidate,
|
|
25312
|
-
|
|
25432
|
+
resolve41(projectRoot, tail)
|
|
25313
25433
|
];
|
|
25314
25434
|
try {
|
|
25315
25435
|
const { loadConfig: loadConfig2 } = await Promise.resolve().then(() => (init_loadConfig(), exports_loadConfig));
|
|
25316
25436
|
const cfg = await loadConfig2();
|
|
25317
|
-
const angularDir = cfg.angularDirectory &&
|
|
25437
|
+
const angularDir = cfg.angularDirectory && resolve41(projectRoot, cfg.angularDirectory);
|
|
25318
25438
|
if (angularDir)
|
|
25319
|
-
candidates.push(
|
|
25439
|
+
candidates.push(resolve41(angularDir, tail));
|
|
25320
25440
|
} catch {}
|
|
25321
25441
|
for (const candidate of candidates) {
|
|
25322
25442
|
if (await fileExists(candidate)) {
|
|
@@ -25326,7 +25446,7 @@ export default {};
|
|
|
25326
25446
|
}
|
|
25327
25447
|
}
|
|
25328
25448
|
}
|
|
25329
|
-
const text = await
|
|
25449
|
+
const text = await readFile10(sourcePath, "utf-8");
|
|
25330
25450
|
JSON.parse(text);
|
|
25331
25451
|
return jsResponse(`export default ${text};`);
|
|
25332
25452
|
} catch (err) {
|
|
@@ -25347,7 +25467,7 @@ export default {};
|
|
|
25347
25467
|
if (!TRANSPILABLE.has(ext))
|
|
25348
25468
|
return;
|
|
25349
25469
|
const stat3 = statSync6(filePath);
|
|
25350
|
-
const resolvedVueDir = vueDir ?
|
|
25470
|
+
const resolvedVueDir = vueDir ? resolve41(vueDir) : undefined;
|
|
25351
25471
|
let content = REACT_EXTENSIONS.has(ext) ? transformReactFile(filePath, projectRoot, rewriter) : transformPlainFile(filePath, projectRoot, rewriter, resolvedVueDir);
|
|
25352
25472
|
const isAngularGeneratedJs = ext === ".js" && filePath.replace(/\\/g, "/").includes("/.absolutejs/generated/angular/");
|
|
25353
25473
|
if (isAngularGeneratedJs) {
|
|
@@ -25406,7 +25526,7 @@ export default {};
|
|
|
25406
25526
|
const relPath = pathname.slice(SRC_PREFIX.length);
|
|
25407
25527
|
if (relPath === "bun:wrap" || relPath.startsWith("bun:wrap?"))
|
|
25408
25528
|
return handleBunWrapRequest();
|
|
25409
|
-
const virtualCssResponse = handleVirtualSvelteCss(
|
|
25529
|
+
const virtualCssResponse = handleVirtualSvelteCss(resolve41(projectRoot, relPath));
|
|
25410
25530
|
if (virtualCssResponse)
|
|
25411
25531
|
return virtualCssResponse;
|
|
25412
25532
|
const { filePath, ext } = resolveSourcePath(relPath, projectRoot);
|
|
@@ -25422,22 +25542,22 @@ export default {};
|
|
|
25422
25542
|
SRC_IMPORT_RE.lastIndex = 0;
|
|
25423
25543
|
while ((match = SRC_IMPORT_RE.exec(content)) !== null) {
|
|
25424
25544
|
if (match[1])
|
|
25425
|
-
files.push(
|
|
25545
|
+
files.push(resolve41(projectRoot, match[1]));
|
|
25426
25546
|
}
|
|
25427
25547
|
return files;
|
|
25428
25548
|
}, invalidateModule = (filePath) => {
|
|
25429
|
-
const resolved =
|
|
25549
|
+
const resolved = resolve41(filePath);
|
|
25430
25550
|
invalidate(filePath);
|
|
25431
25551
|
if (resolved !== filePath)
|
|
25432
25552
|
invalidate(resolved);
|
|
25433
25553
|
mtimeCache.delete(filePath);
|
|
25434
25554
|
mtimeCache.delete(resolved);
|
|
25435
|
-
}, warmCache = (pathname) => {
|
|
25555
|
+
}, warmCache = async (pathname) => {
|
|
25436
25556
|
if (!pathname.startsWith(SRC_PREFIX))
|
|
25437
25557
|
return;
|
|
25438
25558
|
if (!globalModuleServer)
|
|
25439
25559
|
return;
|
|
25440
|
-
globalModuleServer(pathname);
|
|
25560
|
+
await globalModuleServer(pathname);
|
|
25441
25561
|
}, globalModuleServer = null, SRC_URL_PREFIX, setGlobalModuleServer = (handler) => {
|
|
25442
25562
|
globalModuleServer = handler;
|
|
25443
25563
|
};
|
|
@@ -25589,7 +25709,7 @@ __export(exports_hmrCompiler, {
|
|
|
25589
25709
|
getApplyMetadataModule: () => getApplyMetadataModule,
|
|
25590
25710
|
encodeHmrComponentId: () => encodeHmrComponentId
|
|
25591
25711
|
});
|
|
25592
|
-
import { dirname as dirname28, relative as relative17, resolve as
|
|
25712
|
+
import { dirname as dirname28, relative as relative17, resolve as resolve42 } from "path";
|
|
25593
25713
|
import { performance as performance2 } from "perf_hooks";
|
|
25594
25714
|
var encodeHmrComponentId = (absoluteFilePath, className) => {
|
|
25595
25715
|
const projectRel = relative17(process.cwd(), absoluteFilePath).replace(/\\/g, "/");
|
|
@@ -25601,7 +25721,7 @@ var encodeHmrComponentId = (absoluteFilePath, className) => {
|
|
|
25601
25721
|
return null;
|
|
25602
25722
|
const filePathRel = decoded.slice(0, separatorIndex);
|
|
25603
25723
|
const className = decoded.slice(separatorIndex + 1);
|
|
25604
|
-
const componentFilePath =
|
|
25724
|
+
const componentFilePath = resolve42(process.cwd(), filePathRel);
|
|
25605
25725
|
const projectRelPath = relative17(process.cwd(), componentFilePath).replace(/\\/g, "/");
|
|
25606
25726
|
const cacheKey2 = encodeURIComponent(`${projectRelPath}@${className}`);
|
|
25607
25727
|
const { takePendingModule: takePendingModule2 } = await Promise.resolve().then(() => (init_fastHmrCompiler(), exports_fastHmrCompiler));
|
|
@@ -25713,10 +25833,18 @@ var resolveRequestPathname = (request) => {
|
|
|
25713
25833
|
return moduleUrl.href;
|
|
25714
25834
|
}, invalidateEmberSsrCache = () => {
|
|
25715
25835
|
emberCacheBuster = Date.now();
|
|
25716
|
-
}, buildHtmlShell = (headTag, bodyContent, indexPath, props) => {
|
|
25836
|
+
}, buildHtmlShell = (headTag, bodyContent, indexPath, props, hmrShim) => {
|
|
25717
25837
|
const propsScript = `window.__INITIAL_PROPS__=${JSON.stringify(props ?? {})};`;
|
|
25718
25838
|
const indexImport = indexPath ? `<script type="module" src="${indexPath}"></script>` : "";
|
|
25719
|
-
return `<!DOCTYPE html><html>${headTag}<body>` + `<div id="ember-root">${bodyContent}</div>` + `<script>${propsScript}</script>${indexImport}</body></html>`;
|
|
25839
|
+
return `<!DOCTYPE html><html>${headTag}<body>` + `<div id="ember-root">${bodyContent}</div>` + `<script>${propsScript}</script>${indexImport}${hmrShim}</body></html>`;
|
|
25840
|
+
}, cachedEmberHmrShim = null, getEmberHmrShim = () => {
|
|
25841
|
+
if (cachedEmberHmrShim)
|
|
25842
|
+
return cachedEmberHmrShim;
|
|
25843
|
+
cachedEmberHmrShim = Promise.resolve().then(() => (init_buildHMRClient(), exports_buildHMRClient)).then(async ({ buildHMRClient: buildHMRClient2 }) => {
|
|
25844
|
+
const bundle = await buildHMRClient2();
|
|
25845
|
+
return `<script>window.__HMR_FRAMEWORK__="ember";</script><script data-hmr-client>${bundle}</script>`;
|
|
25846
|
+
});
|
|
25847
|
+
return cachedEmberHmrShim;
|
|
25720
25848
|
}, handleEmberPageRequest = async (input) => {
|
|
25721
25849
|
const { indexPath, pagePath, headTag } = input;
|
|
25722
25850
|
const userProps = input.props;
|
|
@@ -25730,7 +25858,8 @@ var resolveRequestPathname = (request) => {
|
|
|
25730
25858
|
throw new Error(`Ember page bundle at ${pagePath} does not export renderToHTML(). Was it compiled by compileEmber()?`);
|
|
25731
25859
|
}
|
|
25732
25860
|
const innerHtml = bundle.renderToHTML(props ?? {});
|
|
25733
|
-
const
|
|
25861
|
+
const hmrShim = !indexPath ? await getEmberHmrShim() : "";
|
|
25862
|
+
const html = buildHtmlShell(resolvedHeadTag, innerHtml.replace(/^<div>|<\/div>$/g, ""), indexPath, props, hmrShim);
|
|
25734
25863
|
return withPageCacheHeaders(new Response(html, {
|
|
25735
25864
|
headers: { "Content-Type": "text/html" }
|
|
25736
25865
|
}), input.request);
|
|
@@ -25761,11 +25890,11 @@ var exports_simpleHTMLHMR = {};
|
|
|
25761
25890
|
__export(exports_simpleHTMLHMR, {
|
|
25762
25891
|
handleHTMLUpdate: () => handleHTMLUpdate
|
|
25763
25892
|
});
|
|
25764
|
-
import { resolve as
|
|
25893
|
+
import { resolve as resolve43 } from "path";
|
|
25765
25894
|
var handleHTMLUpdate = async (htmlFilePath) => {
|
|
25766
25895
|
let htmlContent;
|
|
25767
25896
|
try {
|
|
25768
|
-
const resolvedPath =
|
|
25897
|
+
const resolvedPath = resolve43(htmlFilePath);
|
|
25769
25898
|
const file5 = Bun.file(resolvedPath);
|
|
25770
25899
|
if (!await file5.exists()) {
|
|
25771
25900
|
return null;
|
|
@@ -25791,11 +25920,11 @@ var exports_simpleHTMXHMR = {};
|
|
|
25791
25920
|
__export(exports_simpleHTMXHMR, {
|
|
25792
25921
|
handleHTMXUpdate: () => handleHTMXUpdate
|
|
25793
25922
|
});
|
|
25794
|
-
import { resolve as
|
|
25923
|
+
import { resolve as resolve44 } from "path";
|
|
25795
25924
|
var handleHTMXUpdate = async (htmxFilePath) => {
|
|
25796
25925
|
let htmlContent;
|
|
25797
25926
|
try {
|
|
25798
|
-
const resolvedPath =
|
|
25927
|
+
const resolvedPath = resolve44(htmxFilePath);
|
|
25799
25928
|
const file5 = Bun.file(resolvedPath);
|
|
25800
25929
|
if (!await file5.exists()) {
|
|
25801
25930
|
return null;
|
|
@@ -25835,6 +25964,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
25835
25964
|
return;
|
|
25836
25965
|
if (!files.some(isTailwindCandidate))
|
|
25837
25966
|
return;
|
|
25967
|
+
const startedAt = performance.now();
|
|
25838
25968
|
try {
|
|
25839
25969
|
const { computeFrameworkTailwindSources: computeFrameworkTailwindSources2 } = await Promise.resolve().then(() => (init_compileTailwind(), exports_compileTailwind));
|
|
25840
25970
|
const { cssChanged } = await incrementalTailwindBuild(config.tailwind, state.resolvedPaths.buildDir, files, getStyleTransformConfig(config), computeFrameworkTailwindSources2(config));
|
|
@@ -25850,7 +25980,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
25850
25980
|
data: {
|
|
25851
25981
|
cause: files.filter(isTailwindCandidate),
|
|
25852
25982
|
framework: "tailwind",
|
|
25853
|
-
manifest: state.manifest
|
|
25983
|
+
manifest: state.manifest,
|
|
25984
|
+
serverDuration: Math.round(performance.now() - startedAt)
|
|
25854
25985
|
},
|
|
25855
25986
|
message: "Tailwind utilities recompiled",
|
|
25856
25987
|
type: "style-update"
|
|
@@ -26172,6 +26303,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
26172
26303
|
const { publicDir } = state.resolvedPaths;
|
|
26173
26304
|
const { assetsDir } = state.resolvedPaths;
|
|
26174
26305
|
const handleStaticMirror = async (sourceDir, urlPrefix) => {
|
|
26306
|
+
const startedAt = performance.now();
|
|
26175
26307
|
const absSource = resolvePath3(filePath);
|
|
26176
26308
|
const normalizedSource = absSource.replace(/\\/g, "/");
|
|
26177
26309
|
const normalizedDir = sourceDir.replace(/\\/g, "/");
|
|
@@ -26181,10 +26313,10 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
26181
26313
|
const relFromDir = normalizedSource.slice(normalizedDir.length + 1);
|
|
26182
26314
|
const { buildDir } = state.resolvedPaths;
|
|
26183
26315
|
const destPath = resolvePath3(buildDir, urlPrefix ? `${urlPrefix}/${relFromDir}` : relFromDir);
|
|
26184
|
-
const { mkdir:
|
|
26185
|
-
await
|
|
26316
|
+
const { mkdir: mkdir11, copyFile, readFile: readFile10 } = await import("fs/promises");
|
|
26317
|
+
await mkdir11(dirname29(destPath), { recursive: true });
|
|
26186
26318
|
await copyFile(absSource, destPath);
|
|
26187
|
-
const bytes = await
|
|
26319
|
+
const bytes = await readFile10(destPath);
|
|
26188
26320
|
const webPath = urlPrefix ? `/${urlPrefix}/${relFromDir}` : `/${relFromDir}`;
|
|
26189
26321
|
state.assetStore.set(webPath, new Uint8Array(bytes));
|
|
26190
26322
|
state.fileHashes.set(absSource, currentHash);
|
|
@@ -26192,7 +26324,9 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
26192
26324
|
broadcastToClients(state, {
|
|
26193
26325
|
data: {
|
|
26194
26326
|
framework: urlPrefix || "public",
|
|
26195
|
-
manifest: state.manifest
|
|
26327
|
+
manifest: state.manifest,
|
|
26328
|
+
serverDuration: Math.round(performance.now() - startedAt),
|
|
26329
|
+
sourceFile: absSource
|
|
26196
26330
|
},
|
|
26197
26331
|
message: `${urlPrefix || "Public"} asset updated`,
|
|
26198
26332
|
type: "style-update"
|
|
@@ -26724,8 +26858,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
26724
26858
|
};
|
|
26725
26859
|
return ({ immediate = false } = {}) => {
|
|
26726
26860
|
if (!ctx.debouncedPromise) {
|
|
26727
|
-
ctx.debouncedPromise = new Promise((
|
|
26728
|
-
ctx.debouncedResolve =
|
|
26861
|
+
ctx.debouncedPromise = new Promise((resolve45) => {
|
|
26862
|
+
ctx.debouncedResolve = resolve45;
|
|
26729
26863
|
});
|
|
26730
26864
|
}
|
|
26731
26865
|
const scheduled = ctx.debouncedPromise;
|
|
@@ -26884,6 +27018,9 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
26884
27018
|
await bundleAngularClient(state, clientPaths, state.resolvedPaths.buildDir, angularDir);
|
|
26885
27019
|
}
|
|
26886
27020
|
await Promise.all(pageEntries.map((entry) => compileAngularFileJIT2(entry, generatedAngularRoot, resolvedAngularDir, styleTransformConfig)));
|
|
27021
|
+
if (providersInjection.appProvidersSource) {
|
|
27022
|
+
await compileAngularFileJIT2(providersInjection.appProvidersSource, generatedAngularRoot, resolvedAngularDir, styleTransformConfig);
|
|
27023
|
+
}
|
|
26887
27024
|
broadcastToClients(state, {
|
|
26888
27025
|
data: { manifest: state.manifest },
|
|
26889
27026
|
type: "angular-tier-zero-ssr-rebuild-complete"
|
|
@@ -26948,7 +27085,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
26948
27085
|
invalidateModule2(pageFile);
|
|
26949
27086
|
const rel = relative18(process.cwd(), pageFile).replace(/\\/g, "/");
|
|
26950
27087
|
const url = `${SRC_URL_PREFIX2}${rel}`;
|
|
26951
|
-
warmCache2(url);
|
|
27088
|
+
await warmCache2(url);
|
|
26952
27089
|
return url;
|
|
26953
27090
|
}, getReactModuleUrl, resolveBroadcastTarget = async (primaryFile) => {
|
|
26954
27091
|
const isComponentFile2 = primaryFile.endsWith(".tsx") || primaryFile.endsWith(".jsx");
|
|
@@ -26957,7 +27094,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
26957
27094
|
const { findNearestComponent: findNearestComponent2 } = await Promise.resolve().then(() => (init_transformCache(), exports_transformCache));
|
|
26958
27095
|
const nearest = findNearestComponent2(resolvePath3(primaryFile));
|
|
26959
27096
|
return nearest ?? primaryFile;
|
|
26960
|
-
}, handleReactModuleServerPath = async (state, reactFiles, startTime, onRebuildComplete) => {
|
|
27097
|
+
}, handleReactModuleServerPath = async (state, reactFiles, startTime, fastRefreshSupported, onRebuildComplete) => {
|
|
26961
27098
|
const primaryFile = reactFiles.find((file5) => !file5.replace(/\\/g, "/").includes("/pages/")) ?? reactFiles[0];
|
|
26962
27099
|
if (!primaryFile) {
|
|
26963
27100
|
onRebuildComplete({
|
|
@@ -26978,6 +27115,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
26978
27115
|
state.lastHmrFramework = "react";
|
|
26979
27116
|
broadcastToClients(state, {
|
|
26980
27117
|
data: {
|
|
27118
|
+
fastRefreshSupported,
|
|
26981
27119
|
framework: "react",
|
|
26982
27120
|
hasComponentChanges: true,
|
|
26983
27121
|
hasCSSChanges: false,
|
|
@@ -27001,9 +27139,10 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
27001
27139
|
onRebuildComplete({ hmrState: state, manifest: state.manifest });
|
|
27002
27140
|
return state.manifest;
|
|
27003
27141
|
}
|
|
27004
|
-
const { warnIfReactFastRefreshUnsupported: warnIfReactFastRefreshUnsupported2 } = await Promise.resolve().then(() => (init_moduleServer(), exports_moduleServer));
|
|
27142
|
+
const { isReactFastRefreshSupported: isReactFastRefreshSupported2, warnIfReactFastRefreshUnsupported: warnIfReactFastRefreshUnsupported2 } = await Promise.resolve().then(() => (init_moduleServer(), exports_moduleServer));
|
|
27005
27143
|
warnIfReactFastRefreshUnsupported2();
|
|
27006
|
-
|
|
27144
|
+
const fastRefreshSupported = isReactFastRefreshSupported2();
|
|
27145
|
+
return handleReactModuleServerPath(state, reactFiles, startTime, fastRefreshSupported, onRebuildComplete);
|
|
27007
27146
|
}, getClientVendorPaths = async () => {
|
|
27008
27147
|
const {
|
|
27009
27148
|
getDevVendorPaths: getDevVendorPaths2,
|
|
@@ -27139,7 +27278,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
27139
27278
|
}
|
|
27140
27279
|
return ctx;
|
|
27141
27280
|
}, runSvelteBundleRebuild = async (state, svelteFiles, config) => {
|
|
27142
|
-
|
|
27281
|
+
const existingSvelteFiles = svelteFiles.filter((file5) => existsSync36(file5));
|
|
27282
|
+
if (existingSvelteFiles.length === 0)
|
|
27143
27283
|
return;
|
|
27144
27284
|
const svelteDir = config.svelteDirectory ?? "";
|
|
27145
27285
|
if (!svelteDir)
|
|
@@ -27148,7 +27288,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
27148
27288
|
const { compileSvelte: compileSvelte2 } = await Promise.resolve().then(() => (init_compileSvelte(), exports_compileSvelte));
|
|
27149
27289
|
const { build: bunBuild9 } = await Promise.resolve(globalThis.Bun);
|
|
27150
27290
|
const clientRoot = await computeClientRoot(state.resolvedPaths);
|
|
27151
|
-
const { svelteServerPaths, svelteIndexPaths, svelteClientPaths } = await compileSvelte2(
|
|
27291
|
+
const { svelteServerPaths, svelteIndexPaths, svelteClientPaths } = await compileSvelte2(existingSvelteFiles, svelteDir, new Map, true, getStyleTransformConfig(state.config));
|
|
27152
27292
|
const serverEntries = [...svelteServerPaths];
|
|
27153
27293
|
const clientEntries = [...svelteIndexPaths, ...svelteClientPaths];
|
|
27154
27294
|
const { serverRoot, serverOutDir } = await computeServerOutPaths(state.resolvedPaths, "svelte");
|
|
@@ -27251,8 +27391,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
27251
27391
|
};
|
|
27252
27392
|
return () => {
|
|
27253
27393
|
if (!ctx.debouncedPromise) {
|
|
27254
|
-
ctx.debouncedPromise = new Promise((
|
|
27255
|
-
ctx.debouncedResolve =
|
|
27394
|
+
ctx.debouncedPromise = new Promise((resolve45) => {
|
|
27395
|
+
ctx.debouncedResolve = resolve45;
|
|
27256
27396
|
});
|
|
27257
27397
|
}
|
|
27258
27398
|
if (ctx.debounceTimer)
|
|
@@ -27526,8 +27666,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
27526
27666
|
};
|
|
27527
27667
|
return () => {
|
|
27528
27668
|
if (!ctx.debouncedPromise) {
|
|
27529
|
-
ctx.debouncedPromise = new Promise((
|
|
27530
|
-
ctx.debouncedResolve =
|
|
27669
|
+
ctx.debouncedPromise = new Promise((resolve45) => {
|
|
27670
|
+
ctx.debouncedResolve = resolve45;
|
|
27531
27671
|
});
|
|
27532
27672
|
}
|
|
27533
27673
|
if (ctx.debounceTimer)
|
|
@@ -27587,7 +27727,10 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
27587
27727
|
broadcastToClients(state, {
|
|
27588
27728
|
data: {
|
|
27589
27729
|
affectedPages: allPageEntries,
|
|
27590
|
-
|
|
27730
|
+
framework: "ember",
|
|
27731
|
+
manifest: state.manifest,
|
|
27732
|
+
serverDuration: duration,
|
|
27733
|
+
sourceFile: primary
|
|
27591
27734
|
},
|
|
27592
27735
|
type: "full-reload"
|
|
27593
27736
|
});
|
|
@@ -27632,6 +27775,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
27632
27775
|
hasCSSChanges,
|
|
27633
27776
|
manifest,
|
|
27634
27777
|
primarySource,
|
|
27778
|
+
serverDuration: duration,
|
|
27635
27779
|
sourceFiles
|
|
27636
27780
|
},
|
|
27637
27781
|
type: "react-update"
|
|
@@ -27657,6 +27801,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
27657
27801
|
framework,
|
|
27658
27802
|
manifest,
|
|
27659
27803
|
scriptPath,
|
|
27804
|
+
serverDuration: duration,
|
|
27660
27805
|
sourceFile: scriptFile
|
|
27661
27806
|
},
|
|
27662
27807
|
type: "script-update"
|
|
@@ -27687,7 +27832,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
27687
27832
|
return false;
|
|
27688
27833
|
}
|
|
27689
27834
|
return filesToRebuild.some((file5) => islandFiles.has(resolvePath3(file5)));
|
|
27690
|
-
}, handleIslandSourceReload = async (state, config, filesToRebuild, manifest) => {
|
|
27835
|
+
}, handleIslandSourceReload = async (state, config, filesToRebuild, manifest, serverDuration) => {
|
|
27691
27836
|
const shouldReload = await didStaticPagesNeedIslandRefresh(config, filesToRebuild);
|
|
27692
27837
|
if (!shouldReload) {
|
|
27693
27838
|
return false;
|
|
@@ -27697,7 +27842,10 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
27697
27842
|
broadcastToClients(state, {
|
|
27698
27843
|
data: {
|
|
27699
27844
|
affectedPages,
|
|
27700
|
-
|
|
27845
|
+
framework: "islands",
|
|
27846
|
+
manifest,
|
|
27847
|
+
serverDuration,
|
|
27848
|
+
sourceFile: filesToRebuild[0]
|
|
27701
27849
|
},
|
|
27702
27850
|
type: "full-reload"
|
|
27703
27851
|
});
|
|
@@ -27738,6 +27886,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
27738
27886
|
framework: "html",
|
|
27739
27887
|
html: newHTML,
|
|
27740
27888
|
manifest,
|
|
27889
|
+
serverDuration: duration,
|
|
27741
27890
|
sourceFile: builtHtmlPagePath
|
|
27742
27891
|
},
|
|
27743
27892
|
type: "html-update"
|
|
@@ -27783,6 +27932,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
27783
27932
|
cssUrl,
|
|
27784
27933
|
framework: "vue",
|
|
27785
27934
|
manifest,
|
|
27935
|
+
serverDuration: duration,
|
|
27786
27936
|
sourceFile: cssFile,
|
|
27787
27937
|
updateType: "css-only"
|
|
27788
27938
|
},
|
|
@@ -27798,6 +27948,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
27798
27948
|
framework: "vue",
|
|
27799
27949
|
hmrId,
|
|
27800
27950
|
manifest,
|
|
27951
|
+
serverDuration: duration,
|
|
27801
27952
|
sourceFile: vuePagePath,
|
|
27802
27953
|
updateType: "css-only"
|
|
27803
27954
|
},
|
|
@@ -27815,6 +27966,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
27815
27966
|
hmrId,
|
|
27816
27967
|
html: null,
|
|
27817
27968
|
manifest,
|
|
27969
|
+
serverDuration: duration,
|
|
27818
27970
|
sourceFile: vuePagePath,
|
|
27819
27971
|
updateType: "full"
|
|
27820
27972
|
},
|
|
@@ -27879,6 +28031,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
27879
28031
|
cssUrl,
|
|
27880
28032
|
framework: "svelte",
|
|
27881
28033
|
manifest,
|
|
28034
|
+
serverDuration: duration,
|
|
27882
28035
|
sourceFile: cssFile,
|
|
27883
28036
|
updateType: "css-only"
|
|
27884
28037
|
},
|
|
@@ -27899,6 +28052,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
27899
28052
|
framework: "svelte",
|
|
27900
28053
|
html: null,
|
|
27901
28054
|
manifest,
|
|
28055
|
+
serverDuration: duration,
|
|
27902
28056
|
sourceFile: sveltePagePath,
|
|
27903
28057
|
updateType: "full"
|
|
27904
28058
|
},
|
|
@@ -27947,6 +28101,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
27947
28101
|
cssUrl,
|
|
27948
28102
|
framework: "angular",
|
|
27949
28103
|
manifest,
|
|
28104
|
+
serverDuration: duration,
|
|
27950
28105
|
sourceFile: cssFile,
|
|
27951
28106
|
updateType: "style"
|
|
27952
28107
|
},
|
|
@@ -27992,6 +28147,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
27992
28147
|
framework: "htmx",
|
|
27993
28148
|
html: newHTML,
|
|
27994
28149
|
manifest,
|
|
28150
|
+
serverDuration: duration,
|
|
27995
28151
|
sourceFile: builtHtmxPagePath
|
|
27996
28152
|
},
|
|
27997
28153
|
type: "htmx-update"
|
|
@@ -28100,7 +28256,9 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
28100
28256
|
broadcastToClients(state, {
|
|
28101
28257
|
data: {
|
|
28102
28258
|
framework,
|
|
28103
|
-
manifest
|
|
28259
|
+
manifest,
|
|
28260
|
+
serverDuration: Date.now() - startTime,
|
|
28261
|
+
sourceFile: filesToRebuild?.find((file5) => detectFramework(file5, state.resolvedPaths) === framework)
|
|
28104
28262
|
},
|
|
28105
28263
|
message: `${framework} framework updated`,
|
|
28106
28264
|
type
|
|
@@ -28312,14 +28470,15 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
28312
28470
|
data: {
|
|
28313
28471
|
cause: filesToRebuild?.filter(isTailwindCandidate) ?? [],
|
|
28314
28472
|
framework: "tailwind",
|
|
28315
|
-
manifest
|
|
28473
|
+
manifest,
|
|
28474
|
+
serverDuration: duration
|
|
28316
28475
|
},
|
|
28317
28476
|
message: "Tailwind utilities recompiled",
|
|
28318
28477
|
type: "style-update"
|
|
28319
28478
|
});
|
|
28320
28479
|
}
|
|
28321
28480
|
const hasFilesToRebuild = filesToRebuild && filesToRebuild.length > 0;
|
|
28322
|
-
const didReloadForIslandChange = hasFilesToRebuild ? await handleIslandSourceReload(state, config, filesToRebuild, manifest) : false;
|
|
28481
|
+
const didReloadForIslandChange = hasFilesToRebuild ? await handleIslandSourceReload(state, config, filesToRebuild, manifest, duration) : false;
|
|
28323
28482
|
if (didReloadForIslandChange) {
|
|
28324
28483
|
onRebuildComplete({ hmrState: state, manifest });
|
|
28325
28484
|
return manifest;
|
|
@@ -28458,7 +28617,7 @@ __export(exports_buildDepVendor, {
|
|
|
28458
28617
|
import { mkdirSync as mkdirSync14 } from "fs";
|
|
28459
28618
|
import { isBuiltin } from "module";
|
|
28460
28619
|
import { join as join47 } from "path";
|
|
28461
|
-
import { rm as
|
|
28620
|
+
import { rm as rm13 } from "fs/promises";
|
|
28462
28621
|
var {build: bunBuild9, Glob: Glob10 } = globalThis.Bun;
|
|
28463
28622
|
var toSafeFileName6 = (specifier) => {
|
|
28464
28623
|
const prefix = specifier.startsWith("@") ? "_" : "";
|
|
@@ -28719,7 +28878,7 @@ var toSafeFileName6 = (specifier) => {
|
|
|
28719
28878
|
if (!success) {
|
|
28720
28879
|
console.warn("\u26A0\uFE0F Dependency vendor build had errors:", result.logs);
|
|
28721
28880
|
}
|
|
28722
|
-
await
|
|
28881
|
+
await rm13(tmpDir, { force: true, recursive: true });
|
|
28723
28882
|
const paths = {};
|
|
28724
28883
|
for (const specifier of allSpecs) {
|
|
28725
28884
|
paths[specifier] = `/vendor/${toSafeFileName6(specifier)}.js`;
|
|
@@ -28782,7 +28941,7 @@ __export(exports_devBuild, {
|
|
|
28782
28941
|
});
|
|
28783
28942
|
import { readdir as readdir6 } from "fs/promises";
|
|
28784
28943
|
import { statSync as statSync7 } from "fs";
|
|
28785
|
-
import { resolve as
|
|
28944
|
+
import { resolve as resolve45 } from "path";
|
|
28786
28945
|
var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
28787
28946
|
const configuredDirs = [
|
|
28788
28947
|
config.reactDirectory,
|
|
@@ -28805,7 +28964,7 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
28805
28964
|
return Object.keys(config).length > 0 ? config : null;
|
|
28806
28965
|
}, reloadConfig = async () => {
|
|
28807
28966
|
try {
|
|
28808
|
-
const configPath2 =
|
|
28967
|
+
const configPath2 = resolve45(process.env.ABSOLUTE_CONFIG ?? "absolute.config.ts");
|
|
28809
28968
|
const source = await Bun.file(configPath2).text();
|
|
28810
28969
|
return parseDirectoryConfig(source);
|
|
28811
28970
|
} catch {
|
|
@@ -28917,7 +29076,7 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
28917
29076
|
});
|
|
28918
29077
|
}
|
|
28919
29078
|
}, handleCachedReload = async () => {
|
|
28920
|
-
const serverMtime = statSync7(
|
|
29079
|
+
const serverMtime = statSync7(resolve45(Bun.main)).mtimeMs;
|
|
28921
29080
|
const lastMtime = globalThis.__hmrServerMtime;
|
|
28922
29081
|
globalThis.__hmrServerMtime = serverMtime;
|
|
28923
29082
|
const cached = globalThis.__hmrDevResult;
|
|
@@ -28954,8 +29113,8 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
28954
29113
|
return true;
|
|
28955
29114
|
}, resolveAbsoluteVersion2 = async () => {
|
|
28956
29115
|
const candidates = [
|
|
28957
|
-
|
|
28958
|
-
|
|
29116
|
+
resolve45(import.meta.dir, "..", "..", "package.json"),
|
|
29117
|
+
resolve45(import.meta.dir, "..", "package.json")
|
|
28959
29118
|
];
|
|
28960
29119
|
const [candidate, ...remaining] = candidates;
|
|
28961
29120
|
if (!candidate) {
|
|
@@ -28981,7 +29140,7 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
28981
29140
|
const entries = await readdir6(vendorDir).catch(() => emptyStringArray);
|
|
28982
29141
|
await Promise.all(entries.filter((entry) => entry.endsWith(".js")).map(async (entry) => {
|
|
28983
29142
|
const webPath = `/${framework}/vendor/${entry}`;
|
|
28984
|
-
const bytes = await Bun.file(
|
|
29143
|
+
const bytes = await Bun.file(resolve45(vendorDir, entry)).bytes();
|
|
28985
29144
|
assetStore.set(webPath, bytes);
|
|
28986
29145
|
}));
|
|
28987
29146
|
}, devBuild = async (config) => {
|
|
@@ -29117,11 +29276,11 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
29117
29276
|
cleanStaleAssets(state.assetStore, manifest, state.resolvedPaths.buildDir);
|
|
29118
29277
|
recordStep("populate asset store", stepStartedAt);
|
|
29119
29278
|
stepStartedAt = performance.now();
|
|
29120
|
-
const reactVendorDir =
|
|
29121
|
-
const angularVendorDir =
|
|
29122
|
-
const svelteVendorDir =
|
|
29123
|
-
const vueVendorDir =
|
|
29124
|
-
const depVendorDir =
|
|
29279
|
+
const reactVendorDir = resolve45(state.resolvedPaths.buildDir, "react", "vendor");
|
|
29280
|
+
const angularVendorDir = resolve45(state.resolvedPaths.buildDir, "angular", "vendor");
|
|
29281
|
+
const svelteVendorDir = resolve45(state.resolvedPaths.buildDir, "svelte", "vendor");
|
|
29282
|
+
const vueVendorDir = resolve45(state.resolvedPaths.buildDir, "vue", "vendor");
|
|
29283
|
+
const depVendorDir = resolve45(state.resolvedPaths.buildDir, "vendor");
|
|
29125
29284
|
const { buildDepVendor: buildDepVendor2 } = await Promise.resolve().then(() => (init_buildDepVendor(), exports_buildDepVendor));
|
|
29126
29285
|
const [, angularSpecs, , , , , depPaths] = await Promise.all([
|
|
29127
29286
|
config.reactDirectory ? buildReactVendor(state.resolvedPaths.buildDir) : Promise.resolve(undefined),
|
|
@@ -29202,7 +29361,7 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
29202
29361
|
manifest
|
|
29203
29362
|
};
|
|
29204
29363
|
globalThis.__hmrDevResult = result;
|
|
29205
|
-
globalThis.__hmrServerMtime = statSync7(
|
|
29364
|
+
globalThis.__hmrServerMtime = statSync7(resolve45(Bun.main)).mtimeMs;
|
|
29206
29365
|
return result;
|
|
29207
29366
|
};
|
|
29208
29367
|
var init_devBuild = __esm(() => {
|
|
@@ -29275,7 +29434,7 @@ var exports_hmr = {};
|
|
|
29275
29434
|
__export(exports_hmr, {
|
|
29276
29435
|
hmr: () => hmr
|
|
29277
29436
|
});
|
|
29278
|
-
import
|
|
29437
|
+
import Elysia5 from "elysia";
|
|
29279
29438
|
import { websocket as websocket2 } from "elysia/websocket";
|
|
29280
29439
|
var STORE_KEY = "__elysiaStore", restoredStores, getGlobalValue = (key) => Reflect.get(globalThis, key), restoreStore = (store) => {
|
|
29281
29440
|
if (!store || typeof store !== "object")
|
|
@@ -29351,8 +29510,8 @@ var STORE_KEY = "__elysiaStore", restoredStores, getGlobalValue = (key) => Refle
|
|
|
29351
29510
|
return null;
|
|
29352
29511
|
if (!pathname.startsWith("/"))
|
|
29353
29512
|
return null;
|
|
29354
|
-
const { resolve:
|
|
29355
|
-
const candidate =
|
|
29513
|
+
const { resolve: resolve46, normalize } = await import("path");
|
|
29514
|
+
const candidate = resolve46(buildDir, pathname.slice(1));
|
|
29356
29515
|
const normalizedBuild = normalize(buildDir);
|
|
29357
29516
|
if (!candidate.startsWith(normalizedBuild))
|
|
29358
29517
|
return null;
|
|
@@ -29371,7 +29530,7 @@ var STORE_KEY = "__elysiaStore", restoredStores, getGlobalValue = (key) => Refle
|
|
|
29371
29530
|
return candidate;
|
|
29372
29531
|
}
|
|
29373
29532
|
return null;
|
|
29374
|
-
}, hmr = (hmrState2, manifest, moduleServerHandler) => new
|
|
29533
|
+
}, hmr = (hmrState2, manifest, moduleServerHandler) => new Elysia5({ name: "absolutejs-hmr" }).use(websocket2({
|
|
29375
29534
|
idleTimeout: DEFAULT_WEBSOCKET_IDLE_TIMEOUT_SECONDS,
|
|
29376
29535
|
sendPings: true
|
|
29377
29536
|
})).request(async ({ request, store }) => {
|
|
@@ -29440,12 +29599,12 @@ __export(exports_devtoolsJson, {
|
|
|
29440
29599
|
devtoolsJson: () => devtoolsJson
|
|
29441
29600
|
});
|
|
29442
29601
|
import { existsSync as existsSync37, mkdirSync as mkdirSync15, readFileSync as readFileSync31, writeFileSync as writeFileSync10 } from "fs";
|
|
29443
|
-
import { dirname as dirname30, join as join48, resolve as
|
|
29444
|
-
import { Elysia as
|
|
29602
|
+
import { dirname as dirname30, join as join48, resolve as resolve46 } from "path";
|
|
29603
|
+
import { Elysia as Elysia6 } from "elysia";
|
|
29445
29604
|
var ENDPOINT = "/.well-known/appspecific/com.chrome.devtools.json", UUID_CACHE_KEY = "__absoluteDevtoolsWorkspaceUuid", getGlobalUuid = () => Reflect.get(globalThis, UUID_CACHE_KEY), setGlobalUuid = (uuid) => {
|
|
29446
29605
|
Reflect.set(globalThis, UUID_CACHE_KEY, uuid);
|
|
29447
29606
|
return uuid;
|
|
29448
|
-
}, isUuidV4 = (value) => /^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(value), resolveDevtoolsUuidCachePath = (buildDir, uuidCachePath) =>
|
|
29607
|
+
}, isUuidV4 = (value) => /^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(value), resolveDevtoolsUuidCachePath = (buildDir, uuidCachePath) => resolve46(uuidCachePath ?? join48(buildDir, ".absolute", "chrome-devtools-workspace-uuid")), readCachedUuid = (cachePath) => {
|
|
29449
29608
|
if (!existsSync37(cachePath))
|
|
29450
29609
|
return null;
|
|
29451
29610
|
try {
|
|
@@ -29471,10 +29630,10 @@ var ENDPOINT = "/.well-known/appspecific/com.chrome.devtools.json", UUID_CACHE_K
|
|
|
29471
29630
|
writeFileSync10(cachePath, uuid, "utf-8");
|
|
29472
29631
|
return setGlobalUuid(uuid);
|
|
29473
29632
|
}, devtoolsJson = (buildDir, options = {}) => {
|
|
29474
|
-
const rootPath =
|
|
29633
|
+
const rootPath = resolve46(options.projectRoot ?? process.cwd());
|
|
29475
29634
|
const root = options.normalizeForWindowsContainer === false ? rootPath : normalizeDevtoolsWorkspaceRoot(rootPath);
|
|
29476
29635
|
const uuid = getOrCreateUuid(buildDir, options);
|
|
29477
|
-
return new
|
|
29636
|
+
return new Elysia6({ name: "absolute-devtools-json" }).get(ENDPOINT, () => ({
|
|
29478
29637
|
workspace: {
|
|
29479
29638
|
root,
|
|
29480
29639
|
uuid
|
|
@@ -29500,8 +29659,8 @@ __export(exports_imageOptimizer, {
|
|
|
29500
29659
|
imageOptimizer: () => imageOptimizer
|
|
29501
29660
|
});
|
|
29502
29661
|
import { existsSync as existsSync38 } from "fs";
|
|
29503
|
-
import { resolve as
|
|
29504
|
-
import { Elysia as
|
|
29662
|
+
import { resolve as resolve47 } from "path";
|
|
29663
|
+
import { Elysia as Elysia7 } from "elysia";
|
|
29505
29664
|
var DEFAULT_CACHE_TTL_SECONDS = 60, MS_PER_SECOND = 1000, MAX_QUALITY = 100, avifInProgress, safeResolve = (path, baseDir) => {
|
|
29506
29665
|
try {
|
|
29507
29666
|
const resolved = validateSafePath(path, baseDir);
|
|
@@ -29513,7 +29672,7 @@ var DEFAULT_CACHE_TTL_SECONDS = 60, MS_PER_SECOND = 1000, MAX_QUALITY = 100, avi
|
|
|
29513
29672
|
}
|
|
29514
29673
|
}, resolveLocalImage = (url, buildDir) => {
|
|
29515
29674
|
const cleanPath = url.startsWith("/") ? url.slice(1) : url;
|
|
29516
|
-
return safeResolve(cleanPath, buildDir) ?? safeResolve(cleanPath,
|
|
29675
|
+
return safeResolve(cleanPath, buildDir) ?? safeResolve(cleanPath, resolve47(process.cwd()));
|
|
29517
29676
|
}, parseQueryParams = (query, allowedSizes, defaultQuality) => {
|
|
29518
29677
|
const url = typeof query["url"] === "string" ? query["url"] : undefined;
|
|
29519
29678
|
const wParam = typeof query["w"] === "string" ? query["w"] : undefined;
|
|
@@ -29614,7 +29773,7 @@ var DEFAULT_CACHE_TTL_SECONDS = 60, MS_PER_SECOND = 1000, MAX_QUALITY = 100, avi
|
|
|
29614
29773
|
}
|
|
29615
29774
|
});
|
|
29616
29775
|
}, imageOptimizer = (config, buildDir) => {
|
|
29617
|
-
const plugin = new
|
|
29776
|
+
const plugin = new Elysia7({ name: "image-optimizer" });
|
|
29618
29777
|
if (!config && config !== undefined)
|
|
29619
29778
|
return plugin;
|
|
29620
29779
|
if (config?.unoptimized)
|
|
@@ -29714,7 +29873,7 @@ var exports_requestInspector = {};
|
|
|
29714
29873
|
__export(exports_requestInspector, {
|
|
29715
29874
|
requestInspector: () => requestInspector
|
|
29716
29875
|
});
|
|
29717
|
-
import { Elysia as
|
|
29876
|
+
import { Elysia as Elysia8 } from "elysia";
|
|
29718
29877
|
var RING_MAX = 200, DEFAULT_STATUS = 200, ASSET_EXTENSION, requestLog = () => {
|
|
29719
29878
|
globalThis.__absoluteRequestLog ??= [];
|
|
29720
29879
|
return globalThis.__absoluteRequestLog;
|
|
@@ -29750,7 +29909,7 @@ var RING_MAX = 200, DEFAULT_STATUS = 200, ASSET_EXTENSION, requestLog = () => {
|
|
|
29750
29909
|
var init_requestInspector = __esm(() => {
|
|
29751
29910
|
ASSET_EXTENSION = /\.(?:avif|css|gif|ico|jpe?g|js|json|map|mjs|otf|png|svg|ttf|txt|wasm|webp|woff2?)$/i;
|
|
29752
29911
|
pending = new WeakMap;
|
|
29753
|
-
requestInspector = new
|
|
29912
|
+
requestInspector = new Elysia8({
|
|
29754
29913
|
name: "absolute-request-inspector"
|
|
29755
29914
|
}).get("/__absolute/requests", () => requestLog()).request(({ request }) => {
|
|
29756
29915
|
pending.set(request, {
|
|
@@ -30023,7 +30182,7 @@ import {
|
|
|
30023
30182
|
watch as watch2
|
|
30024
30183
|
} from "fs";
|
|
30025
30184
|
import { createHash as createHash9 } from "crypto";
|
|
30026
|
-
import { dirname as dirname31, join as join53, resolve as
|
|
30185
|
+
import { dirname as dirname31, join as join53, resolve as resolve48 } from "path";
|
|
30027
30186
|
var ATOMIC_RECOVERY_WINDOW_MS = 1000, RELOAD_DEBOUNCE_MS = 80, ENTRY_IMPORT_RETRY_DELAY_MS = 250, MAX_ENTRY_IMPORT_ATTEMPTS = 3, WATCH_FALLBACK_INTERVAL_MS = 250, ATOMIC_WRITE_TEMP_PATTERNS2, isAtomicWriteTemp = (filename) => filename.endsWith(".tmp") || filename.includes(".tmp.") || filename.endsWith("~") || filename.startsWith(".#") || filename.startsWith(".absolutejs-hmr-") || ATOMIC_WRITE_TEMP_PATTERNS2.some((pattern) => pattern.test(filename)), fileHash = (path) => {
|
|
30028
30187
|
try {
|
|
30029
30188
|
return createHash9("sha256").update(readFileSync36(path)).digest("hex");
|
|
@@ -30051,10 +30210,10 @@ var ATOMIC_RECOVERY_WINDOW_MS = 1000, RELOAD_DEBOUNCE_MS = 80, ENTRY_IMPORT_RETR
|
|
|
30051
30210
|
return;
|
|
30052
30211
|
globalThis.__absoluteEntryWatcherStarted = true;
|
|
30053
30212
|
globalThis.__absoluteEntryWatcherReady = false;
|
|
30054
|
-
const entryPath =
|
|
30213
|
+
const entryPath = resolve48(originalEntry);
|
|
30055
30214
|
const entryDir = dirname31(entryPath);
|
|
30056
30215
|
const entryBase = entryPath.slice(entryDir.length + 1);
|
|
30057
|
-
const configPath2 =
|
|
30216
|
+
const configPath2 = resolve48(process.env.ABSOLUTE_CONFIG ?? "absolute.config.ts");
|
|
30058
30217
|
const configDir2 = dirname31(configPath2);
|
|
30059
30218
|
const configBase = configPath2.slice(configDir2.length + 1);
|
|
30060
30219
|
const recentlyHandled = new Map;
|
|
@@ -30758,7 +30917,7 @@ var handleHTMXPageRequest = async (pagePath) => {
|
|
|
30758
30917
|
import { createHash as createHash8 } from "crypto";
|
|
30759
30918
|
import { existsSync as existsSync39, readdirSync as readdirSync10, readFileSync as readFileSync33 } from "fs";
|
|
30760
30919
|
import { basename as basename18, join as join50, relative as relative19, resolve as resolvePath4 } from "path";
|
|
30761
|
-
import { Elysia as
|
|
30920
|
+
import { Elysia as Elysia9, NotFound } from "elysia";
|
|
30762
30921
|
|
|
30763
30922
|
// src/plugins/openApiPlugin.ts
|
|
30764
30923
|
import { existsSync as existsSync7, readFileSync as readFileSync8 } from "fs";
|
|
@@ -31225,6 +31384,7 @@ var parseCompatibilityPage = (value) => {
|
|
|
31225
31384
|
}
|
|
31226
31385
|
return {
|
|
31227
31386
|
bundleHash: readString(value.bundleHash, "page.bundleHash"),
|
|
31387
|
+
bundlePath: readString(value.bundlePath, "page.bundlePath"),
|
|
31228
31388
|
contract: readString(value.contract, "page.contract"),
|
|
31229
31389
|
framework: value.framework,
|
|
31230
31390
|
pageId: readString(value.pageId, "page.pageId"),
|
|
@@ -31262,6 +31422,7 @@ var validateProducerModule = (module) => {
|
|
|
31262
31422
|
};
|
|
31263
31423
|
var normalizePage = (page) => ({
|
|
31264
31424
|
bundleHash: requireNonEmpty(page.bundleHash, "page.bundleHash"),
|
|
31425
|
+
bundlePath: requireNonEmpty(page.bundlePath, "page.bundlePath"),
|
|
31265
31426
|
contract: requireNonEmpty(page.contract, "page.contract"),
|
|
31266
31427
|
framework: page.framework,
|
|
31267
31428
|
pageId: requireNonEmpty(page.pageId, "page.pageId"),
|
|
@@ -31397,7 +31558,7 @@ var ensureProducerStorage = () => {
|
|
|
31397
31558
|
};
|
|
31398
31559
|
var runWithAbsoluteMobileProducer = (context, callback) => ensureProducerStorage().run(context, callback);
|
|
31399
31560
|
|
|
31400
|
-
// src/mobile/
|
|
31561
|
+
// src/mobile/routeMatcher.ts
|
|
31401
31562
|
var REGEXP_SPECIAL_CHARACTERS = /[.*+?^${}()|[\]\\]/g;
|
|
31402
31563
|
var routeSegmentPattern = (segment) => {
|
|
31403
31564
|
if (segment === "*")
|
|
@@ -31408,13 +31569,16 @@ var routeSegmentPattern = (segment) => {
|
|
|
31408
31569
|
return "[^/]+";
|
|
31409
31570
|
return segment.replace(REGEXP_SPECIAL_CHARACTERS, "\\$&");
|
|
31410
31571
|
};
|
|
31411
|
-
var
|
|
31572
|
+
var matchesAbsoluteMobileRoutePattern = (pattern, pathname) => {
|
|
31412
31573
|
const expression = pattern.split("/").map(routeSegmentPattern).join("/");
|
|
31413
31574
|
return new RegExp(`^${expression}/?$`).test(pathname);
|
|
31414
31575
|
};
|
|
31576
|
+
var resolveAbsoluteMobileRoute = (routes, pathname, method = "GET") => routes.find((route) => route.method === method && matchesAbsoluteMobileRoutePattern(route.pattern, pathname));
|
|
31577
|
+
|
|
31578
|
+
// src/mobile/compatibilityDispatcher.ts
|
|
31415
31579
|
var artifactOwnsRequest = (artifact, pageId, request) => {
|
|
31416
31580
|
const { pathname } = new URL(request.url);
|
|
31417
|
-
return artifact.routes.some((route) => route.pageId === pageId && route.method === request.method &&
|
|
31581
|
+
return artifact.routes.some((route) => route.pageId === pageId && route.method === request.method && matchesAbsoluteMobileRoutePattern(route.pattern, pathname));
|
|
31418
31582
|
};
|
|
31419
31583
|
var createProducerResolver = (loadProducer) => {
|
|
31420
31584
|
const producers = new Map;
|
|
@@ -31465,16 +31629,359 @@ var createAbsoluteMobileCompatibilityDispatcher = (options) => {
|
|
|
31465
31629
|
}).as("global");
|
|
31466
31630
|
};
|
|
31467
31631
|
|
|
31632
|
+
// src/mobile/associationFiles.ts
|
|
31633
|
+
import {
|
|
31634
|
+
access,
|
|
31635
|
+
mkdir as mkdir5,
|
|
31636
|
+
readFile as readFile3,
|
|
31637
|
+
rename,
|
|
31638
|
+
rm,
|
|
31639
|
+
writeFile
|
|
31640
|
+
} from "fs/promises";
|
|
31641
|
+
import { resolve as resolve12 } from "path";
|
|
31642
|
+
import { Elysia as Elysia3 } from "elysia";
|
|
31643
|
+
|
|
31644
|
+
// src/mobile/config.ts
|
|
31645
|
+
import { resolve as resolve11 } from "path";
|
|
31646
|
+
var APP_ID_PATTERN = /^[A-Za-z][\w]*(?:\.[A-Za-z][\w]*)+$/;
|
|
31647
|
+
var SCHEME_PATTERN = /^[a-z][a-z0-9+.-]*$/;
|
|
31648
|
+
var APPLE_APP_ID_PREFIX_PATTERN = /^[A-Z0-9]{10}$/;
|
|
31649
|
+
var CERTIFICATE_FINGERPRINT_PATTERN = /^[0-9A-F]{64}$/;
|
|
31650
|
+
var HOSTNAME_PATTERN = /^(?=.{1,253}$)(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)(?:\.(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?))*$/;
|
|
31651
|
+
var resolveProjectPath = (projectRoot, value, field) => {
|
|
31652
|
+
const root = resolve11(projectRoot);
|
|
31653
|
+
const path = resolve11(root, value);
|
|
31654
|
+
if (path !== root && !path.startsWith(`${root}/`)) {
|
|
31655
|
+
throw new TypeError(`${field} must remain inside the project root.`);
|
|
31656
|
+
}
|
|
31657
|
+
return path;
|
|
31658
|
+
};
|
|
31659
|
+
var requireText = (value, field) => {
|
|
31660
|
+
const normalized = value.trim();
|
|
31661
|
+
if (!normalized)
|
|
31662
|
+
throw new TypeError(`${field} must not be empty.`);
|
|
31663
|
+
return normalized;
|
|
31664
|
+
};
|
|
31665
|
+
var normalizeEntry = (entry) => {
|
|
31666
|
+
const normalized = requireText(entry ?? "/", "mobile.entry");
|
|
31667
|
+
if (!normalized.startsWith("/") || normalized.startsWith("//")) {
|
|
31668
|
+
throw new TypeError("mobile.entry must be an absolute application path.");
|
|
31669
|
+
}
|
|
31670
|
+
return normalized;
|
|
31671
|
+
};
|
|
31672
|
+
var normalizeProductionOrigin = (value) => {
|
|
31673
|
+
const parsed = new URL(requireText(value, "mobile.server.productionOrigin"));
|
|
31674
|
+
if (parsed.protocol !== "https:") {
|
|
31675
|
+
throw new TypeError("mobile.server.productionOrigin must use HTTPS in production.");
|
|
31676
|
+
}
|
|
31677
|
+
if (parsed.username || parsed.password || parsed.pathname !== "/" || parsed.search || parsed.hash) {
|
|
31678
|
+
throw new TypeError("mobile.server.productionOrigin must be an origin without credentials, path, query, or hash.");
|
|
31679
|
+
}
|
|
31680
|
+
return parsed.origin;
|
|
31681
|
+
};
|
|
31682
|
+
var normalizePlatforms = (platforms) => {
|
|
31683
|
+
const normalized = [
|
|
31684
|
+
...new Set(platforms ?? ["ios", "android"])
|
|
31685
|
+
];
|
|
31686
|
+
if (normalized.length === 0) {
|
|
31687
|
+
throw new TypeError("mobile.platforms must contain at least one platform.");
|
|
31688
|
+
}
|
|
31689
|
+
return normalized;
|
|
31690
|
+
};
|
|
31691
|
+
var normalizeHosts = (hosts, productionOrigin) => {
|
|
31692
|
+
const normalizeHostname = (host) => {
|
|
31693
|
+
const value = requireText(host, "mobile.deepLinks.hosts").toLowerCase();
|
|
31694
|
+
if (!HOSTNAME_PATTERN.test(value)) {
|
|
31695
|
+
throw new TypeError("mobile.deepLinks.hosts entries must be valid hostnames without ports, wildcards, or paths.");
|
|
31696
|
+
}
|
|
31697
|
+
return value;
|
|
31698
|
+
};
|
|
31699
|
+
const normalized = new Set([
|
|
31700
|
+
normalizeHostname(new URL(productionOrigin).hostname)
|
|
31701
|
+
]);
|
|
31702
|
+
for (const host of hosts ?? []) {
|
|
31703
|
+
normalized.add(normalizeHostname(host));
|
|
31704
|
+
}
|
|
31705
|
+
return [...normalized].sort();
|
|
31706
|
+
};
|
|
31707
|
+
var normalizeAppleAppIdPrefix = (value) => {
|
|
31708
|
+
if (value === undefined)
|
|
31709
|
+
return;
|
|
31710
|
+
const normalized = requireText(value, "mobile.deepLinks.apple.appIdPrefix").toUpperCase();
|
|
31711
|
+
if (!APPLE_APP_ID_PREFIX_PATTERN.test(normalized)) {
|
|
31712
|
+
throw new TypeError("mobile.deepLinks.apple.appIdPrefix must contain ten letters or digits.");
|
|
31713
|
+
}
|
|
31714
|
+
return normalized;
|
|
31715
|
+
};
|
|
31716
|
+
var normalizeIosVersion = (value) => {
|
|
31717
|
+
if (value === undefined)
|
|
31718
|
+
return;
|
|
31719
|
+
const normalized = requireText(value, "mobile.ios.version");
|
|
31720
|
+
if (!/^\d+(?:\.\d+){0,2}$/u.test(normalized)) {
|
|
31721
|
+
throw new TypeError("mobile.ios.version must contain one to three dot-separated integer components, for example 1.4.0.");
|
|
31722
|
+
}
|
|
31723
|
+
return normalized;
|
|
31724
|
+
};
|
|
31725
|
+
var normalizeCertificateFingerprints = (values) => [
|
|
31726
|
+
...new Set((values ?? []).map((value) => requireText(value, "mobile.deepLinks.android.sha256CertificateFingerprints").replaceAll(":", "").toUpperCase()).map((value) => {
|
|
31727
|
+
if (!CERTIFICATE_FINGERPRINT_PATTERN.test(value)) {
|
|
31728
|
+
throw new TypeError("mobile.deepLinks.android.sha256CertificateFingerprints entries must be SHA-256 certificate fingerprints.");
|
|
31729
|
+
}
|
|
31730
|
+
return value.match(/.{2}/g)?.join(":") ?? value;
|
|
31731
|
+
}))
|
|
31732
|
+
].sort();
|
|
31733
|
+
var normalizeAbsoluteMobileConfig = (config, projectRoot) => {
|
|
31734
|
+
const appId = requireText(config.appId, "mobile.appId");
|
|
31735
|
+
if (!APP_ID_PATTERN.test(appId)) {
|
|
31736
|
+
throw new TypeError("mobile.appId must use reverse-domain notation, for example com.example.app.");
|
|
31737
|
+
}
|
|
31738
|
+
const productionOrigin = normalizeProductionOrigin(config.server.productionOrigin);
|
|
31739
|
+
const deepLinkScheme = config.deepLinks?.scheme?.trim().toLowerCase();
|
|
31740
|
+
if (deepLinkScheme && !SCHEME_PATTERN.test(deepLinkScheme)) {
|
|
31741
|
+
throw new TypeError("mobile.deepLinks.scheme is not a valid URL scheme.");
|
|
31742
|
+
}
|
|
31743
|
+
return {
|
|
31744
|
+
androidCertificateFingerprints: normalizeCertificateFingerprints(config.deepLinks?.android?.sha256CertificateFingerprints),
|
|
31745
|
+
appId,
|
|
31746
|
+
appleAppIdPrefix: normalizeAppleAppIdPrefix(config.deepLinks?.apple?.appIdPrefix),
|
|
31747
|
+
appName: requireText(config.appName, "mobile.appName"),
|
|
31748
|
+
bundleDirectory: resolveProjectPath(projectRoot, config.bundleDirectory ?? ".absolutejs/mobile/web", "mobile.bundleDirectory"),
|
|
31749
|
+
deepLinkHosts: normalizeHosts(config.deepLinks?.hosts, productionOrigin),
|
|
31750
|
+
deepLinkScheme,
|
|
31751
|
+
engine: "capacitor",
|
|
31752
|
+
entry: normalizeEntry(config.entry),
|
|
31753
|
+
iosVersion: normalizeIosVersion(config.ios?.version),
|
|
31754
|
+
nativeProjectDirectory: resolveProjectPath(projectRoot, config.nativeProject?.directory ?? "mobile", "mobile.nativeProject.directory"),
|
|
31755
|
+
platforms: normalizePlatforms(config.platforms),
|
|
31756
|
+
productionOrigin
|
|
31757
|
+
};
|
|
31758
|
+
};
|
|
31759
|
+
|
|
31760
|
+
// src/mobile/associationFiles.ts
|
|
31761
|
+
var JSON_HEADERS = {
|
|
31762
|
+
"cache-control": "public, max-age=300, must-revalidate",
|
|
31763
|
+
"content-type": "application/json; charset=utf-8"
|
|
31764
|
+
};
|
|
31765
|
+
var OWNERSHIP_FILE = ".absolutejs-mobile-associations.json";
|
|
31766
|
+
var HTTP_OK = 200;
|
|
31767
|
+
var VERIFY_TIMEOUT_MS = 1e4;
|
|
31768
|
+
var ANDROID_ASSOCIATION_PATH = "/.well-known/assetlinks.json";
|
|
31769
|
+
var APPLE_ASSOCIATION_PATH = "/.well-known/apple-app-site-association";
|
|
31770
|
+
var missingIdentity = (field, platform2) => new TypeError(`${field} is required to publish ${platform2} deep-link association files.`);
|
|
31771
|
+
var createAppleDocument = (config, requireAll) => {
|
|
31772
|
+
if (!config.platforms.includes("ios"))
|
|
31773
|
+
return;
|
|
31774
|
+
if (!config.appleAppIdPrefix && requireAll) {
|
|
31775
|
+
throw missingIdentity("mobile.deepLinks.apple.appIdPrefix", "iOS");
|
|
31776
|
+
}
|
|
31777
|
+
if (!config.appleAppIdPrefix)
|
|
31778
|
+
return;
|
|
31779
|
+
return {
|
|
31780
|
+
applinks: {
|
|
31781
|
+
details: [
|
|
31782
|
+
{
|
|
31783
|
+
appIDs: [
|
|
31784
|
+
`${config.appleAppIdPrefix}.${config.appId}`
|
|
31785
|
+
],
|
|
31786
|
+
components: [{ "/": "/*" }]
|
|
31787
|
+
}
|
|
31788
|
+
]
|
|
31789
|
+
}
|
|
31790
|
+
};
|
|
31791
|
+
};
|
|
31792
|
+
var createAndroidDocument = (config, requireAll) => {
|
|
31793
|
+
if (!config.platforms.includes("android"))
|
|
31794
|
+
return;
|
|
31795
|
+
if (config.androidCertificateFingerprints.length === 0 && requireAll) {
|
|
31796
|
+
throw missingIdentity("mobile.deepLinks.android.sha256CertificateFingerprints", "Android");
|
|
31797
|
+
}
|
|
31798
|
+
if (config.androidCertificateFingerprints.length === 0)
|
|
31799
|
+
return;
|
|
31800
|
+
return [
|
|
31801
|
+
{
|
|
31802
|
+
relation: ["delegate_permission/common.handle_all_urls"],
|
|
31803
|
+
target: {
|
|
31804
|
+
namespace: "android_app",
|
|
31805
|
+
package_name: config.appId,
|
|
31806
|
+
sha256_cert_fingerprints: config.androidCertificateFingerprints
|
|
31807
|
+
}
|
|
31808
|
+
}
|
|
31809
|
+
];
|
|
31810
|
+
};
|
|
31811
|
+
var createAbsoluteMobileAssociationDocuments = (config, options = {}) => {
|
|
31812
|
+
const documents = {};
|
|
31813
|
+
const requireAll = options.requireAll === true;
|
|
31814
|
+
const android = createAndroidDocument(config, requireAll);
|
|
31815
|
+
const apple = createAppleDocument(config, requireAll);
|
|
31816
|
+
if (android)
|
|
31817
|
+
documents.android = android;
|
|
31818
|
+
if (apple)
|
|
31819
|
+
documents.apple = apple;
|
|
31820
|
+
return documents;
|
|
31821
|
+
};
|
|
31822
|
+
var jsonResponse = (value) => new Response(`${JSON.stringify(value)}
|
|
31823
|
+
`, { headers: JSON_HEADERS });
|
|
31824
|
+
var createAbsoluteMobileAssociationPlugin = (mobile, projectRoot, options = {}) => {
|
|
31825
|
+
const plugin = new Elysia3({ name: "absolutejs-mobile-associations" });
|
|
31826
|
+
if (!mobile)
|
|
31827
|
+
return plugin;
|
|
31828
|
+
const config = normalizeAbsoluteMobileConfig(mobile, projectRoot);
|
|
31829
|
+
const documents = createAbsoluteMobileAssociationDocuments(config, options);
|
|
31830
|
+
if (documents.apple) {
|
|
31831
|
+
plugin.get(APPLE_ASSOCIATION_PATH, () => jsonResponse(documents.apple));
|
|
31832
|
+
}
|
|
31833
|
+
if (documents.android) {
|
|
31834
|
+
plugin.get(ANDROID_ASSOCIATION_PATH, () => jsonResponse(documents.android));
|
|
31835
|
+
}
|
|
31836
|
+
return plugin;
|
|
31837
|
+
};
|
|
31838
|
+
var writeAtomic = async (path, source) => {
|
|
31839
|
+
let current;
|
|
31840
|
+
try {
|
|
31841
|
+
current = await readFile3(path, "utf8");
|
|
31842
|
+
} catch (error) {
|
|
31843
|
+
if (!(error instanceof Error) || !("code" in error) || error.code !== "ENOENT") {
|
|
31844
|
+
throw error;
|
|
31845
|
+
}
|
|
31846
|
+
}
|
|
31847
|
+
if (current === source)
|
|
31848
|
+
return false;
|
|
31849
|
+
const temporary = `${path}.${crypto.randomUUID()}.tmp`;
|
|
31850
|
+
await writeFile(temporary, source, { flag: "wx" });
|
|
31851
|
+
await rename(temporary, path);
|
|
31852
|
+
return true;
|
|
31853
|
+
};
|
|
31854
|
+
var exists = async (path) => {
|
|
31855
|
+
try {
|
|
31856
|
+
await access(path);
|
|
31857
|
+
return true;
|
|
31858
|
+
} catch {
|
|
31859
|
+
return false;
|
|
31860
|
+
}
|
|
31861
|
+
};
|
|
31862
|
+
var assertOwnedOutput = async (root) => {
|
|
31863
|
+
const path = resolve12(root, OWNERSHIP_FILE);
|
|
31864
|
+
let ownership;
|
|
31865
|
+
try {
|
|
31866
|
+
ownership = JSON.parse(await readFile3(path, "utf8"));
|
|
31867
|
+
} catch {
|
|
31868
|
+
throw new TypeError(`Association output ${root} already exists and is not owned by AbsoluteJS.`);
|
|
31869
|
+
}
|
|
31870
|
+
if (typeof ownership !== "object" || ownership === null || Reflect.get(ownership, "format") !== 1) {
|
|
31871
|
+
throw new TypeError(`Association output ${root} has an unsupported ownership manifest.`);
|
|
31872
|
+
}
|
|
31873
|
+
};
|
|
31874
|
+
var publishGeneratedDirectory = async (temporary, root) => {
|
|
31875
|
+
const hasCurrent = await exists(root);
|
|
31876
|
+
if (hasCurrent)
|
|
31877
|
+
await assertOwnedOutput(root);
|
|
31878
|
+
const backup = `${root}.${crypto.randomUUID()}.previous`;
|
|
31879
|
+
if (hasCurrent)
|
|
31880
|
+
await rename(root, backup);
|
|
31881
|
+
try {
|
|
31882
|
+
await rename(temporary, root);
|
|
31883
|
+
} catch (error) {
|
|
31884
|
+
if (hasCurrent)
|
|
31885
|
+
await rename(backup, root);
|
|
31886
|
+
throw error;
|
|
31887
|
+
}
|
|
31888
|
+
if (hasCurrent)
|
|
31889
|
+
await rm(backup, { force: true, recursive: true });
|
|
31890
|
+
};
|
|
31891
|
+
var materializeHost = async (root, host, files) => {
|
|
31892
|
+
const directory = resolve12(root, host, ".well-known");
|
|
31893
|
+
await mkdir5(directory, { recursive: true });
|
|
31894
|
+
return Promise.all(files.map(async ([name, document2]) => {
|
|
31895
|
+
const path = resolve12(directory, name);
|
|
31896
|
+
await writeAtomic(path, `${JSON.stringify(document2, null, 2)}
|
|
31897
|
+
`);
|
|
31898
|
+
return path;
|
|
31899
|
+
}));
|
|
31900
|
+
};
|
|
31901
|
+
var associationEndpoints = (config, documents) => config.deepLinkHosts.flatMap((host) => {
|
|
31902
|
+
const endpoints = [];
|
|
31903
|
+
if (documents.android)
|
|
31904
|
+
endpoints.push({
|
|
31905
|
+
document: documents.android,
|
|
31906
|
+
host,
|
|
31907
|
+
path: ANDROID_ASSOCIATION_PATH,
|
|
31908
|
+
platform: "Android"
|
|
31909
|
+
});
|
|
31910
|
+
if (documents.apple)
|
|
31911
|
+
endpoints.push({
|
|
31912
|
+
document: documents.apple,
|
|
31913
|
+
host,
|
|
31914
|
+
path: APPLE_ASSOCIATION_PATH,
|
|
31915
|
+
platform: "Apple"
|
|
31916
|
+
});
|
|
31917
|
+
return endpoints;
|
|
31918
|
+
});
|
|
31919
|
+
var materializeAbsoluteMobileAssociationFiles = async (config, outputDirectory) => {
|
|
31920
|
+
const root = resolve12(outputDirectory);
|
|
31921
|
+
const temporary = `${root}.${crypto.randomUUID()}.tmp`;
|
|
31922
|
+
const documents = createAbsoluteMobileAssociationDocuments(config, {
|
|
31923
|
+
requireAll: true
|
|
31924
|
+
});
|
|
31925
|
+
const files = [];
|
|
31926
|
+
if (documents.android)
|
|
31927
|
+
files.push(["assetlinks.json", documents.android]);
|
|
31928
|
+
if (documents.apple) {
|
|
31929
|
+
files.push(["apple-app-site-association", documents.apple]);
|
|
31930
|
+
}
|
|
31931
|
+
await mkdir5(temporary, { recursive: true });
|
|
31932
|
+
try {
|
|
31933
|
+
const temporaryPaths = (await Promise.all(config.deepLinkHosts.map((host) => materializeHost(temporary, host, files)))).flat();
|
|
31934
|
+
await writeAtomic(resolve12(temporary, OWNERSHIP_FILE), `${JSON.stringify({ format: 1, hosts: config.deepLinkHosts }, null, 2)}
|
|
31935
|
+
`);
|
|
31936
|
+
await publishGeneratedDirectory(temporary, root);
|
|
31937
|
+
const written = temporaryPaths.map((path) => resolve12(root, path.slice(temporary.length + 1)));
|
|
31938
|
+
return { root, written };
|
|
31939
|
+
} catch (error) {
|
|
31940
|
+
await rm(temporary, { force: true, recursive: true });
|
|
31941
|
+
throw error;
|
|
31942
|
+
}
|
|
31943
|
+
};
|
|
31944
|
+
var verifyAbsoluteMobileAssociationFiles = async (config, request = globalThis.fetch) => {
|
|
31945
|
+
const documents = createAbsoluteMobileAssociationDocuments(config, {
|
|
31946
|
+
requireAll: true
|
|
31947
|
+
});
|
|
31948
|
+
const results = await Promise.all(associationEndpoints(config, documents).map(async (endpoint) => {
|
|
31949
|
+
const url = `https://${endpoint.host}${endpoint.path}`;
|
|
31950
|
+
const response = await request(url, {
|
|
31951
|
+
redirect: "manual",
|
|
31952
|
+
signal: AbortSignal.timeout(VERIFY_TIMEOUT_MS)
|
|
31953
|
+
});
|
|
31954
|
+
if (response.status !== HTTP_OK) {
|
|
31955
|
+
throw new TypeError(`${endpoint.platform} association verification failed for ${url}: HTTP ${response.status}; redirects are not allowed.`);
|
|
31956
|
+
}
|
|
31957
|
+
const contentType = response.headers.get("content-type") ?? "";
|
|
31958
|
+
if (!contentType.toLowerCase().startsWith("application/json")) {
|
|
31959
|
+
throw new TypeError(`${endpoint.platform} association verification failed for ${url}: expected application/json.`);
|
|
31960
|
+
}
|
|
31961
|
+
let document2;
|
|
31962
|
+
try {
|
|
31963
|
+
document2 = await response.json();
|
|
31964
|
+
} catch {
|
|
31965
|
+
throw new TypeError(`${endpoint.platform} association verification failed for ${url}: invalid JSON.`);
|
|
31966
|
+
}
|
|
31967
|
+
if (JSON.stringify(document2) !== JSON.stringify(endpoint.document)) {
|
|
31968
|
+
throw new TypeError(`${endpoint.platform} association verification failed for ${url}: the hosted identity does not match mobile config.`);
|
|
31969
|
+
}
|
|
31970
|
+
return { platform: endpoint.platform, url };
|
|
31971
|
+
}));
|
|
31972
|
+
return { results };
|
|
31973
|
+
};
|
|
31974
|
+
|
|
31468
31975
|
// src/mobile/materializedBundle.ts
|
|
31469
31976
|
import { createHash as createHash6 } from "crypto";
|
|
31470
31977
|
import {
|
|
31471
|
-
access,
|
|
31472
|
-
mkdir as
|
|
31978
|
+
access as access2,
|
|
31979
|
+
mkdir as mkdir7,
|
|
31473
31980
|
mkdtemp as mkdtemp2,
|
|
31474
|
-
readFile as
|
|
31475
|
-
rename as
|
|
31476
|
-
rm as
|
|
31477
|
-
writeFile as
|
|
31981
|
+
readFile as readFile5,
|
|
31982
|
+
rename as rename3,
|
|
31983
|
+
rm as rm3,
|
|
31984
|
+
writeFile as writeFile3
|
|
31478
31985
|
} from "fs/promises";
|
|
31479
31986
|
import { dirname as dirname9, join as join14, resolve as resolvePath2 } from "path";
|
|
31480
31987
|
import { pathToFileURL as pathToFileURL2 } from "url";
|
|
@@ -31482,13 +31989,13 @@ import { pathToFileURL as pathToFileURL2 } from "url";
|
|
|
31482
31989
|
// src/mobile/artifactStore.ts
|
|
31483
31990
|
import { createHash as createHash5 } from "crypto";
|
|
31484
31991
|
import {
|
|
31485
|
-
mkdir as
|
|
31992
|
+
mkdir as mkdir6,
|
|
31486
31993
|
mkdtemp,
|
|
31487
|
-
readFile as
|
|
31994
|
+
readFile as readFile4,
|
|
31488
31995
|
readdir as readdir3,
|
|
31489
|
-
rename,
|
|
31490
|
-
rm,
|
|
31491
|
-
writeFile
|
|
31996
|
+
rename as rename2,
|
|
31997
|
+
rm as rm2,
|
|
31998
|
+
writeFile as writeFile2
|
|
31492
31999
|
} from "fs/promises";
|
|
31493
32000
|
import { join as join13, resolve as resolvePath } from "path";
|
|
31494
32001
|
var DEFAULT_MAX_PRODUCER_BYTES = 134217728;
|
|
@@ -31514,7 +32021,7 @@ var requireReleaseId = (releaseId) => {
|
|
|
31514
32021
|
return releaseId;
|
|
31515
32022
|
};
|
|
31516
32023
|
var readStoredArtifact = async (releaseDirectory) => {
|
|
31517
|
-
const serialized = await
|
|
32024
|
+
const serialized = await readFile4(join13(releaseDirectory, ARTIFACT_FILE), "utf8");
|
|
31518
32025
|
const parsed = JSON.parse(serialized);
|
|
31519
32026
|
return parseAbsoluteMobileCompatibilityArtifact(parsed);
|
|
31520
32027
|
};
|
|
@@ -31626,7 +32133,7 @@ var createAbsoluteMobileFileArtifactStore = (options) => {
|
|
|
31626
32133
|
};
|
|
31627
32134
|
return {
|
|
31628
32135
|
delete: async (appId, releaseId) => {
|
|
31629
|
-
await
|
|
32136
|
+
await rm2(releaseDirectory(appId, releaseId), {
|
|
31630
32137
|
force: true,
|
|
31631
32138
|
recursive: true
|
|
31632
32139
|
});
|
|
@@ -31664,21 +32171,21 @@ var createAbsoluteMobileFileArtifactStore = (options) => {
|
|
|
31664
32171
|
const validatedArtifact = parseAbsoluteMobileCompatibilityArtifact(release.artifact);
|
|
31665
32172
|
const validated = await verifyAbsoluteMobileCompatibilityProducer({ artifact: validatedArtifact, producer: release.producer }, maxProducerBytes);
|
|
31666
32173
|
const parent = appDirectory(validated.artifact.appId);
|
|
31667
|
-
await
|
|
32174
|
+
await mkdir6(parent, { recursive: true });
|
|
31668
32175
|
const staging = await mkdtemp(join13(parent, ".stage-"));
|
|
31669
32176
|
const producerPath = join13(staging, validated.artifact.producer.module);
|
|
31670
32177
|
try {
|
|
31671
|
-
await
|
|
32178
|
+
await mkdir6(resolvePath(producerPath, ".."), {
|
|
31672
32179
|
recursive: true
|
|
31673
32180
|
});
|
|
31674
32181
|
await Promise.all([
|
|
31675
|
-
|
|
32182
|
+
writeFile2(join13(staging, ARTIFACT_FILE), `${JSON.stringify(validated.artifact, null, "\t")}
|
|
31676
32183
|
`),
|
|
31677
|
-
|
|
32184
|
+
writeFile2(producerPath, new Uint8Array(await validated.producer.arrayBuffer()))
|
|
31678
32185
|
]);
|
|
31679
|
-
await
|
|
32186
|
+
await rename2(staging, releaseDirectory(validated.artifact.appId, validated.artifact.releaseId));
|
|
31680
32187
|
} catch (error) {
|
|
31681
|
-
await
|
|
32188
|
+
await rm2(staging, { force: true, recursive: true });
|
|
31682
32189
|
if (await acceptExistingRelease(error, validated.artifact))
|
|
31683
32190
|
return;
|
|
31684
32191
|
throw error;
|
|
@@ -31738,17 +32245,17 @@ var parseBundleIndex = (value) => {
|
|
|
31738
32245
|
var writeRelease = async (root, release) => {
|
|
31739
32246
|
const directory = join14(root, release.artifact.releaseId);
|
|
31740
32247
|
const producerPath = join14(directory, release.artifact.producer.module);
|
|
31741
|
-
await
|
|
32248
|
+
await mkdir7(dirname9(producerPath), { recursive: true });
|
|
31742
32249
|
await Promise.all([
|
|
31743
|
-
|
|
32250
|
+
writeFile3(join14(directory, ARTIFACT_FILE2), `${JSON.stringify(release.artifact, null, "\t")}
|
|
31744
32251
|
`),
|
|
31745
|
-
|
|
32252
|
+
writeFile3(producerPath, new Uint8Array(await release.producer.arrayBuffer()))
|
|
31746
32253
|
]);
|
|
31747
32254
|
};
|
|
31748
32255
|
var installImmutableBundle = async (bundlesRoot, bundleId, releases) => {
|
|
31749
32256
|
const destination = join14(bundlesRoot, bundleId);
|
|
31750
32257
|
try {
|
|
31751
|
-
await
|
|
32258
|
+
await access2(destination);
|
|
31752
32259
|
return destination;
|
|
31753
32260
|
} catch (error) {
|
|
31754
32261
|
if (!errorHasCode2(error, "ENOENT"))
|
|
@@ -31757,9 +32264,9 @@ var installImmutableBundle = async (bundlesRoot, bundleId, releases) => {
|
|
|
31757
32264
|
const staging = await mkdtemp2(join14(bundlesRoot, ".stage-"));
|
|
31758
32265
|
try {
|
|
31759
32266
|
await Promise.all(releases.map((release) => writeRelease(staging, release)));
|
|
31760
|
-
await
|
|
32267
|
+
await rename3(staging, destination);
|
|
31761
32268
|
} catch (error) {
|
|
31762
|
-
await
|
|
32269
|
+
await rm3(staging, { force: true, recursive: true });
|
|
31763
32270
|
if (errorHasCode2(error, "EEXIST") || errorHasCode2(error, "ENOTEMPTY")) {
|
|
31764
32271
|
return destination;
|
|
31765
32272
|
}
|
|
@@ -31788,7 +32295,7 @@ var resolveProducerHandler = (loaded, exportName) => {
|
|
|
31788
32295
|
};
|
|
31789
32296
|
var loadAbsoluteMobileMaterializedBundle = async (root) => {
|
|
31790
32297
|
const resolvedRoot = resolvePath2(root);
|
|
31791
|
-
const serialized = await
|
|
32298
|
+
const serialized = await readFile5(join14(resolvedRoot, CURRENT_BUNDLE_FILE), "utf8");
|
|
31792
32299
|
const parsed = JSON.parse(serialized);
|
|
31793
32300
|
const index = parseBundleIndex(parsed);
|
|
31794
32301
|
const bundleRoot = join14(resolvedRoot, BUNDLES_DIRECTORY, index.bundleId);
|
|
@@ -31824,7 +32331,7 @@ var materializeAbsoluteMobileCompatibilityBundle = async (input) => {
|
|
|
31824
32331
|
});
|
|
31825
32332
|
const root = resolvePath2(input.root);
|
|
31826
32333
|
const bundlesRoot = join14(root, BUNDLES_DIRECTORY);
|
|
31827
|
-
await
|
|
32334
|
+
await mkdir7(bundlesRoot, { recursive: true });
|
|
31828
32335
|
const bundleId = bundleIdFor(input.currentReleaseId, artifacts);
|
|
31829
32336
|
await installImmutableBundle(bundlesRoot, bundleId, orderedReleases);
|
|
31830
32337
|
const index = {
|
|
@@ -31835,15 +32342,36 @@ var materializeAbsoluteMobileCompatibilityBundle = async (input) => {
|
|
|
31835
32342
|
};
|
|
31836
32343
|
const pointerPath = join14(root, CURRENT_BUNDLE_FILE);
|
|
31837
32344
|
const temporaryPointerPath = join14(root, `.current-${crypto.randomUUID()}.json`);
|
|
31838
|
-
await
|
|
32345
|
+
await writeFile3(temporaryPointerPath, `${JSON.stringify(index, null, "\t")}
|
|
31839
32346
|
`, { flag: "wx" });
|
|
31840
|
-
await
|
|
32347
|
+
await rename3(temporaryPointerPath, pointerPath);
|
|
31841
32348
|
return index;
|
|
31842
32349
|
};
|
|
32350
|
+
var readAbsoluteMobileMaterializedReleases = async (root) => {
|
|
32351
|
+
const resolvedRoot = resolvePath2(root);
|
|
32352
|
+
try {
|
|
32353
|
+
const serialized = await readFile5(join14(resolvedRoot, CURRENT_BUNDLE_FILE), "utf8");
|
|
32354
|
+
const parsed = JSON.parse(serialized);
|
|
32355
|
+
const index = parseBundleIndex(parsed);
|
|
32356
|
+
const bundleRoot = join14(resolvedRoot, BUNDLES_DIRECTORY, index.bundleId);
|
|
32357
|
+
return Promise.all(index.releases.map(async (artifact) => {
|
|
32358
|
+
const producer = Bun.file(join14(bundleRoot, artifact.releaseId, artifact.producer.module));
|
|
32359
|
+
await verifyAbsoluteMobileCompatibilityProducer({
|
|
32360
|
+
artifact,
|
|
32361
|
+
producer
|
|
32362
|
+
});
|
|
32363
|
+
return { artifact, producer };
|
|
32364
|
+
}));
|
|
32365
|
+
} catch (error) {
|
|
32366
|
+
if (errorHasCode2(error, "ENOENT"))
|
|
32367
|
+
return [];
|
|
32368
|
+
throw error;
|
|
32369
|
+
}
|
|
32370
|
+
};
|
|
31843
32371
|
|
|
31844
32372
|
// src/core/loadIslandRegistry.ts
|
|
31845
32373
|
init_islandEntries();
|
|
31846
|
-
import { resolve as
|
|
32374
|
+
import { resolve as resolve13 } from "path";
|
|
31847
32375
|
var isRecord8 = (value) => typeof value === "object" && value !== null;
|
|
31848
32376
|
var resolveRegistryExport2 = (mod) => {
|
|
31849
32377
|
if (isRecord8(mod.islandRegistry))
|
|
@@ -31855,7 +32383,7 @@ var resolveRegistryExport2 = (mod) => {
|
|
|
31855
32383
|
var isRegistryModuleExport = (value) => isRecord8(value);
|
|
31856
32384
|
var isIslandRegistryInput = (value) => isRecord8(value);
|
|
31857
32385
|
var loadIslandRegistry = async (registryPath) => {
|
|
31858
|
-
const resolvedRegistryPath =
|
|
32386
|
+
const resolvedRegistryPath = resolve13(registryPath);
|
|
31859
32387
|
const buildInfo = await loadIslandRegistryBuildInfo(resolvedRegistryPath);
|
|
31860
32388
|
if (buildInfo.definitions.length > 0) {
|
|
31861
32389
|
return buildInfo.registry;
|
|
@@ -31881,15 +32409,15 @@ var MS_PER_SECOND2 = 1000;
|
|
|
31881
32409
|
var DEFAULT_PORT2 = 3000;
|
|
31882
32410
|
var MAX_STATIC_ROUTE_COUNT = Number.MAX_SAFE_INTEGER;
|
|
31883
32411
|
var STATIC_PLUGIN_RETRY_DELAY_MS = 50;
|
|
31884
|
-
var waitForStaticPluginRetry = () => new Promise((
|
|
31885
|
-
setTimeout(
|
|
32412
|
+
var waitForStaticPluginRetry = () => new Promise((resolve48) => {
|
|
32413
|
+
setTimeout(resolve48, STATIC_PLUGIN_RETRY_DELAY_MS);
|
|
31886
32414
|
});
|
|
31887
32415
|
var retryStaticPlugin = async (createStaticPlugin, options) => {
|
|
31888
32416
|
try {
|
|
31889
32417
|
return await createStaticPlugin(options);
|
|
31890
32418
|
} catch (error) {
|
|
31891
32419
|
logWarn(`Static asset routes were skipped this cycle \u2014 a build file was unavailable mid-rebuild: ${error instanceof Error ? error.message : String(error)}`);
|
|
31892
|
-
return new
|
|
32420
|
+
return new Elysia9({ name: "absolutejs-static-fallback" });
|
|
31893
32421
|
}
|
|
31894
32422
|
};
|
|
31895
32423
|
var mountStaticPlugin = async (createStaticPlugin, options) => {
|
|
@@ -32070,12 +32598,13 @@ var prepareDev = async (config, buildDir) => {
|
|
|
32070
32598
|
const { imageOptimizer: imageOptimizer2 } = await Promise.resolve().then(() => (init_imageOptimizer(), exports_imageOptimizer));
|
|
32071
32599
|
const { requestInspector: requestInspector2 } = await Promise.resolve().then(() => (init_requestInspector(), exports_requestInspector));
|
|
32072
32600
|
const { serverTiming } = await import("@elysia/server-timing");
|
|
32073
|
-
const
|
|
32601
|
+
const mobileAssociationPlugin = createAbsoluteMobileAssociationPlugin(config.mobile, process.cwd());
|
|
32602
|
+
const absolutejs = new Elysia9({ name: "absolutejs-runtime" }).use(requestInspector2).use(absoluteRequestContext).use(serverTiming()).use(devtoolsJson2(buildDir, {
|
|
32074
32603
|
normalizeForWindowsContainer: config.dev?.devtools?.normalizeForWindowsContainer,
|
|
32075
32604
|
projectRoot: config.dev?.devtools?.projectRoot,
|
|
32076
32605
|
uuid: config.dev?.devtools?.uuid,
|
|
32077
32606
|
uuidCachePath: config.dev?.devtools?.uuidCachePath
|
|
32078
|
-
})).use(imageOptimizer2(config.images, buildDir)).use(await mountStaticPlugin(staticPlugin, {
|
|
32607
|
+
})).use(imageOptimizer2(config.images, buildDir)).use(mobileAssociationPlugin).use(await mountStaticPlugin(staticPlugin, {
|
|
32079
32608
|
alwaysStatic: true,
|
|
32080
32609
|
assets: buildDir,
|
|
32081
32610
|
directive: "no-cache",
|
|
@@ -32114,18 +32643,18 @@ var loadPrerenderMap = (prerenderDir) => {
|
|
|
32114
32643
|
var loadMobileCompatibilityPlugin = async (buildDir) => {
|
|
32115
32644
|
const root = join50(buildDir, ".absolutejs", "mobile-compatibility");
|
|
32116
32645
|
if (!existsSync39(join50(root, "current.json"))) {
|
|
32117
|
-
return new
|
|
32646
|
+
return new Elysia9({ name: "absolutejs-mobile-compatibility-empty" });
|
|
32118
32647
|
}
|
|
32119
32648
|
const options = await loadAbsoluteMobileMaterializedBundle(root);
|
|
32120
32649
|
return createAbsoluteMobileCompatibilityDispatcher(options);
|
|
32121
32650
|
};
|
|
32122
|
-
var createNotFoundPlugin = () => new
|
|
32651
|
+
var createNotFoundPlugin = () => new Elysia9({ name: "absolutejs-not-found" }).error("global", NotFound, async () => {
|
|
32123
32652
|
const response = await renderFirstNotFound();
|
|
32124
32653
|
if (response)
|
|
32125
32654
|
return response;
|
|
32126
32655
|
return;
|
|
32127
32656
|
});
|
|
32128
|
-
var createBuildErrorRecoveryPlugin = () => new
|
|
32657
|
+
var createBuildErrorRecoveryPlugin = () => new Elysia9({ name: "absolutejs-build-error-recovery" }).error("global", async ({ error }) => {
|
|
32129
32658
|
const message = error instanceof Error ? error.message : String(error);
|
|
32130
32659
|
const assetMatch = /^Asset "(.+)" not found in manifest\.$/.exec(message);
|
|
32131
32660
|
if (!assetMatch)
|
|
@@ -32155,10 +32684,10 @@ var prepare = async (configOrPath) => {
|
|
|
32155
32684
|
const config = await loadConfig(configOrPath);
|
|
32156
32685
|
recordStep("load config", stepStartedAt);
|
|
32157
32686
|
const nodeEnv = process.env["NODE_ENV"];
|
|
32158
|
-
const
|
|
32687
|
+
const isDev2 = nodeEnv === "development";
|
|
32159
32688
|
const buildDir = resolvePath4(process.env.ABSOLUTE_BUILD_DIR ?? config.buildDirectory ?? "build");
|
|
32160
32689
|
registerIconVersioning(buildDir);
|
|
32161
|
-
if (
|
|
32690
|
+
if (isDev2) {
|
|
32162
32691
|
stepStartedAt = performance.now();
|
|
32163
32692
|
const result = await prepareDev(config, buildDir);
|
|
32164
32693
|
recordStep("prepare dev runtime", stepStartedAt);
|
|
@@ -32193,7 +32722,7 @@ var prepare = async (configOrPath) => {
|
|
|
32193
32722
|
staticLimit: MAX_STATIC_ROUTE_COUNT
|
|
32194
32723
|
});
|
|
32195
32724
|
const generatedAssetsRoot = join50(buildDir, ".absolutejs");
|
|
32196
|
-
const generatedAssetsPlugin = new
|
|
32725
|
+
const generatedAssetsPlugin = new Elysia9({
|
|
32197
32726
|
name: "absolutejs-generated-assets"
|
|
32198
32727
|
}).get("/.absolutejs/*", async ({ params, set }) => {
|
|
32199
32728
|
const requestedPath = resolvePath4(generatedAssetsRoot, params["*"]);
|
|
@@ -32217,7 +32746,7 @@ var prepare = async (configOrPath) => {
|
|
|
32217
32746
|
const hash = base.match(/[.-]([0-9a-z]{6,12})\.[0-9a-z]+$/i)?.[1];
|
|
32218
32747
|
return hash ? /[0-9]/.test(hash) && /[a-z]/i.test(hash) : false;
|
|
32219
32748
|
};
|
|
32220
|
-
const assetCachePlugin = new
|
|
32749
|
+
const assetCachePlugin = new Elysia9({
|
|
32221
32750
|
name: "absolutejs-asset-cache"
|
|
32222
32751
|
}).afterHandle("global", ({ request, responseValue }) => {
|
|
32223
32752
|
if (!(responseValue instanceof Response))
|
|
@@ -32233,13 +32762,14 @@ var prepare = async (configOrPath) => {
|
|
|
32233
32762
|
const prerenderDir = join50(buildDir, "_prerendered");
|
|
32234
32763
|
const prerenderMap = loadPrerenderMap(prerenderDir);
|
|
32235
32764
|
const mobileCompatibilityPlugin = await loadMobileCompatibilityPlugin(buildDir);
|
|
32765
|
+
const mobileAssociationPlugin = createAbsoluteMobileAssociationPlugin(config.mobile, process.cwd(), { requireAll: true });
|
|
32236
32766
|
recordStep("load prerender map", stepStartedAt);
|
|
32237
32767
|
if (prerenderMap.size > 0) {
|
|
32238
32768
|
const { PRERENDER_BYPASS_HEADER: PRERENDER_BYPASS_HEADER2, readTimestamp: readTimestamp2, rerenderRoute: rerenderRoute2 } = await Promise.resolve().then(() => (init_prerender(), exports_prerender));
|
|
32239
32769
|
const revalidateMs = config.static?.revalidate ? config.static.revalidate * MS_PER_SECOND2 : 0;
|
|
32240
32770
|
const port = Number(process.env.PORT) || DEFAULT_PORT2;
|
|
32241
32771
|
const rerendering = new Set;
|
|
32242
|
-
const prerenderPlugin = new
|
|
32772
|
+
const prerenderPlugin = new Elysia9({
|
|
32243
32773
|
name: "prerendered-pages"
|
|
32244
32774
|
}).request(({ request }) => {
|
|
32245
32775
|
const url = new URL(request.url);
|
|
@@ -32262,7 +32792,7 @@ var prepare = async (configOrPath) => {
|
|
|
32262
32792
|
});
|
|
32263
32793
|
stepStartedAt = performance.now();
|
|
32264
32794
|
const { imageOptimizer: imageOptimizer3 } = await Promise.resolve().then(() => (init_imageOptimizer(), exports_imageOptimizer));
|
|
32265
|
-
const absolutejs2 = new
|
|
32795
|
+
const absolutejs2 = new Elysia9({ name: "absolutejs-runtime" }).use(absoluteRequestContext).use(mobileAssociationPlugin).use(mobileCompatibilityPlugin).use(assetCachePlugin).use(imageOptimizer3(config.images, buildDir)).use(prerenderPlugin).use(staticFiles).use(generatedAssetsPlugin).use(createNotFoundPlugin());
|
|
32266
32796
|
await withOpenApi(absolutejs2, config, process.cwd(), false);
|
|
32267
32797
|
await withTelemetry(absolutejs2, config, process.cwd());
|
|
32268
32798
|
recordStep("assemble production runtime", stepStartedAt);
|
|
@@ -32271,7 +32801,7 @@ var prepare = async (configOrPath) => {
|
|
|
32271
32801
|
}
|
|
32272
32802
|
stepStartedAt = performance.now();
|
|
32273
32803
|
const { imageOptimizer: imageOptimizer2 } = await Promise.resolve().then(() => (init_imageOptimizer(), exports_imageOptimizer));
|
|
32274
|
-
const absolutejs = new
|
|
32804
|
+
const absolutejs = new Elysia9({ name: "absolutejs-runtime" }).use(absoluteRequestContext).use(mobileAssociationPlugin).use(mobileCompatibilityPlugin).use(assetCachePlugin).use(imageOptimizer2(config.images, buildDir)).use(staticFiles).use(generatedAssetsPlugin).use(createNotFoundPlugin());
|
|
32275
32805
|
await withOpenApi(absolutejs, config, process.cwd(), false);
|
|
32276
32806
|
await withTelemetry(absolutejs, config, process.cwd());
|
|
32277
32807
|
recordStep("assemble production runtime", stepStartedAt);
|
|
@@ -32776,7 +33306,7 @@ var generateHeadElement = ({
|
|
|
32776
33306
|
// src/utils/defineEnv.ts
|
|
32777
33307
|
var {env: bunEnv } = globalThis.Bun;
|
|
32778
33308
|
import { existsSync as existsSync42, readFileSync as readFileSync37 } from "fs";
|
|
32779
|
-
import { resolve as
|
|
33309
|
+
import { resolve as resolve49 } from "path";
|
|
32780
33310
|
|
|
32781
33311
|
// node_modules/@sinclair/typebox/build/esm/type/guard/value.mjs
|
|
32782
33312
|
var exports_value = {};
|
|
@@ -37249,8 +37779,8 @@ function ScoreUnion(schema, references, value) {
|
|
|
37249
37779
|
return entries.reduce((acc, [key, schema2]) => {
|
|
37250
37780
|
const literal = schema2[Kind] === "Literal" && schema2.const === value[key] ? 100 : 0;
|
|
37251
37781
|
const checks = Check(schema2, references, value[key]) ? 10 : 0;
|
|
37252
|
-
const
|
|
37253
|
-
return acc + (literal + checks +
|
|
37782
|
+
const exists3 = keys.includes(key) ? 1 : 0;
|
|
37783
|
+
return acc + (literal + checks + exists3);
|
|
37254
37784
|
}, 0);
|
|
37255
37785
|
} else if (schema[Kind] === "Union") {
|
|
37256
37786
|
const schemas = schema.anyOf.map((schema2) => Deref(schema2, references));
|
|
@@ -38811,7 +39341,7 @@ ${lines.join(`
|
|
|
38811
39341
|
};
|
|
38812
39342
|
var checkEnvFileSecurity = (properties) => {
|
|
38813
39343
|
const cwd2 = process.cwd();
|
|
38814
|
-
const envPath =
|
|
39344
|
+
const envPath = resolve49(cwd2, ".env");
|
|
38815
39345
|
if (!existsSync42(envPath))
|
|
38816
39346
|
return;
|
|
38817
39347
|
const sensitiveKeys = Object.keys(properties).filter(isSensitive);
|
|
@@ -38821,7 +39351,7 @@ var checkEnvFileSecurity = (properties) => {
|
|
|
38821
39351
|
const presentKeys = sensitiveKeys.filter((key) => envContent.includes(`${key}=`));
|
|
38822
39352
|
if (presentKeys.length === 0)
|
|
38823
39353
|
return;
|
|
38824
|
-
const gitignorePath =
|
|
39354
|
+
const gitignorePath = resolve49(cwd2, ".gitignore");
|
|
38825
39355
|
if (existsSync42(gitignorePath)) {
|
|
38826
39356
|
const gitignore = readFileSync37(gitignorePath, "utf-8");
|
|
38827
39357
|
if (gitignore.split(`
|
|
@@ -38856,7 +39386,7 @@ var getEnv = (key) => {
|
|
|
38856
39386
|
};
|
|
38857
39387
|
// src/utils/projectRoot.ts
|
|
38858
39388
|
import { existsSync as existsSync43 } from "fs";
|
|
38859
|
-
import { dirname as dirname32, resolve as
|
|
39389
|
+
import { dirname as dirname32, resolve as resolve50 } from "path";
|
|
38860
39390
|
var CONFIG_CANDIDATES = [
|
|
38861
39391
|
"absolute.config.ts",
|
|
38862
39392
|
"absolute.config.js",
|
|
@@ -38865,7 +39395,7 @@ var CONFIG_CANDIDATES = [
|
|
|
38865
39395
|
"absolute.config.mts",
|
|
38866
39396
|
"absolute.config.cts"
|
|
38867
39397
|
];
|
|
38868
|
-
var hasAbsoluteConfig = (directory) => CONFIG_CANDIDATES.some((name) => existsSync43(
|
|
39398
|
+
var hasAbsoluteConfig = (directory) => CONFIG_CANDIDATES.some((name) => existsSync43(resolve50(directory, name)));
|
|
38869
39399
|
var findProjectRoot = () => {
|
|
38870
39400
|
const start = process.cwd();
|
|
38871
39401
|
let packageRoot = null;
|
|
@@ -38874,7 +39404,7 @@ var findProjectRoot = () => {
|
|
|
38874
39404
|
if (hasAbsoluteConfig(directory)) {
|
|
38875
39405
|
return directory;
|
|
38876
39406
|
}
|
|
38877
|
-
if (packageRoot === null && existsSync43(
|
|
39407
|
+
if (packageRoot === null && existsSync43(resolve50(directory, "package.json"))) {
|
|
38878
39408
|
packageRoot = directory;
|
|
38879
39409
|
}
|
|
38880
39410
|
const parent = dirname32(directory);
|
|
@@ -39123,5 +39653,5 @@ export {
|
|
|
39123
39653
|
ANGULAR_INIT_TIMEOUT_MS
|
|
39124
39654
|
};
|
|
39125
39655
|
|
|
39126
|
-
//# debugId=
|
|
39656
|
+
//# debugId=990F9153E353E13D64756E2164756E21
|
|
39127
39657
|
//# sourceMappingURL=index.js.map
|