@absolutejs/absolute 0.20.0-beta.177 → 0.20.0-beta.178
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +26 -0
- package/changelog.json +51 -0
- package/dist/angular/browser.js +17 -2
- package/dist/angular/browser.js.map +4 -4
- package/dist/angular/components/core/streamingSlotRegistrar.js +1 -1
- package/dist/angular/components/core/streamingSlotRegistry.js +2 -2
- package/dist/angular/index.js +57 -33
- package/dist/angular/index.js.map +9 -8
- package/dist/angular/server.js +57 -33
- package/dist/angular/server.js.map +9 -8
- package/dist/build.js +532 -416
- package/dist/build.js.map +15 -15
- package/dist/cli/{compile-w2z6c9vt.js → compile-p5yv6ecp.js} +2 -2
- package/dist/cli/config/server.js +45 -12
- package/dist/cli/{dev-8br5mr7t.js → dev-2hbcsvkp.js} +1 -1
- package/dist/cli/{index-420h9hq7.js → index-1ewba8ye.js} +32 -3
- package/dist/cli/{index-7z1hh3fg.js → index-9dzdbbfc.js} +1 -1
- package/dist/cli/index.js +7 -7
- package/dist/cli/{islands-bx67g15t.js → islands-6zgb7501.js} +1 -1
- package/dist/cli/{mobile-we5q51ey.js → mobile-c92dh8s2.js} +2 -2
- package/dist/cli/{start-srs11bm8.js → start-asxb79rc.js} +2 -2
- package/dist/cli/{typecheck-7fvww3b7.js → typecheck-m2j4tkdk.js} +165 -35
- package/dist/client/chunks/{index-8m2qq61n.js → index-58svs66p.js} +13 -3
- package/dist/client/chunks/{index-8m2qq61n.js.map → index-58svs66p.js.map} +5 -4
- package/dist/client/chunks/{islands-mfjmdwnb.js → islands-tcadmgcx.js} +3 -6
- package/dist/client/chunks/{islands-mfjmdwnb.js.map → islands-tcadmgcx.js.map} +3 -4
- package/dist/client/chunks/{react-sprprqzs.js → react-khr6ewhr.js} +2 -2
- package/dist/client/index.js +82 -6
- package/dist/client/index.js.map +7 -6
- package/dist/dev/client/handlers/islands.ts +2 -0
- package/dist/dev/client/handlers/react.ts +92 -111
- package/dist/dev/client/handlers/reactUpdateQueue.ts +153 -0
- package/dist/index.js +505 -389
- package/dist/index.js.map +15 -15
- package/dist/islands/browser.js +2 -2
- package/dist/islands/browser.js.map +3 -3
- package/dist/islands/index.js +13 -6
- package/dist/islands/index.js.map +6 -5
- package/dist/react/browser.js +113 -12
- package/dist/react/browser.js.map +10 -7
- package/dist/react/components/index.js +31 -7
- package/dist/react/components/index.js.map +5 -4
- package/dist/react/components/server/index.js +22 -6
- package/dist/react/index.js +190 -46
- package/dist/react/index.js.map +15 -11
- package/dist/react/server.js +82 -23
- package/dist/react/server.js.map +11 -9
- package/dist/src/build/compileSvelte.d.ts +12 -1
- package/dist/src/build/compileVue.d.ts +1 -0
- package/dist/src/build/islandEntries.d.ts +3 -1
- package/dist/src/cli/scripts/typecheck.d.ts +8 -0
- package/dist/src/cli/scripts/typecheckDiagnostics.d.ts +17 -0
- package/dist/src/client/preserveIslandMarkup.d.ts +4 -0
- package/dist/src/core/islandManifest.d.ts +6 -0
- package/dist/src/core/islandStylesheet.d.ts +17 -0
- package/dist/src/react/Island.d.ts +9 -2
- package/dist/src/react/IslandStyleLink.d.ts +11 -0
- package/dist/src/react/createIsland.d.ts +1 -1
- package/dist/src/react/serverComponents/nodeRendererRef.d.ts +13 -0
- package/dist/src/utils/requestRenderUrl.d.ts +1 -0
- package/dist/src/utils/resolveConvention.d.ts +1 -0
- package/dist/src/vue/Island.browser.d.ts +3 -1
- package/dist/src/vue/Island.d.ts +2 -2
- package/dist/src/vue/createIsland.browser.d.ts +2 -2
- package/dist/src/vue/createIsland.d.ts +2 -2
- package/dist/src/vue/islandStyleLink.d.ts +30 -0
- package/dist/svelte/browser.js +2 -2
- package/dist/svelte/browser.js.map +3 -3
- package/dist/svelte/index.js +51 -49
- package/dist/svelte/index.js.map +9 -8
- package/dist/svelte/server.js +48 -45
- package/dist/svelte/server.js.map +8 -7
- package/dist/types/globals.d.ts +3 -0
- package/dist/vue/browser.js +105 -10
- package/dist/vue/browser.js.map +10 -7
- package/dist/vue/index.js +170 -47
- package/dist/vue/index.js.map +14 -11
- package/dist/vue/server.js +81 -22
- package/dist/vue/server.js.map +9 -7
- package/package.json +1 -1
- /package/dist/cli/{index-6522t968.js → index-yd672jyq.js} +0 -0
- /package/dist/client/chunks/{react-sprprqzs.js.map → react-khr6ewhr.js.map} +0 -0
package/dist/index.js
CHANGED
|
@@ -6289,6 +6289,12 @@ var CONVENTIONS_KEY = "__absoluteConventions", isConventionsMap = (value) => Boo
|
|
|
6289
6289
|
logConventionRenderError(framework, "error", renderError);
|
|
6290
6290
|
}
|
|
6291
6291
|
return null;
|
|
6292
|
+
}, isPageRequest = (request) => {
|
|
6293
|
+
if (request.headers.get("hx-request") === "true")
|
|
6294
|
+
return true;
|
|
6295
|
+
if (request.headers.get("sec-fetch-dest") === "document")
|
|
6296
|
+
return true;
|
|
6297
|
+
return (request.headers.get("accept") ?? "").includes("text/html");
|
|
6292
6298
|
}, renderConventionError = async (framework, pageName, error) => {
|
|
6293
6299
|
const errorProps = buildErrorProps(error);
|
|
6294
6300
|
const frameworkResponse = await tryFrameworkErrorConvention(framework, pageName, errorProps, error);
|
|
@@ -6300,12 +6306,6 @@ var CONVENTIONS_KEY = "__absoluteConventions", isConventionsMap = (value) => Boo
|
|
|
6300
6306
|
return htmlResponse;
|
|
6301
6307
|
}
|
|
6302
6308
|
return null;
|
|
6303
|
-
}, isPageRequest = (request) => {
|
|
6304
|
-
if (request.headers.get("hx-request") === "true")
|
|
6305
|
-
return true;
|
|
6306
|
-
if (request.headers.get("sec-fetch-dest") === "document")
|
|
6307
|
-
return true;
|
|
6308
|
-
return (request.headers.get("accept") ?? "").includes("text/html");
|
|
6309
6309
|
}, renderStaticRouteError = async (request, error) => {
|
|
6310
6310
|
if (!isPageRequest(request))
|
|
6311
6311
|
return null;
|
|
@@ -6654,7 +6654,7 @@ var ISLAND_BOOTSTRAP_MANIFEST_KEY = "AbsoluteIslandBootstrap", LEGACY_ISLAND_BOO
|
|
|
6654
6654
|
islands[framework] = entries;
|
|
6655
6655
|
}
|
|
6656
6656
|
return islands;
|
|
6657
|
-
}, getIslandManifestKey = (framework, component) => `Island${toIslandFrameworkSegment(framework)}${component}`;
|
|
6657
|
+
}, getIslandManifestKey = (framework, component) => `Island${toIslandFrameworkSegment(framework)}${component}`, ISLAND_STYLE_PREFIX = "IslandStyle", getIslandStyleManifestEntries = (manifest) => Object.entries(manifest).filter(([key]) => key.startsWith(ISLAND_STYLE_PREFIX)), getIslandStyleManifestKey = (framework, component) => `${ISLAND_STYLE_PREFIX}${toIslandFrameworkSegment(framework)}${component}`;
|
|
6658
6658
|
|
|
6659
6659
|
// src/core/islands.ts
|
|
6660
6660
|
function getIslandComponent(component) {
|
|
@@ -9019,9 +9019,9 @@ var createVueCompiler = async () => {
|
|
|
9019
9019
|
// src/core/vueServerModule.ts
|
|
9020
9020
|
import { readFileSync as readFileSync6, realpathSync } from "fs";
|
|
9021
9021
|
import { mkdir as mkdir4 } from "fs/promises";
|
|
9022
|
-
import { dirname as dirname7, join as join9, relative as relative4, resolve as resolve7 } from "path";
|
|
9022
|
+
import { basename as basename3, dirname as dirname7, join as join9, relative as relative4, resolve as resolve7 } from "path";
|
|
9023
9023
|
var {Transpiler } = globalThis.Bun;
|
|
9024
|
-
var
|
|
9024
|
+
var serverCacheRoot3, compiledModuleCache3, syncIslandGeneration2, transpiler2, ensureRelativeImportPath2 = (from, target) => {
|
|
9025
9025
|
const importPath = relative4(dirname7(from), target).replace(/\\/g, "/");
|
|
9026
9026
|
return importPath.startsWith(".") ? importPath : `./${importPath}`;
|
|
9027
9027
|
}, getCachedModulePath3 = (sourcePath) => {
|
|
@@ -9063,7 +9063,7 @@ var ISLAND_COMPONENT_ID_LENGTH = 8, serverCacheRoot3, compiledModuleCache3, sync
|
|
|
9063
9063
|
const compiler = await loadVueCompiler();
|
|
9064
9064
|
const source = await Bun.file(sourcePath).text();
|
|
9065
9065
|
const { descriptor } = compiler.parse(source, { filename: sourcePath });
|
|
9066
|
-
const componentId =
|
|
9066
|
+
const componentId = toKebab(basename3(sourcePath, ".vue"));
|
|
9067
9067
|
const hasScript = descriptor.script || descriptor.scriptSetup;
|
|
9068
9068
|
const compiledScript = hasScript ? compiler.compileScript(descriptor, {
|
|
9069
9069
|
fs: {
|
|
@@ -9113,7 +9113,6 @@ var ISLAND_COMPONENT_ID_LENGTH = 8, serverCacheRoot3, compiledModuleCache3, sync
|
|
|
9113
9113
|
return compiledModulePath;
|
|
9114
9114
|
};
|
|
9115
9115
|
var init_vueServerModule = __esm(() => {
|
|
9116
|
-
init_constants();
|
|
9117
9116
|
init_isFile();
|
|
9118
9117
|
serverCacheRoot3 = join9(process.cwd(), ".absolutejs", "islands", "vue");
|
|
9119
9118
|
compiledModuleCache3 = new Map;
|
|
@@ -9560,10 +9559,12 @@ export default component;
|
|
|
9560
9559
|
sources[definition.framework] = frameworkSources;
|
|
9561
9560
|
}
|
|
9562
9561
|
return sources;
|
|
9563
|
-
},
|
|
9562
|
+
}, createCssImports = (entryPath, cssPaths) => cssPaths.map((cssPath) => `import ${JSON.stringify(normalizeImportPath(entryPath, cssPath))};
|
|
9563
|
+
`).join(""), generateIslandEntryPoints = async ({
|
|
9564
9564
|
buildInfo,
|
|
9565
9565
|
buildPath,
|
|
9566
|
-
clientPathMaps = {}
|
|
9566
|
+
clientPathMaps = {},
|
|
9567
|
+
cssPathMaps = {}
|
|
9567
9568
|
}) => {
|
|
9568
9569
|
const generatedRoot = join10(buildPath, "_island_entries");
|
|
9569
9570
|
rmSync(generatedRoot, { force: true, recursive: true });
|
|
@@ -9574,8 +9575,9 @@ export default component;
|
|
|
9574
9575
|
const source = buildReference ? resolveIslandSourcePath(buildInfo.resolvedRegistryPath, buildReference.source) : null;
|
|
9575
9576
|
const compiledSourcePath = source && shouldUseCompiledClientPath(definition.framework, source) ? clientPathMaps[definition.framework]?.get(source) : undefined;
|
|
9576
9577
|
const entrySource = source && (compiledSourcePath || !shouldUseCompiledClientPath(definition.framework, source)) ? createDirectEntrySource(entryPath, compiledSourcePath ?? source, compiledSourcePath ? undefined : buildReference?.export) : createRegistryEntrySource(entryPath, buildInfo.resolvedRegistryPath, buildInfo.hasNamedExport, definition.framework, definition.component);
|
|
9578
|
+
const cssPaths = source ? cssPathMaps[definition.framework]?.get(source) ?? [] : [];
|
|
9577
9579
|
mkdirSync(dirname8(entryPath), { recursive: true });
|
|
9578
|
-
writeFileSync2(entryPath, entrySource);
|
|
9580
|
+
writeFileSync2(entryPath, `${createCssImports(entryPath, cssPaths)}${entrySource}`);
|
|
9579
9581
|
entries.push({
|
|
9580
9582
|
component: definition.component,
|
|
9581
9583
|
entryPath,
|
|
@@ -10269,12 +10271,27 @@ var ISLAND_MARKER = 'data-island="true"', MANIFEST_MARKER = "__ABSOLUTE_MANIFEST
|
|
|
10269
10271
|
browserManifest[key] = value;
|
|
10270
10272
|
}
|
|
10271
10273
|
return browserManifest;
|
|
10272
|
-
},
|
|
10274
|
+
}, ISLAND_MARKER_TAG, ISLAND_FRAMEWORKS, readMarkerAttribute = (tag, name) => new RegExp(`\\b${name}="([^"]*)"`).exec(tag)?.[1]?.replaceAll(""", '"').replaceAll("<", "<").replaceAll(">", ">").replaceAll("&", "&"), toIslandFramework = (value) => ISLAND_FRAMEWORKS.find((framework) => framework === value), collectRenderedIslandStyleKeys = (html) => {
|
|
10275
|
+
const keys = new Set;
|
|
10276
|
+
for (const [tag] of html.matchAll(ISLAND_MARKER_TAG)) {
|
|
10277
|
+
const framework = toIslandFramework(readMarkerAttribute(tag, "data-framework"));
|
|
10278
|
+
const component = readMarkerAttribute(tag, "data-component");
|
|
10279
|
+
if (framework && component)
|
|
10280
|
+
keys.add(getIslandStyleManifestKey(framework, component));
|
|
10281
|
+
}
|
|
10282
|
+
return keys;
|
|
10283
|
+
}, buildIslandStyleLinks = (manifest, html) => {
|
|
10284
|
+
if (html === undefined)
|
|
10285
|
+
return "";
|
|
10286
|
+
const renderedKeys = collectRenderedIslandStyleKeys(html);
|
|
10287
|
+
return getIslandStyleManifestEntries(manifest).filter(([key]) => renderedKeys.has(key)).filter(([, href]) => !html.includes(`href="${href}"`)).map(([key, href]) => `<link rel="stylesheet" href="${href}" data-island-style="${key}"${nonceAttr()}>`).join("");
|
|
10288
|
+
}, buildIslandsHeadMarkup = (manifest, html) => {
|
|
10289
|
+
const styleLinks = buildIslandStyleLinks(manifest, html);
|
|
10273
10290
|
const manifestScript = `<script${nonceAttr()}>window.__ABSOLUTE_MANIFEST__ = ${escapeScriptContent(JSON.stringify(toBrowserManifest(manifest)))}</script>`;
|
|
10274
10291
|
const islandStateScript = `<script${nonceAttr()}>window.__ABS_ISLAND_STATE__ = ${escapeScriptContent(JSON.stringify(globalThis.__ABS_ISLAND_STATE__ ?? {}))}</script>`;
|
|
10275
10292
|
const bootstrapPath = getIslandBootstrapPath(manifest);
|
|
10276
10293
|
const bootstrapScript = bootstrapPath ? `<script${nonceAttr()} type="module" src="${bootstrapPath}"></script>` : "";
|
|
10277
|
-
return `${manifestScript}${islandStateScript}${bootstrapScript}`;
|
|
10294
|
+
return `${styleLinks}${manifestScript}${islandStateScript}${bootstrapScript}`;
|
|
10278
10295
|
}, injectHeadMarkup = (html, markup) => {
|
|
10279
10296
|
const closingHeadIndex = html.indexOf("</head>");
|
|
10280
10297
|
if (closingHeadIndex >= 0) {
|
|
@@ -10456,7 +10473,7 @@ var ISLAND_MARKER = 'data-island="true"', MANIFEST_MARKER = "__ABSOLUTE_MANIFEST
|
|
|
10456
10473
|
return html;
|
|
10457
10474
|
}
|
|
10458
10475
|
warnIfBootstrapMissing(manifest);
|
|
10459
|
-
return injectHeadMarkup(html, buildIslandsHeadMarkup(manifest));
|
|
10476
|
+
return injectHeadMarkup(html, buildIslandsHeadMarkup(manifest, html));
|
|
10460
10477
|
}, injectIslandPageContextStream = (stream, options) => {
|
|
10461
10478
|
const manifest = globalThis.__absoluteManifest;
|
|
10462
10479
|
if (!manifest)
|
|
@@ -10480,6 +10497,13 @@ var init_islandPageContext = __esm(() => {
|
|
|
10480
10497
|
init_logger();
|
|
10481
10498
|
MANIFEST_BUILD_DIR_KEY = Symbol.for("absolutejs.islandManifestBuildDir");
|
|
10482
10499
|
WINDOWS_ABSOLUTE_PATH = /^[A-Za-z]:[\\/]|^\\\\/;
|
|
10500
|
+
ISLAND_MARKER_TAG = /<[^>]*\bdata-island="true"[^>]*>/g;
|
|
10501
|
+
ISLAND_FRAMEWORKS = [
|
|
10502
|
+
"react",
|
|
10503
|
+
"svelte",
|
|
10504
|
+
"vue",
|
|
10505
|
+
"angular"
|
|
10506
|
+
];
|
|
10483
10507
|
});
|
|
10484
10508
|
|
|
10485
10509
|
// src/dev/hotResources.ts
|
|
@@ -11201,7 +11225,7 @@ var init_pageMetadata = __esm(() => {
|
|
|
11201
11225
|
});
|
|
11202
11226
|
|
|
11203
11227
|
// src/utils/spaRouteManifest.ts
|
|
11204
|
-
import { basename as
|
|
11228
|
+
import { basename as basename4 } from "path";
|
|
11205
11229
|
var SPA_ROUTES_KEY = "__absoluteSpaRoutes", setSpaRouteManifest = (hosts) => {
|
|
11206
11230
|
Reflect.set(globalThis, SPA_ROUTES_KEY, hosts);
|
|
11207
11231
|
}, isRuntimeSpaHost = (value) => typeof value === "object" && value !== null && typeof Reflect.get(value, "framework") === "string", getSpaRouteManifest = () => {
|
|
@@ -11237,7 +11261,7 @@ var SPA_ROUTES_KEY = "__absoluteSpaRoutes", setSpaRouteManifest = (hosts) => {
|
|
|
11237
11261
|
expression += `/${segment.replace(/[.+?^${}()|[\]\\]/g, "\\$&")}`;
|
|
11238
11262
|
}
|
|
11239
11263
|
return new RegExp(`${expression || "^/"}/?$`);
|
|
11240
|
-
}, sourcePageName = (sourceFile) =>
|
|
11264
|
+
}, sourcePageName = (sourceFile) => basename4(sourceFile).replace(/\.[^.]+$/, "").toLowerCase(), isKnownSpaRoute = (framework, pageName, request) => {
|
|
11241
11265
|
if (!request)
|
|
11242
11266
|
return true;
|
|
11243
11267
|
let pathname;
|
|
@@ -15119,6 +15143,11 @@ var getManifestKey = (folder, pascalName, isClientComponent, isReact, isVue, isS
|
|
|
15119
15143
|
if (ext === ".css") {
|
|
15120
15144
|
if (segments.includes("server"))
|
|
15121
15145
|
return manifest;
|
|
15146
|
+
const islandStyleFramework = islandIndex > UNFOUND_INDEX ? segments[islandIndex + 1] : undefined;
|
|
15147
|
+
if (islandStyleFramework === "react" || islandStyleFramework === "svelte" || islandStyleFramework === "vue" || islandStyleFramework === "angular") {
|
|
15148
|
+
manifest[getIslandStyleManifestKey(islandStyleFramework, pascalName)] = `/${relative}`;
|
|
15149
|
+
return manifest;
|
|
15150
|
+
}
|
|
15122
15151
|
const cssKey = getCssKey(pascalName, segments);
|
|
15123
15152
|
if (manifest[cssKey] && manifest[cssKey] !== `/${relative}`)
|
|
15124
15153
|
logWarn(`Duplicate manifest key "${cssKey}" \u2014 "${manifest[cssKey]}" will be overwritten by "/${relative}". Use unique page names across frameworks.`);
|
|
@@ -15238,7 +15267,7 @@ var init_verifyAngularCoreUniqueness = __esm(() => {
|
|
|
15238
15267
|
// src/build/generateReactIndexes.ts
|
|
15239
15268
|
import { existsSync as existsSync18, mkdirSync as mkdirSync4 } from "fs";
|
|
15240
15269
|
import { readdir as readdir4, rm as rm5, writeFile as writeFile5 } from "fs/promises";
|
|
15241
|
-
import { basename as
|
|
15270
|
+
import { basename as basename5, join as join24, relative as relative10, resolve as resolve21, sep as sep4 } from "path";
|
|
15242
15271
|
var {Glob: Glob2 } = globalThis.Bun;
|
|
15243
15272
|
var indexContentCache, resolveDevClientDir = () => {
|
|
15244
15273
|
const projectRoot = process.cwd();
|
|
@@ -15268,7 +15297,7 @@ var indexContentCache, resolveDevClientDir = () => {
|
|
|
15268
15297
|
files.push(file);
|
|
15269
15298
|
}
|
|
15270
15299
|
const currentPageNames = new Set([
|
|
15271
|
-
...files.map((file) =>
|
|
15300
|
+
...files.map((file) => basename5(file).split(".")[0]),
|
|
15272
15301
|
...extraPages.map((page) => page.name)
|
|
15273
15302
|
]);
|
|
15274
15303
|
const emptyStringArray = [];
|
|
@@ -15288,7 +15317,7 @@ var indexContentCache, resolveDevClientDir = () => {
|
|
|
15288
15317
|
const pagesRelPath = relative10(resolve21(reactIndexesDirectory), resolve21(reactPagesDirectory)).split(sep4).join("/");
|
|
15289
15318
|
const pages = [
|
|
15290
15319
|
...files.map((file) => {
|
|
15291
|
-
const componentName =
|
|
15320
|
+
const componentName = basename5(file).split(".")[0] ?? "";
|
|
15292
15321
|
return {
|
|
15293
15322
|
componentName,
|
|
15294
15323
|
importPath: `${pagesRelPath}/${componentName}`,
|
|
@@ -15667,7 +15696,7 @@ var init_validateSafePath = () => {};
|
|
|
15667
15696
|
// src/build/buildReactServerComponents.ts
|
|
15668
15697
|
import { createHash as createHash6 } from "crypto";
|
|
15669
15698
|
import { existsSync as existsSync19, mkdirSync as mkdirSync5, readFileSync as readFileSync22, writeFileSync as writeFileSync7 } from "fs";
|
|
15670
|
-
import { basename as
|
|
15699
|
+
import { basename as basename6, dirname as dirname12, extname as extname9, join as join25, relative as relative12, resolve as resolve23 } from "path";
|
|
15671
15700
|
var {
|
|
15672
15701
|
build: bunBuild,
|
|
15673
15702
|
Glob: Glob3,
|
|
@@ -15798,6 +15827,22 @@ export const renderHtml = (flight, options) => {
|
|
|
15798
15827
|
|
|
15799
15828
|
return renderToReadableStream(createElement(Root), options);
|
|
15800
15829
|
};
|
|
15830
|
+
|
|
15831
|
+
// A fragment (a SuspenseSlot's resolved content) rendered to an HTML string.
|
|
15832
|
+
export const renderStaticHtml = async (flight) => {
|
|
15833
|
+
const root = createFromReadableStream(flight, {
|
|
15834
|
+
serverConsumerManifest: {
|
|
15835
|
+
moduleLoading: null,
|
|
15836
|
+
moduleMap,
|
|
15837
|
+
serverModuleMap: null
|
|
15838
|
+
}
|
|
15839
|
+
});
|
|
15840
|
+
const Root = () => use(root);
|
|
15841
|
+
const stream = await renderToReadableStream(createElement(Root));
|
|
15842
|
+
await stream.allReady;
|
|
15843
|
+
|
|
15844
|
+
return new Response(stream).text();
|
|
15845
|
+
};
|
|
15801
15846
|
`;
|
|
15802
15847
|
}, clientRuntimeSource = (modules) => {
|
|
15803
15848
|
const loaders = modules.map((module) => ` ${JSON.stringify(module.id)}: () => import(${JSON.stringify(module.path)})`);
|
|
@@ -15823,7 +15868,7 @@ globalThis.__webpack_chunk_load__ = (id) => {
|
|
|
15823
15868
|
}, clientEntrySource = () => `import './ReactServerClientRuntime';
|
|
15824
15869
|
import { createFromReadableStream } from 'react-server-dom-webpack/client.browser';
|
|
15825
15870
|
import { hydrateRoot } from 'react-dom/client';
|
|
15826
|
-
import { createElement, use } from 'react';
|
|
15871
|
+
import { createElement, use, useEffect } from 'react';
|
|
15827
15872
|
|
|
15828
15873
|
const encoder = new TextEncoder();
|
|
15829
15874
|
const stream = new ReadableStream({
|
|
@@ -15845,9 +15890,23 @@ const stream = new ReadableStream({
|
|
|
15845
15890
|
}
|
|
15846
15891
|
});
|
|
15847
15892
|
const root = createFromReadableStream(stream);
|
|
15848
|
-
|
|
15893
|
+
// The page's inline bootstrap holds streamed slot content back
|
|
15894
|
+
// (__ABS_SLOT_HYDRATION_PENDING__) so hydration compares against the HTML the
|
|
15895
|
+
// server rendered: a slot whose fallback is a React node would otherwise
|
|
15896
|
+
// mismatch, and React's client re-render would drop every patched slot.
|
|
15897
|
+
const releaseStreamingSlots = () => {
|
|
15898
|
+
self.__ABS_SLOT_HYDRATION_PENDING__ = false;
|
|
15899
|
+
if (typeof self.__ABS_SLOT_FLUSH__ === 'function') self.__ABS_SLOT_FLUSH__();
|
|
15900
|
+
};
|
|
15901
|
+
const Root = () => {
|
|
15902
|
+
useEffect(() => {
|
|
15903
|
+
setTimeout(releaseStreamingSlots, 0);
|
|
15904
|
+
}, []);
|
|
15905
|
+
|
|
15906
|
+
return use(root);
|
|
15907
|
+
};
|
|
15849
15908
|
hydrateRoot(document, createElement(Root));
|
|
15850
|
-
`, findOutput = (outputs, name) => outputs.find((artifact) => artifact.kind === "entry-point" &&
|
|
15909
|
+
`, findOutput = (outputs, name) => outputs.find((artifact) => artifact.kind === "entry-point" && basename6(artifact.path).startsWith(`${name}.`)), toWebPath2 = (buildPath, path) => `/${relative12(buildPath, path).replace(/\\/g, "/")}`, assertFlightPackage = (projectRoot) => {
|
|
15851
15910
|
try {
|
|
15852
15911
|
Bun.resolveSync("react-server-dom-webpack/package.json", projectRoot);
|
|
15853
15912
|
} catch {
|
|
@@ -15862,7 +15921,7 @@ hydrateRoot(document, createElement(Root));
|
|
|
15862
15921
|
mkdirSync5(dirname12(path), { recursive: true });
|
|
15863
15922
|
writeFileSync7(path, contents);
|
|
15864
15923
|
return path;
|
|
15865
|
-
}, pageEntryName = (pagePath) => toPascal(
|
|
15924
|
+
}, pageEntryName = (pagePath) => toPascal(basename6(pagePath, extname9(pagePath))), endsWithPageSuffix = (name) => name.length > REACT_SERVER_PAGE_MANIFEST_SUFFIX.length && name.endsWith(REACT_SERVER_PAGE_MANIFEST_SUFFIX), pageManifestKeys = (name, names) => {
|
|
15866
15925
|
const doubled = `${name}${REACT_SERVER_PAGE_MANIFEST_SUFFIX}`;
|
|
15867
15926
|
if (!endsWithPageSuffix(name))
|
|
15868
15927
|
return { keys: [doubled] };
|
|
@@ -16132,11 +16191,11 @@ var STAMP_SETTLE_MS = 2000, createStampedFileCache = () => {
|
|
|
16132
16191
|
var init_stampedFileCache = () => {};
|
|
16133
16192
|
|
|
16134
16193
|
// src/build/scanConventions.ts
|
|
16135
|
-
import { basename as
|
|
16194
|
+
import { basename as basename7 } from "path";
|
|
16136
16195
|
var {Glob: Glob4 } = globalThis.Bun;
|
|
16137
16196
|
import { existsSync as existsSync20 } from "fs";
|
|
16138
|
-
var CONVENTION_RE, isConventionFile = (fileName) => CONVENTION_RE.test(
|
|
16139
|
-
const fileName =
|
|
16197
|
+
var CONVENTION_RE, isConventionFile = (fileName) => CONVENTION_RE.test(basename7(fileName)), classifyFile = (file, pageFiles, defaults, pages) => {
|
|
16198
|
+
const fileName = basename7(file);
|
|
16140
16199
|
const match = CONVENTION_RE.exec(fileName);
|
|
16141
16200
|
if (!match) {
|
|
16142
16201
|
pageFiles.push(file);
|
|
@@ -16297,18 +16356,18 @@ var init_htmlIncludes = () => {};
|
|
|
16297
16356
|
|
|
16298
16357
|
// src/build/spaSideManifests.ts
|
|
16299
16358
|
import { writeFile as writeFile6 } from "fs/promises";
|
|
16300
|
-
import { basename as
|
|
16359
|
+
import { basename as basename8, dirname as dirname14, relative as relative14, resolve as resolve25 } from "path";
|
|
16301
16360
|
var writeSpaSideManifests = async (spaRoutesBySource, resolveServerJsPath) => {
|
|
16302
16361
|
const manifestEntries = {};
|
|
16303
16362
|
await Promise.all([...spaRoutesBySource.entries()].map(async ([source, routes]) => {
|
|
16304
|
-
const parentName =
|
|
16363
|
+
const parentName = basename8(source, ".vue");
|
|
16305
16364
|
const parentJsPath = resolveServerJsPath(parentName);
|
|
16306
16365
|
if (!parentJsPath)
|
|
16307
16366
|
return;
|
|
16308
16367
|
const sourceDir = dirname14(source);
|
|
16309
16368
|
const entries = routes.flatMap(({ path, importPath }) => {
|
|
16310
16369
|
const childSourcePath = resolve25(sourceDir, importPath);
|
|
16311
|
-
const childName =
|
|
16370
|
+
const childName = basename8(childSourcePath, ".vue");
|
|
16312
16371
|
const childJsPath = resolveServerJsPath(childName);
|
|
16313
16372
|
if (!childJsPath)
|
|
16314
16373
|
return [];
|
|
@@ -16534,7 +16593,7 @@ var init_serverExternals = __esm(() => {
|
|
|
16534
16593
|
|
|
16535
16594
|
// src/build/islandBootstrap.ts
|
|
16536
16595
|
import { mkdirSync as mkdirSync6, writeFileSync as writeFileSync8 } from "fs";
|
|
16537
|
-
import { basename as
|
|
16596
|
+
import { basename as basename9, dirname as dirname16, extname as extname11, join as join27, relative as relative15 } from "path";
|
|
16538
16597
|
var DEFAULT_ISLAND_BOOTSTRAP_NAME = "absoluteIslandBootstrap", DEFAULT_ISLAND_BOOTSTRAP_SOURCE = `import {
|
|
16539
16598
|
createIslandManifestResolver,
|
|
16540
16599
|
startIslands
|
|
@@ -16550,7 +16609,7 @@ startIslands({
|
|
|
16550
16609
|
writeFileSync8(entryPath, DEFAULT_ISLAND_BOOTSTRAP_SOURCE);
|
|
16551
16610
|
return entryPath;
|
|
16552
16611
|
}, artifactStem = (artifact) => {
|
|
16553
|
-
const fileName =
|
|
16612
|
+
const fileName = basename9(artifact.path);
|
|
16554
16613
|
const stem = fileName.slice(0, fileName.length - extname11(fileName).length);
|
|
16555
16614
|
const hashSuffix = artifact.hash ? `.${artifact.hash}` : "";
|
|
16556
16615
|
return hashSuffix && stem.endsWith(hashSuffix) ? stem.slice(0, stem.length - hashSuffix.length) : stem;
|
|
@@ -16561,7 +16620,7 @@ startIslands({
|
|
|
16561
16620
|
passRoot
|
|
16562
16621
|
}) => {
|
|
16563
16622
|
const expectedDir = passRoot === undefined ? undefined : normalizePath2(join27(buildPath, relative15(passRoot, dirname16(bootstrapPath))));
|
|
16564
|
-
const expectedStem =
|
|
16623
|
+
const expectedStem = basename9(bootstrapPath, extname11(bootstrapPath));
|
|
16565
16624
|
const artifact = outputs.find((output) => output.kind === "entry-point" && extname11(output.path) === ".js" && (expectedDir === undefined || normalizePath2(dirname16(output.path)) === expectedDir) && artifactStem(output) === expectedStem);
|
|
16566
16625
|
if (!artifact)
|
|
16567
16626
|
return;
|
|
@@ -18424,7 +18483,7 @@ var init_rewriteReactImports = __esm(() => {
|
|
|
18424
18483
|
});
|
|
18425
18484
|
|
|
18426
18485
|
// src/build/rewriteClientOutputs.ts
|
|
18427
|
-
import { basename as
|
|
18486
|
+
import { basename as basename10 } from "path";
|
|
18428
18487
|
var reduceVendorPaths = (vendorPaths, reactPaths) => Object.fromEntries(Object.entries(vendorPaths).filter(([specifier, webPath]) => reactPaths[specifier] !== webPath)), hasEntries = (paths) => Object.keys(paths).length > 0, compileClientRewriteFamilies = (options) => {
|
|
18429
18488
|
const reactPaths = options.reactPaths ?? {};
|
|
18430
18489
|
const react = hasEntries(reactPaths) ? compileSpecifierRewriter(reactPaths) : undefined;
|
|
@@ -18492,7 +18551,7 @@ var reduceVendorPaths = (vendorPaths, reactPaths) => Object.fromEntries(Object.e
|
|
|
18492
18551
|
if (!content.includes("URL("))
|
|
18493
18552
|
return content;
|
|
18494
18553
|
return content.replace(URL_REFERENCE_PATTERN, (match, relPath) => {
|
|
18495
|
-
const resolvedPath = urlFileMap.get(
|
|
18554
|
+
const resolvedPath = urlFileMap.get(basename10(relPath));
|
|
18496
18555
|
if (!resolvedPath)
|
|
18497
18556
|
return match;
|
|
18498
18557
|
return `new URL('${resolvedPath}', import.meta.url)`;
|
|
@@ -18785,7 +18844,7 @@ var init_fileRoutes = __esm(() => {
|
|
|
18785
18844
|
|
|
18786
18845
|
// src/dev/lazyPages.ts
|
|
18787
18846
|
import { existsSync as existsSync32 } from "fs";
|
|
18788
|
-
import { basename as
|
|
18847
|
+
import { basename as basename11, extname as extname13, isAbsolute as isAbsolute6, join as join37, resolve as resolve29 } from "path";
|
|
18789
18848
|
var PAGE_EXTENSIONS2, KEY_SUFFIXES, SRC_URL_PREFIX = "/@src/", isTruthyFlag2 = (value) => value === "1" || value === "true", looksLikePath = (value) => value.includes("/") || value.includes("\\") || value.startsWith("."), probeDirForName = ({ dir, framework }, name) => {
|
|
18790
18849
|
const extension = PAGE_EXTENSIONS2[framework].find((ext) => existsSync32(join37(dir, `${name}${ext}`)));
|
|
18791
18850
|
return extension === undefined ? undefined : toDevPageEntry(framework, join37(dir, `${name}${extension}`));
|
|
@@ -18860,7 +18919,7 @@ var PAGE_EXTENSIONS2, KEY_SUFFIXES, SRC_URL_PREFIX = "/@src/", isTruthyFlag2 = (
|
|
|
18860
18919
|
const resolved = resolve29(source);
|
|
18861
18920
|
const entry = {
|
|
18862
18921
|
framework,
|
|
18863
|
-
name: fileRouteFor(resolved)?.name ?? toPascal(
|
|
18922
|
+
name: fileRouteFor(resolved)?.name ?? toPascal(basename11(resolved, extname13(resolved))),
|
|
18864
18923
|
source: resolved
|
|
18865
18924
|
};
|
|
18866
18925
|
return entry;
|
|
@@ -19056,7 +19115,7 @@ var init_bunStringRawUnicodePlugin = __esm(() => {
|
|
|
19056
19115
|
|
|
19057
19116
|
// src/build/externalAssetPlugin.ts
|
|
19058
19117
|
import { copyFileSync, existsSync as existsSync34, mkdirSync as mkdirSync10, statSync as statSync4 } from "fs";
|
|
19059
|
-
import { basename as
|
|
19118
|
+
import { basename as basename12, dirname as dirname21, join as join39, resolve as resolve31 } from "path";
|
|
19060
19119
|
var createExternalAssetPlugin = (outDir, userSourceRoots = []) => ({
|
|
19061
19120
|
name: "absolute-external-asset",
|
|
19062
19121
|
setup(bld) {
|
|
@@ -19081,7 +19140,7 @@ var createExternalAssetPlugin = (outDir, userSourceRoots = []) => ({
|
|
|
19081
19140
|
continue;
|
|
19082
19141
|
if (!statSync4(assetPath).isFile())
|
|
19083
19142
|
continue;
|
|
19084
|
-
const targetPath = join39(outDir,
|
|
19143
|
+
const targetPath = join39(outDir, basename12(assetPath));
|
|
19085
19144
|
if (existsSync34(targetPath))
|
|
19086
19145
|
continue;
|
|
19087
19146
|
mkdirSync10(dirname21(targetPath), { recursive: true });
|
|
@@ -19094,7 +19153,7 @@ var createExternalAssetPlugin = (outDir, userSourceRoots = []) => ({
|
|
|
19094
19153
|
var init_externalAssetPlugin = () => {};
|
|
19095
19154
|
|
|
19096
19155
|
// src/build/islandRegistryTransform.ts
|
|
19097
|
-
import { basename as
|
|
19156
|
+
import { basename as basename13 } from "path";
|
|
19098
19157
|
var VALID_FRAMEWORKS, getObjectPropertyName2 = (name) => lazyTypescript.isIdentifier(name) || lazyTypescript.isStringLiteral(name) ? name.text : null, isIslandRegistryHelperImport2 = (source) => source === "@absolutejs/absolute/islands" || source.endsWith("/islands") || source.endsWith("/core/islands"), collectRegistryFactory = (sourceFile) => {
|
|
19099
19158
|
const factoryNames = new Set;
|
|
19100
19159
|
const namespaceNames = new Set;
|
|
@@ -19257,7 +19316,7 @@ var VALID_FRAMEWORKS, getObjectPropertyName2 = (name) => lazyTypescript.isIdenti
|
|
|
19257
19316
|
}
|
|
19258
19317
|
return "ts";
|
|
19259
19318
|
}, createIslandRegistryDefinitionPlugin = (info) => {
|
|
19260
|
-
const registryBase =
|
|
19319
|
+
const registryBase = basename13(info.resolvedRegistryPath).replace(/\.[mc]?[jt]sx?$/, "");
|
|
19261
19320
|
const filter = new RegExp(`(^|[/\\\\])${escapeRegExp3(registryBase)}\\.[mc]?[jt]sx?$`);
|
|
19262
19321
|
return {
|
|
19263
19322
|
name: "absolute-island-registry-definitions",
|
|
@@ -19344,7 +19403,7 @@ var init_vueModuleOutputPath = __esm(() => {
|
|
|
19344
19403
|
|
|
19345
19404
|
// src/build/injectVueComposableTracking.ts
|
|
19346
19405
|
import { existsSync as existsSync35, readFileSync as readFileSync30, writeFileSync as writeFileSync12 } from "fs";
|
|
19347
|
-
import { basename as
|
|
19406
|
+
import { basename as basename14, isAbsolute as isAbsolute8, relative as relative19, resolve as resolve33 } from "path";
|
|
19348
19407
|
var VUE_HMR_RUNTIME, USE_DECLARATION, MODULE_COMMENT, LINE_TERMINATOR, STATEMENT_OPENER, SOURCE_EXTENSIONS2, CHUNK_REFERENCE, isSharedChunkFile = (fileName) => fileName.startsWith("chunk-") && fileName.endsWith(".js"), collectModuleComments = (content) => Array.from(content.matchAll(MODULE_COMMENT), (match) => ({
|
|
19349
19408
|
index: match.index,
|
|
19350
19409
|
path: match[1] ?? ""
|
|
@@ -19385,7 +19444,7 @@ var VUE_HMR_RUNTIME, USE_DECLARATION, MODULE_COMMENT, LINE_TERMINATOR, STATEMENT
|
|
|
19385
19444
|
return text;
|
|
19386
19445
|
return `${text.slice(0, declaration.exprStart)}__hmr_wrap(${JSON.stringify(moduleId)}, ${JSON.stringify(declaration.name)}, ${expression})${text.slice(end)}`;
|
|
19387
19446
|
}, collectVueHmrOutputPaths = (vueOutputPaths, chunkOutputPaths) => {
|
|
19388
|
-
const chunkByName = new Map(chunkOutputPaths.filter(isSharedChunkPath).map((path) => [
|
|
19447
|
+
const chunkByName = new Map(chunkOutputPaths.filter(isSharedChunkPath).map((path) => [basename14(path), path]));
|
|
19389
19448
|
const selected = new Set(vueOutputPaths);
|
|
19390
19449
|
if (chunkByName.size === 0)
|
|
19391
19450
|
return [...selected];
|
|
@@ -19445,7 +19504,7 @@ var VUE_HMR_RUNTIME, USE_DECLARATION, MODULE_COMMENT, LINE_TERMINATOR, STATEMENT
|
|
|
19445
19504
|
const insertAt = firstDeclaration?.start ?? 0;
|
|
19446
19505
|
return restore(`${wrapped.slice(0, insertAt)}${VUE_HMR_RUNTIME}
|
|
19447
19506
|
${wrapped.slice(insertAt)}`);
|
|
19448
|
-
}, isSharedChunkPath = (path) => isSharedChunkFile(
|
|
19507
|
+
}, isSharedChunkPath = (path) => isSharedChunkFile(basename14(path)), resolveVueComposableModuleId = (commentPath, options) => {
|
|
19449
19508
|
const absolutePath = resolve33(options.projectRoot, commentPath);
|
|
19450
19509
|
const { vueDir, generatedVueDir } = options;
|
|
19451
19510
|
if (!vueDir || !generatedVueDir)
|
|
@@ -19870,8 +19929,14 @@ var commonAncestor = (paths, fallback) => {
|
|
|
19870
19929
|
var init_commonAncestor = () => {};
|
|
19871
19930
|
|
|
19872
19931
|
// src/utils/buildDirectoryLock.ts
|
|
19873
|
-
import {
|
|
19874
|
-
|
|
19932
|
+
import {
|
|
19933
|
+
mkdirSync as mkdirSync12,
|
|
19934
|
+
readFileSync as readFileSync32,
|
|
19935
|
+
realpathSync as realpathSync3,
|
|
19936
|
+
unlinkSync,
|
|
19937
|
+
writeFileSync as writeFileSync14
|
|
19938
|
+
} from "fs";
|
|
19939
|
+
import { dirname as dirname23, join as join44, resolve as resolve36 } from "path";
|
|
19875
19940
|
var heldLocks, HELD_LOCKS_ENV = "ABSOLUTE_HELD_BUILD_DIRECTORY_LOCKS", exitHandlersRegistered = false, registerExitHandlersOnce = () => {
|
|
19876
19941
|
if (exitHandlersRegistered)
|
|
19877
19942
|
return;
|
|
@@ -19914,6 +19979,13 @@ var heldLocks, HELD_LOCKS_ENV = "ABSOLUTE_HELD_BUILD_DIRECTORY_LOCKS", exitHandl
|
|
|
19914
19979
|
const locks = readHeldLockEnv();
|
|
19915
19980
|
locks.delete(buildDirectory);
|
|
19916
19981
|
writeHeldLockEnv(locks);
|
|
19982
|
+
}, lockProjectRoot = (buildDirectory) => {
|
|
19983
|
+
const projectRoot = dirname23(resolve36(buildDirectory));
|
|
19984
|
+
try {
|
|
19985
|
+
return realpathSync3.native(projectRoot);
|
|
19986
|
+
} catch {
|
|
19987
|
+
return projectRoot;
|
|
19988
|
+
}
|
|
19917
19989
|
}, writeLockFileSync = (lockPath, metadata) => {
|
|
19918
19990
|
mkdirSync12(dirname23(lockPath), { recursive: true });
|
|
19919
19991
|
writeFileSync14(lockPath, JSON.stringify(metadata, null, 2), { flag: "wx" });
|
|
@@ -19922,11 +19994,13 @@ var heldLocks, HELD_LOCKS_ENV = "ABSOLUTE_HELD_BUILD_DIRECTORY_LOCKS", exitHandl
|
|
|
19922
19994
|
const raw = readFileSync32(lockPath, "utf-8");
|
|
19923
19995
|
const parsed = JSON.parse(raw);
|
|
19924
19996
|
if (typeof parsed === "object" && parsed !== null && typeof parsed.pid === "number") {
|
|
19925
|
-
|
|
19997
|
+
const metadata = {
|
|
19926
19998
|
pid: parsed.pid,
|
|
19927
19999
|
port: typeof parsed.port === "number" ? parsed.port : null,
|
|
20000
|
+
projectRoot: typeof parsed.projectRoot === "string" ? parsed.projectRoot : undefined,
|
|
19928
20001
|
startedAt: typeof parsed.startedAt === "string" ? parsed.startedAt : new Date().toISOString()
|
|
19929
20002
|
};
|
|
20003
|
+
return metadata;
|
|
19930
20004
|
}
|
|
19931
20005
|
} catch {}
|
|
19932
20006
|
return null;
|
|
@@ -19947,6 +20021,11 @@ var heldLocks, HELD_LOCKS_ENV = "ABSOLUTE_HELD_BUILD_DIRECTORY_LOCKS", exitHandl
|
|
|
19947
20021
|
unlinkSync(lockPath);
|
|
19948
20022
|
console.warn(`[absolutejs] removed stale lock from PID ${pid}`);
|
|
19949
20023
|
} catch {}
|
|
20024
|
+
}, removeForeignLockSync = (lockPath, existing) => {
|
|
20025
|
+
try {
|
|
20026
|
+
unlinkSync(lockPath);
|
|
20027
|
+
console.warn(`[absolutejs] removed a build lock copied from ${existing.projectRoot} (PID ${existing.pid} holds the original project, not this one)`);
|
|
20028
|
+
} catch {}
|
|
19950
20029
|
}, LOCK_POLL_MS = 250, DEFAULT_WAIT_TIMEOUT_MS = 120000, acquireBuildDirectoryLock = async (buildDirectory, options = {}) => {
|
|
19951
20030
|
registerExitHandlersOnce();
|
|
19952
20031
|
if (readHeldLockEnv().has(buildDirectory)) {
|
|
@@ -19968,9 +20047,11 @@ var heldLocks, HELD_LOCKS_ENV = "ABSOLUTE_HELD_BUILD_DIRECTORY_LOCKS", exitHandl
|
|
|
19968
20047
|
const waitTimeoutMs = options.waitTimeoutMs ?? DEFAULT_WAIT_TIMEOUT_MS;
|
|
19969
20048
|
const start = Date.now();
|
|
19970
20049
|
const tryCreate = () => {
|
|
20050
|
+
mkdirSync12(dirname23(lockPath), { recursive: true });
|
|
19971
20051
|
writeLockFileSync(lockPath, {
|
|
19972
20052
|
pid: process.pid,
|
|
19973
20053
|
port: options.port ?? null,
|
|
20054
|
+
projectRoot: lockProjectRoot(buildDirectory),
|
|
19974
20055
|
startedAt: new Date().toISOString()
|
|
19975
20056
|
});
|
|
19976
20057
|
};
|
|
@@ -19992,6 +20073,10 @@ var heldLocks, HELD_LOCKS_ENV = "ABSOLUTE_HELD_BUILD_DIRECTORY_LOCKS", exitHandl
|
|
|
19992
20073
|
removeStaleLockSync(lockPath, existing.pid);
|
|
19993
20074
|
continue;
|
|
19994
20075
|
}
|
|
20076
|
+
if (existing.projectRoot !== undefined && existing.projectRoot !== lockProjectRoot(buildDirectory)) {
|
|
20077
|
+
removeForeignLockSync(lockPath, existing);
|
|
20078
|
+
continue;
|
|
20079
|
+
}
|
|
19995
20080
|
if (wait && Date.now() - start < waitTimeoutMs) {
|
|
19996
20081
|
await Bun.sleep(LOCK_POLL_MS);
|
|
19997
20082
|
continue;
|
|
@@ -21002,7 +21087,7 @@ var init_typescript_translator = __esm(() => {
|
|
|
21002
21087
|
|
|
21003
21088
|
// src/dev/angular/fastHmrCompiler.ts
|
|
21004
21089
|
import { existsSync as existsSync37, readFileSync as readFileSync33, statSync as statSync5 } from "fs";
|
|
21005
|
-
import { dirname as dirname25, extname as extname15, relative as relative22, resolve as
|
|
21090
|
+
import { dirname as dirname25, extname as extname15, relative as relative22, resolve as resolve37 } from "path";
|
|
21006
21091
|
var fail2 = (reason, detail, location) => ({
|
|
21007
21092
|
detail,
|
|
21008
21093
|
ok: false,
|
|
@@ -21314,7 +21399,7 @@ var fail2 = (reason, detail, location) => ({
|
|
|
21314
21399
|
if (!spec.startsWith(".") && !spec.startsWith("/")) {
|
|
21315
21400
|
return true;
|
|
21316
21401
|
}
|
|
21317
|
-
const base =
|
|
21402
|
+
const base = resolve37(componentDir, spec);
|
|
21318
21403
|
const candidates = [
|
|
21319
21404
|
`${base}.ts`,
|
|
21320
21405
|
`${base}.tsx`,
|
|
@@ -22130,7 +22215,7 @@ var fail2 = (reason, detail, location) => ({
|
|
|
22130
22215
|
return null;
|
|
22131
22216
|
}, resolveDtsFromSpec = (spec, fromDir) => {
|
|
22132
22217
|
const stripped = spec.replace(/\.[mc]?js$/, "");
|
|
22133
|
-
const base =
|
|
22218
|
+
const base = resolve37(fromDir, stripped);
|
|
22134
22219
|
const candidates = [
|
|
22135
22220
|
`${base}.d.ts`,
|
|
22136
22221
|
`${base}.d.mts`,
|
|
@@ -22154,7 +22239,7 @@ var fail2 = (reason, detail, location) => ({
|
|
|
22154
22239
|
return null;
|
|
22155
22240
|
}, resolveChildComponentInfo = (className, spec, componentDir, projectRoot) => {
|
|
22156
22241
|
if (spec.startsWith(".") || spec.startsWith("/")) {
|
|
22157
|
-
const base =
|
|
22242
|
+
const base = resolve37(componentDir, spec);
|
|
22158
22243
|
const candidates = [
|
|
22159
22244
|
`${base}.ts`,
|
|
22160
22245
|
`${base}.tsx`,
|
|
@@ -22373,13 +22458,13 @@ var fail2 = (reason, detail, location) => ({
|
|
|
22373
22458
|
}
|
|
22374
22459
|
if (!matches)
|
|
22375
22460
|
continue;
|
|
22376
|
-
const resolved =
|
|
22461
|
+
const resolved = resolve37(componentDir, spec);
|
|
22377
22462
|
for (const ext of TS_EXTENSIONS) {
|
|
22378
22463
|
const candidate = resolved + ext;
|
|
22379
22464
|
if (existsSync37(candidate))
|
|
22380
22465
|
return candidate;
|
|
22381
22466
|
}
|
|
22382
|
-
const indexCandidate =
|
|
22467
|
+
const indexCandidate = resolve37(resolved, "index.ts");
|
|
22383
22468
|
if (existsSync37(indexCandidate))
|
|
22384
22469
|
return indexCandidate;
|
|
22385
22470
|
}
|
|
@@ -22624,7 +22709,7 @@ ${transpiled}
|
|
|
22624
22709
|
return compileStyleFileIfNeeded(abs);
|
|
22625
22710
|
return compileStyleFileIfNeededSync(abs);
|
|
22626
22711
|
}, resolveAndReadStyleResource = async (componentDir, url) => {
|
|
22627
|
-
const abs =
|
|
22712
|
+
const abs = resolve37(componentDir, url);
|
|
22628
22713
|
if (!existsSync37(abs)) {
|
|
22629
22714
|
const failure = {
|
|
22630
22715
|
detail: `Style file not found: ${url} (looked for ${abs})`,
|
|
@@ -22668,7 +22753,7 @@ ${block}
|
|
|
22668
22753
|
const cached = projectOptionsCache.get(projectRoot);
|
|
22669
22754
|
if (cached !== undefined)
|
|
22670
22755
|
return cached;
|
|
22671
|
-
const tsconfigPath =
|
|
22756
|
+
const tsconfigPath = resolve37(projectRoot, "tsconfig.json");
|
|
22672
22757
|
const opts = {};
|
|
22673
22758
|
if (existsSync37(tsconfigPath)) {
|
|
22674
22759
|
try {
|
|
@@ -22752,7 +22837,7 @@ ${block}
|
|
|
22752
22837
|
templateText = decoratorMeta.template;
|
|
22753
22838
|
templatePath = componentFilePath;
|
|
22754
22839
|
} else if (decoratorMeta.templateUrl) {
|
|
22755
|
-
const tplAbs =
|
|
22840
|
+
const tplAbs = resolve37(componentDir, decoratorMeta.templateUrl);
|
|
22756
22841
|
if (!existsSync37(tplAbs)) {
|
|
22757
22842
|
return fail2("template-resource-not-found", `Template file not found: ${tplAbs}`, { file: componentFilePath });
|
|
22758
22843
|
}
|
|
@@ -23414,7 +23499,7 @@ var init_scanAngularHandlerCalls = __esm(() => {
|
|
|
23414
23499
|
|
|
23415
23500
|
// src/build/scanAngularPageRoutes.ts
|
|
23416
23501
|
import { readdirSync as readdirSync5, readFileSync as readFileSync36 } from "fs";
|
|
23417
|
-
import { basename as
|
|
23502
|
+
import { basename as basename15, join as join49 } from "path";
|
|
23418
23503
|
var SOURCE_EXTENSIONS5, SKIP_DIRS4, hasSourceExtension4 = (filePath) => {
|
|
23419
23504
|
const idx = filePath.lastIndexOf(".");
|
|
23420
23505
|
if (idx === -1)
|
|
@@ -23423,7 +23508,7 @@ var SOURCE_EXTENSIONS5, SKIP_DIRS4, hasSourceExtension4 = (filePath) => {
|
|
|
23423
23508
|
}, isPageFile = (filePath) => {
|
|
23424
23509
|
if (!hasSourceExtension4(filePath))
|
|
23425
23510
|
return false;
|
|
23426
|
-
const base =
|
|
23511
|
+
const base = basename15(filePath);
|
|
23427
23512
|
if (base.endsWith(".d.ts"))
|
|
23428
23513
|
return false;
|
|
23429
23514
|
if (base.endsWith(".test.ts"))
|
|
@@ -23489,7 +23574,7 @@ var SOURCE_EXTENSIONS5, SKIP_DIRS4, hasSourceExtension4 = (filePath) => {
|
|
|
23489
23574
|
continue;
|
|
23490
23575
|
}
|
|
23491
23576
|
const hasRoutes = hasTopLevelRoutesExport(source, file);
|
|
23492
|
-
const base =
|
|
23577
|
+
const base = basename15(file).replace(/\.[cm]?[tj]sx?$/, "");
|
|
23493
23578
|
const manifestKey = toPascal(base);
|
|
23494
23579
|
out.push({
|
|
23495
23580
|
hasRoutes,
|
|
@@ -23736,9 +23821,9 @@ import {
|
|
|
23736
23821
|
dirname as dirname27,
|
|
23737
23822
|
isAbsolute as isAbsolute10,
|
|
23738
23823
|
join as join51,
|
|
23739
|
-
basename as
|
|
23824
|
+
basename as basename16,
|
|
23740
23825
|
extname as extname16,
|
|
23741
|
-
resolve as
|
|
23826
|
+
resolve as resolve38,
|
|
23742
23827
|
relative as relative23,
|
|
23743
23828
|
sep as sep8
|
|
23744
23829
|
} from "path";
|
|
@@ -23752,19 +23837,19 @@ var withResolvedSources = (map, sourceFile) => {
|
|
|
23752
23837
|
return map;
|
|
23753
23838
|
return {
|
|
23754
23839
|
...map,
|
|
23755
|
-
sources: sources.map((source) => typeof source === "string" && !isAbsolute10(source) ?
|
|
23840
|
+
sources: sources.map((source) => typeof source === "string" && !isAbsolute10(source) ? resolve38(dirname27(sourceFile), source) : source)
|
|
23756
23841
|
};
|
|
23757
23842
|
}, resolveDevClientDir2 = () => {
|
|
23758
23843
|
const projectRoot = process.cwd();
|
|
23759
|
-
const fromSource =
|
|
23844
|
+
const fromSource = resolve38(import.meta.dir, "../dev/client");
|
|
23760
23845
|
if (existsSync39(fromSource) && fromSource.startsWith(projectRoot)) {
|
|
23761
23846
|
return fromSource;
|
|
23762
23847
|
}
|
|
23763
|
-
const fromNodeModules =
|
|
23848
|
+
const fromNodeModules = resolve38(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client");
|
|
23764
23849
|
if (existsSync39(fromNodeModules))
|
|
23765
23850
|
return fromNodeModules;
|
|
23766
|
-
return
|
|
23767
|
-
}, devClientDir2, hmrClientPath3,
|
|
23851
|
+
return resolve38(import.meta.dir, "./dev/client");
|
|
23852
|
+
}, devClientDir2, hmrClientPath3, persistentCaches, sourceHashCaches, transpiler3, DYNAMIC_IMPORT_PATTERN, LAZY_MODULE_REGISTRY_NAME = "absolutejs.svelte.lazy-modules", LAZY_RESOLVED_NAME = "absolutejs.svelte.lazy-resolved", LAZY_PRELOAD_MAX_DEPTH = 5, toSourceId = (path) => relative23(process.cwd(), path).replace(/\\/g, "/"), removeUnusedRequireHelper = (code) => {
|
|
23768
23853
|
const helperStart = code.indexOf("var __require = /* @__PURE__ */");
|
|
23769
23854
|
if (helperStart === -1) {
|
|
23770
23855
|
return code;
|
|
@@ -23790,7 +23875,7 @@ var withResolvedSources = (map, sourceFile) => {
|
|
|
23790
23875
|
}, resolveRelativeModule2 = async (spec, from) => {
|
|
23791
23876
|
if (!spec.startsWith("."))
|
|
23792
23877
|
return null;
|
|
23793
|
-
const basePath =
|
|
23878
|
+
const basePath = resolve38(dirname27(from), spec);
|
|
23794
23879
|
const candidates = [
|
|
23795
23880
|
basePath,
|
|
23796
23881
|
`${basePath}.ts`,
|
|
@@ -23817,7 +23902,7 @@ var withResolvedSources = (map, sourceFile) => {
|
|
|
23817
23902
|
const resolved = resolvePackageImport(spec);
|
|
23818
23903
|
return resolved && /\.svelte(\.(?:ts|js))?$/.test(resolved) ? resolved : null;
|
|
23819
23904
|
}
|
|
23820
|
-
const basePath =
|
|
23905
|
+
const basePath = resolve38(dirname27(from), spec);
|
|
23821
23906
|
const explicit = /\.(svelte|svelte\.(?:ts|js))$/.test(basePath);
|
|
23822
23907
|
if (!explicit) {
|
|
23823
23908
|
const extensions = [".svelte", ".svelte.ts", ".svelte.js"];
|
|
@@ -23844,9 +23929,13 @@ var withResolvedSources = (map, sourceFile) => {
|
|
|
23844
23929
|
client: toClient.startsWith(".") || toClient.startsWith("/") ? toClient : `./${toClient}`,
|
|
23845
23930
|
server: toServer.startsWith(".") ? toServer : `./${toServer}`
|
|
23846
23931
|
});
|
|
23847
|
-
}, compileSvelte = async (entryPoints, svelteRoot, cache = new Map, isDev = false, stylePreprocessors) => {
|
|
23932
|
+
}, compileSvelte = async (entryPoints, svelteRoot, cache = new Map, isDev = false, stylePreprocessors, options = {}) => {
|
|
23848
23933
|
const { compile, compileModule, preprocess } = await import("svelte/compiler");
|
|
23849
|
-
const
|
|
23934
|
+
const externalCss = options.externalCss === true;
|
|
23935
|
+
const cssMode = externalCss ? "external" : "injected";
|
|
23936
|
+
const persistentCache = persistentCaches[cssMode];
|
|
23937
|
+
const sourceHashCache = sourceHashCaches[cssMode];
|
|
23938
|
+
const generatedDir = externalCss ? join51(getFrameworkGeneratedDir("svelte"), "islands") : getFrameworkGeneratedDir("svelte");
|
|
23850
23939
|
const clientDir = join51(generatedDir, "client");
|
|
23851
23940
|
const indexDir = join51(generatedDir, "indexes");
|
|
23852
23941
|
const serverDir = join51(generatedDir, "server");
|
|
@@ -23861,7 +23950,7 @@ var withResolvedSources = (map, sourceFile) => {
|
|
|
23861
23950
|
const contentHash = Bun.hash(raw).toString(BASE_36_RADIX);
|
|
23862
23951
|
const prevHash = sourceHashCache.get(src);
|
|
23863
23952
|
const persistent = persistentCache.get(src);
|
|
23864
|
-
if (prevHash === contentHash && persistent && existsSync39(persistent.ssr) && existsSync39(persistent.client)) {
|
|
23953
|
+
if (prevHash === contentHash && persistent && existsSync39(persistent.ssr) && existsSync39(persistent.client) && (!persistent.css || existsSync39(persistent.css))) {
|
|
23865
23954
|
cache.set(src, persistent);
|
|
23866
23955
|
return persistent;
|
|
23867
23956
|
}
|
|
@@ -23880,7 +23969,7 @@ var withResolvedSources = (map, sourceFile) => {
|
|
|
23880
23969
|
const fileRoute = fileRouteFor(src);
|
|
23881
23970
|
const rawRel = fileRoute ? "pages" : dirname27(relative23(svelteRoot, src)).replace(/\\/g, "/");
|
|
23882
23971
|
const relDir = rawRel.startsWith("..") ? `_ext/${relative23(process.cwd(), dirname27(src)).replace(/\\/g, "/")}` : rawRel;
|
|
23883
|
-
const baseName = fileRoute?.name ??
|
|
23972
|
+
const baseName = fileRoute?.name ?? basename16(src).replace(/\.svelte(\.(ts|js))?$/, "");
|
|
23884
23973
|
const staticImportPaths = Array.from(transpiledServer.matchAll(/from\s+['"]([^'"]+)['"]/g)).map((match) => match[1]).filter((path) => path !== undefined);
|
|
23885
23974
|
const dynamicImportPaths = Array.from(transpiledServer.matchAll(DYNAMIC_IMPORT_PATTERN)).map((match) => match[1]).filter((path) => path !== undefined);
|
|
23886
23975
|
const importPaths = Array.from(new Set([...staticImportPaths, ...dynamicImportPaths]));
|
|
@@ -23926,14 +24015,14 @@ var withResolvedSources = (map, sourceFile) => {
|
|
|
23926
24015
|
};
|
|
23927
24016
|
const generate = (mode) => {
|
|
23928
24017
|
const transpiled = mode === "server" ? transpiledServer : transpiledClient;
|
|
23929
|
-
const
|
|
24018
|
+
const compiled = isModule ? compileModule(transpiled, {
|
|
23930
24019
|
dev: mode === "client" && dev,
|
|
23931
24020
|
experimental: {
|
|
23932
24021
|
async: transformedByLowering
|
|
23933
24022
|
},
|
|
23934
24023
|
filename: src
|
|
23935
|
-
})
|
|
23936
|
-
css: "injected",
|
|
24024
|
+
}) : compile(transpiled, {
|
|
24025
|
+
css: externalCss && mode === "client" ? "external" : "injected",
|
|
23937
24026
|
dev: mode === "client" && dev,
|
|
23938
24027
|
experimental: {
|
|
23939
24028
|
async: transformedByLowering
|
|
@@ -23941,7 +24030,8 @@ var withResolvedSources = (map, sourceFile) => {
|
|
|
23941
24030
|
filename: src,
|
|
23942
24031
|
generate: mode,
|
|
23943
24032
|
hmr: isDev
|
|
23944
|
-
})
|
|
24033
|
+
});
|
|
24034
|
+
const compiledJs = compiled.js;
|
|
23945
24035
|
let code = compiledJs.code.replace(/\.svelte(?:\.(?:ts|js))?(['"])/g, ".js$1");
|
|
23946
24036
|
if (mode === "client" && isDev) {
|
|
23947
24037
|
const moduleKey = `/@src/${relative23(process.cwd(), src).replace(/\\/g, "/")}`;
|
|
@@ -23954,7 +24044,8 @@ var withResolvedSources = (map, sourceFile) => {
|
|
|
23954
24044
|
code = removeUnusedRequireHelper(code);
|
|
23955
24045
|
}
|
|
23956
24046
|
code += islandMetadataExports;
|
|
23957
|
-
|
|
24047
|
+
const css = !isModule && externalCss && mode === "client" ? (compiled.css?.code ?? "").trim() : "";
|
|
24048
|
+
return { code, css, map: compiledJs.map };
|
|
23958
24049
|
};
|
|
23959
24050
|
const ssrPath = join51(serverDir, relDir, `${baseName}.js`);
|
|
23960
24051
|
const clientPath = join51(clientDir, relDir, `${baseName}.js`);
|
|
@@ -23980,6 +24071,7 @@ export const ${LAZY_SOURCE_EXPORT} = ${sourceId};${componentStamp}`;
|
|
|
23980
24071
|
]);
|
|
23981
24072
|
const inlineMap = (map) => map ? `${inlineSourceMapComment(withResolvedSources(map, src))}
|
|
23982
24073
|
` : "";
|
|
24074
|
+
let cssFile;
|
|
23983
24075
|
if (isModule) {
|
|
23984
24076
|
const generated = generate("client");
|
|
23985
24077
|
const bundle = rewriteExternalImports(generated.code, "client") + inlineMap(generated.map);
|
|
@@ -23992,14 +24084,21 @@ export const ${LAZY_SOURCE_EXPORT} = ${sourceId};${componentStamp}`;
|
|
|
23992
24084
|
const clientGen = generate("client");
|
|
23993
24085
|
const serverCode = rewriteExternalImports(serverGen.code, "server");
|
|
23994
24086
|
const serverBundle = serverCode + sourceExport(serverCode) + inlineMap(serverGen.map);
|
|
23995
|
-
const
|
|
24087
|
+
const cssPath = clientPath.replace(/\.js$/, ".css");
|
|
24088
|
+
const cssImport = clientGen.css ? `
|
|
24089
|
+
import ${JSON.stringify(`./${basename16(cssPath)}`)};
|
|
24090
|
+
` : "";
|
|
24091
|
+
const clientBundle = rewriteExternalImports(clientGen.code, "client") + lazyRegistrations + cssImport + inlineMap(clientGen.map);
|
|
24092
|
+
cssFile = clientGen.css ? cssPath : undefined;
|
|
23996
24093
|
await Promise.all([
|
|
23997
24094
|
write2(ssrPath, serverBundle),
|
|
23998
|
-
write2(clientPath, clientBundle)
|
|
24095
|
+
write2(clientPath, clientBundle),
|
|
24096
|
+
...clientGen.css ? [write2(cssPath, clientGen.css)] : []
|
|
23999
24097
|
]);
|
|
24000
24098
|
}
|
|
24001
24099
|
const built = {
|
|
24002
24100
|
client: clientPath,
|
|
24101
|
+
css: cssFile,
|
|
24003
24102
|
hasAwaitSlot: loweredAwaitServerSource.transformed || loweredAwaitClientSource.transformed || loweredServerSource.transformed || loweredClientSource.transformed || hasAwaitSlotFromChildren,
|
|
24004
24103
|
isModule,
|
|
24005
24104
|
ssr: ssrPath
|
|
@@ -24012,7 +24111,7 @@ export const ${LAZY_SOURCE_EXPORT} = ${sourceId};${componentStamp}`;
|
|
|
24012
24111
|
const componentRoots = roots.filter((root) => !root.isModule);
|
|
24013
24112
|
await Promise.all(componentRoots.map(async ({ client, hasAwaitSlot }) => {
|
|
24014
24113
|
const relClientDir = dirname27(relative23(clientDir, client));
|
|
24015
|
-
const name =
|
|
24114
|
+
const name = basename16(client, extname16(client));
|
|
24016
24115
|
const indexPath = join51(indexDir, relClientDir, `${name}.js`);
|
|
24017
24116
|
const importRaw = relative23(dirname27(indexPath), client).split(sep8).join("/");
|
|
24018
24117
|
const importPath = importRaw.startsWith(".") || importRaw.startsWith("/") ? importRaw : `./${importRaw}`;
|
|
@@ -24129,7 +24228,7 @@ if (typeof window !== "undefined") {
|
|
|
24129
24228
|
svelteClientPaths: roots.map(({ client }) => client),
|
|
24130
24229
|
svelteIndexPaths: componentRoots.map(({ client }) => {
|
|
24131
24230
|
const rel = dirname27(relative23(clientDir, client));
|
|
24132
|
-
return join51(indexDir, rel,
|
|
24231
|
+
return join51(indexDir, rel, basename16(client));
|
|
24133
24232
|
}),
|
|
24134
24233
|
svelteServerPaths: roots.map(({ ssr }) => ssr)
|
|
24135
24234
|
};
|
|
@@ -24147,8 +24246,14 @@ var init_compileSvelte = __esm(() => {
|
|
|
24147
24246
|
init_lazyModule();
|
|
24148
24247
|
devClientDir2 = resolveDevClientDir2();
|
|
24149
24248
|
hmrClientPath3 = join51(devClientDir2, "hmrClient.ts").replace(/\\/g, "/");
|
|
24150
|
-
|
|
24151
|
-
|
|
24249
|
+
persistentCaches = {
|
|
24250
|
+
external: new Map,
|
|
24251
|
+
injected: new Map
|
|
24252
|
+
};
|
|
24253
|
+
sourceHashCaches = {
|
|
24254
|
+
external: new Map,
|
|
24255
|
+
injected: new Map
|
|
24256
|
+
};
|
|
24152
24257
|
transpiler3 = new Transpiler3({ loader: "ts", target: "browser" });
|
|
24153
24258
|
DYNAMIC_IMPORT_PATTERN = /\bimport\s*\(\s*['"]([^'"]+)['"]\s*\)/g;
|
|
24154
24259
|
});
|
|
@@ -24650,7 +24755,7 @@ var init_chainInlineSourcemaps = __esm(() => {
|
|
|
24650
24755
|
import { createHash as createHash8 } from "crypto";
|
|
24651
24756
|
import { existsSync as existsSync40, readFileSync as readFileSync39 } from "fs";
|
|
24652
24757
|
import { mkdir as mkdir10, rename as rename2, writeFile as writeFile11 } from "fs/promises";
|
|
24653
|
-
import { join as join52, resolve as
|
|
24758
|
+
import { join as join52, resolve as resolve39 } from "path";
|
|
24654
24759
|
var CACHE_DIR_NAME = "compile-cache", ABSOLUTE_CACHE_DIR_NAME2 = ".absolutejs", CACHE_FORMAT_VERSION = 3, FILE_NAME_HASH_LENGTH = 32, vueCompileCacheEnabled = () => process.env.ABSOLUTE_COMPILE_CACHE !== "0", hashContent = (content) => createHash8("sha256").update(content).digest("hex"), hashParts = (parts) => {
|
|
24655
24760
|
const hash = createHash8("sha256");
|
|
24656
24761
|
for (const part of parts) {
|
|
@@ -24660,8 +24765,8 @@ var CACHE_DIR_NAME = "compile-cache", ABSOLUTE_CACHE_DIR_NAME2 = ".absolutejs",
|
|
|
24660
24765
|
return hash.digest("hex");
|
|
24661
24766
|
}, readOwnPackageVersion = () => {
|
|
24662
24767
|
const candidates = [
|
|
24663
|
-
|
|
24664
|
-
|
|
24768
|
+
resolve39(import.meta.dir, "..", "..", "package.json"),
|
|
24769
|
+
resolve39(import.meta.dir, "..", "package.json")
|
|
24665
24770
|
];
|
|
24666
24771
|
for (const candidate of candidates) {
|
|
24667
24772
|
try {
|
|
@@ -24742,7 +24847,7 @@ __export(exports_emitTsHelpers, {
|
|
|
24742
24847
|
var {file: file3, Transpiler: Transpiler4, write: write3 } = globalThis.Bun;
|
|
24743
24848
|
import { copyFileSync as copyFileSync2, existsSync as existsSync41, readdirSync as readdirSync6, statSync as statSync6 } from "fs";
|
|
24744
24849
|
import { mkdir as mkdir11, rename as rename3, writeFile as writeFile12 } from "fs/promises";
|
|
24745
|
-
import { dirname as dirname28, join as join53, resolve as
|
|
24850
|
+
import { dirname as dirname28, join as join53, resolve as resolve40, sep as sep9 } from "path";
|
|
24746
24851
|
var CACHE_DIR_NAME2 = "vue-helpers", CACHE_FORMAT_VERSION2 = 2, HASH_LENGTH4 = 24, transpiler4, cacheDir = () => join53(process.cwd(), ".absolutejs", "compile-cache", CACHE_DIR_NAME2), cacheKey2 = (sourcePath, sourceCode) => {
|
|
24747
24852
|
const frameworkVersion = frameworkVersionForCache();
|
|
24748
24853
|
if (!frameworkVersion || !vueCompileCacheEnabled())
|
|
@@ -24809,7 +24914,7 @@ var CACHE_DIR_NAME2 = "vue-helpers", CACHE_FORMAT_VERSION2 = 2, HASH_LENGTH4 = 2
|
|
|
24809
24914
|
return false;
|
|
24810
24915
|
}
|
|
24811
24916
|
}, resolveImportTarget = (sourceDir, specifier) => {
|
|
24812
|
-
const base =
|
|
24917
|
+
const base = resolve40(sourceDir, specifier);
|
|
24813
24918
|
return IMPORT_CANDIDATE_SUFFIXES.map((suffix) => `${base}${suffix}`).find(isFilePath) ?? base;
|
|
24814
24919
|
}, rewriteMirrorImports = (code, sourcePath) => {
|
|
24815
24920
|
const sourceDir = dirname28(sourcePath);
|
|
@@ -24873,16 +24978,16 @@ var init_emitTsHelpers = __esm(() => {
|
|
|
24873
24978
|
});
|
|
24874
24979
|
|
|
24875
24980
|
// src/build/inlineCssImports.ts
|
|
24876
|
-
import { readFileSync as readFileSync40, realpathSync as
|
|
24877
|
-
import { dirname as dirname29, resolve as
|
|
24981
|
+
import { readFileSync as readFileSync40, realpathSync as realpathSync4 } from "fs";
|
|
24982
|
+
import { dirname as dirname29, resolve as resolve41 } from "path";
|
|
24878
24983
|
var inlineCssImports = (cssContent, cssFilePath, visited = new Set) => {
|
|
24879
|
-
const resolved =
|
|
24984
|
+
const resolved = realpathSync4(cssFilePath);
|
|
24880
24985
|
if (visited.has(resolved))
|
|
24881
24986
|
return "";
|
|
24882
24987
|
visited.add(resolved);
|
|
24883
24988
|
const importRegex = /@import\s+(?:url\(\s*)?(['"])(\.{1,2}\/[^'"]+)\1\s*\)?\s*;?/g;
|
|
24884
24989
|
return cssContent.replace(importRegex, (match, _quote, relPath) => {
|
|
24885
|
-
const importedPath =
|
|
24990
|
+
const importedPath = resolve41(dirname29(cssFilePath), relPath);
|
|
24886
24991
|
if (!isFile(importedPath))
|
|
24887
24992
|
return match;
|
|
24888
24993
|
const importedContent = readFileSync40(importedPath, "utf-8");
|
|
@@ -24894,8 +24999,8 @@ var init_inlineCssImports = __esm(() => {
|
|
|
24894
24999
|
});
|
|
24895
25000
|
|
|
24896
25001
|
// src/build/compileVueSfc.ts
|
|
24897
|
-
import { existsSync as existsSync42, readFileSync as readFileSync41, realpathSync as
|
|
24898
|
-
import { dirname as dirname30, join as join54, relative as relative24, resolve as
|
|
25002
|
+
import { existsSync as existsSync42, readFileSync as readFileSync41, realpathSync as realpathSync5 } from "fs";
|
|
25003
|
+
import { dirname as dirname30, join as join54, relative as relative24, resolve as resolve42 } from "path";
|
|
24899
25004
|
var {Transpiler: Transpiler5 } = globalThis.Bun;
|
|
24900
25005
|
var transpiler5, toJs = (filePath, sourceDir) => {
|
|
24901
25006
|
if (filePath.endsWith(".vue"))
|
|
@@ -24904,15 +25009,15 @@ var transpiler5, toJs = (filePath, sourceDir) => {
|
|
|
24904
25009
|
return filePath.replace(/\.ts$/, ".js");
|
|
24905
25010
|
if (isStylePath(filePath)) {
|
|
24906
25011
|
if (sourceDir && (filePath.startsWith("./") || filePath.startsWith("../"))) {
|
|
24907
|
-
return
|
|
25012
|
+
return resolve42(sourceDir, filePath);
|
|
24908
25013
|
}
|
|
24909
25014
|
return filePath;
|
|
24910
25015
|
}
|
|
24911
25016
|
if (sourceDir && (filePath.startsWith("./") || filePath.startsWith("../"))) {
|
|
24912
|
-
const directTs =
|
|
25017
|
+
const directTs = resolve42(sourceDir, `${filePath}.ts`);
|
|
24913
25018
|
if (existsSync42(directTs))
|
|
24914
25019
|
return `${filePath}.js`;
|
|
24915
|
-
const indexedTs =
|
|
25020
|
+
const indexedTs = resolve42(sourceDir, filePath, "index.ts");
|
|
24916
25021
|
if (existsSync42(indexedTs))
|
|
24917
25022
|
return `${filePath}/index.js`;
|
|
24918
25023
|
}
|
|
@@ -24960,7 +25065,7 @@ const ${localName} = (source) => ${importedName}(
|
|
|
24960
25065
|
: { ...source, loader: () => __absoluteResolveAsyncVueComponent(source.loader) },
|
|
24961
25066
|
);`;
|
|
24962
25067
|
return code.replace(vueImportRegex, `import { ${specifiers.join(", ")} } from 'vue';${wrapper}`);
|
|
24963
|
-
}, toOutputImport = (specifier, sourceDir) => specifier.startsWith("./") || specifier.startsWith("../") ? vueMirrorImport(join54(sourceDir, "__importer__"), specifier,
|
|
25068
|
+
}, toOutputImport = (specifier, sourceDir) => specifier.startsWith("./") || specifier.startsWith("../") ? vueMirrorImport(join54(sourceDir, "__importer__"), specifier, resolve42(sourceDir, specifier)) : specifier, rewriteRelativeImports = (code, sourceDir) => code.replace(/(['"])(\.{1,2}\/[^'"]+)(['"])/g, (_, quoteStart, relativeImport, quoteEnd) => `${quoteStart}${toOutputImport(toJs(relativeImport, sourceDir), sourceDir)}${quoteEnd}`), compileVueSfc = async ({
|
|
24964
25069
|
clientOutputPath,
|
|
24965
25070
|
componentId,
|
|
24966
25071
|
hmrId,
|
|
@@ -24980,7 +25085,7 @@ const ${localName} = (source) => ${importedName}(
|
|
|
24980
25085
|
const compiledScript = hasScript ? compiler.compileScript(descriptor, {
|
|
24981
25086
|
fs: {
|
|
24982
25087
|
fileExists: isFile,
|
|
24983
|
-
realpath:
|
|
25088
|
+
realpath: realpathSync5,
|
|
24984
25089
|
readFile: (file) => {
|
|
24985
25090
|
if (!isFile(file))
|
|
24986
25091
|
return;
|
|
@@ -25481,24 +25586,24 @@ var init_workerPool = __esm(() => {
|
|
|
25481
25586
|
import { existsSync as existsSync44 } from "fs";
|
|
25482
25587
|
import { mkdir as mkdir12 } from "fs/promises";
|
|
25483
25588
|
import {
|
|
25484
|
-
basename as
|
|
25589
|
+
basename as basename17,
|
|
25485
25590
|
dirname as dirname32,
|
|
25486
25591
|
isAbsolute as isAbsolute11,
|
|
25487
25592
|
join as join56,
|
|
25488
25593
|
relative as relative25,
|
|
25489
|
-
resolve as
|
|
25594
|
+
resolve as resolve43
|
|
25490
25595
|
} from "path";
|
|
25491
25596
|
var {file: file4, write: write4 } = globalThis.Bun;
|
|
25492
25597
|
var resolveDevClientDir3 = () => {
|
|
25493
25598
|
const projectRoot = process.cwd();
|
|
25494
|
-
const fromSource =
|
|
25599
|
+
const fromSource = resolve43(import.meta.dir, "../dev/client");
|
|
25495
25600
|
if (existsSync44(fromSource) && fromSource.startsWith(projectRoot)) {
|
|
25496
25601
|
return fromSource;
|
|
25497
25602
|
}
|
|
25498
|
-
const fromNodeModules =
|
|
25603
|
+
const fromNodeModules = resolve43(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client");
|
|
25499
25604
|
if (existsSync44(fromNodeModules))
|
|
25500
25605
|
return fromNodeModules;
|
|
25501
|
-
return
|
|
25606
|
+
return resolve43(import.meta.dir, "./dev/client");
|
|
25502
25607
|
}, devClientDir3, hmrClientPath4, scriptCache, scriptSetupCache, templateCache, styleCache, persistentBuildCache, vueSourceHashCache, vueHmrMetadata, detectVueChangeType = (filePath, descriptor) => {
|
|
25503
25608
|
const prevScript = scriptCache.get(filePath);
|
|
25504
25609
|
const prevScriptSetup = scriptSetupCache.get(filePath);
|
|
@@ -25539,11 +25644,11 @@ var resolveDevClientDir3 = () => {
|
|
|
25539
25644
|
return Array.from(new Set(found));
|
|
25540
25645
|
}, resolveHelperTsPath = (sourceDir, helper) => {
|
|
25541
25646
|
if (helper.endsWith(".ts"))
|
|
25542
|
-
return
|
|
25543
|
-
const direct =
|
|
25647
|
+
return resolve43(sourceDir, helper);
|
|
25648
|
+
const direct = resolve43(sourceDir, `${helper}.ts`);
|
|
25544
25649
|
if (existsSync44(direct))
|
|
25545
25650
|
return direct;
|
|
25546
|
-
const indexed =
|
|
25651
|
+
const indexed = resolve43(sourceDir, helper, "index.ts");
|
|
25547
25652
|
if (existsSync44(indexed))
|
|
25548
25653
|
return indexed;
|
|
25549
25654
|
return direct;
|
|
@@ -25666,7 +25771,7 @@ var resolveDevClientDir3 = () => {
|
|
|
25666
25771
|
throw error;
|
|
25667
25772
|
}
|
|
25668
25773
|
}, compileVueFileUncached = async (sourceFilePath, outputDirs, cacheMap, isEntryPoint, vueRootDir, compiler, runSfc, stylePreprocessors) => {
|
|
25669
|
-
const fileBaseName =
|
|
25774
|
+
const fileBaseName = basename17(sourceFilePath, ".vue");
|
|
25670
25775
|
const componentId = toKebab(fileBaseName);
|
|
25671
25776
|
vueCompileProfile.files += 1;
|
|
25672
25777
|
const rawSourceContent = await timed("readMs", () => file4(sourceFilePath).text());
|
|
@@ -25703,12 +25808,12 @@ var resolveDevClientDir3 = () => {
|
|
|
25703
25808
|
const childComponentPaths = importPaths.filter((path) => path.startsWith(".") && path.endsWith(".vue"));
|
|
25704
25809
|
const packageComponentPaths = Array.from(resolvedPackageVueImports.entries());
|
|
25705
25810
|
const helperModulePaths = importPaths.filter((path) => path.startsWith(".") && !path.endsWith(".vue") && !isStylePath(path));
|
|
25706
|
-
const stylePathsImported = importPaths.filter((path) => (path.startsWith(".") || isAbsolute11(path)) && isStylePath(path)).map((path) => isAbsolute11(path) ? path :
|
|
25811
|
+
const stylePathsImported = importPaths.filter((path) => (path.startsWith(".") || isAbsolute11(path)) && isStylePath(path)).map((path) => isAbsolute11(path) ? path : resolve43(dirname32(sourceFilePath), path));
|
|
25707
25812
|
for (const stylePath of stylePathsImported) {
|
|
25708
25813
|
addStyleImporter(sourceFilePath, stylePath);
|
|
25709
25814
|
}
|
|
25710
25815
|
const childBuildResults = await Promise.all([
|
|
25711
|
-
...childComponentPaths.map((relativeChildPath) => compileVueFile(
|
|
25816
|
+
...childComponentPaths.map((relativeChildPath) => compileVueFile(resolve43(dirname32(sourceFilePath), relativeChildPath), outputDirs, cacheMap, false, vueRootDir, compiler, runSfc, stylePreprocessors)),
|
|
25712
25817
|
...packageComponentPaths.map(([, absolutePath]) => compileVueFile(absolutePath, outputDirs, cacheMap, false, vueRootDir, compiler, runSfc, stylePreprocessors))
|
|
25713
25818
|
]);
|
|
25714
25819
|
const cacheKeyStartedAt = performance.now();
|
|
@@ -25816,7 +25921,7 @@ var resolveDevClientDir3 = () => {
|
|
|
25816
25921
|
const buildCache = new Map;
|
|
25817
25922
|
const allTsHelperPaths = new Set;
|
|
25818
25923
|
const expandSpaRouteChildren = async (entries) => {
|
|
25819
|
-
const expanded = new Set(entries.map((entry) =>
|
|
25924
|
+
const expanded = new Set(entries.map((entry) => resolve43(entry)));
|
|
25820
25925
|
const queue = [...expanded];
|
|
25821
25926
|
while (queue.length > 0) {
|
|
25822
25927
|
const entryPath = queue.pop();
|
|
@@ -25833,7 +25938,7 @@ var resolveDevClientDir3 = () => {
|
|
|
25833
25938
|
});
|
|
25834
25939
|
const routes = parseVueSpaRoutes(descriptor.script?.content ?? "");
|
|
25835
25940
|
for (const { importPath } of routes) {
|
|
25836
|
-
const childPath =
|
|
25941
|
+
const childPath = resolve43(dirname32(entryPath), importPath);
|
|
25837
25942
|
if (expanded.has(childPath) || !existsSync44(childPath)) {
|
|
25838
25943
|
continue;
|
|
25839
25944
|
}
|
|
@@ -25848,7 +25953,7 @@ var resolveDevClientDir3 = () => {
|
|
|
25848
25953
|
vueCompileProfile.stageExpandMs = performance.now() - stageStartedAt;
|
|
25849
25954
|
stageStartedAt = performance.now();
|
|
25850
25955
|
const compiledPages = await Promise.all(expandedEntryPoints.map(async (entryPath) => {
|
|
25851
|
-
const resolvedEntryPath =
|
|
25956
|
+
const resolvedEntryPath = resolve43(entryPath);
|
|
25852
25957
|
const result = await compileVueFile(resolvedEntryPath, {
|
|
25853
25958
|
client: clientOutputDir,
|
|
25854
25959
|
css: cssOutputDir,
|
|
@@ -25865,7 +25970,7 @@ var resolveDevClientDir3 = () => {
|
|
|
25865
25970
|
spaRoutes: result.spaRoutes
|
|
25866
25971
|
};
|
|
25867
25972
|
}
|
|
25868
|
-
const entryBaseName =
|
|
25973
|
+
const entryBaseName = basename17(entryPath, ".vue");
|
|
25869
25974
|
const indexOutputFile = join56(indexOutputDir, `${entryBaseName}.js`);
|
|
25870
25975
|
const clientOutputFile = result.clientPath;
|
|
25871
25976
|
await mkdir12(dirname32(indexOutputFile), { recursive: true });
|
|
@@ -26086,6 +26191,7 @@ var resolveDevClientDir3 = () => {
|
|
|
26086
26191
|
hmrMetadata: new Map(vueHmrMetadata),
|
|
26087
26192
|
vueClientPaths: compiledPages.map((p) => p.clientPath).filter(isString),
|
|
26088
26193
|
vueCssPaths: compiledPages.flatMap((result) => result.cssPaths),
|
|
26194
|
+
vueCssPathsBySource: new Map(compiledPages.map((page) => [page.sourcePath, page.cssPaths])),
|
|
26089
26195
|
vueIndexPaths: compiledPages.map((p) => p.indexPath).filter(isString),
|
|
26090
26196
|
vueServerPaths: compiledPages.map((result) => result.serverPath),
|
|
26091
26197
|
vueSpaRoutesBySource
|
|
@@ -26632,7 +26738,7 @@ __export(exports_compileAngular, {
|
|
|
26632
26738
|
invalidateAngularJitCache: () => invalidateAngularJitCache
|
|
26633
26739
|
});
|
|
26634
26740
|
import { existsSync as existsSync45, readFileSync as readFileSync43, promises as fs5 } from "fs";
|
|
26635
|
-
import { join as join57, basename as
|
|
26741
|
+
import { join as join57, basename as basename18, sep as sep10, dirname as dirname33, resolve as resolve44, relative as relative26 } from "path";
|
|
26636
26742
|
var {Glob: Glob8 } = globalThis.Bun;
|
|
26637
26743
|
var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) => {
|
|
26638
26744
|
const temporaryPath = `${path}.tmp.${process.pid}.${atomicWriteSequence++}`;
|
|
@@ -26647,10 +26753,10 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
26647
26753
|
return tracePhase ? tracePhase(`compile/angular/${name}`, fn, metadata) : await fn();
|
|
26648
26754
|
}, readTsconfigPathAliases = () => {
|
|
26649
26755
|
try {
|
|
26650
|
-
const configPath =
|
|
26756
|
+
const configPath = resolve44(process.cwd(), "tsconfig.json");
|
|
26651
26757
|
const config = lazyTypescript.readConfigFile(configPath, lazyTypescript.sys.readFile).config;
|
|
26652
26758
|
const compilerOptions = config?.compilerOptions ?? {};
|
|
26653
|
-
const baseUrl =
|
|
26759
|
+
const baseUrl = resolve44(process.cwd(), compilerOptions.baseUrl ?? ".");
|
|
26654
26760
|
const aliases = Object.entries(compilerOptions.paths ?? {}).map(([pattern, replacements]) => ({ pattern, replacements }));
|
|
26655
26761
|
return { aliases, baseUrl };
|
|
26656
26762
|
} catch {
|
|
@@ -26670,7 +26776,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
26670
26776
|
const wildcardValue = exactMatch ? "" : specifier.slice(prefix.length, specifier.length - suffix.length);
|
|
26671
26777
|
for (const replacement of alias.replacements) {
|
|
26672
26778
|
const candidate = replacement.replace("*", wildcardValue);
|
|
26673
|
-
const resolved = resolveSourceFile(
|
|
26779
|
+
const resolved = resolveSourceFile(resolve44(baseUrl, candidate));
|
|
26674
26780
|
if (resolved)
|
|
26675
26781
|
return resolved;
|
|
26676
26782
|
}
|
|
@@ -26689,13 +26795,13 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
26689
26795
|
];
|
|
26690
26796
|
return candidates.find((file) => existsSync45(file));
|
|
26691
26797
|
}, createLegacyAngularAnimationUsageResolver = (rootDir) => {
|
|
26692
|
-
const baseDir =
|
|
26798
|
+
const baseDir = resolve44(rootDir);
|
|
26693
26799
|
const tsconfigAliases = readTsconfigPathAliases();
|
|
26694
26800
|
const transpiler = new Bun.Transpiler({ loader: "tsx" });
|
|
26695
26801
|
const scanCache = new Map;
|
|
26696
26802
|
const resolveLocalImport = (specifier, fromDir) => {
|
|
26697
26803
|
if (specifier.startsWith(".") || specifier.startsWith("/")) {
|
|
26698
|
-
return resolveSourceFile(
|
|
26804
|
+
return resolveSourceFile(resolve44(fromDir, specifier));
|
|
26699
26805
|
}
|
|
26700
26806
|
const aliased = matchTsconfigAlias(specifier, tsconfigAliases.aliases, tsconfigAliases.baseUrl, resolveSourceFile);
|
|
26701
26807
|
if (aliased)
|
|
@@ -26704,7 +26810,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
26704
26810
|
const resolved = Bun.resolveSync(specifier, fromDir);
|
|
26705
26811
|
if (resolved.includes("/node_modules/"))
|
|
26706
26812
|
return;
|
|
26707
|
-
const absolute =
|
|
26813
|
+
const absolute = resolve44(resolved);
|
|
26708
26814
|
if (!absolute.startsWith(baseDir))
|
|
26709
26815
|
return;
|
|
26710
26816
|
return resolveSourceFile(absolute);
|
|
@@ -26720,7 +26826,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
26720
26826
|
usesLegacyAnimations: false
|
|
26721
26827
|
});
|
|
26722
26828
|
}
|
|
26723
|
-
const resolved =
|
|
26829
|
+
const resolved = resolve44(actualPath);
|
|
26724
26830
|
const cached = scanCache.get(resolved);
|
|
26725
26831
|
if (cached)
|
|
26726
26832
|
return cached;
|
|
@@ -26749,7 +26855,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
26749
26855
|
const actualPath = resolveSourceFile(filePath);
|
|
26750
26856
|
if (!actualPath)
|
|
26751
26857
|
return false;
|
|
26752
|
-
const resolved =
|
|
26858
|
+
const resolved = resolve44(actualPath);
|
|
26753
26859
|
if (visited.has(resolved))
|
|
26754
26860
|
return false;
|
|
26755
26861
|
visited.add(resolved);
|
|
@@ -26767,14 +26873,14 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
26767
26873
|
return (entryPath) => visit(entryPath);
|
|
26768
26874
|
}, resolveDevClientDir4 = () => {
|
|
26769
26875
|
const projectRoot = process.cwd();
|
|
26770
|
-
const fromSource =
|
|
26876
|
+
const fromSource = resolve44(import.meta.dir, "../dev/client");
|
|
26771
26877
|
if (existsSync45(fromSource) && fromSource.startsWith(projectRoot)) {
|
|
26772
26878
|
return fromSource;
|
|
26773
26879
|
}
|
|
26774
|
-
const fromNodeModules =
|
|
26880
|
+
const fromNodeModules = resolve44(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client");
|
|
26775
26881
|
if (existsSync45(fromNodeModules))
|
|
26776
26882
|
return fromNodeModules;
|
|
26777
|
-
return
|
|
26883
|
+
return resolve44(import.meta.dir, "./dev/client");
|
|
26778
26884
|
}, devClientDir4, hmrClientPath5, formatDiagnosticMessage = (diagnostic) => {
|
|
26779
26885
|
try {
|
|
26780
26886
|
return lazyTypescript.flattenDiagnosticMessageText(diagnostic.messageText, `
|
|
@@ -26817,11 +26923,11 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
26817
26923
|
if (hasJsLikeExtension(path))
|
|
26818
26924
|
return `${path}${query}`;
|
|
26819
26925
|
const importerDir = dirname33(importerOutputPath);
|
|
26820
|
-
const fileCandidate =
|
|
26926
|
+
const fileCandidate = resolve44(importerDir, `${path}.js`);
|
|
26821
26927
|
if (outputFiles?.has(fileCandidate) || existsSync45(fileCandidate)) {
|
|
26822
26928
|
return `${path}.js${query}`;
|
|
26823
26929
|
}
|
|
26824
|
-
const indexCandidate =
|
|
26930
|
+
const indexCandidate = resolve44(importerDir, path, "index.js");
|
|
26825
26931
|
if (outputFiles?.has(indexCandidate) || existsSync45(indexCandidate)) {
|
|
26826
26932
|
return `${path}/index.js${query}`;
|
|
26827
26933
|
}
|
|
@@ -26849,7 +26955,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
26849
26955
|
}, resolveLocalTsImport = (fromFile, specifier) => {
|
|
26850
26956
|
if (!isRelativeModuleSpecifier(specifier))
|
|
26851
26957
|
return null;
|
|
26852
|
-
const basePath =
|
|
26958
|
+
const basePath = resolve44(dirname33(fromFile), specifier);
|
|
26853
26959
|
const candidates = /\.[cm]?[tj]sx?$/.test(basePath) ? [basePath] : [
|
|
26854
26960
|
`${basePath}.ts`,
|
|
26855
26961
|
`${basePath}.tsx`,
|
|
@@ -26860,7 +26966,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
26860
26966
|
join57(basePath, "index.mts"),
|
|
26861
26967
|
join57(basePath, "index.cts")
|
|
26862
26968
|
];
|
|
26863
|
-
return candidates.map((candidate) =>
|
|
26969
|
+
return candidates.map((candidate) => resolve44(candidate)).find((candidate) => existsSync45(candidate) && !candidate.endsWith(".d.ts")) ?? null;
|
|
26864
26970
|
}, readFileForAotTransform = async (fileName, readFile) => {
|
|
26865
26971
|
const hostSource = readFile?.(fileName);
|
|
26866
26972
|
if (typeof hostSource === "string")
|
|
@@ -26895,7 +27001,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
26895
27001
|
paths.push(join57(fileDir, urlMatch.replace(/['"]/g, "")));
|
|
26896
27002
|
}
|
|
26897
27003
|
}
|
|
26898
|
-
return paths.map((path) =>
|
|
27004
|
+
return paths.map((path) => resolve44(path));
|
|
26899
27005
|
}, readResourceCacheFile = async (cachePath) => {
|
|
26900
27006
|
try {
|
|
26901
27007
|
const entry = JSON.parse(await fs5.readFile(cachePath, "utf-8"));
|
|
@@ -26937,7 +27043,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
26937
27043
|
transformedFiles: 0
|
|
26938
27044
|
};
|
|
26939
27045
|
const transformFile = async (filePath) => {
|
|
26940
|
-
const resolvedPath =
|
|
27046
|
+
const resolvedPath = resolve44(filePath);
|
|
26941
27047
|
if (visited.has(resolvedPath))
|
|
26942
27048
|
return;
|
|
26943
27049
|
visited.add(resolvedPath);
|
|
@@ -26972,7 +27078,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
26972
27078
|
return { stats, transformedSources };
|
|
26973
27079
|
}, compileAngularFiles = async (inputPaths, outDir, stylePreprocessors) => {
|
|
26974
27080
|
const islandMetadataByOutputPath = await traceAngularPhase("aot/island-metadata", () => new Map(inputPaths.map((inputPath) => {
|
|
26975
|
-
const outputPath =
|
|
27081
|
+
const outputPath = resolve44(join57(outDir, relative26(process.cwd(), resolve44(inputPath)).replace(/\.[cm]?[tj]sx?$/, ".js")));
|
|
26976
27082
|
return [
|
|
26977
27083
|
outputPath,
|
|
26978
27084
|
buildIslandMetadataExports(readFileSync43(inputPath, "utf-8"))
|
|
@@ -26983,7 +27089,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
26983
27089
|
const tsLibDir = await traceAngularPhase("aot/resolve-typescript-lib", () => {
|
|
26984
27090
|
const tsPath = __require.resolve("typescript");
|
|
26985
27091
|
const tsRootDir = dirname33(tsPath);
|
|
26986
|
-
return tsRootDir.endsWith("lib") ? tsRootDir :
|
|
27092
|
+
return tsRootDir.endsWith("lib") ? tsRootDir : resolve44(tsRootDir, "lib");
|
|
26987
27093
|
});
|
|
26988
27094
|
const config = await traceAngularPhase("aot/read-configuration", () => readConfiguration("./tsconfig.json"));
|
|
26989
27095
|
const options = {
|
|
@@ -27014,7 +27120,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
27014
27120
|
const originalGetDefaultLibFileName = host.getDefaultLibFileName;
|
|
27015
27121
|
host.getDefaultLibFileName = (opts) => {
|
|
27016
27122
|
const fileName = originalGetDefaultLibFileName ? originalGetDefaultLibFileName(opts) : "lib.d.ts";
|
|
27017
|
-
return
|
|
27123
|
+
return basename18(fileName);
|
|
27018
27124
|
};
|
|
27019
27125
|
const originalGetSourceFile = host.getSourceFile;
|
|
27020
27126
|
host.getSourceFile = (fileName, languageVersion, onError) => {
|
|
@@ -27025,7 +27131,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
27025
27131
|
return originalGetSourceFile?.call(host, fileName, languageVersion, onError);
|
|
27026
27132
|
};
|
|
27027
27133
|
const emitted = {};
|
|
27028
|
-
const resolvedOutDir =
|
|
27134
|
+
const resolvedOutDir = resolve44(outDir);
|
|
27029
27135
|
host.writeFile = (fileName, text) => {
|
|
27030
27136
|
const relativePath = resolveRelativePath(fileName, resolvedOutDir, outDir);
|
|
27031
27137
|
emitted[relativePath] = text;
|
|
@@ -27047,12 +27153,12 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
27047
27153
|
if (!fileName.endsWith(".ts") || fileName.endsWith(".d.ts")) {
|
|
27048
27154
|
return source;
|
|
27049
27155
|
}
|
|
27050
|
-
const resolvedPath =
|
|
27156
|
+
const resolvedPath = resolve44(fileName);
|
|
27051
27157
|
return transformedSources.get(resolvedPath) ?? source;
|
|
27052
27158
|
};
|
|
27053
27159
|
const originalGetSourceFileForCompile = host.getSourceFile;
|
|
27054
27160
|
host.getSourceFile = (fileName, languageVersion, onError) => {
|
|
27055
|
-
const source = transformedSources.get(
|
|
27161
|
+
const source = transformedSources.get(resolve44(fileName));
|
|
27056
27162
|
if (source) {
|
|
27057
27163
|
return lazyTypescript.createSourceFile(fileName, source, languageVersion, true);
|
|
27058
27164
|
}
|
|
@@ -27076,7 +27182,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
27076
27182
|
content,
|
|
27077
27183
|
target: join57(outDir, fileName)
|
|
27078
27184
|
}));
|
|
27079
|
-
const outputFiles = new Set(rawEntries.map(({ target }) =>
|
|
27185
|
+
const outputFiles = new Set(rawEntries.map(({ target }) => resolve44(target)));
|
|
27080
27186
|
return rawEntries.map(({ content, target }) => {
|
|
27081
27187
|
let processedContent = content.replace(/from\s+(['"])(\.\.?\/[^'"]+)(\1)/g, (match, quote, path) => {
|
|
27082
27188
|
const rewritten = rewriteRelativeJsSpecifier(target, path, outputFiles);
|
|
@@ -27091,7 +27197,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
27091
27197
|
return cleaned ? `import { ${cleaned}, InternalInjectFlags } from '@angular/core'` : `import { InternalInjectFlags } from '@angular/core'`;
|
|
27092
27198
|
});
|
|
27093
27199
|
processedContent = processedContent.replace(/\b(?<!Internal)InjectFlags\b/g, "InternalInjectFlags");
|
|
27094
|
-
processedContent += islandMetadataByOutputPath.get(
|
|
27200
|
+
processedContent += islandMetadataByOutputPath.get(resolve44(target)) ?? "";
|
|
27095
27201
|
processedContent = downlevelAsyncForZone(processedContent, target);
|
|
27096
27202
|
return { content: processedContent, target };
|
|
27097
27203
|
});
|
|
@@ -27102,7 +27208,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
27102
27208
|
})), { outputs: entries.length });
|
|
27103
27209
|
return await traceAngularPhase("aot/collect-output-paths", () => entries.map(({ target }) => target), { outputs: entries.length });
|
|
27104
27210
|
}, jitContentCache, invalidateAngularJitCache = (filePath) => {
|
|
27105
|
-
jitContentCache.delete(
|
|
27211
|
+
jitContentCache.delete(resolve44(filePath));
|
|
27106
27212
|
}, wrapperOutputCache, escapeTemplateContent = (content) => content.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$\{/g, "\\${"), findUncommentedMatch = (source, pattern) => {
|
|
27107
27213
|
const re = new RegExp(pattern.source, pattern.flags.includes("g") ? pattern.flags : pattern.flags + "g");
|
|
27108
27214
|
let match;
|
|
@@ -27115,7 +27221,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
27115
27221
|
}
|
|
27116
27222
|
return null;
|
|
27117
27223
|
}, resolveAngularDeferImportSpecifier = () => {
|
|
27118
|
-
const sourceEntry =
|
|
27224
|
+
const sourceEntry = resolve44(import.meta.dir, "../angular/components/index.ts");
|
|
27119
27225
|
if (existsSync45(sourceEntry)) {
|
|
27120
27226
|
return sourceEntry.replace(/\\/g, "/");
|
|
27121
27227
|
}
|
|
@@ -27405,10 +27511,10 @@ ${fields}
|
|
|
27405
27511
|
return "";
|
|
27406
27512
|
}
|
|
27407
27513
|
}, compileAngularFileJIT = async (inputPath, outDir, rootDir, stylePreprocessors, cacheBuster) => {
|
|
27408
|
-
const entryPath =
|
|
27514
|
+
const entryPath = resolve44(inputPath);
|
|
27409
27515
|
const allOutputs = [];
|
|
27410
27516
|
const visited = new Set;
|
|
27411
|
-
const baseDir =
|
|
27517
|
+
const baseDir = resolve44(rootDir ?? process.cwd());
|
|
27412
27518
|
let usesLegacyAnimations = false;
|
|
27413
27519
|
const angularTranspiler = new Bun.Transpiler({
|
|
27414
27520
|
loader: "ts",
|
|
@@ -27436,7 +27542,7 @@ ${fields}
|
|
|
27436
27542
|
};
|
|
27437
27543
|
const resolveLocalImport = (specifier, fromDir) => {
|
|
27438
27544
|
if (specifier.startsWith(".") || specifier.startsWith("/")) {
|
|
27439
|
-
return resolveSourceFile(
|
|
27545
|
+
return resolveSourceFile(resolve44(fromDir, specifier));
|
|
27440
27546
|
}
|
|
27441
27547
|
const aliased = matchTsconfigAlias(specifier, tsconfigAliases.aliases, tsconfigAliases.baseUrl, resolveSourceFile);
|
|
27442
27548
|
if (aliased)
|
|
@@ -27445,7 +27551,7 @@ ${fields}
|
|
|
27445
27551
|
const resolved = Bun.resolveSync(specifier, fromDir);
|
|
27446
27552
|
if (resolved.includes("/node_modules/"))
|
|
27447
27553
|
return;
|
|
27448
|
-
const absolute =
|
|
27554
|
+
const absolute = resolve44(resolved);
|
|
27449
27555
|
if (!absolute.startsWith(baseDir))
|
|
27450
27556
|
return;
|
|
27451
27557
|
return resolveSourceFile(absolute);
|
|
@@ -27455,7 +27561,7 @@ ${fields}
|
|
|
27455
27561
|
};
|
|
27456
27562
|
const toOutputPath = (sourcePath) => {
|
|
27457
27563
|
const inputDir = dirname33(sourcePath);
|
|
27458
|
-
const fileBase =
|
|
27564
|
+
const fileBase = basename18(sourcePath).replace(/\.[cm]?[tj]sx?$/, ".js");
|
|
27459
27565
|
if (inputDir === outDir || inputDir.startsWith(`${outDir}${sep10}`)) {
|
|
27460
27566
|
return join57(inputDir, fileBase);
|
|
27461
27567
|
}
|
|
@@ -27497,13 +27603,13 @@ ${fields}
|
|
|
27497
27603
|
return `${prefix}${dots}`;
|
|
27498
27604
|
return `${prefix}../${dots}`;
|
|
27499
27605
|
});
|
|
27500
|
-
if (
|
|
27606
|
+
if (resolve44(actualPath) === entryPath) {
|
|
27501
27607
|
processedContent += buildIslandMetadataExports(sourceCode);
|
|
27502
27608
|
}
|
|
27503
27609
|
return processedContent;
|
|
27504
27610
|
};
|
|
27505
27611
|
const transpileFile = async (filePath) => {
|
|
27506
|
-
const resolved =
|
|
27612
|
+
const resolved = resolve44(filePath);
|
|
27507
27613
|
if (visited.has(resolved))
|
|
27508
27614
|
return;
|
|
27509
27615
|
visited.add(resolved);
|
|
@@ -27511,7 +27617,7 @@ ${fields}
|
|
|
27511
27617
|
const inputDir = dirname33(resolved);
|
|
27512
27618
|
const relativeDir = inputDir.startsWith(baseDir) ? inputDir.substring(baseDir.length + 1) : inputDir;
|
|
27513
27619
|
const targetDir = join57(outDir, relativeDir);
|
|
27514
|
-
const targetPath = join57(targetDir,
|
|
27620
|
+
const targetPath = join57(targetDir, basename18(resolved));
|
|
27515
27621
|
await fs5.mkdir(targetDir, { recursive: true });
|
|
27516
27622
|
await fs5.copyFile(resolved, targetPath);
|
|
27517
27623
|
allOutputs.push(targetPath);
|
|
@@ -27526,7 +27632,7 @@ ${fields}
|
|
|
27526
27632
|
const inlined = await inlineResources(sourceCode, dirname33(actualPath), stylePreprocessors);
|
|
27527
27633
|
sourceCode = inlineTemplateAndLowerDeferSync(inlined.source, dirname33(actualPath)).source;
|
|
27528
27634
|
const inputDir = dirname33(actualPath);
|
|
27529
|
-
const fileBase =
|
|
27635
|
+
const fileBase = basename18(actualPath).replace(/\.[cm]?[tj]sx?$/, ".js");
|
|
27530
27636
|
const targetPath = toOutputPath(actualPath);
|
|
27531
27637
|
const targetDir = dirname33(targetPath);
|
|
27532
27638
|
const relativeDir = relative26(outDir, targetDir).replace(/\\/g, "/");
|
|
@@ -27555,7 +27661,7 @@ ${fields}
|
|
|
27555
27661
|
importRewrites.set(specifier, relativeRewrite);
|
|
27556
27662
|
return resolved;
|
|
27557
27663
|
}).filter((path) => Boolean(path));
|
|
27558
|
-
const isEntry =
|
|
27664
|
+
const isEntry = resolve44(actualPath) === resolve44(entryPath);
|
|
27559
27665
|
const contentHash = Bun.hash(sourceCode).toString(BASE_36_RADIX);
|
|
27560
27666
|
const cacheKey = actualPath;
|
|
27561
27667
|
const shouldWriteFile = cacheBuster && isEntry ? true : jitContentCache.get(cacheKey) !== contentHash || !existsSync45(targetPath);
|
|
@@ -27627,11 +27733,11 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
27627
27733
|
const compiledRoot = compiledParent;
|
|
27628
27734
|
const indexesDir = join57(compiledParent, "indexes");
|
|
27629
27735
|
await traceAngularPhase("setup/create-indexes-dir", () => fs5.mkdir(indexesDir, { recursive: true }));
|
|
27630
|
-
const aotOutputs = hmr ? [] : await traceAngularPhase("aot/compile-files", () => compileAngularFiles(entryPoints.map((entry) =>
|
|
27736
|
+
const aotOutputs = hmr ? [] : await traceAngularPhase("aot/compile-files", () => compileAngularFiles(entryPoints.map((entry) => resolve44(entry)), compiledRoot, stylePreprocessors), { entries: entryPoints.length });
|
|
27631
27737
|
if (!hmr) {
|
|
27632
27738
|
await traceAngularPhase("aot/copy-json-resources", async () => {
|
|
27633
27739
|
const cwd = process.cwd();
|
|
27634
|
-
const angularSrcDir =
|
|
27740
|
+
const angularSrcDir = resolve44(outRoot);
|
|
27635
27741
|
if (!existsSync45(angularSrcDir))
|
|
27636
27742
|
return;
|
|
27637
27743
|
const jsonGlob = new Glob8("**/*.json");
|
|
@@ -27649,22 +27755,22 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
27649
27755
|
}
|
|
27650
27756
|
const usesLegacyAngularAnimations = await traceAngularPhase("setup/legacy-animation-resolver", () => createLegacyAngularAnimationUsageResolver(outRoot));
|
|
27651
27757
|
const compileTasks = entryPoints.map(async (entry) => {
|
|
27652
|
-
const resolvedEntry =
|
|
27758
|
+
const resolvedEntry = resolve44(entry);
|
|
27653
27759
|
const relativeEntry = relative26(outRoot, resolvedEntry).replace(/\.[tj]s$/, ".js");
|
|
27654
27760
|
const compileEntry = () => compileAngularFileJIT(resolvedEntry, compiledRoot, outRoot, stylePreprocessors);
|
|
27655
27761
|
let outputs = hmr ? await traceAngularPhase("jit/compile-entry", compileEntry, {
|
|
27656
27762
|
entry: resolvedEntry
|
|
27657
27763
|
}) : aotOutputs;
|
|
27658
|
-
const fileBase =
|
|
27764
|
+
const fileBase = basename18(resolvedEntry).replace(/\.[tj]s$/, "");
|
|
27659
27765
|
const jsName = `${fileBase}.js`;
|
|
27660
27766
|
const compiledFallbackPaths = [
|
|
27661
27767
|
join57(compiledRoot, relativeEntry),
|
|
27662
27768
|
join57(compiledRoot, "pages", jsName),
|
|
27663
27769
|
join57(compiledRoot, jsName)
|
|
27664
|
-
].map((file) =>
|
|
27770
|
+
].map((file) => resolve44(file));
|
|
27665
27771
|
const resolveRawServerFile = (candidatePaths) => {
|
|
27666
27772
|
const normalizedCandidates = [
|
|
27667
|
-
...candidatePaths.map((file) =>
|
|
27773
|
+
...candidatePaths.map((file) => resolve44(file)),
|
|
27668
27774
|
...compiledFallbackPaths
|
|
27669
27775
|
];
|
|
27670
27776
|
let candidate = normalizedCandidates.find((file) => existsSync45(file) && file.endsWith(`${sep10}${relativeEntry}`));
|
|
@@ -27745,8 +27851,8 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
27745
27851
|
const fragments = [];
|
|
27746
27852
|
if (providersInjection.appProvidersSource) {
|
|
27747
27853
|
const compiledAppProvidersPath = (() => {
|
|
27748
|
-
const angularDirAbs =
|
|
27749
|
-
const appSourceAbs =
|
|
27854
|
+
const angularDirAbs = resolve44(outRoot);
|
|
27855
|
+
const appSourceAbs = resolve44(providersInjection.appProvidersSource);
|
|
27750
27856
|
const rel = relative26(angularDirAbs, appSourceAbs).replace(/\\/g, "/");
|
|
27751
27857
|
return join57(compiledParent, rel).replace(/\.[cm]?[tj]sx?$/, ".js");
|
|
27752
27858
|
})();
|
|
@@ -28493,7 +28599,7 @@ var require_node = __commonJS(function(exports, module) {
|
|
|
28493
28599
|
// src/build/compileEmber.ts
|
|
28494
28600
|
import { existsSync as existsSync46 } from "fs";
|
|
28495
28601
|
import { mkdir as mkdir13, rm as rm10 } from "fs/promises";
|
|
28496
|
-
import { basename as
|
|
28602
|
+
import { basename as basename19, dirname as dirname34, extname as extname17, join as join58, resolve as resolve45 } from "path";
|
|
28497
28603
|
var {build: bunBuild3, Transpiler: Transpiler6, write: write5, file: file5 } = globalThis.Bun;
|
|
28498
28604
|
var cachedPreprocessor = null, getPreprocessor = async () => {
|
|
28499
28605
|
if (cachedPreprocessor)
|
|
@@ -28589,7 +28695,7 @@ export const importSync = (specifier) => {
|
|
|
28589
28695
|
const originalImporter = stagedSourceMap.get(args.importer);
|
|
28590
28696
|
if (!originalImporter)
|
|
28591
28697
|
return;
|
|
28592
|
-
const candidateBase =
|
|
28698
|
+
const candidateBase = resolve45(dirname34(originalImporter), args.path);
|
|
28593
28699
|
const extensionsToTry = ["", ".gts", ".gjs", ".ts", ".js"];
|
|
28594
28700
|
for (const ext of extensionsToTry) {
|
|
28595
28701
|
const candidate = candidateBase + ext;
|
|
@@ -28648,7 +28754,7 @@ export const renderToHTML = (props = {}) => {
|
|
|
28648
28754
|
export { PageComponent };
|
|
28649
28755
|
export default PageComponent;
|
|
28650
28756
|
`, compileEmberFile = async (entry, compiledRoot, cwd = process.cwd()) => {
|
|
28651
|
-
const resolvedEntry =
|
|
28757
|
+
const resolvedEntry = resolve45(entry);
|
|
28652
28758
|
const source = await file5(resolvedEntry).text();
|
|
28653
28759
|
let preprocessed = source;
|
|
28654
28760
|
if (isTemplateTagFile(resolvedEntry)) {
|
|
@@ -28659,7 +28765,7 @@ export default PageComponent;
|
|
|
28659
28765
|
preprocessed = rewriteTemplateEvalToScope(result.code);
|
|
28660
28766
|
}
|
|
28661
28767
|
const transpiled = transpiler6.transformSync(preprocessed);
|
|
28662
|
-
const baseName =
|
|
28768
|
+
const baseName = basename19(resolvedEntry).replace(/\.(gjs|gts|ts|js)$/, "");
|
|
28663
28769
|
const tmpDir = join58(compiledRoot, "_tmp");
|
|
28664
28770
|
const serverDir = join58(compiledRoot, "server");
|
|
28665
28771
|
const clientDir = join58(compiledRoot, "client");
|
|
@@ -28668,8 +28774,8 @@ export default PageComponent;
|
|
|
28668
28774
|
mkdir13(serverDir, { recursive: true }),
|
|
28669
28775
|
mkdir13(clientDir, { recursive: true })
|
|
28670
28776
|
]);
|
|
28671
|
-
const tmpPagePath =
|
|
28672
|
-
const tmpHarnessPath =
|
|
28777
|
+
const tmpPagePath = resolve45(join58(tmpDir, `${baseName}.module.js`));
|
|
28778
|
+
const tmpHarnessPath = resolve45(join58(tmpDir, `${baseName}.harness.js`));
|
|
28673
28779
|
await Promise.all([
|
|
28674
28780
|
write5(tmpPagePath, transpiled),
|
|
28675
28781
|
write5(tmpHarnessPath, generateServerHarness(tmpPagePath))
|
|
@@ -28734,24 +28840,24 @@ var importFromProject = (specifier, projectRoot = process.cwd()) => {
|
|
|
28734
28840
|
|
|
28735
28841
|
// src/build/buildReactVendor.ts
|
|
28736
28842
|
import { existsSync as existsSync47, mkdirSync as mkdirSync13 } from "fs";
|
|
28737
|
-
import { join as join59, resolve as
|
|
28843
|
+
import { join as join59, resolve as resolve46 } from "path";
|
|
28738
28844
|
import { rm as rm11 } from "fs/promises";
|
|
28739
28845
|
var {build: bunBuild4 } = globalThis.Bun;
|
|
28740
28846
|
var resolveJsxDevRuntimeCompatPath = () => {
|
|
28741
28847
|
const candidates = [
|
|
28742
|
-
|
|
28743
|
-
|
|
28744
|
-
|
|
28745
|
-
|
|
28746
|
-
|
|
28747
|
-
|
|
28848
|
+
resolve46(import.meta.dir, "react", "jsxDevRuntimeCompat.js"),
|
|
28849
|
+
resolve46(import.meta.dir, "src", "react", "jsxDevRuntimeCompat.ts"),
|
|
28850
|
+
resolve46(import.meta.dir, "..", "react", "jsxDevRuntimeCompat.js"),
|
|
28851
|
+
resolve46(import.meta.dir, "..", "src", "react", "jsxDevRuntimeCompat.ts"),
|
|
28852
|
+
resolve46(import.meta.dir, "..", "..", "dist", "react", "jsxDevRuntimeCompat.js"),
|
|
28853
|
+
resolve46(import.meta.dir, "..", "..", "src", "react", "jsxDevRuntimeCompat.ts")
|
|
28748
28854
|
];
|
|
28749
28855
|
for (const candidate of candidates) {
|
|
28750
28856
|
if (existsSync47(candidate)) {
|
|
28751
28857
|
return candidate.replace(/\\/g, "/");
|
|
28752
28858
|
}
|
|
28753
28859
|
}
|
|
28754
|
-
return (candidates[0] ??
|
|
28860
|
+
return (candidates[0] ?? resolve46(import.meta.dir, "react", "jsxDevRuntimeCompat.js")).replace(/\\/g, "/");
|
|
28755
28861
|
}, jsxDevRuntimeCompatPath, jsxRuntimeCompatPath, reactSpecifiers, toSafeFileName = (specifier) => specifier.replace(/\//g, "_"), computeVendorPaths = () => {
|
|
28756
28862
|
const paths = {};
|
|
28757
28863
|
for (const specifier of reactSpecifiers) {
|
|
@@ -29206,12 +29312,12 @@ import {
|
|
|
29206
29312
|
writeFileSync as writeFileSync16
|
|
29207
29313
|
} from "fs";
|
|
29208
29314
|
import {
|
|
29209
|
-
basename as
|
|
29315
|
+
basename as basename20,
|
|
29210
29316
|
dirname as dirname35,
|
|
29211
29317
|
extname as extname18,
|
|
29212
29318
|
join as join63,
|
|
29213
29319
|
relative as relative27,
|
|
29214
|
-
resolve as
|
|
29320
|
+
resolve as resolve47,
|
|
29215
29321
|
sep as sep11
|
|
29216
29322
|
} from "path";
|
|
29217
29323
|
import { cwd, env as env3, exit } from "process";
|
|
@@ -29348,7 +29454,7 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
|
|
|
29348
29454
|
const copyFile = (path) => {
|
|
29349
29455
|
if (!path)
|
|
29350
29456
|
return;
|
|
29351
|
-
const dest = join63(outDir,
|
|
29457
|
+
const dest = join63(outDir, basename20(path));
|
|
29352
29458
|
cpSync(path, dest, { force: true });
|
|
29353
29459
|
return dest;
|
|
29354
29460
|
};
|
|
@@ -29374,7 +29480,7 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
|
|
|
29374
29480
|
}, formatManifestKeyCollisions = (collisions, projectRoot) => collisions.map(({ key, next, previous }) => {
|
|
29375
29481
|
const first = relative27(projectRoot, previous);
|
|
29376
29482
|
const second = relative27(projectRoot, next);
|
|
29377
|
-
return `Manifest key "${key}" belongs to two pages: ${first} and ${second}. Pages are looked up by file name (asset(manifest, '${key}')), so each name must be unique across htmlDirectory, htmxDirectory and the other page directories. Rename one of them, for example ${
|
|
29483
|
+
return `Manifest key "${key}" belongs to two pages: ${first} and ${second}. Pages are looked up by file name (asset(manifest, '${key}')), so each name must be unique across htmlDirectory, htmxDirectory and the other page directories. Rename one of them, for example ${basename20(second)} to ${basename20(second).replace(key, `${key}Page`)}, and update its route.`;
|
|
29378
29484
|
}).join(`
|
|
29379
29485
|
`), copyHtmxVendor = (htmxDir, htmxDestDir) => {
|
|
29380
29486
|
mkdirSync17(htmxDestDir, { recursive: true });
|
|
@@ -29395,8 +29501,8 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
|
|
|
29395
29501
|
if (globalThis.__absoluteVersion)
|
|
29396
29502
|
return;
|
|
29397
29503
|
const candidates = [
|
|
29398
|
-
|
|
29399
|
-
|
|
29504
|
+
resolve47(import.meta.dir, "..", "..", "package.json"),
|
|
29505
|
+
resolve47(import.meta.dir, "..", "package.json")
|
|
29400
29506
|
];
|
|
29401
29507
|
const resolveCandidate = async (remaining) => {
|
|
29402
29508
|
const [candidate, ...rest] = remaining;
|
|
@@ -29412,7 +29518,7 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
|
|
|
29412
29518
|
};
|
|
29413
29519
|
await resolveCandidate(candidates);
|
|
29414
29520
|
}, SKIP_DIRS5, addWorkerPathIfExists = (file, relPath, workerPaths) => {
|
|
29415
|
-
const absPath =
|
|
29521
|
+
const absPath = resolve47(file, "..", relPath);
|
|
29416
29522
|
try {
|
|
29417
29523
|
statSync7(absPath);
|
|
29418
29524
|
workerPaths.add(absPath);
|
|
@@ -29503,7 +29609,7 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
|
|
|
29503
29609
|
copyVueDevIndexes(vueDir, vuePagesPath, vueEntries, devIndexDir);
|
|
29504
29610
|
}
|
|
29505
29611
|
}, rewriteFileRouteImports = (content, indexesDir) => content.replace(/from\s*'(\.{1,2}\/[^']+)'/g, (match, specifier) => {
|
|
29506
|
-
const target =
|
|
29612
|
+
const target = resolve47(indexesDir, specifier);
|
|
29507
29613
|
if (!isInFileRouteRoot(target))
|
|
29508
29614
|
return match;
|
|
29509
29615
|
return `from '/@src/${relative27(process.cwd(), target).replace(/\\/g, "/")}'`;
|
|
@@ -29521,7 +29627,7 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
|
|
|
29521
29627
|
return;
|
|
29522
29628
|
}
|
|
29523
29629
|
const indexFiles = readDir(reactIndexesPath).filter((file) => file.endsWith(".tsx"));
|
|
29524
|
-
const pagesRel = relative27(process.cwd(),
|
|
29630
|
+
const pagesRel = relative27(process.cwd(), resolve47(reactPagesPath)).replace(/\\/g, "/");
|
|
29525
29631
|
for (const file of indexFiles) {
|
|
29526
29632
|
let content = readFileSync44(join63(reactIndexesPath, file), "utf-8");
|
|
29527
29633
|
content = content.replace(/from\s*['"]([^'"]*\/pages\/([^'"]+))['"]/g, (_match, _fullPath, componentName) => `from '/@src/${pagesRel}/${componentName}'`);
|
|
@@ -29530,27 +29636,27 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
|
|
|
29530
29636
|
}
|
|
29531
29637
|
}, copySvelteDevIndexes = (svelteDir, sveltePagesPath, svelteEntries, devIndexDir) => {
|
|
29532
29638
|
const svelteIndexDir = join63(getFrameworkGeneratedDir("svelte"), "indexes");
|
|
29533
|
-
const sveltePageEntries = svelteEntries.filter((file) =>
|
|
29639
|
+
const sveltePageEntries = svelteEntries.filter((file) => resolve47(file).startsWith(resolve47(sveltePagesPath)) || fileRouteFor(file) !== undefined);
|
|
29534
29640
|
for (const entry of sveltePageEntries) {
|
|
29535
|
-
const name = fileRouteFor(entry)?.name ??
|
|
29641
|
+
const name = fileRouteFor(entry)?.name ?? basename20(entry).replace(/\.svelte(\.(ts|js))?$/, "");
|
|
29536
29642
|
const indexFile = join63(svelteIndexDir, "pages", `${name}.js`);
|
|
29537
29643
|
if (!existsSync48(indexFile))
|
|
29538
29644
|
continue;
|
|
29539
29645
|
let content = readFileSync44(indexFile, "utf-8");
|
|
29540
|
-
const srcRel = relative27(process.cwd(),
|
|
29646
|
+
const srcRel = relative27(process.cwd(), resolve47(entry)).replace(/\\/g, "/");
|
|
29541
29647
|
content = content.replace(/import\s+Component\s+from\s+['"]([^'"]+)['"]/, `import Component from "/@src/${srcRel}"`);
|
|
29542
29648
|
writeFileSync16(join63(devIndexDir, `${name}.svelte.js`), content);
|
|
29543
29649
|
}
|
|
29544
29650
|
}, copyVueDevIndexes = (vueDir, vuePagesPath, vueEntries, devIndexDir) => {
|
|
29545
29651
|
const vueIndexDir = join63(getFrameworkGeneratedDir("vue"), "indexes");
|
|
29546
|
-
const vuePageEntries = vueEntries.filter((file) =>
|
|
29652
|
+
const vuePageEntries = vueEntries.filter((file) => resolve47(file).startsWith(resolve47(vuePagesPath)));
|
|
29547
29653
|
for (const entry of vuePageEntries) {
|
|
29548
|
-
const name =
|
|
29654
|
+
const name = basename20(entry, ".vue");
|
|
29549
29655
|
const indexFile = join63(vueIndexDir, `${name}.js`);
|
|
29550
29656
|
if (!existsSync48(indexFile))
|
|
29551
29657
|
continue;
|
|
29552
29658
|
let content = readFileSync44(indexFile, "utf-8");
|
|
29553
|
-
const srcRel = relative27(process.cwd(),
|
|
29659
|
+
const srcRel = relative27(process.cwd(), resolve47(entry)).replace(/\\/g, "/");
|
|
29554
29660
|
content = content.replace(/import\s+Comp(?:\s*,\s*\*\s+as\s+\w+)?\s+from\s+['"]([^'"]+)['"]/, (match) => match.replace(/from\s+['"][^'"]+['"]/, `from "/@src/${srcRel}"`));
|
|
29555
29661
|
writeFileSync16(join63(devIndexDir, `${name}.vue.js`), content);
|
|
29556
29662
|
}
|
|
@@ -29558,7 +29664,7 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
|
|
|
29558
29664
|
const urlFileMap = new Map;
|
|
29559
29665
|
for (const srcPath of urlReferencedFiles) {
|
|
29560
29666
|
const rel = relative27(projectRoot, srcPath).replace(/\\/g, "/");
|
|
29561
|
-
const name =
|
|
29667
|
+
const name = basename20(srcPath);
|
|
29562
29668
|
const mtime = Math.round(statSync7(srcPath).mtimeMs);
|
|
29563
29669
|
const url = `/@src/${rel}?v=${mtime}`;
|
|
29564
29670
|
urlFileMap.set(name, url);
|
|
@@ -29568,13 +29674,13 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
|
|
|
29568
29674
|
}, buildProdUrlFileMap = (urlReferencedFiles, buildPath, nonReactClientOutputs) => {
|
|
29569
29675
|
const urlFileMap = new Map;
|
|
29570
29676
|
for (const srcPath of urlReferencedFiles) {
|
|
29571
|
-
const srcBase =
|
|
29572
|
-
const output = nonReactClientOutputs.find((artifact) =>
|
|
29677
|
+
const srcBase = basename20(srcPath).replace(/\.[^.]+$/, "");
|
|
29678
|
+
const output = nonReactClientOutputs.find((artifact) => basename20(artifact.path).startsWith(`${srcBase}.`));
|
|
29573
29679
|
if (!output)
|
|
29574
29680
|
continue;
|
|
29575
29681
|
const url = `/${relative27(buildPath, output.path).replace(/\\/g, "/")}`;
|
|
29576
|
-
urlFileMap.set(
|
|
29577
|
-
urlFileMap.set(
|
|
29682
|
+
urlFileMap.set(basename20(srcPath), url);
|
|
29683
|
+
urlFileMap.set(basename20(srcPath).replace(/\.tsx?$/, ".js"), url);
|
|
29578
29684
|
}
|
|
29579
29685
|
return urlFileMap;
|
|
29580
29686
|
}, buildUrlFileMap = (urlReferencedFiles, hmr, projectRoot, buildPath, nonReactClientOutputs) => {
|
|
@@ -29832,7 +29938,7 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
|
|
|
29832
29938
|
if (!firstEntry)
|
|
29833
29939
|
throw new Error("Expected at least one server directory entry");
|
|
29834
29940
|
serverRoot = join63(firstEntry.dir, firstEntry.subdir);
|
|
29835
|
-
serverOutDir = join63(buildPath,
|
|
29941
|
+
serverOutDir = join63(buildPath, basename20(firstEntry.dir));
|
|
29836
29942
|
} else if (serverDirMap.length > 1) {
|
|
29837
29943
|
serverRoot = commonAncestor(serverDirMap.map((entry) => entry.dir), projectRoot);
|
|
29838
29944
|
serverOutDir = buildPath;
|
|
@@ -29865,13 +29971,13 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
|
|
|
29865
29971
|
const filterToIncrementalEntries = (entryPoints, mapToSource) => {
|
|
29866
29972
|
if (!isIncremental || !incrementalFiles)
|
|
29867
29973
|
return entryPoints;
|
|
29868
|
-
const normalizedIncremental = new Set(incrementalFiles.map((f) =>
|
|
29974
|
+
const normalizedIncremental = new Set(incrementalFiles.map((f) => resolve47(f)));
|
|
29869
29975
|
const matchingEntries = [];
|
|
29870
29976
|
for (const entry of entryPoints) {
|
|
29871
29977
|
const sourceFile = mapToSource(entry);
|
|
29872
29978
|
if (!sourceFile)
|
|
29873
29979
|
continue;
|
|
29874
|
-
if (!normalizedIncremental.has(
|
|
29980
|
+
if (!normalizedIncremental.has(resolve47(sourceFile)))
|
|
29875
29981
|
continue;
|
|
29876
29982
|
matchingEntries.push(entry);
|
|
29877
29983
|
}
|
|
@@ -30005,7 +30111,7 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
|
|
|
30005
30111
|
mkdirSync17(htmlConventionsOutDir, { recursive: true });
|
|
30006
30112
|
const htmlPathRemap = new Map;
|
|
30007
30113
|
for (const sourcePath of htmlConventionSources) {
|
|
30008
|
-
const dest = join63(htmlConventionsOutDir,
|
|
30114
|
+
const dest = join63(htmlConventionsOutDir, basename20(sourcePath));
|
|
30009
30115
|
cpSync(sourcePath, dest, { force: true });
|
|
30010
30116
|
htmlPathRemap.set(sourcePath, dest);
|
|
30011
30117
|
}
|
|
@@ -30057,12 +30163,12 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
|
|
|
30057
30163
|
return scoped;
|
|
30058
30164
|
return scoped.filter((entry) => {
|
|
30059
30165
|
const source = mapToSource(entry);
|
|
30060
|
-
return source !== null && deferPageEntries.except.has(
|
|
30166
|
+
return source !== null && deferPageEntries.except.has(resolve47(source));
|
|
30061
30167
|
});
|
|
30062
30168
|
};
|
|
30063
30169
|
const mapReactIndexToPage = (entry) => {
|
|
30064
|
-
if (reactIndexesPath && reactPagesPath && entry.startsWith(
|
|
30065
|
-
const pageName =
|
|
30170
|
+
if (reactIndexesPath && reactPagesPath && entry.startsWith(resolve47(reactIndexesPath))) {
|
|
30171
|
+
const pageName = basename20(entry, ".tsx");
|
|
30066
30172
|
return fileRouteNamed(pageName)?.source ?? join63(reactPagesPath, `${pageName}.tsx`);
|
|
30067
30173
|
}
|
|
30068
30174
|
return null;
|
|
@@ -30101,9 +30207,9 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
|
|
|
30101
30207
|
return new Set;
|
|
30102
30208
|
const resolved = new Set;
|
|
30103
30209
|
for (const entry of vueEntries) {
|
|
30104
|
-
const name =
|
|
30210
|
+
const name = basename20(entry, ".vue");
|
|
30105
30211
|
if (ssrOnlyPageNames.has(name)) {
|
|
30106
|
-
resolved.add(
|
|
30212
|
+
resolved.add(resolve47(entry));
|
|
30107
30213
|
}
|
|
30108
30214
|
}
|
|
30109
30215
|
return resolved;
|
|
@@ -30166,7 +30272,10 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
|
|
|
30166
30272
|
{ clientPaths: angularClientPaths, serverPaths: angularServerPaths },
|
|
30167
30273
|
{ serverPaths: emberServerPaths },
|
|
30168
30274
|
{ svelteClientPaths: islandSvelteClientPaths },
|
|
30169
|
-
{
|
|
30275
|
+
{
|
|
30276
|
+
vueClientPaths: islandVueClientPaths,
|
|
30277
|
+
vueCssPathsBySource: islandVueCssPathsBySource
|
|
30278
|
+
},
|
|
30170
30279
|
{ clientPaths: islandAngularClientPaths }
|
|
30171
30280
|
] = await Promise.all([
|
|
30172
30281
|
shouldCompileSvelte ? tracePhase("compile/svelte", () => Promise.resolve().then(() => (init_compileSvelte(), {})).then((mod) => compileSvelte(svelteEntries, svelteDir, new Map, hmr, styleTransformConfig))) : {
|
|
@@ -30200,11 +30309,12 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
|
|
|
30200
30309
|
clientPaths: [...emptyStringArray],
|
|
30201
30310
|
serverPaths: [...emptyStringArray]
|
|
30202
30311
|
},
|
|
30203
|
-
shouldCompileIslandSvelte ? tracePhase("compile/island-svelte", () => Promise.resolve().then(() => (init_compileSvelte(), {})).then((mod) => compileSvelte(islandSvelteSources, svelteDir, new Map, hmr, styleTransformConfig))) : {
|
|
30312
|
+
shouldCompileIslandSvelte ? tracePhase("compile/island-svelte", () => Promise.resolve().then(() => (init_compileSvelte(), {})).then((mod) => compileSvelte(islandSvelteSources, svelteDir, new Map, hmr, styleTransformConfig, { externalCss: true }))) : {
|
|
30204
30313
|
svelteClientPaths: [...emptyStringArray]
|
|
30205
30314
|
},
|
|
30206
30315
|
shouldCompileIslandVue ? tracePhase("compile/island-vue", () => Promise.resolve().then(() => (init_compileVue(), {})).then((mod) => compileVue(islandVueSources, vueDir, hmr, styleTransformConfig))) : {
|
|
30207
|
-
vueClientPaths: [...emptyStringArray]
|
|
30316
|
+
vueClientPaths: [...emptyStringArray],
|
|
30317
|
+
vueCssPathsBySource: new Map
|
|
30208
30318
|
},
|
|
30209
30319
|
shouldCompileIslandAngular ? tracePhase("compile/island-angular", () => Promise.resolve().then(() => (init_compileAngular(), {})).then((mod) => compileAngular(islandAngularSources, angularDir, hmr, styleTransformConfig))) : {
|
|
30210
30320
|
clientPaths: [...emptyStringArray]
|
|
@@ -30216,7 +30326,7 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
|
|
|
30216
30326
|
const clientPath = islandSvelteClientPaths[idx];
|
|
30217
30327
|
if (!sourcePath || !clientPath)
|
|
30218
30328
|
continue;
|
|
30219
|
-
islandSvelteClientPathMap.set(
|
|
30329
|
+
islandSvelteClientPathMap.set(resolve47(sourcePath), clientPath);
|
|
30220
30330
|
}
|
|
30221
30331
|
const islandVueClientPathMap = new Map;
|
|
30222
30332
|
for (let idx = 0;idx < islandVueSources.length; idx++) {
|
|
@@ -30224,7 +30334,7 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
|
|
|
30224
30334
|
const clientPath = islandVueClientPaths[idx];
|
|
30225
30335
|
if (!sourcePath || !clientPath)
|
|
30226
30336
|
continue;
|
|
30227
|
-
islandVueClientPathMap.set(
|
|
30337
|
+
islandVueClientPathMap.set(resolve47(sourcePath), clientPath);
|
|
30228
30338
|
}
|
|
30229
30339
|
const islandAngularClientPathMap = new Map;
|
|
30230
30340
|
for (let idx = 0;idx < islandAngularSources.length; idx++) {
|
|
@@ -30232,7 +30342,7 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
|
|
|
30232
30342
|
const clientPath = islandAngularClientPaths[idx];
|
|
30233
30343
|
if (!sourcePath || !clientPath)
|
|
30234
30344
|
continue;
|
|
30235
|
-
islandAngularClientPathMap.set(
|
|
30345
|
+
islandAngularClientPathMap.set(resolve47(sourcePath), clientPath);
|
|
30236
30346
|
}
|
|
30237
30347
|
const reactConventionSources = collectConventionSourceFiles(conventionsMap.react);
|
|
30238
30348
|
const svelteConventionSources = collectConventionSourceFiles(conventionsMap.svelte);
|
|
@@ -30291,7 +30401,7 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
|
|
|
30291
30401
|
rmSync2(destDir, { force: true, recursive: true });
|
|
30292
30402
|
mkdirSync17(destDir, { recursive: true });
|
|
30293
30403
|
const destPaths = await Promise.all(compiledPaths.map(async (compiledPath, idx) => {
|
|
30294
|
-
const name =
|
|
30404
|
+
const name = basename20(compiledPath).replace(/\.[^.]+$/, "");
|
|
30295
30405
|
const result = await bunBuild8({
|
|
30296
30406
|
define: serverDefine,
|
|
30297
30407
|
entrypoints: [compiledPath],
|
|
@@ -30360,6 +30470,9 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
|
|
|
30360
30470
|
angular: islandAngularClientPathMap,
|
|
30361
30471
|
svelte: islandSvelteClientPathMap,
|
|
30362
30472
|
vue: islandVueClientPathMap
|
|
30473
|
+
},
|
|
30474
|
+
cssPathMaps: {
|
|
30475
|
+
vue: islandVueCssPathsBySource
|
|
30363
30476
|
}
|
|
30364
30477
|
})) : {
|
|
30365
30478
|
entries: [],
|
|
@@ -30665,7 +30778,7 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
|
|
|
30665
30778
|
globalCssEntries.length > 0 ? tracePhase("bun/global-css", () => bunBuild8(mergeBunBuildConfig({
|
|
30666
30779
|
entrypoints: globalCssEntries,
|
|
30667
30780
|
naming: `[dir]/[name].[hash].[ext]`,
|
|
30668
|
-
outdir: stylesDir ? join63(buildPath,
|
|
30781
|
+
outdir: stylesDir ? join63(buildPath, basename20(stylesDir)) : buildPath,
|
|
30669
30782
|
plugins: [stylePreprocessorPlugin],
|
|
30670
30783
|
root: stylesDir || clientRoot,
|
|
30671
30784
|
target: "browser",
|
|
@@ -30674,7 +30787,7 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
|
|
|
30674
30787
|
vueCssPaths.length > 0 ? tracePhase("bun/vue-css", () => bunBuild8(mergeBunBuildConfig({
|
|
30675
30788
|
entrypoints: vueCssPaths,
|
|
30676
30789
|
naming: `[name].[hash].[ext]`,
|
|
30677
|
-
outdir: join63(buildPath, assetsPath ?
|
|
30790
|
+
outdir: join63(buildPath, assetsPath ? basename20(assetsPath) : "assets", "css"),
|
|
30678
30791
|
target: "browser",
|
|
30679
30792
|
throw: false
|
|
30680
30793
|
}, resolveBunBuildOverride(bunBuildConfig, "vueCss")))) : undefined
|
|
@@ -30704,7 +30817,7 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
|
|
|
30704
30817
|
}).filter((entry) => entry.endsWith(".js.map") && !entry.includes("node_modules")).map((entry) => join63(buildPath, entry));
|
|
30705
30818
|
for (const mapPath of mapFiles) {
|
|
30706
30819
|
chainExternalSourcemap(mapPath);
|
|
30707
|
-
renameSync(mapPath, join63(sourcemapDir,
|
|
30820
|
+
renameSync(mapPath, join63(sourcemapDir, basename20(mapPath)));
|
|
30708
30821
|
const jsPath = mapPath.slice(0, -4);
|
|
30709
30822
|
try {
|
|
30710
30823
|
const javascript = readFileSync44(jsPath, "utf-8").replace(/\n?\/\/# sourceMappingURL=[^\n]*\s*$/, `
|
|
@@ -30868,7 +30981,7 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
|
|
|
30868
30981
|
for (const artifact of serverOutputs) {
|
|
30869
30982
|
if (extname18(artifact.path) !== ".js")
|
|
30870
30983
|
continue;
|
|
30871
|
-
const fileWithHash =
|
|
30984
|
+
const fileWithHash = basename20(artifact.path);
|
|
30872
30985
|
const [baseName] = fileWithHash.split(`.${artifact.hash}.`);
|
|
30873
30986
|
if (!baseName)
|
|
30874
30987
|
continue;
|
|
@@ -30888,7 +31001,7 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
|
|
|
30888
31001
|
for (const artifact of cssOutputs) {
|
|
30889
31002
|
if (extname18(artifact.path) !== ".css")
|
|
30890
31003
|
continue;
|
|
30891
|
-
const cssName = stripHash(
|
|
31004
|
+
const cssName = stripHash(basename20(artifact.path), artifact.hash);
|
|
30892
31005
|
if (cssName)
|
|
30893
31006
|
cssByName.set(cssName, artifact);
|
|
30894
31007
|
}
|
|
@@ -30898,7 +31011,7 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
|
|
|
30898
31011
|
await Promise.all(serverOutputs.map(async (artifact) => {
|
|
30899
31012
|
if (extname18(artifact.path) !== ".js")
|
|
30900
31013
|
return;
|
|
30901
|
-
const pascalName = stripHash(
|
|
31014
|
+
const pascalName = stripHash(basename20(artifact.path), artifact.hash);
|
|
30902
31015
|
if (!pascalName)
|
|
30903
31016
|
return;
|
|
30904
31017
|
serverJsByPascalName.set(pascalName, artifact);
|
|
@@ -30917,12 +31030,12 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
|
|
|
30917
31030
|
spaSideManifestPaths.push(sideManifestPath);
|
|
30918
31031
|
}
|
|
30919
31032
|
for (const serverPath of emberServerPaths) {
|
|
30920
|
-
const fileBase =
|
|
31033
|
+
const fileBase = basename20(serverPath, ".js");
|
|
30921
31034
|
manifest[toPascal(fileBase)] = serverPath;
|
|
30922
31035
|
}
|
|
30923
31036
|
if (skipAngularClientBundle) {
|
|
30924
31037
|
for (const clientPath of angularClientPaths) {
|
|
30925
|
-
const fileBase =
|
|
31038
|
+
const fileBase = basename20(clientPath, ".js");
|
|
30926
31039
|
const relFromCwd = relative27(projectRoot, clientPath).replace(/\\/g, "/");
|
|
30927
31040
|
manifest[`${toPascal(fileBase)}Index`] = `/@src/${relFromCwd}`;
|
|
30928
31041
|
}
|
|
@@ -30949,7 +31062,7 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
|
|
|
30949
31062
|
let html = readFileSync44(filePath, "utf-8");
|
|
30950
31063
|
if (html.includes("data-hmr-client"))
|
|
30951
31064
|
return;
|
|
30952
|
-
const pageName = JSON.stringify(
|
|
31065
|
+
const pageName = JSON.stringify(basename20(filePath)).replace(/</g, "\\u003c");
|
|
30953
31066
|
const tag = `<script>window.__HMR_FRAMEWORK__="${framework}";window.__HMR_PAGE__=${pageName};</script><script data-hmr-client>${hmrClientBundle}</script>`;
|
|
30954
31067
|
const bodyClose = /<\/body\s*>/i.exec(html);
|
|
30955
31068
|
html = bodyClose ? html.slice(0, bodyClose.index) + tag + html.slice(bodyClose.index) : html + tag;
|
|
@@ -30958,7 +31071,7 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
|
|
|
30958
31071
|
const processHtmlPages = async () => {
|
|
30959
31072
|
if (!(htmlDir && htmlPagesPath))
|
|
30960
31073
|
return;
|
|
30961
|
-
const outputHtmlPages = isSingle ? join63(buildPath, "pages") : join63(buildPath,
|
|
31074
|
+
const outputHtmlPages = isSingle ? join63(buildPath, "pages") : join63(buildPath, basename20(htmlDir), "pages");
|
|
30962
31075
|
mkdirSync17(outputHtmlPages, { recursive: true });
|
|
30963
31076
|
cpSync(htmlPagesPath, outputHtmlPages, {
|
|
30964
31077
|
force: true,
|
|
@@ -30982,13 +31095,13 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
|
|
|
30982
31095
|
const source = readFileSync44(htmlFile, "utf8");
|
|
30983
31096
|
writeFileSync16(htmlFile, injectVitalsReporterHtml(source));
|
|
30984
31097
|
}
|
|
30985
|
-
recordManifestKey(
|
|
31098
|
+
recordManifestKey(basename20(htmlFile, ".html"), htmlFile, join63(htmlPagesPath, relative27(outputHtmlPages, htmlFile)));
|
|
30986
31099
|
}
|
|
30987
31100
|
};
|
|
30988
31101
|
const processHtmxPages = async () => {
|
|
30989
31102
|
if (!(htmxDir && htmxPagesPath))
|
|
30990
31103
|
return;
|
|
30991
|
-
const outputHtmxPages = isSingle ? join63(buildPath, "pages") : join63(buildPath,
|
|
31104
|
+
const outputHtmxPages = isSingle ? join63(buildPath, "pages") : join63(buildPath, basename20(htmxDir), "pages");
|
|
30992
31105
|
mkdirSync17(outputHtmxPages, { recursive: true });
|
|
30993
31106
|
cpSync(htmxPagesPath, outputHtmxPages, {
|
|
30994
31107
|
force: true,
|
|
@@ -30996,7 +31109,7 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
|
|
|
30996
31109
|
});
|
|
30997
31110
|
await expandStaticPageIncludes(htmxPagesPath, outputHtmxPages);
|
|
30998
31111
|
if (shouldCopyHtmx) {
|
|
30999
|
-
const htmxDestDir = isSingle ? buildPath : join63(buildPath,
|
|
31112
|
+
const htmxDestDir = isSingle ? buildPath : join63(buildPath, basename20(htmxDir));
|
|
31000
31113
|
copyHtmxVendor(htmxDir, htmxDestDir);
|
|
31001
31114
|
}
|
|
31002
31115
|
await updateAssetPaths(manifest, outputHtmxPages);
|
|
@@ -31016,7 +31129,7 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
|
|
|
31016
31129
|
const source = readFileSync44(htmxFile, "utf8");
|
|
31017
31130
|
writeFileSync16(htmxFile, injectVitalsReporterHtml(source));
|
|
31018
31131
|
}
|
|
31019
|
-
recordManifestKey(
|
|
31132
|
+
recordManifestKey(basename20(htmxFile, ".html"), htmxFile, join63(htmxPagesPath, relative27(outputHtmxPages, htmxFile)));
|
|
31020
31133
|
}
|
|
31021
31134
|
};
|
|
31022
31135
|
const processStaticConventions = async () => {
|
|
@@ -31166,7 +31279,7 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
|
|
|
31166
31279
|
pageEntries,
|
|
31167
31280
|
tailwindChanged: tailwindResult?.cssChanged ?? false
|
|
31168
31281
|
};
|
|
31169
|
-
}, projectTsconfig = () => existsSync48(
|
|
31282
|
+
}, projectTsconfig = () => existsSync48(resolve47("tsconfig.json")) ? { tsconfig: "./tsconfig.json" } : {}, build2 = async (config) => {
|
|
31170
31283
|
const projectRoot = cwd();
|
|
31171
31284
|
const buildPath = validateSafePath(config.buildDirectory ?? "build", projectRoot);
|
|
31172
31285
|
return withBuildDirectoryLock(buildPath, () => buildUnlocked(config));
|
|
@@ -31414,7 +31527,7 @@ var init_buildEmberVendor = __esm(() => {
|
|
|
31414
31527
|
});
|
|
31415
31528
|
|
|
31416
31529
|
// src/build/workspacePackages.ts
|
|
31417
|
-
import { readFileSync as readFileSync45, realpathSync as
|
|
31530
|
+
import { readFileSync as readFileSync45, realpathSync as realpathSync6 } from "fs";
|
|
31418
31531
|
import { join as join65, sep as sep12 } from "path";
|
|
31419
31532
|
var NODE_MODULES_SEGMENT, verdicts, isWorkspacePackageSpecifier = (specifier, projectRoot = process.cwd()) => {
|
|
31420
31533
|
const key = `${projectRoot}\x00${specifier}`;
|
|
@@ -31423,7 +31536,7 @@ var NODE_MODULES_SEGMENT, verdicts, isWorkspacePackageSpecifier = (specifier, pr
|
|
|
31423
31536
|
return known;
|
|
31424
31537
|
let verdict = false;
|
|
31425
31538
|
try {
|
|
31426
|
-
const resolved =
|
|
31539
|
+
const resolved = realpathSync6(Bun.resolveSync(specifier, projectRoot));
|
|
31427
31540
|
verdict = !resolved.includes(NODE_MODULES_SEGMENT);
|
|
31428
31541
|
} catch {
|
|
31429
31542
|
verdict = false;
|
|
@@ -31448,7 +31561,7 @@ var NODE_MODULES_SEGMENT, verdicts, isWorkspacePackageSpecifier = (specifier, pr
|
|
|
31448
31561
|
const dirs = new Set;
|
|
31449
31562
|
for (const name of names) {
|
|
31450
31563
|
try {
|
|
31451
|
-
const linked =
|
|
31564
|
+
const linked = realpathSync6(join65(projectRoot, "node_modules", name));
|
|
31452
31565
|
if (!`${linked}${sep12}`.includes(NODE_MODULES_SEGMENT))
|
|
31453
31566
|
dirs.add(linked);
|
|
31454
31567
|
} catch {}
|
|
@@ -31564,9 +31677,9 @@ var stripStringsAndComments = (source) => {
|
|
|
31564
31677
|
};
|
|
31565
31678
|
|
|
31566
31679
|
// src/dev/dependencyGraph.ts
|
|
31567
|
-
import { existsSync as existsSync50, readFileSync as readFileSync46, realpathSync as
|
|
31680
|
+
import { existsSync as existsSync50, readFileSync as readFileSync46, realpathSync as realpathSync7 } from "fs";
|
|
31568
31681
|
var {Glob: Glob11 } = globalThis.Bun;
|
|
31569
|
-
import { resolve as
|
|
31682
|
+
import { resolve as resolve48 } from "path";
|
|
31570
31683
|
var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath) => {
|
|
31571
31684
|
const lower = filePath.toLowerCase();
|
|
31572
31685
|
if (lower.endsWith(".ts") || lower.endsWith(".tsx") || lower.endsWith(".jsx"))
|
|
@@ -31577,17 +31690,17 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
31577
31690
|
return "html";
|
|
31578
31691
|
return null;
|
|
31579
31692
|
}, resolveImportPath2 = (importPath, fromFile) => {
|
|
31580
|
-
const fromDir =
|
|
31693
|
+
const fromDir = resolve48(fromFile, "..");
|
|
31581
31694
|
if (!importPath.startsWith(".") && !importPath.startsWith("/")) {
|
|
31582
31695
|
if (!isWorkspacePackageSpecifier(importPath, fromDir))
|
|
31583
31696
|
return null;
|
|
31584
31697
|
try {
|
|
31585
|
-
return
|
|
31698
|
+
return realpathSync7(Bun.resolveSync(importPath, fromDir));
|
|
31586
31699
|
} catch {
|
|
31587
31700
|
return null;
|
|
31588
31701
|
}
|
|
31589
31702
|
}
|
|
31590
|
-
const normalized =
|
|
31703
|
+
const normalized = resolve48(fromDir, importPath);
|
|
31591
31704
|
const extensions = [
|
|
31592
31705
|
".ts",
|
|
31593
31706
|
".tsx",
|
|
@@ -31617,7 +31730,7 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
31617
31730
|
dependents.delete(normalizedPath);
|
|
31618
31731
|
}
|
|
31619
31732
|
}, addFileToGraph = (graph, filePath) => {
|
|
31620
|
-
const normalizedPath =
|
|
31733
|
+
const normalizedPath = resolve48(filePath);
|
|
31621
31734
|
if (!existsSync50(normalizedPath))
|
|
31622
31735
|
return;
|
|
31623
31736
|
const dependencies = extractDependencies(normalizedPath);
|
|
@@ -31644,10 +31757,10 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
31644
31757
|
}, IGNORED_SEGMENTS, buildInitialDependencyGraph = (graph, directories) => {
|
|
31645
31758
|
const processedFiles = new Set;
|
|
31646
31759
|
const glob = new Glob11("**/*.{ts,tsx,js,jsx,vue,svelte,html,htm}");
|
|
31647
|
-
const resolvedDirs = directories.map((dir) =>
|
|
31760
|
+
const resolvedDirs = directories.map((dir) => resolve48(dir)).filter((dir) => existsSync50(dir));
|
|
31648
31761
|
const allFiles = resolvedDirs.flatMap((dir) => Array.from(glob.scanSync({ absolute: true, cwd: dir })));
|
|
31649
31762
|
for (const file of allFiles) {
|
|
31650
|
-
const fullPath =
|
|
31763
|
+
const fullPath = resolve48(file);
|
|
31651
31764
|
if (IGNORED_SEGMENTS.some((seg) => fullPath.includes(seg)))
|
|
31652
31765
|
continue;
|
|
31653
31766
|
if (processedFiles.has(fullPath))
|
|
@@ -31760,7 +31873,7 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
31760
31873
|
return [];
|
|
31761
31874
|
}
|
|
31762
31875
|
}, getAffectedFiles = (graph, changedFile) => {
|
|
31763
|
-
const normalizedPath =
|
|
31876
|
+
const normalizedPath = resolve48(changedFile);
|
|
31764
31877
|
const affected = new Set;
|
|
31765
31878
|
const toProcess = [normalizedPath];
|
|
31766
31879
|
const processNode = (current) => {
|
|
@@ -31791,7 +31904,7 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
31791
31904
|
}, removeDependentsForFile = (graph, normalizedPath) => {
|
|
31792
31905
|
graph.dependents.delete(normalizedPath);
|
|
31793
31906
|
}, removeFileFromGraph = (graph, filePath) => {
|
|
31794
|
-
const normalizedPath =
|
|
31907
|
+
const normalizedPath = resolve48(filePath);
|
|
31795
31908
|
removeDepsForFile(graph, normalizedPath);
|
|
31796
31909
|
removeDependentsForFile(graph, normalizedPath);
|
|
31797
31910
|
};
|
|
@@ -31835,12 +31948,12 @@ var globalVersionCounter = 0, createModuleVersionTracker = () => new Map, getNex
|
|
|
31835
31948
|
};
|
|
31836
31949
|
|
|
31837
31950
|
// src/dev/configResolver.ts
|
|
31838
|
-
import { resolve as
|
|
31951
|
+
import { resolve as resolve49 } from "path";
|
|
31839
31952
|
var resolveBuildPaths = (config) => {
|
|
31840
31953
|
const cwd = process.cwd();
|
|
31841
31954
|
const normalize = (path) => path.replace(/\\/g, "/");
|
|
31842
|
-
const withDefault = (value, fallback) => normalize(
|
|
31843
|
-
const optional = (value) => value ? normalize(
|
|
31955
|
+
const withDefault = (value, fallback) => normalize(resolve49(cwd, value ?? fallback));
|
|
31956
|
+
const optional = (value) => value ? normalize(resolve49(cwd, value)) : undefined;
|
|
31844
31957
|
return {
|
|
31845
31958
|
angularDir: optional(config.angularDirectory),
|
|
31846
31959
|
assetsDir: optional(config.assetsDirectory),
|
|
@@ -31900,7 +32013,7 @@ var init_clientManager = __esm(() => {
|
|
|
31900
32013
|
|
|
31901
32014
|
// src/dev/pathUtils.ts
|
|
31902
32015
|
import { existsSync as existsSync51, readdirSync as readdirSync8, readFileSync as readFileSync47 } from "fs";
|
|
31903
|
-
import { dirname as dirname36, resolve as
|
|
32016
|
+
import { dirname as dirname36, resolve as resolve50 } from "path";
|
|
31904
32017
|
var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
31905
32018
|
if (shouldIgnorePath(filePath, resolved)) {
|
|
31906
32019
|
return "ignored";
|
|
@@ -31981,7 +32094,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
31981
32094
|
return "unknown";
|
|
31982
32095
|
}, collectAngularResourceDirs = (angularDir) => {
|
|
31983
32096
|
const out = new Set;
|
|
31984
|
-
const angularRoot =
|
|
32097
|
+
const angularRoot = resolve50(angularDir);
|
|
31985
32098
|
const angularRootNormalized = normalizePath2(angularRoot);
|
|
31986
32099
|
const walk = (dir) => {
|
|
31987
32100
|
let entries;
|
|
@@ -31994,7 +32107,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
31994
32107
|
if (entry.name.startsWith(".") || entry.name === "node_modules") {
|
|
31995
32108
|
continue;
|
|
31996
32109
|
}
|
|
31997
|
-
const full =
|
|
32110
|
+
const full = resolve50(dir, entry.name);
|
|
31998
32111
|
if (entry.isDirectory()) {
|
|
31999
32112
|
walk(full);
|
|
32000
32113
|
continue;
|
|
@@ -32035,7 +32148,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
32035
32148
|
}
|
|
32036
32149
|
const componentDir = dirname36(full);
|
|
32037
32150
|
for (const ref of refs) {
|
|
32038
|
-
const refAbs = normalizePath2(
|
|
32151
|
+
const refAbs = normalizePath2(resolve50(componentDir, ref));
|
|
32039
32152
|
const refDir = normalizePath2(dirname36(refAbs));
|
|
32040
32153
|
if (refDir === angularRootNormalized || refDir.startsWith(`${angularRootNormalized}/`)) {
|
|
32041
32154
|
continue;
|
|
@@ -32052,7 +32165,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
32052
32165
|
const push = (path) => {
|
|
32053
32166
|
if (!path)
|
|
32054
32167
|
return;
|
|
32055
|
-
const abs = normalizePath2(
|
|
32168
|
+
const abs = normalizePath2(resolve50(cwd, path));
|
|
32056
32169
|
if (!roots.includes(abs))
|
|
32057
32170
|
roots.push(abs);
|
|
32058
32171
|
};
|
|
@@ -32077,7 +32190,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
32077
32190
|
push(cfg.assetsDir);
|
|
32078
32191
|
push(cfg.stylesDir);
|
|
32079
32192
|
for (const candidate of ["src", "db", "assets", "styles"]) {
|
|
32080
|
-
const abs = normalizePath2(
|
|
32193
|
+
const abs = normalizePath2(resolve50(cwd, candidate));
|
|
32081
32194
|
if (existsSync51(abs) && !roots.includes(abs))
|
|
32082
32195
|
roots.push(abs);
|
|
32083
32196
|
}
|
|
@@ -32089,7 +32202,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
32089
32202
|
continue;
|
|
32090
32203
|
if (entry.name.startsWith("."))
|
|
32091
32204
|
continue;
|
|
32092
|
-
const abs = normalizePath2(
|
|
32205
|
+
const abs = normalizePath2(resolve50(cwd, entry.name));
|
|
32093
32206
|
if (roots.includes(abs))
|
|
32094
32207
|
continue;
|
|
32095
32208
|
if (shouldIgnorePath(abs, resolved))
|
|
@@ -32100,7 +32213,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
32100
32213
|
}
|
|
32101
32214
|
const registryPath = config.islands?.registry;
|
|
32102
32215
|
if (registryPath) {
|
|
32103
|
-
const registryDir = normalizePath2(dirname36(
|
|
32216
|
+
const registryDir = normalizePath2(dirname36(resolve50(cwd, registryPath)));
|
|
32104
32217
|
const isWatched = roots.some((root) => registryDir === root || registryDir.startsWith(`${root}/`));
|
|
32105
32218
|
if (!isWatched && registryDir !== normalizePath2(cwd))
|
|
32106
32219
|
push(registryDir);
|
|
@@ -32284,7 +32397,7 @@ var init_editorTempFiles = __esm(() => {
|
|
|
32284
32397
|
// src/dev/fileWatcher.ts
|
|
32285
32398
|
import { watch } from "fs";
|
|
32286
32399
|
import { existsSync as existsSync53, readdirSync as readdirSync10, statSync as statSync8 } from "fs";
|
|
32287
|
-
import { dirname as dirname37, join as join67, resolve as
|
|
32400
|
+
import { dirname as dirname37, join as join67, resolve as resolve51 } from "path";
|
|
32288
32401
|
var safeRemoveFromGraph = (graph, fullPath) => {
|
|
32289
32402
|
try {
|
|
32290
32403
|
removeFileFromGraph(graph, fullPath);
|
|
@@ -32366,7 +32479,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
32366
32479
|
}, addFileWatchers = (state, paths, onFileChange) => {
|
|
32367
32480
|
const stylesDir = state.resolvedPaths?.stylesDir;
|
|
32368
32481
|
paths.forEach((path) => {
|
|
32369
|
-
const absolutePath =
|
|
32482
|
+
const absolutePath = resolve51(path).replace(/\\/g, "/");
|
|
32370
32483
|
if (!existsSync53(absolutePath)) {
|
|
32371
32484
|
return;
|
|
32372
32485
|
}
|
|
@@ -32435,7 +32548,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
32435
32548
|
const watchPaths = getWatchPaths(config, state.resolvedPaths);
|
|
32436
32549
|
const stylesDir = state.resolvedPaths?.stylesDir;
|
|
32437
32550
|
watchPaths.forEach((path) => {
|
|
32438
|
-
const absolutePath =
|
|
32551
|
+
const absolutePath = resolve51(path).replace(/\\/g, "/");
|
|
32439
32552
|
if (!existsSync53(absolutePath)) {
|
|
32440
32553
|
return;
|
|
32441
32554
|
}
|
|
@@ -32454,7 +32567,7 @@ var init_fileWatcher = __esm(() => {
|
|
|
32454
32567
|
// src/build/svelteDeclarations.ts
|
|
32455
32568
|
import { existsSync as existsSync54, readdirSync as readdirSync11, readFileSync as readFileSync48, statSync as statSync9 } from "fs";
|
|
32456
32569
|
import { mkdir as mkdir15, rename as rename5, rm as rm16, writeFile as writeFile14 } from "fs/promises";
|
|
32457
|
-
import { dirname as dirname38, join as join68, relative as relative28, resolve as
|
|
32570
|
+
import { dirname as dirname38, join as join68, relative as relative28, resolve as resolve52 } from "path";
|
|
32458
32571
|
var SVELTE_DECLARATIONS_ROOT = ".absolutejs/types/svelte", FINGERPRINT_FILE = ".fingerprint", SKIPPED_DIRECTORIES, EMIT_SCRIPT = `
|
|
32459
32572
|
const { resolve, sep } = require('node:path');
|
|
32460
32573
|
const { shimsPath, stagingDir, svelte2tsxPath, svelteDir, tsconfigPath, typescriptPath } =
|
|
@@ -32527,7 +32640,7 @@ emitDts({
|
|
|
32527
32640
|
projectRoot,
|
|
32528
32641
|
svelteDirectory
|
|
32529
32642
|
}) => {
|
|
32530
|
-
const svelteDir =
|
|
32643
|
+
const svelteDir = resolve52(projectRoot, svelteDirectory);
|
|
32531
32644
|
const tsconfigPath = join68(projectRoot, "tsconfig.json");
|
|
32532
32645
|
if (!existsSync54(svelteDir))
|
|
32533
32646
|
return {
|
|
@@ -32583,13 +32696,13 @@ var init_svelteDeclarations = __esm(() => {
|
|
|
32583
32696
|
});
|
|
32584
32697
|
|
|
32585
32698
|
// src/dev/svelteDeclarationRefresher.ts
|
|
32586
|
-
import { resolve as
|
|
32699
|
+
import { resolve as resolve53, sep as sep13 } from "path";
|
|
32587
32700
|
var REFRESH_DEBOUNCE_MS = 400, createSvelteDeclarationRefresher = (config) => {
|
|
32588
32701
|
const { svelteDirectory } = config;
|
|
32589
32702
|
if (!svelteDirectory)
|
|
32590
32703
|
return null;
|
|
32591
32704
|
const projectRoot = process.cwd();
|
|
32592
|
-
const svelteRoot =
|
|
32705
|
+
const svelteRoot = resolve53(projectRoot, svelteDirectory) + sep13;
|
|
32593
32706
|
let timer;
|
|
32594
32707
|
let running = false;
|
|
32595
32708
|
let pending = false;
|
|
@@ -32620,7 +32733,7 @@ var REFRESH_DEBOUNCE_MS = 400, createSvelteDeclarationRefresher = (config) => {
|
|
|
32620
32733
|
return {
|
|
32621
32734
|
refresh: schedule,
|
|
32622
32735
|
onFileChange: (filePath) => {
|
|
32623
|
-
if (
|
|
32736
|
+
if (resolve53(filePath).startsWith(svelteRoot))
|
|
32624
32737
|
schedule();
|
|
32625
32738
|
}
|
|
32626
32739
|
};
|
|
@@ -32671,13 +32784,13 @@ var init_fileRouteRefresher = __esm(() => {
|
|
|
32671
32784
|
});
|
|
32672
32785
|
|
|
32673
32786
|
// src/dev/assetStore.ts
|
|
32674
|
-
import { resolve as
|
|
32787
|
+
import { resolve as resolve54 } from "path";
|
|
32675
32788
|
import { readdir as readdir5, unlink } from "fs/promises";
|
|
32676
32789
|
var mimeTypes, getMimeType = (filePath) => {
|
|
32677
32790
|
const ext = filePath.slice(filePath.lastIndexOf("."));
|
|
32678
32791
|
return mimeTypes[ext] ?? "application/octet-stream";
|
|
32679
32792
|
}, HASHED_FILE_RE, stripHash = (webPath) => webPath.replace(/\.[a-z0-9]{8}(\.(js|css|mjs))$/, "$1"), processWalkEntry = (entry, dir, liveByIdentity, walkAndClean) => {
|
|
32680
|
-
const fullPath =
|
|
32793
|
+
const fullPath = resolve54(dir, entry.name);
|
|
32681
32794
|
if (entry.isDirectory()) {
|
|
32682
32795
|
return walkAndClean(fullPath);
|
|
32683
32796
|
}
|
|
@@ -32693,10 +32806,10 @@ var mimeTypes, getMimeType = (filePath) => {
|
|
|
32693
32806
|
}, cleanStaleAssets = async (store, manifest, buildDir) => {
|
|
32694
32807
|
const liveByIdentity = new Map;
|
|
32695
32808
|
for (const webPath of store.keys()) {
|
|
32696
|
-
const diskPath =
|
|
32809
|
+
const diskPath = resolve54(buildDir, webPath.slice(1));
|
|
32697
32810
|
liveByIdentity.set(stripHash(diskPath), diskPath);
|
|
32698
32811
|
}
|
|
32699
|
-
const absBuildDir =
|
|
32812
|
+
const absBuildDir = resolve54(buildDir);
|
|
32700
32813
|
Object.values(manifest).forEach((val) => {
|
|
32701
32814
|
if (!HASHED_FILE_RE.test(val))
|
|
32702
32815
|
return;
|
|
@@ -32716,13 +32829,13 @@ var mimeTypes, getMimeType = (filePath) => {
|
|
|
32716
32829
|
}, evictMissingChunks = async (store, buildDir) => {
|
|
32717
32830
|
const chunkKeys = [...store.keys()].filter((webPath) => webPath.includes("/chunk-"));
|
|
32718
32831
|
await Promise.all(chunkKeys.map(async (webPath) => {
|
|
32719
|
-
const onDisk = await Bun.file(
|
|
32832
|
+
const onDisk = await Bun.file(resolve54(buildDir, webPath.slice(1))).exists().catch(() => false);
|
|
32720
32833
|
if (!onDisk)
|
|
32721
32834
|
store.delete(webPath);
|
|
32722
32835
|
}));
|
|
32723
32836
|
}, lookupAsset = (store, path) => store.get(path), processScanEntry = (entry, dir, prefix, store, scanDir) => {
|
|
32724
32837
|
if (entry.isDirectory()) {
|
|
32725
|
-
return scanDir(
|
|
32838
|
+
return scanDir(resolve54(dir, entry.name), `${prefix}${entry.name}/`);
|
|
32726
32839
|
}
|
|
32727
32840
|
if (!entry.name.startsWith("chunk-")) {
|
|
32728
32841
|
return null;
|
|
@@ -32731,7 +32844,7 @@ var mimeTypes, getMimeType = (filePath) => {
|
|
|
32731
32844
|
if (store.has(webPath)) {
|
|
32732
32845
|
return null;
|
|
32733
32846
|
}
|
|
32734
|
-
return Bun.file(
|
|
32847
|
+
return Bun.file(resolve54(dir, entry.name)).bytes().then((bytes) => {
|
|
32735
32848
|
store.set(webPath, bytes);
|
|
32736
32849
|
return;
|
|
32737
32850
|
}).catch(() => {});
|
|
@@ -32753,7 +32866,7 @@ var mimeTypes, getMimeType = (filePath) => {
|
|
|
32753
32866
|
for (const webPath of newIdentities.values()) {
|
|
32754
32867
|
if (store.has(webPath))
|
|
32755
32868
|
continue;
|
|
32756
|
-
loadPromises.push(Bun.file(
|
|
32869
|
+
loadPromises.push(Bun.file(resolve54(buildDir, webPath.slice(1))).bytes().then((bytes) => {
|
|
32757
32870
|
store.set(webPath, bytes);
|
|
32758
32871
|
return;
|
|
32759
32872
|
}).catch(() => {}));
|
|
@@ -32799,10 +32912,10 @@ var init_assetStore = __esm(() => {
|
|
|
32799
32912
|
});
|
|
32800
32913
|
|
|
32801
32914
|
// src/dev/restartScope.ts
|
|
32802
|
-
import { realpathSync as
|
|
32915
|
+
import { realpathSync as realpathSync8, statSync as statSync10 } from "fs";
|
|
32803
32916
|
var MODULE_FILE, DOCUMENT_FILE, realPath = (path) => {
|
|
32804
32917
|
try {
|
|
32805
|
-
return
|
|
32918
|
+
return realpathSync8(path);
|
|
32806
32919
|
} catch {
|
|
32807
32920
|
return path;
|
|
32808
32921
|
}
|
|
@@ -32916,9 +33029,9 @@ var init_transformCache = __esm(() => {
|
|
|
32916
33029
|
});
|
|
32917
33030
|
|
|
32918
33031
|
// src/dev/reactComponentClassifier.ts
|
|
32919
|
-
import { resolve as
|
|
33032
|
+
import { resolve as resolve55 } from "path";
|
|
32920
33033
|
var classifyComponent = (filePath) => {
|
|
32921
|
-
const normalizedPath =
|
|
33034
|
+
const normalizedPath = resolve55(filePath);
|
|
32922
33035
|
if (normalizedPath.includes("/react/pages/")) {
|
|
32923
33036
|
return "server";
|
|
32924
33037
|
}
|
|
@@ -32930,7 +33043,7 @@ var classifyComponent = (filePath) => {
|
|
|
32930
33043
|
var init_reactComponentClassifier = () => {};
|
|
32931
33044
|
|
|
32932
33045
|
// src/dev/moduleMapper.ts
|
|
32933
|
-
import { basename as
|
|
33046
|
+
import { basename as basename21, resolve as resolve56 } from "path";
|
|
32934
33047
|
var buildModulePaths = (moduleKeys, manifest) => {
|
|
32935
33048
|
const modulePaths = {};
|
|
32936
33049
|
moduleKeys.forEach((key) => {
|
|
@@ -32940,7 +33053,7 @@ var buildModulePaths = (moduleKeys, manifest) => {
|
|
|
32940
33053
|
});
|
|
32941
33054
|
return modulePaths;
|
|
32942
33055
|
}, processChangedFile = (sourceFile, framework, manifest, resolvedPaths, processedFiles) => {
|
|
32943
|
-
const normalizedFile =
|
|
33056
|
+
const normalizedFile = resolve56(sourceFile);
|
|
32944
33057
|
const normalizedPath = normalizedFile.replace(/\\/g, "/");
|
|
32945
33058
|
if (processedFiles.has(normalizedFile)) {
|
|
32946
33059
|
return null;
|
|
@@ -32976,8 +33089,8 @@ var buildModulePaths = (moduleKeys, manifest) => {
|
|
|
32976
33089
|
});
|
|
32977
33090
|
return grouped;
|
|
32978
33091
|
}, mapSourceFileToManifestKeys = (sourceFile, framework, resolvedPaths) => {
|
|
32979
|
-
const normalizedFile =
|
|
32980
|
-
const fileName =
|
|
33092
|
+
const normalizedFile = resolve56(sourceFile);
|
|
33093
|
+
const fileName = basename21(normalizedFile);
|
|
32981
33094
|
const baseName = fileName.replace(/\.(tsx?|jsx?|vue|svelte|css|html)$/, "");
|
|
32982
33095
|
const pascalName = toPascal(baseName);
|
|
32983
33096
|
const keys = [];
|
|
@@ -33031,7 +33144,7 @@ var init_moduleMapper = __esm(() => {
|
|
|
33031
33144
|
});
|
|
33032
33145
|
|
|
33033
33146
|
// src/dev/reactServerComponentsRebuild.ts
|
|
33034
|
-
import { relative as relative29, resolve as
|
|
33147
|
+
import { relative as relative29, resolve as resolve57 } from "path";
|
|
33035
33148
|
var toError = (error) => error instanceof Error ? error : new Error(String(error)), runPass = async (state, directory) => {
|
|
33036
33149
|
const { buildDir } = state.resolvedPaths;
|
|
33037
33150
|
const result = await buildReactServerComponentsPass({
|
|
@@ -33053,8 +33166,8 @@ var toError = (error) => error instanceof Error ? error : new Error(String(error
|
|
|
33053
33166
|
const directory = config.reactServerComponentsDirectory;
|
|
33054
33167
|
if (!directory)
|
|
33055
33168
|
return false;
|
|
33056
|
-
const absolutePath = normalizePath2(
|
|
33057
|
-
if (!absolutePath.startsWith(`${normalizePath2(
|
|
33169
|
+
const absolutePath = normalizePath2(resolve57(filePath));
|
|
33170
|
+
if (!absolutePath.startsWith(`${normalizePath2(resolve57(directory))}/`))
|
|
33058
33171
|
return false;
|
|
33059
33172
|
state.fileHashes.set(absolutePath, currentHash);
|
|
33060
33173
|
const startedAt = performance.now();
|
|
@@ -33074,7 +33187,7 @@ var init_reactServerComponentsRebuild = __esm(() => {
|
|
|
33074
33187
|
|
|
33075
33188
|
// src/utils/spaRouteCss.ts
|
|
33076
33189
|
import { readFile as readFile10 } from "fs/promises";
|
|
33077
|
-
import { dirname as dirname39, isAbsolute as isAbsolute12, resolve as
|
|
33190
|
+
import { dirname as dirname39, isAbsolute as isAbsolute12, resolve as resolve58 } from "path";
|
|
33078
33191
|
var sideManifestCache, readSideManifest = async (sideManifestPath) => {
|
|
33079
33192
|
const cached = sideManifestCache.get(sideManifestPath);
|
|
33080
33193
|
if (cached !== undefined)
|
|
@@ -33112,7 +33225,7 @@ var sideManifestCache, readSideManifest = async (sideManifestPath) => {
|
|
|
33112
33225
|
}, readChildCss = async (cssPath, sideManifestPath) => {
|
|
33113
33226
|
if (!cssPath)
|
|
33114
33227
|
return "";
|
|
33115
|
-
const resolvedCssPath = isAbsolute12(cssPath) ? cssPath :
|
|
33228
|
+
const resolvedCssPath = isAbsolute12(cssPath) ? cssPath : resolve58(dirname39(sideManifestPath), cssPath);
|
|
33116
33229
|
const cached = childCssCache.get(resolvedCssPath);
|
|
33117
33230
|
if (cached !== undefined)
|
|
33118
33231
|
return cached;
|
|
@@ -33197,7 +33310,7 @@ __export(exports_resolveOwningComponents, {
|
|
|
33197
33310
|
resolveOwningComponents: () => resolveOwningComponents
|
|
33198
33311
|
});
|
|
33199
33312
|
import { readdirSync as readdirSync12, readFileSync as readFileSync50, statSync as statSync12 } from "fs";
|
|
33200
|
-
import { dirname as dirname40, extname as extname19, join as join69, resolve as
|
|
33313
|
+
import { dirname as dirname40, extname as extname19, join as join69, resolve as resolve59 } from "path";
|
|
33201
33314
|
var ENTITY_DECORATORS, isAngularSourceFile = (file) => file.endsWith(".ts") || file.endsWith(".tsx"), walkAngularSourceFiles = (root) => {
|
|
33202
33315
|
const out = [];
|
|
33203
33316
|
const visit = (dir) => {
|
|
@@ -33309,7 +33422,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file) => file.endsWith(".ts") || f
|
|
|
33309
33422
|
};
|
|
33310
33423
|
visit(sourceFile);
|
|
33311
33424
|
return out;
|
|
33312
|
-
}, safeNormalize = (path) =>
|
|
33425
|
+
}, safeNormalize = (path) => resolve59(path).replace(/\\/g, "/"), resolveOwningComponents = (params) => {
|
|
33313
33426
|
const { changedFilePath, userAngularRoot } = params;
|
|
33314
33427
|
const changedAbs = safeNormalize(changedFilePath);
|
|
33315
33428
|
const out = [];
|
|
@@ -33378,7 +33491,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file) => file.endsWith(".ts") || f
|
|
|
33378
33491
|
if (!spec.startsWith(".") && !spec.startsWith("/")) {
|
|
33379
33492
|
return null;
|
|
33380
33493
|
}
|
|
33381
|
-
const base =
|
|
33494
|
+
const base = resolve59(childDir, spec);
|
|
33382
33495
|
const candidates = [
|
|
33383
33496
|
`${base}.ts`,
|
|
33384
33497
|
`${base}.tsx`,
|
|
@@ -33416,7 +33529,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file) => file.endsWith(".ts") || f
|
|
|
33416
33529
|
};
|
|
33417
33530
|
if (cls.kind === "component") {
|
|
33418
33531
|
for (const url of [...cls.templateUrls, ...cls.styleUrls]) {
|
|
33419
|
-
const abs = safeNormalize(
|
|
33532
|
+
const abs = safeNormalize(resolve59(componentDir, url));
|
|
33420
33533
|
const existing = resource.get(abs);
|
|
33421
33534
|
if (existing)
|
|
33422
33535
|
existing.push(entity);
|
|
@@ -33679,8 +33792,8 @@ __export(exports_moduleServer, {
|
|
|
33679
33792
|
warmPage: () => warmPage,
|
|
33680
33793
|
warnIfReactFastRefreshUnsupported: () => warnIfReactFastRefreshUnsupported
|
|
33681
33794
|
});
|
|
33682
|
-
import { existsSync as existsSync55, readFileSync as readFileSync51, realpathSync as
|
|
33683
|
-
import { basename as
|
|
33795
|
+
import { existsSync as existsSync55, readFileSync as readFileSync51, realpathSync as realpathSync9, statSync as statSync13 } from "fs";
|
|
33796
|
+
import { basename as basename22, dirname as dirname41, extname as extname20, join as join70, resolve as resolve60, relative as relative30 } from "path";
|
|
33684
33797
|
var SRC_PREFIX = "/@src/", BROWSER_DEFINE, jsTranspiler2, legacyDecoratorTsconfig, tsTranspiler2, tsxTranspiler, TRANSPILABLE, ALL_EXPORTS_RE, STRING_CONTENTS_RE, preserveTypeExports = (originalSource, transpiled, valueExports) => {
|
|
33685
33798
|
const codeOnly = originalSource.replace(STRING_CONTENTS_RE, '""');
|
|
33686
33799
|
const allExports = [];
|
|
@@ -33700,10 +33813,10 @@ var SRC_PREFIX = "/@src/", BROWSER_DEFINE, jsTranspiler2, legacyDecoratorTsconfi
|
|
|
33700
33813
|
${stubs}
|
|
33701
33814
|
`;
|
|
33702
33815
|
}, resolveRelativeExtension = (srcPath, projectRoot, extensions) => {
|
|
33703
|
-
const directHit = extensions.find((ext) => existsSync55(
|
|
33816
|
+
const directHit = extensions.find((ext) => existsSync55(resolve60(projectRoot, srcPath + ext)));
|
|
33704
33817
|
if (directHit)
|
|
33705
33818
|
return srcPath + directHit;
|
|
33706
|
-
const indexHit = extensions.find((ext) => existsSync55(
|
|
33819
|
+
const indexHit = extensions.find((ext) => existsSync55(resolve60(projectRoot, srcPath, `index${ext}`)));
|
|
33707
33820
|
if (indexHit)
|
|
33708
33821
|
return `${srcPath}/index${indexHit}`;
|
|
33709
33822
|
return srcPath;
|
|
@@ -33732,7 +33845,7 @@ ${stubs}
|
|
|
33732
33845
|
return invalidationVersion > 0 ? `${mtime}.${invalidationVersion}` : `${mtime}`;
|
|
33733
33846
|
}, srcUrl = (relPath, projectRoot) => {
|
|
33734
33847
|
const base = `${SRC_PREFIX}${encodeSrcPath(relPath)}`;
|
|
33735
|
-
const absPath =
|
|
33848
|
+
const absPath = resolve60(projectRoot, relPath);
|
|
33736
33849
|
const cached = mtimeCache.get(absPath);
|
|
33737
33850
|
if (cached !== undefined)
|
|
33738
33851
|
return `${base}?v=${buildVersion(cached, absPath)}`;
|
|
@@ -33744,12 +33857,12 @@ ${stubs}
|
|
|
33744
33857
|
return base;
|
|
33745
33858
|
}
|
|
33746
33859
|
}, resolveRelativeImport = (relPath, fileDir, projectRoot, extensions) => {
|
|
33747
|
-
const absPath =
|
|
33860
|
+
const absPath = resolve60(fileDir, relPath);
|
|
33748
33861
|
const rel = relative30(projectRoot, absPath);
|
|
33749
33862
|
const extension = extname20(rel);
|
|
33750
33863
|
let srcPath = RESOLVED_MODULE_EXTENSIONS.has(extension) ? rel : resolveRelativeExtension(rel, projectRoot, extensions);
|
|
33751
33864
|
if (extname20(srcPath) === ".svelte") {
|
|
33752
|
-
srcPath = relative30(projectRoot, resolveSvelteModulePath(
|
|
33865
|
+
srcPath = relative30(projectRoot, resolveSvelteModulePath(resolve60(projectRoot, srcPath)));
|
|
33753
33866
|
}
|
|
33754
33867
|
return srcUrl(srcPath, projectRoot);
|
|
33755
33868
|
}, NODE_BUILTIN_RE, resolveAbsoluteSpecifier = (specifier, projectRoot) => {
|
|
@@ -33768,13 +33881,13 @@ ${stubs}
|
|
|
33768
33881
|
const packageName = isScoped ? `${parts[0]}/${parts[1]}` : parts[0];
|
|
33769
33882
|
const subpath = isScoped ? parts.slice(2).join("/") : parts.slice(1).join("/");
|
|
33770
33883
|
if (!subpath) {
|
|
33771
|
-
const pkgDir =
|
|
33884
|
+
const pkgDir = resolve60(projectRoot, "node_modules", packageName ?? "");
|
|
33772
33885
|
const pkgJsonPath = join70(pkgDir, "package.json");
|
|
33773
33886
|
if (existsSync55(pkgJsonPath)) {
|
|
33774
33887
|
const pkg = JSON.parse(readFileSync51(pkgJsonPath, "utf-8"));
|
|
33775
33888
|
const esmEntry = typeof pkg.module === "string" && pkg.module || typeof pkg.browser === "string" && pkg.browser;
|
|
33776
33889
|
if (esmEntry) {
|
|
33777
|
-
const resolved =
|
|
33890
|
+
const resolved = resolve60(pkgDir, esmEntry);
|
|
33778
33891
|
if (existsSync55(resolved))
|
|
33779
33892
|
return relative30(projectRoot, resolved);
|
|
33780
33893
|
}
|
|
@@ -33831,12 +33944,12 @@ ${stubs}
|
|
|
33831
33944
|
result = result.replace(/((?:from|import)\s*["'])(\/[^"']+\.(tsx?|jsx?|ts))(["'])/g, rewriteAbsoluteToSrc);
|
|
33832
33945
|
result = result.replace(/(import\s*\(\s*["'])(\/[^"']+\.(tsx?|jsx?|ts))(["']\s*\))/g, rewriteAbsoluteToSrc);
|
|
33833
33946
|
result = result.replace(/new\s+URL\(\s*["'](\.\.?\/[^"']+)["']\s*,\s*import\.meta\.url\s*\)/g, (_match, relPath) => {
|
|
33834
|
-
const absPath =
|
|
33947
|
+
const absPath = resolve60(fileDir, relPath);
|
|
33835
33948
|
const rel = relative30(projectRoot, absPath);
|
|
33836
33949
|
return `new URL('${srcUrl(rel, projectRoot)}', import.meta.url)`;
|
|
33837
33950
|
});
|
|
33838
33951
|
result = result.replace(/import\.meta\.resolve\(\s*["'](\.\.?\/[^"']+)["']\s*\)/g, (_match, relPath) => {
|
|
33839
|
-
const absPath =
|
|
33952
|
+
const absPath = resolve60(fileDir, relPath);
|
|
33840
33953
|
const rel = relative30(projectRoot, absPath);
|
|
33841
33954
|
return `'${srcUrl(rel, projectRoot)}'`;
|
|
33842
33955
|
});
|
|
@@ -34063,7 +34176,7 @@ ${code}`;
|
|
|
34063
34176
|
` + ` if (!window.__SVELTE_HMR_ACCEPT__) window.__SVELTE_HMR_ACCEPT__ = {};
|
|
34064
34177
|
` + ` var __hmr_accept = function(cb) { window.__SVELTE_HMR_ACCEPT__[${JSON.stringify(moduleUrl)}] = cb; };`);
|
|
34065
34178
|
return code.replace(/import\.meta\.hot\.accept\(/g, "__hmr_accept(");
|
|
34066
|
-
}, svelteLazyRegistrations = (raw, filePath, projectRoot) => Array.from(raw.matchAll(/\bimport\s*\(\s*['"](\.[^'"]+\.svelte)['"]\s*\)/g)).map((match) => match[1]).filter((spec) => spec !== undefined).filter((spec) => existsSync55(
|
|
34179
|
+
}, svelteLazyRegistrations = (raw, filePath, projectRoot) => Array.from(raw.matchAll(/\bimport\s*\(\s*['"](\.[^'"]+\.svelte)['"]\s*\)/g)).map((match) => match[1]).filter((spec) => spec !== undefined).filter((spec) => existsSync55(resolve60(dirname41(filePath), spec))).map((spec) => lazyModuleRegistration(relative30(projectRoot, resolve60(dirname41(filePath), spec)).replace(/\\/g, "/"), spec)).join(""), transformSvelteFile = async (filePath, projectRoot, rewriter, stylePreprocessors) => {
|
|
34067
34180
|
const raw = readFileSync51(filePath, "utf-8");
|
|
34068
34181
|
if (!svelteCompiler) {
|
|
34069
34182
|
svelteCompiler = await import("svelte/compiler");
|
|
@@ -34136,14 +34249,14 @@ ${code}`;
|
|
|
34136
34249
|
if (!vueCompiler) {
|
|
34137
34250
|
vueCompiler = await loadVueCompiler();
|
|
34138
34251
|
}
|
|
34139
|
-
const fileName =
|
|
34252
|
+
const fileName = basename22(filePath, ".vue");
|
|
34140
34253
|
const componentId = toKebab(fileName);
|
|
34141
34254
|
const { descriptor } = vueCompiler.parse(raw, { filename: filePath });
|
|
34142
34255
|
const hasScript = descriptor.script || descriptor.scriptSetup;
|
|
34143
34256
|
const compiledScript = hasScript ? vueCompiler.compileScript(descriptor, {
|
|
34144
34257
|
fs: {
|
|
34145
34258
|
fileExists: isFile,
|
|
34146
|
-
realpath:
|
|
34259
|
+
realpath: realpathSync9,
|
|
34147
34260
|
readFile: (file) => isFile(file) ? readFileSync51(file, "utf-8") : undefined
|
|
34148
34261
|
},
|
|
34149
34262
|
id: componentId,
|
|
@@ -34159,7 +34272,7 @@ ${code}`;
|
|
|
34159
34272
|
code = injectVueHmr(code, filePath, projectRoot, vueDir);
|
|
34160
34273
|
return rewriteImports(code, filePath, projectRoot, rewriter);
|
|
34161
34274
|
}, injectVueHmr = (code, filePath, projectRoot, vueDir) => {
|
|
34162
|
-
const hmrBase = vueDir ?
|
|
34275
|
+
const hmrBase = vueDir ? resolve60(vueDir) : projectRoot;
|
|
34163
34276
|
const hmrId = relative30(hmrBase, filePath).replace(/\\/g, "/").replace(/\.vue$/, "");
|
|
34164
34277
|
let result = code.replace(/export\s+default\s+/, "var __hmr_comp__ = ");
|
|
34165
34278
|
result += [
|
|
@@ -34308,7 +34421,7 @@ export default {};
|
|
|
34308
34421
|
const escaped = virtualCss.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$/g, "\\$");
|
|
34309
34422
|
return jsResponse(`var s=document.createElement('style');var __absNonce=(document.querySelector('script[nonce],style[nonce]')||{}).nonce;if(__absNonce)s.nonce=__absNonce;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);`);
|
|
34310
34423
|
}, resolveSourcePath2 = (relPath, projectRoot) => {
|
|
34311
|
-
const filePath =
|
|
34424
|
+
const filePath = resolve60(projectRoot, decodeSrcPath(relPath));
|
|
34312
34425
|
const ext = extname20(filePath);
|
|
34313
34426
|
if (ext === ".svelte")
|
|
34314
34427
|
return { ext, filePath: resolveSvelteModulePath(filePath) };
|
|
@@ -34345,14 +34458,14 @@ export default {};
|
|
|
34345
34458
|
const absoluteCandidate = `/${tail.replace(/^\/+/, "")}`;
|
|
34346
34459
|
const candidates = [
|
|
34347
34460
|
absoluteCandidate,
|
|
34348
|
-
|
|
34461
|
+
resolve60(projectRoot, tail)
|
|
34349
34462
|
];
|
|
34350
34463
|
try {
|
|
34351
34464
|
await Promise.resolve().then(() => init_loadConfig());
|
|
34352
34465
|
const cfg = await loadConfig();
|
|
34353
|
-
const angularDir = cfg.angularDirectory &&
|
|
34466
|
+
const angularDir = cfg.angularDirectory && resolve60(projectRoot, cfg.angularDirectory);
|
|
34354
34467
|
if (angularDir)
|
|
34355
|
-
candidates.push(
|
|
34468
|
+
candidates.push(resolve60(angularDir, tail));
|
|
34356
34469
|
} catch {}
|
|
34357
34470
|
for (const candidate of candidates) {
|
|
34358
34471
|
if (await fileExists(candidate)) {
|
|
@@ -34383,7 +34496,7 @@ export default {};
|
|
|
34383
34496
|
if (!TRANSPILABLE.has(ext))
|
|
34384
34497
|
return;
|
|
34385
34498
|
const stat = statSync13(filePath);
|
|
34386
|
-
const resolvedVueDir = vueDir ?
|
|
34499
|
+
const resolvedVueDir = vueDir ? resolve60(vueDir) : undefined;
|
|
34387
34500
|
let content = REACT_EXTENSIONS.has(ext) ? transformReactFile(filePath, projectRoot, rewriter) : transformPlainFile(filePath, projectRoot, rewriter, resolvedVueDir);
|
|
34388
34501
|
const isAngularGeneratedJs = ext === ".js" && filePath.replace(/\\/g, "/").includes("/.absolutejs/generated/angular/");
|
|
34389
34502
|
if (isAngularGeneratedJs) {
|
|
@@ -34439,7 +34552,7 @@ export default {};
|
|
|
34439
34552
|
const ownMessage = source && typeof source === "object" ? Reflect.get(source, "message") : undefined;
|
|
34440
34553
|
const message = typeof ownMessage === "string" ? ownMessage : String(source);
|
|
34441
34554
|
return { message, ...readPosition(first) };
|
|
34442
|
-
}, getTransformError = (filePath) => transformErrors.get(
|
|
34555
|
+
}, getTransformError = (filePath) => transformErrors.get(resolve60(filePath)), transformErrorResponse = (err) => {
|
|
34443
34556
|
const errMsg = err instanceof Error ? err.message : String(err);
|
|
34444
34557
|
return new Response(`console.error('[ModuleServer] Transform error:', ${JSON.stringify(errMsg)});`, {
|
|
34445
34558
|
headers: { "Content-Type": "application/javascript" },
|
|
@@ -34462,16 +34575,16 @@ export default {};
|
|
|
34462
34575
|
const relPath = pathname.slice(SRC_PREFIX.length);
|
|
34463
34576
|
if (relPath === "bun:wrap" || relPath.startsWith("bun:wrap?"))
|
|
34464
34577
|
return handleBunWrapRequest();
|
|
34465
|
-
const virtualCssResponse = handleVirtualSvelteCss(
|
|
34578
|
+
const virtualCssResponse = handleVirtualSvelteCss(resolve60(projectRoot, decodeSrcPath(relPath)));
|
|
34466
34579
|
if (virtualCssResponse)
|
|
34467
34580
|
return virtualCssResponse;
|
|
34468
34581
|
const { filePath, ext } = resolveSourcePath2(relPath, projectRoot);
|
|
34469
34582
|
try {
|
|
34470
34583
|
const response = await transformAndCache(filePath, ext, projectRoot, rewriter, frameworkDirs?.vue, stylePreprocessors);
|
|
34471
|
-
transformErrors.delete(
|
|
34584
|
+
transformErrors.delete(resolve60(filePath));
|
|
34472
34585
|
return response;
|
|
34473
34586
|
} catch (err) {
|
|
34474
|
-
transformErrors.set(
|
|
34587
|
+
transformErrors.set(resolve60(filePath), describeTransformError(err));
|
|
34475
34588
|
return transformErrorResponse(err);
|
|
34476
34589
|
}
|
|
34477
34590
|
};
|
|
@@ -34481,11 +34594,11 @@ export default {};
|
|
|
34481
34594
|
SRC_IMPORT_RE.lastIndex = 0;
|
|
34482
34595
|
while ((match = SRC_IMPORT_RE.exec(content)) !== null) {
|
|
34483
34596
|
if (match[1])
|
|
34484
|
-
files.push(
|
|
34597
|
+
files.push(resolve60(projectRoot, decodeSrcPath(match[1])));
|
|
34485
34598
|
}
|
|
34486
34599
|
return files;
|
|
34487
34600
|
}, SRC_URL_PREFIX2, invalidateModule = (filePath) => {
|
|
34488
|
-
const resolved =
|
|
34601
|
+
const resolved = resolve60(filePath);
|
|
34489
34602
|
transformErrors.delete(resolved);
|
|
34490
34603
|
invalidate(filePath);
|
|
34491
34604
|
if (resolved !== filePath)
|
|
@@ -34551,7 +34664,7 @@ export default {};
|
|
|
34551
34664
|
return false;
|
|
34552
34665
|
}
|
|
34553
34666
|
await Promise.resolve().then(() => init_prepare());
|
|
34554
|
-
patchManifestIndexes(cached.manifest,
|
|
34667
|
+
patchManifestIndexes(cached.manifest, resolve60(state.resolvedPaths.buildDir, "_src_indexes"), SRC_PREFIX);
|
|
34555
34668
|
logPageBuild(entry.source, entry.framework, Math.round(durationMs));
|
|
34556
34669
|
logStartupTimingBlock("AbsoluteJS on-demand page build", [
|
|
34557
34670
|
{ durationMs, label: entry.name }
|
|
@@ -34719,7 +34832,7 @@ var init_rewriteImports = __esm(() => {
|
|
|
34719
34832
|
});
|
|
34720
34833
|
|
|
34721
34834
|
// src/dev/angular/hmrCompiler.ts
|
|
34722
|
-
import { dirname as dirname42, relative as relative31, resolve as
|
|
34835
|
+
import { dirname as dirname42, relative as relative31, resolve as resolve61 } from "path";
|
|
34723
34836
|
import { performance as performance2 } from "perf_hooks";
|
|
34724
34837
|
var encodeHmrComponentId = (absoluteFilePath, className) => {
|
|
34725
34838
|
const projectRel = relative31(process.cwd(), absoluteFilePath).replace(/\\/g, "/");
|
|
@@ -34731,7 +34844,7 @@ var encodeHmrComponentId = (absoluteFilePath, className) => {
|
|
|
34731
34844
|
return null;
|
|
34732
34845
|
const filePathRel = decoded.slice(0, separatorIndex);
|
|
34733
34846
|
const className = decoded.slice(separatorIndex + 1);
|
|
34734
|
-
const componentFilePath =
|
|
34847
|
+
const componentFilePath = resolve61(process.cwd(), filePathRel);
|
|
34735
34848
|
const projectRelPath = relative31(process.cwd(), componentFilePath).replace(/\\/g, "/");
|
|
34736
34849
|
const cacheKey = encodeURIComponent(`${projectRelPath}@${className}`);
|
|
34737
34850
|
await Promise.resolve().then(() => init_fastHmrCompiler());
|
|
@@ -34822,11 +34935,11 @@ var exports_simpleHTMLHMR = {};
|
|
|
34822
34935
|
__export(exports_simpleHTMLHMR, {
|
|
34823
34936
|
handleHTMLUpdate: () => handleHTMLUpdate
|
|
34824
34937
|
});
|
|
34825
|
-
import { resolve as
|
|
34938
|
+
import { resolve as resolve62 } from "path";
|
|
34826
34939
|
var handleHTMLUpdate = async (htmlFilePath) => {
|
|
34827
34940
|
let htmlContent;
|
|
34828
34941
|
try {
|
|
34829
|
-
const resolvedPath =
|
|
34942
|
+
const resolvedPath = resolve62(htmlFilePath);
|
|
34830
34943
|
const file = Bun.file(resolvedPath);
|
|
34831
34944
|
if (!await file.exists()) {
|
|
34832
34945
|
return null;
|
|
@@ -34852,11 +34965,11 @@ var exports_simpleHTMXHMR = {};
|
|
|
34852
34965
|
__export(exports_simpleHTMXHMR, {
|
|
34853
34966
|
handleHTMXUpdate: () => handleHTMXUpdate
|
|
34854
34967
|
});
|
|
34855
|
-
import { resolve as
|
|
34968
|
+
import { resolve as resolve63 } from "path";
|
|
34856
34969
|
var handleHTMXUpdate = async (htmxFilePath) => {
|
|
34857
34970
|
let htmlContent;
|
|
34858
34971
|
try {
|
|
34859
|
-
const resolvedPath =
|
|
34972
|
+
const resolvedPath = resolve63(htmxFilePath);
|
|
34860
34973
|
const file = Bun.file(resolvedPath);
|
|
34861
34974
|
if (!await file.exists()) {
|
|
34862
34975
|
return null;
|
|
@@ -34878,8 +34991,8 @@ var handleHTMXUpdate = async (htmxFilePath) => {
|
|
|
34878
34991
|
var init_simpleHTMXHMR = () => {};
|
|
34879
34992
|
|
|
34880
34993
|
// src/dev/backendGraph.ts
|
|
34881
|
-
import { readFileSync as readFileSync52, realpathSync as
|
|
34882
|
-
import { dirname as dirname43, extname as extname21, resolve as
|
|
34994
|
+
import { readFileSync as readFileSync52, realpathSync as realpathSync10, statSync as statSync14 } from "fs";
|
|
34995
|
+
import { dirname as dirname43, extname as extname21, resolve as resolve64 } from "path";
|
|
34883
34996
|
var SOURCE_FILE, VENDORED, LOADERS, fileCache, transpilers, transpilerFor = (path) => {
|
|
34884
34997
|
const loader = LOADERS[extname21(path)] ?? "ts";
|
|
34885
34998
|
const existing = transpilers.get(loader);
|
|
@@ -34890,11 +35003,11 @@ var SOURCE_FILE, VENDORED, LOADERS, fileCache, transpilers, transpilerFor = (pat
|
|
|
34890
35003
|
return created;
|
|
34891
35004
|
}, realPath2 = (path) => {
|
|
34892
35005
|
try {
|
|
34893
|
-
return
|
|
35006
|
+
return realpathSync10(path);
|
|
34894
35007
|
} catch {
|
|
34895
35008
|
return path;
|
|
34896
35009
|
}
|
|
34897
|
-
}, isProjectModule = (path, root = process.cwd()) => SOURCE_FILE.test(path) && !VENDORED.test(path) &&
|
|
35010
|
+
}, isProjectModule = (path, root = process.cwd()) => SOURCE_FILE.test(path) && !VENDORED.test(path) && resolve64(path).startsWith(resolve64(root)), resolveImport = (specifier, fromFile) => {
|
|
34898
35011
|
try {
|
|
34899
35012
|
return realPath2(Bun.resolveSync(specifier, dirname43(fromFile)));
|
|
34900
35013
|
} catch {
|
|
@@ -34919,14 +35032,14 @@ var SOURCE_FILE, VENDORED, LOADERS, fileCache, transpilers, transpilerFor = (pat
|
|
|
34919
35032
|
fileCache.set(path, { imports, mtimeMs });
|
|
34920
35033
|
return imports;
|
|
34921
35034
|
}, importersOf = (target, entry, loaded = loadedProjectModules(entry)) => {
|
|
34922
|
-
const goal = realPath2(
|
|
35035
|
+
const goal = realPath2(resolve64(target));
|
|
34923
35036
|
const importers = [];
|
|
34924
35037
|
for (const file of loaded)
|
|
34925
35038
|
if (readImports(file).includes(goal))
|
|
34926
35039
|
importers.push(file);
|
|
34927
35040
|
return importers;
|
|
34928
35041
|
}, loadedProjectModules = (entry, loaded = Object.keys(__require.cache), root = process.cwd()) => {
|
|
34929
|
-
const entryPath = realPath2(
|
|
35042
|
+
const entryPath = realPath2(resolve64(entry));
|
|
34930
35043
|
const modules = new Set([entryPath]);
|
|
34931
35044
|
for (const path of loaded) {
|
|
34932
35045
|
if (isAbsoluteServerEntryCopyPath(path))
|
|
@@ -35793,11 +35906,11 @@ var init_runtime = __esm(() => {
|
|
|
35793
35906
|
});
|
|
35794
35907
|
|
|
35795
35908
|
// src/dev/hot/plugin.ts
|
|
35796
|
-
import { mkdirSync as mkdirSync19, readFileSync as readFileSync53, realpathSync as
|
|
35797
|
-
import { extname as extname23, join as join71, relative as relative32, resolve as
|
|
35909
|
+
import { mkdirSync as mkdirSync19, readFileSync as readFileSync53, realpathSync as realpathSync11, writeFileSync as writeFileSync17 } from "fs";
|
|
35910
|
+
import { extname as extname23, join as join71, relative as relative32, resolve as resolve65, sep as sep14 } from "path";
|
|
35798
35911
|
var SOURCE, TEST_FILE, GENERATED, ABSOLUTE_ROOT, realPath3 = (path) => {
|
|
35799
35912
|
try {
|
|
35800
|
-
return
|
|
35913
|
+
return realpathSync11(path);
|
|
35801
35914
|
} catch {
|
|
35802
35915
|
return path;
|
|
35803
35916
|
}
|
|
@@ -35873,7 +35986,7 @@ var init_plugin = __esm(() => {
|
|
|
35873
35986
|
SOURCE = /\.(?:[cm]?[jt]sx?)$/;
|
|
35874
35987
|
TEST_FILE = /(?:\.(?:spec|test)\.[cm]?[jt]sx?$)|(?:[\\/]__tests__[\\/])/;
|
|
35875
35988
|
GENERATED = /(?:^|[\\/])(?:build|generated|compiled|indexes|\.absolutejs|node_modules|dist)(?:[\\/]|$)/;
|
|
35876
|
-
ABSOLUTE_ROOT =
|
|
35989
|
+
ABSOLUTE_ROOT = resolve65(import.meta.dir, "..", "..", "..");
|
|
35877
35990
|
shared = globalThis.__absoluteHotPlugin ??= {
|
|
35878
35991
|
analyses: new Map,
|
|
35879
35992
|
installed: undefined
|
|
@@ -35882,11 +35995,11 @@ var init_plugin = __esm(() => {
|
|
|
35882
35995
|
});
|
|
35883
35996
|
|
|
35884
35997
|
// src/dev/hot/reload.ts
|
|
35885
|
-
import { readFileSync as readFileSync54, realpathSync as
|
|
35998
|
+
import { readFileSync as readFileSync54, realpathSync as realpathSync12 } from "fs";
|
|
35886
35999
|
import { relative as relative33 } from "path";
|
|
35887
36000
|
var MAX_PROPAGATION_STEPS = 500, realPath4 = (path) => {
|
|
35888
36001
|
try {
|
|
35889
|
-
return
|
|
36002
|
+
return realpathSync12(path);
|
|
35890
36003
|
} catch {
|
|
35891
36004
|
return path;
|
|
35892
36005
|
}
|
|
@@ -36075,7 +36188,7 @@ var init_reload = __esm(() => {
|
|
|
36075
36188
|
// src/dev/rebuildTrigger.ts
|
|
36076
36189
|
import { existsSync as existsSync56, readdirSync as readdirSync13, rmSync as rmSync4, statSync as statSync15 } from "fs";
|
|
36077
36190
|
import {
|
|
36078
|
-
basename as
|
|
36191
|
+
basename as basename23,
|
|
36079
36192
|
dirname as dirname45,
|
|
36080
36193
|
isAbsolute as isAbsolute13,
|
|
36081
36194
|
join as join72,
|
|
@@ -36623,7 +36736,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
36623
36736
|
if (serverDirs.length <= 1) {
|
|
36624
36737
|
const dir = getFrameworkGeneratedDir(framework, projectRoot);
|
|
36625
36738
|
return {
|
|
36626
|
-
serverOutDir: resolvePath(resolvedPaths.buildDir,
|
|
36739
|
+
serverOutDir: resolvePath(resolvedPaths.buildDir, basename23(dir)),
|
|
36627
36740
|
serverRoot: resolvePath(dir, "server")
|
|
36628
36741
|
};
|
|
36629
36742
|
}
|
|
@@ -36632,7 +36745,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
36632
36745
|
serverRoot: commonAncestor(serverDirs.map((entry) => entry.dir), projectRoot)
|
|
36633
36746
|
};
|
|
36634
36747
|
}, updateServerManifestEntry = (state, artifact) => {
|
|
36635
|
-
const fileWithHash =
|
|
36748
|
+
const fileWithHash = basename23(artifact.path);
|
|
36636
36749
|
const [baseName] = fileWithHash.split(`.${artifact.hash}.`);
|
|
36637
36750
|
if (!baseName) {
|
|
36638
36751
|
return;
|
|
@@ -36647,7 +36760,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
36647
36760
|
const prefixByDir = new Map;
|
|
36648
36761
|
for (const artifact of freshOutputs) {
|
|
36649
36762
|
const dir = dirname45(artifact.path);
|
|
36650
|
-
const name =
|
|
36763
|
+
const name = basename23(artifact.path);
|
|
36651
36764
|
const [prefix] = name.split(".");
|
|
36652
36765
|
if (!prefix)
|
|
36653
36766
|
continue;
|
|
@@ -37165,7 +37278,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
37165
37278
|
await rewriteImports2(ssrPaths, angServerVendorPaths);
|
|
37166
37279
|
}
|
|
37167
37280
|
serverPaths.forEach((serverPath, idx) => {
|
|
37168
|
-
const fileBase =
|
|
37281
|
+
const fileBase = basename23(serverPath, ".js");
|
|
37169
37282
|
const ssrPath = ssrPaths[idx] ?? serverPath;
|
|
37170
37283
|
state.manifest[toPascal(fileBase)] = resolvePath(ssrPath);
|
|
37171
37284
|
});
|
|
@@ -37284,7 +37397,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
37284
37397
|
}, resolveAffectedPageModules = async (reactFiles) => {
|
|
37285
37398
|
const pages = reactFiles.filter((file) => isReactPagePath(file) && isReactComponentPath(file) && isImportableModule(file));
|
|
37286
37399
|
const entries = await Promise.all(pages.map(async (page) => [
|
|
37287
|
-
`${
|
|
37400
|
+
`${basename23(page).replace(/\.[jt]sx$/, "")}Index`,
|
|
37288
37401
|
await getReactModuleUrl(page)
|
|
37289
37402
|
]));
|
|
37290
37403
|
return Object.fromEntries(entries);
|
|
@@ -37418,7 +37531,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
37418
37531
|
for (const artifact of cssResult.outputs) {
|
|
37419
37532
|
if (!artifact.path.endsWith(".css"))
|
|
37420
37533
|
continue;
|
|
37421
|
-
const cssName = stripArtifactHash(
|
|
37534
|
+
const cssName = stripArtifactHash(basename23(artifact.path), artifact.hash);
|
|
37422
37535
|
if (cssName)
|
|
37423
37536
|
cssByName.set(cssName, artifact.path);
|
|
37424
37537
|
}
|
|
@@ -37428,7 +37541,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
37428
37541
|
await Promise.all(serverResult.outputs.map(async (artifact) => {
|
|
37429
37542
|
if (!artifact.path.endsWith(".js"))
|
|
37430
37543
|
return;
|
|
37431
|
-
const pascalName = stripArtifactHash(
|
|
37544
|
+
const pascalName = stripArtifactHash(basename23(artifact.path), artifact.hash);
|
|
37432
37545
|
if (!pascalName)
|
|
37433
37546
|
return;
|
|
37434
37547
|
const cssBundlePath = cssByName.get(`${toKebab(pascalName)}-compiled`);
|
|
@@ -37701,7 +37814,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
37701
37814
|
const duration = Date.now() - startTime;
|
|
37702
37815
|
const broadcastFiles = svelteFiles.length > 0 ? svelteFiles : filesToRebuild;
|
|
37703
37816
|
broadcastFiles.forEach((sveltePagePath) => {
|
|
37704
|
-
const fileName =
|
|
37817
|
+
const fileName = basename23(sveltePagePath);
|
|
37705
37818
|
const baseName = fileName.replace(/\.svelte$/, "");
|
|
37706
37819
|
const pascalName = toPascal(baseName);
|
|
37707
37820
|
const cssKey = `${pascalName}CSS`;
|
|
@@ -37784,7 +37897,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
37784
37897
|
} = await compileVue(vueFiles, vueDir, true, getStyleTransformConfig(state.config));
|
|
37785
37898
|
const serverEntries = [...vueServerPaths];
|
|
37786
37899
|
const clientEntries = [...vueIndexPaths, ...vueClientPaths];
|
|
37787
|
-
const cssOutDir = join72(buildDir, state.resolvedPaths.assetsDir ?
|
|
37900
|
+
const cssOutDir = join72(buildDir, state.resolvedPaths.assetsDir ? basename23(state.resolvedPaths.assetsDir) : "assets", "css");
|
|
37788
37901
|
const { serverRoot, serverOutDir } = await computeServerOutPaths(state.resolvedPaths, "vue");
|
|
37789
37902
|
const serverExternals = await getServerBundleExternals();
|
|
37790
37903
|
const serverExternalsPlugins = await getServerBundleExternalsPlugins(state.config);
|
|
@@ -37961,7 +38074,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
37961
38074
|
await Promise.resolve().then(() => init_compileEmber());
|
|
37962
38075
|
const { serverPaths } = await compileEmber(allPageEntries, emberDir, process.cwd(), true);
|
|
37963
38076
|
for (const serverPath of serverPaths) {
|
|
37964
|
-
const fileBase =
|
|
38077
|
+
const fileBase = basename23(serverPath, ".js");
|
|
37965
38078
|
state.manifest[toPascal(fileBase)] = resolvePath(serverPath);
|
|
37966
38079
|
}
|
|
37967
38080
|
await Promise.resolve().then(() => init_ember());
|
|
@@ -38040,7 +38153,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
38040
38153
|
});
|
|
38041
38154
|
}
|
|
38042
38155
|
}, handleScriptUpdate = (state, scriptFile, manifest, framework, duration) => {
|
|
38043
|
-
const scriptBaseName =
|
|
38156
|
+
const scriptBaseName = basename23(scriptFile).replace(/\.(ts|js|tsx|jsx)$/, "");
|
|
38044
38157
|
const pascalName = toPascal(scriptBaseName);
|
|
38045
38158
|
const scriptPath = manifest[pascalName] || null;
|
|
38046
38159
|
if (!scriptPath) {
|
|
@@ -38141,7 +38254,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
38141
38254
|
const changedIslands = await collectChangedIslands(config, filesToRebuild);
|
|
38142
38255
|
const islands = changedIslands.flatMap(({ component, framework }) => {
|
|
38143
38256
|
const modulePath = manifest[getIslandManifestKey(framework, component)];
|
|
38144
|
-
|
|
38257
|
+
const stylePath = manifest[getIslandStyleManifestKey(framework, component)];
|
|
38258
|
+
return modulePath ? [{ component, framework, modulePath, stylePath }] : [];
|
|
38145
38259
|
});
|
|
38146
38260
|
if (islands.length === 0)
|
|
38147
38261
|
return true;
|
|
@@ -38186,7 +38300,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
38186
38300
|
if (isSingle) {
|
|
38187
38301
|
return resolvePath(state.resolvedPaths.buildDir, "pages");
|
|
38188
38302
|
}
|
|
38189
|
-
const dirName = framework === "html" ?
|
|
38303
|
+
const dirName = framework === "html" ? basename23(config.htmlDirectory ?? "html") : basename23(config.htmxDirectory ?? "htmx");
|
|
38190
38304
|
return resolvePath(state.resolvedPaths.buildDir, dirName, "pages");
|
|
38191
38305
|
}, processHtmlPageUpdate = async (state, pageFile, builtHtmlPagePath, manifest, duration) => {
|
|
38192
38306
|
try {
|
|
@@ -38227,7 +38341,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
38227
38341
|
const shouldRefreshAllPages = htmlPageFiles.length === 0 && shouldRefreshFromIslandChange;
|
|
38228
38342
|
const pageFilesToUpdate = shouldRefreshAllPages ? await scanEntryPoints(outputHtmlPages, "*.html") : htmlPageFiles;
|
|
38229
38343
|
await runSequentially(pageFilesToUpdate, async (pageFile) => {
|
|
38230
|
-
const htmlPageName =
|
|
38344
|
+
const htmlPageName = basename23(pageFile);
|
|
38231
38345
|
const builtHtmlPagePath = resolvePath(outputHtmlPages, htmlPageName);
|
|
38232
38346
|
await processHtmlPageUpdate(state, pageFile, builtHtmlPagePath, manifest, duration);
|
|
38233
38347
|
});
|
|
@@ -38236,7 +38350,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
38236
38350
|
if (!cssFile) {
|
|
38237
38351
|
return;
|
|
38238
38352
|
}
|
|
38239
|
-
const cssBaseName =
|
|
38353
|
+
const cssBaseName = basename23(getStyleBaseName(cssFile));
|
|
38240
38354
|
const cssPascalName = toPascal(cssBaseName);
|
|
38241
38355
|
const cssKey = `${cssPascalName}CSS`;
|
|
38242
38356
|
const cssUrl = manifest[cssKey] || null;
|
|
@@ -38288,7 +38402,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
38288
38402
|
type: "vue-update"
|
|
38289
38403
|
});
|
|
38290
38404
|
}, broadcastVuePageChange = async (state, config, vuePagePath, manifest, duration) => {
|
|
38291
|
-
const fileName =
|
|
38405
|
+
const fileName = basename23(vuePagePath);
|
|
38292
38406
|
const baseName = fileName.replace(/\.vue$/, "");
|
|
38293
38407
|
const pascalName = toPascal(baseName);
|
|
38294
38408
|
const vueRoot = config.vueDirectory;
|
|
@@ -38335,7 +38449,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
38335
38449
|
if (!cssFile) {
|
|
38336
38450
|
return;
|
|
38337
38451
|
}
|
|
38338
|
-
const cssBaseName =
|
|
38452
|
+
const cssBaseName = basename23(getStyleBaseName(cssFile));
|
|
38339
38453
|
const cssPascalName = toPascal(cssBaseName);
|
|
38340
38454
|
const cssKey = `${cssPascalName}CSS`;
|
|
38341
38455
|
const cssUrl = manifest[cssKey] || null;
|
|
@@ -38354,7 +38468,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
38354
38468
|
});
|
|
38355
38469
|
}, broadcastSveltePageUpdate = (state, sveltePagePath, manifest, duration) => {
|
|
38356
38470
|
try {
|
|
38357
|
-
const fileName =
|
|
38471
|
+
const fileName = basename23(sveltePagePath);
|
|
38358
38472
|
const baseName = fileName.replace(/\.svelte$/, "");
|
|
38359
38473
|
const pascalName = toPascal(baseName);
|
|
38360
38474
|
const cssKey = `${pascalName}CSS`;
|
|
@@ -38405,7 +38519,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
38405
38519
|
if (!cssFile) {
|
|
38406
38520
|
return;
|
|
38407
38521
|
}
|
|
38408
|
-
const cssBaseName =
|
|
38522
|
+
const cssBaseName = basename23(getStyleBaseName(cssFile));
|
|
38409
38523
|
const cssPascalName = toPascal(cssBaseName);
|
|
38410
38524
|
const cssKey = `${cssPascalName}CSS`;
|
|
38411
38525
|
const cssUrl = manifest[cssKey] || null;
|
|
@@ -38488,7 +38602,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
38488
38602
|
const shouldRefreshAllPages = htmxPageFiles.length === 0 && shouldRefreshFromIslandChange;
|
|
38489
38603
|
const pageFilesToUpdate = shouldRefreshAllPages ? await scanEntryPoints(outputHtmxPages, "*.html") : htmxPageFiles;
|
|
38490
38604
|
await runSequentially(pageFilesToUpdate, async (htmxPageFile) => {
|
|
38491
|
-
const htmxPageName =
|
|
38605
|
+
const htmxPageName = basename23(htmxPageFile);
|
|
38492
38606
|
const builtHtmxPagePath = resolvePath(outputHtmxPages, htmxPageName);
|
|
38493
38607
|
await processHtmxPageUpdate(state, htmxPageFile, builtHtmxPagePath, manifest, duration);
|
|
38494
38608
|
});
|
|
@@ -38600,7 +38714,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
38600
38714
|
html = html.slice(0, bodyClose.index) + hmrScript + html.slice(bodyClose.index);
|
|
38601
38715
|
writeFs(destPath, html);
|
|
38602
38716
|
}, processMarkupFileFastPath = async (state, sourceFile, outputDir, framework, startTime, updateAssetPaths, handleUpdate, readFs, writeFs) => {
|
|
38603
|
-
const destPath = resolvePath(outputDir,
|
|
38717
|
+
const destPath = resolvePath(outputDir, basename23(sourceFile));
|
|
38604
38718
|
const hmrScript = extractHmrScript(destPath, readFs);
|
|
38605
38719
|
const source = await Bun.file(sourceFile).text();
|
|
38606
38720
|
await Bun.write(destPath, source);
|
|
@@ -38686,9 +38800,9 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
38686
38800
|
await fastPath.handler(state, config, files, startTime, onRebuildComplete);
|
|
38687
38801
|
markHandledFiles(files, fastPath.framework, state.resolvedPaths, handled);
|
|
38688
38802
|
});
|
|
38689
|
-
const
|
|
38690
|
-
|
|
38691
|
-
|
|
38803
|
+
for (const file of files) {
|
|
38804
|
+
if (!handled.has(file) && detectFramework(file, state.resolvedPaths) === "unknown" && !state.lastUserEditedFiles?.has(resolvePath(file)))
|
|
38805
|
+
handled.add(file);
|
|
38692
38806
|
}
|
|
38693
38807
|
return files.every((f) => handled.has(f));
|
|
38694
38808
|
}, keepReactIndexesOnModuleServer = async (state, manifest) => {
|
|
@@ -39315,7 +39429,7 @@ import {
|
|
|
39315
39429
|
readFileSync as readFileSync55
|
|
39316
39430
|
} from "fs";
|
|
39317
39431
|
import { mkdir as mkdir16, readFile as readFile11, rename as rename6, rm as rm18, writeFile as writeFile15 } from "fs/promises";
|
|
39318
|
-
import { basename as
|
|
39432
|
+
import { basename as basename24, join as join74, resolve as resolve66 } from "path";
|
|
39319
39433
|
var CACHE_ROOT2, CACHE_FORMAT_VERSION3 = 1, KEY_LENGTH = 32, LOCKFILES, computeVendorCacheKey = (inputs) => {
|
|
39320
39434
|
const hash = createHash9("sha256");
|
|
39321
39435
|
hash.update(String(CACHE_FORMAT_VERSION3));
|
|
@@ -39335,7 +39449,7 @@ var CACHE_ROOT2, CACHE_FORMAT_VERSION3 = 1, KEY_LENGTH = 32, LOCKFILES, computeV
|
|
|
39335
39449
|
}
|
|
39336
39450
|
for (const dir of inputs.vendorDirs) {
|
|
39337
39451
|
hash.update("\x00v");
|
|
39338
|
-
hash.update(
|
|
39452
|
+
hash.update(basename24(resolve66(dir, "..")));
|
|
39339
39453
|
}
|
|
39340
39454
|
return hash.digest("hex").slice(0, KEY_LENGTH);
|
|
39341
39455
|
}, readLockfileHash = (projectRoot = process.cwd()) => {
|
|
@@ -39374,7 +39488,7 @@ var CACHE_ROOT2, CACHE_FORMAT_VERSION3 = 1, KEY_LENGTH = 32, LOCKFILES, computeV
|
|
|
39374
39488
|
continue;
|
|
39375
39489
|
copyTree(dir, join74(stagingDir, slotName(index, dir)));
|
|
39376
39490
|
}
|
|
39377
|
-
}, isVendorCachePayload = (value) => typeof value === "object" && value !== null && typeof Reflect.get(value, "depPaths") === "object", cacheDirFor = (key, projectRoot) =>
|
|
39491
|
+
}, isVendorCachePayload = (value) => typeof value === "object" && value !== null && typeof Reflect.get(value, "depPaths") === "object", cacheDirFor = (key, projectRoot) => resolve66(projectRoot, CACHE_ROOT2, key), slotName = (index, dir) => `${index}-${basename24(resolve66(dir, ".."))}`, restoreVendorCache = async (key, vendorDirs, projectRoot = process.cwd()) => {
|
|
39378
39492
|
const cacheDir = cacheDirFor(key, projectRoot);
|
|
39379
39493
|
const payloadPath = join74(cacheDir, "payload.json");
|
|
39380
39494
|
if (!existsSync57(payloadPath))
|
|
@@ -39420,7 +39534,7 @@ var init_vendorCache = __esm(() => {
|
|
|
39420
39534
|
// src/core/devBuild.ts
|
|
39421
39535
|
import { readdir as readdir6 } from "fs/promises";
|
|
39422
39536
|
import { existsSync as existsSync58, statSync as statSync16 } from "fs";
|
|
39423
|
-
import { resolve as
|
|
39537
|
+
import { resolve as resolve67 } from "path";
|
|
39424
39538
|
var FRAMEWORK_DIR_KEYS, devClientVendorSourceDir, collectDepVendorSourceDirs = (config) => {
|
|
39425
39539
|
const configuredDirs = [
|
|
39426
39540
|
...collectConfigVendorSourceDirs(config),
|
|
@@ -39444,7 +39558,7 @@ var FRAMEWORK_DIR_KEYS, devClientVendorSourceDir, collectDepVendorSourceDirs = (
|
|
|
39444
39558
|
return Object.keys(config).length > 0 ? config : null;
|
|
39445
39559
|
}, reloadConfig = async () => {
|
|
39446
39560
|
try {
|
|
39447
|
-
const configPath =
|
|
39561
|
+
const configPath = resolve67(process.env.ABSOLUTE_CONFIG ?? "absolute.config.ts");
|
|
39448
39562
|
const source = await Bun.file(configPath).text();
|
|
39449
39563
|
return parseDirectoryConfig(source);
|
|
39450
39564
|
} catch {
|
|
@@ -39559,7 +39673,7 @@ var FRAMEWORK_DIR_KEYS, devClientVendorSourceDir, collectDepVendorSourceDirs = (
|
|
|
39559
39673
|
});
|
|
39560
39674
|
}
|
|
39561
39675
|
}, handleCachedReload = async () => {
|
|
39562
|
-
const serverMtime = statSync16(
|
|
39676
|
+
const serverMtime = statSync16(resolve67(Bun.main)).mtimeMs;
|
|
39563
39677
|
const lastMtime = globalThis.__hmrServerMtime;
|
|
39564
39678
|
globalThis.__hmrServerMtime = serverMtime;
|
|
39565
39679
|
const cached = globalThis.__hmrDevResult;
|
|
@@ -39600,8 +39714,8 @@ var FRAMEWORK_DIR_KEYS, devClientVendorSourceDir, collectDepVendorSourceDirs = (
|
|
|
39600
39714
|
return true;
|
|
39601
39715
|
}, resolveAbsoluteVersion2 = async () => {
|
|
39602
39716
|
const candidates = [
|
|
39603
|
-
|
|
39604
|
-
|
|
39717
|
+
resolve67(import.meta.dir, "..", "..", "package.json"),
|
|
39718
|
+
resolve67(import.meta.dir, "..", "package.json")
|
|
39605
39719
|
];
|
|
39606
39720
|
const [candidate, ...remaining] = candidates;
|
|
39607
39721
|
if (!candidate) {
|
|
@@ -39627,7 +39741,7 @@ var FRAMEWORK_DIR_KEYS, devClientVendorSourceDir, collectDepVendorSourceDirs = (
|
|
|
39627
39741
|
const entries = await readdir6(vendorDir).catch(() => emptyStringArray);
|
|
39628
39742
|
await Promise.all(entries.filter((entry) => entry.endsWith(".js")).map(async (entry) => {
|
|
39629
39743
|
const webPath = `/${framework}/vendor/${entry}`;
|
|
39630
|
-
const bytes = await Bun.file(
|
|
39744
|
+
const bytes = await Bun.file(resolve67(vendorDir, entry)).bytes();
|
|
39631
39745
|
assetStore.set(webPath, bytes);
|
|
39632
39746
|
}));
|
|
39633
39747
|
}, devBuild = async (config) => {
|
|
@@ -39819,11 +39933,11 @@ var FRAMEWORK_DIR_KEYS, devClientVendorSourceDir, collectDepVendorSourceDirs = (
|
|
|
39819
39933
|
}
|
|
39820
39934
|
stepStartedAt = performance.now();
|
|
39821
39935
|
setBootPhase("build vendor bundles");
|
|
39822
|
-
const reactVendorDir =
|
|
39823
|
-
const angularVendorDir =
|
|
39824
|
-
const svelteVendorDir =
|
|
39825
|
-
const vueVendorDir =
|
|
39826
|
-
const depVendorDir =
|
|
39936
|
+
const reactVendorDir = resolve67(state.resolvedPaths.buildDir, "react", "vendor");
|
|
39937
|
+
const angularVendorDir = resolve67(state.resolvedPaths.buildDir, "angular", "vendor");
|
|
39938
|
+
const svelteVendorDir = resolve67(state.resolvedPaths.buildDir, "svelte", "vendor");
|
|
39939
|
+
const vueVendorDir = resolve67(state.resolvedPaths.buildDir, "vue", "vendor");
|
|
39940
|
+
const depVendorDir = resolve67(state.resolvedPaths.buildDir, "vendor");
|
|
39827
39941
|
await Promise.resolve().then(() => init_buildDepVendor());
|
|
39828
39942
|
const activeVendorDirs = [
|
|
39829
39943
|
reactVendorEnabled ? reactVendorDir : null,
|
|
@@ -39940,7 +40054,7 @@ var FRAMEWORK_DIR_KEYS, devClientVendorSourceDir, collectDepVendorSourceDirs = (
|
|
|
39940
40054
|
manifest
|
|
39941
40055
|
};
|
|
39942
40056
|
globalThis.__hmrDevResult = result;
|
|
39943
|
-
globalThis.__hmrServerMtime = statSync16(
|
|
40057
|
+
globalThis.__hmrServerMtime = statSync16(resolve67(Bun.main)).mtimeMs;
|
|
39944
40058
|
return result;
|
|
39945
40059
|
};
|
|
39946
40060
|
var init_devBuild = __esm(() => {
|
|
@@ -40195,12 +40309,12 @@ var init_hmr = __esm(() => {
|
|
|
40195
40309
|
|
|
40196
40310
|
// src/plugins/devtoolsJson.ts
|
|
40197
40311
|
import { existsSync as existsSync59, mkdirSync as mkdirSync22, readFileSync as readFileSync56, writeFileSync as writeFileSync18 } from "fs";
|
|
40198
|
-
import { dirname as dirname46, join as join75, resolve as
|
|
40312
|
+
import { dirname as dirname46, join as join75, resolve as resolve68 } from "path";
|
|
40199
40313
|
import { Elysia as Elysia11 } from "elysia";
|
|
40200
40314
|
var ENDPOINT = "/.well-known/appspecific/com.chrome.devtools.json", UUID_CACHE_KEY = "__absoluteDevtoolsWorkspaceUuid", getGlobalUuid = () => Reflect.get(globalThis, UUID_CACHE_KEY), setGlobalUuid = (uuid) => {
|
|
40201
40315
|
Reflect.set(globalThis, UUID_CACHE_KEY, uuid);
|
|
40202
40316
|
return uuid;
|
|
40203
|
-
}, 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) =>
|
|
40317
|
+
}, 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) => resolve68(uuidCachePath ?? join75(buildDir, ".absolute", "chrome-devtools-workspace-uuid")), readCachedUuid = (cachePath) => {
|
|
40204
40318
|
if (!existsSync59(cachePath))
|
|
40205
40319
|
return null;
|
|
40206
40320
|
try {
|
|
@@ -40226,7 +40340,7 @@ var ENDPOINT = "/.well-known/appspecific/com.chrome.devtools.json", UUID_CACHE_K
|
|
|
40226
40340
|
writeFileSync18(cachePath, uuid, "utf-8");
|
|
40227
40341
|
return setGlobalUuid(uuid);
|
|
40228
40342
|
}, devtoolsJson = (buildDir, options = {}) => {
|
|
40229
|
-
const rootPath =
|
|
40343
|
+
const rootPath = resolve68(options.projectRoot ?? process.cwd());
|
|
40230
40344
|
const root = options.normalizeForWindowsContainer === false ? rootPath : normalizeDevtoolsWorkspaceRoot(rootPath);
|
|
40231
40345
|
const uuid = getOrCreateUuid(buildDir, options);
|
|
40232
40346
|
return new Elysia11({ name: "absolute-devtools-json" }).get(ENDPOINT, () => ({
|
|
@@ -40251,7 +40365,7 @@ var init_devtoolsJson = () => {};
|
|
|
40251
40365
|
|
|
40252
40366
|
// src/plugins/imageOptimizer.ts
|
|
40253
40367
|
import { existsSync as existsSync60 } from "fs";
|
|
40254
|
-
import { resolve as
|
|
40368
|
+
import { resolve as resolve69 } from "path";
|
|
40255
40369
|
import { Elysia as Elysia12 } from "elysia";
|
|
40256
40370
|
var DEFAULT_CACHE_TTL_SECONDS = 60, MS_PER_SECOND = 1000, MAX_QUALITY = 100, avifInProgress, safeResolve = (path, baseDir) => {
|
|
40257
40371
|
try {
|
|
@@ -40264,7 +40378,7 @@ var DEFAULT_CACHE_TTL_SECONDS = 60, MS_PER_SECOND = 1000, MAX_QUALITY = 100, avi
|
|
|
40264
40378
|
}
|
|
40265
40379
|
}, resolveLocalImage = (url, buildDir) => {
|
|
40266
40380
|
const cleanPath = url.startsWith("/") ? url.slice(1) : url;
|
|
40267
|
-
return safeResolve(cleanPath, buildDir) ?? safeResolve(cleanPath,
|
|
40381
|
+
return safeResolve(cleanPath, buildDir) ?? safeResolve(cleanPath, resolve69(process.cwd()));
|
|
40268
40382
|
}, parseQueryParams = (query, allowedSizes, defaultQuality) => {
|
|
40269
40383
|
const url = typeof query["url"] === "string" ? query["url"] : undefined;
|
|
40270
40384
|
const wParam = typeof query["w"] === "string" ? query["w"] : undefined;
|
|
@@ -41507,7 +41621,7 @@ var init_partialPrerenderServe = __esm(() => {
|
|
|
41507
41621
|
// src/core/prepare.ts
|
|
41508
41622
|
import { createHash as createHash13 } from "crypto";
|
|
41509
41623
|
import { existsSync as existsSync61, readdirSync as readdirSync15, readFileSync as readFileSync58 } from "fs";
|
|
41510
|
-
import { basename as
|
|
41624
|
+
import { basename as basename25, join as join79, relative as relative36, resolve as resolvePath4 } from "path";
|
|
41511
41625
|
import { Elysia as Elysia16, ElysiaError, InternalServerError, NotFound as NotFound2 } from "elysia";
|
|
41512
41626
|
var MS_PER_SECOND2 = 1000, DEFAULT_PORT2 = 3000, MAX_STATIC_ROUTE_COUNT, STATIC_PLUGIN_RETRY_DELAY_MS = 50, waitForStaticPluginRetry = () => new Promise((resolve) => {
|
|
41513
41627
|
setTimeout(resolve, STATIC_PLUGIN_RETRY_DELAY_MS);
|
|
@@ -41790,7 +41904,7 @@ var MS_PER_SECOND2 = 1000, DEFAULT_PORT2 = 3000, MAX_STATIC_ROUTE_COUNT, STATIC_
|
|
|
41790
41904
|
for (const entry of entries) {
|
|
41791
41905
|
if (!entry.endsWith(".html"))
|
|
41792
41906
|
continue;
|
|
41793
|
-
const name =
|
|
41907
|
+
const name = basename25(entry, ".html");
|
|
41794
41908
|
const route = name === "index" ? "/" : `/${name}`;
|
|
41795
41909
|
map.set(route, join79(prerenderDir, entry));
|
|
41796
41910
|
}
|
|
@@ -41816,6 +41930,8 @@ var MS_PER_SECOND2 = 1000, DEFAULT_PORT2 = 3000, MAX_STATIC_ROUTE_COUNT, STATIC_
|
|
|
41816
41930
|
const { endpoint } = resolveVitalsConfig(config.vitals);
|
|
41817
41931
|
return endpoint.startsWith("/") ? createVitalsPlugin(endpoint) : new Elysia16({ name: "absolutejs-vitals-remote" });
|
|
41818
41932
|
}, createNotFoundPlugin = () => new Elysia16({ name: "absolutejs-not-found" }).onError("global", NotFound2, async ({ request }) => {
|
|
41933
|
+
if (!isPageRequest(request))
|
|
41934
|
+
return;
|
|
41819
41935
|
const response = await renderFirstNotFound({
|
|
41820
41936
|
preferHtmx: request.headers.get("hx-request") === "true"
|
|
41821
41937
|
});
|
|
@@ -42104,7 +42220,7 @@ import {
|
|
|
42104
42220
|
watch as watch2
|
|
42105
42221
|
} from "fs";
|
|
42106
42222
|
import { createHash as createHash14 } from "crypto";
|
|
42107
|
-
import { dirname as dirname48, join as join82, resolve as
|
|
42223
|
+
import { dirname as dirname48, join as join82, resolve as resolve70 } from "path";
|
|
42108
42224
|
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, isAtomicWriteTemp = (filename) => isEditorTempFile(filename) || isAbsoluteServerEntryCopyPath(filename), fileHash = (path) => {
|
|
42109
42225
|
try {
|
|
42110
42226
|
return createHash14("sha256").update(readFileSync61(path)).digest("hex");
|
|
@@ -42132,10 +42248,10 @@ var ATOMIC_RECOVERY_WINDOW_MS = 1000, RELOAD_DEBOUNCE_MS = 80, ENTRY_IMPORT_RETR
|
|
|
42132
42248
|
return;
|
|
42133
42249
|
globalThis.__absoluteEntryWatcherStarted = true;
|
|
42134
42250
|
globalThis.__absoluteEntryWatcherReady = false;
|
|
42135
|
-
const entryPath =
|
|
42251
|
+
const entryPath = resolve70(originalEntry);
|
|
42136
42252
|
const entryDir = dirname48(entryPath);
|
|
42137
42253
|
const entryBase = entryPath.slice(entryDir.length + 1);
|
|
42138
|
-
const configPath =
|
|
42254
|
+
const configPath = resolve70(process.env.ABSOLUTE_CONFIG ?? "absolute.config.ts");
|
|
42139
42255
|
const configDir = dirname48(configPath);
|
|
42140
42256
|
const configBase = configPath.slice(configDir.length + 1);
|
|
42141
42257
|
const recentlyHandled = new Map;
|
|
@@ -43487,7 +43603,7 @@ import {
|
|
|
43487
43603
|
writeFileSync as writeFileSync19
|
|
43488
43604
|
} from "fs";
|
|
43489
43605
|
import { homedir as homedir2 } from "os";
|
|
43490
|
-
import { basename as
|
|
43606
|
+
import { basename as basename26, join as join81 } from "path";
|
|
43491
43607
|
var registeredPids = new Set;
|
|
43492
43608
|
var exitHandlerRegistered = false;
|
|
43493
43609
|
var instanceFilePath = (pid) => join81(instanceRegistryDir(), `${pid}.json`);
|
|
@@ -43531,7 +43647,7 @@ var resolveProjectName = (cwd) => {
|
|
|
43531
43647
|
if (parsed !== null && typeof parsed === "object" && typeof parsed.name === "string" && parsed.name.trim().length > 0) {
|
|
43532
43648
|
return parsed.name;
|
|
43533
43649
|
}
|
|
43534
|
-
return
|
|
43650
|
+
return basename26(cwd) || "unknown";
|
|
43535
43651
|
};
|
|
43536
43652
|
|
|
43537
43653
|
// src/utils/networking.ts
|
|
@@ -44566,7 +44682,7 @@ init_fontAssets();
|
|
|
44566
44682
|
// src/utils/defineEnv.ts
|
|
44567
44683
|
var {env: bunEnv } = globalThis.Bun;
|
|
44568
44684
|
import { existsSync as existsSync64, readFileSync as readFileSync62 } from "fs";
|
|
44569
|
-
import { resolve as
|
|
44685
|
+
import { resolve as resolve71 } from "path";
|
|
44570
44686
|
|
|
44571
44687
|
// node_modules/@sinclair/typebox/build/esm/type/guard/value.mjs
|
|
44572
44688
|
function IsAsyncIterator(value) {
|
|
@@ -49093,7 +49209,7 @@ ${lines.join(`
|
|
|
49093
49209
|
};
|
|
49094
49210
|
var checkEnvFileSecurity = (properties) => {
|
|
49095
49211
|
const cwd = process.cwd();
|
|
49096
|
-
const envPath =
|
|
49212
|
+
const envPath = resolve71(cwd, ".env");
|
|
49097
49213
|
if (!existsSync64(envPath))
|
|
49098
49214
|
return;
|
|
49099
49215
|
const sensitiveKeys = Object.keys(properties).filter(isSensitive);
|
|
@@ -49103,7 +49219,7 @@ var checkEnvFileSecurity = (properties) => {
|
|
|
49103
49219
|
const presentKeys = sensitiveKeys.filter((key) => envContent.includes(`${key}=`));
|
|
49104
49220
|
if (presentKeys.length === 0)
|
|
49105
49221
|
return;
|
|
49106
|
-
const gitignorePath =
|
|
49222
|
+
const gitignorePath = resolve71(cwd, ".gitignore");
|
|
49107
49223
|
if (existsSync64(gitignorePath)) {
|
|
49108
49224
|
const gitignore = readFileSync62(gitignorePath, "utf-8");
|
|
49109
49225
|
if (gitignore.split(`
|
|
@@ -49138,7 +49254,7 @@ var getEnv = (key) => {
|
|
|
49138
49254
|
};
|
|
49139
49255
|
// src/utils/projectRoot.ts
|
|
49140
49256
|
import { existsSync as existsSync65 } from "fs";
|
|
49141
|
-
import { dirname as dirname49, resolve as
|
|
49257
|
+
import { dirname as dirname49, resolve as resolve72 } from "path";
|
|
49142
49258
|
var CONFIG_CANDIDATES = [
|
|
49143
49259
|
"absolute.config.ts",
|
|
49144
49260
|
"absolute.config.js",
|
|
@@ -49147,7 +49263,7 @@ var CONFIG_CANDIDATES = [
|
|
|
49147
49263
|
"absolute.config.mts",
|
|
49148
49264
|
"absolute.config.cts"
|
|
49149
49265
|
];
|
|
49150
|
-
var hasAbsoluteConfig = (directory) => CONFIG_CANDIDATES.some((name) => existsSync65(
|
|
49266
|
+
var hasAbsoluteConfig = (directory) => CONFIG_CANDIDATES.some((name) => existsSync65(resolve72(directory, name)));
|
|
49151
49267
|
var findProjectRoot = () => {
|
|
49152
49268
|
const start = process.cwd();
|
|
49153
49269
|
let packageRoot = null;
|
|
@@ -49156,7 +49272,7 @@ var findProjectRoot = () => {
|
|
|
49156
49272
|
if (hasAbsoluteConfig(directory)) {
|
|
49157
49273
|
return directory;
|
|
49158
49274
|
}
|
|
49159
|
-
if (packageRoot === null && existsSync65(
|
|
49275
|
+
if (packageRoot === null && existsSync65(resolve72(directory, "package.json"))) {
|
|
49160
49276
|
packageRoot = directory;
|
|
49161
49277
|
}
|
|
49162
49278
|
const parent = dirname49(directory);
|
|
@@ -49444,5 +49560,5 @@ export {
|
|
|
49444
49560
|
wrapPageHandlerWithStreamingSlots
|
|
49445
49561
|
};
|
|
49446
49562
|
|
|
49447
|
-
//# debugId=
|
|
49563
|
+
//# debugId=74B7718917212AE664756E2164756E21
|
|
49448
49564
|
//# sourceMappingURL=index.js.map
|