@absolutejs/absolute 0.20.0-beta.148 → 0.20.0-beta.149
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/changelog.json +10 -0
- package/dist/angular/components/core/streamingSlotRegistrar.js +1 -1
- package/dist/angular/components/core/streamingSlotRegistry.js +2 -2
- package/dist/build/buildWorker.js +23 -14
- package/dist/build.js +356 -346
- package/dist/build.js.map +6 -5
- package/dist/index.js +338 -328
- package/dist/index.js.map +6 -5
- package/dist/src/build/inlineCssImports.d.ts +1 -0
- package/package.json +1 -1
package/dist/build.js
CHANGED
|
@@ -18667,11 +18667,10 @@ var init_emitTsHelpers = __esm(() => {
|
|
|
18667
18667
|
transpiler4 = new Transpiler3({ loader: "ts", target: "browser" });
|
|
18668
18668
|
});
|
|
18669
18669
|
|
|
18670
|
-
// src/build/
|
|
18671
|
-
import {
|
|
18672
|
-
import { dirname as dirname20,
|
|
18673
|
-
var
|
|
18674
|
-
var transpiler5, inlineCssImports = (cssContent, cssFilePath, visited = new Set) => {
|
|
18670
|
+
// src/build/inlineCssImports.ts
|
|
18671
|
+
import { readFileSync as readFileSync24, realpathSync as realpathSync2 } from "fs";
|
|
18672
|
+
import { dirname as dirname20, resolve as resolve28 } from "path";
|
|
18673
|
+
var inlineCssImports = (cssContent, cssFilePath, visited = new Set) => {
|
|
18675
18674
|
const resolved = realpathSync2(cssFilePath);
|
|
18676
18675
|
if (visited.has(resolved))
|
|
18677
18676
|
return "";
|
|
@@ -18684,22 +18683,31 @@ var transpiler5, inlineCssImports = (cssContent, cssFilePath, visited = new Set)
|
|
|
18684
18683
|
const importedContent = readFileSync24(importedPath, "utf-8");
|
|
18685
18684
|
return inlineCssImports(importedContent, importedPath, visited);
|
|
18686
18685
|
});
|
|
18687
|
-
}
|
|
18686
|
+
};
|
|
18687
|
+
var init_inlineCssImports = __esm(() => {
|
|
18688
|
+
init_isFile();
|
|
18689
|
+
});
|
|
18690
|
+
|
|
18691
|
+
// src/build/compileVueSfc.ts
|
|
18692
|
+
import { existsSync as existsSync28, readFileSync as readFileSync25, realpathSync as realpathSync3 } from "fs";
|
|
18693
|
+
import { dirname as dirname21, relative as relative17, resolve as resolve29 } from "path";
|
|
18694
|
+
var {Transpiler: Transpiler4 } = globalThis.Bun;
|
|
18695
|
+
var transpiler5, toJs = (filePath, sourceDir) => {
|
|
18688
18696
|
if (filePath.endsWith(".vue"))
|
|
18689
18697
|
return filePath.replace(/\.vue$/, ".js");
|
|
18690
18698
|
if (filePath.endsWith(".ts"))
|
|
18691
18699
|
return filePath.replace(/\.ts$/, ".js");
|
|
18692
18700
|
if (isStylePath(filePath)) {
|
|
18693
18701
|
if (sourceDir && (filePath.startsWith("./") || filePath.startsWith("../"))) {
|
|
18694
|
-
return
|
|
18702
|
+
return resolve29(sourceDir, filePath);
|
|
18695
18703
|
}
|
|
18696
18704
|
return filePath;
|
|
18697
18705
|
}
|
|
18698
18706
|
if (sourceDir && (filePath.startsWith("./") || filePath.startsWith("../"))) {
|
|
18699
|
-
const directTs =
|
|
18707
|
+
const directTs = resolve29(sourceDir, `${filePath}.ts`);
|
|
18700
18708
|
if (existsSync28(directTs))
|
|
18701
18709
|
return `${filePath}.js`;
|
|
18702
|
-
const indexedTs =
|
|
18710
|
+
const indexedTs = resolve29(sourceDir, filePath, "index.ts");
|
|
18703
18711
|
if (existsSync28(indexedTs))
|
|
18704
18712
|
return `${filePath}/index.js`;
|
|
18705
18713
|
}
|
|
@@ -18767,11 +18775,11 @@ const ${localName} = (source) => ${importedName}(
|
|
|
18767
18775
|
const compiledScript = hasScript ? compiler.compileScript(descriptor, {
|
|
18768
18776
|
fs: {
|
|
18769
18777
|
fileExists: isFile,
|
|
18770
|
-
realpath:
|
|
18778
|
+
realpath: realpathSync3,
|
|
18771
18779
|
readFile: (file) => {
|
|
18772
18780
|
if (!isFile(file))
|
|
18773
18781
|
return;
|
|
18774
|
-
const content =
|
|
18782
|
+
const content = readFileSync25(file, "utf-8");
|
|
18775
18783
|
typeDepHashes[file] = hashContent(content);
|
|
18776
18784
|
return content;
|
|
18777
18785
|
}
|
|
@@ -18784,10 +18792,10 @@ const ${localName} = (source) => ${importedName}(
|
|
|
18784
18792
|
for (const dep of typeDependencies) {
|
|
18785
18793
|
if (dep in typeDepHashes || !existsSync28(dep))
|
|
18786
18794
|
continue;
|
|
18787
|
-
typeDepHashes[dep] = hashContent(
|
|
18795
|
+
typeDepHashes[dep] = hashContent(readFileSync25(dep, "utf-8"));
|
|
18788
18796
|
}
|
|
18789
18797
|
const strippedScript = stripExports2(compiledScript.content);
|
|
18790
|
-
const sourceDir =
|
|
18798
|
+
const sourceDir = dirname21(sourceFilePath);
|
|
18791
18799
|
const transpiledScript = rewriteRelativeImports(transpiler5.transformSync(strippedScript), sourceDir);
|
|
18792
18800
|
const generateRenderFunction = (ssr) => {
|
|
18793
18801
|
const rendered = compiler.compileTemplate({
|
|
@@ -18842,7 +18850,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
18842
18850
|
let result = code;
|
|
18843
18851
|
for (const [bareImport, paths] of packageImportRewrites) {
|
|
18844
18852
|
const targetPath = mode === "server" ? paths.server : paths.client;
|
|
18845
|
-
let rel = relative17(
|
|
18853
|
+
let rel = relative17(dirname21(outputPath), targetPath).replace(/\\/g, "/");
|
|
18846
18854
|
if (!rel.startsWith("."))
|
|
18847
18855
|
rel = `./${rel}`;
|
|
18848
18856
|
result = result.replaceAll(bareImport, rel);
|
|
@@ -18877,6 +18885,7 @@ var init_compileVueSfc = __esm(() => {
|
|
|
18877
18885
|
init_isFile();
|
|
18878
18886
|
init_chainInlineSourcemaps();
|
|
18879
18887
|
init_stylePreprocessor();
|
|
18888
|
+
init_inlineCssImports();
|
|
18880
18889
|
init_vueCompileCache();
|
|
18881
18890
|
transpiler5 = new Transpiler4({ loader: "ts", target: "browser" });
|
|
18882
18891
|
});
|
|
@@ -18939,9 +18948,9 @@ var init_workerJobs = __esm(() => {
|
|
|
18939
18948
|
});
|
|
18940
18949
|
|
|
18941
18950
|
// src/build/workerPool.ts
|
|
18942
|
-
import { existsSync as existsSync29, readFileSync as
|
|
18951
|
+
import { existsSync as existsSync29, readFileSync as readFileSync26 } from "fs";
|
|
18943
18952
|
import { availableParallelism, freemem } from "os";
|
|
18944
|
-
import { dirname as
|
|
18953
|
+
import { dirname as dirname22, join as join38 } from "path";
|
|
18945
18954
|
import { pathToFileURL as pathToFileURL2 } from "url";
|
|
18946
18955
|
var MIN_WORKERS = 2, MAX_DEFAULT_WORKERS = 8, MAX_OVERRIDE_WORKERS = 64, WORKER_MEMORY_BUDGET_BYTES, DEFAULT_IDLE_TIMEOUT_MS = 2000, DEFAULT_MIN_BATCH = 4, PACKAGE_WALK_DEPTH = 6, PERCENT = 100, OWN_PACKAGE_NAME = "@absolutejs/absolute", parseWorkerOverride = (raw) => {
|
|
18947
18956
|
if (raw === undefined || raw.trim() === "")
|
|
@@ -18962,7 +18971,7 @@ var MIN_WORKERS = 2, MAX_DEFAULT_WORKERS = 8, MAX_OVERRIDE_WORKERS = 64, WORKER_
|
|
|
18962
18971
|
if (!existsSync29(packageFile))
|
|
18963
18972
|
return false;
|
|
18964
18973
|
try {
|
|
18965
|
-
const pkg = JSON.parse(
|
|
18974
|
+
const pkg = JSON.parse(readFileSync26(packageFile, "utf-8"));
|
|
18966
18975
|
return typeof pkg === "object" && pkg !== null && "name" in pkg && pkg.name === OWN_PACKAGE_NAME;
|
|
18967
18976
|
} catch {
|
|
18968
18977
|
return false;
|
|
@@ -18972,7 +18981,7 @@ var MIN_WORKERS = 2, MAX_DEFAULT_WORKERS = 8, MAX_OVERRIDE_WORKERS = 64, WORKER_
|
|
|
18972
18981
|
for (let depth = 0;depth < PACKAGE_WALK_DEPTH; depth++) {
|
|
18973
18982
|
if (isOwnPackageRoot(dir))
|
|
18974
18983
|
return dir;
|
|
18975
|
-
const parent =
|
|
18984
|
+
const parent = dirname22(dir);
|
|
18976
18985
|
if (parent === dir)
|
|
18977
18986
|
break;
|
|
18978
18987
|
dir = parent;
|
|
@@ -19268,23 +19277,23 @@ import { existsSync as existsSync30 } from "fs";
|
|
|
19268
19277
|
import { mkdir as mkdir9 } from "fs/promises";
|
|
19269
19278
|
import {
|
|
19270
19279
|
basename as basename14,
|
|
19271
|
-
dirname as
|
|
19280
|
+
dirname as dirname23,
|
|
19272
19281
|
isAbsolute as isAbsolute7,
|
|
19273
19282
|
join as join39,
|
|
19274
19283
|
relative as relative18,
|
|
19275
|
-
resolve as
|
|
19284
|
+
resolve as resolve30
|
|
19276
19285
|
} from "path";
|
|
19277
19286
|
var {file: file3, write: write4 } = globalThis.Bun;
|
|
19278
19287
|
var resolveDevClientDir3 = () => {
|
|
19279
19288
|
const projectRoot = process.cwd();
|
|
19280
|
-
const fromSource =
|
|
19289
|
+
const fromSource = resolve30(import.meta.dir, "../dev/client");
|
|
19281
19290
|
if (existsSync30(fromSource) && fromSource.startsWith(projectRoot)) {
|
|
19282
19291
|
return fromSource;
|
|
19283
19292
|
}
|
|
19284
|
-
const fromNodeModules =
|
|
19293
|
+
const fromNodeModules = resolve30(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client");
|
|
19285
19294
|
if (existsSync30(fromNodeModules))
|
|
19286
19295
|
return fromNodeModules;
|
|
19287
|
-
return
|
|
19296
|
+
return resolve30(import.meta.dir, "./dev/client");
|
|
19288
19297
|
}, devClientDir3, hmrClientPath4, scriptCache, scriptSetupCache, templateCache, styleCache, persistentBuildCache, vueSourceHashCache, vueHmrMetadata, detectVueChangeType = (filePath, descriptor) => {
|
|
19289
19298
|
const prevScript = scriptCache.get(filePath);
|
|
19290
19299
|
const prevScriptSetup = scriptSetupCache.get(filePath);
|
|
@@ -19325,11 +19334,11 @@ var resolveDevClientDir3 = () => {
|
|
|
19325
19334
|
return Array.from(new Set(found));
|
|
19326
19335
|
}, resolveHelperTsPath = (sourceDir, helper) => {
|
|
19327
19336
|
if (helper.endsWith(".ts"))
|
|
19328
|
-
return
|
|
19329
|
-
const direct =
|
|
19337
|
+
return resolve30(sourceDir, helper);
|
|
19338
|
+
const direct = resolve30(sourceDir, `${helper}.ts`);
|
|
19330
19339
|
if (existsSync30(direct))
|
|
19331
19340
|
return direct;
|
|
19332
|
-
const indexed =
|
|
19341
|
+
const indexed = resolve30(sourceDir, helper, "index.ts");
|
|
19333
19342
|
if (existsSync30(indexed))
|
|
19334
19343
|
return indexed;
|
|
19335
19344
|
return direct;
|
|
@@ -19356,7 +19365,7 @@ var resolveDevClientDir3 = () => {
|
|
|
19356
19365
|
if (!inline)
|
|
19357
19366
|
pool.warm("vue-sfc");
|
|
19358
19367
|
const runSfc = (input) => pool.run("vue-sfc", input, {
|
|
19359
|
-
affinity:
|
|
19368
|
+
affinity: dirname23(input.sourceFilePath),
|
|
19360
19369
|
inline
|
|
19361
19370
|
});
|
|
19362
19371
|
return runSfc;
|
|
@@ -19418,9 +19427,9 @@ var resolveDevClientDir3 = () => {
|
|
|
19418
19427
|
serverPath
|
|
19419
19428
|
}) => {
|
|
19420
19429
|
await Promise.all([
|
|
19421
|
-
mkdir9(
|
|
19422
|
-
mkdir9(
|
|
19423
|
-
...css ? [mkdir9(
|
|
19430
|
+
mkdir9(dirname23(clientPath), { recursive: true }),
|
|
19431
|
+
mkdir9(dirname23(serverPath), { recursive: true }),
|
|
19432
|
+
...css ? [mkdir9(dirname23(css.path), { recursive: true })] : []
|
|
19424
19433
|
]);
|
|
19425
19434
|
await Promise.all([
|
|
19426
19435
|
write4(clientPath, clientCode),
|
|
@@ -19489,12 +19498,12 @@ var resolveDevClientDir3 = () => {
|
|
|
19489
19498
|
const childComponentPaths = importPaths.filter((path) => path.startsWith(".") && path.endsWith(".vue"));
|
|
19490
19499
|
const packageComponentPaths = Array.from(resolvedPackageVueImports.entries());
|
|
19491
19500
|
const helperModulePaths = importPaths.filter((path) => path.startsWith(".") && !path.endsWith(".vue") && !isStylePath(path));
|
|
19492
|
-
const stylePathsImported = importPaths.filter((path) => (path.startsWith(".") || isAbsolute7(path)) && isStylePath(path)).map((path) => isAbsolute7(path) ? path :
|
|
19501
|
+
const stylePathsImported = importPaths.filter((path) => (path.startsWith(".") || isAbsolute7(path)) && isStylePath(path)).map((path) => isAbsolute7(path) ? path : resolve30(dirname23(sourceFilePath), path));
|
|
19493
19502
|
for (const stylePath of stylePathsImported) {
|
|
19494
19503
|
addStyleImporter(sourceFilePath, stylePath);
|
|
19495
19504
|
}
|
|
19496
19505
|
const childBuildResults = await Promise.all([
|
|
19497
|
-
...childComponentPaths.map((relativeChildPath) => compileVueFile(
|
|
19506
|
+
...childComponentPaths.map((relativeChildPath) => compileVueFile(resolve30(dirname23(sourceFilePath), relativeChildPath), outputDirs, cacheMap, false, vueRootDir, compiler, runSfc, stylePreprocessors)),
|
|
19498
19507
|
...packageComponentPaths.map(([, absolutePath]) => compileVueFile(absolutePath, outputDirs, cacheMap, false, vueRootDir, compiler, runSfc, stylePreprocessors))
|
|
19499
19508
|
]);
|
|
19500
19509
|
const cacheKeyStartedAt = performance.now();
|
|
@@ -19563,7 +19572,7 @@ var resolveDevClientDir3 = () => {
|
|
|
19563
19572
|
serverPath: serverOutputPath,
|
|
19564
19573
|
spaRoutes: spaRoutes.length > 0 ? spaRoutes : undefined,
|
|
19565
19574
|
tsHelperPaths: [
|
|
19566
|
-
...helperModulePaths.map((helper) => resolveHelperTsPath(
|
|
19575
|
+
...helperModulePaths.map((helper) => resolveHelperTsPath(dirname23(sourceFilePath), helper)),
|
|
19567
19576
|
...childBuildResults.flatMap((child) => child.tsHelperPaths)
|
|
19568
19577
|
]
|
|
19569
19578
|
};
|
|
@@ -19602,7 +19611,7 @@ var resolveDevClientDir3 = () => {
|
|
|
19602
19611
|
const buildCache = new Map;
|
|
19603
19612
|
const allTsHelperPaths = new Set;
|
|
19604
19613
|
const expandSpaRouteChildren = async (entries) => {
|
|
19605
|
-
const expanded = new Set(entries.map((entry) =>
|
|
19614
|
+
const expanded = new Set(entries.map((entry) => resolve30(entry)));
|
|
19606
19615
|
const queue = [...expanded];
|
|
19607
19616
|
while (queue.length > 0) {
|
|
19608
19617
|
const entryPath = queue.pop();
|
|
@@ -19619,7 +19628,7 @@ var resolveDevClientDir3 = () => {
|
|
|
19619
19628
|
});
|
|
19620
19629
|
const routes = parseVueSpaRoutes(descriptor.script?.content ?? "");
|
|
19621
19630
|
for (const { importPath } of routes) {
|
|
19622
|
-
const childPath =
|
|
19631
|
+
const childPath = resolve30(dirname23(entryPath), importPath);
|
|
19623
19632
|
if (expanded.has(childPath) || !existsSync30(childPath)) {
|
|
19624
19633
|
continue;
|
|
19625
19634
|
}
|
|
@@ -19634,7 +19643,7 @@ var resolveDevClientDir3 = () => {
|
|
|
19634
19643
|
vueCompileProfile.stageExpandMs = performance.now() - stageStartedAt;
|
|
19635
19644
|
stageStartedAt = performance.now();
|
|
19636
19645
|
const compiledPages = await Promise.all(expandedEntryPoints.map(async (entryPath) => {
|
|
19637
|
-
const resolvedEntryPath =
|
|
19646
|
+
const resolvedEntryPath = resolve30(entryPath);
|
|
19638
19647
|
const result = await compileVueFile(resolvedEntryPath, {
|
|
19639
19648
|
client: clientOutputDir,
|
|
19640
19649
|
css: cssOutputDir,
|
|
@@ -19654,14 +19663,14 @@ var resolveDevClientDir3 = () => {
|
|
|
19654
19663
|
const entryBaseName = basename14(entryPath, ".vue");
|
|
19655
19664
|
const indexOutputFile = join39(indexOutputDir, `${entryBaseName}.js`);
|
|
19656
19665
|
const clientOutputFile = result.clientPath;
|
|
19657
|
-
await mkdir9(
|
|
19666
|
+
await mkdir9(dirname23(indexOutputFile), { recursive: true });
|
|
19658
19667
|
const vueHmrImports = isDev ? [
|
|
19659
19668
|
`window.__HMR_FRAMEWORK__ = "vue";`,
|
|
19660
19669
|
`import "${hmrClientPath4}";`
|
|
19661
19670
|
] : [];
|
|
19662
19671
|
await write4(indexOutputFile, [
|
|
19663
19672
|
...vueHmrImports,
|
|
19664
|
-
`import Comp, * as PageModule from "${relative18(
|
|
19673
|
+
`import Comp, * as PageModule from "${relative18(dirname23(indexOutputFile), clientOutputFile).replace(/\\/g, "/")}";`,
|
|
19665
19674
|
'import { createSSRApp, createApp } from "vue";',
|
|
19666
19675
|
'import { prepareBrowserTranslationHydration } from "@absolutejs/absolute/vue";',
|
|
19667
19676
|
"",
|
|
@@ -19827,7 +19836,7 @@ var resolveDevClientDir3 = () => {
|
|
|
19827
19836
|
}));
|
|
19828
19837
|
vueCompileProfile.stagePagesMs = performance.now() - stageStartedAt;
|
|
19829
19838
|
stageStartedAt = performance.now();
|
|
19830
|
-
const helperDependencies = (tsPath, sourceCode) => extractImports(sourceCode).filter((dep) => dep.startsWith(".") && !isStylePath(dep) && !dep.endsWith(".vue")).map((dep) => resolveHelperTsPath(
|
|
19839
|
+
const helperDependencies = (tsPath, sourceCode) => extractImports(sourceCode).filter((dep) => dep.startsWith(".") && !isStylePath(dep) && !dep.endsWith(".vue")).map((dep) => resolveHelperTsPath(dirname23(tsPath), dep)).filter((resolved) => existsSync30(resolved) && !allTsHelperPaths.has(resolved));
|
|
19831
19840
|
const readHelperWave = (paths) => Promise.all(paths.map((tsPath) => file3(tsPath).text().then((sourceCode) => helperDependencies(tsPath, sourceCode)).catch(() => [])));
|
|
19832
19841
|
const expandHelpers = async (frontier) => {
|
|
19833
19842
|
if (frontier.length === 0)
|
|
@@ -20397,8 +20406,8 @@ __export(exports_compileAngular, {
|
|
|
20397
20406
|
compileAngularFileJIT: () => compileAngularFileJIT,
|
|
20398
20407
|
invalidateAngularJitCache: () => invalidateAngularJitCache
|
|
20399
20408
|
});
|
|
20400
|
-
import { existsSync as existsSync31, readFileSync as
|
|
20401
|
-
import { join as join40, basename as basename15, sep as sep5, dirname as
|
|
20409
|
+
import { existsSync as existsSync31, readFileSync as readFileSync27, promises as fs5 } from "fs";
|
|
20410
|
+
import { join as join40, basename as basename15, sep as sep5, dirname as dirname24, resolve as resolve31, relative as relative19 } from "path";
|
|
20402
20411
|
var {Glob: Glob6 } = globalThis.Bun;
|
|
20403
20412
|
import ts18 from "typescript";
|
|
20404
20413
|
var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) => {
|
|
@@ -20414,10 +20423,10 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
20414
20423
|
return tracePhase ? tracePhase(`compile/angular/${name}`, fn, metadata) : await fn();
|
|
20415
20424
|
}, readTsconfigPathAliases = () => {
|
|
20416
20425
|
try {
|
|
20417
|
-
const configPath =
|
|
20426
|
+
const configPath = resolve31(process.cwd(), "tsconfig.json");
|
|
20418
20427
|
const config = ts18.readConfigFile(configPath, ts18.sys.readFile).config;
|
|
20419
20428
|
const compilerOptions = config?.compilerOptions ?? {};
|
|
20420
|
-
const baseUrl =
|
|
20429
|
+
const baseUrl = resolve31(process.cwd(), compilerOptions.baseUrl ?? ".");
|
|
20421
20430
|
const aliases = Object.entries(compilerOptions.paths ?? {}).map(([pattern, replacements]) => ({ pattern, replacements }));
|
|
20422
20431
|
return { aliases, baseUrl };
|
|
20423
20432
|
} catch {
|
|
@@ -20437,7 +20446,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
20437
20446
|
const wildcardValue = exactMatch ? "" : specifier.slice(prefix.length, specifier.length - suffix.length);
|
|
20438
20447
|
for (const replacement of alias.replacements) {
|
|
20439
20448
|
const candidate = replacement.replace("*", wildcardValue);
|
|
20440
|
-
const resolved = resolveSourceFile(
|
|
20449
|
+
const resolved = resolveSourceFile(resolve31(baseUrl, candidate));
|
|
20441
20450
|
if (resolved)
|
|
20442
20451
|
return resolved;
|
|
20443
20452
|
}
|
|
@@ -20456,13 +20465,13 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
20456
20465
|
];
|
|
20457
20466
|
return candidates.find((file) => existsSync31(file));
|
|
20458
20467
|
}, createLegacyAngularAnimationUsageResolver = (rootDir) => {
|
|
20459
|
-
const baseDir =
|
|
20468
|
+
const baseDir = resolve31(rootDir);
|
|
20460
20469
|
const tsconfigAliases = readTsconfigPathAliases();
|
|
20461
20470
|
const transpiler = new Bun.Transpiler({ loader: "tsx" });
|
|
20462
20471
|
const scanCache = new Map;
|
|
20463
20472
|
const resolveLocalImport = (specifier, fromDir) => {
|
|
20464
20473
|
if (specifier.startsWith(".") || specifier.startsWith("/")) {
|
|
20465
|
-
return resolveSourceFile(
|
|
20474
|
+
return resolveSourceFile(resolve31(fromDir, specifier));
|
|
20466
20475
|
}
|
|
20467
20476
|
const aliased = matchTsconfigAlias(specifier, tsconfigAliases.aliases, tsconfigAliases.baseUrl, resolveSourceFile);
|
|
20468
20477
|
if (aliased)
|
|
@@ -20471,7 +20480,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
20471
20480
|
const resolved = Bun.resolveSync(specifier, fromDir);
|
|
20472
20481
|
if (resolved.includes("/node_modules/"))
|
|
20473
20482
|
return;
|
|
20474
|
-
const absolute =
|
|
20483
|
+
const absolute = resolve31(resolved);
|
|
20475
20484
|
if (!absolute.startsWith(baseDir))
|
|
20476
20485
|
return;
|
|
20477
20486
|
return resolveSourceFile(absolute);
|
|
@@ -20487,7 +20496,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
20487
20496
|
usesLegacyAnimations: false
|
|
20488
20497
|
});
|
|
20489
20498
|
}
|
|
20490
|
-
const resolved =
|
|
20499
|
+
const resolved = resolve31(actualPath);
|
|
20491
20500
|
const cached = scanCache.get(resolved);
|
|
20492
20501
|
if (cached)
|
|
20493
20502
|
return cached;
|
|
@@ -20516,7 +20525,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
20516
20525
|
const actualPath = resolveSourceFile(filePath);
|
|
20517
20526
|
if (!actualPath)
|
|
20518
20527
|
return false;
|
|
20519
|
-
const resolved =
|
|
20528
|
+
const resolved = resolve31(actualPath);
|
|
20520
20529
|
if (visited.has(resolved))
|
|
20521
20530
|
return false;
|
|
20522
20531
|
visited.add(resolved);
|
|
@@ -20524,7 +20533,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
20524
20533
|
if (scan.usesLegacyAnimations)
|
|
20525
20534
|
return true;
|
|
20526
20535
|
for (const specifier of scan.imports) {
|
|
20527
|
-
const importedPath = resolveLocalImport(specifier,
|
|
20536
|
+
const importedPath = resolveLocalImport(specifier, dirname24(resolved));
|
|
20528
20537
|
if (importedPath && await visit(importedPath, visited)) {
|
|
20529
20538
|
return true;
|
|
20530
20539
|
}
|
|
@@ -20534,14 +20543,14 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
20534
20543
|
return (entryPath) => visit(entryPath);
|
|
20535
20544
|
}, resolveDevClientDir4 = () => {
|
|
20536
20545
|
const projectRoot = process.cwd();
|
|
20537
|
-
const fromSource =
|
|
20546
|
+
const fromSource = resolve31(import.meta.dir, "../dev/client");
|
|
20538
20547
|
if (existsSync31(fromSource) && fromSource.startsWith(projectRoot)) {
|
|
20539
20548
|
return fromSource;
|
|
20540
20549
|
}
|
|
20541
|
-
const fromNodeModules =
|
|
20550
|
+
const fromNodeModules = resolve31(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client");
|
|
20542
20551
|
if (existsSync31(fromNodeModules))
|
|
20543
20552
|
return fromNodeModules;
|
|
20544
|
-
return
|
|
20553
|
+
return resolve31(import.meta.dir, "./dev/client");
|
|
20545
20554
|
}, devClientDir4, hmrClientPath5, formatDiagnosticMessage = (diagnostic) => {
|
|
20546
20555
|
try {
|
|
20547
20556
|
return ts18.flattenDiagnosticMessageText(diagnostic.messageText, `
|
|
@@ -20583,12 +20592,12 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
20583
20592
|
return `${path.replace(/\.ts$/, ".js")}${query}`;
|
|
20584
20593
|
if (hasJsLikeExtension(path))
|
|
20585
20594
|
return `${path}${query}`;
|
|
20586
|
-
const importerDir =
|
|
20587
|
-
const fileCandidate =
|
|
20595
|
+
const importerDir = dirname24(importerOutputPath);
|
|
20596
|
+
const fileCandidate = resolve31(importerDir, `${path}.js`);
|
|
20588
20597
|
if (outputFiles?.has(fileCandidate) || existsSync31(fileCandidate)) {
|
|
20589
20598
|
return `${path}.js${query}`;
|
|
20590
20599
|
}
|
|
20591
|
-
const indexCandidate =
|
|
20600
|
+
const indexCandidate = resolve31(importerDir, path, "index.js");
|
|
20592
20601
|
if (outputFiles?.has(indexCandidate) || existsSync31(indexCandidate)) {
|
|
20593
20602
|
return `${path}/index.js${query}`;
|
|
20594
20603
|
}
|
|
@@ -20616,7 +20625,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
20616
20625
|
}, resolveLocalTsImport = (fromFile, specifier) => {
|
|
20617
20626
|
if (!isRelativeModuleSpecifier(specifier))
|
|
20618
20627
|
return null;
|
|
20619
|
-
const basePath =
|
|
20628
|
+
const basePath = resolve31(dirname24(fromFile), specifier);
|
|
20620
20629
|
const candidates = /\.[cm]?[tj]sx?$/.test(basePath) ? [basePath] : [
|
|
20621
20630
|
`${basePath}.ts`,
|
|
20622
20631
|
`${basePath}.tsx`,
|
|
@@ -20627,7 +20636,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
20627
20636
|
join40(basePath, "index.mts"),
|
|
20628
20637
|
join40(basePath, "index.cts")
|
|
20629
20638
|
];
|
|
20630
|
-
return candidates.map((candidate) =>
|
|
20639
|
+
return candidates.map((candidate) => resolve31(candidate)).find((candidate) => existsSync31(candidate) && !candidate.endsWith(".d.ts")) ?? null;
|
|
20631
20640
|
}, readFileForAotTransform = async (fileName, readFile) => {
|
|
20632
20641
|
const hostSource = readFile?.(fileName);
|
|
20633
20642
|
if (typeof hostSource === "string")
|
|
@@ -20662,7 +20671,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
20662
20671
|
paths.push(join40(fileDir, urlMatch.replace(/['"]/g, "")));
|
|
20663
20672
|
}
|
|
20664
20673
|
}
|
|
20665
|
-
return paths.map((path) =>
|
|
20674
|
+
return paths.map((path) => resolve31(path));
|
|
20666
20675
|
}, readResourceCacheFile = async (cachePath) => {
|
|
20667
20676
|
try {
|
|
20668
20677
|
const entry = JSON.parse(await fs5.readFile(cachePath, "utf-8"));
|
|
@@ -20674,13 +20683,13 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
20674
20683
|
return null;
|
|
20675
20684
|
}
|
|
20676
20685
|
}, writeResourceCacheFile = async (cachePath, source) => {
|
|
20677
|
-
await fs5.mkdir(
|
|
20686
|
+
await fs5.mkdir(dirname24(cachePath), { recursive: true });
|
|
20678
20687
|
await writeTextFileAtomically(cachePath, JSON.stringify({
|
|
20679
20688
|
source,
|
|
20680
20689
|
version: 1
|
|
20681
20690
|
}));
|
|
20682
20691
|
}, resolveResourceTransformCachePath = async (filePath, source, stylePreprocessors) => {
|
|
20683
|
-
const resourcePaths = collectAngularResourcePaths(source,
|
|
20692
|
+
const resourcePaths = collectAngularResourcePaths(source, dirname24(filePath));
|
|
20684
20693
|
const resourceContents = await Promise.all(resourcePaths.map(async (resourcePath) => {
|
|
20685
20694
|
const content = await fs5.readFile(resourcePath, "utf-8");
|
|
20686
20695
|
return `${resourcePath}\x00${content}`;
|
|
@@ -20704,7 +20713,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
20704
20713
|
transformedFiles: 0
|
|
20705
20714
|
};
|
|
20706
20715
|
const transformFile = async (filePath) => {
|
|
20707
|
-
const resolvedPath =
|
|
20716
|
+
const resolvedPath = resolve31(filePath);
|
|
20708
20717
|
if (visited.has(resolvedPath))
|
|
20709
20718
|
return;
|
|
20710
20719
|
visited.add(resolvedPath);
|
|
@@ -20720,7 +20729,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
20720
20729
|
transformedSource = cached.source;
|
|
20721
20730
|
} else {
|
|
20722
20731
|
stats.cacheMisses += 1;
|
|
20723
|
-
const transformed = await inlineResources(source,
|
|
20732
|
+
const transformed = await inlineResources(source, dirname24(resolvedPath), stylePreprocessors);
|
|
20724
20733
|
transformedSource = transformed.source;
|
|
20725
20734
|
await writeResourceCacheFile(cachePath, transformedSource);
|
|
20726
20735
|
}
|
|
@@ -20739,18 +20748,18 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
20739
20748
|
return { stats, transformedSources };
|
|
20740
20749
|
}, compileAngularFiles = async (inputPaths, outDir, stylePreprocessors) => {
|
|
20741
20750
|
const islandMetadataByOutputPath = await traceAngularPhase("aot/island-metadata", () => new Map(inputPaths.map((inputPath) => {
|
|
20742
|
-
const outputPath =
|
|
20751
|
+
const outputPath = resolve31(join40(outDir, relative19(process.cwd(), resolve31(inputPath)).replace(/\.[cm]?[tj]sx?$/, ".js")));
|
|
20743
20752
|
return [
|
|
20744
20753
|
outputPath,
|
|
20745
|
-
buildIslandMetadataExports(
|
|
20754
|
+
buildIslandMetadataExports(readFileSync27(inputPath, "utf-8"))
|
|
20746
20755
|
];
|
|
20747
20756
|
})), { entries: inputPaths.length });
|
|
20748
20757
|
await traceAngularPhase("aot/preload-compiler", () => import("@angular/compiler"));
|
|
20749
20758
|
const { readConfiguration, performCompilation, EmitFlags } = await traceAngularPhase("aot/import-compiler-cli", () => import("@angular/compiler-cli"));
|
|
20750
20759
|
const tsLibDir = await traceAngularPhase("aot/resolve-typescript-lib", () => {
|
|
20751
20760
|
const tsPath = __require.resolve("typescript");
|
|
20752
|
-
const tsRootDir =
|
|
20753
|
-
return tsRootDir.endsWith("lib") ? tsRootDir :
|
|
20761
|
+
const tsRootDir = dirname24(tsPath);
|
|
20762
|
+
return tsRootDir.endsWith("lib") ? tsRootDir : resolve31(tsRootDir, "lib");
|
|
20754
20763
|
});
|
|
20755
20764
|
const config = await traceAngularPhase("aot/read-configuration", () => readConfiguration("./tsconfig.json"));
|
|
20756
20765
|
const options = {
|
|
@@ -20792,7 +20801,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
20792
20801
|
return originalGetSourceFile?.call(host, fileName, languageVersion, onError);
|
|
20793
20802
|
};
|
|
20794
20803
|
const emitted = {};
|
|
20795
|
-
const resolvedOutDir =
|
|
20804
|
+
const resolvedOutDir = resolve31(outDir);
|
|
20796
20805
|
host.writeFile = (fileName, text) => {
|
|
20797
20806
|
const relativePath = resolveRelativePath(fileName, resolvedOutDir, outDir);
|
|
20798
20807
|
emitted[relativePath] = text;
|
|
@@ -20814,12 +20823,12 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
20814
20823
|
if (!fileName.endsWith(".ts") || fileName.endsWith(".d.ts")) {
|
|
20815
20824
|
return source;
|
|
20816
20825
|
}
|
|
20817
|
-
const resolvedPath =
|
|
20826
|
+
const resolvedPath = resolve31(fileName);
|
|
20818
20827
|
return transformedSources.get(resolvedPath) ?? source;
|
|
20819
20828
|
};
|
|
20820
20829
|
const originalGetSourceFileForCompile = host.getSourceFile;
|
|
20821
20830
|
host.getSourceFile = (fileName, languageVersion, onError) => {
|
|
20822
|
-
const source = transformedSources.get(
|
|
20831
|
+
const source = transformedSources.get(resolve31(fileName));
|
|
20823
20832
|
if (source) {
|
|
20824
20833
|
return ts18.createSourceFile(fileName, source, languageVersion, true);
|
|
20825
20834
|
}
|
|
@@ -20843,7 +20852,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
20843
20852
|
content,
|
|
20844
20853
|
target: join40(outDir, fileName)
|
|
20845
20854
|
}));
|
|
20846
|
-
const outputFiles = new Set(rawEntries.map(({ target }) =>
|
|
20855
|
+
const outputFiles = new Set(rawEntries.map(({ target }) => resolve31(target)));
|
|
20847
20856
|
return rawEntries.map(({ content, target }) => {
|
|
20848
20857
|
let processedContent = content.replace(/from\s+(['"])(\.\.?\/[^'"]+)(\1)/g, (match, quote, path) => {
|
|
20849
20858
|
const rewritten = rewriteRelativeJsSpecifier(target, path, outputFiles);
|
|
@@ -20858,17 +20867,17 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
20858
20867
|
return cleaned ? `import { ${cleaned}, InternalInjectFlags } from '@angular/core'` : `import { InternalInjectFlags } from '@angular/core'`;
|
|
20859
20868
|
});
|
|
20860
20869
|
processedContent = processedContent.replace(/\b(?<!Internal)InjectFlags\b/g, "InternalInjectFlags");
|
|
20861
|
-
processedContent += islandMetadataByOutputPath.get(
|
|
20870
|
+
processedContent += islandMetadataByOutputPath.get(resolve31(target)) ?? "";
|
|
20862
20871
|
return { content: processedContent, target };
|
|
20863
20872
|
});
|
|
20864
20873
|
});
|
|
20865
20874
|
await traceAngularPhase("aot/write-output", () => Promise.all(entries.map(async ({ target, content }) => {
|
|
20866
|
-
await fs5.mkdir(
|
|
20875
|
+
await fs5.mkdir(dirname24(target), { recursive: true });
|
|
20867
20876
|
await writeTextFileAtomically(target, content);
|
|
20868
20877
|
})), { outputs: entries.length });
|
|
20869
20878
|
return await traceAngularPhase("aot/collect-output-paths", () => entries.map(({ target }) => target), { outputs: entries.length });
|
|
20870
20879
|
}, jitContentCache, invalidateAngularJitCache = (filePath) => {
|
|
20871
|
-
jitContentCache.delete(
|
|
20880
|
+
jitContentCache.delete(resolve31(filePath));
|
|
20872
20881
|
}, wrapperOutputCache, escapeTemplateContent = (content) => content.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$\{/g, "\\${"), findUncommentedMatch = (source, pattern) => {
|
|
20873
20882
|
const re = new RegExp(pattern.source, pattern.flags.includes("g") ? pattern.flags : pattern.flags + "g");
|
|
20874
20883
|
let match;
|
|
@@ -20881,7 +20890,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
20881
20890
|
}
|
|
20882
20891
|
return null;
|
|
20883
20892
|
}, resolveAngularDeferImportSpecifier = () => {
|
|
20884
|
-
const sourceEntry =
|
|
20893
|
+
const sourceEntry = resolve31(import.meta.dir, "../angular/components/index.ts");
|
|
20885
20894
|
if (existsSync31(sourceEntry)) {
|
|
20886
20895
|
return sourceEntry.replace(/\\/g, "/");
|
|
20887
20896
|
}
|
|
@@ -21053,7 +21062,7 @@ ${fields}
|
|
|
21053
21062
|
if (!existsSync31(templatePath)) {
|
|
21054
21063
|
throw new Error(`Unable to inline Angular templateUrl "${templateUrlMatch[1]}": file not found at ${templatePath}`);
|
|
21055
21064
|
}
|
|
21056
|
-
const templateRaw =
|
|
21065
|
+
const templateRaw = readFileSync27(templatePath, "utf-8");
|
|
21057
21066
|
const lowered = lowerAngularDeferSyntax(templateRaw);
|
|
21058
21067
|
const escaped = escapeTemplateContent(lowered.template);
|
|
21059
21068
|
const replacedSource = source.slice(0, templateUrlMatch.index) + `template: \`${escaped}\`` + source.slice(templateUrlMatch.index + templateUrlMatch[0].length);
|
|
@@ -21171,10 +21180,10 @@ ${fields}
|
|
|
21171
21180
|
return "";
|
|
21172
21181
|
}
|
|
21173
21182
|
}, compileAngularFileJIT = async (inputPath, outDir, rootDir, stylePreprocessors, cacheBuster) => {
|
|
21174
|
-
const entryPath =
|
|
21183
|
+
const entryPath = resolve31(inputPath);
|
|
21175
21184
|
const allOutputs = [];
|
|
21176
21185
|
const visited = new Set;
|
|
21177
|
-
const baseDir =
|
|
21186
|
+
const baseDir = resolve31(rootDir ?? process.cwd());
|
|
21178
21187
|
let usesLegacyAnimations = false;
|
|
21179
21188
|
const angularTranspiler = new Bun.Transpiler({
|
|
21180
21189
|
loader: "ts",
|
|
@@ -21202,7 +21211,7 @@ ${fields}
|
|
|
21202
21211
|
};
|
|
21203
21212
|
const resolveLocalImport = (specifier, fromDir) => {
|
|
21204
21213
|
if (specifier.startsWith(".") || specifier.startsWith("/")) {
|
|
21205
|
-
return resolveSourceFile(
|
|
21214
|
+
return resolveSourceFile(resolve31(fromDir, specifier));
|
|
21206
21215
|
}
|
|
21207
21216
|
const aliased = matchTsconfigAlias(specifier, tsconfigAliases.aliases, tsconfigAliases.baseUrl, resolveSourceFile);
|
|
21208
21217
|
if (aliased)
|
|
@@ -21211,7 +21220,7 @@ ${fields}
|
|
|
21211
21220
|
const resolved = Bun.resolveSync(specifier, fromDir);
|
|
21212
21221
|
if (resolved.includes("/node_modules/"))
|
|
21213
21222
|
return;
|
|
21214
|
-
const absolute =
|
|
21223
|
+
const absolute = resolve31(resolved);
|
|
21215
21224
|
if (!absolute.startsWith(baseDir))
|
|
21216
21225
|
return;
|
|
21217
21226
|
return resolveSourceFile(absolute);
|
|
@@ -21220,7 +21229,7 @@ ${fields}
|
|
|
21220
21229
|
}
|
|
21221
21230
|
};
|
|
21222
21231
|
const toOutputPath = (sourcePath) => {
|
|
21223
|
-
const inputDir =
|
|
21232
|
+
const inputDir = dirname24(sourcePath);
|
|
21224
21233
|
const fileBase = basename15(sourcePath).replace(/\.[cm]?[tj]sx?$/, ".js");
|
|
21225
21234
|
if (inputDir === outDir || inputDir.startsWith(`${outDir}${sep5}`)) {
|
|
21226
21235
|
return join40(inputDir, fileBase);
|
|
@@ -21263,18 +21272,18 @@ ${fields}
|
|
|
21263
21272
|
return `${prefix}${dots}`;
|
|
21264
21273
|
return `${prefix}../${dots}`;
|
|
21265
21274
|
});
|
|
21266
|
-
if (
|
|
21275
|
+
if (resolve31(actualPath) === entryPath) {
|
|
21267
21276
|
processedContent += buildIslandMetadataExports(sourceCode);
|
|
21268
21277
|
}
|
|
21269
21278
|
return processedContent;
|
|
21270
21279
|
};
|
|
21271
21280
|
const transpileFile = async (filePath) => {
|
|
21272
|
-
const resolved =
|
|
21281
|
+
const resolved = resolve31(filePath);
|
|
21273
21282
|
if (visited.has(resolved))
|
|
21274
21283
|
return;
|
|
21275
21284
|
visited.add(resolved);
|
|
21276
21285
|
if (resolved.endsWith(".json") && existsSync31(resolved)) {
|
|
21277
|
-
const inputDir =
|
|
21286
|
+
const inputDir = dirname24(resolved);
|
|
21278
21287
|
const relativeDir = inputDir.startsWith(baseDir) ? inputDir.substring(baseDir.length + 1) : inputDir;
|
|
21279
21288
|
const targetDir = join40(outDir, relativeDir);
|
|
21280
21289
|
const targetPath = join40(targetDir, basename15(resolved));
|
|
@@ -21289,12 +21298,12 @@ ${fields}
|
|
|
21289
21298
|
if (!existsSync31(actualPath))
|
|
21290
21299
|
return;
|
|
21291
21300
|
let sourceCode = await fs5.readFile(actualPath, "utf-8");
|
|
21292
|
-
const inlined = await inlineResources(sourceCode,
|
|
21293
|
-
sourceCode = inlineTemplateAndLowerDeferSync(inlined.source,
|
|
21294
|
-
const inputDir =
|
|
21301
|
+
const inlined = await inlineResources(sourceCode, dirname24(actualPath), stylePreprocessors);
|
|
21302
|
+
sourceCode = inlineTemplateAndLowerDeferSync(inlined.source, dirname24(actualPath)).source;
|
|
21303
|
+
const inputDir = dirname24(actualPath);
|
|
21295
21304
|
const fileBase = basename15(actualPath).replace(/\.[cm]?[tj]sx?$/, ".js");
|
|
21296
21305
|
const targetPath = toOutputPath(actualPath);
|
|
21297
|
-
const targetDir =
|
|
21306
|
+
const targetDir = dirname24(targetPath);
|
|
21298
21307
|
const relativeDir = relative19(outDir, targetDir).replace(/\\/g, "/");
|
|
21299
21308
|
const localImports = [];
|
|
21300
21309
|
const importRewrites = new Map;
|
|
@@ -21321,7 +21330,7 @@ ${fields}
|
|
|
21321
21330
|
importRewrites.set(specifier, relativeRewrite);
|
|
21322
21331
|
return resolved;
|
|
21323
21332
|
}).filter((path) => Boolean(path));
|
|
21324
|
-
const isEntry =
|
|
21333
|
+
const isEntry = resolve31(actualPath) === resolve31(entryPath);
|
|
21325
21334
|
const contentHash = Bun.hash(sourceCode).toString(BASE_36_RADIX);
|
|
21326
21335
|
const cacheKey = actualPath;
|
|
21327
21336
|
const shouldWriteFile = cacheBuster && isEntry ? true : jitContentCache.get(cacheKey) !== contentHash || !existsSync31(targetPath);
|
|
@@ -21358,11 +21367,11 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
21358
21367
|
const compiledRoot = compiledParent;
|
|
21359
21368
|
const indexesDir = join40(compiledParent, "indexes");
|
|
21360
21369
|
await traceAngularPhase("setup/create-indexes-dir", () => fs5.mkdir(indexesDir, { recursive: true }));
|
|
21361
|
-
const aotOutputs = hmr ? [] : await traceAngularPhase("aot/compile-files", () => compileAngularFiles(entryPoints.map((entry) =>
|
|
21370
|
+
const aotOutputs = hmr ? [] : await traceAngularPhase("aot/compile-files", () => compileAngularFiles(entryPoints.map((entry) => resolve31(entry)), compiledRoot, stylePreprocessors), { entries: entryPoints.length });
|
|
21362
21371
|
if (!hmr) {
|
|
21363
21372
|
await traceAngularPhase("aot/copy-json-resources", async () => {
|
|
21364
21373
|
const cwd = process.cwd();
|
|
21365
|
-
const angularSrcDir =
|
|
21374
|
+
const angularSrcDir = resolve31(outRoot);
|
|
21366
21375
|
if (!existsSync31(angularSrcDir))
|
|
21367
21376
|
return;
|
|
21368
21377
|
const jsonGlob = new Glob6("**/*.json");
|
|
@@ -21373,14 +21382,14 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
21373
21382
|
const sourcePath = join40(angularSrcDir, rel);
|
|
21374
21383
|
const cwdRel = relative19(cwd, sourcePath);
|
|
21375
21384
|
const targetPath = join40(compiledRoot, cwdRel);
|
|
21376
|
-
await fs5.mkdir(
|
|
21385
|
+
await fs5.mkdir(dirname24(targetPath), { recursive: true });
|
|
21377
21386
|
await fs5.copyFile(sourcePath, targetPath);
|
|
21378
21387
|
}
|
|
21379
21388
|
});
|
|
21380
21389
|
}
|
|
21381
21390
|
const usesLegacyAngularAnimations = await traceAngularPhase("setup/legacy-animation-resolver", () => createLegacyAngularAnimationUsageResolver(outRoot));
|
|
21382
21391
|
const compileTasks = entryPoints.map(async (entry) => {
|
|
21383
|
-
const resolvedEntry =
|
|
21392
|
+
const resolvedEntry = resolve31(entry);
|
|
21384
21393
|
const relativeEntry = relative19(outRoot, resolvedEntry).replace(/\.[tj]s$/, ".js");
|
|
21385
21394
|
const compileEntry = () => compileAngularFileJIT(resolvedEntry, compiledRoot, outRoot, stylePreprocessors);
|
|
21386
21395
|
let outputs = hmr ? await traceAngularPhase("jit/compile-entry", compileEntry, {
|
|
@@ -21392,10 +21401,10 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
21392
21401
|
join40(compiledRoot, relativeEntry),
|
|
21393
21402
|
join40(compiledRoot, "pages", jsName),
|
|
21394
21403
|
join40(compiledRoot, jsName)
|
|
21395
|
-
].map((file) =>
|
|
21404
|
+
].map((file) => resolve31(file));
|
|
21396
21405
|
const resolveRawServerFile = (candidatePaths) => {
|
|
21397
21406
|
const normalizedCandidates = [
|
|
21398
|
-
...candidatePaths.map((file) =>
|
|
21407
|
+
...candidatePaths.map((file) => resolve31(file)),
|
|
21399
21408
|
...compiledFallbackPaths
|
|
21400
21409
|
];
|
|
21401
21410
|
let candidate = normalizedCandidates.find((file) => existsSync31(file) && file.endsWith(`${sep5}${relativeEntry}`));
|
|
@@ -21442,7 +21451,7 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
21442
21451
|
let providersSourceContent = "";
|
|
21443
21452
|
if (providersInjection.appProvidersSource) {
|
|
21444
21453
|
try {
|
|
21445
|
-
providersSourceContent =
|
|
21454
|
+
providersSourceContent = readFileSync27(providersInjection.appProvidersSource, "utf-8");
|
|
21446
21455
|
} catch {}
|
|
21447
21456
|
}
|
|
21448
21457
|
return JSON.stringify({
|
|
@@ -21485,13 +21494,13 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
21485
21494
|
const fragments = [];
|
|
21486
21495
|
if (providersInjection.appProvidersSource) {
|
|
21487
21496
|
const compiledAppProvidersPath = (() => {
|
|
21488
|
-
const angularDirAbs =
|
|
21489
|
-
const appSourceAbs =
|
|
21497
|
+
const angularDirAbs = resolve31(outRoot);
|
|
21498
|
+
const appSourceAbs = resolve31(providersInjection.appProvidersSource);
|
|
21490
21499
|
const rel = relative19(angularDirAbs, appSourceAbs).replace(/\\/g, "/");
|
|
21491
21500
|
return join40(compiledParent, rel).replace(/\.[cm]?[tj]sx?$/, ".js");
|
|
21492
21501
|
})();
|
|
21493
21502
|
const appProvidersSpec = (() => {
|
|
21494
|
-
const rel = relative19(
|
|
21503
|
+
const rel = relative19(dirname24(rawServerFile), compiledAppProvidersPath).replace(/\\/g, "/");
|
|
21495
21504
|
return rel.startsWith(".") ? rel : `./${rel}`;
|
|
21496
21505
|
})();
|
|
21497
21506
|
importLines.push(`import { appProviders as __abs_globalProviders } from "${appProvidersSpec}";`);
|
|
@@ -22192,7 +22201,7 @@ var require_node = __commonJS(function(exports, module) {
|
|
|
22192
22201
|
// src/build/compileEmber.ts
|
|
22193
22202
|
import { existsSync as existsSync32 } from "fs";
|
|
22194
22203
|
import { mkdir as mkdir10, rm as rm5 } from "fs/promises";
|
|
22195
|
-
import { basename as basename16, dirname as
|
|
22204
|
+
import { basename as basename16, dirname as dirname25, extname as extname13, join as join41, resolve as resolve32 } from "path";
|
|
22196
22205
|
var {build: bunBuild2, Transpiler: Transpiler5, write: write5, file: file4 } = globalThis.Bun;
|
|
22197
22206
|
var cachedPreprocessor = null, getPreprocessor = async () => {
|
|
22198
22207
|
if (cachedPreprocessor)
|
|
@@ -22288,7 +22297,7 @@ export const importSync = (specifier) => {
|
|
|
22288
22297
|
const originalImporter = stagedSourceMap.get(args.importer);
|
|
22289
22298
|
if (!originalImporter)
|
|
22290
22299
|
return;
|
|
22291
|
-
const candidateBase =
|
|
22300
|
+
const candidateBase = resolve32(dirname25(originalImporter), args.path);
|
|
22292
22301
|
const extensionsToTry = ["", ".gts", ".gjs", ".ts", ".js"];
|
|
22293
22302
|
for (const ext of extensionsToTry) {
|
|
22294
22303
|
const candidate = candidateBase + ext;
|
|
@@ -22347,7 +22356,7 @@ export const renderToHTML = (props = {}) => {
|
|
|
22347
22356
|
export { PageComponent };
|
|
22348
22357
|
export default PageComponent;
|
|
22349
22358
|
`, compileEmberFile = async (entry, compiledRoot, cwd = process.cwd()) => {
|
|
22350
|
-
const resolvedEntry =
|
|
22359
|
+
const resolvedEntry = resolve32(entry);
|
|
22351
22360
|
const source = await file4(resolvedEntry).text();
|
|
22352
22361
|
let preprocessed = source;
|
|
22353
22362
|
if (isTemplateTagFile(resolvedEntry)) {
|
|
@@ -22367,8 +22376,8 @@ export default PageComponent;
|
|
|
22367
22376
|
mkdir10(serverDir, { recursive: true }),
|
|
22368
22377
|
mkdir10(clientDir, { recursive: true })
|
|
22369
22378
|
]);
|
|
22370
|
-
const tmpPagePath =
|
|
22371
|
-
const tmpHarnessPath =
|
|
22379
|
+
const tmpPagePath = resolve32(join41(tmpDir, `${baseName}.module.js`));
|
|
22380
|
+
const tmpHarnessPath = resolve32(join41(tmpDir, `${baseName}.harness.js`));
|
|
22372
22381
|
await Promise.all([
|
|
22373
22382
|
write5(tmpPagePath, transpiled),
|
|
22374
22383
|
write5(tmpHarnessPath, generateServerHarness(tmpPagePath))
|
|
@@ -22433,24 +22442,24 @@ var importFromProject = (specifier, projectRoot = process.cwd()) => {
|
|
|
22433
22442
|
|
|
22434
22443
|
// src/build/buildReactVendor.ts
|
|
22435
22444
|
import { existsSync as existsSync33, mkdirSync as mkdirSync8 } from "fs";
|
|
22436
|
-
import { join as join42, resolve as
|
|
22445
|
+
import { join as join42, resolve as resolve33 } from "path";
|
|
22437
22446
|
import { rm as rm6 } from "fs/promises";
|
|
22438
22447
|
var {build: bunBuild3 } = globalThis.Bun;
|
|
22439
22448
|
var resolveJsxDevRuntimeCompatPath = () => {
|
|
22440
22449
|
const candidates = [
|
|
22441
|
-
|
|
22442
|
-
|
|
22443
|
-
|
|
22444
|
-
|
|
22445
|
-
|
|
22446
|
-
|
|
22450
|
+
resolve33(import.meta.dir, "react", "jsxDevRuntimeCompat.js"),
|
|
22451
|
+
resolve33(import.meta.dir, "src", "react", "jsxDevRuntimeCompat.ts"),
|
|
22452
|
+
resolve33(import.meta.dir, "..", "react", "jsxDevRuntimeCompat.js"),
|
|
22453
|
+
resolve33(import.meta.dir, "..", "src", "react", "jsxDevRuntimeCompat.ts"),
|
|
22454
|
+
resolve33(import.meta.dir, "..", "..", "dist", "react", "jsxDevRuntimeCompat.js"),
|
|
22455
|
+
resolve33(import.meta.dir, "..", "..", "src", "react", "jsxDevRuntimeCompat.ts")
|
|
22447
22456
|
];
|
|
22448
22457
|
for (const candidate of candidates) {
|
|
22449
22458
|
if (existsSync33(candidate)) {
|
|
22450
22459
|
return candidate.replace(/\\/g, "/");
|
|
22451
22460
|
}
|
|
22452
22461
|
}
|
|
22453
|
-
return (candidates[0] ??
|
|
22462
|
+
return (candidates[0] ?? resolve33(import.meta.dir, "react", "jsxDevRuntimeCompat.js")).replace(/\\/g, "/");
|
|
22454
22463
|
}, jsxDevRuntimeCompatPath, jsxRuntimeCompatPath, reactSpecifiers, toSafeFileName = (specifier) => specifier.replace(/\//g, "_"), computeVendorPaths = () => {
|
|
22455
22464
|
const paths = {};
|
|
22456
22465
|
for (const specifier of reactSpecifiers) {
|
|
@@ -22898,13 +22907,13 @@ import {
|
|
|
22898
22907
|
existsSync as existsSync34,
|
|
22899
22908
|
mkdirSync as mkdirSync12,
|
|
22900
22909
|
readdirSync as readdirSync7,
|
|
22901
|
-
readFileSync as
|
|
22910
|
+
readFileSync as readFileSync28,
|
|
22902
22911
|
renameSync,
|
|
22903
22912
|
rmSync as rmSync2,
|
|
22904
22913
|
statSync as statSync5,
|
|
22905
22914
|
writeFileSync as writeFileSync9
|
|
22906
22915
|
} from "fs";
|
|
22907
|
-
import { basename as basename17, dirname as
|
|
22916
|
+
import { basename as basename17, dirname as dirname26, extname as extname14, join as join46, relative as relative20, resolve as resolve34 } from "path";
|
|
22908
22917
|
import { cwd, env as env2, exit } from "process";
|
|
22909
22918
|
var {build: bunBuild7, Glob: Glob8 } = globalThis.Bun;
|
|
22910
22919
|
var isBuildTraceEnabled = () => {
|
|
@@ -22987,7 +22996,7 @@ var isBuildTraceEnabled = () => {
|
|
|
22987
22996
|
}, REACT_VENDOR_SPECIFIERS, findBareReactImports = (path, importRegex) => {
|
|
22988
22997
|
let content;
|
|
22989
22998
|
try {
|
|
22990
|
-
content =
|
|
22999
|
+
content = readFileSync28(path, "utf-8");
|
|
22991
23000
|
} catch {
|
|
22992
23001
|
return [];
|
|
22993
23002
|
}
|
|
@@ -23053,8 +23062,8 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
|
|
|
23053
23062
|
if (globalThis.__absoluteVersion)
|
|
23054
23063
|
return;
|
|
23055
23064
|
const candidates = [
|
|
23056
|
-
|
|
23057
|
-
|
|
23065
|
+
resolve34(import.meta.dir, "..", "..", "package.json"),
|
|
23066
|
+
resolve34(import.meta.dir, "..", "package.json")
|
|
23058
23067
|
];
|
|
23059
23068
|
const resolveCandidate = async (remaining) => {
|
|
23060
23069
|
const [candidate, ...rest] = remaining;
|
|
@@ -23070,13 +23079,13 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
|
|
|
23070
23079
|
};
|
|
23071
23080
|
await resolveCandidate(candidates);
|
|
23072
23081
|
}, SKIP_DIRS5, addWorkerPathIfExists = (file, relPath, workerPaths) => {
|
|
23073
|
-
const absPath =
|
|
23082
|
+
const absPath = resolve34(file, "..", relPath);
|
|
23074
23083
|
try {
|
|
23075
23084
|
statSync5(absPath);
|
|
23076
23085
|
workerPaths.add(absPath);
|
|
23077
23086
|
} catch {}
|
|
23078
23087
|
}, extractWorkerSpecifiers = (file, patterns) => {
|
|
23079
|
-
const content =
|
|
23088
|
+
const content = readFileSync28(file, "utf-8");
|
|
23080
23089
|
const specifiers = [];
|
|
23081
23090
|
for (const pattern of patterns) {
|
|
23082
23091
|
pattern.lastIndex = 0;
|
|
@@ -23165,35 +23174,35 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
|
|
|
23165
23174
|
return;
|
|
23166
23175
|
}
|
|
23167
23176
|
const indexFiles = readDir(reactIndexesPath).filter((file) => file.endsWith(".tsx"));
|
|
23168
|
-
const pagesRel = relative20(process.cwd(),
|
|
23177
|
+
const pagesRel = relative20(process.cwd(), resolve34(reactPagesPath)).replace(/\\/g, "/");
|
|
23169
23178
|
for (const file of indexFiles) {
|
|
23170
|
-
let content =
|
|
23179
|
+
let content = readFileSync28(join46(reactIndexesPath, file), "utf-8");
|
|
23171
23180
|
content = content.replace(/from\s*['"]([^'"]*\/pages\/([^'"]+))['"]/g, (_match, _fullPath, componentName) => `from '/@src/${pagesRel}/${componentName}'`);
|
|
23172
23181
|
writeFileSync9(join46(devIndexDir, file), content);
|
|
23173
23182
|
}
|
|
23174
23183
|
}, copySvelteDevIndexes = (svelteDir, sveltePagesPath, svelteEntries, devIndexDir) => {
|
|
23175
23184
|
const svelteIndexDir = join46(getFrameworkGeneratedDir("svelte"), "indexes");
|
|
23176
|
-
const sveltePageEntries = svelteEntries.filter((file) =>
|
|
23185
|
+
const sveltePageEntries = svelteEntries.filter((file) => resolve34(file).startsWith(resolve34(sveltePagesPath)));
|
|
23177
23186
|
for (const entry of sveltePageEntries) {
|
|
23178
23187
|
const name = basename17(entry).replace(/\.svelte(\.(ts|js))?$/, "");
|
|
23179
23188
|
const indexFile = join46(svelteIndexDir, "pages", `${name}.js`);
|
|
23180
23189
|
if (!existsSync34(indexFile))
|
|
23181
23190
|
continue;
|
|
23182
|
-
let content =
|
|
23183
|
-
const srcRel = relative20(process.cwd(),
|
|
23191
|
+
let content = readFileSync28(indexFile, "utf-8");
|
|
23192
|
+
const srcRel = relative20(process.cwd(), resolve34(entry)).replace(/\\/g, "/");
|
|
23184
23193
|
content = content.replace(/import\s+Component\s+from\s+['"]([^'"]+)['"]/, `import Component from "/@src/${srcRel}"`);
|
|
23185
23194
|
writeFileSync9(join46(devIndexDir, `${name}.svelte.js`), content);
|
|
23186
23195
|
}
|
|
23187
23196
|
}, copyVueDevIndexes = (vueDir, vuePagesPath, vueEntries, devIndexDir) => {
|
|
23188
23197
|
const vueIndexDir = join46(getFrameworkGeneratedDir("vue"), "indexes");
|
|
23189
|
-
const vuePageEntries = vueEntries.filter((file) =>
|
|
23198
|
+
const vuePageEntries = vueEntries.filter((file) => resolve34(file).startsWith(resolve34(vuePagesPath)));
|
|
23190
23199
|
for (const entry of vuePageEntries) {
|
|
23191
23200
|
const name = basename17(entry, ".vue");
|
|
23192
23201
|
const indexFile = join46(vueIndexDir, `${name}.js`);
|
|
23193
23202
|
if (!existsSync34(indexFile))
|
|
23194
23203
|
continue;
|
|
23195
|
-
let content =
|
|
23196
|
-
const srcRel = relative20(process.cwd(),
|
|
23204
|
+
let content = readFileSync28(indexFile, "utf-8");
|
|
23205
|
+
const srcRel = relative20(process.cwd(), resolve34(entry)).replace(/\\/g, "/");
|
|
23197
23206
|
content = content.replace(/import\s+Comp(?:\s*,\s*\*\s+as\s+\w+)?\s+from\s+['"]([^'"]+)['"]/, (match) => match.replace(/from\s+['"][^'"]+['"]/, `from "/@src/${srcRel}"`));
|
|
23198
23207
|
writeFileSync9(join46(devIndexDir, `${name}.vue.js`), content);
|
|
23199
23208
|
}
|
|
@@ -23432,7 +23441,7 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
|
|
|
23432
23441
|
const sourceClientRoots = [
|
|
23433
23442
|
htmlDir,
|
|
23434
23443
|
htmxDir,
|
|
23435
|
-
islandBootstrapPath &&
|
|
23444
|
+
islandBootstrapPath && dirname26(islandBootstrapPath)
|
|
23436
23445
|
].filter((dir) => Boolean(dir));
|
|
23437
23446
|
const usesGenerated = Boolean(reactDir) || Boolean(svelteDir) || Boolean(vueDir) || Boolean(angularDir);
|
|
23438
23447
|
if (usesGenerated)
|
|
@@ -23480,13 +23489,13 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
|
|
|
23480
23489
|
const filterToIncrementalEntries = (entryPoints, mapToSource) => {
|
|
23481
23490
|
if (!isIncremental || !incrementalFiles)
|
|
23482
23491
|
return entryPoints;
|
|
23483
|
-
const normalizedIncremental = new Set(incrementalFiles.map((f) =>
|
|
23492
|
+
const normalizedIncremental = new Set(incrementalFiles.map((f) => resolve34(f)));
|
|
23484
23493
|
const matchingEntries = [];
|
|
23485
23494
|
for (const entry of entryPoints) {
|
|
23486
23495
|
const sourceFile = mapToSource(entry);
|
|
23487
23496
|
if (!sourceFile)
|
|
23488
23497
|
continue;
|
|
23489
|
-
if (!normalizedIncremental.has(
|
|
23498
|
+
if (!normalizedIncremental.has(resolve34(sourceFile)))
|
|
23490
23499
|
continue;
|
|
23491
23500
|
matchingEntries.push(entry);
|
|
23492
23501
|
}
|
|
@@ -23662,11 +23671,11 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
|
|
|
23662
23671
|
return scoped;
|
|
23663
23672
|
return scoped.filter((entry) => {
|
|
23664
23673
|
const source = mapToSource(entry);
|
|
23665
|
-
return source !== null && deferPageEntries.except.has(
|
|
23674
|
+
return source !== null && deferPageEntries.except.has(resolve34(source));
|
|
23666
23675
|
});
|
|
23667
23676
|
};
|
|
23668
23677
|
const mapReactIndexToPage = (entry) => {
|
|
23669
|
-
if (reactIndexesPath && reactPagesPath && entry.startsWith(
|
|
23678
|
+
if (reactIndexesPath && reactPagesPath && entry.startsWith(resolve34(reactIndexesPath))) {
|
|
23670
23679
|
const pageName = basename17(entry, ".tsx");
|
|
23671
23680
|
return join46(reactPagesPath, `${pageName}.tsx`);
|
|
23672
23681
|
}
|
|
@@ -23708,7 +23717,7 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
|
|
|
23708
23717
|
for (const entry of vueEntries) {
|
|
23709
23718
|
const name = basename17(entry, ".vue");
|
|
23710
23719
|
if (ssrOnlyPageNames.has(name)) {
|
|
23711
|
-
resolved.add(
|
|
23720
|
+
resolved.add(resolve34(entry));
|
|
23712
23721
|
}
|
|
23713
23722
|
}
|
|
23714
23723
|
return resolved;
|
|
@@ -23821,7 +23830,7 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
|
|
|
23821
23830
|
const clientPath = islandSvelteClientPaths[idx];
|
|
23822
23831
|
if (!sourcePath || !clientPath)
|
|
23823
23832
|
continue;
|
|
23824
|
-
islandSvelteClientPathMap.set(
|
|
23833
|
+
islandSvelteClientPathMap.set(resolve34(sourcePath), clientPath);
|
|
23825
23834
|
}
|
|
23826
23835
|
const islandVueClientPathMap = new Map;
|
|
23827
23836
|
for (let idx = 0;idx < islandVueSources.length; idx++) {
|
|
@@ -23829,7 +23838,7 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
|
|
|
23829
23838
|
const clientPath = islandVueClientPaths[idx];
|
|
23830
23839
|
if (!sourcePath || !clientPath)
|
|
23831
23840
|
continue;
|
|
23832
|
-
islandVueClientPathMap.set(
|
|
23841
|
+
islandVueClientPathMap.set(resolve34(sourcePath), clientPath);
|
|
23833
23842
|
}
|
|
23834
23843
|
const islandAngularClientPathMap = new Map;
|
|
23835
23844
|
for (let idx = 0;idx < islandAngularSources.length; idx++) {
|
|
@@ -23837,7 +23846,7 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
|
|
|
23837
23846
|
const clientPath = islandAngularClientPaths[idx];
|
|
23838
23847
|
if (!sourcePath || !clientPath)
|
|
23839
23848
|
continue;
|
|
23840
|
-
islandAngularClientPathMap.set(
|
|
23849
|
+
islandAngularClientPathMap.set(resolve34(sourcePath), clientPath);
|
|
23841
23850
|
}
|
|
23842
23851
|
const reactConventionSources = collectConventionSourceFiles(conventionsMap.react);
|
|
23843
23852
|
const svelteConventionSources = collectConventionSourceFiles(conventionsMap.svelte);
|
|
@@ -23864,7 +23873,7 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
|
|
|
23864
23873
|
stylePreprocessorPlugin,
|
|
23865
23874
|
createBunStringRawUnicodePlugin()
|
|
23866
23875
|
],
|
|
23867
|
-
root:
|
|
23876
|
+
root: dirname26(source),
|
|
23868
23877
|
target: "bun",
|
|
23869
23878
|
throw: false,
|
|
23870
23879
|
...projectTsconfig()
|
|
@@ -23956,7 +23965,7 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
|
|
|
23956
23965
|
...islandBootstrapPath ? [islandBootstrapPath] : []
|
|
23957
23966
|
];
|
|
23958
23967
|
const [onlyWorkerClientEntry] = urlReferencedFiles;
|
|
23959
|
-
const workerClientRoot = urlReferencedFiles.length === 1 && onlyWorkerClientEntry ?
|
|
23968
|
+
const workerClientRoot = urlReferencedFiles.length === 1 && onlyWorkerClientEntry ? dirname26(onlyWorkerClientEntry) : commonAncestor(urlReferencedFiles.map((file) => dirname26(file)), projectRoot);
|
|
23960
23969
|
const islandEntryResult = islandBuildInfo ? await tracePhase("islands/client-entry-generation", () => generateIslandEntryPoints({
|
|
23961
23970
|
buildInfo: islandBuildInfo,
|
|
23962
23971
|
buildPath,
|
|
@@ -24284,7 +24293,7 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
|
|
|
24284
24293
|
renameSync(mapPath, join46(sourcemapDir, basename17(mapPath)));
|
|
24285
24294
|
const jsPath = mapPath.slice(0, -4);
|
|
24286
24295
|
try {
|
|
24287
|
-
const javascript =
|
|
24296
|
+
const javascript = readFileSync28(jsPath, "utf-8").replace(/\n?\/\/# sourceMappingURL=[^\n]*\s*$/, `
|
|
24288
24297
|
`);
|
|
24289
24298
|
writeFileSync9(jsPath, javascript);
|
|
24290
24299
|
} catch {}
|
|
@@ -24363,7 +24372,7 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
|
|
|
24363
24372
|
if (serverOutputs.length > 0 && angularServerVendorPaths && Object.keys(angularServerVendorPaths).length > 0) {
|
|
24364
24373
|
await Promise.resolve().then(() => init_rewriteImportsPlugin());
|
|
24365
24374
|
await tracePhase("postprocess/server-angular-vendor-imports", () => rewriteBuildOutputsWith(serverOutputs, (artifact) => {
|
|
24366
|
-
const fileDir =
|
|
24375
|
+
const fileDir = dirname26(artifact.path);
|
|
24367
24376
|
const relativePaths = {};
|
|
24368
24377
|
for (const [specifier, absolute] of Object.entries(angularServerVendorPaths)) {
|
|
24369
24378
|
const rel = relative20(fileDir, absolute);
|
|
@@ -24491,7 +24500,7 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
|
|
|
24491
24500
|
const injectHMRIntoHTMLFile = (filePath, framework) => {
|
|
24492
24501
|
if (!hmrClientBundle)
|
|
24493
24502
|
return;
|
|
24494
|
-
let html =
|
|
24503
|
+
let html = readFileSync28(filePath, "utf-8");
|
|
24495
24504
|
if (html.includes("data-hmr-client"))
|
|
24496
24505
|
return;
|
|
24497
24506
|
const tag = `<script>window.__HMR_FRAMEWORK__="${framework}";</script><script data-hmr-client>${hmrClientBundle}</script>`;
|
|
@@ -24516,7 +24525,7 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
|
|
|
24516
24525
|
if (hmr)
|
|
24517
24526
|
injectHMRIntoHTMLFile(htmlFile, "html");
|
|
24518
24527
|
if (pwaArtifacts) {
|
|
24519
|
-
const source =
|
|
24528
|
+
const source = readFileSync28(htmlFile, "utf8");
|
|
24520
24529
|
writeFileSync9(htmlFile, injectPwaBootstrapHtml(source));
|
|
24521
24530
|
}
|
|
24522
24531
|
const fileName = basename17(htmlFile, ".html");
|
|
@@ -24547,7 +24556,7 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
|
|
|
24547
24556
|
if (hmr)
|
|
24548
24557
|
injectHMRIntoHTMLFile(htmxFile, "htmx");
|
|
24549
24558
|
if (pwaArtifacts) {
|
|
24550
|
-
const source =
|
|
24559
|
+
const source = readFileSync28(htmxFile, "utf8");
|
|
24551
24560
|
writeFileSync9(htmxFile, injectPwaBootstrapHtml(source));
|
|
24552
24561
|
}
|
|
24553
24562
|
const fileName = basename17(htmxFile, ".html");
|
|
@@ -24672,7 +24681,7 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
|
|
|
24672
24681
|
pageEntries,
|
|
24673
24682
|
tailwindChanged: tailwindResult?.cssChanged ?? false
|
|
24674
24683
|
};
|
|
24675
|
-
}, projectTsconfig = () => existsSync34(
|
|
24684
|
+
}, projectTsconfig = () => existsSync34(resolve34("tsconfig.json")) ? { tsconfig: "./tsconfig.json" } : {}, build = async (config) => {
|
|
24676
24685
|
const projectRoot = cwd();
|
|
24677
24686
|
const buildPath = validateSafePath(config.buildDirectory ?? "build", projectRoot);
|
|
24678
24687
|
return withBuildDirectoryLock(buildPath, () => buildUnlocked(config));
|
|
@@ -24762,14 +24771,14 @@ var init_build = __esm(() => {
|
|
|
24762
24771
|
|
|
24763
24772
|
// src/dev/runtimePaths.ts
|
|
24764
24773
|
import { existsSync as existsSync35 } from "fs";
|
|
24765
|
-
import { resolve as
|
|
24774
|
+
import { resolve as resolve35 } from "path";
|
|
24766
24775
|
var resolveDevClientDirectory = () => {
|
|
24767
24776
|
const candidates = [
|
|
24768
|
-
|
|
24769
|
-
|
|
24770
|
-
|
|
24777
|
+
resolve35(import.meta.dir, "client"),
|
|
24778
|
+
resolve35(import.meta.dir, "dev/client"),
|
|
24779
|
+
resolve35(import.meta.dir, "../dev/client")
|
|
24771
24780
|
];
|
|
24772
|
-
const directory = candidates.find((candidate) => existsSync35(
|
|
24781
|
+
const directory = candidates.find((candidate) => existsSync35(resolve35(candidate, "hmrClient.ts")));
|
|
24773
24782
|
if (!directory) {
|
|
24774
24783
|
throw new Error("AbsoluteJS browser HMR sources are missing from the installed package.");
|
|
24775
24784
|
}
|
|
@@ -24926,7 +24935,7 @@ var init_buildEmberVendor = __esm(() => {
|
|
|
24926
24935
|
});
|
|
24927
24936
|
|
|
24928
24937
|
// src/build/workspacePackages.ts
|
|
24929
|
-
import { readFileSync as
|
|
24938
|
+
import { readFileSync as readFileSync29, realpathSync as realpathSync4 } from "fs";
|
|
24930
24939
|
import { join as join48, sep as sep6 } from "path";
|
|
24931
24940
|
var NODE_MODULES_SEGMENT, verdicts, isWorkspacePackageSpecifier = (specifier, projectRoot = process.cwd()) => {
|
|
24932
24941
|
const key = `${projectRoot}\x00${specifier}`;
|
|
@@ -24935,7 +24944,7 @@ var NODE_MODULES_SEGMENT, verdicts, isWorkspacePackageSpecifier = (specifier, pr
|
|
|
24935
24944
|
return known;
|
|
24936
24945
|
let verdict = false;
|
|
24937
24946
|
try {
|
|
24938
|
-
const resolved =
|
|
24947
|
+
const resolved = realpathSync4(Bun.resolveSync(specifier, projectRoot));
|
|
24939
24948
|
verdict = !resolved.includes(NODE_MODULES_SEGMENT);
|
|
24940
24949
|
} catch {
|
|
24941
24950
|
verdict = false;
|
|
@@ -24945,7 +24954,7 @@ var NODE_MODULES_SEGMENT, verdicts, isWorkspacePackageSpecifier = (specifier, pr
|
|
|
24945
24954
|
}, workspacePackageDirs = (projectRoot = process.cwd()) => {
|
|
24946
24955
|
let manifest;
|
|
24947
24956
|
try {
|
|
24948
|
-
manifest = JSON.parse(
|
|
24957
|
+
manifest = JSON.parse(readFileSync29(join48(projectRoot, "package.json"), "utf-8"));
|
|
24949
24958
|
} catch {
|
|
24950
24959
|
return [];
|
|
24951
24960
|
}
|
|
@@ -24960,7 +24969,7 @@ var NODE_MODULES_SEGMENT, verdicts, isWorkspacePackageSpecifier = (specifier, pr
|
|
|
24960
24969
|
const dirs = new Set;
|
|
24961
24970
|
for (const name of names) {
|
|
24962
24971
|
try {
|
|
24963
|
-
const linked =
|
|
24972
|
+
const linked = realpathSync4(join48(projectRoot, "node_modules", name));
|
|
24964
24973
|
if (!`${linked}${sep6}`.includes(NODE_MODULES_SEGMENT))
|
|
24965
24974
|
dirs.add(linked);
|
|
24966
24975
|
} catch {}
|
|
@@ -25076,9 +25085,9 @@ var stripStringsAndComments = (source) => {
|
|
|
25076
25085
|
};
|
|
25077
25086
|
|
|
25078
25087
|
// src/dev/dependencyGraph.ts
|
|
25079
|
-
import { existsSync as existsSync37, readFileSync as
|
|
25088
|
+
import { existsSync as existsSync37, readFileSync as readFileSync30, realpathSync as realpathSync5 } from "fs";
|
|
25080
25089
|
var {Glob: Glob9 } = globalThis.Bun;
|
|
25081
|
-
import { resolve as
|
|
25090
|
+
import { resolve as resolve36 } from "path";
|
|
25082
25091
|
var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath) => {
|
|
25083
25092
|
const lower = filePath.toLowerCase();
|
|
25084
25093
|
if (lower.endsWith(".ts") || lower.endsWith(".tsx") || lower.endsWith(".jsx"))
|
|
@@ -25089,17 +25098,17 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
25089
25098
|
return "html";
|
|
25090
25099
|
return null;
|
|
25091
25100
|
}, resolveImportPath2 = (importPath, fromFile) => {
|
|
25092
|
-
const fromDir =
|
|
25101
|
+
const fromDir = resolve36(fromFile, "..");
|
|
25093
25102
|
if (!importPath.startsWith(".") && !importPath.startsWith("/")) {
|
|
25094
25103
|
if (!isWorkspacePackageSpecifier(importPath, fromDir))
|
|
25095
25104
|
return null;
|
|
25096
25105
|
try {
|
|
25097
|
-
return
|
|
25106
|
+
return realpathSync5(Bun.resolveSync(importPath, fromDir));
|
|
25098
25107
|
} catch {
|
|
25099
25108
|
return null;
|
|
25100
25109
|
}
|
|
25101
25110
|
}
|
|
25102
|
-
const normalized =
|
|
25111
|
+
const normalized = resolve36(fromDir, importPath);
|
|
25103
25112
|
const extensions = [
|
|
25104
25113
|
".ts",
|
|
25105
25114
|
".tsx",
|
|
@@ -25129,7 +25138,7 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
25129
25138
|
dependents.delete(normalizedPath);
|
|
25130
25139
|
}
|
|
25131
25140
|
}, addFileToGraph = (graph, filePath) => {
|
|
25132
|
-
const normalizedPath =
|
|
25141
|
+
const normalizedPath = resolve36(filePath);
|
|
25133
25142
|
if (!existsSync37(normalizedPath))
|
|
25134
25143
|
return;
|
|
25135
25144
|
const dependencies = extractDependencies(normalizedPath);
|
|
@@ -25156,10 +25165,10 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
25156
25165
|
}, IGNORED_SEGMENTS, buildInitialDependencyGraph = (graph, directories) => {
|
|
25157
25166
|
const processedFiles = new Set;
|
|
25158
25167
|
const glob = new Glob9("**/*.{ts,tsx,js,jsx,vue,svelte,html,htm}");
|
|
25159
|
-
const resolvedDirs = directories.map((dir) =>
|
|
25168
|
+
const resolvedDirs = directories.map((dir) => resolve36(dir)).filter((dir) => existsSync37(dir));
|
|
25160
25169
|
const allFiles = resolvedDirs.flatMap((dir) => Array.from(glob.scanSync({ absolute: true, cwd: dir })));
|
|
25161
25170
|
for (const file of allFiles) {
|
|
25162
|
-
const fullPath =
|
|
25171
|
+
const fullPath = resolve36(file);
|
|
25163
25172
|
if (IGNORED_SEGMENTS.some((seg) => fullPath.includes(seg)))
|
|
25164
25173
|
continue;
|
|
25165
25174
|
if (processedFiles.has(fullPath))
|
|
@@ -25253,15 +25262,15 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
25253
25262
|
const lowerPath = filePath.toLowerCase();
|
|
25254
25263
|
const isSvelteOrVue = lowerPath.endsWith(".svelte") || lowerPath.endsWith(".vue");
|
|
25255
25264
|
if (loader === "html") {
|
|
25256
|
-
const content =
|
|
25265
|
+
const content = readFileSync30(filePath, "utf-8");
|
|
25257
25266
|
return extractHtmlDependencies(filePath, content);
|
|
25258
25267
|
}
|
|
25259
25268
|
if (loader === "tsx" || loader === "js") {
|
|
25260
|
-
const content =
|
|
25269
|
+
const content = readFileSync30(filePath, "utf-8");
|
|
25261
25270
|
return extractJsDependencies(filePath, content, loader);
|
|
25262
25271
|
}
|
|
25263
25272
|
if (isSvelteOrVue) {
|
|
25264
|
-
const content =
|
|
25273
|
+
const content = readFileSync30(filePath, "utf-8");
|
|
25265
25274
|
return extractSvelteVueDependencies(filePath, content);
|
|
25266
25275
|
}
|
|
25267
25276
|
return [];
|
|
@@ -25272,7 +25281,7 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
25272
25281
|
return [];
|
|
25273
25282
|
}
|
|
25274
25283
|
}, getAffectedFiles = (graph, changedFile) => {
|
|
25275
|
-
const normalizedPath =
|
|
25284
|
+
const normalizedPath = resolve36(changedFile);
|
|
25276
25285
|
const affected = new Set;
|
|
25277
25286
|
const toProcess = [normalizedPath];
|
|
25278
25287
|
const processNode = (current) => {
|
|
@@ -25303,7 +25312,7 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
25303
25312
|
}, removeDependentsForFile = (graph, normalizedPath) => {
|
|
25304
25313
|
graph.dependents.delete(normalizedPath);
|
|
25305
25314
|
}, removeFileFromGraph = (graph, filePath) => {
|
|
25306
|
-
const normalizedPath =
|
|
25315
|
+
const normalizedPath = resolve36(filePath);
|
|
25307
25316
|
removeDepsForFile(graph, normalizedPath);
|
|
25308
25317
|
removeDependentsForFile(graph, normalizedPath);
|
|
25309
25318
|
};
|
|
@@ -25347,12 +25356,12 @@ var globalVersionCounter = 0, createModuleVersionTracker = () => new Map, getNex
|
|
|
25347
25356
|
};
|
|
25348
25357
|
|
|
25349
25358
|
// src/dev/configResolver.ts
|
|
25350
|
-
import { resolve as
|
|
25359
|
+
import { resolve as resolve37 } from "path";
|
|
25351
25360
|
var resolveBuildPaths = (config) => {
|
|
25352
25361
|
const cwd = process.cwd();
|
|
25353
25362
|
const normalize = (path) => path.replace(/\\/g, "/");
|
|
25354
|
-
const withDefault = (value, fallback) => normalize(
|
|
25355
|
-
const optional = (value) => value ? normalize(
|
|
25363
|
+
const withDefault = (value, fallback) => normalize(resolve37(cwd, value ?? fallback));
|
|
25364
|
+
const optional = (value) => value ? normalize(resolve37(cwd, value)) : undefined;
|
|
25356
25365
|
return {
|
|
25357
25366
|
angularDir: optional(config.angularDirectory),
|
|
25358
25367
|
assetsDir: optional(config.assetsDirectory),
|
|
@@ -25411,8 +25420,8 @@ var init_clientManager = __esm(() => {
|
|
|
25411
25420
|
});
|
|
25412
25421
|
|
|
25413
25422
|
// src/dev/pathUtils.ts
|
|
25414
|
-
import { existsSync as existsSync38, readdirSync as readdirSync8, readFileSync as
|
|
25415
|
-
import { dirname as
|
|
25423
|
+
import { existsSync as existsSync38, readdirSync as readdirSync8, readFileSync as readFileSync31 } from "fs";
|
|
25424
|
+
import { dirname as dirname27, resolve as resolve38 } from "path";
|
|
25416
25425
|
var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
25417
25426
|
if (shouldIgnorePath(filePath, resolved)) {
|
|
25418
25427
|
return "ignored";
|
|
@@ -25488,7 +25497,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
25488
25497
|
return "unknown";
|
|
25489
25498
|
}, collectAngularResourceDirs = (angularDir) => {
|
|
25490
25499
|
const out = new Set;
|
|
25491
|
-
const angularRoot =
|
|
25500
|
+
const angularRoot = resolve38(angularDir);
|
|
25492
25501
|
const angularRootNormalized = normalizePath(angularRoot);
|
|
25493
25502
|
const walk = (dir) => {
|
|
25494
25503
|
let entries;
|
|
@@ -25501,7 +25510,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
25501
25510
|
if (entry.name.startsWith(".") || entry.name === "node_modules") {
|
|
25502
25511
|
continue;
|
|
25503
25512
|
}
|
|
25504
|
-
const full =
|
|
25513
|
+
const full = resolve38(dir, entry.name);
|
|
25505
25514
|
if (entry.isDirectory()) {
|
|
25506
25515
|
walk(full);
|
|
25507
25516
|
continue;
|
|
@@ -25511,7 +25520,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
25511
25520
|
}
|
|
25512
25521
|
let source;
|
|
25513
25522
|
try {
|
|
25514
|
-
source =
|
|
25523
|
+
source = readFileSync31(full, "utf8");
|
|
25515
25524
|
} catch {
|
|
25516
25525
|
continue;
|
|
25517
25526
|
}
|
|
@@ -25540,10 +25549,10 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
25540
25549
|
refs.push(strMatch[1]);
|
|
25541
25550
|
}
|
|
25542
25551
|
}
|
|
25543
|
-
const componentDir =
|
|
25552
|
+
const componentDir = dirname27(full);
|
|
25544
25553
|
for (const ref of refs) {
|
|
25545
|
-
const refAbs = normalizePath(
|
|
25546
|
-
const refDir = normalizePath(
|
|
25554
|
+
const refAbs = normalizePath(resolve38(componentDir, ref));
|
|
25555
|
+
const refDir = normalizePath(dirname27(refAbs));
|
|
25547
25556
|
if (refDir === angularRootNormalized || refDir.startsWith(`${angularRootNormalized}/`)) {
|
|
25548
25557
|
continue;
|
|
25549
25558
|
}
|
|
@@ -25559,7 +25568,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
25559
25568
|
const push = (path) => {
|
|
25560
25569
|
if (!path)
|
|
25561
25570
|
return;
|
|
25562
|
-
const abs = normalizePath(
|
|
25571
|
+
const abs = normalizePath(resolve38(cwd, path));
|
|
25563
25572
|
if (!roots.includes(abs))
|
|
25564
25573
|
roots.push(abs);
|
|
25565
25574
|
};
|
|
@@ -25584,7 +25593,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
25584
25593
|
push(cfg.assetsDir);
|
|
25585
25594
|
push(cfg.stylesDir);
|
|
25586
25595
|
for (const candidate of ["src", "db", "assets", "styles"]) {
|
|
25587
|
-
const abs = normalizePath(
|
|
25596
|
+
const abs = normalizePath(resolve38(cwd, candidate));
|
|
25588
25597
|
if (existsSync38(abs) && !roots.includes(abs))
|
|
25589
25598
|
roots.push(abs);
|
|
25590
25599
|
}
|
|
@@ -25595,7 +25604,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
25595
25604
|
continue;
|
|
25596
25605
|
if (entry.name.startsWith("."))
|
|
25597
25606
|
continue;
|
|
25598
|
-
const abs = normalizePath(
|
|
25607
|
+
const abs = normalizePath(resolve38(cwd, entry.name));
|
|
25599
25608
|
if (roots.includes(abs))
|
|
25600
25609
|
continue;
|
|
25601
25610
|
if (shouldIgnorePath(abs, resolved))
|
|
@@ -25753,7 +25762,7 @@ var init_serverEntryCopies = () => {};
|
|
|
25753
25762
|
// src/dev/fileWatcher.ts
|
|
25754
25763
|
import { watch } from "fs";
|
|
25755
25764
|
import { existsSync as existsSync40, readdirSync as readdirSync10, statSync as statSync6 } from "fs";
|
|
25756
|
-
import { dirname as
|
|
25765
|
+
import { dirname as dirname28, join as join50, resolve as resolve39 } from "path";
|
|
25757
25766
|
var safeRemoveFromGraph = (graph, fullPath) => {
|
|
25758
25767
|
try {
|
|
25759
25768
|
removeFileFromGraph(graph, fullPath);
|
|
@@ -25808,7 +25817,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
25808
25817
|
return;
|
|
25809
25818
|
if (shouldSkipFilename(filename, isStylesDir)) {
|
|
25810
25819
|
if (event === "rename") {
|
|
25811
|
-
const eventDir =
|
|
25820
|
+
const eventDir = dirname28(join50(absolutePath, filename)).replace(/\\/g, "/");
|
|
25812
25821
|
atomicRecoveryScan(eventDir);
|
|
25813
25822
|
for (const delay of [25, 100]) {
|
|
25814
25823
|
const timer = setTimeout(() => atomicRecoveryScan(eventDir), delay);
|
|
@@ -25835,7 +25844,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
25835
25844
|
}, addFileWatchers = (state, paths, onFileChange) => {
|
|
25836
25845
|
const stylesDir = state.resolvedPaths?.stylesDir;
|
|
25837
25846
|
paths.forEach((path) => {
|
|
25838
|
-
const absolutePath =
|
|
25847
|
+
const absolutePath = resolve39(path).replace(/\\/g, "/");
|
|
25839
25848
|
if (!existsSync40(absolutePath)) {
|
|
25840
25849
|
return;
|
|
25841
25850
|
}
|
|
@@ -25846,7 +25855,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
25846
25855
|
const watchPaths = getWatchPaths(config, state.resolvedPaths);
|
|
25847
25856
|
const stylesDir = state.resolvedPaths?.stylesDir;
|
|
25848
25857
|
watchPaths.forEach((path) => {
|
|
25849
|
-
const absolutePath =
|
|
25858
|
+
const absolutePath = resolve39(path).replace(/\\/g, "/");
|
|
25850
25859
|
if (!existsSync40(absolutePath)) {
|
|
25851
25860
|
return;
|
|
25852
25861
|
}
|
|
@@ -25866,13 +25875,13 @@ var init_fileWatcher = __esm(() => {
|
|
|
25866
25875
|
});
|
|
25867
25876
|
|
|
25868
25877
|
// src/dev/assetStore.ts
|
|
25869
|
-
import { resolve as
|
|
25878
|
+
import { resolve as resolve40 } from "path";
|
|
25870
25879
|
import { readdir as readdir5, unlink } from "fs/promises";
|
|
25871
25880
|
var mimeTypes, getMimeType = (filePath) => {
|
|
25872
25881
|
const ext = filePath.slice(filePath.lastIndexOf("."));
|
|
25873
25882
|
return mimeTypes[ext] ?? "application/octet-stream";
|
|
25874
25883
|
}, HASHED_FILE_RE, stripHash = (webPath) => webPath.replace(/\.[a-z0-9]{8}(\.(js|css|mjs))$/, "$1"), processWalkEntry = (entry, dir, liveByIdentity, walkAndClean) => {
|
|
25875
|
-
const fullPath =
|
|
25884
|
+
const fullPath = resolve40(dir, entry.name);
|
|
25876
25885
|
if (entry.isDirectory()) {
|
|
25877
25886
|
return walkAndClean(fullPath);
|
|
25878
25887
|
}
|
|
@@ -25888,10 +25897,10 @@ var mimeTypes, getMimeType = (filePath) => {
|
|
|
25888
25897
|
}, cleanStaleAssets = async (store, manifest, buildDir) => {
|
|
25889
25898
|
const liveByIdentity = new Map;
|
|
25890
25899
|
for (const webPath of store.keys()) {
|
|
25891
|
-
const diskPath =
|
|
25900
|
+
const diskPath = resolve40(buildDir, webPath.slice(1));
|
|
25892
25901
|
liveByIdentity.set(stripHash(diskPath), diskPath);
|
|
25893
25902
|
}
|
|
25894
|
-
const absBuildDir =
|
|
25903
|
+
const absBuildDir = resolve40(buildDir);
|
|
25895
25904
|
Object.values(manifest).forEach((val) => {
|
|
25896
25905
|
if (!HASHED_FILE_RE.test(val))
|
|
25897
25906
|
return;
|
|
@@ -25911,13 +25920,13 @@ var mimeTypes, getMimeType = (filePath) => {
|
|
|
25911
25920
|
}, evictMissingChunks = async (store, buildDir) => {
|
|
25912
25921
|
const chunkKeys = [...store.keys()].filter((webPath) => webPath.includes("/chunk-"));
|
|
25913
25922
|
await Promise.all(chunkKeys.map(async (webPath) => {
|
|
25914
|
-
const onDisk = await Bun.file(
|
|
25923
|
+
const onDisk = await Bun.file(resolve40(buildDir, webPath.slice(1))).exists().catch(() => false);
|
|
25915
25924
|
if (!onDisk)
|
|
25916
25925
|
store.delete(webPath);
|
|
25917
25926
|
}));
|
|
25918
25927
|
}, lookupAsset = (store, path) => store.get(path), processScanEntry = (entry, dir, prefix, store, scanDir) => {
|
|
25919
25928
|
if (entry.isDirectory()) {
|
|
25920
|
-
return scanDir(
|
|
25929
|
+
return scanDir(resolve40(dir, entry.name), `${prefix}${entry.name}/`);
|
|
25921
25930
|
}
|
|
25922
25931
|
if (!entry.name.startsWith("chunk-")) {
|
|
25923
25932
|
return null;
|
|
@@ -25926,7 +25935,7 @@ var mimeTypes, getMimeType = (filePath) => {
|
|
|
25926
25935
|
if (store.has(webPath)) {
|
|
25927
25936
|
return null;
|
|
25928
25937
|
}
|
|
25929
|
-
return Bun.file(
|
|
25938
|
+
return Bun.file(resolve40(dir, entry.name)).bytes().then((bytes) => {
|
|
25930
25939
|
store.set(webPath, bytes);
|
|
25931
25940
|
return;
|
|
25932
25941
|
}).catch(() => {});
|
|
@@ -25948,7 +25957,7 @@ var mimeTypes, getMimeType = (filePath) => {
|
|
|
25948
25957
|
for (const webPath of newIdentities.values()) {
|
|
25949
25958
|
if (store.has(webPath))
|
|
25950
25959
|
continue;
|
|
25951
|
-
loadPromises.push(Bun.file(
|
|
25960
|
+
loadPromises.push(Bun.file(resolve40(buildDir, webPath.slice(1))).bytes().then((bytes) => {
|
|
25952
25961
|
store.set(webPath, bytes);
|
|
25953
25962
|
return;
|
|
25954
25963
|
}).catch(() => {}));
|
|
@@ -25994,10 +26003,10 @@ var init_assetStore = __esm(() => {
|
|
|
25994
26003
|
});
|
|
25995
26004
|
|
|
25996
26005
|
// src/dev/restartScope.ts
|
|
25997
|
-
import { realpathSync as
|
|
26006
|
+
import { realpathSync as realpathSync6 } from "fs";
|
|
25998
26007
|
var MODULE_FILE, DOCUMENT_FILE, realPath = (path) => {
|
|
25999
26008
|
try {
|
|
26000
|
-
return
|
|
26009
|
+
return realpathSync6(path);
|
|
26001
26010
|
} catch {
|
|
26002
26011
|
return path;
|
|
26003
26012
|
}
|
|
@@ -26014,8 +26023,8 @@ var init_restartScope = __esm(() => {
|
|
|
26014
26023
|
});
|
|
26015
26024
|
|
|
26016
26025
|
// src/islands/pageMetadata.ts
|
|
26017
|
-
import { readFileSync as
|
|
26018
|
-
import { dirname as
|
|
26026
|
+
import { readFileSync as readFileSync32 } from "fs";
|
|
26027
|
+
import { dirname as dirname29, resolve as resolve41 } from "path";
|
|
26019
26028
|
var pagePatterns, getPageDirs = (config) => [
|
|
26020
26029
|
{ dir: config.angularDirectory, framework: "angular" },
|
|
26021
26030
|
{ dir: config.emberDirectory, framework: "ember" },
|
|
@@ -26035,15 +26044,15 @@ var pagePatterns, getPageDirs = (config) => [
|
|
|
26035
26044
|
const source = definition.buildReference?.source;
|
|
26036
26045
|
if (!source)
|
|
26037
26046
|
continue;
|
|
26038
|
-
const resolvedSource = source.startsWith("file://") ? new URL(source).pathname :
|
|
26039
|
-
lookup.set(`${definition.framework}:${definition.component}`,
|
|
26047
|
+
const resolvedSource = source.startsWith("file://") ? new URL(source).pathname : resolve41(dirname29(buildInfo.resolvedRegistryPath), source);
|
|
26048
|
+
lookup.set(`${definition.framework}:${definition.component}`, resolve41(resolvedSource));
|
|
26040
26049
|
}
|
|
26041
26050
|
return lookup;
|
|
26042
26051
|
}, getCurrentPageIslandMetadata = () => globalThis.__absolutePageIslandMetadata ?? new Map, metadataUsesSource = (metadata, target) => metadata.islands.some((usage) => {
|
|
26043
26052
|
const candidate = usage.source;
|
|
26044
|
-
return candidate ?
|
|
26053
|
+
return candidate ? resolve41(candidate) === target : false;
|
|
26045
26054
|
}), getPagesUsingIslandSource = (sourcePath) => {
|
|
26046
|
-
const target =
|
|
26055
|
+
const target = resolve41(sourcePath);
|
|
26047
26056
|
return [...getCurrentPageIslandMetadata().values()].filter((metadata) => metadataUsesSource(metadata, target)).map((metadata) => metadata.pagePath);
|
|
26048
26057
|
}, resolveIslandUsages = (islands, islandSourceLookup) => islands.map((usage) => {
|
|
26049
26058
|
const sourcePath = islandSourceLookup.get(`${usage.framework}:${usage.component}`);
|
|
@@ -26055,13 +26064,13 @@ var pagePatterns, getPageDirs = (config) => [
|
|
|
26055
26064
|
const pattern = pagePatterns[entry.framework];
|
|
26056
26065
|
if (!pattern)
|
|
26057
26066
|
return;
|
|
26058
|
-
const files = await scanEntryPoints(
|
|
26067
|
+
const files = await scanEntryPoints(resolve41(entry.dir), pattern);
|
|
26059
26068
|
for (const filePath of files) {
|
|
26060
|
-
const source =
|
|
26069
|
+
const source = readFileSync32(filePath, "utf-8");
|
|
26061
26070
|
const islands = extractIslandUsagesFromSource(source);
|
|
26062
|
-
pageMetadata.set(
|
|
26071
|
+
pageMetadata.set(resolve41(filePath), {
|
|
26063
26072
|
islands: resolveIslandUsages(islands, islandSourceLookup),
|
|
26064
|
-
pagePath:
|
|
26073
|
+
pagePath: resolve41(filePath)
|
|
26065
26074
|
});
|
|
26066
26075
|
}
|
|
26067
26076
|
}, loadPageIslandMetadata = async (config) => {
|
|
@@ -26088,10 +26097,10 @@ var init_pageMetadata = __esm(() => {
|
|
|
26088
26097
|
});
|
|
26089
26098
|
|
|
26090
26099
|
// src/dev/fileHashTracker.ts
|
|
26091
|
-
import { readFileSync as
|
|
26100
|
+
import { readFileSync as readFileSync33, statSync as statSync7 } from "fs";
|
|
26092
26101
|
var computeFileHash = (filePath) => {
|
|
26093
26102
|
try {
|
|
26094
|
-
const fileContent =
|
|
26103
|
+
const fileContent = readFileSync33(filePath);
|
|
26095
26104
|
return Number(Bun.hash(fileContent));
|
|
26096
26105
|
} catch {
|
|
26097
26106
|
return UNFOUND_INDEX;
|
|
@@ -26179,9 +26188,9 @@ var init_transformCache = __esm(() => {
|
|
|
26179
26188
|
});
|
|
26180
26189
|
|
|
26181
26190
|
// src/dev/reactComponentClassifier.ts
|
|
26182
|
-
import { resolve as
|
|
26191
|
+
import { resolve as resolve42 } from "path";
|
|
26183
26192
|
var classifyComponent = (filePath) => {
|
|
26184
|
-
const normalizedPath =
|
|
26193
|
+
const normalizedPath = resolve42(filePath);
|
|
26185
26194
|
if (normalizedPath.includes("/react/pages/")) {
|
|
26186
26195
|
return "server";
|
|
26187
26196
|
}
|
|
@@ -26193,7 +26202,7 @@ var classifyComponent = (filePath) => {
|
|
|
26193
26202
|
var init_reactComponentClassifier = () => {};
|
|
26194
26203
|
|
|
26195
26204
|
// src/dev/moduleMapper.ts
|
|
26196
|
-
import { basename as basename18, resolve as
|
|
26205
|
+
import { basename as basename18, resolve as resolve43 } from "path";
|
|
26197
26206
|
var buildModulePaths = (moduleKeys, manifest) => {
|
|
26198
26207
|
const modulePaths = {};
|
|
26199
26208
|
moduleKeys.forEach((key) => {
|
|
@@ -26203,7 +26212,7 @@ var buildModulePaths = (moduleKeys, manifest) => {
|
|
|
26203
26212
|
});
|
|
26204
26213
|
return modulePaths;
|
|
26205
26214
|
}, processChangedFile = (sourceFile, framework, manifest, resolvedPaths, processedFiles) => {
|
|
26206
|
-
const normalizedFile =
|
|
26215
|
+
const normalizedFile = resolve43(sourceFile);
|
|
26207
26216
|
const normalizedPath = normalizedFile.replace(/\\/g, "/");
|
|
26208
26217
|
if (processedFiles.has(normalizedFile)) {
|
|
26209
26218
|
return null;
|
|
@@ -26239,7 +26248,7 @@ var buildModulePaths = (moduleKeys, manifest) => {
|
|
|
26239
26248
|
});
|
|
26240
26249
|
return grouped;
|
|
26241
26250
|
}, mapSourceFileToManifestKeys = (sourceFile, framework, resolvedPaths) => {
|
|
26242
|
-
const normalizedFile =
|
|
26251
|
+
const normalizedFile = resolve43(sourceFile);
|
|
26243
26252
|
const fileName = basename18(normalizedFile);
|
|
26244
26253
|
const baseName = fileName.replace(/\.(tsx?|jsx?|vue|svelte|css|html)$/, "");
|
|
26245
26254
|
const pascalName = toPascal(baseName);
|
|
@@ -26295,7 +26304,7 @@ var init_moduleMapper = __esm(() => {
|
|
|
26295
26304
|
|
|
26296
26305
|
// src/utils/spaRouteCss.ts
|
|
26297
26306
|
import { readFile as readFile8 } from "fs/promises";
|
|
26298
|
-
import { dirname as
|
|
26307
|
+
import { dirname as dirname30, isAbsolute as isAbsolute8, resolve as resolve44 } from "path";
|
|
26299
26308
|
var sideManifestCache, readSideManifest = async (sideManifestPath) => {
|
|
26300
26309
|
const cached = sideManifestCache.get(sideManifestPath);
|
|
26301
26310
|
if (cached !== undefined)
|
|
@@ -26333,7 +26342,7 @@ var sideManifestCache, readSideManifest = async (sideManifestPath) => {
|
|
|
26333
26342
|
}, readChildCss = async (cssPath, sideManifestPath) => {
|
|
26334
26343
|
if (!cssPath)
|
|
26335
26344
|
return "";
|
|
26336
|
-
const resolvedCssPath = isAbsolute8(cssPath) ? cssPath :
|
|
26345
|
+
const resolvedCssPath = isAbsolute8(cssPath) ? cssPath : resolve44(dirname30(sideManifestPath), cssPath);
|
|
26337
26346
|
const cached = childCssCache.get(resolvedCssPath);
|
|
26338
26347
|
if (cached !== undefined)
|
|
26339
26348
|
return cached;
|
|
@@ -26416,8 +26425,8 @@ __export(exports_resolveOwningComponents, {
|
|
|
26416
26425
|
resolveDescendantsOfParent: () => resolveDescendantsOfParent,
|
|
26417
26426
|
resolveOwningComponents: () => resolveOwningComponents
|
|
26418
26427
|
});
|
|
26419
|
-
import { readdirSync as readdirSync11, readFileSync as
|
|
26420
|
-
import { dirname as
|
|
26428
|
+
import { readdirSync as readdirSync11, readFileSync as readFileSync34, statSync as statSync8 } from "fs";
|
|
26429
|
+
import { dirname as dirname31, extname as extname15, join as join51, resolve as resolve45 } from "path";
|
|
26421
26430
|
import ts19 from "typescript";
|
|
26422
26431
|
var ENTITY_DECORATORS, isAngularSourceFile = (file) => file.endsWith(".ts") || file.endsWith(".tsx"), walkAngularSourceFiles = (root) => {
|
|
26423
26432
|
const out = [];
|
|
@@ -26476,7 +26485,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file) => file.endsWith(".ts") || f
|
|
|
26476
26485
|
}, parseDecoratedClasses = (filePath) => {
|
|
26477
26486
|
let source;
|
|
26478
26487
|
try {
|
|
26479
|
-
source =
|
|
26488
|
+
source = readFileSync34(filePath, "utf8");
|
|
26480
26489
|
} catch {
|
|
26481
26490
|
return [];
|
|
26482
26491
|
}
|
|
@@ -26530,7 +26539,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file) => file.endsWith(".ts") || f
|
|
|
26530
26539
|
};
|
|
26531
26540
|
visit(sourceFile);
|
|
26532
26541
|
return out;
|
|
26533
|
-
}, safeNormalize = (path) =>
|
|
26542
|
+
}, safeNormalize = (path) => resolve45(path).replace(/\\/g, "/"), resolveOwningComponents = (params) => {
|
|
26534
26543
|
const { changedFilePath, userAngularRoot } = params;
|
|
26535
26544
|
const changedAbs = safeNormalize(changedFilePath);
|
|
26536
26545
|
const out = [];
|
|
@@ -26566,12 +26575,12 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file) => file.endsWith(".ts") || f
|
|
|
26566
26575
|
}, indexByRoot, resolveParentClassFile = (parentName, childFilePath, angularRoot) => {
|
|
26567
26576
|
let source;
|
|
26568
26577
|
try {
|
|
26569
|
-
source =
|
|
26578
|
+
source = readFileSync34(childFilePath, "utf8");
|
|
26570
26579
|
} catch {
|
|
26571
26580
|
return null;
|
|
26572
26581
|
}
|
|
26573
26582
|
const sourceFile = ts19.createSourceFile(childFilePath, source, ts19.ScriptTarget.ES2022, true, ts19.ScriptKind.TS);
|
|
26574
|
-
const childDir =
|
|
26583
|
+
const childDir = dirname31(childFilePath);
|
|
26575
26584
|
for (const stmt of sourceFile.statements) {
|
|
26576
26585
|
if (!ts19.isImportDeclaration(stmt))
|
|
26577
26586
|
continue;
|
|
@@ -26599,7 +26608,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file) => file.endsWith(".ts") || f
|
|
|
26599
26608
|
if (!spec.startsWith(".") && !spec.startsWith("/")) {
|
|
26600
26609
|
return null;
|
|
26601
26610
|
}
|
|
26602
|
-
const base =
|
|
26611
|
+
const base = resolve45(childDir, spec);
|
|
26603
26612
|
const candidates = [
|
|
26604
26613
|
`${base}.ts`,
|
|
26605
26614
|
`${base}.tsx`,
|
|
@@ -26628,7 +26637,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file) => file.endsWith(".ts") || f
|
|
|
26628
26637
|
const parentFile = new Map;
|
|
26629
26638
|
for (const tsPath of walkAngularSourceFiles(userAngularRoot)) {
|
|
26630
26639
|
const classes = parseDecoratedClasses(tsPath);
|
|
26631
|
-
const componentDir =
|
|
26640
|
+
const componentDir = dirname31(tsPath);
|
|
26632
26641
|
for (const cls of classes) {
|
|
26633
26642
|
const entity = {
|
|
26634
26643
|
className: cls.className,
|
|
@@ -26637,7 +26646,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file) => file.endsWith(".ts") || f
|
|
|
26637
26646
|
};
|
|
26638
26647
|
if (cls.kind === "component") {
|
|
26639
26648
|
for (const url of [...cls.templateUrls, ...cls.styleUrls]) {
|
|
26640
|
-
const abs = safeNormalize(
|
|
26649
|
+
const abs = safeNormalize(resolve45(componentDir, url));
|
|
26641
26650
|
const existing = resource.get(abs);
|
|
26642
26651
|
if (existing)
|
|
26643
26652
|
existing.push(entity);
|
|
@@ -26905,7 +26914,7 @@ var init_webSocket = __esm(() => {
|
|
|
26905
26914
|
});
|
|
26906
26915
|
|
|
26907
26916
|
// src/utils/loadConfig.ts
|
|
26908
|
-
import { resolve as
|
|
26917
|
+
import { resolve as resolve46 } from "path";
|
|
26909
26918
|
var RESERVED_TOP_LEVEL_KEYS, isObject2 = (value) => typeof value === "object" && value !== null, isCommandService = (service) => service.kind === "command" || Array.isArray(service.command), isServiceCandidate = (value) => isObject2(value) && (typeof value.entry === "string" || Array.isArray(value.command)), isWorkspaceConfig = (config) => {
|
|
26910
26919
|
if (!isObject2(config)) {
|
|
26911
26920
|
return false;
|
|
@@ -26956,7 +26965,7 @@ var RESERVED_TOP_LEVEL_KEYS, isObject2 = (value) => typeof value === "object" &&
|
|
|
26956
26965
|
}
|
|
26957
26966
|
return config;
|
|
26958
26967
|
}, loadRawConfig = async (configPath) => {
|
|
26959
|
-
const resolved =
|
|
26968
|
+
const resolved = resolve46(configPath ?? process.env.ABSOLUTE_CONFIG ?? "absolute.config.ts");
|
|
26960
26969
|
const mod = await import(resolved);
|
|
26961
26970
|
const config = mod.default ?? mod.config;
|
|
26962
26971
|
if (!config) {
|
|
@@ -27082,7 +27091,7 @@ var init_hotResources = __esm(() => {
|
|
|
27082
27091
|
});
|
|
27083
27092
|
|
|
27084
27093
|
// src/plugins/openApiPlugin.ts
|
|
27085
|
-
import { existsSync as existsSync41, readFileSync as
|
|
27094
|
+
import { existsSync as existsSync41, readFileSync as readFileSync35 } from "fs";
|
|
27086
27095
|
import { join as join52 } from "path";
|
|
27087
27096
|
var FALLBACK_NAME = "AbsoluteJS API", FALLBACK_VERSION = "1.0.0", projectInfo = (cwd) => {
|
|
27088
27097
|
const path = join52(cwd, "package.json");
|
|
@@ -27090,7 +27099,7 @@ var FALLBACK_NAME = "AbsoluteJS API", FALLBACK_VERSION = "1.0.0", projectInfo =
|
|
|
27090
27099
|
return { name: FALLBACK_NAME, version: FALLBACK_VERSION };
|
|
27091
27100
|
}
|
|
27092
27101
|
try {
|
|
27093
|
-
const pkg = JSON.parse(
|
|
27102
|
+
const pkg = JSON.parse(readFileSync35(path, "utf-8"));
|
|
27094
27103
|
return {
|
|
27095
27104
|
name: typeof pkg.name === "string" ? pkg.name : FALLBACK_NAME,
|
|
27096
27105
|
version: typeof pkg.version === "string" ? pkg.version : FALLBACK_VERSION
|
|
@@ -27139,14 +27148,14 @@ var FALLBACK_NAME = "AbsoluteJS API", FALLBACK_VERSION = "1.0.0", projectInfo =
|
|
|
27139
27148
|
var init_openApiPlugin = () => {};
|
|
27140
27149
|
|
|
27141
27150
|
// src/plugins/telemetryPlugin.ts
|
|
27142
|
-
import { existsSync as existsSync42, readFileSync as
|
|
27151
|
+
import { existsSync as existsSync42, readFileSync as readFileSync36 } from "fs";
|
|
27143
27152
|
import { join as join53 } from "path";
|
|
27144
27153
|
var OTEL_PACKAGE = "@elysia/opentelemetry", readPackageName = (cwd) => {
|
|
27145
27154
|
const path = join53(cwd, "package.json");
|
|
27146
27155
|
if (!existsSync42(path))
|
|
27147
27156
|
return null;
|
|
27148
27157
|
try {
|
|
27149
|
-
const pkg = JSON.parse(
|
|
27158
|
+
const pkg = JSON.parse(readFileSync36(path, "utf-8"));
|
|
27150
27159
|
return typeof pkg.name === "string" ? pkg.name : null;
|
|
27151
27160
|
} catch {
|
|
27152
27161
|
return null;
|
|
@@ -27539,7 +27548,7 @@ var init_requestContext = __esm(() => {
|
|
|
27539
27548
|
});
|
|
27540
27549
|
|
|
27541
27550
|
// src/core/loadIslandRegistry.ts
|
|
27542
|
-
import { resolve as
|
|
27551
|
+
import { resolve as resolve47 } from "path";
|
|
27543
27552
|
var isRecord6 = (value) => typeof value === "object" && value !== null, resolveRegistryExport2 = (mod) => {
|
|
27544
27553
|
if (isRecord6(mod.islandRegistry))
|
|
27545
27554
|
return mod.islandRegistry;
|
|
@@ -27547,7 +27556,7 @@ var isRecord6 = (value) => typeof value === "object" && value !== null, resolveR
|
|
|
27547
27556
|
return mod.default;
|
|
27548
27557
|
throw new Error("Island registry module must export `islandRegistry` or a default registry object.");
|
|
27549
27558
|
}, isRegistryModuleExport = (value) => isRecord6(value), isIslandRegistryInput = (value) => isRecord6(value), loadIslandRegistry = async (registryPath) => {
|
|
27550
|
-
const resolvedRegistryPath =
|
|
27559
|
+
const resolvedRegistryPath = resolve47(registryPath);
|
|
27551
27560
|
const buildInfo = await loadIslandRegistryBuildInfo(resolvedRegistryPath);
|
|
27552
27561
|
if (buildInfo.definitions.length > 0) {
|
|
27553
27562
|
return buildInfo.registry;
|
|
@@ -27754,12 +27763,12 @@ var exports_config = {};
|
|
|
27754
27763
|
__export(exports_config, {
|
|
27755
27764
|
normalizeAbsoluteMobileConfig: () => normalizeAbsoluteMobileConfig
|
|
27756
27765
|
});
|
|
27757
|
-
import { readFileSync as
|
|
27758
|
-
import { resolve as
|
|
27766
|
+
import { readFileSync as readFileSync37 } from "fs";
|
|
27767
|
+
import { resolve as resolve48 } from "path";
|
|
27759
27768
|
import { createHash as createHash4, createPublicKey, X509Certificate } from "crypto";
|
|
27760
27769
|
var APP_ID_PATTERN, SCHEME_PATTERN, APPLE_APP_ID_PREFIX_PATTERN, CERTIFICATE_FINGERPRINT_PATTERN, UPDATE_NAME_PATTERN, RELEASE_TARGET_PATTERN, UPDATE_PUBLIC_KEY_PATTERN, ENVIRONMENT_NAME_PATTERN, COLOR_PATTERN, DEFAULT_UPDATE_BOOT_TIMEOUT_MS = 20000, DEFAULT_UPDATE_HEALTH_FAILURE_RATE = 0.2, DEFAULT_UPDATE_HEALTH_MINIMUM_REPORTS = 20, DEFAULT_UPDATE_ROLLOUT_FAILURE_RATE = 0.05, DEFAULT_UPDATE_ROLLOUT_OBSERVATION_MINUTES = 60, MINUTE_MS, DEFAULT_UPDATE_ROLLOUT_STAGES, MINIMUM_UPDATE_BOOT_TIMEOUT_MS = 5000, MAXIMUM_UPDATE_BOOT_TIMEOUT_MS = 120000, HOSTNAME_PATTERN, EXPO_RESERVED_ROUTE_PREFIXES, resolveProjectPath = (projectRoot, value, field) => {
|
|
27761
|
-
const root =
|
|
27762
|
-
const path =
|
|
27770
|
+
const root = resolve48(projectRoot);
|
|
27771
|
+
const path = resolve48(root, value);
|
|
27763
27772
|
if (path !== root && !path.startsWith(`${root}/`)) {
|
|
27764
27773
|
throw new TypeError(`${field} must remain inside the project root.`);
|
|
27765
27774
|
}
|
|
@@ -27953,7 +27962,7 @@ var APP_ID_PATTERN, SCHEME_PATTERN, APPLE_APP_ID_PREFIX_PATTERN, CERTIFICATE_FIN
|
|
|
27953
27962
|
}))
|
|
27954
27963
|
].sort(), readExpoCodeSigningCertificate = (certificatePath) => {
|
|
27955
27964
|
try {
|
|
27956
|
-
const certificateSource =
|
|
27965
|
+
const certificateSource = readFileSync37(certificatePath, "utf8");
|
|
27957
27966
|
const certificatePem = certificateSource.endsWith(`
|
|
27958
27967
|
`) ? certificateSource : `${certificateSource}
|
|
27959
27968
|
`;
|
|
@@ -28278,7 +28287,7 @@ import {
|
|
|
28278
28287
|
rm as rm11,
|
|
28279
28288
|
writeFile as writeFile10
|
|
28280
28289
|
} from "fs/promises";
|
|
28281
|
-
import { resolve as
|
|
28290
|
+
import { resolve as resolve49 } from "path";
|
|
28282
28291
|
import { Elysia as Elysia4 } from "elysia";
|
|
28283
28292
|
var JSON_HEADERS, OWNERSHIP_FILE = ".absolutejs-mobile-associations.json", HTTP_OK = 200, VERIFY_TIMEOUT_MS = 1e4, ANDROID_ASSOCIATION_PATH = "/.well-known/assetlinks.json", APPLE_ASSOCIATION_PATH = "/.well-known/apple-app-site-association", missingIdentity = (field, platform) => new TypeError(`${field} is required to publish ${platform} deep-link association files.`), createAppleDocument = (config, requireAll) => {
|
|
28284
28293
|
if (!config.platforms.includes("ios"))
|
|
@@ -28365,7 +28374,7 @@ var JSON_HEADERS, OWNERSHIP_FILE = ".absolutejs-mobile-associations.json", HTTP_
|
|
|
28365
28374
|
return false;
|
|
28366
28375
|
}
|
|
28367
28376
|
}, assertOwnedOutput = async (root) => {
|
|
28368
|
-
const path =
|
|
28377
|
+
const path = resolve49(root, OWNERSHIP_FILE);
|
|
28369
28378
|
let ownership;
|
|
28370
28379
|
try {
|
|
28371
28380
|
ownership = JSON.parse(await readFile9(path, "utf8"));
|
|
@@ -28392,10 +28401,10 @@ var JSON_HEADERS, OWNERSHIP_FILE = ".absolutejs-mobile-associations.json", HTTP_
|
|
|
28392
28401
|
if (hasCurrent)
|
|
28393
28402
|
await rm11(backup, { force: true, recursive: true });
|
|
28394
28403
|
}, materializeHost = async (root, host, files) => {
|
|
28395
|
-
const directory =
|
|
28404
|
+
const directory = resolve49(root, host, ".well-known");
|
|
28396
28405
|
await mkdir12(directory, { recursive: true });
|
|
28397
28406
|
return Promise.all(files.map(async ([name, document2]) => {
|
|
28398
|
-
const path =
|
|
28407
|
+
const path = resolve49(directory, name);
|
|
28399
28408
|
await writeAtomic(path, `${JSON.stringify(document2, null, 2)}
|
|
28400
28409
|
`);
|
|
28401
28410
|
return path;
|
|
@@ -28418,7 +28427,7 @@ var JSON_HEADERS, OWNERSHIP_FILE = ".absolutejs-mobile-associations.json", HTTP_
|
|
|
28418
28427
|
});
|
|
28419
28428
|
return endpoints;
|
|
28420
28429
|
}), materializeAbsoluteMobileAssociationFiles = async (config, outputDirectory) => {
|
|
28421
|
-
const root =
|
|
28430
|
+
const root = resolve49(outputDirectory);
|
|
28422
28431
|
const temporary = `${root}.${crypto.randomUUID()}.tmp`;
|
|
28423
28432
|
const documents = createAbsoluteMobileAssociationDocuments(config, {
|
|
28424
28433
|
requireAll: true
|
|
@@ -28432,10 +28441,10 @@ var JSON_HEADERS, OWNERSHIP_FILE = ".absolutejs-mobile-associations.json", HTTP_
|
|
|
28432
28441
|
await mkdir12(temporary, { recursive: true });
|
|
28433
28442
|
try {
|
|
28434
28443
|
const temporaryPaths = (await Promise.all(config.deepLinkHosts.map((host) => materializeHost(temporary, host, files)))).flat();
|
|
28435
|
-
await writeAtomic(
|
|
28444
|
+
await writeAtomic(resolve49(temporary, OWNERSHIP_FILE), `${JSON.stringify({ format: 1, hosts: config.deepLinkHosts }, null, 2)}
|
|
28436
28445
|
`);
|
|
28437
28446
|
await publishGeneratedDirectory(temporary, root);
|
|
28438
|
-
const written = temporaryPaths.map((path) =>
|
|
28447
|
+
const written = temporaryPaths.map((path) => resolve49(root, path.slice(temporary.length + 1)));
|
|
28439
28448
|
return { root, written };
|
|
28440
28449
|
} catch (error) {
|
|
28441
28450
|
await rm11(temporary, { force: true, recursive: true });
|
|
@@ -28555,11 +28564,11 @@ var init_mobilePreview = __esm(() => {
|
|
|
28555
28564
|
});
|
|
28556
28565
|
|
|
28557
28566
|
// src/mobile/nativeAuth.ts
|
|
28558
|
-
import { readFileSync as
|
|
28567
|
+
import { readFileSync as readFileSync38 } from "fs";
|
|
28559
28568
|
import { join as join54 } from "path";
|
|
28560
28569
|
var ABSOLUTE_AUTH_PACKAGE = "@absolutejs/auth", ABSOLUTE_EXPO_AUTH_CORE_VERSION = "0.76.3", ABSOLUTE_EXPO_AUTH_PACKAGE = "@absolutejs/auth-expo", ABSOLUTE_EXPO_AUTH_VERSION = "0.0.6", ABSOLUTE_EXPO_SYNC_CORE_VERSION = "2.31.0", ABSOLUTE_EXPO_SYNC_PACKAGE = "@absolutejs/sync-expo", ABSOLUTE_EXPO_SYNC_VERSION = "0.0.4", ABSOLUTE_NATIVE_AUTH_CLIENTS_ENV = "ABSOLUTE_AUTH_NATIVE_CLIENTS", ABSOLUTE_NATIVE_AUTH_SCOPES, ABSOLUTE_SYNC_PACKAGE = "@absolutejs/sync", readPackageManifest = (projectRoot) => {
|
|
28561
28570
|
try {
|
|
28562
|
-
return JSON.parse(
|
|
28571
|
+
return JSON.parse(readFileSync38(join54(projectRoot, "package.json"), "utf8"));
|
|
28563
28572
|
} catch {
|
|
28564
28573
|
return;
|
|
28565
28574
|
}
|
|
@@ -29224,12 +29233,12 @@ import {
|
|
|
29224
29233
|
X509Certificate as X509Certificate3
|
|
29225
29234
|
} from "crypto";
|
|
29226
29235
|
import { access as access4, mkdir as mkdir13 } from "fs/promises";
|
|
29227
|
-
import { dirname as
|
|
29236
|
+
import { dirname as dirname32, isAbsolute as isAbsolute9, relative as relative21, resolve as resolve50, sep as sep7 } from "path";
|
|
29228
29237
|
import { pathToFileURL as pathToFileURL3 } from "url";
|
|
29229
29238
|
import { Elysia as Elysia6 } from "elysia";
|
|
29230
29239
|
var ABSOLUTE_MOBILE_UPDATE_SERVER_FORMAT = 1, DEFAULT_MOBILE_UPDATE_REGISTRY_MODULE = "mobile.update.ts", object4 = (value) => typeof value === "object" && value !== null && !Array.isArray(value), projectPath = (projectRoot, requested) => {
|
|
29231
|
-
const root =
|
|
29232
|
-
const path =
|
|
29240
|
+
const root = resolve50(projectRoot);
|
|
29241
|
+
const path = resolve50(root, requested);
|
|
29233
29242
|
const projectRelative = relative21(root, path);
|
|
29234
29243
|
if (projectRelative === ".." || projectRelative.startsWith(`..${sep7}`) || isAbsolute9(projectRelative))
|
|
29235
29244
|
throw new TypeError("mobile.updates.server.registry must remain inside the project.");
|
|
@@ -29449,7 +29458,7 @@ ${generated}`);
|
|
|
29449
29458
|
return;
|
|
29450
29459
|
});
|
|
29451
29460
|
}
|
|
29452
|
-
await mkdir13(
|
|
29461
|
+
await mkdir13(dirname32(path), { recursive: true });
|
|
29453
29462
|
await Bun.write(path, renderAbsoluteMobileUpdateRegistry({
|
|
29454
29463
|
...options.health ? { health: options.health } : {},
|
|
29455
29464
|
...options.rollout ? { rollout: options.rollout } : {},
|
|
@@ -29500,7 +29509,7 @@ var init_bridgeInternals = __esm(() => {
|
|
|
29500
29509
|
});
|
|
29501
29510
|
|
|
29502
29511
|
// src/dev/angular/hmrCompiler.ts
|
|
29503
|
-
import { dirname as
|
|
29512
|
+
import { dirname as dirname33, relative as relative22, resolve as resolve51 } from "path";
|
|
29504
29513
|
import { performance as performance2 } from "perf_hooks";
|
|
29505
29514
|
var encodeHmrComponentId = (absoluteFilePath, className) => {
|
|
29506
29515
|
const projectRel = relative22(process.cwd(), absoluteFilePath).replace(/\\/g, "/");
|
|
@@ -29512,7 +29521,7 @@ var encodeHmrComponentId = (absoluteFilePath, className) => {
|
|
|
29512
29521
|
return null;
|
|
29513
29522
|
const filePathRel = decoded.slice(0, separatorIndex);
|
|
29514
29523
|
const className = decoded.slice(separatorIndex + 1);
|
|
29515
|
-
const componentFilePath =
|
|
29524
|
+
const componentFilePath = resolve51(process.cwd(), filePathRel);
|
|
29516
29525
|
const projectRelPath = relative22(process.cwd(), componentFilePath).replace(/\\/g, "/");
|
|
29517
29526
|
const cacheKey = encodeURIComponent(`${projectRelPath}@${className}`);
|
|
29518
29527
|
await Promise.resolve().then(() => init_fastHmrCompiler());
|
|
@@ -29523,7 +29532,7 @@ var encodeHmrComponentId = (absoluteFilePath, className) => {
|
|
|
29523
29532
|
await Promise.resolve().then(() => init_resolveOwningComponents());
|
|
29524
29533
|
const owners = resolveOwningComponents({
|
|
29525
29534
|
changedFilePath: componentFilePath,
|
|
29526
|
-
userAngularRoot:
|
|
29535
|
+
userAngularRoot: dirname33(componentFilePath)
|
|
29527
29536
|
});
|
|
29528
29537
|
const owner = owners.find((o) => o.className === className);
|
|
29529
29538
|
const kind = owner?.kind ?? "component";
|
|
@@ -29717,17 +29726,17 @@ var init_hmr = __esm(() => {
|
|
|
29717
29726
|
});
|
|
29718
29727
|
|
|
29719
29728
|
// src/plugins/devtoolsJson.ts
|
|
29720
|
-
import { existsSync as existsSync43, mkdirSync as mkdirSync14, readFileSync as
|
|
29721
|
-
import { dirname as
|
|
29729
|
+
import { existsSync as existsSync43, mkdirSync as mkdirSync14, readFileSync as readFileSync39, writeFileSync as writeFileSync10 } from "fs";
|
|
29730
|
+
import { dirname as dirname34, join as join57, resolve as resolve52 } from "path";
|
|
29722
29731
|
import { Elysia as Elysia8 } from "elysia";
|
|
29723
29732
|
var ENDPOINT = "/.well-known/appspecific/com.chrome.devtools.json", UUID_CACHE_KEY = "__absoluteDevtoolsWorkspaceUuid", getGlobalUuid = () => Reflect.get(globalThis, UUID_CACHE_KEY), setGlobalUuid = (uuid) => {
|
|
29724
29733
|
Reflect.set(globalThis, UUID_CACHE_KEY, uuid);
|
|
29725
29734
|
return uuid;
|
|
29726
|
-
}, 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) =>
|
|
29735
|
+
}, 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) => resolve52(uuidCachePath ?? join57(buildDir, ".absolute", "chrome-devtools-workspace-uuid")), readCachedUuid = (cachePath) => {
|
|
29727
29736
|
if (!existsSync43(cachePath))
|
|
29728
29737
|
return null;
|
|
29729
29738
|
try {
|
|
29730
|
-
const value =
|
|
29739
|
+
const value = readFileSync39(cachePath, "utf-8").trim();
|
|
29731
29740
|
return isUuidV4(value) ? value : null;
|
|
29732
29741
|
} catch {
|
|
29733
29742
|
return null;
|
|
@@ -29745,11 +29754,11 @@ var ENDPOINT = "/.well-known/appspecific/com.chrome.devtools.json", UUID_CACHE_K
|
|
|
29745
29754
|
if (cachedUuid)
|
|
29746
29755
|
return setGlobalUuid(cachedUuid);
|
|
29747
29756
|
const uuid = crypto.randomUUID();
|
|
29748
|
-
mkdirSync14(
|
|
29757
|
+
mkdirSync14(dirname34(cachePath), { recursive: true });
|
|
29749
29758
|
writeFileSync10(cachePath, uuid, "utf-8");
|
|
29750
29759
|
return setGlobalUuid(uuid);
|
|
29751
29760
|
}, devtoolsJson = (buildDir, options = {}) => {
|
|
29752
|
-
const rootPath =
|
|
29761
|
+
const rootPath = resolve52(options.projectRoot ?? process.cwd());
|
|
29753
29762
|
const root = options.normalizeForWindowsContainer === false ? rootPath : normalizeDevtoolsWorkspaceRoot(rootPath);
|
|
29754
29763
|
const uuid = getOrCreateUuid(buildDir, options);
|
|
29755
29764
|
return new Elysia8({ name: "absolute-devtools-json" }).get(ENDPOINT, () => ({
|
|
@@ -29774,7 +29783,7 @@ var init_devtoolsJson = () => {};
|
|
|
29774
29783
|
|
|
29775
29784
|
// src/plugins/imageOptimizer.ts
|
|
29776
29785
|
import { existsSync as existsSync44 } from "fs";
|
|
29777
|
-
import { resolve as
|
|
29786
|
+
import { resolve as resolve53 } from "path";
|
|
29778
29787
|
import { Elysia as Elysia9 } from "elysia";
|
|
29779
29788
|
var DEFAULT_CACHE_TTL_SECONDS = 60, MS_PER_SECOND = 1000, MAX_QUALITY = 100, avifInProgress, safeResolve = (path, baseDir) => {
|
|
29780
29789
|
try {
|
|
@@ -29787,7 +29796,7 @@ var DEFAULT_CACHE_TTL_SECONDS = 60, MS_PER_SECOND = 1000, MAX_QUALITY = 100, avi
|
|
|
29787
29796
|
}
|
|
29788
29797
|
}, resolveLocalImage = (url, buildDir) => {
|
|
29789
29798
|
const cleanPath = url.startsWith("/") ? url.slice(1) : url;
|
|
29790
|
-
return safeResolve(cleanPath, buildDir) ?? safeResolve(cleanPath,
|
|
29799
|
+
return safeResolve(cleanPath, buildDir) ?? safeResolve(cleanPath, resolve53(process.cwd()));
|
|
29791
29800
|
}, parseQueryParams = (query, allowedSizes, defaultQuality) => {
|
|
29792
29801
|
const url = typeof query["url"] === "string" ? query["url"] : undefined;
|
|
29793
29802
|
const wParam = typeof query["w"] === "string" ? query["w"] : undefined;
|
|
@@ -30514,7 +30523,7 @@ import {
|
|
|
30514
30523
|
rm as rm14,
|
|
30515
30524
|
writeFile as writeFile13
|
|
30516
30525
|
} from "fs/promises";
|
|
30517
|
-
import { dirname as
|
|
30526
|
+
import { dirname as dirname35, join as join59, resolve as resolvePath2 } from "path";
|
|
30518
30527
|
import { pathToFileURL as pathToFileURL5 } from "url";
|
|
30519
30528
|
var ABSOLUTE_MOBILE_MATERIALIZED_BUNDLE_FORMAT = 1, CURRENT_BUNDLE_FILE = "current.json", BUNDLES_DIRECTORY = "bundles", ARTIFACT_FILE2 = "artifact.json", BUNDLE_ID_PATTERN, isRecord9 = (value) => typeof value === "object" && value !== null && !Array.isArray(value), errorHasCode2 = (error, code) => typeof error === "object" && error !== null && Reflect.get(error, "code") === code, bundleIdFor = (currentReleaseId, releases) => {
|
|
30520
30529
|
const identity = JSON.stringify({
|
|
@@ -30547,7 +30556,7 @@ var ABSOLUTE_MOBILE_MATERIALIZED_BUNDLE_FORMAT = 1, CURRENT_BUNDLE_FILE = "curre
|
|
|
30547
30556
|
}, writeRelease = async (root, release) => {
|
|
30548
30557
|
const directory = join59(root, release.artifact.releaseId);
|
|
30549
30558
|
const producerPath = join59(directory, release.artifact.producer.module);
|
|
30550
|
-
await mkdir15(
|
|
30559
|
+
await mkdir15(dirname35(producerPath), { recursive: true });
|
|
30551
30560
|
await Promise.all([
|
|
30552
30561
|
writeFile13(join59(directory, ARTIFACT_FILE2), `${JSON.stringify(release.artifact, null, "\t")}
|
|
30553
30562
|
`),
|
|
@@ -31185,7 +31194,7 @@ var init_compatibilityDispatcher = __esm(() => {
|
|
|
31185
31194
|
});
|
|
31186
31195
|
|
|
31187
31196
|
// src/core/prerender.ts
|
|
31188
|
-
import { mkdirSync as mkdirSync15, readFileSync as
|
|
31197
|
+
import { mkdirSync as mkdirSync15, readFileSync as readFileSync40 } from "fs";
|
|
31189
31198
|
import { join as join60 } from "path";
|
|
31190
31199
|
var DEFAULT_FETCH_TIMEOUT_MS = 1e4, PRERENDER_BYPASS_HEADER = "X-Absolute-Prerender-Bypass", routeToFilename = (route) => route === "/" ? "index.html" : `${route.slice(1).replace(/\//g, "-")}.html`, writeTimestamp = async (htmlPath) => {
|
|
31191
31200
|
const metaPath = htmlPath.replace(/\.html$/, ".meta");
|
|
@@ -31193,7 +31202,7 @@ var DEFAULT_FETCH_TIMEOUT_MS = 1e4, PRERENDER_BYPASS_HEADER = "X-Absolute-Preren
|
|
|
31193
31202
|
}, readTimestamp = (htmlPath) => {
|
|
31194
31203
|
const metaPath = htmlPath.replace(/\.html$/, ".meta");
|
|
31195
31204
|
try {
|
|
31196
|
-
const content =
|
|
31205
|
+
const content = readFileSync40(metaPath, "utf-8");
|
|
31197
31206
|
return Number(content) || 0;
|
|
31198
31207
|
} catch {
|
|
31199
31208
|
return 0;
|
|
@@ -31229,7 +31238,7 @@ var init_prerender = () => {};
|
|
|
31229
31238
|
|
|
31230
31239
|
// src/core/prepare.ts
|
|
31231
31240
|
import { createHash as createHash9 } from "crypto";
|
|
31232
|
-
import { existsSync as existsSync45, readdirSync as readdirSync12, readFileSync as
|
|
31241
|
+
import { existsSync as existsSync45, readdirSync as readdirSync12, readFileSync as readFileSync41 } from "fs";
|
|
31233
31242
|
import { basename as basename19, join as join61, relative as relative23, resolve as resolvePath3 } from "path";
|
|
31234
31243
|
import { Elysia as Elysia12, NotFound } from "elysia";
|
|
31235
31244
|
var MS_PER_SECOND2 = 1000, DEFAULT_PORT2 = 3000, MAX_STATIC_ROUTE_COUNT, STATIC_PLUGIN_RETRY_DELAY_MS = 50, waitForStaticPluginRetry = () => new Promise((resolve) => {
|
|
@@ -31374,7 +31383,7 @@ var MS_PER_SECOND2 = 1000, DEFAULT_PORT2 = 3000, MAX_STATIC_ROUTE_COUNT, STATIC_
|
|
|
31374
31383
|
const filePath = join61(buildDir, path);
|
|
31375
31384
|
let versioned = href;
|
|
31376
31385
|
if (existsSync45(filePath)) {
|
|
31377
|
-
const hash = createHash9("sha256").update(
|
|
31386
|
+
const hash = createHash9("sha256").update(readFileSync41(filePath)).digest("hex").slice(0, ICON_HASH_LENGTH);
|
|
31378
31387
|
versioned = href.includes("?") ? `${href}&v=${hash}` : `${href}?v=${hash}`;
|
|
31379
31388
|
}
|
|
31380
31389
|
cache.set(href, versioned);
|
|
@@ -31569,7 +31578,7 @@ var MS_PER_SECOND2 = 1000, DEFAULT_PORT2 = 3000, MAX_STATIC_ROUTE_COUNT, STATIC_
|
|
|
31569
31578
|
return result;
|
|
31570
31579
|
}
|
|
31571
31580
|
stepStartedAt = performance.now();
|
|
31572
|
-
const manifest = JSON.parse(
|
|
31581
|
+
const manifest = JSON.parse(readFileSync41(`${buildDir}/manifest.json`, "utf-8"));
|
|
31573
31582
|
setCurrentIslandManifest(manifest);
|
|
31574
31583
|
if (config.islands?.registry) {
|
|
31575
31584
|
setCurrentIslandRegistry(await loadIslandRegistry(config.islands.registry));
|
|
@@ -31579,12 +31588,12 @@ var MS_PER_SECOND2 = 1000, DEFAULT_PORT2 = 3000, MAX_STATIC_ROUTE_COUNT, STATIC_
|
|
|
31579
31588
|
stepStartedAt = performance.now();
|
|
31580
31589
|
const conventionsPath = join61(buildDir, "conventions.json");
|
|
31581
31590
|
if (existsSync45(conventionsPath)) {
|
|
31582
|
-
const conventions = JSON.parse(
|
|
31591
|
+
const conventions = JSON.parse(readFileSync41(conventionsPath, "utf-8"));
|
|
31583
31592
|
setConventions(conventions);
|
|
31584
31593
|
}
|
|
31585
31594
|
const spaRoutesPath = join61(buildDir, "spa-routes.json");
|
|
31586
31595
|
if (existsSync45(spaRoutesPath)) {
|
|
31587
|
-
setSpaRouteManifest(JSON.parse(
|
|
31596
|
+
setSpaRouteManifest(JSON.parse(readFileSync41(spaRoutesPath, "utf-8")));
|
|
31588
31597
|
}
|
|
31589
31598
|
recordStep("load production conventions", stepStartedAt);
|
|
31590
31599
|
stepStartedAt = performance.now();
|
|
@@ -31755,8 +31764,8 @@ __export(exports_moduleServer, {
|
|
|
31755
31764
|
warmPage: () => warmPage,
|
|
31756
31765
|
warnIfReactFastRefreshUnsupported: () => warnIfReactFastRefreshUnsupported
|
|
31757
31766
|
});
|
|
31758
|
-
import { existsSync as existsSync46, readFileSync as
|
|
31759
|
-
import { basename as basename20, dirname as
|
|
31767
|
+
import { existsSync as existsSync46, readFileSync as readFileSync42, realpathSync as realpathSync7, statSync as statSync9 } from "fs";
|
|
31768
|
+
import { basename as basename20, dirname as dirname36, extname as extname16, join as join62, resolve as resolve54, relative as relative24 } from "path";
|
|
31760
31769
|
var SRC_PREFIX = "/@src/", BROWSER_DEFINE, jsTranspiler2, legacyDecoratorTsconfig, tsTranspiler2, tsxTranspiler, TRANSPILABLE, ALL_EXPORTS_RE, STRING_CONTENTS_RE, preserveTypeExports = (originalSource, transpiled, valueExports) => {
|
|
31761
31770
|
const codeOnly = originalSource.replace(STRING_CONTENTS_RE, '""');
|
|
31762
31771
|
const allExports = [];
|
|
@@ -31776,10 +31785,10 @@ var SRC_PREFIX = "/@src/", BROWSER_DEFINE, jsTranspiler2, legacyDecoratorTsconfi
|
|
|
31776
31785
|
${stubs}
|
|
31777
31786
|
`;
|
|
31778
31787
|
}, resolveRelativeExtension = (srcPath, projectRoot, extensions) => {
|
|
31779
|
-
const directHit = extensions.find((ext) => existsSync46(
|
|
31788
|
+
const directHit = extensions.find((ext) => existsSync46(resolve54(projectRoot, srcPath + ext)));
|
|
31780
31789
|
if (directHit)
|
|
31781
31790
|
return srcPath + directHit;
|
|
31782
|
-
const indexHit = extensions.find((ext) => existsSync46(
|
|
31791
|
+
const indexHit = extensions.find((ext) => existsSync46(resolve54(projectRoot, srcPath, `index${ext}`)));
|
|
31783
31792
|
if (indexHit)
|
|
31784
31793
|
return `${srcPath}/index${indexHit}`;
|
|
31785
31794
|
return srcPath;
|
|
@@ -31808,7 +31817,7 @@ ${stubs}
|
|
|
31808
31817
|
return invalidationVersion > 0 ? `${mtime}.${invalidationVersion}` : `${mtime}`;
|
|
31809
31818
|
}, srcUrl = (relPath, projectRoot) => {
|
|
31810
31819
|
const base = `${SRC_PREFIX}${encodeSrcPath(relPath)}`;
|
|
31811
|
-
const absPath =
|
|
31820
|
+
const absPath = resolve54(projectRoot, relPath);
|
|
31812
31821
|
const cached = mtimeCache.get(absPath);
|
|
31813
31822
|
if (cached !== undefined)
|
|
31814
31823
|
return `${base}?v=${buildVersion(cached, absPath)}`;
|
|
@@ -31820,12 +31829,12 @@ ${stubs}
|
|
|
31820
31829
|
return base;
|
|
31821
31830
|
}
|
|
31822
31831
|
}, resolveRelativeImport = (relPath, fileDir, projectRoot, extensions) => {
|
|
31823
|
-
const absPath =
|
|
31832
|
+
const absPath = resolve54(fileDir, relPath);
|
|
31824
31833
|
const rel = relative24(projectRoot, absPath);
|
|
31825
31834
|
const extension = extname16(rel);
|
|
31826
31835
|
let srcPath = RESOLVED_MODULE_EXTENSIONS.has(extension) ? rel : resolveRelativeExtension(rel, projectRoot, extensions);
|
|
31827
31836
|
if (extname16(srcPath) === ".svelte") {
|
|
31828
|
-
srcPath = relative24(projectRoot, resolveSvelteModulePath(
|
|
31837
|
+
srcPath = relative24(projectRoot, resolveSvelteModulePath(resolve54(projectRoot, srcPath)));
|
|
31829
31838
|
}
|
|
31830
31839
|
return srcUrl(srcPath, projectRoot);
|
|
31831
31840
|
}, NODE_BUILTIN_RE, resolveAbsoluteSpecifier = (specifier, projectRoot) => {
|
|
@@ -31844,13 +31853,13 @@ ${stubs}
|
|
|
31844
31853
|
const packageName = isScoped ? `${parts[0]}/${parts[1]}` : parts[0];
|
|
31845
31854
|
const subpath = isScoped ? parts.slice(2).join("/") : parts.slice(1).join("/");
|
|
31846
31855
|
if (!subpath) {
|
|
31847
|
-
const pkgDir =
|
|
31856
|
+
const pkgDir = resolve54(projectRoot, "node_modules", packageName ?? "");
|
|
31848
31857
|
const pkgJsonPath = join62(pkgDir, "package.json");
|
|
31849
31858
|
if (existsSync46(pkgJsonPath)) {
|
|
31850
|
-
const pkg = JSON.parse(
|
|
31859
|
+
const pkg = JSON.parse(readFileSync42(pkgJsonPath, "utf-8"));
|
|
31851
31860
|
const esmEntry = typeof pkg.module === "string" && pkg.module || typeof pkg.browser === "string" && pkg.browser;
|
|
31852
31861
|
if (esmEntry) {
|
|
31853
|
-
const resolved =
|
|
31862
|
+
const resolved = resolve54(pkgDir, esmEntry);
|
|
31854
31863
|
if (existsSync46(resolved))
|
|
31855
31864
|
return relative24(projectRoot, resolved);
|
|
31856
31865
|
}
|
|
@@ -31890,7 +31899,7 @@ ${stubs}
|
|
|
31890
31899
|
};
|
|
31891
31900
|
result = result.replace(/^((?:import\s+[^"'`;]+?\s+from|export\s+[^"'`;]+?\s+from|import)\s*["'])([^"'./][^"']*)(["'])/gm, stubReplace);
|
|
31892
31901
|
result = result.replace(/(import\s*\(\s*["'])([^"'./][^"']*)(["']\s*\))/g, stubReplace);
|
|
31893
|
-
const fileDir =
|
|
31902
|
+
const fileDir = dirname36(filePath);
|
|
31894
31903
|
result = result.replace(/(from\s*["'])(\.\.?\/[^"']+)(["'])/g, (_match, prefix, relPath, suffix) => isRealImport(relPath) ? `${prefix}${resolveRelativeImport(relPath, fileDir, projectRoot, IMPORT_EXTENSIONS)}${suffix}` : _match);
|
|
31895
31904
|
result = result.replace(/(import\s*\(\s*["'])(\.\.?\/[^"']+)(["']\s*\))/g, (_match, prefix, relPath, suffix) => isRealImport(relPath) ? `${prefix}${resolveRelativeImport(relPath, fileDir, projectRoot, IMPORT_EXTENSIONS)}${suffix}` : _match);
|
|
31896
31905
|
result = result.replace(/(import\s*["'])(\.\.?\/[^"']+)(["']\s*;?)/g, (_match, prefix, relPath, suffix) => isRealImport(relPath) ? `${prefix}${resolveRelativeImport(relPath, fileDir, projectRoot, SIDE_EFFECT_EXTENSIONS)}${suffix}` : _match);
|
|
@@ -31907,12 +31916,12 @@ ${stubs}
|
|
|
31907
31916
|
result = result.replace(/((?:from|import)\s*["'])(\/[^"']+\.(tsx?|jsx?|ts))(["'])/g, rewriteAbsoluteToSrc);
|
|
31908
31917
|
result = result.replace(/(import\s*\(\s*["'])(\/[^"']+\.(tsx?|jsx?|ts))(["']\s*\))/g, rewriteAbsoluteToSrc);
|
|
31909
31918
|
result = result.replace(/new\s+URL\(\s*["'](\.\.?\/[^"']+)["']\s*,\s*import\.meta\.url\s*\)/g, (_match, relPath) => {
|
|
31910
|
-
const absPath =
|
|
31919
|
+
const absPath = resolve54(fileDir, relPath);
|
|
31911
31920
|
const rel = relative24(projectRoot, absPath);
|
|
31912
31921
|
return `new URL('${srcUrl(rel, projectRoot)}', import.meta.url)`;
|
|
31913
31922
|
});
|
|
31914
31923
|
result = result.replace(/import\.meta\.resolve\(\s*["'](\.\.?\/[^"']+)["']\s*\)/g, (_match, relPath) => {
|
|
31915
|
-
const absPath =
|
|
31924
|
+
const absPath = resolve54(fileDir, relPath);
|
|
31916
31925
|
const rel = relative24(projectRoot, absPath);
|
|
31917
31926
|
return `'${srcUrl(rel, projectRoot)}'`;
|
|
31918
31927
|
});
|
|
@@ -31958,7 +31967,7 @@ ${code}`;
|
|
|
31958
31967
|
reactFastRefreshWarningEmitted = true;
|
|
31959
31968
|
logWarn("React edits remount the page instead of keeping component state: " + "this Bun ignores `reactFastRefresh` on Bun.Transpiler " + "(https://github.com/oven-sh/bun/issues/32919). Run " + "`absolute bun-patch install` to use AbsoluteJS's patched Bun, " + "which has the fix; `absolute dev` then uses it automatically.");
|
|
31960
31969
|
}, transformReactFile = (filePath, projectRoot, rewriter) => {
|
|
31961
|
-
const raw =
|
|
31970
|
+
const raw = readFileSync42(filePath, "utf-8");
|
|
31962
31971
|
const valueExports = tsxTranspiler.scan(raw).exports;
|
|
31963
31972
|
let transpiled = reactTranspiler.transformSync(raw);
|
|
31964
31973
|
transpiled = preserveTypeExports(raw, transpiled, valueExports);
|
|
@@ -31974,7 +31983,7 @@ ${transpiled}`;
|
|
|
31974
31983
|
transpiled += buildIslandMetadataExports(raw);
|
|
31975
31984
|
return rewriteImports(transpiled, filePath, projectRoot, rewriter);
|
|
31976
31985
|
}, transformPlainFile = (filePath, projectRoot, rewriter, vueDir) => {
|
|
31977
|
-
const raw =
|
|
31986
|
+
const raw = readFileSync42(filePath, "utf-8");
|
|
31978
31987
|
const ext = extname16(filePath);
|
|
31979
31988
|
const isTS = ext === ".ts" || ext === ".tsx";
|
|
31980
31989
|
const isTSX = ext === ".tsx" || ext === ".jsx";
|
|
@@ -32140,7 +32149,7 @@ ${code}`;
|
|
|
32140
32149
|
` + ` var __hmr_accept = function(cb) { window.__SVELTE_HMR_ACCEPT__[${JSON.stringify(moduleUrl)}] = cb; };`);
|
|
32141
32150
|
return code.replace(/import\.meta\.hot\.accept\(/g, "__hmr_accept(");
|
|
32142
32151
|
}, transformSvelteFile = async (filePath, projectRoot, rewriter, stylePreprocessors) => {
|
|
32143
|
-
const raw =
|
|
32152
|
+
const raw = readFileSync42(filePath, "utf-8");
|
|
32144
32153
|
if (!svelteCompiler) {
|
|
32145
32154
|
svelteCompiler = await import("svelte/compiler");
|
|
32146
32155
|
}
|
|
@@ -32189,7 +32198,7 @@ export default __script__;`;
|
|
|
32189
32198
|
filename: filePath,
|
|
32190
32199
|
id: `data-v-${componentId}`,
|
|
32191
32200
|
scoped: Boolean(style.scoped),
|
|
32192
|
-
source: style.lang ? await compileStyleSource(filePath, style.content, style.lang, stylePreprocessors) : style.content,
|
|
32201
|
+
source: inlineCssImports(style.lang ? await compileStyleSource(filePath, style.content, style.lang, stylePreprocessors) : style.content, filePath),
|
|
32193
32202
|
trim: true
|
|
32194
32203
|
}).code))).join(`
|
|
32195
32204
|
`);
|
|
@@ -32206,7 +32215,7 @@ export default __script__;`;
|
|
|
32206
32215
|
return `${cssInjection}
|
|
32207
32216
|
${code}`;
|
|
32208
32217
|
}, transformVueFile = async (filePath, projectRoot, rewriter, vueDir, stylePreprocessors) => {
|
|
32209
|
-
const rawSource =
|
|
32218
|
+
const rawSource = readFileSync42(filePath, "utf-8");
|
|
32210
32219
|
const raw = addAutoRouterSetupApp(rawSource);
|
|
32211
32220
|
if (!vueCompiler) {
|
|
32212
32221
|
vueCompiler = await loadVueCompiler();
|
|
@@ -32218,8 +32227,8 @@ ${code}`;
|
|
|
32218
32227
|
const compiledScript = hasScript ? vueCompiler.compileScript(descriptor, {
|
|
32219
32228
|
fs: {
|
|
32220
32229
|
fileExists: isFile,
|
|
32221
|
-
realpath:
|
|
32222
|
-
readFile: (file) => isFile(file) ?
|
|
32230
|
+
realpath: realpathSync7,
|
|
32231
|
+
readFile: (file) => isFile(file) ? readFileSync42(file, "utf-8") : undefined
|
|
32223
32232
|
},
|
|
32224
32233
|
id: componentId,
|
|
32225
32234
|
inlineTemplate: false
|
|
@@ -32234,7 +32243,7 @@ ${code}`;
|
|
|
32234
32243
|
code = injectVueHmr(code, filePath, projectRoot, vueDir);
|
|
32235
32244
|
return rewriteImports(code, filePath, projectRoot, rewriter);
|
|
32236
32245
|
}, injectVueHmr = (code, filePath, projectRoot, vueDir) => {
|
|
32237
|
-
const hmrBase = vueDir ?
|
|
32246
|
+
const hmrBase = vueDir ? resolve54(vueDir) : projectRoot;
|
|
32238
32247
|
const hmrId = relative24(hmrBase, filePath).replace(/\\/g, "/").replace(/\.vue$/, "");
|
|
32239
32248
|
let result = code.replace(/export\s+default\s+/, "var __hmr_comp__ = ");
|
|
32240
32249
|
result += [
|
|
@@ -32266,7 +32275,7 @@ ${code}`;
|
|
|
32266
32275
|
}
|
|
32267
32276
|
});
|
|
32268
32277
|
}, handleCssRequest = (filePath) => {
|
|
32269
|
-
const raw =
|
|
32278
|
+
const raw = readFileSync42(filePath, "utf-8");
|
|
32270
32279
|
const escaped = raw.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$/g, "\\$");
|
|
32271
32280
|
return [
|
|
32272
32281
|
`const style = document.createElement('style');`,
|
|
@@ -32395,7 +32404,7 @@ export default {};
|
|
|
32395
32404
|
const escaped = virtualCss.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$/g, "\\$");
|
|
32396
32405
|
return jsResponse(`var s=document.createElement('style');s.textContent=\`${escaped}\`;s.dataset.svelteHmr=${JSON.stringify(cssCheckPath)};var p=document.querySelector('style[data-svelte-hmr="${cssCheckPath}"]');if(p)p.remove();document.head.appendChild(s);`);
|
|
32397
32406
|
}, resolveSourcePath2 = (relPath, projectRoot) => {
|
|
32398
|
-
const filePath =
|
|
32407
|
+
const filePath = resolve54(projectRoot, decodeSrcPath(relPath));
|
|
32399
32408
|
const ext = extname16(filePath);
|
|
32400
32409
|
if (ext === ".svelte")
|
|
32401
32410
|
return { ext, filePath: resolveSvelteModulePath(filePath) };
|
|
@@ -32432,14 +32441,14 @@ export default {};
|
|
|
32432
32441
|
const absoluteCandidate = `/${tail.replace(/^\/+/, "")}`;
|
|
32433
32442
|
const candidates = [
|
|
32434
32443
|
absoluteCandidate,
|
|
32435
|
-
|
|
32444
|
+
resolve54(projectRoot, tail)
|
|
32436
32445
|
];
|
|
32437
32446
|
try {
|
|
32438
32447
|
await Promise.resolve().then(() => init_loadConfig());
|
|
32439
32448
|
const cfg = await loadConfig();
|
|
32440
|
-
const angularDir = cfg.angularDirectory &&
|
|
32449
|
+
const angularDir = cfg.angularDirectory && resolve54(projectRoot, cfg.angularDirectory);
|
|
32441
32450
|
if (angularDir)
|
|
32442
|
-
candidates.push(
|
|
32451
|
+
candidates.push(resolve54(angularDir, tail));
|
|
32443
32452
|
} catch {}
|
|
32444
32453
|
for (const candidate of candidates) {
|
|
32445
32454
|
if (await fileExists(candidate)) {
|
|
@@ -32470,7 +32479,7 @@ export default {};
|
|
|
32470
32479
|
if (!TRANSPILABLE.has(ext))
|
|
32471
32480
|
return;
|
|
32472
32481
|
const stat = statSync9(filePath);
|
|
32473
|
-
const resolvedVueDir = vueDir ?
|
|
32482
|
+
const resolvedVueDir = vueDir ? resolve54(vueDir) : undefined;
|
|
32474
32483
|
let content = REACT_EXTENSIONS.has(ext) ? transformReactFile(filePath, projectRoot, rewriter) : transformPlainFile(filePath, projectRoot, rewriter, resolvedVueDir);
|
|
32475
32484
|
const isAngularGeneratedJs = ext === ".js" && filePath.replace(/\\/g, "/").includes("/.absolutejs/generated/angular/");
|
|
32476
32485
|
if (isAngularGeneratedJs) {
|
|
@@ -32526,7 +32535,7 @@ export default {};
|
|
|
32526
32535
|
const ownMessage = source && typeof source === "object" ? Reflect.get(source, "message") : undefined;
|
|
32527
32536
|
const message = typeof ownMessage === "string" ? ownMessage : String(source);
|
|
32528
32537
|
return { message, ...readPosition(first) };
|
|
32529
|
-
}, getTransformError = (filePath) => transformErrors.get(
|
|
32538
|
+
}, getTransformError = (filePath) => transformErrors.get(resolve54(filePath)), transformErrorResponse = (err) => {
|
|
32530
32539
|
const errMsg = err instanceof Error ? err.message : String(err);
|
|
32531
32540
|
return new Response(`console.error('[ModuleServer] Transform error:', ${JSON.stringify(errMsg)});`, {
|
|
32532
32541
|
headers: { "Content-Type": "application/javascript" },
|
|
@@ -32549,16 +32558,16 @@ export default {};
|
|
|
32549
32558
|
const relPath = pathname.slice(SRC_PREFIX.length);
|
|
32550
32559
|
if (relPath === "bun:wrap" || relPath.startsWith("bun:wrap?"))
|
|
32551
32560
|
return handleBunWrapRequest();
|
|
32552
|
-
const virtualCssResponse = handleVirtualSvelteCss(
|
|
32561
|
+
const virtualCssResponse = handleVirtualSvelteCss(resolve54(projectRoot, decodeSrcPath(relPath)));
|
|
32553
32562
|
if (virtualCssResponse)
|
|
32554
32563
|
return virtualCssResponse;
|
|
32555
32564
|
const { filePath, ext } = resolveSourcePath2(relPath, projectRoot);
|
|
32556
32565
|
try {
|
|
32557
32566
|
const response = await transformAndCache(filePath, ext, projectRoot, rewriter, frameworkDirs?.vue, stylePreprocessors);
|
|
32558
|
-
transformErrors.delete(
|
|
32567
|
+
transformErrors.delete(resolve54(filePath));
|
|
32559
32568
|
return response;
|
|
32560
32569
|
} catch (err) {
|
|
32561
|
-
transformErrors.set(
|
|
32570
|
+
transformErrors.set(resolve54(filePath), describeTransformError(err));
|
|
32562
32571
|
return transformErrorResponse(err);
|
|
32563
32572
|
}
|
|
32564
32573
|
};
|
|
@@ -32568,11 +32577,11 @@ export default {};
|
|
|
32568
32577
|
SRC_IMPORT_RE.lastIndex = 0;
|
|
32569
32578
|
while ((match = SRC_IMPORT_RE.exec(content)) !== null) {
|
|
32570
32579
|
if (match[1])
|
|
32571
|
-
files.push(
|
|
32580
|
+
files.push(resolve54(projectRoot, decodeSrcPath(match[1])));
|
|
32572
32581
|
}
|
|
32573
32582
|
return files;
|
|
32574
32583
|
}, SRC_URL_PREFIX2, invalidateModule = (filePath) => {
|
|
32575
|
-
const resolved =
|
|
32584
|
+
const resolved = resolve54(filePath);
|
|
32576
32585
|
transformErrors.delete(resolved);
|
|
32577
32586
|
invalidate(filePath);
|
|
32578
32587
|
if (resolved !== filePath)
|
|
@@ -32638,7 +32647,7 @@ export default {};
|
|
|
32638
32647
|
return false;
|
|
32639
32648
|
}
|
|
32640
32649
|
await Promise.resolve().then(() => init_prepare());
|
|
32641
|
-
patchManifestIndexes(cached.manifest,
|
|
32650
|
+
patchManifestIndexes(cached.manifest, resolve54(state.resolvedPaths.buildDir, "_src_indexes"), SRC_PREFIX);
|
|
32642
32651
|
logPageBuild(entry.source, entry.framework, Math.round(durationMs));
|
|
32643
32652
|
logStartupTimingBlock("AbsoluteJS on-demand page build", [
|
|
32644
32653
|
{ durationMs, label: entry.name }
|
|
@@ -32661,6 +32670,7 @@ export default {};
|
|
|
32661
32670
|
};
|
|
32662
32671
|
var init_moduleServer = __esm(() => {
|
|
32663
32672
|
init_constants();
|
|
32673
|
+
init_inlineCssImports();
|
|
32664
32674
|
init_resolvePackageImport();
|
|
32665
32675
|
init_vueAutoRouterTransform();
|
|
32666
32676
|
init_sourceMetadata();
|
|
@@ -32897,11 +32907,11 @@ var exports_simpleHTMLHMR = {};
|
|
|
32897
32907
|
__export(exports_simpleHTMLHMR, {
|
|
32898
32908
|
handleHTMLUpdate: () => handleHTMLUpdate
|
|
32899
32909
|
});
|
|
32900
|
-
import { resolve as
|
|
32910
|
+
import { resolve as resolve55 } from "path";
|
|
32901
32911
|
var handleHTMLUpdate = async (htmlFilePath) => {
|
|
32902
32912
|
let htmlContent;
|
|
32903
32913
|
try {
|
|
32904
|
-
const resolvedPath =
|
|
32914
|
+
const resolvedPath = resolve55(htmlFilePath);
|
|
32905
32915
|
const file = Bun.file(resolvedPath);
|
|
32906
32916
|
if (!await file.exists()) {
|
|
32907
32917
|
return null;
|
|
@@ -32927,11 +32937,11 @@ var exports_simpleHTMXHMR = {};
|
|
|
32927
32937
|
__export(exports_simpleHTMXHMR, {
|
|
32928
32938
|
handleHTMXUpdate: () => handleHTMXUpdate
|
|
32929
32939
|
});
|
|
32930
|
-
import { resolve as
|
|
32940
|
+
import { resolve as resolve56 } from "path";
|
|
32931
32941
|
var handleHTMXUpdate = async (htmxFilePath) => {
|
|
32932
32942
|
let htmlContent;
|
|
32933
32943
|
try {
|
|
32934
|
-
const resolvedPath =
|
|
32944
|
+
const resolvedPath = resolve56(htmxFilePath);
|
|
32935
32945
|
const file = Bun.file(resolvedPath);
|
|
32936
32946
|
if (!await file.exists()) {
|
|
32937
32947
|
return null;
|
|
@@ -32953,8 +32963,8 @@ var handleHTMXUpdate = async (htmxFilePath) => {
|
|
|
32953
32963
|
var init_simpleHTMXHMR = () => {};
|
|
32954
32964
|
|
|
32955
32965
|
// src/dev/backendGraph.ts
|
|
32956
|
-
import { readFileSync as
|
|
32957
|
-
import { dirname as
|
|
32966
|
+
import { readFileSync as readFileSync43, realpathSync as realpathSync8, statSync as statSync10 } from "fs";
|
|
32967
|
+
import { dirname as dirname37, extname as extname17, resolve as resolve57 } from "path";
|
|
32958
32968
|
var SOURCE_FILE, VENDORED, LOADERS, fileCache, transpilers, transpilerFor = (path) => {
|
|
32959
32969
|
const loader = LOADERS[extname17(path)] ?? "ts";
|
|
32960
32970
|
const existing = transpilers.get(loader);
|
|
@@ -32965,13 +32975,13 @@ var SOURCE_FILE, VENDORED, LOADERS, fileCache, transpilers, transpilerFor = (pat
|
|
|
32965
32975
|
return created;
|
|
32966
32976
|
}, realPath2 = (path) => {
|
|
32967
32977
|
try {
|
|
32968
|
-
return
|
|
32978
|
+
return realpathSync8(path);
|
|
32969
32979
|
} catch {
|
|
32970
32980
|
return path;
|
|
32971
32981
|
}
|
|
32972
|
-
}, isProjectModule = (path, root = process.cwd()) => SOURCE_FILE.test(path) && !VENDORED.test(path) &&
|
|
32982
|
+
}, isProjectModule = (path, root = process.cwd()) => SOURCE_FILE.test(path) && !VENDORED.test(path) && resolve57(path).startsWith(resolve57(root)), resolveImport = (specifier, fromFile) => {
|
|
32973
32983
|
try {
|
|
32974
|
-
return realPath2(Bun.resolveSync(specifier,
|
|
32984
|
+
return realPath2(Bun.resolveSync(specifier, dirname37(fromFile)));
|
|
32975
32985
|
} catch {
|
|
32976
32986
|
return;
|
|
32977
32987
|
}
|
|
@@ -32988,20 +32998,20 @@ var SOURCE_FILE, VENDORED, LOADERS, fileCache, transpilers, transpilerFor = (pat
|
|
|
32988
32998
|
return cached.imports;
|
|
32989
32999
|
let imports = [];
|
|
32990
33000
|
try {
|
|
32991
|
-
const source =
|
|
33001
|
+
const source = readFileSync43(path, "utf-8");
|
|
32992
33002
|
imports = transpilerFor(path).scanImports(source).map((entry) => resolveImport(entry.path, path)).filter((target) => target !== undefined);
|
|
32993
33003
|
} catch {}
|
|
32994
33004
|
fileCache.set(path, { imports, mtimeMs });
|
|
32995
33005
|
return imports;
|
|
32996
33006
|
}, importersOf = (target, entry, loaded = loadedProjectModules(entry)) => {
|
|
32997
|
-
const goal = realPath2(
|
|
33007
|
+
const goal = realPath2(resolve57(target));
|
|
32998
33008
|
const importers = [];
|
|
32999
33009
|
for (const file of loaded)
|
|
33000
33010
|
if (readImports(file).includes(goal))
|
|
33001
33011
|
importers.push(file);
|
|
33002
33012
|
return importers;
|
|
33003
33013
|
}, loadedProjectModules = (entry, loaded = Object.keys(__require.cache), root = process.cwd()) => {
|
|
33004
|
-
const entryPath = realPath2(
|
|
33014
|
+
const entryPath = realPath2(resolve57(entry));
|
|
33005
33015
|
const modules = new Set([entryPath]);
|
|
33006
33016
|
for (const path of loaded) {
|
|
33007
33017
|
if (isAbsoluteServerEntryCopyPath(path))
|
|
@@ -33030,7 +33040,7 @@ var init_backendGraph = __esm(() => {
|
|
|
33030
33040
|
});
|
|
33031
33041
|
|
|
33032
33042
|
// src/dev/hot/analyze.ts
|
|
33033
|
-
import { dirname as
|
|
33043
|
+
import { dirname as dirname38, extname as extname18 } from "path";
|
|
33034
33044
|
var ANALYZER_VERSION = 1, hashText = (text) => Bun.hash(text).toString(36), scriptKindFor = (tsc, path) => {
|
|
33035
33045
|
switch (extname18(path)) {
|
|
33036
33046
|
case ".tsx":
|
|
@@ -33712,7 +33722,7 @@ var ANALYZER_VERSION = 1, hashText = (text) => Bun.hash(text).toString(36), scri
|
|
|
33712
33722
|
return analysis;
|
|
33713
33723
|
}, resolveFrom = (fromFile, isManaged) => (specifier) => {
|
|
33714
33724
|
try {
|
|
33715
|
-
const resolved = Bun.resolveSync(specifier,
|
|
33725
|
+
const resolved = Bun.resolveSync(specifier, dirname38(fromFile));
|
|
33716
33726
|
return isManaged(resolved) ? resolved : undefined;
|
|
33717
33727
|
} catch {
|
|
33718
33728
|
return;
|
|
@@ -33786,11 +33796,11 @@ var init_runtime = __esm(() => {
|
|
|
33786
33796
|
});
|
|
33787
33797
|
|
|
33788
33798
|
// src/dev/hot/plugin.ts
|
|
33789
|
-
import { mkdirSync as mkdirSync16, readFileSync as
|
|
33790
|
-
import { extname as extname19, join as join63, relative as relative25, resolve as
|
|
33799
|
+
import { mkdirSync as mkdirSync16, readFileSync as readFileSync44, realpathSync as realpathSync9, writeFileSync as writeFileSync11 } from "fs";
|
|
33800
|
+
import { extname as extname19, join as join63, relative as relative25, resolve as resolve58, sep as sep8 } from "path";
|
|
33791
33801
|
var SOURCE, TEST_FILE, GENERATED, ABSOLUTE_ROOT, realPath3 = (path) => {
|
|
33792
33802
|
try {
|
|
33793
|
-
return
|
|
33803
|
+
return realpathSync9(path);
|
|
33794
33804
|
} catch {
|
|
33795
33805
|
return path;
|
|
33796
33806
|
}
|
|
@@ -33832,7 +33842,7 @@ var SOURCE, TEST_FILE, GENERATED, ABSOLUTE_ROOT, realPath3 = (path) => {
|
|
|
33832
33842
|
if (!state)
|
|
33833
33843
|
return;
|
|
33834
33844
|
try {
|
|
33835
|
-
const cached = JSON.parse(
|
|
33845
|
+
const cached = JSON.parse(readFileSync44(cachePath(state.cacheDir, key), "utf-8"));
|
|
33836
33846
|
return isAnalysis(cached) ? cached : undefined;
|
|
33837
33847
|
} catch {
|
|
33838
33848
|
return;
|
|
@@ -33866,7 +33876,7 @@ var init_plugin = __esm(() => {
|
|
|
33866
33876
|
SOURCE = /\.(?:[cm]?[jt]sx?)$/;
|
|
33867
33877
|
TEST_FILE = /(?:\.(?:spec|test)\.[cm]?[jt]sx?$)|(?:[\\/]__tests__[\\/])/;
|
|
33868
33878
|
GENERATED = /(?:^|[\\/])(?:build|generated|compiled|indexes|\.absolutejs|node_modules|dist)(?:[\\/]|$)/;
|
|
33869
|
-
ABSOLUTE_ROOT =
|
|
33879
|
+
ABSOLUTE_ROOT = resolve58(import.meta.dir, "..", "..", "..");
|
|
33870
33880
|
shared = globalThis.__absoluteHotPlugin ??= {
|
|
33871
33881
|
analyses: new Map,
|
|
33872
33882
|
installed: undefined
|
|
@@ -33875,11 +33885,11 @@ var init_plugin = __esm(() => {
|
|
|
33875
33885
|
});
|
|
33876
33886
|
|
|
33877
33887
|
// src/dev/hot/reload.ts
|
|
33878
|
-
import { readFileSync as
|
|
33888
|
+
import { readFileSync as readFileSync45, realpathSync as realpathSync10 } from "fs";
|
|
33879
33889
|
import { relative as relative26 } from "path";
|
|
33880
33890
|
var MAX_PROPAGATION_STEPS = 500, realPath4 = (path) => {
|
|
33881
33891
|
try {
|
|
33882
|
-
return
|
|
33892
|
+
return realpathSync10(path);
|
|
33883
33893
|
} catch {
|
|
33884
33894
|
return path;
|
|
33885
33895
|
}
|
|
@@ -33953,7 +33963,7 @@ var MAX_PROPAGATION_STEPS = 500, realPath4 = (path) => {
|
|
|
33953
33963
|
return { status: "entry" };
|
|
33954
33964
|
if (!moduleRecord(path) || !isHotManaged(path))
|
|
33955
33965
|
return { status: "unmanaged" };
|
|
33956
|
-
const source =
|
|
33966
|
+
const source = readFileSync45(path, "utf-8");
|
|
33957
33967
|
if (moduleRecord(path)?.source === source)
|
|
33958
33968
|
return { status: "unchanged" };
|
|
33959
33969
|
const analysis = await analyzeSource(path, source);
|
|
@@ -34045,7 +34055,7 @@ var init_reload = __esm(() => {
|
|
|
34045
34055
|
import { existsSync as existsSync47, readdirSync as readdirSync13, rmSync as rmSync4, statSync as statSync11 } from "fs";
|
|
34046
34056
|
import {
|
|
34047
34057
|
basename as basename21,
|
|
34048
|
-
dirname as
|
|
34058
|
+
dirname as dirname39,
|
|
34049
34059
|
isAbsolute as isAbsolute10,
|
|
34050
34060
|
join as join64,
|
|
34051
34061
|
relative as relative27,
|
|
@@ -34414,7 +34424,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
34414
34424
|
const { buildDir } = state.resolvedPaths;
|
|
34415
34425
|
const destPath = resolvePath4(buildDir, urlPrefix ? `${urlPrefix}/${relFromDir}` : relFromDir);
|
|
34416
34426
|
const { mkdir, copyFile, readFile } = await import("fs/promises");
|
|
34417
|
-
await mkdir(
|
|
34427
|
+
await mkdir(dirname39(destPath), { recursive: true });
|
|
34418
34428
|
await copyFile(absSource, destPath);
|
|
34419
34429
|
const bytes = await readFile(destPath);
|
|
34420
34430
|
const webPath = urlPrefix ? `/${urlPrefix}/${relFromDir}` : `/${relFromDir}`;
|
|
@@ -34610,7 +34620,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
34610
34620
|
const keepStemsByDir = new Map;
|
|
34611
34621
|
const prefixByDir = new Map;
|
|
34612
34622
|
for (const artifact of freshOutputs) {
|
|
34613
|
-
const dir =
|
|
34623
|
+
const dir = dirname39(artifact.path);
|
|
34614
34624
|
const name = basename21(artifact.path);
|
|
34615
34625
|
const [prefix] = name.split(".");
|
|
34616
34626
|
if (!prefix)
|
|
@@ -36012,7 +36022,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
36012
36022
|
if (!buildReference?.source) {
|
|
36013
36023
|
return;
|
|
36014
36024
|
}
|
|
36015
|
-
const sourcePath = buildReference.source.startsWith("file://") ? new URL(buildReference.source).pathname : resolvePath4(
|
|
36025
|
+
const sourcePath = buildReference.source.startsWith("file://") ? new URL(buildReference.source).pathname : resolvePath4(dirname39(buildInfo.resolvedRegistryPath), buildReference.source);
|
|
36016
36026
|
islandFiles.add(resolvePath4(sourcePath));
|
|
36017
36027
|
}, resolveIslandSourceFiles = async (config) => {
|
|
36018
36028
|
const registryPath = config.islands?.registry;
|
|
@@ -37188,10 +37198,10 @@ import {
|
|
|
37188
37198
|
existsSync as existsSync48,
|
|
37189
37199
|
mkdirSync as mkdirSync18,
|
|
37190
37200
|
readdirSync as readdirSync14,
|
|
37191
|
-
readFileSync as
|
|
37201
|
+
readFileSync as readFileSync46
|
|
37192
37202
|
} from "fs";
|
|
37193
37203
|
import { mkdir as mkdir16, readFile as readFile12, rename as rename7, rm as rm16, writeFile as writeFile14 } from "fs/promises";
|
|
37194
|
-
import { basename as basename22, join as join66, resolve as
|
|
37204
|
+
import { basename as basename22, join as join66, resolve as resolve59 } from "path";
|
|
37195
37205
|
var CACHE_ROOT2, CACHE_FORMAT_VERSION3 = 1, KEY_LENGTH = 32, LOCKFILES, computeVendorCacheKey = (inputs) => {
|
|
37196
37206
|
const hash = createHash11("sha256");
|
|
37197
37207
|
hash.update(String(CACHE_FORMAT_VERSION3));
|
|
@@ -37211,7 +37221,7 @@ var CACHE_ROOT2, CACHE_FORMAT_VERSION3 = 1, KEY_LENGTH = 32, LOCKFILES, computeV
|
|
|
37211
37221
|
}
|
|
37212
37222
|
for (const dir of inputs.vendorDirs) {
|
|
37213
37223
|
hash.update("\x00v");
|
|
37214
|
-
hash.update(basename22(
|
|
37224
|
+
hash.update(basename22(resolve59(dir, "..")));
|
|
37215
37225
|
}
|
|
37216
37226
|
return hash.digest("hex").slice(0, KEY_LENGTH);
|
|
37217
37227
|
}, readLockfileHash = (projectRoot = process.cwd()) => {
|
|
@@ -37223,7 +37233,7 @@ var CACHE_ROOT2, CACHE_FORMAT_VERSION3 = 1, KEY_LENGTH = 32, LOCKFILES, computeV
|
|
|
37223
37233
|
continue;
|
|
37224
37234
|
found = true;
|
|
37225
37235
|
hash.update(name);
|
|
37226
|
-
hash.update(
|
|
37236
|
+
hash.update(readFileSync46(path));
|
|
37227
37237
|
}
|
|
37228
37238
|
return found ? hash.digest("hex") : null;
|
|
37229
37239
|
}, vendorCacheEnabled = () => process.env.ABSOLUTE_DEV_VENDOR_CACHE !== "0", copyTree = (fromDir, toDir) => {
|
|
@@ -37250,7 +37260,7 @@ var CACHE_ROOT2, CACHE_FORMAT_VERSION3 = 1, KEY_LENGTH = 32, LOCKFILES, computeV
|
|
|
37250
37260
|
continue;
|
|
37251
37261
|
copyTree(dir, join66(stagingDir, slotName(index, dir)));
|
|
37252
37262
|
}
|
|
37253
|
-
}, isVendorCachePayload = (value) => typeof value === "object" && value !== null && typeof Reflect.get(value, "depPaths") === "object", cacheDirFor = (key, projectRoot) =>
|
|
37263
|
+
}, isVendorCachePayload = (value) => typeof value === "object" && value !== null && typeof Reflect.get(value, "depPaths") === "object", cacheDirFor = (key, projectRoot) => resolve59(projectRoot, CACHE_ROOT2, key), slotName = (index, dir) => `${index}-${basename22(resolve59(dir, ".."))}`, restoreVendorCache = async (key, vendorDirs, projectRoot = process.cwd()) => {
|
|
37254
37264
|
const cacheDir = cacheDirFor(key, projectRoot);
|
|
37255
37265
|
const payloadPath = join66(cacheDir, "payload.json");
|
|
37256
37266
|
if (!existsSync48(payloadPath))
|
|
@@ -37296,7 +37306,7 @@ var init_vendorCache = __esm(() => {
|
|
|
37296
37306
|
// src/core/devBuild.ts
|
|
37297
37307
|
import { readdir as readdir7 } from "fs/promises";
|
|
37298
37308
|
import { existsSync as existsSync49, statSync as statSync12 } from "fs";
|
|
37299
|
-
import { resolve as
|
|
37309
|
+
import { resolve as resolve60 } from "path";
|
|
37300
37310
|
var FRAMEWORK_DIR_KEYS, devClientVendorSourceDir, collectDepVendorSourceDirs = (config) => {
|
|
37301
37311
|
const configuredDirs = [
|
|
37302
37312
|
...collectConfigVendorSourceDirs(config),
|
|
@@ -37320,7 +37330,7 @@ var FRAMEWORK_DIR_KEYS, devClientVendorSourceDir, collectDepVendorSourceDirs = (
|
|
|
37320
37330
|
return Object.keys(config).length > 0 ? config : null;
|
|
37321
37331
|
}, reloadConfig = async () => {
|
|
37322
37332
|
try {
|
|
37323
|
-
const configPath =
|
|
37333
|
+
const configPath = resolve60(process.env.ABSOLUTE_CONFIG ?? "absolute.config.ts");
|
|
37324
37334
|
const source = await Bun.file(configPath).text();
|
|
37325
37335
|
return parseDirectoryConfig(source);
|
|
37326
37336
|
} catch {
|
|
@@ -37435,7 +37445,7 @@ var FRAMEWORK_DIR_KEYS, devClientVendorSourceDir, collectDepVendorSourceDirs = (
|
|
|
37435
37445
|
});
|
|
37436
37446
|
}
|
|
37437
37447
|
}, handleCachedReload = async () => {
|
|
37438
|
-
const serverMtime = statSync12(
|
|
37448
|
+
const serverMtime = statSync12(resolve60(Bun.main)).mtimeMs;
|
|
37439
37449
|
const lastMtime = globalThis.__hmrServerMtime;
|
|
37440
37450
|
globalThis.__hmrServerMtime = serverMtime;
|
|
37441
37451
|
const cached = globalThis.__hmrDevResult;
|
|
@@ -37476,8 +37486,8 @@ var FRAMEWORK_DIR_KEYS, devClientVendorSourceDir, collectDepVendorSourceDirs = (
|
|
|
37476
37486
|
return true;
|
|
37477
37487
|
}, resolveAbsoluteVersion2 = async () => {
|
|
37478
37488
|
const candidates = [
|
|
37479
|
-
|
|
37480
|
-
|
|
37489
|
+
resolve60(import.meta.dir, "..", "..", "package.json"),
|
|
37490
|
+
resolve60(import.meta.dir, "..", "package.json")
|
|
37481
37491
|
];
|
|
37482
37492
|
const [candidate, ...remaining] = candidates;
|
|
37483
37493
|
if (!candidate) {
|
|
@@ -37503,7 +37513,7 @@ var FRAMEWORK_DIR_KEYS, devClientVendorSourceDir, collectDepVendorSourceDirs = (
|
|
|
37503
37513
|
const entries = await readdir7(vendorDir).catch(() => emptyStringArray);
|
|
37504
37514
|
await Promise.all(entries.filter((entry) => entry.endsWith(".js")).map(async (entry) => {
|
|
37505
37515
|
const webPath = `/${framework}/vendor/${entry}`;
|
|
37506
|
-
const bytes = await Bun.file(
|
|
37516
|
+
const bytes = await Bun.file(resolve60(vendorDir, entry)).bytes();
|
|
37507
37517
|
assetStore.set(webPath, bytes);
|
|
37508
37518
|
}));
|
|
37509
37519
|
}, devBuild = async (config) => {
|
|
@@ -37689,11 +37699,11 @@ var FRAMEWORK_DIR_KEYS, devClientVendorSourceDir, collectDepVendorSourceDirs = (
|
|
|
37689
37699
|
}
|
|
37690
37700
|
stepStartedAt = performance.now();
|
|
37691
37701
|
setBootPhase("build vendor bundles");
|
|
37692
|
-
const reactVendorDir =
|
|
37693
|
-
const angularVendorDir =
|
|
37694
|
-
const svelteVendorDir =
|
|
37695
|
-
const vueVendorDir =
|
|
37696
|
-
const depVendorDir =
|
|
37702
|
+
const reactVendorDir = resolve60(state.resolvedPaths.buildDir, "react", "vendor");
|
|
37703
|
+
const angularVendorDir = resolve60(state.resolvedPaths.buildDir, "angular", "vendor");
|
|
37704
|
+
const svelteVendorDir = resolve60(state.resolvedPaths.buildDir, "svelte", "vendor");
|
|
37705
|
+
const vueVendorDir = resolve60(state.resolvedPaths.buildDir, "vue", "vendor");
|
|
37706
|
+
const depVendorDir = resolve60(state.resolvedPaths.buildDir, "vendor");
|
|
37697
37707
|
await Promise.resolve().then(() => init_buildDepVendor());
|
|
37698
37708
|
const activeVendorDirs = [
|
|
37699
37709
|
config.reactDirectory ? reactVendorDir : null,
|
|
@@ -37810,7 +37820,7 @@ var FRAMEWORK_DIR_KEYS, devClientVendorSourceDir, collectDepVendorSourceDirs = (
|
|
|
37810
37820
|
manifest
|
|
37811
37821
|
};
|
|
37812
37822
|
globalThis.__hmrDevResult = result;
|
|
37813
|
-
globalThis.__hmrServerMtime = statSync12(
|
|
37823
|
+
globalThis.__hmrServerMtime = statSync12(resolve60(Bun.main)).mtimeMs;
|
|
37814
37824
|
return result;
|
|
37815
37825
|
};
|
|
37816
37826
|
var init_devBuild = __esm(() => {
|
|
@@ -37853,5 +37863,5 @@ export {
|
|
|
37853
37863
|
devBuild
|
|
37854
37864
|
};
|
|
37855
37865
|
|
|
37856
|
-
//# debugId=
|
|
37866
|
+
//# debugId=AA60B6F5F10DA90864756E2164756E21
|
|
37857
37867
|
//# sourceMappingURL=build.js.map
|