@absolutejs/absolute 0.19.0-beta.1045 → 0.19.0-beta.1047
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/angular/components/core/streamingSlotRegistrar.js +1 -1
- package/dist/angular/components/core/streamingSlotRegistry.js +2 -2
- package/dist/cli/index.js +25 -5
- package/dist/index.js +656 -489
- package/dist/index.js.map +7 -5
- package/dist/src/core/prepare.d.ts +16 -0
- package/dist/src/plugins/telemetryPlugin.d.ts +10 -0
- package/package.json +2 -1
package/dist/index.js
CHANGED
|
@@ -18617,10 +18617,10 @@ var init_loadConfig = __esm(() => {
|
|
|
18617
18617
|
});
|
|
18618
18618
|
|
|
18619
18619
|
// src/build/scanEntryPoints.ts
|
|
18620
|
-
import { existsSync as
|
|
18620
|
+
import { existsSync as existsSync9 } from "fs";
|
|
18621
18621
|
var {Glob } = globalThis.Bun;
|
|
18622
18622
|
var scanEntryPoints = async (dir, pattern) => {
|
|
18623
|
-
if (!
|
|
18623
|
+
if (!existsSync9(dir))
|
|
18624
18624
|
return [];
|
|
18625
18625
|
const entryPaths = [];
|
|
18626
18626
|
const glob = new Glob(pattern);
|
|
@@ -18709,7 +18709,7 @@ var init_sourceMetadata = __esm(() => {
|
|
|
18709
18709
|
});
|
|
18710
18710
|
|
|
18711
18711
|
// src/islands/pageMetadata.ts
|
|
18712
|
-
import { readFileSync as
|
|
18712
|
+
import { readFileSync as readFileSync10 } from "fs";
|
|
18713
18713
|
import { dirname as dirname9, resolve as resolve12 } from "path";
|
|
18714
18714
|
var pagePatterns, getPageDirs = (config2) => [
|
|
18715
18715
|
{ dir: config2.angularDirectory, framework: "angular" },
|
|
@@ -18752,7 +18752,7 @@ var pagePatterns, getPageDirs = (config2) => [
|
|
|
18752
18752
|
return;
|
|
18753
18753
|
const files = await scanEntryPoints(resolve12(entry.dir), pattern);
|
|
18754
18754
|
for (const filePath of files) {
|
|
18755
|
-
const source =
|
|
18755
|
+
const source = readFileSync10(filePath, "utf-8");
|
|
18756
18756
|
const islands = extractIslandUsagesFromSource(source);
|
|
18757
18757
|
pageMetadata.set(resolve12(filePath), {
|
|
18758
18758
|
islands: resolveIslandUsages(islands, islandSourceLookup),
|
|
@@ -19228,22 +19228,22 @@ var init_verifyAngularCoreUniqueness = __esm(() => {
|
|
|
19228
19228
|
});
|
|
19229
19229
|
|
|
19230
19230
|
// src/build/generateReactIndexes.ts
|
|
19231
|
-
import { existsSync as
|
|
19231
|
+
import { existsSync as existsSync10, mkdirSync as mkdirSync2 } from "fs";
|
|
19232
19232
|
import { readdir as readdir3, rm, writeFile } from "fs/promises";
|
|
19233
|
-
import { basename as basename3, join as
|
|
19233
|
+
import { basename as basename3, join as join14, relative as relative6, resolve as resolve14, sep } from "path";
|
|
19234
19234
|
var {Glob: Glob2 } = globalThis.Bun;
|
|
19235
19235
|
var indexContentCache, resolveDevClientDir = () => {
|
|
19236
19236
|
const projectRoot = process.cwd();
|
|
19237
19237
|
const fromSource = resolve14(import.meta.dir, "../dev/client");
|
|
19238
|
-
if (
|
|
19238
|
+
if (existsSync10(fromSource) && fromSource.startsWith(projectRoot)) {
|
|
19239
19239
|
return fromSource;
|
|
19240
19240
|
}
|
|
19241
19241
|
const fromNodeModules = resolve14(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client");
|
|
19242
|
-
if (
|
|
19242
|
+
if (existsSync10(fromNodeModules))
|
|
19243
19243
|
return fromNodeModules;
|
|
19244
19244
|
return resolve14(import.meta.dir, "./dev/client");
|
|
19245
19245
|
}, devClientDir, errorOverlayPath, hmrClientPath, refreshSetupPath, reactRefreshRuntimePath, generateReactIndexFiles = async (reactPagesDirectory, reactIndexesDirectory, isDev2 = false) => {
|
|
19246
|
-
if (!
|
|
19246
|
+
if (!existsSync10(reactIndexesDirectory)) {
|
|
19247
19247
|
mkdirSync2(reactIndexesDirectory, { recursive: true });
|
|
19248
19248
|
}
|
|
19249
19249
|
const CONVENTION_RE = /^(?:(.+)\.)?(error|loading|not-found)\.[^.]+$/;
|
|
@@ -19263,8 +19263,8 @@ var indexContentCache, resolveDevClientDir = () => {
|
|
|
19263
19263
|
});
|
|
19264
19264
|
if (staleIndexes.length > 0) {
|
|
19265
19265
|
await Promise.all(staleIndexes.map((indexFile) => {
|
|
19266
|
-
indexContentCache.delete(
|
|
19267
|
-
return rm(
|
|
19266
|
+
indexContentCache.delete(join14(reactIndexesDirectory, indexFile));
|
|
19267
|
+
return rm(join14(reactIndexesDirectory, indexFile), {
|
|
19268
19268
|
force: true
|
|
19269
19269
|
});
|
|
19270
19270
|
}));
|
|
@@ -19547,11 +19547,11 @@ var indexContentCache, resolveDevClientDir = () => {
|
|
|
19547
19547
|
] : []
|
|
19548
19548
|
].join(`
|
|
19549
19549
|
`);
|
|
19550
|
-
const indexPath =
|
|
19550
|
+
const indexPath = join14(reactIndexesDirectory, `${componentName}.tsx`);
|
|
19551
19551
|
const hasher = new Bun.CryptoHasher("md5");
|
|
19552
19552
|
hasher.update(content);
|
|
19553
19553
|
const contentHash = hasher.digest("hex");
|
|
19554
|
-
if (indexContentCache.get(indexPath) === contentHash &&
|
|
19554
|
+
if (indexContentCache.get(indexPath) === contentHash && existsSync10(indexPath)) {
|
|
19555
19555
|
return;
|
|
19556
19556
|
}
|
|
19557
19557
|
indexContentCache.set(indexPath, contentHash);
|
|
@@ -19561,8 +19561,8 @@ var indexContentCache, resolveDevClientDir = () => {
|
|
|
19561
19561
|
if (!isDev2) {
|
|
19562
19562
|
return;
|
|
19563
19563
|
}
|
|
19564
|
-
const refreshPath =
|
|
19565
|
-
if (!
|
|
19564
|
+
const refreshPath = join14(reactIndexesDirectory, "_refresh.tsx");
|
|
19565
|
+
if (!existsSync10(refreshPath)) {
|
|
19566
19566
|
await writeFile(refreshPath, `import '${refreshSetupPath}';
|
|
19567
19567
|
import 'react';
|
|
19568
19568
|
import 'react-dom/client';
|
|
@@ -19572,10 +19572,10 @@ import 'react-dom/client';
|
|
|
19572
19572
|
var init_generateReactIndexes = __esm(() => {
|
|
19573
19573
|
indexContentCache = new Map;
|
|
19574
19574
|
devClientDir = resolveDevClientDir();
|
|
19575
|
-
errorOverlayPath =
|
|
19576
|
-
hmrClientPath =
|
|
19577
|
-
refreshSetupPath =
|
|
19578
|
-
reactRefreshRuntimePath =
|
|
19575
|
+
errorOverlayPath = join14(devClientDir, "errorOverlay.ts").replace(/\\/g, "/");
|
|
19576
|
+
hmrClientPath = join14(devClientDir, "hmrClient.ts").replace(/\\/g, "/");
|
|
19577
|
+
refreshSetupPath = join14(devClientDir, "reactRefreshSetup.ts").replace(/\\/g, "/");
|
|
19578
|
+
reactRefreshRuntimePath = join14(devClientDir, "vendor", "reactRefreshRuntime.js").replace(/\\/g, "/");
|
|
19579
19579
|
});
|
|
19580
19580
|
|
|
19581
19581
|
// src/build/wrapHTMLScript.ts
|
|
@@ -19643,7 +19643,7 @@ var init_outputLogs = __esm(() => {
|
|
|
19643
19643
|
// src/build/scanConventions.ts
|
|
19644
19644
|
import { basename as basename4 } from "path";
|
|
19645
19645
|
var {Glob: Glob3 } = globalThis.Bun;
|
|
19646
|
-
import { existsSync as
|
|
19646
|
+
import { existsSync as existsSync11 } from "fs";
|
|
19647
19647
|
var CONVENTION_RE, classifyFile = (file2, pageFiles, defaults, pages) => {
|
|
19648
19648
|
const fileName = basename4(file2);
|
|
19649
19649
|
const match = CONVENTION_RE.exec(fileName);
|
|
@@ -19668,7 +19668,7 @@ var CONVENTION_RE, classifyFile = (file2, pageFiles, defaults, pages) => {
|
|
|
19668
19668
|
else if (kind === "loading")
|
|
19669
19669
|
pages[pageName].loading = file2;
|
|
19670
19670
|
}, scanConventions = async (pagesDir, pattern) => {
|
|
19671
|
-
if (!
|
|
19671
|
+
if (!existsSync11(pagesDir)) {
|
|
19672
19672
|
const pageFiles2 = [];
|
|
19673
19673
|
return { conventions: undefined, pageFiles: pageFiles2 };
|
|
19674
19674
|
}
|
|
@@ -19691,8 +19691,8 @@ var init_scanConventions = __esm(() => {
|
|
|
19691
19691
|
});
|
|
19692
19692
|
|
|
19693
19693
|
// src/build/scanRouteRegistrations.ts
|
|
19694
|
-
import { readdirSync, readFileSync as
|
|
19695
|
-
import { join as
|
|
19694
|
+
import { readdirSync, readFileSync as readFileSync11 } from "fs";
|
|
19695
|
+
import { join as join15 } from "path";
|
|
19696
19696
|
import ts2 from "typescript";
|
|
19697
19697
|
var ELYSIA_ROUTE_METHODS, SKIP_DIRS, SOURCE_EXTENSIONS, getScriptKind = (filePath) => {
|
|
19698
19698
|
if (filePath.endsWith(".tsx"))
|
|
@@ -19729,9 +19729,9 @@ var ELYSIA_ROUTE_METHODS, SKIP_DIRS, SOURCE_EXTENSIONS, getScriptKind = (filePat
|
|
|
19729
19729
|
continue;
|
|
19730
19730
|
if (entry.name.startsWith("."))
|
|
19731
19731
|
continue;
|
|
19732
|
-
stack.push(
|
|
19732
|
+
stack.push(join15(dir, entry.name));
|
|
19733
19733
|
} else if (entry.isFile() && hasSourceExtension(entry.name)) {
|
|
19734
|
-
out.push(
|
|
19734
|
+
out.push(join15(dir, entry.name));
|
|
19735
19735
|
}
|
|
19736
19736
|
}
|
|
19737
19737
|
}
|
|
@@ -19745,7 +19745,7 @@ var ELYSIA_ROUTE_METHODS, SKIP_DIRS, SOURCE_EXTENSIONS, getScriptKind = (filePat
|
|
|
19745
19745
|
}, extractRoutesFromFile = (filePath, out) => {
|
|
19746
19746
|
let source;
|
|
19747
19747
|
try {
|
|
19748
|
-
source =
|
|
19748
|
+
source = readFileSync11(filePath, "utf-8");
|
|
19749
19749
|
} catch {
|
|
19750
19750
|
return;
|
|
19751
19751
|
}
|
|
@@ -19814,8 +19814,8 @@ var init_scanRouteRegistrations = __esm(() => {
|
|
|
19814
19814
|
});
|
|
19815
19815
|
|
|
19816
19816
|
// src/angular/staticAnalyzeSpaRoutes.ts
|
|
19817
|
-
import { existsSync as
|
|
19818
|
-
import { join as
|
|
19817
|
+
import { existsSync as existsSync12, promises as fs } from "fs";
|
|
19818
|
+
import { join as join16 } from "path";
|
|
19819
19819
|
import ts3 from "typescript";
|
|
19820
19820
|
var DYNAMIC_SEGMENT_PATTERN, pathHasDynamic = (path) => path.split("/").some((seg) => DYNAMIC_SEGMENT_PATTERN.test(seg) || seg === "**"), importsSymbolFrom = (sf, localName, moduleSpecifier) => {
|
|
19821
19821
|
for (const statement of sf.statements) {
|
|
@@ -20013,7 +20013,7 @@ var DYNAMIC_SEGMENT_PATTERN, pathHasDynamic = (path) => path.split("/").some((se
|
|
|
20013
20013
|
continue;
|
|
20014
20014
|
if (item.name.startsWith("."))
|
|
20015
20015
|
continue;
|
|
20016
|
-
const full =
|
|
20016
|
+
const full = join16(dir, item.name);
|
|
20017
20017
|
if (item.isDirectory()) {
|
|
20018
20018
|
await walkTsFiles(full, out);
|
|
20019
20019
|
} else if (item.isFile() && item.name.endsWith(".ts") && !item.name.endsWith(".d.ts")) {
|
|
@@ -20021,7 +20021,7 @@ var DYNAMIC_SEGMENT_PATTERN, pathHasDynamic = (path) => path.split("/").some((se
|
|
|
20021
20021
|
}
|
|
20022
20022
|
}
|
|
20023
20023
|
}, analyzeAngularSpaRoutes = async (angularDirectory) => {
|
|
20024
|
-
if (!
|
|
20024
|
+
if (!existsSync12(angularDirectory))
|
|
20025
20025
|
return [];
|
|
20026
20026
|
const tsFiles = [];
|
|
20027
20027
|
await walkTsFiles(angularDirectory, tsFiles);
|
|
@@ -20042,8 +20042,8 @@ var init_staticAnalyzeSpaRoutes = __esm(() => {
|
|
|
20042
20042
|
});
|
|
20043
20043
|
|
|
20044
20044
|
// src/react/staticAnalyzeSpaRoutes.ts
|
|
20045
|
-
import { existsSync as
|
|
20046
|
-
import { join as
|
|
20045
|
+
import { existsSync as existsSync13, promises as fs2 } from "fs";
|
|
20046
|
+
import { join as join17 } from "path";
|
|
20047
20047
|
import ts4 from "typescript";
|
|
20048
20048
|
var DYNAMIC_SEGMENT_PATTERN2, pathHasDynamic2 = (path) => path.split("/").some((seg) => DYNAMIC_SEGMENT_PATTERN2.test(seg) || seg === "**"), readStringLiteral2 = (expression) => {
|
|
20049
20049
|
if (ts4.isStringLiteral(expression) || ts4.isNoSubstitutionTemplateLiteral(expression)) {
|
|
@@ -20223,7 +20223,7 @@ var DYNAMIC_SEGMENT_PATTERN2, pathHasDynamic2 = (path) => path.split("/").some((
|
|
|
20223
20223
|
for (const item of items) {
|
|
20224
20224
|
if (item.name === "node_modules" || item.name.startsWith("."))
|
|
20225
20225
|
continue;
|
|
20226
|
-
const full =
|
|
20226
|
+
const full = join17(dir, item.name);
|
|
20227
20227
|
if (item.isDirectory()) {
|
|
20228
20228
|
await walkSourceFiles(full, out);
|
|
20229
20229
|
} else if (item.isFile() && (item.name.endsWith(".tsx") || item.name.endsWith(".ts") || item.name.endsWith(".jsx") || item.name.endsWith(".js")) && !item.name.endsWith(".d.ts")) {
|
|
@@ -20231,7 +20231,7 @@ var DYNAMIC_SEGMENT_PATTERN2, pathHasDynamic2 = (path) => path.split("/").some((
|
|
|
20231
20231
|
}
|
|
20232
20232
|
}
|
|
20233
20233
|
}, analyzeReactSpaRoutes = async (reactDirectory) => {
|
|
20234
|
-
if (!
|
|
20234
|
+
if (!existsSync13(reactDirectory))
|
|
20235
20235
|
return [];
|
|
20236
20236
|
const files = [];
|
|
20237
20237
|
await walkSourceFiles(reactDirectory, files);
|
|
@@ -20252,8 +20252,8 @@ var init_staticAnalyzeSpaRoutes2 = __esm(() => {
|
|
|
20252
20252
|
});
|
|
20253
20253
|
|
|
20254
20254
|
// src/svelte/staticAnalyzeSpaRoutes.ts
|
|
20255
|
-
import { existsSync as
|
|
20256
|
-
import { join as
|
|
20255
|
+
import { existsSync as existsSync14, promises as fs3 } from "fs";
|
|
20256
|
+
import { join as join18 } from "path";
|
|
20257
20257
|
var DYNAMIC_SEGMENT_PATTERN3, pathHasDynamic3 = (path) => path.split("/").some((seg) => DYNAMIC_SEGMENT_PATTERN3.test(seg) || seg === "**"), joinSegments3 = (parent, child) => {
|
|
20258
20258
|
if (!child)
|
|
20259
20259
|
return parent;
|
|
@@ -20325,7 +20325,7 @@ var DYNAMIC_SEGMENT_PATTERN3, pathHasDynamic3 = (path) => path.split("/").some((
|
|
|
20325
20325
|
for (const item of items) {
|
|
20326
20326
|
if (item.name === "node_modules" || item.name.startsWith("."))
|
|
20327
20327
|
continue;
|
|
20328
|
-
const full =
|
|
20328
|
+
const full = join18(dir, item.name);
|
|
20329
20329
|
if (item.isDirectory()) {
|
|
20330
20330
|
await walkSvelteFiles(full, out);
|
|
20331
20331
|
} else if (item.isFile() && item.name.endsWith(".svelte")) {
|
|
@@ -20333,7 +20333,7 @@ var DYNAMIC_SEGMENT_PATTERN3, pathHasDynamic3 = (path) => path.split("/").some((
|
|
|
20333
20333
|
}
|
|
20334
20334
|
}
|
|
20335
20335
|
}, analyzeSvelteSpaRoutes = async (svelteDirectory) => {
|
|
20336
|
-
if (!
|
|
20336
|
+
if (!existsSync14(svelteDirectory))
|
|
20337
20337
|
return [];
|
|
20338
20338
|
const files = [];
|
|
20339
20339
|
await walkSvelteFiles(svelteDirectory, files);
|
|
@@ -20356,8 +20356,8 @@ var init_staticAnalyzeSpaRoutes3 = __esm(() => {
|
|
|
20356
20356
|
});
|
|
20357
20357
|
|
|
20358
20358
|
// src/vue/staticAnalyzeSpaRoutes.ts
|
|
20359
|
-
import { existsSync as
|
|
20360
|
-
import { join as
|
|
20359
|
+
import { existsSync as existsSync15, promises as fs4 } from "fs";
|
|
20360
|
+
import { join as join19 } from "path";
|
|
20361
20361
|
import ts5 from "typescript";
|
|
20362
20362
|
var DYNAMIC_SEGMENT_PATTERN4, pathHasDynamic4 = (path) => path.split("/").some((seg) => DYNAMIC_SEGMENT_PATTERN4.test(seg) || seg === "**"), readStringLiteral3 = (expression) => {
|
|
20363
20363
|
if (ts5.isStringLiteral(expression) || ts5.isNoSubstitutionTemplateLiteral(expression)) {
|
|
@@ -20563,7 +20563,7 @@ var DYNAMIC_SEGMENT_PATTERN4, pathHasDynamic4 = (path) => path.split("/").some((
|
|
|
20563
20563
|
for (const item of items) {
|
|
20564
20564
|
if (item.name === "node_modules" || item.name.startsWith("."))
|
|
20565
20565
|
continue;
|
|
20566
|
-
const full =
|
|
20566
|
+
const full = join19(dir, item.name);
|
|
20567
20567
|
if (item.isDirectory()) {
|
|
20568
20568
|
await walkSourceFiles2(full, out);
|
|
20569
20569
|
} else if (item.isFile() && (item.name.endsWith(".ts") || item.name.endsWith(".js") || item.name.endsWith(".vue")) && !item.name.endsWith(".d.ts")) {
|
|
@@ -20571,7 +20571,7 @@ var DYNAMIC_SEGMENT_PATTERN4, pathHasDynamic4 = (path) => path.split("/").some((
|
|
|
20571
20571
|
}
|
|
20572
20572
|
}
|
|
20573
20573
|
}, analyzeVueSpaRoutes = async (vueDirectory) => {
|
|
20574
|
-
if (!
|
|
20574
|
+
if (!existsSync15(vueDirectory))
|
|
20575
20575
|
return [];
|
|
20576
20576
|
const files = [];
|
|
20577
20577
|
await walkSourceFiles2(vueDirectory, files);
|
|
@@ -20824,10 +20824,10 @@ var init_generateSitemap = __esm(() => {
|
|
|
20824
20824
|
});
|
|
20825
20825
|
|
|
20826
20826
|
// src/build/scanCssEntryPoints.ts
|
|
20827
|
-
import { existsSync as
|
|
20827
|
+
import { existsSync as existsSync16 } from "fs";
|
|
20828
20828
|
var {Glob: Glob4 } = globalThis.Bun;
|
|
20829
20829
|
var scanCssEntryPoints = async (dir, ignore) => {
|
|
20830
|
-
if (!
|
|
20830
|
+
if (!existsSync16(dir))
|
|
20831
20831
|
return [];
|
|
20832
20832
|
const entryPaths = [];
|
|
20833
20833
|
const glob = new Glob4("**/*.{css,scss,sass,less,styl,stylus}");
|
|
@@ -20844,8 +20844,8 @@ var init_scanCssEntryPoints = __esm(() => {
|
|
|
20844
20844
|
});
|
|
20845
20845
|
|
|
20846
20846
|
// src/utils/imageProcessing.ts
|
|
20847
|
-
import { existsSync as
|
|
20848
|
-
import { join as
|
|
20847
|
+
import { existsSync as existsSync17, mkdirSync as mkdirSync3, readFileSync as readFileSync12, writeFileSync as writeFileSync4 } from "fs";
|
|
20848
|
+
import { join as join20, resolve as resolve15 } from "path";
|
|
20849
20849
|
var DEFAULT_DEVICE_SIZES, DEFAULT_IMAGE_SIZES, DEFAULT_QUALITY, OPTIMIZATION_ENDPOINT = "/_absolute/image", BLUR_DEVIATION = 20, sharpModule = undefined, sharpLoaded = false, sharpWarned = false, snapToSize = (target, sizes) => {
|
|
20850
20850
|
for (const size of sizes) {
|
|
20851
20851
|
if (size >= target)
|
|
@@ -20895,8 +20895,8 @@ var DEFAULT_DEVICE_SIZES, DEFAULT_IMAGE_SIZES, DEFAULT_QUALITY, OPTIMIZATION_END
|
|
|
20895
20895
|
const image2 = config2?.imageSizes ?? DEFAULT_IMAGE_SIZES;
|
|
20896
20896
|
return [...device, ...image2].sort((left, right) => left - right);
|
|
20897
20897
|
}, getCacheDir = (buildDir) => {
|
|
20898
|
-
const dir =
|
|
20899
|
-
if (!
|
|
20898
|
+
const dir = join20(buildDir, ".cache", "images");
|
|
20899
|
+
if (!existsSync17(dir))
|
|
20900
20900
|
mkdirSync3(dir, { recursive: true });
|
|
20901
20901
|
return dir;
|
|
20902
20902
|
}, getCacheKey = (url2, width, quality, format) => {
|
|
@@ -20978,13 +20978,13 @@ var DEFAULT_DEVICE_SIZES, DEFAULT_IMAGE_SIZES, DEFAULT_QUALITY, OPTIMIZATION_END
|
|
|
20978
20978
|
throw err;
|
|
20979
20979
|
}
|
|
20980
20980
|
}, readFromCache = (cacheDir, cacheKey) => {
|
|
20981
|
-
const metaPath =
|
|
20982
|
-
const dataPath =
|
|
20983
|
-
if (!
|
|
20981
|
+
const metaPath = join20(cacheDir, `${cacheKey}.meta`);
|
|
20982
|
+
const dataPath = join20(cacheDir, `${cacheKey}.data`);
|
|
20983
|
+
if (!existsSync17(metaPath) || !existsSync17(dataPath))
|
|
20984
20984
|
return null;
|
|
20985
20985
|
try {
|
|
20986
|
-
const meta = JSON.parse(
|
|
20987
|
-
const buffer =
|
|
20986
|
+
const meta = JSON.parse(readFileSync12(metaPath, "utf-8"));
|
|
20987
|
+
const buffer = readFileSync12(dataPath);
|
|
20988
20988
|
return { buffer, meta };
|
|
20989
20989
|
} catch {
|
|
20990
20990
|
return null;
|
|
@@ -21006,8 +21006,8 @@ var DEFAULT_DEVICE_SIZES, DEFAULT_IMAGE_SIZES, DEFAULT_QUALITY, OPTIMIZATION_END
|
|
|
21006
21006
|
return null;
|
|
21007
21007
|
}
|
|
21008
21008
|
}, writeToCache = (cacheDir, cacheKey, buffer, meta) => {
|
|
21009
|
-
const metaPath =
|
|
21010
|
-
const dataPath =
|
|
21009
|
+
const metaPath = join20(cacheDir, `${cacheKey}.meta`);
|
|
21010
|
+
const dataPath = join20(cacheDir, `${cacheKey}.data`);
|
|
21011
21011
|
writeFileSync4(dataPath, buffer);
|
|
21012
21012
|
writeFileSync4(metaPath, JSON.stringify(meta));
|
|
21013
21013
|
};
|
|
@@ -21093,14 +21093,14 @@ var init_optimizeHtmlImages = __esm(() => {
|
|
|
21093
21093
|
});
|
|
21094
21094
|
|
|
21095
21095
|
// src/cli/scripts/telemetry.ts
|
|
21096
|
-
import { existsSync as
|
|
21096
|
+
import { existsSync as existsSync18, mkdirSync as mkdirSync4, readFileSync as readFileSync13, writeFileSync as writeFileSync5 } from "fs";
|
|
21097
21097
|
import { homedir } from "os";
|
|
21098
|
-
import { join as
|
|
21098
|
+
import { join as join21 } from "path";
|
|
21099
21099
|
var configDir, configPath, getTelemetryConfig = () => {
|
|
21100
21100
|
try {
|
|
21101
|
-
if (!
|
|
21101
|
+
if (!existsSync18(configPath))
|
|
21102
21102
|
return null;
|
|
21103
|
-
const raw =
|
|
21103
|
+
const raw = readFileSync13(configPath, "utf-8");
|
|
21104
21104
|
const config2 = JSON.parse(raw);
|
|
21105
21105
|
return config2;
|
|
21106
21106
|
} catch {
|
|
@@ -21108,19 +21108,19 @@ var configDir, configPath, getTelemetryConfig = () => {
|
|
|
21108
21108
|
}
|
|
21109
21109
|
};
|
|
21110
21110
|
var init_telemetry = __esm(() => {
|
|
21111
|
-
configDir =
|
|
21112
|
-
configPath =
|
|
21111
|
+
configDir = join21(homedir(), ".absolutejs");
|
|
21112
|
+
configPath = join21(configDir, "telemetry.json");
|
|
21113
21113
|
});
|
|
21114
21114
|
|
|
21115
21115
|
// src/cli/telemetryEvent.ts
|
|
21116
|
-
import { existsSync as
|
|
21116
|
+
import { existsSync as existsSync19, readFileSync as readFileSync14 } from "fs";
|
|
21117
21117
|
import { arch as arch2, platform as platform2 } from "os";
|
|
21118
|
-
import { dirname as dirname10, join as
|
|
21118
|
+
import { dirname as dirname10, join as join22, parse } from "path";
|
|
21119
21119
|
var checkCandidate = (candidate) => {
|
|
21120
|
-
if (!
|
|
21120
|
+
if (!existsSync19(candidate)) {
|
|
21121
21121
|
return null;
|
|
21122
21122
|
}
|
|
21123
|
-
const pkg = JSON.parse(
|
|
21123
|
+
const pkg = JSON.parse(readFileSync14(candidate, "utf-8"));
|
|
21124
21124
|
if (pkg.name === "@absolutejs/absolute") {
|
|
21125
21125
|
const ver = pkg.version;
|
|
21126
21126
|
return ver;
|
|
@@ -21135,7 +21135,7 @@ var checkCandidate = (candidate) => {
|
|
|
21135
21135
|
}, findPackageVersion = () => {
|
|
21136
21136
|
let { dir } = import.meta;
|
|
21137
21137
|
while (dir !== parse(dir).root) {
|
|
21138
|
-
const candidate =
|
|
21138
|
+
const candidate = join22(dir, "package.json");
|
|
21139
21139
|
const version2 = checkCandidate(candidate);
|
|
21140
21140
|
if (version2) {
|
|
21141
21141
|
return version2;
|
|
@@ -21232,17 +21232,17 @@ var exports_buildHMRClient = {};
|
|
|
21232
21232
|
__export(exports_buildHMRClient, {
|
|
21233
21233
|
buildHMRClient: () => buildHMRClient
|
|
21234
21234
|
});
|
|
21235
|
-
import { existsSync as
|
|
21235
|
+
import { existsSync as existsSync20 } from "fs";
|
|
21236
21236
|
import { resolve as resolve16 } from "path";
|
|
21237
21237
|
var {build: bunBuild } = globalThis.Bun;
|
|
21238
21238
|
var resolveHmrClientPath = () => {
|
|
21239
21239
|
const projectRoot = process.cwd();
|
|
21240
21240
|
const fromSource = resolve16(import.meta.dir, "client/hmrClient.ts");
|
|
21241
|
-
if (
|
|
21241
|
+
if (existsSync20(fromSource) && fromSource.startsWith(projectRoot)) {
|
|
21242
21242
|
return fromSource;
|
|
21243
21243
|
}
|
|
21244
21244
|
const fromNodeModules = resolve16(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client/hmrClient.ts");
|
|
21245
|
-
if (
|
|
21245
|
+
if (existsSync20(fromNodeModules))
|
|
21246
21246
|
return fromNodeModules;
|
|
21247
21247
|
return resolve16(import.meta.dir, "dev/client/hmrClient.ts");
|
|
21248
21248
|
}, hmrClientPath2, buildHMRClient = async () => {
|
|
@@ -21376,8 +21376,8 @@ var devVendorPaths = null, getDevVendorPaths = () => devVendorPaths, setDevVendo
|
|
|
21376
21376
|
};
|
|
21377
21377
|
|
|
21378
21378
|
// src/build/angularLinkerPlugin.ts
|
|
21379
|
-
import { existsSync as
|
|
21380
|
-
import { dirname as dirname11, join as
|
|
21379
|
+
import { existsSync as existsSync21, mkdirSync as mkdirSync5, readFileSync as readFileSync15, writeFileSync as writeFileSync6 } from "fs";
|
|
21380
|
+
import { dirname as dirname11, join as join23, relative as relative7, resolve as resolve17 } from "path";
|
|
21381
21381
|
import { createHash as createHash3 } from "crypto";
|
|
21382
21382
|
var CACHE_ROOT, ANGULAR_LINKER_CANDIDATE_RE, createAngularLinkerPlugin = (linkerJitMode) => ({
|
|
21383
21383
|
name: "angular-linker",
|
|
@@ -21385,7 +21385,7 @@ var CACHE_ROOT, ANGULAR_LINKER_CANDIDATE_RE, createAngularLinkerPlugin = (linker
|
|
|
21385
21385
|
let needsLinking;
|
|
21386
21386
|
let babelTransform;
|
|
21387
21387
|
let linkerPlugin;
|
|
21388
|
-
const cacheDir =
|
|
21388
|
+
const cacheDir = join23(CACHE_ROOT, linkerJitMode ? "jit" : "aot");
|
|
21389
21389
|
bld.onLoad({ filter: ANGULAR_LINKER_CANDIDATE_RE }, async (args) => {
|
|
21390
21390
|
const source = await Bun.file(args.path).text();
|
|
21391
21391
|
if (!needsLinking) {
|
|
@@ -21398,10 +21398,10 @@ var CACHE_ROOT, ANGULAR_LINKER_CANDIDATE_RE, createAngularLinkerPlugin = (linker
|
|
|
21398
21398
|
return;
|
|
21399
21399
|
}
|
|
21400
21400
|
const hash = createHash3("md5").update(source).digest("hex");
|
|
21401
|
-
const cachePath =
|
|
21402
|
-
if (
|
|
21401
|
+
const cachePath = join23(cacheDir, `${hash}.js`);
|
|
21402
|
+
if (existsSync21(cachePath)) {
|
|
21403
21403
|
return {
|
|
21404
|
-
contents:
|
|
21404
|
+
contents: readFileSync15(cachePath, "utf-8"),
|
|
21405
21405
|
loader: "js"
|
|
21406
21406
|
};
|
|
21407
21407
|
}
|
|
@@ -21416,8 +21416,8 @@ var CACHE_ROOT, ANGULAR_LINKER_CANDIDATE_RE, createAngularLinkerPlugin = (linker
|
|
|
21416
21416
|
linkerPlugin = mod.createEs2015LinkerPlugin({
|
|
21417
21417
|
fileSystem: {
|
|
21418
21418
|
dirname: dirname11,
|
|
21419
|
-
exists:
|
|
21420
|
-
readFile:
|
|
21419
|
+
exists: existsSync21,
|
|
21420
|
+
readFile: readFileSync15,
|
|
21421
21421
|
relative: relative7,
|
|
21422
21422
|
resolve: resolve17
|
|
21423
21423
|
},
|
|
@@ -21456,8 +21456,8 @@ var init_angularLinkerPlugin = __esm(() => {
|
|
|
21456
21456
|
});
|
|
21457
21457
|
|
|
21458
21458
|
// src/build/externalAssetPlugin.ts
|
|
21459
|
-
import { copyFileSync, existsSync as
|
|
21460
|
-
import { basename as basename5, dirname as dirname12, join as
|
|
21459
|
+
import { copyFileSync, existsSync as existsSync22, mkdirSync as mkdirSync6, statSync } from "fs";
|
|
21460
|
+
import { basename as basename5, dirname as dirname12, join as join24, resolve as resolve18 } from "path";
|
|
21461
21461
|
var createExternalAssetPlugin = (outDir, userSourceRoots = []) => ({
|
|
21462
21462
|
name: "absolute-external-asset",
|
|
21463
21463
|
setup(bld) {
|
|
@@ -21478,12 +21478,12 @@ var createExternalAssetPlugin = (outDir, userSourceRoots = []) => ({
|
|
|
21478
21478
|
if (!relPath)
|
|
21479
21479
|
continue;
|
|
21480
21480
|
const assetPath = resolve18(sourceDir, relPath);
|
|
21481
|
-
if (!
|
|
21481
|
+
if (!existsSync22(assetPath))
|
|
21482
21482
|
continue;
|
|
21483
21483
|
if (!statSync(assetPath).isFile())
|
|
21484
21484
|
continue;
|
|
21485
|
-
const targetPath =
|
|
21486
|
-
if (
|
|
21485
|
+
const targetPath = join24(outDir, basename5(assetPath));
|
|
21486
|
+
if (existsSync22(targetPath))
|
|
21487
21487
|
continue;
|
|
21488
21488
|
mkdirSync6(dirname12(targetPath), { recursive: true });
|
|
21489
21489
|
copyFileSync(assetPath, targetPath);
|
|
@@ -21935,20 +21935,20 @@ __export(exports_generatedDir, {
|
|
|
21935
21935
|
getGeneratedRoot: () => getGeneratedRoot,
|
|
21936
21936
|
getFrameworkGeneratedDir: () => getFrameworkGeneratedDir
|
|
21937
21937
|
});
|
|
21938
|
-
import { join as
|
|
21939
|
-
var GENERATED_DIR_NAME = "generated", ABSOLUTE_CACHE_DIR_NAME = ".absolutejs", getFrameworkGeneratedDir = (framework, projectRoot = process.cwd()) =>
|
|
21938
|
+
import { join as join25 } from "path";
|
|
21939
|
+
var GENERATED_DIR_NAME = "generated", ABSOLUTE_CACHE_DIR_NAME = ".absolutejs", getFrameworkGeneratedDir = (framework, projectRoot = process.cwd()) => join25(getGeneratedRoot(projectRoot), framework), getGeneratedRoot = (projectRoot = process.cwd()) => join25(projectRoot, ABSOLUTE_CACHE_DIR_NAME, GENERATED_DIR_NAME);
|
|
21940
21940
|
var init_generatedDir = () => {};
|
|
21941
21941
|
|
|
21942
21942
|
// src/utils/cleanup.ts
|
|
21943
21943
|
import { rm as rm3 } from "fs/promises";
|
|
21944
|
-
import { join as
|
|
21944
|
+
import { join as join26 } from "path";
|
|
21945
21945
|
var removeIfExists = (path) => rm3(path, { force: true, recursive: true }), cleanFramework = (framework, frameworkDir, skipGenerated = false) => {
|
|
21946
21946
|
const tasks = [];
|
|
21947
21947
|
if (!skipGenerated) {
|
|
21948
21948
|
tasks.push(removeIfExists(getFrameworkGeneratedDir(framework)));
|
|
21949
21949
|
}
|
|
21950
21950
|
if (frameworkDir)
|
|
21951
|
-
tasks.push(removeIfExists(
|
|
21951
|
+
tasks.push(removeIfExists(join26(frameworkDir, "generated")));
|
|
21952
21952
|
return Promise.all(tasks);
|
|
21953
21953
|
}, cleanup = async ({
|
|
21954
21954
|
angularDir,
|
|
@@ -21986,8 +21986,8 @@ var commonAncestor = (paths, fallback) => {
|
|
|
21986
21986
|
var init_commonAncestor = () => {};
|
|
21987
21987
|
|
|
21988
21988
|
// src/utils/buildDirectoryLock.ts
|
|
21989
|
-
import { mkdirSync as mkdirSync7, unlinkSync, writeFileSync as writeFileSync7, readFileSync as
|
|
21990
|
-
import { dirname as dirname13, join as
|
|
21989
|
+
import { mkdirSync as mkdirSync7, unlinkSync, writeFileSync as writeFileSync7, readFileSync as readFileSync16 } from "fs";
|
|
21990
|
+
import { dirname as dirname13, join as join27 } from "path";
|
|
21991
21991
|
var heldLocks, HELD_LOCKS_ENV = "ABSOLUTE_HELD_BUILD_DIRECTORY_LOCKS", exitHandlersRegistered = false, registerExitHandlersOnce = () => {
|
|
21992
21992
|
if (exitHandlersRegistered)
|
|
21993
21993
|
return;
|
|
@@ -22013,7 +22013,7 @@ var heldLocks, HELD_LOCKS_ENV = "ABSOLUTE_HELD_BUILD_DIRECTORY_LOCKS", exitHandl
|
|
|
22013
22013
|
releaseAllSync();
|
|
22014
22014
|
throw err;
|
|
22015
22015
|
});
|
|
22016
|
-
}, isAlreadyExistsError = (error) => error instanceof Error && ("code" in error) && error.code === "EEXIST", lockPathForBuildDirectory = (buildDirectory) =>
|
|
22016
|
+
}, isAlreadyExistsError = (error) => error instanceof Error && ("code" in error) && error.code === "EEXIST", lockPathForBuildDirectory = (buildDirectory) => join27(dirname13(buildDirectory), ".absolutejs", "build.lock"), readHeldLockEnv = () => new Set((process.env[HELD_LOCKS_ENV] ?? "").split(`
|
|
22017
22017
|
`).filter((entry) => entry.length > 0)), writeHeldLockEnv = (locks) => {
|
|
22018
22018
|
if (locks.size === 0) {
|
|
22019
22019
|
delete process.env[HELD_LOCKS_ENV];
|
|
@@ -22034,7 +22034,7 @@ var heldLocks, HELD_LOCKS_ENV = "ABSOLUTE_HELD_BUILD_DIRECTORY_LOCKS", exitHandl
|
|
|
22034
22034
|
writeFileSync7(lockPath, JSON.stringify(metadata2, null, 2), { flag: "wx" });
|
|
22035
22035
|
}, readLockMetadata = (lockPath) => {
|
|
22036
22036
|
try {
|
|
22037
|
-
const raw =
|
|
22037
|
+
const raw = readFileSync16(lockPath, "utf-8");
|
|
22038
22038
|
const parsed = JSON.parse(raw);
|
|
22039
22039
|
if (typeof parsed === "object" && parsed !== null && typeof parsed.pid === "number") {
|
|
22040
22040
|
return {
|
|
@@ -22167,8 +22167,8 @@ var exports_scanVueSsrOnlyPages = {};
|
|
|
22167
22167
|
__export(exports_scanVueSsrOnlyPages, {
|
|
22168
22168
|
scanVueSsrOnlyPages: () => scanVueSsrOnlyPages
|
|
22169
22169
|
});
|
|
22170
|
-
import { readdirSync as readdirSync2, readFileSync as
|
|
22171
|
-
import { join as
|
|
22170
|
+
import { readdirSync as readdirSync2, readFileSync as readFileSync17 } from "fs";
|
|
22171
|
+
import { join as join28 } from "path";
|
|
22172
22172
|
import ts7 from "typescript";
|
|
22173
22173
|
var SKIP_DIRS2, SOURCE_EXTENSIONS2, getScriptKind2 = (filePath) => {
|
|
22174
22174
|
if (filePath.endsWith(".tsx"))
|
|
@@ -22201,9 +22201,9 @@ var SKIP_DIRS2, SOURCE_EXTENSIONS2, getScriptKind2 = (filePath) => {
|
|
|
22201
22201
|
continue;
|
|
22202
22202
|
if (entry.name.startsWith("."))
|
|
22203
22203
|
continue;
|
|
22204
|
-
stack.push(
|
|
22204
|
+
stack.push(join28(dir, entry.name));
|
|
22205
22205
|
} else if (entry.isFile() && hasSourceExtension2(entry.name)) {
|
|
22206
|
-
out.push(
|
|
22206
|
+
out.push(join28(dir, entry.name));
|
|
22207
22207
|
}
|
|
22208
22208
|
}
|
|
22209
22209
|
}
|
|
@@ -22270,7 +22270,7 @@ var SKIP_DIRS2, SOURCE_EXTENSIONS2, getScriptKind2 = (filePath) => {
|
|
|
22270
22270
|
}, extractFromFile = (filePath, out) => {
|
|
22271
22271
|
let source;
|
|
22272
22272
|
try {
|
|
22273
|
-
source =
|
|
22273
|
+
source = readFileSync17(filePath, "utf-8");
|
|
22274
22274
|
} catch {
|
|
22275
22275
|
return;
|
|
22276
22276
|
}
|
|
@@ -22314,8 +22314,8 @@ var init_scanVueSsrOnlyPages = __esm(() => {
|
|
|
22314
22314
|
});
|
|
22315
22315
|
|
|
22316
22316
|
// src/build/scanAngularHandlerCalls.ts
|
|
22317
|
-
import { readdirSync as readdirSync3, readFileSync as
|
|
22318
|
-
import { join as
|
|
22317
|
+
import { readdirSync as readdirSync3, readFileSync as readFileSync18 } from "fs";
|
|
22318
|
+
import { join as join29 } from "path";
|
|
22319
22319
|
import ts8 from "typescript";
|
|
22320
22320
|
var ELYSIA_ROUTE_METHODS2, SKIP_DIRS3, SOURCE_EXTENSIONS3, getScriptKind3 = (filePath) => {
|
|
22321
22321
|
if (filePath.endsWith(".tsx"))
|
|
@@ -22348,9 +22348,9 @@ var ELYSIA_ROUTE_METHODS2, SKIP_DIRS3, SOURCE_EXTENSIONS3, getScriptKind3 = (fil
|
|
|
22348
22348
|
continue;
|
|
22349
22349
|
if (entry.name.startsWith("."))
|
|
22350
22350
|
continue;
|
|
22351
|
-
stack.push(
|
|
22351
|
+
stack.push(join29(dir, entry.name));
|
|
22352
22352
|
} else if (entry.isFile() && hasSourceExtension3(entry.name)) {
|
|
22353
|
-
out.push(
|
|
22353
|
+
out.push(join29(dir, entry.name));
|
|
22354
22354
|
}
|
|
22355
22355
|
}
|
|
22356
22356
|
}
|
|
@@ -22385,7 +22385,7 @@ var ELYSIA_ROUTE_METHODS2, SKIP_DIRS3, SOURCE_EXTENSIONS3, getScriptKind3 = (fil
|
|
|
22385
22385
|
}, extractCallsFromFile = (filePath, out) => {
|
|
22386
22386
|
let source;
|
|
22387
22387
|
try {
|
|
22388
|
-
source =
|
|
22388
|
+
source = readFileSync18(filePath, "utf-8");
|
|
22389
22389
|
} catch {
|
|
22390
22390
|
return;
|
|
22391
22391
|
}
|
|
@@ -22464,8 +22464,8 @@ var init_scanAngularHandlerCalls = __esm(() => {
|
|
|
22464
22464
|
});
|
|
22465
22465
|
|
|
22466
22466
|
// src/build/scanAngularPageRoutes.ts
|
|
22467
|
-
import { readdirSync as readdirSync4, readFileSync as
|
|
22468
|
-
import { basename as basename7, join as
|
|
22467
|
+
import { readdirSync as readdirSync4, readFileSync as readFileSync19 } from "fs";
|
|
22468
|
+
import { basename as basename7, join as join30 } from "path";
|
|
22469
22469
|
import ts9 from "typescript";
|
|
22470
22470
|
var SOURCE_EXTENSIONS4, SKIP_DIRS4, hasSourceExtension4 = (filePath) => {
|
|
22471
22471
|
const idx = filePath.lastIndexOf(".");
|
|
@@ -22505,9 +22505,9 @@ var SOURCE_EXTENSIONS4, SKIP_DIRS4, hasSourceExtension4 = (filePath) => {
|
|
|
22505
22505
|
continue;
|
|
22506
22506
|
if (entry.name.startsWith("."))
|
|
22507
22507
|
continue;
|
|
22508
|
-
stack.push(
|
|
22508
|
+
stack.push(join30(dir, entry.name));
|
|
22509
22509
|
} else if (entry.isFile() && isPageFile(entry.name)) {
|
|
22510
|
-
out.push(
|
|
22510
|
+
out.push(join30(dir, entry.name));
|
|
22511
22511
|
}
|
|
22512
22512
|
}
|
|
22513
22513
|
}
|
|
@@ -22536,7 +22536,7 @@ var SOURCE_EXTENSIONS4, SKIP_DIRS4, hasSourceExtension4 = (filePath) => {
|
|
|
22536
22536
|
for (const file2 of files) {
|
|
22537
22537
|
let source;
|
|
22538
22538
|
try {
|
|
22539
|
-
source =
|
|
22539
|
+
source = readFileSync19(file2, "utf-8");
|
|
22540
22540
|
} catch {
|
|
22541
22541
|
continue;
|
|
22542
22542
|
}
|
|
@@ -22583,8 +22583,8 @@ var exports_parseAngularConfigImports = {};
|
|
|
22583
22583
|
__export(exports_parseAngularConfigImports, {
|
|
22584
22584
|
parseAngularProvidersImport: () => parseAngularProvidersImport
|
|
22585
22585
|
});
|
|
22586
|
-
import { existsSync as
|
|
22587
|
-
import { dirname as dirname14, isAbsolute as isAbsolute3, join as
|
|
22586
|
+
import { existsSync as existsSync23, readFileSync as readFileSync20 } from "fs";
|
|
22587
|
+
import { dirname as dirname14, isAbsolute as isAbsolute3, join as join31 } from "path";
|
|
22588
22588
|
import ts10 from "typescript";
|
|
22589
22589
|
var findDefineConfigCall = (sf) => {
|
|
22590
22590
|
let result = null;
|
|
@@ -22639,18 +22639,18 @@ var findDefineConfigCall = (sf) => {
|
|
|
22639
22639
|
}, resolveConfigPath = (projectRoot) => {
|
|
22640
22640
|
const envOverride = process.env.ABSOLUTE_CONFIG;
|
|
22641
22641
|
if (envOverride) {
|
|
22642
|
-
const resolved = isAbsolute3(envOverride) ? envOverride :
|
|
22643
|
-
if (
|
|
22642
|
+
const resolved = isAbsolute3(envOverride) ? envOverride : join31(projectRoot, envOverride);
|
|
22643
|
+
if (existsSync23(resolved))
|
|
22644
22644
|
return resolved;
|
|
22645
22645
|
}
|
|
22646
22646
|
const candidates = [
|
|
22647
|
-
|
|
22648
|
-
|
|
22649
|
-
|
|
22650
|
-
|
|
22647
|
+
join31(projectRoot, "absolute.config.ts"),
|
|
22648
|
+
join31(projectRoot, "absolute.config.mts"),
|
|
22649
|
+
join31(projectRoot, "absolute.config.js"),
|
|
22650
|
+
join31(projectRoot, "absolute.config.mjs")
|
|
22651
22651
|
];
|
|
22652
22652
|
for (const candidate of candidates) {
|
|
22653
|
-
if (
|
|
22653
|
+
if (existsSync23(candidate))
|
|
22654
22654
|
return candidate;
|
|
22655
22655
|
}
|
|
22656
22656
|
return null;
|
|
@@ -22658,7 +22658,7 @@ var findDefineConfigCall = (sf) => {
|
|
|
22658
22658
|
const configPath2 = resolveConfigPath(projectRoot);
|
|
22659
22659
|
if (!configPath2)
|
|
22660
22660
|
return null;
|
|
22661
|
-
const source =
|
|
22661
|
+
const source = readFileSync20(configPath2, "utf-8");
|
|
22662
22662
|
if (!source.includes("angular"))
|
|
22663
22663
|
return null;
|
|
22664
22664
|
if (!source.includes("providers"))
|
|
@@ -22680,7 +22680,7 @@ var findDefineConfigCall = (sf) => {
|
|
|
22680
22680
|
if (!importInfo)
|
|
22681
22681
|
return null;
|
|
22682
22682
|
const configDir2 = dirname14(configPath2);
|
|
22683
|
-
const absolutePath = importInfo.source.startsWith(".") ?
|
|
22683
|
+
const absolutePath = importInfo.source.startsWith(".") ? join31(configDir2, importInfo.source).replace(/\.[cm]?[tj]sx?$/, "") : isAbsolute3(importInfo.source) ? importInfo.source.replace(/\.[cm]?[tj]sx?$/, "") : importInfo.source;
|
|
22684
22684
|
return {
|
|
22685
22685
|
absolutePath,
|
|
22686
22686
|
bindingName: binding,
|
|
@@ -22751,11 +22751,11 @@ __export(exports_compileSvelte, {
|
|
|
22751
22751
|
compileSvelte: () => compileSvelte,
|
|
22752
22752
|
clearSvelteCompilerCache: () => clearSvelteCompilerCache
|
|
22753
22753
|
});
|
|
22754
|
-
import { existsSync as
|
|
22754
|
+
import { existsSync as existsSync24 } from "fs";
|
|
22755
22755
|
import { mkdir as mkdir5, stat as stat2 } from "fs/promises";
|
|
22756
22756
|
import {
|
|
22757
22757
|
dirname as dirname15,
|
|
22758
|
-
join as
|
|
22758
|
+
join as join32,
|
|
22759
22759
|
basename as basename8,
|
|
22760
22760
|
extname as extname5,
|
|
22761
22761
|
resolve as resolve22,
|
|
@@ -22767,11 +22767,11 @@ var {write: write2, file: file2, Transpiler: Transpiler2 } = globalThis.Bun;
|
|
|
22767
22767
|
var resolveDevClientDir2 = () => {
|
|
22768
22768
|
const projectRoot = process.cwd();
|
|
22769
22769
|
const fromSource = resolve22(import.meta.dir, "../dev/client");
|
|
22770
|
-
if (
|
|
22770
|
+
if (existsSync24(fromSource) && fromSource.startsWith(projectRoot)) {
|
|
22771
22771
|
return fromSource;
|
|
22772
22772
|
}
|
|
22773
22773
|
const fromNodeModules = resolve22(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client");
|
|
22774
|
-
if (
|
|
22774
|
+
if (existsSync24(fromNodeModules))
|
|
22775
22775
|
return fromNodeModules;
|
|
22776
22776
|
return resolve22(import.meta.dir, "./dev/client");
|
|
22777
22777
|
}, devClientDir2, hmrClientPath3, persistentCache, sourceHashCache, clearSvelteCompilerCache = () => {
|
|
@@ -22814,14 +22814,14 @@ var resolveDevClientDir2 = () => {
|
|
|
22814
22814
|
`${basePath}.svelte`,
|
|
22815
22815
|
`${basePath}.svelte.ts`,
|
|
22816
22816
|
`${basePath}.svelte.js`,
|
|
22817
|
-
|
|
22818
|
-
|
|
22819
|
-
|
|
22820
|
-
|
|
22821
|
-
|
|
22822
|
-
|
|
22823
|
-
|
|
22824
|
-
|
|
22817
|
+
join32(basePath, "index.ts"),
|
|
22818
|
+
join32(basePath, "index.js"),
|
|
22819
|
+
join32(basePath, "index.mjs"),
|
|
22820
|
+
join32(basePath, "index.cjs"),
|
|
22821
|
+
join32(basePath, "index.json"),
|
|
22822
|
+
join32(basePath, "index.svelte"),
|
|
22823
|
+
join32(basePath, "index.svelte.ts"),
|
|
22824
|
+
join32(basePath, "index.svelte.js")
|
|
22825
22825
|
];
|
|
22826
22826
|
const checks = await Promise.all(candidates.map(exists));
|
|
22827
22827
|
return candidates.find((_2, index) => checks[index]) ?? null;
|
|
@@ -22860,9 +22860,9 @@ var resolveDevClientDir2 = () => {
|
|
|
22860
22860
|
}, compileSvelte = async (entryPoints, svelteRoot, cache = new Map, isDev2 = false, stylePreprocessors) => {
|
|
22861
22861
|
const { compile, compileModule, preprocess } = await import("svelte/compiler");
|
|
22862
22862
|
const generatedDir = getFrameworkGeneratedDir("svelte");
|
|
22863
|
-
const clientDir =
|
|
22864
|
-
const indexDir =
|
|
22865
|
-
const serverDir =
|
|
22863
|
+
const clientDir = join32(generatedDir, "client");
|
|
22864
|
+
const indexDir = join32(generatedDir, "indexes");
|
|
22865
|
+
const serverDir = join32(generatedDir, "server");
|
|
22866
22866
|
await Promise.all([clientDir, indexDir, serverDir].map((dir) => mkdir5(dir, { recursive: true })));
|
|
22867
22867
|
const dev = env2.NODE_ENV !== "production";
|
|
22868
22868
|
const build2 = async (src) => {
|
|
@@ -22874,7 +22874,7 @@ var resolveDevClientDir2 = () => {
|
|
|
22874
22874
|
const contentHash = Bun.hash(raw).toString(BASE_36_RADIX);
|
|
22875
22875
|
const prevHash = sourceHashCache.get(src);
|
|
22876
22876
|
const persistent = persistentCache.get(src);
|
|
22877
|
-
if (prevHash === contentHash && persistent &&
|
|
22877
|
+
if (prevHash === contentHash && persistent && existsSync24(persistent.ssr) && existsSync24(persistent.client)) {
|
|
22878
22878
|
cache.set(src, persistent);
|
|
22879
22879
|
return persistent;
|
|
22880
22880
|
}
|
|
@@ -22900,8 +22900,8 @@ var resolveDevClientDir2 = () => {
|
|
|
22900
22900
|
const childBuilt = await Promise.all(childSources.map((child) => build2(child)));
|
|
22901
22901
|
const hasAwaitSlotFromChildren = childBuilt.some((child) => child.hasAwaitSlot);
|
|
22902
22902
|
const externalRewrites = new Map;
|
|
22903
|
-
const ssrOutputDir = dirname15(
|
|
22904
|
-
const clientOutputDir = dirname15(
|
|
22903
|
+
const ssrOutputDir = dirname15(join32(serverDir, relDir, `${baseName}.js`));
|
|
22904
|
+
const clientOutputDir = dirname15(join32(clientDir, relDir, `${baseName}.js`));
|
|
22905
22905
|
for (let idx = 0;idx < importPaths.length; idx++) {
|
|
22906
22906
|
const rawSpec = importPaths[idx];
|
|
22907
22907
|
if (!rawSpec)
|
|
@@ -22966,8 +22966,8 @@ var resolveDevClientDir2 = () => {
|
|
|
22966
22966
|
code += islandMetadataExports;
|
|
22967
22967
|
return { code, map: compiledJs.map };
|
|
22968
22968
|
};
|
|
22969
|
-
const ssrPath =
|
|
22970
|
-
const clientPath =
|
|
22969
|
+
const ssrPath = join32(serverDir, relDir, `${baseName}.js`);
|
|
22970
|
+
const clientPath = join32(clientDir, relDir, `${baseName}.js`);
|
|
22971
22971
|
await Promise.all([
|
|
22972
22972
|
mkdir5(dirname15(ssrPath), { recursive: true }),
|
|
22973
22973
|
mkdir5(dirname15(clientPath), { recursive: true })
|
|
@@ -23005,7 +23005,7 @@ var resolveDevClientDir2 = () => {
|
|
|
23005
23005
|
await Promise.all(roots.map(async ({ client: client2, hasAwaitSlot }) => {
|
|
23006
23006
|
const relClientDir = dirname15(relative10(clientDir, client2));
|
|
23007
23007
|
const name = basename8(client2, extname5(client2));
|
|
23008
|
-
const indexPath =
|
|
23008
|
+
const indexPath = join32(indexDir, relClientDir, `${name}.js`);
|
|
23009
23009
|
const importRaw = relative10(dirname15(indexPath), client2).split(sep2).join("/");
|
|
23010
23010
|
const importPath = importRaw.startsWith(".") || importRaw.startsWith("/") ? importRaw : `./${importRaw}`;
|
|
23011
23011
|
const hmrImports = isDev2 ? `window.__HMR_FRAMEWORK__ = "svelte";
|
|
@@ -23084,7 +23084,7 @@ if (typeof window !== "undefined") {
|
|
|
23084
23084
|
svelteClientPaths: roots.map(({ client: client2 }) => client2),
|
|
23085
23085
|
svelteIndexPaths: roots.map(({ client: client2 }) => {
|
|
23086
23086
|
const rel = dirname15(relative10(clientDir, client2));
|
|
23087
|
-
return
|
|
23087
|
+
return join32(indexDir, rel, basename8(client2));
|
|
23088
23088
|
}),
|
|
23089
23089
|
svelteServerPaths: roots.map(({ ssr }) => ssr)
|
|
23090
23090
|
};
|
|
@@ -23099,7 +23099,7 @@ var init_compileSvelte = __esm(() => {
|
|
|
23099
23099
|
init_lowerAwaitSlotSyntax();
|
|
23100
23100
|
init_renderToReadableStream();
|
|
23101
23101
|
devClientDir2 = resolveDevClientDir2();
|
|
23102
|
-
hmrClientPath3 =
|
|
23102
|
+
hmrClientPath3 = join32(devClientDir2, "hmrClient.ts").replace(/\\/g, "/");
|
|
23103
23103
|
persistentCache = new Map;
|
|
23104
23104
|
sourceHashCache = new Map;
|
|
23105
23105
|
transpiler3 = new Transpiler2({ loader: "ts", target: "browser" });
|
|
@@ -23133,7 +23133,7 @@ __export(exports_chainInlineSourcemaps, {
|
|
|
23133
23133
|
chainBundleInlineSourcemap: () => chainBundleInlineSourcemap,
|
|
23134
23134
|
buildLineRemap: () => buildLineRemap
|
|
23135
23135
|
});
|
|
23136
|
-
import { readFileSync as
|
|
23136
|
+
import { readFileSync as readFileSync21, writeFileSync as writeFileSync8 } from "fs";
|
|
23137
23137
|
var BASE64_CHARS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", BASE64_TO_INT, decodeVlq = (str, startPos) => {
|
|
23138
23138
|
let result = 0;
|
|
23139
23139
|
let shift = 0;
|
|
@@ -23424,7 +23424,7 @@ var BASE64_CHARS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz01234567
|
|
|
23424
23424
|
version: 3
|
|
23425
23425
|
};
|
|
23426
23426
|
}, chainBundleInlineSourcemap = (bundleFilePath) => {
|
|
23427
|
-
const text =
|
|
23427
|
+
const text = readFileSync21(bundleFilePath, "utf-8");
|
|
23428
23428
|
const outerMap = extractInlineMap(text);
|
|
23429
23429
|
if (!outerMap)
|
|
23430
23430
|
return;
|
|
@@ -23510,13 +23510,13 @@ __export(exports_compileVue, {
|
|
|
23510
23510
|
compileVue: () => compileVue,
|
|
23511
23511
|
clearVueHmrCaches: () => clearVueHmrCaches
|
|
23512
23512
|
});
|
|
23513
|
-
import { existsSync as
|
|
23513
|
+
import { existsSync as existsSync25, readFileSync as readFileSync22, realpathSync as realpathSync2 } from "fs";
|
|
23514
23514
|
import { mkdir as mkdir6 } from "fs/promises";
|
|
23515
23515
|
import {
|
|
23516
23516
|
basename as basename9,
|
|
23517
23517
|
dirname as dirname16,
|
|
23518
23518
|
isAbsolute as isAbsolute4,
|
|
23519
|
-
join as
|
|
23519
|
+
join as join33,
|
|
23520
23520
|
relative as relative11,
|
|
23521
23521
|
resolve as resolve23
|
|
23522
23522
|
} from "path";
|
|
@@ -23524,11 +23524,11 @@ var {file: file3, write: write3, Transpiler: Transpiler3 } = globalThis.Bun;
|
|
|
23524
23524
|
var resolveDevClientDir3 = () => {
|
|
23525
23525
|
const projectRoot = process.cwd();
|
|
23526
23526
|
const fromSource = resolve23(import.meta.dir, "../dev/client");
|
|
23527
|
-
if (
|
|
23527
|
+
if (existsSync25(fromSource) && fromSource.startsWith(projectRoot)) {
|
|
23528
23528
|
return fromSource;
|
|
23529
23529
|
}
|
|
23530
23530
|
const fromNodeModules = resolve23(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client");
|
|
23531
|
-
if (
|
|
23531
|
+
if (existsSync25(fromNodeModules))
|
|
23532
23532
|
return fromNodeModules;
|
|
23533
23533
|
return resolve23(import.meta.dir, "./dev/client");
|
|
23534
23534
|
}, devClientDir3, hmrClientPath4, transpiler4, scriptCache, scriptSetupCache, templateCache, styleCache, persistentBuildCache, vueSourceHashCache, vueHmrMetadata, clearVueHmrCaches = () => {
|
|
@@ -23577,19 +23577,19 @@ var resolveDevClientDir3 = () => {
|
|
|
23577
23577
|
const importRegex = /@import\s+(?:url\(\s*)?(['"])(\.{1,2}\/[^'"]+)\1\s*\)?\s*;?/g;
|
|
23578
23578
|
return cssContent.replace(importRegex, (match, _quote, relPath) => {
|
|
23579
23579
|
const importedPath = resolve23(dirname16(cssFilePath), relPath);
|
|
23580
|
-
if (!
|
|
23580
|
+
if (!existsSync25(importedPath))
|
|
23581
23581
|
return match;
|
|
23582
|
-
const importedContent =
|
|
23582
|
+
const importedContent = readFileSync22(importedPath, "utf-8");
|
|
23583
23583
|
return inlineCssImports(importedContent, importedPath, visited);
|
|
23584
23584
|
});
|
|
23585
23585
|
}, resolveHelperTsPath = (sourceDir, helper) => {
|
|
23586
23586
|
if (helper.endsWith(".ts"))
|
|
23587
23587
|
return resolve23(sourceDir, helper);
|
|
23588
23588
|
const direct = resolve23(sourceDir, `${helper}.ts`);
|
|
23589
|
-
if (
|
|
23589
|
+
if (existsSync25(direct))
|
|
23590
23590
|
return direct;
|
|
23591
23591
|
const indexed = resolve23(sourceDir, helper, "index.ts");
|
|
23592
|
-
if (
|
|
23592
|
+
if (existsSync25(indexed))
|
|
23593
23593
|
return indexed;
|
|
23594
23594
|
return direct;
|
|
23595
23595
|
}, toJs = (filePath, sourceDir) => {
|
|
@@ -23605,10 +23605,10 @@ var resolveDevClientDir3 = () => {
|
|
|
23605
23605
|
}
|
|
23606
23606
|
if (sourceDir && (filePath.startsWith("./") || filePath.startsWith("../"))) {
|
|
23607
23607
|
const directTs = resolve23(sourceDir, `${filePath}.ts`);
|
|
23608
|
-
if (
|
|
23608
|
+
if (existsSync25(directTs))
|
|
23609
23609
|
return `${filePath}.js`;
|
|
23610
23610
|
const indexedTs = resolve23(sourceDir, filePath, "index.ts");
|
|
23611
|
-
if (
|
|
23611
|
+
if (existsSync25(indexedTs))
|
|
23612
23612
|
return `${filePath}/index.js`;
|
|
23613
23613
|
}
|
|
23614
23614
|
return `${filePath}.js`;
|
|
@@ -23643,7 +23643,7 @@ var resolveDevClientDir3 = () => {
|
|
|
23643
23643
|
const contentHash = Bun.hash(sourceContent).toString(BASE_36_RADIX);
|
|
23644
23644
|
const prevHash = vueSourceHashCache.get(sourceFilePath);
|
|
23645
23645
|
const persistent = persistentBuildCache.get(sourceFilePath);
|
|
23646
|
-
if (prevHash === contentHash && persistent &&
|
|
23646
|
+
if (prevHash === contentHash && persistent && existsSync25(persistent.clientPath) && existsSync25(persistent.serverPath)) {
|
|
23647
23647
|
cacheMap.set(sourceFilePath, persistent);
|
|
23648
23648
|
return persistent;
|
|
23649
23649
|
}
|
|
@@ -23683,8 +23683,8 @@ var resolveDevClientDir3 = () => {
|
|
|
23683
23683
|
const hasScript = descriptor.script || descriptor.scriptSetup;
|
|
23684
23684
|
const compiledScript = hasScript ? compiler.compileScript(descriptor, {
|
|
23685
23685
|
fs: {
|
|
23686
|
-
fileExists:
|
|
23687
|
-
readFile: (file4) =>
|
|
23686
|
+
fileExists: existsSync25,
|
|
23687
|
+
readFile: (file4) => existsSync25(file4) ? readFileSync22(file4, "utf-8") : undefined,
|
|
23688
23688
|
realpath: realpathSync2
|
|
23689
23689
|
},
|
|
23690
23690
|
id: componentId,
|
|
@@ -23737,7 +23737,7 @@ var resolveDevClientDir3 = () => {
|
|
|
23737
23737
|
];
|
|
23738
23738
|
let cssOutputPaths = [];
|
|
23739
23739
|
if (isEntryPoint && allCss.length) {
|
|
23740
|
-
const cssOutputFile =
|
|
23740
|
+
const cssOutputFile = join33(outputDirs.css, `${toKebab(fileBaseName)}-compiled.css`);
|
|
23741
23741
|
await mkdir6(dirname16(cssOutputFile), { recursive: true });
|
|
23742
23742
|
await write3(cssOutputFile, allCss.join(`
|
|
23743
23743
|
`));
|
|
@@ -23768,8 +23768,8 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
23768
23768
|
};
|
|
23769
23769
|
const clientCode = assembleModule(generateRenderFunction(false), "render", true) + islandMetadataExports;
|
|
23770
23770
|
const serverCode = assembleModule(generateRenderFunction(true), "ssrRender", false) + islandMetadataExports;
|
|
23771
|
-
const clientOutputPath =
|
|
23772
|
-
const serverOutputPath =
|
|
23771
|
+
const clientOutputPath = join33(outputDirs.client, `${relativeWithoutExtension}.js`);
|
|
23772
|
+
const serverOutputPath = join33(outputDirs.server, `${relativeWithoutExtension}.js`);
|
|
23773
23773
|
const rewritePackageImports = (code, outputPath, mode) => {
|
|
23774
23774
|
let result2 = code;
|
|
23775
23775
|
for (const [bareImport, paths] of packageImportRewrites) {
|
|
@@ -23815,10 +23815,10 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
23815
23815
|
}, compileVue = async (entryPoints, vueRootDir, isDev2 = false, stylePreprocessors, ssrOnlyEntries) => {
|
|
23816
23816
|
const compiler = await import("@vue/compiler-sfc");
|
|
23817
23817
|
const generatedDir = getFrameworkGeneratedDir("vue");
|
|
23818
|
-
const clientOutputDir =
|
|
23819
|
-
const indexOutputDir =
|
|
23820
|
-
const serverOutputDir =
|
|
23821
|
-
const cssOutputDir =
|
|
23818
|
+
const clientOutputDir = join33(generatedDir, "client");
|
|
23819
|
+
const indexOutputDir = join33(generatedDir, "indexes");
|
|
23820
|
+
const serverOutputDir = join33(generatedDir, "server");
|
|
23821
|
+
const cssOutputDir = join33(generatedDir, "compiled");
|
|
23822
23822
|
await Promise.all([
|
|
23823
23823
|
mkdir6(clientOutputDir, { recursive: true }),
|
|
23824
23824
|
mkdir6(indexOutputDir, { recursive: true }),
|
|
@@ -23846,8 +23846,8 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
23846
23846
|
};
|
|
23847
23847
|
}
|
|
23848
23848
|
const entryBaseName = basename9(entryPath, ".vue");
|
|
23849
|
-
const indexOutputFile =
|
|
23850
|
-
const clientOutputFile =
|
|
23849
|
+
const indexOutputFile = join33(indexOutputDir, `${entryBaseName}.js`);
|
|
23850
|
+
const clientOutputFile = join33(clientOutputDir, relative11(vueRootDir, entryPath).replace(/\\/g, "/").replace(/\.vue$/, ".js"));
|
|
23851
23851
|
await mkdir6(dirname16(indexOutputFile), { recursive: true });
|
|
23852
23852
|
const vueHmrImports = isDev2 ? [
|
|
23853
23853
|
`window.__HMR_FRAMEWORK__ = "vue";`,
|
|
@@ -24010,7 +24010,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
24010
24010
|
continue;
|
|
24011
24011
|
}
|
|
24012
24012
|
const resolved = resolveHelperTsPath(helperDir, dep);
|
|
24013
|
-
if (!
|
|
24013
|
+
if (!existsSync25(resolved))
|
|
24014
24014
|
continue;
|
|
24015
24015
|
if (allTsHelperPaths.has(resolved))
|
|
24016
24016
|
continue;
|
|
@@ -24022,8 +24022,8 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
24022
24022
|
const sourceCode = await file3(tsPath).text();
|
|
24023
24023
|
const transpiledCode = transpiler4.transformSync(sourceCode);
|
|
24024
24024
|
const relativeJsPath = relative11(vueRootDir, tsPath).replace(/\.ts$/, ".js");
|
|
24025
|
-
const outClientPath =
|
|
24026
|
-
const outServerPath =
|
|
24025
|
+
const outClientPath = join33(clientOutputDir, relativeJsPath);
|
|
24026
|
+
const outServerPath = join33(serverOutputDir, relativeJsPath);
|
|
24027
24027
|
await mkdir6(dirname16(outClientPath), { recursive: true });
|
|
24028
24028
|
await mkdir6(dirname16(outServerPath), { recursive: true });
|
|
24029
24029
|
await write3(outClientPath, transpiledCode);
|
|
@@ -24055,7 +24055,7 @@ var init_compileVue = __esm(() => {
|
|
|
24055
24055
|
init_vueAutoRouterTransform();
|
|
24056
24056
|
init_stylePreprocessor();
|
|
24057
24057
|
devClientDir3 = resolveDevClientDir3();
|
|
24058
|
-
hmrClientPath4 =
|
|
24058
|
+
hmrClientPath4 = join33(devClientDir3, "hmrClient.ts").replace(/\\/g, "/");
|
|
24059
24059
|
transpiler4 = new Transpiler3({ loader: "ts", target: "browser" });
|
|
24060
24060
|
scriptCache = new Map;
|
|
24061
24061
|
scriptSetupCache = new Map;
|
|
@@ -24536,8 +24536,8 @@ __export(exports_compileAngular, {
|
|
|
24536
24536
|
compileAngularFile: () => compileAngularFile,
|
|
24537
24537
|
compileAngular: () => compileAngular
|
|
24538
24538
|
});
|
|
24539
|
-
import { existsSync as
|
|
24540
|
-
import { join as
|
|
24539
|
+
import { existsSync as existsSync26, readFileSync as readFileSync23, promises as fs5 } from "fs";
|
|
24540
|
+
import { join as join34, basename as basename10, sep as sep3, dirname as dirname17, resolve as resolve24, relative as relative12 } from "path";
|
|
24541
24541
|
var {Glob: Glob6 } = globalThis.Bun;
|
|
24542
24542
|
import ts11 from "typescript";
|
|
24543
24543
|
var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
@@ -24580,12 +24580,12 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
24580
24580
|
`${candidate}.tsx`,
|
|
24581
24581
|
`${candidate}.js`,
|
|
24582
24582
|
`${candidate}.jsx`,
|
|
24583
|
-
|
|
24584
|
-
|
|
24585
|
-
|
|
24586
|
-
|
|
24583
|
+
join34(candidate, "index.ts"),
|
|
24584
|
+
join34(candidate, "index.tsx"),
|
|
24585
|
+
join34(candidate, "index.js"),
|
|
24586
|
+
join34(candidate, "index.jsx")
|
|
24587
24587
|
];
|
|
24588
|
-
return candidates.find((file4) =>
|
|
24588
|
+
return candidates.find((file4) => existsSync26(file4));
|
|
24589
24589
|
}, createLegacyAngularAnimationUsageResolver = (rootDir) => {
|
|
24590
24590
|
const baseDir = resolve24(rootDir);
|
|
24591
24591
|
const tsconfigAliases = readTsconfigPathAliases();
|
|
@@ -24666,11 +24666,11 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
24666
24666
|
}, resolveDevClientDir4 = () => {
|
|
24667
24667
|
const projectRoot = process.cwd();
|
|
24668
24668
|
const fromSource = resolve24(import.meta.dir, "../dev/client");
|
|
24669
|
-
if (
|
|
24669
|
+
if (existsSync26(fromSource) && fromSource.startsWith(projectRoot)) {
|
|
24670
24670
|
return fromSource;
|
|
24671
24671
|
}
|
|
24672
24672
|
const fromNodeModules = resolve24(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client");
|
|
24673
|
-
if (
|
|
24673
|
+
if (existsSync26(fromNodeModules))
|
|
24674
24674
|
return fromNodeModules;
|
|
24675
24675
|
return resolve24(import.meta.dir, "./dev/client");
|
|
24676
24676
|
}, devClientDir4, hmrClientPath5, formatDiagnosticMessage = (diagnostic) => {
|
|
@@ -24716,11 +24716,11 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
24716
24716
|
return `${path}${query}`;
|
|
24717
24717
|
const importerDir = dirname17(importerOutputPath);
|
|
24718
24718
|
const fileCandidate = resolve24(importerDir, `${path}.js`);
|
|
24719
|
-
if (outputFiles?.has(fileCandidate) ||
|
|
24719
|
+
if (outputFiles?.has(fileCandidate) || existsSync26(fileCandidate)) {
|
|
24720
24720
|
return `${path}.js${query}`;
|
|
24721
24721
|
}
|
|
24722
24722
|
const indexCandidate = resolve24(importerDir, path, "index.js");
|
|
24723
|
-
if (outputFiles?.has(indexCandidate) ||
|
|
24723
|
+
if (outputFiles?.has(indexCandidate) || existsSync26(indexCandidate)) {
|
|
24724
24724
|
return `${path}/index.js${query}`;
|
|
24725
24725
|
}
|
|
24726
24726
|
return `${path}.js${query}`;
|
|
@@ -24753,12 +24753,12 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
24753
24753
|
`${basePath}.tsx`,
|
|
24754
24754
|
`${basePath}.mts`,
|
|
24755
24755
|
`${basePath}.cts`,
|
|
24756
|
-
|
|
24757
|
-
|
|
24758
|
-
|
|
24759
|
-
|
|
24756
|
+
join34(basePath, "index.ts"),
|
|
24757
|
+
join34(basePath, "index.tsx"),
|
|
24758
|
+
join34(basePath, "index.mts"),
|
|
24759
|
+
join34(basePath, "index.cts")
|
|
24760
24760
|
];
|
|
24761
|
-
return candidates.map((candidate) => resolve24(candidate)).find((candidate) =>
|
|
24761
|
+
return candidates.map((candidate) => resolve24(candidate)).find((candidate) => existsSync26(candidate) && !candidate.endsWith(".d.ts")) ?? null;
|
|
24762
24762
|
}, readFileForAotTransform = async (fileName, readFile6) => {
|
|
24763
24763
|
const hostSource = readFile6?.(fileName);
|
|
24764
24764
|
if (typeof hostSource === "string")
|
|
@@ -24782,15 +24782,15 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
24782
24782
|
const paths = [];
|
|
24783
24783
|
const templateUrlMatch = findUncommentedMatch(source, /templateUrl\s*:\s*['"]([^'"]+)['"]/);
|
|
24784
24784
|
if (templateUrlMatch?.[1])
|
|
24785
|
-
paths.push(
|
|
24785
|
+
paths.push(join34(fileDir, templateUrlMatch[1]));
|
|
24786
24786
|
const styleUrlMatch = findUncommentedMatch(source, /styleUrl\s*:\s*['"]([^'"]+)['"]/);
|
|
24787
24787
|
if (styleUrlMatch?.[1])
|
|
24788
|
-
paths.push(
|
|
24788
|
+
paths.push(join34(fileDir, styleUrlMatch[1]));
|
|
24789
24789
|
const styleUrlsMatch = findUncommentedMatch(source, /styleUrls\s*:\s*\[([^\]]+)\]/);
|
|
24790
24790
|
const urlMatches = styleUrlsMatch?.[1]?.match(/['"]([^'"]+)['"]/g);
|
|
24791
24791
|
if (urlMatches) {
|
|
24792
24792
|
for (const urlMatch of urlMatches) {
|
|
24793
|
-
paths.push(
|
|
24793
|
+
paths.push(join34(fileDir, urlMatch.replace(/['"]/g, "")));
|
|
24794
24794
|
}
|
|
24795
24795
|
}
|
|
24796
24796
|
return paths.map((path) => resolve24(path));
|
|
@@ -24824,7 +24824,7 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
24824
24824
|
safeStableStringify(stylePreprocessors ?? null)
|
|
24825
24825
|
].join("\x00");
|
|
24826
24826
|
const cacheKey2 = Bun.hash(cacheInput).toString(BASE_36_RADIX);
|
|
24827
|
-
return
|
|
24827
|
+
return join34(process.cwd(), ".absolutejs", "cache", "angular-resources", `${cacheKey2}.json`);
|
|
24828
24828
|
}, precomputeAotResourceTransforms = async (inputPaths, readFile6, stylePreprocessors) => {
|
|
24829
24829
|
const transformedSources = new Map;
|
|
24830
24830
|
const visited = new Set;
|
|
@@ -24839,7 +24839,7 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
24839
24839
|
if (visited.has(resolvedPath))
|
|
24840
24840
|
return;
|
|
24841
24841
|
visited.add(resolvedPath);
|
|
24842
|
-
if (!
|
|
24842
|
+
if (!existsSync26(resolvedPath) || resolvedPath.endsWith(".d.ts"))
|
|
24843
24843
|
return;
|
|
24844
24844
|
stats.filesVisited += 1;
|
|
24845
24845
|
const source = await readFileForAotTransform(resolvedPath, readFile6);
|
|
@@ -24870,10 +24870,10 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
24870
24870
|
return { stats, transformedSources };
|
|
24871
24871
|
}, compileAngularFiles = async (inputPaths, outDir, stylePreprocessors) => {
|
|
24872
24872
|
const islandMetadataByOutputPath = await traceAngularPhase("aot/island-metadata", () => new Map(inputPaths.map((inputPath) => {
|
|
24873
|
-
const outputPath = resolve24(
|
|
24873
|
+
const outputPath = resolve24(join34(outDir, relative12(process.cwd(), resolve24(inputPath)).replace(/\.[cm]?[tj]sx?$/, ".js")));
|
|
24874
24874
|
return [
|
|
24875
24875
|
outputPath,
|
|
24876
|
-
buildIslandMetadataExports(
|
|
24876
|
+
buildIslandMetadataExports(readFileSync23(inputPath, "utf-8"))
|
|
24877
24877
|
];
|
|
24878
24878
|
})), { entries: inputPaths.length });
|
|
24879
24879
|
await traceAngularPhase("aot/preload-compiler", () => import("@angular/compiler"));
|
|
@@ -24917,7 +24917,7 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
24917
24917
|
const originalGetSourceFile = host.getSourceFile;
|
|
24918
24918
|
host.getSourceFile = (fileName, languageVersion, onError) => {
|
|
24919
24919
|
if (fileName.startsWith("lib.") && fileName.endsWith(".d.ts") && tsLibDir) {
|
|
24920
|
-
const resolvedPath =
|
|
24920
|
+
const resolvedPath = join34(tsLibDir, fileName);
|
|
24921
24921
|
return originalGetSourceFile?.call(host, resolvedPath, languageVersion, onError);
|
|
24922
24922
|
}
|
|
24923
24923
|
return originalGetSourceFile?.call(host, fileName, languageVersion, onError);
|
|
@@ -24972,7 +24972,7 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
24972
24972
|
const entries = await traceAngularPhase("aot/postprocess-emitted-js", () => {
|
|
24973
24973
|
const rawEntries = Object.entries(emitted).filter(([fileName]) => fileName.endsWith(".js")).map(([fileName, content]) => ({
|
|
24974
24974
|
content,
|
|
24975
|
-
target:
|
|
24975
|
+
target: join34(outDir, fileName)
|
|
24976
24976
|
}));
|
|
24977
24977
|
const outputFiles = new Set(rawEntries.map(({ target }) => resolve24(target)));
|
|
24978
24978
|
return rawEntries.map(({ content, target }) => {
|
|
@@ -25013,7 +25013,7 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
25013
25013
|
return null;
|
|
25014
25014
|
}, resolveAngularDeferImportSpecifier = () => {
|
|
25015
25015
|
const sourceEntry = resolve24(import.meta.dir, "../angular/components/index.ts");
|
|
25016
|
-
if (
|
|
25016
|
+
if (existsSync26(sourceEntry)) {
|
|
25017
25017
|
return sourceEntry.replace(/\\/g, "/");
|
|
25018
25018
|
}
|
|
25019
25019
|
return "@absolutejs/absolute/angular/components";
|
|
@@ -25141,7 +25141,7 @@ ${slot.resolvedBindings.map((binding) => ` "${binding.key}": this.__absoluteDef
|
|
|
25141
25141
|
${fields}
|
|
25142
25142
|
`);
|
|
25143
25143
|
}, readAndEscapeFile = async (filePath, stylePreprocessors) => {
|
|
25144
|
-
if (!
|
|
25144
|
+
if (!existsSync26(filePath)) {
|
|
25145
25145
|
throw new Error(`Unable to inline Angular style resource: file not found at ${filePath}`);
|
|
25146
25146
|
}
|
|
25147
25147
|
const content = await compileStyleFileIfNeeded(filePath, stylePreprocessors);
|
|
@@ -25149,8 +25149,8 @@ ${fields}
|
|
|
25149
25149
|
}, inlineTemplateAndLowerDefer = async (source, fileDir) => {
|
|
25150
25150
|
const templateUrlMatch = findUncommentedMatch(source, /templateUrl\s*:\s*['"]([^'"]+)['"]/);
|
|
25151
25151
|
if (templateUrlMatch?.[1]) {
|
|
25152
|
-
const templatePath =
|
|
25153
|
-
if (!
|
|
25152
|
+
const templatePath = join34(fileDir, templateUrlMatch[1]);
|
|
25153
|
+
if (!existsSync26(templatePath)) {
|
|
25154
25154
|
throw new Error(`Unable to inline Angular templateUrl "${templateUrlMatch[1]}": file not found at ${templatePath}`);
|
|
25155
25155
|
}
|
|
25156
25156
|
const templateRaw2 = await fs5.readFile(templatePath, "utf-8");
|
|
@@ -25180,11 +25180,11 @@ ${fields}
|
|
|
25180
25180
|
}, inlineTemplateAndLowerDeferSync = (source, fileDir) => {
|
|
25181
25181
|
const templateUrlMatch = findUncommentedMatch(source, /templateUrl\s*:\s*['"]([^'"]+)['"]/);
|
|
25182
25182
|
if (templateUrlMatch?.[1]) {
|
|
25183
|
-
const templatePath =
|
|
25184
|
-
if (!
|
|
25183
|
+
const templatePath = join34(fileDir, templateUrlMatch[1]);
|
|
25184
|
+
if (!existsSync26(templatePath)) {
|
|
25185
25185
|
throw new Error(`Unable to inline Angular templateUrl "${templateUrlMatch[1]}": file not found at ${templatePath}`);
|
|
25186
25186
|
}
|
|
25187
|
-
const templateRaw2 =
|
|
25187
|
+
const templateRaw2 = readFileSync23(templatePath, "utf-8");
|
|
25188
25188
|
const lowered2 = lowerAngularDeferSyntax(templateRaw2);
|
|
25189
25189
|
const escaped2 = escapeTemplateContent(lowered2.template);
|
|
25190
25190
|
const replacedSource2 = source.slice(0, templateUrlMatch.index) + `template: \`${escaped2}\`` + source.slice(templateUrlMatch.index + templateUrlMatch[0].length);
|
|
@@ -25217,7 +25217,7 @@ ${fields}
|
|
|
25217
25217
|
return source;
|
|
25218
25218
|
const stylePromises = urlMatches.map((urlMatch) => {
|
|
25219
25219
|
const styleUrl = urlMatch.replace(/['"]/g, "");
|
|
25220
|
-
return readAndEscapeFile(
|
|
25220
|
+
return readAndEscapeFile(join34(fileDir, styleUrl), stylePreprocessors);
|
|
25221
25221
|
});
|
|
25222
25222
|
const results = await Promise.all(stylePromises);
|
|
25223
25223
|
const inlinedStyles = results.filter(Boolean).map((escaped) => `\`${escaped}\``);
|
|
@@ -25228,7 +25228,7 @@ ${fields}
|
|
|
25228
25228
|
const styleUrlMatch = findUncommentedMatch(source, /styleUrl\s*:\s*['"]([^'"]+)['"]/);
|
|
25229
25229
|
if (!styleUrlMatch?.[1])
|
|
25230
25230
|
return source;
|
|
25231
|
-
const escaped = await readAndEscapeFile(
|
|
25231
|
+
const escaped = await readAndEscapeFile(join34(fileDir, styleUrlMatch[1]), stylePreprocessors);
|
|
25232
25232
|
if (!escaped)
|
|
25233
25233
|
return source;
|
|
25234
25234
|
return source.slice(0, styleUrlMatch.index) + `styles: [\`${escaped}\`]` + source.slice(styleUrlMatch.index + styleUrlMatch[0].length);
|
|
@@ -25264,12 +25264,12 @@ ${fields}
|
|
|
25264
25264
|
`${candidate}.js`,
|
|
25265
25265
|
`${candidate}.jsx`,
|
|
25266
25266
|
`${candidate}.json`,
|
|
25267
|
-
|
|
25268
|
-
|
|
25269
|
-
|
|
25270
|
-
|
|
25267
|
+
join34(candidate, "index.ts"),
|
|
25268
|
+
join34(candidate, "index.tsx"),
|
|
25269
|
+
join34(candidate, "index.js"),
|
|
25270
|
+
join34(candidate, "index.jsx")
|
|
25271
25271
|
];
|
|
25272
|
-
return candidates.find((file4) =>
|
|
25272
|
+
return candidates.find((file4) => existsSync26(file4));
|
|
25273
25273
|
};
|
|
25274
25274
|
const resolveLocalImport = (specifier, fromDir) => {
|
|
25275
25275
|
if (specifier.startsWith(".") || specifier.startsWith("/")) {
|
|
@@ -25294,10 +25294,10 @@ ${fields}
|
|
|
25294
25294
|
const inputDir = dirname17(sourcePath);
|
|
25295
25295
|
const fileBase = basename10(sourcePath).replace(/\.[cm]?[tj]sx?$/, ".js");
|
|
25296
25296
|
if (inputDir === outDir || inputDir.startsWith(`${outDir}${sep3}`)) {
|
|
25297
|
-
return
|
|
25297
|
+
return join34(inputDir, fileBase);
|
|
25298
25298
|
}
|
|
25299
25299
|
const relativeDir = inputDir.startsWith(baseDir) ? inputDir.substring(baseDir.length + 1) : inputDir;
|
|
25300
|
-
return
|
|
25300
|
+
return join34(outDir, relativeDir, fileBase);
|
|
25301
25301
|
};
|
|
25302
25302
|
const withCacheBuster = (specifier) => {
|
|
25303
25303
|
if (!cacheBuster)
|
|
@@ -25344,11 +25344,11 @@ ${fields}
|
|
|
25344
25344
|
if (visited.has(resolved))
|
|
25345
25345
|
return;
|
|
25346
25346
|
visited.add(resolved);
|
|
25347
|
-
if (resolved.endsWith(".json") &&
|
|
25347
|
+
if (resolved.endsWith(".json") && existsSync26(resolved)) {
|
|
25348
25348
|
const inputDir2 = dirname17(resolved);
|
|
25349
25349
|
const relativeDir2 = inputDir2.startsWith(baseDir) ? inputDir2.substring(baseDir.length + 1) : inputDir2;
|
|
25350
|
-
const targetDir2 =
|
|
25351
|
-
const targetPath2 =
|
|
25350
|
+
const targetDir2 = join34(outDir, relativeDir2);
|
|
25351
|
+
const targetPath2 = join34(targetDir2, basename10(resolved));
|
|
25352
25352
|
await fs5.mkdir(targetDir2, { recursive: true });
|
|
25353
25353
|
await fs5.copyFile(resolved, targetPath2);
|
|
25354
25354
|
allOutputs.push(targetPath2);
|
|
@@ -25357,7 +25357,7 @@ ${fields}
|
|
|
25357
25357
|
let actualPath = resolved;
|
|
25358
25358
|
if (!actualPath.endsWith(".ts"))
|
|
25359
25359
|
actualPath += ".ts";
|
|
25360
|
-
if (!
|
|
25360
|
+
if (!existsSync26(actualPath))
|
|
25361
25361
|
return;
|
|
25362
25362
|
let sourceCode = await fs5.readFile(actualPath, "utf-8");
|
|
25363
25363
|
const inlined = await inlineResources(sourceCode, dirname17(actualPath), stylePreprocessors);
|
|
@@ -25395,7 +25395,7 @@ ${fields}
|
|
|
25395
25395
|
const isEntry = resolve24(actualPath) === resolve24(entryPath);
|
|
25396
25396
|
const contentHash = Bun.hash(sourceCode).toString(BASE_36_RADIX);
|
|
25397
25397
|
const cacheKey2 = actualPath;
|
|
25398
|
-
const shouldWriteFile = cacheBuster && isEntry ? true : jitContentCache.get(cacheKey2) !== contentHash || !
|
|
25398
|
+
const shouldWriteFile = cacheBuster && isEntry ? true : jitContentCache.get(cacheKey2) !== contentHash || !existsSync26(targetPath);
|
|
25399
25399
|
if (shouldWriteFile) {
|
|
25400
25400
|
const processedContent = transpileAndRewrite(sourceCode, relativeDir, actualPath, importRewrites);
|
|
25401
25401
|
await fs5.mkdir(targetDir, { recursive: true });
|
|
@@ -25407,7 +25407,7 @@ ${fields}
|
|
|
25407
25407
|
};
|
|
25408
25408
|
await transpileFile(inputPath);
|
|
25409
25409
|
const entryOutputPath = toOutputPath(entryPath);
|
|
25410
|
-
if (
|
|
25410
|
+
if (existsSync26(entryOutputPath)) {
|
|
25411
25411
|
const entryOutput = await fs5.readFile(entryOutputPath, "utf-8");
|
|
25412
25412
|
const withoutLegacyFlag = entryOutput.replace(/\nexport const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;\n?/g, `
|
|
25413
25413
|
`);
|
|
@@ -25426,23 +25426,23 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
25426
25426
|
return { clientPaths: [...emptyPaths], serverPaths: [...emptyPaths] };
|
|
25427
25427
|
}
|
|
25428
25428
|
const compiledRoot = compiledParent;
|
|
25429
|
-
const indexesDir =
|
|
25429
|
+
const indexesDir = join34(compiledParent, "indexes");
|
|
25430
25430
|
await traceAngularPhase("setup/create-indexes-dir", () => fs5.mkdir(indexesDir, { recursive: true }));
|
|
25431
25431
|
const aotOutputs = hmr ? [] : await traceAngularPhase("aot/compile-files", () => compileAngularFiles(entryPoints.map((entry) => resolve24(entry)), compiledRoot, stylePreprocessors), { entries: entryPoints.length });
|
|
25432
25432
|
if (!hmr) {
|
|
25433
25433
|
await traceAngularPhase("aot/copy-json-resources", async () => {
|
|
25434
25434
|
const cwd = process.cwd();
|
|
25435
25435
|
const angularSrcDir = resolve24(outRoot);
|
|
25436
|
-
if (!
|
|
25436
|
+
if (!existsSync26(angularSrcDir))
|
|
25437
25437
|
return;
|
|
25438
25438
|
const jsonGlob = new Glob6("**/*.json");
|
|
25439
25439
|
for (const rel of jsonGlob.scanSync({
|
|
25440
25440
|
absolute: false,
|
|
25441
25441
|
cwd: angularSrcDir
|
|
25442
25442
|
})) {
|
|
25443
|
-
const sourcePath =
|
|
25443
|
+
const sourcePath = join34(angularSrcDir, rel);
|
|
25444
25444
|
const cwdRel = relative12(cwd, sourcePath);
|
|
25445
|
-
const targetPath =
|
|
25445
|
+
const targetPath = join34(compiledRoot, cwdRel);
|
|
25446
25446
|
await fs5.mkdir(dirname17(targetPath), { recursive: true });
|
|
25447
25447
|
await fs5.copyFile(sourcePath, targetPath);
|
|
25448
25448
|
}
|
|
@@ -25459,24 +25459,24 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
25459
25459
|
const fileBase = basename10(resolvedEntry).replace(/\.[tj]s$/, "");
|
|
25460
25460
|
const jsName = `${fileBase}.js`;
|
|
25461
25461
|
const compiledFallbackPaths = [
|
|
25462
|
-
|
|
25463
|
-
|
|
25464
|
-
|
|
25462
|
+
join34(compiledRoot, relativeEntry),
|
|
25463
|
+
join34(compiledRoot, "pages", jsName),
|
|
25464
|
+
join34(compiledRoot, jsName)
|
|
25465
25465
|
].map((file4) => resolve24(file4));
|
|
25466
25466
|
const resolveRawServerFile = (candidatePaths) => {
|
|
25467
25467
|
const normalizedCandidates = [
|
|
25468
25468
|
...candidatePaths.map((file4) => resolve24(file4)),
|
|
25469
25469
|
...compiledFallbackPaths
|
|
25470
25470
|
];
|
|
25471
|
-
let candidate = normalizedCandidates.find((file4) =>
|
|
25471
|
+
let candidate = normalizedCandidates.find((file4) => existsSync26(file4) && file4.endsWith(`${sep3}${relativeEntry}`));
|
|
25472
25472
|
if (!candidate) {
|
|
25473
|
-
candidate = normalizedCandidates.find((file4) =>
|
|
25473
|
+
candidate = normalizedCandidates.find((file4) => existsSync26(file4) && file4.endsWith(`${sep3}pages${sep3}${jsName}`));
|
|
25474
25474
|
}
|
|
25475
25475
|
if (!candidate) {
|
|
25476
|
-
candidate = normalizedCandidates.find((file4) =>
|
|
25476
|
+
candidate = normalizedCandidates.find((file4) => existsSync26(file4) && file4.endsWith(`${sep3}${jsName}`));
|
|
25477
25477
|
}
|
|
25478
25478
|
if (!candidate) {
|
|
25479
|
-
candidate = normalizedCandidates.find((file4) =>
|
|
25479
|
+
candidate = normalizedCandidates.find((file4) => existsSync26(file4));
|
|
25480
25480
|
}
|
|
25481
25481
|
return candidate;
|
|
25482
25482
|
};
|
|
@@ -25484,11 +25484,11 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
25484
25484
|
if (!rawServerFile) {
|
|
25485
25485
|
rawServerFile = await traceAngularPhase("wrapper/resolve-server-output-fallback", () => resolveRawServerFile([]), { entry: resolvedEntry });
|
|
25486
25486
|
}
|
|
25487
|
-
if (rawServerFile && !
|
|
25487
|
+
if (rawServerFile && !existsSync26(rawServerFile)) {
|
|
25488
25488
|
outputs = hmr ? await compileEntry() : aotOutputs;
|
|
25489
25489
|
rawServerFile = await traceAngularPhase("wrapper/resolve-server-output-retry", () => resolveRawServerFile(outputs), { entry: resolvedEntry });
|
|
25490
25490
|
}
|
|
25491
|
-
if (!rawServerFile || !
|
|
25491
|
+
if (!rawServerFile || !existsSync26(rawServerFile)) {
|
|
25492
25492
|
throw new Error(`Compiled output not found for ${entry}. Looking for: ${jsName}. Available: ${[
|
|
25493
25493
|
...outputs,
|
|
25494
25494
|
...compiledFallbackPaths
|
|
@@ -25512,7 +25512,7 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
25512
25512
|
let providersSourceContent = "";
|
|
25513
25513
|
if (providersInjection.appProvidersSource) {
|
|
25514
25514
|
try {
|
|
25515
|
-
providersSourceContent =
|
|
25515
|
+
providersSourceContent = readFileSync23(providersInjection.appProvidersSource, "utf-8");
|
|
25516
25516
|
} catch {}
|
|
25517
25517
|
}
|
|
25518
25518
|
return JSON.stringify({
|
|
@@ -25523,8 +25523,8 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
25523
25523
|
})() : "no-providers";
|
|
25524
25524
|
const serverContentHash = `${Bun.hash(original).toString(BASE_36_RADIX)}.${Bun.hash(providersHashInput).toString(BASE_36_RADIX)}`;
|
|
25525
25525
|
const cachedWrapper = wrapperOutputCache.get(resolvedEntry);
|
|
25526
|
-
const clientFile =
|
|
25527
|
-
if (hmr && cachedWrapper && cachedWrapper.serverHash === serverContentHash &&
|
|
25526
|
+
const clientFile = join34(indexesDir, jsName);
|
|
25527
|
+
if (hmr && cachedWrapper && cachedWrapper.serverHash === serverContentHash && existsSync26(clientFile) && (usesLegacyAnimations || !original.includes("__ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__")) && (!usesLegacyAnimations || original.includes("__ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__"))) {
|
|
25528
25528
|
return {
|
|
25529
25529
|
clientPath: clientFile,
|
|
25530
25530
|
indexUnchanged: true,
|
|
@@ -25558,7 +25558,7 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
25558
25558
|
const angularDirAbs = resolve24(outRoot);
|
|
25559
25559
|
const appSourceAbs = resolve24(providersInjection.appProvidersSource);
|
|
25560
25560
|
const rel = relative12(angularDirAbs, appSourceAbs).replace(/\\/g, "/");
|
|
25561
|
-
return
|
|
25561
|
+
return join34(compiledParent, rel).replace(/\.[cm]?[tj]sx?$/, ".js");
|
|
25562
25562
|
})();
|
|
25563
25563
|
const appProvidersSpec = (() => {
|
|
25564
25564
|
const rel = relative12(dirname17(rawServerFile), compiledAppProvidersPath).replace(/\\/g, "/");
|
|
@@ -25782,7 +25782,7 @@ var init_compileAngular = __esm(() => {
|
|
|
25782
25782
|
init_stylePreprocessor();
|
|
25783
25783
|
init_generatedDir();
|
|
25784
25784
|
devClientDir4 = resolveDevClientDir4();
|
|
25785
|
-
hmrClientPath5 =
|
|
25785
|
+
hmrClientPath5 = join34(devClientDir4, "hmrClient.ts").replace(/\\/g, "/");
|
|
25786
25786
|
jitContentCache = new Map;
|
|
25787
25787
|
wrapperOutputCache = new Map;
|
|
25788
25788
|
});
|
|
@@ -26505,7 +26505,7 @@ __export(exports_fastHmrCompiler, {
|
|
|
26505
26505
|
primeComponentFingerprint: () => primeComponentFingerprint,
|
|
26506
26506
|
invalidateFingerprintCache: () => invalidateFingerprintCache
|
|
26507
26507
|
});
|
|
26508
|
-
import { existsSync as
|
|
26508
|
+
import { existsSync as existsSync27, readFileSync as readFileSync24, statSync as statSync2 } from "fs";
|
|
26509
26509
|
import { dirname as dirname18, extname as extname6, relative as relative13, resolve as resolve25 } from "path";
|
|
26510
26510
|
import ts15 from "typescript";
|
|
26511
26511
|
var fail = (reason, detail, location) => ({
|
|
@@ -26818,11 +26818,11 @@ var fail = (reason, detail, location) => ({
|
|
|
26818
26818
|
`${base}/index.tsx`
|
|
26819
26819
|
];
|
|
26820
26820
|
for (const candidate of candidates) {
|
|
26821
|
-
if (!
|
|
26821
|
+
if (!existsSync27(candidate))
|
|
26822
26822
|
continue;
|
|
26823
26823
|
let content;
|
|
26824
26824
|
try {
|
|
26825
|
-
content =
|
|
26825
|
+
content = readFileSync24(candidate, "utf-8");
|
|
26826
26826
|
} catch {
|
|
26827
26827
|
continue;
|
|
26828
26828
|
}
|
|
@@ -27401,7 +27401,7 @@ var fail = (reason, detail, location) => ({
|
|
|
27401
27401
|
return cached2.info;
|
|
27402
27402
|
let source;
|
|
27403
27403
|
try {
|
|
27404
|
-
source =
|
|
27404
|
+
source = readFileSync24(filePath, "utf-8");
|
|
27405
27405
|
} catch {
|
|
27406
27406
|
childComponentInfoCache.set(cacheKey2, {
|
|
27407
27407
|
info: null,
|
|
@@ -27455,7 +27455,7 @@ var fail = (reason, detail, location) => ({
|
|
|
27455
27455
|
return cached2.info;
|
|
27456
27456
|
let content;
|
|
27457
27457
|
try {
|
|
27458
|
-
content =
|
|
27458
|
+
content = readFileSync24(dtsPath, "utf-8");
|
|
27459
27459
|
} catch {
|
|
27460
27460
|
childComponentInfoCache.set(cacheKey2, {
|
|
27461
27461
|
info: null,
|
|
@@ -27571,11 +27571,11 @@ var fail = (reason, detail, location) => ({
|
|
|
27571
27571
|
if (visited.has(startDtsPath))
|
|
27572
27572
|
return null;
|
|
27573
27573
|
visited.add(startDtsPath);
|
|
27574
|
-
if (!
|
|
27574
|
+
if (!existsSync27(startDtsPath))
|
|
27575
27575
|
return null;
|
|
27576
27576
|
let content;
|
|
27577
27577
|
try {
|
|
27578
|
-
content =
|
|
27578
|
+
content = readFileSync24(startDtsPath, "utf-8");
|
|
27579
27579
|
} catch {
|
|
27580
27580
|
return null;
|
|
27581
27581
|
}
|
|
@@ -27624,16 +27624,16 @@ var fail = (reason, detail, location) => ({
|
|
|
27624
27624
|
`${base}/index.d.cts`
|
|
27625
27625
|
];
|
|
27626
27626
|
for (const c of candidates) {
|
|
27627
|
-
if (
|
|
27627
|
+
if (existsSync27(c))
|
|
27628
27628
|
return c;
|
|
27629
27629
|
}
|
|
27630
27630
|
return null;
|
|
27631
27631
|
}, findPackageDtsForJs = (jsPath) => {
|
|
27632
27632
|
const sibling = jsPath.replace(/\.[mc]?js$/, ".d.ts");
|
|
27633
|
-
if (
|
|
27633
|
+
if (existsSync27(sibling))
|
|
27634
27634
|
return sibling;
|
|
27635
27635
|
const mirror = jsPath.replace(/\/dist\//, "/dist/src/").replace(/\.[mc]?js$/, ".d.ts");
|
|
27636
|
-
if (
|
|
27636
|
+
if (existsSync27(mirror))
|
|
27637
27637
|
return mirror;
|
|
27638
27638
|
return null;
|
|
27639
27639
|
}, resolveChildComponentInfo = (className, spec, componentDir, projectRoot) => {
|
|
@@ -27646,7 +27646,7 @@ var fail = (reason, detail, location) => ({
|
|
|
27646
27646
|
`${base}/index.tsx`
|
|
27647
27647
|
];
|
|
27648
27648
|
for (const candidate of candidates) {
|
|
27649
|
-
if (!
|
|
27649
|
+
if (!existsSync27(candidate))
|
|
27650
27650
|
continue;
|
|
27651
27651
|
const info = getChildComponentInfoFromTsSource(candidate, className);
|
|
27652
27652
|
if (info)
|
|
@@ -27793,7 +27793,7 @@ var fail = (reason, detail, location) => ({
|
|
|
27793
27793
|
return cached2.hasProviders;
|
|
27794
27794
|
let source;
|
|
27795
27795
|
try {
|
|
27796
|
-
source =
|
|
27796
|
+
source = readFileSync24(filePath, "utf8");
|
|
27797
27797
|
} catch {
|
|
27798
27798
|
return true;
|
|
27799
27799
|
}
|
|
@@ -27860,11 +27860,11 @@ var fail = (reason, detail, location) => ({
|
|
|
27860
27860
|
const resolved = resolve25(componentDir, spec);
|
|
27861
27861
|
for (const ext of TS_EXTENSIONS) {
|
|
27862
27862
|
const candidate = resolved + ext;
|
|
27863
|
-
if (
|
|
27863
|
+
if (existsSync27(candidate))
|
|
27864
27864
|
return candidate;
|
|
27865
27865
|
}
|
|
27866
27866
|
const indexCandidate = resolve25(resolved, "index.ts");
|
|
27867
|
-
if (
|
|
27867
|
+
if (existsSync27(indexCandidate))
|
|
27868
27868
|
return indexCandidate;
|
|
27869
27869
|
}
|
|
27870
27870
|
return null;
|
|
@@ -28097,11 +28097,11 @@ ${transpiled}
|
|
|
28097
28097
|
}${staticPatch}`;
|
|
28098
28098
|
}, STYLE_PREPROCESSED_EXT, resolveAndReadStyleResource = (componentDir, url2) => {
|
|
28099
28099
|
const abs = resolve25(componentDir, url2);
|
|
28100
|
-
if (!
|
|
28100
|
+
if (!existsSync27(abs))
|
|
28101
28101
|
return null;
|
|
28102
28102
|
const ext = extname6(abs).toLowerCase();
|
|
28103
28103
|
if (!STYLE_PREPROCESSED_EXT.has(ext) || ext === ".css") {
|
|
28104
|
-
return
|
|
28104
|
+
return readFileSync24(abs, "utf8");
|
|
28105
28105
|
}
|
|
28106
28106
|
try {
|
|
28107
28107
|
const { compileStyleFileIfNeededSync: compileStyleFileIfNeededSync2 } = (init_stylePreprocessor(), __toCommonJS(exports_stylePreprocessor));
|
|
@@ -28138,9 +28138,9 @@ ${block}
|
|
|
28138
28138
|
return cached2;
|
|
28139
28139
|
const tsconfigPath = resolve25(projectRoot, "tsconfig.json");
|
|
28140
28140
|
const opts = {};
|
|
28141
|
-
if (
|
|
28141
|
+
if (existsSync27(tsconfigPath)) {
|
|
28142
28142
|
try {
|
|
28143
|
-
const text =
|
|
28143
|
+
const text = readFileSync24(tsconfigPath, "utf8");
|
|
28144
28144
|
const parsed = ts15.parseConfigFileTextToJson(tsconfigPath, text);
|
|
28145
28145
|
if (!parsed.error && parsed.config) {
|
|
28146
28146
|
const cfg = parsed.config;
|
|
@@ -28165,7 +28165,7 @@ ${block}
|
|
|
28165
28165
|
}, tryFastHmr = async (params) => {
|
|
28166
28166
|
const { componentFilePath, className } = params;
|
|
28167
28167
|
const projectRoot = params.projectRoot ?? process.cwd();
|
|
28168
|
-
if (!
|
|
28168
|
+
if (!existsSync27(componentFilePath)) {
|
|
28169
28169
|
return fail("file-not-found", componentFilePath);
|
|
28170
28170
|
}
|
|
28171
28171
|
let compiler;
|
|
@@ -28174,7 +28174,7 @@ ${block}
|
|
|
28174
28174
|
} catch (err) {
|
|
28175
28175
|
return fail("unexpected-error", `import @angular/compiler: ${err}`);
|
|
28176
28176
|
}
|
|
28177
|
-
const tsSource =
|
|
28177
|
+
const tsSource = readFileSync24(componentFilePath, "utf8");
|
|
28178
28178
|
const sourceFile = ts15.createSourceFile(componentFilePath, tsSource, ts15.ScriptTarget.ES2022, true, ts15.ScriptKind.TS);
|
|
28179
28179
|
const classNode = findClassDeclaration(sourceFile, className);
|
|
28180
28180
|
if (!classNode) {
|
|
@@ -28221,10 +28221,10 @@ ${block}
|
|
|
28221
28221
|
templatePath = componentFilePath;
|
|
28222
28222
|
} else if (decoratorMeta.templateUrl) {
|
|
28223
28223
|
const tplAbs = resolve25(componentDir, decoratorMeta.templateUrl);
|
|
28224
|
-
if (!
|
|
28224
|
+
if (!existsSync27(tplAbs)) {
|
|
28225
28225
|
return fail("template-resource-not-found", `Template file not found: ${tplAbs}`, { file: componentFilePath });
|
|
28226
28226
|
}
|
|
28227
|
-
templateText =
|
|
28227
|
+
templateText = readFileSync24(tplAbs, "utf8");
|
|
28228
28228
|
templatePath = tplAbs;
|
|
28229
28229
|
} else {
|
|
28230
28230
|
return fail("unsupported-decorator-args", "missing template/templateUrl");
|
|
@@ -28981,9 +28981,9 @@ __export(exports_compileEmber, {
|
|
|
28981
28981
|
clearEmberCompilerCache: () => clearEmberCompilerCache,
|
|
28982
28982
|
basename: () => basename11
|
|
28983
28983
|
});
|
|
28984
|
-
import { existsSync as
|
|
28984
|
+
import { existsSync as existsSync28 } from "fs";
|
|
28985
28985
|
import { mkdir as mkdir7, rm as rm4 } from "fs/promises";
|
|
28986
|
-
import { basename as basename11, dirname as dirname19, extname as extname7, join as
|
|
28986
|
+
import { basename as basename11, dirname as dirname19, extname as extname7, join as join35, resolve as resolve26 } from "path";
|
|
28987
28987
|
var {build: bunBuild2, Transpiler: Transpiler4, write: write4, file: file4 } = globalThis.Bun;
|
|
28988
28988
|
var cachedPreprocessor = null, getPreprocessor = async () => {
|
|
28989
28989
|
if (cachedPreprocessor)
|
|
@@ -29083,7 +29083,7 @@ export const importSync = (specifier) => {
|
|
|
29083
29083
|
const extensionsToTry = ["", ".gts", ".gjs", ".ts", ".js"];
|
|
29084
29084
|
for (const ext of extensionsToTry) {
|
|
29085
29085
|
const candidate = candidateBase + ext;
|
|
29086
|
-
if (
|
|
29086
|
+
if (existsSync28(candidate))
|
|
29087
29087
|
return { path: candidate };
|
|
29088
29088
|
}
|
|
29089
29089
|
return;
|
|
@@ -29102,8 +29102,8 @@ export const importSync = (specifier) => {
|
|
|
29102
29102
|
build2.onResolve({ filter: /^@(?:ember|glimmer|simple-dom)\// }, (args) => {
|
|
29103
29103
|
if (standalonePackages.has(args.path))
|
|
29104
29104
|
return;
|
|
29105
|
-
const internal =
|
|
29106
|
-
if (
|
|
29105
|
+
const internal = join35(cwd, "node_modules/ember-source/dist/packages", args.path, "index.js");
|
|
29106
|
+
if (existsSync28(internal))
|
|
29107
29107
|
return { path: internal };
|
|
29108
29108
|
return;
|
|
29109
29109
|
});
|
|
@@ -29150,16 +29150,16 @@ export default PageComponent;
|
|
|
29150
29150
|
}
|
|
29151
29151
|
const transpiled = transpiler5.transformSync(preprocessed);
|
|
29152
29152
|
const baseName = basename11(resolvedEntry).replace(/\.(gjs|gts|ts|js)$/, "");
|
|
29153
|
-
const tmpDir =
|
|
29154
|
-
const serverDir =
|
|
29155
|
-
const clientDir =
|
|
29153
|
+
const tmpDir = join35(compiledRoot, "_tmp");
|
|
29154
|
+
const serverDir = join35(compiledRoot, "server");
|
|
29155
|
+
const clientDir = join35(compiledRoot, "client");
|
|
29156
29156
|
await Promise.all([
|
|
29157
29157
|
mkdir7(tmpDir, { recursive: true }),
|
|
29158
29158
|
mkdir7(serverDir, { recursive: true }),
|
|
29159
29159
|
mkdir7(clientDir, { recursive: true })
|
|
29160
29160
|
]);
|
|
29161
|
-
const tmpPagePath = resolve26(
|
|
29162
|
-
const tmpHarnessPath = resolve26(
|
|
29161
|
+
const tmpPagePath = resolve26(join35(tmpDir, `${baseName}.module.js`));
|
|
29162
|
+
const tmpHarnessPath = resolve26(join35(tmpDir, `${baseName}.harness.js`));
|
|
29163
29163
|
await Promise.all([
|
|
29164
29164
|
write4(tmpPagePath, transpiled),
|
|
29165
29165
|
write4(tmpHarnessPath, generateServerHarness(tmpPagePath))
|
|
@@ -29167,7 +29167,7 @@ export default PageComponent;
|
|
|
29167
29167
|
const stagedSourceMap = new Map([
|
|
29168
29168
|
[tmpPagePath, resolvedEntry]
|
|
29169
29169
|
]);
|
|
29170
|
-
const serverPath =
|
|
29170
|
+
const serverPath = join35(serverDir, `${baseName}.js`);
|
|
29171
29171
|
const buildResult = await bunBuild2({
|
|
29172
29172
|
entrypoints: [tmpHarnessPath],
|
|
29173
29173
|
format: "esm",
|
|
@@ -29184,7 +29184,7 @@ export default PageComponent;
|
|
|
29184
29184
|
console.warn(`\u26A0\uFE0F Ember server build for ${baseName} had errors:`, buildResult.logs);
|
|
29185
29185
|
}
|
|
29186
29186
|
await rm4(tmpDir, { force: true, recursive: true });
|
|
29187
|
-
const clientPath =
|
|
29187
|
+
const clientPath = join35(clientDir, `${baseName}.js`);
|
|
29188
29188
|
await write4(clientPath, transpiled);
|
|
29189
29189
|
return { clientPath, serverPath };
|
|
29190
29190
|
}, compileEmber = async (entries, emberDir, cwd = process.cwd(), _hmr = false) => {
|
|
@@ -29212,7 +29212,7 @@ export default PageComponent;
|
|
|
29212
29212
|
preprocessed = rewriteTemplateEvalToScope(result.code);
|
|
29213
29213
|
}
|
|
29214
29214
|
return transpiler5.transformSync(preprocessed);
|
|
29215
|
-
}, clearEmberCompilerCache = () => {}, getEmberCompiledRoot = (_emberDir) => getFrameworkGeneratedDir("ember"), getEmberServerCompiledDir = (emberDir) =>
|
|
29215
|
+
}, clearEmberCompilerCache = () => {}, getEmberCompiledRoot = (_emberDir) => getFrameworkGeneratedDir("ember"), getEmberServerCompiledDir = (emberDir) => join35(getEmberCompiledRoot(emberDir), "server"), getEmberClientCompiledDir = (emberDir) => join35(getEmberCompiledRoot(emberDir), "client");
|
|
29216
29216
|
var init_compileEmber = __esm(() => {
|
|
29217
29217
|
init_generatedDir();
|
|
29218
29218
|
transpiler5 = new Transpiler4({
|
|
@@ -29233,8 +29233,8 @@ __export(exports_buildReactVendor, {
|
|
|
29233
29233
|
computeVendorPaths: () => computeVendorPaths,
|
|
29234
29234
|
buildReactVendor: () => buildReactVendor
|
|
29235
29235
|
});
|
|
29236
|
-
import { existsSync as
|
|
29237
|
-
import { join as
|
|
29236
|
+
import { existsSync as existsSync29, mkdirSync as mkdirSync8 } from "fs";
|
|
29237
|
+
import { join as join36, resolve as resolve27 } from "path";
|
|
29238
29238
|
import { rm as rm5 } from "fs/promises";
|
|
29239
29239
|
var {build: bunBuild3 } = globalThis.Bun;
|
|
29240
29240
|
var resolveJsxDevRuntimeCompatPath = () => {
|
|
@@ -29247,7 +29247,7 @@ var resolveJsxDevRuntimeCompatPath = () => {
|
|
|
29247
29247
|
resolve27(import.meta.dir, "..", "..", "src", "react", "jsxDevRuntimeCompat.ts")
|
|
29248
29248
|
];
|
|
29249
29249
|
for (const candidate of candidates) {
|
|
29250
|
-
if (
|
|
29250
|
+
if (existsSync29(candidate)) {
|
|
29251
29251
|
return candidate.replace(/\\/g, "/");
|
|
29252
29252
|
}
|
|
29253
29253
|
}
|
|
@@ -29276,14 +29276,14 @@ var resolveJsxDevRuntimeCompatPath = () => {
|
|
|
29276
29276
|
`)}
|
|
29277
29277
|
`;
|
|
29278
29278
|
}, buildReactVendor = async (buildDir) => {
|
|
29279
|
-
const vendorDir =
|
|
29279
|
+
const vendorDir = join36(buildDir, "react", "vendor");
|
|
29280
29280
|
mkdirSync8(vendorDir, { recursive: true });
|
|
29281
|
-
const tmpDir =
|
|
29281
|
+
const tmpDir = join36(buildDir, "_vendor_tmp");
|
|
29282
29282
|
mkdirSync8(tmpDir, { recursive: true });
|
|
29283
29283
|
const specifiers = reactSpecifiers;
|
|
29284
29284
|
const entrypoints = await Promise.all(specifiers.map(async (specifier) => {
|
|
29285
29285
|
const safeName = toSafeFileName(specifier);
|
|
29286
|
-
const entryPath =
|
|
29286
|
+
const entryPath = join36(tmpDir, `${safeName}.ts`);
|
|
29287
29287
|
const source = await generateEntrySource(specifier);
|
|
29288
29288
|
await Bun.write(entryPath, source);
|
|
29289
29289
|
return entryPath;
|
|
@@ -29348,7 +29348,7 @@ __export(exports_buildAngularVendor, {
|
|
|
29348
29348
|
buildAngularServerVendor: () => buildAngularServerVendor
|
|
29349
29349
|
});
|
|
29350
29350
|
import { mkdirSync as mkdirSync9 } from "fs";
|
|
29351
|
-
import { join as
|
|
29351
|
+
import { join as join37 } from "path";
|
|
29352
29352
|
import { rm as rm6 } from "fs/promises";
|
|
29353
29353
|
var {build: bunBuild4, Glob: Glob7 } = globalThis.Bun;
|
|
29354
29354
|
var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => jitMode ? [...REQUIRED_ANGULAR_SPECIFIERS_BASE, "@angular/compiler"] : REQUIRED_ANGULAR_SPECIFIERS_BASE, SERVER_ONLY_ANGULAR_SPECIFIERS, BUILD_ONLY_ANGULAR_SPECIFIER_PREFIXES, isBuildOnlyAngularSpecifier = (spec) => BUILD_ONLY_ANGULAR_SPECIFIER_PREFIXES.some((prefix) => spec === prefix || spec.startsWith(`${prefix}/`)), SCAN_SKIP_DIRS, isResolvable = (specifier) => {
|
|
@@ -29385,7 +29385,7 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
|
|
|
29385
29385
|
}
|
|
29386
29386
|
return { angular, transitiveRoots };
|
|
29387
29387
|
}, PARTIAL_DECL_MARKERS, containsPartialDeclarations = (source) => PARTIAL_DECL_MARKERS.some((marker) => source.includes(marker)), collectTransitiveAngularSpecs = async (roots, angularFound) => {
|
|
29388
|
-
const { readFileSync:
|
|
29388
|
+
const { readFileSync: readFileSync25 } = await import("fs");
|
|
29389
29389
|
const transpiler6 = new Bun.Transpiler({ loader: "js" });
|
|
29390
29390
|
const visited = new Set;
|
|
29391
29391
|
const frontier = [];
|
|
@@ -29406,7 +29406,7 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
|
|
|
29406
29406
|
}
|
|
29407
29407
|
let content;
|
|
29408
29408
|
try {
|
|
29409
|
-
content =
|
|
29409
|
+
content = readFileSync25(resolved, "utf-8");
|
|
29410
29410
|
} catch {
|
|
29411
29411
|
continue;
|
|
29412
29412
|
}
|
|
@@ -29445,14 +29445,14 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
|
|
|
29445
29445
|
await collectTransitiveAngularSpecs([...angular, ...transitiveRoots], angular);
|
|
29446
29446
|
return Array.from(angular).filter(isResolvable);
|
|
29447
29447
|
}, buildAngularVendor = async (buildDir, directories = [], linkerJitMode = false, depVendorSpecifiers = []) => {
|
|
29448
|
-
const vendorDir =
|
|
29448
|
+
const vendorDir = join37(buildDir, "angular", "vendor");
|
|
29449
29449
|
mkdirSync9(vendorDir, { recursive: true });
|
|
29450
|
-
const tmpDir =
|
|
29450
|
+
const tmpDir = join37(buildDir, "_angular_vendor_tmp");
|
|
29451
29451
|
mkdirSync9(tmpDir, { recursive: true });
|
|
29452
29452
|
const specifiers = await resolveAngularSpecifiers(directories, linkerJitMode);
|
|
29453
29453
|
const entrypoints = await Promise.all(specifiers.map(async (specifier) => {
|
|
29454
29454
|
const safeName = toSafeFileName2(specifier);
|
|
29455
|
-
const entryPath =
|
|
29455
|
+
const entryPath = join37(tmpDir, `${safeName}.ts`);
|
|
29456
29456
|
await Bun.write(entryPath, await generateVendorEntrySource(specifier));
|
|
29457
29457
|
return entryPath;
|
|
29458
29458
|
}));
|
|
@@ -29483,9 +29483,9 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
|
|
|
29483
29483
|
const specifiers = await resolveAngularSpecifiers(directories, linkerJitMode);
|
|
29484
29484
|
return computeAngularVendorPaths(specifiers);
|
|
29485
29485
|
}, buildAngularServerVendor = async (buildDir, directories = [], linkerJitMode = false) => {
|
|
29486
|
-
const vendorDir =
|
|
29486
|
+
const vendorDir = join37(buildDir, "angular", "vendor", "server");
|
|
29487
29487
|
mkdirSync9(vendorDir, { recursive: true });
|
|
29488
|
-
const tmpDir =
|
|
29488
|
+
const tmpDir = join37(buildDir, "_angular_server_vendor_tmp");
|
|
29489
29489
|
mkdirSync9(tmpDir, { recursive: true });
|
|
29490
29490
|
const browserSpecs = await resolveAngularSpecifiers(directories, linkerJitMode);
|
|
29491
29491
|
const allSpecs = new Set(browserSpecs);
|
|
@@ -29496,7 +29496,7 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
|
|
|
29496
29496
|
const specifiers = Array.from(allSpecs);
|
|
29497
29497
|
const entrypoints = await Promise.all(specifiers.map(async (specifier) => {
|
|
29498
29498
|
const safeName = toSafeFileName2(specifier);
|
|
29499
|
-
const entryPath =
|
|
29499
|
+
const entryPath = join37(tmpDir, `${safeName}.ts`);
|
|
29500
29500
|
await Bun.write(entryPath, await generateVendorEntrySource(specifier));
|
|
29501
29501
|
return entryPath;
|
|
29502
29502
|
}));
|
|
@@ -29518,9 +29518,9 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
|
|
|
29518
29518
|
return specifiers;
|
|
29519
29519
|
}, computeAngularServerVendorPaths = (buildDir, specifiers) => {
|
|
29520
29520
|
const paths = {};
|
|
29521
|
-
const vendorDir =
|
|
29521
|
+
const vendorDir = join37(buildDir, "angular", "vendor", "server");
|
|
29522
29522
|
for (const specifier of specifiers) {
|
|
29523
|
-
paths[specifier] =
|
|
29523
|
+
paths[specifier] = join37(vendorDir, `${toSafeFileName2(specifier)}.js`);
|
|
29524
29524
|
}
|
|
29525
29525
|
return paths;
|
|
29526
29526
|
}, computeAngularServerVendorPathsAsync = async (buildDir, directories = [], linkerJitMode = true) => {
|
|
@@ -29576,17 +29576,17 @@ __export(exports_buildVueVendor, {
|
|
|
29576
29576
|
buildVueVendor: () => buildVueVendor
|
|
29577
29577
|
});
|
|
29578
29578
|
import { mkdirSync as mkdirSync10 } from "fs";
|
|
29579
|
-
import { join as
|
|
29579
|
+
import { join as join38 } from "path";
|
|
29580
29580
|
import { rm as rm7 } from "fs/promises";
|
|
29581
29581
|
var {build: bunBuild5 } = globalThis.Bun;
|
|
29582
29582
|
var vueSpecifiers, toSafeFileName3 = (specifier) => specifier.replace(/\//g, "_"), buildVueVendor = async (buildDir) => {
|
|
29583
|
-
const vendorDir =
|
|
29583
|
+
const vendorDir = join38(buildDir, "vue", "vendor");
|
|
29584
29584
|
mkdirSync10(vendorDir, { recursive: true });
|
|
29585
|
-
const tmpDir =
|
|
29585
|
+
const tmpDir = join38(buildDir, "_vue_vendor_tmp");
|
|
29586
29586
|
mkdirSync10(tmpDir, { recursive: true });
|
|
29587
29587
|
const entrypoints = await Promise.all(vueSpecifiers.map(async (specifier) => {
|
|
29588
29588
|
const safeName = toSafeFileName3(specifier);
|
|
29589
|
-
const entryPath =
|
|
29589
|
+
const entryPath = join38(tmpDir, `${safeName}.ts`);
|
|
29590
29590
|
await Bun.write(entryPath, `export * from '${specifier}';
|
|
29591
29591
|
`);
|
|
29592
29592
|
return entryPath;
|
|
@@ -29611,11 +29611,11 @@ var vueSpecifiers, toSafeFileName3 = (specifier) => specifier.replace(/\//g, "_"
|
|
|
29611
29611
|
console.warn("\u26A0\uFE0F Vue vendor build had errors:", result.logs);
|
|
29612
29612
|
return;
|
|
29613
29613
|
}
|
|
29614
|
-
const { readFileSync:
|
|
29614
|
+
const { readFileSync: readFileSync25, writeFileSync: writeFileSync9, readdirSync: readdirSync5 } = await import("fs");
|
|
29615
29615
|
const files = readdirSync5(vendorDir).filter((f2) => f2.endsWith(".js"));
|
|
29616
29616
|
for (const file5 of files) {
|
|
29617
|
-
const filePath =
|
|
29618
|
-
const content =
|
|
29617
|
+
const filePath = join38(vendorDir, file5);
|
|
29618
|
+
const content = readFileSync25(filePath, "utf-8");
|
|
29619
29619
|
if (!content.includes("__VUE_HMR_RUNTIME__"))
|
|
29620
29620
|
continue;
|
|
29621
29621
|
const patched = content.replace(/getGlobalThis\(\)\.__VUE_HMR_RUNTIME__\s*=\s*\{/, "getGlobalThis().__VUE_HMR_RUNTIME__ = getGlobalThis().__VUE_HMR_RUNTIME__ || {");
|
|
@@ -29641,7 +29641,7 @@ __export(exports_buildSvelteVendor, {
|
|
|
29641
29641
|
buildSvelteVendor: () => buildSvelteVendor
|
|
29642
29642
|
});
|
|
29643
29643
|
import { mkdirSync as mkdirSync11 } from "fs";
|
|
29644
|
-
import { join as
|
|
29644
|
+
import { join as join39 } from "path";
|
|
29645
29645
|
import { rm as rm8 } from "fs/promises";
|
|
29646
29646
|
var {build: bunBuild6 } = globalThis.Bun;
|
|
29647
29647
|
var svelteSpecifiers, isResolvable2 = (specifier) => {
|
|
@@ -29655,13 +29655,13 @@ var svelteSpecifiers, isResolvable2 = (specifier) => {
|
|
|
29655
29655
|
const specifiers = resolveVendorSpecifiers();
|
|
29656
29656
|
if (specifiers.length === 0)
|
|
29657
29657
|
return;
|
|
29658
|
-
const vendorDir =
|
|
29658
|
+
const vendorDir = join39(buildDir, "svelte", "vendor");
|
|
29659
29659
|
mkdirSync11(vendorDir, { recursive: true });
|
|
29660
|
-
const tmpDir =
|
|
29660
|
+
const tmpDir = join39(buildDir, "_svelte_vendor_tmp");
|
|
29661
29661
|
mkdirSync11(tmpDir, { recursive: true });
|
|
29662
29662
|
const entrypoints = await Promise.all(specifiers.map(async (specifier) => {
|
|
29663
29663
|
const safeName = toSafeFileName4(specifier);
|
|
29664
|
-
const entryPath =
|
|
29664
|
+
const entryPath = join39(tmpDir, `${safeName}.ts`);
|
|
29665
29665
|
await Bun.write(entryPath, `export * from '${specifier}';
|
|
29666
29666
|
`);
|
|
29667
29667
|
return entryPath;
|
|
@@ -29703,14 +29703,14 @@ var init_buildSvelteVendor = __esm(() => {
|
|
|
29703
29703
|
import {
|
|
29704
29704
|
copyFileSync as copyFileSync2,
|
|
29705
29705
|
cpSync,
|
|
29706
|
-
existsSync as
|
|
29706
|
+
existsSync as existsSync30,
|
|
29707
29707
|
mkdirSync as mkdirSync12,
|
|
29708
|
-
readFileSync as
|
|
29708
|
+
readFileSync as readFileSync25,
|
|
29709
29709
|
rmSync as rmSync2,
|
|
29710
29710
|
statSync as statSync3,
|
|
29711
29711
|
writeFileSync as writeFileSync9
|
|
29712
29712
|
} from "fs";
|
|
29713
|
-
import { basename as basename12, dirname as dirname20, extname as extname8, join as
|
|
29713
|
+
import { basename as basename12, dirname as dirname20, extname as extname8, join as join40, relative as relative14, resolve as resolve28 } from "path";
|
|
29714
29714
|
import { cwd, env as env3, exit } from "process";
|
|
29715
29715
|
var {
|
|
29716
29716
|
build: bunBuild7,
|
|
@@ -29791,8 +29791,8 @@ var isDev2, isBuildTraceEnabled = () => {
|
|
|
29791
29791
|
mkdirSync12(htmxDestDir, { recursive: true });
|
|
29792
29792
|
const glob = new Glob8("htmx*.min.js");
|
|
29793
29793
|
for (const relPath of glob.scanSync({ cwd: htmxDir })) {
|
|
29794
|
-
const src =
|
|
29795
|
-
const dest =
|
|
29794
|
+
const src = join40(htmxDir, relPath);
|
|
29795
|
+
const dest = join40(htmxDestDir, "htmx.min.js");
|
|
29796
29796
|
copyFileSync2(src, dest);
|
|
29797
29797
|
return;
|
|
29798
29798
|
}
|
|
@@ -29836,7 +29836,7 @@ var isDev2, isBuildTraceEnabled = () => {
|
|
|
29836
29836
|
addWorkerPathIfExists(file5, relPath, workerPaths);
|
|
29837
29837
|
}
|
|
29838
29838
|
}, collectWorkerPathsFromFile = (file5, patterns, workerPaths) => {
|
|
29839
|
-
const content =
|
|
29839
|
+
const content = readFileSync25(file5, "utf-8");
|
|
29840
29840
|
for (const pattern of patterns) {
|
|
29841
29841
|
collectWorkerPathsFromContent(content, pattern, file5, workerPaths);
|
|
29842
29842
|
}
|
|
@@ -29867,7 +29867,7 @@ var isDev2, isBuildTraceEnabled = () => {
|
|
|
29867
29867
|
vuePagesPath
|
|
29868
29868
|
}) => {
|
|
29869
29869
|
const { readdirSync: readDir } = await import("fs");
|
|
29870
|
-
const devIndexDir =
|
|
29870
|
+
const devIndexDir = join40(buildPath, "_src_indexes");
|
|
29871
29871
|
mkdirSync12(devIndexDir, { recursive: true });
|
|
29872
29872
|
if (reactIndexesPath && reactPagesPath) {
|
|
29873
29873
|
copyReactDevIndexes(reactIndexesPath, reactPagesPath, devIndexDir, readDir);
|
|
@@ -29879,41 +29879,41 @@ var isDev2, isBuildTraceEnabled = () => {
|
|
|
29879
29879
|
copyVueDevIndexes(vueDir, vuePagesPath, vueEntries, devIndexDir);
|
|
29880
29880
|
}
|
|
29881
29881
|
}, copyReactDevIndexes = (reactIndexesPath, reactPagesPath, devIndexDir, readDir) => {
|
|
29882
|
-
if (!
|
|
29882
|
+
if (!existsSync30(reactIndexesPath)) {
|
|
29883
29883
|
return;
|
|
29884
29884
|
}
|
|
29885
29885
|
const indexFiles = readDir(reactIndexesPath).filter((file5) => file5.endsWith(".tsx"));
|
|
29886
29886
|
const pagesRel = relative14(process.cwd(), resolve28(reactPagesPath)).replace(/\\/g, "/");
|
|
29887
29887
|
for (const file5 of indexFiles) {
|
|
29888
|
-
let content =
|
|
29888
|
+
let content = readFileSync25(join40(reactIndexesPath, file5), "utf-8");
|
|
29889
29889
|
content = content.replace(/from\s*['"]([^'"]*\/pages\/([^'"]+))['"]/g, (_match, _fullPath, componentName) => `from '/@src/${pagesRel}/${componentName}'`);
|
|
29890
|
-
writeFileSync9(
|
|
29890
|
+
writeFileSync9(join40(devIndexDir, file5), content);
|
|
29891
29891
|
}
|
|
29892
29892
|
}, copySvelteDevIndexes = (svelteDir, sveltePagesPath, svelteEntries, devIndexDir) => {
|
|
29893
|
-
const svelteIndexDir =
|
|
29893
|
+
const svelteIndexDir = join40(getFrameworkGeneratedDir("svelte"), "indexes");
|
|
29894
29894
|
const sveltePageEntries = svelteEntries.filter((file5) => resolve28(file5).startsWith(resolve28(sveltePagesPath)));
|
|
29895
29895
|
for (const entry of sveltePageEntries) {
|
|
29896
29896
|
const name = basename12(entry).replace(/\.svelte(\.(ts|js))?$/, "");
|
|
29897
|
-
const indexFile =
|
|
29898
|
-
if (!
|
|
29897
|
+
const indexFile = join40(svelteIndexDir, "pages", `${name}.js`);
|
|
29898
|
+
if (!existsSync30(indexFile))
|
|
29899
29899
|
continue;
|
|
29900
|
-
let content =
|
|
29900
|
+
let content = readFileSync25(indexFile, "utf-8");
|
|
29901
29901
|
const srcRel = relative14(process.cwd(), resolve28(entry)).replace(/\\/g, "/");
|
|
29902
29902
|
content = content.replace(/import\s+Component\s+from\s+['"]([^'"]+)['"]/, `import Component from "/@src/${srcRel}"`);
|
|
29903
|
-
writeFileSync9(
|
|
29903
|
+
writeFileSync9(join40(devIndexDir, `${name}.svelte.js`), content);
|
|
29904
29904
|
}
|
|
29905
29905
|
}, copyVueDevIndexes = (vueDir, vuePagesPath, vueEntries, devIndexDir) => {
|
|
29906
|
-
const vueIndexDir =
|
|
29906
|
+
const vueIndexDir = join40(getFrameworkGeneratedDir("vue"), "indexes");
|
|
29907
29907
|
const vuePageEntries = vueEntries.filter((file5) => resolve28(file5).startsWith(resolve28(vuePagesPath)));
|
|
29908
29908
|
for (const entry of vuePageEntries) {
|
|
29909
29909
|
const name = basename12(entry, ".vue");
|
|
29910
|
-
const indexFile =
|
|
29911
|
-
if (!
|
|
29910
|
+
const indexFile = join40(vueIndexDir, `${name}.js`);
|
|
29911
|
+
if (!existsSync30(indexFile))
|
|
29912
29912
|
continue;
|
|
29913
|
-
let content =
|
|
29913
|
+
let content = readFileSync25(indexFile, "utf-8");
|
|
29914
29914
|
const srcRel = relative14(process.cwd(), resolve28(entry)).replace(/\\/g, "/");
|
|
29915
29915
|
content = content.replace(/import\s+Comp(?:\s*,\s*\*\s+as\s+\w+)?\s+from\s+['"]([^'"]+)['"]/, (match) => match.replace(/from\s+['"][^'"]+['"]/, `from "/@src/${srcRel}"`));
|
|
29916
|
-
writeFileSync9(
|
|
29916
|
+
writeFileSync9(join40(devIndexDir, `${name}.vue.js`), content);
|
|
29917
29917
|
}
|
|
29918
29918
|
}, resolveVueRuntimeId = (content, firstUseName, outputPath, projectRoot) => {
|
|
29919
29919
|
const varIdx = content.indexOf(`var ${firstUseName} =`);
|
|
@@ -29961,7 +29961,7 @@ var isDev2, isBuildTraceEnabled = () => {
|
|
|
29961
29961
|
}
|
|
29962
29962
|
return result;
|
|
29963
29963
|
}, VUE_HMR_RUNTIME, injectVueComposableTracking = (outputPath, projectRoot) => {
|
|
29964
|
-
let content =
|
|
29964
|
+
let content = readFileSync25(outputPath, "utf-8");
|
|
29965
29965
|
const usePattern = /^var\s+(use[A-Z]\w*)\s*=/gm;
|
|
29966
29966
|
const useNames = [];
|
|
29967
29967
|
let match;
|
|
@@ -30011,7 +30011,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
30011
30011
|
}, rewriteUrlReferences = (outputPaths, urlFileMap) => {
|
|
30012
30012
|
const urlPattern = /new\s+URL\(\s*["'](\.\.?\/[^"']+)["']\s*,\s*import\.meta\.url\s*\)/g;
|
|
30013
30013
|
for (const outputPath of outputPaths) {
|
|
30014
|
-
let content =
|
|
30014
|
+
let content = readFileSync25(outputPath, "utf-8");
|
|
30015
30015
|
let changed = false;
|
|
30016
30016
|
content = content.replace(urlPattern, (_match, relPath) => {
|
|
30017
30017
|
const targetName = basename12(relPath);
|
|
@@ -30136,10 +30136,10 @@ ${content.slice(firstUseIdx)}`;
|
|
|
30136
30136
|
restoreTracePhase();
|
|
30137
30137
|
return;
|
|
30138
30138
|
}
|
|
30139
|
-
const traceDir =
|
|
30139
|
+
const traceDir = join40(buildPath2, ".absolute-trace");
|
|
30140
30140
|
const timestamp = new Date().toISOString().replace(/[:.]/g, "-");
|
|
30141
30141
|
mkdirSync12(traceDir, { recursive: true });
|
|
30142
|
-
writeFileSync9(
|
|
30142
|
+
writeFileSync9(join40(traceDir, `build-trace-${timestamp}.json`), JSON.stringify({
|
|
30143
30143
|
events: traceEvents,
|
|
30144
30144
|
frameworks: traceFrameworkNames,
|
|
30145
30145
|
generatedAt: new Date().toISOString(),
|
|
@@ -30170,15 +30170,15 @@ ${content.slice(firstUseIdx)}`;
|
|
|
30170
30170
|
const stylesPath = typeof stylesConfig === "string" ? stylesConfig : stylesConfig?.path;
|
|
30171
30171
|
const stylesIgnore = typeof stylesConfig === "object" ? stylesConfig.ignore : undefined;
|
|
30172
30172
|
const stylesDir = stylesPath && validateSafePath(stylesPath, projectRoot);
|
|
30173
|
-
const reactIndexesPath = reactDir &&
|
|
30174
|
-
const reactPagesPath = reactDir &&
|
|
30175
|
-
const htmlPagesPath = htmlDir &&
|
|
30176
|
-
const htmlScriptsPath = htmlDir &&
|
|
30177
|
-
const sveltePagesPath = svelteDir &&
|
|
30178
|
-
const vuePagesPath = vueDir &&
|
|
30179
|
-
const htmxPagesPath = htmxDir &&
|
|
30180
|
-
const angularPagesPath = angularDir &&
|
|
30181
|
-
const emberPagesPath = emberDir &&
|
|
30173
|
+
const reactIndexesPath = reactDir && join40(getFrameworkGeneratedDir("react"), "indexes");
|
|
30174
|
+
const reactPagesPath = reactDir && join40(reactDir, "pages");
|
|
30175
|
+
const htmlPagesPath = htmlDir && join40(htmlDir, "pages");
|
|
30176
|
+
const htmlScriptsPath = htmlDir && join40(htmlDir, "scripts");
|
|
30177
|
+
const sveltePagesPath = svelteDir && join40(svelteDir, "pages");
|
|
30178
|
+
const vuePagesPath = vueDir && join40(vueDir, "pages");
|
|
30179
|
+
const htmxPagesPath = htmxDir && join40(htmxDir, "pages");
|
|
30180
|
+
const angularPagesPath = angularDir && join40(angularDir, "pages");
|
|
30181
|
+
const emberPagesPath = emberDir && join40(emberDir, "pages");
|
|
30182
30182
|
const frontends = [
|
|
30183
30183
|
reactDir,
|
|
30184
30184
|
htmlDir,
|
|
@@ -30237,8 +30237,8 @@ ${content.slice(firstUseIdx)}`;
|
|
|
30237
30237
|
const [firstEntry] = serverDirMap;
|
|
30238
30238
|
if (!firstEntry)
|
|
30239
30239
|
throw new Error("Expected at least one server directory entry");
|
|
30240
|
-
serverRoot =
|
|
30241
|
-
serverOutDir =
|
|
30240
|
+
serverRoot = join40(firstEntry.dir, firstEntry.subdir);
|
|
30241
|
+
serverOutDir = join40(buildPath, basename12(firstEntry.dir));
|
|
30242
30242
|
} else if (serverDirMap.length > 1) {
|
|
30243
30243
|
serverRoot = commonAncestor(serverDirMap.map((entry) => entry.dir), projectRoot);
|
|
30244
30244
|
serverOutDir = buildPath;
|
|
@@ -30266,7 +30266,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
30266
30266
|
await tracePhase("react/index-generation", () => generateReactIndexFiles(reactPagesPath, reactIndexesPath, hmr));
|
|
30267
30267
|
}
|
|
30268
30268
|
if (assetsPath && (!isIncremental || normalizedIncrementalFiles?.some((f2) => f2.includes("/assets/")))) {
|
|
30269
|
-
await tracePhase("assets/copy", () => cpSync(assetsPath,
|
|
30269
|
+
await tracePhase("assets/copy", () => cpSync(assetsPath, join40(buildPath, "assets"), {
|
|
30270
30270
|
force: true,
|
|
30271
30271
|
recursive: true
|
|
30272
30272
|
}));
|
|
@@ -30376,11 +30376,11 @@ ${content.slice(firstUseIdx)}`;
|
|
|
30376
30376
|
}
|
|
30377
30377
|
}
|
|
30378
30378
|
if (htmlDefaults.error || htmlDefaults.notFound || htmlDefaults.loading || Object.keys(htmlPages).length > 0) {
|
|
30379
|
-
const htmlConventionsOutDir =
|
|
30379
|
+
const htmlConventionsOutDir = join40(buildPath, "conventions", "html");
|
|
30380
30380
|
mkdirSync12(htmlConventionsOutDir, { recursive: true });
|
|
30381
30381
|
const htmlPathRemap = new Map;
|
|
30382
30382
|
for (const sourcePath of htmlConventionSources) {
|
|
30383
|
-
const dest =
|
|
30383
|
+
const dest = join40(htmlConventionsOutDir, basename12(sourcePath));
|
|
30384
30384
|
cpSync(sourcePath, dest, { force: true });
|
|
30385
30385
|
htmlPathRemap.set(sourcePath, dest);
|
|
30386
30386
|
}
|
|
@@ -30423,7 +30423,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
30423
30423
|
const reactEntries = isIncremental && reactIndexesPath && reactPagesPath ? filterToIncrementalEntries(allReactEntries, (entry) => {
|
|
30424
30424
|
if (entry.startsWith(resolve28(reactIndexesPath))) {
|
|
30425
30425
|
const pageName = basename12(entry, ".tsx");
|
|
30426
|
-
return
|
|
30426
|
+
return join40(reactPagesPath, `${pageName}.tsx`);
|
|
30427
30427
|
}
|
|
30428
30428
|
return null;
|
|
30429
30429
|
}) : allReactEntries;
|
|
@@ -30542,14 +30542,14 @@ ${content.slice(firstUseIdx)}`;
|
|
|
30542
30542
|
try {
|
|
30543
30543
|
const { primeComponentFingerprint: primeComponentFingerprint2 } = await Promise.resolve().then(() => (init_fastHmrCompiler(), exports_fastHmrCompiler));
|
|
30544
30544
|
const { readdir: readdir4 } = await import("fs/promises");
|
|
30545
|
-
const { join:
|
|
30545
|
+
const { join: join41 } = await import("path");
|
|
30546
30546
|
const walk = async (dir) => {
|
|
30547
30547
|
const entries = await readdir4(dir, {
|
|
30548
30548
|
withFileTypes: true
|
|
30549
30549
|
});
|
|
30550
30550
|
const out = [];
|
|
30551
30551
|
for (const entry of entries) {
|
|
30552
|
-
const full =
|
|
30552
|
+
const full = join41(dir, entry.name);
|
|
30553
30553
|
if (entry.isDirectory()) {
|
|
30554
30554
|
out.push(...await walk(full));
|
|
30555
30555
|
} else if (entry.isFile() && entry.name.endsWith(".ts") && !entry.name.endsWith(".d.ts")) {
|
|
@@ -30614,7 +30614,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
30614
30614
|
const compileReactConventions = async () => {
|
|
30615
30615
|
if (reactConventionSources.length === 0)
|
|
30616
30616
|
return emptyStringArray;
|
|
30617
|
-
const destDir =
|
|
30617
|
+
const destDir = join40(buildPath, "conventions", "react");
|
|
30618
30618
|
rmSync2(destDir, { force: true, recursive: true });
|
|
30619
30619
|
mkdirSync12(destDir, { recursive: true });
|
|
30620
30620
|
const destPaths = [];
|
|
@@ -30658,7 +30658,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
30658
30658
|
angularConventionSources.length > 0 && angularDir ? tracePhase("compile/convention-angular", () => Promise.resolve().then(() => (init_compileAngular(), exports_compileAngular)).then((mod) => mod.compileAngular(angularConventionSources, angularDir, hmr, styleTransformConfig))) : { serverPaths: emptyStringArray }
|
|
30659
30659
|
]);
|
|
30660
30660
|
const bundleConventionFiles = async (framework, compiledPaths) => {
|
|
30661
|
-
const destDir =
|
|
30661
|
+
const destDir = join40(buildPath, "conventions", framework);
|
|
30662
30662
|
rmSync2(destDir, { force: true, recursive: true });
|
|
30663
30663
|
mkdirSync12(destDir, { recursive: true });
|
|
30664
30664
|
const destPaths = [];
|
|
@@ -30732,7 +30732,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
30732
30732
|
}
|
|
30733
30733
|
})) : {
|
|
30734
30734
|
entries: [],
|
|
30735
|
-
generatedRoot:
|
|
30735
|
+
generatedRoot: join40(buildPath, "_island_entries")
|
|
30736
30736
|
};
|
|
30737
30737
|
const islandClientEntryPoints = islandEntryResult.entries.map((entry) => entry.entryPath);
|
|
30738
30738
|
if (serverEntryPoints.length === 0 && reactClientEntryPoints.length === 0 && nonReactClientEntryPoints.length === 0 && islandClientEntryPoints.length === 0 && htmxDir === undefined && htmlDir === undefined) {
|
|
@@ -30768,7 +30768,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
30768
30768
|
return {};
|
|
30769
30769
|
}
|
|
30770
30770
|
if (hmr && reactIndexesPath && reactClientEntryPoints.length > 0) {
|
|
30771
|
-
const refreshEntry =
|
|
30771
|
+
const refreshEntry = join40(reactIndexesPath, "_refresh.tsx");
|
|
30772
30772
|
if (!reactClientEntryPoints.includes(refreshEntry))
|
|
30773
30773
|
reactClientEntryPoints.push(refreshEntry);
|
|
30774
30774
|
}
|
|
@@ -30904,19 +30904,19 @@ ${content.slice(firstUseIdx)}`;
|
|
|
30904
30904
|
throw: false
|
|
30905
30905
|
}, resolveBunBuildOverride(bunBuildConfig, "reactClient")) : undefined;
|
|
30906
30906
|
if (reactDir && reactClientEntryPoints.length > 0) {
|
|
30907
|
-
rmSync2(
|
|
30907
|
+
rmSync2(join40(buildPath, "react", "generated", "indexes"), {
|
|
30908
30908
|
force: true,
|
|
30909
30909
|
recursive: true
|
|
30910
30910
|
});
|
|
30911
30911
|
}
|
|
30912
30912
|
if (angularDir && angularClientPaths.length > 0) {
|
|
30913
|
-
rmSync2(
|
|
30913
|
+
rmSync2(join40(buildPath, "angular", "indexes"), {
|
|
30914
30914
|
force: true,
|
|
30915
30915
|
recursive: true
|
|
30916
30916
|
});
|
|
30917
30917
|
}
|
|
30918
30918
|
if (islandClientEntryPoints.length > 0) {
|
|
30919
|
-
rmSync2(
|
|
30919
|
+
rmSync2(join40(buildPath, "islands"), {
|
|
30920
30920
|
force: true,
|
|
30921
30921
|
recursive: true
|
|
30922
30922
|
});
|
|
@@ -31008,7 +31008,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
31008
31008
|
globalCssEntries.length > 0 ? tracePhase("bun/global-css", () => bunBuild7(mergeBunBuildConfig({
|
|
31009
31009
|
entrypoints: globalCssEntries,
|
|
31010
31010
|
naming: `[dir]/[name].[hash].[ext]`,
|
|
31011
|
-
outdir: stylesDir ?
|
|
31011
|
+
outdir: stylesDir ? join40(buildPath, basename12(stylesDir)) : buildPath,
|
|
31012
31012
|
plugins: [stylePreprocessorPlugin2],
|
|
31013
31013
|
root: stylesDir || clientRoot,
|
|
31014
31014
|
target: "browser",
|
|
@@ -31017,7 +31017,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
31017
31017
|
vueCssPaths.length > 0 ? tracePhase("bun/vue-css", () => bunBuild7(mergeBunBuildConfig({
|
|
31018
31018
|
entrypoints: vueCssPaths,
|
|
31019
31019
|
naming: `[name].[hash].[ext]`,
|
|
31020
|
-
outdir:
|
|
31020
|
+
outdir: join40(buildPath, assetsPath ? basename12(assetsPath) : "assets", "css"),
|
|
31021
31021
|
target: "browser",
|
|
31022
31022
|
throw: false
|
|
31023
31023
|
}, resolveBunBuildOverride(bunBuildConfig, "vueCss")))) : undefined
|
|
@@ -31238,7 +31238,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
31238
31238
|
const injectHMRIntoHTMLFile = (filePath, framework) => {
|
|
31239
31239
|
if (!hmrClientBundle)
|
|
31240
31240
|
return;
|
|
31241
|
-
let html =
|
|
31241
|
+
let html = readFileSync25(filePath, "utf-8");
|
|
31242
31242
|
if (html.includes("data-hmr-client"))
|
|
31243
31243
|
return;
|
|
31244
31244
|
const tag = `<script>window.__HMR_FRAMEWORK__="${framework}";</script><script data-hmr-client>${hmrClientBundle}</script>`;
|
|
@@ -31249,7 +31249,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
31249
31249
|
const processHtmlPages = async () => {
|
|
31250
31250
|
if (!(htmlDir && htmlPagesPath))
|
|
31251
31251
|
return;
|
|
31252
|
-
const outputHtmlPages = isSingle ?
|
|
31252
|
+
const outputHtmlPages = isSingle ? join40(buildPath, "pages") : join40(buildPath, basename12(htmlDir), "pages");
|
|
31253
31253
|
mkdirSync12(outputHtmlPages, { recursive: true });
|
|
31254
31254
|
cpSync(htmlPagesPath, outputHtmlPages, {
|
|
31255
31255
|
force: true,
|
|
@@ -31274,14 +31274,14 @@ ${content.slice(firstUseIdx)}`;
|
|
|
31274
31274
|
const processHtmxPages = async () => {
|
|
31275
31275
|
if (!(htmxDir && htmxPagesPath))
|
|
31276
31276
|
return;
|
|
31277
|
-
const outputHtmxPages = isSingle ?
|
|
31277
|
+
const outputHtmxPages = isSingle ? join40(buildPath, "pages") : join40(buildPath, basename12(htmxDir), "pages");
|
|
31278
31278
|
mkdirSync12(outputHtmxPages, { recursive: true });
|
|
31279
31279
|
cpSync(htmxPagesPath, outputHtmxPages, {
|
|
31280
31280
|
force: true,
|
|
31281
31281
|
recursive: true
|
|
31282
31282
|
});
|
|
31283
31283
|
if (shouldCopyHtmx) {
|
|
31284
|
-
const htmxDestDir = isSingle ? buildPath :
|
|
31284
|
+
const htmxDestDir = isSingle ? buildPath : join40(buildPath, basename12(htmxDir));
|
|
31285
31285
|
copyHtmxVendor(htmxDir, htmxDestDir);
|
|
31286
31286
|
}
|
|
31287
31287
|
if (shouldUpdateHtmxAssetPaths) {
|
|
@@ -31348,9 +31348,9 @@ ${content.slice(firstUseIdx)}`;
|
|
|
31348
31348
|
writeBuildTrace(buildPath);
|
|
31349
31349
|
return { conventions: conventionsMap, manifest };
|
|
31350
31350
|
}
|
|
31351
|
-
writeFileSync9(
|
|
31351
|
+
writeFileSync9(join40(buildPath, "manifest.json"), JSON.stringify(manifest, null, "\t"));
|
|
31352
31352
|
if (Object.keys(conventionsMap).length > 0) {
|
|
31353
|
-
writeFileSync9(
|
|
31353
|
+
writeFileSync9(join40(buildPath, "conventions.json"), JSON.stringify(conventionsMap, null, "\t"));
|
|
31354
31354
|
}
|
|
31355
31355
|
writeBuildTrace(buildPath);
|
|
31356
31356
|
if (mode === "production") {
|
|
@@ -31472,8 +31472,8 @@ var init_build = __esm(() => {
|
|
|
31472
31472
|
});
|
|
31473
31473
|
|
|
31474
31474
|
// src/build/buildEmberVendor.ts
|
|
31475
|
-
import { mkdirSync as mkdirSync13, existsSync as
|
|
31476
|
-
import { join as
|
|
31475
|
+
import { mkdirSync as mkdirSync13, existsSync as existsSync31 } from "fs";
|
|
31476
|
+
import { join as join41 } from "path";
|
|
31477
31477
|
import { rm as rm9 } from "fs/promises";
|
|
31478
31478
|
var {build: bunBuild8 } = globalThis.Bun;
|
|
31479
31479
|
var toSafeFileName5 = (specifier) => specifier.replace(/^@/, "").replace(/\//g, "_"), generateMacrosShim = () => `// Generated shim for @embroider/macros \u2014 provides minimal runtime
|
|
@@ -31525,8 +31525,8 @@ export const importSync = (specifier) => {
|
|
|
31525
31525
|
if (standaloneSpecifiers.has(specifier)) {
|
|
31526
31526
|
return { resolveTo: specifier, specifier };
|
|
31527
31527
|
}
|
|
31528
|
-
const emberInternalPath =
|
|
31529
|
-
if (!
|
|
31528
|
+
const emberInternalPath = join41(cwd2, "node_modules/ember-source/dist/packages", specifier, "index.js");
|
|
31529
|
+
if (!existsSync31(emberInternalPath)) {
|
|
31530
31530
|
throw new Error(`Ember vendor build: cannot find ${specifier} at ${emberInternalPath}. ` + `Is ember-source installed and at least 6.12?`);
|
|
31531
31531
|
}
|
|
31532
31532
|
return { resolveTo: emberInternalPath, specifier };
|
|
@@ -31557,24 +31557,24 @@ export const importSync = (specifier) => {
|
|
|
31557
31557
|
if (standalonePackages.has(args.path)) {
|
|
31558
31558
|
return;
|
|
31559
31559
|
}
|
|
31560
|
-
const internal =
|
|
31561
|
-
if (
|
|
31560
|
+
const internal = join41(cwd2, "node_modules/ember-source/dist/packages", args.path, "index.js");
|
|
31561
|
+
if (existsSync31(internal)) {
|
|
31562
31562
|
return { path: internal };
|
|
31563
31563
|
}
|
|
31564
31564
|
return;
|
|
31565
31565
|
});
|
|
31566
31566
|
}
|
|
31567
31567
|
}), buildEmberVendor = async (buildDir, cwd2 = process.cwd()) => {
|
|
31568
|
-
const vendorDir =
|
|
31568
|
+
const vendorDir = join41(buildDir, "ember", "vendor");
|
|
31569
31569
|
mkdirSync13(vendorDir, { recursive: true });
|
|
31570
|
-
const tmpDir =
|
|
31570
|
+
const tmpDir = join41(buildDir, "_ember_vendor_tmp");
|
|
31571
31571
|
mkdirSync13(tmpDir, { recursive: true });
|
|
31572
|
-
const macrosShimPath =
|
|
31572
|
+
const macrosShimPath = join41(tmpDir, "embroider_macros_shim.js");
|
|
31573
31573
|
await Bun.write(macrosShimPath, generateMacrosShim());
|
|
31574
31574
|
const resolutions = REQUIRED_EMBER_SPECIFIERS.map((specifier) => resolveEmberSpecifier(specifier, cwd2));
|
|
31575
31575
|
const entrypoints = await Promise.all(resolutions.map(async (resolution) => {
|
|
31576
31576
|
const safeName = toSafeFileName5(resolution.specifier);
|
|
31577
|
-
const entryPath =
|
|
31577
|
+
const entryPath = join41(tmpDir, `${safeName}.js`);
|
|
31578
31578
|
const source = resolution.specifier === "@embroider/macros" ? `export * from ${JSON.stringify(macrosShimPath)};
|
|
31579
31579
|
` : generateVendorEntrySource2(resolution);
|
|
31580
31580
|
await Bun.write(entryPath, source);
|
|
@@ -31627,7 +31627,7 @@ __export(exports_dependencyGraph, {
|
|
|
31627
31627
|
buildInitialDependencyGraph: () => buildInitialDependencyGraph,
|
|
31628
31628
|
addFileToGraph: () => addFileToGraph
|
|
31629
31629
|
});
|
|
31630
|
-
import { existsSync as
|
|
31630
|
+
import { existsSync as existsSync32, readFileSync as readFileSync26 } from "fs";
|
|
31631
31631
|
var {Glob: Glob9 } = globalThis.Bun;
|
|
31632
31632
|
import { resolve as resolve29 } from "path";
|
|
31633
31633
|
var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath) => {
|
|
@@ -31657,10 +31657,10 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
31657
31657
|
];
|
|
31658
31658
|
for (const ext of extensions) {
|
|
31659
31659
|
const withExt = normalized + ext;
|
|
31660
|
-
if (
|
|
31660
|
+
if (existsSync32(withExt))
|
|
31661
31661
|
return withExt;
|
|
31662
31662
|
}
|
|
31663
|
-
if (
|
|
31663
|
+
if (existsSync32(normalized))
|
|
31664
31664
|
return normalized;
|
|
31665
31665
|
return null;
|
|
31666
31666
|
}, clearExistingDependents = (graph, normalizedPath) => {
|
|
@@ -31675,7 +31675,7 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
31675
31675
|
}
|
|
31676
31676
|
}, addFileToGraph = (graph, filePath) => {
|
|
31677
31677
|
const normalizedPath = resolve29(filePath);
|
|
31678
|
-
if (!
|
|
31678
|
+
if (!existsSync32(normalizedPath))
|
|
31679
31679
|
return;
|
|
31680
31680
|
const dependencies = extractDependencies(normalizedPath);
|
|
31681
31681
|
clearExistingDependents(graph, normalizedPath);
|
|
@@ -31701,7 +31701,7 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
31701
31701
|
}, IGNORED_SEGMENTS, buildInitialDependencyGraph = (graph, directories) => {
|
|
31702
31702
|
const processedFiles = new Set;
|
|
31703
31703
|
const glob = new Glob9("**/*.{ts,tsx,js,jsx,vue,svelte,html,htm}");
|
|
31704
|
-
const resolvedDirs = directories.map((dir) => resolve29(dir)).filter((dir) =>
|
|
31704
|
+
const resolvedDirs = directories.map((dir) => resolve29(dir)).filter((dir) => existsSync32(dir));
|
|
31705
31705
|
const allFiles = resolvedDirs.flatMap((dir) => Array.from(glob.scanSync({ absolute: true, cwd: dir })));
|
|
31706
31706
|
for (const file5 of allFiles) {
|
|
31707
31707
|
const fullPath = resolve29(file5);
|
|
@@ -31798,15 +31798,15 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
31798
31798
|
const lowerPath = filePath.toLowerCase();
|
|
31799
31799
|
const isSvelteOrVue = lowerPath.endsWith(".svelte") || lowerPath.endsWith(".vue");
|
|
31800
31800
|
if (loader === "html") {
|
|
31801
|
-
const content =
|
|
31801
|
+
const content = readFileSync26(filePath, "utf-8");
|
|
31802
31802
|
return extractHtmlDependencies(filePath, content);
|
|
31803
31803
|
}
|
|
31804
31804
|
if (loader === "tsx" || loader === "js") {
|
|
31805
|
-
const content =
|
|
31805
|
+
const content = readFileSync26(filePath, "utf-8");
|
|
31806
31806
|
return extractJsDependencies(filePath, content, loader);
|
|
31807
31807
|
}
|
|
31808
31808
|
if (isSvelteOrVue) {
|
|
31809
|
-
const content =
|
|
31809
|
+
const content = readFileSync26(filePath, "utf-8");
|
|
31810
31810
|
return extractSvelteVueDependencies(filePath, content);
|
|
31811
31811
|
}
|
|
31812
31812
|
return [];
|
|
@@ -31949,7 +31949,7 @@ var init_clientManager = __esm(() => {
|
|
|
31949
31949
|
});
|
|
31950
31950
|
|
|
31951
31951
|
// src/dev/pathUtils.ts
|
|
31952
|
-
import { existsSync as
|
|
31952
|
+
import { existsSync as existsSync33, readdirSync as readdirSync5, readFileSync as readFileSync27 } from "fs";
|
|
31953
31953
|
import { dirname as dirname21, resolve as resolve31 } from "path";
|
|
31954
31954
|
var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
31955
31955
|
if (shouldIgnorePath(filePath, resolved)) {
|
|
@@ -32049,7 +32049,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
32049
32049
|
}
|
|
32050
32050
|
let source;
|
|
32051
32051
|
try {
|
|
32052
|
-
source =
|
|
32052
|
+
source = readFileSync27(full, "utf8");
|
|
32053
32053
|
} catch {
|
|
32054
32054
|
continue;
|
|
32055
32055
|
}
|
|
@@ -32123,7 +32123,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
32123
32123
|
push(cfg.stylesDir);
|
|
32124
32124
|
for (const candidate of ["src", "db", "assets", "styles"]) {
|
|
32125
32125
|
const abs = normalizePath(resolve31(cwd2, candidate));
|
|
32126
|
-
if (
|
|
32126
|
+
if (existsSync33(abs) && !roots.includes(abs))
|
|
32127
32127
|
roots.push(abs);
|
|
32128
32128
|
}
|
|
32129
32129
|
try {
|
|
@@ -32208,8 +32208,8 @@ var init_pathUtils = __esm(() => {
|
|
|
32208
32208
|
|
|
32209
32209
|
// src/dev/fileWatcher.ts
|
|
32210
32210
|
import { watch } from "fs";
|
|
32211
|
-
import { existsSync as
|
|
32212
|
-
import { dirname as dirname22, join as
|
|
32211
|
+
import { existsSync as existsSync34, readdirSync as readdirSync6, statSync as statSync4 } from "fs";
|
|
32212
|
+
import { dirname as dirname22, join as join42, resolve as resolve32 } from "path";
|
|
32213
32213
|
var safeRemoveFromGraph = (graph, fullPath) => {
|
|
32214
32214
|
try {
|
|
32215
32215
|
removeFileFromGraph(graph, fullPath);
|
|
@@ -32242,7 +32242,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
32242
32242
|
for (const name of entries) {
|
|
32243
32243
|
if (shouldSkipFilename(name, isStylesDir))
|
|
32244
32244
|
continue;
|
|
32245
|
-
const child =
|
|
32245
|
+
const child = join42(eventDir, name).replace(/\\/g, "/");
|
|
32246
32246
|
let st2;
|
|
32247
32247
|
try {
|
|
32248
32248
|
st2 = statSync4(child);
|
|
@@ -32267,21 +32267,21 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
32267
32267
|
return;
|
|
32268
32268
|
if (shouldSkipFilename(filename, isStylesDir)) {
|
|
32269
32269
|
if (event === "rename") {
|
|
32270
|
-
const eventDir = dirname22(
|
|
32270
|
+
const eventDir = dirname22(join42(absolutePath, filename)).replace(/\\/g, "/");
|
|
32271
32271
|
atomicRecoveryScan(eventDir);
|
|
32272
32272
|
}
|
|
32273
32273
|
return;
|
|
32274
32274
|
}
|
|
32275
|
-
const fullPath =
|
|
32275
|
+
const fullPath = join42(absolutePath, filename).replace(/\\/g, "/");
|
|
32276
32276
|
if (shouldIgnorePath(fullPath, state.resolvedPaths)) {
|
|
32277
32277
|
return;
|
|
32278
32278
|
}
|
|
32279
|
-
if (event === "rename" && !
|
|
32279
|
+
if (event === "rename" && !existsSync34(fullPath)) {
|
|
32280
32280
|
safeRemoveFromGraph(state.dependencyGraph, fullPath);
|
|
32281
32281
|
onFileChange(fullPath);
|
|
32282
32282
|
return;
|
|
32283
32283
|
}
|
|
32284
|
-
if (
|
|
32284
|
+
if (existsSync34(fullPath)) {
|
|
32285
32285
|
onFileChange(fullPath);
|
|
32286
32286
|
safeAddToGraph(state.dependencyGraph, fullPath);
|
|
32287
32287
|
}
|
|
@@ -32291,7 +32291,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
32291
32291
|
const stylesDir = state.resolvedPaths?.stylesDir;
|
|
32292
32292
|
paths.forEach((path) => {
|
|
32293
32293
|
const absolutePath = resolve32(path).replace(/\\/g, "/");
|
|
32294
|
-
if (!
|
|
32294
|
+
if (!existsSync34(absolutePath)) {
|
|
32295
32295
|
return;
|
|
32296
32296
|
}
|
|
32297
32297
|
const isStylesDir = Boolean(stylesDir && absolutePath.startsWith(stylesDir));
|
|
@@ -32302,7 +32302,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
32302
32302
|
const stylesDir = state.resolvedPaths?.stylesDir;
|
|
32303
32303
|
watchPaths.forEach((path) => {
|
|
32304
32304
|
const absolutePath = resolve32(path).replace(/\\/g, "/");
|
|
32305
|
-
if (!
|
|
32305
|
+
if (!existsSync34(absolutePath)) {
|
|
32306
32306
|
return;
|
|
32307
32307
|
}
|
|
32308
32308
|
const isStylesDir = Boolean(stylesDir && absolutePath.startsWith(stylesDir));
|
|
@@ -32424,10 +32424,10 @@ var init_assetStore = __esm(() => {
|
|
|
32424
32424
|
});
|
|
32425
32425
|
|
|
32426
32426
|
// src/dev/fileHashTracker.ts
|
|
32427
|
-
import { readFileSync as
|
|
32427
|
+
import { readFileSync as readFileSync28 } from "fs";
|
|
32428
32428
|
var computeFileHash = (filePath) => {
|
|
32429
32429
|
try {
|
|
32430
|
-
const fileContent =
|
|
32430
|
+
const fileContent = readFileSync28(filePath);
|
|
32431
32431
|
return Number(Bun.hash(fileContent));
|
|
32432
32432
|
} catch {
|
|
32433
32433
|
return UNFOUND_INDEX;
|
|
@@ -32641,8 +32641,8 @@ __export(exports_resolveOwningComponents, {
|
|
|
32641
32641
|
resolveDescendantsOfParent: () => resolveDescendantsOfParent,
|
|
32642
32642
|
invalidateResourceIndex: () => invalidateResourceIndex
|
|
32643
32643
|
});
|
|
32644
|
-
import { readdirSync as readdirSync7, readFileSync as
|
|
32645
|
-
import { dirname as dirname23, extname as extname9, join as
|
|
32644
|
+
import { readdirSync as readdirSync7, readFileSync as readFileSync29, statSync as statSync5 } from "fs";
|
|
32645
|
+
import { dirname as dirname23, extname as extname9, join as join43, resolve as resolve36 } from "path";
|
|
32646
32646
|
import ts16 from "typescript";
|
|
32647
32647
|
var ENTITY_DECORATORS, isAngularSourceFile = (file5) => file5.endsWith(".ts") || file5.endsWith(".tsx"), walkAngularSourceFiles = (root) => {
|
|
32648
32648
|
const out = [];
|
|
@@ -32657,7 +32657,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file5) => file5.endsWith(".ts") ||
|
|
|
32657
32657
|
if (entry.name.startsWith(".") || entry.name === "node_modules") {
|
|
32658
32658
|
continue;
|
|
32659
32659
|
}
|
|
32660
|
-
const full =
|
|
32660
|
+
const full = join43(dir, entry.name);
|
|
32661
32661
|
if (entry.isDirectory()) {
|
|
32662
32662
|
visit(full);
|
|
32663
32663
|
} else if (entry.isFile() && isAngularSourceFile(entry.name)) {
|
|
@@ -32701,7 +32701,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file5) => file5.endsWith(".ts") ||
|
|
|
32701
32701
|
}, parseDecoratedClasses = (filePath) => {
|
|
32702
32702
|
let source;
|
|
32703
32703
|
try {
|
|
32704
|
-
source =
|
|
32704
|
+
source = readFileSync29(filePath, "utf8");
|
|
32705
32705
|
} catch {
|
|
32706
32706
|
return [];
|
|
32707
32707
|
}
|
|
@@ -32791,7 +32791,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file5) => file5.endsWith(".ts") ||
|
|
|
32791
32791
|
}, indexByRoot, resolveParentClassFile = (parentName, childFilePath, angularRoot) => {
|
|
32792
32792
|
let source;
|
|
32793
32793
|
try {
|
|
32794
|
-
source =
|
|
32794
|
+
source = readFileSync29(childFilePath, "utf8");
|
|
32795
32795
|
} catch {
|
|
32796
32796
|
return null;
|
|
32797
32797
|
}
|
|
@@ -33027,8 +33027,8 @@ __export(exports_moduleServer, {
|
|
|
33027
33027
|
createModuleServer: () => createModuleServer,
|
|
33028
33028
|
SRC_URL_PREFIX: () => SRC_URL_PREFIX
|
|
33029
33029
|
});
|
|
33030
|
-
import { existsSync as
|
|
33031
|
-
import { basename as basename14, dirname as dirname24, extname as extname10, join as
|
|
33030
|
+
import { existsSync as existsSync35, readFileSync as readFileSync30, realpathSync as realpathSync3, statSync as statSync6 } from "fs";
|
|
33031
|
+
import { basename as basename14, dirname as dirname24, extname as extname10, join as join44, resolve as resolve37, relative as relative15 } from "path";
|
|
33032
33032
|
var SRC_PREFIX = "/@src/", jsTranspiler2, legacyDecoratorTsconfig, tsTranspiler2, tsxTranspiler, TRANSPILABLE, ALL_EXPORTS_RE, STRING_CONTENTS_RE, preserveTypeExports = (originalSource, transpiled, valueExports) => {
|
|
33033
33033
|
const codeOnly = originalSource.replace(STRING_CONTENTS_RE, '""');
|
|
33034
33034
|
const allExports = [];
|
|
@@ -33048,10 +33048,10 @@ var SRC_PREFIX = "/@src/", jsTranspiler2, legacyDecoratorTsconfig, tsTranspiler2
|
|
|
33048
33048
|
${stubs}
|
|
33049
33049
|
`;
|
|
33050
33050
|
}, resolveRelativeExtension = (srcPath, projectRoot, extensions) => {
|
|
33051
|
-
const directHit = extensions.find((ext) =>
|
|
33051
|
+
const directHit = extensions.find((ext) => existsSync35(resolve37(projectRoot, srcPath + ext)));
|
|
33052
33052
|
if (directHit)
|
|
33053
33053
|
return srcPath + directHit;
|
|
33054
|
-
const indexHit = extensions.find((ext) =>
|
|
33054
|
+
const indexHit = extensions.find((ext) => existsSync35(resolve37(projectRoot, srcPath, `index${ext}`)));
|
|
33055
33055
|
if (indexHit)
|
|
33056
33056
|
return `${srcPath}/index${indexHit}`;
|
|
33057
33057
|
return srcPath;
|
|
@@ -33105,13 +33105,13 @@ ${stubs}
|
|
|
33105
33105
|
const subpath = isScoped ? parts.slice(2).join("/") : parts.slice(1).join("/");
|
|
33106
33106
|
if (!subpath) {
|
|
33107
33107
|
const pkgDir = resolve37(projectRoot, "node_modules", packageName ?? "");
|
|
33108
|
-
const pkgJsonPath =
|
|
33109
|
-
if (
|
|
33110
|
-
const pkg = JSON.parse(
|
|
33108
|
+
const pkgJsonPath = join44(pkgDir, "package.json");
|
|
33109
|
+
if (existsSync35(pkgJsonPath)) {
|
|
33110
|
+
const pkg = JSON.parse(readFileSync30(pkgJsonPath, "utf-8"));
|
|
33111
33111
|
const esmEntry = typeof pkg.module === "string" && pkg.module || typeof pkg.browser === "string" && pkg.browser;
|
|
33112
33112
|
if (esmEntry) {
|
|
33113
33113
|
const resolved = resolve37(pkgDir, esmEntry);
|
|
33114
|
-
if (
|
|
33114
|
+
if (existsSync35(resolved))
|
|
33115
33115
|
return relative15(projectRoot, resolved);
|
|
33116
33116
|
}
|
|
33117
33117
|
}
|
|
@@ -33208,7 +33208,7 @@ ${code}`;
|
|
|
33208
33208
|
reactFastRefreshWarningEmitted = true;
|
|
33209
33209
|
logWarn("React HMR is blocked: this Bun build ignores " + "`reactFastRefresh` on Bun.Transpiler, so component state " + "cannot be preserved across edits. Tracking " + "https://github.com/oven-sh/bun/pull/28312 \u2014 if it still has " + "not merged, leave a \uD83D\uDC4D on the PR so the Bun team knows it " + "is blocking you. Until then, React edits trigger a full " + "reload instead of a fast refresh.");
|
|
33210
33210
|
}, transformReactFile = (filePath, projectRoot, rewriter) => {
|
|
33211
|
-
const raw =
|
|
33211
|
+
const raw = readFileSync30(filePath, "utf-8");
|
|
33212
33212
|
const valueExports = tsxTranspiler.scan(raw).exports;
|
|
33213
33213
|
let transpiled = reactTranspiler.transformSync(raw);
|
|
33214
33214
|
transpiled = preserveTypeExports(raw, transpiled, valueExports);
|
|
@@ -33224,7 +33224,7 @@ ${transpiled}`;
|
|
|
33224
33224
|
transpiled += buildIslandMetadataExports(raw);
|
|
33225
33225
|
return rewriteImports(transpiled, filePath, projectRoot, rewriter);
|
|
33226
33226
|
}, transformPlainFile = (filePath, projectRoot, rewriter, vueDir) => {
|
|
33227
|
-
const raw =
|
|
33227
|
+
const raw = readFileSync30(filePath, "utf-8");
|
|
33228
33228
|
const ext = extname10(filePath);
|
|
33229
33229
|
const isTS = ext === ".ts" || ext === ".tsx";
|
|
33230
33230
|
const isTSX = ext === ".tsx" || ext === ".jsx";
|
|
@@ -33390,7 +33390,7 @@ ${code}`;
|
|
|
33390
33390
|
` + ` var __hmr_accept = function(cb) { window.__SVELTE_HMR_ACCEPT__[${JSON.stringify(moduleUrl)}] = cb; };`);
|
|
33391
33391
|
return code.replace(/import\.meta\.hot\.accept\(/g, "__hmr_accept(");
|
|
33392
33392
|
}, transformSvelteFile = async (filePath, projectRoot, rewriter, stylePreprocessors) => {
|
|
33393
|
-
const raw =
|
|
33393
|
+
const raw = readFileSync30(filePath, "utf-8");
|
|
33394
33394
|
if (!svelteCompiler) {
|
|
33395
33395
|
svelteCompiler = await import("svelte/compiler");
|
|
33396
33396
|
}
|
|
@@ -33456,7 +33456,7 @@ export default __script__;`;
|
|
|
33456
33456
|
return `${cssInjection}
|
|
33457
33457
|
${code}`;
|
|
33458
33458
|
}, transformVueFile = async (filePath, projectRoot, rewriter, vueDir, stylePreprocessors) => {
|
|
33459
|
-
const rawSource =
|
|
33459
|
+
const rawSource = readFileSync30(filePath, "utf-8");
|
|
33460
33460
|
const raw = addAutoRouterSetupApp(rawSource);
|
|
33461
33461
|
if (!vueCompiler) {
|
|
33462
33462
|
vueCompiler = await import("@vue/compiler-sfc");
|
|
@@ -33467,9 +33467,9 @@ ${code}`;
|
|
|
33467
33467
|
const hasScript = descriptor.script || descriptor.scriptSetup;
|
|
33468
33468
|
const compiledScript = hasScript ? vueCompiler.compileScript(descriptor, {
|
|
33469
33469
|
fs: {
|
|
33470
|
-
fileExists:
|
|
33470
|
+
fileExists: existsSync35,
|
|
33471
33471
|
realpath: realpathSync3,
|
|
33472
|
-
readFile: (file5) =>
|
|
33472
|
+
readFile: (file5) => existsSync35(file5) ? readFileSync30(file5, "utf-8") : undefined
|
|
33473
33473
|
},
|
|
33474
33474
|
id: componentId,
|
|
33475
33475
|
inlineTemplate: false
|
|
@@ -33499,11 +33499,11 @@ ${code}`;
|
|
|
33499
33499
|
`);
|
|
33500
33500
|
return result;
|
|
33501
33501
|
}, resolveSvelteModulePath = (path) => {
|
|
33502
|
-
if (
|
|
33502
|
+
if (existsSync35(path))
|
|
33503
33503
|
return path;
|
|
33504
|
-
if (
|
|
33504
|
+
if (existsSync35(`${path}.ts`))
|
|
33505
33505
|
return `${path}.ts`;
|
|
33506
|
-
if (
|
|
33506
|
+
if (existsSync35(`${path}.js`))
|
|
33507
33507
|
return `${path}.js`;
|
|
33508
33508
|
return path;
|
|
33509
33509
|
}, jsResponse = (body) => {
|
|
@@ -33516,7 +33516,7 @@ ${code}`;
|
|
|
33516
33516
|
}
|
|
33517
33517
|
});
|
|
33518
33518
|
}, handleCssRequest = (filePath) => {
|
|
33519
|
-
const raw =
|
|
33519
|
+
const raw = readFileSync30(filePath, "utf-8");
|
|
33520
33520
|
const escaped = raw.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$/g, "\\$");
|
|
33521
33521
|
return [
|
|
33522
33522
|
`const style = document.createElement('style');`,
|
|
@@ -33654,7 +33654,7 @@ export default {};
|
|
|
33654
33654
|
return { ext, filePath: resolveSvelteModulePath(filePath) };
|
|
33655
33655
|
if (ext)
|
|
33656
33656
|
return { ext, filePath };
|
|
33657
|
-
const found = MODULE_EXTENSIONS.find((candidate) =>
|
|
33657
|
+
const found = MODULE_EXTENSIONS.find((candidate) => existsSync35(filePath + candidate));
|
|
33658
33658
|
if (!found)
|
|
33659
33659
|
return { ext, filePath };
|
|
33660
33660
|
const resolved = filePath + found;
|
|
@@ -34185,8 +34185,8 @@ var handleHTMXUpdate = async (htmxFilePath) => {
|
|
|
34185
34185
|
var init_simpleHTMXHMR = () => {};
|
|
34186
34186
|
|
|
34187
34187
|
// src/dev/rebuildTrigger.ts
|
|
34188
|
-
import { existsSync as
|
|
34189
|
-
import { basename as basename15, dirname as dirname26, join as
|
|
34188
|
+
import { existsSync as existsSync36, rmSync as rmSync3 } from "fs";
|
|
34189
|
+
import { basename as basename15, dirname as dirname26, join as join45, relative as relative17, resolve as resolve41, sep as sep4 } from "path";
|
|
34190
34190
|
var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequentially = (items, action) => items.reduce((chain, item) => chain.then(() => action(item)), Promise.resolve()), getStyleTransformConfig = (config2) => createStyleTransformConfig(config2.stylePreprocessors, config2.postcss), recompileTailwindForFastPath = async (state, config2, files) => {
|
|
34191
34191
|
if (!config2.tailwind)
|
|
34192
34192
|
return;
|
|
@@ -34285,7 +34285,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
34285
34285
|
detectedFw = detected !== "ignored" ? detected : affectedFrameworks[0];
|
|
34286
34286
|
}
|
|
34287
34287
|
return { ...parsed, framework: detectedFw };
|
|
34288
|
-
}, isValidDeletedAffectedFile = (affectedFile, deletedPathResolved, processedFiles) => affectedFile !== deletedPathResolved && !processedFiles.has(affectedFile) &&
|
|
34288
|
+
}, isValidDeletedAffectedFile = (affectedFile, deletedPathResolved, processedFiles) => affectedFile !== deletedPathResolved && !processedFiles.has(affectedFile) && existsSync36(affectedFile), FRAMEWORK_DIR_KEYS_FOR_CLEANUP, removeStaleGenerated = (state, deletedFile) => {
|
|
34289
34289
|
const { config: config2 } = state;
|
|
34290
34290
|
const cwd2 = process.cwd();
|
|
34291
34291
|
const absDeleted = resolve41(deletedFile).replace(/\\/g, "/");
|
|
@@ -34303,8 +34303,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
34303
34303
|
const relJs = `${rel.slice(0, -ext[0].length)}.js`;
|
|
34304
34304
|
const generatedDir = getFrameworkGeneratedDir(framework, cwd2);
|
|
34305
34305
|
for (const candidate of [
|
|
34306
|
-
|
|
34307
|
-
`${
|
|
34306
|
+
join45(generatedDir, relJs),
|
|
34307
|
+
`${join45(generatedDir, relJs)}.map`
|
|
34308
34308
|
]) {
|
|
34309
34309
|
try {
|
|
34310
34310
|
rmSync3(candidate, { force: true });
|
|
@@ -34331,7 +34331,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
34331
34331
|
if (!dependents || dependents.size === 0) {
|
|
34332
34332
|
return;
|
|
34333
34333
|
}
|
|
34334
|
-
const dependentFiles = Array.from(dependents).filter((file5) =>
|
|
34334
|
+
const dependentFiles = Array.from(dependents).filter((file5) => existsSync36(file5));
|
|
34335
34335
|
if (dependentFiles.length === 0) {
|
|
34336
34336
|
return;
|
|
34337
34337
|
}
|
|
@@ -34347,7 +34347,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
34347
34347
|
try {
|
|
34348
34348
|
const affectedFiles = getAffectedFiles(state.dependencyGraph, normalizedFilePath);
|
|
34349
34349
|
affectedFiles.forEach((affectedFile) => {
|
|
34350
|
-
if (!processedFiles.has(affectedFile) && affectedFile !== normalizedFilePath &&
|
|
34350
|
+
if (!processedFiles.has(affectedFile) && affectedFile !== normalizedFilePath && existsSync36(affectedFile)) {
|
|
34351
34351
|
validFiles.push(affectedFile);
|
|
34352
34352
|
processedFiles.add(affectedFile);
|
|
34353
34353
|
}
|
|
@@ -34372,7 +34372,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
34372
34372
|
collectChangedFileAffected(state, normalizedFilePath, processedFiles, validFiles);
|
|
34373
34373
|
}, processFilePathSet = (state, filePathSet, processedFiles, validFiles) => {
|
|
34374
34374
|
filePathSet.forEach((filePathInSet) => {
|
|
34375
|
-
if (!
|
|
34375
|
+
if (!existsSync36(filePathInSet)) {
|
|
34376
34376
|
collectDeletedFileAffected(state, filePathInSet, processedFiles, validFiles);
|
|
34377
34377
|
return;
|
|
34378
34378
|
}
|
|
@@ -34626,7 +34626,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
34626
34626
|
return componentFile;
|
|
34627
34627
|
}
|
|
34628
34628
|
const tsCounterpart = componentFile.replace(/\.html$/, ".ts");
|
|
34629
|
-
if (
|
|
34629
|
+
if (existsSync36(tsCounterpart)) {
|
|
34630
34630
|
return tsCounterpart;
|
|
34631
34631
|
}
|
|
34632
34632
|
if (!graph)
|
|
@@ -35163,12 +35163,12 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
35163
35163
|
try {
|
|
35164
35164
|
const { primeComponentFingerprint: primeComponentFingerprint2 } = await Promise.resolve().then(() => (init_fastHmrCompiler(), exports_fastHmrCompiler));
|
|
35165
35165
|
const { readdir: readdir5 } = await import("fs/promises");
|
|
35166
|
-
const { join:
|
|
35166
|
+
const { join: join46 } = await import("path");
|
|
35167
35167
|
const walk = async (dir) => {
|
|
35168
35168
|
const entries = await readdir5(dir, { withFileTypes: true });
|
|
35169
35169
|
const files = [];
|
|
35170
35170
|
for (const entry of entries) {
|
|
35171
|
-
const full =
|
|
35171
|
+
const full = join46(dir, entry.name);
|
|
35172
35172
|
if (entry.isDirectory()) {
|
|
35173
35173
|
files.push(...await walk(full));
|
|
35174
35174
|
} else if (entry.isFile() && entry.name.endsWith(".ts") && !entry.name.endsWith(".d.ts")) {
|
|
@@ -35634,7 +35634,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
35634
35634
|
const { vueServerPaths, vueIndexPaths, vueClientPaths, vueCssPaths } = await compileVue2(vueFiles, vueDir, true, getStyleTransformConfig(state.config));
|
|
35635
35635
|
const serverEntries = [...vueServerPaths];
|
|
35636
35636
|
const clientEntries = [...vueIndexPaths, ...vueClientPaths];
|
|
35637
|
-
const cssOutDir =
|
|
35637
|
+
const cssOutDir = join45(buildDir, state.resolvedPaths.assetsDir ? basename15(state.resolvedPaths.assetsDir) : "assets", "css");
|
|
35638
35638
|
const { serverRoot, serverOutDir } = await computeServerOutPaths(state.resolvedPaths, "vue");
|
|
35639
35639
|
const [serverResult, clientResult, cssResult] = await Promise.all([
|
|
35640
35640
|
serverEntries.length > 0 ? bunBuild9({
|
|
@@ -36629,7 +36629,7 @@ __export(exports_buildDepVendor, {
|
|
|
36629
36629
|
buildDepVendor: () => buildDepVendor
|
|
36630
36630
|
});
|
|
36631
36631
|
import { mkdirSync as mkdirSync14 } from "fs";
|
|
36632
|
-
import { join as
|
|
36632
|
+
import { join as join46 } from "path";
|
|
36633
36633
|
import { rm as rm10 } from "fs/promises";
|
|
36634
36634
|
var {build: bunBuild9, Glob: Glob10 } = globalThis.Bun;
|
|
36635
36635
|
var toSafeFileName6 = (specifier) => {
|
|
@@ -36683,7 +36683,7 @@ var toSafeFileName6 = (specifier) => {
|
|
|
36683
36683
|
framework: Array.from(framework).filter(isResolvable3)
|
|
36684
36684
|
};
|
|
36685
36685
|
}, collectTransitiveImports = async (specs, alreadyVendored, alreadyScanned) => {
|
|
36686
|
-
const { readFileSync:
|
|
36686
|
+
const { readFileSync: readFileSync31 } = await import("fs");
|
|
36687
36687
|
const transpiler6 = new Bun.Transpiler({ loader: "js" });
|
|
36688
36688
|
const newSpecs = new Set;
|
|
36689
36689
|
for (const spec of specs) {
|
|
@@ -36698,7 +36698,7 @@ var toSafeFileName6 = (specifier) => {
|
|
|
36698
36698
|
}
|
|
36699
36699
|
let content;
|
|
36700
36700
|
try {
|
|
36701
|
-
content =
|
|
36701
|
+
content = readFileSync31(resolved, "utf-8");
|
|
36702
36702
|
} catch {
|
|
36703
36703
|
continue;
|
|
36704
36704
|
}
|
|
@@ -36740,7 +36740,7 @@ var toSafeFileName6 = (specifier) => {
|
|
|
36740
36740
|
}), buildDepVendorPass = async (specifiers, vendorDir, tmpDir) => {
|
|
36741
36741
|
const entries = await Promise.all(specifiers.map(async (specifier) => {
|
|
36742
36742
|
const safeName = toSafeFileName6(specifier);
|
|
36743
|
-
const entryPath =
|
|
36743
|
+
const entryPath = join46(tmpDir, `${safeName}.ts`);
|
|
36744
36744
|
await Bun.write(entryPath, await generateVendorEntrySource(specifier));
|
|
36745
36745
|
return { entryPath, specifier };
|
|
36746
36746
|
}));
|
|
@@ -36801,9 +36801,9 @@ var toSafeFileName6 = (specifier) => {
|
|
|
36801
36801
|
const { dep: initialSpecs, framework: frameworkRoots } = await scanBareImports(directories);
|
|
36802
36802
|
if (initialSpecs.length === 0 && frameworkRoots.length === 0)
|
|
36803
36803
|
return {};
|
|
36804
|
-
const vendorDir =
|
|
36804
|
+
const vendorDir = join46(buildDir, "vendor");
|
|
36805
36805
|
mkdirSync14(vendorDir, { recursive: true });
|
|
36806
|
-
const tmpDir =
|
|
36806
|
+
const tmpDir = join46(buildDir, "_dep_vendor_tmp");
|
|
36807
36807
|
mkdirSync14(tmpDir, { recursive: true });
|
|
36808
36808
|
const allSpecs = new Set(initialSpecs);
|
|
36809
36809
|
const alreadyScanned = new Set;
|
|
@@ -37503,17 +37503,17 @@ __export(exports_devtoolsJson, {
|
|
|
37503
37503
|
normalizeDevtoolsWorkspaceRoot: () => normalizeDevtoolsWorkspaceRoot,
|
|
37504
37504
|
devtoolsJson: () => devtoolsJson
|
|
37505
37505
|
});
|
|
37506
|
-
import { existsSync as
|
|
37507
|
-
import { dirname as dirname27, join as
|
|
37506
|
+
import { existsSync as existsSync37, mkdirSync as mkdirSync15, readFileSync as readFileSync31, writeFileSync as writeFileSync10 } from "fs";
|
|
37507
|
+
import { dirname as dirname27, join as join47, resolve as resolve43 } from "path";
|
|
37508
37508
|
import { Elysia as Elysia4 } from "elysia";
|
|
37509
37509
|
var ENDPOINT = "/.well-known/appspecific/com.chrome.devtools.json", UUID_CACHE_KEY = "__absoluteDevtoolsWorkspaceUuid", getGlobalUuid = () => Reflect.get(globalThis, UUID_CACHE_KEY), setGlobalUuid = (uuid3) => {
|
|
37510
37510
|
Reflect.set(globalThis, UUID_CACHE_KEY, uuid3);
|
|
37511
37511
|
return uuid3;
|
|
37512
|
-
}, 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) => resolve43(uuidCachePath ??
|
|
37513
|
-
if (!
|
|
37512
|
+
}, 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) => resolve43(uuidCachePath ?? join47(buildDir, ".absolute", "chrome-devtools-workspace-uuid")), readCachedUuid = (cachePath) => {
|
|
37513
|
+
if (!existsSync37(cachePath))
|
|
37514
37514
|
return null;
|
|
37515
37515
|
try {
|
|
37516
|
-
const value =
|
|
37516
|
+
const value = readFileSync31(cachePath, "utf-8").trim();
|
|
37517
37517
|
return isUuidV4(value) ? value : null;
|
|
37518
37518
|
} catch {
|
|
37519
37519
|
return null;
|
|
@@ -37548,11 +37548,11 @@ var ENDPOINT = "/.well-known/appspecific/com.chrome.devtools.json", UUID_CACHE_K
|
|
|
37548
37548
|
if (process.env.WSL_DISTRO_NAME) {
|
|
37549
37549
|
const distro = process.env.WSL_DISTRO_NAME;
|
|
37550
37550
|
const withoutLeadingSlash = root.replace(/^\//, "");
|
|
37551
|
-
return
|
|
37551
|
+
return join47("\\\\wsl.localhost", distro, withoutLeadingSlash).replace(/\//g, "\\");
|
|
37552
37552
|
}
|
|
37553
37553
|
if (process.env.DOCKER_DESKTOP && !root.startsWith("\\\\")) {
|
|
37554
37554
|
const withoutLeadingSlash = root.replace(/^\//, "");
|
|
37555
|
-
return
|
|
37555
|
+
return join47("\\\\wsl.localhost", "docker-desktop-data", withoutLeadingSlash).replace(/\//g, "\\");
|
|
37556
37556
|
}
|
|
37557
37557
|
return root;
|
|
37558
37558
|
};
|
|
@@ -37563,13 +37563,13 @@ var exports_imageOptimizer = {};
|
|
|
37563
37563
|
__export(exports_imageOptimizer, {
|
|
37564
37564
|
imageOptimizer: () => imageOptimizer
|
|
37565
37565
|
});
|
|
37566
|
-
import { existsSync as
|
|
37566
|
+
import { existsSync as existsSync38 } from "fs";
|
|
37567
37567
|
import { resolve as resolve44 } from "path";
|
|
37568
37568
|
import { Elysia as Elysia5 } from "elysia";
|
|
37569
37569
|
var DEFAULT_CACHE_TTL_SECONDS = 60, MS_PER_SECOND = 1000, MAX_QUALITY = 100, avifInProgress, safeResolve = (path, baseDir) => {
|
|
37570
37570
|
try {
|
|
37571
37571
|
const resolved = validateSafePath(path, baseDir);
|
|
37572
|
-
if (
|
|
37572
|
+
if (existsSync38(resolved))
|
|
37573
37573
|
return resolved;
|
|
37574
37574
|
return null;
|
|
37575
37575
|
} catch {
|
|
@@ -37844,6 +37844,123 @@ var init_requestInspector = __esm(() => {
|
|
|
37844
37844
|
}).as("global");
|
|
37845
37845
|
});
|
|
37846
37846
|
|
|
37847
|
+
// node_modules/@elysiajs/server-timing/dist/index.mjs
|
|
37848
|
+
var exports_dist2 = {};
|
|
37849
|
+
__export(exports_dist2, {
|
|
37850
|
+
serverTiming: () => serverTiming,
|
|
37851
|
+
default: () => index_default2
|
|
37852
|
+
});
|
|
37853
|
+
import {
|
|
37854
|
+
Elysia as Elysia7
|
|
37855
|
+
} from "elysia";
|
|
37856
|
+
var getLabel = (event, listener, write5) => {
|
|
37857
|
+
listener(async ({ onStop, onEvent, total }) => {
|
|
37858
|
+
let label = "";
|
|
37859
|
+
if (total === 0)
|
|
37860
|
+
return;
|
|
37861
|
+
onEvent(({ name, index, onStop: onStop2 }) => {
|
|
37862
|
+
onStop2(({ elapsed }) => {
|
|
37863
|
+
label += `${event}.${index}.${name || "anon"};dur=${elapsed},`;
|
|
37864
|
+
});
|
|
37865
|
+
});
|
|
37866
|
+
onStop(({ elapsed }) => {
|
|
37867
|
+
label += `${event};dur=${elapsed},`;
|
|
37868
|
+
write5(label);
|
|
37869
|
+
});
|
|
37870
|
+
});
|
|
37871
|
+
}, serverTiming = ({
|
|
37872
|
+
allow,
|
|
37873
|
+
enabled = true,
|
|
37874
|
+
trace: {
|
|
37875
|
+
request: traceRequest = true,
|
|
37876
|
+
parse: traceParse = true,
|
|
37877
|
+
transform: traceTransform = true,
|
|
37878
|
+
beforeHandle: traceBeforeHandle = true,
|
|
37879
|
+
handle: traceHandle = true,
|
|
37880
|
+
afterHandle: traceAfterHandle = true,
|
|
37881
|
+
error: traceError = true,
|
|
37882
|
+
mapResponse: traceMapResponse = true,
|
|
37883
|
+
total: traceTotal = true
|
|
37884
|
+
} = {}
|
|
37885
|
+
} = {}) => {
|
|
37886
|
+
const app = new Elysia7;
|
|
37887
|
+
if (enabled) {
|
|
37888
|
+
app.trace({ as: "global" }, async ({
|
|
37889
|
+
onRequest,
|
|
37890
|
+
onParse,
|
|
37891
|
+
onTransform,
|
|
37892
|
+
onBeforeHandle,
|
|
37893
|
+
onHandle,
|
|
37894
|
+
onAfterHandle,
|
|
37895
|
+
onMapResponse,
|
|
37896
|
+
onError,
|
|
37897
|
+
set,
|
|
37898
|
+
context,
|
|
37899
|
+
context: {
|
|
37900
|
+
request: { method }
|
|
37901
|
+
}
|
|
37902
|
+
}) => {
|
|
37903
|
+
let label = "";
|
|
37904
|
+
const write5 = (nextValue) => {
|
|
37905
|
+
label += nextValue;
|
|
37906
|
+
};
|
|
37907
|
+
let start;
|
|
37908
|
+
onRequest(({ begin }) => {
|
|
37909
|
+
start = begin;
|
|
37910
|
+
});
|
|
37911
|
+
if (traceRequest)
|
|
37912
|
+
getLabel("request", onRequest, write5);
|
|
37913
|
+
if (traceParse)
|
|
37914
|
+
getLabel("parse", onParse, write5);
|
|
37915
|
+
if (traceTransform)
|
|
37916
|
+
getLabel("transform", onTransform, write5);
|
|
37917
|
+
if (traceBeforeHandle)
|
|
37918
|
+
getLabel("beforeHandle", onBeforeHandle, write5);
|
|
37919
|
+
if (traceAfterHandle)
|
|
37920
|
+
getLabel("afterHandle", onAfterHandle, write5);
|
|
37921
|
+
if (traceError)
|
|
37922
|
+
getLabel("error", onError, write5);
|
|
37923
|
+
if (traceMapResponse)
|
|
37924
|
+
getLabel("mapResponse", onMapResponse, write5);
|
|
37925
|
+
if (traceHandle)
|
|
37926
|
+
onHandle(({ name, onStop }) => {
|
|
37927
|
+
onStop(({ elapsed }) => {
|
|
37928
|
+
label += `handle.${name};dur=${elapsed},`;
|
|
37929
|
+
});
|
|
37930
|
+
});
|
|
37931
|
+
onMapResponse(({ onStop }) => {
|
|
37932
|
+
onStop(async ({ end }) => {
|
|
37933
|
+
let allowed = allow;
|
|
37934
|
+
if (allowed instanceof Promise)
|
|
37935
|
+
allowed = await allowed;
|
|
37936
|
+
if (traceTotal)
|
|
37937
|
+
label += `total;dur=${end - start}`;
|
|
37938
|
+
else
|
|
37939
|
+
label = label.slice(0, -1);
|
|
37940
|
+
switch (typeof allowed) {
|
|
37941
|
+
case "boolean":
|
|
37942
|
+
if (allowed === false)
|
|
37943
|
+
delete set.headers["Server-Timing"];
|
|
37944
|
+
set.headers["Server-Timing"] = label;
|
|
37945
|
+
break;
|
|
37946
|
+
case "function":
|
|
37947
|
+
if (await allowed(context) === false)
|
|
37948
|
+
delete set.headers["Server-Timing"];
|
|
37949
|
+
set.headers["Server-Timing"] = label;
|
|
37950
|
+
break;
|
|
37951
|
+
default:
|
|
37952
|
+
set.headers["Server-Timing"] = label;
|
|
37953
|
+
}
|
|
37954
|
+
});
|
|
37955
|
+
});
|
|
37956
|
+
});
|
|
37957
|
+
}
|
|
37958
|
+
return app;
|
|
37959
|
+
}, index_default2;
|
|
37960
|
+
var init_dist2 = __esm(() => {
|
|
37961
|
+
index_default2 = serverTiming;
|
|
37962
|
+
});
|
|
37963
|
+
|
|
37847
37964
|
// src/core/prerender.ts
|
|
37848
37965
|
var exports_prerender = {};
|
|
37849
37966
|
__export(exports_prerender, {
|
|
@@ -37854,15 +37971,15 @@ __export(exports_prerender, {
|
|
|
37854
37971
|
prerender: () => prerender,
|
|
37855
37972
|
PRERENDER_BYPASS_HEADER: () => PRERENDER_BYPASS_HEADER
|
|
37856
37973
|
});
|
|
37857
|
-
import { mkdirSync as mkdirSync16, readFileSync as
|
|
37858
|
-
import { join as
|
|
37974
|
+
import { mkdirSync as mkdirSync16, readFileSync as readFileSync32 } from "fs";
|
|
37975
|
+
import { join as join48 } from "path";
|
|
37859
37976
|
var SERVER_OUTPUT_LIMIT = 4000, STARTUP_POLL_INTERVAL_MS = 100, DEFAULT_STARTUP_TIMEOUT_MS = 30000, PRERENDER_BYPASS_HEADER = "X-Absolute-Prerender-Bypass", routeToFilename = (route) => route === "/" ? "index.html" : `${route.slice(1).replace(/\//g, "-")}.html`, writeTimestamp = async (htmlPath) => {
|
|
37860
37977
|
const metaPath = htmlPath.replace(/\.html$/, ".meta");
|
|
37861
37978
|
await Bun.write(metaPath, String(Date.now()));
|
|
37862
37979
|
}, readTimestamp = (htmlPath) => {
|
|
37863
37980
|
const metaPath = htmlPath.replace(/\.html$/, ".meta");
|
|
37864
37981
|
try {
|
|
37865
|
-
const content =
|
|
37982
|
+
const content = readFileSync32(metaPath, "utf-8");
|
|
37866
37983
|
return Number(content) || 0;
|
|
37867
37984
|
} catch {
|
|
37868
37985
|
return 0;
|
|
@@ -37921,7 +38038,7 @@ var SERVER_OUTPUT_LIMIT = 4000, STARTUP_POLL_INTERVAL_MS = 100, DEFAULT_STARTUP_
|
|
|
37921
38038
|
return false;
|
|
37922
38039
|
const html = await res.text();
|
|
37923
38040
|
const fileName = routeToFilename(route);
|
|
37924
|
-
const filePath =
|
|
38041
|
+
const filePath = join48(prerenderDir, fileName);
|
|
37925
38042
|
await Bun.write(filePath, html);
|
|
37926
38043
|
await writeTimestamp(filePath);
|
|
37927
38044
|
return true;
|
|
@@ -37947,13 +38064,13 @@ var SERVER_OUTPUT_LIMIT = 4000, STARTUP_POLL_INTERVAL_MS = 100, DEFAULT_STARTUP_
|
|
|
37947
38064
|
}
|
|
37948
38065
|
const html = await res.text();
|
|
37949
38066
|
const fileName = routeToFilename(route);
|
|
37950
|
-
const filePath =
|
|
38067
|
+
const filePath = join48(prerenderDir, fileName);
|
|
37951
38068
|
await Bun.write(filePath, html);
|
|
37952
38069
|
await writeTimestamp(filePath);
|
|
37953
38070
|
result.routes.set(route, filePath);
|
|
37954
38071
|
log2?.(` Pre-rendered ${route} \u2192 ${fileName} (${html.length} bytes)`);
|
|
37955
38072
|
}, prerender = async (port, outDir, staticConfig, log2) => {
|
|
37956
|
-
const prerenderDir =
|
|
38073
|
+
const prerenderDir = join48(outDir, "_prerendered");
|
|
37957
38074
|
mkdirSync16(prerenderDir, { recursive: true });
|
|
37958
38075
|
const baseUrl = `http://localhost:${port}`;
|
|
37959
38076
|
let routes;
|
|
@@ -38053,14 +38170,14 @@ __export(exports_serverEntryWatcher, {
|
|
|
38053
38170
|
startServerEntryWatcher: () => startServerEntryWatcher,
|
|
38054
38171
|
isAtomicWriteTemp: () => isAtomicWriteTemp
|
|
38055
38172
|
});
|
|
38056
|
-
import { existsSync as
|
|
38173
|
+
import { existsSync as existsSync41, statSync as statSync8, watch as watch2 } from "fs";
|
|
38057
38174
|
import { createRequire as createRequire2 } from "module";
|
|
38058
|
-
import { dirname as dirname28, join as
|
|
38175
|
+
import { dirname as dirname28, join as join52, resolve as resolve46 } from "path";
|
|
38059
38176
|
var ATOMIC_RECOVERY_WINDOW_MS = 1000, RELOAD_DEBOUNCE_MS = 80, ATOMIC_WRITE_TEMP_PATTERNS2, isAtomicWriteTemp = (filename) => filename.endsWith(".tmp") || filename.includes(".tmp.") || filename.endsWith("~") || filename.startsWith(".#") || ATOMIC_WRITE_TEMP_PATTERNS2.some((re2) => re2.test(filename)), startServerEntryWatcher = () => {
|
|
38060
38177
|
if (globalThis.__absoluteEntryWatcherStarted)
|
|
38061
38178
|
return;
|
|
38062
38179
|
const { main } = Bun;
|
|
38063
|
-
if (!main || !
|
|
38180
|
+
if (!main || !existsSync41(main))
|
|
38064
38181
|
return;
|
|
38065
38182
|
globalThis.__absoluteEntryWatcherStarted = true;
|
|
38066
38183
|
const entryPath = resolve46(main);
|
|
@@ -38158,7 +38275,7 @@ var ATOMIC_RECOVERY_WINDOW_MS = 1000, RELOAD_DEBOUNCE_MS = 80, ATOMIC_WRITE_TEMP
|
|
|
38158
38275
|
continue;
|
|
38159
38276
|
let st2;
|
|
38160
38277
|
try {
|
|
38161
|
-
st2 = statSync8(
|
|
38278
|
+
st2 = statSync8(join52(dir, entry.name));
|
|
38162
38279
|
} catch {
|
|
38163
38280
|
continue;
|
|
38164
38281
|
}
|
|
@@ -38718,9 +38835,9 @@ var handleHTMXPageRequest = async (pagePath) => {
|
|
|
38718
38835
|
});
|
|
38719
38836
|
};
|
|
38720
38837
|
// src/core/prepare.ts
|
|
38721
|
-
import { existsSync as
|
|
38722
|
-
import { basename as basename16, join as
|
|
38723
|
-
import { Elysia as
|
|
38838
|
+
import { existsSync as existsSync39, readdirSync as readdirSync8, readFileSync as readFileSync33 } from "fs";
|
|
38839
|
+
import { basename as basename16, join as join49, relative as relative18, resolve as resolve45 } from "path";
|
|
38840
|
+
import { Elysia as Elysia8 } from "elysia";
|
|
38724
38841
|
|
|
38725
38842
|
// src/plugins/openApiPlugin.ts
|
|
38726
38843
|
import { existsSync as existsSync7, readFileSync as readFileSync8 } from "fs";
|
|
@@ -38756,6 +38873,17 @@ var createOpenApiPlugin = async (config2, cwd) => {
|
|
|
38756
38873
|
version: options.documentation?.version ?? info.version
|
|
38757
38874
|
}
|
|
38758
38875
|
},
|
|
38876
|
+
exclude: {
|
|
38877
|
+
paths: [
|
|
38878
|
+
/^\/_/,
|
|
38879
|
+
/^\/@/,
|
|
38880
|
+
/^\/__absolute/,
|
|
38881
|
+
/^\/hmr/,
|
|
38882
|
+
/^\/\.well-known/,
|
|
38883
|
+
/^\/chunk-/,
|
|
38884
|
+
/^\/node_modules/
|
|
38885
|
+
]
|
|
38886
|
+
},
|
|
38759
38887
|
path: options.path ?? "/openapi",
|
|
38760
38888
|
provider: options.provider === "swagger" ? "swagger-ui" : "scalar"
|
|
38761
38889
|
});
|
|
@@ -38772,6 +38900,41 @@ var withOpenApi = async (app, config2, cwd, isDev) => {
|
|
|
38772
38900
|
}
|
|
38773
38901
|
};
|
|
38774
38902
|
|
|
38903
|
+
// src/plugins/telemetryPlugin.ts
|
|
38904
|
+
import { existsSync as existsSync8, readFileSync as readFileSync9 } from "fs";
|
|
38905
|
+
import { join as join13 } from "path";
|
|
38906
|
+
var OTEL_PACKAGE = "@elysiajs/opentelemetry";
|
|
38907
|
+
var readPackageName = (cwd) => {
|
|
38908
|
+
const path = join13(cwd, "package.json");
|
|
38909
|
+
if (!existsSync8(path))
|
|
38910
|
+
return null;
|
|
38911
|
+
try {
|
|
38912
|
+
const pkg = JSON.parse(readFileSync9(path, "utf-8"));
|
|
38913
|
+
return typeof pkg.name === "string" ? pkg.name : null;
|
|
38914
|
+
} catch {
|
|
38915
|
+
return null;
|
|
38916
|
+
}
|
|
38917
|
+
};
|
|
38918
|
+
var serviceNameFor = (config2, cwd) => {
|
|
38919
|
+
const setting = config2.telemetry;
|
|
38920
|
+
if (typeof setting === "object" && setting.serviceName) {
|
|
38921
|
+
return setting.serviceName;
|
|
38922
|
+
}
|
|
38923
|
+
return readPackageName(cwd) ?? "absolutejs-app";
|
|
38924
|
+
};
|
|
38925
|
+
var withTelemetry = async (app, config2, cwd) => {
|
|
38926
|
+
if (!config2.telemetry)
|
|
38927
|
+
return app;
|
|
38928
|
+
try {
|
|
38929
|
+
const { opentelemetry } = await import(OTEL_PACKAGE);
|
|
38930
|
+
return app.use(opentelemetry({ serviceName: serviceNameFor(config2, cwd) }));
|
|
38931
|
+
} catch (error) {
|
|
38932
|
+
const detail = error instanceof Error ? error.message : String(error);
|
|
38933
|
+
console.warn(`[absolute] telemetry enabled but ${OTEL_PACKAGE} isn't installed \u2014 run \`bun add ${OTEL_PACKAGE}\` (${detail})`);
|
|
38934
|
+
return app;
|
|
38935
|
+
}
|
|
38936
|
+
};
|
|
38937
|
+
|
|
38775
38938
|
// src/core/prepare.ts
|
|
38776
38939
|
init_loadConfig();
|
|
38777
38940
|
|
|
@@ -39171,7 +39334,7 @@ var patchManifestIndexes = (manifest, devIndexDir, SRC_URL_PREFIX2) => {
|
|
|
39171
39334
|
if (!fileName)
|
|
39172
39335
|
continue;
|
|
39173
39336
|
const srcPath = resolve45(devIndexDir, fileName);
|
|
39174
|
-
if (!
|
|
39337
|
+
if (!existsSync39(srcPath))
|
|
39175
39338
|
continue;
|
|
39176
39339
|
const rel = relative18(process.cwd(), srcPath).replace(/\\/g, "/");
|
|
39177
39340
|
manifest[key] = `${SRC_URL_PREFIX2}${rel}`;
|
|
@@ -39258,7 +39421,8 @@ var prepareDev = async (config2, buildDir) => {
|
|
|
39258
39421
|
stepStartedAt = performance.now();
|
|
39259
39422
|
const { imageOptimizer: imageOptimizer2 } = await Promise.resolve().then(() => (init_imageOptimizer(), exports_imageOptimizer));
|
|
39260
39423
|
const { requestInspector: requestInspector2 } = await Promise.resolve().then(() => (init_requestInspector(), exports_requestInspector));
|
|
39261
|
-
const
|
|
39424
|
+
const { serverTiming: serverTiming2 } = await Promise.resolve().then(() => (init_dist2(), exports_dist2));
|
|
39425
|
+
const absolutejs = new Elysia8({ name: "absolutejs-runtime" }).use(requestInspector2).use(serverTiming2()).use(devtoolsJson2(buildDir, {
|
|
39262
39426
|
normalizeForWindowsContainer: config2.dev?.devtools?.normalizeForWindowsContainer,
|
|
39263
39427
|
projectRoot: config2.dev?.devtools?.projectRoot,
|
|
39264
39428
|
uuid: config2.dev?.devtools?.uuid,
|
|
@@ -39272,6 +39436,7 @@ var prepareDev = async (config2, buildDir) => {
|
|
|
39272
39436
|
staticLimit: MAX_STATIC_ROUTE_COUNT
|
|
39273
39437
|
})).use(hmrPlugin).use(createBuildErrorRecoveryPlugin()).use(createNotFoundPlugin());
|
|
39274
39438
|
await withOpenApi(absolutejs, config2, process.cwd(), true);
|
|
39439
|
+
await withTelemetry(absolutejs, config2, process.cwd());
|
|
39275
39440
|
recordStep("assemble dev runtime", stepStartedAt);
|
|
39276
39441
|
logStartupTimingBlock("AbsoluteJS prepareDev timing", startupSteps);
|
|
39277
39442
|
return {
|
|
@@ -39281,7 +39446,7 @@ var prepareDev = async (config2, buildDir) => {
|
|
|
39281
39446
|
};
|
|
39282
39447
|
var loadPrerenderMap = (prerenderDir) => {
|
|
39283
39448
|
const map3 = new Map;
|
|
39284
|
-
if (!
|
|
39449
|
+
if (!existsSync39(prerenderDir))
|
|
39285
39450
|
return map3;
|
|
39286
39451
|
let entries;
|
|
39287
39452
|
try {
|
|
@@ -39294,11 +39459,11 @@ var loadPrerenderMap = (prerenderDir) => {
|
|
|
39294
39459
|
continue;
|
|
39295
39460
|
const name = basename16(entry, ".html");
|
|
39296
39461
|
const route = name === "index" ? "/" : `/${name}`;
|
|
39297
|
-
map3.set(route,
|
|
39462
|
+
map3.set(route, join49(prerenderDir, entry));
|
|
39298
39463
|
}
|
|
39299
39464
|
return map3;
|
|
39300
39465
|
};
|
|
39301
|
-
var createNotFoundPlugin = () => new
|
|
39466
|
+
var createNotFoundPlugin = () => new Elysia8({ name: "absolutejs-not-found" }).onError({ as: "global" }, async ({ code }) => {
|
|
39302
39467
|
if (code !== "NOT_FOUND")
|
|
39303
39468
|
return;
|
|
39304
39469
|
const response = await renderFirstNotFound();
|
|
@@ -39306,7 +39471,7 @@ var createNotFoundPlugin = () => new Elysia7({ name: "absolutejs-not-found" }).o
|
|
|
39306
39471
|
return response;
|
|
39307
39472
|
return;
|
|
39308
39473
|
});
|
|
39309
|
-
var createBuildErrorRecoveryPlugin = () => new
|
|
39474
|
+
var createBuildErrorRecoveryPlugin = () => new Elysia8({ name: "absolutejs-build-error-recovery" }).onError({ as: "global" }, async ({ error }) => {
|
|
39310
39475
|
const message = error instanceof Error ? error.message : String(error);
|
|
39311
39476
|
const assetMatch = /^Asset "(.+)" not found in manifest\.$/.exec(message);
|
|
39312
39477
|
if (!assetMatch)
|
|
@@ -39346,7 +39511,7 @@ var prepare = async (configOrPath) => {
|
|
|
39346
39511
|
return result;
|
|
39347
39512
|
}
|
|
39348
39513
|
stepStartedAt = performance.now();
|
|
39349
|
-
const manifest = JSON.parse(
|
|
39514
|
+
const manifest = JSON.parse(readFileSync33(`${buildDir}/manifest.json`, "utf-8"));
|
|
39350
39515
|
setCurrentIslandManifest(manifest);
|
|
39351
39516
|
if (config2.islands?.registry) {
|
|
39352
39517
|
setCurrentIslandRegistry(await loadIslandRegistry(config2.islands.registry));
|
|
@@ -39354,9 +39519,9 @@ var prepare = async (configOrPath) => {
|
|
|
39354
39519
|
setCurrentPageIslandMetadata(await loadPageIslandMetadata(config2));
|
|
39355
39520
|
recordStep("load production manifest and island metadata", stepStartedAt);
|
|
39356
39521
|
stepStartedAt = performance.now();
|
|
39357
|
-
const conventionsPath =
|
|
39358
|
-
if (
|
|
39359
|
-
const conventions2 = JSON.parse(
|
|
39522
|
+
const conventionsPath = join49(buildDir, "conventions.json");
|
|
39523
|
+
if (existsSync39(conventionsPath)) {
|
|
39524
|
+
const conventions2 = JSON.parse(readFileSync33(conventionsPath, "utf-8"));
|
|
39360
39525
|
setConventions(conventions2);
|
|
39361
39526
|
}
|
|
39362
39527
|
recordStep("load production conventions", stepStartedAt);
|
|
@@ -39368,8 +39533,8 @@ var prepare = async (configOrPath) => {
|
|
|
39368
39533
|
prefix: "",
|
|
39369
39534
|
staticLimit: MAX_STATIC_ROUTE_COUNT
|
|
39370
39535
|
});
|
|
39371
|
-
const generatedAssetsRoot =
|
|
39372
|
-
const generatedAssetsPlugin = new
|
|
39536
|
+
const generatedAssetsRoot = join49(buildDir, ".absolutejs");
|
|
39537
|
+
const generatedAssetsPlugin = new Elysia8({
|
|
39373
39538
|
name: "absolutejs-generated-assets"
|
|
39374
39539
|
}).get("/.absolutejs/*", async ({ params, set }) => {
|
|
39375
39540
|
const requestedPath = resolve45(generatedAssetsRoot, params["*"]);
|
|
@@ -39387,7 +39552,7 @@ var prepare = async (configOrPath) => {
|
|
|
39387
39552
|
});
|
|
39388
39553
|
recordStep("create static plugin", stepStartedAt);
|
|
39389
39554
|
stepStartedAt = performance.now();
|
|
39390
|
-
const prerenderDir =
|
|
39555
|
+
const prerenderDir = join49(buildDir, "_prerendered");
|
|
39391
39556
|
const prerenderMap = loadPrerenderMap(prerenderDir);
|
|
39392
39557
|
recordStep("load prerender map", stepStartedAt);
|
|
39393
39558
|
if (prerenderMap.size > 0) {
|
|
@@ -39395,7 +39560,7 @@ var prepare = async (configOrPath) => {
|
|
|
39395
39560
|
const revalidateMs = config2.static?.revalidate ? config2.static.revalidate * MS_PER_SECOND2 : 0;
|
|
39396
39561
|
const port = Number(process.env.PORT) || DEFAULT_PORT2;
|
|
39397
39562
|
const rerendering = new Set;
|
|
39398
|
-
const prerenderPlugin = new
|
|
39563
|
+
const prerenderPlugin = new Elysia8({
|
|
39399
39564
|
name: "prerendered-pages"
|
|
39400
39565
|
}).onRequest(({ request }) => {
|
|
39401
39566
|
const url2 = new URL(request.url);
|
|
@@ -39418,16 +39583,18 @@ var prepare = async (configOrPath) => {
|
|
|
39418
39583
|
});
|
|
39419
39584
|
stepStartedAt = performance.now();
|
|
39420
39585
|
const { imageOptimizer: imageOptimizer3 } = await Promise.resolve().then(() => (init_imageOptimizer(), exports_imageOptimizer));
|
|
39421
|
-
const absolutejs2 = new
|
|
39586
|
+
const absolutejs2 = new Elysia8({ name: "absolutejs-runtime" }).use(imageOptimizer3(config2.images, buildDir)).use(prerenderPlugin).use(staticFiles).use(generatedAssetsPlugin).use(createNotFoundPlugin());
|
|
39422
39587
|
await withOpenApi(absolutejs2, config2, process.cwd(), false);
|
|
39588
|
+
await withTelemetry(absolutejs2, config2, process.cwd());
|
|
39423
39589
|
recordStep("assemble production runtime", stepStartedAt);
|
|
39424
39590
|
logStartupTimingBlock("AbsoluteJS prepare timing", startupSteps);
|
|
39425
39591
|
return { absolutejs: absolutejs2, manifest };
|
|
39426
39592
|
}
|
|
39427
39593
|
stepStartedAt = performance.now();
|
|
39428
39594
|
const { imageOptimizer: imageOptimizer2 } = await Promise.resolve().then(() => (init_imageOptimizer(), exports_imageOptimizer));
|
|
39429
|
-
const absolutejs = new
|
|
39595
|
+
const absolutejs = new Elysia8({ name: "absolutejs-runtime" }).use(imageOptimizer2(config2.images, buildDir)).use(staticFiles).use(generatedAssetsPlugin).use(createNotFoundPlugin());
|
|
39430
39596
|
await withOpenApi(absolutejs, config2, process.cwd(), false);
|
|
39597
|
+
await withTelemetry(absolutejs, config2, process.cwd());
|
|
39431
39598
|
recordStep("assemble production runtime", stepStartedAt);
|
|
39432
39599
|
logStartupTimingBlock("AbsoluteJS prepare timing", startupSteps);
|
|
39433
39600
|
return { absolutejs, manifest };
|
|
@@ -39449,22 +39616,22 @@ var {env: env4 } = globalThis.Bun;
|
|
|
39449
39616
|
// src/dev/devCert.ts
|
|
39450
39617
|
import {
|
|
39451
39618
|
copyFileSync as copyFileSync3,
|
|
39452
|
-
existsSync as
|
|
39619
|
+
existsSync as existsSync40,
|
|
39453
39620
|
mkdirSync as mkdirSync17,
|
|
39454
|
-
readFileSync as
|
|
39621
|
+
readFileSync as readFileSync34,
|
|
39455
39622
|
rmSync as rmSync4
|
|
39456
39623
|
} from "fs";
|
|
39457
|
-
import { join as
|
|
39458
|
-
var CERT_DIR =
|
|
39459
|
-
var CERT_PATH =
|
|
39460
|
-
var KEY_PATH =
|
|
39624
|
+
import { join as join50 } from "path";
|
|
39625
|
+
var CERT_DIR = join50(process.cwd(), ".absolutejs");
|
|
39626
|
+
var CERT_PATH = join50(CERT_DIR, "cert.pem");
|
|
39627
|
+
var KEY_PATH = join50(CERT_DIR, "key.pem");
|
|
39461
39628
|
var CERT_VALIDITY_DAYS = 365;
|
|
39462
39629
|
var devLog = (msg) => console.log(`\x1B[2m${new Date().toLocaleTimeString()}\x1B[0m \x1B[36m[dev]\x1B[0m ${msg}`);
|
|
39463
39630
|
var devWarn = (msg) => console.log(`\x1B[2m${new Date().toLocaleTimeString()}\x1B[0m \x1B[33m[dev]\x1B[0m \x1B[33m${msg}\x1B[0m`);
|
|
39464
|
-
var certFilesExist = () =>
|
|
39631
|
+
var certFilesExist = () => existsSync40(CERT_PATH) && existsSync40(KEY_PATH);
|
|
39465
39632
|
var isCertExpired = () => {
|
|
39466
39633
|
try {
|
|
39467
|
-
const certPem =
|
|
39634
|
+
const certPem = readFileSync34(CERT_PATH, "utf-8");
|
|
39468
39635
|
const proc = Bun.spawnSync(["openssl", "x509", "-enddate", "-noout"], {
|
|
39469
39636
|
stdin: new TextEncoder().encode(certPem)
|
|
39470
39637
|
});
|
|
@@ -39560,8 +39727,8 @@ var loadDevCert = () => {
|
|
|
39560
39727
|
return null;
|
|
39561
39728
|
try {
|
|
39562
39729
|
return {
|
|
39563
|
-
cert:
|
|
39564
|
-
key:
|
|
39730
|
+
cert: readFileSync34(paths.cert, "utf-8"),
|
|
39731
|
+
key: readFileSync34(paths.key, "utf-8")
|
|
39565
39732
|
};
|
|
39566
39733
|
} catch {
|
|
39567
39734
|
return null;
|
|
@@ -39571,18 +39738,18 @@ var loadDevCert = () => {
|
|
|
39571
39738
|
// src/utils/instanceRegistry.ts
|
|
39572
39739
|
import {
|
|
39573
39740
|
mkdirSync as mkdirSync18,
|
|
39574
|
-
readFileSync as
|
|
39741
|
+
readFileSync as readFileSync35,
|
|
39575
39742
|
readdirSync as readdirSync9,
|
|
39576
39743
|
unlinkSync as unlinkSync2,
|
|
39577
39744
|
writeFileSync as writeFileSync11
|
|
39578
39745
|
} from "fs";
|
|
39579
39746
|
import { homedir as homedir2 } from "os";
|
|
39580
|
-
import { basename as basename17, join as
|
|
39747
|
+
import { basename as basename17, join as join51 } from "path";
|
|
39581
39748
|
var registeredPids = new Set;
|
|
39582
39749
|
var exitHandlerRegistered = false;
|
|
39583
|
-
var instanceFilePath = (pid) =>
|
|
39584
|
-
var instanceLogPath = (pid) =>
|
|
39585
|
-
var instanceRegistryDir = () =>
|
|
39750
|
+
var instanceFilePath = (pid) => join51(instanceRegistryDir(), `${pid}.json`);
|
|
39751
|
+
var instanceLogPath = (pid) => join51(instanceRegistryDir(), `${pid}.log`);
|
|
39752
|
+
var instanceRegistryDir = () => join51(homedir2(), ".absolutejs", "instances");
|
|
39586
39753
|
var removeInstanceFilesSync = (pid) => {
|
|
39587
39754
|
try {
|
|
39588
39755
|
unlinkSync2(instanceFilePath(pid));
|
|
@@ -39604,7 +39771,7 @@ var registerExitHandlerOnce = () => {
|
|
|
39604
39771
|
};
|
|
39605
39772
|
var readJsonFile = (path) => {
|
|
39606
39773
|
try {
|
|
39607
|
-
return JSON.parse(
|
|
39774
|
+
return JSON.parse(readFileSync35(path, "utf-8"));
|
|
39608
39775
|
} catch {
|
|
39609
39776
|
return null;
|
|
39610
39777
|
}
|
|
@@ -39617,7 +39784,7 @@ var registerInstance = (record) => {
|
|
|
39617
39784
|
return record;
|
|
39618
39785
|
};
|
|
39619
39786
|
var resolveProjectName = (cwd2) => {
|
|
39620
|
-
const parsed = readJsonFile(
|
|
39787
|
+
const parsed = readJsonFile(join51(cwd2, "package.json"));
|
|
39621
39788
|
if (parsed !== null && typeof parsed === "object" && typeof parsed.name === "string" && parsed.name.trim().length > 0) {
|
|
39622
39789
|
return parsed.name;
|
|
39623
39790
|
}
|
|
@@ -39919,7 +40086,7 @@ var generateHeadElement = ({
|
|
|
39919
40086
|
};
|
|
39920
40087
|
// src/utils/defineEnv.ts
|
|
39921
40088
|
var {env: bunEnv } = globalThis.Bun;
|
|
39922
|
-
import { existsSync as
|
|
40089
|
+
import { existsSync as existsSync42, readFileSync as readFileSync36 } from "fs";
|
|
39923
40090
|
import { resolve as resolve47 } from "path";
|
|
39924
40091
|
|
|
39925
40092
|
// node_modules/@sinclair/typebox/build/esm/type/guard/value.mjs
|
|
@@ -45956,18 +46123,18 @@ ${lines.join(`
|
|
|
45956
46123
|
var checkEnvFileSecurity = (properties) => {
|
|
45957
46124
|
const cwd2 = process.cwd();
|
|
45958
46125
|
const envPath = resolve47(cwd2, ".env");
|
|
45959
|
-
if (!
|
|
46126
|
+
if (!existsSync42(envPath))
|
|
45960
46127
|
return;
|
|
45961
46128
|
const sensitiveKeys = Object.keys(properties).filter(isSensitive);
|
|
45962
46129
|
if (sensitiveKeys.length === 0)
|
|
45963
46130
|
return;
|
|
45964
|
-
const envContent =
|
|
46131
|
+
const envContent = readFileSync36(envPath, "utf-8");
|
|
45965
46132
|
const presentKeys = sensitiveKeys.filter((key) => envContent.includes(`${key}=`));
|
|
45966
46133
|
if (presentKeys.length === 0)
|
|
45967
46134
|
return;
|
|
45968
46135
|
const gitignorePath = resolve47(cwd2, ".gitignore");
|
|
45969
|
-
if (
|
|
45970
|
-
const gitignore =
|
|
46136
|
+
if (existsSync42(gitignorePath)) {
|
|
46137
|
+
const gitignore = readFileSync36(gitignorePath, "utf-8");
|
|
45971
46138
|
if (gitignore.split(`
|
|
45972
46139
|
`).some((line) => line.trim() === ".env"))
|
|
45973
46140
|
return;
|
|
@@ -45999,7 +46166,7 @@ var getEnv = (key) => {
|
|
|
45999
46166
|
return environmentVariable;
|
|
46000
46167
|
};
|
|
46001
46168
|
// src/utils/projectRoot.ts
|
|
46002
|
-
import { existsSync as
|
|
46169
|
+
import { existsSync as existsSync43 } from "fs";
|
|
46003
46170
|
import { dirname as dirname29, resolve as resolve48 } from "path";
|
|
46004
46171
|
var CONFIG_CANDIDATES = [
|
|
46005
46172
|
"absolute.config.ts",
|
|
@@ -46014,10 +46181,10 @@ var findProjectRoot = () => {
|
|
|
46014
46181
|
let packageRoot = null;
|
|
46015
46182
|
let dir = start;
|
|
46016
46183
|
for (;; ) {
|
|
46017
|
-
if (CONFIG_CANDIDATES.some((name) =>
|
|
46184
|
+
if (CONFIG_CANDIDATES.some((name) => existsSync43(resolve48(dir, name)))) {
|
|
46018
46185
|
return dir;
|
|
46019
46186
|
}
|
|
46020
|
-
if (packageRoot === null &&
|
|
46187
|
+
if (packageRoot === null && existsSync43(resolve48(dir, "package.json"))) {
|
|
46021
46188
|
packageRoot = dir;
|
|
46022
46189
|
}
|
|
46023
46190
|
const parent = dirname29(dir);
|
|
@@ -46256,5 +46423,5 @@ export {
|
|
|
46256
46423
|
ANGULAR_INIT_TIMEOUT_MS
|
|
46257
46424
|
};
|
|
46258
46425
|
|
|
46259
|
-
//# debugId=
|
|
46426
|
+
//# debugId=81209F161728A1AE64756E2164756E21
|
|
46260
46427
|
//# sourceMappingURL=index.js.map
|