@absolutejs/absolute 0.20.0-beta.66 → 0.20.0-beta.68
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/cli/index.js +1526 -574
- package/dist/dev/serverBootstrap.js +544 -6
- package/dist/index.js +879 -619
- package/dist/index.js.map +13 -10
- package/dist/mobile/index.js +1777 -190
- package/dist/mobile/index.js.map +9 -5
- package/dist/mobile/mobilePreviewClient.ts +246 -0
- package/dist/mobile/remoteMacAgentEntry.js +576 -205
- package/dist/mobile/shellBootstrap.js +152 -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/expoNativeObservability.d.ts +3 -0
- package/dist/src/mobile/index.d.ts +3 -0
- package/dist/src/mobile/mobilePreview.d.ts +1 -1
- package/dist/src/mobile/nativeObservability.d.ts +4 -0
- package/dist/src/mobile/shellNativeObservability.d.ts +21 -0
- 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/index.js
CHANGED
|
@@ -9949,7 +9949,7 @@ var init_getDurationString = __esm(() => {
|
|
|
9949
9949
|
});
|
|
9950
9950
|
|
|
9951
9951
|
// src/utils/startupTimings.ts
|
|
9952
|
-
var startupTimingsEnabled, formatStartupTimingBlock = (title, steps) => {
|
|
9952
|
+
var isTruthyFlag = (value) => value === "1" || value === "true", devProfileEnabled, startupTimingsEnabled, formatStartupTimingBlock = (title, steps) => {
|
|
9953
9953
|
const totalDuration = steps.reduce((sum, step) => sum + step.durationMs, 0);
|
|
9954
9954
|
return [
|
|
9955
9955
|
title,
|
|
@@ -9961,11 +9961,12 @@ var startupTimingsEnabled, formatStartupTimingBlock = (title, steps) => {
|
|
|
9961
9961
|
if (!startupTimingsEnabled || steps.length === 0) {
|
|
9962
9962
|
return;
|
|
9963
9963
|
}
|
|
9964
|
-
console.
|
|
9964
|
+
console.error(formatStartupTimingBlock(title, steps));
|
|
9965
9965
|
};
|
|
9966
9966
|
var init_startupTimings = __esm(() => {
|
|
9967
9967
|
init_getDurationString();
|
|
9968
|
-
|
|
9968
|
+
devProfileEnabled = isTruthyFlag(process.env.ABSOLUTE_DEV_PROFILE);
|
|
9969
|
+
startupTimingsEnabled = devProfileEnabled || isTruthyFlag(process.env.ABSOLUTE_STARTUP_TIMINGS);
|
|
9969
9970
|
});
|
|
9970
9971
|
|
|
9971
9972
|
// src/utils/startupBanner.ts
|
|
@@ -10113,6 +10114,37 @@ var init_logger = __esm(() => {
|
|
|
10113
10114
|
};
|
|
10114
10115
|
});
|
|
10115
10116
|
|
|
10117
|
+
// src/dev/bootLifecycle.ts
|
|
10118
|
+
var DEFERRED_TASK_FALLBACK_SECONDS = 15, setBootPhase = (phase) => {
|
|
10119
|
+
globalThis.__absoluteBootPhase = phase;
|
|
10120
|
+
}, runTask = async (task) => {
|
|
10121
|
+
try {
|
|
10122
|
+
await task();
|
|
10123
|
+
} catch (error) {
|
|
10124
|
+
console.error(`[dev] deferred boot task failed: ${error instanceof Error ? error.message : String(error)}`);
|
|
10125
|
+
}
|
|
10126
|
+
}, deferUntilServing = (task) => {
|
|
10127
|
+
if (globalThis.__absoluteDeferredBootTasksRan) {
|
|
10128
|
+
runTask(task);
|
|
10129
|
+
return;
|
|
10130
|
+
}
|
|
10131
|
+
const queue = globalThis.__absoluteDeferredBootTasks ?? [];
|
|
10132
|
+
globalThis.__absoluteDeferredBootTasks = queue;
|
|
10133
|
+
queue.push(task);
|
|
10134
|
+
const timer = setTimeout(runDeferredBootTasks, DEFERRED_TASK_FALLBACK_SECONDS * MILLISECONDS_IN_A_SECOND);
|
|
10135
|
+
if (typeof timer === "object" && "unref" in timer)
|
|
10136
|
+
timer.unref();
|
|
10137
|
+
}, runDeferredBootTasks = () => {
|
|
10138
|
+
const tasks = globalThis.__absoluteDeferredBootTasks ?? [];
|
|
10139
|
+
globalThis.__absoluteDeferredBootTasks = [];
|
|
10140
|
+
globalThis.__absoluteDeferredBootTasksRan = true;
|
|
10141
|
+
for (const task of tasks)
|
|
10142
|
+
runTask(task);
|
|
10143
|
+
};
|
|
10144
|
+
var init_bootLifecycle = __esm(() => {
|
|
10145
|
+
init_constants();
|
|
10146
|
+
});
|
|
10147
|
+
|
|
10116
10148
|
// src/core/devRouteRegistrationCallsite.ts
|
|
10117
10149
|
var exports_devRouteRegistrationCallsite = {};
|
|
10118
10150
|
__export(exports_devRouteRegistrationCallsite, {
|
|
@@ -15429,6 +15461,7 @@ var exports_chainInlineSourcemaps = {};
|
|
|
15429
15461
|
__export(exports_chainInlineSourcemaps, {
|
|
15430
15462
|
buildLineRemap: () => buildLineRemap,
|
|
15431
15463
|
chainBundleInlineSourcemap: () => chainBundleInlineSourcemap,
|
|
15464
|
+
chainBundleInlineSourcemaps: () => chainBundleInlineSourcemaps,
|
|
15432
15465
|
chainExternalSourcemap: () => chainExternalSourcemap,
|
|
15433
15466
|
chainSourcemap: () => chainSourcemap,
|
|
15434
15467
|
inlineLineMapComment: () => inlineLineMapComment,
|
|
@@ -15742,6 +15775,10 @@ var BASE64_CHARS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz01234567
|
|
|
15742
15775
|
const inline = `
|
|
15743
15776
|
//# sourceMappingURL=data:application/json;base64,` + Buffer.from(JSON.stringify(chained)).toString("base64");
|
|
15744
15777
|
writeFileSync8(bundleFilePath, stripped + inline);
|
|
15778
|
+
}, chainBundleInlineSourcemaps = async (bundlePaths) => {
|
|
15779
|
+
for (const bundlePath of bundlePaths) {
|
|
15780
|
+
chainBundleInlineSourcemap(bundlePath);
|
|
15781
|
+
}
|
|
15745
15782
|
}, chainExternalSourcemap = (mapFilePath) => {
|
|
15746
15783
|
let outerMap;
|
|
15747
15784
|
try {
|
|
@@ -15835,6 +15872,98 @@ var init_vueAutoRouterTransform = __esm(() => {
|
|
|
15835
15872
|
SETUP_APP_FUNCTION_REGEX = /\bexport\s+(async\s+function|function)\s+setupApp\b/;
|
|
15836
15873
|
});
|
|
15837
15874
|
|
|
15875
|
+
// src/build/vueCompileCache.ts
|
|
15876
|
+
import { createHash as createHash9 } from "crypto";
|
|
15877
|
+
import {
|
|
15878
|
+
existsSync as existsSync26,
|
|
15879
|
+
mkdirSync as mkdirSync8,
|
|
15880
|
+
readFileSync as readFileSync25,
|
|
15881
|
+
renameSync,
|
|
15882
|
+
writeFileSync as writeFileSync9
|
|
15883
|
+
} from "fs";
|
|
15884
|
+
import { join as join37, resolve as resolve28 } from "path";
|
|
15885
|
+
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) => createHash9("sha256").update(content).digest("hex"), hashParts = (parts) => {
|
|
15886
|
+
const hash = createHash9("sha256");
|
|
15887
|
+
for (const part of parts) {
|
|
15888
|
+
hash.update(part);
|
|
15889
|
+
hash.update("\x00");
|
|
15890
|
+
}
|
|
15891
|
+
return hash.digest("hex");
|
|
15892
|
+
}, readOwnPackageVersion = () => {
|
|
15893
|
+
const candidates = [
|
|
15894
|
+
resolve28(import.meta.dir, "..", "..", "package.json"),
|
|
15895
|
+
resolve28(import.meta.dir, "..", "package.json")
|
|
15896
|
+
];
|
|
15897
|
+
for (const candidate of candidates) {
|
|
15898
|
+
try {
|
|
15899
|
+
const pkg = JSON.parse(readFileSync25(candidate, "utf-8"));
|
|
15900
|
+
if (pkg.name === "@absolutejs/absolute" && pkg.version) {
|
|
15901
|
+
return pkg.version;
|
|
15902
|
+
}
|
|
15903
|
+
} catch {}
|
|
15904
|
+
}
|
|
15905
|
+
return globalThis.__absoluteVersion ?? null;
|
|
15906
|
+
}, cachedFrameworkVersion, frameworkVersionForCache = () => {
|
|
15907
|
+
cachedFrameworkVersion ??= readOwnPackageVersion();
|
|
15908
|
+
return cachedFrameworkVersion;
|
|
15909
|
+
}, vueCompileCacheDir = (projectRoot = process.cwd()) => join37(projectRoot, ABSOLUTE_CACHE_DIR_NAME2, CACHE_DIR_NAME, "vue"), entryFileFor = (sourceFilePath, projectRoot) => join37(vueCompileCacheDir(projectRoot), `${hashContent(sourceFilePath).slice(0, FILE_NAME_HASH_LENGTH)}.json`), vueCompileCacheFingerprint = (parts) => {
|
|
15910
|
+
const frameworkVersion = frameworkVersionForCache();
|
|
15911
|
+
if (!frameworkVersion)
|
|
15912
|
+
return null;
|
|
15913
|
+
return hashParts([
|
|
15914
|
+
String(CACHE_FORMAT_VERSION),
|
|
15915
|
+
frameworkVersion,
|
|
15916
|
+
parts.compilerVersion ?? "unknown-vue-compiler",
|
|
15917
|
+
JSON.stringify(parts.stylePreprocessors ?? null),
|
|
15918
|
+
parts.vueRootDir,
|
|
15919
|
+
parts.outputDirs.client,
|
|
15920
|
+
parts.outputDirs.server,
|
|
15921
|
+
parts.outputDirs.css
|
|
15922
|
+
]);
|
|
15923
|
+
}, typeDepsUnchanged = (typeDeps) => {
|
|
15924
|
+
for (const [path, hash] of Object.entries(typeDeps)) {
|
|
15925
|
+
try {
|
|
15926
|
+
if (hashContent(readFileSync25(path, "utf-8")) !== hash)
|
|
15927
|
+
return false;
|
|
15928
|
+
} catch {
|
|
15929
|
+
return false;
|
|
15930
|
+
}
|
|
15931
|
+
}
|
|
15932
|
+
return true;
|
|
15933
|
+
}, isEntryShape = (value) => {
|
|
15934
|
+
if (!value || typeof value !== "object")
|
|
15935
|
+
return false;
|
|
15936
|
+
const entry = value;
|
|
15937
|
+
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;
|
|
15938
|
+
}, readVueCompileCacheEntry = (sourceFilePath, key, projectRoot) => {
|
|
15939
|
+
if (!vueCompileCacheEnabled())
|
|
15940
|
+
return null;
|
|
15941
|
+
const entryFile = entryFileFor(sourceFilePath, projectRoot);
|
|
15942
|
+
if (!existsSync26(entryFile))
|
|
15943
|
+
return null;
|
|
15944
|
+
try {
|
|
15945
|
+
const parsed = JSON.parse(readFileSync25(entryFile, "utf-8"));
|
|
15946
|
+
if (!isEntryShape(parsed) || parsed.key !== key)
|
|
15947
|
+
return null;
|
|
15948
|
+
if (!typeDepsUnchanged(parsed.typeDeps))
|
|
15949
|
+
return null;
|
|
15950
|
+
return parsed;
|
|
15951
|
+
} catch {
|
|
15952
|
+
return null;
|
|
15953
|
+
}
|
|
15954
|
+
}, writeVueCompileCacheEntry = (sourceFilePath, entry, projectRoot) => {
|
|
15955
|
+
if (!vueCompileCacheEnabled())
|
|
15956
|
+
return;
|
|
15957
|
+
const entryFile = entryFileFor(sourceFilePath, projectRoot);
|
|
15958
|
+
try {
|
|
15959
|
+
mkdirSync8(vueCompileCacheDir(projectRoot), { recursive: true });
|
|
15960
|
+
const tempFile = `${entryFile}.${process.pid}.tmp`;
|
|
15961
|
+
writeFileSync9(tempFile, JSON.stringify(entry));
|
|
15962
|
+
renameSync(tempFile, entryFile);
|
|
15963
|
+
} catch {}
|
|
15964
|
+
};
|
|
15965
|
+
var init_vueCompileCache = () => {};
|
|
15966
|
+
|
|
15838
15967
|
// src/build/compileVue.ts
|
|
15839
15968
|
var exports_compileVue = {};
|
|
15840
15969
|
__export(exports_compileVue, {
|
|
@@ -15844,27 +15973,27 @@ __export(exports_compileVue, {
|
|
|
15844
15973
|
generateVueHmrId: () => generateVueHmrId,
|
|
15845
15974
|
vueHmrMetadata: () => vueHmrMetadata
|
|
15846
15975
|
});
|
|
15847
|
-
import { existsSync as
|
|
15976
|
+
import { existsSync as existsSync27, readFileSync as readFileSync26, realpathSync as realpathSync2 } from "fs";
|
|
15848
15977
|
import { mkdir as mkdir10 } from "fs/promises";
|
|
15849
15978
|
import {
|
|
15850
15979
|
basename as basename11,
|
|
15851
15980
|
dirname as dirname20,
|
|
15852
15981
|
isAbsolute as isAbsolute4,
|
|
15853
|
-
join as
|
|
15982
|
+
join as join38,
|
|
15854
15983
|
relative as relative13,
|
|
15855
|
-
resolve as
|
|
15984
|
+
resolve as resolve29
|
|
15856
15985
|
} from "path";
|
|
15857
15986
|
var {file: file3, write: write3, Transpiler: Transpiler3 } = globalThis.Bun;
|
|
15858
15987
|
var resolveDevClientDir3 = () => {
|
|
15859
15988
|
const projectRoot = process.cwd();
|
|
15860
|
-
const fromSource =
|
|
15861
|
-
if (
|
|
15989
|
+
const fromSource = resolve29(import.meta.dir, "../dev/client");
|
|
15990
|
+
if (existsSync27(fromSource) && fromSource.startsWith(projectRoot)) {
|
|
15862
15991
|
return fromSource;
|
|
15863
15992
|
}
|
|
15864
|
-
const fromNodeModules =
|
|
15865
|
-
if (
|
|
15993
|
+
const fromNodeModules = resolve29(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client");
|
|
15994
|
+
if (existsSync27(fromNodeModules))
|
|
15866
15995
|
return fromNodeModules;
|
|
15867
|
-
return
|
|
15996
|
+
return resolve29(import.meta.dir, "./dev/client");
|
|
15868
15997
|
}, devClientDir3, hmrClientPath4, transpiler4, scriptCache, scriptSetupCache, templateCache, styleCache, persistentBuildCache, vueSourceHashCache, vueHmrMetadata, clearVueHmrCaches = () => {
|
|
15869
15998
|
scriptCache.clear();
|
|
15870
15999
|
scriptSetupCache.clear();
|
|
@@ -15914,20 +16043,20 @@ var resolveDevClientDir3 = () => {
|
|
|
15914
16043
|
visited.add(resolved);
|
|
15915
16044
|
const importRegex = /@import\s+(?:url\(\s*)?(['"])(\.{1,2}\/[^'"]+)\1\s*\)?\s*;?/g;
|
|
15916
16045
|
return cssContent.replace(importRegex, (match, _quote, relPath) => {
|
|
15917
|
-
const importedPath =
|
|
15918
|
-
if (!
|
|
16046
|
+
const importedPath = resolve29(dirname20(cssFilePath), relPath);
|
|
16047
|
+
if (!existsSync27(importedPath))
|
|
15919
16048
|
return match;
|
|
15920
|
-
const importedContent =
|
|
16049
|
+
const importedContent = readFileSync26(importedPath, "utf-8");
|
|
15921
16050
|
return inlineCssImports(importedContent, importedPath, visited);
|
|
15922
16051
|
});
|
|
15923
16052
|
}, resolveHelperTsPath = (sourceDir, helper) => {
|
|
15924
16053
|
if (helper.endsWith(".ts"))
|
|
15925
|
-
return
|
|
15926
|
-
const direct =
|
|
15927
|
-
if (
|
|
16054
|
+
return resolve29(sourceDir, helper);
|
|
16055
|
+
const direct = resolve29(sourceDir, `${helper}.ts`);
|
|
16056
|
+
if (existsSync27(direct))
|
|
15928
16057
|
return direct;
|
|
15929
|
-
const indexed =
|
|
15930
|
-
if (
|
|
16058
|
+
const indexed = resolve29(sourceDir, helper, "index.ts");
|
|
16059
|
+
if (existsSync27(indexed))
|
|
15931
16060
|
return indexed;
|
|
15932
16061
|
return direct;
|
|
15933
16062
|
}, toJs = (filePath, sourceDir) => {
|
|
@@ -15937,16 +16066,16 @@ var resolveDevClientDir3 = () => {
|
|
|
15937
16066
|
return filePath.replace(/\.ts$/, ".js");
|
|
15938
16067
|
if (isStylePath(filePath)) {
|
|
15939
16068
|
if (sourceDir && (filePath.startsWith("./") || filePath.startsWith("../"))) {
|
|
15940
|
-
return
|
|
16069
|
+
return resolve29(sourceDir, filePath);
|
|
15941
16070
|
}
|
|
15942
16071
|
return filePath;
|
|
15943
16072
|
}
|
|
15944
16073
|
if (sourceDir && (filePath.startsWith("./") || filePath.startsWith("../"))) {
|
|
15945
|
-
const directTs =
|
|
15946
|
-
if (
|
|
16074
|
+
const directTs = resolve29(sourceDir, `${filePath}.ts`);
|
|
16075
|
+
if (existsSync27(directTs))
|
|
15947
16076
|
return `${filePath}.js`;
|
|
15948
|
-
const indexedTs =
|
|
15949
|
-
if (
|
|
16077
|
+
const indexedTs = resolve29(sourceDir, filePath, "index.ts");
|
|
16078
|
+
if (existsSync27(indexedTs))
|
|
15950
16079
|
return `${filePath}/index.js`;
|
|
15951
16080
|
}
|
|
15952
16081
|
return `${filePath}.js`;
|
|
@@ -15993,6 +16122,50 @@ const ${localName} = (source) => ${importedName}(
|
|
|
15993
16122
|
: { ...source, loader: () => __absoluteResolveAsyncVueComponent(source.loader) },
|
|
15994
16123
|
);`;
|
|
15995
16124
|
return code.replace(vueImportRegex, `import { ${specifiers.join(", ")} } from 'vue';${wrapper}`);
|
|
16125
|
+
}, EXTERNAL_STYLE_DEPENDENCY, hasExternalStyleDependency = (descriptor) => descriptor.styles.some((styleBlock) => Boolean(styleBlock.lang) || EXTERNAL_STYLE_DEPENDENCY.test(styleBlock.content)), fingerprintCache, currentVueCompileFingerprint = (compiler, outputDirs, vueRootDir, stylePreprocessors) => {
|
|
16126
|
+
const memoKey = JSON.stringify([outputDirs, vueRootDir, stylePreprocessors]);
|
|
16127
|
+
const memoised = fingerprintCache.get(memoKey);
|
|
16128
|
+
if (memoised !== undefined)
|
|
16129
|
+
return memoised;
|
|
16130
|
+
const fingerprint = vueCompileCacheFingerprint({
|
|
16131
|
+
compilerVersion: compiler.version,
|
|
16132
|
+
outputDirs,
|
|
16133
|
+
stylePreprocessors,
|
|
16134
|
+
vueRootDir
|
|
16135
|
+
});
|
|
16136
|
+
fingerprintCache.set(memoKey, fingerprint);
|
|
16137
|
+
return fingerprint;
|
|
16138
|
+
}, computeVueCompileCacheKey = (parts) => {
|
|
16139
|
+
if (!parts.fingerprint || !vueCompileCacheEnabled())
|
|
16140
|
+
return;
|
|
16141
|
+
if (hasExternalStyleDependency(parts.descriptor))
|
|
16142
|
+
return;
|
|
16143
|
+
const childKeys = [];
|
|
16144
|
+
for (const child of parts.childResults) {
|
|
16145
|
+
if (!child.cacheKey)
|
|
16146
|
+
return;
|
|
16147
|
+
childKeys.push(child.cacheKey);
|
|
16148
|
+
}
|
|
16149
|
+
return hashParts([
|
|
16150
|
+
parts.fingerprint,
|
|
16151
|
+
parts.relativeWithoutExtension,
|
|
16152
|
+
parts.isEntryPoint ? "entry" : "child",
|
|
16153
|
+
parts.contentHash,
|
|
16154
|
+
...childKeys
|
|
16155
|
+
]);
|
|
16156
|
+
}, materialiseVueCompileCacheEntry = async (entry, cacheKey2, isEntryPoint, outputDirs, fileBaseName) => {
|
|
16157
|
+
const { result } = entry;
|
|
16158
|
+
await mkdir10(dirname20(result.clientPath), { recursive: true });
|
|
16159
|
+
await mkdir10(dirname20(result.serverPath), { recursive: true });
|
|
16160
|
+
await write3(result.clientPath, entry.clientCode);
|
|
16161
|
+
await write3(result.serverPath, entry.serverCode);
|
|
16162
|
+
if (isEntryPoint && result.cssCodes.length > 0) {
|
|
16163
|
+
const cssOutputFile = join38(outputDirs.css, `${toKebab(fileBaseName)}-compiled.css`);
|
|
16164
|
+
await mkdir10(dirname20(cssOutputFile), { recursive: true });
|
|
16165
|
+
await write3(cssOutputFile, result.cssCodes.join(`
|
|
16166
|
+
`));
|
|
16167
|
+
}
|
|
16168
|
+
return { ...result, cacheKey: cacheKey2 };
|
|
15996
16169
|
}, compileVueFile = async (sourceFilePath, outputDirs, cacheMap, isEntryPoint, vueRootDir, compiler, stylePreprocessors) => {
|
|
15997
16170
|
const cachedResult = cacheMap.get(sourceFilePath);
|
|
15998
16171
|
if (cachedResult)
|
|
@@ -16007,7 +16180,7 @@ const ${localName} = (source) => ${importedName}(
|
|
|
16007
16180
|
const contentHash = Bun.hash(sourceContent).toString(BASE_36_RADIX);
|
|
16008
16181
|
const prevHash = vueSourceHashCache.get(sourceFilePath);
|
|
16009
16182
|
const persistent = persistentBuildCache.get(sourceFilePath);
|
|
16010
|
-
if (prevHash === contentHash && persistent &&
|
|
16183
|
+
if (prevHash === contentHash && persistent && existsSync27(persistent.clientPath) && existsSync27(persistent.serverPath)) {
|
|
16011
16184
|
cacheMap.set(sourceFilePath, persistent);
|
|
16012
16185
|
return persistent;
|
|
16013
16186
|
}
|
|
@@ -16036,25 +16209,55 @@ const ${localName} = (source) => ${importedName}(
|
|
|
16036
16209
|
const childComponentPaths = importPaths.filter((path) => path.startsWith(".") && path.endsWith(".vue"));
|
|
16037
16210
|
const packageComponentPaths = Array.from(resolvedPackageVueImports.entries());
|
|
16038
16211
|
const helperModulePaths = importPaths.filter((path) => path.startsWith(".") && !path.endsWith(".vue") && !isStylePath(path));
|
|
16039
|
-
const stylePathsImported = importPaths.filter((path) => (path.startsWith(".") || isAbsolute4(path)) && isStylePath(path)).map((path) => isAbsolute4(path) ? path :
|
|
16212
|
+
const stylePathsImported = importPaths.filter((path) => (path.startsWith(".") || isAbsolute4(path)) && isStylePath(path)).map((path) => isAbsolute4(path) ? path : resolve29(dirname20(sourceFilePath), path));
|
|
16040
16213
|
for (const stylePath of stylePathsImported) {
|
|
16041
16214
|
addStyleImporter(sourceFilePath, stylePath);
|
|
16042
16215
|
}
|
|
16043
16216
|
const childBuildResults = await Promise.all([
|
|
16044
|
-
...childComponentPaths.map((relativeChildPath) => compileVueFile(
|
|
16217
|
+
...childComponentPaths.map((relativeChildPath) => compileVueFile(resolve29(dirname20(sourceFilePath), relativeChildPath), outputDirs, cacheMap, false, vueRootDir, compiler, stylePreprocessors)),
|
|
16045
16218
|
...packageComponentPaths.map(([, absolutePath]) => compileVueFile(absolutePath, outputDirs, cacheMap, false, vueRootDir, compiler, stylePreprocessors))
|
|
16046
16219
|
]);
|
|
16220
|
+
const cacheKey2 = computeVueCompileCacheKey({
|
|
16221
|
+
childResults: childBuildResults,
|
|
16222
|
+
contentHash,
|
|
16223
|
+
descriptor,
|
|
16224
|
+
fingerprint: currentVueCompileFingerprint(compiler, outputDirs, vueRootDir, stylePreprocessors),
|
|
16225
|
+
isEntryPoint,
|
|
16226
|
+
relativeWithoutExtension
|
|
16227
|
+
});
|
|
16228
|
+
const typeDepHashes = {};
|
|
16229
|
+
if (cacheKey2) {
|
|
16230
|
+
const restored = readVueCompileCacheEntry(sourceFilePath, cacheKey2);
|
|
16231
|
+
if (restored) {
|
|
16232
|
+
const result2 = await materialiseVueCompileCacheEntry(restored, cacheKey2, isEntryPoint, outputDirs, fileBaseName);
|
|
16233
|
+
cacheMap.set(sourceFilePath, result2);
|
|
16234
|
+
persistentBuildCache.set(sourceFilePath, result2);
|
|
16235
|
+
return result2;
|
|
16236
|
+
}
|
|
16237
|
+
}
|
|
16047
16238
|
const hasScript = descriptor.script || descriptor.scriptSetup;
|
|
16048
16239
|
const compiledScript = hasScript ? compiler.compileScript(descriptor, {
|
|
16049
16240
|
fs: {
|
|
16050
|
-
fileExists:
|
|
16051
|
-
readFile: (file4) =>
|
|
16241
|
+
fileExists: existsSync27,
|
|
16242
|
+
readFile: (file4) => {
|
|
16243
|
+
if (!existsSync27(file4))
|
|
16244
|
+
return;
|
|
16245
|
+
const content = readFileSync26(file4, "utf-8");
|
|
16246
|
+
typeDepHashes[file4] = hashContent(content);
|
|
16247
|
+
return content;
|
|
16248
|
+
},
|
|
16052
16249
|
realpath: realpathSync2
|
|
16053
16250
|
},
|
|
16054
16251
|
id: componentId,
|
|
16055
16252
|
inlineTemplate: false,
|
|
16056
16253
|
sourceMap: true
|
|
16057
16254
|
}) : { bindings: {}, content: "export default {};", map: undefined };
|
|
16255
|
+
const typeDependencies = "deps" in compiledScript ? compiledScript.deps ?? [] : [];
|
|
16256
|
+
for (const dep of typeDependencies) {
|
|
16257
|
+
if (dep in typeDepHashes || !existsSync27(dep))
|
|
16258
|
+
continue;
|
|
16259
|
+
typeDepHashes[dep] = hashContent(readFileSync26(dep, "utf-8"));
|
|
16260
|
+
}
|
|
16058
16261
|
const strippedScript = stripExports2(compiledScript.content);
|
|
16059
16262
|
const sourceDir = dirname20(sourceFilePath);
|
|
16060
16263
|
const transpiledScript = transpiler4.transformSync(strippedScript).replace(/(['"])(\.{1,2}\/[^'"]+)(['"])/g, (_2, quoteStart, relativeImport, quoteEnd) => `${quoteStart}${toJs(relativeImport, sourceDir)}${quoteEnd}`);
|
|
@@ -16101,7 +16304,7 @@ const ${localName} = (source) => ${importedName}(
|
|
|
16101
16304
|
];
|
|
16102
16305
|
let cssOutputPaths = [];
|
|
16103
16306
|
if (isEntryPoint && allCss.length) {
|
|
16104
|
-
const cssOutputFile =
|
|
16307
|
+
const cssOutputFile = join38(outputDirs.css, `${toKebab(fileBaseName)}-compiled.css`);
|
|
16105
16308
|
await mkdir10(dirname20(cssOutputFile), { recursive: true });
|
|
16106
16309
|
await write3(cssOutputFile, allCss.join(`
|
|
16107
16310
|
`));
|
|
@@ -16132,8 +16335,8 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
16132
16335
|
};
|
|
16133
16336
|
const clientCode = assembleModule(generateRenderFunction(false), "render", true) + islandMetadataExports;
|
|
16134
16337
|
const serverCode = wrapServerAsyncComponentLoader(assembleModule(generateRenderFunction(true), "ssrRender", false)) + islandMetadataExports;
|
|
16135
|
-
const clientOutputPath =
|
|
16136
|
-
const serverOutputPath =
|
|
16338
|
+
const clientOutputPath = join38(outputDirs.client, `${relativeWithoutExtension}.js`);
|
|
16339
|
+
const serverOutputPath = join38(outputDirs.server, `${relativeWithoutExtension}.js`);
|
|
16137
16340
|
const rewritePackageImports = (code, outputPath, mode) => {
|
|
16138
16341
|
let result2 = code;
|
|
16139
16342
|
for (const [bareImport, paths] of packageImportRewrites) {
|
|
@@ -16159,9 +16362,11 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
16159
16362
|
//# sourceMappingURL=data:application/json;base64,${Buffer.from(JSON.stringify(map)).toString("base64")}
|
|
16160
16363
|
`;
|
|
16161
16364
|
};
|
|
16162
|
-
|
|
16163
|
-
|
|
16164
|
-
|
|
16365
|
+
const clientOutput = clientFinal + inlineSourceMapFor(clientFinal);
|
|
16366
|
+
const serverOutput = serverFinal + inlineSourceMapFor(serverFinal);
|
|
16367
|
+
await write3(clientOutputPath, clientOutput);
|
|
16368
|
+
await write3(serverOutputPath, serverOutput);
|
|
16369
|
+
const cacheableResult = {
|
|
16165
16370
|
clientPath: clientOutputPath,
|
|
16166
16371
|
cssCodes: allCss,
|
|
16167
16372
|
cssPaths: cssOutputPaths,
|
|
@@ -16173,16 +16378,26 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
16173
16378
|
...childBuildResults.flatMap((child) => child.tsHelperPaths)
|
|
16174
16379
|
]
|
|
16175
16380
|
};
|
|
16381
|
+
const result = { ...cacheableResult, cacheKey: cacheKey2 };
|
|
16176
16382
|
cacheMap.set(sourceFilePath, result);
|
|
16177
16383
|
persistentBuildCache.set(sourceFilePath, result);
|
|
16384
|
+
if (cacheKey2) {
|
|
16385
|
+
writeVueCompileCacheEntry(sourceFilePath, {
|
|
16386
|
+
clientCode: clientOutput,
|
|
16387
|
+
key: cacheKey2,
|
|
16388
|
+
result: cacheableResult,
|
|
16389
|
+
serverCode: serverOutput,
|
|
16390
|
+
typeDeps: typeDepHashes
|
|
16391
|
+
});
|
|
16392
|
+
}
|
|
16178
16393
|
return result;
|
|
16179
16394
|
}, compileVue = async (entryPoints, vueRootDir, isDev2 = false, stylePreprocessors, ssrOnlyEntries) => {
|
|
16180
16395
|
const compiler = await loadVueCompiler();
|
|
16181
16396
|
const generatedDir = getFrameworkGeneratedDir("vue");
|
|
16182
|
-
const clientOutputDir =
|
|
16183
|
-
const indexOutputDir =
|
|
16184
|
-
const serverOutputDir =
|
|
16185
|
-
const cssOutputDir =
|
|
16397
|
+
const clientOutputDir = join38(generatedDir, "client");
|
|
16398
|
+
const indexOutputDir = join38(generatedDir, "indexes");
|
|
16399
|
+
const serverOutputDir = join38(generatedDir, "server");
|
|
16400
|
+
const cssOutputDir = join38(generatedDir, "compiled");
|
|
16186
16401
|
await Promise.all([
|
|
16187
16402
|
mkdir10(clientOutputDir, { recursive: true }),
|
|
16188
16403
|
mkdir10(indexOutputDir, { recursive: true }),
|
|
@@ -16192,7 +16407,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
16192
16407
|
const buildCache = new Map;
|
|
16193
16408
|
const allTsHelperPaths = new Set;
|
|
16194
16409
|
const expandSpaRouteChildren = async (entries) => {
|
|
16195
|
-
const expanded = new Set(entries.map((entry) =>
|
|
16410
|
+
const expanded = new Set(entries.map((entry) => resolve29(entry)));
|
|
16196
16411
|
const queue2 = [...expanded];
|
|
16197
16412
|
while (queue2.length > 0) {
|
|
16198
16413
|
const entryPath = queue2.pop();
|
|
@@ -16209,8 +16424,8 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
16209
16424
|
});
|
|
16210
16425
|
const routes = parseVueSpaRoutes(descriptor.script?.content ?? "");
|
|
16211
16426
|
for (const { importPath } of routes) {
|
|
16212
|
-
const childPath =
|
|
16213
|
-
if (expanded.has(childPath) || !
|
|
16427
|
+
const childPath = resolve29(dirname20(entryPath), importPath);
|
|
16428
|
+
if (expanded.has(childPath) || !existsSync27(childPath)) {
|
|
16214
16429
|
continue;
|
|
16215
16430
|
}
|
|
16216
16431
|
expanded.add(childPath);
|
|
@@ -16221,7 +16436,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
16221
16436
|
};
|
|
16222
16437
|
const expandedEntryPoints = await expandSpaRouteChildren(entryPoints);
|
|
16223
16438
|
const compiledPages = await Promise.all(expandedEntryPoints.map(async (entryPath) => {
|
|
16224
|
-
const resolvedEntryPath =
|
|
16439
|
+
const resolvedEntryPath = resolve29(entryPath);
|
|
16225
16440
|
const result = await compileVueFile(resolvedEntryPath, {
|
|
16226
16441
|
client: clientOutputDir,
|
|
16227
16442
|
css: cssOutputDir,
|
|
@@ -16239,8 +16454,8 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
16239
16454
|
};
|
|
16240
16455
|
}
|
|
16241
16456
|
const entryBaseName = basename11(entryPath, ".vue");
|
|
16242
|
-
const indexOutputFile =
|
|
16243
|
-
const clientOutputFile =
|
|
16457
|
+
const indexOutputFile = join38(indexOutputDir, `${entryBaseName}.js`);
|
|
16458
|
+
const clientOutputFile = join38(clientOutputDir, relative13(vueRootDir, entryPath).replace(/\\/g, "/").replace(/\.vue$/, ".js"));
|
|
16244
16459
|
await mkdir10(dirname20(indexOutputFile), { recursive: true });
|
|
16245
16460
|
const vueHmrImports = isDev2 ? [
|
|
16246
16461
|
`window.__HMR_FRAMEWORK__ = "vue";`,
|
|
@@ -16424,7 +16639,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
16424
16639
|
continue;
|
|
16425
16640
|
}
|
|
16426
16641
|
const resolved = resolveHelperTsPath(helperDir, dep);
|
|
16427
|
-
if (!
|
|
16642
|
+
if (!existsSync27(resolved))
|
|
16428
16643
|
continue;
|
|
16429
16644
|
if (allTsHelperPaths.has(resolved))
|
|
16430
16645
|
continue;
|
|
@@ -16437,8 +16652,8 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
16437
16652
|
const transpiledCode = transpiler4.transformSync(sourceCode);
|
|
16438
16653
|
const withMap = transpiledCode + inlineLineMapComment(tsPath, sourceCode, transpiledCode);
|
|
16439
16654
|
const relativeJsPath = relative13(vueRootDir, tsPath).replace(/\.ts$/, ".js");
|
|
16440
|
-
const outClientPath =
|
|
16441
|
-
const outServerPath =
|
|
16655
|
+
const outClientPath = join38(clientOutputDir, relativeJsPath);
|
|
16656
|
+
const outServerPath = join38(serverOutputDir, relativeJsPath);
|
|
16442
16657
|
await mkdir10(dirname20(outClientPath), { recursive: true });
|
|
16443
16658
|
await mkdir10(dirname20(outServerPath), { recursive: true });
|
|
16444
16659
|
await write3(outClientPath, withMap);
|
|
@@ -16469,8 +16684,9 @@ var init_compileVue = __esm(() => {
|
|
|
16469
16684
|
init_chainInlineSourcemaps();
|
|
16470
16685
|
init_vueAutoRouterTransform();
|
|
16471
16686
|
init_stylePreprocessor();
|
|
16687
|
+
init_vueCompileCache();
|
|
16472
16688
|
devClientDir3 = resolveDevClientDir3();
|
|
16473
|
-
hmrClientPath4 =
|
|
16689
|
+
hmrClientPath4 = join38(devClientDir3, "hmrClient.ts").replace(/\\/g, "/");
|
|
16474
16690
|
transpiler4 = new Transpiler3({ loader: "ts", target: "browser" });
|
|
16475
16691
|
scriptCache = new Map;
|
|
16476
16692
|
scriptSetupCache = new Map;
|
|
@@ -16479,6 +16695,8 @@ var init_compileVue = __esm(() => {
|
|
|
16479
16695
|
persistentBuildCache = new Map;
|
|
16480
16696
|
vueSourceHashCache = new Map;
|
|
16481
16697
|
vueHmrMetadata = new Map;
|
|
16698
|
+
EXTERNAL_STYLE_DEPENDENCY = /@(?:import|use|forward)\b/;
|
|
16699
|
+
fingerprintCache = new Map;
|
|
16482
16700
|
});
|
|
16483
16701
|
|
|
16484
16702
|
// src/angular/lowerDeferSyntax.ts
|
|
@@ -16951,8 +17169,8 @@ __export(exports_compileAngular, {
|
|
|
16951
17169
|
compileAngularFiles: () => compileAngularFiles,
|
|
16952
17170
|
invalidateAngularJitCache: () => invalidateAngularJitCache
|
|
16953
17171
|
});
|
|
16954
|
-
import { existsSync as
|
|
16955
|
-
import { join as
|
|
17172
|
+
import { existsSync as existsSync28, readFileSync as readFileSync27, promises as fs5 } from "fs";
|
|
17173
|
+
import { join as join39, basename as basename12, sep as sep3, dirname as dirname21, resolve as resolve30, relative as relative14 } from "path";
|
|
16956
17174
|
var {Glob: Glob6 } = globalThis.Bun;
|
|
16957
17175
|
import ts14 from "typescript";
|
|
16958
17176
|
var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) => {
|
|
@@ -16968,10 +17186,10 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
16968
17186
|
return tracePhase ? tracePhase(`compile/angular/${name}`, fn2, metadata2) : await fn2();
|
|
16969
17187
|
}, readTsconfigPathAliases = () => {
|
|
16970
17188
|
try {
|
|
16971
|
-
const configPath2 =
|
|
17189
|
+
const configPath2 = resolve30(process.cwd(), "tsconfig.json");
|
|
16972
17190
|
const config = ts14.readConfigFile(configPath2, ts14.sys.readFile).config;
|
|
16973
17191
|
const compilerOptions = config?.compilerOptions ?? {};
|
|
16974
|
-
const baseUrl =
|
|
17192
|
+
const baseUrl = resolve30(process.cwd(), compilerOptions.baseUrl ?? ".");
|
|
16975
17193
|
const aliases = Object.entries(compilerOptions.paths ?? {}).map(([pattern, replacements]) => ({ pattern, replacements }));
|
|
16976
17194
|
return { aliases, baseUrl };
|
|
16977
17195
|
} catch {
|
|
@@ -16991,7 +17209,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
16991
17209
|
const wildcardValue = exactMatch ? "" : specifier.slice(prefix.length, specifier.length - suffix.length);
|
|
16992
17210
|
for (const replacement of alias.replacements) {
|
|
16993
17211
|
const candidate = replacement.replace("*", wildcardValue);
|
|
16994
|
-
const resolved = resolveSourceFile(
|
|
17212
|
+
const resolved = resolveSourceFile(resolve30(baseUrl, candidate));
|
|
16995
17213
|
if (resolved)
|
|
16996
17214
|
return resolved;
|
|
16997
17215
|
}
|
|
@@ -17003,20 +17221,20 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
17003
17221
|
`${candidate}.tsx`,
|
|
17004
17222
|
`${candidate}.js`,
|
|
17005
17223
|
`${candidate}.jsx`,
|
|
17006
|
-
|
|
17007
|
-
|
|
17008
|
-
|
|
17009
|
-
|
|
17224
|
+
join39(candidate, "index.ts"),
|
|
17225
|
+
join39(candidate, "index.tsx"),
|
|
17226
|
+
join39(candidate, "index.js"),
|
|
17227
|
+
join39(candidate, "index.jsx")
|
|
17010
17228
|
];
|
|
17011
|
-
return candidates.find((file4) =>
|
|
17229
|
+
return candidates.find((file4) => existsSync28(file4));
|
|
17012
17230
|
}, createLegacyAngularAnimationUsageResolver = (rootDir) => {
|
|
17013
|
-
const baseDir =
|
|
17231
|
+
const baseDir = resolve30(rootDir);
|
|
17014
17232
|
const tsconfigAliases = readTsconfigPathAliases();
|
|
17015
17233
|
const transpiler5 = new Bun.Transpiler({ loader: "tsx" });
|
|
17016
17234
|
const scanCache = new Map;
|
|
17017
17235
|
const resolveLocalImport = (specifier, fromDir) => {
|
|
17018
17236
|
if (specifier.startsWith(".") || specifier.startsWith("/")) {
|
|
17019
|
-
return resolveSourceFile(
|
|
17237
|
+
return resolveSourceFile(resolve30(fromDir, specifier));
|
|
17020
17238
|
}
|
|
17021
17239
|
const aliased = matchTsconfigAlias(specifier, tsconfigAliases.aliases, tsconfigAliases.baseUrl, resolveSourceFile);
|
|
17022
17240
|
if (aliased)
|
|
@@ -17025,7 +17243,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
17025
17243
|
const resolved = Bun.resolveSync(specifier, fromDir);
|
|
17026
17244
|
if (resolved.includes("/node_modules/"))
|
|
17027
17245
|
return;
|
|
17028
|
-
const absolute =
|
|
17246
|
+
const absolute = resolve30(resolved);
|
|
17029
17247
|
if (!absolute.startsWith(baseDir))
|
|
17030
17248
|
return;
|
|
17031
17249
|
return resolveSourceFile(absolute);
|
|
@@ -17041,7 +17259,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
17041
17259
|
usesLegacyAnimations: false
|
|
17042
17260
|
});
|
|
17043
17261
|
}
|
|
17044
|
-
const resolved =
|
|
17262
|
+
const resolved = resolve30(actualPath);
|
|
17045
17263
|
const cached = scanCache.get(resolved);
|
|
17046
17264
|
if (cached)
|
|
17047
17265
|
return cached;
|
|
@@ -17070,7 +17288,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
17070
17288
|
const actualPath = resolveSourceFile(filePath);
|
|
17071
17289
|
if (!actualPath)
|
|
17072
17290
|
return false;
|
|
17073
|
-
const resolved =
|
|
17291
|
+
const resolved = resolve30(actualPath);
|
|
17074
17292
|
if (visited.has(resolved))
|
|
17075
17293
|
return false;
|
|
17076
17294
|
visited.add(resolved);
|
|
@@ -17088,14 +17306,14 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
17088
17306
|
return (entryPath) => visit(entryPath);
|
|
17089
17307
|
}, resolveDevClientDir4 = () => {
|
|
17090
17308
|
const projectRoot = process.cwd();
|
|
17091
|
-
const fromSource =
|
|
17092
|
-
if (
|
|
17309
|
+
const fromSource = resolve30(import.meta.dir, "../dev/client");
|
|
17310
|
+
if (existsSync28(fromSource) && fromSource.startsWith(projectRoot)) {
|
|
17093
17311
|
return fromSource;
|
|
17094
17312
|
}
|
|
17095
|
-
const fromNodeModules =
|
|
17096
|
-
if (
|
|
17313
|
+
const fromNodeModules = resolve30(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client");
|
|
17314
|
+
if (existsSync28(fromNodeModules))
|
|
17097
17315
|
return fromNodeModules;
|
|
17098
|
-
return
|
|
17316
|
+
return resolve30(import.meta.dir, "./dev/client");
|
|
17099
17317
|
}, devClientDir4, hmrClientPath5, formatDiagnosticMessage = (diagnostic) => {
|
|
17100
17318
|
try {
|
|
17101
17319
|
return ts14.flattenDiagnosticMessageText(diagnostic.messageText, `
|
|
@@ -17138,12 +17356,12 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
17138
17356
|
if (hasJsLikeExtension(path))
|
|
17139
17357
|
return `${path}${query}`;
|
|
17140
17358
|
const importerDir = dirname21(importerOutputPath);
|
|
17141
|
-
const fileCandidate =
|
|
17142
|
-
if (outputFiles?.has(fileCandidate) ||
|
|
17359
|
+
const fileCandidate = resolve30(importerDir, `${path}.js`);
|
|
17360
|
+
if (outputFiles?.has(fileCandidate) || existsSync28(fileCandidate)) {
|
|
17143
17361
|
return `${path}.js${query}`;
|
|
17144
17362
|
}
|
|
17145
|
-
const indexCandidate =
|
|
17146
|
-
if (outputFiles?.has(indexCandidate) ||
|
|
17363
|
+
const indexCandidate = resolve30(importerDir, path, "index.js");
|
|
17364
|
+
if (outputFiles?.has(indexCandidate) || existsSync28(indexCandidate)) {
|
|
17147
17365
|
return `${path}/index.js${query}`;
|
|
17148
17366
|
}
|
|
17149
17367
|
return `${path}.js${query}`;
|
|
@@ -17170,18 +17388,18 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
17170
17388
|
}, resolveLocalTsImport = (fromFile, specifier) => {
|
|
17171
17389
|
if (!isRelativeModuleSpecifier(specifier))
|
|
17172
17390
|
return null;
|
|
17173
|
-
const basePath =
|
|
17391
|
+
const basePath = resolve30(dirname21(fromFile), specifier);
|
|
17174
17392
|
const candidates = /\.[cm]?[tj]sx?$/.test(basePath) ? [basePath] : [
|
|
17175
17393
|
`${basePath}.ts`,
|
|
17176
17394
|
`${basePath}.tsx`,
|
|
17177
17395
|
`${basePath}.mts`,
|
|
17178
17396
|
`${basePath}.cts`,
|
|
17179
|
-
|
|
17180
|
-
|
|
17181
|
-
|
|
17182
|
-
|
|
17397
|
+
join39(basePath, "index.ts"),
|
|
17398
|
+
join39(basePath, "index.tsx"),
|
|
17399
|
+
join39(basePath, "index.mts"),
|
|
17400
|
+
join39(basePath, "index.cts")
|
|
17183
17401
|
];
|
|
17184
|
-
return candidates.map((candidate) =>
|
|
17402
|
+
return candidates.map((candidate) => resolve30(candidate)).find((candidate) => existsSync28(candidate) && !candidate.endsWith(".d.ts")) ?? null;
|
|
17185
17403
|
}, readFileForAotTransform = async (fileName, readFile9) => {
|
|
17186
17404
|
const hostSource = readFile9?.(fileName);
|
|
17187
17405
|
if (typeof hostSource === "string")
|
|
@@ -17205,18 +17423,18 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
17205
17423
|
const paths = [];
|
|
17206
17424
|
const templateUrlMatch = findUncommentedMatch(source, /templateUrl\s*:\s*['"]([^'"]+)['"]/);
|
|
17207
17425
|
if (templateUrlMatch?.[1])
|
|
17208
|
-
paths.push(
|
|
17426
|
+
paths.push(join39(fileDir, templateUrlMatch[1]));
|
|
17209
17427
|
const styleUrlMatch = findUncommentedMatch(source, /styleUrl\s*:\s*['"]([^'"]+)['"]/);
|
|
17210
17428
|
if (styleUrlMatch?.[1])
|
|
17211
|
-
paths.push(
|
|
17429
|
+
paths.push(join39(fileDir, styleUrlMatch[1]));
|
|
17212
17430
|
const styleUrlsMatch = findUncommentedMatch(source, /styleUrls\s*:\s*\[([^\]]+)\]/);
|
|
17213
17431
|
const urlMatches = styleUrlsMatch?.[1]?.match(/['"]([^'"]+)['"]/g);
|
|
17214
17432
|
if (urlMatches) {
|
|
17215
17433
|
for (const urlMatch of urlMatches) {
|
|
17216
|
-
paths.push(
|
|
17434
|
+
paths.push(join39(fileDir, urlMatch.replace(/['"]/g, "")));
|
|
17217
17435
|
}
|
|
17218
17436
|
}
|
|
17219
|
-
return paths.map((path) =>
|
|
17437
|
+
return paths.map((path) => resolve30(path));
|
|
17220
17438
|
}, readResourceCacheFile = async (cachePath) => {
|
|
17221
17439
|
try {
|
|
17222
17440
|
const entry = JSON.parse(await fs5.readFile(cachePath, "utf-8"));
|
|
@@ -17247,7 +17465,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
17247
17465
|
safeStableStringify(stylePreprocessors ?? null)
|
|
17248
17466
|
].join("\x00");
|
|
17249
17467
|
const cacheKey2 = Bun.hash(cacheInput).toString(BASE_36_RADIX);
|
|
17250
|
-
return
|
|
17468
|
+
return join39(process.cwd(), ".absolutejs", "cache", "angular-resources", `${cacheKey2}.json`);
|
|
17251
17469
|
}, precomputeAotResourceTransforms = async (inputPaths, readFile9, stylePreprocessors) => {
|
|
17252
17470
|
const transformedSources = new Map;
|
|
17253
17471
|
const visited = new Set;
|
|
@@ -17258,11 +17476,11 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
17258
17476
|
transformedFiles: 0
|
|
17259
17477
|
};
|
|
17260
17478
|
const transformFile = async (filePath) => {
|
|
17261
|
-
const resolvedPath =
|
|
17479
|
+
const resolvedPath = resolve30(filePath);
|
|
17262
17480
|
if (visited.has(resolvedPath))
|
|
17263
17481
|
return;
|
|
17264
17482
|
visited.add(resolvedPath);
|
|
17265
|
-
if (!
|
|
17483
|
+
if (!existsSync28(resolvedPath) || resolvedPath.endsWith(".d.ts"))
|
|
17266
17484
|
return;
|
|
17267
17485
|
stats.filesVisited += 1;
|
|
17268
17486
|
const source = await readFileForAotTransform(resolvedPath, readFile9);
|
|
@@ -17293,10 +17511,10 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
17293
17511
|
return { stats, transformedSources };
|
|
17294
17512
|
}, compileAngularFiles = async (inputPaths, outDir, stylePreprocessors) => {
|
|
17295
17513
|
const islandMetadataByOutputPath = await traceAngularPhase("aot/island-metadata", () => new Map(inputPaths.map((inputPath) => {
|
|
17296
|
-
const outputPath =
|
|
17514
|
+
const outputPath = resolve30(join39(outDir, relative14(process.cwd(), resolve30(inputPath)).replace(/\.[cm]?[tj]sx?$/, ".js")));
|
|
17297
17515
|
return [
|
|
17298
17516
|
outputPath,
|
|
17299
|
-
buildIslandMetadataExports(
|
|
17517
|
+
buildIslandMetadataExports(readFileSync27(inputPath, "utf-8"))
|
|
17300
17518
|
];
|
|
17301
17519
|
})), { entries: inputPaths.length });
|
|
17302
17520
|
await traceAngularPhase("aot/preload-compiler", () => import("@angular/compiler"));
|
|
@@ -17304,7 +17522,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
17304
17522
|
const tsLibDir = await traceAngularPhase("aot/resolve-typescript-lib", () => {
|
|
17305
17523
|
const tsPath = __require.resolve("typescript");
|
|
17306
17524
|
const tsRootDir = dirname21(tsPath);
|
|
17307
|
-
return tsRootDir.endsWith("lib") ? tsRootDir :
|
|
17525
|
+
return tsRootDir.endsWith("lib") ? tsRootDir : resolve30(tsRootDir, "lib");
|
|
17308
17526
|
});
|
|
17309
17527
|
const config = await traceAngularPhase("aot/read-configuration", () => readConfiguration("./tsconfig.json"));
|
|
17310
17528
|
const options = {
|
|
@@ -17340,13 +17558,13 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
17340
17558
|
const originalGetSourceFile = host2.getSourceFile;
|
|
17341
17559
|
host2.getSourceFile = (fileName, languageVersion, onError) => {
|
|
17342
17560
|
if (fileName.startsWith("lib.") && fileName.endsWith(".d.ts") && tsLibDir) {
|
|
17343
|
-
const resolvedPath =
|
|
17561
|
+
const resolvedPath = join39(tsLibDir, fileName);
|
|
17344
17562
|
return originalGetSourceFile?.call(host2, resolvedPath, languageVersion, onError);
|
|
17345
17563
|
}
|
|
17346
17564
|
return originalGetSourceFile?.call(host2, fileName, languageVersion, onError);
|
|
17347
17565
|
};
|
|
17348
17566
|
const emitted = {};
|
|
17349
|
-
const resolvedOutDir =
|
|
17567
|
+
const resolvedOutDir = resolve30(outDir);
|
|
17350
17568
|
host2.writeFile = (fileName, text2) => {
|
|
17351
17569
|
const relativePath = resolveRelativePath(fileName, resolvedOutDir, outDir);
|
|
17352
17570
|
emitted[relativePath] = text2;
|
|
@@ -17368,12 +17586,12 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
17368
17586
|
if (!fileName.endsWith(".ts") || fileName.endsWith(".d.ts")) {
|
|
17369
17587
|
return source;
|
|
17370
17588
|
}
|
|
17371
|
-
const resolvedPath =
|
|
17589
|
+
const resolvedPath = resolve30(fileName);
|
|
17372
17590
|
return transformedSources.get(resolvedPath) ?? source;
|
|
17373
17591
|
};
|
|
17374
17592
|
const originalGetSourceFileForCompile = host2.getSourceFile;
|
|
17375
17593
|
host2.getSourceFile = (fileName, languageVersion, onError) => {
|
|
17376
|
-
const source = transformedSources.get(
|
|
17594
|
+
const source = transformedSources.get(resolve30(fileName));
|
|
17377
17595
|
if (source) {
|
|
17378
17596
|
return ts14.createSourceFile(fileName, source, languageVersion, true);
|
|
17379
17597
|
}
|
|
@@ -17395,9 +17613,9 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
17395
17613
|
const entries = await traceAngularPhase("aot/postprocess-emitted-js", () => {
|
|
17396
17614
|
const rawEntries = Object.entries(emitted).filter(([fileName]) => fileName.endsWith(".js")).map(([fileName, content]) => ({
|
|
17397
17615
|
content,
|
|
17398
|
-
target:
|
|
17616
|
+
target: join39(outDir, fileName)
|
|
17399
17617
|
}));
|
|
17400
|
-
const outputFiles = new Set(rawEntries.map(({ target }) =>
|
|
17618
|
+
const outputFiles = new Set(rawEntries.map(({ target }) => resolve30(target)));
|
|
17401
17619
|
return rawEntries.map(({ content, target }) => {
|
|
17402
17620
|
let processedContent = content.replace(/from\s+(['"])(\.\.?\/[^'"]+)(\1)/g, (match, quote, path) => {
|
|
17403
17621
|
const rewritten = rewriteRelativeJsSpecifier(target, path, outputFiles);
|
|
@@ -17412,7 +17630,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
17412
17630
|
return cleaned ? `import { ${cleaned}, InternalInjectFlags } from '@angular/core'` : `import { InternalInjectFlags } from '@angular/core'`;
|
|
17413
17631
|
});
|
|
17414
17632
|
processedContent = processedContent.replace(/\b(?<!Internal)InjectFlags\b/g, "InternalInjectFlags");
|
|
17415
|
-
processedContent += islandMetadataByOutputPath.get(
|
|
17633
|
+
processedContent += islandMetadataByOutputPath.get(resolve30(target)) ?? "";
|
|
17416
17634
|
return { content: processedContent, target };
|
|
17417
17635
|
});
|
|
17418
17636
|
});
|
|
@@ -17422,7 +17640,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
17422
17640
|
})), { outputs: entries.length });
|
|
17423
17641
|
return await traceAngularPhase("aot/collect-output-paths", () => entries.map(({ target }) => target), { outputs: entries.length });
|
|
17424
17642
|
}, compileAngularFile = async (inputPath, outDir, stylePreprocessors) => compileAngularFiles([inputPath], outDir, stylePreprocessors), jitContentCache, invalidateAngularJitCache = (filePath) => {
|
|
17425
|
-
jitContentCache.delete(
|
|
17643
|
+
jitContentCache.delete(resolve30(filePath));
|
|
17426
17644
|
}, wrapperOutputCache, escapeTemplateContent = (content) => content.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$\{/g, "\\${"), findUncommentedMatch = (source, pattern) => {
|
|
17427
17645
|
const re2 = new RegExp(pattern.source, pattern.flags.includes("g") ? pattern.flags : pattern.flags + "g");
|
|
17428
17646
|
let match;
|
|
@@ -17435,8 +17653,8 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
17435
17653
|
}
|
|
17436
17654
|
return null;
|
|
17437
17655
|
}, resolveAngularDeferImportSpecifier = () => {
|
|
17438
|
-
const sourceEntry =
|
|
17439
|
-
if (
|
|
17656
|
+
const sourceEntry = resolve30(import.meta.dir, "../angular/components/index.ts");
|
|
17657
|
+
if (existsSync28(sourceEntry)) {
|
|
17440
17658
|
return sourceEntry.replace(/\\/g, "/");
|
|
17441
17659
|
}
|
|
17442
17660
|
return "@absolutejs/absolute/angular/components";
|
|
@@ -17564,7 +17782,7 @@ ${slot.resolvedBindings.map((binding) => ` "${binding.key}": this.__absoluteDef
|
|
|
17564
17782
|
${fields}
|
|
17565
17783
|
`);
|
|
17566
17784
|
}, readAndEscapeFile = async (filePath, stylePreprocessors) => {
|
|
17567
|
-
if (!
|
|
17785
|
+
if (!existsSync28(filePath)) {
|
|
17568
17786
|
throw new Error(`Unable to inline Angular style resource: file not found at ${filePath}`);
|
|
17569
17787
|
}
|
|
17570
17788
|
const content = await compileStyleFileIfNeeded(filePath, stylePreprocessors);
|
|
@@ -17572,8 +17790,8 @@ ${fields}
|
|
|
17572
17790
|
}, inlineTemplateAndLowerDefer = async (source, fileDir) => {
|
|
17573
17791
|
const templateUrlMatch = findUncommentedMatch(source, /templateUrl\s*:\s*['"]([^'"]+)['"]/);
|
|
17574
17792
|
if (templateUrlMatch?.[1]) {
|
|
17575
|
-
const templatePath =
|
|
17576
|
-
if (!
|
|
17793
|
+
const templatePath = join39(fileDir, templateUrlMatch[1]);
|
|
17794
|
+
if (!existsSync28(templatePath)) {
|
|
17577
17795
|
throw new Error(`Unable to inline Angular templateUrl "${templateUrlMatch[1]}": file not found at ${templatePath}`);
|
|
17578
17796
|
}
|
|
17579
17797
|
const templateRaw2 = await fs5.readFile(templatePath, "utf-8");
|
|
@@ -17603,11 +17821,11 @@ ${fields}
|
|
|
17603
17821
|
}, inlineTemplateAndLowerDeferSync = (source, fileDir) => {
|
|
17604
17822
|
const templateUrlMatch = findUncommentedMatch(source, /templateUrl\s*:\s*['"]([^'"]+)['"]/);
|
|
17605
17823
|
if (templateUrlMatch?.[1]) {
|
|
17606
|
-
const templatePath =
|
|
17607
|
-
if (!
|
|
17824
|
+
const templatePath = join39(fileDir, templateUrlMatch[1]);
|
|
17825
|
+
if (!existsSync28(templatePath)) {
|
|
17608
17826
|
throw new Error(`Unable to inline Angular templateUrl "${templateUrlMatch[1]}": file not found at ${templatePath}`);
|
|
17609
17827
|
}
|
|
17610
|
-
const templateRaw2 =
|
|
17828
|
+
const templateRaw2 = readFileSync27(templatePath, "utf-8");
|
|
17611
17829
|
const lowered2 = lowerAngularDeferSyntax(templateRaw2);
|
|
17612
17830
|
const escaped2 = escapeTemplateContent(lowered2.template);
|
|
17613
17831
|
const replacedSource2 = source.slice(0, templateUrlMatch.index) + `template: \`${escaped2}\`` + source.slice(templateUrlMatch.index + templateUrlMatch[0].length);
|
|
@@ -17640,7 +17858,7 @@ ${fields}
|
|
|
17640
17858
|
return source;
|
|
17641
17859
|
const stylePromises = urlMatches.map((urlMatch) => {
|
|
17642
17860
|
const styleUrl = urlMatch.replace(/['"]/g, "");
|
|
17643
|
-
return readAndEscapeFile(
|
|
17861
|
+
return readAndEscapeFile(join39(fileDir, styleUrl), stylePreprocessors);
|
|
17644
17862
|
});
|
|
17645
17863
|
const results = await Promise.all(stylePromises);
|
|
17646
17864
|
const inlinedStyles = results.filter(Boolean).map((escaped) => `\`${escaped}\``);
|
|
@@ -17651,7 +17869,7 @@ ${fields}
|
|
|
17651
17869
|
const styleUrlMatch = findUncommentedMatch(source, /styleUrl\s*:\s*['"]([^'"]+)['"]/);
|
|
17652
17870
|
if (!styleUrlMatch?.[1])
|
|
17653
17871
|
return source;
|
|
17654
|
-
const escaped = await readAndEscapeFile(
|
|
17872
|
+
const escaped = await readAndEscapeFile(join39(fileDir, styleUrlMatch[1]), stylePreprocessors);
|
|
17655
17873
|
if (!escaped)
|
|
17656
17874
|
return source;
|
|
17657
17875
|
return source.slice(0, styleUrlMatch.index) + `styles: [\`${escaped}\`]` + source.slice(styleUrlMatch.index + styleUrlMatch[0].length);
|
|
@@ -17725,10 +17943,10 @@ ${fields}
|
|
|
17725
17943
|
return "";
|
|
17726
17944
|
}
|
|
17727
17945
|
}, compileAngularFileJIT = async (inputPath, outDir, rootDir, stylePreprocessors, cacheBuster) => {
|
|
17728
|
-
const entryPath =
|
|
17946
|
+
const entryPath = resolve30(inputPath);
|
|
17729
17947
|
const allOutputs = [];
|
|
17730
17948
|
const visited = new Set;
|
|
17731
|
-
const baseDir =
|
|
17949
|
+
const baseDir = resolve30(rootDir ?? process.cwd());
|
|
17732
17950
|
let usesLegacyAnimations = false;
|
|
17733
17951
|
const angularTranspiler = new Bun.Transpiler({
|
|
17734
17952
|
loader: "ts",
|
|
@@ -17747,16 +17965,16 @@ ${fields}
|
|
|
17747
17965
|
`${candidate}.js`,
|
|
17748
17966
|
`${candidate}.jsx`,
|
|
17749
17967
|
`${candidate}.json`,
|
|
17750
|
-
|
|
17751
|
-
|
|
17752
|
-
|
|
17753
|
-
|
|
17968
|
+
join39(candidate, "index.ts"),
|
|
17969
|
+
join39(candidate, "index.tsx"),
|
|
17970
|
+
join39(candidate, "index.js"),
|
|
17971
|
+
join39(candidate, "index.jsx")
|
|
17754
17972
|
];
|
|
17755
|
-
return candidates.find((file4) =>
|
|
17973
|
+
return candidates.find((file4) => existsSync28(file4));
|
|
17756
17974
|
};
|
|
17757
17975
|
const resolveLocalImport = (specifier, fromDir) => {
|
|
17758
17976
|
if (specifier.startsWith(".") || specifier.startsWith("/")) {
|
|
17759
|
-
return resolveSourceFile2(
|
|
17977
|
+
return resolveSourceFile2(resolve30(fromDir, specifier));
|
|
17760
17978
|
}
|
|
17761
17979
|
const aliased = matchTsconfigAlias(specifier, tsconfigAliases.aliases, tsconfigAliases.baseUrl, resolveSourceFile2);
|
|
17762
17980
|
if (aliased)
|
|
@@ -17765,7 +17983,7 @@ ${fields}
|
|
|
17765
17983
|
const resolved = Bun.resolveSync(specifier, fromDir);
|
|
17766
17984
|
if (resolved.includes("/node_modules/"))
|
|
17767
17985
|
return;
|
|
17768
|
-
const absolute =
|
|
17986
|
+
const absolute = resolve30(resolved);
|
|
17769
17987
|
if (!absolute.startsWith(baseDir))
|
|
17770
17988
|
return;
|
|
17771
17989
|
return resolveSourceFile2(absolute);
|
|
@@ -17777,10 +17995,10 @@ ${fields}
|
|
|
17777
17995
|
const inputDir = dirname21(sourcePath);
|
|
17778
17996
|
const fileBase = basename12(sourcePath).replace(/\.[cm]?[tj]sx?$/, ".js");
|
|
17779
17997
|
if (inputDir === outDir || inputDir.startsWith(`${outDir}${sep3}`)) {
|
|
17780
|
-
return
|
|
17998
|
+
return join39(inputDir, fileBase);
|
|
17781
17999
|
}
|
|
17782
18000
|
const relativeDir = inputDir.startsWith(baseDir) ? inputDir.substring(baseDir.length + 1) : inputDir;
|
|
17783
|
-
return
|
|
18001
|
+
return join39(outDir, relativeDir, fileBase);
|
|
17784
18002
|
};
|
|
17785
18003
|
const withCacheBuster = (specifier) => {
|
|
17786
18004
|
if (!cacheBuster)
|
|
@@ -17817,21 +18035,21 @@ ${fields}
|
|
|
17817
18035
|
return `${prefix}${dots}`;
|
|
17818
18036
|
return `${prefix}../${dots}`;
|
|
17819
18037
|
});
|
|
17820
|
-
if (
|
|
18038
|
+
if (resolve30(actualPath) === entryPath) {
|
|
17821
18039
|
processedContent += buildIslandMetadataExports(sourceCode);
|
|
17822
18040
|
}
|
|
17823
18041
|
return processedContent;
|
|
17824
18042
|
};
|
|
17825
18043
|
const transpileFile = async (filePath) => {
|
|
17826
|
-
const resolved =
|
|
18044
|
+
const resolved = resolve30(filePath);
|
|
17827
18045
|
if (visited.has(resolved))
|
|
17828
18046
|
return;
|
|
17829
18047
|
visited.add(resolved);
|
|
17830
|
-
if (resolved.endsWith(".json") &&
|
|
18048
|
+
if (resolved.endsWith(".json") && existsSync28(resolved)) {
|
|
17831
18049
|
const inputDir2 = dirname21(resolved);
|
|
17832
18050
|
const relativeDir2 = inputDir2.startsWith(baseDir) ? inputDir2.substring(baseDir.length + 1) : inputDir2;
|
|
17833
|
-
const targetDir2 =
|
|
17834
|
-
const targetPath2 =
|
|
18051
|
+
const targetDir2 = join39(outDir, relativeDir2);
|
|
18052
|
+
const targetPath2 = join39(targetDir2, basename12(resolved));
|
|
17835
18053
|
await fs5.mkdir(targetDir2, { recursive: true });
|
|
17836
18054
|
await fs5.copyFile(resolved, targetPath2);
|
|
17837
18055
|
allOutputs.push(targetPath2);
|
|
@@ -17840,7 +18058,7 @@ ${fields}
|
|
|
17840
18058
|
let actualPath = resolved;
|
|
17841
18059
|
if (!actualPath.endsWith(".ts"))
|
|
17842
18060
|
actualPath += ".ts";
|
|
17843
|
-
if (!
|
|
18061
|
+
if (!existsSync28(actualPath))
|
|
17844
18062
|
return;
|
|
17845
18063
|
let sourceCode = await fs5.readFile(actualPath, "utf-8");
|
|
17846
18064
|
const inlined = await inlineResources(sourceCode, dirname21(actualPath), stylePreprocessors);
|
|
@@ -17875,10 +18093,10 @@ ${fields}
|
|
|
17875
18093
|
importRewrites.set(specifier, relativeRewrite);
|
|
17876
18094
|
return resolved2;
|
|
17877
18095
|
}).filter((path) => Boolean(path));
|
|
17878
|
-
const isEntry =
|
|
18096
|
+
const isEntry = resolve30(actualPath) === resolve30(entryPath);
|
|
17879
18097
|
const contentHash = Bun.hash(sourceCode).toString(BASE_36_RADIX);
|
|
17880
18098
|
const cacheKey2 = actualPath;
|
|
17881
|
-
const shouldWriteFile = cacheBuster && isEntry ? true : jitContentCache.get(cacheKey2) !== contentHash || !
|
|
18099
|
+
const shouldWriteFile = cacheBuster && isEntry ? true : jitContentCache.get(cacheKey2) !== contentHash || !existsSync28(targetPath);
|
|
17882
18100
|
if (shouldWriteFile) {
|
|
17883
18101
|
const processedContent = transpileAndRewrite(sourceCode, relativeDir, actualPath, importRewrites);
|
|
17884
18102
|
const preservedInjection = await readPreservedInjection(targetPath);
|
|
@@ -17891,7 +18109,7 @@ ${fields}
|
|
|
17891
18109
|
};
|
|
17892
18110
|
await transpileFile(inputPath);
|
|
17893
18111
|
const entryOutputPath = toOutputPath(entryPath);
|
|
17894
|
-
if (
|
|
18112
|
+
if (existsSync28(entryOutputPath)) {
|
|
17895
18113
|
const entryOutput = await fs5.readFile(entryOutputPath, "utf-8");
|
|
17896
18114
|
const withoutLegacyFlag = entryOutput.replace(/\nexport const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;\n?/g, `
|
|
17897
18115
|
`);
|
|
@@ -17910,23 +18128,23 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
17910
18128
|
return { clientPaths: [...emptyPaths], serverPaths: [...emptyPaths] };
|
|
17911
18129
|
}
|
|
17912
18130
|
const compiledRoot = compiledParent;
|
|
17913
|
-
const indexesDir =
|
|
18131
|
+
const indexesDir = join39(compiledParent, "indexes");
|
|
17914
18132
|
await traceAngularPhase("setup/create-indexes-dir", () => fs5.mkdir(indexesDir, { recursive: true }));
|
|
17915
|
-
const aotOutputs = hmr ? [] : await traceAngularPhase("aot/compile-files", () => compileAngularFiles(entryPoints.map((entry) =>
|
|
18133
|
+
const aotOutputs = hmr ? [] : await traceAngularPhase("aot/compile-files", () => compileAngularFiles(entryPoints.map((entry) => resolve30(entry)), compiledRoot, stylePreprocessors), { entries: entryPoints.length });
|
|
17916
18134
|
if (!hmr) {
|
|
17917
18135
|
await traceAngularPhase("aot/copy-json-resources", async () => {
|
|
17918
18136
|
const cwd = process.cwd();
|
|
17919
|
-
const angularSrcDir =
|
|
17920
|
-
if (!
|
|
18137
|
+
const angularSrcDir = resolve30(outRoot);
|
|
18138
|
+
if (!existsSync28(angularSrcDir))
|
|
17921
18139
|
return;
|
|
17922
18140
|
const jsonGlob = new Glob6("**/*.json");
|
|
17923
18141
|
for (const rel of jsonGlob.scanSync({
|
|
17924
18142
|
absolute: false,
|
|
17925
18143
|
cwd: angularSrcDir
|
|
17926
18144
|
})) {
|
|
17927
|
-
const sourcePath =
|
|
18145
|
+
const sourcePath = join39(angularSrcDir, rel);
|
|
17928
18146
|
const cwdRel = relative14(cwd, sourcePath);
|
|
17929
|
-
const targetPath =
|
|
18147
|
+
const targetPath = join39(compiledRoot, cwdRel);
|
|
17930
18148
|
await fs5.mkdir(dirname21(targetPath), { recursive: true });
|
|
17931
18149
|
await fs5.copyFile(sourcePath, targetPath);
|
|
17932
18150
|
}
|
|
@@ -17934,7 +18152,7 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
17934
18152
|
}
|
|
17935
18153
|
const usesLegacyAngularAnimations = await traceAngularPhase("setup/legacy-animation-resolver", () => createLegacyAngularAnimationUsageResolver(outRoot));
|
|
17936
18154
|
const compileTasks = entryPoints.map(async (entry) => {
|
|
17937
|
-
const resolvedEntry =
|
|
18155
|
+
const resolvedEntry = resolve30(entry);
|
|
17938
18156
|
const relativeEntry = relative14(outRoot, resolvedEntry).replace(/\.[tj]s$/, ".js");
|
|
17939
18157
|
const compileEntry = () => compileAngularFileJIT(resolvedEntry, compiledRoot, outRoot, stylePreprocessors);
|
|
17940
18158
|
let outputs = hmr ? await traceAngularPhase("jit/compile-entry", compileEntry, {
|
|
@@ -17943,24 +18161,24 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
17943
18161
|
const fileBase = basename12(resolvedEntry).replace(/\.[tj]s$/, "");
|
|
17944
18162
|
const jsName = `${fileBase}.js`;
|
|
17945
18163
|
const compiledFallbackPaths = [
|
|
17946
|
-
|
|
17947
|
-
|
|
17948
|
-
|
|
17949
|
-
].map((file4) =>
|
|
18164
|
+
join39(compiledRoot, relativeEntry),
|
|
18165
|
+
join39(compiledRoot, "pages", jsName),
|
|
18166
|
+
join39(compiledRoot, jsName)
|
|
18167
|
+
].map((file4) => resolve30(file4));
|
|
17950
18168
|
const resolveRawServerFile = (candidatePaths) => {
|
|
17951
18169
|
const normalizedCandidates = [
|
|
17952
|
-
...candidatePaths.map((file4) =>
|
|
18170
|
+
...candidatePaths.map((file4) => resolve30(file4)),
|
|
17953
18171
|
...compiledFallbackPaths
|
|
17954
18172
|
];
|
|
17955
|
-
let candidate = normalizedCandidates.find((file4) =>
|
|
18173
|
+
let candidate = normalizedCandidates.find((file4) => existsSync28(file4) && file4.endsWith(`${sep3}${relativeEntry}`));
|
|
17956
18174
|
if (!candidate) {
|
|
17957
|
-
candidate = normalizedCandidates.find((file4) =>
|
|
18175
|
+
candidate = normalizedCandidates.find((file4) => existsSync28(file4) && file4.endsWith(`${sep3}pages${sep3}${jsName}`));
|
|
17958
18176
|
}
|
|
17959
18177
|
if (!candidate) {
|
|
17960
|
-
candidate = normalizedCandidates.find((file4) =>
|
|
18178
|
+
candidate = normalizedCandidates.find((file4) => existsSync28(file4) && file4.endsWith(`${sep3}${jsName}`));
|
|
17961
18179
|
}
|
|
17962
18180
|
if (!candidate) {
|
|
17963
|
-
candidate = normalizedCandidates.find((file4) =>
|
|
18181
|
+
candidate = normalizedCandidates.find((file4) => existsSync28(file4));
|
|
17964
18182
|
}
|
|
17965
18183
|
return candidate;
|
|
17966
18184
|
};
|
|
@@ -17968,11 +18186,11 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
17968
18186
|
if (!rawServerFile) {
|
|
17969
18187
|
rawServerFile = await traceAngularPhase("wrapper/resolve-server-output-fallback", () => resolveRawServerFile([]), { entry: resolvedEntry });
|
|
17970
18188
|
}
|
|
17971
|
-
if (rawServerFile && !
|
|
18189
|
+
if (rawServerFile && !existsSync28(rawServerFile)) {
|
|
17972
18190
|
outputs = hmr ? await compileEntry() : aotOutputs;
|
|
17973
18191
|
rawServerFile = await traceAngularPhase("wrapper/resolve-server-output-retry", () => resolveRawServerFile(outputs), { entry: resolvedEntry });
|
|
17974
18192
|
}
|
|
17975
|
-
if (!rawServerFile || !
|
|
18193
|
+
if (!rawServerFile || !existsSync28(rawServerFile)) {
|
|
17976
18194
|
throw new Error(`Compiled output not found for ${entry}. Looking for: ${jsName}. Available: ${[
|
|
17977
18195
|
...outputs,
|
|
17978
18196
|
...compiledFallbackPaths
|
|
@@ -17996,7 +18214,7 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
17996
18214
|
let providersSourceContent = "";
|
|
17997
18215
|
if (providersInjection.appProvidersSource) {
|
|
17998
18216
|
try {
|
|
17999
|
-
providersSourceContent =
|
|
18217
|
+
providersSourceContent = readFileSync27(providersInjection.appProvidersSource, "utf-8");
|
|
18000
18218
|
} catch {}
|
|
18001
18219
|
}
|
|
18002
18220
|
return JSON.stringify({
|
|
@@ -18007,8 +18225,8 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
18007
18225
|
})() : "no-providers";
|
|
18008
18226
|
const serverContentHash = `${Bun.hash(original).toString(BASE_36_RADIX)}.${Bun.hash(providersHashInput).toString(BASE_36_RADIX)}`;
|
|
18009
18227
|
const cachedWrapper = wrapperOutputCache.get(resolvedEntry);
|
|
18010
|
-
const clientFile =
|
|
18011
|
-
if (hmr && cachedWrapper && cachedWrapper.serverHash === serverContentHash &&
|
|
18228
|
+
const clientFile = join39(indexesDir, jsName);
|
|
18229
|
+
if (hmr && cachedWrapper && cachedWrapper.serverHash === serverContentHash && existsSync28(clientFile) && (usesLegacyAnimations || !original.includes("__ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__")) && (!usesLegacyAnimations || original.includes("__ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__"))) {
|
|
18012
18230
|
return {
|
|
18013
18231
|
clientPath: clientFile,
|
|
18014
18232
|
indexUnchanged: true,
|
|
@@ -18039,10 +18257,10 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
18039
18257
|
const fragments = [];
|
|
18040
18258
|
if (providersInjection.appProvidersSource) {
|
|
18041
18259
|
const compiledAppProvidersPath = (() => {
|
|
18042
|
-
const angularDirAbs =
|
|
18043
|
-
const appSourceAbs =
|
|
18260
|
+
const angularDirAbs = resolve30(outRoot);
|
|
18261
|
+
const appSourceAbs = resolve30(providersInjection.appProvidersSource);
|
|
18044
18262
|
const rel = relative14(angularDirAbs, appSourceAbs).replace(/\\/g, "/");
|
|
18045
|
-
return
|
|
18263
|
+
return join39(compiledParent, rel).replace(/\.[cm]?[tj]sx?$/, ".js");
|
|
18046
18264
|
})();
|
|
18047
18265
|
const appProvidersSpec = (() => {
|
|
18048
18266
|
const rel = relative14(dirname21(rawServerFile), compiledAppProvidersPath).replace(/\\/g, "/");
|
|
@@ -18303,7 +18521,7 @@ var init_compileAngular = __esm(() => {
|
|
|
18303
18521
|
init_stylePreprocessor();
|
|
18304
18522
|
init_generatedDir();
|
|
18305
18523
|
devClientDir4 = resolveDevClientDir4();
|
|
18306
|
-
hmrClientPath5 =
|
|
18524
|
+
hmrClientPath5 = join39(devClientDir4, "hmrClient.ts").replace(/\\/g, "/");
|
|
18307
18525
|
jitContentCache = new Map;
|
|
18308
18526
|
wrapperOutputCache = new Map;
|
|
18309
18527
|
PROVIDERS_INJECTION_BLOCK_RE = /\n\/\* __ABS_PROVIDERS_INJECTION_START \*\/[\s\S]*?\/\* __ABS_PROVIDERS_INJECTION_END \*\/\n?/;
|
|
@@ -19019,15 +19237,15 @@ __export(exports_fastHmrCompiler, {
|
|
|
19019
19237
|
takePendingModule: () => takePendingModule,
|
|
19020
19238
|
tryFastHmr: () => tryFastHmr
|
|
19021
19239
|
});
|
|
19022
|
-
import { existsSync as
|
|
19023
|
-
import { dirname as dirname22, extname as extname9, relative as relative15, resolve as
|
|
19240
|
+
import { existsSync as existsSync29, readFileSync as readFileSync28, statSync as statSync2 } from "fs";
|
|
19241
|
+
import { dirname as dirname22, extname as extname9, relative as relative15, resolve as resolve31 } from "path";
|
|
19024
19242
|
import ts18 from "typescript";
|
|
19025
19243
|
var fail = (reason, detail, location) => ({
|
|
19026
19244
|
detail,
|
|
19027
19245
|
ok: false,
|
|
19028
19246
|
reason,
|
|
19029
19247
|
...location ?? {}
|
|
19030
|
-
}),
|
|
19248
|
+
}), fingerprintCache2, pendingModuleCache, ANGULAR_DECORATOR_NAMES, findAngularDecoratorName = (decorators) => {
|
|
19031
19249
|
for (const decorator of decorators) {
|
|
19032
19250
|
if (!ts18.isCallExpression(decorator.expression))
|
|
19033
19251
|
continue;
|
|
@@ -19107,7 +19325,7 @@ var fail = (reason, detail, location) => ({
|
|
|
19107
19325
|
return false;
|
|
19108
19326
|
return true;
|
|
19109
19327
|
}, invalidateFingerprintCache = () => {
|
|
19110
|
-
|
|
19328
|
+
fingerprintCache2.clear();
|
|
19111
19329
|
entityFingerprintCache.clear();
|
|
19112
19330
|
}, primeComponentFingerprint = async (componentFilePath) => {
|
|
19113
19331
|
let source;
|
|
@@ -19152,7 +19370,7 @@ var fail = (reason, detail, location) => ({
|
|
|
19152
19370
|
const { inputs, outputs } = extractInputsAndOutputs(stmt, null);
|
|
19153
19371
|
const componentDir = dirname22(componentFilePath);
|
|
19154
19372
|
const fingerprint = extractFingerprint(stmt, className, decoratorMeta, inputs, outputs, sourceFile, componentDir);
|
|
19155
|
-
|
|
19373
|
+
fingerprintCache2.set(id, fingerprint);
|
|
19156
19374
|
} else {
|
|
19157
19375
|
try {
|
|
19158
19376
|
const entityFingerprint = extractEntityFingerprint(stmt, className, sourceFile);
|
|
@@ -19161,7 +19379,7 @@ var fail = (reason, detail, location) => ({
|
|
|
19161
19379
|
}
|
|
19162
19380
|
}
|
|
19163
19381
|
}, recordFingerprint = (id, fingerprint) => {
|
|
19164
|
-
|
|
19382
|
+
fingerprintCache2.set(id, fingerprint);
|
|
19165
19383
|
}, entityFingerprintCache, entityFingerprintsEqual = (leftValue, rightValue) => {
|
|
19166
19384
|
if (leftValue.className !== rightValue.className)
|
|
19167
19385
|
return false;
|
|
@@ -19335,7 +19553,7 @@ var fail = (reason, detail, location) => ({
|
|
|
19335
19553
|
if (!spec.startsWith(".") && !spec.startsWith("/")) {
|
|
19336
19554
|
return true;
|
|
19337
19555
|
}
|
|
19338
|
-
const base =
|
|
19556
|
+
const base = resolve31(componentDir, spec);
|
|
19339
19557
|
const candidates = [
|
|
19340
19558
|
`${base}.ts`,
|
|
19341
19559
|
`${base}.tsx`,
|
|
@@ -19343,11 +19561,11 @@ var fail = (reason, detail, location) => ({
|
|
|
19343
19561
|
`${base}/index.tsx`
|
|
19344
19562
|
];
|
|
19345
19563
|
for (const candidate of candidates) {
|
|
19346
|
-
if (!
|
|
19564
|
+
if (!existsSync29(candidate))
|
|
19347
19565
|
continue;
|
|
19348
19566
|
let content;
|
|
19349
19567
|
try {
|
|
19350
|
-
content =
|
|
19568
|
+
content = readFileSync28(candidate, "utf-8");
|
|
19351
19569
|
} catch {
|
|
19352
19570
|
continue;
|
|
19353
19571
|
}
|
|
@@ -19935,7 +20153,7 @@ var fail = (reason, detail, location) => ({
|
|
|
19935
20153
|
return cached.info;
|
|
19936
20154
|
let source;
|
|
19937
20155
|
try {
|
|
19938
|
-
source =
|
|
20156
|
+
source = readFileSync28(filePath, "utf-8");
|
|
19939
20157
|
} catch {
|
|
19940
20158
|
childComponentInfoCache.set(cacheKey2, {
|
|
19941
20159
|
info: null,
|
|
@@ -19989,7 +20207,7 @@ var fail = (reason, detail, location) => ({
|
|
|
19989
20207
|
return cached.info;
|
|
19990
20208
|
let content;
|
|
19991
20209
|
try {
|
|
19992
|
-
content =
|
|
20210
|
+
content = readFileSync28(dtsPath, "utf-8");
|
|
19993
20211
|
} catch {
|
|
19994
20212
|
childComponentInfoCache.set(cacheKey2, {
|
|
19995
20213
|
info: null,
|
|
@@ -20108,11 +20326,11 @@ var fail = (reason, detail, location) => ({
|
|
|
20108
20326
|
if (visited.has(startDtsPath))
|
|
20109
20327
|
return null;
|
|
20110
20328
|
visited.add(startDtsPath);
|
|
20111
|
-
if (!
|
|
20329
|
+
if (!existsSync29(startDtsPath))
|
|
20112
20330
|
return null;
|
|
20113
20331
|
let content;
|
|
20114
20332
|
try {
|
|
20115
|
-
content =
|
|
20333
|
+
content = readFileSync28(startDtsPath, "utf-8");
|
|
20116
20334
|
} catch {
|
|
20117
20335
|
return null;
|
|
20118
20336
|
}
|
|
@@ -20151,7 +20369,7 @@ var fail = (reason, detail, location) => ({
|
|
|
20151
20369
|
return null;
|
|
20152
20370
|
}, resolveDtsFromSpec = (spec, fromDir) => {
|
|
20153
20371
|
const stripped = spec.replace(/\.[mc]?js$/, "");
|
|
20154
|
-
const base =
|
|
20372
|
+
const base = resolve31(fromDir, stripped);
|
|
20155
20373
|
const candidates = [
|
|
20156
20374
|
`${base}.d.ts`,
|
|
20157
20375
|
`${base}.d.mts`,
|
|
@@ -20161,21 +20379,21 @@ var fail = (reason, detail, location) => ({
|
|
|
20161
20379
|
`${base}/index.d.cts`
|
|
20162
20380
|
];
|
|
20163
20381
|
for (const c of candidates) {
|
|
20164
|
-
if (
|
|
20382
|
+
if (existsSync29(c))
|
|
20165
20383
|
return c;
|
|
20166
20384
|
}
|
|
20167
20385
|
return null;
|
|
20168
20386
|
}, findPackageDtsForJs = (jsPath) => {
|
|
20169
20387
|
const sibling = jsPath.replace(/\.[mc]?js$/, ".d.ts");
|
|
20170
|
-
if (
|
|
20388
|
+
if (existsSync29(sibling))
|
|
20171
20389
|
return sibling;
|
|
20172
20390
|
const mirror = jsPath.replace(/\/dist\//, "/dist/src/").replace(/\.[mc]?js$/, ".d.ts");
|
|
20173
|
-
if (
|
|
20391
|
+
if (existsSync29(mirror))
|
|
20174
20392
|
return mirror;
|
|
20175
20393
|
return null;
|
|
20176
20394
|
}, resolveChildComponentInfo = (className, spec, componentDir, projectRoot) => {
|
|
20177
20395
|
if (spec.startsWith(".") || spec.startsWith("/")) {
|
|
20178
|
-
const base =
|
|
20396
|
+
const base = resolve31(componentDir, spec);
|
|
20179
20397
|
const candidates = [
|
|
20180
20398
|
`${base}.ts`,
|
|
20181
20399
|
`${base}.tsx`,
|
|
@@ -20183,7 +20401,7 @@ var fail = (reason, detail, location) => ({
|
|
|
20183
20401
|
`${base}/index.tsx`
|
|
20184
20402
|
];
|
|
20185
20403
|
for (const candidate of candidates) {
|
|
20186
|
-
if (!
|
|
20404
|
+
if (!existsSync29(candidate))
|
|
20187
20405
|
continue;
|
|
20188
20406
|
const info = getChildComponentInfoFromTsSource(candidate, className);
|
|
20189
20407
|
if (info)
|
|
@@ -20330,7 +20548,7 @@ var fail = (reason, detail, location) => ({
|
|
|
20330
20548
|
return cached.hasProviders;
|
|
20331
20549
|
let source;
|
|
20332
20550
|
try {
|
|
20333
|
-
source =
|
|
20551
|
+
source = readFileSync28(filePath, "utf8");
|
|
20334
20552
|
} catch {
|
|
20335
20553
|
return true;
|
|
20336
20554
|
}
|
|
@@ -20394,14 +20612,14 @@ var fail = (reason, detail, location) => ({
|
|
|
20394
20612
|
}
|
|
20395
20613
|
if (!matches)
|
|
20396
20614
|
continue;
|
|
20397
|
-
const resolved =
|
|
20615
|
+
const resolved = resolve31(componentDir, spec);
|
|
20398
20616
|
for (const ext of TS_EXTENSIONS) {
|
|
20399
20617
|
const candidate = resolved + ext;
|
|
20400
|
-
if (
|
|
20618
|
+
if (existsSync29(candidate))
|
|
20401
20619
|
return candidate;
|
|
20402
20620
|
}
|
|
20403
|
-
const indexCandidate =
|
|
20404
|
-
if (
|
|
20621
|
+
const indexCandidate = resolve31(resolved, "index.ts");
|
|
20622
|
+
if (existsSync29(indexCandidate))
|
|
20405
20623
|
return indexCandidate;
|
|
20406
20624
|
}
|
|
20407
20625
|
return null;
|
|
@@ -20638,12 +20856,12 @@ ${transpiled}
|
|
|
20638
20856
|
}
|
|
20639
20857
|
}${staticPatch}`;
|
|
20640
20858
|
}, STYLE_PREPROCESSED_EXT, resolveAndReadStyleResource = (componentDir, url) => {
|
|
20641
|
-
const abs =
|
|
20642
|
-
if (!
|
|
20859
|
+
const abs = resolve31(componentDir, url);
|
|
20860
|
+
if (!existsSync29(abs))
|
|
20643
20861
|
return null;
|
|
20644
20862
|
const ext = extname9(abs).toLowerCase();
|
|
20645
20863
|
if (!STYLE_PREPROCESSED_EXT.has(ext) || ext === ".css") {
|
|
20646
|
-
return
|
|
20864
|
+
return readFileSync28(abs, "utf8");
|
|
20647
20865
|
}
|
|
20648
20866
|
try {
|
|
20649
20867
|
return compileStyleFileIfNeededSync(abs);
|
|
@@ -20677,11 +20895,11 @@ ${block}
|
|
|
20677
20895
|
const cached = projectOptionsCache.get(projectRoot);
|
|
20678
20896
|
if (cached !== undefined)
|
|
20679
20897
|
return cached;
|
|
20680
|
-
const tsconfigPath =
|
|
20898
|
+
const tsconfigPath = resolve31(projectRoot, "tsconfig.json");
|
|
20681
20899
|
const opts = {};
|
|
20682
|
-
if (
|
|
20900
|
+
if (existsSync29(tsconfigPath)) {
|
|
20683
20901
|
try {
|
|
20684
|
-
const text2 =
|
|
20902
|
+
const text2 = readFileSync28(tsconfigPath, "utf8");
|
|
20685
20903
|
const parsed = ts18.parseConfigFileTextToJson(tsconfigPath, text2);
|
|
20686
20904
|
if (!parsed.error && parsed.config) {
|
|
20687
20905
|
const cfg = parsed.config;
|
|
@@ -20706,7 +20924,7 @@ ${block}
|
|
|
20706
20924
|
}, tryFastHmr = async (params) => {
|
|
20707
20925
|
const { componentFilePath, className } = params;
|
|
20708
20926
|
const projectRoot = params.projectRoot ?? process.cwd();
|
|
20709
|
-
if (!
|
|
20927
|
+
if (!existsSync29(componentFilePath)) {
|
|
20710
20928
|
return fail("file-not-found", componentFilePath);
|
|
20711
20929
|
}
|
|
20712
20930
|
let compiler;
|
|
@@ -20715,7 +20933,7 @@ ${block}
|
|
|
20715
20933
|
} catch (err) {
|
|
20716
20934
|
return fail("unexpected-error", `import @angular/compiler: ${err}`);
|
|
20717
20935
|
}
|
|
20718
|
-
const tsSource =
|
|
20936
|
+
const tsSource = readFileSync28(componentFilePath, "utf8");
|
|
20719
20937
|
const sourceFile = ts18.createSourceFile(componentFilePath, tsSource, ts18.ScriptTarget.ES2022, true, ts18.ScriptKind.TS);
|
|
20720
20938
|
const classNode = findClassDeclaration(sourceFile, className);
|
|
20721
20939
|
if (!classNode) {
|
|
@@ -20761,11 +20979,11 @@ ${block}
|
|
|
20761
20979
|
templateText = decoratorMeta.template;
|
|
20762
20980
|
templatePath = componentFilePath;
|
|
20763
20981
|
} else if (decoratorMeta.templateUrl) {
|
|
20764
|
-
const tplAbs =
|
|
20765
|
-
if (!
|
|
20982
|
+
const tplAbs = resolve31(componentDir, decoratorMeta.templateUrl);
|
|
20983
|
+
if (!existsSync29(tplAbs)) {
|
|
20766
20984
|
return fail("template-resource-not-found", `Template file not found: ${tplAbs}`, { file: componentFilePath });
|
|
20767
20985
|
}
|
|
20768
|
-
templateText =
|
|
20986
|
+
templateText = readFileSync28(tplAbs, "utf8");
|
|
20769
20987
|
templatePath = tplAbs;
|
|
20770
20988
|
} else {
|
|
20771
20989
|
return fail("unsupported-decorator-args", "missing template/templateUrl");
|
|
@@ -20810,7 +21028,7 @@ ${block}
|
|
|
20810
21028
|
const projectRelPath = relative15(projectRoot, componentFilePath).replace(/\\/g, "/");
|
|
20811
21029
|
const fingerprintId = encodeURIComponent(`${projectRelPath}@${className}`);
|
|
20812
21030
|
const currentFingerprint = extractFingerprint(classNode, className, decoratorMeta, inputs, outputs, sourceFile, componentDir);
|
|
20813
|
-
const cachedFingerprint =
|
|
21031
|
+
const cachedFingerprint = fingerprintCache2.get(fingerprintId);
|
|
20814
21032
|
const fingerprintChanged = cachedFingerprint !== undefined && !fingerprintsEqual(cachedFingerprint, currentFingerprint);
|
|
20815
21033
|
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);
|
|
20816
21034
|
const sourceFileObj = new compiler.ParseSourceFile(tsSource, componentFilePath);
|
|
@@ -21017,7 +21235,7 @@ ${methodsBlock}
|
|
|
21017
21235
|
moduleText = moduleText.slice(0, lastBrace) + tail + moduleText.slice(lastBrace);
|
|
21018
21236
|
}
|
|
21019
21237
|
}
|
|
21020
|
-
|
|
21238
|
+
fingerprintCache2.set(fingerprintId, currentFingerprint);
|
|
21021
21239
|
setPendingModule(fingerprintId, moduleText);
|
|
21022
21240
|
return {
|
|
21023
21241
|
componentSource: sourceFile,
|
|
@@ -21034,7 +21252,7 @@ var init_fastHmrCompiler = __esm(() => {
|
|
|
21034
21252
|
init_stylePreprocessor();
|
|
21035
21253
|
init_hmrImportGenerator();
|
|
21036
21254
|
init_typescript_translator();
|
|
21037
|
-
|
|
21255
|
+
fingerprintCache2 = new Map;
|
|
21038
21256
|
pendingModuleCache = new Map;
|
|
21039
21257
|
ANGULAR_DECORATOR_NAMES = new Set([
|
|
21040
21258
|
"Component",
|
|
@@ -21531,9 +21749,9 @@ __export(exports_compileEmber, {
|
|
|
21531
21749
|
getEmberCompiledRoot: () => getEmberCompiledRoot,
|
|
21532
21750
|
getEmberServerCompiledDir: () => getEmberServerCompiledDir
|
|
21533
21751
|
});
|
|
21534
|
-
import { existsSync as
|
|
21752
|
+
import { existsSync as existsSync30 } from "fs";
|
|
21535
21753
|
import { mkdir as mkdir11, rm as rm8 } from "fs/promises";
|
|
21536
|
-
import { basename as basename13, dirname as dirname23, extname as extname10, join as
|
|
21754
|
+
import { basename as basename13, dirname as dirname23, extname as extname10, join as join40, resolve as resolve32 } from "path";
|
|
21537
21755
|
var {build: bunBuild2, Transpiler: Transpiler4, write: write4, file: file4 } = globalThis.Bun;
|
|
21538
21756
|
var cachedPreprocessor = null, getPreprocessor = async () => {
|
|
21539
21757
|
if (cachedPreprocessor)
|
|
@@ -21629,11 +21847,11 @@ export const importSync = (specifier) => {
|
|
|
21629
21847
|
const originalImporter = stagedSourceMap.get(args.importer);
|
|
21630
21848
|
if (!originalImporter)
|
|
21631
21849
|
return;
|
|
21632
|
-
const candidateBase =
|
|
21850
|
+
const candidateBase = resolve32(dirname23(originalImporter), args.path);
|
|
21633
21851
|
const extensionsToTry = ["", ".gts", ".gjs", ".ts", ".js"];
|
|
21634
21852
|
for (const ext of extensionsToTry) {
|
|
21635
21853
|
const candidate = candidateBase + ext;
|
|
21636
|
-
if (
|
|
21854
|
+
if (existsSync30(candidate))
|
|
21637
21855
|
return { path: candidate };
|
|
21638
21856
|
}
|
|
21639
21857
|
return;
|
|
@@ -21652,8 +21870,8 @@ export const importSync = (specifier) => {
|
|
|
21652
21870
|
build2.onResolve({ filter: /^@(?:ember|glimmer|simple-dom)\// }, (args) => {
|
|
21653
21871
|
if (standalonePackages.has(args.path))
|
|
21654
21872
|
return;
|
|
21655
|
-
const internal =
|
|
21656
|
-
if (
|
|
21873
|
+
const internal = join40(cwd, "node_modules/ember-source/dist/packages", args.path, "index.js");
|
|
21874
|
+
if (existsSync30(internal))
|
|
21657
21875
|
return { path: internal };
|
|
21658
21876
|
return;
|
|
21659
21877
|
});
|
|
@@ -21688,7 +21906,7 @@ export const renderToHTML = (props = {}) => {
|
|
|
21688
21906
|
export { PageComponent };
|
|
21689
21907
|
export default PageComponent;
|
|
21690
21908
|
`, compileEmberFile = async (entry, compiledRoot, cwd = process.cwd()) => {
|
|
21691
|
-
const resolvedEntry =
|
|
21909
|
+
const resolvedEntry = resolve32(entry);
|
|
21692
21910
|
const source = await file4(resolvedEntry).text();
|
|
21693
21911
|
let preprocessed = source;
|
|
21694
21912
|
if (isTemplateTagFile(resolvedEntry)) {
|
|
@@ -21700,16 +21918,16 @@ export default PageComponent;
|
|
|
21700
21918
|
}
|
|
21701
21919
|
const transpiled = transpiler5.transformSync(preprocessed);
|
|
21702
21920
|
const baseName = basename13(resolvedEntry).replace(/\.(gjs|gts|ts|js)$/, "");
|
|
21703
|
-
const tmpDir =
|
|
21704
|
-
const serverDir =
|
|
21705
|
-
const clientDir =
|
|
21921
|
+
const tmpDir = join40(compiledRoot, "_tmp");
|
|
21922
|
+
const serverDir = join40(compiledRoot, "server");
|
|
21923
|
+
const clientDir = join40(compiledRoot, "client");
|
|
21706
21924
|
await Promise.all([
|
|
21707
21925
|
mkdir11(tmpDir, { recursive: true }),
|
|
21708
21926
|
mkdir11(serverDir, { recursive: true }),
|
|
21709
21927
|
mkdir11(clientDir, { recursive: true })
|
|
21710
21928
|
]);
|
|
21711
|
-
const tmpPagePath =
|
|
21712
|
-
const tmpHarnessPath =
|
|
21929
|
+
const tmpPagePath = resolve32(join40(tmpDir, `${baseName}.module.js`));
|
|
21930
|
+
const tmpHarnessPath = resolve32(join40(tmpDir, `${baseName}.harness.js`));
|
|
21713
21931
|
await Promise.all([
|
|
21714
21932
|
write4(tmpPagePath, transpiled),
|
|
21715
21933
|
write4(tmpHarnessPath, generateServerHarness(tmpPagePath))
|
|
@@ -21717,7 +21935,7 @@ export default PageComponent;
|
|
|
21717
21935
|
const stagedSourceMap = new Map([
|
|
21718
21936
|
[tmpPagePath, resolvedEntry]
|
|
21719
21937
|
]);
|
|
21720
|
-
const serverPath =
|
|
21938
|
+
const serverPath = join40(serverDir, `${baseName}.js`);
|
|
21721
21939
|
const buildResult = await bunBuild2({
|
|
21722
21940
|
entrypoints: [tmpHarnessPath],
|
|
21723
21941
|
format: "esm",
|
|
@@ -21734,7 +21952,7 @@ export default PageComponent;
|
|
|
21734
21952
|
console.warn(`\u26A0\uFE0F Ember server build for ${baseName} had errors:`, buildResult.logs);
|
|
21735
21953
|
}
|
|
21736
21954
|
await rm8(tmpDir, { force: true, recursive: true });
|
|
21737
|
-
const clientPath =
|
|
21955
|
+
const clientPath = join40(clientDir, `${baseName}.js`);
|
|
21738
21956
|
await write4(clientPath, transpiled);
|
|
21739
21957
|
return { clientPath, serverPath };
|
|
21740
21958
|
}, compileEmber = async (entries, emberDir, cwd = process.cwd(), _hmr = false) => {
|
|
@@ -21751,7 +21969,7 @@ export default PageComponent;
|
|
|
21751
21969
|
serverPaths: outputs.map((o3) => o3.serverPath)
|
|
21752
21970
|
};
|
|
21753
21971
|
}, compileEmberFileSource = async (entry) => {
|
|
21754
|
-
const resolvedEntry =
|
|
21972
|
+
const resolvedEntry = resolve32(entry);
|
|
21755
21973
|
const source = await file4(resolvedEntry).text();
|
|
21756
21974
|
let preprocessed = source;
|
|
21757
21975
|
if (isTemplateTagFile(resolvedEntry)) {
|
|
@@ -21762,7 +21980,7 @@ export default PageComponent;
|
|
|
21762
21980
|
preprocessed = rewriteTemplateEvalToScope(result.code);
|
|
21763
21981
|
}
|
|
21764
21982
|
return transpiler5.transformSync(preprocessed);
|
|
21765
|
-
}, clearEmberCompilerCache = () => {}, getEmberCompiledRoot = (_emberDir) => getFrameworkGeneratedDir("ember"), getEmberServerCompiledDir = (emberDir) =>
|
|
21983
|
+
}, clearEmberCompilerCache = () => {}, getEmberCompiledRoot = (_emberDir) => getFrameworkGeneratedDir("ember"), getEmberServerCompiledDir = (emberDir) => join40(getEmberCompiledRoot(emberDir), "server"), getEmberClientCompiledDir = (emberDir) => join40(getEmberCompiledRoot(emberDir), "client");
|
|
21766
21984
|
var init_compileEmber = __esm(() => {
|
|
21767
21985
|
init_generatedDir();
|
|
21768
21986
|
transpiler5 = new Transpiler4({
|
|
@@ -21783,25 +22001,25 @@ __export(exports_buildReactVendor, {
|
|
|
21783
22001
|
buildReactVendor: () => buildReactVendor,
|
|
21784
22002
|
computeVendorPaths: () => computeVendorPaths
|
|
21785
22003
|
});
|
|
21786
|
-
import { existsSync as
|
|
21787
|
-
import { join as
|
|
22004
|
+
import { existsSync as existsSync31, mkdirSync as mkdirSync9 } from "fs";
|
|
22005
|
+
import { join as join41, resolve as resolve33 } from "path";
|
|
21788
22006
|
import { rm as rm9 } from "fs/promises";
|
|
21789
22007
|
var {build: bunBuild3 } = globalThis.Bun;
|
|
21790
22008
|
var resolveJsxDevRuntimeCompatPath = () => {
|
|
21791
22009
|
const candidates = [
|
|
21792
|
-
|
|
21793
|
-
|
|
21794
|
-
|
|
21795
|
-
|
|
21796
|
-
|
|
21797
|
-
|
|
22010
|
+
resolve33(import.meta.dir, "react", "jsxDevRuntimeCompat.js"),
|
|
22011
|
+
resolve33(import.meta.dir, "src", "react", "jsxDevRuntimeCompat.ts"),
|
|
22012
|
+
resolve33(import.meta.dir, "..", "react", "jsxDevRuntimeCompat.js"),
|
|
22013
|
+
resolve33(import.meta.dir, "..", "src", "react", "jsxDevRuntimeCompat.ts"),
|
|
22014
|
+
resolve33(import.meta.dir, "..", "..", "dist", "react", "jsxDevRuntimeCompat.js"),
|
|
22015
|
+
resolve33(import.meta.dir, "..", "..", "src", "react", "jsxDevRuntimeCompat.ts")
|
|
21798
22016
|
];
|
|
21799
22017
|
for (const candidate of candidates) {
|
|
21800
|
-
if (
|
|
22018
|
+
if (existsSync31(candidate)) {
|
|
21801
22019
|
return candidate.replace(/\\/g, "/");
|
|
21802
22020
|
}
|
|
21803
22021
|
}
|
|
21804
|
-
return (candidates[0] ??
|
|
22022
|
+
return (candidates[0] ?? resolve33(import.meta.dir, "react", "jsxDevRuntimeCompat.js")).replace(/\\/g, "/");
|
|
21805
22023
|
}, jsxDevRuntimeCompatPath, jsxRuntimeCompatPath, reactSpecifiers, toSafeFileName = (specifier) => specifier.replace(/\//g, "_"), computeVendorPaths = () => {
|
|
21806
22024
|
const paths = {};
|
|
21807
22025
|
for (const specifier of reactSpecifiers) {
|
|
@@ -21834,14 +22052,14 @@ var resolveJsxDevRuntimeCompatPath = () => {
|
|
|
21834
22052
|
`)}
|
|
21835
22053
|
`;
|
|
21836
22054
|
}, buildReactVendor = async (buildDir) => {
|
|
21837
|
-
const vendorDir =
|
|
21838
|
-
|
|
21839
|
-
const tmpDir =
|
|
21840
|
-
|
|
22055
|
+
const vendorDir = join41(buildDir, "react", "vendor");
|
|
22056
|
+
mkdirSync9(vendorDir, { recursive: true });
|
|
22057
|
+
const tmpDir = join41(buildDir, "_vendor_tmp");
|
|
22058
|
+
mkdirSync9(tmpDir, { recursive: true });
|
|
21841
22059
|
const specifiers = reactSpecifiers;
|
|
21842
22060
|
const entrypoints = await Promise.all(specifiers.map(async (specifier) => {
|
|
21843
22061
|
const safeName = toSafeFileName(specifier);
|
|
21844
|
-
const entryPath =
|
|
22062
|
+
const entryPath = join41(tmpDir, `${safeName}.ts`);
|
|
21845
22063
|
const source = await generateEntrySource(specifier);
|
|
21846
22064
|
await Bun.write(entryPath, source);
|
|
21847
22065
|
return entryPath;
|
|
@@ -21908,8 +22126,8 @@ __export(exports_buildAngularVendor, {
|
|
|
21908
22126
|
computeAngularVendorPaths: () => computeAngularVendorPaths,
|
|
21909
22127
|
computeAngularVendorPathsAsync: () => computeAngularVendorPathsAsync
|
|
21910
22128
|
});
|
|
21911
|
-
import { mkdirSync as
|
|
21912
|
-
import { join as
|
|
22129
|
+
import { mkdirSync as mkdirSync10 } from "fs";
|
|
22130
|
+
import { join as join42 } from "path";
|
|
21913
22131
|
import { rm as rm10 } from "fs/promises";
|
|
21914
22132
|
var {build: bunBuild4, Glob: Glob7 } = globalThis.Bun;
|
|
21915
22133
|
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) => {
|
|
@@ -21946,7 +22164,7 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
|
|
|
21946
22164
|
}
|
|
21947
22165
|
return { angular, transitiveRoots };
|
|
21948
22166
|
}, PARTIAL_DECL_MARKERS, containsPartialDeclarations = (source) => PARTIAL_DECL_MARKERS.some((marker) => source.includes(marker)), collectTransitiveAngularSpecs = async (roots, angularFound) => {
|
|
21949
|
-
const { readFileSync:
|
|
22167
|
+
const { readFileSync: readFileSync29 } = await import("fs");
|
|
21950
22168
|
const transpiler6 = new Bun.Transpiler({ loader: "js" });
|
|
21951
22169
|
const visited = new Set;
|
|
21952
22170
|
const frontier = [];
|
|
@@ -21967,7 +22185,7 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
|
|
|
21967
22185
|
}
|
|
21968
22186
|
let content;
|
|
21969
22187
|
try {
|
|
21970
|
-
content =
|
|
22188
|
+
content = readFileSync29(resolved, "utf-8");
|
|
21971
22189
|
} catch {
|
|
21972
22190
|
continue;
|
|
21973
22191
|
}
|
|
@@ -22006,14 +22224,14 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
|
|
|
22006
22224
|
await collectTransitiveAngularSpecs([...angular, ...transitiveRoots], angular);
|
|
22007
22225
|
return Array.from(angular).filter(isResolvable);
|
|
22008
22226
|
}, buildAngularVendor = async (buildDir, directories = [], linkerJitMode = false, depVendorSpecifiers = []) => {
|
|
22009
|
-
const vendorDir =
|
|
22010
|
-
|
|
22011
|
-
const tmpDir =
|
|
22012
|
-
|
|
22227
|
+
const vendorDir = join42(buildDir, "angular", "vendor");
|
|
22228
|
+
mkdirSync10(vendorDir, { recursive: true });
|
|
22229
|
+
const tmpDir = join42(buildDir, "_angular_vendor_tmp");
|
|
22230
|
+
mkdirSync10(tmpDir, { recursive: true });
|
|
22013
22231
|
const specifiers = await resolveAngularSpecifiers(directories, linkerJitMode);
|
|
22014
22232
|
const entrypoints = await Promise.all(specifiers.map(async (specifier) => {
|
|
22015
22233
|
const safeName = toSafeFileName2(specifier);
|
|
22016
|
-
const entryPath =
|
|
22234
|
+
const entryPath = join42(tmpDir, `${safeName}.ts`);
|
|
22017
22235
|
await Bun.write(entryPath, await generateVendorEntrySource(specifier));
|
|
22018
22236
|
return entryPath;
|
|
22019
22237
|
}));
|
|
@@ -22044,10 +22262,10 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
|
|
|
22044
22262
|
const specifiers = await resolveAngularSpecifiers(directories, linkerJitMode);
|
|
22045
22263
|
return computeAngularVendorPaths(specifiers);
|
|
22046
22264
|
}, buildAngularServerVendor = async (buildDir, directories = [], linkerJitMode = false) => {
|
|
22047
|
-
const vendorDir =
|
|
22048
|
-
|
|
22049
|
-
const tmpDir =
|
|
22050
|
-
|
|
22265
|
+
const vendorDir = join42(buildDir, "angular", "vendor", "server");
|
|
22266
|
+
mkdirSync10(vendorDir, { recursive: true });
|
|
22267
|
+
const tmpDir = join42(buildDir, "_angular_server_vendor_tmp");
|
|
22268
|
+
mkdirSync10(tmpDir, { recursive: true });
|
|
22051
22269
|
const browserSpecs = await resolveAngularSpecifiers(directories, linkerJitMode);
|
|
22052
22270
|
const allSpecs = new Set(browserSpecs);
|
|
22053
22271
|
for (const spec of SERVER_ONLY_ANGULAR_SPECIFIERS) {
|
|
@@ -22057,7 +22275,7 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
|
|
|
22057
22275
|
const specifiers = Array.from(allSpecs);
|
|
22058
22276
|
const entrypoints = await Promise.all(specifiers.map(async (specifier) => {
|
|
22059
22277
|
const safeName = toSafeFileName2(specifier);
|
|
22060
|
-
const entryPath =
|
|
22278
|
+
const entryPath = join42(tmpDir, `${safeName}.ts`);
|
|
22061
22279
|
await Bun.write(entryPath, await generateVendorEntrySource(specifier));
|
|
22062
22280
|
return entryPath;
|
|
22063
22281
|
}));
|
|
@@ -22079,9 +22297,9 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
|
|
|
22079
22297
|
return specifiers;
|
|
22080
22298
|
}, computeAngularServerVendorPaths = (buildDir, specifiers) => {
|
|
22081
22299
|
const paths = {};
|
|
22082
|
-
const vendorDir =
|
|
22300
|
+
const vendorDir = join42(buildDir, "angular", "vendor", "server");
|
|
22083
22301
|
for (const specifier of specifiers) {
|
|
22084
|
-
paths[specifier] =
|
|
22302
|
+
paths[specifier] = join42(vendorDir, `${toSafeFileName2(specifier)}.js`);
|
|
22085
22303
|
}
|
|
22086
22304
|
return paths;
|
|
22087
22305
|
}, computeAngularServerVendorPathsAsync = async (buildDir, directories = [], linkerJitMode = true) => {
|
|
@@ -22136,18 +22354,18 @@ __export(exports_buildVueVendor, {
|
|
|
22136
22354
|
buildVueVendor: () => buildVueVendor,
|
|
22137
22355
|
computeVueVendorPaths: () => computeVueVendorPaths
|
|
22138
22356
|
});
|
|
22139
|
-
import { mkdirSync as
|
|
22140
|
-
import { join as
|
|
22357
|
+
import { mkdirSync as mkdirSync11 } from "fs";
|
|
22358
|
+
import { join as join43 } from "path";
|
|
22141
22359
|
import { rm as rm11 } from "fs/promises";
|
|
22142
22360
|
var {build: bunBuild5 } = globalThis.Bun;
|
|
22143
22361
|
var vueSpecifiers, toSafeFileName3 = (specifier) => specifier.replace(/\//g, "_"), buildVueVendor = async (buildDir) => {
|
|
22144
|
-
const vendorDir =
|
|
22145
|
-
|
|
22146
|
-
const tmpDir =
|
|
22147
|
-
|
|
22362
|
+
const vendorDir = join43(buildDir, "vue", "vendor");
|
|
22363
|
+
mkdirSync11(vendorDir, { recursive: true });
|
|
22364
|
+
const tmpDir = join43(buildDir, "_vue_vendor_tmp");
|
|
22365
|
+
mkdirSync11(tmpDir, { recursive: true });
|
|
22148
22366
|
const entrypoints = await Promise.all(vueSpecifiers.map(async (specifier) => {
|
|
22149
22367
|
const safeName = toSafeFileName3(specifier);
|
|
22150
|
-
const entryPath =
|
|
22368
|
+
const entryPath = join43(tmpDir, `${safeName}.ts`);
|
|
22151
22369
|
await Bun.write(entryPath, `export * from '${specifier}';
|
|
22152
22370
|
`);
|
|
22153
22371
|
return entryPath;
|
|
@@ -22172,17 +22390,17 @@ var vueSpecifiers, toSafeFileName3 = (specifier) => specifier.replace(/\//g, "_"
|
|
|
22172
22390
|
console.warn("\u26A0\uFE0F Vue vendor build had errors:", result.logs);
|
|
22173
22391
|
return;
|
|
22174
22392
|
}
|
|
22175
|
-
const { readFileSync:
|
|
22393
|
+
const { readFileSync: readFileSync29, writeFileSync: writeFileSync10, readdirSync: readdirSync5 } = await import("fs");
|
|
22176
22394
|
const files = readdirSync5(vendorDir).filter((f2) => f2.endsWith(".js"));
|
|
22177
22395
|
for (const file5 of files) {
|
|
22178
|
-
const filePath =
|
|
22179
|
-
const content =
|
|
22396
|
+
const filePath = join43(vendorDir, file5);
|
|
22397
|
+
const content = readFileSync29(filePath, "utf-8");
|
|
22180
22398
|
if (!content.includes("__VUE_HMR_RUNTIME__"))
|
|
22181
22399
|
continue;
|
|
22182
22400
|
const patched = content.replace(/getGlobalThis\(\)\.__VUE_HMR_RUNTIME__\s*=\s*\{/, "getGlobalThis().__VUE_HMR_RUNTIME__ = getGlobalThis().__VUE_HMR_RUNTIME__ || {");
|
|
22183
22401
|
if (patched === content)
|
|
22184
22402
|
continue;
|
|
22185
|
-
|
|
22403
|
+
writeFileSync10(filePath, patched);
|
|
22186
22404
|
}
|
|
22187
22405
|
}, computeVueVendorPaths = () => {
|
|
22188
22406
|
const paths = {};
|
|
@@ -22201,8 +22419,8 @@ __export(exports_buildSvelteVendor, {
|
|
|
22201
22419
|
buildSvelteVendor: () => buildSvelteVendor,
|
|
22202
22420
|
computeSvelteVendorPaths: () => computeSvelteVendorPaths
|
|
22203
22421
|
});
|
|
22204
|
-
import { mkdirSync as
|
|
22205
|
-
import { join as
|
|
22422
|
+
import { mkdirSync as mkdirSync12 } from "fs";
|
|
22423
|
+
import { join as join44 } from "path";
|
|
22206
22424
|
import { rm as rm12 } from "fs/promises";
|
|
22207
22425
|
var {build: bunBuild6 } = globalThis.Bun;
|
|
22208
22426
|
var svelteSpecifiers, isResolvable2 = (specifier) => {
|
|
@@ -22216,13 +22434,13 @@ var svelteSpecifiers, isResolvable2 = (specifier) => {
|
|
|
22216
22434
|
const specifiers = resolveVendorSpecifiers();
|
|
22217
22435
|
if (specifiers.length === 0)
|
|
22218
22436
|
return;
|
|
22219
|
-
const vendorDir =
|
|
22220
|
-
|
|
22221
|
-
const tmpDir =
|
|
22222
|
-
|
|
22437
|
+
const vendorDir = join44(buildDir, "svelte", "vendor");
|
|
22438
|
+
mkdirSync12(vendorDir, { recursive: true });
|
|
22439
|
+
const tmpDir = join44(buildDir, "_svelte_vendor_tmp");
|
|
22440
|
+
mkdirSync12(tmpDir, { recursive: true });
|
|
22223
22441
|
const entrypoints = await Promise.all(specifiers.map(async (specifier) => {
|
|
22224
22442
|
const safeName = toSafeFileName4(specifier);
|
|
22225
|
-
const entryPath =
|
|
22443
|
+
const entryPath = join44(tmpDir, `${safeName}.ts`);
|
|
22226
22444
|
await Bun.write(entryPath, `export * from '${specifier}';
|
|
22227
22445
|
`);
|
|
22228
22446
|
return entryPath;
|
|
@@ -22264,21 +22482,21 @@ var init_buildSvelteVendor = __esm(() => {
|
|
|
22264
22482
|
import {
|
|
22265
22483
|
copyFileSync as copyFileSync2,
|
|
22266
22484
|
cpSync,
|
|
22267
|
-
existsSync as
|
|
22268
|
-
mkdirSync as
|
|
22485
|
+
existsSync as existsSync32,
|
|
22486
|
+
mkdirSync as mkdirSync13,
|
|
22269
22487
|
readdirSync as readdirSync5,
|
|
22270
|
-
readFileSync as
|
|
22271
|
-
renameSync,
|
|
22488
|
+
readFileSync as readFileSync29,
|
|
22489
|
+
renameSync as renameSync2,
|
|
22272
22490
|
rmSync as rmSync2,
|
|
22273
22491
|
statSync as statSync3,
|
|
22274
|
-
writeFileSync as
|
|
22492
|
+
writeFileSync as writeFileSync10
|
|
22275
22493
|
} from "fs";
|
|
22276
|
-
import { basename as basename14, dirname as dirname24, extname as extname11, join as
|
|
22494
|
+
import { basename as basename14, dirname as dirname24, extname as extname11, join as join45, relative as relative16, resolve as resolve34 } from "path";
|
|
22277
22495
|
import { cwd, env as env3, exit } from "process";
|
|
22278
22496
|
var {build: bunBuild7, Glob: Glob8 } = globalThis.Bun;
|
|
22279
22497
|
var isBuildTraceEnabled = () => {
|
|
22280
22498
|
const value = env3.ABSOLUTE_BUILD_TRACE?.toLowerCase();
|
|
22281
|
-
return value === "1" || value === "true" || value === "yes";
|
|
22499
|
+
return devProfileEnabled || value === "1" || value === "true" || value === "yes";
|
|
22282
22500
|
}, collectConventionSourceFiles = (entry) => {
|
|
22283
22501
|
if (!entry)
|
|
22284
22502
|
return [];
|
|
@@ -22356,7 +22574,7 @@ var isBuildTraceEnabled = () => {
|
|
|
22356
22574
|
}, REACT_VENDOR_SPECIFIERS, findBareReactImports = (path, importRegex) => {
|
|
22357
22575
|
let content;
|
|
22358
22576
|
try {
|
|
22359
|
-
content =
|
|
22577
|
+
content = readFileSync29(path, "utf-8");
|
|
22360
22578
|
} catch {
|
|
22361
22579
|
return [];
|
|
22362
22580
|
}
|
|
@@ -22404,11 +22622,11 @@ ${offenders.map((o3) => ` \u2022 ${o3}`).join(`
|
|
|
22404
22622
|
}
|
|
22405
22623
|
exit(1);
|
|
22406
22624
|
}, copyHtmxVendor = (htmxDir, htmxDestDir) => {
|
|
22407
|
-
|
|
22625
|
+
mkdirSync13(htmxDestDir, { recursive: true });
|
|
22408
22626
|
const glob = new Glob8("htmx*.min.js");
|
|
22409
22627
|
for (const relPath of glob.scanSync({ cwd: htmxDir })) {
|
|
22410
|
-
const src =
|
|
22411
|
-
const dest =
|
|
22628
|
+
const src = join45(htmxDir, relPath);
|
|
22629
|
+
const dest = join45(htmxDestDir, "htmx.min.js");
|
|
22412
22630
|
copyFileSync2(src, dest);
|
|
22413
22631
|
return;
|
|
22414
22632
|
}
|
|
@@ -22420,8 +22638,8 @@ ${offenders.map((o3) => ` \u2022 ${o3}`).join(`
|
|
|
22420
22638
|
}
|
|
22421
22639
|
}, resolveAbsoluteVersion = async () => {
|
|
22422
22640
|
const candidates = [
|
|
22423
|
-
|
|
22424
|
-
|
|
22641
|
+
resolve34(import.meta.dir, "..", "..", "package.json"),
|
|
22642
|
+
resolve34(import.meta.dir, "..", "package.json")
|
|
22425
22643
|
];
|
|
22426
22644
|
const resolveCandidate = async (remaining) => {
|
|
22427
22645
|
const [candidate, ...rest] = remaining;
|
|
@@ -22437,7 +22655,7 @@ ${offenders.map((o3) => ` \u2022 ${o3}`).join(`
|
|
|
22437
22655
|
};
|
|
22438
22656
|
await resolveCandidate(candidates);
|
|
22439
22657
|
}, SKIP_DIRS5, addWorkerPathIfExists = (file5, relPath, workerPaths) => {
|
|
22440
|
-
const absPath =
|
|
22658
|
+
const absPath = resolve34(file5, "..", relPath);
|
|
22441
22659
|
try {
|
|
22442
22660
|
statSync3(absPath);
|
|
22443
22661
|
workerPaths.add(absPath);
|
|
@@ -22452,7 +22670,7 @@ ${offenders.map((o3) => ` \u2022 ${o3}`).join(`
|
|
|
22452
22670
|
addWorkerPathIfExists(file5, relPath, workerPaths);
|
|
22453
22671
|
}
|
|
22454
22672
|
}, collectWorkerPathsFromFile = (file5, patterns, workerPaths) => {
|
|
22455
|
-
const content =
|
|
22673
|
+
const content = readFileSync29(file5, "utf-8");
|
|
22456
22674
|
for (const pattern of patterns) {
|
|
22457
22675
|
collectWorkerPathsFromContent(content, pattern, file5, workerPaths);
|
|
22458
22676
|
}
|
|
@@ -22485,8 +22703,8 @@ ${offenders.map((o3) => ` \u2022 ${o3}`).join(`
|
|
|
22485
22703
|
vuePagesPath
|
|
22486
22704
|
}) => {
|
|
22487
22705
|
const { readdirSync: readDir } = await import("fs");
|
|
22488
|
-
const devIndexDir =
|
|
22489
|
-
|
|
22706
|
+
const devIndexDir = join45(buildPath, "_src_indexes");
|
|
22707
|
+
mkdirSync13(devIndexDir, { recursive: true });
|
|
22490
22708
|
if (reactIndexesPath && reactPagesPath) {
|
|
22491
22709
|
copyReactDevIndexes(reactIndexesPath, reactPagesPath, devIndexDir, readDir);
|
|
22492
22710
|
}
|
|
@@ -22497,41 +22715,41 @@ ${offenders.map((o3) => ` \u2022 ${o3}`).join(`
|
|
|
22497
22715
|
copyVueDevIndexes(vueDir, vuePagesPath, vueEntries, devIndexDir);
|
|
22498
22716
|
}
|
|
22499
22717
|
}, copyReactDevIndexes = (reactIndexesPath, reactPagesPath, devIndexDir, readDir) => {
|
|
22500
|
-
if (!
|
|
22718
|
+
if (!existsSync32(reactIndexesPath)) {
|
|
22501
22719
|
return;
|
|
22502
22720
|
}
|
|
22503
22721
|
const indexFiles = readDir(reactIndexesPath).filter((file5) => file5.endsWith(".tsx"));
|
|
22504
|
-
const pagesRel = relative16(process.cwd(),
|
|
22722
|
+
const pagesRel = relative16(process.cwd(), resolve34(reactPagesPath)).replace(/\\/g, "/");
|
|
22505
22723
|
for (const file5 of indexFiles) {
|
|
22506
|
-
let content =
|
|
22724
|
+
let content = readFileSync29(join45(reactIndexesPath, file5), "utf-8");
|
|
22507
22725
|
content = content.replace(/from\s*['"]([^'"]*\/pages\/([^'"]+))['"]/g, (_match, _fullPath, componentName) => `from '/@src/${pagesRel}/${componentName}'`);
|
|
22508
|
-
|
|
22726
|
+
writeFileSync10(join45(devIndexDir, file5), content);
|
|
22509
22727
|
}
|
|
22510
22728
|
}, copySvelteDevIndexes = (svelteDir, sveltePagesPath, svelteEntries, devIndexDir) => {
|
|
22511
|
-
const svelteIndexDir =
|
|
22512
|
-
const sveltePageEntries = svelteEntries.filter((file5) =>
|
|
22729
|
+
const svelteIndexDir = join45(getFrameworkGeneratedDir("svelte"), "indexes");
|
|
22730
|
+
const sveltePageEntries = svelteEntries.filter((file5) => resolve34(file5).startsWith(resolve34(sveltePagesPath)));
|
|
22513
22731
|
for (const entry of sveltePageEntries) {
|
|
22514
22732
|
const name = basename14(entry).replace(/\.svelte(\.(ts|js))?$/, "");
|
|
22515
|
-
const indexFile =
|
|
22516
|
-
if (!
|
|
22733
|
+
const indexFile = join45(svelteIndexDir, "pages", `${name}.js`);
|
|
22734
|
+
if (!existsSync32(indexFile))
|
|
22517
22735
|
continue;
|
|
22518
|
-
let content =
|
|
22519
|
-
const srcRel = relative16(process.cwd(),
|
|
22736
|
+
let content = readFileSync29(indexFile, "utf-8");
|
|
22737
|
+
const srcRel = relative16(process.cwd(), resolve34(entry)).replace(/\\/g, "/");
|
|
22520
22738
|
content = content.replace(/import\s+Component\s+from\s+['"]([^'"]+)['"]/, `import Component from "/@src/${srcRel}"`);
|
|
22521
|
-
|
|
22739
|
+
writeFileSync10(join45(devIndexDir, `${name}.svelte.js`), content);
|
|
22522
22740
|
}
|
|
22523
22741
|
}, copyVueDevIndexes = (vueDir, vuePagesPath, vueEntries, devIndexDir) => {
|
|
22524
|
-
const vueIndexDir =
|
|
22525
|
-
const vuePageEntries = vueEntries.filter((file5) =>
|
|
22742
|
+
const vueIndexDir = join45(getFrameworkGeneratedDir("vue"), "indexes");
|
|
22743
|
+
const vuePageEntries = vueEntries.filter((file5) => resolve34(file5).startsWith(resolve34(vuePagesPath)));
|
|
22526
22744
|
for (const entry of vuePageEntries) {
|
|
22527
22745
|
const name = basename14(entry, ".vue");
|
|
22528
|
-
const indexFile =
|
|
22529
|
-
if (!
|
|
22746
|
+
const indexFile = join45(vueIndexDir, `${name}.js`);
|
|
22747
|
+
if (!existsSync32(indexFile))
|
|
22530
22748
|
continue;
|
|
22531
|
-
let content =
|
|
22532
|
-
const srcRel = relative16(process.cwd(),
|
|
22749
|
+
let content = readFileSync29(indexFile, "utf-8");
|
|
22750
|
+
const srcRel = relative16(process.cwd(), resolve34(entry)).replace(/\\/g, "/");
|
|
22533
22751
|
content = content.replace(/import\s+Comp(?:\s*,\s*\*\s+as\s+\w+)?\s+from\s+['"]([^'"]+)['"]/, (match) => match.replace(/from\s+['"][^'"]+['"]/, `from "/@src/${srcRel}"`));
|
|
22534
|
-
|
|
22752
|
+
writeFileSync10(join45(devIndexDir, `${name}.vue.js`), content);
|
|
22535
22753
|
}
|
|
22536
22754
|
}, resolveVueRuntimeId = (content, firstUseName, outputPath, projectRoot) => {
|
|
22537
22755
|
const varIdx = content.indexOf(`var ${firstUseName} =`);
|
|
@@ -22542,7 +22760,7 @@ ${offenders.map((o3) => ` \u2022 ${o3}`).join(`
|
|
|
22542
22760
|
const last = allComments[allComments.length - 1];
|
|
22543
22761
|
if (!last?.[1])
|
|
22544
22762
|
return JSON.stringify(outputPath);
|
|
22545
|
-
const srcPath =
|
|
22763
|
+
const srcPath = resolve34(projectRoot, last[1].replace("/client/", "/").replace(/\.js$/, ".ts"));
|
|
22546
22764
|
return JSON.stringify(srcPath);
|
|
22547
22765
|
}, QUOTE_CHARS, OPEN_BRACES, CLOSE_BRACES, findFunctionExpressionEnd = (content, startPos) => {
|
|
22548
22766
|
let depth = 0;
|
|
@@ -22579,7 +22797,7 @@ ${offenders.map((o3) => ` \u2022 ${o3}`).join(`
|
|
|
22579
22797
|
}
|
|
22580
22798
|
return result;
|
|
22581
22799
|
}, VUE_HMR_RUNTIME, injectVueComposableTracking = (outputPath, projectRoot) => {
|
|
22582
|
-
let content =
|
|
22800
|
+
let content = readFileSync29(outputPath, "utf-8");
|
|
22583
22801
|
const usePattern = /^var\s+(use[A-Z]\w*)\s*=/gm;
|
|
22584
22802
|
const useNames = [];
|
|
22585
22803
|
let match;
|
|
@@ -22600,7 +22818,7 @@ ${offenders.map((o3) => ` \u2022 ${o3}`).join(`
|
|
|
22600
22818
|
content = `${content.slice(0, firstUseIdx) + runtime}
|
|
22601
22819
|
${content.slice(firstUseIdx)}`;
|
|
22602
22820
|
content = wrapUseFunctions(content, useNames);
|
|
22603
|
-
|
|
22821
|
+
writeFileSync10(outputPath, content);
|
|
22604
22822
|
}, buildDevUrlFileMap = (urlReferencedFiles, projectRoot) => {
|
|
22605
22823
|
const urlFileMap = new Map;
|
|
22606
22824
|
for (const srcPath of urlReferencedFiles) {
|
|
@@ -22629,7 +22847,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
22629
22847
|
}, rewriteUrlReferences = (outputPaths, urlFileMap) => {
|
|
22630
22848
|
const urlPattern = /new\s+URL\(\s*["'](\.\.?\/[^"']+)["']\s*,\s*import\.meta\.url\s*\)/g;
|
|
22631
22849
|
for (const outputPath of outputPaths) {
|
|
22632
|
-
let content =
|
|
22850
|
+
let content = readFileSync29(outputPath, "utf-8");
|
|
22633
22851
|
let changed = false;
|
|
22634
22852
|
content = content.replace(urlPattern, (_match, relPath) => {
|
|
22635
22853
|
const targetName = basename14(relPath);
|
|
@@ -22640,7 +22858,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
22640
22858
|
return `new URL('${resolvedPath}', import.meta.url)`;
|
|
22641
22859
|
});
|
|
22642
22860
|
if (changed)
|
|
22643
|
-
|
|
22861
|
+
writeFileSync10(outputPath, content);
|
|
22644
22862
|
}
|
|
22645
22863
|
}, bunBuildPassKeys, bunBuildPassKeySet, reservedBunBuildConfigKeys, passLockedKeys, isObject2 = (value) => typeof value === "object" && value !== null, isBunBuildPassConfig = (config) => isObject2(config) && Object.keys(config).some((key) => bunBuildPassKeySet.has(key)), sanitizeBunBuildOverride = (override, extraReservedKeys = new Set) => {
|
|
22646
22864
|
if (!override)
|
|
@@ -22769,10 +22987,10 @@ ${content.slice(firstUseIdx)}`;
|
|
|
22769
22987
|
restoreTracePhase();
|
|
22770
22988
|
return;
|
|
22771
22989
|
}
|
|
22772
|
-
const traceDir =
|
|
22990
|
+
const traceDir = join45(buildPath2, ".absolute-trace");
|
|
22773
22991
|
const timestamp = new Date().toISOString().replace(/[:.]/g, "-");
|
|
22774
|
-
|
|
22775
|
-
|
|
22992
|
+
mkdirSync13(traceDir, { recursive: true });
|
|
22993
|
+
writeFileSync10(join45(traceDir, `build-trace-${timestamp}.json`), JSON.stringify({
|
|
22776
22994
|
events: traceEvents,
|
|
22777
22995
|
frameworks: traceFrameworkNames,
|
|
22778
22996
|
generatedAt: new Date().toISOString(),
|
|
@@ -22803,16 +23021,16 @@ ${content.slice(firstUseIdx)}`;
|
|
|
22803
23021
|
const stylesPath = typeof stylesConfig === "string" ? stylesConfig : stylesConfig?.path;
|
|
22804
23022
|
const stylesIgnore = typeof stylesConfig === "object" ? stylesConfig.ignore : undefined;
|
|
22805
23023
|
const stylesDir = stylesPath && validateSafePath(stylesPath, projectRoot);
|
|
22806
|
-
const reactIndexesPath = reactDir &&
|
|
22807
|
-
const reactPagesPath = reactDir &&
|
|
22808
|
-
const htmlPagesPath = htmlDir &&
|
|
22809
|
-
const htmlScriptsPath = htmlDir &&
|
|
22810
|
-
const sveltePagesPath = svelteDir &&
|
|
22811
|
-
const vuePagesPath = vueDir &&
|
|
22812
|
-
const htmxPagesPath = htmxDir &&
|
|
22813
|
-
const htmxScriptsPath = htmxDir &&
|
|
22814
|
-
const angularPagesPath = angularDir &&
|
|
22815
|
-
const emberPagesPath = emberDir &&
|
|
23024
|
+
const reactIndexesPath = reactDir && join45(getFrameworkGeneratedDir("react"), "indexes");
|
|
23025
|
+
const reactPagesPath = reactDir && join45(reactDir, "pages");
|
|
23026
|
+
const htmlPagesPath = htmlDir && join45(htmlDir, "pages");
|
|
23027
|
+
const htmlScriptsPath = htmlDir && join45(htmlDir, "scripts");
|
|
23028
|
+
const sveltePagesPath = svelteDir && join45(svelteDir, "pages");
|
|
23029
|
+
const vuePagesPath = vueDir && join45(vueDir, "pages");
|
|
23030
|
+
const htmxPagesPath = htmxDir && join45(htmxDir, "pages");
|
|
23031
|
+
const htmxScriptsPath = htmxDir && join45(htmxDir, "scripts");
|
|
23032
|
+
const angularPagesPath = angularDir && join45(angularDir, "pages");
|
|
23033
|
+
const emberPagesPath = emberDir && join45(emberDir, "pages");
|
|
22816
23034
|
const frontends = [
|
|
22817
23035
|
reactDir,
|
|
22818
23036
|
htmlDir,
|
|
@@ -22873,14 +23091,14 @@ ${content.slice(firstUseIdx)}`;
|
|
|
22873
23091
|
const [firstEntry] = serverDirMap;
|
|
22874
23092
|
if (!firstEntry)
|
|
22875
23093
|
throw new Error("Expected at least one server directory entry");
|
|
22876
|
-
serverRoot =
|
|
22877
|
-
serverOutDir =
|
|
23094
|
+
serverRoot = join45(firstEntry.dir, firstEntry.subdir);
|
|
23095
|
+
serverOutDir = join45(buildPath, basename14(firstEntry.dir));
|
|
22878
23096
|
} else if (serverDirMap.length > 1) {
|
|
22879
23097
|
serverRoot = commonAncestor(serverDirMap.map((entry) => entry.dir), projectRoot);
|
|
22880
23098
|
serverOutDir = buildPath;
|
|
22881
23099
|
}
|
|
22882
23100
|
const publicPath = publicDirectory && validateSafePath(publicDirectory, projectRoot);
|
|
22883
|
-
await tracePhase("build-dir/create", () =>
|
|
23101
|
+
await tracePhase("build-dir/create", () => mkdirSync13(buildPath, { recursive: true }));
|
|
22884
23102
|
if (publicPath)
|
|
22885
23103
|
await tracePhase("public/copy", () => cpSync(publicPath, buildPath, { force: true, recursive: true }));
|
|
22886
23104
|
const pwaArtifacts = pwa ? await tracePhase("pwa/materialize", () => materializeAbsolutePwa({
|
|
@@ -22893,13 +23111,13 @@ ${content.slice(firstUseIdx)}`;
|
|
|
22893
23111
|
const filterToIncrementalEntries = (entryPoints, mapToSource) => {
|
|
22894
23112
|
if (!isIncremental || !incrementalFiles)
|
|
22895
23113
|
return entryPoints;
|
|
22896
|
-
const normalizedIncremental = new Set(incrementalFiles.map((f2) =>
|
|
23114
|
+
const normalizedIncremental = new Set(incrementalFiles.map((f2) => resolve34(f2)));
|
|
22897
23115
|
const matchingEntries = [];
|
|
22898
23116
|
for (const entry of entryPoints) {
|
|
22899
23117
|
const sourceFile = mapToSource(entry);
|
|
22900
23118
|
if (!sourceFile)
|
|
22901
23119
|
continue;
|
|
22902
|
-
if (!normalizedIncremental.has(
|
|
23120
|
+
if (!normalizedIncremental.has(resolve34(sourceFile)))
|
|
22903
23121
|
continue;
|
|
22904
23122
|
matchingEntries.push(entry);
|
|
22905
23123
|
}
|
|
@@ -22909,7 +23127,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
22909
23127
|
await tracePhase("react/index-generation", () => generateReactIndexFiles(reactPagesPath, reactIndexesPath, hmr));
|
|
22910
23128
|
}
|
|
22911
23129
|
if (assetsPath && (!isIncremental || normalizedIncrementalFiles?.some((f2) => f2.includes("/assets/")))) {
|
|
22912
|
-
await tracePhase("assets/copy", () => cpSync(assetsPath,
|
|
23130
|
+
await tracePhase("assets/copy", () => cpSync(assetsPath, join45(buildPath, "assets"), {
|
|
22913
23131
|
force: true,
|
|
22914
23132
|
recursive: true
|
|
22915
23133
|
}));
|
|
@@ -23023,11 +23241,11 @@ ${content.slice(firstUseIdx)}`;
|
|
|
23023
23241
|
}
|
|
23024
23242
|
}
|
|
23025
23243
|
if (htmlDefaults.error || htmlDefaults.notFound || htmlDefaults.loading || Object.keys(htmlPages).length > 0) {
|
|
23026
|
-
const htmlConventionsOutDir =
|
|
23027
|
-
|
|
23244
|
+
const htmlConventionsOutDir = join45(buildPath, "conventions", "html");
|
|
23245
|
+
mkdirSync13(htmlConventionsOutDir, { recursive: true });
|
|
23028
23246
|
const htmlPathRemap = new Map;
|
|
23029
23247
|
for (const sourcePath of htmlConventionSources) {
|
|
23030
|
-
const dest =
|
|
23248
|
+
const dest = join45(htmlConventionsOutDir, basename14(sourcePath));
|
|
23031
23249
|
cpSync(sourcePath, dest, { force: true });
|
|
23032
23250
|
htmlPathRemap.set(sourcePath, dest);
|
|
23033
23251
|
}
|
|
@@ -23068,9 +23286,9 @@ ${content.slice(firstUseIdx)}`;
|
|
|
23068
23286
|
}
|
|
23069
23287
|
const shouldIncludeHtmlAssets = !isIncremental || normalizedIncrementalFiles?.some((f2) => f2.includes("/html/") && (f2.endsWith(".html") || isStylePath(f2)));
|
|
23070
23288
|
const reactEntries = isIncremental && reactIndexesPath && reactPagesPath ? filterToIncrementalEntries(allReactEntries, (entry) => {
|
|
23071
|
-
if (entry.startsWith(
|
|
23289
|
+
if (entry.startsWith(resolve34(reactIndexesPath))) {
|
|
23072
23290
|
const pageName = basename14(entry, ".tsx");
|
|
23073
|
-
return
|
|
23291
|
+
return join45(reactPagesPath, `${pageName}.tsx`);
|
|
23074
23292
|
}
|
|
23075
23293
|
return null;
|
|
23076
23294
|
}) : allReactEntries;
|
|
@@ -23102,7 +23320,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
23102
23320
|
for (const entry of vueEntries) {
|
|
23103
23321
|
const name = basename14(entry, ".vue");
|
|
23104
23322
|
if (ssrOnlyPageNames.has(name)) {
|
|
23105
|
-
resolved.add(
|
|
23323
|
+
resolved.add(resolve34(entry));
|
|
23106
23324
|
}
|
|
23107
23325
|
}
|
|
23108
23326
|
return resolved;
|
|
@@ -23239,7 +23457,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
23239
23457
|
const clientPath = islandSvelteClientPaths[idx];
|
|
23240
23458
|
if (!sourcePath || !clientPath)
|
|
23241
23459
|
continue;
|
|
23242
|
-
islandSvelteClientPathMap.set(
|
|
23460
|
+
islandSvelteClientPathMap.set(resolve34(sourcePath), clientPath);
|
|
23243
23461
|
}
|
|
23244
23462
|
const islandVueClientPathMap = new Map;
|
|
23245
23463
|
for (let idx = 0;idx < islandVueSources.length; idx++) {
|
|
@@ -23247,7 +23465,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
23247
23465
|
const clientPath = islandVueClientPaths[idx];
|
|
23248
23466
|
if (!sourcePath || !clientPath)
|
|
23249
23467
|
continue;
|
|
23250
|
-
islandVueClientPathMap.set(
|
|
23468
|
+
islandVueClientPathMap.set(resolve34(sourcePath), clientPath);
|
|
23251
23469
|
}
|
|
23252
23470
|
const islandAngularClientPathMap = new Map;
|
|
23253
23471
|
for (let idx = 0;idx < islandAngularSources.length; idx++) {
|
|
@@ -23255,7 +23473,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
23255
23473
|
const clientPath = islandAngularClientPaths[idx];
|
|
23256
23474
|
if (!sourcePath || !clientPath)
|
|
23257
23475
|
continue;
|
|
23258
|
-
islandAngularClientPathMap.set(
|
|
23476
|
+
islandAngularClientPathMap.set(resolve34(sourcePath), clientPath);
|
|
23259
23477
|
}
|
|
23260
23478
|
const reactConventionSources = collectConventionSourceFiles(conventionsMap.react);
|
|
23261
23479
|
const svelteConventionSources = collectConventionSourceFiles(conventionsMap.svelte);
|
|
@@ -23266,9 +23484,9 @@ ${content.slice(firstUseIdx)}`;
|
|
|
23266
23484
|
const compileReactConventions = async () => {
|
|
23267
23485
|
if (reactConventionSources.length === 0)
|
|
23268
23486
|
return emptyStringArray;
|
|
23269
|
-
const destDir =
|
|
23487
|
+
const destDir = join45(buildPath, "conventions", "react");
|
|
23270
23488
|
rmSync2(destDir, { force: true, recursive: true });
|
|
23271
|
-
|
|
23489
|
+
mkdirSync13(destDir, { recursive: true });
|
|
23272
23490
|
const destPaths = await Promise.all(reactConventionSources.map(async (source, idx) => {
|
|
23273
23491
|
const result = await bunBuild7({
|
|
23274
23492
|
entrypoints: [source],
|
|
@@ -23309,9 +23527,9 @@ ${content.slice(firstUseIdx)}`;
|
|
|
23309
23527
|
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 }
|
|
23310
23528
|
]);
|
|
23311
23529
|
const bundleConventionFiles = async (framework, compiledPaths) => {
|
|
23312
|
-
const destDir =
|
|
23530
|
+
const destDir = join45(buildPath, "conventions", framework);
|
|
23313
23531
|
rmSync2(destDir, { force: true, recursive: true });
|
|
23314
|
-
|
|
23532
|
+
mkdirSync13(destDir, { recursive: true });
|
|
23315
23533
|
const destPaths = await Promise.all(compiledPaths.map(async (compiledPath, idx) => {
|
|
23316
23534
|
const name = basename14(compiledPath).replace(/\.[^.]+$/, "");
|
|
23317
23535
|
const result = await bunBuild7({
|
|
@@ -23381,7 +23599,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
23381
23599
|
}
|
|
23382
23600
|
})) : {
|
|
23383
23601
|
entries: [],
|
|
23384
|
-
generatedRoot:
|
|
23602
|
+
generatedRoot: join45(buildPath, "_island_entries")
|
|
23385
23603
|
};
|
|
23386
23604
|
const islandClientEntryPoints = islandEntryResult.entries.map((entry) => entry.entryPath);
|
|
23387
23605
|
if (serverEntryPoints.length === 0 && reactClientEntryPoints.length === 0 && nonReactClientEntryPoints.length === 0 && urlReferencedFiles.length === 0 && islandClientEntryPoints.length === 0 && htmxDir === undefined && htmlDir === undefined) {
|
|
@@ -23417,7 +23635,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
23417
23635
|
return {};
|
|
23418
23636
|
}
|
|
23419
23637
|
if (hmr && reactIndexesPath && reactClientEntryPoints.length > 0) {
|
|
23420
|
-
const refreshEntry =
|
|
23638
|
+
const refreshEntry = join45(reactIndexesPath, "_refresh.tsx");
|
|
23421
23639
|
if (!reactClientEntryPoints.includes(refreshEntry))
|
|
23422
23640
|
reactClientEntryPoints.push(refreshEntry);
|
|
23423
23641
|
}
|
|
@@ -23534,19 +23752,19 @@ ${content.slice(firstUseIdx)}`;
|
|
|
23534
23752
|
throw: false
|
|
23535
23753
|
}, resolveBunBuildOverride(bunBuildConfig, "reactClient")) : undefined;
|
|
23536
23754
|
if (reactDir && reactClientEntryPoints.length > 0) {
|
|
23537
|
-
rmSync2(
|
|
23755
|
+
rmSync2(join45(buildPath, "react", "generated", "indexes"), {
|
|
23538
23756
|
force: true,
|
|
23539
23757
|
recursive: true
|
|
23540
23758
|
});
|
|
23541
23759
|
}
|
|
23542
23760
|
if (angularDir && angularClientPaths.length > 0) {
|
|
23543
|
-
rmSync2(
|
|
23761
|
+
rmSync2(join45(buildPath, "angular", "indexes"), {
|
|
23544
23762
|
force: true,
|
|
23545
23763
|
recursive: true
|
|
23546
23764
|
});
|
|
23547
23765
|
}
|
|
23548
23766
|
if (islandClientEntryPoints.length > 0) {
|
|
23549
|
-
rmSync2(
|
|
23767
|
+
rmSync2(join45(buildPath, "islands"), {
|
|
23550
23768
|
force: true,
|
|
23551
23769
|
recursive: true
|
|
23552
23770
|
});
|
|
@@ -23660,7 +23878,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
23660
23878
|
globalCssEntries.length > 0 ? tracePhase("bun/global-css", () => bunBuild7(mergeBunBuildConfig({
|
|
23661
23879
|
entrypoints: globalCssEntries,
|
|
23662
23880
|
naming: `[dir]/[name].[hash].[ext]`,
|
|
23663
|
-
outdir: stylesDir ?
|
|
23881
|
+
outdir: stylesDir ? join45(buildPath, basename14(stylesDir)) : buildPath,
|
|
23664
23882
|
plugins: [stylePreprocessorPlugin2],
|
|
23665
23883
|
root: stylesDir || clientRoot,
|
|
23666
23884
|
target: "browser",
|
|
@@ -23669,7 +23887,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
23669
23887
|
vueCssPaths.length > 0 ? tracePhase("bun/vue-css", () => bunBuild7(mergeBunBuildConfig({
|
|
23670
23888
|
entrypoints: vueCssPaths,
|
|
23671
23889
|
naming: `[name].[hash].[ext]`,
|
|
23672
|
-
outdir:
|
|
23890
|
+
outdir: join45(buildPath, assetsPath ? basename14(assetsPath) : "assets", "css"),
|
|
23673
23891
|
target: "browser",
|
|
23674
23892
|
throw: false
|
|
23675
23893
|
}, resolveBunBuildOverride(bunBuildConfig, "vueCss")))) : undefined
|
|
@@ -23685,28 +23903,26 @@ ${content.slice(firstUseIdx)}`;
|
|
|
23685
23903
|
extractBuildError(logs, pass, label, frameworkNames, isIncremental, throwOnError);
|
|
23686
23904
|
};
|
|
23687
23905
|
if (isDev2 && serverResult?.success) {
|
|
23688
|
-
const {
|
|
23689
|
-
|
|
23690
|
-
|
|
23691
|
-
chainBundleInlineSourcemap2(out.path);
|
|
23692
|
-
}
|
|
23906
|
+
const { chainBundleInlineSourcemaps: chainBundleInlineSourcemaps2 } = await Promise.resolve().then(() => (init_chainInlineSourcemaps(), exports_chainInlineSourcemaps));
|
|
23907
|
+
const serverBundlePaths = serverOutputs.map((out) => out.path).filter((path) => path.endsWith(".js"));
|
|
23908
|
+
await tracePhase("postprocess/server-sourcemap-chain", () => chainBundleInlineSourcemaps2(serverBundlePaths), { bundles: serverBundlePaths.length });
|
|
23693
23909
|
}
|
|
23694
23910
|
if (!isDev2 && resolveClientSourcemap(sourcemaps, isDev2) === "external") {
|
|
23695
23911
|
const { chainExternalSourcemap: chainExternalSourcemap2 } = await Promise.resolve().then(() => (init_chainInlineSourcemaps(), exports_chainInlineSourcemaps));
|
|
23696
|
-
const sourcemapDir =
|
|
23697
|
-
|
|
23912
|
+
const sourcemapDir = join45(projectRoot, "sourcemaps");
|
|
23913
|
+
mkdirSync13(sourcemapDir, { recursive: true });
|
|
23698
23914
|
const mapFiles = readdirSync5(buildPath, {
|
|
23699
23915
|
encoding: "utf8",
|
|
23700
23916
|
recursive: true
|
|
23701
|
-
}).filter((entry) => entry.endsWith(".js.map") && !entry.includes("node_modules")).map((entry) =>
|
|
23917
|
+
}).filter((entry) => entry.endsWith(".js.map") && !entry.includes("node_modules")).map((entry) => join45(buildPath, entry));
|
|
23702
23918
|
for (const mapPath of mapFiles) {
|
|
23703
23919
|
chainExternalSourcemap2(mapPath);
|
|
23704
|
-
|
|
23920
|
+
renameSync2(mapPath, join45(sourcemapDir, basename14(mapPath)));
|
|
23705
23921
|
const jsPath = mapPath.slice(0, -4);
|
|
23706
23922
|
try {
|
|
23707
|
-
const javascript =
|
|
23923
|
+
const javascript = readFileSync29(jsPath, "utf-8").replace(/\n?\/\/# sourceMappingURL=[^\n]*\s*$/, `
|
|
23708
23924
|
`);
|
|
23709
|
-
|
|
23925
|
+
writeFileSync10(jsPath, javascript);
|
|
23710
23926
|
} catch {}
|
|
23711
23927
|
}
|
|
23712
23928
|
console.info(`[absolute] sourcemaps: chained + privatized ${mapFiles.length} client maps \u2192 ${relative16(projectRoot, sourcemapDir)}/`);
|
|
@@ -23775,8 +23991,8 @@ ${content.slice(firstUseIdx)}`;
|
|
|
23775
23991
|
await tracePhase("postprocess/island-vendor-imports", () => rewriteBuildOutputs2(islandClientOutputs, allIslandVendorPaths));
|
|
23776
23992
|
}
|
|
23777
23993
|
if (!hmr) {
|
|
23778
|
-
const reactVendorDir =
|
|
23779
|
-
const vendorChunkPaths =
|
|
23994
|
+
const reactVendorDir = join45(buildPath, "react", "vendor");
|
|
23995
|
+
const vendorChunkPaths = existsSync32(reactVendorDir) ? [
|
|
23780
23996
|
...new Glob8("**/*.js").scanSync({
|
|
23781
23997
|
absolute: true,
|
|
23782
23998
|
cwd: reactVendorDir
|
|
@@ -23920,19 +24136,19 @@ ${content.slice(firstUseIdx)}`;
|
|
|
23920
24136
|
const injectHMRIntoHTMLFile = (filePath, framework) => {
|
|
23921
24137
|
if (!hmrClientBundle)
|
|
23922
24138
|
return;
|
|
23923
|
-
let html =
|
|
24139
|
+
let html = readFileSync29(filePath, "utf-8");
|
|
23924
24140
|
if (html.includes("data-hmr-client"))
|
|
23925
24141
|
return;
|
|
23926
24142
|
const tag = `<script>window.__HMR_FRAMEWORK__="${framework}";</script><script data-hmr-client>${hmrClientBundle}</script>`;
|
|
23927
24143
|
const bodyClose = /<\/body\s*>/i.exec(html);
|
|
23928
24144
|
html = bodyClose ? html.slice(0, bodyClose.index) + tag + html.slice(bodyClose.index) : html + tag;
|
|
23929
|
-
|
|
24145
|
+
writeFileSync10(filePath, html);
|
|
23930
24146
|
};
|
|
23931
24147
|
const processHtmlPages = async () => {
|
|
23932
24148
|
if (!(htmlDir && htmlPagesPath))
|
|
23933
24149
|
return;
|
|
23934
|
-
const outputHtmlPages = isSingle ?
|
|
23935
|
-
|
|
24150
|
+
const outputHtmlPages = isSingle ? join45(buildPath, "pages") : join45(buildPath, basename14(htmlDir), "pages");
|
|
24151
|
+
mkdirSync13(outputHtmlPages, { recursive: true });
|
|
23936
24152
|
cpSync(htmlPagesPath, outputHtmlPages, {
|
|
23937
24153
|
force: true,
|
|
23938
24154
|
recursive: true
|
|
@@ -23947,8 +24163,8 @@ ${content.slice(firstUseIdx)}`;
|
|
|
23947
24163
|
if (hmr)
|
|
23948
24164
|
injectHMRIntoHTMLFile(htmlFile, "html");
|
|
23949
24165
|
if (pwaArtifacts) {
|
|
23950
|
-
const source =
|
|
23951
|
-
|
|
24166
|
+
const source = readFileSync29(htmlFile, "utf8");
|
|
24167
|
+
writeFileSync10(htmlFile, injectPwaBootstrapHtml(source));
|
|
23952
24168
|
}
|
|
23953
24169
|
const fileName = basename14(htmlFile, ".html");
|
|
23954
24170
|
if (manifest[fileName] && manifest[fileName] !== htmlFile) {
|
|
@@ -23960,14 +24176,14 @@ ${content.slice(firstUseIdx)}`;
|
|
|
23960
24176
|
const processHtmxPages = async () => {
|
|
23961
24177
|
if (!(htmxDir && htmxPagesPath))
|
|
23962
24178
|
return;
|
|
23963
|
-
const outputHtmxPages = isSingle ?
|
|
23964
|
-
|
|
24179
|
+
const outputHtmxPages = isSingle ? join45(buildPath, "pages") : join45(buildPath, basename14(htmxDir), "pages");
|
|
24180
|
+
mkdirSync13(outputHtmxPages, { recursive: true });
|
|
23965
24181
|
cpSync(htmxPagesPath, outputHtmxPages, {
|
|
23966
24182
|
force: true,
|
|
23967
24183
|
recursive: true
|
|
23968
24184
|
});
|
|
23969
24185
|
if (shouldCopyHtmx) {
|
|
23970
|
-
const htmxDestDir = isSingle ? buildPath :
|
|
24186
|
+
const htmxDestDir = isSingle ? buildPath : join45(buildPath, basename14(htmxDir));
|
|
23971
24187
|
copyHtmxVendor(htmxDir, htmxDestDir);
|
|
23972
24188
|
}
|
|
23973
24189
|
if (shouldUpdateHtmxAssetPaths) {
|
|
@@ -23980,8 +24196,8 @@ ${content.slice(firstUseIdx)}`;
|
|
|
23980
24196
|
if (hmr)
|
|
23981
24197
|
injectHMRIntoHTMLFile(htmxFile, "htmx");
|
|
23982
24198
|
if (pwaArtifacts) {
|
|
23983
|
-
const source =
|
|
23984
|
-
|
|
24199
|
+
const source = readFileSync29(htmxFile, "utf8");
|
|
24200
|
+
writeFileSync10(htmxFile, injectPwaBootstrapHtml(source));
|
|
23985
24201
|
}
|
|
23986
24202
|
const fileName = basename14(htmxFile, ".html");
|
|
23987
24203
|
if (manifest[fileName] && manifest[fileName] !== htmxFile) {
|
|
@@ -24058,7 +24274,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
24058
24274
|
}))
|
|
24059
24275
|
];
|
|
24060
24276
|
setSpaRouteManifest(spaRouteHosts);
|
|
24061
|
-
|
|
24277
|
+
writeFileSync10(join45(buildPath, "spa-routes.json"), JSON.stringify(spaRouteHosts, null, "\t"));
|
|
24062
24278
|
if (isIncremental) {
|
|
24063
24279
|
writeBuildTrace(buildPath);
|
|
24064
24280
|
return {
|
|
@@ -24067,9 +24283,9 @@ ${content.slice(firstUseIdx)}`;
|
|
|
24067
24283
|
manifest
|
|
24068
24284
|
};
|
|
24069
24285
|
}
|
|
24070
|
-
|
|
24286
|
+
writeFileSync10(join45(buildPath, "manifest.json"), JSON.stringify(manifest, null, "\t"));
|
|
24071
24287
|
if (Object.keys(conventionsMap).length > 0) {
|
|
24072
|
-
|
|
24288
|
+
writeFileSync10(join45(buildPath, "conventions.json"), JSON.stringify(conventionsMap, null, "\t"));
|
|
24073
24289
|
}
|
|
24074
24290
|
writeBuildTrace(buildPath);
|
|
24075
24291
|
if (mode === "production") {
|
|
@@ -24134,6 +24350,7 @@ var init_build = __esm(() => {
|
|
|
24134
24350
|
init_hmrInjectionPlugin();
|
|
24135
24351
|
init_cleanStaleOutputs();
|
|
24136
24352
|
init_cleanup();
|
|
24353
|
+
init_startupTimings();
|
|
24137
24354
|
init_commonAncestor();
|
|
24138
24355
|
init_generatedDir();
|
|
24139
24356
|
init_buildDirectoryLock();
|
|
@@ -24202,8 +24419,8 @@ var init_build = __esm(() => {
|
|
|
24202
24419
|
});
|
|
24203
24420
|
|
|
24204
24421
|
// src/build/buildEmberVendor.ts
|
|
24205
|
-
import { mkdirSync as
|
|
24206
|
-
import { join as
|
|
24422
|
+
import { mkdirSync as mkdirSync14, existsSync as existsSync33 } from "fs";
|
|
24423
|
+
import { join as join46 } from "path";
|
|
24207
24424
|
import { rm as rm13 } from "fs/promises";
|
|
24208
24425
|
var {build: bunBuild8 } = globalThis.Bun;
|
|
24209
24426
|
var toSafeFileName5 = (specifier) => specifier.replace(/^@/, "").replace(/\//g, "_"), generateMacrosShim = () => `// Generated shim for @embroider/macros \u2014 provides minimal runtime
|
|
@@ -24255,8 +24472,8 @@ export const importSync = (specifier) => {
|
|
|
24255
24472
|
if (standaloneSpecifiers.has(specifier)) {
|
|
24256
24473
|
return { resolveTo: specifier, specifier };
|
|
24257
24474
|
}
|
|
24258
|
-
const emberInternalPath =
|
|
24259
|
-
if (!
|
|
24475
|
+
const emberInternalPath = join46(cwd2, "node_modules/ember-source/dist/packages", specifier, "index.js");
|
|
24476
|
+
if (!existsSync33(emberInternalPath)) {
|
|
24260
24477
|
throw new Error(`Ember vendor build: cannot find ${specifier} at ${emberInternalPath}. ` + `Is ember-source installed and at least 6.12?`);
|
|
24261
24478
|
}
|
|
24262
24479
|
return { resolveTo: emberInternalPath, specifier };
|
|
@@ -24287,24 +24504,24 @@ export const importSync = (specifier) => {
|
|
|
24287
24504
|
if (standalonePackages.has(args.path)) {
|
|
24288
24505
|
return;
|
|
24289
24506
|
}
|
|
24290
|
-
const internal =
|
|
24291
|
-
if (
|
|
24507
|
+
const internal = join46(cwd2, "node_modules/ember-source/dist/packages", args.path, "index.js");
|
|
24508
|
+
if (existsSync33(internal)) {
|
|
24292
24509
|
return { path: internal };
|
|
24293
24510
|
}
|
|
24294
24511
|
return;
|
|
24295
24512
|
});
|
|
24296
24513
|
}
|
|
24297
24514
|
}), buildEmberVendor = async (buildDir, cwd2 = process.cwd()) => {
|
|
24298
|
-
const vendorDir =
|
|
24299
|
-
|
|
24300
|
-
const tmpDir =
|
|
24301
|
-
|
|
24302
|
-
const macrosShimPath =
|
|
24515
|
+
const vendorDir = join46(buildDir, "ember", "vendor");
|
|
24516
|
+
mkdirSync14(vendorDir, { recursive: true });
|
|
24517
|
+
const tmpDir = join46(buildDir, "_ember_vendor_tmp");
|
|
24518
|
+
mkdirSync14(tmpDir, { recursive: true });
|
|
24519
|
+
const macrosShimPath = join46(tmpDir, "embroider_macros_shim.js");
|
|
24303
24520
|
await Bun.write(macrosShimPath, generateMacrosShim());
|
|
24304
24521
|
const resolutions = REQUIRED_EMBER_SPECIFIERS.map((specifier) => resolveEmberSpecifier(specifier, cwd2));
|
|
24305
24522
|
const entrypoints = await Promise.all(resolutions.map(async (resolution) => {
|
|
24306
24523
|
const safeName = toSafeFileName5(resolution.specifier);
|
|
24307
|
-
const entryPath =
|
|
24524
|
+
const entryPath = join46(tmpDir, `${safeName}.js`);
|
|
24308
24525
|
const source = resolution.specifier === "@embroider/macros" ? `export * from ${JSON.stringify(macrosShimPath)};
|
|
24309
24526
|
` : generateVendorEntrySource2(resolution);
|
|
24310
24527
|
await Bun.write(entryPath, source);
|
|
@@ -24460,9 +24677,9 @@ __export(exports_dependencyGraph, {
|
|
|
24460
24677
|
getAffectedFiles: () => getAffectedFiles,
|
|
24461
24678
|
removeFileFromGraph: () => removeFileFromGraph
|
|
24462
24679
|
});
|
|
24463
|
-
import { existsSync as
|
|
24680
|
+
import { existsSync as existsSync34, readFileSync as readFileSync30 } from "fs";
|
|
24464
24681
|
var {Glob: Glob9 } = globalThis.Bun;
|
|
24465
|
-
import { resolve as
|
|
24682
|
+
import { resolve as resolve35 } from "path";
|
|
24466
24683
|
var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath) => {
|
|
24467
24684
|
const lower = filePath.toLowerCase();
|
|
24468
24685
|
if (lower.endsWith(".ts") || lower.endsWith(".tsx") || lower.endsWith(".jsx"))
|
|
@@ -24476,8 +24693,8 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
24476
24693
|
if (!importPath.startsWith(".") && !importPath.startsWith("/")) {
|
|
24477
24694
|
return null;
|
|
24478
24695
|
}
|
|
24479
|
-
const fromDir =
|
|
24480
|
-
const normalized =
|
|
24696
|
+
const fromDir = resolve35(fromFile, "..");
|
|
24697
|
+
const normalized = resolve35(fromDir, importPath);
|
|
24481
24698
|
const extensions = [
|
|
24482
24699
|
".ts",
|
|
24483
24700
|
".tsx",
|
|
@@ -24490,10 +24707,10 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
24490
24707
|
];
|
|
24491
24708
|
for (const ext of extensions) {
|
|
24492
24709
|
const withExt = normalized + ext;
|
|
24493
|
-
if (
|
|
24710
|
+
if (existsSync34(withExt))
|
|
24494
24711
|
return withExt;
|
|
24495
24712
|
}
|
|
24496
|
-
if (
|
|
24713
|
+
if (existsSync34(normalized))
|
|
24497
24714
|
return normalized;
|
|
24498
24715
|
return null;
|
|
24499
24716
|
}, clearExistingDependents = (graph, normalizedPath) => {
|
|
@@ -24507,8 +24724,8 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
24507
24724
|
dependents.delete(normalizedPath);
|
|
24508
24725
|
}
|
|
24509
24726
|
}, addFileToGraph = (graph, filePath) => {
|
|
24510
|
-
const normalizedPath =
|
|
24511
|
-
if (!
|
|
24727
|
+
const normalizedPath = resolve35(filePath);
|
|
24728
|
+
if (!existsSync34(normalizedPath))
|
|
24512
24729
|
return;
|
|
24513
24730
|
const dependencies = extractDependencies(normalizedPath);
|
|
24514
24731
|
clearExistingDependents(graph, normalizedPath);
|
|
@@ -24534,10 +24751,10 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
24534
24751
|
}, IGNORED_SEGMENTS, buildInitialDependencyGraph = (graph, directories) => {
|
|
24535
24752
|
const processedFiles = new Set;
|
|
24536
24753
|
const glob = new Glob9("**/*.{ts,tsx,js,jsx,vue,svelte,html,htm}");
|
|
24537
|
-
const resolvedDirs = directories.map((dir) =>
|
|
24754
|
+
const resolvedDirs = directories.map((dir) => resolve35(dir)).filter((dir) => existsSync34(dir));
|
|
24538
24755
|
const allFiles = resolvedDirs.flatMap((dir) => Array.from(glob.scanSync({ absolute: true, cwd: dir })));
|
|
24539
24756
|
for (const file5 of allFiles) {
|
|
24540
|
-
const fullPath =
|
|
24757
|
+
const fullPath = resolve35(file5);
|
|
24541
24758
|
if (IGNORED_SEGMENTS.some((seg) => fullPath.includes(seg)))
|
|
24542
24759
|
continue;
|
|
24543
24760
|
if (processedFiles.has(fullPath))
|
|
@@ -24631,15 +24848,15 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
24631
24848
|
const lowerPath = filePath.toLowerCase();
|
|
24632
24849
|
const isSvelteOrVue = lowerPath.endsWith(".svelte") || lowerPath.endsWith(".vue");
|
|
24633
24850
|
if (loader === "html") {
|
|
24634
|
-
const content =
|
|
24851
|
+
const content = readFileSync30(filePath, "utf-8");
|
|
24635
24852
|
return extractHtmlDependencies(filePath, content);
|
|
24636
24853
|
}
|
|
24637
24854
|
if (loader === "tsx" || loader === "js") {
|
|
24638
|
-
const content =
|
|
24855
|
+
const content = readFileSync30(filePath, "utf-8");
|
|
24639
24856
|
return extractJsDependencies(filePath, content, loader);
|
|
24640
24857
|
}
|
|
24641
24858
|
if (isSvelteOrVue) {
|
|
24642
|
-
const content =
|
|
24859
|
+
const content = readFileSync30(filePath, "utf-8");
|
|
24643
24860
|
return extractSvelteVueDependencies(filePath, content);
|
|
24644
24861
|
}
|
|
24645
24862
|
return [];
|
|
@@ -24650,7 +24867,7 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
24650
24867
|
return [];
|
|
24651
24868
|
}
|
|
24652
24869
|
}, getAffectedFiles = (graph, changedFile) => {
|
|
24653
|
-
const normalizedPath =
|
|
24870
|
+
const normalizedPath = resolve35(changedFile);
|
|
24654
24871
|
const affected = new Set;
|
|
24655
24872
|
const toProcess = [normalizedPath];
|
|
24656
24873
|
const processNode = (current) => {
|
|
@@ -24681,7 +24898,7 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
24681
24898
|
}, removeDependentsForFile = (graph, normalizedPath) => {
|
|
24682
24899
|
graph.dependents.delete(normalizedPath);
|
|
24683
24900
|
}, removeFileFromGraph = (graph, filePath) => {
|
|
24684
|
-
const normalizedPath =
|
|
24901
|
+
const normalizedPath = resolve35(filePath);
|
|
24685
24902
|
removeDepsForFile(graph, normalizedPath);
|
|
24686
24903
|
removeDependentsForFile(graph, normalizedPath);
|
|
24687
24904
|
};
|
|
@@ -24724,12 +24941,12 @@ var globalVersionCounter = 0, createModuleVersionTracker = () => new Map, getNex
|
|
|
24724
24941
|
};
|
|
24725
24942
|
|
|
24726
24943
|
// src/dev/configResolver.ts
|
|
24727
|
-
import { resolve as
|
|
24944
|
+
import { resolve as resolve36 } from "path";
|
|
24728
24945
|
var resolveBuildPaths = (config) => {
|
|
24729
24946
|
const cwd2 = process.cwd();
|
|
24730
24947
|
const normalize = (path) => path.replace(/\\/g, "/");
|
|
24731
|
-
const withDefault = (value, fallback) => normalize(
|
|
24732
|
-
const optional = (value) => value ? normalize(
|
|
24948
|
+
const withDefault = (value, fallback) => normalize(resolve36(cwd2, value ?? fallback));
|
|
24949
|
+
const optional = (value) => value ? normalize(resolve36(cwd2, value)) : undefined;
|
|
24733
24950
|
return {
|
|
24734
24951
|
angularDir: optional(config.angularDirectory),
|
|
24735
24952
|
assetsDir: optional(config.assetsDirectory),
|
|
@@ -24788,8 +25005,8 @@ var init_clientManager = __esm(() => {
|
|
|
24788
25005
|
});
|
|
24789
25006
|
|
|
24790
25007
|
// src/dev/pathUtils.ts
|
|
24791
|
-
import { existsSync as
|
|
24792
|
-
import { dirname as dirname25, resolve as
|
|
25008
|
+
import { existsSync as existsSync35, readdirSync as readdirSync6, readFileSync as readFileSync31 } from "fs";
|
|
25009
|
+
import { dirname as dirname25, resolve as resolve37 } from "path";
|
|
24793
25010
|
var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
24794
25011
|
if (shouldIgnorePath(filePath, resolved)) {
|
|
24795
25012
|
return "ignored";
|
|
@@ -24865,7 +25082,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
24865
25082
|
return "unknown";
|
|
24866
25083
|
}, collectAngularResourceDirs = (angularDir) => {
|
|
24867
25084
|
const out = new Set;
|
|
24868
|
-
const angularRoot =
|
|
25085
|
+
const angularRoot = resolve37(angularDir);
|
|
24869
25086
|
const angularRootNormalized = normalizePath2(angularRoot);
|
|
24870
25087
|
const walk = (dir) => {
|
|
24871
25088
|
let entries;
|
|
@@ -24878,7 +25095,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
24878
25095
|
if (entry.name.startsWith(".") || entry.name === "node_modules") {
|
|
24879
25096
|
continue;
|
|
24880
25097
|
}
|
|
24881
|
-
const full =
|
|
25098
|
+
const full = resolve37(dir, entry.name);
|
|
24882
25099
|
if (entry.isDirectory()) {
|
|
24883
25100
|
walk(full);
|
|
24884
25101
|
continue;
|
|
@@ -24888,7 +25105,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
24888
25105
|
}
|
|
24889
25106
|
let source;
|
|
24890
25107
|
try {
|
|
24891
|
-
source =
|
|
25108
|
+
source = readFileSync31(full, "utf8");
|
|
24892
25109
|
} catch {
|
|
24893
25110
|
continue;
|
|
24894
25111
|
}
|
|
@@ -24919,7 +25136,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
24919
25136
|
}
|
|
24920
25137
|
const componentDir = dirname25(full);
|
|
24921
25138
|
for (const ref of refs) {
|
|
24922
|
-
const refAbs = normalizePath2(
|
|
25139
|
+
const refAbs = normalizePath2(resolve37(componentDir, ref));
|
|
24923
25140
|
const refDir = normalizePath2(dirname25(refAbs));
|
|
24924
25141
|
if (refDir === angularRootNormalized || refDir.startsWith(`${angularRootNormalized}/`)) {
|
|
24925
25142
|
continue;
|
|
@@ -24936,7 +25153,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
24936
25153
|
const push = (path) => {
|
|
24937
25154
|
if (!path)
|
|
24938
25155
|
return;
|
|
24939
|
-
const abs = normalizePath2(
|
|
25156
|
+
const abs = normalizePath2(resolve37(cwd2, path));
|
|
24940
25157
|
if (!roots.includes(abs))
|
|
24941
25158
|
roots.push(abs);
|
|
24942
25159
|
};
|
|
@@ -24961,8 +25178,8 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
24961
25178
|
push(cfg.assetsDir);
|
|
24962
25179
|
push(cfg.stylesDir);
|
|
24963
25180
|
for (const candidate of ["src", "db", "assets", "styles"]) {
|
|
24964
|
-
const abs = normalizePath2(
|
|
24965
|
-
if (
|
|
25181
|
+
const abs = normalizePath2(resolve37(cwd2, candidate));
|
|
25182
|
+
if (existsSync35(abs) && !roots.includes(abs))
|
|
24966
25183
|
roots.push(abs);
|
|
24967
25184
|
}
|
|
24968
25185
|
try {
|
|
@@ -24972,7 +25189,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
24972
25189
|
continue;
|
|
24973
25190
|
if (entry.name.startsWith("."))
|
|
24974
25191
|
continue;
|
|
24975
|
-
const abs = normalizePath2(
|
|
25192
|
+
const abs = normalizePath2(resolve37(cwd2, entry.name));
|
|
24976
25193
|
if (roots.includes(abs))
|
|
24977
25194
|
continue;
|
|
24978
25195
|
if (shouldIgnorePath(abs, resolved))
|
|
@@ -25055,8 +25272,8 @@ var init_pathUtils = __esm(() => {
|
|
|
25055
25272
|
|
|
25056
25273
|
// src/dev/fileWatcher.ts
|
|
25057
25274
|
import { watch } from "fs";
|
|
25058
|
-
import { existsSync as
|
|
25059
|
-
import { dirname as dirname26, join as
|
|
25275
|
+
import { existsSync as existsSync36, readdirSync as readdirSync7, statSync as statSync4 } from "fs";
|
|
25276
|
+
import { dirname as dirname26, join as join47, resolve as resolve38 } from "path";
|
|
25060
25277
|
var safeRemoveFromGraph = (graph, fullPath) => {
|
|
25061
25278
|
try {
|
|
25062
25279
|
removeFileFromGraph(graph, fullPath);
|
|
@@ -25088,7 +25305,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
25088
25305
|
for (const name of entries) {
|
|
25089
25306
|
if (shouldSkipFilename(name, isStylesDir))
|
|
25090
25307
|
continue;
|
|
25091
|
-
const child =
|
|
25308
|
+
const child = join47(eventDir, name).replace(/\\/g, "/");
|
|
25092
25309
|
let st2;
|
|
25093
25310
|
try {
|
|
25094
25311
|
st2 = statSync4(child);
|
|
@@ -25109,7 +25326,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
25109
25326
|
return;
|
|
25110
25327
|
if (shouldSkipFilename(filename, isStylesDir)) {
|
|
25111
25328
|
if (event === "rename") {
|
|
25112
|
-
const eventDir = dirname26(
|
|
25329
|
+
const eventDir = dirname26(join47(absolutePath, filename)).replace(/\\/g, "/");
|
|
25113
25330
|
atomicRecoveryScan(eventDir);
|
|
25114
25331
|
for (const delay of [25, 100]) {
|
|
25115
25332
|
const timer = setTimeout(() => atomicRecoveryScan(eventDir), delay);
|
|
@@ -25118,16 +25335,16 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
25118
25335
|
}
|
|
25119
25336
|
return;
|
|
25120
25337
|
}
|
|
25121
|
-
const fullPath =
|
|
25338
|
+
const fullPath = join47(absolutePath, filename).replace(/\\/g, "/");
|
|
25122
25339
|
if (shouldIgnorePath(fullPath, state.resolvedPaths)) {
|
|
25123
25340
|
return;
|
|
25124
25341
|
}
|
|
25125
|
-
if (event === "rename" && !
|
|
25342
|
+
if (event === "rename" && !existsSync36(fullPath)) {
|
|
25126
25343
|
safeRemoveFromGraph(state.dependencyGraph, fullPath);
|
|
25127
25344
|
onFileChange(fullPath);
|
|
25128
25345
|
return;
|
|
25129
25346
|
}
|
|
25130
|
-
if (
|
|
25347
|
+
if (existsSync36(fullPath)) {
|
|
25131
25348
|
onFileChange(fullPath);
|
|
25132
25349
|
safeAddToGraph(state.dependencyGraph, fullPath);
|
|
25133
25350
|
}
|
|
@@ -25136,8 +25353,8 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
25136
25353
|
}, addFileWatchers = (state, paths, onFileChange) => {
|
|
25137
25354
|
const stylesDir = state.resolvedPaths?.stylesDir;
|
|
25138
25355
|
paths.forEach((path) => {
|
|
25139
|
-
const absolutePath =
|
|
25140
|
-
if (!
|
|
25356
|
+
const absolutePath = resolve38(path).replace(/\\/g, "/");
|
|
25357
|
+
if (!existsSync36(absolutePath)) {
|
|
25141
25358
|
return;
|
|
25142
25359
|
}
|
|
25143
25360
|
const isStylesDir = Boolean(stylesDir && absolutePath.startsWith(stylesDir));
|
|
@@ -25147,8 +25364,8 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
25147
25364
|
const watchPaths = getWatchPaths(config, state.resolvedPaths);
|
|
25148
25365
|
const stylesDir = state.resolvedPaths?.stylesDir;
|
|
25149
25366
|
watchPaths.forEach((path) => {
|
|
25150
|
-
const absolutePath =
|
|
25151
|
-
if (!
|
|
25367
|
+
const absolutePath = resolve38(path).replace(/\\/g, "/");
|
|
25368
|
+
if (!existsSync36(absolutePath)) {
|
|
25152
25369
|
return;
|
|
25153
25370
|
}
|
|
25154
25371
|
const isStylesDir = Boolean(stylesDir && absolutePath.startsWith(stylesDir));
|
|
@@ -25166,13 +25383,13 @@ var init_fileWatcher = __esm(() => {
|
|
|
25166
25383
|
});
|
|
25167
25384
|
|
|
25168
25385
|
// src/dev/assetStore.ts
|
|
25169
|
-
import { resolve as
|
|
25386
|
+
import { resolve as resolve39 } from "path";
|
|
25170
25387
|
import { readdir as readdir5, unlink } from "fs/promises";
|
|
25171
25388
|
var mimeTypes, getMimeType = (filePath) => {
|
|
25172
25389
|
const ext = filePath.slice(filePath.lastIndexOf("."));
|
|
25173
25390
|
return mimeTypes[ext] ?? "application/octet-stream";
|
|
25174
25391
|
}, HASHED_FILE_RE, stripHash = (webPath) => webPath.replace(/\.[a-z0-9]{8}(\.(js|css|mjs))$/, "$1"), processWalkEntry = (entry, dir, liveByIdentity, walkAndClean) => {
|
|
25175
|
-
const fullPath =
|
|
25392
|
+
const fullPath = resolve39(dir, entry.name);
|
|
25176
25393
|
if (entry.isDirectory()) {
|
|
25177
25394
|
return walkAndClean(fullPath);
|
|
25178
25395
|
}
|
|
@@ -25188,10 +25405,10 @@ var mimeTypes, getMimeType = (filePath) => {
|
|
|
25188
25405
|
}, cleanStaleAssets = async (store, manifest, buildDir) => {
|
|
25189
25406
|
const liveByIdentity = new Map;
|
|
25190
25407
|
for (const webPath of store.keys()) {
|
|
25191
|
-
const diskPath =
|
|
25408
|
+
const diskPath = resolve39(buildDir, webPath.slice(1));
|
|
25192
25409
|
liveByIdentity.set(stripHash(diskPath), diskPath);
|
|
25193
25410
|
}
|
|
25194
|
-
const absBuildDir =
|
|
25411
|
+
const absBuildDir = resolve39(buildDir);
|
|
25195
25412
|
Object.values(manifest).forEach((val) => {
|
|
25196
25413
|
if (!HASHED_FILE_RE.test(val))
|
|
25197
25414
|
return;
|
|
@@ -25209,7 +25426,7 @@ var mimeTypes, getMimeType = (filePath) => {
|
|
|
25209
25426
|
} catch {}
|
|
25210
25427
|
}, lookupAsset = (store, path) => store.get(path), processScanEntry = (entry, dir, prefix, store, scanDir) => {
|
|
25211
25428
|
if (entry.isDirectory()) {
|
|
25212
|
-
return scanDir(
|
|
25429
|
+
return scanDir(resolve39(dir, entry.name), `${prefix}${entry.name}/`);
|
|
25213
25430
|
}
|
|
25214
25431
|
if (!entry.name.startsWith("chunk-")) {
|
|
25215
25432
|
return null;
|
|
@@ -25218,7 +25435,7 @@ var mimeTypes, getMimeType = (filePath) => {
|
|
|
25218
25435
|
if (store.has(webPath)) {
|
|
25219
25436
|
return null;
|
|
25220
25437
|
}
|
|
25221
|
-
return Bun.file(
|
|
25438
|
+
return Bun.file(resolve39(dir, entry.name)).bytes().then((bytes) => {
|
|
25222
25439
|
store.set(webPath, bytes);
|
|
25223
25440
|
return;
|
|
25224
25441
|
}).catch(() => {});
|
|
@@ -25240,7 +25457,7 @@ var mimeTypes, getMimeType = (filePath) => {
|
|
|
25240
25457
|
for (const webPath of newIdentities.values()) {
|
|
25241
25458
|
if (store.has(webPath))
|
|
25242
25459
|
continue;
|
|
25243
|
-
loadPromises.push(Bun.file(
|
|
25460
|
+
loadPromises.push(Bun.file(resolve39(buildDir, webPath.slice(1))).bytes().then((bytes) => {
|
|
25244
25461
|
store.set(webPath, bytes);
|
|
25245
25462
|
return;
|
|
25246
25463
|
}).catch(() => {}));
|
|
@@ -25285,10 +25502,10 @@ var init_assetStore = __esm(() => {
|
|
|
25285
25502
|
});
|
|
25286
25503
|
|
|
25287
25504
|
// src/dev/fileHashTracker.ts
|
|
25288
|
-
import { readFileSync as
|
|
25505
|
+
import { readFileSync as readFileSync32 } from "fs";
|
|
25289
25506
|
var computeFileHash = (filePath) => {
|
|
25290
25507
|
try {
|
|
25291
|
-
const fileContent =
|
|
25508
|
+
const fileContent = readFileSync32(filePath);
|
|
25292
25509
|
return Number(Bun.hash(fileContent));
|
|
25293
25510
|
} catch {
|
|
25294
25511
|
return UNFOUND_INDEX;
|
|
@@ -25381,9 +25598,9 @@ var init_transformCache = __esm(() => {
|
|
|
25381
25598
|
});
|
|
25382
25599
|
|
|
25383
25600
|
// src/dev/reactComponentClassifier.ts
|
|
25384
|
-
import { resolve as
|
|
25601
|
+
import { resolve as resolve40 } from "path";
|
|
25385
25602
|
var classifyComponent = (filePath) => {
|
|
25386
|
-
const normalizedPath =
|
|
25603
|
+
const normalizedPath = resolve40(filePath);
|
|
25387
25604
|
if (normalizedPath.includes("/react/pages/")) {
|
|
25388
25605
|
return "server";
|
|
25389
25606
|
}
|
|
@@ -25395,7 +25612,7 @@ var classifyComponent = (filePath) => {
|
|
|
25395
25612
|
var init_reactComponentClassifier = () => {};
|
|
25396
25613
|
|
|
25397
25614
|
// src/dev/moduleMapper.ts
|
|
25398
|
-
import { basename as basename15, resolve as
|
|
25615
|
+
import { basename as basename15, resolve as resolve41 } from "path";
|
|
25399
25616
|
var buildModulePaths = (moduleKeys, manifest) => {
|
|
25400
25617
|
const modulePaths = {};
|
|
25401
25618
|
moduleKeys.forEach((key) => {
|
|
@@ -25405,7 +25622,7 @@ var buildModulePaths = (moduleKeys, manifest) => {
|
|
|
25405
25622
|
});
|
|
25406
25623
|
return modulePaths;
|
|
25407
25624
|
}, processChangedFile = (sourceFile, framework, manifest, resolvedPaths, processedFiles) => {
|
|
25408
|
-
const normalizedFile =
|
|
25625
|
+
const normalizedFile = resolve41(sourceFile);
|
|
25409
25626
|
const normalizedPath = normalizedFile.replace(/\\/g, "/");
|
|
25410
25627
|
if (processedFiles.has(normalizedFile)) {
|
|
25411
25628
|
return null;
|
|
@@ -25441,7 +25658,7 @@ var buildModulePaths = (moduleKeys, manifest) => {
|
|
|
25441
25658
|
});
|
|
25442
25659
|
return grouped;
|
|
25443
25660
|
}, mapSourceFileToManifestKeys = (sourceFile, framework, resolvedPaths) => {
|
|
25444
|
-
const normalizedFile =
|
|
25661
|
+
const normalizedFile = resolve41(sourceFile);
|
|
25445
25662
|
const fileName = basename15(normalizedFile);
|
|
25446
25663
|
const baseName = fileName.replace(/\.(tsx?|jsx?|vue|svelte|css|html)$/, "");
|
|
25447
25664
|
const pascalName = toPascal(baseName);
|
|
@@ -25497,7 +25714,7 @@ var init_moduleMapper = __esm(() => {
|
|
|
25497
25714
|
|
|
25498
25715
|
// src/utils/spaRouteCss.ts
|
|
25499
25716
|
import { readFile as readFile9 } from "fs/promises";
|
|
25500
|
-
import { dirname as dirname27, isAbsolute as isAbsolute5, resolve as
|
|
25717
|
+
import { dirname as dirname27, isAbsolute as isAbsolute5, resolve as resolve42 } from "path";
|
|
25501
25718
|
var sideManifestCache, readSideManifest = async (sideManifestPath) => {
|
|
25502
25719
|
const cached = sideManifestCache.get(sideManifestPath);
|
|
25503
25720
|
if (cached !== undefined)
|
|
@@ -25535,7 +25752,7 @@ var sideManifestCache, readSideManifest = async (sideManifestPath) => {
|
|
|
25535
25752
|
}, readChildCss = async (cssPath, sideManifestPath) => {
|
|
25536
25753
|
if (!cssPath)
|
|
25537
25754
|
return "";
|
|
25538
|
-
const resolvedCssPath = isAbsolute5(cssPath) ? cssPath :
|
|
25755
|
+
const resolvedCssPath = isAbsolute5(cssPath) ? cssPath : resolve42(dirname27(sideManifestPath), cssPath);
|
|
25539
25756
|
const cached = childCssCache.get(resolvedCssPath);
|
|
25540
25757
|
if (cached !== undefined)
|
|
25541
25758
|
return cached;
|
|
@@ -25618,8 +25835,8 @@ __export(exports_resolveOwningComponents, {
|
|
|
25618
25835
|
resolveDescendantsOfParent: () => resolveDescendantsOfParent,
|
|
25619
25836
|
resolveOwningComponents: () => resolveOwningComponents
|
|
25620
25837
|
});
|
|
25621
|
-
import { readdirSync as readdirSync8, readFileSync as
|
|
25622
|
-
import { dirname as dirname28, extname as extname12, join as
|
|
25838
|
+
import { readdirSync as readdirSync8, readFileSync as readFileSync33, statSync as statSync5 } from "fs";
|
|
25839
|
+
import { dirname as dirname28, extname as extname12, join as join48, resolve as resolve43 } from "path";
|
|
25623
25840
|
import ts19 from "typescript";
|
|
25624
25841
|
var ENTITY_DECORATORS, isAngularSourceFile = (file5) => file5.endsWith(".ts") || file5.endsWith(".tsx"), walkAngularSourceFiles = (root) => {
|
|
25625
25842
|
const out = [];
|
|
@@ -25634,7 +25851,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file5) => file5.endsWith(".ts") ||
|
|
|
25634
25851
|
if (entry.name.startsWith(".") || entry.name === "node_modules") {
|
|
25635
25852
|
continue;
|
|
25636
25853
|
}
|
|
25637
|
-
const full =
|
|
25854
|
+
const full = join48(dir, entry.name);
|
|
25638
25855
|
if (entry.isDirectory()) {
|
|
25639
25856
|
visit(full);
|
|
25640
25857
|
} else if (entry.isFile() && isAngularSourceFile(entry.name)) {
|
|
@@ -25678,7 +25895,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file5) => file5.endsWith(".ts") ||
|
|
|
25678
25895
|
}, parseDecoratedClasses = (filePath) => {
|
|
25679
25896
|
let source;
|
|
25680
25897
|
try {
|
|
25681
|
-
source =
|
|
25898
|
+
source = readFileSync33(filePath, "utf8");
|
|
25682
25899
|
} catch {
|
|
25683
25900
|
return [];
|
|
25684
25901
|
}
|
|
@@ -25732,7 +25949,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file5) => file5.endsWith(".ts") ||
|
|
|
25732
25949
|
};
|
|
25733
25950
|
visit(sourceFile);
|
|
25734
25951
|
return out;
|
|
25735
|
-
}, safeNormalize = (path) =>
|
|
25952
|
+
}, safeNormalize = (path) => resolve43(path).replace(/\\/g, "/"), resolveOwningComponents = (params) => {
|
|
25736
25953
|
const { changedFilePath, userAngularRoot } = params;
|
|
25737
25954
|
const changedAbs = safeNormalize(changedFilePath);
|
|
25738
25955
|
const out = [];
|
|
@@ -25768,7 +25985,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file5) => file5.endsWith(".ts") ||
|
|
|
25768
25985
|
}, indexByRoot, resolveParentClassFile = (parentName, childFilePath, angularRoot) => {
|
|
25769
25986
|
let source;
|
|
25770
25987
|
try {
|
|
25771
|
-
source =
|
|
25988
|
+
source = readFileSync33(childFilePath, "utf8");
|
|
25772
25989
|
} catch {
|
|
25773
25990
|
return null;
|
|
25774
25991
|
}
|
|
@@ -25801,7 +26018,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file5) => file5.endsWith(".ts") ||
|
|
|
25801
26018
|
if (!spec.startsWith(".") && !spec.startsWith("/")) {
|
|
25802
26019
|
return null;
|
|
25803
26020
|
}
|
|
25804
|
-
const base =
|
|
26021
|
+
const base = resolve43(childDir, spec);
|
|
25805
26022
|
const candidates = [
|
|
25806
26023
|
`${base}.ts`,
|
|
25807
26024
|
`${base}.tsx`,
|
|
@@ -25839,7 +26056,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file5) => file5.endsWith(".ts") ||
|
|
|
25839
26056
|
};
|
|
25840
26057
|
if (cls.kind === "component") {
|
|
25841
26058
|
for (const url of [...cls.templateUrls, ...cls.styleUrls]) {
|
|
25842
|
-
const abs = safeNormalize(
|
|
26059
|
+
const abs = safeNormalize(resolve43(componentDir, url));
|
|
25843
26060
|
const existing = resource.get(abs);
|
|
25844
26061
|
if (existing)
|
|
25845
26062
|
existing.push(entity);
|
|
@@ -26087,8 +26304,8 @@ __export(exports_moduleServer, {
|
|
|
26087
26304
|
warmCompilers: () => warmCompilers,
|
|
26088
26305
|
warnIfReactFastRefreshUnsupported: () => warnIfReactFastRefreshUnsupported
|
|
26089
26306
|
});
|
|
26090
|
-
import { existsSync as
|
|
26091
|
-
import { basename as basename16, dirname as dirname29, extname as extname13, join as
|
|
26307
|
+
import { existsSync as existsSync37, readFileSync as readFileSync34, realpathSync as realpathSync3, statSync as statSync6 } from "fs";
|
|
26308
|
+
import { basename as basename16, dirname as dirname29, extname as extname13, join as join49, resolve as resolve44, relative as relative17 } from "path";
|
|
26092
26309
|
var SRC_PREFIX = "/@src/", BROWSER_DEFINE, jsTranspiler2, legacyDecoratorTsconfig, tsTranspiler2, tsxTranspiler, TRANSPILABLE, ALL_EXPORTS_RE, STRING_CONTENTS_RE, preserveTypeExports = (originalSource, transpiled, valueExports) => {
|
|
26093
26310
|
const codeOnly = originalSource.replace(STRING_CONTENTS_RE, '""');
|
|
26094
26311
|
const allExports = [];
|
|
@@ -26108,10 +26325,10 @@ var SRC_PREFIX = "/@src/", BROWSER_DEFINE, jsTranspiler2, legacyDecoratorTsconfi
|
|
|
26108
26325
|
${stubs}
|
|
26109
26326
|
`;
|
|
26110
26327
|
}, resolveRelativeExtension = (srcPath, projectRoot, extensions) => {
|
|
26111
|
-
const directHit = extensions.find((ext) =>
|
|
26328
|
+
const directHit = extensions.find((ext) => existsSync37(resolve44(projectRoot, srcPath + ext)));
|
|
26112
26329
|
if (directHit)
|
|
26113
26330
|
return srcPath + directHit;
|
|
26114
|
-
const indexHit = extensions.find((ext) =>
|
|
26331
|
+
const indexHit = extensions.find((ext) => existsSync37(resolve44(projectRoot, srcPath, `index${ext}`)));
|
|
26115
26332
|
if (indexHit)
|
|
26116
26333
|
return `${srcPath}/index${indexHit}`;
|
|
26117
26334
|
return srcPath;
|
|
@@ -26134,7 +26351,7 @@ ${stubs}
|
|
|
26134
26351
|
return invalidationVersion > 0 ? `${mtime}.${invalidationVersion}` : `${mtime}`;
|
|
26135
26352
|
}, srcUrl = (relPath, projectRoot) => {
|
|
26136
26353
|
const base = `${SRC_PREFIX}${relPath.replace(/\\/g, "/")}`;
|
|
26137
|
-
const absPath =
|
|
26354
|
+
const absPath = resolve44(projectRoot, relPath);
|
|
26138
26355
|
const cached = mtimeCache.get(absPath);
|
|
26139
26356
|
if (cached !== undefined)
|
|
26140
26357
|
return `${base}?v=${buildVersion(cached, absPath)}`;
|
|
@@ -26146,12 +26363,12 @@ ${stubs}
|
|
|
26146
26363
|
return base;
|
|
26147
26364
|
}
|
|
26148
26365
|
}, resolveRelativeImport = (relPath, fileDir, projectRoot, extensions) => {
|
|
26149
|
-
const absPath =
|
|
26366
|
+
const absPath = resolve44(fileDir, relPath);
|
|
26150
26367
|
const rel = relative17(projectRoot, absPath);
|
|
26151
26368
|
const extension = extname13(rel);
|
|
26152
26369
|
let srcPath = RESOLVED_MODULE_EXTENSIONS.has(extension) ? rel : resolveRelativeExtension(rel, projectRoot, extensions);
|
|
26153
26370
|
if (extname13(srcPath) === ".svelte") {
|
|
26154
|
-
srcPath = relative17(projectRoot, resolveSvelteModulePath(
|
|
26371
|
+
srcPath = relative17(projectRoot, resolveSvelteModulePath(resolve44(projectRoot, srcPath)));
|
|
26155
26372
|
}
|
|
26156
26373
|
return srcUrl(srcPath, projectRoot);
|
|
26157
26374
|
}, NODE_BUILTIN_RE, resolveAbsoluteSpecifier = (specifier, projectRoot) => {
|
|
@@ -26170,14 +26387,14 @@ ${stubs}
|
|
|
26170
26387
|
const packageName = isScoped ? `${parts[0]}/${parts[1]}` : parts[0];
|
|
26171
26388
|
const subpath = isScoped ? parts.slice(2).join("/") : parts.slice(1).join("/");
|
|
26172
26389
|
if (!subpath) {
|
|
26173
|
-
const pkgDir =
|
|
26174
|
-
const pkgJsonPath =
|
|
26175
|
-
if (
|
|
26176
|
-
const pkg = JSON.parse(
|
|
26390
|
+
const pkgDir = resolve44(projectRoot, "node_modules", packageName ?? "");
|
|
26391
|
+
const pkgJsonPath = join49(pkgDir, "package.json");
|
|
26392
|
+
if (existsSync37(pkgJsonPath)) {
|
|
26393
|
+
const pkg = JSON.parse(readFileSync34(pkgJsonPath, "utf-8"));
|
|
26177
26394
|
const esmEntry = typeof pkg.module === "string" && pkg.module || typeof pkg.browser === "string" && pkg.browser;
|
|
26178
26395
|
if (esmEntry) {
|
|
26179
|
-
const resolved =
|
|
26180
|
-
if (
|
|
26396
|
+
const resolved = resolve44(pkgDir, esmEntry);
|
|
26397
|
+
if (existsSync37(resolved))
|
|
26181
26398
|
return relative17(projectRoot, resolved);
|
|
26182
26399
|
}
|
|
26183
26400
|
}
|
|
@@ -26229,12 +26446,12 @@ ${stubs}
|
|
|
26229
26446
|
result = result.replace(/((?:from|import)\s*["'])(\/[^"']+\.(tsx?|jsx?|ts))(["'])/g, rewriteAbsoluteToSrc);
|
|
26230
26447
|
result = result.replace(/(import\s*\(\s*["'])(\/[^"']+\.(tsx?|jsx?|ts))(["']\s*\))/g, rewriteAbsoluteToSrc);
|
|
26231
26448
|
result = result.replace(/new\s+URL\(\s*["'](\.\.?\/[^"']+)["']\s*,\s*import\.meta\.url\s*\)/g, (_match, relPath) => {
|
|
26232
|
-
const absPath =
|
|
26449
|
+
const absPath = resolve44(fileDir, relPath);
|
|
26233
26450
|
const rel = relative17(projectRoot, absPath);
|
|
26234
26451
|
return `new URL('${srcUrl(rel, projectRoot)}', import.meta.url)`;
|
|
26235
26452
|
});
|
|
26236
26453
|
result = result.replace(/import\.meta\.resolve\(\s*["'](\.\.?\/[^"']+)["']\s*\)/g, (_match, relPath) => {
|
|
26237
|
-
const absPath =
|
|
26454
|
+
const absPath = resolve44(fileDir, relPath);
|
|
26238
26455
|
const rel = relative17(projectRoot, absPath);
|
|
26239
26456
|
return `'${srcUrl(rel, projectRoot)}'`;
|
|
26240
26457
|
});
|
|
@@ -26280,7 +26497,7 @@ ${code}`;
|
|
|
26280
26497
|
reactFastRefreshWarningEmitted = true;
|
|
26281
26498
|
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.");
|
|
26282
26499
|
}, transformReactFile = (filePath, projectRoot, rewriter) => {
|
|
26283
|
-
const raw =
|
|
26500
|
+
const raw = readFileSync34(filePath, "utf-8");
|
|
26284
26501
|
const valueExports = tsxTranspiler.scan(raw).exports;
|
|
26285
26502
|
let transpiled = reactTranspiler.transformSync(raw);
|
|
26286
26503
|
transpiled = preserveTypeExports(raw, transpiled, valueExports);
|
|
@@ -26296,7 +26513,7 @@ ${transpiled}`;
|
|
|
26296
26513
|
transpiled += buildIslandMetadataExports(raw);
|
|
26297
26514
|
return rewriteImports(transpiled, filePath, projectRoot, rewriter);
|
|
26298
26515
|
}, transformPlainFile = (filePath, projectRoot, rewriter, vueDir) => {
|
|
26299
|
-
const raw =
|
|
26516
|
+
const raw = readFileSync34(filePath, "utf-8");
|
|
26300
26517
|
const ext = extname13(filePath);
|
|
26301
26518
|
const isTS = ext === ".ts" || ext === ".tsx";
|
|
26302
26519
|
const isTSX = ext === ".tsx" || ext === ".jsx";
|
|
@@ -26462,7 +26679,7 @@ ${code}`;
|
|
|
26462
26679
|
` + ` var __hmr_accept = function(cb) { window.__SVELTE_HMR_ACCEPT__[${JSON.stringify(moduleUrl)}] = cb; };`);
|
|
26463
26680
|
return code.replace(/import\.meta\.hot\.accept\(/g, "__hmr_accept(");
|
|
26464
26681
|
}, transformSvelteFile = async (filePath, projectRoot, rewriter, stylePreprocessors) => {
|
|
26465
|
-
const raw =
|
|
26682
|
+
const raw = readFileSync34(filePath, "utf-8");
|
|
26466
26683
|
if (!svelteCompiler) {
|
|
26467
26684
|
svelteCompiler = await import("svelte/compiler");
|
|
26468
26685
|
}
|
|
@@ -26528,7 +26745,7 @@ export default __script__;`;
|
|
|
26528
26745
|
return `${cssInjection}
|
|
26529
26746
|
${code}`;
|
|
26530
26747
|
}, transformVueFile = async (filePath, projectRoot, rewriter, vueDir, stylePreprocessors) => {
|
|
26531
|
-
const rawSource =
|
|
26748
|
+
const rawSource = readFileSync34(filePath, "utf-8");
|
|
26532
26749
|
const raw = addAutoRouterSetupApp(rawSource);
|
|
26533
26750
|
if (!vueCompiler) {
|
|
26534
26751
|
vueCompiler = await loadVueCompiler();
|
|
@@ -26539,9 +26756,9 @@ ${code}`;
|
|
|
26539
26756
|
const hasScript = descriptor.script || descriptor.scriptSetup;
|
|
26540
26757
|
const compiledScript = hasScript ? vueCompiler.compileScript(descriptor, {
|
|
26541
26758
|
fs: {
|
|
26542
|
-
fileExists:
|
|
26759
|
+
fileExists: existsSync37,
|
|
26543
26760
|
realpath: realpathSync3,
|
|
26544
|
-
readFile: (file5) =>
|
|
26761
|
+
readFile: (file5) => existsSync37(file5) ? readFileSync34(file5, "utf-8") : undefined
|
|
26545
26762
|
},
|
|
26546
26763
|
id: componentId,
|
|
26547
26764
|
inlineTemplate: false
|
|
@@ -26556,7 +26773,7 @@ ${code}`;
|
|
|
26556
26773
|
code = injectVueHmr(code, filePath, projectRoot, vueDir);
|
|
26557
26774
|
return rewriteImports(code, filePath, projectRoot, rewriter);
|
|
26558
26775
|
}, injectVueHmr = (code, filePath, projectRoot, vueDir) => {
|
|
26559
|
-
const hmrBase = vueDir ?
|
|
26776
|
+
const hmrBase = vueDir ? resolve44(vueDir) : projectRoot;
|
|
26560
26777
|
const hmrId = relative17(hmrBase, filePath).replace(/\\/g, "/").replace(/\.vue$/, "");
|
|
26561
26778
|
let result = code.replace(/export\s+default\s+/, "var __hmr_comp__ = ");
|
|
26562
26779
|
result += [
|
|
@@ -26571,11 +26788,11 @@ ${code}`;
|
|
|
26571
26788
|
`);
|
|
26572
26789
|
return result;
|
|
26573
26790
|
}, resolveSvelteModulePath = (path) => {
|
|
26574
|
-
if (
|
|
26791
|
+
if (existsSync37(path))
|
|
26575
26792
|
return path;
|
|
26576
|
-
if (
|
|
26793
|
+
if (existsSync37(`${path}.ts`))
|
|
26577
26794
|
return `${path}.ts`;
|
|
26578
|
-
if (
|
|
26795
|
+
if (existsSync37(`${path}.js`))
|
|
26579
26796
|
return `${path}.js`;
|
|
26580
26797
|
return path;
|
|
26581
26798
|
}, jsResponse = (body) => {
|
|
@@ -26588,7 +26805,7 @@ ${code}`;
|
|
|
26588
26805
|
}
|
|
26589
26806
|
});
|
|
26590
26807
|
}, handleCssRequest = (filePath) => {
|
|
26591
|
-
const raw =
|
|
26808
|
+
const raw = readFileSync34(filePath, "utf-8");
|
|
26592
26809
|
const escaped = raw.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$/g, "\\$");
|
|
26593
26810
|
return [
|
|
26594
26811
|
`const style = document.createElement('style');`,
|
|
@@ -26720,13 +26937,13 @@ export default {};
|
|
|
26720
26937
|
const escaped = virtualCss.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$/g, "\\$");
|
|
26721
26938
|
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);`);
|
|
26722
26939
|
}, resolveSourcePath = (relPath, projectRoot) => {
|
|
26723
|
-
const filePath =
|
|
26940
|
+
const filePath = resolve44(projectRoot, relPath);
|
|
26724
26941
|
const ext = extname13(filePath);
|
|
26725
26942
|
if (ext === ".svelte")
|
|
26726
26943
|
return { ext, filePath: resolveSvelteModulePath(filePath) };
|
|
26727
26944
|
if (ext)
|
|
26728
26945
|
return { ext, filePath };
|
|
26729
|
-
const found = MODULE_EXTENSIONS.find((candidate) =>
|
|
26946
|
+
const found = MODULE_EXTENSIONS.find((candidate) => existsSync37(filePath + candidate));
|
|
26730
26947
|
if (!found)
|
|
26731
26948
|
return { ext, filePath };
|
|
26732
26949
|
const resolved = filePath + found;
|
|
@@ -26757,14 +26974,14 @@ export default {};
|
|
|
26757
26974
|
const absoluteCandidate = `/${tail.replace(/^\/+/, "")}`;
|
|
26758
26975
|
const candidates = [
|
|
26759
26976
|
absoluteCandidate,
|
|
26760
|
-
|
|
26977
|
+
resolve44(projectRoot, tail)
|
|
26761
26978
|
];
|
|
26762
26979
|
try {
|
|
26763
26980
|
const { loadConfig: loadConfig2 } = await Promise.resolve().then(() => (init_loadConfig(), exports_loadConfig));
|
|
26764
26981
|
const cfg = await loadConfig2();
|
|
26765
|
-
const angularDir = cfg.angularDirectory &&
|
|
26982
|
+
const angularDir = cfg.angularDirectory && resolve44(projectRoot, cfg.angularDirectory);
|
|
26766
26983
|
if (angularDir)
|
|
26767
|
-
candidates.push(
|
|
26984
|
+
candidates.push(resolve44(angularDir, tail));
|
|
26768
26985
|
} catch {}
|
|
26769
26986
|
for (const candidate of candidates) {
|
|
26770
26987
|
if (await fileExists(candidate)) {
|
|
@@ -26795,7 +27012,7 @@ export default {};
|
|
|
26795
27012
|
if (!TRANSPILABLE.has(ext))
|
|
26796
27013
|
return;
|
|
26797
27014
|
const stat3 = statSync6(filePath);
|
|
26798
|
-
const resolvedVueDir = vueDir ?
|
|
27015
|
+
const resolvedVueDir = vueDir ? resolve44(vueDir) : undefined;
|
|
26799
27016
|
let content = REACT_EXTENSIONS.has(ext) ? transformReactFile(filePath, projectRoot, rewriter) : transformPlainFile(filePath, projectRoot, rewriter, resolvedVueDir);
|
|
26800
27017
|
const isAngularGeneratedJs = ext === ".js" && filePath.replace(/\\/g, "/").includes("/.absolutejs/generated/angular/");
|
|
26801
27018
|
if (isAngularGeneratedJs) {
|
|
@@ -26854,7 +27071,7 @@ export default {};
|
|
|
26854
27071
|
const relPath = pathname.slice(SRC_PREFIX.length);
|
|
26855
27072
|
if (relPath === "bun:wrap" || relPath.startsWith("bun:wrap?"))
|
|
26856
27073
|
return handleBunWrapRequest();
|
|
26857
|
-
const virtualCssResponse = handleVirtualSvelteCss(
|
|
27074
|
+
const virtualCssResponse = handleVirtualSvelteCss(resolve44(projectRoot, relPath));
|
|
26858
27075
|
if (virtualCssResponse)
|
|
26859
27076
|
return virtualCssResponse;
|
|
26860
27077
|
const { filePath, ext } = resolveSourcePath(relPath, projectRoot);
|
|
@@ -26870,11 +27087,11 @@ export default {};
|
|
|
26870
27087
|
SRC_IMPORT_RE.lastIndex = 0;
|
|
26871
27088
|
while ((match = SRC_IMPORT_RE.exec(content)) !== null) {
|
|
26872
27089
|
if (match[1])
|
|
26873
|
-
files.push(
|
|
27090
|
+
files.push(resolve44(projectRoot, match[1]));
|
|
26874
27091
|
}
|
|
26875
27092
|
return files;
|
|
26876
27093
|
}, invalidateModule = (filePath) => {
|
|
26877
|
-
const resolved =
|
|
27094
|
+
const resolved = resolve44(filePath);
|
|
26878
27095
|
invalidate(filePath);
|
|
26879
27096
|
if (resolved !== filePath)
|
|
26880
27097
|
invalidate(resolved);
|
|
@@ -27037,7 +27254,7 @@ __export(exports_hmrCompiler, {
|
|
|
27037
27254
|
encodeHmrComponentId: () => encodeHmrComponentId,
|
|
27038
27255
|
getApplyMetadataModule: () => getApplyMetadataModule
|
|
27039
27256
|
});
|
|
27040
|
-
import { dirname as dirname30, relative as relative18, resolve as
|
|
27257
|
+
import { dirname as dirname30, relative as relative18, resolve as resolve45 } from "path";
|
|
27041
27258
|
import { performance as performance2 } from "perf_hooks";
|
|
27042
27259
|
var encodeHmrComponentId = (absoluteFilePath, className) => {
|
|
27043
27260
|
const projectRel = relative18(process.cwd(), absoluteFilePath).replace(/\\/g, "/");
|
|
@@ -27049,7 +27266,7 @@ var encodeHmrComponentId = (absoluteFilePath, className) => {
|
|
|
27049
27266
|
return null;
|
|
27050
27267
|
const filePathRel = decoded.slice(0, separatorIndex);
|
|
27051
27268
|
const className = decoded.slice(separatorIndex + 1);
|
|
27052
|
-
const componentFilePath =
|
|
27269
|
+
const componentFilePath = resolve45(process.cwd(), filePathRel);
|
|
27053
27270
|
const projectRelPath = relative18(process.cwd(), componentFilePath).replace(/\\/g, "/");
|
|
27054
27271
|
const cacheKey2 = encodeURIComponent(`${projectRelPath}@${className}`);
|
|
27055
27272
|
const { takePendingModule: takePendingModule2 } = await Promise.resolve().then(() => (init_fastHmrCompiler(), exports_fastHmrCompiler));
|
|
@@ -27219,11 +27436,11 @@ var exports_simpleHTMLHMR = {};
|
|
|
27219
27436
|
__export(exports_simpleHTMLHMR, {
|
|
27220
27437
|
handleHTMLUpdate: () => handleHTMLUpdate
|
|
27221
27438
|
});
|
|
27222
|
-
import { resolve as
|
|
27439
|
+
import { resolve as resolve46 } from "path";
|
|
27223
27440
|
var handleHTMLUpdate = async (htmlFilePath) => {
|
|
27224
27441
|
let htmlContent;
|
|
27225
27442
|
try {
|
|
27226
|
-
const resolvedPath =
|
|
27443
|
+
const resolvedPath = resolve46(htmlFilePath);
|
|
27227
27444
|
const file5 = Bun.file(resolvedPath);
|
|
27228
27445
|
if (!await file5.exists()) {
|
|
27229
27446
|
return null;
|
|
@@ -27249,11 +27466,11 @@ var exports_simpleHTMXHMR = {};
|
|
|
27249
27466
|
__export(exports_simpleHTMXHMR, {
|
|
27250
27467
|
handleHTMXUpdate: () => handleHTMXUpdate
|
|
27251
27468
|
});
|
|
27252
|
-
import { resolve as
|
|
27469
|
+
import { resolve as resolve47 } from "path";
|
|
27253
27470
|
var handleHTMXUpdate = async (htmxFilePath) => {
|
|
27254
27471
|
let htmlContent;
|
|
27255
27472
|
try {
|
|
27256
|
-
const resolvedPath =
|
|
27473
|
+
const resolvedPath = resolve47(htmxFilePath);
|
|
27257
27474
|
const file5 = Bun.file(resolvedPath);
|
|
27258
27475
|
if (!await file5.exists()) {
|
|
27259
27476
|
return null;
|
|
@@ -27275,12 +27492,12 @@ var handleHTMXUpdate = async (htmxFilePath) => {
|
|
|
27275
27492
|
var init_simpleHTMXHMR = () => {};
|
|
27276
27493
|
|
|
27277
27494
|
// src/dev/rebuildTrigger.ts
|
|
27278
|
-
import { existsSync as
|
|
27495
|
+
import { existsSync as existsSync38, readdirSync as readdirSync9, rmSync as rmSync3 } from "fs";
|
|
27279
27496
|
import {
|
|
27280
27497
|
basename as basename17,
|
|
27281
27498
|
dirname as dirname31,
|
|
27282
27499
|
isAbsolute as isAbsolute6,
|
|
27283
|
-
join as
|
|
27500
|
+
join as join50,
|
|
27284
27501
|
relative as relative19,
|
|
27285
27502
|
resolve as resolvePath3,
|
|
27286
27503
|
sep as sep4
|
|
@@ -27389,7 +27606,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
27389
27606
|
detectedFw = detected !== "ignored" ? detected : affectedFrameworks[0];
|
|
27390
27607
|
}
|
|
27391
27608
|
return { ...parsed, framework: detectedFw };
|
|
27392
|
-
}, isValidDeletedAffectedFile = (affectedFile, deletedPathResolved, processedFiles) => affectedFile !== deletedPathResolved && !processedFiles.has(affectedFile) &&
|
|
27609
|
+
}, isValidDeletedAffectedFile = (affectedFile, deletedPathResolved, processedFiles) => affectedFile !== deletedPathResolved && !processedFiles.has(affectedFile) && existsSync38(affectedFile), FRAMEWORK_DIR_KEYS_FOR_CLEANUP, removeStaleGenerated = (state, deletedFile) => {
|
|
27393
27610
|
const { config } = state;
|
|
27394
27611
|
const cwd2 = process.cwd();
|
|
27395
27612
|
const absDeleted = resolvePath3(deletedFile).replace(/\\/g, "/");
|
|
@@ -27407,8 +27624,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
27407
27624
|
const relJs = `${rel.slice(0, -ext[0].length)}.js`;
|
|
27408
27625
|
const generatedDir = getFrameworkGeneratedDir(framework, cwd2);
|
|
27409
27626
|
for (const candidate of [
|
|
27410
|
-
|
|
27411
|
-
`${
|
|
27627
|
+
join50(generatedDir, relJs),
|
|
27628
|
+
`${join50(generatedDir, relJs)}.map`
|
|
27412
27629
|
]) {
|
|
27413
27630
|
try {
|
|
27414
27631
|
rmSync3(candidate, { force: true });
|
|
@@ -27435,7 +27652,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
27435
27652
|
if (!dependents || dependents.size === 0) {
|
|
27436
27653
|
return;
|
|
27437
27654
|
}
|
|
27438
|
-
const dependentFiles = Array.from(dependents).filter((file5) =>
|
|
27655
|
+
const dependentFiles = Array.from(dependents).filter((file5) => existsSync38(file5));
|
|
27439
27656
|
if (dependentFiles.length === 0) {
|
|
27440
27657
|
return;
|
|
27441
27658
|
}
|
|
@@ -27451,7 +27668,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
27451
27668
|
try {
|
|
27452
27669
|
const affectedFiles = getAffectedFiles(state.dependencyGraph, normalizedFilePath);
|
|
27453
27670
|
affectedFiles.forEach((affectedFile) => {
|
|
27454
|
-
if (!processedFiles.has(affectedFile) && affectedFile !== normalizedFilePath &&
|
|
27671
|
+
if (!processedFiles.has(affectedFile) && affectedFile !== normalizedFilePath && existsSync38(affectedFile)) {
|
|
27455
27672
|
validFiles.push(affectedFile);
|
|
27456
27673
|
processedFiles.add(affectedFile);
|
|
27457
27674
|
}
|
|
@@ -27476,7 +27693,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
27476
27693
|
collectChangedFileAffected(state, normalizedFilePath, processedFiles, validFiles);
|
|
27477
27694
|
}, processFilePathSet = (state, filePathSet, processedFiles, validFiles) => {
|
|
27478
27695
|
filePathSet.forEach((filePathInSet) => {
|
|
27479
|
-
if (!
|
|
27696
|
+
if (!existsSync38(filePathInSet)) {
|
|
27480
27697
|
collectDeletedFileAffected(state, filePathInSet, processedFiles, validFiles);
|
|
27481
27698
|
return;
|
|
27482
27699
|
}
|
|
@@ -27741,7 +27958,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
27741
27958
|
return componentFile;
|
|
27742
27959
|
}
|
|
27743
27960
|
const tsCounterpart = componentFile.replace(/\.html$/, ".ts");
|
|
27744
|
-
if (
|
|
27961
|
+
if (existsSync38(tsCounterpart)) {
|
|
27745
27962
|
return tsCounterpart;
|
|
27746
27963
|
}
|
|
27747
27964
|
if (!graph)
|
|
@@ -28191,8 +28408,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
28191
28408
|
};
|
|
28192
28409
|
return ({ immediate = false } = {}) => {
|
|
28193
28410
|
if (!ctx.debouncedPromise) {
|
|
28194
|
-
ctx.debouncedPromise = new Promise((
|
|
28195
|
-
ctx.debouncedResolve =
|
|
28411
|
+
ctx.debouncedPromise = new Promise((resolve48) => {
|
|
28412
|
+
ctx.debouncedResolve = resolve48;
|
|
28196
28413
|
});
|
|
28197
28414
|
}
|
|
28198
28415
|
const scheduled = ctx.debouncedPromise;
|
|
@@ -28314,7 +28531,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
28314
28531
|
const entries = await readdir6(dir, { withFileTypes: true });
|
|
28315
28532
|
const files = [];
|
|
28316
28533
|
for (const entry of entries) {
|
|
28317
|
-
const full =
|
|
28534
|
+
const full = join50(dir, entry.name);
|
|
28318
28535
|
if (entry.isDirectory()) {
|
|
28319
28536
|
files.push(...await walk(full));
|
|
28320
28537
|
} else if (entry.isFile() && entry.name.endsWith(".ts") && !entry.name.endsWith(".d.ts")) {
|
|
@@ -28611,7 +28828,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
28611
28828
|
}
|
|
28612
28829
|
return ctx;
|
|
28613
28830
|
}, runSvelteBundleRebuild = async (state, svelteFiles, config) => {
|
|
28614
|
-
const existingSvelteFiles = svelteFiles.filter((file5) =>
|
|
28831
|
+
const existingSvelteFiles = svelteFiles.filter((file5) => existsSync38(file5));
|
|
28615
28832
|
if (existingSvelteFiles.length === 0)
|
|
28616
28833
|
return;
|
|
28617
28834
|
const svelteDir = config.svelteDirectory ?? "";
|
|
@@ -28727,8 +28944,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
28727
28944
|
};
|
|
28728
28945
|
return () => {
|
|
28729
28946
|
if (!ctx.debouncedPromise) {
|
|
28730
|
-
ctx.debouncedPromise = new Promise((
|
|
28731
|
-
ctx.debouncedResolve =
|
|
28947
|
+
ctx.debouncedPromise = new Promise((resolve48) => {
|
|
28948
|
+
ctx.debouncedResolve = resolve48;
|
|
28732
28949
|
});
|
|
28733
28950
|
}
|
|
28734
28951
|
if (ctx.debounceTimer)
|
|
@@ -28877,7 +29094,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
28877
29094
|
} = await compileVue2(vueFiles, vueDir, true, getStyleTransformConfig(state.config));
|
|
28878
29095
|
const serverEntries = [...vueServerPaths];
|
|
28879
29096
|
const clientEntries = [...vueIndexPaths, ...vueClientPaths];
|
|
28880
|
-
const cssOutDir =
|
|
29097
|
+
const cssOutDir = join50(buildDir, state.resolvedPaths.assetsDir ? basename17(state.resolvedPaths.assetsDir) : "assets", "css");
|
|
28881
29098
|
const { serverRoot, serverOutDir } = await computeServerOutPaths(state.resolvedPaths, "vue");
|
|
28882
29099
|
const serverExternals = await getServerBundleExternals();
|
|
28883
29100
|
const clientVendorPaths = await getClientVendorPaths();
|
|
@@ -29005,8 +29222,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
29005
29222
|
};
|
|
29006
29223
|
return () => {
|
|
29007
29224
|
if (!ctx.debouncedPromise) {
|
|
29008
|
-
ctx.debouncedPromise = new Promise((
|
|
29009
|
-
ctx.debouncedResolve =
|
|
29225
|
+
ctx.debouncedPromise = new Promise((resolve48) => {
|
|
29226
|
+
ctx.debouncedResolve = resolve48;
|
|
29010
29227
|
});
|
|
29011
29228
|
}
|
|
29012
29229
|
if (ctx.debounceTimer)
|
|
@@ -29968,9 +30185,9 @@ __export(exports_buildDepVendor, {
|
|
|
29968
30185
|
buildDepVendor: () => buildDepVendor,
|
|
29969
30186
|
computeDepVendorPaths: () => computeDepVendorPaths
|
|
29970
30187
|
});
|
|
29971
|
-
import { mkdirSync as
|
|
30188
|
+
import { mkdirSync as mkdirSync15 } from "fs";
|
|
29972
30189
|
import { isBuiltin } from "module";
|
|
29973
|
-
import { join as
|
|
30190
|
+
import { join as join51 } from "path";
|
|
29974
30191
|
import { rm as rm14 } from "fs/promises";
|
|
29975
30192
|
var {build: bunBuild9, Glob: Glob10 } = globalThis.Bun;
|
|
29976
30193
|
var toSafeFileName6 = (specifier) => {
|
|
@@ -30029,7 +30246,7 @@ var toSafeFileName6 = (specifier) => {
|
|
|
30029
30246
|
framework: Array.from(framework).filter(isResolvable3)
|
|
30030
30247
|
};
|
|
30031
30248
|
}, collectBareImportsFromFile = async (entryPath, transpiler6, maxDepth = 8) => {
|
|
30032
|
-
const { readFileSync:
|
|
30249
|
+
const { readFileSync: readFileSync35 } = await import("fs");
|
|
30033
30250
|
const { dirname: dirname32 } = await import("path");
|
|
30034
30251
|
const seenFiles = new Set;
|
|
30035
30252
|
const bareOut = new Set;
|
|
@@ -30045,7 +30262,7 @@ var toSafeFileName6 = (specifier) => {
|
|
|
30045
30262
|
continue;
|
|
30046
30263
|
let content;
|
|
30047
30264
|
try {
|
|
30048
|
-
content =
|
|
30265
|
+
content = readFileSync35(path, "utf-8");
|
|
30049
30266
|
} catch {
|
|
30050
30267
|
continue;
|
|
30051
30268
|
}
|
|
@@ -30119,7 +30336,7 @@ var toSafeFileName6 = (specifier) => {
|
|
|
30119
30336
|
}), buildDepVendorPass = async (specifiers, vendorDir, tmpDir) => {
|
|
30120
30337
|
const entries = await Promise.all(specifiers.map(async (specifier) => {
|
|
30121
30338
|
const safeName = toSafeFileName6(specifier);
|
|
30122
|
-
const entryPath =
|
|
30339
|
+
const entryPath = join51(tmpDir, `${safeName}.ts`);
|
|
30123
30340
|
await Bun.write(entryPath, await generateVendorEntrySource(specifier));
|
|
30124
30341
|
return { entryPath, specifier };
|
|
30125
30342
|
}));
|
|
@@ -30210,10 +30427,10 @@ var toSafeFileName6 = (specifier) => {
|
|
|
30210
30427
|
const { dep: initialSpecs, framework: frameworkRoots } = await scanBareImports(directories);
|
|
30211
30428
|
if (initialSpecs.length === 0 && frameworkRoots.length === 0)
|
|
30212
30429
|
return {};
|
|
30213
|
-
const vendorDir =
|
|
30214
|
-
|
|
30215
|
-
const tmpDir =
|
|
30216
|
-
|
|
30430
|
+
const vendorDir = join51(buildDir, "vendor");
|
|
30431
|
+
mkdirSync15(vendorDir, { recursive: true });
|
|
30432
|
+
const tmpDir = join51(buildDir, "_dep_vendor_tmp");
|
|
30433
|
+
mkdirSync15(tmpDir, { recursive: true });
|
|
30217
30434
|
const allSpecs = new Set(initialSpecs);
|
|
30218
30435
|
const alreadyScanned = new Set;
|
|
30219
30436
|
let frontier = [...allSpecs, ...frameworkRoots];
|
|
@@ -30296,7 +30513,7 @@ __export(exports_devBuild, {
|
|
|
30296
30513
|
});
|
|
30297
30514
|
import { readdir as readdir6 } from "fs/promises";
|
|
30298
30515
|
import { statSync as statSync7 } from "fs";
|
|
30299
|
-
import { resolve as
|
|
30516
|
+
import { resolve as resolve48 } from "path";
|
|
30300
30517
|
var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
30301
30518
|
const configuredDirs = [
|
|
30302
30519
|
config.reactDirectory,
|
|
@@ -30305,7 +30522,7 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
30305
30522
|
config.angularDirectory,
|
|
30306
30523
|
config.htmlDirectory,
|
|
30307
30524
|
config.htmxDirectory,
|
|
30308
|
-
|
|
30525
|
+
resolve48(import.meta.dir, "../dev/client")
|
|
30309
30526
|
].filter((dir) => Boolean(dir));
|
|
30310
30527
|
return Array.from(new Set(configuredDirs));
|
|
30311
30528
|
}, parseDirectoryConfig = (source) => {
|
|
@@ -30320,7 +30537,7 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
30320
30537
|
return Object.keys(config).length > 0 ? config : null;
|
|
30321
30538
|
}, reloadConfig = async () => {
|
|
30322
30539
|
try {
|
|
30323
|
-
const configPath2 =
|
|
30540
|
+
const configPath2 = resolve48(process.env.ABSOLUTE_CONFIG ?? "absolute.config.ts");
|
|
30324
30541
|
const source = await Bun.file(configPath2).text();
|
|
30325
30542
|
return parseDirectoryConfig(source);
|
|
30326
30543
|
} catch {
|
|
@@ -30432,7 +30649,7 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
30432
30649
|
});
|
|
30433
30650
|
}
|
|
30434
30651
|
}, handleCachedReload = async () => {
|
|
30435
|
-
const serverMtime = statSync7(
|
|
30652
|
+
const serverMtime = statSync7(resolve48(Bun.main)).mtimeMs;
|
|
30436
30653
|
const lastMtime = globalThis.__hmrServerMtime;
|
|
30437
30654
|
globalThis.__hmrServerMtime = serverMtime;
|
|
30438
30655
|
const cached = globalThis.__hmrDevResult;
|
|
@@ -30469,8 +30686,8 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
30469
30686
|
return true;
|
|
30470
30687
|
}, resolveAbsoluteVersion2 = async () => {
|
|
30471
30688
|
const candidates = [
|
|
30472
|
-
|
|
30473
|
-
|
|
30689
|
+
resolve48(import.meta.dir, "..", "..", "package.json"),
|
|
30690
|
+
resolve48(import.meta.dir, "..", "package.json")
|
|
30474
30691
|
];
|
|
30475
30692
|
const [candidate, ...remaining] = candidates;
|
|
30476
30693
|
if (!candidate) {
|
|
@@ -30496,7 +30713,7 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
30496
30713
|
const entries = await readdir6(vendorDir).catch(() => emptyStringArray);
|
|
30497
30714
|
await Promise.all(entries.filter((entry) => entry.endsWith(".js")).map(async (entry) => {
|
|
30498
30715
|
const webPath = `/${framework}/vendor/${entry}`;
|
|
30499
|
-
const bytes = await Bun.file(
|
|
30716
|
+
const bytes = await Bun.file(resolve48(vendorDir, entry)).bytes();
|
|
30500
30717
|
assetStore.set(webPath, bytes);
|
|
30501
30718
|
}));
|
|
30502
30719
|
}, devBuild = async (config) => {
|
|
@@ -30521,6 +30738,7 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
30521
30738
|
process.env.ABSOLUTE_BUILD_DIR ??= state.resolvedPaths.buildDir;
|
|
30522
30739
|
recordStep("create HMR state", stepStartedAt);
|
|
30523
30740
|
stepStartedAt = performance.now();
|
|
30741
|
+
setBootPhase("scan source tree");
|
|
30524
30742
|
const watchPaths = getWatchPaths(config, state.resolvedPaths);
|
|
30525
30743
|
buildInitialDependencyGraph(state.dependencyGraph, watchPaths);
|
|
30526
30744
|
recordStep("initialize dependency graph", stepStartedAt);
|
|
@@ -30599,6 +30817,7 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
30599
30817
|
recordStep("start file watching", stepStartedAt);
|
|
30600
30818
|
const buildStart = performance.now();
|
|
30601
30819
|
let buildResult = null;
|
|
30820
|
+
setBootPhase("initial build");
|
|
30602
30821
|
try {
|
|
30603
30822
|
buildResult = await build2({
|
|
30604
30823
|
...config,
|
|
@@ -30631,15 +30850,17 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
30631
30850
|
console.log("\u26A0\uFE0F Manifest is empty - this is OK for HTML/HTMX-only projects");
|
|
30632
30851
|
}
|
|
30633
30852
|
stepStartedAt = performance.now();
|
|
30853
|
+
setBootPhase("populate asset store");
|
|
30634
30854
|
await populateAssetStore(state.assetStore, manifest, state.resolvedPaths.buildDir);
|
|
30635
30855
|
cleanStaleAssets(state.assetStore, manifest, state.resolvedPaths.buildDir);
|
|
30636
30856
|
recordStep("populate asset store", stepStartedAt);
|
|
30637
30857
|
stepStartedAt = performance.now();
|
|
30638
|
-
|
|
30639
|
-
const
|
|
30640
|
-
const
|
|
30641
|
-
const
|
|
30642
|
-
const
|
|
30858
|
+
setBootPhase("build vendor bundles");
|
|
30859
|
+
const reactVendorDir = resolve48(state.resolvedPaths.buildDir, "react", "vendor");
|
|
30860
|
+
const angularVendorDir = resolve48(state.resolvedPaths.buildDir, "angular", "vendor");
|
|
30861
|
+
const svelteVendorDir = resolve48(state.resolvedPaths.buildDir, "svelte", "vendor");
|
|
30862
|
+
const vueVendorDir = resolve48(state.resolvedPaths.buildDir, "vue", "vendor");
|
|
30863
|
+
const depVendorDir = resolve48(state.resolvedPaths.buildDir, "vendor");
|
|
30643
30864
|
const { buildDepVendor: buildDepVendor2 } = await Promise.resolve().then(() => (init_buildDepVendor(), exports_buildDepVendor));
|
|
30644
30865
|
const [, angularSpecs, , , , , depPaths] = await Promise.all([
|
|
30645
30866
|
config.reactDirectory ? buildReactVendor(state.resolvedPaths.buildDir) : Promise.resolve(undefined),
|
|
@@ -30658,6 +30879,7 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
30658
30879
|
globalThis.__depVendorPaths = depPaths;
|
|
30659
30880
|
recordStep("build vendor bundles", stepStartedAt);
|
|
30660
30881
|
stepStartedAt = performance.now();
|
|
30882
|
+
setBootPhase("rewrite vendor cross-references");
|
|
30661
30883
|
const combinedVendorPaths = {
|
|
30662
30884
|
...getDevVendorPaths() ?? {},
|
|
30663
30885
|
...getAngularVendorPaths() ?? {},
|
|
@@ -30685,6 +30907,7 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
30685
30907
|
]);
|
|
30686
30908
|
recordStep("load vendor files", stepStartedAt);
|
|
30687
30909
|
stepStartedAt = performance.now();
|
|
30910
|
+
setBootPhase("warm compilers");
|
|
30688
30911
|
const { warmCompilers: warmCompilers2 } = await Promise.resolve().then(() => (init_moduleServer(), exports_moduleServer));
|
|
30689
30912
|
await warmCompilers2({
|
|
30690
30913
|
svelte: Boolean(config.svelteDirectory),
|
|
@@ -30717,7 +30940,7 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
30717
30940
|
manifest
|
|
30718
30941
|
};
|
|
30719
30942
|
globalThis.__hmrDevResult = result;
|
|
30720
|
-
globalThis.__hmrServerMtime = statSync7(
|
|
30943
|
+
globalThis.__hmrServerMtime = statSync7(resolve48(Bun.main)).mtimeMs;
|
|
30721
30944
|
return result;
|
|
30722
30945
|
};
|
|
30723
30946
|
var init_devBuild = __esm(() => {
|
|
@@ -30736,6 +30959,7 @@ var init_devBuild = __esm(() => {
|
|
|
30736
30959
|
init_rebuildTrigger();
|
|
30737
30960
|
init_logger();
|
|
30738
30961
|
init_startupTimings();
|
|
30962
|
+
init_bootLifecycle();
|
|
30739
30963
|
FRAMEWORK_DIR_KEYS = [
|
|
30740
30964
|
"reactDirectory",
|
|
30741
30965
|
"svelteDirectory",
|
|
@@ -30866,8 +31090,8 @@ var STORE_KEY = "__elysiaStore", restoredStores, getGlobalValue = (key) => Refle
|
|
|
30866
31090
|
return null;
|
|
30867
31091
|
if (!pathname.startsWith("/"))
|
|
30868
31092
|
return null;
|
|
30869
|
-
const { resolve:
|
|
30870
|
-
const candidate =
|
|
31093
|
+
const { resolve: resolve49, normalize } = await import("path");
|
|
31094
|
+
const candidate = resolve49(buildDir, pathname.slice(1));
|
|
30871
31095
|
const normalizedBuild = normalize(buildDir);
|
|
30872
31096
|
if (!candidate.startsWith(normalizedBuild))
|
|
30873
31097
|
return null;
|
|
@@ -30966,17 +31190,17 @@ __export(exports_devtoolsJson, {
|
|
|
30966
31190
|
normalizeDevtoolsWorkspaceRoot: () => normalizeDevtoolsWorkspaceRoot,
|
|
30967
31191
|
resolveDevtoolsUuidCachePath: () => resolveDevtoolsUuidCachePath
|
|
30968
31192
|
});
|
|
30969
|
-
import { existsSync as
|
|
30970
|
-
import { dirname as dirname32, join as
|
|
31193
|
+
import { existsSync as existsSync39, mkdirSync as mkdirSync16, readFileSync as readFileSync35, writeFileSync as writeFileSync11 } from "fs";
|
|
31194
|
+
import { dirname as dirname32, join as join52, resolve as resolve49 } from "path";
|
|
30971
31195
|
import { Elysia as Elysia7 } from "elysia";
|
|
30972
31196
|
var ENDPOINT = "/.well-known/appspecific/com.chrome.devtools.json", UUID_CACHE_KEY = "__absoluteDevtoolsWorkspaceUuid", getGlobalUuid = () => Reflect.get(globalThis, UUID_CACHE_KEY), setGlobalUuid = (uuid) => {
|
|
30973
31197
|
Reflect.set(globalThis, UUID_CACHE_KEY, uuid);
|
|
30974
31198
|
return uuid;
|
|
30975
|
-
}, isUuidV4 = (value) => /^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(value), resolveDevtoolsUuidCachePath = (buildDir, uuidCachePath) =>
|
|
30976
|
-
if (!
|
|
31199
|
+
}, isUuidV4 = (value) => /^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(value), resolveDevtoolsUuidCachePath = (buildDir, uuidCachePath) => resolve49(uuidCachePath ?? join52(buildDir, ".absolute", "chrome-devtools-workspace-uuid")), readCachedUuid = (cachePath) => {
|
|
31200
|
+
if (!existsSync39(cachePath))
|
|
30977
31201
|
return null;
|
|
30978
31202
|
try {
|
|
30979
|
-
const value =
|
|
31203
|
+
const value = readFileSync35(cachePath, "utf-8").trim();
|
|
30980
31204
|
return isUuidV4(value) ? value : null;
|
|
30981
31205
|
} catch {
|
|
30982
31206
|
return null;
|
|
@@ -30994,11 +31218,11 @@ var ENDPOINT = "/.well-known/appspecific/com.chrome.devtools.json", UUID_CACHE_K
|
|
|
30994
31218
|
if (cachedUuid)
|
|
30995
31219
|
return setGlobalUuid(cachedUuid);
|
|
30996
31220
|
const uuid = crypto.randomUUID();
|
|
30997
|
-
|
|
30998
|
-
|
|
31221
|
+
mkdirSync16(dirname32(cachePath), { recursive: true });
|
|
31222
|
+
writeFileSync11(cachePath, uuid, "utf-8");
|
|
30999
31223
|
return setGlobalUuid(uuid);
|
|
31000
31224
|
}, devtoolsJson = (buildDir, options = {}) => {
|
|
31001
|
-
const rootPath =
|
|
31225
|
+
const rootPath = resolve49(options.projectRoot ?? process.cwd());
|
|
31002
31226
|
const root = options.normalizeForWindowsContainer === false ? rootPath : normalizeDevtoolsWorkspaceRoot(rootPath);
|
|
31003
31227
|
const uuid = getOrCreateUuid(buildDir, options);
|
|
31004
31228
|
return new Elysia7({ name: "absolute-devtools-json" }).get(ENDPOINT, () => ({
|
|
@@ -31011,11 +31235,11 @@ var ENDPOINT = "/.well-known/appspecific/com.chrome.devtools.json", UUID_CACHE_K
|
|
|
31011
31235
|
if (process.env.WSL_DISTRO_NAME) {
|
|
31012
31236
|
const distro = process.env.WSL_DISTRO_NAME;
|
|
31013
31237
|
const withoutLeadingSlash = root.replace(/^\//, "");
|
|
31014
|
-
return
|
|
31238
|
+
return join52("\\\\wsl.localhost", distro, withoutLeadingSlash).replace(/\//g, "\\");
|
|
31015
31239
|
}
|
|
31016
31240
|
if (process.env.DOCKER_DESKTOP && !root.startsWith("\\\\")) {
|
|
31017
31241
|
const withoutLeadingSlash = root.replace(/^\//, "");
|
|
31018
|
-
return
|
|
31242
|
+
return join52("\\\\wsl.localhost", "docker-desktop-data", withoutLeadingSlash).replace(/\//g, "\\");
|
|
31019
31243
|
}
|
|
31020
31244
|
return root;
|
|
31021
31245
|
};
|
|
@@ -31026,13 +31250,13 @@ var exports_imageOptimizer = {};
|
|
|
31026
31250
|
__export(exports_imageOptimizer, {
|
|
31027
31251
|
imageOptimizer: () => imageOptimizer
|
|
31028
31252
|
});
|
|
31029
|
-
import { existsSync as
|
|
31030
|
-
import { resolve as
|
|
31253
|
+
import { existsSync as existsSync40 } from "fs";
|
|
31254
|
+
import { resolve as resolve50 } from "path";
|
|
31031
31255
|
import { Elysia as Elysia8 } from "elysia";
|
|
31032
31256
|
var DEFAULT_CACHE_TTL_SECONDS = 60, MS_PER_SECOND = 1000, MAX_QUALITY = 100, avifInProgress, safeResolve = (path, baseDir) => {
|
|
31033
31257
|
try {
|
|
31034
31258
|
const resolved = validateSafePath(path, baseDir);
|
|
31035
|
-
if (
|
|
31259
|
+
if (existsSync40(resolved))
|
|
31036
31260
|
return resolved;
|
|
31037
31261
|
return null;
|
|
31038
31262
|
} catch {
|
|
@@ -31040,7 +31264,7 @@ var DEFAULT_CACHE_TTL_SECONDS = 60, MS_PER_SECOND = 1000, MAX_QUALITY = 100, avi
|
|
|
31040
31264
|
}
|
|
31041
31265
|
}, resolveLocalImage = (url, buildDir) => {
|
|
31042
31266
|
const cleanPath = url.startsWith("/") ? url.slice(1) : url;
|
|
31043
|
-
return safeResolve(cleanPath, buildDir) ?? safeResolve(cleanPath,
|
|
31267
|
+
return safeResolve(cleanPath, buildDir) ?? safeResolve(cleanPath, resolve50(process.cwd()));
|
|
31044
31268
|
}, parseQueryParams = (query, allowedSizes, defaultQuality) => {
|
|
31045
31269
|
const url = typeof query["url"] === "string" ? query["url"] : undefined;
|
|
31046
31270
|
const wParam = typeof query["w"] === "string" ? query["w"] : undefined;
|
|
@@ -31309,11 +31533,11 @@ var init_requestInspector = __esm(() => {
|
|
|
31309
31533
|
});
|
|
31310
31534
|
|
|
31311
31535
|
// src/mobile/nativeAuth.ts
|
|
31312
|
-
import { readFileSync as
|
|
31313
|
-
import { join as
|
|
31536
|
+
import { readFileSync as readFileSync36 } from "fs";
|
|
31537
|
+
import { join as join53 } from "path";
|
|
31314
31538
|
var ABSOLUTE_AUTH_PACKAGE = "@absolutejs/auth", ABSOLUTE_EXPO_AUTH_CORE_VERSION = "0.75.6", ABSOLUTE_EXPO_AUTH_PACKAGE = "@absolutejs/auth-expo", ABSOLUTE_EXPO_AUTH_VERSION = "0.0.2", ABSOLUTE_EXPO_SYNC_CORE_VERSION = "2.31.0", ABSOLUTE_EXPO_SYNC_PACKAGE = "@absolutejs/sync-expo", ABSOLUTE_EXPO_SYNC_VERSION = "0.0.2", ABSOLUTE_NATIVE_AUTH_CLIENTS_ENV = "ABSOLUTE_AUTH_NATIVE_CLIENTS", ABSOLUTE_NATIVE_AUTH_SCOPES, ABSOLUTE_SYNC_PACKAGE = "@absolutejs/sync", readPackageManifest = (projectRoot) => {
|
|
31315
31539
|
try {
|
|
31316
|
-
return JSON.parse(
|
|
31540
|
+
return JSON.parse(readFileSync36(join53(projectRoot, "package.json"), "utf8"));
|
|
31317
31541
|
} catch {
|
|
31318
31542
|
return;
|
|
31319
31543
|
}
|
|
@@ -31359,7 +31583,7 @@ __export(exports_devDeviceAdapter, {
|
|
|
31359
31583
|
buildAbsoluteNativeDevAdapter: () => buildAbsoluteNativeDevAdapter
|
|
31360
31584
|
});
|
|
31361
31585
|
import { access as access3, mkdtemp as mkdtemp3, rm as rm15, writeFile as writeFile9 } from "fs/promises";
|
|
31362
|
-
import { join as
|
|
31586
|
+
import { join as join54 } from "path";
|
|
31363
31587
|
import { tmpdir } from "os";
|
|
31364
31588
|
var absoluteNativeDevAdapterSource = (projectRoot, mobile, resolveModule = (specifier) => specifier, expoAdapterModule = "@absolutejs/absolute/mobile/expo-devices", expoAuthModule = "@absolutejs/absolute/mobile/expo-auth", expoSyncModule = "@absolutejs/absolute/mobile/expo-sync") => {
|
|
31365
31589
|
if ((mobile.engine ?? "capacitor") === "expo") {
|
|
@@ -31397,7 +31621,7 @@ ${auth ? `void createAbsoluteExpoShellAuth(${JSON.stringify(auth)}).then(auth =>
|
|
|
31397
31621
|
`);
|
|
31398
31622
|
}, expoAdapterPath = async () => {
|
|
31399
31623
|
const candidates = await Promise.all(["ts", "js"].map(async (extension) => {
|
|
31400
|
-
const path2 =
|
|
31624
|
+
const path2 = join54(import.meta.dir, `shellExpoDevices.${extension}`);
|
|
31401
31625
|
try {
|
|
31402
31626
|
await access3(path2);
|
|
31403
31627
|
return path2;
|
|
@@ -31411,7 +31635,7 @@ ${auth ? `void createAbsoluteExpoShellAuth(${JSON.stringify(auth)}).then(auth =>
|
|
|
31411
31635
|
throw new TypeError("The AbsoluteJS Expo development adapter is missing.");
|
|
31412
31636
|
}, expoAuthPath = async () => {
|
|
31413
31637
|
const candidates = await Promise.all(["ts", "js"].map(async (extension) => {
|
|
31414
|
-
const path2 =
|
|
31638
|
+
const path2 = join54(import.meta.dir, `shellExpoAuth.${extension}`);
|
|
31415
31639
|
try {
|
|
31416
31640
|
await access3(path2);
|
|
31417
31641
|
return path2;
|
|
@@ -31425,7 +31649,7 @@ ${auth ? `void createAbsoluteExpoShellAuth(${JSON.stringify(auth)}).then(auth =>
|
|
|
31425
31649
|
throw new TypeError("The AbsoluteJS Expo Auth development adapter is missing.");
|
|
31426
31650
|
}, expoSyncPath = async () => {
|
|
31427
31651
|
const candidates = await Promise.all(["ts", "js"].map(async (extension) => {
|
|
31428
|
-
const path2 =
|
|
31652
|
+
const path2 = join54(import.meta.dir, `shellExpoSync.${extension}`);
|
|
31429
31653
|
try {
|
|
31430
31654
|
await access3(path2);
|
|
31431
31655
|
return path2;
|
|
@@ -31438,8 +31662,8 @@ ${auth ? `void createAbsoluteExpoShellAuth(${JSON.stringify(auth)}).then(auth =>
|
|
|
31438
31662
|
return path;
|
|
31439
31663
|
throw new TypeError("The AbsoluteJS Expo Sync development adapter is missing.");
|
|
31440
31664
|
}, buildAbsoluteNativeDevAdapter = async (projectRoot, mobile) => {
|
|
31441
|
-
const temporaryDirectory = await mkdtemp3(
|
|
31442
|
-
const entry =
|
|
31665
|
+
const temporaryDirectory = await mkdtemp3(join54(tmpdir(), "absolutejs-native-dev-adapter-"));
|
|
31666
|
+
const entry = join54(temporaryDirectory, "entry.ts");
|
|
31443
31667
|
try {
|
|
31444
31668
|
await writeFile9(entry, absoluteNativeDevAdapterSource(projectRoot, mobile, (specifier) => Bun.resolveSync(specifier, projectRoot), await expoAdapterPath(), await expoAuthPath(), await expoSyncPath()));
|
|
31445
31669
|
const result = await Bun.build({
|
|
@@ -31473,15 +31697,15 @@ __export(exports_prerender, {
|
|
|
31473
31697
|
rerenderRoute: () => rerenderRoute,
|
|
31474
31698
|
routeToFilename: () => routeToFilename
|
|
31475
31699
|
});
|
|
31476
|
-
import { mkdirSync as
|
|
31477
|
-
import { join as
|
|
31700
|
+
import { mkdirSync as mkdirSync17, readFileSync as readFileSync37 } from "fs";
|
|
31701
|
+
import { join as join55 } from "path";
|
|
31478
31702
|
var SERVER_OUTPUT_LIMIT = 4000, STARTUP_POLL_INTERVAL_MS = 100, DEFAULT_STARTUP_TIMEOUT_MS = 30000, DEFAULT_FETCH_TIMEOUT_MS = 1e4, PRERENDER_BYPASS_HEADER = "X-Absolute-Prerender-Bypass", routeToFilename = (route) => route === "/" ? "index.html" : `${route.slice(1).replace(/\//g, "-")}.html`, writeTimestamp = async (htmlPath) => {
|
|
31479
31703
|
const metaPath = htmlPath.replace(/\.html$/, ".meta");
|
|
31480
31704
|
await Bun.write(metaPath, String(Date.now()));
|
|
31481
31705
|
}, readTimestamp = (htmlPath) => {
|
|
31482
31706
|
const metaPath = htmlPath.replace(/\.html$/, ".meta");
|
|
31483
31707
|
try {
|
|
31484
|
-
const content =
|
|
31708
|
+
const content = readFileSync37(metaPath, "utf-8");
|
|
31485
31709
|
return Number(content) || 0;
|
|
31486
31710
|
} catch {
|
|
31487
31711
|
return 0;
|
|
@@ -31544,7 +31768,7 @@ var SERVER_OUTPUT_LIMIT = 4000, STARTUP_POLL_INTERVAL_MS = 100, DEFAULT_STARTUP_
|
|
|
31544
31768
|
if (!isCompleteHtml(html))
|
|
31545
31769
|
return false;
|
|
31546
31770
|
const fileName = routeToFilename(route);
|
|
31547
|
-
const filePath =
|
|
31771
|
+
const filePath = join55(prerenderDir, fileName);
|
|
31548
31772
|
await Bun.write(filePath, html);
|
|
31549
31773
|
await writeTimestamp(filePath);
|
|
31550
31774
|
return true;
|
|
@@ -31574,14 +31798,14 @@ var SERVER_OUTPUT_LIMIT = 4000, STARTUP_POLL_INTERVAL_MS = 100, DEFAULT_STARTUP_
|
|
|
31574
31798
|
return;
|
|
31575
31799
|
}
|
|
31576
31800
|
const fileName = routeToFilename(route);
|
|
31577
|
-
const filePath =
|
|
31801
|
+
const filePath = join55(prerenderDir, fileName);
|
|
31578
31802
|
await Bun.write(filePath, html);
|
|
31579
31803
|
await writeTimestamp(filePath);
|
|
31580
31804
|
result.routes.set(route, filePath);
|
|
31581
31805
|
log2?.(` Pre-rendered ${route} \u2192 ${fileName} (${html.length} bytes)`);
|
|
31582
31806
|
}, prerender = async (port, outDir, staticConfig, log2) => {
|
|
31583
|
-
const prerenderDir =
|
|
31584
|
-
|
|
31807
|
+
const prerenderDir = join55(outDir, "_prerendered");
|
|
31808
|
+
mkdirSync17(prerenderDir, { recursive: true });
|
|
31585
31809
|
const baseUrl = `http://localhost:${port}`;
|
|
31586
31810
|
let routes;
|
|
31587
31811
|
if (staticConfig.routes === "all") {
|
|
@@ -31699,17 +31923,17 @@ __export(exports_serverEntryWatcher, {
|
|
|
31699
31923
|
});
|
|
31700
31924
|
import {
|
|
31701
31925
|
copyFileSync as copyFileSync4,
|
|
31702
|
-
existsSync as
|
|
31926
|
+
existsSync as existsSync43,
|
|
31703
31927
|
readdirSync as readdirSync12,
|
|
31704
|
-
readFileSync as
|
|
31928
|
+
readFileSync as readFileSync41,
|
|
31705
31929
|
statSync as statSync8,
|
|
31706
31930
|
watch as watch2
|
|
31707
31931
|
} from "fs";
|
|
31708
|
-
import { createHash as
|
|
31709
|
-
import { dirname as dirname33, join as
|
|
31932
|
+
import { createHash as createHash11 } from "crypto";
|
|
31933
|
+
import { dirname as dirname33, join as join59, resolve as resolve51 } from "path";
|
|
31710
31934
|
var ATOMIC_RECOVERY_WINDOW_MS = 1000, RELOAD_DEBOUNCE_MS = 80, ENTRY_IMPORT_RETRY_DELAY_MS = 250, MAX_ENTRY_IMPORT_ATTEMPTS = 3, WATCH_FALLBACK_INTERVAL_MS = 250, ATOMIC_WRITE_TEMP_PATTERNS2, isAtomicWriteTemp = (filename) => filename.endsWith(".tmp") || filename.includes(".tmp.") || filename.endsWith("~") || filename.startsWith(".#") || filename.startsWith(".absolutejs-hmr-") || ATOMIC_WRITE_TEMP_PATTERNS2.some((pattern) => pattern.test(filename)), fileHash = (path) => {
|
|
31711
31935
|
try {
|
|
31712
|
-
return
|
|
31936
|
+
return createHash11("sha256").update(readFileSync41(path)).digest("hex");
|
|
31713
31937
|
} catch {
|
|
31714
31938
|
return null;
|
|
31715
31939
|
}
|
|
@@ -31730,14 +31954,14 @@ var ATOMIC_RECOVERY_WINDOW_MS = 1000, RELOAD_DEBOUNCE_MS = 80, ENTRY_IMPORT_RETR
|
|
|
31730
31954
|
if (globalThis.__absoluteEntryWatcherStarted)
|
|
31731
31955
|
return;
|
|
31732
31956
|
const originalEntry = process.env.ABSOLUTE_SERVER_ENTRY ?? Bun.main;
|
|
31733
|
-
if (!originalEntry || !
|
|
31957
|
+
if (!originalEntry || !existsSync43(originalEntry))
|
|
31734
31958
|
return;
|
|
31735
31959
|
globalThis.__absoluteEntryWatcherStarted = true;
|
|
31736
31960
|
globalThis.__absoluteEntryWatcherReady = false;
|
|
31737
|
-
const entryPath =
|
|
31961
|
+
const entryPath = resolve51(originalEntry);
|
|
31738
31962
|
const entryDir = dirname33(entryPath);
|
|
31739
31963
|
const entryBase = entryPath.slice(entryDir.length + 1);
|
|
31740
|
-
const configPath2 =
|
|
31964
|
+
const configPath2 = resolve51(process.env.ABSOLUTE_CONFIG ?? "absolute.config.ts");
|
|
31741
31965
|
const configDir2 = dirname33(configPath2);
|
|
31742
31966
|
const configBase = configPath2.slice(configDir2.length + 1);
|
|
31743
31967
|
const recentlyHandled = new Map;
|
|
@@ -31748,7 +31972,7 @@ var ATOMIC_RECOVERY_WINDOW_MS = 1000, RELOAD_DEBOUNCE_MS = 80, ENTRY_IMPORT_RETR
|
|
|
31748
31972
|
let pendingEntryCause = null;
|
|
31749
31973
|
let siblingSequence = 0;
|
|
31750
31974
|
const importFreshEntry = async (attempt = 1) => {
|
|
31751
|
-
const siblingPath =
|
|
31975
|
+
const siblingPath = join59(entryDir, `.absolutejs-hmr-${process.pid}-${siblingSequence++}.ts`);
|
|
31752
31976
|
let failure;
|
|
31753
31977
|
try {
|
|
31754
31978
|
copyFileSync4(entryPath, siblingPath);
|
|
@@ -31861,7 +32085,7 @@ var ATOMIC_RECOVERY_WINDOW_MS = 1000, RELOAD_DEBOUNCE_MS = 80, ENTRY_IMPORT_RETR
|
|
|
31861
32085
|
continue;
|
|
31862
32086
|
let st2;
|
|
31863
32087
|
try {
|
|
31864
|
-
st2 = statSync8(
|
|
32088
|
+
st2 = statSync8(join59(dir, entry.name));
|
|
31865
32089
|
} catch {
|
|
31866
32090
|
continue;
|
|
31867
32091
|
}
|
|
@@ -32763,9 +32987,9 @@ var handleHTMXPageRequest = async (pagePath, options = {}) => {
|
|
|
32763
32987
|
});
|
|
32764
32988
|
};
|
|
32765
32989
|
// src/core/prepare.ts
|
|
32766
|
-
import { createHash as
|
|
32767
|
-
import { existsSync as
|
|
32768
|
-
import { basename as basename18, join as
|
|
32990
|
+
import { createHash as createHash10 } from "crypto";
|
|
32991
|
+
import { existsSync as existsSync41, readdirSync as readdirSync10, readFileSync as readFileSync38 } from "fs";
|
|
32992
|
+
import { basename as basename18, join as join56, relative as relative20, resolve as resolvePath4 } from "path";
|
|
32769
32993
|
import { Elysia as Elysia10, NotFound } from "elysia";
|
|
32770
32994
|
|
|
32771
32995
|
// src/plugins/openApiPlugin.ts
|
|
@@ -34025,12 +34249,13 @@ init_resolveConvention();
|
|
|
34025
34249
|
init_spaRouteManifest();
|
|
34026
34250
|
init_startupTimings();
|
|
34027
34251
|
init_logger();
|
|
34252
|
+
init_bootLifecycle();
|
|
34028
34253
|
var MS_PER_SECOND2 = 1000;
|
|
34029
34254
|
var DEFAULT_PORT2 = 3000;
|
|
34030
34255
|
var MAX_STATIC_ROUTE_COUNT = Number.MAX_SAFE_INTEGER;
|
|
34031
34256
|
var STATIC_PLUGIN_RETRY_DELAY_MS = 50;
|
|
34032
|
-
var waitForStaticPluginRetry = () => new Promise((
|
|
34033
|
-
setTimeout(
|
|
34257
|
+
var waitForStaticPluginRetry = () => new Promise((resolve51) => {
|
|
34258
|
+
setTimeout(resolve51, STATIC_PLUGIN_RETRY_DELAY_MS);
|
|
34034
34259
|
});
|
|
34035
34260
|
var retryStaticPlugin = async (createStaticPlugin, options) => {
|
|
34036
34261
|
try {
|
|
@@ -34110,7 +34335,7 @@ var patchManifestIndexes = (manifest, devIndexDir, SRC_URL_PREFIX2) => {
|
|
|
34110
34335
|
if (!fileName)
|
|
34111
34336
|
continue;
|
|
34112
34337
|
const srcPath = resolvePath4(devIndexDir, fileName);
|
|
34113
|
-
if (!
|
|
34338
|
+
if (!existsSync41(srcPath))
|
|
34114
34339
|
continue;
|
|
34115
34340
|
const rel = relative20(process.cwd(), srcPath).replace(/\\/g, "/");
|
|
34116
34341
|
manifest[key] = `${SRC_URL_PREFIX2}${rel}`;
|
|
@@ -34126,10 +34351,10 @@ var registerIconVersioning = (buildDir) => {
|
|
|
34126
34351
|
if (cached !== undefined)
|
|
34127
34352
|
return cached;
|
|
34128
34353
|
const path = href.split("?")[0] ?? href;
|
|
34129
|
-
const filePath =
|
|
34354
|
+
const filePath = join56(buildDir, path);
|
|
34130
34355
|
let versioned = href;
|
|
34131
|
-
if (
|
|
34132
|
-
const hash =
|
|
34356
|
+
if (existsSync41(filePath)) {
|
|
34357
|
+
const hash = createHash10("sha256").update(readFileSync38(filePath)).digest("hex").slice(0, ICON_HASH_LENGTH);
|
|
34133
34358
|
versioned = href.includes("?") ? `${href}&v=${hash}` : `${href}?v=${hash}`;
|
|
34134
34359
|
}
|
|
34135
34360
|
cache2.set(href, versioned);
|
|
@@ -34146,14 +34371,17 @@ var prepareDev = async (config, buildDir) => {
|
|
|
34146
34371
|
});
|
|
34147
34372
|
};
|
|
34148
34373
|
let stepStartedAt = performance.now();
|
|
34374
|
+
setBootPhase("patch route registration");
|
|
34149
34375
|
const { patchElysiaRouteRegistrationCallsites: patchElysiaRouteRegistrationCallsites2 } = await Promise.resolve().then(() => (init_devRouteRegistrationCallsite(), exports_devRouteRegistrationCallsite));
|
|
34150
34376
|
patchElysiaRouteRegistrationCallsites2();
|
|
34151
34377
|
recordStep("patch route registration", stepStartedAt);
|
|
34152
34378
|
stepStartedAt = performance.now();
|
|
34379
|
+
setBootPhase("build");
|
|
34153
34380
|
const { devBuild: devBuild2 } = await Promise.resolve().then(() => (init_devBuild(), exports_devBuild));
|
|
34154
34381
|
const result = await devBuild2(config);
|
|
34155
34382
|
recordStep("devBuild", stepStartedAt);
|
|
34156
34383
|
stepStartedAt = performance.now();
|
|
34384
|
+
setBootPhase("load dev runtime");
|
|
34157
34385
|
const { hmr: hmr2 } = await Promise.resolve().then(() => (init_hmr(), exports_hmr));
|
|
34158
34386
|
const { staticPlugin } = await import("@elysia/static");
|
|
34159
34387
|
const { createModuleServer: createModuleServer2 } = await Promise.resolve().then(() => (init_moduleServer(), exports_moduleServer));
|
|
@@ -34191,8 +34419,17 @@ var prepareDev = async (config, buildDir) => {
|
|
|
34191
34419
|
const { warmCache: warmCache2, SRC_URL_PREFIX: SRC_URL_PREFIX2 } = await Promise.resolve().then(() => (init_moduleServer(), exports_moduleServer));
|
|
34192
34420
|
const prewarmDirs = buildPrewarmDirs(config);
|
|
34193
34421
|
stepStartedAt = performance.now();
|
|
34194
|
-
|
|
34195
|
-
|
|
34422
|
+
deferUntilServing(async () => {
|
|
34423
|
+
const prewarmStartedAt = performance.now();
|
|
34424
|
+
await warmPrewarmDirs(prewarmDirs, warmCache2, SRC_URL_PREFIX2);
|
|
34425
|
+
logStartupTimingBlock("AbsoluteJS deferred boot timing", [
|
|
34426
|
+
{
|
|
34427
|
+
durationMs: performance.now() - prewarmStartedAt,
|
|
34428
|
+
label: "prewarm source modules (after listen)"
|
|
34429
|
+
}
|
|
34430
|
+
]);
|
|
34431
|
+
});
|
|
34432
|
+
recordStep("schedule source module prewarm", stepStartedAt);
|
|
34196
34433
|
if (config.dev?.https) {
|
|
34197
34434
|
globalThis.__http2Config = {
|
|
34198
34435
|
hmrState: result.hmrState,
|
|
@@ -34200,12 +34437,14 @@ var prepareDev = async (config, buildDir) => {
|
|
|
34200
34437
|
};
|
|
34201
34438
|
}
|
|
34202
34439
|
stepStartedAt = performance.now();
|
|
34440
|
+
setBootPhase("configure dev plugins");
|
|
34203
34441
|
const hmrPlugin = hmr2(result.hmrState, result.manifest, moduleHandler);
|
|
34204
34442
|
const { devtoolsJson: devtoolsJson2 } = await Promise.resolve().then(() => (init_devtoolsJson(), exports_devtoolsJson));
|
|
34205
34443
|
const devIndexDir = resolvePath4(buildDir, "_src_indexes");
|
|
34206
34444
|
patchManifestIndexes(result.manifest, devIndexDir, SRC_URL_PREFIX2);
|
|
34207
34445
|
recordStep("configure dev plugins", stepStartedAt);
|
|
34208
34446
|
stepStartedAt = performance.now();
|
|
34447
|
+
setBootPhase("load runtime metadata");
|
|
34209
34448
|
if (result.conventions)
|
|
34210
34449
|
setConventions(result.conventions);
|
|
34211
34450
|
setCurrentIslandManifest(result.manifest);
|
|
@@ -34215,6 +34454,7 @@ var prepareDev = async (config, buildDir) => {
|
|
|
34215
34454
|
setCurrentPageIslandMetadata(await loadPageIslandMetadata(config));
|
|
34216
34455
|
recordStep("load runtime metadata", stepStartedAt);
|
|
34217
34456
|
stepStartedAt = performance.now();
|
|
34457
|
+
setBootPhase("assemble dev runtime");
|
|
34218
34458
|
const { imageOptimizer: imageOptimizer2 } = await Promise.resolve().then(() => (init_imageOptimizer(), exports_imageOptimizer));
|
|
34219
34459
|
const { requestInspector: requestInspector2 } = await Promise.resolve().then(() => (init_requestInspector(), exports_requestInspector));
|
|
34220
34460
|
const { serverTiming } = await import("@elysia/server-timing");
|
|
@@ -34244,6 +34484,7 @@ var prepareDev = async (config, buildDir) => {
|
|
|
34244
34484
|
await withOpenApi(absolutejs, config, process.cwd(), true);
|
|
34245
34485
|
await withTelemetry(absolutejs, config, process.cwd());
|
|
34246
34486
|
recordStep("assemble dev runtime", stepStartedAt);
|
|
34487
|
+
setBootPhase("starting server");
|
|
34247
34488
|
logStartupTimingBlock("AbsoluteJS prepareDev timing", startupSteps);
|
|
34248
34489
|
return {
|
|
34249
34490
|
absolutejs,
|
|
@@ -34252,7 +34493,7 @@ var prepareDev = async (config, buildDir) => {
|
|
|
34252
34493
|
};
|
|
34253
34494
|
var loadPrerenderMap = (prerenderDir) => {
|
|
34254
34495
|
const map = new Map;
|
|
34255
|
-
if (!
|
|
34496
|
+
if (!existsSync41(prerenderDir))
|
|
34256
34497
|
return map;
|
|
34257
34498
|
let entries;
|
|
34258
34499
|
try {
|
|
@@ -34265,13 +34506,13 @@ var loadPrerenderMap = (prerenderDir) => {
|
|
|
34265
34506
|
continue;
|
|
34266
34507
|
const name = basename18(entry, ".html");
|
|
34267
34508
|
const route = name === "index" ? "/" : `/${name}`;
|
|
34268
|
-
map.set(route,
|
|
34509
|
+
map.set(route, join56(prerenderDir, entry));
|
|
34269
34510
|
}
|
|
34270
34511
|
return map;
|
|
34271
34512
|
};
|
|
34272
34513
|
var loadMobileCompatibilityPlugin = async (buildDir) => {
|
|
34273
|
-
const root =
|
|
34274
|
-
if (!
|
|
34514
|
+
const root = join56(buildDir, ".absolutejs", "mobile-compatibility");
|
|
34515
|
+
if (!existsSync41(join56(root, "current.json"))) {
|
|
34275
34516
|
return new Elysia10({ name: "absolutejs-mobile-compatibility-empty" });
|
|
34276
34517
|
}
|
|
34277
34518
|
const options = await loadAbsoluteMobileMaterializedBundle(root);
|
|
@@ -34324,7 +34565,7 @@ var prepare = async (configOrPath) => {
|
|
|
34324
34565
|
return result;
|
|
34325
34566
|
}
|
|
34326
34567
|
stepStartedAt = performance.now();
|
|
34327
|
-
const manifest = JSON.parse(
|
|
34568
|
+
const manifest = JSON.parse(readFileSync38(`${buildDir}/manifest.json`, "utf-8"));
|
|
34328
34569
|
setCurrentIslandManifest(manifest);
|
|
34329
34570
|
if (config.islands?.registry) {
|
|
34330
34571
|
setCurrentIslandRegistry(await loadIslandRegistry(config.islands.registry));
|
|
@@ -34332,14 +34573,14 @@ var prepare = async (configOrPath) => {
|
|
|
34332
34573
|
setCurrentPageIslandMetadata(await loadPageIslandMetadata(config));
|
|
34333
34574
|
recordStep("load production manifest and island metadata", stepStartedAt);
|
|
34334
34575
|
stepStartedAt = performance.now();
|
|
34335
|
-
const conventionsPath =
|
|
34336
|
-
if (
|
|
34337
|
-
const conventions2 = JSON.parse(
|
|
34576
|
+
const conventionsPath = join56(buildDir, "conventions.json");
|
|
34577
|
+
if (existsSync41(conventionsPath)) {
|
|
34578
|
+
const conventions2 = JSON.parse(readFileSync38(conventionsPath, "utf-8"));
|
|
34338
34579
|
setConventions(conventions2);
|
|
34339
34580
|
}
|
|
34340
|
-
const spaRoutesPath =
|
|
34341
|
-
if (
|
|
34342
|
-
setSpaRouteManifest(JSON.parse(
|
|
34581
|
+
const spaRoutesPath = join56(buildDir, "spa-routes.json");
|
|
34582
|
+
if (existsSync41(spaRoutesPath)) {
|
|
34583
|
+
setSpaRouteManifest(JSON.parse(readFileSync38(spaRoutesPath, "utf-8")));
|
|
34343
34584
|
}
|
|
34344
34585
|
recordStep("load production conventions", stepStartedAt);
|
|
34345
34586
|
stepStartedAt = performance.now();
|
|
@@ -34350,7 +34591,7 @@ var prepare = async (configOrPath) => {
|
|
|
34350
34591
|
prefix: "",
|
|
34351
34592
|
staticLimit: MAX_STATIC_ROUTE_COUNT
|
|
34352
34593
|
});
|
|
34353
|
-
const generatedAssetsRoot =
|
|
34594
|
+
const generatedAssetsRoot = join56(buildDir, ".absolutejs");
|
|
34354
34595
|
const generatedAssetsPlugin = new Elysia10({
|
|
34355
34596
|
name: "absolutejs-generated-assets"
|
|
34356
34597
|
}).get("/.absolutejs/*", async ({ params, set }) => {
|
|
@@ -34388,7 +34629,7 @@ var prepare = async (configOrPath) => {
|
|
|
34388
34629
|
responseValue.headers.set("cache-control", isFingerprintedAsset(pathname) ? "public, max-age=31536000, immutable" : "public, max-age=0, must-revalidate");
|
|
34389
34630
|
});
|
|
34390
34631
|
stepStartedAt = performance.now();
|
|
34391
|
-
const prerenderDir =
|
|
34632
|
+
const prerenderDir = join56(buildDir, "_prerendered");
|
|
34392
34633
|
const prerenderMap = loadPrerenderMap(prerenderDir);
|
|
34393
34634
|
const mobileCompatibilityPlugin = await loadMobileCompatibilityPlugin(buildDir);
|
|
34394
34635
|
const mobileAssociationPlugin = createAbsoluteMobileAssociationPlugin(config.mobile, process.cwd(), { requireAll: true });
|
|
@@ -34448,6 +34689,7 @@ var wrapPageHandlerWithStreamingSlots = (handler, options) => {
|
|
|
34448
34689
|
};
|
|
34449
34690
|
// src/plugins/networking.ts
|
|
34450
34691
|
init_constants();
|
|
34692
|
+
init_bootLifecycle();
|
|
34451
34693
|
import { argv } from "process";
|
|
34452
34694
|
var {env: env4 } = globalThis.Bun;
|
|
34453
34695
|
import { websocket as websocket3 } from "elysia/websocket";
|
|
@@ -34456,23 +34698,23 @@ import { buildGlobalWSHandler } from "elysia/ws";
|
|
|
34456
34698
|
// src/dev/devCert.ts
|
|
34457
34699
|
import {
|
|
34458
34700
|
copyFileSync as copyFileSync3,
|
|
34459
|
-
existsSync as
|
|
34460
|
-
mkdirSync as
|
|
34461
|
-
readFileSync as
|
|
34701
|
+
existsSync as existsSync42,
|
|
34702
|
+
mkdirSync as mkdirSync18,
|
|
34703
|
+
readFileSync as readFileSync39,
|
|
34462
34704
|
rmSync as rmSync4
|
|
34463
34705
|
} from "fs";
|
|
34464
34706
|
import { X509Certificate as X509Certificate2 } from "crypto";
|
|
34465
34707
|
import { isIP } from "net";
|
|
34466
|
-
import { join as
|
|
34467
|
-
var CERT_DIR =
|
|
34468
|
-
var CERT_PATH =
|
|
34469
|
-
var KEY_PATH =
|
|
34708
|
+
import { join as join57 } from "path";
|
|
34709
|
+
var CERT_DIR = join57(process.cwd(), ".absolutejs");
|
|
34710
|
+
var CERT_PATH = join57(CERT_DIR, "cert.pem");
|
|
34711
|
+
var KEY_PATH = join57(CERT_DIR, "key.pem");
|
|
34470
34712
|
var CERT_VALIDITY_DAYS = 365;
|
|
34471
34713
|
var DEFAULT_CERTIFICATE_HOSTS = ["localhost", "127.0.0.1", "::1"];
|
|
34472
34714
|
var CERTIFICATE_HOSTNAME_PATTERN = /^(?=.{1,253}$)(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)(?:\.(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?))*$/u;
|
|
34473
34715
|
var devLog = (msg) => console.log(`\x1B[2m${new Date().toLocaleTimeString()}\x1B[0m \x1B[36m[dev]\x1B[0m ${msg}`);
|
|
34474
34716
|
var devWarn = (msg) => console.log(`\x1B[2m${new Date().toLocaleTimeString()}\x1B[0m \x1B[33m[dev]\x1B[0m \x1B[33m${msg}\x1B[0m`);
|
|
34475
|
-
var certFilesExist = () =>
|
|
34717
|
+
var certFilesExist = () => existsSync42(CERT_PATH) && existsSync42(KEY_PATH);
|
|
34476
34718
|
var normalizeDevCertificateHosts = (hosts = []) => {
|
|
34477
34719
|
const normalized = new Set(DEFAULT_CERTIFICATE_HOSTS);
|
|
34478
34720
|
for (const host2 of hosts) {
|
|
@@ -34488,7 +34730,7 @@ var normalizeDevCertificateHosts = (hosts = []) => {
|
|
|
34488
34730
|
};
|
|
34489
34731
|
var certificateIsUsable = (hosts) => {
|
|
34490
34732
|
try {
|
|
34491
|
-
const certPem =
|
|
34733
|
+
const certPem = readFileSync39(CERT_PATH, "utf-8");
|
|
34492
34734
|
const certificate = new X509Certificate2(certPem);
|
|
34493
34735
|
if (new Date(certificate.validTo).getTime() <= Date.now())
|
|
34494
34736
|
return false;
|
|
@@ -34558,7 +34800,7 @@ var generateCert = (hosts = []) => {
|
|
|
34558
34800
|
}
|
|
34559
34801
|
};
|
|
34560
34802
|
var ensureDevCert = (hosts = []) => {
|
|
34561
|
-
|
|
34803
|
+
mkdirSync18(CERT_DIR, { recursive: true });
|
|
34562
34804
|
if (hasCert(hosts)) {
|
|
34563
34805
|
return { cert: CERT_PATH, key: KEY_PATH };
|
|
34564
34806
|
}
|
|
@@ -34580,29 +34822,44 @@ var loadDevCert = (hosts = []) => {
|
|
|
34580
34822
|
return null;
|
|
34581
34823
|
try {
|
|
34582
34824
|
return {
|
|
34583
|
-
cert:
|
|
34584
|
-
key:
|
|
34825
|
+
cert: readFileSync39(paths.cert, "utf-8"),
|
|
34826
|
+
key: readFileSync39(paths.key, "utf-8")
|
|
34585
34827
|
};
|
|
34586
34828
|
} catch {
|
|
34587
34829
|
return null;
|
|
34588
34830
|
}
|
|
34589
34831
|
};
|
|
34590
34832
|
|
|
34833
|
+
// src/dev/earlyListener.ts
|
|
34834
|
+
init_constants();
|
|
34835
|
+
init_bootLifecycle();
|
|
34836
|
+
var RETRY_AFTER_SECONDS = 2;
|
|
34837
|
+
var POLL_INTERVAL_MS = RETRY_AFTER_SECONDS * MILLISECONDS_IN_A_SECOND;
|
|
34838
|
+
var releaseEarlyListener = () => {
|
|
34839
|
+
const listener = globalThis.__absoluteEarlyListener;
|
|
34840
|
+
if (!listener)
|
|
34841
|
+
return false;
|
|
34842
|
+
const hadServer = listener.server !== null;
|
|
34843
|
+
listener.release();
|
|
34844
|
+
globalThis.__absoluteEarlyListener = undefined;
|
|
34845
|
+
return hadServer;
|
|
34846
|
+
};
|
|
34847
|
+
|
|
34591
34848
|
// src/utils/instanceRegistry.ts
|
|
34592
34849
|
import {
|
|
34593
|
-
mkdirSync as
|
|
34594
|
-
readFileSync as
|
|
34850
|
+
mkdirSync as mkdirSync19,
|
|
34851
|
+
readFileSync as readFileSync40,
|
|
34595
34852
|
readdirSync as readdirSync11,
|
|
34596
34853
|
unlinkSync as unlinkSync2,
|
|
34597
|
-
writeFileSync as
|
|
34854
|
+
writeFileSync as writeFileSync12
|
|
34598
34855
|
} from "fs";
|
|
34599
34856
|
import { homedir as homedir2 } from "os";
|
|
34600
|
-
import { basename as basename19, join as
|
|
34857
|
+
import { basename as basename19, join as join58 } from "path";
|
|
34601
34858
|
var registeredPids = new Set;
|
|
34602
34859
|
var exitHandlerRegistered = false;
|
|
34603
|
-
var instanceFilePath = (pid) =>
|
|
34604
|
-
var instanceLogPath = (pid) =>
|
|
34605
|
-
var instanceRegistryDir = () =>
|
|
34860
|
+
var instanceFilePath = (pid) => join58(instanceRegistryDir(), `${pid}.json`);
|
|
34861
|
+
var instanceLogPath = (pid) => join58(instanceRegistryDir(), `${pid}.log`);
|
|
34862
|
+
var instanceRegistryDir = () => join58(homedir2(), ".absolutejs", "instances");
|
|
34606
34863
|
var removeInstanceFilesSync = (pid) => {
|
|
34607
34864
|
try {
|
|
34608
34865
|
unlinkSync2(instanceFilePath(pid));
|
|
@@ -34624,20 +34881,20 @@ var registerExitHandlerOnce = () => {
|
|
|
34624
34881
|
};
|
|
34625
34882
|
var readJsonFile = (path) => {
|
|
34626
34883
|
try {
|
|
34627
|
-
return JSON.parse(
|
|
34884
|
+
return JSON.parse(readFileSync40(path, "utf-8"));
|
|
34628
34885
|
} catch {
|
|
34629
34886
|
return null;
|
|
34630
34887
|
}
|
|
34631
34888
|
};
|
|
34632
34889
|
var registerInstance = (record) => {
|
|
34633
|
-
|
|
34634
|
-
|
|
34890
|
+
mkdirSync19(instanceRegistryDir(), { recursive: true });
|
|
34891
|
+
writeFileSync12(instanceFilePath(record.pid), JSON.stringify(record, null, 2));
|
|
34635
34892
|
registeredPids.add(record.pid);
|
|
34636
34893
|
registerExitHandlerOnce();
|
|
34637
34894
|
return record;
|
|
34638
34895
|
};
|
|
34639
34896
|
var resolveProjectName = (cwd2) => {
|
|
34640
|
-
const parsed = readJsonFile(
|
|
34897
|
+
const parsed = readJsonFile(join58(cwd2, "package.json"));
|
|
34641
34898
|
if (parsed !== null && typeof parsed === "object" && typeof parsed.name === "string" && parsed.name.trim().length > 0) {
|
|
34642
34899
|
return parsed.name;
|
|
34643
34900
|
}
|
|
@@ -34751,8 +35008,10 @@ var networking = (app) => {
|
|
|
34751
35008
|
},
|
|
34752
35009
|
fetch: (request) => app.fetch(request)
|
|
34753
35010
|
});
|
|
35011
|
+
runDeferredBootTasks();
|
|
34754
35012
|
return app;
|
|
34755
35013
|
}
|
|
35014
|
+
releaseEarlyListener();
|
|
34756
35015
|
const listened = app.listen({
|
|
34757
35016
|
hostname: host2,
|
|
34758
35017
|
idleTimeout: httpIdleTimeout,
|
|
@@ -34765,6 +35024,7 @@ var networking = (app) => {
|
|
|
34765
35024
|
} : {}
|
|
34766
35025
|
}, () => {
|
|
34767
35026
|
selfRegisterInstance();
|
|
35027
|
+
runDeferredBootTasks();
|
|
34768
35028
|
if (visibility === "internal" || managedByWorkspace) {
|
|
34769
35029
|
return;
|
|
34770
35030
|
}
|
|
@@ -34949,8 +35209,8 @@ var generateHeadElement = ({
|
|
|
34949
35209
|
};
|
|
34950
35210
|
// src/utils/defineEnv.ts
|
|
34951
35211
|
var {env: bunEnv } = globalThis.Bun;
|
|
34952
|
-
import { existsSync as
|
|
34953
|
-
import { resolve as
|
|
35212
|
+
import { existsSync as existsSync44, readFileSync as readFileSync42 } from "fs";
|
|
35213
|
+
import { resolve as resolve52 } from "path";
|
|
34954
35214
|
|
|
34955
35215
|
// node_modules/@sinclair/typebox/build/esm/type/guard/value.mjs
|
|
34956
35216
|
var exports_value = {};
|
|
@@ -40985,19 +41245,19 @@ ${lines.join(`
|
|
|
40985
41245
|
};
|
|
40986
41246
|
var checkEnvFileSecurity = (properties) => {
|
|
40987
41247
|
const cwd2 = process.cwd();
|
|
40988
|
-
const envPath =
|
|
40989
|
-
if (!
|
|
41248
|
+
const envPath = resolve52(cwd2, ".env");
|
|
41249
|
+
if (!existsSync44(envPath))
|
|
40990
41250
|
return;
|
|
40991
41251
|
const sensitiveKeys = Object.keys(properties).filter(isSensitive);
|
|
40992
41252
|
if (sensitiveKeys.length === 0)
|
|
40993
41253
|
return;
|
|
40994
|
-
const envContent =
|
|
41254
|
+
const envContent = readFileSync42(envPath, "utf-8");
|
|
40995
41255
|
const presentKeys = sensitiveKeys.filter((key) => envContent.includes(`${key}=`));
|
|
40996
41256
|
if (presentKeys.length === 0)
|
|
40997
41257
|
return;
|
|
40998
|
-
const gitignorePath =
|
|
40999
|
-
if (
|
|
41000
|
-
const gitignore =
|
|
41258
|
+
const gitignorePath = resolve52(cwd2, ".gitignore");
|
|
41259
|
+
if (existsSync44(gitignorePath)) {
|
|
41260
|
+
const gitignore = readFileSync42(gitignorePath, "utf-8");
|
|
41001
41261
|
if (gitignore.split(`
|
|
41002
41262
|
`).some((line) => line.trim() === ".env"))
|
|
41003
41263
|
return;
|
|
@@ -41029,8 +41289,8 @@ var getEnv = (key) => {
|
|
|
41029
41289
|
return environmentVariable;
|
|
41030
41290
|
};
|
|
41031
41291
|
// src/utils/projectRoot.ts
|
|
41032
|
-
import { existsSync as
|
|
41033
|
-
import { dirname as dirname34, resolve as
|
|
41292
|
+
import { existsSync as existsSync45 } from "fs";
|
|
41293
|
+
import { dirname as dirname34, resolve as resolve53 } from "path";
|
|
41034
41294
|
var CONFIG_CANDIDATES = [
|
|
41035
41295
|
"absolute.config.ts",
|
|
41036
41296
|
"absolute.config.js",
|
|
@@ -41039,7 +41299,7 @@ var CONFIG_CANDIDATES = [
|
|
|
41039
41299
|
"absolute.config.mts",
|
|
41040
41300
|
"absolute.config.cts"
|
|
41041
41301
|
];
|
|
41042
|
-
var hasAbsoluteConfig = (directory) => CONFIG_CANDIDATES.some((name) =>
|
|
41302
|
+
var hasAbsoluteConfig = (directory) => CONFIG_CANDIDATES.some((name) => existsSync45(resolve53(directory, name)));
|
|
41043
41303
|
var findProjectRoot = () => {
|
|
41044
41304
|
const start = process.cwd();
|
|
41045
41305
|
let packageRoot = null;
|
|
@@ -41048,7 +41308,7 @@ var findProjectRoot = () => {
|
|
|
41048
41308
|
if (hasAbsoluteConfig(directory)) {
|
|
41049
41309
|
return directory;
|
|
41050
41310
|
}
|
|
41051
|
-
if (packageRoot === null &&
|
|
41311
|
+
if (packageRoot === null && existsSync45(resolve53(directory, "package.json"))) {
|
|
41052
41312
|
packageRoot = directory;
|
|
41053
41313
|
}
|
|
41054
41314
|
const parent = dirname34(directory);
|
|
@@ -41297,5 +41557,5 @@ export {
|
|
|
41297
41557
|
wrapPageHandlerWithStreamingSlots
|
|
41298
41558
|
};
|
|
41299
41559
|
|
|
41300
|
-
//# debugId=
|
|
41560
|
+
//# debugId=C2C6E94A66DDD23764756E2164756E21
|
|
41301
41561
|
//# sourceMappingURL=index.js.map
|