@absolutejs/absolute 0.19.0-beta.996 → 0.19.0-beta.998
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/angular/components/core/streamingSlotRegistrar.js +1 -1
- package/dist/angular/components/core/streamingSlotRegistry.js +2 -2
- package/dist/angular/index.js +35 -29
- package/dist/angular/index.js.map +3 -3
- package/dist/angular/server.js +35 -29
- package/dist/angular/server.js.map +3 -3
- package/dist/build.js +208 -196
- package/dist/build.js.map +5 -5
- package/dist/index.js +236 -224
- package/dist/index.js.map +5 -5
- package/dist/islands/index.js +7 -1
- package/dist/islands/index.js.map +3 -3
- package/dist/react/index.js +7 -1
- package/dist/react/index.js.map +3 -3
- package/dist/svelte/index.js +7 -1
- package/dist/svelte/index.js.map +3 -3
- package/dist/vue/index.js +7 -1
- package/dist/vue/index.js.map +3 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -7578,6 +7578,7 @@ var init_svelteServerModule = __esm(() => {
|
|
|
7578
7578
|
});
|
|
7579
7579
|
|
|
7580
7580
|
// src/core/vueServerModule.ts
|
|
7581
|
+
import { existsSync as existsSync6, readFileSync as readFileSync6, realpathSync } from "fs";
|
|
7581
7582
|
import { mkdir as mkdir3 } from "fs/promises";
|
|
7582
7583
|
import { dirname as dirname6, join as join7, relative as relative3, resolve as resolve7 } from "path";
|
|
7583
7584
|
var {Transpiler } = globalThis.Bun;
|
|
@@ -7623,6 +7624,11 @@ var ISLAND_COMPONENT_ID_LENGTH = 8, serverCacheRoot2, compiledModuleCache2, tran
|
|
|
7623
7624
|
const componentId = Bun.hash(sourcePath).toString(BASE_36_RADIX).slice(0, ISLAND_COMPONENT_ID_LENGTH);
|
|
7624
7625
|
const hasScript = descriptor.script || descriptor.scriptSetup;
|
|
7625
7626
|
const compiledScript = hasScript ? compiler.compileScript(descriptor, {
|
|
7627
|
+
fs: {
|
|
7628
|
+
fileExists: existsSync6,
|
|
7629
|
+
readFile: (file) => existsSync6(file) ? readFileSync6(file, "utf-8") : undefined,
|
|
7630
|
+
realpath: realpathSync
|
|
7631
|
+
},
|
|
7626
7632
|
id: componentId,
|
|
7627
7633
|
inlineTemplate: false
|
|
7628
7634
|
}) : { bindings: {}, content: "export default {};" };
|
|
@@ -8179,7 +8185,7 @@ var init_staticStreaming = __esm(() => {
|
|
|
8179
8185
|
});
|
|
8180
8186
|
|
|
8181
8187
|
// src/build/staticIslandPages.ts
|
|
8182
|
-
import { readFileSync as
|
|
8188
|
+
import { readFileSync as readFileSync7, writeFileSync as writeFileSync3 } from "fs";
|
|
8183
8189
|
var ISLAND_TAG_RE_SOURCE = "<(?:absolute-island|island)\\b([^>]*?)(?:\\/\\>|>(?:[\\s\\S]*?)<\\/(?:absolute-island|island)>)", ATTRIBUTE_RE_SOURCE = `([A-Za-z_:][-A-Za-z0-9_:.]*)\\s*=\\s*(?:"([^"]*)"|'([^']*)')`, islandFrameworks, islandHydrationModes, isRecord5 = (value) => typeof value === "object" && value !== null, isIslandFramework = (value) => islandFrameworks.some((framework) => framework === value), isIslandHydrationMode = (value) => islandHydrationModes.some((mode) => mode === value), parseHtmlAttributes = (attributeString) => {
|
|
8184
8190
|
const attributeRe = new RegExp(ATTRIBUTE_RE_SOURCE, "g");
|
|
8185
8191
|
const attributes = new Map;
|
|
@@ -8308,7 +8314,7 @@ var ISLAND_TAG_RE_SOURCE = "<(?:absolute-island|island)\\b([^>]*?)(?:\\/\\>|>(?:
|
|
|
8308
8314
|
}
|
|
8309
8315
|
return result + originalHtml.slice(nextIndex);
|
|
8310
8316
|
}, transformStaticPage = async (pagePath, registry) => {
|
|
8311
|
-
const originalHtml =
|
|
8317
|
+
const originalHtml = readFileSync7(pagePath, "utf-8");
|
|
8312
8318
|
const transformedHtml = await transformStaticPageHtml(originalHtml, registry);
|
|
8313
8319
|
if (transformedHtml !== originalHtml) {
|
|
8314
8320
|
writeFileSync3(pagePath, transformedHtml);
|
|
@@ -8452,10 +8458,10 @@ var init_loadConfig = __esm(() => {
|
|
|
8452
8458
|
});
|
|
8453
8459
|
|
|
8454
8460
|
// src/build/scanEntryPoints.ts
|
|
8455
|
-
import { existsSync as
|
|
8461
|
+
import { existsSync as existsSync7 } from "fs";
|
|
8456
8462
|
var {Glob } = globalThis.Bun;
|
|
8457
8463
|
var scanEntryPoints = async (dir, pattern) => {
|
|
8458
|
-
if (!
|
|
8464
|
+
if (!existsSync7(dir))
|
|
8459
8465
|
return [];
|
|
8460
8466
|
const entryPaths = [];
|
|
8461
8467
|
const glob = new Glob(pattern);
|
|
@@ -8544,7 +8550,7 @@ var init_sourceMetadata = __esm(() => {
|
|
|
8544
8550
|
});
|
|
8545
8551
|
|
|
8546
8552
|
// src/islands/pageMetadata.ts
|
|
8547
|
-
import { readFileSync as
|
|
8553
|
+
import { readFileSync as readFileSync8 } from "fs";
|
|
8548
8554
|
import { dirname as dirname8, resolve as resolve11 } from "path";
|
|
8549
8555
|
var pagePatterns, getPageDirs = (config) => [
|
|
8550
8556
|
{ dir: config.angularDirectory, framework: "angular" },
|
|
@@ -8587,7 +8593,7 @@ var pagePatterns, getPageDirs = (config) => [
|
|
|
8587
8593
|
return;
|
|
8588
8594
|
const files = await scanEntryPoints(resolve11(entry.dir), pattern);
|
|
8589
8595
|
for (const filePath of files) {
|
|
8590
|
-
const source =
|
|
8596
|
+
const source = readFileSync8(filePath, "utf-8");
|
|
8591
8597
|
const islands = extractIslandUsagesFromSource(source);
|
|
8592
8598
|
pageMetadata.set(resolve11(filePath), {
|
|
8593
8599
|
islands: resolveIslandUsages(islands, islandSourceLookup),
|
|
@@ -9063,22 +9069,22 @@ var init_verifyAngularCoreUniqueness = __esm(() => {
|
|
|
9063
9069
|
});
|
|
9064
9070
|
|
|
9065
9071
|
// src/build/generateReactIndexes.ts
|
|
9066
|
-
import { existsSync as
|
|
9072
|
+
import { existsSync as existsSync8, mkdirSync as mkdirSync2 } from "fs";
|
|
9067
9073
|
import { readdir as readdir2, rm, writeFile } from "fs/promises";
|
|
9068
9074
|
import { basename as basename3, join as join9, relative as relative5, resolve as resolve13, sep } from "path";
|
|
9069
9075
|
var {Glob: Glob2 } = globalThis.Bun;
|
|
9070
9076
|
var indexContentCache, resolveDevClientDir = () => {
|
|
9071
9077
|
const projectRoot = process.cwd();
|
|
9072
9078
|
const fromSource = resolve13(import.meta.dir, "../dev/client");
|
|
9073
|
-
if (
|
|
9079
|
+
if (existsSync8(fromSource) && fromSource.startsWith(projectRoot)) {
|
|
9074
9080
|
return fromSource;
|
|
9075
9081
|
}
|
|
9076
9082
|
const fromNodeModules = resolve13(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client");
|
|
9077
|
-
if (
|
|
9083
|
+
if (existsSync8(fromNodeModules))
|
|
9078
9084
|
return fromNodeModules;
|
|
9079
9085
|
return resolve13(import.meta.dir, "./dev/client");
|
|
9080
9086
|
}, devClientDir, errorOverlayPath, hmrClientPath, refreshSetupPath, generateReactIndexFiles = async (reactPagesDirectory, reactIndexesDirectory, isDev2 = false) => {
|
|
9081
|
-
if (!
|
|
9087
|
+
if (!existsSync8(reactIndexesDirectory)) {
|
|
9082
9088
|
mkdirSync2(reactIndexesDirectory, { recursive: true });
|
|
9083
9089
|
}
|
|
9084
9090
|
const CONVENTION_RE = /^(?:(.+)\.)?(error|loading|not-found)\.[^.]+$/;
|
|
@@ -9386,7 +9392,7 @@ var indexContentCache, resolveDevClientDir = () => {
|
|
|
9386
9392
|
const hasher = new Bun.CryptoHasher("md5");
|
|
9387
9393
|
hasher.update(content);
|
|
9388
9394
|
const contentHash = hasher.digest("hex");
|
|
9389
|
-
if (indexContentCache.get(indexPath) === contentHash &&
|
|
9395
|
+
if (indexContentCache.get(indexPath) === contentHash && existsSync8(indexPath)) {
|
|
9390
9396
|
return;
|
|
9391
9397
|
}
|
|
9392
9398
|
indexContentCache.set(indexPath, contentHash);
|
|
@@ -9397,7 +9403,7 @@ var indexContentCache, resolveDevClientDir = () => {
|
|
|
9397
9403
|
return;
|
|
9398
9404
|
}
|
|
9399
9405
|
const refreshPath = join9(reactIndexesDirectory, "_refresh.tsx");
|
|
9400
|
-
if (!
|
|
9406
|
+
if (!existsSync8(refreshPath)) {
|
|
9401
9407
|
await writeFile(refreshPath, `import '${refreshSetupPath}';
|
|
9402
9408
|
import 'react';
|
|
9403
9409
|
import 'react-dom/client';
|
|
@@ -9477,7 +9483,7 @@ var init_outputLogs = __esm(() => {
|
|
|
9477
9483
|
// src/build/scanConventions.ts
|
|
9478
9484
|
import { basename as basename4 } from "path";
|
|
9479
9485
|
var {Glob: Glob3 } = globalThis.Bun;
|
|
9480
|
-
import { existsSync as
|
|
9486
|
+
import { existsSync as existsSync9 } from "fs";
|
|
9481
9487
|
var CONVENTION_RE, classifyFile = (file2, pageFiles, defaults, pages) => {
|
|
9482
9488
|
const fileName = basename4(file2);
|
|
9483
9489
|
const match = CONVENTION_RE.exec(fileName);
|
|
@@ -9502,7 +9508,7 @@ var CONVENTION_RE, classifyFile = (file2, pageFiles, defaults, pages) => {
|
|
|
9502
9508
|
else if (kind === "loading")
|
|
9503
9509
|
pages[pageName].loading = file2;
|
|
9504
9510
|
}, scanConventions = async (pagesDir, pattern) => {
|
|
9505
|
-
if (!
|
|
9511
|
+
if (!existsSync9(pagesDir)) {
|
|
9506
9512
|
const pageFiles2 = [];
|
|
9507
9513
|
return { conventions: undefined, pageFiles: pageFiles2 };
|
|
9508
9514
|
}
|
|
@@ -9525,7 +9531,7 @@ var init_scanConventions = __esm(() => {
|
|
|
9525
9531
|
});
|
|
9526
9532
|
|
|
9527
9533
|
// src/build/scanRouteRegistrations.ts
|
|
9528
|
-
import { readdirSync, readFileSync as
|
|
9534
|
+
import { readdirSync, readFileSync as readFileSync9 } from "fs";
|
|
9529
9535
|
import { join as join10 } from "path";
|
|
9530
9536
|
import ts2 from "typescript";
|
|
9531
9537
|
var ELYSIA_ROUTE_METHODS, SKIP_DIRS, SOURCE_EXTENSIONS, getScriptKind = (filePath) => {
|
|
@@ -9579,7 +9585,7 @@ var ELYSIA_ROUTE_METHODS, SKIP_DIRS, SOURCE_EXTENSIONS, getScriptKind = (filePat
|
|
|
9579
9585
|
}, extractRoutesFromFile = (filePath, out) => {
|
|
9580
9586
|
let source;
|
|
9581
9587
|
try {
|
|
9582
|
-
source =
|
|
9588
|
+
source = readFileSync9(filePath, "utf-8");
|
|
9583
9589
|
} catch {
|
|
9584
9590
|
return;
|
|
9585
9591
|
}
|
|
@@ -9648,7 +9654,7 @@ var init_scanRouteRegistrations = __esm(() => {
|
|
|
9648
9654
|
});
|
|
9649
9655
|
|
|
9650
9656
|
// src/angular/staticAnalyzeSpaRoutes.ts
|
|
9651
|
-
import { existsSync as
|
|
9657
|
+
import { existsSync as existsSync10, promises as fs } from "fs";
|
|
9652
9658
|
import { join as join11 } from "path";
|
|
9653
9659
|
import ts3 from "typescript";
|
|
9654
9660
|
var DYNAMIC_SEGMENT_PATTERN, pathHasDynamic = (path) => path.split("/").some((seg) => DYNAMIC_SEGMENT_PATTERN.test(seg) || seg === "**"), importsSymbolFrom = (sf, localName, moduleSpecifier) => {
|
|
@@ -9855,7 +9861,7 @@ var DYNAMIC_SEGMENT_PATTERN, pathHasDynamic = (path) => path.split("/").some((se
|
|
|
9855
9861
|
}
|
|
9856
9862
|
}
|
|
9857
9863
|
}, analyzeAngularSpaRoutes = async (angularDirectory) => {
|
|
9858
|
-
if (!
|
|
9864
|
+
if (!existsSync10(angularDirectory))
|
|
9859
9865
|
return [];
|
|
9860
9866
|
const tsFiles = [];
|
|
9861
9867
|
await walkTsFiles(angularDirectory, tsFiles);
|
|
@@ -9876,7 +9882,7 @@ var init_staticAnalyzeSpaRoutes = __esm(() => {
|
|
|
9876
9882
|
});
|
|
9877
9883
|
|
|
9878
9884
|
// src/react/staticAnalyzeSpaRoutes.ts
|
|
9879
|
-
import { existsSync as
|
|
9885
|
+
import { existsSync as existsSync11, promises as fs2 } from "fs";
|
|
9880
9886
|
import { join as join12 } from "path";
|
|
9881
9887
|
import ts4 from "typescript";
|
|
9882
9888
|
var DYNAMIC_SEGMENT_PATTERN2, pathHasDynamic2 = (path) => path.split("/").some((seg) => DYNAMIC_SEGMENT_PATTERN2.test(seg) || seg === "**"), readStringLiteral2 = (expression) => {
|
|
@@ -10065,7 +10071,7 @@ var DYNAMIC_SEGMENT_PATTERN2, pathHasDynamic2 = (path) => path.split("/").some((
|
|
|
10065
10071
|
}
|
|
10066
10072
|
}
|
|
10067
10073
|
}, analyzeReactSpaRoutes = async (reactDirectory) => {
|
|
10068
|
-
if (!
|
|
10074
|
+
if (!existsSync11(reactDirectory))
|
|
10069
10075
|
return [];
|
|
10070
10076
|
const files = [];
|
|
10071
10077
|
await walkSourceFiles(reactDirectory, files);
|
|
@@ -10086,7 +10092,7 @@ var init_staticAnalyzeSpaRoutes2 = __esm(() => {
|
|
|
10086
10092
|
});
|
|
10087
10093
|
|
|
10088
10094
|
// src/svelte/staticAnalyzeSpaRoutes.ts
|
|
10089
|
-
import { existsSync as
|
|
10095
|
+
import { existsSync as existsSync12, promises as fs3 } from "fs";
|
|
10090
10096
|
import { join as join13 } from "path";
|
|
10091
10097
|
var DYNAMIC_SEGMENT_PATTERN3, pathHasDynamic3 = (path) => path.split("/").some((seg) => DYNAMIC_SEGMENT_PATTERN3.test(seg) || seg === "**"), joinSegments3 = (parent, child) => {
|
|
10092
10098
|
if (!child)
|
|
@@ -10167,7 +10173,7 @@ var DYNAMIC_SEGMENT_PATTERN3, pathHasDynamic3 = (path) => path.split("/").some((
|
|
|
10167
10173
|
}
|
|
10168
10174
|
}
|
|
10169
10175
|
}, analyzeSvelteSpaRoutes = async (svelteDirectory) => {
|
|
10170
|
-
if (!
|
|
10176
|
+
if (!existsSync12(svelteDirectory))
|
|
10171
10177
|
return [];
|
|
10172
10178
|
const files = [];
|
|
10173
10179
|
await walkSvelteFiles(svelteDirectory, files);
|
|
@@ -10190,7 +10196,7 @@ var init_staticAnalyzeSpaRoutes3 = __esm(() => {
|
|
|
10190
10196
|
});
|
|
10191
10197
|
|
|
10192
10198
|
// src/vue/staticAnalyzeSpaRoutes.ts
|
|
10193
|
-
import { existsSync as
|
|
10199
|
+
import { existsSync as existsSync13, promises as fs4 } from "fs";
|
|
10194
10200
|
import { join as join14 } from "path";
|
|
10195
10201
|
import ts5 from "typescript";
|
|
10196
10202
|
var DYNAMIC_SEGMENT_PATTERN4, pathHasDynamic4 = (path) => path.split("/").some((seg) => DYNAMIC_SEGMENT_PATTERN4.test(seg) || seg === "**"), readStringLiteral3 = (expression) => {
|
|
@@ -10405,7 +10411,7 @@ var DYNAMIC_SEGMENT_PATTERN4, pathHasDynamic4 = (path) => path.split("/").some((
|
|
|
10405
10411
|
}
|
|
10406
10412
|
}
|
|
10407
10413
|
}, analyzeVueSpaRoutes = async (vueDirectory) => {
|
|
10408
|
-
if (!
|
|
10414
|
+
if (!existsSync13(vueDirectory))
|
|
10409
10415
|
return [];
|
|
10410
10416
|
const files = [];
|
|
10411
10417
|
await walkSourceFiles2(vueDirectory, files);
|
|
@@ -10658,10 +10664,10 @@ var init_generateSitemap = __esm(() => {
|
|
|
10658
10664
|
});
|
|
10659
10665
|
|
|
10660
10666
|
// src/build/scanCssEntryPoints.ts
|
|
10661
|
-
import { existsSync as
|
|
10667
|
+
import { existsSync as existsSync14 } from "fs";
|
|
10662
10668
|
var {Glob: Glob4 } = globalThis.Bun;
|
|
10663
10669
|
var scanCssEntryPoints = async (dir, ignore) => {
|
|
10664
|
-
if (!
|
|
10670
|
+
if (!existsSync14(dir))
|
|
10665
10671
|
return [];
|
|
10666
10672
|
const entryPaths = [];
|
|
10667
10673
|
const glob = new Glob4("**/*.{css,scss,sass,less,styl,stylus}");
|
|
@@ -10678,7 +10684,7 @@ var init_scanCssEntryPoints = __esm(() => {
|
|
|
10678
10684
|
});
|
|
10679
10685
|
|
|
10680
10686
|
// src/utils/imageProcessing.ts
|
|
10681
|
-
import { existsSync as
|
|
10687
|
+
import { existsSync as existsSync15, mkdirSync as mkdirSync3, readFileSync as readFileSync10, writeFileSync as writeFileSync4 } from "fs";
|
|
10682
10688
|
import { join as join15, resolve as resolve14 } from "path";
|
|
10683
10689
|
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) => {
|
|
10684
10690
|
for (const size of sizes) {
|
|
@@ -10730,7 +10736,7 @@ var DEFAULT_DEVICE_SIZES, DEFAULT_IMAGE_SIZES, DEFAULT_QUALITY, OPTIMIZATION_END
|
|
|
10730
10736
|
return [...device, ...image2].sort((left, right) => left - right);
|
|
10731
10737
|
}, getCacheDir = (buildDir) => {
|
|
10732
10738
|
const dir = join15(buildDir, ".cache", "images");
|
|
10733
|
-
if (!
|
|
10739
|
+
if (!existsSync15(dir))
|
|
10734
10740
|
mkdirSync3(dir, { recursive: true });
|
|
10735
10741
|
return dir;
|
|
10736
10742
|
}, getCacheKey = (url, width, quality, format) => {
|
|
@@ -10812,11 +10818,11 @@ var DEFAULT_DEVICE_SIZES, DEFAULT_IMAGE_SIZES, DEFAULT_QUALITY, OPTIMIZATION_END
|
|
|
10812
10818
|
}, readFromCache = (cacheDir, cacheKey) => {
|
|
10813
10819
|
const metaPath = join15(cacheDir, `${cacheKey}.meta`);
|
|
10814
10820
|
const dataPath = join15(cacheDir, `${cacheKey}.data`);
|
|
10815
|
-
if (!
|
|
10821
|
+
if (!existsSync15(metaPath) || !existsSync15(dataPath))
|
|
10816
10822
|
return null;
|
|
10817
10823
|
try {
|
|
10818
|
-
const meta = JSON.parse(
|
|
10819
|
-
const buffer =
|
|
10824
|
+
const meta = JSON.parse(readFileSync10(metaPath, "utf-8"));
|
|
10825
|
+
const buffer = readFileSync10(dataPath);
|
|
10820
10826
|
return { buffer, meta };
|
|
10821
10827
|
} catch {
|
|
10822
10828
|
return null;
|
|
@@ -10925,14 +10931,14 @@ var init_optimizeHtmlImages = __esm(() => {
|
|
|
10925
10931
|
});
|
|
10926
10932
|
|
|
10927
10933
|
// src/cli/scripts/telemetry.ts
|
|
10928
|
-
import { existsSync as
|
|
10934
|
+
import { existsSync as existsSync16, mkdirSync as mkdirSync4, readFileSync as readFileSync11, writeFileSync as writeFileSync5 } from "fs";
|
|
10929
10935
|
import { homedir } from "os";
|
|
10930
10936
|
import { join as join16 } from "path";
|
|
10931
10937
|
var configDir, configPath, getTelemetryConfig = () => {
|
|
10932
10938
|
try {
|
|
10933
|
-
if (!
|
|
10939
|
+
if (!existsSync16(configPath))
|
|
10934
10940
|
return null;
|
|
10935
|
-
const raw =
|
|
10941
|
+
const raw = readFileSync11(configPath, "utf-8");
|
|
10936
10942
|
const config = JSON.parse(raw);
|
|
10937
10943
|
return config;
|
|
10938
10944
|
} catch {
|
|
@@ -10945,14 +10951,14 @@ var init_telemetry = __esm(() => {
|
|
|
10945
10951
|
});
|
|
10946
10952
|
|
|
10947
10953
|
// src/cli/telemetryEvent.ts
|
|
10948
|
-
import { existsSync as
|
|
10954
|
+
import { existsSync as existsSync17, readFileSync as readFileSync12 } from "fs";
|
|
10949
10955
|
import { arch, platform } from "os";
|
|
10950
10956
|
import { dirname as dirname9, join as join17, parse } from "path";
|
|
10951
10957
|
var checkCandidate = (candidate) => {
|
|
10952
|
-
if (!
|
|
10958
|
+
if (!existsSync17(candidate)) {
|
|
10953
10959
|
return null;
|
|
10954
10960
|
}
|
|
10955
|
-
const pkg = JSON.parse(
|
|
10961
|
+
const pkg = JSON.parse(readFileSync12(candidate, "utf-8"));
|
|
10956
10962
|
if (pkg.name === "@absolutejs/absolute") {
|
|
10957
10963
|
const ver = pkg.version;
|
|
10958
10964
|
return ver;
|
|
@@ -11064,17 +11070,17 @@ var exports_buildHMRClient = {};
|
|
|
11064
11070
|
__export(exports_buildHMRClient, {
|
|
11065
11071
|
buildHMRClient: () => buildHMRClient
|
|
11066
11072
|
});
|
|
11067
|
-
import { existsSync as
|
|
11073
|
+
import { existsSync as existsSync18 } from "fs";
|
|
11068
11074
|
import { resolve as resolve15 } from "path";
|
|
11069
11075
|
var {build: bunBuild } = globalThis.Bun;
|
|
11070
11076
|
var resolveHmrClientPath = () => {
|
|
11071
11077
|
const projectRoot = process.cwd();
|
|
11072
11078
|
const fromSource = resolve15(import.meta.dir, "client/hmrClient.ts");
|
|
11073
|
-
if (
|
|
11079
|
+
if (existsSync18(fromSource) && fromSource.startsWith(projectRoot)) {
|
|
11074
11080
|
return fromSource;
|
|
11075
11081
|
}
|
|
11076
11082
|
const fromNodeModules = resolve15(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client/hmrClient.ts");
|
|
11077
|
-
if (
|
|
11083
|
+
if (existsSync18(fromNodeModules))
|
|
11078
11084
|
return fromNodeModules;
|
|
11079
11085
|
return resolve15(import.meta.dir, "dev/client/hmrClient.ts");
|
|
11080
11086
|
}, hmrClientPath2, buildHMRClient = async () => {
|
|
@@ -11269,7 +11275,7 @@ var devVendorPaths = null, getDevVendorPaths = () => devVendorPaths, setDevVendo
|
|
|
11269
11275
|
};
|
|
11270
11276
|
|
|
11271
11277
|
// src/build/angularLinkerPlugin.ts
|
|
11272
|
-
import { existsSync as
|
|
11278
|
+
import { existsSync as existsSync19, mkdirSync as mkdirSync5, readFileSync as readFileSync13, writeFileSync as writeFileSync6 } from "fs";
|
|
11273
11279
|
import { dirname as dirname10, join as join18, relative as relative6, resolve as resolve17 } from "path";
|
|
11274
11280
|
import { createHash as createHash3 } from "crypto";
|
|
11275
11281
|
var CACHE_ROOT, ANGULAR_LINKER_CANDIDATE_RE, createAngularLinkerPlugin = (linkerJitMode) => ({
|
|
@@ -11292,9 +11298,9 @@ var CACHE_ROOT, ANGULAR_LINKER_CANDIDATE_RE, createAngularLinkerPlugin = (linker
|
|
|
11292
11298
|
}
|
|
11293
11299
|
const hash = createHash3("md5").update(source).digest("hex");
|
|
11294
11300
|
const cachePath = join18(cacheDir, `${hash}.js`);
|
|
11295
|
-
if (
|
|
11301
|
+
if (existsSync19(cachePath)) {
|
|
11296
11302
|
return {
|
|
11297
|
-
contents:
|
|
11303
|
+
contents: readFileSync13(cachePath, "utf-8"),
|
|
11298
11304
|
loader: "js"
|
|
11299
11305
|
};
|
|
11300
11306
|
}
|
|
@@ -11309,8 +11315,8 @@ var CACHE_ROOT, ANGULAR_LINKER_CANDIDATE_RE, createAngularLinkerPlugin = (linker
|
|
|
11309
11315
|
linkerPlugin = mod.createEs2015LinkerPlugin({
|
|
11310
11316
|
fileSystem: {
|
|
11311
11317
|
dirname: dirname10,
|
|
11312
|
-
exists:
|
|
11313
|
-
readFile:
|
|
11318
|
+
exists: existsSync19,
|
|
11319
|
+
readFile: readFileSync13,
|
|
11314
11320
|
relative: relative6,
|
|
11315
11321
|
resolve: resolve17
|
|
11316
11322
|
},
|
|
@@ -11349,7 +11355,7 @@ var init_angularLinkerPlugin = __esm(() => {
|
|
|
11349
11355
|
});
|
|
11350
11356
|
|
|
11351
11357
|
// src/build/externalAssetPlugin.ts
|
|
11352
|
-
import { copyFileSync, existsSync as
|
|
11358
|
+
import { copyFileSync, existsSync as existsSync20, mkdirSync as mkdirSync6, statSync } from "fs";
|
|
11353
11359
|
import { basename as basename5, dirname as dirname11, join as join19, resolve as resolve18 } from "path";
|
|
11354
11360
|
var createExternalAssetPlugin = (outDir, userSourceRoots = []) => ({
|
|
11355
11361
|
name: "absolute-external-asset",
|
|
@@ -11371,12 +11377,12 @@ var createExternalAssetPlugin = (outDir, userSourceRoots = []) => ({
|
|
|
11371
11377
|
if (!relPath)
|
|
11372
11378
|
continue;
|
|
11373
11379
|
const assetPath = resolve18(sourceDir, relPath);
|
|
11374
|
-
if (!
|
|
11380
|
+
if (!existsSync20(assetPath))
|
|
11375
11381
|
continue;
|
|
11376
11382
|
if (!statSync(assetPath).isFile())
|
|
11377
11383
|
continue;
|
|
11378
11384
|
const targetPath = join19(outDir, basename5(assetPath));
|
|
11379
|
-
if (
|
|
11385
|
+
if (existsSync20(targetPath))
|
|
11380
11386
|
continue;
|
|
11381
11387
|
mkdirSync6(dirname11(targetPath), { recursive: true });
|
|
11382
11388
|
copyFileSync(assetPath, targetPath);
|
|
@@ -11687,7 +11693,7 @@ var commonAncestor = (paths, fallback) => {
|
|
|
11687
11693
|
var init_commonAncestor = () => {};
|
|
11688
11694
|
|
|
11689
11695
|
// src/utils/buildDirectoryLock.ts
|
|
11690
|
-
import { mkdirSync as mkdirSync7, unlinkSync, writeFileSync as writeFileSync7, readFileSync as
|
|
11696
|
+
import { mkdirSync as mkdirSync7, unlinkSync, writeFileSync as writeFileSync7, readFileSync as readFileSync14 } from "fs";
|
|
11691
11697
|
import { dirname as dirname12, join as join22 } from "path";
|
|
11692
11698
|
var heldLocks, HELD_LOCKS_ENV = "ABSOLUTE_HELD_BUILD_DIRECTORY_LOCKS", exitHandlersRegistered = false, registerExitHandlersOnce = () => {
|
|
11693
11699
|
if (exitHandlersRegistered)
|
|
@@ -11735,7 +11741,7 @@ var heldLocks, HELD_LOCKS_ENV = "ABSOLUTE_HELD_BUILD_DIRECTORY_LOCKS", exitHandl
|
|
|
11735
11741
|
writeFileSync7(lockPath, JSON.stringify(metadata2, null, 2), { flag: "wx" });
|
|
11736
11742
|
}, readLockMetadata = (lockPath) => {
|
|
11737
11743
|
try {
|
|
11738
|
-
const raw =
|
|
11744
|
+
const raw = readFileSync14(lockPath, "utf-8");
|
|
11739
11745
|
const parsed = JSON.parse(raw);
|
|
11740
11746
|
if (typeof parsed === "object" && parsed !== null && typeof parsed.pid === "number") {
|
|
11741
11747
|
return {
|
|
@@ -11868,7 +11874,7 @@ var exports_scanVueSsrOnlyPages = {};
|
|
|
11868
11874
|
__export(exports_scanVueSsrOnlyPages, {
|
|
11869
11875
|
scanVueSsrOnlyPages: () => scanVueSsrOnlyPages
|
|
11870
11876
|
});
|
|
11871
|
-
import { readdirSync as readdirSync2, readFileSync as
|
|
11877
|
+
import { readdirSync as readdirSync2, readFileSync as readFileSync15 } from "fs";
|
|
11872
11878
|
import { join as join23 } from "path";
|
|
11873
11879
|
import ts6 from "typescript";
|
|
11874
11880
|
var SKIP_DIRS2, SOURCE_EXTENSIONS2, getScriptKind2 = (filePath) => {
|
|
@@ -11971,7 +11977,7 @@ var SKIP_DIRS2, SOURCE_EXTENSIONS2, getScriptKind2 = (filePath) => {
|
|
|
11971
11977
|
}, extractFromFile = (filePath, out) => {
|
|
11972
11978
|
let source;
|
|
11973
11979
|
try {
|
|
11974
|
-
source =
|
|
11980
|
+
source = readFileSync15(filePath, "utf-8");
|
|
11975
11981
|
} catch {
|
|
11976
11982
|
return;
|
|
11977
11983
|
}
|
|
@@ -12015,7 +12021,7 @@ var init_scanVueSsrOnlyPages = __esm(() => {
|
|
|
12015
12021
|
});
|
|
12016
12022
|
|
|
12017
12023
|
// src/build/scanAngularHandlerCalls.ts
|
|
12018
|
-
import { readdirSync as readdirSync3, readFileSync as
|
|
12024
|
+
import { readdirSync as readdirSync3, readFileSync as readFileSync16 } from "fs";
|
|
12019
12025
|
import { join as join24 } from "path";
|
|
12020
12026
|
import ts7 from "typescript";
|
|
12021
12027
|
var ELYSIA_ROUTE_METHODS2, SKIP_DIRS3, SOURCE_EXTENSIONS3, getScriptKind3 = (filePath) => {
|
|
@@ -12086,7 +12092,7 @@ var ELYSIA_ROUTE_METHODS2, SKIP_DIRS3, SOURCE_EXTENSIONS3, getScriptKind3 = (fil
|
|
|
12086
12092
|
}, extractCallsFromFile = (filePath, out) => {
|
|
12087
12093
|
let source;
|
|
12088
12094
|
try {
|
|
12089
|
-
source =
|
|
12095
|
+
source = readFileSync16(filePath, "utf-8");
|
|
12090
12096
|
} catch {
|
|
12091
12097
|
return;
|
|
12092
12098
|
}
|
|
@@ -12165,7 +12171,7 @@ var init_scanAngularHandlerCalls = __esm(() => {
|
|
|
12165
12171
|
});
|
|
12166
12172
|
|
|
12167
12173
|
// src/build/scanAngularPageRoutes.ts
|
|
12168
|
-
import { readdirSync as readdirSync4, readFileSync as
|
|
12174
|
+
import { readdirSync as readdirSync4, readFileSync as readFileSync17 } from "fs";
|
|
12169
12175
|
import { basename as basename6, join as join25 } from "path";
|
|
12170
12176
|
import ts8 from "typescript";
|
|
12171
12177
|
var SOURCE_EXTENSIONS4, SKIP_DIRS4, hasSourceExtension4 = (filePath) => {
|
|
@@ -12237,7 +12243,7 @@ var SOURCE_EXTENSIONS4, SKIP_DIRS4, hasSourceExtension4 = (filePath) => {
|
|
|
12237
12243
|
for (const file2 of files) {
|
|
12238
12244
|
let source;
|
|
12239
12245
|
try {
|
|
12240
|
-
source =
|
|
12246
|
+
source = readFileSync17(file2, "utf-8");
|
|
12241
12247
|
} catch {
|
|
12242
12248
|
continue;
|
|
12243
12249
|
}
|
|
@@ -12284,7 +12290,7 @@ var exports_parseAngularConfigImports = {};
|
|
|
12284
12290
|
__export(exports_parseAngularConfigImports, {
|
|
12285
12291
|
parseAngularProvidersImport: () => parseAngularProvidersImport
|
|
12286
12292
|
});
|
|
12287
|
-
import { existsSync as
|
|
12293
|
+
import { existsSync as existsSync21, readFileSync as readFileSync18 } from "fs";
|
|
12288
12294
|
import { dirname as dirname13, isAbsolute as isAbsolute3, join as join26 } from "path";
|
|
12289
12295
|
import ts9 from "typescript";
|
|
12290
12296
|
var findDefineConfigCall = (sf) => {
|
|
@@ -12341,7 +12347,7 @@ var findDefineConfigCall = (sf) => {
|
|
|
12341
12347
|
const envOverride = process.env.ABSOLUTE_CONFIG;
|
|
12342
12348
|
if (envOverride) {
|
|
12343
12349
|
const resolved = isAbsolute3(envOverride) ? envOverride : join26(projectRoot, envOverride);
|
|
12344
|
-
if (
|
|
12350
|
+
if (existsSync21(resolved))
|
|
12345
12351
|
return resolved;
|
|
12346
12352
|
}
|
|
12347
12353
|
const candidates = [
|
|
@@ -12351,7 +12357,7 @@ var findDefineConfigCall = (sf) => {
|
|
|
12351
12357
|
join26(projectRoot, "absolute.config.mjs")
|
|
12352
12358
|
];
|
|
12353
12359
|
for (const candidate of candidates) {
|
|
12354
|
-
if (
|
|
12360
|
+
if (existsSync21(candidate))
|
|
12355
12361
|
return candidate;
|
|
12356
12362
|
}
|
|
12357
12363
|
return null;
|
|
@@ -12359,7 +12365,7 @@ var findDefineConfigCall = (sf) => {
|
|
|
12359
12365
|
const configPath2 = resolveConfigPath(projectRoot);
|
|
12360
12366
|
if (!configPath2)
|
|
12361
12367
|
return null;
|
|
12362
|
-
const source =
|
|
12368
|
+
const source = readFileSync18(configPath2, "utf-8");
|
|
12363
12369
|
if (!source.includes("angular"))
|
|
12364
12370
|
return null;
|
|
12365
12371
|
if (!source.includes("providers"))
|
|
@@ -12452,7 +12458,7 @@ __export(exports_compileSvelte, {
|
|
|
12452
12458
|
compileSvelte: () => compileSvelte,
|
|
12453
12459
|
clearSvelteCompilerCache: () => clearSvelteCompilerCache
|
|
12454
12460
|
});
|
|
12455
|
-
import { existsSync as
|
|
12461
|
+
import { existsSync as existsSync22 } from "fs";
|
|
12456
12462
|
import { mkdir as mkdir4, stat as stat2 } from "fs/promises";
|
|
12457
12463
|
import {
|
|
12458
12464
|
dirname as dirname14,
|
|
@@ -12468,11 +12474,11 @@ var {write: write2, file: file2, Transpiler: Transpiler2 } = globalThis.Bun;
|
|
|
12468
12474
|
var resolveDevClientDir2 = () => {
|
|
12469
12475
|
const projectRoot = process.cwd();
|
|
12470
12476
|
const fromSource = resolve22(import.meta.dir, "../dev/client");
|
|
12471
|
-
if (
|
|
12477
|
+
if (existsSync22(fromSource) && fromSource.startsWith(projectRoot)) {
|
|
12472
12478
|
return fromSource;
|
|
12473
12479
|
}
|
|
12474
12480
|
const fromNodeModules = resolve22(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client");
|
|
12475
|
-
if (
|
|
12481
|
+
if (existsSync22(fromNodeModules))
|
|
12476
12482
|
return fromNodeModules;
|
|
12477
12483
|
return resolve22(import.meta.dir, "./dev/client");
|
|
12478
12484
|
}, devClientDir2, hmrClientPath3, persistentCache, sourceHashCache, clearSvelteCompilerCache = () => {
|
|
@@ -12575,7 +12581,7 @@ var resolveDevClientDir2 = () => {
|
|
|
12575
12581
|
const contentHash = Bun.hash(raw).toString(BASE_36_RADIX);
|
|
12576
12582
|
const prevHash = sourceHashCache.get(src);
|
|
12577
12583
|
const persistent = persistentCache.get(src);
|
|
12578
|
-
if (prevHash === contentHash && persistent &&
|
|
12584
|
+
if (prevHash === contentHash && persistent && existsSync22(persistent.ssr) && existsSync22(persistent.client)) {
|
|
12579
12585
|
cache.set(src, persistent);
|
|
12580
12586
|
return persistent;
|
|
12581
12587
|
}
|
|
@@ -12815,7 +12821,7 @@ __export(exports_chainInlineSourcemaps, {
|
|
|
12815
12821
|
chainBundleInlineSourcemap: () => chainBundleInlineSourcemap,
|
|
12816
12822
|
buildLineRemap: () => buildLineRemap
|
|
12817
12823
|
});
|
|
12818
|
-
import { readFileSync as
|
|
12824
|
+
import { readFileSync as readFileSync19, writeFileSync as writeFileSync8 } from "fs";
|
|
12819
12825
|
var BASE64_CHARS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", BASE64_TO_INT, decodeVlq = (str, startPos) => {
|
|
12820
12826
|
let result = 0;
|
|
12821
12827
|
let shift = 0;
|
|
@@ -13106,7 +13112,7 @@ var BASE64_CHARS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz01234567
|
|
|
13106
13112
|
version: 3
|
|
13107
13113
|
};
|
|
13108
13114
|
}, chainBundleInlineSourcemap = (bundleFilePath) => {
|
|
13109
|
-
const text =
|
|
13115
|
+
const text = readFileSync19(bundleFilePath, "utf-8");
|
|
13110
13116
|
const outerMap = extractInlineMap(text);
|
|
13111
13117
|
if (!outerMap)
|
|
13112
13118
|
return;
|
|
@@ -13192,7 +13198,7 @@ __export(exports_compileVue, {
|
|
|
13192
13198
|
compileVue: () => compileVue,
|
|
13193
13199
|
clearVueHmrCaches: () => clearVueHmrCaches
|
|
13194
13200
|
});
|
|
13195
|
-
import { existsSync as
|
|
13201
|
+
import { existsSync as existsSync23, readFileSync as readFileSync20, realpathSync as realpathSync2 } from "fs";
|
|
13196
13202
|
import { mkdir as mkdir5 } from "fs/promises";
|
|
13197
13203
|
import {
|
|
13198
13204
|
basename as basename8,
|
|
@@ -13206,11 +13212,11 @@ var {file: file3, write: write3, Transpiler: Transpiler3 } = globalThis.Bun;
|
|
|
13206
13212
|
var resolveDevClientDir3 = () => {
|
|
13207
13213
|
const projectRoot = process.cwd();
|
|
13208
13214
|
const fromSource = resolve23(import.meta.dir, "../dev/client");
|
|
13209
|
-
if (
|
|
13215
|
+
if (existsSync23(fromSource) && fromSource.startsWith(projectRoot)) {
|
|
13210
13216
|
return fromSource;
|
|
13211
13217
|
}
|
|
13212
13218
|
const fromNodeModules = resolve23(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client");
|
|
13213
|
-
if (
|
|
13219
|
+
if (existsSync23(fromNodeModules))
|
|
13214
13220
|
return fromNodeModules;
|
|
13215
13221
|
return resolve23(import.meta.dir, "./dev/client");
|
|
13216
13222
|
}, devClientDir3, hmrClientPath4, transpiler4, scriptCache, scriptSetupCache, templateCache, styleCache, persistentBuildCache, vueSourceHashCache, vueHmrMetadata, clearVueHmrCaches = () => {
|
|
@@ -13252,26 +13258,26 @@ var resolveDevClientDir3 = () => {
|
|
|
13252
13258
|
}
|
|
13253
13259
|
return "full";
|
|
13254
13260
|
}, generateVueHmrId = (sourceFilePath, vueRootDir) => relative10(vueRootDir, sourceFilePath).replace(/\\/g, "/").replace(/\.vue$/, ""), extractImports = (sourceCode) => Array.from(sourceCode.matchAll(/import\s+[\s\S]+?['"]([^'"]+)['"]/g)).map((match) => match[1]).filter((importPath) => importPath !== undefined), inlineCssImports = (cssContent, cssFilePath, visited = new Set) => {
|
|
13255
|
-
const resolved =
|
|
13261
|
+
const resolved = realpathSync2(cssFilePath);
|
|
13256
13262
|
if (visited.has(resolved))
|
|
13257
13263
|
return "";
|
|
13258
13264
|
visited.add(resolved);
|
|
13259
13265
|
const importRegex = /@import\s+(?:url\(\s*)?(['"])(\.{1,2}\/[^'"]+)\1\s*\)?\s*;?/g;
|
|
13260
13266
|
return cssContent.replace(importRegex, (match, _quote, relPath) => {
|
|
13261
13267
|
const importedPath = resolve23(dirname15(cssFilePath), relPath);
|
|
13262
|
-
if (!
|
|
13268
|
+
if (!existsSync23(importedPath))
|
|
13263
13269
|
return match;
|
|
13264
|
-
const importedContent =
|
|
13270
|
+
const importedContent = readFileSync20(importedPath, "utf-8");
|
|
13265
13271
|
return inlineCssImports(importedContent, importedPath, visited);
|
|
13266
13272
|
});
|
|
13267
13273
|
}, resolveHelperTsPath = (sourceDir, helper) => {
|
|
13268
13274
|
if (helper.endsWith(".ts"))
|
|
13269
13275
|
return resolve23(sourceDir, helper);
|
|
13270
13276
|
const direct = resolve23(sourceDir, `${helper}.ts`);
|
|
13271
|
-
if (
|
|
13277
|
+
if (existsSync23(direct))
|
|
13272
13278
|
return direct;
|
|
13273
13279
|
const indexed = resolve23(sourceDir, helper, "index.ts");
|
|
13274
|
-
if (
|
|
13280
|
+
if (existsSync23(indexed))
|
|
13275
13281
|
return indexed;
|
|
13276
13282
|
return direct;
|
|
13277
13283
|
}, toJs = (filePath, sourceDir) => {
|
|
@@ -13287,10 +13293,10 @@ var resolveDevClientDir3 = () => {
|
|
|
13287
13293
|
}
|
|
13288
13294
|
if (sourceDir && (filePath.startsWith("./") || filePath.startsWith("../"))) {
|
|
13289
13295
|
const directTs = resolve23(sourceDir, `${filePath}.ts`);
|
|
13290
|
-
if (
|
|
13296
|
+
if (existsSync23(directTs))
|
|
13291
13297
|
return `${filePath}.js`;
|
|
13292
13298
|
const indexedTs = resolve23(sourceDir, filePath, "index.ts");
|
|
13293
|
-
if (
|
|
13299
|
+
if (existsSync23(indexedTs))
|
|
13294
13300
|
return `${filePath}/index.js`;
|
|
13295
13301
|
}
|
|
13296
13302
|
return `${filePath}.js`;
|
|
@@ -13325,7 +13331,7 @@ var resolveDevClientDir3 = () => {
|
|
|
13325
13331
|
const contentHash = Bun.hash(sourceContent).toString(BASE_36_RADIX);
|
|
13326
13332
|
const prevHash = vueSourceHashCache.get(sourceFilePath);
|
|
13327
13333
|
const persistent = persistentBuildCache.get(sourceFilePath);
|
|
13328
|
-
if (prevHash === contentHash && persistent &&
|
|
13334
|
+
if (prevHash === contentHash && persistent && existsSync23(persistent.clientPath) && existsSync23(persistent.serverPath)) {
|
|
13329
13335
|
cacheMap.set(sourceFilePath, persistent);
|
|
13330
13336
|
return persistent;
|
|
13331
13337
|
}
|
|
@@ -13364,9 +13370,9 @@ var resolveDevClientDir3 = () => {
|
|
|
13364
13370
|
const hasScript = descriptor.script || descriptor.scriptSetup;
|
|
13365
13371
|
const compiledScript = hasScript ? compiler.compileScript(descriptor, {
|
|
13366
13372
|
fs: {
|
|
13367
|
-
fileExists:
|
|
13368
|
-
readFile: (file4) =>
|
|
13369
|
-
realpath:
|
|
13373
|
+
fileExists: existsSync23,
|
|
13374
|
+
readFile: (file4) => existsSync23(file4) ? readFileSync20(file4, "utf-8") : undefined,
|
|
13375
|
+
realpath: realpathSync2
|
|
13370
13376
|
},
|
|
13371
13377
|
id: componentId,
|
|
13372
13378
|
inlineTemplate: false,
|
|
@@ -13686,7 +13692,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
13686
13692
|
continue;
|
|
13687
13693
|
}
|
|
13688
13694
|
const resolved = resolveHelperTsPath(helperDir, dep);
|
|
13689
|
-
if (!
|
|
13695
|
+
if (!existsSync23(resolved))
|
|
13690
13696
|
continue;
|
|
13691
13697
|
if (allTsHelperPaths.has(resolved))
|
|
13692
13698
|
continue;
|
|
@@ -14204,7 +14210,7 @@ __export(exports_compileAngular, {
|
|
|
14204
14210
|
compileAngularFile: () => compileAngularFile,
|
|
14205
14211
|
compileAngular: () => compileAngular
|
|
14206
14212
|
});
|
|
14207
|
-
import { existsSync as
|
|
14213
|
+
import { existsSync as existsSync24, readFileSync as readFileSync21, promises as fs5 } from "fs";
|
|
14208
14214
|
import { join as join29, basename as basename9, sep as sep3, dirname as dirname16, resolve as resolve24, relative as relative11 } from "path";
|
|
14209
14215
|
var {Glob: Glob6 } = globalThis.Bun;
|
|
14210
14216
|
import ts10 from "typescript";
|
|
@@ -14253,7 +14259,7 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
14253
14259
|
join29(candidate, "index.js"),
|
|
14254
14260
|
join29(candidate, "index.jsx")
|
|
14255
14261
|
];
|
|
14256
|
-
return candidates.find((file4) =>
|
|
14262
|
+
return candidates.find((file4) => existsSync24(file4));
|
|
14257
14263
|
}, createLegacyAngularAnimationUsageResolver = (rootDir) => {
|
|
14258
14264
|
const baseDir = resolve24(rootDir);
|
|
14259
14265
|
const tsconfigAliases = readTsconfigPathAliases();
|
|
@@ -14334,11 +14340,11 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
14334
14340
|
}, resolveDevClientDir4 = () => {
|
|
14335
14341
|
const projectRoot = process.cwd();
|
|
14336
14342
|
const fromSource = resolve24(import.meta.dir, "../dev/client");
|
|
14337
|
-
if (
|
|
14343
|
+
if (existsSync24(fromSource) && fromSource.startsWith(projectRoot)) {
|
|
14338
14344
|
return fromSource;
|
|
14339
14345
|
}
|
|
14340
14346
|
const fromNodeModules = resolve24(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client");
|
|
14341
|
-
if (
|
|
14347
|
+
if (existsSync24(fromNodeModules))
|
|
14342
14348
|
return fromNodeModules;
|
|
14343
14349
|
return resolve24(import.meta.dir, "./dev/client");
|
|
14344
14350
|
}, devClientDir4, hmrClientPath5, formatDiagnosticMessage = (diagnostic) => {
|
|
@@ -14384,11 +14390,11 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
14384
14390
|
return `${path}${query}`;
|
|
14385
14391
|
const importerDir = dirname16(importerOutputPath);
|
|
14386
14392
|
const fileCandidate = resolve24(importerDir, `${path}.js`);
|
|
14387
|
-
if (outputFiles?.has(fileCandidate) ||
|
|
14393
|
+
if (outputFiles?.has(fileCandidate) || existsSync24(fileCandidate)) {
|
|
14388
14394
|
return `${path}.js${query}`;
|
|
14389
14395
|
}
|
|
14390
14396
|
const indexCandidate = resolve24(importerDir, path, "index.js");
|
|
14391
|
-
if (outputFiles?.has(indexCandidate) ||
|
|
14397
|
+
if (outputFiles?.has(indexCandidate) || existsSync24(indexCandidate)) {
|
|
14392
14398
|
return `${path}/index.js${query}`;
|
|
14393
14399
|
}
|
|
14394
14400
|
return `${path}.js${query}`;
|
|
@@ -14426,7 +14432,7 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
14426
14432
|
join29(basePath, "index.mts"),
|
|
14427
14433
|
join29(basePath, "index.cts")
|
|
14428
14434
|
];
|
|
14429
|
-
return candidates.map((candidate) => resolve24(candidate)).find((candidate) =>
|
|
14435
|
+
return candidates.map((candidate) => resolve24(candidate)).find((candidate) => existsSync24(candidate) && !candidate.endsWith(".d.ts")) ?? null;
|
|
14430
14436
|
}, readFileForAotTransform = async (fileName, readFile6) => {
|
|
14431
14437
|
const hostSource = readFile6?.(fileName);
|
|
14432
14438
|
if (typeof hostSource === "string")
|
|
@@ -14507,7 +14513,7 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
14507
14513
|
if (visited.has(resolvedPath))
|
|
14508
14514
|
return;
|
|
14509
14515
|
visited.add(resolvedPath);
|
|
14510
|
-
if (!
|
|
14516
|
+
if (!existsSync24(resolvedPath) || resolvedPath.endsWith(".d.ts"))
|
|
14511
14517
|
return;
|
|
14512
14518
|
stats.filesVisited += 1;
|
|
14513
14519
|
const source = await readFileForAotTransform(resolvedPath, readFile6);
|
|
@@ -14541,7 +14547,7 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
14541
14547
|
const outputPath = resolve24(join29(outDir, relative11(process.cwd(), resolve24(inputPath)).replace(/\.[cm]?[tj]sx?$/, ".js")));
|
|
14542
14548
|
return [
|
|
14543
14549
|
outputPath,
|
|
14544
|
-
buildIslandMetadataExports(
|
|
14550
|
+
buildIslandMetadataExports(readFileSync21(inputPath, "utf-8"))
|
|
14545
14551
|
];
|
|
14546
14552
|
})), { entries: inputPaths.length });
|
|
14547
14553
|
await traceAngularPhase("aot/preload-compiler", () => import("@angular/compiler"));
|
|
@@ -14681,7 +14687,7 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
14681
14687
|
return null;
|
|
14682
14688
|
}, resolveAngularDeferImportSpecifier = () => {
|
|
14683
14689
|
const sourceEntry = resolve24(import.meta.dir, "../angular/components/index.ts");
|
|
14684
|
-
if (
|
|
14690
|
+
if (existsSync24(sourceEntry)) {
|
|
14685
14691
|
return sourceEntry.replace(/\\/g, "/");
|
|
14686
14692
|
}
|
|
14687
14693
|
return "@absolutejs/absolute/angular/components";
|
|
@@ -14809,7 +14815,7 @@ ${slot.resolvedBindings.map((binding) => ` "${binding.key}": this.__absoluteDef
|
|
|
14809
14815
|
${fields}
|
|
14810
14816
|
`);
|
|
14811
14817
|
}, readAndEscapeFile = async (filePath, stylePreprocessors) => {
|
|
14812
|
-
if (!
|
|
14818
|
+
if (!existsSync24(filePath)) {
|
|
14813
14819
|
throw new Error(`Unable to inline Angular style resource: file not found at ${filePath}`);
|
|
14814
14820
|
}
|
|
14815
14821
|
const content = await compileStyleFileIfNeeded(filePath, stylePreprocessors);
|
|
@@ -14818,7 +14824,7 @@ ${fields}
|
|
|
14818
14824
|
const templateUrlMatch = findUncommentedMatch(source, /templateUrl\s*:\s*['"]([^'"]+)['"]/);
|
|
14819
14825
|
if (templateUrlMatch?.[1]) {
|
|
14820
14826
|
const templatePath = join29(fileDir, templateUrlMatch[1]);
|
|
14821
|
-
if (!
|
|
14827
|
+
if (!existsSync24(templatePath)) {
|
|
14822
14828
|
throw new Error(`Unable to inline Angular templateUrl "${templateUrlMatch[1]}": file not found at ${templatePath}`);
|
|
14823
14829
|
}
|
|
14824
14830
|
const templateRaw2 = await fs5.readFile(templatePath, "utf-8");
|
|
@@ -14849,10 +14855,10 @@ ${fields}
|
|
|
14849
14855
|
const templateUrlMatch = findUncommentedMatch(source, /templateUrl\s*:\s*['"]([^'"]+)['"]/);
|
|
14850
14856
|
if (templateUrlMatch?.[1]) {
|
|
14851
14857
|
const templatePath = join29(fileDir, templateUrlMatch[1]);
|
|
14852
|
-
if (!
|
|
14858
|
+
if (!existsSync24(templatePath)) {
|
|
14853
14859
|
throw new Error(`Unable to inline Angular templateUrl "${templateUrlMatch[1]}": file not found at ${templatePath}`);
|
|
14854
14860
|
}
|
|
14855
|
-
const templateRaw2 =
|
|
14861
|
+
const templateRaw2 = readFileSync21(templatePath, "utf-8");
|
|
14856
14862
|
const lowered2 = lowerAngularDeferSyntax(templateRaw2);
|
|
14857
14863
|
const escaped2 = escapeTemplateContent(lowered2.template);
|
|
14858
14864
|
const replacedSource2 = source.slice(0, templateUrlMatch.index) + `template: \`${escaped2}\`` + source.slice(templateUrlMatch.index + templateUrlMatch[0].length);
|
|
@@ -14937,7 +14943,7 @@ ${fields}
|
|
|
14937
14943
|
join29(candidate, "index.js"),
|
|
14938
14944
|
join29(candidate, "index.jsx")
|
|
14939
14945
|
];
|
|
14940
|
-
return candidates.find((file4) =>
|
|
14946
|
+
return candidates.find((file4) => existsSync24(file4));
|
|
14941
14947
|
};
|
|
14942
14948
|
const resolveLocalImport = (specifier, fromDir) => {
|
|
14943
14949
|
if (specifier.startsWith(".") || specifier.startsWith("/")) {
|
|
@@ -15012,7 +15018,7 @@ ${fields}
|
|
|
15012
15018
|
if (visited.has(resolved))
|
|
15013
15019
|
return;
|
|
15014
15020
|
visited.add(resolved);
|
|
15015
|
-
if (resolved.endsWith(".json") &&
|
|
15021
|
+
if (resolved.endsWith(".json") && existsSync24(resolved)) {
|
|
15016
15022
|
const inputDir2 = dirname16(resolved);
|
|
15017
15023
|
const relativeDir2 = inputDir2.startsWith(baseDir) ? inputDir2.substring(baseDir.length + 1) : inputDir2;
|
|
15018
15024
|
const targetDir2 = join29(outDir, relativeDir2);
|
|
@@ -15025,7 +15031,7 @@ ${fields}
|
|
|
15025
15031
|
let actualPath = resolved;
|
|
15026
15032
|
if (!actualPath.endsWith(".ts"))
|
|
15027
15033
|
actualPath += ".ts";
|
|
15028
|
-
if (!
|
|
15034
|
+
if (!existsSync24(actualPath))
|
|
15029
15035
|
return;
|
|
15030
15036
|
let sourceCode = await fs5.readFile(actualPath, "utf-8");
|
|
15031
15037
|
const inlined = await inlineResources(sourceCode, dirname16(actualPath), stylePreprocessors);
|
|
@@ -15063,7 +15069,7 @@ ${fields}
|
|
|
15063
15069
|
const isEntry = resolve24(actualPath) === resolve24(entryPath);
|
|
15064
15070
|
const contentHash = Bun.hash(sourceCode).toString(BASE_36_RADIX);
|
|
15065
15071
|
const cacheKey2 = actualPath;
|
|
15066
|
-
const shouldWriteFile = cacheBuster && isEntry ? true : jitContentCache.get(cacheKey2) !== contentHash || !
|
|
15072
|
+
const shouldWriteFile = cacheBuster && isEntry ? true : jitContentCache.get(cacheKey2) !== contentHash || !existsSync24(targetPath);
|
|
15067
15073
|
if (shouldWriteFile) {
|
|
15068
15074
|
const processedContent = transpileAndRewrite(sourceCode, relativeDir, actualPath, importRewrites);
|
|
15069
15075
|
await fs5.mkdir(targetDir, { recursive: true });
|
|
@@ -15075,7 +15081,7 @@ ${fields}
|
|
|
15075
15081
|
};
|
|
15076
15082
|
await transpileFile(inputPath);
|
|
15077
15083
|
const entryOutputPath = toOutputPath(entryPath);
|
|
15078
|
-
if (
|
|
15084
|
+
if (existsSync24(entryOutputPath)) {
|
|
15079
15085
|
const entryOutput = await fs5.readFile(entryOutputPath, "utf-8");
|
|
15080
15086
|
const withoutLegacyFlag = entryOutput.replace(/\nexport const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;\n?/g, `
|
|
15081
15087
|
`);
|
|
@@ -15101,7 +15107,7 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
15101
15107
|
await traceAngularPhase("aot/copy-json-resources", async () => {
|
|
15102
15108
|
const cwd = process.cwd();
|
|
15103
15109
|
const angularSrcDir = resolve24(outRoot);
|
|
15104
|
-
if (!
|
|
15110
|
+
if (!existsSync24(angularSrcDir))
|
|
15105
15111
|
return;
|
|
15106
15112
|
const jsonGlob = new Glob6("**/*.json");
|
|
15107
15113
|
for (const rel of jsonGlob.scanSync({
|
|
@@ -15136,15 +15142,15 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
15136
15142
|
...candidatePaths.map((file4) => resolve24(file4)),
|
|
15137
15143
|
...compiledFallbackPaths
|
|
15138
15144
|
];
|
|
15139
|
-
let candidate = normalizedCandidates.find((file4) =>
|
|
15145
|
+
let candidate = normalizedCandidates.find((file4) => existsSync24(file4) && file4.endsWith(`${sep3}${relativeEntry}`));
|
|
15140
15146
|
if (!candidate) {
|
|
15141
|
-
candidate = normalizedCandidates.find((file4) =>
|
|
15147
|
+
candidate = normalizedCandidates.find((file4) => existsSync24(file4) && file4.endsWith(`${sep3}pages${sep3}${jsName}`));
|
|
15142
15148
|
}
|
|
15143
15149
|
if (!candidate) {
|
|
15144
|
-
candidate = normalizedCandidates.find((file4) =>
|
|
15150
|
+
candidate = normalizedCandidates.find((file4) => existsSync24(file4) && file4.endsWith(`${sep3}${jsName}`));
|
|
15145
15151
|
}
|
|
15146
15152
|
if (!candidate) {
|
|
15147
|
-
candidate = normalizedCandidates.find((file4) =>
|
|
15153
|
+
candidate = normalizedCandidates.find((file4) => existsSync24(file4));
|
|
15148
15154
|
}
|
|
15149
15155
|
return candidate;
|
|
15150
15156
|
};
|
|
@@ -15152,11 +15158,11 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
15152
15158
|
if (!rawServerFile) {
|
|
15153
15159
|
rawServerFile = await traceAngularPhase("wrapper/resolve-server-output-fallback", () => resolveRawServerFile([]), { entry: resolvedEntry });
|
|
15154
15160
|
}
|
|
15155
|
-
if (rawServerFile && !
|
|
15161
|
+
if (rawServerFile && !existsSync24(rawServerFile)) {
|
|
15156
15162
|
outputs = hmr ? await compileEntry() : aotOutputs;
|
|
15157
15163
|
rawServerFile = await traceAngularPhase("wrapper/resolve-server-output-retry", () => resolveRawServerFile(outputs), { entry: resolvedEntry });
|
|
15158
15164
|
}
|
|
15159
|
-
if (!rawServerFile || !
|
|
15165
|
+
if (!rawServerFile || !existsSync24(rawServerFile)) {
|
|
15160
15166
|
throw new Error(`Compiled output not found for ${entry}. Looking for: ${jsName}. Available: ${[
|
|
15161
15167
|
...outputs,
|
|
15162
15168
|
...compiledFallbackPaths
|
|
@@ -15179,7 +15185,7 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
15179
15185
|
const providersHashInput = providersInjection ? (() => {
|
|
15180
15186
|
let providersSourceContent = "";
|
|
15181
15187
|
try {
|
|
15182
|
-
providersSourceContent =
|
|
15188
|
+
providersSourceContent = readFileSync21(providersInjection.appProvidersSource, "utf-8");
|
|
15183
15189
|
} catch {}
|
|
15184
15190
|
return JSON.stringify({
|
|
15185
15191
|
basePath: pageInjectionForHash?.basePath ?? null,
|
|
@@ -15190,7 +15196,7 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
15190
15196
|
const serverContentHash = `${Bun.hash(original).toString(BASE_36_RADIX)}.${Bun.hash(providersHashInput).toString(BASE_36_RADIX)}`;
|
|
15191
15197
|
const cachedWrapper = wrapperOutputCache.get(resolvedEntry);
|
|
15192
15198
|
const clientFile = join29(indexesDir, jsName);
|
|
15193
|
-
if (hmr && cachedWrapper && cachedWrapper.serverHash === serverContentHash &&
|
|
15199
|
+
if (hmr && cachedWrapper && cachedWrapper.serverHash === serverContentHash && existsSync24(clientFile) && (usesLegacyAnimations || !original.includes("__ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__")) && (!usesLegacyAnimations || original.includes("__ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__"))) {
|
|
15194
15200
|
return {
|
|
15195
15201
|
clientPath: clientFile,
|
|
15196
15202
|
indexUnchanged: true,
|
|
@@ -16167,7 +16173,7 @@ __export(exports_fastHmrCompiler, {
|
|
|
16167
16173
|
primeComponentFingerprint: () => primeComponentFingerprint,
|
|
16168
16174
|
invalidateFingerprintCache: () => invalidateFingerprintCache
|
|
16169
16175
|
});
|
|
16170
|
-
import { existsSync as
|
|
16176
|
+
import { existsSync as existsSync25, readFileSync as readFileSync22, statSync as statSync2 } from "fs";
|
|
16171
16177
|
import { dirname as dirname17, extname as extname6, relative as relative12, resolve as resolve25 } from "path";
|
|
16172
16178
|
import ts14 from "typescript";
|
|
16173
16179
|
var fail = (reason, detail, location) => ({
|
|
@@ -16480,11 +16486,11 @@ var fail = (reason, detail, location) => ({
|
|
|
16480
16486
|
`${base}/index.tsx`
|
|
16481
16487
|
];
|
|
16482
16488
|
for (const candidate of candidates) {
|
|
16483
|
-
if (!
|
|
16489
|
+
if (!existsSync25(candidate))
|
|
16484
16490
|
continue;
|
|
16485
16491
|
let content;
|
|
16486
16492
|
try {
|
|
16487
|
-
content =
|
|
16493
|
+
content = readFileSync22(candidate, "utf-8");
|
|
16488
16494
|
} catch {
|
|
16489
16495
|
continue;
|
|
16490
16496
|
}
|
|
@@ -17063,7 +17069,7 @@ var fail = (reason, detail, location) => ({
|
|
|
17063
17069
|
return cached.info;
|
|
17064
17070
|
let source;
|
|
17065
17071
|
try {
|
|
17066
|
-
source =
|
|
17072
|
+
source = readFileSync22(filePath, "utf-8");
|
|
17067
17073
|
} catch {
|
|
17068
17074
|
childComponentInfoCache.set(cacheKey2, {
|
|
17069
17075
|
info: null,
|
|
@@ -17117,7 +17123,7 @@ var fail = (reason, detail, location) => ({
|
|
|
17117
17123
|
return cached.info;
|
|
17118
17124
|
let content;
|
|
17119
17125
|
try {
|
|
17120
|
-
content =
|
|
17126
|
+
content = readFileSync22(dtsPath, "utf-8");
|
|
17121
17127
|
} catch {
|
|
17122
17128
|
childComponentInfoCache.set(cacheKey2, {
|
|
17123
17129
|
info: null,
|
|
@@ -17233,11 +17239,11 @@ var fail = (reason, detail, location) => ({
|
|
|
17233
17239
|
if (visited.has(startDtsPath))
|
|
17234
17240
|
return null;
|
|
17235
17241
|
visited.add(startDtsPath);
|
|
17236
|
-
if (!
|
|
17242
|
+
if (!existsSync25(startDtsPath))
|
|
17237
17243
|
return null;
|
|
17238
17244
|
let content;
|
|
17239
17245
|
try {
|
|
17240
|
-
content =
|
|
17246
|
+
content = readFileSync22(startDtsPath, "utf-8");
|
|
17241
17247
|
} catch {
|
|
17242
17248
|
return null;
|
|
17243
17249
|
}
|
|
@@ -17286,16 +17292,16 @@ var fail = (reason, detail, location) => ({
|
|
|
17286
17292
|
`${base}/index.d.cts`
|
|
17287
17293
|
];
|
|
17288
17294
|
for (const c of candidates) {
|
|
17289
|
-
if (
|
|
17295
|
+
if (existsSync25(c))
|
|
17290
17296
|
return c;
|
|
17291
17297
|
}
|
|
17292
17298
|
return null;
|
|
17293
17299
|
}, findPackageDtsForJs = (jsPath) => {
|
|
17294
17300
|
const sibling = jsPath.replace(/\.[mc]?js$/, ".d.ts");
|
|
17295
|
-
if (
|
|
17301
|
+
if (existsSync25(sibling))
|
|
17296
17302
|
return sibling;
|
|
17297
17303
|
const mirror = jsPath.replace(/\/dist\//, "/dist/src/").replace(/\.[mc]?js$/, ".d.ts");
|
|
17298
|
-
if (
|
|
17304
|
+
if (existsSync25(mirror))
|
|
17299
17305
|
return mirror;
|
|
17300
17306
|
return null;
|
|
17301
17307
|
}, resolveChildComponentInfo = (className, spec, componentDir, projectRoot) => {
|
|
@@ -17308,7 +17314,7 @@ var fail = (reason, detail, location) => ({
|
|
|
17308
17314
|
`${base}/index.tsx`
|
|
17309
17315
|
];
|
|
17310
17316
|
for (const candidate of candidates) {
|
|
17311
|
-
if (!
|
|
17317
|
+
if (!existsSync25(candidate))
|
|
17312
17318
|
continue;
|
|
17313
17319
|
const info = getChildComponentInfoFromTsSource(candidate, className);
|
|
17314
17320
|
if (info)
|
|
@@ -17455,7 +17461,7 @@ var fail = (reason, detail, location) => ({
|
|
|
17455
17461
|
return cached.hasProviders;
|
|
17456
17462
|
let source;
|
|
17457
17463
|
try {
|
|
17458
|
-
source =
|
|
17464
|
+
source = readFileSync22(filePath, "utf8");
|
|
17459
17465
|
} catch {
|
|
17460
17466
|
return true;
|
|
17461
17467
|
}
|
|
@@ -17522,11 +17528,11 @@ var fail = (reason, detail, location) => ({
|
|
|
17522
17528
|
const resolved = resolve25(componentDir, spec);
|
|
17523
17529
|
for (const ext of TS_EXTENSIONS) {
|
|
17524
17530
|
const candidate = resolved + ext;
|
|
17525
|
-
if (
|
|
17531
|
+
if (existsSync25(candidate))
|
|
17526
17532
|
return candidate;
|
|
17527
17533
|
}
|
|
17528
17534
|
const indexCandidate = resolve25(resolved, "index.ts");
|
|
17529
|
-
if (
|
|
17535
|
+
if (existsSync25(indexCandidate))
|
|
17530
17536
|
return indexCandidate;
|
|
17531
17537
|
}
|
|
17532
17538
|
return null;
|
|
@@ -17759,11 +17765,11 @@ ${transpiled}
|
|
|
17759
17765
|
}${staticPatch}`;
|
|
17760
17766
|
}, STYLE_PREPROCESSED_EXT, resolveAndReadStyleResource = (componentDir, url) => {
|
|
17761
17767
|
const abs = resolve25(componentDir, url);
|
|
17762
|
-
if (!
|
|
17768
|
+
if (!existsSync25(abs))
|
|
17763
17769
|
return null;
|
|
17764
17770
|
const ext = extname6(abs).toLowerCase();
|
|
17765
17771
|
if (!STYLE_PREPROCESSED_EXT.has(ext) || ext === ".css") {
|
|
17766
|
-
return
|
|
17772
|
+
return readFileSync22(abs, "utf8");
|
|
17767
17773
|
}
|
|
17768
17774
|
try {
|
|
17769
17775
|
const { compileStyleFileIfNeededSync: compileStyleFileIfNeededSync2 } = (init_stylePreprocessor(), __toCommonJS(exports_stylePreprocessor));
|
|
@@ -17800,9 +17806,9 @@ ${block}
|
|
|
17800
17806
|
return cached;
|
|
17801
17807
|
const tsconfigPath = resolve25(projectRoot, "tsconfig.json");
|
|
17802
17808
|
const opts = {};
|
|
17803
|
-
if (
|
|
17809
|
+
if (existsSync25(tsconfigPath)) {
|
|
17804
17810
|
try {
|
|
17805
|
-
const text =
|
|
17811
|
+
const text = readFileSync22(tsconfigPath, "utf8");
|
|
17806
17812
|
const parsed = ts14.parseConfigFileTextToJson(tsconfigPath, text);
|
|
17807
17813
|
if (!parsed.error && parsed.config) {
|
|
17808
17814
|
const cfg = parsed.config;
|
|
@@ -17827,7 +17833,7 @@ ${block}
|
|
|
17827
17833
|
}, tryFastHmr = async (params) => {
|
|
17828
17834
|
const { componentFilePath, className } = params;
|
|
17829
17835
|
const projectRoot = params.projectRoot ?? process.cwd();
|
|
17830
|
-
if (!
|
|
17836
|
+
if (!existsSync25(componentFilePath)) {
|
|
17831
17837
|
return fail("file-not-found", componentFilePath);
|
|
17832
17838
|
}
|
|
17833
17839
|
let compiler;
|
|
@@ -17836,7 +17842,7 @@ ${block}
|
|
|
17836
17842
|
} catch (err) {
|
|
17837
17843
|
return fail("unexpected-error", `import @angular/compiler: ${err}`);
|
|
17838
17844
|
}
|
|
17839
|
-
const tsSource =
|
|
17845
|
+
const tsSource = readFileSync22(componentFilePath, "utf8");
|
|
17840
17846
|
const sourceFile = ts14.createSourceFile(componentFilePath, tsSource, ts14.ScriptTarget.ES2022, true, ts14.ScriptKind.TS);
|
|
17841
17847
|
const classNode = findClassDeclaration(sourceFile, className);
|
|
17842
17848
|
if (!classNode) {
|
|
@@ -17883,10 +17889,10 @@ ${block}
|
|
|
17883
17889
|
templatePath = componentFilePath;
|
|
17884
17890
|
} else if (decoratorMeta.templateUrl) {
|
|
17885
17891
|
const tplAbs = resolve25(componentDir, decoratorMeta.templateUrl);
|
|
17886
|
-
if (!
|
|
17892
|
+
if (!existsSync25(tplAbs)) {
|
|
17887
17893
|
return fail("template-resource-not-found", `Template file not found: ${tplAbs}`, { file: componentFilePath });
|
|
17888
17894
|
}
|
|
17889
|
-
templateText =
|
|
17895
|
+
templateText = readFileSync22(tplAbs, "utf8");
|
|
17890
17896
|
templatePath = tplAbs;
|
|
17891
17897
|
} else {
|
|
17892
17898
|
return fail("unsupported-decorator-args", "missing template/templateUrl");
|
|
@@ -18643,7 +18649,7 @@ __export(exports_compileEmber, {
|
|
|
18643
18649
|
clearEmberCompilerCache: () => clearEmberCompilerCache,
|
|
18644
18650
|
basename: () => basename10
|
|
18645
18651
|
});
|
|
18646
|
-
import { existsSync as
|
|
18652
|
+
import { existsSync as existsSync26 } from "fs";
|
|
18647
18653
|
import { mkdir as mkdir6, rm as rm4 } from "fs/promises";
|
|
18648
18654
|
import { basename as basename10, dirname as dirname18, extname as extname7, join as join30, resolve as resolve26 } from "path";
|
|
18649
18655
|
var {build: bunBuild2, Transpiler: Transpiler4, write: write4, file: file4 } = globalThis.Bun;
|
|
@@ -18745,7 +18751,7 @@ export const importSync = (specifier) => {
|
|
|
18745
18751
|
const extensionsToTry = ["", ".gts", ".gjs", ".ts", ".js"];
|
|
18746
18752
|
for (const ext of extensionsToTry) {
|
|
18747
18753
|
const candidate = candidateBase + ext;
|
|
18748
|
-
if (
|
|
18754
|
+
if (existsSync26(candidate))
|
|
18749
18755
|
return { path: candidate };
|
|
18750
18756
|
}
|
|
18751
18757
|
return;
|
|
@@ -18765,7 +18771,7 @@ export const importSync = (specifier) => {
|
|
|
18765
18771
|
if (standalonePackages.has(args.path))
|
|
18766
18772
|
return;
|
|
18767
18773
|
const internal = join30(cwd, "node_modules/ember-source/dist/packages", args.path, "index.js");
|
|
18768
|
-
if (
|
|
18774
|
+
if (existsSync26(internal))
|
|
18769
18775
|
return { path: internal };
|
|
18770
18776
|
return;
|
|
18771
18777
|
});
|
|
@@ -18895,7 +18901,7 @@ __export(exports_buildReactVendor, {
|
|
|
18895
18901
|
computeVendorPaths: () => computeVendorPaths,
|
|
18896
18902
|
buildReactVendor: () => buildReactVendor
|
|
18897
18903
|
});
|
|
18898
|
-
import { existsSync as
|
|
18904
|
+
import { existsSync as existsSync27, mkdirSync as mkdirSync8 } from "fs";
|
|
18899
18905
|
import { join as join31, resolve as resolve27 } from "path";
|
|
18900
18906
|
import { rm as rm5 } from "fs/promises";
|
|
18901
18907
|
var {build: bunBuild3 } = globalThis.Bun;
|
|
@@ -18909,7 +18915,7 @@ var resolveJsxDevRuntimeCompatPath = () => {
|
|
|
18909
18915
|
resolve27(import.meta.dir, "..", "..", "src", "react", "jsxDevRuntimeCompat.ts")
|
|
18910
18916
|
];
|
|
18911
18917
|
for (const candidate of candidates) {
|
|
18912
|
-
if (
|
|
18918
|
+
if (existsSync27(candidate)) {
|
|
18913
18919
|
return candidate.replace(/\\/g, "/");
|
|
18914
18920
|
}
|
|
18915
18921
|
}
|
|
@@ -19059,7 +19065,7 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
|
|
|
19059
19065
|
}
|
|
19060
19066
|
return { angular, transitiveRoots };
|
|
19061
19067
|
}, PARTIAL_DECL_MARKERS, containsPartialDeclarations = (source) => PARTIAL_DECL_MARKERS.some((marker) => source.includes(marker)), collectTransitiveAngularSpecs = async (roots, angularFound) => {
|
|
19062
|
-
const { readFileSync:
|
|
19068
|
+
const { readFileSync: readFileSync23 } = await import("fs");
|
|
19063
19069
|
const transpiler6 = new Bun.Transpiler({ loader: "js" });
|
|
19064
19070
|
const visited = new Set;
|
|
19065
19071
|
const frontier = [];
|
|
@@ -19080,7 +19086,7 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
|
|
|
19080
19086
|
}
|
|
19081
19087
|
let content;
|
|
19082
19088
|
try {
|
|
19083
|
-
content =
|
|
19089
|
+
content = readFileSync23(resolved, "utf-8");
|
|
19084
19090
|
} catch {
|
|
19085
19091
|
continue;
|
|
19086
19092
|
}
|
|
@@ -19285,11 +19291,11 @@ var vueSpecifiers, toSafeFileName3 = (specifier) => specifier.replace(/\//g, "_"
|
|
|
19285
19291
|
console.warn("\u26A0\uFE0F Vue vendor build had errors:", result.logs);
|
|
19286
19292
|
return;
|
|
19287
19293
|
}
|
|
19288
|
-
const { readFileSync:
|
|
19294
|
+
const { readFileSync: readFileSync23, writeFileSync: writeFileSync9, readdirSync: readdirSync5 } = await import("fs");
|
|
19289
19295
|
const files = readdirSync5(vendorDir).filter((f2) => f2.endsWith(".js"));
|
|
19290
19296
|
for (const file5 of files) {
|
|
19291
19297
|
const filePath = join33(vendorDir, file5);
|
|
19292
|
-
const content =
|
|
19298
|
+
const content = readFileSync23(filePath, "utf-8");
|
|
19293
19299
|
if (!content.includes("__VUE_HMR_RUNTIME__"))
|
|
19294
19300
|
continue;
|
|
19295
19301
|
const patched = content.replace(/getGlobalThis\(\)\.__VUE_HMR_RUNTIME__\s*=\s*\{/, "getGlobalThis().__VUE_HMR_RUNTIME__ = getGlobalThis().__VUE_HMR_RUNTIME__ || {");
|
|
@@ -19556,9 +19562,9 @@ var init_rewriteImportsPlugin = __esm(() => {
|
|
|
19556
19562
|
import {
|
|
19557
19563
|
copyFileSync as copyFileSync2,
|
|
19558
19564
|
cpSync,
|
|
19559
|
-
existsSync as
|
|
19565
|
+
existsSync as existsSync28,
|
|
19560
19566
|
mkdirSync as mkdirSync12,
|
|
19561
|
-
readFileSync as
|
|
19567
|
+
readFileSync as readFileSync23,
|
|
19562
19568
|
rmSync as rmSync2,
|
|
19563
19569
|
statSync as statSync3,
|
|
19564
19570
|
writeFileSync as writeFileSync9
|
|
@@ -19686,7 +19692,7 @@ var isDev2, isBuildTraceEnabled = () => {
|
|
|
19686
19692
|
addWorkerPathIfExists(file5, relPath, workerPaths);
|
|
19687
19693
|
}
|
|
19688
19694
|
}, collectWorkerPathsFromFile = (file5, patterns, workerPaths) => {
|
|
19689
|
-
const content =
|
|
19695
|
+
const content = readFileSync23(file5, "utf-8");
|
|
19690
19696
|
for (const pattern of patterns) {
|
|
19691
19697
|
collectWorkerPathsFromContent(content, pattern, file5, workerPaths);
|
|
19692
19698
|
}
|
|
@@ -19729,13 +19735,13 @@ var isDev2, isBuildTraceEnabled = () => {
|
|
|
19729
19735
|
copyVueDevIndexes(vueDir, vuePagesPath, vueEntries, devIndexDir);
|
|
19730
19736
|
}
|
|
19731
19737
|
}, copyReactDevIndexes = (reactIndexesPath, reactPagesPath, devIndexDir, readDir) => {
|
|
19732
|
-
if (!
|
|
19738
|
+
if (!existsSync28(reactIndexesPath)) {
|
|
19733
19739
|
return;
|
|
19734
19740
|
}
|
|
19735
19741
|
const indexFiles = readDir(reactIndexesPath).filter((file5) => file5.endsWith(".tsx"));
|
|
19736
19742
|
const pagesRel = relative13(process.cwd(), resolve28(reactPagesPath)).replace(/\\/g, "/");
|
|
19737
19743
|
for (const file5 of indexFiles) {
|
|
19738
|
-
let content =
|
|
19744
|
+
let content = readFileSync23(join36(reactIndexesPath, file5), "utf-8");
|
|
19739
19745
|
content = content.replace(/from\s*['"]([^'"]*\/pages\/([^'"]+))['"]/g, (_match, _fullPath, componentName) => `from '/@src/${pagesRel}/${componentName}'`);
|
|
19740
19746
|
writeFileSync9(join36(devIndexDir, file5), content);
|
|
19741
19747
|
}
|
|
@@ -19745,9 +19751,9 @@ var isDev2, isBuildTraceEnabled = () => {
|
|
|
19745
19751
|
for (const entry of sveltePageEntries) {
|
|
19746
19752
|
const name = basename11(entry).replace(/\.svelte(\.(ts|js))?$/, "");
|
|
19747
19753
|
const indexFile = join36(svelteIndexDir, "pages", `${name}.js`);
|
|
19748
|
-
if (!
|
|
19754
|
+
if (!existsSync28(indexFile))
|
|
19749
19755
|
continue;
|
|
19750
|
-
let content =
|
|
19756
|
+
let content = readFileSync23(indexFile, "utf-8");
|
|
19751
19757
|
const srcRel = relative13(process.cwd(), resolve28(entry)).replace(/\\/g, "/");
|
|
19752
19758
|
content = content.replace(/import\s+Component\s+from\s+['"]([^'"]+)['"]/, `import Component from "/@src/${srcRel}"`);
|
|
19753
19759
|
writeFileSync9(join36(devIndexDir, `${name}.svelte.js`), content);
|
|
@@ -19758,9 +19764,9 @@ var isDev2, isBuildTraceEnabled = () => {
|
|
|
19758
19764
|
for (const entry of vuePageEntries) {
|
|
19759
19765
|
const name = basename11(entry, ".vue");
|
|
19760
19766
|
const indexFile = join36(vueIndexDir, `${name}.js`);
|
|
19761
|
-
if (!
|
|
19767
|
+
if (!existsSync28(indexFile))
|
|
19762
19768
|
continue;
|
|
19763
|
-
let content =
|
|
19769
|
+
let content = readFileSync23(indexFile, "utf-8");
|
|
19764
19770
|
const srcRel = relative13(process.cwd(), resolve28(entry)).replace(/\\/g, "/");
|
|
19765
19771
|
content = content.replace(/import\s+Comp(?:\s*,\s*\*\s+as\s+\w+)?\s+from\s+['"]([^'"]+)['"]/, (match) => match.replace(/from\s+['"][^'"]+['"]/, `from "/@src/${srcRel}"`));
|
|
19766
19772
|
writeFileSync9(join36(devIndexDir, `${name}.vue.js`), content);
|
|
@@ -19811,7 +19817,7 @@ var isDev2, isBuildTraceEnabled = () => {
|
|
|
19811
19817
|
}
|
|
19812
19818
|
return result;
|
|
19813
19819
|
}, VUE_HMR_RUNTIME, injectVueComposableTracking = (outputPath, projectRoot) => {
|
|
19814
|
-
let content =
|
|
19820
|
+
let content = readFileSync23(outputPath, "utf-8");
|
|
19815
19821
|
const usePattern = /^var\s+(use[A-Z]\w*)\s*=/gm;
|
|
19816
19822
|
const useNames = [];
|
|
19817
19823
|
let match;
|
|
@@ -19861,7 +19867,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
19861
19867
|
}, rewriteUrlReferences = (outputPaths, urlFileMap) => {
|
|
19862
19868
|
const urlPattern = /new\s+URL\(\s*["'](\.\.?\/[^"']+)["']\s*,\s*import\.meta\.url\s*\)/g;
|
|
19863
19869
|
for (const outputPath of outputPaths) {
|
|
19864
|
-
let content =
|
|
19870
|
+
let content = readFileSync23(outputPath, "utf-8");
|
|
19865
19871
|
let changed = false;
|
|
19866
19872
|
content = content.replace(urlPattern, (_match, relPath) => {
|
|
19867
19873
|
const targetName = basename11(relPath);
|
|
@@ -20693,6 +20699,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
20693
20699
|
"svelte/*",
|
|
20694
20700
|
"vue",
|
|
20695
20701
|
"vue/*",
|
|
20702
|
+
"vue-demi",
|
|
20696
20703
|
"@vue/*",
|
|
20697
20704
|
"@angular/*",
|
|
20698
20705
|
...angularPartialDeclSpecs,
|
|
@@ -20988,7 +20995,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
20988
20995
|
const injectHMRIntoHTMLFile = (filePath, framework) => {
|
|
20989
20996
|
if (!hmrClientBundle)
|
|
20990
20997
|
return;
|
|
20991
|
-
let html =
|
|
20998
|
+
let html = readFileSync23(filePath, "utf-8");
|
|
20992
20999
|
if (html.includes("data-hmr-client"))
|
|
20993
21000
|
return;
|
|
20994
21001
|
const tag = `<script>window.__HMR_FRAMEWORK__="${framework}";</script><script data-hmr-client>${hmrClientBundle}</script>`;
|
|
@@ -21219,7 +21226,7 @@ var init_build = __esm(() => {
|
|
|
21219
21226
|
});
|
|
21220
21227
|
|
|
21221
21228
|
// src/build/buildEmberVendor.ts
|
|
21222
|
-
import { mkdirSync as mkdirSync13, existsSync as
|
|
21229
|
+
import { mkdirSync as mkdirSync13, existsSync as existsSync29 } from "fs";
|
|
21223
21230
|
import { join as join37 } from "path";
|
|
21224
21231
|
import { rm as rm9 } from "fs/promises";
|
|
21225
21232
|
var {build: bunBuild8 } = globalThis.Bun;
|
|
@@ -21273,7 +21280,7 @@ export const importSync = (specifier) => {
|
|
|
21273
21280
|
return { resolveTo: specifier, specifier };
|
|
21274
21281
|
}
|
|
21275
21282
|
const emberInternalPath = join37(cwd2, "node_modules/ember-source/dist/packages", specifier, "index.js");
|
|
21276
|
-
if (!
|
|
21283
|
+
if (!existsSync29(emberInternalPath)) {
|
|
21277
21284
|
throw new Error(`Ember vendor build: cannot find ${specifier} at ${emberInternalPath}. ` + `Is ember-source installed and at least 6.12?`);
|
|
21278
21285
|
}
|
|
21279
21286
|
return { resolveTo: emberInternalPath, specifier };
|
|
@@ -21305,7 +21312,7 @@ export const importSync = (specifier) => {
|
|
|
21305
21312
|
return;
|
|
21306
21313
|
}
|
|
21307
21314
|
const internal = join37(cwd2, "node_modules/ember-source/dist/packages", args.path, "index.js");
|
|
21308
|
-
if (
|
|
21315
|
+
if (existsSync29(internal)) {
|
|
21309
21316
|
return { path: internal };
|
|
21310
21317
|
}
|
|
21311
21318
|
return;
|
|
@@ -21374,7 +21381,7 @@ __export(exports_dependencyGraph, {
|
|
|
21374
21381
|
buildInitialDependencyGraph: () => buildInitialDependencyGraph,
|
|
21375
21382
|
addFileToGraph: () => addFileToGraph
|
|
21376
21383
|
});
|
|
21377
|
-
import { existsSync as
|
|
21384
|
+
import { existsSync as existsSync30, readFileSync as readFileSync24 } from "fs";
|
|
21378
21385
|
var {Glob: Glob9 } = globalThis.Bun;
|
|
21379
21386
|
import { resolve as resolve29 } from "path";
|
|
21380
21387
|
var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath) => {
|
|
@@ -21404,10 +21411,10 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
21404
21411
|
];
|
|
21405
21412
|
for (const ext of extensions) {
|
|
21406
21413
|
const withExt = normalized + ext;
|
|
21407
|
-
if (
|
|
21414
|
+
if (existsSync30(withExt))
|
|
21408
21415
|
return withExt;
|
|
21409
21416
|
}
|
|
21410
|
-
if (
|
|
21417
|
+
if (existsSync30(normalized))
|
|
21411
21418
|
return normalized;
|
|
21412
21419
|
return null;
|
|
21413
21420
|
}, clearExistingDependents = (graph, normalizedPath) => {
|
|
@@ -21422,7 +21429,7 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
21422
21429
|
}
|
|
21423
21430
|
}, addFileToGraph = (graph, filePath) => {
|
|
21424
21431
|
const normalizedPath = resolve29(filePath);
|
|
21425
|
-
if (!
|
|
21432
|
+
if (!existsSync30(normalizedPath))
|
|
21426
21433
|
return;
|
|
21427
21434
|
const dependencies = extractDependencies(normalizedPath);
|
|
21428
21435
|
clearExistingDependents(graph, normalizedPath);
|
|
@@ -21448,7 +21455,7 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
21448
21455
|
}, IGNORED_SEGMENTS, buildInitialDependencyGraph = (graph, directories) => {
|
|
21449
21456
|
const processedFiles = new Set;
|
|
21450
21457
|
const glob = new Glob9("**/*.{ts,tsx,js,jsx,vue,svelte,html,htm}");
|
|
21451
|
-
const resolvedDirs = directories.map((dir) => resolve29(dir)).filter((dir) =>
|
|
21458
|
+
const resolvedDirs = directories.map((dir) => resolve29(dir)).filter((dir) => existsSync30(dir));
|
|
21452
21459
|
const allFiles = resolvedDirs.flatMap((dir) => Array.from(glob.scanSync({ absolute: true, cwd: dir })));
|
|
21453
21460
|
for (const file5 of allFiles) {
|
|
21454
21461
|
const fullPath = resolve29(file5);
|
|
@@ -21545,15 +21552,15 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
21545
21552
|
const lowerPath = filePath.toLowerCase();
|
|
21546
21553
|
const isSvelteOrVue = lowerPath.endsWith(".svelte") || lowerPath.endsWith(".vue");
|
|
21547
21554
|
if (loader === "html") {
|
|
21548
|
-
const content =
|
|
21555
|
+
const content = readFileSync24(filePath, "utf-8");
|
|
21549
21556
|
return extractHtmlDependencies(filePath, content);
|
|
21550
21557
|
}
|
|
21551
21558
|
if (loader === "tsx" || loader === "js") {
|
|
21552
|
-
const content =
|
|
21559
|
+
const content = readFileSync24(filePath, "utf-8");
|
|
21553
21560
|
return extractJsDependencies(filePath, content, loader);
|
|
21554
21561
|
}
|
|
21555
21562
|
if (isSvelteOrVue) {
|
|
21556
|
-
const content =
|
|
21563
|
+
const content = readFileSync24(filePath, "utf-8");
|
|
21557
21564
|
return extractSvelteVueDependencies(filePath, content);
|
|
21558
21565
|
}
|
|
21559
21566
|
return [];
|
|
@@ -21696,7 +21703,7 @@ var init_clientManager = __esm(() => {
|
|
|
21696
21703
|
});
|
|
21697
21704
|
|
|
21698
21705
|
// src/dev/pathUtils.ts
|
|
21699
|
-
import { existsSync as
|
|
21706
|
+
import { existsSync as existsSync31, readdirSync as readdirSync5, readFileSync as readFileSync25 } from "fs";
|
|
21700
21707
|
import { dirname as dirname20, resolve as resolve31 } from "path";
|
|
21701
21708
|
var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
21702
21709
|
if (shouldIgnorePath(filePath, resolved)) {
|
|
@@ -21796,7 +21803,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
21796
21803
|
}
|
|
21797
21804
|
let source;
|
|
21798
21805
|
try {
|
|
21799
|
-
source =
|
|
21806
|
+
source = readFileSync25(full, "utf8");
|
|
21800
21807
|
} catch {
|
|
21801
21808
|
continue;
|
|
21802
21809
|
}
|
|
@@ -21870,7 +21877,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
21870
21877
|
push(cfg.stylesDir);
|
|
21871
21878
|
for (const candidate of ["src", "db", "assets", "styles"]) {
|
|
21872
21879
|
const abs = normalizePath(resolve31(cwd2, candidate));
|
|
21873
|
-
if (
|
|
21880
|
+
if (existsSync31(abs) && !roots.includes(abs))
|
|
21874
21881
|
roots.push(abs);
|
|
21875
21882
|
}
|
|
21876
21883
|
try {
|
|
@@ -21955,7 +21962,7 @@ var init_pathUtils = __esm(() => {
|
|
|
21955
21962
|
|
|
21956
21963
|
// src/dev/fileWatcher.ts
|
|
21957
21964
|
import { watch } from "fs";
|
|
21958
|
-
import { existsSync as
|
|
21965
|
+
import { existsSync as existsSync32, readdirSync as readdirSync6, statSync as statSync4 } from "fs";
|
|
21959
21966
|
import { dirname as dirname21, join as join38, resolve as resolve32 } from "path";
|
|
21960
21967
|
var safeRemoveFromGraph = (graph, fullPath) => {
|
|
21961
21968
|
try {
|
|
@@ -22023,12 +22030,12 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
22023
22030
|
if (shouldIgnorePath(fullPath, state.resolvedPaths)) {
|
|
22024
22031
|
return;
|
|
22025
22032
|
}
|
|
22026
|
-
if (event === "rename" && !
|
|
22033
|
+
if (event === "rename" && !existsSync32(fullPath)) {
|
|
22027
22034
|
safeRemoveFromGraph(state.dependencyGraph, fullPath);
|
|
22028
22035
|
onFileChange(fullPath);
|
|
22029
22036
|
return;
|
|
22030
22037
|
}
|
|
22031
|
-
if (
|
|
22038
|
+
if (existsSync32(fullPath)) {
|
|
22032
22039
|
onFileChange(fullPath);
|
|
22033
22040
|
safeAddToGraph(state.dependencyGraph, fullPath);
|
|
22034
22041
|
}
|
|
@@ -22038,7 +22045,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
22038
22045
|
const stylesDir = state.resolvedPaths?.stylesDir;
|
|
22039
22046
|
paths.forEach((path) => {
|
|
22040
22047
|
const absolutePath = resolve32(path).replace(/\\/g, "/");
|
|
22041
|
-
if (!
|
|
22048
|
+
if (!existsSync32(absolutePath)) {
|
|
22042
22049
|
return;
|
|
22043
22050
|
}
|
|
22044
22051
|
const isStylesDir = Boolean(stylesDir && absolutePath.startsWith(stylesDir));
|
|
@@ -22049,7 +22056,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
22049
22056
|
const stylesDir = state.resolvedPaths?.stylesDir;
|
|
22050
22057
|
watchPaths.forEach((path) => {
|
|
22051
22058
|
const absolutePath = resolve32(path).replace(/\\/g, "/");
|
|
22052
|
-
if (!
|
|
22059
|
+
if (!existsSync32(absolutePath)) {
|
|
22053
22060
|
return;
|
|
22054
22061
|
}
|
|
22055
22062
|
const isStylesDir = Boolean(stylesDir && absolutePath.startsWith(stylesDir));
|
|
@@ -22171,10 +22178,10 @@ var init_assetStore = __esm(() => {
|
|
|
22171
22178
|
});
|
|
22172
22179
|
|
|
22173
22180
|
// src/dev/fileHashTracker.ts
|
|
22174
|
-
import { readFileSync as
|
|
22181
|
+
import { readFileSync as readFileSync26 } from "fs";
|
|
22175
22182
|
var computeFileHash = (filePath) => {
|
|
22176
22183
|
try {
|
|
22177
|
-
const fileContent =
|
|
22184
|
+
const fileContent = readFileSync26(filePath);
|
|
22178
22185
|
return Number(Bun.hash(fileContent));
|
|
22179
22186
|
} catch {
|
|
22180
22187
|
return UNFOUND_INDEX;
|
|
@@ -22388,7 +22395,7 @@ __export(exports_resolveOwningComponents, {
|
|
|
22388
22395
|
resolveDescendantsOfParent: () => resolveDescendantsOfParent,
|
|
22389
22396
|
invalidateResourceIndex: () => invalidateResourceIndex
|
|
22390
22397
|
});
|
|
22391
|
-
import { readdirSync as readdirSync7, readFileSync as
|
|
22398
|
+
import { readdirSync as readdirSync7, readFileSync as readFileSync27, statSync as statSync5 } from "fs";
|
|
22392
22399
|
import { dirname as dirname22, extname as extname9, join as join39, resolve as resolve36 } from "path";
|
|
22393
22400
|
import ts15 from "typescript";
|
|
22394
22401
|
var ENTITY_DECORATORS, isAngularSourceFile = (file5) => file5.endsWith(".ts") || file5.endsWith(".tsx"), walkAngularSourceFiles = (root) => {
|
|
@@ -22448,7 +22455,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file5) => file5.endsWith(".ts") ||
|
|
|
22448
22455
|
}, parseDecoratedClasses = (filePath) => {
|
|
22449
22456
|
let source;
|
|
22450
22457
|
try {
|
|
22451
|
-
source =
|
|
22458
|
+
source = readFileSync27(filePath, "utf8");
|
|
22452
22459
|
} catch {
|
|
22453
22460
|
return [];
|
|
22454
22461
|
}
|
|
@@ -22538,7 +22545,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file5) => file5.endsWith(".ts") ||
|
|
|
22538
22545
|
}, indexByRoot, resolveParentClassFile = (parentName, childFilePath, angularRoot) => {
|
|
22539
22546
|
let source;
|
|
22540
22547
|
try {
|
|
22541
|
-
source =
|
|
22548
|
+
source = readFileSync27(childFilePath, "utf8");
|
|
22542
22549
|
} catch {
|
|
22543
22550
|
return null;
|
|
22544
22551
|
}
|
|
@@ -22776,7 +22783,7 @@ __export(exports_moduleServer, {
|
|
|
22776
22783
|
createModuleServer: () => createModuleServer,
|
|
22777
22784
|
SRC_URL_PREFIX: () => SRC_URL_PREFIX
|
|
22778
22785
|
});
|
|
22779
|
-
import { existsSync as
|
|
22786
|
+
import { existsSync as existsSync33, readFileSync as readFileSync28, realpathSync as realpathSync3, statSync as statSync6 } from "fs";
|
|
22780
22787
|
import { basename as basename13, dirname as dirname23, extname as extname10, join as join40, resolve as resolve37, relative as relative14 } from "path";
|
|
22781
22788
|
var SRC_PREFIX = "/@src/", jsTranspiler2, tsTranspiler2, tsxTranspiler, TRANSPILABLE, ALL_EXPORTS_RE, STRING_CONTENTS_RE, preserveTypeExports = (originalSource, transpiled, valueExports) => {
|
|
22782
22789
|
const codeOnly = originalSource.replace(STRING_CONTENTS_RE, '""');
|
|
@@ -22797,7 +22804,7 @@ var SRC_PREFIX = "/@src/", jsTranspiler2, tsTranspiler2, tsxTranspiler, TRANSPIL
|
|
|
22797
22804
|
${stubs}
|
|
22798
22805
|
`;
|
|
22799
22806
|
}, resolveRelativeExtension = (srcPath, projectRoot, extensions) => {
|
|
22800
|
-
const found = extensions.find((ext) =>
|
|
22807
|
+
const found = extensions.find((ext) => existsSync33(resolve37(projectRoot, srcPath + ext)));
|
|
22801
22808
|
return found ? srcPath + found : srcPath;
|
|
22802
22809
|
}, IMPORT_EXTENSIONS, SIDE_EFFECT_EXTENSIONS, MODULE_EXTENSIONS, RESOLVED_MODULE_EXTENSIONS, REACT_EXTENSIONS, escapeRegex3 = (str) => str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), buildImportRewriter = (vendorPaths) => {
|
|
22803
22810
|
const entries = Object.entries(vendorPaths).sort(([a], [b2]) => b2.length - a.length);
|
|
@@ -22850,12 +22857,12 @@ ${stubs}
|
|
|
22850
22857
|
if (!subpath) {
|
|
22851
22858
|
const pkgDir = resolve37(projectRoot, "node_modules", packageName ?? "");
|
|
22852
22859
|
const pkgJsonPath = join40(pkgDir, "package.json");
|
|
22853
|
-
if (
|
|
22854
|
-
const pkg = JSON.parse(
|
|
22860
|
+
if (existsSync33(pkgJsonPath)) {
|
|
22861
|
+
const pkg = JSON.parse(readFileSync28(pkgJsonPath, "utf-8"));
|
|
22855
22862
|
const esmEntry = typeof pkg.module === "string" && pkg.module || typeof pkg.browser === "string" && pkg.browser;
|
|
22856
22863
|
if (esmEntry) {
|
|
22857
22864
|
const resolved = resolve37(pkgDir, esmEntry);
|
|
22858
|
-
if (
|
|
22865
|
+
if (existsSync33(resolved))
|
|
22859
22866
|
return relative14(projectRoot, resolved);
|
|
22860
22867
|
}
|
|
22861
22868
|
}
|
|
@@ -22952,7 +22959,7 @@ ${code}`;
|
|
|
22952
22959
|
reactFastRefreshWarningEmitted = true;
|
|
22953
22960
|
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.");
|
|
22954
22961
|
}, transformReactFile = (filePath, projectRoot, rewriter) => {
|
|
22955
|
-
const raw =
|
|
22962
|
+
const raw = readFileSync28(filePath, "utf-8");
|
|
22956
22963
|
const valueExports = tsxTranspiler.scan(raw).exports;
|
|
22957
22964
|
let transpiled = reactTranspiler.transformSync(raw);
|
|
22958
22965
|
transpiled = preserveTypeExports(raw, transpiled, valueExports);
|
|
@@ -22968,7 +22975,7 @@ ${transpiled}`;
|
|
|
22968
22975
|
transpiled += buildIslandMetadataExports(raw);
|
|
22969
22976
|
return rewriteImports(transpiled, filePath, projectRoot, rewriter);
|
|
22970
22977
|
}, transformPlainFile = (filePath, projectRoot, rewriter, vueDir) => {
|
|
22971
|
-
const raw =
|
|
22978
|
+
const raw = readFileSync28(filePath, "utf-8");
|
|
22972
22979
|
const ext = extname10(filePath);
|
|
22973
22980
|
const isTS = ext === ".ts" || ext === ".tsx";
|
|
22974
22981
|
const isTSX = ext === ".tsx" || ext === ".jsx";
|
|
@@ -23134,7 +23141,7 @@ ${code}`;
|
|
|
23134
23141
|
` + ` var __hmr_accept = function(cb) { window.__SVELTE_HMR_ACCEPT__[${JSON.stringify(moduleUrl)}] = cb; };`);
|
|
23135
23142
|
return code.replace(/import\.meta\.hot\.accept\(/g, "__hmr_accept(");
|
|
23136
23143
|
}, transformSvelteFile = async (filePath, projectRoot, rewriter, stylePreprocessors) => {
|
|
23137
|
-
const raw =
|
|
23144
|
+
const raw = readFileSync28(filePath, "utf-8");
|
|
23138
23145
|
if (!svelteCompiler) {
|
|
23139
23146
|
svelteCompiler = await import("svelte/compiler");
|
|
23140
23147
|
}
|
|
@@ -23196,7 +23203,7 @@ export default __script__;`;
|
|
|
23196
23203
|
return `${cssInjection}
|
|
23197
23204
|
${code}`;
|
|
23198
23205
|
}, transformVueFile = async (filePath, projectRoot, rewriter, vueDir, stylePreprocessors) => {
|
|
23199
|
-
const rawSource =
|
|
23206
|
+
const rawSource = readFileSync28(filePath, "utf-8");
|
|
23200
23207
|
const raw = addAutoRouterSetupApp(rawSource);
|
|
23201
23208
|
if (!vueCompiler) {
|
|
23202
23209
|
vueCompiler = await import("@vue/compiler-sfc");
|
|
@@ -23206,6 +23213,11 @@ ${code}`;
|
|
|
23206
23213
|
const { descriptor } = vueCompiler.parse(raw, { filename: filePath });
|
|
23207
23214
|
const hasScript = descriptor.script || descriptor.scriptSetup;
|
|
23208
23215
|
const compiledScript = hasScript ? vueCompiler.compileScript(descriptor, {
|
|
23216
|
+
fs: {
|
|
23217
|
+
fileExists: existsSync33,
|
|
23218
|
+
readFile: (file5) => existsSync33(file5) ? readFileSync28(file5, "utf-8") : undefined,
|
|
23219
|
+
realpath: realpathSync3
|
|
23220
|
+
},
|
|
23209
23221
|
id: componentId,
|
|
23210
23222
|
inlineTemplate: false
|
|
23211
23223
|
}) : { bindings: {}, content: "export default {};" };
|
|
@@ -23234,11 +23246,11 @@ ${code}`;
|
|
|
23234
23246
|
`);
|
|
23235
23247
|
return result;
|
|
23236
23248
|
}, resolveSvelteModulePath = (path) => {
|
|
23237
|
-
if (
|
|
23249
|
+
if (existsSync33(path))
|
|
23238
23250
|
return path;
|
|
23239
|
-
if (
|
|
23251
|
+
if (existsSync33(`${path}.ts`))
|
|
23240
23252
|
return `${path}.ts`;
|
|
23241
|
-
if (
|
|
23253
|
+
if (existsSync33(`${path}.js`))
|
|
23242
23254
|
return `${path}.js`;
|
|
23243
23255
|
return path;
|
|
23244
23256
|
}, jsResponse = (body) => {
|
|
@@ -23251,7 +23263,7 @@ ${code}`;
|
|
|
23251
23263
|
}
|
|
23252
23264
|
});
|
|
23253
23265
|
}, handleCssRequest = (filePath) => {
|
|
23254
|
-
const raw =
|
|
23266
|
+
const raw = readFileSync28(filePath, "utf-8");
|
|
23255
23267
|
const escaped = raw.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$/g, "\\$");
|
|
23256
23268
|
return [
|
|
23257
23269
|
`const style = document.createElement('style');`,
|
|
@@ -23389,7 +23401,7 @@ export default {};
|
|
|
23389
23401
|
return { ext, filePath: resolveSvelteModulePath(filePath) };
|
|
23390
23402
|
if (ext)
|
|
23391
23403
|
return { ext, filePath };
|
|
23392
|
-
const found = MODULE_EXTENSIONS.find((candidate) =>
|
|
23404
|
+
const found = MODULE_EXTENSIONS.find((candidate) => existsSync33(filePath + candidate));
|
|
23393
23405
|
if (!found)
|
|
23394
23406
|
return { ext, filePath };
|
|
23395
23407
|
const resolved = filePath + found;
|
|
@@ -23909,7 +23921,7 @@ var handleHTMXUpdate = async (htmxFilePath) => {
|
|
|
23909
23921
|
var init_simpleHTMXHMR = () => {};
|
|
23910
23922
|
|
|
23911
23923
|
// src/dev/rebuildTrigger.ts
|
|
23912
|
-
import { existsSync as
|
|
23924
|
+
import { existsSync as existsSync34, rmSync as rmSync3 } from "fs";
|
|
23913
23925
|
import { basename as basename14, dirname as dirname25, join as join41, relative as relative16, resolve as resolve41, sep as sep4 } from "path";
|
|
23914
23926
|
var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequentially = (items, action) => items.reduce((chain, item) => chain.then(() => action(item)), Promise.resolve()), getStyleTransformConfig = (config) => createStyleTransformConfig(config.stylePreprocessors, config.postcss), recompileTailwindForFastPath = async (state, config, files) => {
|
|
23915
23927
|
if (!config.tailwind)
|
|
@@ -24009,7 +24021,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24009
24021
|
detectedFw = detected !== "ignored" ? detected : affectedFrameworks[0];
|
|
24010
24022
|
}
|
|
24011
24023
|
return { ...parsed, framework: detectedFw };
|
|
24012
|
-
}, isValidDeletedAffectedFile = (affectedFile, deletedPathResolved, processedFiles) => affectedFile !== deletedPathResolved && !processedFiles.has(affectedFile) &&
|
|
24024
|
+
}, isValidDeletedAffectedFile = (affectedFile, deletedPathResolved, processedFiles) => affectedFile !== deletedPathResolved && !processedFiles.has(affectedFile) && existsSync34(affectedFile), FRAMEWORK_DIR_KEYS_FOR_CLEANUP, removeStaleGenerated = (state, deletedFile) => {
|
|
24013
24025
|
const config = state.config;
|
|
24014
24026
|
const cwd2 = process.cwd();
|
|
24015
24027
|
const absDeleted = resolve41(deletedFile).replace(/\\/g, "/");
|
|
@@ -24055,7 +24067,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24055
24067
|
if (!dependents || dependents.size === 0) {
|
|
24056
24068
|
return;
|
|
24057
24069
|
}
|
|
24058
|
-
const dependentFiles = Array.from(dependents).filter((file5) =>
|
|
24070
|
+
const dependentFiles = Array.from(dependents).filter((file5) => existsSync34(file5));
|
|
24059
24071
|
if (dependentFiles.length === 0) {
|
|
24060
24072
|
return;
|
|
24061
24073
|
}
|
|
@@ -24071,7 +24083,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24071
24083
|
try {
|
|
24072
24084
|
const affectedFiles = getAffectedFiles(state.dependencyGraph, normalizedFilePath);
|
|
24073
24085
|
affectedFiles.forEach((affectedFile) => {
|
|
24074
|
-
if (!processedFiles.has(affectedFile) && affectedFile !== normalizedFilePath &&
|
|
24086
|
+
if (!processedFiles.has(affectedFile) && affectedFile !== normalizedFilePath && existsSync34(affectedFile)) {
|
|
24075
24087
|
validFiles.push(affectedFile);
|
|
24076
24088
|
processedFiles.add(affectedFile);
|
|
24077
24089
|
}
|
|
@@ -24096,7 +24108,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24096
24108
|
collectChangedFileAffected(state, normalizedFilePath, processedFiles, validFiles);
|
|
24097
24109
|
}, processFilePathSet = (state, filePathSet, processedFiles, validFiles) => {
|
|
24098
24110
|
filePathSet.forEach((filePathInSet) => {
|
|
24099
|
-
if (!
|
|
24111
|
+
if (!existsSync34(filePathInSet)) {
|
|
24100
24112
|
collectDeletedFileAffected(state, filePathInSet, processedFiles, validFiles);
|
|
24101
24113
|
return;
|
|
24102
24114
|
}
|
|
@@ -24350,7 +24362,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24350
24362
|
return componentFile;
|
|
24351
24363
|
}
|
|
24352
24364
|
const tsCounterpart = componentFile.replace(/\.html$/, ".ts");
|
|
24353
|
-
if (
|
|
24365
|
+
if (existsSync34(tsCounterpart)) {
|
|
24354
24366
|
return tsCounterpart;
|
|
24355
24367
|
}
|
|
24356
24368
|
if (!graph)
|
|
@@ -26410,7 +26422,7 @@ var toSafeFileName6 = (specifier) => {
|
|
|
26410
26422
|
framework: Array.from(framework).filter(isResolvable4)
|
|
26411
26423
|
};
|
|
26412
26424
|
}, collectTransitiveImports = async (specs, alreadyVendored, alreadyScanned) => {
|
|
26413
|
-
const { readFileSync:
|
|
26425
|
+
const { readFileSync: readFileSync29 } = await import("fs");
|
|
26414
26426
|
const transpiler6 = new Bun.Transpiler({ loader: "js" });
|
|
26415
26427
|
const newSpecs = new Set;
|
|
26416
26428
|
for (const spec of specs) {
|
|
@@ -26425,7 +26437,7 @@ var toSafeFileName6 = (specifier) => {
|
|
|
26425
26437
|
}
|
|
26426
26438
|
let content;
|
|
26427
26439
|
try {
|
|
26428
|
-
content =
|
|
26440
|
+
content = readFileSync29(resolved, "utf-8");
|
|
26429
26441
|
} catch {
|
|
26430
26442
|
continue;
|
|
26431
26443
|
}
|
|
@@ -27231,17 +27243,17 @@ __export(exports_devtoolsJson, {
|
|
|
27231
27243
|
normalizeDevtoolsWorkspaceRoot: () => normalizeDevtoolsWorkspaceRoot,
|
|
27232
27244
|
devtoolsJson: () => devtoolsJson
|
|
27233
27245
|
});
|
|
27234
|
-
import { existsSync as
|
|
27246
|
+
import { existsSync as existsSync35, mkdirSync as mkdirSync15, readFileSync as readFileSync29, writeFileSync as writeFileSync10 } from "fs";
|
|
27235
27247
|
import { dirname as dirname26, join as join43, resolve as resolve43 } from "path";
|
|
27236
27248
|
import { Elysia as Elysia3 } from "elysia";
|
|
27237
27249
|
var ENDPOINT = "/.well-known/appspecific/com.chrome.devtools.json", UUID_CACHE_KEY = "__absoluteDevtoolsWorkspaceUuid", getGlobalUuid = () => Reflect.get(globalThis, UUID_CACHE_KEY), setGlobalUuid = (uuid) => {
|
|
27238
27250
|
Reflect.set(globalThis, UUID_CACHE_KEY, uuid);
|
|
27239
27251
|
return uuid;
|
|
27240
27252
|
}, 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 ?? join43(buildDir, ".absolute", "chrome-devtools-workspace-uuid")), readCachedUuid = (cachePath) => {
|
|
27241
|
-
if (!
|
|
27253
|
+
if (!existsSync35(cachePath))
|
|
27242
27254
|
return null;
|
|
27243
27255
|
try {
|
|
27244
|
-
const value =
|
|
27256
|
+
const value = readFileSync29(cachePath, "utf-8").trim();
|
|
27245
27257
|
return isUuidV4(value) ? value : null;
|
|
27246
27258
|
} catch {
|
|
27247
27259
|
return null;
|
|
@@ -27291,13 +27303,13 @@ var exports_imageOptimizer = {};
|
|
|
27291
27303
|
__export(exports_imageOptimizer, {
|
|
27292
27304
|
imageOptimizer: () => imageOptimizer
|
|
27293
27305
|
});
|
|
27294
|
-
import { existsSync as
|
|
27306
|
+
import { existsSync as existsSync36 } from "fs";
|
|
27295
27307
|
import { resolve as resolve44 } from "path";
|
|
27296
27308
|
import { Elysia as Elysia4 } from "elysia";
|
|
27297
27309
|
var DEFAULT_CACHE_TTL_SECONDS = 60, MS_PER_SECOND = 1000, MAX_QUALITY = 100, avifInProgress, safeResolve = (path, baseDir) => {
|
|
27298
27310
|
try {
|
|
27299
27311
|
const resolved = validateSafePath(path, baseDir);
|
|
27300
|
-
if (
|
|
27312
|
+
if (existsSync36(resolved))
|
|
27301
27313
|
return resolved;
|
|
27302
27314
|
return null;
|
|
27303
27315
|
} catch {
|
|
@@ -27511,7 +27523,7 @@ __export(exports_prerender, {
|
|
|
27511
27523
|
prerender: () => prerender,
|
|
27512
27524
|
PRERENDER_BYPASS_HEADER: () => PRERENDER_BYPASS_HEADER
|
|
27513
27525
|
});
|
|
27514
|
-
import { mkdirSync as mkdirSync16, readFileSync as
|
|
27526
|
+
import { mkdirSync as mkdirSync16, readFileSync as readFileSync30 } from "fs";
|
|
27515
27527
|
import { join as join44 } from "path";
|
|
27516
27528
|
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) => {
|
|
27517
27529
|
const metaPath = htmlPath.replace(/\.html$/, ".meta");
|
|
@@ -27519,7 +27531,7 @@ var SERVER_OUTPUT_LIMIT = 4000, STARTUP_POLL_INTERVAL_MS = 100, DEFAULT_STARTUP_
|
|
|
27519
27531
|
}, readTimestamp = (htmlPath) => {
|
|
27520
27532
|
const metaPath = htmlPath.replace(/\.html$/, ".meta");
|
|
27521
27533
|
try {
|
|
27522
|
-
const content =
|
|
27534
|
+
const content = readFileSync30(metaPath, "utf-8");
|
|
27523
27535
|
return Number(content) || 0;
|
|
27524
27536
|
} catch {
|
|
27525
27537
|
return 0;
|
|
@@ -27710,14 +27722,14 @@ __export(exports_serverEntryWatcher, {
|
|
|
27710
27722
|
startServerEntryWatcher: () => startServerEntryWatcher,
|
|
27711
27723
|
isAtomicWriteTemp: () => isAtomicWriteTemp
|
|
27712
27724
|
});
|
|
27713
|
-
import { existsSync as
|
|
27725
|
+
import { existsSync as existsSync39, statSync as statSync8, watch as watch2 } from "fs";
|
|
27714
27726
|
import { createRequire as createRequire2 } from "module";
|
|
27715
27727
|
import { dirname as dirname27, join as join47, resolve as resolve46 } from "path";
|
|
27716
27728
|
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 = () => {
|
|
27717
27729
|
if (globalThis.__absoluteEntryWatcherStarted)
|
|
27718
27730
|
return;
|
|
27719
27731
|
const main = Bun.main;
|
|
27720
|
-
if (!main || !
|
|
27732
|
+
if (!main || !existsSync39(main))
|
|
27721
27733
|
return;
|
|
27722
27734
|
globalThis.__absoluteEntryWatcherStarted = true;
|
|
27723
27735
|
const entryPath = resolve46(main);
|
|
@@ -28370,7 +28382,7 @@ var handleHTMXPageRequest = async (pagePath) => {
|
|
|
28370
28382
|
};
|
|
28371
28383
|
// src/core/prepare.ts
|
|
28372
28384
|
init_loadConfig();
|
|
28373
|
-
import { existsSync as
|
|
28385
|
+
import { existsSync as existsSync37, readdirSync as readdirSync8, readFileSync as readFileSync31 } from "fs";
|
|
28374
28386
|
import { basename as basename15, join as join45, relative as relative17, resolve as resolve45 } from "path";
|
|
28375
28387
|
import { Elysia as Elysia5 } from "elysia";
|
|
28376
28388
|
|
|
@@ -28770,7 +28782,7 @@ var patchManifestIndexes = (manifest, devIndexDir, SRC_URL_PREFIX2) => {
|
|
|
28770
28782
|
if (!fileName)
|
|
28771
28783
|
continue;
|
|
28772
28784
|
const srcPath = resolve45(devIndexDir, fileName);
|
|
28773
|
-
if (!
|
|
28785
|
+
if (!existsSync37(srcPath))
|
|
28774
28786
|
continue;
|
|
28775
28787
|
const rel = relative17(process.cwd(), srcPath).replace(/\\/g, "/");
|
|
28776
28788
|
manifest[key] = `${SRC_URL_PREFIX2}${rel}`;
|
|
@@ -28878,7 +28890,7 @@ var prepareDev = async (config, buildDir) => {
|
|
|
28878
28890
|
};
|
|
28879
28891
|
var loadPrerenderMap = (prerenderDir) => {
|
|
28880
28892
|
const map = new Map;
|
|
28881
|
-
if (!
|
|
28893
|
+
if (!existsSync37(prerenderDir))
|
|
28882
28894
|
return map;
|
|
28883
28895
|
let entries;
|
|
28884
28896
|
try {
|
|
@@ -28943,7 +28955,7 @@ var prepare = async (configOrPath) => {
|
|
|
28943
28955
|
return result;
|
|
28944
28956
|
}
|
|
28945
28957
|
stepStartedAt = performance.now();
|
|
28946
|
-
const manifest = JSON.parse(
|
|
28958
|
+
const manifest = JSON.parse(readFileSync31(`${buildDir}/manifest.json`, "utf-8"));
|
|
28947
28959
|
setCurrentIslandManifest(manifest);
|
|
28948
28960
|
if (config.islands?.registry) {
|
|
28949
28961
|
setCurrentIslandRegistry(await loadIslandRegistry(config.islands.registry));
|
|
@@ -28952,8 +28964,8 @@ var prepare = async (configOrPath) => {
|
|
|
28952
28964
|
recordStep("load production manifest and island metadata", stepStartedAt);
|
|
28953
28965
|
stepStartedAt = performance.now();
|
|
28954
28966
|
const conventionsPath = join45(buildDir, "conventions.json");
|
|
28955
|
-
if (
|
|
28956
|
-
const conventions2 = JSON.parse(
|
|
28967
|
+
if (existsSync37(conventionsPath)) {
|
|
28968
|
+
const conventions2 = JSON.parse(readFileSync31(conventionsPath, "utf-8"));
|
|
28957
28969
|
setConventions(conventions2);
|
|
28958
28970
|
}
|
|
28959
28971
|
recordStep("load production conventions", stepStartedAt);
|
|
@@ -29025,7 +29037,7 @@ import { argv } from "process";
|
|
|
29025
29037
|
var {env: env4 } = globalThis.Bun;
|
|
29026
29038
|
|
|
29027
29039
|
// src/dev/devCert.ts
|
|
29028
|
-
import { existsSync as
|
|
29040
|
+
import { existsSync as existsSync38, mkdirSync as mkdirSync17, readFileSync as readFileSync32, rmSync as rmSync4 } from "fs";
|
|
29029
29041
|
import { join as join46 } from "path";
|
|
29030
29042
|
var CERT_DIR = join46(process.cwd(), ".absolutejs");
|
|
29031
29043
|
var CERT_PATH = join46(CERT_DIR, "cert.pem");
|
|
@@ -29033,10 +29045,10 @@ var KEY_PATH = join46(CERT_DIR, "key.pem");
|
|
|
29033
29045
|
var CERT_VALIDITY_DAYS = 365;
|
|
29034
29046
|
var devLog = (msg) => console.log(`\x1B[2m${new Date().toLocaleTimeString()}\x1B[0m \x1B[36m[dev]\x1B[0m ${msg}`);
|
|
29035
29047
|
var devWarn = (msg) => console.log(`\x1B[2m${new Date().toLocaleTimeString()}\x1B[0m \x1B[33m[dev]\x1B[0m \x1B[33m${msg}\x1B[0m`);
|
|
29036
|
-
var certFilesExist = () =>
|
|
29048
|
+
var certFilesExist = () => existsSync38(CERT_PATH) && existsSync38(KEY_PATH);
|
|
29037
29049
|
var isCertExpired = () => {
|
|
29038
29050
|
try {
|
|
29039
|
-
const certPem =
|
|
29051
|
+
const certPem = readFileSync32(CERT_PATH, "utf-8");
|
|
29040
29052
|
const proc = Bun.spawnSync(["openssl", "x509", "-enddate", "-noout"], {
|
|
29041
29053
|
stdin: new TextEncoder().encode(certPem)
|
|
29042
29054
|
});
|
|
@@ -29132,8 +29144,8 @@ var loadDevCert = () => {
|
|
|
29132
29144
|
return null;
|
|
29133
29145
|
try {
|
|
29134
29146
|
return {
|
|
29135
|
-
cert:
|
|
29136
|
-
key:
|
|
29147
|
+
cert: readFileSync32(paths.cert, "utf-8"),
|
|
29148
|
+
key: readFileSync32(paths.key, "utf-8")
|
|
29137
29149
|
};
|
|
29138
29150
|
} catch {
|
|
29139
29151
|
return null;
|
|
@@ -29408,7 +29420,7 @@ var generateHeadElement = ({
|
|
|
29408
29420
|
};
|
|
29409
29421
|
// src/utils/defineEnv.ts
|
|
29410
29422
|
var {env: bunEnv } = globalThis.Bun;
|
|
29411
|
-
import { existsSync as
|
|
29423
|
+
import { existsSync as existsSync40, readFileSync as readFileSync33 } from "fs";
|
|
29412
29424
|
import { resolve as resolve47 } from "path";
|
|
29413
29425
|
|
|
29414
29426
|
// node_modules/@sinclair/typebox/build/esm/type/guard/value.mjs
|
|
@@ -35445,18 +35457,18 @@ ${lines.join(`
|
|
|
35445
35457
|
var checkEnvFileSecurity = (properties) => {
|
|
35446
35458
|
const cwd2 = process.cwd();
|
|
35447
35459
|
const envPath = resolve47(cwd2, ".env");
|
|
35448
|
-
if (!
|
|
35460
|
+
if (!existsSync40(envPath))
|
|
35449
35461
|
return;
|
|
35450
35462
|
const sensitiveKeys = Object.keys(properties).filter(isSensitive);
|
|
35451
35463
|
if (sensitiveKeys.length === 0)
|
|
35452
35464
|
return;
|
|
35453
|
-
const envContent =
|
|
35465
|
+
const envContent = readFileSync33(envPath, "utf-8");
|
|
35454
35466
|
const presentKeys = sensitiveKeys.filter((key) => envContent.includes(`${key}=`));
|
|
35455
35467
|
if (presentKeys.length === 0)
|
|
35456
35468
|
return;
|
|
35457
35469
|
const gitignorePath = resolve47(cwd2, ".gitignore");
|
|
35458
|
-
if (
|
|
35459
|
-
const gitignore =
|
|
35470
|
+
if (existsSync40(gitignorePath)) {
|
|
35471
|
+
const gitignore = readFileSync33(gitignorePath, "utf-8");
|
|
35460
35472
|
if (gitignore.split(`
|
|
35461
35473
|
`).some((line) => line.trim() === ".env"))
|
|
35462
35474
|
return;
|
|
@@ -35697,5 +35709,5 @@ export {
|
|
|
35697
35709
|
ANGULAR_INIT_TIMEOUT_MS
|
|
35698
35710
|
};
|
|
35699
35711
|
|
|
35700
|
-
//# debugId=
|
|
35712
|
+
//# debugId=BC60D3ECCCBB925664756E2164756E21
|
|
35701
35713
|
//# sourceMappingURL=index.js.map
|