@absolutejs/absolute 0.20.0-beta.66 → 0.20.0-beta.67
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/angular/components/core/streamingSlotRegistrar.js +1 -1
- package/dist/angular/components/core/streamingSlotRegistry.js +2 -2
- package/dist/build.js +768 -544
- package/dist/build.js.map +10 -8
- package/dist/dev/serverBootstrap.js +544 -6
- package/dist/index.js +879 -619
- package/dist/index.js.map +13 -10
- package/dist/mobile/mobilePreviewClient.ts +246 -0
- package/dist/src/build/chainInlineSourcemaps.d.ts +2 -0
- package/dist/src/build/vueCompileCache.d.ts +43 -0
- package/dist/src/cli/config/server.d.ts +1 -1
- package/dist/src/dev/bootLifecycle.d.ts +11 -0
- package/dist/src/dev/earlyListener.d.ts +41 -0
- package/dist/src/mobile/mobilePreview.d.ts +1 -1
- package/dist/src/plugins/imageOptimizer.d.ts +1 -1
- package/dist/src/utils/startupTimings.d.ts +4 -0
- package/dist/types/globals.d.ts +15 -0
- package/package.json +7 -7
package/dist/build.js
CHANGED
|
@@ -12363,6 +12363,27 @@ var init_cleanup = __esm(() => {
|
|
|
12363
12363
|
init_generatedDir();
|
|
12364
12364
|
});
|
|
12365
12365
|
|
|
12366
|
+
// src/utils/startupTimings.ts
|
|
12367
|
+
var isTruthyFlag = (value) => value === "1" || value === "true", devProfileEnabled, startupTimingsEnabled, formatStartupTimingBlock = (title, steps) => {
|
|
12368
|
+
const totalDuration = steps.reduce((sum, step) => sum + step.durationMs, 0);
|
|
12369
|
+
return [
|
|
12370
|
+
title,
|
|
12371
|
+
...steps.map((step) => ` - ${step.label}: ${getDurationString(step.durationMs)}`),
|
|
12372
|
+
` Total: ${getDurationString(totalDuration)}`
|
|
12373
|
+
].join(`
|
|
12374
|
+
`);
|
|
12375
|
+
}, logStartupTimingBlock = (title, steps) => {
|
|
12376
|
+
if (!startupTimingsEnabled || steps.length === 0) {
|
|
12377
|
+
return;
|
|
12378
|
+
}
|
|
12379
|
+
console.error(formatStartupTimingBlock(title, steps));
|
|
12380
|
+
};
|
|
12381
|
+
var init_startupTimings = __esm(() => {
|
|
12382
|
+
init_getDurationString();
|
|
12383
|
+
devProfileEnabled = isTruthyFlag(process.env.ABSOLUTE_DEV_PROFILE);
|
|
12384
|
+
startupTimingsEnabled = devProfileEnabled || isTruthyFlag(process.env.ABSOLUTE_STARTUP_TIMINGS);
|
|
12385
|
+
});
|
|
12386
|
+
|
|
12366
12387
|
// src/build/resolveBuildMode.ts
|
|
12367
12388
|
var resolveBuildDevelopmentMode = (mode, nodeEnv) => mode === "development" || mode === undefined && nodeEnv === "development", resolveVueFeatureFlags = (development) => ({
|
|
12368
12389
|
__VUE_OPTIONS_API__: "true",
|
|
@@ -14877,6 +14898,7 @@ var exports_chainInlineSourcemaps = {};
|
|
|
14877
14898
|
__export(exports_chainInlineSourcemaps, {
|
|
14878
14899
|
buildLineRemap: () => buildLineRemap,
|
|
14879
14900
|
chainBundleInlineSourcemap: () => chainBundleInlineSourcemap,
|
|
14901
|
+
chainBundleInlineSourcemaps: () => chainBundleInlineSourcemaps,
|
|
14880
14902
|
chainExternalSourcemap: () => chainExternalSourcemap,
|
|
14881
14903
|
chainSourcemap: () => chainSourcemap,
|
|
14882
14904
|
inlineLineMapComment: () => inlineLineMapComment,
|
|
@@ -15190,6 +15212,10 @@ var BASE64_CHARS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz01234567
|
|
|
15190
15212
|
const inline = `
|
|
15191
15213
|
//# sourceMappingURL=data:application/json;base64,` + Buffer.from(JSON.stringify(chained)).toString("base64");
|
|
15192
15214
|
writeFileSync7(bundleFilePath, stripped + inline);
|
|
15215
|
+
}, chainBundleInlineSourcemaps = async (bundlePaths) => {
|
|
15216
|
+
for (const bundlePath of bundlePaths) {
|
|
15217
|
+
chainBundleInlineSourcemap(bundlePath);
|
|
15218
|
+
}
|
|
15193
15219
|
}, chainExternalSourcemap = (mapFilePath) => {
|
|
15194
15220
|
let outerMap;
|
|
15195
15221
|
try {
|
|
@@ -15283,6 +15309,98 @@ var init_vueAutoRouterTransform = __esm(() => {
|
|
|
15283
15309
|
SETUP_APP_FUNCTION_REGEX = /\bexport\s+(async\s+function|function)\s+setupApp\b/;
|
|
15284
15310
|
});
|
|
15285
15311
|
|
|
15312
|
+
// src/build/vueCompileCache.ts
|
|
15313
|
+
import { createHash as createHash4 } from "crypto";
|
|
15314
|
+
import {
|
|
15315
|
+
existsSync as existsSync23,
|
|
15316
|
+
mkdirSync as mkdirSync8,
|
|
15317
|
+
readFileSync as readFileSync20,
|
|
15318
|
+
renameSync,
|
|
15319
|
+
writeFileSync as writeFileSync8
|
|
15320
|
+
} from "fs";
|
|
15321
|
+
import { join as join32, resolve as resolve23 } from "path";
|
|
15322
|
+
var CACHE_DIR_NAME = "compile-cache", ABSOLUTE_CACHE_DIR_NAME2 = ".absolutejs", CACHE_FORMAT_VERSION = 1, FILE_NAME_HASH_LENGTH = 32, vueCompileCacheEnabled = () => process.env.ABSOLUTE_COMPILE_CACHE !== "0", hashContent = (content) => createHash4("sha256").update(content).digest("hex"), hashParts = (parts) => {
|
|
15323
|
+
const hash = createHash4("sha256");
|
|
15324
|
+
for (const part of parts) {
|
|
15325
|
+
hash.update(part);
|
|
15326
|
+
hash.update("\x00");
|
|
15327
|
+
}
|
|
15328
|
+
return hash.digest("hex");
|
|
15329
|
+
}, readOwnPackageVersion = () => {
|
|
15330
|
+
const candidates = [
|
|
15331
|
+
resolve23(import.meta.dir, "..", "..", "package.json"),
|
|
15332
|
+
resolve23(import.meta.dir, "..", "package.json")
|
|
15333
|
+
];
|
|
15334
|
+
for (const candidate of candidates) {
|
|
15335
|
+
try {
|
|
15336
|
+
const pkg = JSON.parse(readFileSync20(candidate, "utf-8"));
|
|
15337
|
+
if (pkg.name === "@absolutejs/absolute" && pkg.version) {
|
|
15338
|
+
return pkg.version;
|
|
15339
|
+
}
|
|
15340
|
+
} catch {}
|
|
15341
|
+
}
|
|
15342
|
+
return globalThis.__absoluteVersion ?? null;
|
|
15343
|
+
}, cachedFrameworkVersion, frameworkVersionForCache = () => {
|
|
15344
|
+
cachedFrameworkVersion ??= readOwnPackageVersion();
|
|
15345
|
+
return cachedFrameworkVersion;
|
|
15346
|
+
}, vueCompileCacheDir = (projectRoot = process.cwd()) => join32(projectRoot, ABSOLUTE_CACHE_DIR_NAME2, CACHE_DIR_NAME, "vue"), entryFileFor = (sourceFilePath, projectRoot) => join32(vueCompileCacheDir(projectRoot), `${hashContent(sourceFilePath).slice(0, FILE_NAME_HASH_LENGTH)}.json`), vueCompileCacheFingerprint = (parts) => {
|
|
15347
|
+
const frameworkVersion = frameworkVersionForCache();
|
|
15348
|
+
if (!frameworkVersion)
|
|
15349
|
+
return null;
|
|
15350
|
+
return hashParts([
|
|
15351
|
+
String(CACHE_FORMAT_VERSION),
|
|
15352
|
+
frameworkVersion,
|
|
15353
|
+
parts.compilerVersion ?? "unknown-vue-compiler",
|
|
15354
|
+
JSON.stringify(parts.stylePreprocessors ?? null),
|
|
15355
|
+
parts.vueRootDir,
|
|
15356
|
+
parts.outputDirs.client,
|
|
15357
|
+
parts.outputDirs.server,
|
|
15358
|
+
parts.outputDirs.css
|
|
15359
|
+
]);
|
|
15360
|
+
}, typeDepsUnchanged = (typeDeps) => {
|
|
15361
|
+
for (const [path, hash] of Object.entries(typeDeps)) {
|
|
15362
|
+
try {
|
|
15363
|
+
if (hashContent(readFileSync20(path, "utf-8")) !== hash)
|
|
15364
|
+
return false;
|
|
15365
|
+
} catch {
|
|
15366
|
+
return false;
|
|
15367
|
+
}
|
|
15368
|
+
}
|
|
15369
|
+
return true;
|
|
15370
|
+
}, isEntryShape = (value) => {
|
|
15371
|
+
if (!value || typeof value !== "object")
|
|
15372
|
+
return false;
|
|
15373
|
+
const entry = value;
|
|
15374
|
+
return typeof entry.key === "string" && typeof entry.clientCode === "string" && typeof entry.serverCode === "string" && typeof entry.result === "object" && entry.result !== null && typeof entry.typeDeps === "object" && entry.typeDeps !== null;
|
|
15375
|
+
}, readVueCompileCacheEntry = (sourceFilePath, key, projectRoot) => {
|
|
15376
|
+
if (!vueCompileCacheEnabled())
|
|
15377
|
+
return null;
|
|
15378
|
+
const entryFile = entryFileFor(sourceFilePath, projectRoot);
|
|
15379
|
+
if (!existsSync23(entryFile))
|
|
15380
|
+
return null;
|
|
15381
|
+
try {
|
|
15382
|
+
const parsed = JSON.parse(readFileSync20(entryFile, "utf-8"));
|
|
15383
|
+
if (!isEntryShape(parsed) || parsed.key !== key)
|
|
15384
|
+
return null;
|
|
15385
|
+
if (!typeDepsUnchanged(parsed.typeDeps))
|
|
15386
|
+
return null;
|
|
15387
|
+
return parsed;
|
|
15388
|
+
} catch {
|
|
15389
|
+
return null;
|
|
15390
|
+
}
|
|
15391
|
+
}, writeVueCompileCacheEntry = (sourceFilePath, entry, projectRoot) => {
|
|
15392
|
+
if (!vueCompileCacheEnabled())
|
|
15393
|
+
return;
|
|
15394
|
+
const entryFile = entryFileFor(sourceFilePath, projectRoot);
|
|
15395
|
+
try {
|
|
15396
|
+
mkdirSync8(vueCompileCacheDir(projectRoot), { recursive: true });
|
|
15397
|
+
const tempFile = `${entryFile}.${process.pid}.tmp`;
|
|
15398
|
+
writeFileSync8(tempFile, JSON.stringify(entry));
|
|
15399
|
+
renameSync(tempFile, entryFile);
|
|
15400
|
+
} catch {}
|
|
15401
|
+
};
|
|
15402
|
+
var init_vueCompileCache = () => {};
|
|
15403
|
+
|
|
15286
15404
|
// src/build/compileVue.ts
|
|
15287
15405
|
var exports_compileVue = {};
|
|
15288
15406
|
__export(exports_compileVue, {
|
|
@@ -15292,27 +15410,27 @@ __export(exports_compileVue, {
|
|
|
15292
15410
|
generateVueHmrId: () => generateVueHmrId,
|
|
15293
15411
|
vueHmrMetadata: () => vueHmrMetadata
|
|
15294
15412
|
});
|
|
15295
|
-
import { existsSync as
|
|
15413
|
+
import { existsSync as existsSync24, readFileSync as readFileSync21, realpathSync as realpathSync2 } from "fs";
|
|
15296
15414
|
import { mkdir as mkdir7 } from "fs/promises";
|
|
15297
15415
|
import {
|
|
15298
15416
|
basename as basename11,
|
|
15299
15417
|
dirname as dirname17,
|
|
15300
15418
|
isAbsolute as isAbsolute4,
|
|
15301
|
-
join as
|
|
15419
|
+
join as join33,
|
|
15302
15420
|
relative as relative13,
|
|
15303
|
-
resolve as
|
|
15421
|
+
resolve as resolve24
|
|
15304
15422
|
} from "path";
|
|
15305
15423
|
var {file: file2, write: write3, Transpiler: Transpiler3 } = globalThis.Bun;
|
|
15306
15424
|
var resolveDevClientDir3 = () => {
|
|
15307
15425
|
const projectRoot = process.cwd();
|
|
15308
|
-
const fromSource =
|
|
15309
|
-
if (
|
|
15426
|
+
const fromSource = resolve24(import.meta.dir, "../dev/client");
|
|
15427
|
+
if (existsSync24(fromSource) && fromSource.startsWith(projectRoot)) {
|
|
15310
15428
|
return fromSource;
|
|
15311
15429
|
}
|
|
15312
|
-
const fromNodeModules =
|
|
15313
|
-
if (
|
|
15430
|
+
const fromNodeModules = resolve24(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client");
|
|
15431
|
+
if (existsSync24(fromNodeModules))
|
|
15314
15432
|
return fromNodeModules;
|
|
15315
|
-
return
|
|
15433
|
+
return resolve24(import.meta.dir, "./dev/client");
|
|
15316
15434
|
}, devClientDir3, hmrClientPath4, transpiler4, scriptCache, scriptSetupCache, templateCache, styleCache, persistentBuildCache, vueSourceHashCache, vueHmrMetadata, clearVueHmrCaches = () => {
|
|
15317
15435
|
scriptCache.clear();
|
|
15318
15436
|
scriptSetupCache.clear();
|
|
@@ -15362,20 +15480,20 @@ var resolveDevClientDir3 = () => {
|
|
|
15362
15480
|
visited.add(resolved);
|
|
15363
15481
|
const importRegex = /@import\s+(?:url\(\s*)?(['"])(\.{1,2}\/[^'"]+)\1\s*\)?\s*;?/g;
|
|
15364
15482
|
return cssContent.replace(importRegex, (match, _quote, relPath) => {
|
|
15365
|
-
const importedPath =
|
|
15366
|
-
if (!
|
|
15483
|
+
const importedPath = resolve24(dirname17(cssFilePath), relPath);
|
|
15484
|
+
if (!existsSync24(importedPath))
|
|
15367
15485
|
return match;
|
|
15368
|
-
const importedContent =
|
|
15486
|
+
const importedContent = readFileSync21(importedPath, "utf-8");
|
|
15369
15487
|
return inlineCssImports(importedContent, importedPath, visited);
|
|
15370
15488
|
});
|
|
15371
15489
|
}, resolveHelperTsPath = (sourceDir, helper) => {
|
|
15372
15490
|
if (helper.endsWith(".ts"))
|
|
15373
|
-
return
|
|
15374
|
-
const direct =
|
|
15375
|
-
if (
|
|
15491
|
+
return resolve24(sourceDir, helper);
|
|
15492
|
+
const direct = resolve24(sourceDir, `${helper}.ts`);
|
|
15493
|
+
if (existsSync24(direct))
|
|
15376
15494
|
return direct;
|
|
15377
|
-
const indexed =
|
|
15378
|
-
if (
|
|
15495
|
+
const indexed = resolve24(sourceDir, helper, "index.ts");
|
|
15496
|
+
if (existsSync24(indexed))
|
|
15379
15497
|
return indexed;
|
|
15380
15498
|
return direct;
|
|
15381
15499
|
}, toJs = (filePath, sourceDir) => {
|
|
@@ -15385,16 +15503,16 @@ var resolveDevClientDir3 = () => {
|
|
|
15385
15503
|
return filePath.replace(/\.ts$/, ".js");
|
|
15386
15504
|
if (isStylePath(filePath)) {
|
|
15387
15505
|
if (sourceDir && (filePath.startsWith("./") || filePath.startsWith("../"))) {
|
|
15388
|
-
return
|
|
15506
|
+
return resolve24(sourceDir, filePath);
|
|
15389
15507
|
}
|
|
15390
15508
|
return filePath;
|
|
15391
15509
|
}
|
|
15392
15510
|
if (sourceDir && (filePath.startsWith("./") || filePath.startsWith("../"))) {
|
|
15393
|
-
const directTs =
|
|
15394
|
-
if (
|
|
15511
|
+
const directTs = resolve24(sourceDir, `${filePath}.ts`);
|
|
15512
|
+
if (existsSync24(directTs))
|
|
15395
15513
|
return `${filePath}.js`;
|
|
15396
|
-
const indexedTs =
|
|
15397
|
-
if (
|
|
15514
|
+
const indexedTs = resolve24(sourceDir, filePath, "index.ts");
|
|
15515
|
+
if (existsSync24(indexedTs))
|
|
15398
15516
|
return `${filePath}/index.js`;
|
|
15399
15517
|
}
|
|
15400
15518
|
return `${filePath}.js`;
|
|
@@ -15441,6 +15559,50 @@ const ${localName} = (source) => ${importedName}(
|
|
|
15441
15559
|
: { ...source, loader: () => __absoluteResolveAsyncVueComponent(source.loader) },
|
|
15442
15560
|
);`;
|
|
15443
15561
|
return code.replace(vueImportRegex, `import { ${specifiers.join(", ")} } from 'vue';${wrapper}`);
|
|
15562
|
+
}, EXTERNAL_STYLE_DEPENDENCY, hasExternalStyleDependency = (descriptor) => descriptor.styles.some((styleBlock) => Boolean(styleBlock.lang) || EXTERNAL_STYLE_DEPENDENCY.test(styleBlock.content)), fingerprintCache, currentVueCompileFingerprint = (compiler, outputDirs, vueRootDir, stylePreprocessors) => {
|
|
15563
|
+
const memoKey = JSON.stringify([outputDirs, vueRootDir, stylePreprocessors]);
|
|
15564
|
+
const memoised = fingerprintCache.get(memoKey);
|
|
15565
|
+
if (memoised !== undefined)
|
|
15566
|
+
return memoised;
|
|
15567
|
+
const fingerprint = vueCompileCacheFingerprint({
|
|
15568
|
+
compilerVersion: compiler.version,
|
|
15569
|
+
outputDirs,
|
|
15570
|
+
stylePreprocessors,
|
|
15571
|
+
vueRootDir
|
|
15572
|
+
});
|
|
15573
|
+
fingerprintCache.set(memoKey, fingerprint);
|
|
15574
|
+
return fingerprint;
|
|
15575
|
+
}, computeVueCompileCacheKey = (parts) => {
|
|
15576
|
+
if (!parts.fingerprint || !vueCompileCacheEnabled())
|
|
15577
|
+
return;
|
|
15578
|
+
if (hasExternalStyleDependency(parts.descriptor))
|
|
15579
|
+
return;
|
|
15580
|
+
const childKeys = [];
|
|
15581
|
+
for (const child of parts.childResults) {
|
|
15582
|
+
if (!child.cacheKey)
|
|
15583
|
+
return;
|
|
15584
|
+
childKeys.push(child.cacheKey);
|
|
15585
|
+
}
|
|
15586
|
+
return hashParts([
|
|
15587
|
+
parts.fingerprint,
|
|
15588
|
+
parts.relativeWithoutExtension,
|
|
15589
|
+
parts.isEntryPoint ? "entry" : "child",
|
|
15590
|
+
parts.contentHash,
|
|
15591
|
+
...childKeys
|
|
15592
|
+
]);
|
|
15593
|
+
}, materialiseVueCompileCacheEntry = async (entry, cacheKey2, isEntryPoint, outputDirs, fileBaseName) => {
|
|
15594
|
+
const { result } = entry;
|
|
15595
|
+
await mkdir7(dirname17(result.clientPath), { recursive: true });
|
|
15596
|
+
await mkdir7(dirname17(result.serverPath), { recursive: true });
|
|
15597
|
+
await write3(result.clientPath, entry.clientCode);
|
|
15598
|
+
await write3(result.serverPath, entry.serverCode);
|
|
15599
|
+
if (isEntryPoint && result.cssCodes.length > 0) {
|
|
15600
|
+
const cssOutputFile = join33(outputDirs.css, `${toKebab(fileBaseName)}-compiled.css`);
|
|
15601
|
+
await mkdir7(dirname17(cssOutputFile), { recursive: true });
|
|
15602
|
+
await write3(cssOutputFile, result.cssCodes.join(`
|
|
15603
|
+
`));
|
|
15604
|
+
}
|
|
15605
|
+
return { ...result, cacheKey: cacheKey2 };
|
|
15444
15606
|
}, compileVueFile = async (sourceFilePath, outputDirs, cacheMap, isEntryPoint, vueRootDir, compiler, stylePreprocessors) => {
|
|
15445
15607
|
const cachedResult = cacheMap.get(sourceFilePath);
|
|
15446
15608
|
if (cachedResult)
|
|
@@ -15455,7 +15617,7 @@ const ${localName} = (source) => ${importedName}(
|
|
|
15455
15617
|
const contentHash = Bun.hash(sourceContent).toString(BASE_36_RADIX);
|
|
15456
15618
|
const prevHash = vueSourceHashCache.get(sourceFilePath);
|
|
15457
15619
|
const persistent = persistentBuildCache.get(sourceFilePath);
|
|
15458
|
-
if (prevHash === contentHash && persistent &&
|
|
15620
|
+
if (prevHash === contentHash && persistent && existsSync24(persistent.clientPath) && existsSync24(persistent.serverPath)) {
|
|
15459
15621
|
cacheMap.set(sourceFilePath, persistent);
|
|
15460
15622
|
return persistent;
|
|
15461
15623
|
}
|
|
@@ -15484,25 +15646,55 @@ const ${localName} = (source) => ${importedName}(
|
|
|
15484
15646
|
const childComponentPaths = importPaths.filter((path) => path.startsWith(".") && path.endsWith(".vue"));
|
|
15485
15647
|
const packageComponentPaths = Array.from(resolvedPackageVueImports.entries());
|
|
15486
15648
|
const helperModulePaths = importPaths.filter((path) => path.startsWith(".") && !path.endsWith(".vue") && !isStylePath(path));
|
|
15487
|
-
const stylePathsImported = importPaths.filter((path) => (path.startsWith(".") || isAbsolute4(path)) && isStylePath(path)).map((path) => isAbsolute4(path) ? path :
|
|
15649
|
+
const stylePathsImported = importPaths.filter((path) => (path.startsWith(".") || isAbsolute4(path)) && isStylePath(path)).map((path) => isAbsolute4(path) ? path : resolve24(dirname17(sourceFilePath), path));
|
|
15488
15650
|
for (const stylePath of stylePathsImported) {
|
|
15489
15651
|
addStyleImporter(sourceFilePath, stylePath);
|
|
15490
15652
|
}
|
|
15491
15653
|
const childBuildResults = await Promise.all([
|
|
15492
|
-
...childComponentPaths.map((relativeChildPath) => compileVueFile(
|
|
15654
|
+
...childComponentPaths.map((relativeChildPath) => compileVueFile(resolve24(dirname17(sourceFilePath), relativeChildPath), outputDirs, cacheMap, false, vueRootDir, compiler, stylePreprocessors)),
|
|
15493
15655
|
...packageComponentPaths.map(([, absolutePath]) => compileVueFile(absolutePath, outputDirs, cacheMap, false, vueRootDir, compiler, stylePreprocessors))
|
|
15494
15656
|
]);
|
|
15657
|
+
const cacheKey2 = computeVueCompileCacheKey({
|
|
15658
|
+
childResults: childBuildResults,
|
|
15659
|
+
contentHash,
|
|
15660
|
+
descriptor,
|
|
15661
|
+
fingerprint: currentVueCompileFingerprint(compiler, outputDirs, vueRootDir, stylePreprocessors),
|
|
15662
|
+
isEntryPoint,
|
|
15663
|
+
relativeWithoutExtension
|
|
15664
|
+
});
|
|
15665
|
+
const typeDepHashes = {};
|
|
15666
|
+
if (cacheKey2) {
|
|
15667
|
+
const restored = readVueCompileCacheEntry(sourceFilePath, cacheKey2);
|
|
15668
|
+
if (restored) {
|
|
15669
|
+
const result2 = await materialiseVueCompileCacheEntry(restored, cacheKey2, isEntryPoint, outputDirs, fileBaseName);
|
|
15670
|
+
cacheMap.set(sourceFilePath, result2);
|
|
15671
|
+
persistentBuildCache.set(sourceFilePath, result2);
|
|
15672
|
+
return result2;
|
|
15673
|
+
}
|
|
15674
|
+
}
|
|
15495
15675
|
const hasScript = descriptor.script || descriptor.scriptSetup;
|
|
15496
15676
|
const compiledScript = hasScript ? compiler.compileScript(descriptor, {
|
|
15497
15677
|
fs: {
|
|
15498
|
-
fileExists:
|
|
15499
|
-
readFile: (file3) =>
|
|
15678
|
+
fileExists: existsSync24,
|
|
15679
|
+
readFile: (file3) => {
|
|
15680
|
+
if (!existsSync24(file3))
|
|
15681
|
+
return;
|
|
15682
|
+
const content = readFileSync21(file3, "utf-8");
|
|
15683
|
+
typeDepHashes[file3] = hashContent(content);
|
|
15684
|
+
return content;
|
|
15685
|
+
},
|
|
15500
15686
|
realpath: realpathSync2
|
|
15501
15687
|
},
|
|
15502
15688
|
id: componentId,
|
|
15503
15689
|
inlineTemplate: false,
|
|
15504
15690
|
sourceMap: true
|
|
15505
15691
|
}) : { bindings: {}, content: "export default {};", map: undefined };
|
|
15692
|
+
const typeDependencies = "deps" in compiledScript ? compiledScript.deps ?? [] : [];
|
|
15693
|
+
for (const dep of typeDependencies) {
|
|
15694
|
+
if (dep in typeDepHashes || !existsSync24(dep))
|
|
15695
|
+
continue;
|
|
15696
|
+
typeDepHashes[dep] = hashContent(readFileSync21(dep, "utf-8"));
|
|
15697
|
+
}
|
|
15506
15698
|
const strippedScript = stripExports2(compiledScript.content);
|
|
15507
15699
|
const sourceDir = dirname17(sourceFilePath);
|
|
15508
15700
|
const transpiledScript = transpiler4.transformSync(strippedScript).replace(/(['"])(\.{1,2}\/[^'"]+)(['"])/g, (_2, quoteStart, relativeImport, quoteEnd) => `${quoteStart}${toJs(relativeImport, sourceDir)}${quoteEnd}`);
|
|
@@ -15549,7 +15741,7 @@ const ${localName} = (source) => ${importedName}(
|
|
|
15549
15741
|
];
|
|
15550
15742
|
let cssOutputPaths = [];
|
|
15551
15743
|
if (isEntryPoint && allCss.length) {
|
|
15552
|
-
const cssOutputFile =
|
|
15744
|
+
const cssOutputFile = join33(outputDirs.css, `${toKebab(fileBaseName)}-compiled.css`);
|
|
15553
15745
|
await mkdir7(dirname17(cssOutputFile), { recursive: true });
|
|
15554
15746
|
await write3(cssOutputFile, allCss.join(`
|
|
15555
15747
|
`));
|
|
@@ -15580,8 +15772,8 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
15580
15772
|
};
|
|
15581
15773
|
const clientCode = assembleModule(generateRenderFunction(false), "render", true) + islandMetadataExports;
|
|
15582
15774
|
const serverCode = wrapServerAsyncComponentLoader(assembleModule(generateRenderFunction(true), "ssrRender", false)) + islandMetadataExports;
|
|
15583
|
-
const clientOutputPath =
|
|
15584
|
-
const serverOutputPath =
|
|
15775
|
+
const clientOutputPath = join33(outputDirs.client, `${relativeWithoutExtension}.js`);
|
|
15776
|
+
const serverOutputPath = join33(outputDirs.server, `${relativeWithoutExtension}.js`);
|
|
15585
15777
|
const rewritePackageImports = (code, outputPath, mode) => {
|
|
15586
15778
|
let result2 = code;
|
|
15587
15779
|
for (const [bareImport, paths] of packageImportRewrites) {
|
|
@@ -15607,9 +15799,11 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
15607
15799
|
//# sourceMappingURL=data:application/json;base64,${Buffer.from(JSON.stringify(map)).toString("base64")}
|
|
15608
15800
|
`;
|
|
15609
15801
|
};
|
|
15610
|
-
|
|
15611
|
-
|
|
15612
|
-
|
|
15802
|
+
const clientOutput = clientFinal + inlineSourceMapFor(clientFinal);
|
|
15803
|
+
const serverOutput = serverFinal + inlineSourceMapFor(serverFinal);
|
|
15804
|
+
await write3(clientOutputPath, clientOutput);
|
|
15805
|
+
await write3(serverOutputPath, serverOutput);
|
|
15806
|
+
const cacheableResult = {
|
|
15613
15807
|
clientPath: clientOutputPath,
|
|
15614
15808
|
cssCodes: allCss,
|
|
15615
15809
|
cssPaths: cssOutputPaths,
|
|
@@ -15621,16 +15815,26 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
15621
15815
|
...childBuildResults.flatMap((child) => child.tsHelperPaths)
|
|
15622
15816
|
]
|
|
15623
15817
|
};
|
|
15818
|
+
const result = { ...cacheableResult, cacheKey: cacheKey2 };
|
|
15624
15819
|
cacheMap.set(sourceFilePath, result);
|
|
15625
15820
|
persistentBuildCache.set(sourceFilePath, result);
|
|
15821
|
+
if (cacheKey2) {
|
|
15822
|
+
writeVueCompileCacheEntry(sourceFilePath, {
|
|
15823
|
+
clientCode: clientOutput,
|
|
15824
|
+
key: cacheKey2,
|
|
15825
|
+
result: cacheableResult,
|
|
15826
|
+
serverCode: serverOutput,
|
|
15827
|
+
typeDeps: typeDepHashes
|
|
15828
|
+
});
|
|
15829
|
+
}
|
|
15626
15830
|
return result;
|
|
15627
15831
|
}, compileVue = async (entryPoints, vueRootDir, isDev2 = false, stylePreprocessors, ssrOnlyEntries) => {
|
|
15628
15832
|
const compiler = await loadVueCompiler();
|
|
15629
15833
|
const generatedDir = getFrameworkGeneratedDir("vue");
|
|
15630
|
-
const clientOutputDir =
|
|
15631
|
-
const indexOutputDir =
|
|
15632
|
-
const serverOutputDir =
|
|
15633
|
-
const cssOutputDir =
|
|
15834
|
+
const clientOutputDir = join33(generatedDir, "client");
|
|
15835
|
+
const indexOutputDir = join33(generatedDir, "indexes");
|
|
15836
|
+
const serverOutputDir = join33(generatedDir, "server");
|
|
15837
|
+
const cssOutputDir = join33(generatedDir, "compiled");
|
|
15634
15838
|
await Promise.all([
|
|
15635
15839
|
mkdir7(clientOutputDir, { recursive: true }),
|
|
15636
15840
|
mkdir7(indexOutputDir, { recursive: true }),
|
|
@@ -15640,7 +15844,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
15640
15844
|
const buildCache = new Map;
|
|
15641
15845
|
const allTsHelperPaths = new Set;
|
|
15642
15846
|
const expandSpaRouteChildren = async (entries) => {
|
|
15643
|
-
const expanded = new Set(entries.map((entry) =>
|
|
15847
|
+
const expanded = new Set(entries.map((entry) => resolve24(entry)));
|
|
15644
15848
|
const queue2 = [...expanded];
|
|
15645
15849
|
while (queue2.length > 0) {
|
|
15646
15850
|
const entryPath = queue2.pop();
|
|
@@ -15657,8 +15861,8 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
15657
15861
|
});
|
|
15658
15862
|
const routes = parseVueSpaRoutes(descriptor.script?.content ?? "");
|
|
15659
15863
|
for (const { importPath } of routes) {
|
|
15660
|
-
const childPath =
|
|
15661
|
-
if (expanded.has(childPath) || !
|
|
15864
|
+
const childPath = resolve24(dirname17(entryPath), importPath);
|
|
15865
|
+
if (expanded.has(childPath) || !existsSync24(childPath)) {
|
|
15662
15866
|
continue;
|
|
15663
15867
|
}
|
|
15664
15868
|
expanded.add(childPath);
|
|
@@ -15669,7 +15873,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
15669
15873
|
};
|
|
15670
15874
|
const expandedEntryPoints = await expandSpaRouteChildren(entryPoints);
|
|
15671
15875
|
const compiledPages = await Promise.all(expandedEntryPoints.map(async (entryPath) => {
|
|
15672
|
-
const resolvedEntryPath =
|
|
15876
|
+
const resolvedEntryPath = resolve24(entryPath);
|
|
15673
15877
|
const result = await compileVueFile(resolvedEntryPath, {
|
|
15674
15878
|
client: clientOutputDir,
|
|
15675
15879
|
css: cssOutputDir,
|
|
@@ -15687,8 +15891,8 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
15687
15891
|
};
|
|
15688
15892
|
}
|
|
15689
15893
|
const entryBaseName = basename11(entryPath, ".vue");
|
|
15690
|
-
const indexOutputFile =
|
|
15691
|
-
const clientOutputFile =
|
|
15894
|
+
const indexOutputFile = join33(indexOutputDir, `${entryBaseName}.js`);
|
|
15895
|
+
const clientOutputFile = join33(clientOutputDir, relative13(vueRootDir, entryPath).replace(/\\/g, "/").replace(/\.vue$/, ".js"));
|
|
15692
15896
|
await mkdir7(dirname17(indexOutputFile), { recursive: true });
|
|
15693
15897
|
const vueHmrImports = isDev2 ? [
|
|
15694
15898
|
`window.__HMR_FRAMEWORK__ = "vue";`,
|
|
@@ -15872,7 +16076,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
15872
16076
|
continue;
|
|
15873
16077
|
}
|
|
15874
16078
|
const resolved = resolveHelperTsPath(helperDir, dep);
|
|
15875
|
-
if (!
|
|
16079
|
+
if (!existsSync24(resolved))
|
|
15876
16080
|
continue;
|
|
15877
16081
|
if (allTsHelperPaths.has(resolved))
|
|
15878
16082
|
continue;
|
|
@@ -15885,8 +16089,8 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
15885
16089
|
const transpiledCode = transpiler4.transformSync(sourceCode);
|
|
15886
16090
|
const withMap = transpiledCode + inlineLineMapComment(tsPath, sourceCode, transpiledCode);
|
|
15887
16091
|
const relativeJsPath = relative13(vueRootDir, tsPath).replace(/\.ts$/, ".js");
|
|
15888
|
-
const outClientPath =
|
|
15889
|
-
const outServerPath =
|
|
16092
|
+
const outClientPath = join33(clientOutputDir, relativeJsPath);
|
|
16093
|
+
const outServerPath = join33(serverOutputDir, relativeJsPath);
|
|
15890
16094
|
await mkdir7(dirname17(outClientPath), { recursive: true });
|
|
15891
16095
|
await mkdir7(dirname17(outServerPath), { recursive: true });
|
|
15892
16096
|
await write3(outClientPath, withMap);
|
|
@@ -15917,8 +16121,9 @@ var init_compileVue = __esm(() => {
|
|
|
15917
16121
|
init_chainInlineSourcemaps();
|
|
15918
16122
|
init_vueAutoRouterTransform();
|
|
15919
16123
|
init_stylePreprocessor();
|
|
16124
|
+
init_vueCompileCache();
|
|
15920
16125
|
devClientDir3 = resolveDevClientDir3();
|
|
15921
|
-
hmrClientPath4 =
|
|
16126
|
+
hmrClientPath4 = join33(devClientDir3, "hmrClient.ts").replace(/\\/g, "/");
|
|
15922
16127
|
transpiler4 = new Transpiler3({ loader: "ts", target: "browser" });
|
|
15923
16128
|
scriptCache = new Map;
|
|
15924
16129
|
scriptSetupCache = new Map;
|
|
@@ -15927,6 +16132,8 @@ var init_compileVue = __esm(() => {
|
|
|
15927
16132
|
persistentBuildCache = new Map;
|
|
15928
16133
|
vueSourceHashCache = new Map;
|
|
15929
16134
|
vueHmrMetadata = new Map;
|
|
16135
|
+
EXTERNAL_STYLE_DEPENDENCY = /@(?:import|use|forward)\b/;
|
|
16136
|
+
fingerprintCache = new Map;
|
|
15930
16137
|
});
|
|
15931
16138
|
|
|
15932
16139
|
// src/angular/lowerDeferSyntax.ts
|
|
@@ -16399,8 +16606,8 @@ __export(exports_compileAngular, {
|
|
|
16399
16606
|
compileAngularFiles: () => compileAngularFiles,
|
|
16400
16607
|
invalidateAngularJitCache: () => invalidateAngularJitCache
|
|
16401
16608
|
});
|
|
16402
|
-
import { existsSync as
|
|
16403
|
-
import { join as
|
|
16609
|
+
import { existsSync as existsSync25, readFileSync as readFileSync22, promises as fs5 } from "fs";
|
|
16610
|
+
import { join as join34, basename as basename12, sep as sep3, dirname as dirname18, resolve as resolve25, relative as relative14 } from "path";
|
|
16404
16611
|
var {Glob: Glob6 } = globalThis.Bun;
|
|
16405
16612
|
import ts14 from "typescript";
|
|
16406
16613
|
var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) => {
|
|
@@ -16416,10 +16623,10 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
16416
16623
|
return tracePhase ? tracePhase(`compile/angular/${name}`, fn2, metadata) : await fn2();
|
|
16417
16624
|
}, readTsconfigPathAliases = () => {
|
|
16418
16625
|
try {
|
|
16419
|
-
const configPath2 =
|
|
16626
|
+
const configPath2 = resolve25(process.cwd(), "tsconfig.json");
|
|
16420
16627
|
const config = ts14.readConfigFile(configPath2, ts14.sys.readFile).config;
|
|
16421
16628
|
const compilerOptions = config?.compilerOptions ?? {};
|
|
16422
|
-
const baseUrl =
|
|
16629
|
+
const baseUrl = resolve25(process.cwd(), compilerOptions.baseUrl ?? ".");
|
|
16423
16630
|
const aliases = Object.entries(compilerOptions.paths ?? {}).map(([pattern, replacements]) => ({ pattern, replacements }));
|
|
16424
16631
|
return { aliases, baseUrl };
|
|
16425
16632
|
} catch {
|
|
@@ -16439,7 +16646,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
16439
16646
|
const wildcardValue = exactMatch ? "" : specifier.slice(prefix.length, specifier.length - suffix.length);
|
|
16440
16647
|
for (const replacement of alias.replacements) {
|
|
16441
16648
|
const candidate = replacement.replace("*", wildcardValue);
|
|
16442
|
-
const resolved = resolveSourceFile(
|
|
16649
|
+
const resolved = resolveSourceFile(resolve25(baseUrl, candidate));
|
|
16443
16650
|
if (resolved)
|
|
16444
16651
|
return resolved;
|
|
16445
16652
|
}
|
|
@@ -16451,20 +16658,20 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
16451
16658
|
`${candidate}.tsx`,
|
|
16452
16659
|
`${candidate}.js`,
|
|
16453
16660
|
`${candidate}.jsx`,
|
|
16454
|
-
|
|
16455
|
-
|
|
16456
|
-
|
|
16457
|
-
|
|
16661
|
+
join34(candidate, "index.ts"),
|
|
16662
|
+
join34(candidate, "index.tsx"),
|
|
16663
|
+
join34(candidate, "index.js"),
|
|
16664
|
+
join34(candidate, "index.jsx")
|
|
16458
16665
|
];
|
|
16459
|
-
return candidates.find((file3) =>
|
|
16666
|
+
return candidates.find((file3) => existsSync25(file3));
|
|
16460
16667
|
}, createLegacyAngularAnimationUsageResolver = (rootDir) => {
|
|
16461
|
-
const baseDir =
|
|
16668
|
+
const baseDir = resolve25(rootDir);
|
|
16462
16669
|
const tsconfigAliases = readTsconfigPathAliases();
|
|
16463
16670
|
const transpiler5 = new Bun.Transpiler({ loader: "tsx" });
|
|
16464
16671
|
const scanCache = new Map;
|
|
16465
16672
|
const resolveLocalImport = (specifier, fromDir) => {
|
|
16466
16673
|
if (specifier.startsWith(".") || specifier.startsWith("/")) {
|
|
16467
|
-
return resolveSourceFile(
|
|
16674
|
+
return resolveSourceFile(resolve25(fromDir, specifier));
|
|
16468
16675
|
}
|
|
16469
16676
|
const aliased = matchTsconfigAlias(specifier, tsconfigAliases.aliases, tsconfigAliases.baseUrl, resolveSourceFile);
|
|
16470
16677
|
if (aliased)
|
|
@@ -16473,7 +16680,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
16473
16680
|
const resolved = Bun.resolveSync(specifier, fromDir);
|
|
16474
16681
|
if (resolved.includes("/node_modules/"))
|
|
16475
16682
|
return;
|
|
16476
|
-
const absolute =
|
|
16683
|
+
const absolute = resolve25(resolved);
|
|
16477
16684
|
if (!absolute.startsWith(baseDir))
|
|
16478
16685
|
return;
|
|
16479
16686
|
return resolveSourceFile(absolute);
|
|
@@ -16489,7 +16696,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
16489
16696
|
usesLegacyAnimations: false
|
|
16490
16697
|
});
|
|
16491
16698
|
}
|
|
16492
|
-
const resolved =
|
|
16699
|
+
const resolved = resolve25(actualPath);
|
|
16493
16700
|
const cached = scanCache.get(resolved);
|
|
16494
16701
|
if (cached)
|
|
16495
16702
|
return cached;
|
|
@@ -16518,7 +16725,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
16518
16725
|
const actualPath = resolveSourceFile(filePath);
|
|
16519
16726
|
if (!actualPath)
|
|
16520
16727
|
return false;
|
|
16521
|
-
const resolved =
|
|
16728
|
+
const resolved = resolve25(actualPath);
|
|
16522
16729
|
if (visited.has(resolved))
|
|
16523
16730
|
return false;
|
|
16524
16731
|
visited.add(resolved);
|
|
@@ -16536,14 +16743,14 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
16536
16743
|
return (entryPath) => visit(entryPath);
|
|
16537
16744
|
}, resolveDevClientDir4 = () => {
|
|
16538
16745
|
const projectRoot = process.cwd();
|
|
16539
|
-
const fromSource =
|
|
16540
|
-
if (
|
|
16746
|
+
const fromSource = resolve25(import.meta.dir, "../dev/client");
|
|
16747
|
+
if (existsSync25(fromSource) && fromSource.startsWith(projectRoot)) {
|
|
16541
16748
|
return fromSource;
|
|
16542
16749
|
}
|
|
16543
|
-
const fromNodeModules =
|
|
16544
|
-
if (
|
|
16750
|
+
const fromNodeModules = resolve25(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client");
|
|
16751
|
+
if (existsSync25(fromNodeModules))
|
|
16545
16752
|
return fromNodeModules;
|
|
16546
|
-
return
|
|
16753
|
+
return resolve25(import.meta.dir, "./dev/client");
|
|
16547
16754
|
}, devClientDir4, hmrClientPath5, formatDiagnosticMessage = (diagnostic) => {
|
|
16548
16755
|
try {
|
|
16549
16756
|
return ts14.flattenDiagnosticMessageText(diagnostic.messageText, `
|
|
@@ -16586,12 +16793,12 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
16586
16793
|
if (hasJsLikeExtension(path))
|
|
16587
16794
|
return `${path}${query}`;
|
|
16588
16795
|
const importerDir = dirname18(importerOutputPath);
|
|
16589
|
-
const fileCandidate =
|
|
16590
|
-
if (outputFiles?.has(fileCandidate) ||
|
|
16796
|
+
const fileCandidate = resolve25(importerDir, `${path}.js`);
|
|
16797
|
+
if (outputFiles?.has(fileCandidate) || existsSync25(fileCandidate)) {
|
|
16591
16798
|
return `${path}.js${query}`;
|
|
16592
16799
|
}
|
|
16593
|
-
const indexCandidate =
|
|
16594
|
-
if (outputFiles?.has(indexCandidate) ||
|
|
16800
|
+
const indexCandidate = resolve25(importerDir, path, "index.js");
|
|
16801
|
+
if (outputFiles?.has(indexCandidate) || existsSync25(indexCandidate)) {
|
|
16595
16802
|
return `${path}/index.js${query}`;
|
|
16596
16803
|
}
|
|
16597
16804
|
return `${path}.js${query}`;
|
|
@@ -16618,18 +16825,18 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
16618
16825
|
}, resolveLocalTsImport = (fromFile, specifier) => {
|
|
16619
16826
|
if (!isRelativeModuleSpecifier(specifier))
|
|
16620
16827
|
return null;
|
|
16621
|
-
const basePath =
|
|
16828
|
+
const basePath = resolve25(dirname18(fromFile), specifier);
|
|
16622
16829
|
const candidates = /\.[cm]?[tj]sx?$/.test(basePath) ? [basePath] : [
|
|
16623
16830
|
`${basePath}.ts`,
|
|
16624
16831
|
`${basePath}.tsx`,
|
|
16625
16832
|
`${basePath}.mts`,
|
|
16626
16833
|
`${basePath}.cts`,
|
|
16627
|
-
|
|
16628
|
-
|
|
16629
|
-
|
|
16630
|
-
|
|
16834
|
+
join34(basePath, "index.ts"),
|
|
16835
|
+
join34(basePath, "index.tsx"),
|
|
16836
|
+
join34(basePath, "index.mts"),
|
|
16837
|
+
join34(basePath, "index.cts")
|
|
16631
16838
|
];
|
|
16632
|
-
return candidates.map((candidate) =>
|
|
16839
|
+
return candidates.map((candidate) => resolve25(candidate)).find((candidate) => existsSync25(candidate) && !candidate.endsWith(".d.ts")) ?? null;
|
|
16633
16840
|
}, readFileForAotTransform = async (fileName, readFile6) => {
|
|
16634
16841
|
const hostSource = readFile6?.(fileName);
|
|
16635
16842
|
if (typeof hostSource === "string")
|
|
@@ -16653,18 +16860,18 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
16653
16860
|
const paths = [];
|
|
16654
16861
|
const templateUrlMatch = findUncommentedMatch(source, /templateUrl\s*:\s*['"]([^'"]+)['"]/);
|
|
16655
16862
|
if (templateUrlMatch?.[1])
|
|
16656
|
-
paths.push(
|
|
16863
|
+
paths.push(join34(fileDir, templateUrlMatch[1]));
|
|
16657
16864
|
const styleUrlMatch = findUncommentedMatch(source, /styleUrl\s*:\s*['"]([^'"]+)['"]/);
|
|
16658
16865
|
if (styleUrlMatch?.[1])
|
|
16659
|
-
paths.push(
|
|
16866
|
+
paths.push(join34(fileDir, styleUrlMatch[1]));
|
|
16660
16867
|
const styleUrlsMatch = findUncommentedMatch(source, /styleUrls\s*:\s*\[([^\]]+)\]/);
|
|
16661
16868
|
const urlMatches = styleUrlsMatch?.[1]?.match(/['"]([^'"]+)['"]/g);
|
|
16662
16869
|
if (urlMatches) {
|
|
16663
16870
|
for (const urlMatch of urlMatches) {
|
|
16664
|
-
paths.push(
|
|
16871
|
+
paths.push(join34(fileDir, urlMatch.replace(/['"]/g, "")));
|
|
16665
16872
|
}
|
|
16666
16873
|
}
|
|
16667
|
-
return paths.map((path) =>
|
|
16874
|
+
return paths.map((path) => resolve25(path));
|
|
16668
16875
|
}, readResourceCacheFile = async (cachePath) => {
|
|
16669
16876
|
try {
|
|
16670
16877
|
const entry = JSON.parse(await fs5.readFile(cachePath, "utf-8"));
|
|
@@ -16695,7 +16902,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
16695
16902
|
safeStableStringify(stylePreprocessors ?? null)
|
|
16696
16903
|
].join("\x00");
|
|
16697
16904
|
const cacheKey2 = Bun.hash(cacheInput).toString(BASE_36_RADIX);
|
|
16698
|
-
return
|
|
16905
|
+
return join34(process.cwd(), ".absolutejs", "cache", "angular-resources", `${cacheKey2}.json`);
|
|
16699
16906
|
}, precomputeAotResourceTransforms = async (inputPaths, readFile6, stylePreprocessors) => {
|
|
16700
16907
|
const transformedSources = new Map;
|
|
16701
16908
|
const visited = new Set;
|
|
@@ -16706,11 +16913,11 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
16706
16913
|
transformedFiles: 0
|
|
16707
16914
|
};
|
|
16708
16915
|
const transformFile = async (filePath) => {
|
|
16709
|
-
const resolvedPath =
|
|
16916
|
+
const resolvedPath = resolve25(filePath);
|
|
16710
16917
|
if (visited.has(resolvedPath))
|
|
16711
16918
|
return;
|
|
16712
16919
|
visited.add(resolvedPath);
|
|
16713
|
-
if (!
|
|
16920
|
+
if (!existsSync25(resolvedPath) || resolvedPath.endsWith(".d.ts"))
|
|
16714
16921
|
return;
|
|
16715
16922
|
stats.filesVisited += 1;
|
|
16716
16923
|
const source = await readFileForAotTransform(resolvedPath, readFile6);
|
|
@@ -16741,10 +16948,10 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
16741
16948
|
return { stats, transformedSources };
|
|
16742
16949
|
}, compileAngularFiles = async (inputPaths, outDir, stylePreprocessors) => {
|
|
16743
16950
|
const islandMetadataByOutputPath = await traceAngularPhase("aot/island-metadata", () => new Map(inputPaths.map((inputPath) => {
|
|
16744
|
-
const outputPath =
|
|
16951
|
+
const outputPath = resolve25(join34(outDir, relative14(process.cwd(), resolve25(inputPath)).replace(/\.[cm]?[tj]sx?$/, ".js")));
|
|
16745
16952
|
return [
|
|
16746
16953
|
outputPath,
|
|
16747
|
-
buildIslandMetadataExports(
|
|
16954
|
+
buildIslandMetadataExports(readFileSync22(inputPath, "utf-8"))
|
|
16748
16955
|
];
|
|
16749
16956
|
})), { entries: inputPaths.length });
|
|
16750
16957
|
await traceAngularPhase("aot/preload-compiler", () => import("@angular/compiler"));
|
|
@@ -16752,7 +16959,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
16752
16959
|
const tsLibDir = await traceAngularPhase("aot/resolve-typescript-lib", () => {
|
|
16753
16960
|
const tsPath = __require.resolve("typescript");
|
|
16754
16961
|
const tsRootDir = dirname18(tsPath);
|
|
16755
|
-
return tsRootDir.endsWith("lib") ? tsRootDir :
|
|
16962
|
+
return tsRootDir.endsWith("lib") ? tsRootDir : resolve25(tsRootDir, "lib");
|
|
16756
16963
|
});
|
|
16757
16964
|
const config = await traceAngularPhase("aot/read-configuration", () => readConfiguration("./tsconfig.json"));
|
|
16758
16965
|
const options = {
|
|
@@ -16788,13 +16995,13 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
16788
16995
|
const originalGetSourceFile = host2.getSourceFile;
|
|
16789
16996
|
host2.getSourceFile = (fileName, languageVersion, onError) => {
|
|
16790
16997
|
if (fileName.startsWith("lib.") && fileName.endsWith(".d.ts") && tsLibDir) {
|
|
16791
|
-
const resolvedPath =
|
|
16998
|
+
const resolvedPath = join34(tsLibDir, fileName);
|
|
16792
16999
|
return originalGetSourceFile?.call(host2, resolvedPath, languageVersion, onError);
|
|
16793
17000
|
}
|
|
16794
17001
|
return originalGetSourceFile?.call(host2, fileName, languageVersion, onError);
|
|
16795
17002
|
};
|
|
16796
17003
|
const emitted = {};
|
|
16797
|
-
const resolvedOutDir =
|
|
17004
|
+
const resolvedOutDir = resolve25(outDir);
|
|
16798
17005
|
host2.writeFile = (fileName, text2) => {
|
|
16799
17006
|
const relativePath = resolveRelativePath(fileName, resolvedOutDir, outDir);
|
|
16800
17007
|
emitted[relativePath] = text2;
|
|
@@ -16816,12 +17023,12 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
16816
17023
|
if (!fileName.endsWith(".ts") || fileName.endsWith(".d.ts")) {
|
|
16817
17024
|
return source;
|
|
16818
17025
|
}
|
|
16819
|
-
const resolvedPath =
|
|
17026
|
+
const resolvedPath = resolve25(fileName);
|
|
16820
17027
|
return transformedSources.get(resolvedPath) ?? source;
|
|
16821
17028
|
};
|
|
16822
17029
|
const originalGetSourceFileForCompile = host2.getSourceFile;
|
|
16823
17030
|
host2.getSourceFile = (fileName, languageVersion, onError) => {
|
|
16824
|
-
const source = transformedSources.get(
|
|
17031
|
+
const source = transformedSources.get(resolve25(fileName));
|
|
16825
17032
|
if (source) {
|
|
16826
17033
|
return ts14.createSourceFile(fileName, source, languageVersion, true);
|
|
16827
17034
|
}
|
|
@@ -16843,9 +17050,9 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
16843
17050
|
const entries = await traceAngularPhase("aot/postprocess-emitted-js", () => {
|
|
16844
17051
|
const rawEntries = Object.entries(emitted).filter(([fileName]) => fileName.endsWith(".js")).map(([fileName, content]) => ({
|
|
16845
17052
|
content,
|
|
16846
|
-
target:
|
|
17053
|
+
target: join34(outDir, fileName)
|
|
16847
17054
|
}));
|
|
16848
|
-
const outputFiles = new Set(rawEntries.map(({ target }) =>
|
|
17055
|
+
const outputFiles = new Set(rawEntries.map(({ target }) => resolve25(target)));
|
|
16849
17056
|
return rawEntries.map(({ content, target }) => {
|
|
16850
17057
|
let processedContent = content.replace(/from\s+(['"])(\.\.?\/[^'"]+)(\1)/g, (match, quote, path) => {
|
|
16851
17058
|
const rewritten = rewriteRelativeJsSpecifier(target, path, outputFiles);
|
|
@@ -16860,7 +17067,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
16860
17067
|
return cleaned ? `import { ${cleaned}, InternalInjectFlags } from '@angular/core'` : `import { InternalInjectFlags } from '@angular/core'`;
|
|
16861
17068
|
});
|
|
16862
17069
|
processedContent = processedContent.replace(/\b(?<!Internal)InjectFlags\b/g, "InternalInjectFlags");
|
|
16863
|
-
processedContent += islandMetadataByOutputPath.get(
|
|
17070
|
+
processedContent += islandMetadataByOutputPath.get(resolve25(target)) ?? "";
|
|
16864
17071
|
return { content: processedContent, target };
|
|
16865
17072
|
});
|
|
16866
17073
|
});
|
|
@@ -16870,7 +17077,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
16870
17077
|
})), { outputs: entries.length });
|
|
16871
17078
|
return await traceAngularPhase("aot/collect-output-paths", () => entries.map(({ target }) => target), { outputs: entries.length });
|
|
16872
17079
|
}, compileAngularFile = async (inputPath, outDir, stylePreprocessors) => compileAngularFiles([inputPath], outDir, stylePreprocessors), jitContentCache, invalidateAngularJitCache = (filePath) => {
|
|
16873
|
-
jitContentCache.delete(
|
|
17080
|
+
jitContentCache.delete(resolve25(filePath));
|
|
16874
17081
|
}, wrapperOutputCache, escapeTemplateContent = (content) => content.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$\{/g, "\\${"), findUncommentedMatch = (source, pattern) => {
|
|
16875
17082
|
const re2 = new RegExp(pattern.source, pattern.flags.includes("g") ? pattern.flags : pattern.flags + "g");
|
|
16876
17083
|
let match;
|
|
@@ -16883,8 +17090,8 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
16883
17090
|
}
|
|
16884
17091
|
return null;
|
|
16885
17092
|
}, resolveAngularDeferImportSpecifier = () => {
|
|
16886
|
-
const sourceEntry =
|
|
16887
|
-
if (
|
|
17093
|
+
const sourceEntry = resolve25(import.meta.dir, "../angular/components/index.ts");
|
|
17094
|
+
if (existsSync25(sourceEntry)) {
|
|
16888
17095
|
return sourceEntry.replace(/\\/g, "/");
|
|
16889
17096
|
}
|
|
16890
17097
|
return "@absolutejs/absolute/angular/components";
|
|
@@ -17012,7 +17219,7 @@ ${slot.resolvedBindings.map((binding) => ` "${binding.key}": this.__absoluteDef
|
|
|
17012
17219
|
${fields}
|
|
17013
17220
|
`);
|
|
17014
17221
|
}, readAndEscapeFile = async (filePath, stylePreprocessors) => {
|
|
17015
|
-
if (!
|
|
17222
|
+
if (!existsSync25(filePath)) {
|
|
17016
17223
|
throw new Error(`Unable to inline Angular style resource: file not found at ${filePath}`);
|
|
17017
17224
|
}
|
|
17018
17225
|
const content = await compileStyleFileIfNeeded(filePath, stylePreprocessors);
|
|
@@ -17020,8 +17227,8 @@ ${fields}
|
|
|
17020
17227
|
}, inlineTemplateAndLowerDefer = async (source, fileDir) => {
|
|
17021
17228
|
const templateUrlMatch = findUncommentedMatch(source, /templateUrl\s*:\s*['"]([^'"]+)['"]/);
|
|
17022
17229
|
if (templateUrlMatch?.[1]) {
|
|
17023
|
-
const templatePath =
|
|
17024
|
-
if (!
|
|
17230
|
+
const templatePath = join34(fileDir, templateUrlMatch[1]);
|
|
17231
|
+
if (!existsSync25(templatePath)) {
|
|
17025
17232
|
throw new Error(`Unable to inline Angular templateUrl "${templateUrlMatch[1]}": file not found at ${templatePath}`);
|
|
17026
17233
|
}
|
|
17027
17234
|
const templateRaw2 = await fs5.readFile(templatePath, "utf-8");
|
|
@@ -17051,11 +17258,11 @@ ${fields}
|
|
|
17051
17258
|
}, inlineTemplateAndLowerDeferSync = (source, fileDir) => {
|
|
17052
17259
|
const templateUrlMatch = findUncommentedMatch(source, /templateUrl\s*:\s*['"]([^'"]+)['"]/);
|
|
17053
17260
|
if (templateUrlMatch?.[1]) {
|
|
17054
|
-
const templatePath =
|
|
17055
|
-
if (!
|
|
17261
|
+
const templatePath = join34(fileDir, templateUrlMatch[1]);
|
|
17262
|
+
if (!existsSync25(templatePath)) {
|
|
17056
17263
|
throw new Error(`Unable to inline Angular templateUrl "${templateUrlMatch[1]}": file not found at ${templatePath}`);
|
|
17057
17264
|
}
|
|
17058
|
-
const templateRaw2 =
|
|
17265
|
+
const templateRaw2 = readFileSync22(templatePath, "utf-8");
|
|
17059
17266
|
const lowered2 = lowerAngularDeferSyntax(templateRaw2);
|
|
17060
17267
|
const escaped2 = escapeTemplateContent(lowered2.template);
|
|
17061
17268
|
const replacedSource2 = source.slice(0, templateUrlMatch.index) + `template: \`${escaped2}\`` + source.slice(templateUrlMatch.index + templateUrlMatch[0].length);
|
|
@@ -17088,7 +17295,7 @@ ${fields}
|
|
|
17088
17295
|
return source;
|
|
17089
17296
|
const stylePromises = urlMatches.map((urlMatch) => {
|
|
17090
17297
|
const styleUrl = urlMatch.replace(/['"]/g, "");
|
|
17091
|
-
return readAndEscapeFile(
|
|
17298
|
+
return readAndEscapeFile(join34(fileDir, styleUrl), stylePreprocessors);
|
|
17092
17299
|
});
|
|
17093
17300
|
const results = await Promise.all(stylePromises);
|
|
17094
17301
|
const inlinedStyles = results.filter(Boolean).map((escaped) => `\`${escaped}\``);
|
|
@@ -17099,7 +17306,7 @@ ${fields}
|
|
|
17099
17306
|
const styleUrlMatch = findUncommentedMatch(source, /styleUrl\s*:\s*['"]([^'"]+)['"]/);
|
|
17100
17307
|
if (!styleUrlMatch?.[1])
|
|
17101
17308
|
return source;
|
|
17102
|
-
const escaped = await readAndEscapeFile(
|
|
17309
|
+
const escaped = await readAndEscapeFile(join34(fileDir, styleUrlMatch[1]), stylePreprocessors);
|
|
17103
17310
|
if (!escaped)
|
|
17104
17311
|
return source;
|
|
17105
17312
|
return source.slice(0, styleUrlMatch.index) + `styles: [\`${escaped}\`]` + source.slice(styleUrlMatch.index + styleUrlMatch[0].length);
|
|
@@ -17173,10 +17380,10 @@ ${fields}
|
|
|
17173
17380
|
return "";
|
|
17174
17381
|
}
|
|
17175
17382
|
}, compileAngularFileJIT = async (inputPath, outDir, rootDir, stylePreprocessors, cacheBuster) => {
|
|
17176
|
-
const entryPath =
|
|
17383
|
+
const entryPath = resolve25(inputPath);
|
|
17177
17384
|
const allOutputs = [];
|
|
17178
17385
|
const visited = new Set;
|
|
17179
|
-
const baseDir =
|
|
17386
|
+
const baseDir = resolve25(rootDir ?? process.cwd());
|
|
17180
17387
|
let usesLegacyAnimations = false;
|
|
17181
17388
|
const angularTranspiler = new Bun.Transpiler({
|
|
17182
17389
|
loader: "ts",
|
|
@@ -17195,16 +17402,16 @@ ${fields}
|
|
|
17195
17402
|
`${candidate}.js`,
|
|
17196
17403
|
`${candidate}.jsx`,
|
|
17197
17404
|
`${candidate}.json`,
|
|
17198
|
-
|
|
17199
|
-
|
|
17200
|
-
|
|
17201
|
-
|
|
17405
|
+
join34(candidate, "index.ts"),
|
|
17406
|
+
join34(candidate, "index.tsx"),
|
|
17407
|
+
join34(candidate, "index.js"),
|
|
17408
|
+
join34(candidate, "index.jsx")
|
|
17202
17409
|
];
|
|
17203
|
-
return candidates.find((file3) =>
|
|
17410
|
+
return candidates.find((file3) => existsSync25(file3));
|
|
17204
17411
|
};
|
|
17205
17412
|
const resolveLocalImport = (specifier, fromDir) => {
|
|
17206
17413
|
if (specifier.startsWith(".") || specifier.startsWith("/")) {
|
|
17207
|
-
return resolveSourceFile2(
|
|
17414
|
+
return resolveSourceFile2(resolve25(fromDir, specifier));
|
|
17208
17415
|
}
|
|
17209
17416
|
const aliased = matchTsconfigAlias(specifier, tsconfigAliases.aliases, tsconfigAliases.baseUrl, resolveSourceFile2);
|
|
17210
17417
|
if (aliased)
|
|
@@ -17213,7 +17420,7 @@ ${fields}
|
|
|
17213
17420
|
const resolved = Bun.resolveSync(specifier, fromDir);
|
|
17214
17421
|
if (resolved.includes("/node_modules/"))
|
|
17215
17422
|
return;
|
|
17216
|
-
const absolute =
|
|
17423
|
+
const absolute = resolve25(resolved);
|
|
17217
17424
|
if (!absolute.startsWith(baseDir))
|
|
17218
17425
|
return;
|
|
17219
17426
|
return resolveSourceFile2(absolute);
|
|
@@ -17225,10 +17432,10 @@ ${fields}
|
|
|
17225
17432
|
const inputDir = dirname18(sourcePath);
|
|
17226
17433
|
const fileBase = basename12(sourcePath).replace(/\.[cm]?[tj]sx?$/, ".js");
|
|
17227
17434
|
if (inputDir === outDir || inputDir.startsWith(`${outDir}${sep3}`)) {
|
|
17228
|
-
return
|
|
17435
|
+
return join34(inputDir, fileBase);
|
|
17229
17436
|
}
|
|
17230
17437
|
const relativeDir = inputDir.startsWith(baseDir) ? inputDir.substring(baseDir.length + 1) : inputDir;
|
|
17231
|
-
return
|
|
17438
|
+
return join34(outDir, relativeDir, fileBase);
|
|
17232
17439
|
};
|
|
17233
17440
|
const withCacheBuster = (specifier) => {
|
|
17234
17441
|
if (!cacheBuster)
|
|
@@ -17265,21 +17472,21 @@ ${fields}
|
|
|
17265
17472
|
return `${prefix}${dots}`;
|
|
17266
17473
|
return `${prefix}../${dots}`;
|
|
17267
17474
|
});
|
|
17268
|
-
if (
|
|
17475
|
+
if (resolve25(actualPath) === entryPath) {
|
|
17269
17476
|
processedContent += buildIslandMetadataExports(sourceCode);
|
|
17270
17477
|
}
|
|
17271
17478
|
return processedContent;
|
|
17272
17479
|
};
|
|
17273
17480
|
const transpileFile = async (filePath) => {
|
|
17274
|
-
const resolved =
|
|
17481
|
+
const resolved = resolve25(filePath);
|
|
17275
17482
|
if (visited.has(resolved))
|
|
17276
17483
|
return;
|
|
17277
17484
|
visited.add(resolved);
|
|
17278
|
-
if (resolved.endsWith(".json") &&
|
|
17485
|
+
if (resolved.endsWith(".json") && existsSync25(resolved)) {
|
|
17279
17486
|
const inputDir2 = dirname18(resolved);
|
|
17280
17487
|
const relativeDir2 = inputDir2.startsWith(baseDir) ? inputDir2.substring(baseDir.length + 1) : inputDir2;
|
|
17281
|
-
const targetDir2 =
|
|
17282
|
-
const targetPath2 =
|
|
17488
|
+
const targetDir2 = join34(outDir, relativeDir2);
|
|
17489
|
+
const targetPath2 = join34(targetDir2, basename12(resolved));
|
|
17283
17490
|
await fs5.mkdir(targetDir2, { recursive: true });
|
|
17284
17491
|
await fs5.copyFile(resolved, targetPath2);
|
|
17285
17492
|
allOutputs.push(targetPath2);
|
|
@@ -17288,7 +17495,7 @@ ${fields}
|
|
|
17288
17495
|
let actualPath = resolved;
|
|
17289
17496
|
if (!actualPath.endsWith(".ts"))
|
|
17290
17497
|
actualPath += ".ts";
|
|
17291
|
-
if (!
|
|
17498
|
+
if (!existsSync25(actualPath))
|
|
17292
17499
|
return;
|
|
17293
17500
|
let sourceCode = await fs5.readFile(actualPath, "utf-8");
|
|
17294
17501
|
const inlined = await inlineResources(sourceCode, dirname18(actualPath), stylePreprocessors);
|
|
@@ -17323,10 +17530,10 @@ ${fields}
|
|
|
17323
17530
|
importRewrites.set(specifier, relativeRewrite);
|
|
17324
17531
|
return resolved2;
|
|
17325
17532
|
}).filter((path) => Boolean(path));
|
|
17326
|
-
const isEntry =
|
|
17533
|
+
const isEntry = resolve25(actualPath) === resolve25(entryPath);
|
|
17327
17534
|
const contentHash = Bun.hash(sourceCode).toString(BASE_36_RADIX);
|
|
17328
17535
|
const cacheKey2 = actualPath;
|
|
17329
|
-
const shouldWriteFile = cacheBuster && isEntry ? true : jitContentCache.get(cacheKey2) !== contentHash || !
|
|
17536
|
+
const shouldWriteFile = cacheBuster && isEntry ? true : jitContentCache.get(cacheKey2) !== contentHash || !existsSync25(targetPath);
|
|
17330
17537
|
if (shouldWriteFile) {
|
|
17331
17538
|
const processedContent = transpileAndRewrite(sourceCode, relativeDir, actualPath, importRewrites);
|
|
17332
17539
|
const preservedInjection = await readPreservedInjection(targetPath);
|
|
@@ -17339,7 +17546,7 @@ ${fields}
|
|
|
17339
17546
|
};
|
|
17340
17547
|
await transpileFile(inputPath);
|
|
17341
17548
|
const entryOutputPath = toOutputPath(entryPath);
|
|
17342
|
-
if (
|
|
17549
|
+
if (existsSync25(entryOutputPath)) {
|
|
17343
17550
|
const entryOutput = await fs5.readFile(entryOutputPath, "utf-8");
|
|
17344
17551
|
const withoutLegacyFlag = entryOutput.replace(/\nexport const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;\n?/g, `
|
|
17345
17552
|
`);
|
|
@@ -17358,23 +17565,23 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
17358
17565
|
return { clientPaths: [...emptyPaths], serverPaths: [...emptyPaths] };
|
|
17359
17566
|
}
|
|
17360
17567
|
const compiledRoot = compiledParent;
|
|
17361
|
-
const indexesDir =
|
|
17568
|
+
const indexesDir = join34(compiledParent, "indexes");
|
|
17362
17569
|
await traceAngularPhase("setup/create-indexes-dir", () => fs5.mkdir(indexesDir, { recursive: true }));
|
|
17363
|
-
const aotOutputs = hmr ? [] : await traceAngularPhase("aot/compile-files", () => compileAngularFiles(entryPoints.map((entry) =>
|
|
17570
|
+
const aotOutputs = hmr ? [] : await traceAngularPhase("aot/compile-files", () => compileAngularFiles(entryPoints.map((entry) => resolve25(entry)), compiledRoot, stylePreprocessors), { entries: entryPoints.length });
|
|
17364
17571
|
if (!hmr) {
|
|
17365
17572
|
await traceAngularPhase("aot/copy-json-resources", async () => {
|
|
17366
17573
|
const cwd = process.cwd();
|
|
17367
|
-
const angularSrcDir =
|
|
17368
|
-
if (!
|
|
17574
|
+
const angularSrcDir = resolve25(outRoot);
|
|
17575
|
+
if (!existsSync25(angularSrcDir))
|
|
17369
17576
|
return;
|
|
17370
17577
|
const jsonGlob = new Glob6("**/*.json");
|
|
17371
17578
|
for (const rel of jsonGlob.scanSync({
|
|
17372
17579
|
absolute: false,
|
|
17373
17580
|
cwd: angularSrcDir
|
|
17374
17581
|
})) {
|
|
17375
|
-
const sourcePath =
|
|
17582
|
+
const sourcePath = join34(angularSrcDir, rel);
|
|
17376
17583
|
const cwdRel = relative14(cwd, sourcePath);
|
|
17377
|
-
const targetPath =
|
|
17584
|
+
const targetPath = join34(compiledRoot, cwdRel);
|
|
17378
17585
|
await fs5.mkdir(dirname18(targetPath), { recursive: true });
|
|
17379
17586
|
await fs5.copyFile(sourcePath, targetPath);
|
|
17380
17587
|
}
|
|
@@ -17382,7 +17589,7 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
17382
17589
|
}
|
|
17383
17590
|
const usesLegacyAngularAnimations = await traceAngularPhase("setup/legacy-animation-resolver", () => createLegacyAngularAnimationUsageResolver(outRoot));
|
|
17384
17591
|
const compileTasks = entryPoints.map(async (entry) => {
|
|
17385
|
-
const resolvedEntry =
|
|
17592
|
+
const resolvedEntry = resolve25(entry);
|
|
17386
17593
|
const relativeEntry = relative14(outRoot, resolvedEntry).replace(/\.[tj]s$/, ".js");
|
|
17387
17594
|
const compileEntry = () => compileAngularFileJIT(resolvedEntry, compiledRoot, outRoot, stylePreprocessors);
|
|
17388
17595
|
let outputs = hmr ? await traceAngularPhase("jit/compile-entry", compileEntry, {
|
|
@@ -17391,24 +17598,24 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
17391
17598
|
const fileBase = basename12(resolvedEntry).replace(/\.[tj]s$/, "");
|
|
17392
17599
|
const jsName = `${fileBase}.js`;
|
|
17393
17600
|
const compiledFallbackPaths = [
|
|
17394
|
-
|
|
17395
|
-
|
|
17396
|
-
|
|
17397
|
-
].map((file3) =>
|
|
17601
|
+
join34(compiledRoot, relativeEntry),
|
|
17602
|
+
join34(compiledRoot, "pages", jsName),
|
|
17603
|
+
join34(compiledRoot, jsName)
|
|
17604
|
+
].map((file3) => resolve25(file3));
|
|
17398
17605
|
const resolveRawServerFile = (candidatePaths) => {
|
|
17399
17606
|
const normalizedCandidates = [
|
|
17400
|
-
...candidatePaths.map((file3) =>
|
|
17607
|
+
...candidatePaths.map((file3) => resolve25(file3)),
|
|
17401
17608
|
...compiledFallbackPaths
|
|
17402
17609
|
];
|
|
17403
|
-
let candidate = normalizedCandidates.find((file3) =>
|
|
17610
|
+
let candidate = normalizedCandidates.find((file3) => existsSync25(file3) && file3.endsWith(`${sep3}${relativeEntry}`));
|
|
17404
17611
|
if (!candidate) {
|
|
17405
|
-
candidate = normalizedCandidates.find((file3) =>
|
|
17612
|
+
candidate = normalizedCandidates.find((file3) => existsSync25(file3) && file3.endsWith(`${sep3}pages${sep3}${jsName}`));
|
|
17406
17613
|
}
|
|
17407
17614
|
if (!candidate) {
|
|
17408
|
-
candidate = normalizedCandidates.find((file3) =>
|
|
17615
|
+
candidate = normalizedCandidates.find((file3) => existsSync25(file3) && file3.endsWith(`${sep3}${jsName}`));
|
|
17409
17616
|
}
|
|
17410
17617
|
if (!candidate) {
|
|
17411
|
-
candidate = normalizedCandidates.find((file3) =>
|
|
17618
|
+
candidate = normalizedCandidates.find((file3) => existsSync25(file3));
|
|
17412
17619
|
}
|
|
17413
17620
|
return candidate;
|
|
17414
17621
|
};
|
|
@@ -17416,11 +17623,11 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
17416
17623
|
if (!rawServerFile) {
|
|
17417
17624
|
rawServerFile = await traceAngularPhase("wrapper/resolve-server-output-fallback", () => resolveRawServerFile([]), { entry: resolvedEntry });
|
|
17418
17625
|
}
|
|
17419
|
-
if (rawServerFile && !
|
|
17626
|
+
if (rawServerFile && !existsSync25(rawServerFile)) {
|
|
17420
17627
|
outputs = hmr ? await compileEntry() : aotOutputs;
|
|
17421
17628
|
rawServerFile = await traceAngularPhase("wrapper/resolve-server-output-retry", () => resolveRawServerFile(outputs), { entry: resolvedEntry });
|
|
17422
17629
|
}
|
|
17423
|
-
if (!rawServerFile || !
|
|
17630
|
+
if (!rawServerFile || !existsSync25(rawServerFile)) {
|
|
17424
17631
|
throw new Error(`Compiled output not found for ${entry}. Looking for: ${jsName}. Available: ${[
|
|
17425
17632
|
...outputs,
|
|
17426
17633
|
...compiledFallbackPaths
|
|
@@ -17444,7 +17651,7 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
17444
17651
|
let providersSourceContent = "";
|
|
17445
17652
|
if (providersInjection.appProvidersSource) {
|
|
17446
17653
|
try {
|
|
17447
|
-
providersSourceContent =
|
|
17654
|
+
providersSourceContent = readFileSync22(providersInjection.appProvidersSource, "utf-8");
|
|
17448
17655
|
} catch {}
|
|
17449
17656
|
}
|
|
17450
17657
|
return JSON.stringify({
|
|
@@ -17455,8 +17662,8 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
17455
17662
|
})() : "no-providers";
|
|
17456
17663
|
const serverContentHash = `${Bun.hash(original).toString(BASE_36_RADIX)}.${Bun.hash(providersHashInput).toString(BASE_36_RADIX)}`;
|
|
17457
17664
|
const cachedWrapper = wrapperOutputCache.get(resolvedEntry);
|
|
17458
|
-
const clientFile =
|
|
17459
|
-
if (hmr && cachedWrapper && cachedWrapper.serverHash === serverContentHash &&
|
|
17665
|
+
const clientFile = join34(indexesDir, jsName);
|
|
17666
|
+
if (hmr && cachedWrapper && cachedWrapper.serverHash === serverContentHash && existsSync25(clientFile) && (usesLegacyAnimations || !original.includes("__ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__")) && (!usesLegacyAnimations || original.includes("__ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__"))) {
|
|
17460
17667
|
return {
|
|
17461
17668
|
clientPath: clientFile,
|
|
17462
17669
|
indexUnchanged: true,
|
|
@@ -17487,10 +17694,10 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
17487
17694
|
const fragments = [];
|
|
17488
17695
|
if (providersInjection.appProvidersSource) {
|
|
17489
17696
|
const compiledAppProvidersPath = (() => {
|
|
17490
|
-
const angularDirAbs =
|
|
17491
|
-
const appSourceAbs =
|
|
17697
|
+
const angularDirAbs = resolve25(outRoot);
|
|
17698
|
+
const appSourceAbs = resolve25(providersInjection.appProvidersSource);
|
|
17492
17699
|
const rel = relative14(angularDirAbs, appSourceAbs).replace(/\\/g, "/");
|
|
17493
|
-
return
|
|
17700
|
+
return join34(compiledParent, rel).replace(/\.[cm]?[tj]sx?$/, ".js");
|
|
17494
17701
|
})();
|
|
17495
17702
|
const appProvidersSpec = (() => {
|
|
17496
17703
|
const rel = relative14(dirname18(rawServerFile), compiledAppProvidersPath).replace(/\\/g, "/");
|
|
@@ -17751,7 +17958,7 @@ var init_compileAngular = __esm(() => {
|
|
|
17751
17958
|
init_stylePreprocessor();
|
|
17752
17959
|
init_generatedDir();
|
|
17753
17960
|
devClientDir4 = resolveDevClientDir4();
|
|
17754
|
-
hmrClientPath5 =
|
|
17961
|
+
hmrClientPath5 = join34(devClientDir4, "hmrClient.ts").replace(/\\/g, "/");
|
|
17755
17962
|
jitContentCache = new Map;
|
|
17756
17963
|
wrapperOutputCache = new Map;
|
|
17757
17964
|
PROVIDERS_INJECTION_BLOCK_RE = /\n\/\* __ABS_PROVIDERS_INJECTION_START \*\/[\s\S]*?\/\* __ABS_PROVIDERS_INJECTION_END \*\/\n?/;
|
|
@@ -18467,15 +18674,15 @@ __export(exports_fastHmrCompiler, {
|
|
|
18467
18674
|
takePendingModule: () => takePendingModule,
|
|
18468
18675
|
tryFastHmr: () => tryFastHmr
|
|
18469
18676
|
});
|
|
18470
|
-
import { existsSync as
|
|
18471
|
-
import { dirname as dirname19, extname as extname9, relative as relative15, resolve as
|
|
18677
|
+
import { existsSync as existsSync26, readFileSync as readFileSync23, statSync as statSync2 } from "fs";
|
|
18678
|
+
import { dirname as dirname19, extname as extname9, relative as relative15, resolve as resolve26 } from "path";
|
|
18472
18679
|
import ts18 from "typescript";
|
|
18473
18680
|
var fail = (reason, detail, location) => ({
|
|
18474
18681
|
detail,
|
|
18475
18682
|
ok: false,
|
|
18476
18683
|
reason,
|
|
18477
18684
|
...location ?? {}
|
|
18478
|
-
}),
|
|
18685
|
+
}), fingerprintCache2, pendingModuleCache, ANGULAR_DECORATOR_NAMES, findAngularDecoratorName = (decorators) => {
|
|
18479
18686
|
for (const decorator of decorators) {
|
|
18480
18687
|
if (!ts18.isCallExpression(decorator.expression))
|
|
18481
18688
|
continue;
|
|
@@ -18555,7 +18762,7 @@ var fail = (reason, detail, location) => ({
|
|
|
18555
18762
|
return false;
|
|
18556
18763
|
return true;
|
|
18557
18764
|
}, invalidateFingerprintCache = () => {
|
|
18558
|
-
|
|
18765
|
+
fingerprintCache2.clear();
|
|
18559
18766
|
entityFingerprintCache.clear();
|
|
18560
18767
|
}, primeComponentFingerprint = async (componentFilePath) => {
|
|
18561
18768
|
let source;
|
|
@@ -18600,7 +18807,7 @@ var fail = (reason, detail, location) => ({
|
|
|
18600
18807
|
const { inputs, outputs } = extractInputsAndOutputs(stmt, null);
|
|
18601
18808
|
const componentDir = dirname19(componentFilePath);
|
|
18602
18809
|
const fingerprint = extractFingerprint(stmt, className, decoratorMeta, inputs, outputs, sourceFile, componentDir);
|
|
18603
|
-
|
|
18810
|
+
fingerprintCache2.set(id, fingerprint);
|
|
18604
18811
|
} else {
|
|
18605
18812
|
try {
|
|
18606
18813
|
const entityFingerprint = extractEntityFingerprint(stmt, className, sourceFile);
|
|
@@ -18609,7 +18816,7 @@ var fail = (reason, detail, location) => ({
|
|
|
18609
18816
|
}
|
|
18610
18817
|
}
|
|
18611
18818
|
}, recordFingerprint = (id, fingerprint) => {
|
|
18612
|
-
|
|
18819
|
+
fingerprintCache2.set(id, fingerprint);
|
|
18613
18820
|
}, entityFingerprintCache, entityFingerprintsEqual = (leftValue, rightValue) => {
|
|
18614
18821
|
if (leftValue.className !== rightValue.className)
|
|
18615
18822
|
return false;
|
|
@@ -18783,7 +18990,7 @@ var fail = (reason, detail, location) => ({
|
|
|
18783
18990
|
if (!spec.startsWith(".") && !spec.startsWith("/")) {
|
|
18784
18991
|
return true;
|
|
18785
18992
|
}
|
|
18786
|
-
const base =
|
|
18993
|
+
const base = resolve26(componentDir, spec);
|
|
18787
18994
|
const candidates = [
|
|
18788
18995
|
`${base}.ts`,
|
|
18789
18996
|
`${base}.tsx`,
|
|
@@ -18791,11 +18998,11 @@ var fail = (reason, detail, location) => ({
|
|
|
18791
18998
|
`${base}/index.tsx`
|
|
18792
18999
|
];
|
|
18793
19000
|
for (const candidate of candidates) {
|
|
18794
|
-
if (!
|
|
19001
|
+
if (!existsSync26(candidate))
|
|
18795
19002
|
continue;
|
|
18796
19003
|
let content;
|
|
18797
19004
|
try {
|
|
18798
|
-
content =
|
|
19005
|
+
content = readFileSync23(candidate, "utf-8");
|
|
18799
19006
|
} catch {
|
|
18800
19007
|
continue;
|
|
18801
19008
|
}
|
|
@@ -19383,7 +19590,7 @@ var fail = (reason, detail, location) => ({
|
|
|
19383
19590
|
return cached.info;
|
|
19384
19591
|
let source;
|
|
19385
19592
|
try {
|
|
19386
|
-
source =
|
|
19593
|
+
source = readFileSync23(filePath, "utf-8");
|
|
19387
19594
|
} catch {
|
|
19388
19595
|
childComponentInfoCache.set(cacheKey2, {
|
|
19389
19596
|
info: null,
|
|
@@ -19437,7 +19644,7 @@ var fail = (reason, detail, location) => ({
|
|
|
19437
19644
|
return cached.info;
|
|
19438
19645
|
let content;
|
|
19439
19646
|
try {
|
|
19440
|
-
content =
|
|
19647
|
+
content = readFileSync23(dtsPath, "utf-8");
|
|
19441
19648
|
} catch {
|
|
19442
19649
|
childComponentInfoCache.set(cacheKey2, {
|
|
19443
19650
|
info: null,
|
|
@@ -19556,11 +19763,11 @@ var fail = (reason, detail, location) => ({
|
|
|
19556
19763
|
if (visited.has(startDtsPath))
|
|
19557
19764
|
return null;
|
|
19558
19765
|
visited.add(startDtsPath);
|
|
19559
|
-
if (!
|
|
19766
|
+
if (!existsSync26(startDtsPath))
|
|
19560
19767
|
return null;
|
|
19561
19768
|
let content;
|
|
19562
19769
|
try {
|
|
19563
|
-
content =
|
|
19770
|
+
content = readFileSync23(startDtsPath, "utf-8");
|
|
19564
19771
|
} catch {
|
|
19565
19772
|
return null;
|
|
19566
19773
|
}
|
|
@@ -19599,7 +19806,7 @@ var fail = (reason, detail, location) => ({
|
|
|
19599
19806
|
return null;
|
|
19600
19807
|
}, resolveDtsFromSpec = (spec, fromDir) => {
|
|
19601
19808
|
const stripped = spec.replace(/\.[mc]?js$/, "");
|
|
19602
|
-
const base =
|
|
19809
|
+
const base = resolve26(fromDir, stripped);
|
|
19603
19810
|
const candidates = [
|
|
19604
19811
|
`${base}.d.ts`,
|
|
19605
19812
|
`${base}.d.mts`,
|
|
@@ -19609,21 +19816,21 @@ var fail = (reason, detail, location) => ({
|
|
|
19609
19816
|
`${base}/index.d.cts`
|
|
19610
19817
|
];
|
|
19611
19818
|
for (const c of candidates) {
|
|
19612
|
-
if (
|
|
19819
|
+
if (existsSync26(c))
|
|
19613
19820
|
return c;
|
|
19614
19821
|
}
|
|
19615
19822
|
return null;
|
|
19616
19823
|
}, findPackageDtsForJs = (jsPath) => {
|
|
19617
19824
|
const sibling = jsPath.replace(/\.[mc]?js$/, ".d.ts");
|
|
19618
|
-
if (
|
|
19825
|
+
if (existsSync26(sibling))
|
|
19619
19826
|
return sibling;
|
|
19620
19827
|
const mirror = jsPath.replace(/\/dist\//, "/dist/src/").replace(/\.[mc]?js$/, ".d.ts");
|
|
19621
|
-
if (
|
|
19828
|
+
if (existsSync26(mirror))
|
|
19622
19829
|
return mirror;
|
|
19623
19830
|
return null;
|
|
19624
19831
|
}, resolveChildComponentInfo = (className, spec, componentDir, projectRoot) => {
|
|
19625
19832
|
if (spec.startsWith(".") || spec.startsWith("/")) {
|
|
19626
|
-
const base =
|
|
19833
|
+
const base = resolve26(componentDir, spec);
|
|
19627
19834
|
const candidates = [
|
|
19628
19835
|
`${base}.ts`,
|
|
19629
19836
|
`${base}.tsx`,
|
|
@@ -19631,7 +19838,7 @@ var fail = (reason, detail, location) => ({
|
|
|
19631
19838
|
`${base}/index.tsx`
|
|
19632
19839
|
];
|
|
19633
19840
|
for (const candidate of candidates) {
|
|
19634
|
-
if (!
|
|
19841
|
+
if (!existsSync26(candidate))
|
|
19635
19842
|
continue;
|
|
19636
19843
|
const info = getChildComponentInfoFromTsSource(candidate, className);
|
|
19637
19844
|
if (info)
|
|
@@ -19778,7 +19985,7 @@ var fail = (reason, detail, location) => ({
|
|
|
19778
19985
|
return cached.hasProviders;
|
|
19779
19986
|
let source;
|
|
19780
19987
|
try {
|
|
19781
|
-
source =
|
|
19988
|
+
source = readFileSync23(filePath, "utf8");
|
|
19782
19989
|
} catch {
|
|
19783
19990
|
return true;
|
|
19784
19991
|
}
|
|
@@ -19842,14 +20049,14 @@ var fail = (reason, detail, location) => ({
|
|
|
19842
20049
|
}
|
|
19843
20050
|
if (!matches)
|
|
19844
20051
|
continue;
|
|
19845
|
-
const resolved =
|
|
20052
|
+
const resolved = resolve26(componentDir, spec);
|
|
19846
20053
|
for (const ext of TS_EXTENSIONS) {
|
|
19847
20054
|
const candidate = resolved + ext;
|
|
19848
|
-
if (
|
|
20055
|
+
if (existsSync26(candidate))
|
|
19849
20056
|
return candidate;
|
|
19850
20057
|
}
|
|
19851
|
-
const indexCandidate =
|
|
19852
|
-
if (
|
|
20058
|
+
const indexCandidate = resolve26(resolved, "index.ts");
|
|
20059
|
+
if (existsSync26(indexCandidate))
|
|
19853
20060
|
return indexCandidate;
|
|
19854
20061
|
}
|
|
19855
20062
|
return null;
|
|
@@ -20086,12 +20293,12 @@ ${transpiled}
|
|
|
20086
20293
|
}
|
|
20087
20294
|
}${staticPatch}`;
|
|
20088
20295
|
}, STYLE_PREPROCESSED_EXT, resolveAndReadStyleResource = (componentDir, url) => {
|
|
20089
|
-
const abs =
|
|
20090
|
-
if (!
|
|
20296
|
+
const abs = resolve26(componentDir, url);
|
|
20297
|
+
if (!existsSync26(abs))
|
|
20091
20298
|
return null;
|
|
20092
20299
|
const ext = extname9(abs).toLowerCase();
|
|
20093
20300
|
if (!STYLE_PREPROCESSED_EXT.has(ext) || ext === ".css") {
|
|
20094
|
-
return
|
|
20301
|
+
return readFileSync23(abs, "utf8");
|
|
20095
20302
|
}
|
|
20096
20303
|
try {
|
|
20097
20304
|
return compileStyleFileIfNeededSync(abs);
|
|
@@ -20125,11 +20332,11 @@ ${block}
|
|
|
20125
20332
|
const cached = projectOptionsCache.get(projectRoot);
|
|
20126
20333
|
if (cached !== undefined)
|
|
20127
20334
|
return cached;
|
|
20128
|
-
const tsconfigPath =
|
|
20335
|
+
const tsconfigPath = resolve26(projectRoot, "tsconfig.json");
|
|
20129
20336
|
const opts = {};
|
|
20130
|
-
if (
|
|
20337
|
+
if (existsSync26(tsconfigPath)) {
|
|
20131
20338
|
try {
|
|
20132
|
-
const text2 =
|
|
20339
|
+
const text2 = readFileSync23(tsconfigPath, "utf8");
|
|
20133
20340
|
const parsed = ts18.parseConfigFileTextToJson(tsconfigPath, text2);
|
|
20134
20341
|
if (!parsed.error && parsed.config) {
|
|
20135
20342
|
const cfg = parsed.config;
|
|
@@ -20154,7 +20361,7 @@ ${block}
|
|
|
20154
20361
|
}, tryFastHmr = async (params) => {
|
|
20155
20362
|
const { componentFilePath, className } = params;
|
|
20156
20363
|
const projectRoot = params.projectRoot ?? process.cwd();
|
|
20157
|
-
if (!
|
|
20364
|
+
if (!existsSync26(componentFilePath)) {
|
|
20158
20365
|
return fail("file-not-found", componentFilePath);
|
|
20159
20366
|
}
|
|
20160
20367
|
let compiler;
|
|
@@ -20163,7 +20370,7 @@ ${block}
|
|
|
20163
20370
|
} catch (err) {
|
|
20164
20371
|
return fail("unexpected-error", `import @angular/compiler: ${err}`);
|
|
20165
20372
|
}
|
|
20166
|
-
const tsSource =
|
|
20373
|
+
const tsSource = readFileSync23(componentFilePath, "utf8");
|
|
20167
20374
|
const sourceFile = ts18.createSourceFile(componentFilePath, tsSource, ts18.ScriptTarget.ES2022, true, ts18.ScriptKind.TS);
|
|
20168
20375
|
const classNode = findClassDeclaration(sourceFile, className);
|
|
20169
20376
|
if (!classNode) {
|
|
@@ -20209,11 +20416,11 @@ ${block}
|
|
|
20209
20416
|
templateText = decoratorMeta.template;
|
|
20210
20417
|
templatePath = componentFilePath;
|
|
20211
20418
|
} else if (decoratorMeta.templateUrl) {
|
|
20212
|
-
const tplAbs =
|
|
20213
|
-
if (!
|
|
20419
|
+
const tplAbs = resolve26(componentDir, decoratorMeta.templateUrl);
|
|
20420
|
+
if (!existsSync26(tplAbs)) {
|
|
20214
20421
|
return fail("template-resource-not-found", `Template file not found: ${tplAbs}`, { file: componentFilePath });
|
|
20215
20422
|
}
|
|
20216
|
-
templateText =
|
|
20423
|
+
templateText = readFileSync23(tplAbs, "utf8");
|
|
20217
20424
|
templatePath = tplAbs;
|
|
20218
20425
|
} else {
|
|
20219
20426
|
return fail("unsupported-decorator-args", "missing template/templateUrl");
|
|
@@ -20258,7 +20465,7 @@ ${block}
|
|
|
20258
20465
|
const projectRelPath = relative15(projectRoot, componentFilePath).replace(/\\/g, "/");
|
|
20259
20466
|
const fingerprintId = encodeURIComponent(`${projectRelPath}@${className}`);
|
|
20260
20467
|
const currentFingerprint = extractFingerprint(classNode, className, decoratorMeta, inputs, outputs, sourceFile, componentDir);
|
|
20261
|
-
const cachedFingerprint =
|
|
20468
|
+
const cachedFingerprint = fingerprintCache2.get(fingerprintId);
|
|
20262
20469
|
const fingerprintChanged = cachedFingerprint !== undefined && !fingerprintsEqual(cachedFingerprint, currentFingerprint);
|
|
20263
20470
|
const rebootstrapRequired = !currentFingerprint.standalone || cachedFingerprint !== undefined && (cachedFingerprint.importsArraySig !== currentFingerprint.importsArraySig || cachedFingerprint.hostDirectivesSig !== currentFingerprint.hostDirectivesSig || cachedFingerprint.providersArraySig !== currentFingerprint.providersArraySig || cachedFingerprint.viewProvidersArraySig !== currentFingerprint.viewProvidersArraySig || cachedFingerprint.selector !== currentFingerprint.selector || cachedFingerprint.pageExportsSig !== currentFingerprint.pageExportsSig || cachedFingerprint.standalone !== currentFingerprint.standalone);
|
|
20264
20471
|
const sourceFileObj = new compiler.ParseSourceFile(tsSource, componentFilePath);
|
|
@@ -20465,7 +20672,7 @@ ${methodsBlock}
|
|
|
20465
20672
|
moduleText = moduleText.slice(0, lastBrace) + tail + moduleText.slice(lastBrace);
|
|
20466
20673
|
}
|
|
20467
20674
|
}
|
|
20468
|
-
|
|
20675
|
+
fingerprintCache2.set(fingerprintId, currentFingerprint);
|
|
20469
20676
|
setPendingModule(fingerprintId, moduleText);
|
|
20470
20677
|
return {
|
|
20471
20678
|
componentSource: sourceFile,
|
|
@@ -20482,7 +20689,7 @@ var init_fastHmrCompiler = __esm(() => {
|
|
|
20482
20689
|
init_stylePreprocessor();
|
|
20483
20690
|
init_hmrImportGenerator();
|
|
20484
20691
|
init_typescript_translator();
|
|
20485
|
-
|
|
20692
|
+
fingerprintCache2 = new Map;
|
|
20486
20693
|
pendingModuleCache = new Map;
|
|
20487
20694
|
ANGULAR_DECORATOR_NAMES = new Set([
|
|
20488
20695
|
"Component",
|
|
@@ -20979,9 +21186,9 @@ __export(exports_compileEmber, {
|
|
|
20979
21186
|
getEmberCompiledRoot: () => getEmberCompiledRoot,
|
|
20980
21187
|
getEmberServerCompiledDir: () => getEmberServerCompiledDir
|
|
20981
21188
|
});
|
|
20982
|
-
import { existsSync as
|
|
21189
|
+
import { existsSync as existsSync27 } from "fs";
|
|
20983
21190
|
import { mkdir as mkdir8, rm as rm5 } from "fs/promises";
|
|
20984
|
-
import { basename as basename13, dirname as dirname20, extname as extname10, join as
|
|
21191
|
+
import { basename as basename13, dirname as dirname20, extname as extname10, join as join35, resolve as resolve27 } from "path";
|
|
20985
21192
|
var {build: bunBuild2, Transpiler: Transpiler4, write: write4, file: file3 } = globalThis.Bun;
|
|
20986
21193
|
var cachedPreprocessor = null, getPreprocessor = async () => {
|
|
20987
21194
|
if (cachedPreprocessor)
|
|
@@ -21077,11 +21284,11 @@ export const importSync = (specifier) => {
|
|
|
21077
21284
|
const originalImporter = stagedSourceMap.get(args.importer);
|
|
21078
21285
|
if (!originalImporter)
|
|
21079
21286
|
return;
|
|
21080
|
-
const candidateBase =
|
|
21287
|
+
const candidateBase = resolve27(dirname20(originalImporter), args.path);
|
|
21081
21288
|
const extensionsToTry = ["", ".gts", ".gjs", ".ts", ".js"];
|
|
21082
21289
|
for (const ext of extensionsToTry) {
|
|
21083
21290
|
const candidate = candidateBase + ext;
|
|
21084
|
-
if (
|
|
21291
|
+
if (existsSync27(candidate))
|
|
21085
21292
|
return { path: candidate };
|
|
21086
21293
|
}
|
|
21087
21294
|
return;
|
|
@@ -21100,8 +21307,8 @@ export const importSync = (specifier) => {
|
|
|
21100
21307
|
build.onResolve({ filter: /^@(?:ember|glimmer|simple-dom)\// }, (args) => {
|
|
21101
21308
|
if (standalonePackages.has(args.path))
|
|
21102
21309
|
return;
|
|
21103
|
-
const internal =
|
|
21104
|
-
if (
|
|
21310
|
+
const internal = join35(cwd, "node_modules/ember-source/dist/packages", args.path, "index.js");
|
|
21311
|
+
if (existsSync27(internal))
|
|
21105
21312
|
return { path: internal };
|
|
21106
21313
|
return;
|
|
21107
21314
|
});
|
|
@@ -21136,7 +21343,7 @@ export const renderToHTML = (props = {}) => {
|
|
|
21136
21343
|
export { PageComponent };
|
|
21137
21344
|
export default PageComponent;
|
|
21138
21345
|
`, compileEmberFile = async (entry, compiledRoot, cwd = process.cwd()) => {
|
|
21139
|
-
const resolvedEntry =
|
|
21346
|
+
const resolvedEntry = resolve27(entry);
|
|
21140
21347
|
const source = await file3(resolvedEntry).text();
|
|
21141
21348
|
let preprocessed = source;
|
|
21142
21349
|
if (isTemplateTagFile(resolvedEntry)) {
|
|
@@ -21148,16 +21355,16 @@ export default PageComponent;
|
|
|
21148
21355
|
}
|
|
21149
21356
|
const transpiled = transpiler5.transformSync(preprocessed);
|
|
21150
21357
|
const baseName = basename13(resolvedEntry).replace(/\.(gjs|gts|ts|js)$/, "");
|
|
21151
|
-
const tmpDir =
|
|
21152
|
-
const serverDir =
|
|
21153
|
-
const clientDir =
|
|
21358
|
+
const tmpDir = join35(compiledRoot, "_tmp");
|
|
21359
|
+
const serverDir = join35(compiledRoot, "server");
|
|
21360
|
+
const clientDir = join35(compiledRoot, "client");
|
|
21154
21361
|
await Promise.all([
|
|
21155
21362
|
mkdir8(tmpDir, { recursive: true }),
|
|
21156
21363
|
mkdir8(serverDir, { recursive: true }),
|
|
21157
21364
|
mkdir8(clientDir, { recursive: true })
|
|
21158
21365
|
]);
|
|
21159
|
-
const tmpPagePath =
|
|
21160
|
-
const tmpHarnessPath =
|
|
21366
|
+
const tmpPagePath = resolve27(join35(tmpDir, `${baseName}.module.js`));
|
|
21367
|
+
const tmpHarnessPath = resolve27(join35(tmpDir, `${baseName}.harness.js`));
|
|
21161
21368
|
await Promise.all([
|
|
21162
21369
|
write4(tmpPagePath, transpiled),
|
|
21163
21370
|
write4(tmpHarnessPath, generateServerHarness(tmpPagePath))
|
|
@@ -21165,7 +21372,7 @@ export default PageComponent;
|
|
|
21165
21372
|
const stagedSourceMap = new Map([
|
|
21166
21373
|
[tmpPagePath, resolvedEntry]
|
|
21167
21374
|
]);
|
|
21168
|
-
const serverPath =
|
|
21375
|
+
const serverPath = join35(serverDir, `${baseName}.js`);
|
|
21169
21376
|
const buildResult = await bunBuild2({
|
|
21170
21377
|
entrypoints: [tmpHarnessPath],
|
|
21171
21378
|
format: "esm",
|
|
@@ -21182,7 +21389,7 @@ export default PageComponent;
|
|
|
21182
21389
|
console.warn(`\u26A0\uFE0F Ember server build for ${baseName} had errors:`, buildResult.logs);
|
|
21183
21390
|
}
|
|
21184
21391
|
await rm5(tmpDir, { force: true, recursive: true });
|
|
21185
|
-
const clientPath =
|
|
21392
|
+
const clientPath = join35(clientDir, `${baseName}.js`);
|
|
21186
21393
|
await write4(clientPath, transpiled);
|
|
21187
21394
|
return { clientPath, serverPath };
|
|
21188
21395
|
}, compileEmber = async (entries, emberDir, cwd = process.cwd(), _hmr = false) => {
|
|
@@ -21199,7 +21406,7 @@ export default PageComponent;
|
|
|
21199
21406
|
serverPaths: outputs.map((o3) => o3.serverPath)
|
|
21200
21407
|
};
|
|
21201
21408
|
}, compileEmberFileSource = async (entry) => {
|
|
21202
|
-
const resolvedEntry =
|
|
21409
|
+
const resolvedEntry = resolve27(entry);
|
|
21203
21410
|
const source = await file3(resolvedEntry).text();
|
|
21204
21411
|
let preprocessed = source;
|
|
21205
21412
|
if (isTemplateTagFile(resolvedEntry)) {
|
|
@@ -21210,7 +21417,7 @@ export default PageComponent;
|
|
|
21210
21417
|
preprocessed = rewriteTemplateEvalToScope(result.code);
|
|
21211
21418
|
}
|
|
21212
21419
|
return transpiler5.transformSync(preprocessed);
|
|
21213
|
-
}, clearEmberCompilerCache = () => {}, getEmberCompiledRoot = (_emberDir) => getFrameworkGeneratedDir("ember"), getEmberServerCompiledDir = (emberDir) =>
|
|
21420
|
+
}, clearEmberCompilerCache = () => {}, getEmberCompiledRoot = (_emberDir) => getFrameworkGeneratedDir("ember"), getEmberServerCompiledDir = (emberDir) => join35(getEmberCompiledRoot(emberDir), "server"), getEmberClientCompiledDir = (emberDir) => join35(getEmberCompiledRoot(emberDir), "client");
|
|
21214
21421
|
var init_compileEmber = __esm(() => {
|
|
21215
21422
|
init_generatedDir();
|
|
21216
21423
|
transpiler5 = new Transpiler4({
|
|
@@ -21231,25 +21438,25 @@ __export(exports_buildReactVendor, {
|
|
|
21231
21438
|
buildReactVendor: () => buildReactVendor,
|
|
21232
21439
|
computeVendorPaths: () => computeVendorPaths
|
|
21233
21440
|
});
|
|
21234
|
-
import { existsSync as
|
|
21235
|
-
import { join as
|
|
21441
|
+
import { existsSync as existsSync28, mkdirSync as mkdirSync9 } from "fs";
|
|
21442
|
+
import { join as join36, resolve as resolve28 } from "path";
|
|
21236
21443
|
import { rm as rm6 } from "fs/promises";
|
|
21237
21444
|
var {build: bunBuild3 } = globalThis.Bun;
|
|
21238
21445
|
var resolveJsxDevRuntimeCompatPath = () => {
|
|
21239
21446
|
const candidates = [
|
|
21240
|
-
|
|
21241
|
-
|
|
21242
|
-
|
|
21243
|
-
|
|
21244
|
-
|
|
21245
|
-
|
|
21447
|
+
resolve28(import.meta.dir, "react", "jsxDevRuntimeCompat.js"),
|
|
21448
|
+
resolve28(import.meta.dir, "src", "react", "jsxDevRuntimeCompat.ts"),
|
|
21449
|
+
resolve28(import.meta.dir, "..", "react", "jsxDevRuntimeCompat.js"),
|
|
21450
|
+
resolve28(import.meta.dir, "..", "src", "react", "jsxDevRuntimeCompat.ts"),
|
|
21451
|
+
resolve28(import.meta.dir, "..", "..", "dist", "react", "jsxDevRuntimeCompat.js"),
|
|
21452
|
+
resolve28(import.meta.dir, "..", "..", "src", "react", "jsxDevRuntimeCompat.ts")
|
|
21246
21453
|
];
|
|
21247
21454
|
for (const candidate of candidates) {
|
|
21248
|
-
if (
|
|
21455
|
+
if (existsSync28(candidate)) {
|
|
21249
21456
|
return candidate.replace(/\\/g, "/");
|
|
21250
21457
|
}
|
|
21251
21458
|
}
|
|
21252
|
-
return (candidates[0] ??
|
|
21459
|
+
return (candidates[0] ?? resolve28(import.meta.dir, "react", "jsxDevRuntimeCompat.js")).replace(/\\/g, "/");
|
|
21253
21460
|
}, jsxDevRuntimeCompatPath, jsxRuntimeCompatPath, reactSpecifiers, toSafeFileName = (specifier) => specifier.replace(/\//g, "_"), computeVendorPaths = () => {
|
|
21254
21461
|
const paths = {};
|
|
21255
21462
|
for (const specifier of reactSpecifiers) {
|
|
@@ -21282,14 +21489,14 @@ var resolveJsxDevRuntimeCompatPath = () => {
|
|
|
21282
21489
|
`)}
|
|
21283
21490
|
`;
|
|
21284
21491
|
}, buildReactVendor = async (buildDir) => {
|
|
21285
|
-
const vendorDir =
|
|
21286
|
-
|
|
21287
|
-
const tmpDir =
|
|
21288
|
-
|
|
21492
|
+
const vendorDir = join36(buildDir, "react", "vendor");
|
|
21493
|
+
mkdirSync9(vendorDir, { recursive: true });
|
|
21494
|
+
const tmpDir = join36(buildDir, "_vendor_tmp");
|
|
21495
|
+
mkdirSync9(tmpDir, { recursive: true });
|
|
21289
21496
|
const specifiers = reactSpecifiers;
|
|
21290
21497
|
const entrypoints = await Promise.all(specifiers.map(async (specifier) => {
|
|
21291
21498
|
const safeName = toSafeFileName(specifier);
|
|
21292
|
-
const entryPath =
|
|
21499
|
+
const entryPath = join36(tmpDir, `${safeName}.ts`);
|
|
21293
21500
|
const source = await generateEntrySource(specifier);
|
|
21294
21501
|
await Bun.write(entryPath, source);
|
|
21295
21502
|
return entryPath;
|
|
@@ -21356,8 +21563,8 @@ __export(exports_buildAngularVendor, {
|
|
|
21356
21563
|
computeAngularVendorPaths: () => computeAngularVendorPaths,
|
|
21357
21564
|
computeAngularVendorPathsAsync: () => computeAngularVendorPathsAsync
|
|
21358
21565
|
});
|
|
21359
|
-
import { mkdirSync as
|
|
21360
|
-
import { join as
|
|
21566
|
+
import { mkdirSync as mkdirSync10 } from "fs";
|
|
21567
|
+
import { join as join37 } from "path";
|
|
21361
21568
|
import { rm as rm7 } from "fs/promises";
|
|
21362
21569
|
var {build: bunBuild4, Glob: Glob7 } = globalThis.Bun;
|
|
21363
21570
|
var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => jitMode ? [...REQUIRED_ANGULAR_SPECIFIERS_BASE, "@angular/compiler"] : REQUIRED_ANGULAR_SPECIFIERS_BASE, SERVER_ONLY_ANGULAR_SPECIFIERS, BUILD_ONLY_ANGULAR_SPECIFIER_PREFIXES, isBuildOnlyAngularSpecifier = (spec) => BUILD_ONLY_ANGULAR_SPECIFIER_PREFIXES.some((prefix) => spec === prefix || spec.startsWith(`${prefix}/`)), SCAN_SKIP_DIRS, isResolvable = (specifier) => {
|
|
@@ -21394,7 +21601,7 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
|
|
|
21394
21601
|
}
|
|
21395
21602
|
return { angular, transitiveRoots };
|
|
21396
21603
|
}, PARTIAL_DECL_MARKERS, containsPartialDeclarations = (source) => PARTIAL_DECL_MARKERS.some((marker) => source.includes(marker)), collectTransitiveAngularSpecs = async (roots, angularFound) => {
|
|
21397
|
-
const { readFileSync:
|
|
21604
|
+
const { readFileSync: readFileSync24 } = await import("fs");
|
|
21398
21605
|
const transpiler6 = new Bun.Transpiler({ loader: "js" });
|
|
21399
21606
|
const visited = new Set;
|
|
21400
21607
|
const frontier = [];
|
|
@@ -21415,7 +21622,7 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
|
|
|
21415
21622
|
}
|
|
21416
21623
|
let content;
|
|
21417
21624
|
try {
|
|
21418
|
-
content =
|
|
21625
|
+
content = readFileSync24(resolved, "utf-8");
|
|
21419
21626
|
} catch {
|
|
21420
21627
|
continue;
|
|
21421
21628
|
}
|
|
@@ -21454,14 +21661,14 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
|
|
|
21454
21661
|
await collectTransitiveAngularSpecs([...angular, ...transitiveRoots], angular);
|
|
21455
21662
|
return Array.from(angular).filter(isResolvable);
|
|
21456
21663
|
}, buildAngularVendor = async (buildDir, directories = [], linkerJitMode = false, depVendorSpecifiers = []) => {
|
|
21457
|
-
const vendorDir =
|
|
21458
|
-
|
|
21459
|
-
const tmpDir =
|
|
21460
|
-
|
|
21664
|
+
const vendorDir = join37(buildDir, "angular", "vendor");
|
|
21665
|
+
mkdirSync10(vendorDir, { recursive: true });
|
|
21666
|
+
const tmpDir = join37(buildDir, "_angular_vendor_tmp");
|
|
21667
|
+
mkdirSync10(tmpDir, { recursive: true });
|
|
21461
21668
|
const specifiers = await resolveAngularSpecifiers(directories, linkerJitMode);
|
|
21462
21669
|
const entrypoints = await Promise.all(specifiers.map(async (specifier) => {
|
|
21463
21670
|
const safeName = toSafeFileName2(specifier);
|
|
21464
|
-
const entryPath =
|
|
21671
|
+
const entryPath = join37(tmpDir, `${safeName}.ts`);
|
|
21465
21672
|
await Bun.write(entryPath, await generateVendorEntrySource(specifier));
|
|
21466
21673
|
return entryPath;
|
|
21467
21674
|
}));
|
|
@@ -21492,10 +21699,10 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
|
|
|
21492
21699
|
const specifiers = await resolveAngularSpecifiers(directories, linkerJitMode);
|
|
21493
21700
|
return computeAngularVendorPaths(specifiers);
|
|
21494
21701
|
}, buildAngularServerVendor = async (buildDir, directories = [], linkerJitMode = false) => {
|
|
21495
|
-
const vendorDir =
|
|
21496
|
-
|
|
21497
|
-
const tmpDir =
|
|
21498
|
-
|
|
21702
|
+
const vendorDir = join37(buildDir, "angular", "vendor", "server");
|
|
21703
|
+
mkdirSync10(vendorDir, { recursive: true });
|
|
21704
|
+
const tmpDir = join37(buildDir, "_angular_server_vendor_tmp");
|
|
21705
|
+
mkdirSync10(tmpDir, { recursive: true });
|
|
21499
21706
|
const browserSpecs = await resolveAngularSpecifiers(directories, linkerJitMode);
|
|
21500
21707
|
const allSpecs = new Set(browserSpecs);
|
|
21501
21708
|
for (const spec of SERVER_ONLY_ANGULAR_SPECIFIERS) {
|
|
@@ -21505,7 +21712,7 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
|
|
|
21505
21712
|
const specifiers = Array.from(allSpecs);
|
|
21506
21713
|
const entrypoints = await Promise.all(specifiers.map(async (specifier) => {
|
|
21507
21714
|
const safeName = toSafeFileName2(specifier);
|
|
21508
|
-
const entryPath =
|
|
21715
|
+
const entryPath = join37(tmpDir, `${safeName}.ts`);
|
|
21509
21716
|
await Bun.write(entryPath, await generateVendorEntrySource(specifier));
|
|
21510
21717
|
return entryPath;
|
|
21511
21718
|
}));
|
|
@@ -21527,9 +21734,9 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
|
|
|
21527
21734
|
return specifiers;
|
|
21528
21735
|
}, computeAngularServerVendorPaths = (buildDir, specifiers) => {
|
|
21529
21736
|
const paths = {};
|
|
21530
|
-
const vendorDir =
|
|
21737
|
+
const vendorDir = join37(buildDir, "angular", "vendor", "server");
|
|
21531
21738
|
for (const specifier of specifiers) {
|
|
21532
|
-
paths[specifier] =
|
|
21739
|
+
paths[specifier] = join37(vendorDir, `${toSafeFileName2(specifier)}.js`);
|
|
21533
21740
|
}
|
|
21534
21741
|
return paths;
|
|
21535
21742
|
}, computeAngularServerVendorPathsAsync = async (buildDir, directories = [], linkerJitMode = true) => {
|
|
@@ -21584,18 +21791,18 @@ __export(exports_buildVueVendor, {
|
|
|
21584
21791
|
buildVueVendor: () => buildVueVendor,
|
|
21585
21792
|
computeVueVendorPaths: () => computeVueVendorPaths
|
|
21586
21793
|
});
|
|
21587
|
-
import { mkdirSync as
|
|
21588
|
-
import { join as
|
|
21794
|
+
import { mkdirSync as mkdirSync11 } from "fs";
|
|
21795
|
+
import { join as join38 } from "path";
|
|
21589
21796
|
import { rm as rm8 } from "fs/promises";
|
|
21590
21797
|
var {build: bunBuild5 } = globalThis.Bun;
|
|
21591
21798
|
var vueSpecifiers, toSafeFileName3 = (specifier) => specifier.replace(/\//g, "_"), buildVueVendor = async (buildDir) => {
|
|
21592
|
-
const vendorDir =
|
|
21593
|
-
|
|
21594
|
-
const tmpDir =
|
|
21595
|
-
|
|
21799
|
+
const vendorDir = join38(buildDir, "vue", "vendor");
|
|
21800
|
+
mkdirSync11(vendorDir, { recursive: true });
|
|
21801
|
+
const tmpDir = join38(buildDir, "_vue_vendor_tmp");
|
|
21802
|
+
mkdirSync11(tmpDir, { recursive: true });
|
|
21596
21803
|
const entrypoints = await Promise.all(vueSpecifiers.map(async (specifier) => {
|
|
21597
21804
|
const safeName = toSafeFileName3(specifier);
|
|
21598
|
-
const entryPath =
|
|
21805
|
+
const entryPath = join38(tmpDir, `${safeName}.ts`);
|
|
21599
21806
|
await Bun.write(entryPath, `export * from '${specifier}';
|
|
21600
21807
|
`);
|
|
21601
21808
|
return entryPath;
|
|
@@ -21620,17 +21827,17 @@ var vueSpecifiers, toSafeFileName3 = (specifier) => specifier.replace(/\//g, "_"
|
|
|
21620
21827
|
console.warn("\u26A0\uFE0F Vue vendor build had errors:", result.logs);
|
|
21621
21828
|
return;
|
|
21622
21829
|
}
|
|
21623
|
-
const { readFileSync:
|
|
21830
|
+
const { readFileSync: readFileSync24, writeFileSync: writeFileSync9, readdirSync: readdirSync5 } = await import("fs");
|
|
21624
21831
|
const files = readdirSync5(vendorDir).filter((f2) => f2.endsWith(".js"));
|
|
21625
21832
|
for (const file4 of files) {
|
|
21626
|
-
const filePath =
|
|
21627
|
-
const content =
|
|
21833
|
+
const filePath = join38(vendorDir, file4);
|
|
21834
|
+
const content = readFileSync24(filePath, "utf-8");
|
|
21628
21835
|
if (!content.includes("__VUE_HMR_RUNTIME__"))
|
|
21629
21836
|
continue;
|
|
21630
21837
|
const patched = content.replace(/getGlobalThis\(\)\.__VUE_HMR_RUNTIME__\s*=\s*\{/, "getGlobalThis().__VUE_HMR_RUNTIME__ = getGlobalThis().__VUE_HMR_RUNTIME__ || {");
|
|
21631
21838
|
if (patched === content)
|
|
21632
21839
|
continue;
|
|
21633
|
-
|
|
21840
|
+
writeFileSync9(filePath, patched);
|
|
21634
21841
|
}
|
|
21635
21842
|
}, computeVueVendorPaths = () => {
|
|
21636
21843
|
const paths = {};
|
|
@@ -21649,8 +21856,8 @@ __export(exports_buildSvelteVendor, {
|
|
|
21649
21856
|
buildSvelteVendor: () => buildSvelteVendor,
|
|
21650
21857
|
computeSvelteVendorPaths: () => computeSvelteVendorPaths
|
|
21651
21858
|
});
|
|
21652
|
-
import { mkdirSync as
|
|
21653
|
-
import { join as
|
|
21859
|
+
import { mkdirSync as mkdirSync12 } from "fs";
|
|
21860
|
+
import { join as join39 } from "path";
|
|
21654
21861
|
import { rm as rm9 } from "fs/promises";
|
|
21655
21862
|
var {build: bunBuild6 } = globalThis.Bun;
|
|
21656
21863
|
var svelteSpecifiers, isResolvable2 = (specifier) => {
|
|
@@ -21664,13 +21871,13 @@ var svelteSpecifiers, isResolvable2 = (specifier) => {
|
|
|
21664
21871
|
const specifiers = resolveVendorSpecifiers();
|
|
21665
21872
|
if (specifiers.length === 0)
|
|
21666
21873
|
return;
|
|
21667
|
-
const vendorDir =
|
|
21668
|
-
|
|
21669
|
-
const tmpDir =
|
|
21670
|
-
|
|
21874
|
+
const vendorDir = join39(buildDir, "svelte", "vendor");
|
|
21875
|
+
mkdirSync12(vendorDir, { recursive: true });
|
|
21876
|
+
const tmpDir = join39(buildDir, "_svelte_vendor_tmp");
|
|
21877
|
+
mkdirSync12(tmpDir, { recursive: true });
|
|
21671
21878
|
const entrypoints = await Promise.all(specifiers.map(async (specifier) => {
|
|
21672
21879
|
const safeName = toSafeFileName4(specifier);
|
|
21673
|
-
const entryPath =
|
|
21880
|
+
const entryPath = join39(tmpDir, `${safeName}.ts`);
|
|
21674
21881
|
await Bun.write(entryPath, `export * from '${specifier}';
|
|
21675
21882
|
`);
|
|
21676
21883
|
return entryPath;
|
|
@@ -21712,21 +21919,21 @@ var init_buildSvelteVendor = __esm(() => {
|
|
|
21712
21919
|
import {
|
|
21713
21920
|
copyFileSync as copyFileSync2,
|
|
21714
21921
|
cpSync,
|
|
21715
|
-
existsSync as
|
|
21716
|
-
mkdirSync as
|
|
21922
|
+
existsSync as existsSync29,
|
|
21923
|
+
mkdirSync as mkdirSync13,
|
|
21717
21924
|
readdirSync as readdirSync5,
|
|
21718
|
-
readFileSync as
|
|
21719
|
-
renameSync,
|
|
21925
|
+
readFileSync as readFileSync24,
|
|
21926
|
+
renameSync as renameSync2,
|
|
21720
21927
|
rmSync as rmSync2,
|
|
21721
21928
|
statSync as statSync3,
|
|
21722
|
-
writeFileSync as
|
|
21929
|
+
writeFileSync as writeFileSync9
|
|
21723
21930
|
} from "fs";
|
|
21724
|
-
import { basename as basename14, dirname as dirname21, extname as extname11, join as
|
|
21931
|
+
import { basename as basename14, dirname as dirname21, extname as extname11, join as join40, relative as relative16, resolve as resolve29 } from "path";
|
|
21725
21932
|
import { cwd, env as env2, exit } from "process";
|
|
21726
21933
|
var {build: bunBuild7, Glob: Glob8 } = globalThis.Bun;
|
|
21727
21934
|
var isBuildTraceEnabled = () => {
|
|
21728
21935
|
const value = env2.ABSOLUTE_BUILD_TRACE?.toLowerCase();
|
|
21729
|
-
return value === "1" || value === "true" || value === "yes";
|
|
21936
|
+
return devProfileEnabled || value === "1" || value === "true" || value === "yes";
|
|
21730
21937
|
}, collectConventionSourceFiles = (entry) => {
|
|
21731
21938
|
if (!entry)
|
|
21732
21939
|
return [];
|
|
@@ -21804,7 +22011,7 @@ var isBuildTraceEnabled = () => {
|
|
|
21804
22011
|
}, REACT_VENDOR_SPECIFIERS, findBareReactImports = (path, importRegex) => {
|
|
21805
22012
|
let content;
|
|
21806
22013
|
try {
|
|
21807
|
-
content =
|
|
22014
|
+
content = readFileSync24(path, "utf-8");
|
|
21808
22015
|
} catch {
|
|
21809
22016
|
return [];
|
|
21810
22017
|
}
|
|
@@ -21852,11 +22059,11 @@ ${offenders.map((o3) => ` \u2022 ${o3}`).join(`
|
|
|
21852
22059
|
}
|
|
21853
22060
|
exit(1);
|
|
21854
22061
|
}, copyHtmxVendor = (htmxDir, htmxDestDir) => {
|
|
21855
|
-
|
|
22062
|
+
mkdirSync13(htmxDestDir, { recursive: true });
|
|
21856
22063
|
const glob = new Glob8("htmx*.min.js");
|
|
21857
22064
|
for (const relPath of glob.scanSync({ cwd: htmxDir })) {
|
|
21858
|
-
const src =
|
|
21859
|
-
const dest =
|
|
22065
|
+
const src = join40(htmxDir, relPath);
|
|
22066
|
+
const dest = join40(htmxDestDir, "htmx.min.js");
|
|
21860
22067
|
copyFileSync2(src, dest);
|
|
21861
22068
|
return;
|
|
21862
22069
|
}
|
|
@@ -21868,8 +22075,8 @@ ${offenders.map((o3) => ` \u2022 ${o3}`).join(`
|
|
|
21868
22075
|
}
|
|
21869
22076
|
}, resolveAbsoluteVersion = async () => {
|
|
21870
22077
|
const candidates = [
|
|
21871
|
-
|
|
21872
|
-
|
|
22078
|
+
resolve29(import.meta.dir, "..", "..", "package.json"),
|
|
22079
|
+
resolve29(import.meta.dir, "..", "package.json")
|
|
21873
22080
|
];
|
|
21874
22081
|
const resolveCandidate = async (remaining) => {
|
|
21875
22082
|
const [candidate, ...rest] = remaining;
|
|
@@ -21885,7 +22092,7 @@ ${offenders.map((o3) => ` \u2022 ${o3}`).join(`
|
|
|
21885
22092
|
};
|
|
21886
22093
|
await resolveCandidate(candidates);
|
|
21887
22094
|
}, SKIP_DIRS5, addWorkerPathIfExists = (file4, relPath, workerPaths) => {
|
|
21888
|
-
const absPath =
|
|
22095
|
+
const absPath = resolve29(file4, "..", relPath);
|
|
21889
22096
|
try {
|
|
21890
22097
|
statSync3(absPath);
|
|
21891
22098
|
workerPaths.add(absPath);
|
|
@@ -21900,7 +22107,7 @@ ${offenders.map((o3) => ` \u2022 ${o3}`).join(`
|
|
|
21900
22107
|
addWorkerPathIfExists(file4, relPath, workerPaths);
|
|
21901
22108
|
}
|
|
21902
22109
|
}, collectWorkerPathsFromFile = (file4, patterns, workerPaths) => {
|
|
21903
|
-
const content =
|
|
22110
|
+
const content = readFileSync24(file4, "utf-8");
|
|
21904
22111
|
for (const pattern of patterns) {
|
|
21905
22112
|
collectWorkerPathsFromContent(content, pattern, file4, workerPaths);
|
|
21906
22113
|
}
|
|
@@ -21933,8 +22140,8 @@ ${offenders.map((o3) => ` \u2022 ${o3}`).join(`
|
|
|
21933
22140
|
vuePagesPath
|
|
21934
22141
|
}) => {
|
|
21935
22142
|
const { readdirSync: readDir } = await import("fs");
|
|
21936
|
-
const devIndexDir =
|
|
21937
|
-
|
|
22143
|
+
const devIndexDir = join40(buildPath, "_src_indexes");
|
|
22144
|
+
mkdirSync13(devIndexDir, { recursive: true });
|
|
21938
22145
|
if (reactIndexesPath && reactPagesPath) {
|
|
21939
22146
|
copyReactDevIndexes(reactIndexesPath, reactPagesPath, devIndexDir, readDir);
|
|
21940
22147
|
}
|
|
@@ -21945,41 +22152,41 @@ ${offenders.map((o3) => ` \u2022 ${o3}`).join(`
|
|
|
21945
22152
|
copyVueDevIndexes(vueDir, vuePagesPath, vueEntries, devIndexDir);
|
|
21946
22153
|
}
|
|
21947
22154
|
}, copyReactDevIndexes = (reactIndexesPath, reactPagesPath, devIndexDir, readDir) => {
|
|
21948
|
-
if (!
|
|
22155
|
+
if (!existsSync29(reactIndexesPath)) {
|
|
21949
22156
|
return;
|
|
21950
22157
|
}
|
|
21951
22158
|
const indexFiles = readDir(reactIndexesPath).filter((file4) => file4.endsWith(".tsx"));
|
|
21952
|
-
const pagesRel = relative16(process.cwd(),
|
|
22159
|
+
const pagesRel = relative16(process.cwd(), resolve29(reactPagesPath)).replace(/\\/g, "/");
|
|
21953
22160
|
for (const file4 of indexFiles) {
|
|
21954
|
-
let content =
|
|
22161
|
+
let content = readFileSync24(join40(reactIndexesPath, file4), "utf-8");
|
|
21955
22162
|
content = content.replace(/from\s*['"]([^'"]*\/pages\/([^'"]+))['"]/g, (_match, _fullPath, componentName) => `from '/@src/${pagesRel}/${componentName}'`);
|
|
21956
|
-
|
|
22163
|
+
writeFileSync9(join40(devIndexDir, file4), content);
|
|
21957
22164
|
}
|
|
21958
22165
|
}, copySvelteDevIndexes = (svelteDir, sveltePagesPath, svelteEntries, devIndexDir) => {
|
|
21959
|
-
const svelteIndexDir =
|
|
21960
|
-
const sveltePageEntries = svelteEntries.filter((file4) =>
|
|
22166
|
+
const svelteIndexDir = join40(getFrameworkGeneratedDir("svelte"), "indexes");
|
|
22167
|
+
const sveltePageEntries = svelteEntries.filter((file4) => resolve29(file4).startsWith(resolve29(sveltePagesPath)));
|
|
21961
22168
|
for (const entry of sveltePageEntries) {
|
|
21962
22169
|
const name = basename14(entry).replace(/\.svelte(\.(ts|js))?$/, "");
|
|
21963
|
-
const indexFile =
|
|
21964
|
-
if (!
|
|
22170
|
+
const indexFile = join40(svelteIndexDir, "pages", `${name}.js`);
|
|
22171
|
+
if (!existsSync29(indexFile))
|
|
21965
22172
|
continue;
|
|
21966
|
-
let content =
|
|
21967
|
-
const srcRel = relative16(process.cwd(),
|
|
22173
|
+
let content = readFileSync24(indexFile, "utf-8");
|
|
22174
|
+
const srcRel = relative16(process.cwd(), resolve29(entry)).replace(/\\/g, "/");
|
|
21968
22175
|
content = content.replace(/import\s+Component\s+from\s+['"]([^'"]+)['"]/, `import Component from "/@src/${srcRel}"`);
|
|
21969
|
-
|
|
22176
|
+
writeFileSync9(join40(devIndexDir, `${name}.svelte.js`), content);
|
|
21970
22177
|
}
|
|
21971
22178
|
}, copyVueDevIndexes = (vueDir, vuePagesPath, vueEntries, devIndexDir) => {
|
|
21972
|
-
const vueIndexDir =
|
|
21973
|
-
const vuePageEntries = vueEntries.filter((file4) =>
|
|
22179
|
+
const vueIndexDir = join40(getFrameworkGeneratedDir("vue"), "indexes");
|
|
22180
|
+
const vuePageEntries = vueEntries.filter((file4) => resolve29(file4).startsWith(resolve29(vuePagesPath)));
|
|
21974
22181
|
for (const entry of vuePageEntries) {
|
|
21975
22182
|
const name = basename14(entry, ".vue");
|
|
21976
|
-
const indexFile =
|
|
21977
|
-
if (!
|
|
22183
|
+
const indexFile = join40(vueIndexDir, `${name}.js`);
|
|
22184
|
+
if (!existsSync29(indexFile))
|
|
21978
22185
|
continue;
|
|
21979
|
-
let content =
|
|
21980
|
-
const srcRel = relative16(process.cwd(),
|
|
22186
|
+
let content = readFileSync24(indexFile, "utf-8");
|
|
22187
|
+
const srcRel = relative16(process.cwd(), resolve29(entry)).replace(/\\/g, "/");
|
|
21981
22188
|
content = content.replace(/import\s+Comp(?:\s*,\s*\*\s+as\s+\w+)?\s+from\s+['"]([^'"]+)['"]/, (match) => match.replace(/from\s+['"][^'"]+['"]/, `from "/@src/${srcRel}"`));
|
|
21982
|
-
|
|
22189
|
+
writeFileSync9(join40(devIndexDir, `${name}.vue.js`), content);
|
|
21983
22190
|
}
|
|
21984
22191
|
}, resolveVueRuntimeId = (content, firstUseName, outputPath, projectRoot) => {
|
|
21985
22192
|
const varIdx = content.indexOf(`var ${firstUseName} =`);
|
|
@@ -21990,7 +22197,7 @@ ${offenders.map((o3) => ` \u2022 ${o3}`).join(`
|
|
|
21990
22197
|
const last = allComments[allComments.length - 1];
|
|
21991
22198
|
if (!last?.[1])
|
|
21992
22199
|
return JSON.stringify(outputPath);
|
|
21993
|
-
const srcPath =
|
|
22200
|
+
const srcPath = resolve29(projectRoot, last[1].replace("/client/", "/").replace(/\.js$/, ".ts"));
|
|
21994
22201
|
return JSON.stringify(srcPath);
|
|
21995
22202
|
}, QUOTE_CHARS, OPEN_BRACES, CLOSE_BRACES, findFunctionExpressionEnd = (content, startPos) => {
|
|
21996
22203
|
let depth = 0;
|
|
@@ -22027,7 +22234,7 @@ ${offenders.map((o3) => ` \u2022 ${o3}`).join(`
|
|
|
22027
22234
|
}
|
|
22028
22235
|
return result;
|
|
22029
22236
|
}, VUE_HMR_RUNTIME, injectVueComposableTracking = (outputPath, projectRoot) => {
|
|
22030
|
-
let content =
|
|
22237
|
+
let content = readFileSync24(outputPath, "utf-8");
|
|
22031
22238
|
const usePattern = /^var\s+(use[A-Z]\w*)\s*=/gm;
|
|
22032
22239
|
const useNames = [];
|
|
22033
22240
|
let match;
|
|
@@ -22048,7 +22255,7 @@ ${offenders.map((o3) => ` \u2022 ${o3}`).join(`
|
|
|
22048
22255
|
content = `${content.slice(0, firstUseIdx) + runtime}
|
|
22049
22256
|
${content.slice(firstUseIdx)}`;
|
|
22050
22257
|
content = wrapUseFunctions(content, useNames);
|
|
22051
|
-
|
|
22258
|
+
writeFileSync9(outputPath, content);
|
|
22052
22259
|
}, buildDevUrlFileMap = (urlReferencedFiles, projectRoot) => {
|
|
22053
22260
|
const urlFileMap = new Map;
|
|
22054
22261
|
for (const srcPath of urlReferencedFiles) {
|
|
@@ -22077,7 +22284,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
22077
22284
|
}, rewriteUrlReferences = (outputPaths, urlFileMap) => {
|
|
22078
22285
|
const urlPattern = /new\s+URL\(\s*["'](\.\.?\/[^"']+)["']\s*,\s*import\.meta\.url\s*\)/g;
|
|
22079
22286
|
for (const outputPath of outputPaths) {
|
|
22080
|
-
let content =
|
|
22287
|
+
let content = readFileSync24(outputPath, "utf-8");
|
|
22081
22288
|
let changed = false;
|
|
22082
22289
|
content = content.replace(urlPattern, (_match, relPath) => {
|
|
22083
22290
|
const targetName = basename14(relPath);
|
|
@@ -22088,7 +22295,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
22088
22295
|
return `new URL('${resolvedPath}', import.meta.url)`;
|
|
22089
22296
|
});
|
|
22090
22297
|
if (changed)
|
|
22091
|
-
|
|
22298
|
+
writeFileSync9(outputPath, content);
|
|
22092
22299
|
}
|
|
22093
22300
|
}, bunBuildPassKeys, bunBuildPassKeySet, reservedBunBuildConfigKeys, passLockedKeys, isObject = (value) => typeof value === "object" && value !== null, isBunBuildPassConfig = (config) => isObject(config) && Object.keys(config).some((key) => bunBuildPassKeySet.has(key)), sanitizeBunBuildOverride = (override, extraReservedKeys = new Set) => {
|
|
22094
22301
|
if (!override)
|
|
@@ -22217,10 +22424,10 @@ ${content.slice(firstUseIdx)}`;
|
|
|
22217
22424
|
restoreTracePhase();
|
|
22218
22425
|
return;
|
|
22219
22426
|
}
|
|
22220
|
-
const traceDir =
|
|
22427
|
+
const traceDir = join40(buildPath2, ".absolute-trace");
|
|
22221
22428
|
const timestamp = new Date().toISOString().replace(/[:.]/g, "-");
|
|
22222
|
-
|
|
22223
|
-
|
|
22429
|
+
mkdirSync13(traceDir, { recursive: true });
|
|
22430
|
+
writeFileSync9(join40(traceDir, `build-trace-${timestamp}.json`), JSON.stringify({
|
|
22224
22431
|
events: traceEvents,
|
|
22225
22432
|
frameworks: traceFrameworkNames,
|
|
22226
22433
|
generatedAt: new Date().toISOString(),
|
|
@@ -22251,16 +22458,16 @@ ${content.slice(firstUseIdx)}`;
|
|
|
22251
22458
|
const stylesPath = typeof stylesConfig === "string" ? stylesConfig : stylesConfig?.path;
|
|
22252
22459
|
const stylesIgnore = typeof stylesConfig === "object" ? stylesConfig.ignore : undefined;
|
|
22253
22460
|
const stylesDir = stylesPath && validateSafePath(stylesPath, projectRoot);
|
|
22254
|
-
const reactIndexesPath = reactDir &&
|
|
22255
|
-
const reactPagesPath = reactDir &&
|
|
22256
|
-
const htmlPagesPath = htmlDir &&
|
|
22257
|
-
const htmlScriptsPath = htmlDir &&
|
|
22258
|
-
const sveltePagesPath = svelteDir &&
|
|
22259
|
-
const vuePagesPath = vueDir &&
|
|
22260
|
-
const htmxPagesPath = htmxDir &&
|
|
22261
|
-
const htmxScriptsPath = htmxDir &&
|
|
22262
|
-
const angularPagesPath = angularDir &&
|
|
22263
|
-
const emberPagesPath = emberDir &&
|
|
22461
|
+
const reactIndexesPath = reactDir && join40(getFrameworkGeneratedDir("react"), "indexes");
|
|
22462
|
+
const reactPagesPath = reactDir && join40(reactDir, "pages");
|
|
22463
|
+
const htmlPagesPath = htmlDir && join40(htmlDir, "pages");
|
|
22464
|
+
const htmlScriptsPath = htmlDir && join40(htmlDir, "scripts");
|
|
22465
|
+
const sveltePagesPath = svelteDir && join40(svelteDir, "pages");
|
|
22466
|
+
const vuePagesPath = vueDir && join40(vueDir, "pages");
|
|
22467
|
+
const htmxPagesPath = htmxDir && join40(htmxDir, "pages");
|
|
22468
|
+
const htmxScriptsPath = htmxDir && join40(htmxDir, "scripts");
|
|
22469
|
+
const angularPagesPath = angularDir && join40(angularDir, "pages");
|
|
22470
|
+
const emberPagesPath = emberDir && join40(emberDir, "pages");
|
|
22264
22471
|
const frontends = [
|
|
22265
22472
|
reactDir,
|
|
22266
22473
|
htmlDir,
|
|
@@ -22321,14 +22528,14 @@ ${content.slice(firstUseIdx)}`;
|
|
|
22321
22528
|
const [firstEntry] = serverDirMap;
|
|
22322
22529
|
if (!firstEntry)
|
|
22323
22530
|
throw new Error("Expected at least one server directory entry");
|
|
22324
|
-
serverRoot =
|
|
22325
|
-
serverOutDir =
|
|
22531
|
+
serverRoot = join40(firstEntry.dir, firstEntry.subdir);
|
|
22532
|
+
serverOutDir = join40(buildPath, basename14(firstEntry.dir));
|
|
22326
22533
|
} else if (serverDirMap.length > 1) {
|
|
22327
22534
|
serverRoot = commonAncestor(serverDirMap.map((entry) => entry.dir), projectRoot);
|
|
22328
22535
|
serverOutDir = buildPath;
|
|
22329
22536
|
}
|
|
22330
22537
|
const publicPath = publicDirectory && validateSafePath(publicDirectory, projectRoot);
|
|
22331
|
-
await tracePhase("build-dir/create", () =>
|
|
22538
|
+
await tracePhase("build-dir/create", () => mkdirSync13(buildPath, { recursive: true }));
|
|
22332
22539
|
if (publicPath)
|
|
22333
22540
|
await tracePhase("public/copy", () => cpSync(publicPath, buildPath, { force: true, recursive: true }));
|
|
22334
22541
|
const pwaArtifacts = pwa ? await tracePhase("pwa/materialize", () => materializeAbsolutePwa({
|
|
@@ -22341,13 +22548,13 @@ ${content.slice(firstUseIdx)}`;
|
|
|
22341
22548
|
const filterToIncrementalEntries = (entryPoints, mapToSource) => {
|
|
22342
22549
|
if (!isIncremental || !incrementalFiles)
|
|
22343
22550
|
return entryPoints;
|
|
22344
|
-
const normalizedIncremental = new Set(incrementalFiles.map((f2) =>
|
|
22551
|
+
const normalizedIncremental = new Set(incrementalFiles.map((f2) => resolve29(f2)));
|
|
22345
22552
|
const matchingEntries = [];
|
|
22346
22553
|
for (const entry of entryPoints) {
|
|
22347
22554
|
const sourceFile = mapToSource(entry);
|
|
22348
22555
|
if (!sourceFile)
|
|
22349
22556
|
continue;
|
|
22350
|
-
if (!normalizedIncremental.has(
|
|
22557
|
+
if (!normalizedIncremental.has(resolve29(sourceFile)))
|
|
22351
22558
|
continue;
|
|
22352
22559
|
matchingEntries.push(entry);
|
|
22353
22560
|
}
|
|
@@ -22357,7 +22564,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
22357
22564
|
await tracePhase("react/index-generation", () => generateReactIndexFiles(reactPagesPath, reactIndexesPath, hmr));
|
|
22358
22565
|
}
|
|
22359
22566
|
if (assetsPath && (!isIncremental || normalizedIncrementalFiles?.some((f2) => f2.includes("/assets/")))) {
|
|
22360
|
-
await tracePhase("assets/copy", () => cpSync(assetsPath,
|
|
22567
|
+
await tracePhase("assets/copy", () => cpSync(assetsPath, join40(buildPath, "assets"), {
|
|
22361
22568
|
force: true,
|
|
22362
22569
|
recursive: true
|
|
22363
22570
|
}));
|
|
@@ -22471,11 +22678,11 @@ ${content.slice(firstUseIdx)}`;
|
|
|
22471
22678
|
}
|
|
22472
22679
|
}
|
|
22473
22680
|
if (htmlDefaults.error || htmlDefaults.notFound || htmlDefaults.loading || Object.keys(htmlPages).length > 0) {
|
|
22474
|
-
const htmlConventionsOutDir =
|
|
22475
|
-
|
|
22681
|
+
const htmlConventionsOutDir = join40(buildPath, "conventions", "html");
|
|
22682
|
+
mkdirSync13(htmlConventionsOutDir, { recursive: true });
|
|
22476
22683
|
const htmlPathRemap = new Map;
|
|
22477
22684
|
for (const sourcePath of htmlConventionSources) {
|
|
22478
|
-
const dest =
|
|
22685
|
+
const dest = join40(htmlConventionsOutDir, basename14(sourcePath));
|
|
22479
22686
|
cpSync(sourcePath, dest, { force: true });
|
|
22480
22687
|
htmlPathRemap.set(sourcePath, dest);
|
|
22481
22688
|
}
|
|
@@ -22516,9 +22723,9 @@ ${content.slice(firstUseIdx)}`;
|
|
|
22516
22723
|
}
|
|
22517
22724
|
const shouldIncludeHtmlAssets = !isIncremental || normalizedIncrementalFiles?.some((f2) => f2.includes("/html/") && (f2.endsWith(".html") || isStylePath(f2)));
|
|
22518
22725
|
const reactEntries = isIncremental && reactIndexesPath && reactPagesPath ? filterToIncrementalEntries(allReactEntries, (entry) => {
|
|
22519
|
-
if (entry.startsWith(
|
|
22726
|
+
if (entry.startsWith(resolve29(reactIndexesPath))) {
|
|
22520
22727
|
const pageName = basename14(entry, ".tsx");
|
|
22521
|
-
return
|
|
22728
|
+
return join40(reactPagesPath, `${pageName}.tsx`);
|
|
22522
22729
|
}
|
|
22523
22730
|
return null;
|
|
22524
22731
|
}) : allReactEntries;
|
|
@@ -22550,7 +22757,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
22550
22757
|
for (const entry of vueEntries) {
|
|
22551
22758
|
const name = basename14(entry, ".vue");
|
|
22552
22759
|
if (ssrOnlyPageNames.has(name)) {
|
|
22553
|
-
resolved.add(
|
|
22760
|
+
resolved.add(resolve29(entry));
|
|
22554
22761
|
}
|
|
22555
22762
|
}
|
|
22556
22763
|
return resolved;
|
|
@@ -22687,7 +22894,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
22687
22894
|
const clientPath = islandSvelteClientPaths[idx];
|
|
22688
22895
|
if (!sourcePath || !clientPath)
|
|
22689
22896
|
continue;
|
|
22690
|
-
islandSvelteClientPathMap.set(
|
|
22897
|
+
islandSvelteClientPathMap.set(resolve29(sourcePath), clientPath);
|
|
22691
22898
|
}
|
|
22692
22899
|
const islandVueClientPathMap = new Map;
|
|
22693
22900
|
for (let idx = 0;idx < islandVueSources.length; idx++) {
|
|
@@ -22695,7 +22902,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
22695
22902
|
const clientPath = islandVueClientPaths[idx];
|
|
22696
22903
|
if (!sourcePath || !clientPath)
|
|
22697
22904
|
continue;
|
|
22698
|
-
islandVueClientPathMap.set(
|
|
22905
|
+
islandVueClientPathMap.set(resolve29(sourcePath), clientPath);
|
|
22699
22906
|
}
|
|
22700
22907
|
const islandAngularClientPathMap = new Map;
|
|
22701
22908
|
for (let idx = 0;idx < islandAngularSources.length; idx++) {
|
|
@@ -22703,7 +22910,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
22703
22910
|
const clientPath = islandAngularClientPaths[idx];
|
|
22704
22911
|
if (!sourcePath || !clientPath)
|
|
22705
22912
|
continue;
|
|
22706
|
-
islandAngularClientPathMap.set(
|
|
22913
|
+
islandAngularClientPathMap.set(resolve29(sourcePath), clientPath);
|
|
22707
22914
|
}
|
|
22708
22915
|
const reactConventionSources = collectConventionSourceFiles(conventionsMap.react);
|
|
22709
22916
|
const svelteConventionSources = collectConventionSourceFiles(conventionsMap.svelte);
|
|
@@ -22714,9 +22921,9 @@ ${content.slice(firstUseIdx)}`;
|
|
|
22714
22921
|
const compileReactConventions = async () => {
|
|
22715
22922
|
if (reactConventionSources.length === 0)
|
|
22716
22923
|
return emptyStringArray;
|
|
22717
|
-
const destDir =
|
|
22924
|
+
const destDir = join40(buildPath, "conventions", "react");
|
|
22718
22925
|
rmSync2(destDir, { force: true, recursive: true });
|
|
22719
|
-
|
|
22926
|
+
mkdirSync13(destDir, { recursive: true });
|
|
22720
22927
|
const destPaths = await Promise.all(reactConventionSources.map(async (source, idx) => {
|
|
22721
22928
|
const result = await bunBuild7({
|
|
22722
22929
|
entrypoints: [source],
|
|
@@ -22757,9 +22964,9 @@ ${content.slice(firstUseIdx)}`;
|
|
|
22757
22964
|
angularConventionSources.length > 0 && angularDir ? tracePhase("compile/convention-angular", () => Promise.resolve().then(() => (init_compileAngular(), exports_compileAngular)).then((mod) => mod.compileAngular(angularConventionSources, angularDir, hmr, styleTransformConfig))) : { serverPaths: emptyStringArray }
|
|
22758
22965
|
]);
|
|
22759
22966
|
const bundleConventionFiles = async (framework, compiledPaths) => {
|
|
22760
|
-
const destDir =
|
|
22967
|
+
const destDir = join40(buildPath, "conventions", framework);
|
|
22761
22968
|
rmSync2(destDir, { force: true, recursive: true });
|
|
22762
|
-
|
|
22969
|
+
mkdirSync13(destDir, { recursive: true });
|
|
22763
22970
|
const destPaths = await Promise.all(compiledPaths.map(async (compiledPath, idx) => {
|
|
22764
22971
|
const name = basename14(compiledPath).replace(/\.[^.]+$/, "");
|
|
22765
22972
|
const result = await bunBuild7({
|
|
@@ -22829,7 +23036,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
22829
23036
|
}
|
|
22830
23037
|
})) : {
|
|
22831
23038
|
entries: [],
|
|
22832
|
-
generatedRoot:
|
|
23039
|
+
generatedRoot: join40(buildPath, "_island_entries")
|
|
22833
23040
|
};
|
|
22834
23041
|
const islandClientEntryPoints = islandEntryResult.entries.map((entry) => entry.entryPath);
|
|
22835
23042
|
if (serverEntryPoints.length === 0 && reactClientEntryPoints.length === 0 && nonReactClientEntryPoints.length === 0 && urlReferencedFiles.length === 0 && islandClientEntryPoints.length === 0 && htmxDir === undefined && htmlDir === undefined) {
|
|
@@ -22865,7 +23072,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
22865
23072
|
return {};
|
|
22866
23073
|
}
|
|
22867
23074
|
if (hmr && reactIndexesPath && reactClientEntryPoints.length > 0) {
|
|
22868
|
-
const refreshEntry =
|
|
23075
|
+
const refreshEntry = join40(reactIndexesPath, "_refresh.tsx");
|
|
22869
23076
|
if (!reactClientEntryPoints.includes(refreshEntry))
|
|
22870
23077
|
reactClientEntryPoints.push(refreshEntry);
|
|
22871
23078
|
}
|
|
@@ -22982,19 +23189,19 @@ ${content.slice(firstUseIdx)}`;
|
|
|
22982
23189
|
throw: false
|
|
22983
23190
|
}, resolveBunBuildOverride(bunBuildConfig, "reactClient")) : undefined;
|
|
22984
23191
|
if (reactDir && reactClientEntryPoints.length > 0) {
|
|
22985
|
-
rmSync2(
|
|
23192
|
+
rmSync2(join40(buildPath, "react", "generated", "indexes"), {
|
|
22986
23193
|
force: true,
|
|
22987
23194
|
recursive: true
|
|
22988
23195
|
});
|
|
22989
23196
|
}
|
|
22990
23197
|
if (angularDir && angularClientPaths.length > 0) {
|
|
22991
|
-
rmSync2(
|
|
23198
|
+
rmSync2(join40(buildPath, "angular", "indexes"), {
|
|
22992
23199
|
force: true,
|
|
22993
23200
|
recursive: true
|
|
22994
23201
|
});
|
|
22995
23202
|
}
|
|
22996
23203
|
if (islandClientEntryPoints.length > 0) {
|
|
22997
|
-
rmSync2(
|
|
23204
|
+
rmSync2(join40(buildPath, "islands"), {
|
|
22998
23205
|
force: true,
|
|
22999
23206
|
recursive: true
|
|
23000
23207
|
});
|
|
@@ -23108,7 +23315,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
23108
23315
|
globalCssEntries.length > 0 ? tracePhase("bun/global-css", () => bunBuild7(mergeBunBuildConfig({
|
|
23109
23316
|
entrypoints: globalCssEntries,
|
|
23110
23317
|
naming: `[dir]/[name].[hash].[ext]`,
|
|
23111
|
-
outdir: stylesDir ?
|
|
23318
|
+
outdir: stylesDir ? join40(buildPath, basename14(stylesDir)) : buildPath,
|
|
23112
23319
|
plugins: [stylePreprocessorPlugin2],
|
|
23113
23320
|
root: stylesDir || clientRoot,
|
|
23114
23321
|
target: "browser",
|
|
@@ -23117,7 +23324,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
23117
23324
|
vueCssPaths.length > 0 ? tracePhase("bun/vue-css", () => bunBuild7(mergeBunBuildConfig({
|
|
23118
23325
|
entrypoints: vueCssPaths,
|
|
23119
23326
|
naming: `[name].[hash].[ext]`,
|
|
23120
|
-
outdir:
|
|
23327
|
+
outdir: join40(buildPath, assetsPath ? basename14(assetsPath) : "assets", "css"),
|
|
23121
23328
|
target: "browser",
|
|
23122
23329
|
throw: false
|
|
23123
23330
|
}, resolveBunBuildOverride(bunBuildConfig, "vueCss")))) : undefined
|
|
@@ -23133,28 +23340,26 @@ ${content.slice(firstUseIdx)}`;
|
|
|
23133
23340
|
extractBuildError(logs, pass, label, frameworkNames, isIncremental, throwOnError);
|
|
23134
23341
|
};
|
|
23135
23342
|
if (isDev2 && serverResult?.success) {
|
|
23136
|
-
const {
|
|
23137
|
-
|
|
23138
|
-
|
|
23139
|
-
chainBundleInlineSourcemap2(out.path);
|
|
23140
|
-
}
|
|
23343
|
+
const { chainBundleInlineSourcemaps: chainBundleInlineSourcemaps2 } = await Promise.resolve().then(() => (init_chainInlineSourcemaps(), exports_chainInlineSourcemaps));
|
|
23344
|
+
const serverBundlePaths = serverOutputs.map((out) => out.path).filter((path) => path.endsWith(".js"));
|
|
23345
|
+
await tracePhase("postprocess/server-sourcemap-chain", () => chainBundleInlineSourcemaps2(serverBundlePaths), { bundles: serverBundlePaths.length });
|
|
23141
23346
|
}
|
|
23142
23347
|
if (!isDev2 && resolveClientSourcemap(sourcemaps, isDev2) === "external") {
|
|
23143
23348
|
const { chainExternalSourcemap: chainExternalSourcemap2 } = await Promise.resolve().then(() => (init_chainInlineSourcemaps(), exports_chainInlineSourcemaps));
|
|
23144
|
-
const sourcemapDir =
|
|
23145
|
-
|
|
23349
|
+
const sourcemapDir = join40(projectRoot, "sourcemaps");
|
|
23350
|
+
mkdirSync13(sourcemapDir, { recursive: true });
|
|
23146
23351
|
const mapFiles = readdirSync5(buildPath, {
|
|
23147
23352
|
encoding: "utf8",
|
|
23148
23353
|
recursive: true
|
|
23149
|
-
}).filter((entry) => entry.endsWith(".js.map") && !entry.includes("node_modules")).map((entry) =>
|
|
23354
|
+
}).filter((entry) => entry.endsWith(".js.map") && !entry.includes("node_modules")).map((entry) => join40(buildPath, entry));
|
|
23150
23355
|
for (const mapPath of mapFiles) {
|
|
23151
23356
|
chainExternalSourcemap2(mapPath);
|
|
23152
|
-
|
|
23357
|
+
renameSync2(mapPath, join40(sourcemapDir, basename14(mapPath)));
|
|
23153
23358
|
const jsPath = mapPath.slice(0, -4);
|
|
23154
23359
|
try {
|
|
23155
|
-
const javascript =
|
|
23360
|
+
const javascript = readFileSync24(jsPath, "utf-8").replace(/\n?\/\/# sourceMappingURL=[^\n]*\s*$/, `
|
|
23156
23361
|
`);
|
|
23157
|
-
|
|
23362
|
+
writeFileSync9(jsPath, javascript);
|
|
23158
23363
|
} catch {}
|
|
23159
23364
|
}
|
|
23160
23365
|
console.info(`[absolute] sourcemaps: chained + privatized ${mapFiles.length} client maps \u2192 ${relative16(projectRoot, sourcemapDir)}/`);
|
|
@@ -23223,8 +23428,8 @@ ${content.slice(firstUseIdx)}`;
|
|
|
23223
23428
|
await tracePhase("postprocess/island-vendor-imports", () => rewriteBuildOutputs2(islandClientOutputs, allIslandVendorPaths));
|
|
23224
23429
|
}
|
|
23225
23430
|
if (!hmr) {
|
|
23226
|
-
const reactVendorDir =
|
|
23227
|
-
const vendorChunkPaths =
|
|
23431
|
+
const reactVendorDir = join40(buildPath, "react", "vendor");
|
|
23432
|
+
const vendorChunkPaths = existsSync29(reactVendorDir) ? [
|
|
23228
23433
|
...new Glob8("**/*.js").scanSync({
|
|
23229
23434
|
absolute: true,
|
|
23230
23435
|
cwd: reactVendorDir
|
|
@@ -23368,19 +23573,19 @@ ${content.slice(firstUseIdx)}`;
|
|
|
23368
23573
|
const injectHMRIntoHTMLFile = (filePath, framework) => {
|
|
23369
23574
|
if (!hmrClientBundle)
|
|
23370
23575
|
return;
|
|
23371
|
-
let html =
|
|
23576
|
+
let html = readFileSync24(filePath, "utf-8");
|
|
23372
23577
|
if (html.includes("data-hmr-client"))
|
|
23373
23578
|
return;
|
|
23374
23579
|
const tag = `<script>window.__HMR_FRAMEWORK__="${framework}";</script><script data-hmr-client>${hmrClientBundle}</script>`;
|
|
23375
23580
|
const bodyClose = /<\/body\s*>/i.exec(html);
|
|
23376
23581
|
html = bodyClose ? html.slice(0, bodyClose.index) + tag + html.slice(bodyClose.index) : html + tag;
|
|
23377
|
-
|
|
23582
|
+
writeFileSync9(filePath, html);
|
|
23378
23583
|
};
|
|
23379
23584
|
const processHtmlPages = async () => {
|
|
23380
23585
|
if (!(htmlDir && htmlPagesPath))
|
|
23381
23586
|
return;
|
|
23382
|
-
const outputHtmlPages = isSingle ?
|
|
23383
|
-
|
|
23587
|
+
const outputHtmlPages = isSingle ? join40(buildPath, "pages") : join40(buildPath, basename14(htmlDir), "pages");
|
|
23588
|
+
mkdirSync13(outputHtmlPages, { recursive: true });
|
|
23384
23589
|
cpSync(htmlPagesPath, outputHtmlPages, {
|
|
23385
23590
|
force: true,
|
|
23386
23591
|
recursive: true
|
|
@@ -23395,8 +23600,8 @@ ${content.slice(firstUseIdx)}`;
|
|
|
23395
23600
|
if (hmr)
|
|
23396
23601
|
injectHMRIntoHTMLFile(htmlFile, "html");
|
|
23397
23602
|
if (pwaArtifacts) {
|
|
23398
|
-
const source =
|
|
23399
|
-
|
|
23603
|
+
const source = readFileSync24(htmlFile, "utf8");
|
|
23604
|
+
writeFileSync9(htmlFile, injectPwaBootstrapHtml(source));
|
|
23400
23605
|
}
|
|
23401
23606
|
const fileName = basename14(htmlFile, ".html");
|
|
23402
23607
|
if (manifest[fileName] && manifest[fileName] !== htmlFile) {
|
|
@@ -23408,14 +23613,14 @@ ${content.slice(firstUseIdx)}`;
|
|
|
23408
23613
|
const processHtmxPages = async () => {
|
|
23409
23614
|
if (!(htmxDir && htmxPagesPath))
|
|
23410
23615
|
return;
|
|
23411
|
-
const outputHtmxPages = isSingle ?
|
|
23412
|
-
|
|
23616
|
+
const outputHtmxPages = isSingle ? join40(buildPath, "pages") : join40(buildPath, basename14(htmxDir), "pages");
|
|
23617
|
+
mkdirSync13(outputHtmxPages, { recursive: true });
|
|
23413
23618
|
cpSync(htmxPagesPath, outputHtmxPages, {
|
|
23414
23619
|
force: true,
|
|
23415
23620
|
recursive: true
|
|
23416
23621
|
});
|
|
23417
23622
|
if (shouldCopyHtmx) {
|
|
23418
|
-
const htmxDestDir = isSingle ? buildPath :
|
|
23623
|
+
const htmxDestDir = isSingle ? buildPath : join40(buildPath, basename14(htmxDir));
|
|
23419
23624
|
copyHtmxVendor(htmxDir, htmxDestDir);
|
|
23420
23625
|
}
|
|
23421
23626
|
if (shouldUpdateHtmxAssetPaths) {
|
|
@@ -23428,8 +23633,8 @@ ${content.slice(firstUseIdx)}`;
|
|
|
23428
23633
|
if (hmr)
|
|
23429
23634
|
injectHMRIntoHTMLFile(htmxFile, "htmx");
|
|
23430
23635
|
if (pwaArtifacts) {
|
|
23431
|
-
const source =
|
|
23432
|
-
|
|
23636
|
+
const source = readFileSync24(htmxFile, "utf8");
|
|
23637
|
+
writeFileSync9(htmxFile, injectPwaBootstrapHtml(source));
|
|
23433
23638
|
}
|
|
23434
23639
|
const fileName = basename14(htmxFile, ".html");
|
|
23435
23640
|
if (manifest[fileName] && manifest[fileName] !== htmxFile) {
|
|
@@ -23506,7 +23711,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
23506
23711
|
}))
|
|
23507
23712
|
];
|
|
23508
23713
|
setSpaRouteManifest(spaRouteHosts);
|
|
23509
|
-
|
|
23714
|
+
writeFileSync9(join40(buildPath, "spa-routes.json"), JSON.stringify(spaRouteHosts, null, "\t"));
|
|
23510
23715
|
if (isIncremental) {
|
|
23511
23716
|
writeBuildTrace(buildPath);
|
|
23512
23717
|
return {
|
|
@@ -23515,9 +23720,9 @@ ${content.slice(firstUseIdx)}`;
|
|
|
23515
23720
|
manifest
|
|
23516
23721
|
};
|
|
23517
23722
|
}
|
|
23518
|
-
|
|
23723
|
+
writeFileSync9(join40(buildPath, "manifest.json"), JSON.stringify(manifest, null, "\t"));
|
|
23519
23724
|
if (Object.keys(conventionsMap).length > 0) {
|
|
23520
|
-
|
|
23725
|
+
writeFileSync9(join40(buildPath, "conventions.json"), JSON.stringify(conventionsMap, null, "\t"));
|
|
23521
23726
|
}
|
|
23522
23727
|
writeBuildTrace(buildPath);
|
|
23523
23728
|
if (mode === "production") {
|
|
@@ -23582,6 +23787,7 @@ var init_build = __esm(() => {
|
|
|
23582
23787
|
init_hmrInjectionPlugin();
|
|
23583
23788
|
init_cleanStaleOutputs();
|
|
23584
23789
|
init_cleanup();
|
|
23790
|
+
init_startupTimings();
|
|
23585
23791
|
init_commonAncestor();
|
|
23586
23792
|
init_generatedDir();
|
|
23587
23793
|
init_buildDirectoryLock();
|
|
@@ -23650,8 +23856,8 @@ var init_build = __esm(() => {
|
|
|
23650
23856
|
});
|
|
23651
23857
|
|
|
23652
23858
|
// src/build/buildEmberVendor.ts
|
|
23653
|
-
import { mkdirSync as
|
|
23654
|
-
import { join as
|
|
23859
|
+
import { mkdirSync as mkdirSync14, existsSync as existsSync30 } from "fs";
|
|
23860
|
+
import { join as join41 } from "path";
|
|
23655
23861
|
import { rm as rm10 } from "fs/promises";
|
|
23656
23862
|
var {build: bunBuild8 } = globalThis.Bun;
|
|
23657
23863
|
var toSafeFileName5 = (specifier) => specifier.replace(/^@/, "").replace(/\//g, "_"), generateMacrosShim = () => `// Generated shim for @embroider/macros \u2014 provides minimal runtime
|
|
@@ -23703,8 +23909,8 @@ export const importSync = (specifier) => {
|
|
|
23703
23909
|
if (standaloneSpecifiers.has(specifier)) {
|
|
23704
23910
|
return { resolveTo: specifier, specifier };
|
|
23705
23911
|
}
|
|
23706
|
-
const emberInternalPath =
|
|
23707
|
-
if (!
|
|
23912
|
+
const emberInternalPath = join41(cwd2, "node_modules/ember-source/dist/packages", specifier, "index.js");
|
|
23913
|
+
if (!existsSync30(emberInternalPath)) {
|
|
23708
23914
|
throw new Error(`Ember vendor build: cannot find ${specifier} at ${emberInternalPath}. ` + `Is ember-source installed and at least 6.12?`);
|
|
23709
23915
|
}
|
|
23710
23916
|
return { resolveTo: emberInternalPath, specifier };
|
|
@@ -23735,24 +23941,24 @@ export const importSync = (specifier) => {
|
|
|
23735
23941
|
if (standalonePackages.has(args.path)) {
|
|
23736
23942
|
return;
|
|
23737
23943
|
}
|
|
23738
|
-
const internal =
|
|
23739
|
-
if (
|
|
23944
|
+
const internal = join41(cwd2, "node_modules/ember-source/dist/packages", args.path, "index.js");
|
|
23945
|
+
if (existsSync30(internal)) {
|
|
23740
23946
|
return { path: internal };
|
|
23741
23947
|
}
|
|
23742
23948
|
return;
|
|
23743
23949
|
});
|
|
23744
23950
|
}
|
|
23745
23951
|
}), buildEmberVendor = async (buildDir, cwd2 = process.cwd()) => {
|
|
23746
|
-
const vendorDir =
|
|
23747
|
-
|
|
23748
|
-
const tmpDir =
|
|
23749
|
-
|
|
23750
|
-
const macrosShimPath =
|
|
23952
|
+
const vendorDir = join41(buildDir, "ember", "vendor");
|
|
23953
|
+
mkdirSync14(vendorDir, { recursive: true });
|
|
23954
|
+
const tmpDir = join41(buildDir, "_ember_vendor_tmp");
|
|
23955
|
+
mkdirSync14(tmpDir, { recursive: true });
|
|
23956
|
+
const macrosShimPath = join41(tmpDir, "embroider_macros_shim.js");
|
|
23751
23957
|
await Bun.write(macrosShimPath, generateMacrosShim());
|
|
23752
23958
|
const resolutions = REQUIRED_EMBER_SPECIFIERS.map((specifier) => resolveEmberSpecifier(specifier, cwd2));
|
|
23753
23959
|
const entrypoints = await Promise.all(resolutions.map(async (resolution) => {
|
|
23754
23960
|
const safeName = toSafeFileName5(resolution.specifier);
|
|
23755
|
-
const entryPath =
|
|
23961
|
+
const entryPath = join41(tmpDir, `${safeName}.js`);
|
|
23756
23962
|
const source = resolution.specifier === "@embroider/macros" ? `export * from ${JSON.stringify(macrosShimPath)};
|
|
23757
23963
|
` : generateVendorEntrySource2(resolution);
|
|
23758
23964
|
await Bun.write(entryPath, source);
|
|
@@ -23908,9 +24114,9 @@ __export(exports_dependencyGraph, {
|
|
|
23908
24114
|
getAffectedFiles: () => getAffectedFiles,
|
|
23909
24115
|
removeFileFromGraph: () => removeFileFromGraph
|
|
23910
24116
|
});
|
|
23911
|
-
import { existsSync as
|
|
24117
|
+
import { existsSync as existsSync31, readFileSync as readFileSync25 } from "fs";
|
|
23912
24118
|
var {Glob: Glob9 } = globalThis.Bun;
|
|
23913
|
-
import { resolve as
|
|
24119
|
+
import { resolve as resolve30 } from "path";
|
|
23914
24120
|
var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath) => {
|
|
23915
24121
|
const lower = filePath.toLowerCase();
|
|
23916
24122
|
if (lower.endsWith(".ts") || lower.endsWith(".tsx") || lower.endsWith(".jsx"))
|
|
@@ -23924,8 +24130,8 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
23924
24130
|
if (!importPath.startsWith(".") && !importPath.startsWith("/")) {
|
|
23925
24131
|
return null;
|
|
23926
24132
|
}
|
|
23927
|
-
const fromDir =
|
|
23928
|
-
const normalized =
|
|
24133
|
+
const fromDir = resolve30(fromFile, "..");
|
|
24134
|
+
const normalized = resolve30(fromDir, importPath);
|
|
23929
24135
|
const extensions = [
|
|
23930
24136
|
".ts",
|
|
23931
24137
|
".tsx",
|
|
@@ -23938,10 +24144,10 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
23938
24144
|
];
|
|
23939
24145
|
for (const ext of extensions) {
|
|
23940
24146
|
const withExt = normalized + ext;
|
|
23941
|
-
if (
|
|
24147
|
+
if (existsSync31(withExt))
|
|
23942
24148
|
return withExt;
|
|
23943
24149
|
}
|
|
23944
|
-
if (
|
|
24150
|
+
if (existsSync31(normalized))
|
|
23945
24151
|
return normalized;
|
|
23946
24152
|
return null;
|
|
23947
24153
|
}, clearExistingDependents = (graph, normalizedPath) => {
|
|
@@ -23955,8 +24161,8 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
23955
24161
|
dependents.delete(normalizedPath);
|
|
23956
24162
|
}
|
|
23957
24163
|
}, addFileToGraph = (graph, filePath) => {
|
|
23958
|
-
const normalizedPath =
|
|
23959
|
-
if (!
|
|
24164
|
+
const normalizedPath = resolve30(filePath);
|
|
24165
|
+
if (!existsSync31(normalizedPath))
|
|
23960
24166
|
return;
|
|
23961
24167
|
const dependencies = extractDependencies(normalizedPath);
|
|
23962
24168
|
clearExistingDependents(graph, normalizedPath);
|
|
@@ -23982,10 +24188,10 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
23982
24188
|
}, IGNORED_SEGMENTS, buildInitialDependencyGraph = (graph, directories) => {
|
|
23983
24189
|
const processedFiles = new Set;
|
|
23984
24190
|
const glob = new Glob9("**/*.{ts,tsx,js,jsx,vue,svelte,html,htm}");
|
|
23985
|
-
const resolvedDirs = directories.map((dir) =>
|
|
24191
|
+
const resolvedDirs = directories.map((dir) => resolve30(dir)).filter((dir) => existsSync31(dir));
|
|
23986
24192
|
const allFiles = resolvedDirs.flatMap((dir) => Array.from(glob.scanSync({ absolute: true, cwd: dir })));
|
|
23987
24193
|
for (const file4 of allFiles) {
|
|
23988
|
-
const fullPath =
|
|
24194
|
+
const fullPath = resolve30(file4);
|
|
23989
24195
|
if (IGNORED_SEGMENTS.some((seg) => fullPath.includes(seg)))
|
|
23990
24196
|
continue;
|
|
23991
24197
|
if (processedFiles.has(fullPath))
|
|
@@ -24079,15 +24285,15 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
24079
24285
|
const lowerPath = filePath.toLowerCase();
|
|
24080
24286
|
const isSvelteOrVue = lowerPath.endsWith(".svelte") || lowerPath.endsWith(".vue");
|
|
24081
24287
|
if (loader === "html") {
|
|
24082
|
-
const content =
|
|
24288
|
+
const content = readFileSync25(filePath, "utf-8");
|
|
24083
24289
|
return extractHtmlDependencies(filePath, content);
|
|
24084
24290
|
}
|
|
24085
24291
|
if (loader === "tsx" || loader === "js") {
|
|
24086
|
-
const content =
|
|
24292
|
+
const content = readFileSync25(filePath, "utf-8");
|
|
24087
24293
|
return extractJsDependencies(filePath, content, loader);
|
|
24088
24294
|
}
|
|
24089
24295
|
if (isSvelteOrVue) {
|
|
24090
|
-
const content =
|
|
24296
|
+
const content = readFileSync25(filePath, "utf-8");
|
|
24091
24297
|
return extractSvelteVueDependencies(filePath, content);
|
|
24092
24298
|
}
|
|
24093
24299
|
return [];
|
|
@@ -24098,7 +24304,7 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
24098
24304
|
return [];
|
|
24099
24305
|
}
|
|
24100
24306
|
}, getAffectedFiles = (graph, changedFile) => {
|
|
24101
|
-
const normalizedPath =
|
|
24307
|
+
const normalizedPath = resolve30(changedFile);
|
|
24102
24308
|
const affected = new Set;
|
|
24103
24309
|
const toProcess = [normalizedPath];
|
|
24104
24310
|
const processNode = (current) => {
|
|
@@ -24129,7 +24335,7 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
24129
24335
|
}, removeDependentsForFile = (graph, normalizedPath) => {
|
|
24130
24336
|
graph.dependents.delete(normalizedPath);
|
|
24131
24337
|
}, removeFileFromGraph = (graph, filePath) => {
|
|
24132
|
-
const normalizedPath =
|
|
24338
|
+
const normalizedPath = resolve30(filePath);
|
|
24133
24339
|
removeDepsForFile(graph, normalizedPath);
|
|
24134
24340
|
removeDependentsForFile(graph, normalizedPath);
|
|
24135
24341
|
};
|
|
@@ -24172,12 +24378,12 @@ var globalVersionCounter = 0, createModuleVersionTracker = () => new Map, getNex
|
|
|
24172
24378
|
};
|
|
24173
24379
|
|
|
24174
24380
|
// src/dev/configResolver.ts
|
|
24175
|
-
import { resolve as
|
|
24381
|
+
import { resolve as resolve31 } from "path";
|
|
24176
24382
|
var resolveBuildPaths = (config) => {
|
|
24177
24383
|
const cwd2 = process.cwd();
|
|
24178
24384
|
const normalize = (path) => path.replace(/\\/g, "/");
|
|
24179
|
-
const withDefault = (value, fallback) => normalize(
|
|
24180
|
-
const optional = (value) => value ? normalize(
|
|
24385
|
+
const withDefault = (value, fallback) => normalize(resolve31(cwd2, value ?? fallback));
|
|
24386
|
+
const optional = (value) => value ? normalize(resolve31(cwd2, value)) : undefined;
|
|
24181
24387
|
return {
|
|
24182
24388
|
angularDir: optional(config.angularDirectory),
|
|
24183
24389
|
assetsDir: optional(config.assetsDirectory),
|
|
@@ -24236,8 +24442,8 @@ var init_clientManager = __esm(() => {
|
|
|
24236
24442
|
});
|
|
24237
24443
|
|
|
24238
24444
|
// src/dev/pathUtils.ts
|
|
24239
|
-
import { existsSync as
|
|
24240
|
-
import { dirname as dirname22, resolve as
|
|
24445
|
+
import { existsSync as existsSync32, readdirSync as readdirSync6, readFileSync as readFileSync26 } from "fs";
|
|
24446
|
+
import { dirname as dirname22, resolve as resolve32 } from "path";
|
|
24241
24447
|
var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
24242
24448
|
if (shouldIgnorePath(filePath, resolved)) {
|
|
24243
24449
|
return "ignored";
|
|
@@ -24313,7 +24519,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
24313
24519
|
return "unknown";
|
|
24314
24520
|
}, collectAngularResourceDirs = (angularDir) => {
|
|
24315
24521
|
const out = new Set;
|
|
24316
|
-
const angularRoot =
|
|
24522
|
+
const angularRoot = resolve32(angularDir);
|
|
24317
24523
|
const angularRootNormalized = normalizePath(angularRoot);
|
|
24318
24524
|
const walk = (dir) => {
|
|
24319
24525
|
let entries;
|
|
@@ -24326,7 +24532,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
24326
24532
|
if (entry.name.startsWith(".") || entry.name === "node_modules") {
|
|
24327
24533
|
continue;
|
|
24328
24534
|
}
|
|
24329
|
-
const full =
|
|
24535
|
+
const full = resolve32(dir, entry.name);
|
|
24330
24536
|
if (entry.isDirectory()) {
|
|
24331
24537
|
walk(full);
|
|
24332
24538
|
continue;
|
|
@@ -24336,7 +24542,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
24336
24542
|
}
|
|
24337
24543
|
let source;
|
|
24338
24544
|
try {
|
|
24339
|
-
source =
|
|
24545
|
+
source = readFileSync26(full, "utf8");
|
|
24340
24546
|
} catch {
|
|
24341
24547
|
continue;
|
|
24342
24548
|
}
|
|
@@ -24367,7 +24573,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
24367
24573
|
}
|
|
24368
24574
|
const componentDir = dirname22(full);
|
|
24369
24575
|
for (const ref of refs) {
|
|
24370
|
-
const refAbs = normalizePath(
|
|
24576
|
+
const refAbs = normalizePath(resolve32(componentDir, ref));
|
|
24371
24577
|
const refDir = normalizePath(dirname22(refAbs));
|
|
24372
24578
|
if (refDir === angularRootNormalized || refDir.startsWith(`${angularRootNormalized}/`)) {
|
|
24373
24579
|
continue;
|
|
@@ -24384,7 +24590,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
24384
24590
|
const push = (path) => {
|
|
24385
24591
|
if (!path)
|
|
24386
24592
|
return;
|
|
24387
|
-
const abs = normalizePath(
|
|
24593
|
+
const abs = normalizePath(resolve32(cwd2, path));
|
|
24388
24594
|
if (!roots.includes(abs))
|
|
24389
24595
|
roots.push(abs);
|
|
24390
24596
|
};
|
|
@@ -24409,8 +24615,8 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
24409
24615
|
push(cfg.assetsDir);
|
|
24410
24616
|
push(cfg.stylesDir);
|
|
24411
24617
|
for (const candidate of ["src", "db", "assets", "styles"]) {
|
|
24412
|
-
const abs = normalizePath(
|
|
24413
|
-
if (
|
|
24618
|
+
const abs = normalizePath(resolve32(cwd2, candidate));
|
|
24619
|
+
if (existsSync32(abs) && !roots.includes(abs))
|
|
24414
24620
|
roots.push(abs);
|
|
24415
24621
|
}
|
|
24416
24622
|
try {
|
|
@@ -24420,7 +24626,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
24420
24626
|
continue;
|
|
24421
24627
|
if (entry.name.startsWith("."))
|
|
24422
24628
|
continue;
|
|
24423
|
-
const abs = normalizePath(
|
|
24629
|
+
const abs = normalizePath(resolve32(cwd2, entry.name));
|
|
24424
24630
|
if (roots.includes(abs))
|
|
24425
24631
|
continue;
|
|
24426
24632
|
if (shouldIgnorePath(abs, resolved))
|
|
@@ -24503,8 +24709,8 @@ var init_pathUtils = __esm(() => {
|
|
|
24503
24709
|
|
|
24504
24710
|
// src/dev/fileWatcher.ts
|
|
24505
24711
|
import { watch } from "fs";
|
|
24506
|
-
import { existsSync as
|
|
24507
|
-
import { dirname as dirname23, join as
|
|
24712
|
+
import { existsSync as existsSync33, readdirSync as readdirSync7, statSync as statSync4 } from "fs";
|
|
24713
|
+
import { dirname as dirname23, join as join42, resolve as resolve33 } from "path";
|
|
24508
24714
|
var safeRemoveFromGraph = (graph, fullPath) => {
|
|
24509
24715
|
try {
|
|
24510
24716
|
removeFileFromGraph(graph, fullPath);
|
|
@@ -24536,7 +24742,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
24536
24742
|
for (const name of entries) {
|
|
24537
24743
|
if (shouldSkipFilename(name, isStylesDir))
|
|
24538
24744
|
continue;
|
|
24539
|
-
const child =
|
|
24745
|
+
const child = join42(eventDir, name).replace(/\\/g, "/");
|
|
24540
24746
|
let st2;
|
|
24541
24747
|
try {
|
|
24542
24748
|
st2 = statSync4(child);
|
|
@@ -24557,7 +24763,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
24557
24763
|
return;
|
|
24558
24764
|
if (shouldSkipFilename(filename, isStylesDir)) {
|
|
24559
24765
|
if (event === "rename") {
|
|
24560
|
-
const eventDir = dirname23(
|
|
24766
|
+
const eventDir = dirname23(join42(absolutePath, filename)).replace(/\\/g, "/");
|
|
24561
24767
|
atomicRecoveryScan(eventDir);
|
|
24562
24768
|
for (const delay of [25, 100]) {
|
|
24563
24769
|
const timer = setTimeout(() => atomicRecoveryScan(eventDir), delay);
|
|
@@ -24566,16 +24772,16 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
24566
24772
|
}
|
|
24567
24773
|
return;
|
|
24568
24774
|
}
|
|
24569
|
-
const fullPath =
|
|
24775
|
+
const fullPath = join42(absolutePath, filename).replace(/\\/g, "/");
|
|
24570
24776
|
if (shouldIgnorePath(fullPath, state.resolvedPaths)) {
|
|
24571
24777
|
return;
|
|
24572
24778
|
}
|
|
24573
|
-
if (event === "rename" && !
|
|
24779
|
+
if (event === "rename" && !existsSync33(fullPath)) {
|
|
24574
24780
|
safeRemoveFromGraph(state.dependencyGraph, fullPath);
|
|
24575
24781
|
onFileChange(fullPath);
|
|
24576
24782
|
return;
|
|
24577
24783
|
}
|
|
24578
|
-
if (
|
|
24784
|
+
if (existsSync33(fullPath)) {
|
|
24579
24785
|
onFileChange(fullPath);
|
|
24580
24786
|
safeAddToGraph(state.dependencyGraph, fullPath);
|
|
24581
24787
|
}
|
|
@@ -24584,8 +24790,8 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
24584
24790
|
}, addFileWatchers = (state, paths, onFileChange) => {
|
|
24585
24791
|
const stylesDir = state.resolvedPaths?.stylesDir;
|
|
24586
24792
|
paths.forEach((path) => {
|
|
24587
|
-
const absolutePath =
|
|
24588
|
-
if (!
|
|
24793
|
+
const absolutePath = resolve33(path).replace(/\\/g, "/");
|
|
24794
|
+
if (!existsSync33(absolutePath)) {
|
|
24589
24795
|
return;
|
|
24590
24796
|
}
|
|
24591
24797
|
const isStylesDir = Boolean(stylesDir && absolutePath.startsWith(stylesDir));
|
|
@@ -24595,8 +24801,8 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
24595
24801
|
const watchPaths = getWatchPaths(config, state.resolvedPaths);
|
|
24596
24802
|
const stylesDir = state.resolvedPaths?.stylesDir;
|
|
24597
24803
|
watchPaths.forEach((path) => {
|
|
24598
|
-
const absolutePath =
|
|
24599
|
-
if (!
|
|
24804
|
+
const absolutePath = resolve33(path).replace(/\\/g, "/");
|
|
24805
|
+
if (!existsSync33(absolutePath)) {
|
|
24600
24806
|
return;
|
|
24601
24807
|
}
|
|
24602
24808
|
const isStylesDir = Boolean(stylesDir && absolutePath.startsWith(stylesDir));
|
|
@@ -24614,13 +24820,13 @@ var init_fileWatcher = __esm(() => {
|
|
|
24614
24820
|
});
|
|
24615
24821
|
|
|
24616
24822
|
// src/dev/assetStore.ts
|
|
24617
|
-
import { resolve as
|
|
24823
|
+
import { resolve as resolve34 } from "path";
|
|
24618
24824
|
import { readdir as readdir4, unlink } from "fs/promises";
|
|
24619
24825
|
var mimeTypes, getMimeType = (filePath) => {
|
|
24620
24826
|
const ext = filePath.slice(filePath.lastIndexOf("."));
|
|
24621
24827
|
return mimeTypes[ext] ?? "application/octet-stream";
|
|
24622
24828
|
}, HASHED_FILE_RE, stripHash = (webPath) => webPath.replace(/\.[a-z0-9]{8}(\.(js|css|mjs))$/, "$1"), processWalkEntry = (entry, dir, liveByIdentity, walkAndClean) => {
|
|
24623
|
-
const fullPath =
|
|
24829
|
+
const fullPath = resolve34(dir, entry.name);
|
|
24624
24830
|
if (entry.isDirectory()) {
|
|
24625
24831
|
return walkAndClean(fullPath);
|
|
24626
24832
|
}
|
|
@@ -24636,10 +24842,10 @@ var mimeTypes, getMimeType = (filePath) => {
|
|
|
24636
24842
|
}, cleanStaleAssets = async (store, manifest, buildDir) => {
|
|
24637
24843
|
const liveByIdentity = new Map;
|
|
24638
24844
|
for (const webPath of store.keys()) {
|
|
24639
|
-
const diskPath =
|
|
24845
|
+
const diskPath = resolve34(buildDir, webPath.slice(1));
|
|
24640
24846
|
liveByIdentity.set(stripHash(diskPath), diskPath);
|
|
24641
24847
|
}
|
|
24642
|
-
const absBuildDir =
|
|
24848
|
+
const absBuildDir = resolve34(buildDir);
|
|
24643
24849
|
Object.values(manifest).forEach((val) => {
|
|
24644
24850
|
if (!HASHED_FILE_RE.test(val))
|
|
24645
24851
|
return;
|
|
@@ -24657,7 +24863,7 @@ var mimeTypes, getMimeType = (filePath) => {
|
|
|
24657
24863
|
} catch {}
|
|
24658
24864
|
}, lookupAsset = (store, path) => store.get(path), processScanEntry = (entry, dir, prefix, store, scanDir) => {
|
|
24659
24865
|
if (entry.isDirectory()) {
|
|
24660
|
-
return scanDir(
|
|
24866
|
+
return scanDir(resolve34(dir, entry.name), `${prefix}${entry.name}/`);
|
|
24661
24867
|
}
|
|
24662
24868
|
if (!entry.name.startsWith("chunk-")) {
|
|
24663
24869
|
return null;
|
|
@@ -24666,7 +24872,7 @@ var mimeTypes, getMimeType = (filePath) => {
|
|
|
24666
24872
|
if (store.has(webPath)) {
|
|
24667
24873
|
return null;
|
|
24668
24874
|
}
|
|
24669
|
-
return Bun.file(
|
|
24875
|
+
return Bun.file(resolve34(dir, entry.name)).bytes().then((bytes) => {
|
|
24670
24876
|
store.set(webPath, bytes);
|
|
24671
24877
|
return;
|
|
24672
24878
|
}).catch(() => {});
|
|
@@ -24688,7 +24894,7 @@ var mimeTypes, getMimeType = (filePath) => {
|
|
|
24688
24894
|
for (const webPath of newIdentities.values()) {
|
|
24689
24895
|
if (store.has(webPath))
|
|
24690
24896
|
continue;
|
|
24691
|
-
loadPromises.push(Bun.file(
|
|
24897
|
+
loadPromises.push(Bun.file(resolve34(buildDir, webPath.slice(1))).bytes().then((bytes) => {
|
|
24692
24898
|
store.set(webPath, bytes);
|
|
24693
24899
|
return;
|
|
24694
24900
|
}).catch(() => {}));
|
|
@@ -24733,8 +24939,8 @@ var init_assetStore = __esm(() => {
|
|
|
24733
24939
|
});
|
|
24734
24940
|
|
|
24735
24941
|
// src/islands/pageMetadata.ts
|
|
24736
|
-
import { readFileSync as
|
|
24737
|
-
import { dirname as dirname24, resolve as
|
|
24942
|
+
import { readFileSync as readFileSync27 } from "fs";
|
|
24943
|
+
import { dirname as dirname24, resolve as resolve35 } from "path";
|
|
24738
24944
|
var pagePatterns, getPageDirs = (config) => [
|
|
24739
24945
|
{ dir: config.angularDirectory, framework: "angular" },
|
|
24740
24946
|
{ dir: config.emberDirectory, framework: "ember" },
|
|
@@ -24754,15 +24960,15 @@ var pagePatterns, getPageDirs = (config) => [
|
|
|
24754
24960
|
const source = definition.buildReference?.source;
|
|
24755
24961
|
if (!source)
|
|
24756
24962
|
continue;
|
|
24757
|
-
const resolvedSource = source.startsWith("file://") ? new URL(source).pathname :
|
|
24758
|
-
lookup.set(`${definition.framework}:${definition.component}`,
|
|
24963
|
+
const resolvedSource = source.startsWith("file://") ? new URL(source).pathname : resolve35(dirname24(buildInfo.resolvedRegistryPath), source);
|
|
24964
|
+
lookup.set(`${definition.framework}:${definition.component}`, resolve35(resolvedSource));
|
|
24759
24965
|
}
|
|
24760
24966
|
return lookup;
|
|
24761
24967
|
}, getCurrentPageIslandMetadata = () => globalThis.__absolutePageIslandMetadata ?? new Map, metadataUsesSource = (metadata, target) => metadata.islands.some((usage) => {
|
|
24762
24968
|
const candidate = usage.source;
|
|
24763
|
-
return candidate ?
|
|
24969
|
+
return candidate ? resolve35(candidate) === target : false;
|
|
24764
24970
|
}), getPagesUsingIslandSource = (sourcePath) => {
|
|
24765
|
-
const target =
|
|
24971
|
+
const target = resolve35(sourcePath);
|
|
24766
24972
|
return [...getCurrentPageIslandMetadata().values()].filter((metadata) => metadataUsesSource(metadata, target)).map((metadata) => metadata.pagePath);
|
|
24767
24973
|
}, resolveIslandUsages = (islands, islandSourceLookup) => islands.map((usage) => {
|
|
24768
24974
|
const sourcePath = islandSourceLookup.get(`${usage.framework}:${usage.component}`);
|
|
@@ -24774,13 +24980,13 @@ var pagePatterns, getPageDirs = (config) => [
|
|
|
24774
24980
|
const pattern = pagePatterns[entry.framework];
|
|
24775
24981
|
if (!pattern)
|
|
24776
24982
|
return;
|
|
24777
|
-
const files = await scanEntryPoints(
|
|
24983
|
+
const files = await scanEntryPoints(resolve35(entry.dir), pattern);
|
|
24778
24984
|
for (const filePath of files) {
|
|
24779
|
-
const source =
|
|
24985
|
+
const source = readFileSync27(filePath, "utf-8");
|
|
24780
24986
|
const islands = extractIslandUsagesFromSource(source);
|
|
24781
|
-
pageMetadata.set(
|
|
24987
|
+
pageMetadata.set(resolve35(filePath), {
|
|
24782
24988
|
islands: resolveIslandUsages(islands, islandSourceLookup),
|
|
24783
|
-
pagePath:
|
|
24989
|
+
pagePath: resolve35(filePath)
|
|
24784
24990
|
});
|
|
24785
24991
|
}
|
|
24786
24992
|
}, loadPageIslandMetadata = async (config) => {
|
|
@@ -24807,10 +25013,10 @@ var init_pageMetadata = __esm(() => {
|
|
|
24807
25013
|
});
|
|
24808
25014
|
|
|
24809
25015
|
// src/dev/fileHashTracker.ts
|
|
24810
|
-
import { readFileSync as
|
|
25016
|
+
import { readFileSync as readFileSync28 } from "fs";
|
|
24811
25017
|
var computeFileHash = (filePath) => {
|
|
24812
25018
|
try {
|
|
24813
|
-
const fileContent =
|
|
25019
|
+
const fileContent = readFileSync28(filePath);
|
|
24814
25020
|
return Number(Bun.hash(fileContent));
|
|
24815
25021
|
} catch {
|
|
24816
25022
|
return UNFOUND_INDEX;
|
|
@@ -24903,9 +25109,9 @@ var init_transformCache = __esm(() => {
|
|
|
24903
25109
|
});
|
|
24904
25110
|
|
|
24905
25111
|
// src/dev/reactComponentClassifier.ts
|
|
24906
|
-
import { resolve as
|
|
25112
|
+
import { resolve as resolve36 } from "path";
|
|
24907
25113
|
var classifyComponent = (filePath) => {
|
|
24908
|
-
const normalizedPath =
|
|
25114
|
+
const normalizedPath = resolve36(filePath);
|
|
24909
25115
|
if (normalizedPath.includes("/react/pages/")) {
|
|
24910
25116
|
return "server";
|
|
24911
25117
|
}
|
|
@@ -24917,7 +25123,7 @@ var classifyComponent = (filePath) => {
|
|
|
24917
25123
|
var init_reactComponentClassifier = () => {};
|
|
24918
25124
|
|
|
24919
25125
|
// src/dev/moduleMapper.ts
|
|
24920
|
-
import { basename as basename15, resolve as
|
|
25126
|
+
import { basename as basename15, resolve as resolve37 } from "path";
|
|
24921
25127
|
var buildModulePaths = (moduleKeys, manifest) => {
|
|
24922
25128
|
const modulePaths = {};
|
|
24923
25129
|
moduleKeys.forEach((key) => {
|
|
@@ -24927,7 +25133,7 @@ var buildModulePaths = (moduleKeys, manifest) => {
|
|
|
24927
25133
|
});
|
|
24928
25134
|
return modulePaths;
|
|
24929
25135
|
}, processChangedFile = (sourceFile, framework, manifest, resolvedPaths, processedFiles) => {
|
|
24930
|
-
const normalizedFile =
|
|
25136
|
+
const normalizedFile = resolve37(sourceFile);
|
|
24931
25137
|
const normalizedPath = normalizedFile.replace(/\\/g, "/");
|
|
24932
25138
|
if (processedFiles.has(normalizedFile)) {
|
|
24933
25139
|
return null;
|
|
@@ -24963,7 +25169,7 @@ var buildModulePaths = (moduleKeys, manifest) => {
|
|
|
24963
25169
|
});
|
|
24964
25170
|
return grouped;
|
|
24965
25171
|
}, mapSourceFileToManifestKeys = (sourceFile, framework, resolvedPaths) => {
|
|
24966
|
-
const normalizedFile =
|
|
25172
|
+
const normalizedFile = resolve37(sourceFile);
|
|
24967
25173
|
const fileName = basename15(normalizedFile);
|
|
24968
25174
|
const baseName = fileName.replace(/\.(tsx?|jsx?|vue|svelte|css|html)$/, "");
|
|
24969
25175
|
const pascalName = toPascal(baseName);
|
|
@@ -25019,7 +25225,7 @@ var init_moduleMapper = __esm(() => {
|
|
|
25019
25225
|
|
|
25020
25226
|
// src/utils/spaRouteCss.ts
|
|
25021
25227
|
import { readFile as readFile6 } from "fs/promises";
|
|
25022
|
-
import { dirname as dirname25, isAbsolute as isAbsolute5, resolve as
|
|
25228
|
+
import { dirname as dirname25, isAbsolute as isAbsolute5, resolve as resolve38 } from "path";
|
|
25023
25229
|
var sideManifestCache, readSideManifest = async (sideManifestPath) => {
|
|
25024
25230
|
const cached = sideManifestCache.get(sideManifestPath);
|
|
25025
25231
|
if (cached !== undefined)
|
|
@@ -25057,7 +25263,7 @@ var sideManifestCache, readSideManifest = async (sideManifestPath) => {
|
|
|
25057
25263
|
}, readChildCss = async (cssPath, sideManifestPath) => {
|
|
25058
25264
|
if (!cssPath)
|
|
25059
25265
|
return "";
|
|
25060
|
-
const resolvedCssPath = isAbsolute5(cssPath) ? cssPath :
|
|
25266
|
+
const resolvedCssPath = isAbsolute5(cssPath) ? cssPath : resolve38(dirname25(sideManifestPath), cssPath);
|
|
25061
25267
|
const cached = childCssCache.get(resolvedCssPath);
|
|
25062
25268
|
if (cached !== undefined)
|
|
25063
25269
|
return cached;
|
|
@@ -25140,8 +25346,8 @@ __export(exports_resolveOwningComponents, {
|
|
|
25140
25346
|
resolveDescendantsOfParent: () => resolveDescendantsOfParent,
|
|
25141
25347
|
resolveOwningComponents: () => resolveOwningComponents
|
|
25142
25348
|
});
|
|
25143
|
-
import { readdirSync as readdirSync8, readFileSync as
|
|
25144
|
-
import { dirname as dirname26, extname as extname12, join as
|
|
25349
|
+
import { readdirSync as readdirSync8, readFileSync as readFileSync29, statSync as statSync5 } from "fs";
|
|
25350
|
+
import { dirname as dirname26, extname as extname12, join as join43, resolve as resolve39 } from "path";
|
|
25145
25351
|
import ts19 from "typescript";
|
|
25146
25352
|
var ENTITY_DECORATORS, isAngularSourceFile = (file4) => file4.endsWith(".ts") || file4.endsWith(".tsx"), walkAngularSourceFiles = (root) => {
|
|
25147
25353
|
const out = [];
|
|
@@ -25156,7 +25362,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file4) => file4.endsWith(".ts") ||
|
|
|
25156
25362
|
if (entry.name.startsWith(".") || entry.name === "node_modules") {
|
|
25157
25363
|
continue;
|
|
25158
25364
|
}
|
|
25159
|
-
const full =
|
|
25365
|
+
const full = join43(dir, entry.name);
|
|
25160
25366
|
if (entry.isDirectory()) {
|
|
25161
25367
|
visit(full);
|
|
25162
25368
|
} else if (entry.isFile() && isAngularSourceFile(entry.name)) {
|
|
@@ -25200,7 +25406,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file4) => file4.endsWith(".ts") ||
|
|
|
25200
25406
|
}, parseDecoratedClasses = (filePath) => {
|
|
25201
25407
|
let source;
|
|
25202
25408
|
try {
|
|
25203
|
-
source =
|
|
25409
|
+
source = readFileSync29(filePath, "utf8");
|
|
25204
25410
|
} catch {
|
|
25205
25411
|
return [];
|
|
25206
25412
|
}
|
|
@@ -25254,7 +25460,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file4) => file4.endsWith(".ts") ||
|
|
|
25254
25460
|
};
|
|
25255
25461
|
visit(sourceFile);
|
|
25256
25462
|
return out;
|
|
25257
|
-
}, safeNormalize = (path) =>
|
|
25463
|
+
}, safeNormalize = (path) => resolve39(path).replace(/\\/g, "/"), resolveOwningComponents = (params) => {
|
|
25258
25464
|
const { changedFilePath, userAngularRoot } = params;
|
|
25259
25465
|
const changedAbs = safeNormalize(changedFilePath);
|
|
25260
25466
|
const out = [];
|
|
@@ -25290,7 +25496,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file4) => file4.endsWith(".ts") ||
|
|
|
25290
25496
|
}, indexByRoot, resolveParentClassFile = (parentName, childFilePath, angularRoot) => {
|
|
25291
25497
|
let source;
|
|
25292
25498
|
try {
|
|
25293
|
-
source =
|
|
25499
|
+
source = readFileSync29(childFilePath, "utf8");
|
|
25294
25500
|
} catch {
|
|
25295
25501
|
return null;
|
|
25296
25502
|
}
|
|
@@ -25323,7 +25529,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file4) => file4.endsWith(".ts") ||
|
|
|
25323
25529
|
if (!spec.startsWith(".") && !spec.startsWith("/")) {
|
|
25324
25530
|
return null;
|
|
25325
25531
|
}
|
|
25326
|
-
const base =
|
|
25532
|
+
const base = resolve39(childDir, spec);
|
|
25327
25533
|
const candidates = [
|
|
25328
25534
|
`${base}.ts`,
|
|
25329
25535
|
`${base}.tsx`,
|
|
@@ -25361,7 +25567,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file4) => file4.endsWith(".ts") ||
|
|
|
25361
25567
|
};
|
|
25362
25568
|
if (cls.kind === "component") {
|
|
25363
25569
|
for (const url of [...cls.templateUrls, ...cls.styleUrls]) {
|
|
25364
|
-
const abs = safeNormalize(
|
|
25570
|
+
const abs = safeNormalize(resolve39(componentDir, url));
|
|
25365
25571
|
const existing = resource.get(abs);
|
|
25366
25572
|
if (existing)
|
|
25367
25573
|
existing.push(entity);
|
|
@@ -25627,7 +25833,7 @@ __export(exports_loadConfig, {
|
|
|
25627
25833
|
loadConfig: () => loadConfig,
|
|
25628
25834
|
loadRawConfig: () => loadRawConfig
|
|
25629
25835
|
});
|
|
25630
|
-
import { resolve as
|
|
25836
|
+
import { resolve as resolve40 } from "path";
|
|
25631
25837
|
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) => {
|
|
25632
25838
|
if (!isObject2(config)) {
|
|
25633
25839
|
return false;
|
|
@@ -25678,7 +25884,7 @@ var RESERVED_TOP_LEVEL_KEYS, isObject2 = (value) => typeof value === "object" &&
|
|
|
25678
25884
|
}
|
|
25679
25885
|
return config;
|
|
25680
25886
|
}, loadRawConfig = async (configPath2) => {
|
|
25681
|
-
const resolved =
|
|
25887
|
+
const resolved = resolve40(configPath2 ?? process.env.ABSOLUTE_CONFIG ?? "absolute.config.ts");
|
|
25682
25888
|
const mod = await import(resolved);
|
|
25683
25889
|
const config = mod.default ?? mod.config;
|
|
25684
25890
|
if (!config) {
|
|
@@ -25740,8 +25946,8 @@ __export(exports_moduleServer, {
|
|
|
25740
25946
|
warmCompilers: () => warmCompilers,
|
|
25741
25947
|
warnIfReactFastRefreshUnsupported: () => warnIfReactFastRefreshUnsupported
|
|
25742
25948
|
});
|
|
25743
|
-
import { existsSync as
|
|
25744
|
-
import { basename as basename16, dirname as dirname27, extname as extname13, join as
|
|
25949
|
+
import { existsSync as existsSync34, readFileSync as readFileSync30, realpathSync as realpathSync3, statSync as statSync6 } from "fs";
|
|
25950
|
+
import { basename as basename16, dirname as dirname27, extname as extname13, join as join44, resolve as resolve41, relative as relative17 } from "path";
|
|
25745
25951
|
var SRC_PREFIX = "/@src/", BROWSER_DEFINE, jsTranspiler2, legacyDecoratorTsconfig, tsTranspiler2, tsxTranspiler, TRANSPILABLE, ALL_EXPORTS_RE, STRING_CONTENTS_RE, preserveTypeExports = (originalSource, transpiled, valueExports) => {
|
|
25746
25952
|
const codeOnly = originalSource.replace(STRING_CONTENTS_RE, '""');
|
|
25747
25953
|
const allExports = [];
|
|
@@ -25761,10 +25967,10 @@ var SRC_PREFIX = "/@src/", BROWSER_DEFINE, jsTranspiler2, legacyDecoratorTsconfi
|
|
|
25761
25967
|
${stubs}
|
|
25762
25968
|
`;
|
|
25763
25969
|
}, resolveRelativeExtension = (srcPath, projectRoot, extensions) => {
|
|
25764
|
-
const directHit = extensions.find((ext) =>
|
|
25970
|
+
const directHit = extensions.find((ext) => existsSync34(resolve41(projectRoot, srcPath + ext)));
|
|
25765
25971
|
if (directHit)
|
|
25766
25972
|
return srcPath + directHit;
|
|
25767
|
-
const indexHit = extensions.find((ext) =>
|
|
25973
|
+
const indexHit = extensions.find((ext) => existsSync34(resolve41(projectRoot, srcPath, `index${ext}`)));
|
|
25768
25974
|
if (indexHit)
|
|
25769
25975
|
return `${srcPath}/index${indexHit}`;
|
|
25770
25976
|
return srcPath;
|
|
@@ -25787,7 +25993,7 @@ ${stubs}
|
|
|
25787
25993
|
return invalidationVersion > 0 ? `${mtime}.${invalidationVersion}` : `${mtime}`;
|
|
25788
25994
|
}, srcUrl = (relPath, projectRoot) => {
|
|
25789
25995
|
const base = `${SRC_PREFIX}${relPath.replace(/\\/g, "/")}`;
|
|
25790
|
-
const absPath =
|
|
25996
|
+
const absPath = resolve41(projectRoot, relPath);
|
|
25791
25997
|
const cached = mtimeCache.get(absPath);
|
|
25792
25998
|
if (cached !== undefined)
|
|
25793
25999
|
return `${base}?v=${buildVersion(cached, absPath)}`;
|
|
@@ -25799,12 +26005,12 @@ ${stubs}
|
|
|
25799
26005
|
return base;
|
|
25800
26006
|
}
|
|
25801
26007
|
}, resolveRelativeImport = (relPath, fileDir, projectRoot, extensions) => {
|
|
25802
|
-
const absPath =
|
|
26008
|
+
const absPath = resolve41(fileDir, relPath);
|
|
25803
26009
|
const rel = relative17(projectRoot, absPath);
|
|
25804
26010
|
const extension = extname13(rel);
|
|
25805
26011
|
let srcPath = RESOLVED_MODULE_EXTENSIONS.has(extension) ? rel : resolveRelativeExtension(rel, projectRoot, extensions);
|
|
25806
26012
|
if (extname13(srcPath) === ".svelte") {
|
|
25807
|
-
srcPath = relative17(projectRoot, resolveSvelteModulePath(
|
|
26013
|
+
srcPath = relative17(projectRoot, resolveSvelteModulePath(resolve41(projectRoot, srcPath)));
|
|
25808
26014
|
}
|
|
25809
26015
|
return srcUrl(srcPath, projectRoot);
|
|
25810
26016
|
}, NODE_BUILTIN_RE, resolveAbsoluteSpecifier = (specifier, projectRoot) => {
|
|
@@ -25823,14 +26029,14 @@ ${stubs}
|
|
|
25823
26029
|
const packageName = isScoped ? `${parts[0]}/${parts[1]}` : parts[0];
|
|
25824
26030
|
const subpath = isScoped ? parts.slice(2).join("/") : parts.slice(1).join("/");
|
|
25825
26031
|
if (!subpath) {
|
|
25826
|
-
const pkgDir =
|
|
25827
|
-
const pkgJsonPath =
|
|
25828
|
-
if (
|
|
25829
|
-
const pkg = JSON.parse(
|
|
26032
|
+
const pkgDir = resolve41(projectRoot, "node_modules", packageName ?? "");
|
|
26033
|
+
const pkgJsonPath = join44(pkgDir, "package.json");
|
|
26034
|
+
if (existsSync34(pkgJsonPath)) {
|
|
26035
|
+
const pkg = JSON.parse(readFileSync30(pkgJsonPath, "utf-8"));
|
|
25830
26036
|
const esmEntry = typeof pkg.module === "string" && pkg.module || typeof pkg.browser === "string" && pkg.browser;
|
|
25831
26037
|
if (esmEntry) {
|
|
25832
|
-
const resolved =
|
|
25833
|
-
if (
|
|
26038
|
+
const resolved = resolve41(pkgDir, esmEntry);
|
|
26039
|
+
if (existsSync34(resolved))
|
|
25834
26040
|
return relative17(projectRoot, resolved);
|
|
25835
26041
|
}
|
|
25836
26042
|
}
|
|
@@ -25882,12 +26088,12 @@ ${stubs}
|
|
|
25882
26088
|
result = result.replace(/((?:from|import)\s*["'])(\/[^"']+\.(tsx?|jsx?|ts))(["'])/g, rewriteAbsoluteToSrc);
|
|
25883
26089
|
result = result.replace(/(import\s*\(\s*["'])(\/[^"']+\.(tsx?|jsx?|ts))(["']\s*\))/g, rewriteAbsoluteToSrc);
|
|
25884
26090
|
result = result.replace(/new\s+URL\(\s*["'](\.\.?\/[^"']+)["']\s*,\s*import\.meta\.url\s*\)/g, (_match, relPath) => {
|
|
25885
|
-
const absPath =
|
|
26091
|
+
const absPath = resolve41(fileDir, relPath);
|
|
25886
26092
|
const rel = relative17(projectRoot, absPath);
|
|
25887
26093
|
return `new URL('${srcUrl(rel, projectRoot)}', import.meta.url)`;
|
|
25888
26094
|
});
|
|
25889
26095
|
result = result.replace(/import\.meta\.resolve\(\s*["'](\.\.?\/[^"']+)["']\s*\)/g, (_match, relPath) => {
|
|
25890
|
-
const absPath =
|
|
26096
|
+
const absPath = resolve41(fileDir, relPath);
|
|
25891
26097
|
const rel = relative17(projectRoot, absPath);
|
|
25892
26098
|
return `'${srcUrl(rel, projectRoot)}'`;
|
|
25893
26099
|
});
|
|
@@ -25933,7 +26139,7 @@ ${code}`;
|
|
|
25933
26139
|
reactFastRefreshWarningEmitted = true;
|
|
25934
26140
|
logWarn("React HMR is blocked: this Bun build ignores " + "`reactFastRefresh` on Bun.Transpiler, so component state " + "cannot be preserved across edits. Tracking " + "https://github.com/oven-sh/bun/pull/28312 \u2014 if it still has " + "not merged, leave a \uD83D\uDC4D on the PR so the Bun team knows it " + "is blocking you. Until then, React edits trigger a targeted " + "page remount instead of a state-preserving fast refresh.");
|
|
25935
26141
|
}, transformReactFile = (filePath, projectRoot, rewriter) => {
|
|
25936
|
-
const raw =
|
|
26142
|
+
const raw = readFileSync30(filePath, "utf-8");
|
|
25937
26143
|
const valueExports = tsxTranspiler.scan(raw).exports;
|
|
25938
26144
|
let transpiled = reactTranspiler.transformSync(raw);
|
|
25939
26145
|
transpiled = preserveTypeExports(raw, transpiled, valueExports);
|
|
@@ -25949,7 +26155,7 @@ ${transpiled}`;
|
|
|
25949
26155
|
transpiled += buildIslandMetadataExports(raw);
|
|
25950
26156
|
return rewriteImports(transpiled, filePath, projectRoot, rewriter);
|
|
25951
26157
|
}, transformPlainFile = (filePath, projectRoot, rewriter, vueDir) => {
|
|
25952
|
-
const raw =
|
|
26158
|
+
const raw = readFileSync30(filePath, "utf-8");
|
|
25953
26159
|
const ext = extname13(filePath);
|
|
25954
26160
|
const isTS = ext === ".ts" || ext === ".tsx";
|
|
25955
26161
|
const isTSX = ext === ".tsx" || ext === ".jsx";
|
|
@@ -26115,7 +26321,7 @@ ${code}`;
|
|
|
26115
26321
|
` + ` var __hmr_accept = function(cb) { window.__SVELTE_HMR_ACCEPT__[${JSON.stringify(moduleUrl)}] = cb; };`);
|
|
26116
26322
|
return code.replace(/import\.meta\.hot\.accept\(/g, "__hmr_accept(");
|
|
26117
26323
|
}, transformSvelteFile = async (filePath, projectRoot, rewriter, stylePreprocessors) => {
|
|
26118
|
-
const raw =
|
|
26324
|
+
const raw = readFileSync30(filePath, "utf-8");
|
|
26119
26325
|
if (!svelteCompiler) {
|
|
26120
26326
|
svelteCompiler = await import("svelte/compiler");
|
|
26121
26327
|
}
|
|
@@ -26181,7 +26387,7 @@ export default __script__;`;
|
|
|
26181
26387
|
return `${cssInjection}
|
|
26182
26388
|
${code}`;
|
|
26183
26389
|
}, transformVueFile = async (filePath, projectRoot, rewriter, vueDir, stylePreprocessors) => {
|
|
26184
|
-
const rawSource =
|
|
26390
|
+
const rawSource = readFileSync30(filePath, "utf-8");
|
|
26185
26391
|
const raw = addAutoRouterSetupApp(rawSource);
|
|
26186
26392
|
if (!vueCompiler) {
|
|
26187
26393
|
vueCompiler = await loadVueCompiler();
|
|
@@ -26192,9 +26398,9 @@ ${code}`;
|
|
|
26192
26398
|
const hasScript = descriptor.script || descriptor.scriptSetup;
|
|
26193
26399
|
const compiledScript = hasScript ? vueCompiler.compileScript(descriptor, {
|
|
26194
26400
|
fs: {
|
|
26195
|
-
fileExists:
|
|
26401
|
+
fileExists: existsSync34,
|
|
26196
26402
|
realpath: realpathSync3,
|
|
26197
|
-
readFile: (file4) =>
|
|
26403
|
+
readFile: (file4) => existsSync34(file4) ? readFileSync30(file4, "utf-8") : undefined
|
|
26198
26404
|
},
|
|
26199
26405
|
id: componentId,
|
|
26200
26406
|
inlineTemplate: false
|
|
@@ -26209,7 +26415,7 @@ ${code}`;
|
|
|
26209
26415
|
code = injectVueHmr(code, filePath, projectRoot, vueDir);
|
|
26210
26416
|
return rewriteImports(code, filePath, projectRoot, rewriter);
|
|
26211
26417
|
}, injectVueHmr = (code, filePath, projectRoot, vueDir) => {
|
|
26212
|
-
const hmrBase = vueDir ?
|
|
26418
|
+
const hmrBase = vueDir ? resolve41(vueDir) : projectRoot;
|
|
26213
26419
|
const hmrId = relative17(hmrBase, filePath).replace(/\\/g, "/").replace(/\.vue$/, "");
|
|
26214
26420
|
let result = code.replace(/export\s+default\s+/, "var __hmr_comp__ = ");
|
|
26215
26421
|
result += [
|
|
@@ -26224,11 +26430,11 @@ ${code}`;
|
|
|
26224
26430
|
`);
|
|
26225
26431
|
return result;
|
|
26226
26432
|
}, resolveSvelteModulePath = (path) => {
|
|
26227
|
-
if (
|
|
26433
|
+
if (existsSync34(path))
|
|
26228
26434
|
return path;
|
|
26229
|
-
if (
|
|
26435
|
+
if (existsSync34(`${path}.ts`))
|
|
26230
26436
|
return `${path}.ts`;
|
|
26231
|
-
if (
|
|
26437
|
+
if (existsSync34(`${path}.js`))
|
|
26232
26438
|
return `${path}.js`;
|
|
26233
26439
|
return path;
|
|
26234
26440
|
}, jsResponse = (body) => {
|
|
@@ -26241,7 +26447,7 @@ ${code}`;
|
|
|
26241
26447
|
}
|
|
26242
26448
|
});
|
|
26243
26449
|
}, handleCssRequest = (filePath) => {
|
|
26244
|
-
const raw =
|
|
26450
|
+
const raw = readFileSync30(filePath, "utf-8");
|
|
26245
26451
|
const escaped = raw.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$/g, "\\$");
|
|
26246
26452
|
return [
|
|
26247
26453
|
`const style = document.createElement('style');`,
|
|
@@ -26373,13 +26579,13 @@ export default {};
|
|
|
26373
26579
|
const escaped = virtualCss.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$/g, "\\$");
|
|
26374
26580
|
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);`);
|
|
26375
26581
|
}, resolveSourcePath = (relPath, projectRoot) => {
|
|
26376
|
-
const filePath =
|
|
26582
|
+
const filePath = resolve41(projectRoot, relPath);
|
|
26377
26583
|
const ext = extname13(filePath);
|
|
26378
26584
|
if (ext === ".svelte")
|
|
26379
26585
|
return { ext, filePath: resolveSvelteModulePath(filePath) };
|
|
26380
26586
|
if (ext)
|
|
26381
26587
|
return { ext, filePath };
|
|
26382
|
-
const found = MODULE_EXTENSIONS.find((candidate) =>
|
|
26588
|
+
const found = MODULE_EXTENSIONS.find((candidate) => existsSync34(filePath + candidate));
|
|
26383
26589
|
if (!found)
|
|
26384
26590
|
return { ext, filePath };
|
|
26385
26591
|
const resolved = filePath + found;
|
|
@@ -26410,14 +26616,14 @@ export default {};
|
|
|
26410
26616
|
const absoluteCandidate = `/${tail.replace(/^\/+/, "")}`;
|
|
26411
26617
|
const candidates = [
|
|
26412
26618
|
absoluteCandidate,
|
|
26413
|
-
|
|
26619
|
+
resolve41(projectRoot, tail)
|
|
26414
26620
|
];
|
|
26415
26621
|
try {
|
|
26416
26622
|
const { loadConfig: loadConfig2 } = await Promise.resolve().then(() => (init_loadConfig(), exports_loadConfig));
|
|
26417
26623
|
const cfg = await loadConfig2();
|
|
26418
|
-
const angularDir = cfg.angularDirectory &&
|
|
26624
|
+
const angularDir = cfg.angularDirectory && resolve41(projectRoot, cfg.angularDirectory);
|
|
26419
26625
|
if (angularDir)
|
|
26420
|
-
candidates.push(
|
|
26626
|
+
candidates.push(resolve41(angularDir, tail));
|
|
26421
26627
|
} catch {}
|
|
26422
26628
|
for (const candidate of candidates) {
|
|
26423
26629
|
if (await fileExists(candidate)) {
|
|
@@ -26448,7 +26654,7 @@ export default {};
|
|
|
26448
26654
|
if (!TRANSPILABLE.has(ext))
|
|
26449
26655
|
return;
|
|
26450
26656
|
const stat3 = statSync6(filePath);
|
|
26451
|
-
const resolvedVueDir = vueDir ?
|
|
26657
|
+
const resolvedVueDir = vueDir ? resolve41(vueDir) : undefined;
|
|
26452
26658
|
let content = REACT_EXTENSIONS.has(ext) ? transformReactFile(filePath, projectRoot, rewriter) : transformPlainFile(filePath, projectRoot, rewriter, resolvedVueDir);
|
|
26453
26659
|
const isAngularGeneratedJs = ext === ".js" && filePath.replace(/\\/g, "/").includes("/.absolutejs/generated/angular/");
|
|
26454
26660
|
if (isAngularGeneratedJs) {
|
|
@@ -26507,7 +26713,7 @@ export default {};
|
|
|
26507
26713
|
const relPath = pathname.slice(SRC_PREFIX.length);
|
|
26508
26714
|
if (relPath === "bun:wrap" || relPath.startsWith("bun:wrap?"))
|
|
26509
26715
|
return handleBunWrapRequest();
|
|
26510
|
-
const virtualCssResponse = handleVirtualSvelteCss(
|
|
26716
|
+
const virtualCssResponse = handleVirtualSvelteCss(resolve41(projectRoot, relPath));
|
|
26511
26717
|
if (virtualCssResponse)
|
|
26512
26718
|
return virtualCssResponse;
|
|
26513
26719
|
const { filePath, ext } = resolveSourcePath(relPath, projectRoot);
|
|
@@ -26523,11 +26729,11 @@ export default {};
|
|
|
26523
26729
|
SRC_IMPORT_RE.lastIndex = 0;
|
|
26524
26730
|
while ((match = SRC_IMPORT_RE.exec(content)) !== null) {
|
|
26525
26731
|
if (match[1])
|
|
26526
|
-
files.push(
|
|
26732
|
+
files.push(resolve41(projectRoot, match[1]));
|
|
26527
26733
|
}
|
|
26528
26734
|
return files;
|
|
26529
26735
|
}, invalidateModule = (filePath) => {
|
|
26530
|
-
const resolved =
|
|
26736
|
+
const resolved = resolve41(filePath);
|
|
26531
26737
|
invalidate(filePath);
|
|
26532
26738
|
if (resolved !== filePath)
|
|
26533
26739
|
invalidate(resolved);
|
|
@@ -26690,7 +26896,7 @@ __export(exports_hmrCompiler, {
|
|
|
26690
26896
|
encodeHmrComponentId: () => encodeHmrComponentId,
|
|
26691
26897
|
getApplyMetadataModule: () => getApplyMetadataModule
|
|
26692
26898
|
});
|
|
26693
|
-
import { dirname as dirname28, relative as relative18, resolve as
|
|
26899
|
+
import { dirname as dirname28, relative as relative18, resolve as resolve42 } from "path";
|
|
26694
26900
|
import { performance as performance2 } from "perf_hooks";
|
|
26695
26901
|
var encodeHmrComponentId = (absoluteFilePath, className) => {
|
|
26696
26902
|
const projectRel = relative18(process.cwd(), absoluteFilePath).replace(/\\/g, "/");
|
|
@@ -26702,7 +26908,7 @@ var encodeHmrComponentId = (absoluteFilePath, className) => {
|
|
|
26702
26908
|
return null;
|
|
26703
26909
|
const filePathRel = decoded.slice(0, separatorIndex);
|
|
26704
26910
|
const className = decoded.slice(separatorIndex + 1);
|
|
26705
|
-
const componentFilePath =
|
|
26911
|
+
const componentFilePath = resolve42(process.cwd(), filePathRel);
|
|
26706
26912
|
const projectRelPath = relative18(process.cwd(), componentFilePath).replace(/\\/g, "/");
|
|
26707
26913
|
const cacheKey2 = encodeURIComponent(`${projectRelPath}@${className}`);
|
|
26708
26914
|
const { takePendingModule: takePendingModule2 } = await Promise.resolve().then(() => (init_fastHmrCompiler(), exports_fastHmrCompiler));
|
|
@@ -26731,13 +26937,13 @@ var init_hmrCompiler = __esm(() => {
|
|
|
26731
26937
|
});
|
|
26732
26938
|
|
|
26733
26939
|
// src/core/pageResponseCache.ts
|
|
26734
|
-
import { createHash as
|
|
26940
|
+
import { createHash as createHash5 } from "crypto";
|
|
26735
26941
|
var STREAMING_PAGE_HEADER = "x-absolute-stream", HTML_CONTENT_TYPE = "text/html", streamingPageHeaders = (extra) => {
|
|
26736
26942
|
const headers = new Headers(extra);
|
|
26737
26943
|
headers.set("content-type", HTML_CONTENT_TYPE);
|
|
26738
26944
|
headers.set(STREAMING_PAGE_HEADER, "1");
|
|
26739
26945
|
return headers;
|
|
26740
|
-
}, computeEtag = (html) => `W/"${
|
|
26946
|
+
}, computeEtag = (html) => `W/"${createHash5("sha1").update(html).digest("base64url")}"`, withPageCacheHeaders = async (response, request, options) => {
|
|
26741
26947
|
const contentType = response.headers.get("content-type") ?? "";
|
|
26742
26948
|
if (!contentType.includes(HTML_CONTENT_TYPE))
|
|
26743
26949
|
return response;
|
|
@@ -26909,11 +27115,11 @@ var exports_simpleHTMLHMR = {};
|
|
|
26909
27115
|
__export(exports_simpleHTMLHMR, {
|
|
26910
27116
|
handleHTMLUpdate: () => handleHTMLUpdate
|
|
26911
27117
|
});
|
|
26912
|
-
import { resolve as
|
|
27118
|
+
import { resolve as resolve43 } from "path";
|
|
26913
27119
|
var handleHTMLUpdate = async (htmlFilePath) => {
|
|
26914
27120
|
let htmlContent;
|
|
26915
27121
|
try {
|
|
26916
|
-
const resolvedPath =
|
|
27122
|
+
const resolvedPath = resolve43(htmlFilePath);
|
|
26917
27123
|
const file4 = Bun.file(resolvedPath);
|
|
26918
27124
|
if (!await file4.exists()) {
|
|
26919
27125
|
return null;
|
|
@@ -26939,11 +27145,11 @@ var exports_simpleHTMXHMR = {};
|
|
|
26939
27145
|
__export(exports_simpleHTMXHMR, {
|
|
26940
27146
|
handleHTMXUpdate: () => handleHTMXUpdate
|
|
26941
27147
|
});
|
|
26942
|
-
import { resolve as
|
|
27148
|
+
import { resolve as resolve44 } from "path";
|
|
26943
27149
|
var handleHTMXUpdate = async (htmxFilePath) => {
|
|
26944
27150
|
let htmlContent;
|
|
26945
27151
|
try {
|
|
26946
|
-
const resolvedPath =
|
|
27152
|
+
const resolvedPath = resolve44(htmxFilePath);
|
|
26947
27153
|
const file4 = Bun.file(resolvedPath);
|
|
26948
27154
|
if (!await file4.exists()) {
|
|
26949
27155
|
return null;
|
|
@@ -26965,12 +27171,12 @@ var handleHTMXUpdate = async (htmxFilePath) => {
|
|
|
26965
27171
|
var init_simpleHTMXHMR = () => {};
|
|
26966
27172
|
|
|
26967
27173
|
// src/dev/rebuildTrigger.ts
|
|
26968
|
-
import { existsSync as
|
|
27174
|
+
import { existsSync as existsSync35, readdirSync as readdirSync9, rmSync as rmSync3 } from "fs";
|
|
26969
27175
|
import {
|
|
26970
27176
|
basename as basename17,
|
|
26971
27177
|
dirname as dirname29,
|
|
26972
27178
|
isAbsolute as isAbsolute6,
|
|
26973
|
-
join as
|
|
27179
|
+
join as join45,
|
|
26974
27180
|
relative as relative19,
|
|
26975
27181
|
resolve as resolvePath,
|
|
26976
27182
|
sep as sep4
|
|
@@ -27079,7 +27285,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
27079
27285
|
detectedFw = detected !== "ignored" ? detected : affectedFrameworks[0];
|
|
27080
27286
|
}
|
|
27081
27287
|
return { ...parsed, framework: detectedFw };
|
|
27082
|
-
}, isValidDeletedAffectedFile = (affectedFile, deletedPathResolved, processedFiles) => affectedFile !== deletedPathResolved && !processedFiles.has(affectedFile) &&
|
|
27288
|
+
}, isValidDeletedAffectedFile = (affectedFile, deletedPathResolved, processedFiles) => affectedFile !== deletedPathResolved && !processedFiles.has(affectedFile) && existsSync35(affectedFile), FRAMEWORK_DIR_KEYS_FOR_CLEANUP, removeStaleGenerated = (state, deletedFile) => {
|
|
27083
27289
|
const { config } = state;
|
|
27084
27290
|
const cwd2 = process.cwd();
|
|
27085
27291
|
const absDeleted = resolvePath(deletedFile).replace(/\\/g, "/");
|
|
@@ -27097,8 +27303,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
27097
27303
|
const relJs = `${rel.slice(0, -ext[0].length)}.js`;
|
|
27098
27304
|
const generatedDir = getFrameworkGeneratedDir(framework, cwd2);
|
|
27099
27305
|
for (const candidate of [
|
|
27100
|
-
|
|
27101
|
-
`${
|
|
27306
|
+
join45(generatedDir, relJs),
|
|
27307
|
+
`${join45(generatedDir, relJs)}.map`
|
|
27102
27308
|
]) {
|
|
27103
27309
|
try {
|
|
27104
27310
|
rmSync3(candidate, { force: true });
|
|
@@ -27125,7 +27331,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
27125
27331
|
if (!dependents || dependents.size === 0) {
|
|
27126
27332
|
return;
|
|
27127
27333
|
}
|
|
27128
|
-
const dependentFiles = Array.from(dependents).filter((file4) =>
|
|
27334
|
+
const dependentFiles = Array.from(dependents).filter((file4) => existsSync35(file4));
|
|
27129
27335
|
if (dependentFiles.length === 0) {
|
|
27130
27336
|
return;
|
|
27131
27337
|
}
|
|
@@ -27141,7 +27347,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
27141
27347
|
try {
|
|
27142
27348
|
const affectedFiles = getAffectedFiles(state.dependencyGraph, normalizedFilePath);
|
|
27143
27349
|
affectedFiles.forEach((affectedFile) => {
|
|
27144
|
-
if (!processedFiles.has(affectedFile) && affectedFile !== normalizedFilePath &&
|
|
27350
|
+
if (!processedFiles.has(affectedFile) && affectedFile !== normalizedFilePath && existsSync35(affectedFile)) {
|
|
27145
27351
|
validFiles.push(affectedFile);
|
|
27146
27352
|
processedFiles.add(affectedFile);
|
|
27147
27353
|
}
|
|
@@ -27166,7 +27372,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
27166
27372
|
collectChangedFileAffected(state, normalizedFilePath, processedFiles, validFiles);
|
|
27167
27373
|
}, processFilePathSet = (state, filePathSet, processedFiles, validFiles) => {
|
|
27168
27374
|
filePathSet.forEach((filePathInSet) => {
|
|
27169
|
-
if (!
|
|
27375
|
+
if (!existsSync35(filePathInSet)) {
|
|
27170
27376
|
collectDeletedFileAffected(state, filePathInSet, processedFiles, validFiles);
|
|
27171
27377
|
return;
|
|
27172
27378
|
}
|
|
@@ -27431,7 +27637,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
27431
27637
|
return componentFile;
|
|
27432
27638
|
}
|
|
27433
27639
|
const tsCounterpart = componentFile.replace(/\.html$/, ".ts");
|
|
27434
|
-
if (
|
|
27640
|
+
if (existsSync35(tsCounterpart)) {
|
|
27435
27641
|
return tsCounterpart;
|
|
27436
27642
|
}
|
|
27437
27643
|
if (!graph)
|
|
@@ -27881,8 +28087,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
27881
28087
|
};
|
|
27882
28088
|
return ({ immediate = false } = {}) => {
|
|
27883
28089
|
if (!ctx.debouncedPromise) {
|
|
27884
|
-
ctx.debouncedPromise = new Promise((
|
|
27885
|
-
ctx.debouncedResolve =
|
|
28090
|
+
ctx.debouncedPromise = new Promise((resolve45) => {
|
|
28091
|
+
ctx.debouncedResolve = resolve45;
|
|
27886
28092
|
});
|
|
27887
28093
|
}
|
|
27888
28094
|
const scheduled = ctx.debouncedPromise;
|
|
@@ -28004,7 +28210,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
28004
28210
|
const entries = await readdir5(dir, { withFileTypes: true });
|
|
28005
28211
|
const files = [];
|
|
28006
28212
|
for (const entry of entries) {
|
|
28007
|
-
const full =
|
|
28213
|
+
const full = join45(dir, entry.name);
|
|
28008
28214
|
if (entry.isDirectory()) {
|
|
28009
28215
|
files.push(...await walk(full));
|
|
28010
28216
|
} else if (entry.isFile() && entry.name.endsWith(".ts") && !entry.name.endsWith(".d.ts")) {
|
|
@@ -28301,7 +28507,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
28301
28507
|
}
|
|
28302
28508
|
return ctx;
|
|
28303
28509
|
}, runSvelteBundleRebuild = async (state, svelteFiles, config) => {
|
|
28304
|
-
const existingSvelteFiles = svelteFiles.filter((file4) =>
|
|
28510
|
+
const existingSvelteFiles = svelteFiles.filter((file4) => existsSync35(file4));
|
|
28305
28511
|
if (existingSvelteFiles.length === 0)
|
|
28306
28512
|
return;
|
|
28307
28513
|
const svelteDir = config.svelteDirectory ?? "";
|
|
@@ -28417,8 +28623,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
28417
28623
|
};
|
|
28418
28624
|
return () => {
|
|
28419
28625
|
if (!ctx.debouncedPromise) {
|
|
28420
|
-
ctx.debouncedPromise = new Promise((
|
|
28421
|
-
ctx.debouncedResolve =
|
|
28626
|
+
ctx.debouncedPromise = new Promise((resolve45) => {
|
|
28627
|
+
ctx.debouncedResolve = resolve45;
|
|
28422
28628
|
});
|
|
28423
28629
|
}
|
|
28424
28630
|
if (ctx.debounceTimer)
|
|
@@ -28567,7 +28773,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
28567
28773
|
} = await compileVue2(vueFiles, vueDir, true, getStyleTransformConfig(state.config));
|
|
28568
28774
|
const serverEntries = [...vueServerPaths];
|
|
28569
28775
|
const clientEntries = [...vueIndexPaths, ...vueClientPaths];
|
|
28570
|
-
const cssOutDir =
|
|
28776
|
+
const cssOutDir = join45(buildDir, state.resolvedPaths.assetsDir ? basename17(state.resolvedPaths.assetsDir) : "assets", "css");
|
|
28571
28777
|
const { serverRoot, serverOutDir } = await computeServerOutPaths(state.resolvedPaths, "vue");
|
|
28572
28778
|
const serverExternals = await getServerBundleExternals();
|
|
28573
28779
|
const clientVendorPaths = await getClientVendorPaths();
|
|
@@ -28695,8 +28901,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
28695
28901
|
};
|
|
28696
28902
|
return () => {
|
|
28697
28903
|
if (!ctx.debouncedPromise) {
|
|
28698
|
-
ctx.debouncedPromise = new Promise((
|
|
28699
|
-
ctx.debouncedResolve =
|
|
28904
|
+
ctx.debouncedPromise = new Promise((resolve45) => {
|
|
28905
|
+
ctx.debouncedResolve = resolve45;
|
|
28700
28906
|
});
|
|
28701
28907
|
}
|
|
28702
28908
|
if (ctx.debounceTimer)
|
|
@@ -29652,24 +29858,35 @@ var init_rebuildTrigger = __esm(() => {
|
|
|
29652
29858
|
STYLE_FILE_EXT_RE = /\.(?:css|scss|sass|less|styl|stylus)$/i;
|
|
29653
29859
|
});
|
|
29654
29860
|
|
|
29655
|
-
// src/
|
|
29656
|
-
var
|
|
29657
|
-
|
|
29658
|
-
|
|
29659
|
-
|
|
29660
|
-
|
|
29661
|
-
|
|
29662
|
-
|
|
29663
|
-
|
|
29664
|
-
},
|
|
29665
|
-
if (
|
|
29861
|
+
// src/dev/bootLifecycle.ts
|
|
29862
|
+
var DEFERRED_TASK_FALLBACK_SECONDS = 15, setBootPhase = (phase) => {
|
|
29863
|
+
globalThis.__absoluteBootPhase = phase;
|
|
29864
|
+
}, runTask = async (task) => {
|
|
29865
|
+
try {
|
|
29866
|
+
await task();
|
|
29867
|
+
} catch (error) {
|
|
29868
|
+
console.error(`[dev] deferred boot task failed: ${error instanceof Error ? error.message : String(error)}`);
|
|
29869
|
+
}
|
|
29870
|
+
}, deferUntilServing = (task) => {
|
|
29871
|
+
if (globalThis.__absoluteDeferredBootTasksRan) {
|
|
29872
|
+
runTask(task);
|
|
29666
29873
|
return;
|
|
29667
29874
|
}
|
|
29668
|
-
|
|
29875
|
+
const queue = globalThis.__absoluteDeferredBootTasks ?? [];
|
|
29876
|
+
globalThis.__absoluteDeferredBootTasks = queue;
|
|
29877
|
+
queue.push(task);
|
|
29878
|
+
const timer = setTimeout(runDeferredBootTasks, DEFERRED_TASK_FALLBACK_SECONDS * MILLISECONDS_IN_A_SECOND);
|
|
29879
|
+
if (typeof timer === "object" && "unref" in timer)
|
|
29880
|
+
timer.unref();
|
|
29881
|
+
}, runDeferredBootTasks = () => {
|
|
29882
|
+
const tasks = globalThis.__absoluteDeferredBootTasks ?? [];
|
|
29883
|
+
globalThis.__absoluteDeferredBootTasks = [];
|
|
29884
|
+
globalThis.__absoluteDeferredBootTasksRan = true;
|
|
29885
|
+
for (const task of tasks)
|
|
29886
|
+
runTask(task);
|
|
29669
29887
|
};
|
|
29670
|
-
var
|
|
29671
|
-
|
|
29672
|
-
startupTimingsEnabled = process.env.ABSOLUTE_STARTUP_TIMINGS === "1" || process.env.ABSOLUTE_STARTUP_TIMINGS === "true";
|
|
29888
|
+
var init_bootLifecycle = __esm(() => {
|
|
29889
|
+
init_constants();
|
|
29673
29890
|
});
|
|
29674
29891
|
|
|
29675
29892
|
// src/build/buildDepVendor.ts
|
|
@@ -29678,9 +29895,9 @@ __export(exports_buildDepVendor, {
|
|
|
29678
29895
|
buildDepVendor: () => buildDepVendor,
|
|
29679
29896
|
computeDepVendorPaths: () => computeDepVendorPaths
|
|
29680
29897
|
});
|
|
29681
|
-
import { mkdirSync as
|
|
29898
|
+
import { mkdirSync as mkdirSync15 } from "fs";
|
|
29682
29899
|
import { isBuiltin } from "module";
|
|
29683
|
-
import { join as
|
|
29900
|
+
import { join as join46 } from "path";
|
|
29684
29901
|
import { rm as rm11 } from "fs/promises";
|
|
29685
29902
|
var {build: bunBuild9, Glob: Glob10 } = globalThis.Bun;
|
|
29686
29903
|
var toSafeFileName6 = (specifier) => {
|
|
@@ -29739,7 +29956,7 @@ var toSafeFileName6 = (specifier) => {
|
|
|
29739
29956
|
framework: Array.from(framework).filter(isResolvable3)
|
|
29740
29957
|
};
|
|
29741
29958
|
}, collectBareImportsFromFile = async (entryPath, transpiler6, maxDepth = 8) => {
|
|
29742
|
-
const { readFileSync:
|
|
29959
|
+
const { readFileSync: readFileSync31 } = await import("fs");
|
|
29743
29960
|
const { dirname: dirname30 } = await import("path");
|
|
29744
29961
|
const seenFiles = new Set;
|
|
29745
29962
|
const bareOut = new Set;
|
|
@@ -29755,7 +29972,7 @@ var toSafeFileName6 = (specifier) => {
|
|
|
29755
29972
|
continue;
|
|
29756
29973
|
let content;
|
|
29757
29974
|
try {
|
|
29758
|
-
content =
|
|
29975
|
+
content = readFileSync31(path, "utf-8");
|
|
29759
29976
|
} catch {
|
|
29760
29977
|
continue;
|
|
29761
29978
|
}
|
|
@@ -29829,7 +30046,7 @@ var toSafeFileName6 = (specifier) => {
|
|
|
29829
30046
|
}), buildDepVendorPass = async (specifiers, vendorDir, tmpDir) => {
|
|
29830
30047
|
const entries = await Promise.all(specifiers.map(async (specifier) => {
|
|
29831
30048
|
const safeName = toSafeFileName6(specifier);
|
|
29832
|
-
const entryPath =
|
|
30049
|
+
const entryPath = join46(tmpDir, `${safeName}.ts`);
|
|
29833
30050
|
await Bun.write(entryPath, await generateVendorEntrySource(specifier));
|
|
29834
30051
|
return { entryPath, specifier };
|
|
29835
30052
|
}));
|
|
@@ -29920,10 +30137,10 @@ var toSafeFileName6 = (specifier) => {
|
|
|
29920
30137
|
const { dep: initialSpecs, framework: frameworkRoots } = await scanBareImports(directories);
|
|
29921
30138
|
if (initialSpecs.length === 0 && frameworkRoots.length === 0)
|
|
29922
30139
|
return {};
|
|
29923
|
-
const vendorDir =
|
|
29924
|
-
|
|
29925
|
-
const tmpDir =
|
|
29926
|
-
|
|
30140
|
+
const vendorDir = join46(buildDir, "vendor");
|
|
30141
|
+
mkdirSync15(vendorDir, { recursive: true });
|
|
30142
|
+
const tmpDir = join46(buildDir, "_dep_vendor_tmp");
|
|
30143
|
+
mkdirSync15(tmpDir, { recursive: true });
|
|
29927
30144
|
const allSpecs = new Set(initialSpecs);
|
|
29928
30145
|
const alreadyScanned = new Set;
|
|
29929
30146
|
let frontier = [...allSpecs, ...frameworkRoots];
|
|
@@ -30006,7 +30223,7 @@ __export(exports_devBuild, {
|
|
|
30006
30223
|
});
|
|
30007
30224
|
import { readdir as readdir5 } from "fs/promises";
|
|
30008
30225
|
import { statSync as statSync7 } from "fs";
|
|
30009
|
-
import { resolve as
|
|
30226
|
+
import { resolve as resolve45 } from "path";
|
|
30010
30227
|
var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
30011
30228
|
const configuredDirs = [
|
|
30012
30229
|
config.reactDirectory,
|
|
@@ -30015,7 +30232,7 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
30015
30232
|
config.angularDirectory,
|
|
30016
30233
|
config.htmlDirectory,
|
|
30017
30234
|
config.htmxDirectory,
|
|
30018
|
-
|
|
30235
|
+
resolve45(import.meta.dir, "../dev/client")
|
|
30019
30236
|
].filter((dir) => Boolean(dir));
|
|
30020
30237
|
return Array.from(new Set(configuredDirs));
|
|
30021
30238
|
}, parseDirectoryConfig = (source) => {
|
|
@@ -30030,7 +30247,7 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
30030
30247
|
return Object.keys(config).length > 0 ? config : null;
|
|
30031
30248
|
}, reloadConfig = async () => {
|
|
30032
30249
|
try {
|
|
30033
|
-
const configPath2 =
|
|
30250
|
+
const configPath2 = resolve45(process.env.ABSOLUTE_CONFIG ?? "absolute.config.ts");
|
|
30034
30251
|
const source = await Bun.file(configPath2).text();
|
|
30035
30252
|
return parseDirectoryConfig(source);
|
|
30036
30253
|
} catch {
|
|
@@ -30142,7 +30359,7 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
30142
30359
|
});
|
|
30143
30360
|
}
|
|
30144
30361
|
}, handleCachedReload = async () => {
|
|
30145
|
-
const serverMtime = statSync7(
|
|
30362
|
+
const serverMtime = statSync7(resolve45(Bun.main)).mtimeMs;
|
|
30146
30363
|
const lastMtime = globalThis.__hmrServerMtime;
|
|
30147
30364
|
globalThis.__hmrServerMtime = serverMtime;
|
|
30148
30365
|
const cached = globalThis.__hmrDevResult;
|
|
@@ -30179,8 +30396,8 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
30179
30396
|
return true;
|
|
30180
30397
|
}, resolveAbsoluteVersion2 = async () => {
|
|
30181
30398
|
const candidates = [
|
|
30182
|
-
|
|
30183
|
-
|
|
30399
|
+
resolve45(import.meta.dir, "..", "..", "package.json"),
|
|
30400
|
+
resolve45(import.meta.dir, "..", "package.json")
|
|
30184
30401
|
];
|
|
30185
30402
|
const [candidate, ...remaining] = candidates;
|
|
30186
30403
|
if (!candidate) {
|
|
@@ -30206,7 +30423,7 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
30206
30423
|
const entries = await readdir5(vendorDir).catch(() => emptyStringArray);
|
|
30207
30424
|
await Promise.all(entries.filter((entry) => entry.endsWith(".js")).map(async (entry) => {
|
|
30208
30425
|
const webPath = `/${framework}/vendor/${entry}`;
|
|
30209
|
-
const bytes = await Bun.file(
|
|
30426
|
+
const bytes = await Bun.file(resolve45(vendorDir, entry)).bytes();
|
|
30210
30427
|
assetStore.set(webPath, bytes);
|
|
30211
30428
|
}));
|
|
30212
30429
|
}, devBuild = async (config) => {
|
|
@@ -30231,6 +30448,7 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
30231
30448
|
process.env.ABSOLUTE_BUILD_DIR ??= state.resolvedPaths.buildDir;
|
|
30232
30449
|
recordStep("create HMR state", stepStartedAt);
|
|
30233
30450
|
stepStartedAt = performance.now();
|
|
30451
|
+
setBootPhase("scan source tree");
|
|
30234
30452
|
const watchPaths = getWatchPaths(config, state.resolvedPaths);
|
|
30235
30453
|
buildInitialDependencyGraph(state.dependencyGraph, watchPaths);
|
|
30236
30454
|
recordStep("initialize dependency graph", stepStartedAt);
|
|
@@ -30309,6 +30527,7 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
30309
30527
|
recordStep("start file watching", stepStartedAt);
|
|
30310
30528
|
const buildStart = performance.now();
|
|
30311
30529
|
let buildResult = null;
|
|
30530
|
+
setBootPhase("initial build");
|
|
30312
30531
|
try {
|
|
30313
30532
|
buildResult = await build({
|
|
30314
30533
|
...config,
|
|
@@ -30341,15 +30560,17 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
30341
30560
|
console.log("\u26A0\uFE0F Manifest is empty - this is OK for HTML/HTMX-only projects");
|
|
30342
30561
|
}
|
|
30343
30562
|
stepStartedAt = performance.now();
|
|
30563
|
+
setBootPhase("populate asset store");
|
|
30344
30564
|
await populateAssetStore(state.assetStore, manifest, state.resolvedPaths.buildDir);
|
|
30345
30565
|
cleanStaleAssets(state.assetStore, manifest, state.resolvedPaths.buildDir);
|
|
30346
30566
|
recordStep("populate asset store", stepStartedAt);
|
|
30347
30567
|
stepStartedAt = performance.now();
|
|
30348
|
-
|
|
30349
|
-
const
|
|
30350
|
-
const
|
|
30351
|
-
const
|
|
30352
|
-
const
|
|
30568
|
+
setBootPhase("build vendor bundles");
|
|
30569
|
+
const reactVendorDir = resolve45(state.resolvedPaths.buildDir, "react", "vendor");
|
|
30570
|
+
const angularVendorDir = resolve45(state.resolvedPaths.buildDir, "angular", "vendor");
|
|
30571
|
+
const svelteVendorDir = resolve45(state.resolvedPaths.buildDir, "svelte", "vendor");
|
|
30572
|
+
const vueVendorDir = resolve45(state.resolvedPaths.buildDir, "vue", "vendor");
|
|
30573
|
+
const depVendorDir = resolve45(state.resolvedPaths.buildDir, "vendor");
|
|
30353
30574
|
const { buildDepVendor: buildDepVendor2 } = await Promise.resolve().then(() => (init_buildDepVendor(), exports_buildDepVendor));
|
|
30354
30575
|
const [, angularSpecs, , , , , depPaths] = await Promise.all([
|
|
30355
30576
|
config.reactDirectory ? buildReactVendor(state.resolvedPaths.buildDir) : Promise.resolve(undefined),
|
|
@@ -30368,6 +30589,7 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
30368
30589
|
globalThis.__depVendorPaths = depPaths;
|
|
30369
30590
|
recordStep("build vendor bundles", stepStartedAt);
|
|
30370
30591
|
stepStartedAt = performance.now();
|
|
30592
|
+
setBootPhase("rewrite vendor cross-references");
|
|
30371
30593
|
const combinedVendorPaths = {
|
|
30372
30594
|
...getDevVendorPaths() ?? {},
|
|
30373
30595
|
...getAngularVendorPaths() ?? {},
|
|
@@ -30395,6 +30617,7 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
30395
30617
|
]);
|
|
30396
30618
|
recordStep("load vendor files", stepStartedAt);
|
|
30397
30619
|
stepStartedAt = performance.now();
|
|
30620
|
+
setBootPhase("warm compilers");
|
|
30398
30621
|
const { warmCompilers: warmCompilers2 } = await Promise.resolve().then(() => (init_moduleServer(), exports_moduleServer));
|
|
30399
30622
|
await warmCompilers2({
|
|
30400
30623
|
svelte: Boolean(config.svelteDirectory),
|
|
@@ -30427,7 +30650,7 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
30427
30650
|
manifest
|
|
30428
30651
|
};
|
|
30429
30652
|
globalThis.__hmrDevResult = result;
|
|
30430
|
-
globalThis.__hmrServerMtime = statSync7(
|
|
30653
|
+
globalThis.__hmrServerMtime = statSync7(resolve45(Bun.main)).mtimeMs;
|
|
30431
30654
|
return result;
|
|
30432
30655
|
};
|
|
30433
30656
|
var init_devBuild = __esm(() => {
|
|
@@ -30446,6 +30669,7 @@ var init_devBuild = __esm(() => {
|
|
|
30446
30669
|
init_rebuildTrigger();
|
|
30447
30670
|
init_logger();
|
|
30448
30671
|
init_startupTimings();
|
|
30672
|
+
init_bootLifecycle();
|
|
30449
30673
|
FRAMEWORK_DIR_KEYS = [
|
|
30450
30674
|
"reactDirectory",
|
|
30451
30675
|
"svelteDirectory",
|
|
@@ -30464,5 +30688,5 @@ export {
|
|
|
30464
30688
|
devBuild
|
|
30465
30689
|
};
|
|
30466
30690
|
|
|
30467
|
-
//# debugId=
|
|
30691
|
+
//# debugId=7C34949B9195D09F64756E2164756E21
|
|
30468
30692
|
//# sourceMappingURL=build.js.map
|