@absolutejs/absolute 0.19.0-beta.930 → 0.19.0-beta.931
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/angular/components/core/streamingSlotRegistrar.js +1 -1
- package/dist/angular/components/core/streamingSlotRegistry.js +2 -2
- package/dist/angular/index.js +118 -221
- package/dist/angular/index.js.map +4 -5
- package/dist/angular/server.js +100 -203
- package/dist/angular/server.js.map +4 -5
- package/dist/build.js +566 -688
- package/dist/build.js.map +8 -9
- package/dist/index.js +617 -739
- package/dist/index.js.map +8 -9
- package/dist/islands/index.js +2 -105
- package/dist/islands/index.js.map +4 -5
- package/dist/react/index.js +2 -105
- package/dist/react/index.js.map +4 -5
- package/dist/src/vue/Island.browser.d.ts +12 -36
- package/dist/src/vue/Island.d.ts +11 -35
- package/dist/src/vue/pageHandler.d.ts +0 -8
- package/dist/svelte/index.js +2 -105
- package/dist/svelte/index.js.map +4 -5
- package/dist/vue/browser.js +4 -57
- package/dist/vue/browser.js.map +4 -5
- package/dist/vue/index.js +8 -172
- package/dist/vue/index.js.map +6 -8
- package/dist/vue/server.js +4 -11
- package/dist/vue/server.js.map +3 -3
- package/package.json +1 -1
- package/dist/src/core/normalizeIslandProps.d.ts +0 -15
- package/dist/src/core/vueServerModule.d.ts +0 -1
package/dist/build.js
CHANGED
|
@@ -3381,100 +3381,6 @@ var init_svelteServerModule = __esm(() => {
|
|
|
3381
3381
|
});
|
|
3382
3382
|
});
|
|
3383
3383
|
|
|
3384
|
-
// src/core/vueServerModule.ts
|
|
3385
|
-
import { mkdir as mkdir2 } from "fs/promises";
|
|
3386
|
-
import { dirname as dirname4, join as join7, relative as relative5, resolve as resolve8 } from "path";
|
|
3387
|
-
var {Transpiler } = globalThis.Bun;
|
|
3388
|
-
var ISLAND_COMPONENT_ID_LENGTH = 8, serverCacheRoot2, compiledModuleCache2, transpiler2, ensureRelativeImportPath2 = (from, target) => {
|
|
3389
|
-
const importPath = relative5(dirname4(from), target).replace(/\\/g, "/");
|
|
3390
|
-
return importPath.startsWith(".") ? importPath : `./${importPath}`;
|
|
3391
|
-
}, getCachedModulePath2 = (sourcePath) => {
|
|
3392
|
-
const relativeSourcePath = relative5(process.cwd(), sourcePath).replace(/\\/g, "/");
|
|
3393
|
-
const normalizedSourcePath = relativeSourcePath.startsWith("..") ? sourcePath.replace(/[:\\/]/g, "_") : relativeSourcePath;
|
|
3394
|
-
return join7(serverCacheRoot2, `${normalizedSourcePath}.server.js`);
|
|
3395
|
-
}, writeIfChanged2 = async (path, content) => {
|
|
3396
|
-
const targetFile = Bun.file(path);
|
|
3397
|
-
if (await targetFile.exists()) {
|
|
3398
|
-
const currentContent = await targetFile.text();
|
|
3399
|
-
if (currentContent === content)
|
|
3400
|
-
return;
|
|
3401
|
-
}
|
|
3402
|
-
await Bun.write(path, content);
|
|
3403
|
-
}, stripExports = (code) => code.replace(/export\s+default/, "const script ="), mergeVueImports = (code) => {
|
|
3404
|
-
const lines = code.split(`
|
|
3405
|
-
`);
|
|
3406
|
-
const specifierSet = new Set;
|
|
3407
|
-
const vueImportRegex = /^import\s+{([^}]+)}\s+from\s+['"]vue['"];?$/;
|
|
3408
|
-
lines.forEach((line) => {
|
|
3409
|
-
const match = line.match(vueImportRegex);
|
|
3410
|
-
if (match?.[1])
|
|
3411
|
-
match[1].split(",").forEach((importSpecifier) => specifierSet.add(importSpecifier.trim()));
|
|
3412
|
-
});
|
|
3413
|
-
const nonVueLines = lines.filter((line) => !vueImportRegex.test(line));
|
|
3414
|
-
return specifierSet.size ? [
|
|
3415
|
-
`import { ${[...specifierSet].join(", ")} } from "vue";`,
|
|
3416
|
-
...nonVueLines
|
|
3417
|
-
].join(`
|
|
3418
|
-
`) : nonVueLines.join(`
|
|
3419
|
-
`);
|
|
3420
|
-
}, extractRelativeVueImports = (sourceCode) => Array.from(sourceCode.matchAll(/import\s+[\s\S]+?['"]([^'"]+)['"]/g)).map((match) => match[1]).filter((importPath) => typeof importPath === "string" && importPath.startsWith(".") && importPath.endsWith(".vue")), compileVueServerModule = async (sourcePath) => {
|
|
3421
|
-
const cachedModulePath = compiledModuleCache2.get(sourcePath);
|
|
3422
|
-
if (cachedModulePath)
|
|
3423
|
-
return cachedModulePath;
|
|
3424
|
-
const compiler = await import("@vue/compiler-sfc");
|
|
3425
|
-
const source = await Bun.file(sourcePath).text();
|
|
3426
|
-
const { descriptor } = compiler.parse(source, { filename: sourcePath });
|
|
3427
|
-
const componentId = Bun.hash(sourcePath).toString(BASE_36_RADIX).slice(0, ISLAND_COMPONENT_ID_LENGTH);
|
|
3428
|
-
const hasScript = descriptor.script || descriptor.scriptSetup;
|
|
3429
|
-
const compiledScript = hasScript ? compiler.compileScript(descriptor, {
|
|
3430
|
-
id: componentId,
|
|
3431
|
-
inlineTemplate: false
|
|
3432
|
-
}) : { bindings: {}, content: "export default {};" };
|
|
3433
|
-
const renderCode = descriptor.template ? compiler.compileTemplate({
|
|
3434
|
-
compilerOptions: {
|
|
3435
|
-
bindingMetadata: compiledScript.bindings,
|
|
3436
|
-
expressionPlugins: ["typescript"],
|
|
3437
|
-
prefixIdentifiers: true,
|
|
3438
|
-
isCustomElement: (tag) => tag === "absolute-island"
|
|
3439
|
-
},
|
|
3440
|
-
filename: sourcePath,
|
|
3441
|
-
id: componentId,
|
|
3442
|
-
scoped: descriptor.styles.some((styleBlock) => styleBlock.scoped),
|
|
3443
|
-
source: descriptor.template.content,
|
|
3444
|
-
ssr: true,
|
|
3445
|
-
ssrCssVars: descriptor.cssVars
|
|
3446
|
-
}).code : "const ssrRender = () => {};";
|
|
3447
|
-
const childImportPaths = extractRelativeVueImports(compiledScript.content);
|
|
3448
|
-
const compiledChildren = await Promise.all(childImportPaths.map(async (relativeImport) => ({
|
|
3449
|
-
compiledPath: await compileVueServerModule(resolve8(dirname4(sourcePath), relativeImport)),
|
|
3450
|
-
spec: relativeImport
|
|
3451
|
-
})));
|
|
3452
|
-
const strippedScript = stripExports(compiledScript.content);
|
|
3453
|
-
const transpiledScript = transpiler2.transformSync(strippedScript);
|
|
3454
|
-
const assembled = mergeVueImports([
|
|
3455
|
-
transpiledScript,
|
|
3456
|
-
renderCode,
|
|
3457
|
-
"script.ssrRender = ssrRender;",
|
|
3458
|
-
"export default script;"
|
|
3459
|
-
].join(`
|
|
3460
|
-
`));
|
|
3461
|
-
const compiledModulePath = getCachedModulePath2(sourcePath);
|
|
3462
|
-
let rewritten = assembled;
|
|
3463
|
-
for (const child of compiledChildren) {
|
|
3464
|
-
rewritten = rewritten.replaceAll(child.spec, ensureRelativeImportPath2(compiledModulePath, child.compiledPath));
|
|
3465
|
-
}
|
|
3466
|
-
await mkdir2(dirname4(compiledModulePath), { recursive: true });
|
|
3467
|
-
await writeIfChanged2(compiledModulePath, rewritten);
|
|
3468
|
-
compiledModuleCache2.set(sourcePath, compiledModulePath);
|
|
3469
|
-
return compiledModulePath;
|
|
3470
|
-
};
|
|
3471
|
-
var init_vueServerModule = __esm(() => {
|
|
3472
|
-
init_constants();
|
|
3473
|
-
serverCacheRoot2 = join7(process.cwd(), ".absolutejs", "islands", "vue");
|
|
3474
|
-
compiledModuleCache2 = new Map;
|
|
3475
|
-
transpiler2 = new Transpiler({ loader: "ts", target: "browser" });
|
|
3476
|
-
});
|
|
3477
|
-
|
|
3478
3384
|
// src/core/islandMarkupAttributes.ts
|
|
3479
3385
|
var getIslandMarkerAttributes = (props, islandId) => ({
|
|
3480
3386
|
"data-component": props.component,
|
|
@@ -3510,17 +3416,9 @@ var islandSequence = 0, resolvedServerComponentCache, resolvedServerBuildCompone
|
|
|
3510
3416
|
const loadPromise = loadAndCompileServerBuildComponent(buildReferencePath);
|
|
3511
3417
|
resolvedServerBuildComponentCache.set(buildReferencePath, loadPromise);
|
|
3512
3418
|
return loadPromise;
|
|
3513
|
-
}, resolveRuntimeImportTarget = async (resolvedModulePath) => {
|
|
3514
|
-
if (resolvedModulePath.endsWith(".svelte")) {
|
|
3515
|
-
return compileSvelteServerModule(resolvedModulePath);
|
|
3516
|
-
}
|
|
3517
|
-
if (resolvedModulePath.endsWith(".vue")) {
|
|
3518
|
-
return compileVueServerModule(resolvedModulePath);
|
|
3519
|
-
}
|
|
3520
|
-
return resolvedModulePath;
|
|
3521
3419
|
}, loadServerImportComponent = async (resolvedComponent, exportName) => {
|
|
3522
3420
|
const resolvedModulePath = resolvedComponent.startsWith(".") ? new URL(resolvedComponent, import.meta.url).pathname : resolvedComponent;
|
|
3523
|
-
const importTarget = await
|
|
3421
|
+
const importTarget = resolvedModulePath.endsWith(".svelte") ? await compileSvelteServerModule(resolvedModulePath) : resolvedModulePath;
|
|
3524
3422
|
const loadedModule = await import(importTarget);
|
|
3525
3423
|
if (exportName && exportName !== "default" && exportName in loadedModule) {
|
|
3526
3424
|
return loadedModule[exportName];
|
|
@@ -3624,7 +3522,6 @@ var islandSequence = 0, resolvedServerComponentCache, resolvedServerBuildCompone
|
|
|
3624
3522
|
var init_renderIslandMarkup = __esm(() => {
|
|
3625
3523
|
init_islandSsr();
|
|
3626
3524
|
init_svelteServerModule();
|
|
3627
|
-
init_vueServerModule();
|
|
3628
3525
|
init_islandMarkupAttributes();
|
|
3629
3526
|
init_islands();
|
|
3630
3527
|
resolvedServerComponentCache = new Map;
|
|
@@ -8855,7 +8752,7 @@ __export(exports_tailwindCompiler, {
|
|
|
8855
8752
|
import { createHash as createHash2 } from "crypto";
|
|
8856
8753
|
import { existsSync as existsSync8, readFileSync as readFileSync5 } from "fs";
|
|
8857
8754
|
import { readFile as readFile2, stat } from "fs/promises";
|
|
8858
|
-
import { dirname as
|
|
8755
|
+
import { dirname as dirname4, isAbsolute as isAbsolute2, resolve as resolve8 } from "path";
|
|
8859
8756
|
var compilerCache, cachedTailwindCompile = null, loadTailwindCompile = async () => {
|
|
8860
8757
|
if (cachedTailwindCompile)
|
|
8861
8758
|
return cachedTailwindCompile;
|
|
@@ -8886,7 +8783,7 @@ var compilerCache, cachedTailwindCompile = null, loadTailwindCompile = async ()
|
|
|
8886
8783
|
} catch {
|
|
8887
8784
|
return Bun.resolveSync(id, base);
|
|
8888
8785
|
}
|
|
8889
|
-
const pkgDir =
|
|
8786
|
+
const pkgDir = dirname4(pkgJsonPath);
|
|
8890
8787
|
let pkg = {};
|
|
8891
8788
|
try {
|
|
8892
8789
|
pkg = JSON.parse(readFileSync5(pkgJsonPath, "utf-8"));
|
|
@@ -8902,29 +8799,29 @@ var compilerCache, cachedTailwindCompile = null, loadTailwindCompile = async ()
|
|
|
8902
8799
|
"dist/index.css"
|
|
8903
8800
|
].filter((entry) => typeof entry === "string");
|
|
8904
8801
|
for (const candidate of candidates) {
|
|
8905
|
-
const candidatePath =
|
|
8802
|
+
const candidatePath = resolve8(pkgDir, candidate);
|
|
8906
8803
|
if (existsSync8(candidatePath))
|
|
8907
8804
|
return candidatePath;
|
|
8908
8805
|
}
|
|
8909
8806
|
return Bun.resolveSync(id, base);
|
|
8910
8807
|
}, createLoadStylesheet = (deps) => async (id, base) => {
|
|
8911
|
-
const path = id.startsWith(".") || isAbsolute2(id) ?
|
|
8808
|
+
const path = id.startsWith(".") || isAbsolute2(id) ? resolve8(base, id) : resolveBareCssImport(id, base);
|
|
8912
8809
|
const content = await readFile2(path, "utf-8");
|
|
8913
8810
|
await recordDependency(deps, path);
|
|
8914
|
-
return { base:
|
|
8811
|
+
return { base: dirname4(path), content, path };
|
|
8915
8812
|
}, loadModule = async (id, base, _kind) => {
|
|
8916
|
-
const path = id.startsWith(".") || isAbsolute2(id) ?
|
|
8813
|
+
const path = id.startsWith(".") || isAbsolute2(id) ? resolve8(base, id) : Bun.resolveSync(id, base);
|
|
8917
8814
|
const module = await import(path);
|
|
8918
|
-
return { base:
|
|
8815
|
+
return { base: dirname4(path), module, path };
|
|
8919
8816
|
}, buildCompilerEntry = async (cssPath) => {
|
|
8920
8817
|
const compile = await loadTailwindCompile();
|
|
8921
|
-
const absPath =
|
|
8818
|
+
const absPath = resolve8(cssPath);
|
|
8922
8819
|
const css = await readFile2(absPath, "utf-8");
|
|
8923
8820
|
const cssMtimeMs = (await stat(absPath)).mtimeMs;
|
|
8924
8821
|
const cssDependencies = new Map;
|
|
8925
8822
|
cssDependencies.set(absPath, cssMtimeMs);
|
|
8926
8823
|
const compiler = await compile(css, {
|
|
8927
|
-
base:
|
|
8824
|
+
base: dirname4(absPath),
|
|
8928
8825
|
loadModule,
|
|
8929
8826
|
loadStylesheet: createLoadStylesheet(cssDependencies)
|
|
8930
8827
|
});
|
|
@@ -8947,11 +8844,11 @@ var compilerCache, cachedTailwindCompile = null, loadTailwindCompile = async ()
|
|
|
8947
8844
|
}, hashCss = (css) => createHash2("sha1").update(css).digest("hex"), fileMatchesSources = (file, sources) => {
|
|
8948
8845
|
if (sources.length === 0)
|
|
8949
8846
|
return true;
|
|
8950
|
-
const absFile =
|
|
8847
|
+
const absFile = resolve8(file);
|
|
8951
8848
|
for (const source of sources) {
|
|
8952
8849
|
if (source.negated)
|
|
8953
8850
|
continue;
|
|
8954
|
-
const absolutePattern =
|
|
8851
|
+
const absolutePattern = resolve8(source.base, source.pattern);
|
|
8955
8852
|
if (!/[*?{[]/.test(absolutePattern)) {
|
|
8956
8853
|
if (absolutePattern === absFile)
|
|
8957
8854
|
return true;
|
|
@@ -8996,7 +8893,7 @@ var compilerCache, cachedTailwindCompile = null, loadTailwindCompile = async ()
|
|
|
8996
8893
|
const seen = new Set;
|
|
8997
8894
|
const collected = [];
|
|
8998
8895
|
const scans = sources.filter((source) => !source.negated).map(async (source) => {
|
|
8999
|
-
const absolutePattern =
|
|
8896
|
+
const absolutePattern = resolve8(source.base, source.pattern);
|
|
9000
8897
|
const { glob: relativePattern, root } = splitGlobAtFirstMeta(absolutePattern);
|
|
9001
8898
|
if (!relativePattern) {
|
|
9002
8899
|
try {
|
|
@@ -9008,12 +8905,12 @@ var compilerCache, cachedTailwindCompile = null, loadTailwindCompile = async ()
|
|
|
9008
8905
|
}
|
|
9009
8906
|
const glob = new Bun.Glob(relativePattern);
|
|
9010
8907
|
const matches = [];
|
|
9011
|
-
for await (const
|
|
8908
|
+
for await (const relative5 of glob.scan({
|
|
9012
8909
|
absolute: false,
|
|
9013
8910
|
cwd: root,
|
|
9014
8911
|
onlyFiles: true
|
|
9015
8912
|
})) {
|
|
9016
|
-
matches.push(
|
|
8913
|
+
matches.push(resolve8(root, relative5));
|
|
9017
8914
|
}
|
|
9018
8915
|
return matches;
|
|
9019
8916
|
});
|
|
@@ -9045,7 +8942,7 @@ var compilerCache, cachedTailwindCompile = null, loadTailwindCompile = async ()
|
|
|
9045
8942
|
const results = await Promise.all(checks);
|
|
9046
8943
|
return results.some(Boolean);
|
|
9047
8944
|
}, getCompilerEntry = async (cssPath) => {
|
|
9048
|
-
const key =
|
|
8945
|
+
const key = resolve8(cssPath);
|
|
9049
8946
|
const cached = compilerCache.get(key);
|
|
9050
8947
|
if (cached && !await isCompilerStale(cached))
|
|
9051
8948
|
return cached;
|
|
@@ -9058,14 +8955,14 @@ var compilerCache, cachedTailwindCompile = null, loadTailwindCompile = async ()
|
|
|
9058
8955
|
compilerCache.clear();
|
|
9059
8956
|
return;
|
|
9060
8957
|
}
|
|
9061
|
-
compilerCache.delete(
|
|
8958
|
+
compilerCache.delete(resolve8(cssPath));
|
|
9062
8959
|
}, incrementalTailwindBuild = async (tailwind, buildPath, changedFiles, styleTransformConfig) => {
|
|
9063
8960
|
const startedAt = performance.now();
|
|
9064
8961
|
const entry = await getCompilerEntry(tailwind.input);
|
|
9065
8962
|
const inputAbs = entry.cssPath;
|
|
9066
8963
|
const filesToRescan = [];
|
|
9067
8964
|
for (const file of changedFiles) {
|
|
9068
|
-
const abs =
|
|
8965
|
+
const abs = resolve8(file);
|
|
9069
8966
|
if (abs === inputAbs)
|
|
9070
8967
|
continue;
|
|
9071
8968
|
if (!fileMatchesSources(abs, entry.sources))
|
|
@@ -9074,7 +8971,7 @@ var compilerCache, cachedTailwindCompile = null, loadTailwindCompile = async ()
|
|
|
9074
8971
|
}
|
|
9075
8972
|
await Promise.all(filesToRescan.map((file) => ingestFile(entry, file)));
|
|
9076
8973
|
const rawCss = entry.compiler.build([...entry.candidateCounts.keys()]);
|
|
9077
|
-
const outputPath =
|
|
8974
|
+
const outputPath = resolve8(buildPath, tailwind.output);
|
|
9078
8975
|
const finalCss = await compileStyleSource(outputPath, rawCss, "css", styleTransformConfig);
|
|
9079
8976
|
const hash = hashCss(finalCss);
|
|
9080
8977
|
const durationMs = performance.now() - startedAt;
|
|
@@ -9094,11 +8991,11 @@ var init_tailwindCompiler = __esm(() => {
|
|
|
9094
8991
|
});
|
|
9095
8992
|
|
|
9096
8993
|
// src/build/compileTailwind.ts
|
|
9097
|
-
import { mkdir as
|
|
9098
|
-
import { dirname as
|
|
8994
|
+
import { mkdir as mkdir2 } from "fs/promises";
|
|
8995
|
+
import { dirname as dirname5, join as join7 } from "path";
|
|
9099
8996
|
var TAILWIND_CANDIDATE_EXTENSION_PATTERN, isTailwindCandidate = (filePath) => TAILWIND_CANDIDATE_EXTENSION_PATTERN.test(filePath), compileTailwind = async (input, output, buildPath, styleTransformConfig) => {
|
|
9100
|
-
const outputPath =
|
|
9101
|
-
await
|
|
8997
|
+
const outputPath = join7(buildPath, output);
|
|
8998
|
+
await mkdir2(dirname5(outputPath), { recursive: true });
|
|
9102
8999
|
await incrementalTailwindBuild({ input, output }, buildPath, [], styleTransformConfig);
|
|
9103
9000
|
}, compileTailwindConfig = async (tailwind, buildPath, styleTransformConfig) => compileTailwind(tailwind.input, tailwind.output, buildPath, styleTransformConfig);
|
|
9104
9001
|
var init_compileTailwind = __esm(() => {
|
|
@@ -9108,7 +9005,7 @@ var init_compileTailwind = __esm(() => {
|
|
|
9108
9005
|
|
|
9109
9006
|
// src/utils/imageProcessing.ts
|
|
9110
9007
|
import { existsSync as existsSync9, mkdirSync as mkdirSync3, readFileSync as readFileSync6, writeFileSync as writeFileSync3 } from "fs";
|
|
9111
|
-
import { join as
|
|
9008
|
+
import { join as join8, resolve as resolve9 } from "path";
|
|
9112
9009
|
var DEFAULT_DEVICE_SIZES, DEFAULT_IMAGE_SIZES, DEFAULT_QUALITY, OPTIMIZATION_ENDPOINT = "/_absolute/image", BLUR_DEVIATION = 20, sharpModule = undefined, sharpLoaded = false, sharpWarned = false, snapToSize = (target, sizes) => {
|
|
9113
9010
|
for (const size of sizes) {
|
|
9114
9011
|
if (size >= target)
|
|
@@ -9163,7 +9060,7 @@ var DEFAULT_DEVICE_SIZES, DEFAULT_IMAGE_SIZES, DEFAULT_QUALITY, OPTIMIZATION_END
|
|
|
9163
9060
|
const image = config?.imageSizes ?? DEFAULT_IMAGE_SIZES;
|
|
9164
9061
|
return [...device, ...image].sort((left, right) => left - right);
|
|
9165
9062
|
}, getCacheDir = (buildDir) => {
|
|
9166
|
-
const dir =
|
|
9063
|
+
const dir = join8(buildDir, ".cache", "images");
|
|
9167
9064
|
if (!existsSync9(dir))
|
|
9168
9065
|
mkdirSync3(dir, { recursive: true });
|
|
9169
9066
|
return dir;
|
|
@@ -9220,8 +9117,8 @@ var DEFAULT_DEVICE_SIZES, DEFAULT_IMAGE_SIZES, DEFAULT_QUALITY, OPTIMIZATION_END
|
|
|
9220
9117
|
return toBuffer(buffer);
|
|
9221
9118
|
}
|
|
9222
9119
|
}, readFromCache = (cacheDir, cacheKey) => {
|
|
9223
|
-
const metaPath =
|
|
9224
|
-
const dataPath =
|
|
9120
|
+
const metaPath = join8(cacheDir, `${cacheKey}.meta`);
|
|
9121
|
+
const dataPath = join8(cacheDir, `${cacheKey}.data`);
|
|
9225
9122
|
if (!existsSync9(metaPath) || !existsSync9(dataPath))
|
|
9226
9123
|
return null;
|
|
9227
9124
|
try {
|
|
@@ -9236,7 +9133,7 @@ var DEFAULT_DEVICE_SIZES, DEFAULT_IMAGE_SIZES, DEFAULT_QUALITY, OPTIMIZATION_END
|
|
|
9236
9133
|
return sharpModule;
|
|
9237
9134
|
sharpLoaded = true;
|
|
9238
9135
|
try {
|
|
9239
|
-
const sharpPath =
|
|
9136
|
+
const sharpPath = resolve9(process.cwd(), "node_modules/sharp");
|
|
9240
9137
|
const mod = await import(sharpPath);
|
|
9241
9138
|
sharpModule = mod.default ?? mod;
|
|
9242
9139
|
return sharpModule;
|
|
@@ -9248,8 +9145,8 @@ var DEFAULT_DEVICE_SIZES, DEFAULT_IMAGE_SIZES, DEFAULT_QUALITY, OPTIMIZATION_END
|
|
|
9248
9145
|
return null;
|
|
9249
9146
|
}
|
|
9250
9147
|
}, writeToCache = (cacheDir, cacheKey, buffer, meta) => {
|
|
9251
|
-
const metaPath =
|
|
9252
|
-
const dataPath =
|
|
9148
|
+
const metaPath = join8(cacheDir, `${cacheKey}.meta`);
|
|
9149
|
+
const dataPath = join8(cacheDir, `${cacheKey}.data`);
|
|
9253
9150
|
writeFileSync3(dataPath, buffer);
|
|
9254
9151
|
writeFileSync3(metaPath, JSON.stringify(meta));
|
|
9255
9152
|
};
|
|
@@ -9337,7 +9234,7 @@ var init_optimizeHtmlImages = __esm(() => {
|
|
|
9337
9234
|
// src/cli/scripts/telemetry.ts
|
|
9338
9235
|
import { existsSync as existsSync10, mkdirSync as mkdirSync4, readFileSync as readFileSync7, writeFileSync as writeFileSync4 } from "fs";
|
|
9339
9236
|
import { homedir } from "os";
|
|
9340
|
-
import { join as
|
|
9237
|
+
import { join as join9 } from "path";
|
|
9341
9238
|
var configDir, configPath, getTelemetryConfig = () => {
|
|
9342
9239
|
try {
|
|
9343
9240
|
if (!existsSync10(configPath))
|
|
@@ -9350,14 +9247,14 @@ var configDir, configPath, getTelemetryConfig = () => {
|
|
|
9350
9247
|
}
|
|
9351
9248
|
};
|
|
9352
9249
|
var init_telemetry = __esm(() => {
|
|
9353
|
-
configDir =
|
|
9354
|
-
configPath =
|
|
9250
|
+
configDir = join9(homedir(), ".absolutejs");
|
|
9251
|
+
configPath = join9(configDir, "telemetry.json");
|
|
9355
9252
|
});
|
|
9356
9253
|
|
|
9357
9254
|
// src/cli/telemetryEvent.ts
|
|
9358
9255
|
import { existsSync as existsSync11, readFileSync as readFileSync8 } from "fs";
|
|
9359
9256
|
import { arch, platform } from "os";
|
|
9360
|
-
import { dirname as
|
|
9257
|
+
import { dirname as dirname6, join as join10, parse } from "path";
|
|
9361
9258
|
var checkCandidate = (candidate) => {
|
|
9362
9259
|
if (!existsSync11(candidate)) {
|
|
9363
9260
|
return null;
|
|
@@ -9377,12 +9274,12 @@ var checkCandidate = (candidate) => {
|
|
|
9377
9274
|
}, findPackageVersion = () => {
|
|
9378
9275
|
let { dir } = import.meta;
|
|
9379
9276
|
while (dir !== parse(dir).root) {
|
|
9380
|
-
const candidate =
|
|
9277
|
+
const candidate = join10(dir, "package.json");
|
|
9381
9278
|
const version = checkCandidate(candidate);
|
|
9382
9279
|
if (version) {
|
|
9383
9280
|
return version;
|
|
9384
9281
|
}
|
|
9385
|
-
dir =
|
|
9282
|
+
dir = dirname6(dir);
|
|
9386
9283
|
}
|
|
9387
9284
|
return "unknown";
|
|
9388
9285
|
}, sendTelemetryEvent = (event, payload) => {
|
|
@@ -9468,18 +9365,18 @@ var init_updateAssetPaths = __esm(() => {
|
|
|
9468
9365
|
|
|
9469
9366
|
// src/dev/buildHMRClient.ts
|
|
9470
9367
|
import { existsSync as existsSync12 } from "fs";
|
|
9471
|
-
import { resolve as
|
|
9368
|
+
import { resolve as resolve10 } from "path";
|
|
9472
9369
|
var {build: bunBuild } = globalThis.Bun;
|
|
9473
9370
|
var resolveHmrClientPath = () => {
|
|
9474
9371
|
const projectRoot = process.cwd();
|
|
9475
|
-
const fromSource =
|
|
9372
|
+
const fromSource = resolve10(import.meta.dir, "client/hmrClient.ts");
|
|
9476
9373
|
if (existsSync12(fromSource) && fromSource.startsWith(projectRoot)) {
|
|
9477
9374
|
return fromSource;
|
|
9478
9375
|
}
|
|
9479
|
-
const fromNodeModules =
|
|
9376
|
+
const fromNodeModules = resolve10(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client/hmrClient.ts");
|
|
9480
9377
|
if (existsSync12(fromNodeModules))
|
|
9481
9378
|
return fromNodeModules;
|
|
9482
|
-
return
|
|
9379
|
+
return resolve10(import.meta.dir, "dev/client/hmrClient.ts");
|
|
9483
9380
|
}, hmrClientPath2, buildHMRClient = async () => {
|
|
9484
9381
|
const entryPoint = hmrClientPath2;
|
|
9485
9382
|
const result = await bunBuild({
|
|
@@ -9509,7 +9406,7 @@ var init_buildHMRClient = __esm(() => {
|
|
|
9509
9406
|
// src/build/nativeRewrite.ts
|
|
9510
9407
|
import { dlopen, FFIType, ptr } from "bun:ffi";
|
|
9511
9408
|
import { platform as platform2, arch as arch2 } from "os";
|
|
9512
|
-
import { resolve as
|
|
9409
|
+
import { resolve as resolve11 } from "path";
|
|
9513
9410
|
var ffiDefinition, nativeLib = null, loadNative = () => {
|
|
9514
9411
|
if (nativeLib !== null)
|
|
9515
9412
|
return nativeLib;
|
|
@@ -9527,7 +9424,7 @@ var ffiDefinition, nativeLib = null, loadNative = () => {
|
|
|
9527
9424
|
if (!libPath)
|
|
9528
9425
|
return null;
|
|
9529
9426
|
try {
|
|
9530
|
-
const fullPath =
|
|
9427
|
+
const fullPath = resolve11(import.meta.dir, "../../native/packages", libPath);
|
|
9531
9428
|
const lib = dlopen(fullPath, ffiDefinition);
|
|
9532
9429
|
nativeLib = lib.symbols;
|
|
9533
9430
|
return nativeLib;
|
|
@@ -9673,7 +9570,7 @@ var devVendorPaths = null, getDevVendorPaths = () => devVendorPaths, setDevVendo
|
|
|
9673
9570
|
|
|
9674
9571
|
// src/build/angularLinkerPlugin.ts
|
|
9675
9572
|
import { existsSync as existsSync13, mkdirSync as mkdirSync5, readFileSync as readFileSync9, writeFileSync as writeFileSync5 } from "fs";
|
|
9676
|
-
import { dirname as
|
|
9573
|
+
import { dirname as dirname7, join as join11, relative as relative5, resolve as resolve12 } from "path";
|
|
9677
9574
|
import { createHash as createHash3 } from "crypto";
|
|
9678
9575
|
var CACHE_ROOT, createAngularLinkerPlugin = (linkerJitMode) => ({
|
|
9679
9576
|
name: "angular-linker",
|
|
@@ -9681,7 +9578,7 @@ var CACHE_ROOT, createAngularLinkerPlugin = (linkerJitMode) => ({
|
|
|
9681
9578
|
let needsLinking;
|
|
9682
9579
|
let babelTransform;
|
|
9683
9580
|
let linkerPlugin;
|
|
9684
|
-
const cacheDir =
|
|
9581
|
+
const cacheDir = join11(CACHE_ROOT, linkerJitMode ? "jit" : "aot");
|
|
9685
9582
|
bld.onLoad({ filter: /[\\/]@angular[\\/].*\.m?js$/ }, async (args) => {
|
|
9686
9583
|
const source = await Bun.file(args.path).text();
|
|
9687
9584
|
if (!needsLinking) {
|
|
@@ -9694,7 +9591,7 @@ var CACHE_ROOT, createAngularLinkerPlugin = (linkerJitMode) => ({
|
|
|
9694
9591
|
return;
|
|
9695
9592
|
}
|
|
9696
9593
|
const hash = createHash3("md5").update(source).digest("hex");
|
|
9697
|
-
const cachePath =
|
|
9594
|
+
const cachePath = join11(cacheDir, `${hash}.js`);
|
|
9698
9595
|
if (existsSync13(cachePath)) {
|
|
9699
9596
|
return {
|
|
9700
9597
|
contents: readFileSync9(cachePath, "utf-8"),
|
|
@@ -9711,11 +9608,11 @@ var CACHE_ROOT, createAngularLinkerPlugin = (linkerJitMode) => ({
|
|
|
9711
9608
|
const mod = await import(linkerSpecifier);
|
|
9712
9609
|
linkerPlugin = mod.createEs2015LinkerPlugin({
|
|
9713
9610
|
fileSystem: {
|
|
9714
|
-
dirname:
|
|
9611
|
+
dirname: dirname7,
|
|
9715
9612
|
exists: existsSync13,
|
|
9716
9613
|
readFile: readFileSync9,
|
|
9717
|
-
relative:
|
|
9718
|
-
resolve:
|
|
9614
|
+
relative: relative5,
|
|
9615
|
+
resolve: resolve12
|
|
9719
9616
|
},
|
|
9720
9617
|
linkerJitMode,
|
|
9721
9618
|
logger: {
|
|
@@ -9746,7 +9643,7 @@ var CACHE_ROOT, createAngularLinkerPlugin = (linkerJitMode) => ({
|
|
|
9746
9643
|
}
|
|
9747
9644
|
}), angularLinkerPlugin;
|
|
9748
9645
|
var init_angularLinkerPlugin = __esm(() => {
|
|
9749
|
-
CACHE_ROOT =
|
|
9646
|
+
CACHE_ROOT = resolve12(".absolutejs", "cache", "angular-linker");
|
|
9750
9647
|
angularLinkerPlugin = createAngularLinkerPlugin(false);
|
|
9751
9648
|
});
|
|
9752
9649
|
|
|
@@ -9757,7 +9654,7 @@ __export(exports_hmrInjectionPlugin, {
|
|
|
9757
9654
|
applyAngularHmrInjection: () => applyAngularHmrInjection
|
|
9758
9655
|
});
|
|
9759
9656
|
import { readFile as readFile5 } from "fs/promises";
|
|
9760
|
-
import { relative as
|
|
9657
|
+
import { relative as relative6, resolve as resolve13 } from "path";
|
|
9761
9658
|
var ENTITY_DECORATOR_RE, IMPORT_RE, TOP_LEVEL_DECL_RE, extractAllTopLevelNames = (jsSource) => {
|
|
9762
9659
|
const names = new Set;
|
|
9763
9660
|
IMPORT_RE.lastIndex = 0;
|
|
@@ -9920,7 +9817,7 @@ var ENTITY_DECORATOR_RE, IMPORT_RE, TOP_LEVEL_DECL_RE, extractAllTopLevelNames =
|
|
|
9920
9817
|
}
|
|
9921
9818
|
`, applyAngularHmrInjection = (jsSource, componentJsAbsPath, params) => {
|
|
9922
9819
|
const { generatedAngularRoot, userAngularRoot, projectRoot } = params;
|
|
9923
|
-
const normalizedGenRoot =
|
|
9820
|
+
const normalizedGenRoot = resolve13(generatedAngularRoot).replace(/\\/g, "/");
|
|
9924
9821
|
const normalizedPath = componentJsAbsPath.replace(/\\/g, "/");
|
|
9925
9822
|
if (!normalizedPath.startsWith(normalizedGenRoot + "/"))
|
|
9926
9823
|
return;
|
|
@@ -9937,9 +9834,9 @@ var ENTITY_DECORATOR_RE, IMPORT_RE, TOP_LEVEL_DECL_RE, extractAllTopLevelNames =
|
|
|
9937
9834
|
}
|
|
9938
9835
|
if (classNames.length === 0)
|
|
9939
9836
|
return;
|
|
9940
|
-
const relFromGenRoot =
|
|
9941
|
-
const userTsPath =
|
|
9942
|
-
const projectRel =
|
|
9837
|
+
const relFromGenRoot = relative6(generatedAngularRoot, componentJsAbsPath).replace(/\\/g, "/");
|
|
9838
|
+
const userTsPath = resolve13(userAngularRoot, relFromGenRoot.replace(/\.js$/, ".ts"));
|
|
9839
|
+
const projectRel = relative6(projectRoot, userTsPath).replace(/\\/g, "/");
|
|
9943
9840
|
const tail = classNames.map((className) => {
|
|
9944
9841
|
const id = `${projectRel}@${className}`;
|
|
9945
9842
|
return buildHmrTail(className, JSON.stringify(id));
|
|
@@ -9973,17 +9870,17 @@ var init_hmrInjectionPlugin = __esm(() => {
|
|
|
9973
9870
|
|
|
9974
9871
|
// src/utils/cleanStaleOutputs.ts
|
|
9975
9872
|
import { rm as rm2 } from "fs/promises";
|
|
9976
|
-
import { resolve as
|
|
9873
|
+
import { resolve as resolve14 } from "path";
|
|
9977
9874
|
var {Glob: Glob5 } = globalThis.Bun;
|
|
9978
9875
|
var HASHED_FILE_PATTERN, cleanStaleOutputs = async (buildPath, currentOutputPaths) => {
|
|
9979
|
-
const currentPaths = new Set(currentOutputPaths.map((path) =>
|
|
9876
|
+
const currentPaths = new Set(currentOutputPaths.map((path) => resolve14(path)));
|
|
9980
9877
|
const glob = new Glob5("**/*");
|
|
9981
9878
|
const removals = [];
|
|
9982
|
-
for (const
|
|
9983
|
-
const absolute =
|
|
9879
|
+
for (const relative7 of glob.scanSync({ cwd: buildPath })) {
|
|
9880
|
+
const absolute = resolve14(buildPath, relative7);
|
|
9984
9881
|
if (currentPaths.has(absolute))
|
|
9985
9882
|
continue;
|
|
9986
|
-
if (!HASHED_FILE_PATTERN.test(
|
|
9883
|
+
if (!HASHED_FILE_PATTERN.test(relative7))
|
|
9987
9884
|
continue;
|
|
9988
9885
|
removals.push(rm2(absolute, { force: true }));
|
|
9989
9886
|
}
|
|
@@ -9999,20 +9896,20 @@ __export(exports_generatedDir, {
|
|
|
9999
9896
|
getGeneratedRoot: () => getGeneratedRoot,
|
|
10000
9897
|
getFrameworkGeneratedDir: () => getFrameworkGeneratedDir
|
|
10001
9898
|
});
|
|
10002
|
-
import { join as
|
|
10003
|
-
var GENERATED_DIR_NAME = "generated", ABSOLUTE_CACHE_DIR_NAME = ".absolutejs", getGeneratedRoot = (projectRoot = process.cwd()) =>
|
|
9899
|
+
import { join as join12 } from "path";
|
|
9900
|
+
var GENERATED_DIR_NAME = "generated", ABSOLUTE_CACHE_DIR_NAME = ".absolutejs", getGeneratedRoot = (projectRoot = process.cwd()) => join12(projectRoot, ABSOLUTE_CACHE_DIR_NAME, GENERATED_DIR_NAME), getFrameworkGeneratedDir = (framework, projectRoot = process.cwd()) => join12(getGeneratedRoot(projectRoot), framework);
|
|
10004
9901
|
var init_generatedDir = () => {};
|
|
10005
9902
|
|
|
10006
9903
|
// src/utils/cleanup.ts
|
|
10007
9904
|
import { rm as rm3 } from "fs/promises";
|
|
10008
|
-
import { join as
|
|
9905
|
+
import { join as join13 } from "path";
|
|
10009
9906
|
var removeIfExists = (path) => rm3(path, { force: true, recursive: true }), cleanFramework = (framework, frameworkDir, skipGenerated = false) => {
|
|
10010
9907
|
const tasks = [];
|
|
10011
9908
|
if (!skipGenerated) {
|
|
10012
9909
|
tasks.push(removeIfExists(getFrameworkGeneratedDir(framework)));
|
|
10013
9910
|
}
|
|
10014
9911
|
if (frameworkDir)
|
|
10015
|
-
tasks.push(removeIfExists(
|
|
9912
|
+
tasks.push(removeIfExists(join13(frameworkDir, "generated")));
|
|
10016
9913
|
return Promise.all(tasks);
|
|
10017
9914
|
}, cleanup = async ({
|
|
10018
9915
|
angularDir,
|
|
@@ -10051,7 +9948,7 @@ var init_commonAncestor = () => {};
|
|
|
10051
9948
|
|
|
10052
9949
|
// src/utils/buildDirectoryLock.ts
|
|
10053
9950
|
import { mkdirSync as mkdirSync6, unlinkSync, writeFileSync as writeFileSync6, readFileSync as readFileSync10 } from "fs";
|
|
10054
|
-
import { dirname as
|
|
9951
|
+
import { dirname as dirname8, join as join14 } from "path";
|
|
10055
9952
|
var heldLocks, HELD_LOCKS_ENV = "ABSOLUTE_HELD_BUILD_DIRECTORY_LOCKS", exitHandlersRegistered = false, registerExitHandlersOnce = () => {
|
|
10056
9953
|
if (exitHandlersRegistered)
|
|
10057
9954
|
return;
|
|
@@ -10077,7 +9974,7 @@ var heldLocks, HELD_LOCKS_ENV = "ABSOLUTE_HELD_BUILD_DIRECTORY_LOCKS", exitHandl
|
|
|
10077
9974
|
releaseAllSync();
|
|
10078
9975
|
throw err;
|
|
10079
9976
|
});
|
|
10080
|
-
}, isAlreadyExistsError = (error) => error instanceof Error && ("code" in error) && error.code === "EEXIST", lockPathForBuildDirectory = (buildDirectory) =>
|
|
9977
|
+
}, isAlreadyExistsError = (error) => error instanceof Error && ("code" in error) && error.code === "EEXIST", lockPathForBuildDirectory = (buildDirectory) => join14(dirname8(buildDirectory), ".absolutejs", "build.lock"), readHeldLockEnv = () => new Set((process.env[HELD_LOCKS_ENV] ?? "").split(`
|
|
10081
9978
|
`).filter((entry) => entry.length > 0)), writeHeldLockEnv = (locks) => {
|
|
10082
9979
|
if (locks.size === 0) {
|
|
10083
9980
|
delete process.env[HELD_LOCKS_ENV];
|
|
@@ -10094,7 +9991,7 @@ var heldLocks, HELD_LOCKS_ENV = "ABSOLUTE_HELD_BUILD_DIRECTORY_LOCKS", exitHandl
|
|
|
10094
9991
|
locks.delete(buildDirectory);
|
|
10095
9992
|
writeHeldLockEnv(locks);
|
|
10096
9993
|
}, writeLockFileSync = (lockPath, metadata) => {
|
|
10097
|
-
mkdirSync6(
|
|
9994
|
+
mkdirSync6(dirname8(lockPath), { recursive: true });
|
|
10098
9995
|
writeFileSync6(lockPath, JSON.stringify(metadata, null, 2), { flag: "wx" });
|
|
10099
9996
|
}, readLockMetadata = (lockPath) => {
|
|
10100
9997
|
try {
|
|
@@ -10214,11 +10111,11 @@ var init_buildDirectoryLock = __esm(() => {
|
|
|
10214
10111
|
});
|
|
10215
10112
|
|
|
10216
10113
|
// src/utils/validateSafePath.ts
|
|
10217
|
-
import { resolve as
|
|
10114
|
+
import { resolve as resolve15, relative as relative7 } from "path";
|
|
10218
10115
|
var validateSafePath = (targetPath, baseDirectory) => {
|
|
10219
|
-
const absoluteBase =
|
|
10220
|
-
const absoluteTarget =
|
|
10221
|
-
const relativePath = normalizePath(
|
|
10116
|
+
const absoluteBase = resolve15(baseDirectory);
|
|
10117
|
+
const absoluteTarget = resolve15(baseDirectory, targetPath);
|
|
10118
|
+
const relativePath = normalizePath(relative7(absoluteBase, absoluteTarget));
|
|
10222
10119
|
if (relativePath.startsWith("../") || relativePath === "..") {
|
|
10223
10120
|
throw new Error(`Unsafe path: ${targetPath}`);
|
|
10224
10121
|
}
|
|
@@ -10366,32 +10263,32 @@ __export(exports_compileSvelte, {
|
|
|
10366
10263
|
clearSvelteCompilerCache: () => clearSvelteCompilerCache
|
|
10367
10264
|
});
|
|
10368
10265
|
import { existsSync as existsSync14 } from "fs";
|
|
10369
|
-
import { mkdir as
|
|
10266
|
+
import { mkdir as mkdir3, stat as stat2 } from "fs/promises";
|
|
10370
10267
|
import {
|
|
10371
|
-
dirname as
|
|
10372
|
-
join as
|
|
10268
|
+
dirname as dirname9,
|
|
10269
|
+
join as join15,
|
|
10373
10270
|
basename as basename4,
|
|
10374
10271
|
extname as extname5,
|
|
10375
|
-
resolve as
|
|
10376
|
-
relative as
|
|
10272
|
+
resolve as resolve16,
|
|
10273
|
+
relative as relative8,
|
|
10377
10274
|
sep as sep2
|
|
10378
10275
|
} from "path";
|
|
10379
10276
|
import { env } from "process";
|
|
10380
|
-
var {write, file, Transpiler
|
|
10277
|
+
var {write, file, Transpiler } = globalThis.Bun;
|
|
10381
10278
|
var resolveDevClientDir2 = () => {
|
|
10382
10279
|
const projectRoot = process.cwd();
|
|
10383
|
-
const fromSource =
|
|
10280
|
+
const fromSource = resolve16(import.meta.dir, "../dev/client");
|
|
10384
10281
|
if (existsSync14(fromSource) && fromSource.startsWith(projectRoot)) {
|
|
10385
10282
|
return fromSource;
|
|
10386
10283
|
}
|
|
10387
|
-
const fromNodeModules =
|
|
10284
|
+
const fromNodeModules = resolve16(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client");
|
|
10388
10285
|
if (existsSync14(fromNodeModules))
|
|
10389
10286
|
return fromNodeModules;
|
|
10390
|
-
return
|
|
10287
|
+
return resolve16(import.meta.dir, "./dev/client");
|
|
10391
10288
|
}, devClientDir2, hmrClientPath3, persistentCache, sourceHashCache, clearSvelteCompilerCache = () => {
|
|
10392
10289
|
persistentCache.clear();
|
|
10393
10290
|
sourceHashCache.clear();
|
|
10394
|
-
},
|
|
10291
|
+
}, transpiler2, removeUnusedRequireHelper = (code) => {
|
|
10395
10292
|
const helperStart = code.indexOf("var __require = /* @__PURE__ */");
|
|
10396
10293
|
if (helperStart === -1) {
|
|
10397
10294
|
return code;
|
|
@@ -10417,7 +10314,7 @@ var resolveDevClientDir2 = () => {
|
|
|
10417
10314
|
}, resolveRelativeModule2 = async (spec, from) => {
|
|
10418
10315
|
if (!spec.startsWith("."))
|
|
10419
10316
|
return null;
|
|
10420
|
-
const basePath =
|
|
10317
|
+
const basePath = resolve16(dirname9(from), spec);
|
|
10421
10318
|
const candidates = [
|
|
10422
10319
|
basePath,
|
|
10423
10320
|
`${basePath}.ts`,
|
|
@@ -10428,14 +10325,14 @@ var resolveDevClientDir2 = () => {
|
|
|
10428
10325
|
`${basePath}.svelte`,
|
|
10429
10326
|
`${basePath}.svelte.ts`,
|
|
10430
10327
|
`${basePath}.svelte.js`,
|
|
10431
|
-
|
|
10432
|
-
|
|
10433
|
-
|
|
10434
|
-
|
|
10435
|
-
|
|
10436
|
-
|
|
10437
|
-
|
|
10438
|
-
|
|
10328
|
+
join15(basePath, "index.ts"),
|
|
10329
|
+
join15(basePath, "index.js"),
|
|
10330
|
+
join15(basePath, "index.mjs"),
|
|
10331
|
+
join15(basePath, "index.cjs"),
|
|
10332
|
+
join15(basePath, "index.json"),
|
|
10333
|
+
join15(basePath, "index.svelte"),
|
|
10334
|
+
join15(basePath, "index.svelte.ts"),
|
|
10335
|
+
join15(basePath, "index.svelte.js")
|
|
10439
10336
|
];
|
|
10440
10337
|
const checks = await Promise.all(candidates.map(exists));
|
|
10441
10338
|
return candidates.find((_2, index) => checks[index]) ?? null;
|
|
@@ -10444,7 +10341,7 @@ var resolveDevClientDir2 = () => {
|
|
|
10444
10341
|
const resolved = resolvePackageImport(spec);
|
|
10445
10342
|
return resolved && /\.svelte(\.(?:ts|js))?$/.test(resolved) ? resolved : null;
|
|
10446
10343
|
}
|
|
10447
|
-
const basePath =
|
|
10344
|
+
const basePath = resolve16(dirname9(from), spec);
|
|
10448
10345
|
const explicit = /\.(svelte|svelte\.(?:ts|js))$/.test(basePath);
|
|
10449
10346
|
if (!explicit) {
|
|
10450
10347
|
const extensions = [".svelte", ".svelte.ts", ".svelte.js"];
|
|
@@ -10465,8 +10362,8 @@ var resolveDevClientDir2 = () => {
|
|
|
10465
10362
|
return jsPath;
|
|
10466
10363
|
return null;
|
|
10467
10364
|
}, addModuleRewrite = (rewrites, rawSpec, resolvedModule, ssrOutputDir, clientOutputDir) => {
|
|
10468
|
-
const toServer =
|
|
10469
|
-
const toClient =
|
|
10365
|
+
const toServer = relative8(ssrOutputDir, resolvedModule).replace(/\\/g, "/");
|
|
10366
|
+
const toClient = relative8(clientOutputDir, resolvedModule).replace(/\\/g, "/");
|
|
10470
10367
|
rewrites.set(rawSpec, {
|
|
10471
10368
|
client: toClient.startsWith(".") || toClient.startsWith("/") ? toClient : `./${toClient}`,
|
|
10472
10369
|
server: toServer.startsWith(".") ? toServer : `./${toServer}`
|
|
@@ -10474,10 +10371,10 @@ var resolveDevClientDir2 = () => {
|
|
|
10474
10371
|
}, compileSvelte = async (entryPoints, svelteRoot, cache = new Map, isDev = false, stylePreprocessors) => {
|
|
10475
10372
|
const { compile, compileModule, preprocess } = await import("svelte/compiler");
|
|
10476
10373
|
const generatedDir = getFrameworkGeneratedDir("svelte");
|
|
10477
|
-
const clientDir =
|
|
10478
|
-
const indexDir =
|
|
10479
|
-
const serverDir =
|
|
10480
|
-
await Promise.all([clientDir, indexDir, serverDir].map((dir) =>
|
|
10374
|
+
const clientDir = join15(generatedDir, "client");
|
|
10375
|
+
const indexDir = join15(generatedDir, "indexes");
|
|
10376
|
+
const serverDir = join15(generatedDir, "server");
|
|
10377
|
+
await Promise.all([clientDir, indexDir, serverDir].map((dir) => mkdir3(dir, { recursive: true })));
|
|
10481
10378
|
const dev = env.NODE_ENV !== "production";
|
|
10482
10379
|
const build = async (src) => {
|
|
10483
10380
|
const memoized = cache.get(src);
|
|
@@ -10502,10 +10399,10 @@ var resolveDevClientDir2 = () => {
|
|
|
10502
10399
|
const svelteStylePreprocessor = createSvelteStylePreprocessor(stylePreprocessors);
|
|
10503
10400
|
const preprocessedServer = isModule ? loweredServerSource.code : (await preprocess(loweredServerSource.code, svelteStylePreprocessor)).code;
|
|
10504
10401
|
const preprocessedClient = isModule ? loweredClientSource.code : (await preprocess(loweredClientSource.code, svelteStylePreprocessor)).code;
|
|
10505
|
-
const transpiledServer = src.endsWith(".ts") || src.endsWith(".svelte.ts") ?
|
|
10506
|
-
const transpiledClient = src.endsWith(".ts") || src.endsWith(".svelte.ts") ?
|
|
10507
|
-
const rawRel =
|
|
10508
|
-
const relDir = rawRel.startsWith("..") ? `_ext/${
|
|
10402
|
+
const transpiledServer = src.endsWith(".ts") || src.endsWith(".svelte.ts") ? transpiler2.transformSync(preprocessedServer) : preprocessedServer;
|
|
10403
|
+
const transpiledClient = src.endsWith(".ts") || src.endsWith(".svelte.ts") ? transpiler2.transformSync(preprocessedClient) : preprocessedClient;
|
|
10404
|
+
const rawRel = dirname9(relative8(svelteRoot, src)).replace(/\\/g, "/");
|
|
10405
|
+
const relDir = rawRel.startsWith("..") ? `_ext/${relative8(process.cwd(), dirname9(src)).replace(/\\/g, "/")}` : rawRel;
|
|
10509
10406
|
const baseName = basename4(src).replace(/\.svelte(\.(ts|js))?$/, "");
|
|
10510
10407
|
const importPaths = Array.from(transpiledServer.matchAll(/from\s+['"]([^'"]+)['"]/g)).map((match) => match[1]).filter((path) => path !== undefined);
|
|
10511
10408
|
const resolvedModuleImports = await Promise.all(importPaths.map((importPath) => resolveRelativeModule2(importPath, src)));
|
|
@@ -10514,8 +10411,8 @@ var resolveDevClientDir2 = () => {
|
|
|
10514
10411
|
const childBuilt = await Promise.all(childSources.map((child) => build(child)));
|
|
10515
10412
|
const hasAwaitSlotFromChildren = childBuilt.some((child) => child.hasAwaitSlot);
|
|
10516
10413
|
const externalRewrites = new Map;
|
|
10517
|
-
const ssrOutputDir =
|
|
10518
|
-
const clientOutputDir =
|
|
10414
|
+
const ssrOutputDir = dirname9(join15(serverDir, relDir, `${baseName}.js`));
|
|
10415
|
+
const clientOutputDir = dirname9(join15(clientDir, relDir, `${baseName}.js`));
|
|
10519
10416
|
for (let idx = 0;idx < importPaths.length; idx++) {
|
|
10520
10417
|
const rawSpec = importPaths[idx];
|
|
10521
10418
|
if (!rawSpec)
|
|
@@ -10526,15 +10423,15 @@ var resolveDevClientDir2 = () => {
|
|
|
10526
10423
|
addModuleRewrite(externalRewrites, rawSpec, resolvedModule, ssrOutputDir, clientOutputDir);
|
|
10527
10424
|
if (!resolved)
|
|
10528
10425
|
continue;
|
|
10529
|
-
const childRel =
|
|
10426
|
+
const childRel = relative8(svelteRoot, resolved).replace(/\\/g, "/");
|
|
10530
10427
|
if (!childRel.startsWith(".."))
|
|
10531
10428
|
continue;
|
|
10532
10429
|
const childBuilt2 = cache.get(resolved);
|
|
10533
10430
|
if (!childBuilt2)
|
|
10534
10431
|
continue;
|
|
10535
10432
|
const origSpec = rawSpec.replace(/\.svelte(?:\.(?:ts|js))?$/, ".js");
|
|
10536
|
-
const toServer =
|
|
10537
|
-
const toClient =
|
|
10433
|
+
const toServer = relative8(ssrOutputDir, childBuilt2.ssr).replace(/\\/g, "/");
|
|
10434
|
+
const toClient = relative8(clientOutputDir, childBuilt2.client).replace(/\\/g, "/");
|
|
10538
10435
|
externalRewrites.set(origSpec, {
|
|
10539
10436
|
client: toClient.startsWith(".") ? toClient : `./${toClient}`,
|
|
10540
10437
|
server: toServer.startsWith(".") ? toServer : `./${toServer}`
|
|
@@ -10568,7 +10465,7 @@ var resolveDevClientDir2 = () => {
|
|
|
10568
10465
|
}).js.code;
|
|
10569
10466
|
let code = compiled.replace(/\.svelte(?:\.(?:ts|js))?(['"])/g, ".js$1");
|
|
10570
10467
|
if (mode === "client" && isDev) {
|
|
10571
|
-
const moduleKey = `/@src/${
|
|
10468
|
+
const moduleKey = `/@src/${relative8(process.cwd(), src).replace(/\\/g, "/")}`;
|
|
10572
10469
|
code = code.replace(/if\s*\(import\.meta\.hot\)\s*\{/, `if (typeof window !== "undefined") {
|
|
10573
10470
|
if (!window.__SVELTE_HMR_ACCEPT__) window.__SVELTE_HMR_ACCEPT__ = {};
|
|
10574
10471
|
var __hmr_accept = function(cb) { window.__SVELTE_HMR_ACCEPT__[${JSON.stringify(moduleKey)}] = cb; };`);
|
|
@@ -10580,11 +10477,11 @@ var resolveDevClientDir2 = () => {
|
|
|
10580
10477
|
code += islandMetadataExports;
|
|
10581
10478
|
return code;
|
|
10582
10479
|
};
|
|
10583
|
-
const ssrPath =
|
|
10584
|
-
const clientPath =
|
|
10480
|
+
const ssrPath = join15(serverDir, relDir, `${baseName}.js`);
|
|
10481
|
+
const clientPath = join15(clientDir, relDir, `${baseName}.js`);
|
|
10585
10482
|
await Promise.all([
|
|
10586
|
-
|
|
10587
|
-
|
|
10483
|
+
mkdir3(dirname9(ssrPath), { recursive: true }),
|
|
10484
|
+
mkdir3(dirname9(clientPath), { recursive: true })
|
|
10588
10485
|
]);
|
|
10589
10486
|
if (isModule) {
|
|
10590
10487
|
const bundle = rewriteExternalImports(generate("client"), "client");
|
|
@@ -10611,10 +10508,10 @@ var resolveDevClientDir2 = () => {
|
|
|
10611
10508
|
};
|
|
10612
10509
|
const roots = await Promise.all(entryPoints.map(build));
|
|
10613
10510
|
await Promise.all(roots.map(async ({ client, hasAwaitSlot }) => {
|
|
10614
|
-
const relClientDir =
|
|
10511
|
+
const relClientDir = dirname9(relative8(clientDir, client));
|
|
10615
10512
|
const name = basename4(client, extname5(client));
|
|
10616
|
-
const indexPath =
|
|
10617
|
-
const importRaw =
|
|
10513
|
+
const indexPath = join15(indexDir, relClientDir, `${name}.js`);
|
|
10514
|
+
const importRaw = relative8(dirname9(indexPath), client).split(sep2).join("/");
|
|
10618
10515
|
const importPath = importRaw.startsWith(".") || importRaw.startsWith("/") ? importRaw : `./${importRaw}`;
|
|
10619
10516
|
const hmrImports = isDev ? `window.__HMR_FRAMEWORK__ = "svelte";
|
|
10620
10517
|
import "${hmrClientPath3}";
|
|
@@ -10685,14 +10582,14 @@ if (typeof window !== "undefined") {
|
|
|
10685
10582
|
setTimeout(releaseStreamingSlots, 0);
|
|
10686
10583
|
}
|
|
10687
10584
|
}`;
|
|
10688
|
-
await
|
|
10585
|
+
await mkdir3(dirname9(indexPath), { recursive: true });
|
|
10689
10586
|
return write(indexPath, bootstrap);
|
|
10690
10587
|
}));
|
|
10691
10588
|
return {
|
|
10692
10589
|
svelteClientPaths: roots.map(({ client }) => client),
|
|
10693
10590
|
svelteIndexPaths: roots.map(({ client }) => {
|
|
10694
|
-
const rel =
|
|
10695
|
-
return
|
|
10591
|
+
const rel = dirname9(relative8(clientDir, client));
|
|
10592
|
+
return join15(indexDir, rel, basename4(client));
|
|
10696
10593
|
}),
|
|
10697
10594
|
svelteServerPaths: roots.map(({ ssr }) => ssr)
|
|
10698
10595
|
};
|
|
@@ -10707,10 +10604,10 @@ var init_compileSvelte = __esm(() => {
|
|
|
10707
10604
|
init_lowerAwaitSlotSyntax();
|
|
10708
10605
|
init_renderToReadableStream();
|
|
10709
10606
|
devClientDir2 = resolveDevClientDir2();
|
|
10710
|
-
hmrClientPath3 =
|
|
10607
|
+
hmrClientPath3 = join15(devClientDir2, "hmrClient.ts").replace(/\\/g, "/");
|
|
10711
10608
|
persistentCache = new Map;
|
|
10712
10609
|
sourceHashCache = new Map;
|
|
10713
|
-
|
|
10610
|
+
transpiler2 = new Transpiler({ loader: "ts", target: "browser" });
|
|
10714
10611
|
});
|
|
10715
10612
|
|
|
10716
10613
|
// src/build/vueAutoRouterTransform.ts
|
|
@@ -10774,27 +10671,27 @@ __export(exports_compileVue, {
|
|
|
10774
10671
|
clearVueHmrCaches: () => clearVueHmrCaches
|
|
10775
10672
|
});
|
|
10776
10673
|
import { existsSync as existsSync15 } from "fs";
|
|
10777
|
-
import { mkdir as
|
|
10674
|
+
import { mkdir as mkdir4 } from "fs/promises";
|
|
10778
10675
|
import {
|
|
10779
10676
|
basename as basename5,
|
|
10780
|
-
dirname as
|
|
10677
|
+
dirname as dirname10,
|
|
10781
10678
|
isAbsolute as isAbsolute3,
|
|
10782
|
-
join as
|
|
10783
|
-
relative as
|
|
10784
|
-
resolve as
|
|
10679
|
+
join as join16,
|
|
10680
|
+
relative as relative9,
|
|
10681
|
+
resolve as resolve17
|
|
10785
10682
|
} from "path";
|
|
10786
|
-
var {file: file2, write: write2, Transpiler:
|
|
10683
|
+
var {file: file2, write: write2, Transpiler: Transpiler2 } = globalThis.Bun;
|
|
10787
10684
|
var resolveDevClientDir3 = () => {
|
|
10788
10685
|
const projectRoot = process.cwd();
|
|
10789
|
-
const fromSource =
|
|
10686
|
+
const fromSource = resolve17(import.meta.dir, "../dev/client");
|
|
10790
10687
|
if (existsSync15(fromSource) && fromSource.startsWith(projectRoot)) {
|
|
10791
10688
|
return fromSource;
|
|
10792
10689
|
}
|
|
10793
|
-
const fromNodeModules =
|
|
10690
|
+
const fromNodeModules = resolve17(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client");
|
|
10794
10691
|
if (existsSync15(fromNodeModules))
|
|
10795
10692
|
return fromNodeModules;
|
|
10796
|
-
return
|
|
10797
|
-
}, devClientDir3, hmrClientPath4,
|
|
10693
|
+
return resolve17(import.meta.dir, "./dev/client");
|
|
10694
|
+
}, devClientDir3, hmrClientPath4, transpiler3, scriptCache, scriptSetupCache, templateCache, styleCache, persistentBuildCache, vueSourceHashCache, vueHmrMetadata, clearVueHmrCaches = () => {
|
|
10798
10695
|
scriptCache.clear();
|
|
10799
10696
|
scriptSetupCache.clear();
|
|
10800
10697
|
templateCache.clear();
|
|
@@ -10832,19 +10729,19 @@ var resolveDevClientDir3 = () => {
|
|
|
10832
10729
|
return "template-only";
|
|
10833
10730
|
}
|
|
10834
10731
|
return "full";
|
|
10835
|
-
}, generateVueHmrId = (sourceFilePath, vueRootDir) =>
|
|
10732
|
+
}, generateVueHmrId = (sourceFilePath, vueRootDir) => relative9(vueRootDir, sourceFilePath).replace(/\\/g, "/").replace(/\.vue$/, ""), extractImports = (sourceCode) => Array.from(sourceCode.matchAll(/import\s+[\s\S]+?['"]([^'"]+)['"]/g)).map((match) => match[1]).filter((importPath) => importPath !== undefined), toJs = (filePath, sourceDir) => {
|
|
10836
10733
|
if (filePath.endsWith(".vue"))
|
|
10837
10734
|
return filePath.replace(/\.vue$/, ".js");
|
|
10838
10735
|
if (filePath.endsWith(".ts"))
|
|
10839
10736
|
return filePath.replace(/\.ts$/, ".js");
|
|
10840
10737
|
if (isStylePath(filePath)) {
|
|
10841
10738
|
if (sourceDir && (filePath.startsWith("./") || filePath.startsWith("../"))) {
|
|
10842
|
-
return
|
|
10739
|
+
return resolve17(sourceDir, filePath);
|
|
10843
10740
|
}
|
|
10844
10741
|
return filePath;
|
|
10845
10742
|
}
|
|
10846
10743
|
return `${filePath}.js`;
|
|
10847
|
-
},
|
|
10744
|
+
}, stripExports = (code) => code.replace(/export\s+default/, "const script ="), mergeVueImports = (code) => {
|
|
10848
10745
|
const lines = code.split(`
|
|
10849
10746
|
`);
|
|
10850
10747
|
const specifierSet = new Set;
|
|
@@ -10865,7 +10762,7 @@ var resolveDevClientDir3 = () => {
|
|
|
10865
10762
|
const cachedResult = cacheMap.get(sourceFilePath);
|
|
10866
10763
|
if (cachedResult)
|
|
10867
10764
|
return cachedResult;
|
|
10868
|
-
const relativeFilePath =
|
|
10765
|
+
const relativeFilePath = relative9(vueRootDir, sourceFilePath).replace(/\\/g, "/");
|
|
10869
10766
|
const relativeWithoutExtension = relativeFilePath.replace(/\.vue$/, "");
|
|
10870
10767
|
const fileBaseName = basename5(sourceFilePath, ".vue");
|
|
10871
10768
|
const componentId = toKebab(fileBaseName);
|
|
@@ -10903,12 +10800,12 @@ var resolveDevClientDir3 = () => {
|
|
|
10903
10800
|
const childComponentPaths = importPaths.filter((path) => path.startsWith(".") && path.endsWith(".vue"));
|
|
10904
10801
|
const packageComponentPaths = Array.from(resolvedPackageVueImports.entries());
|
|
10905
10802
|
const helperModulePaths = importPaths.filter((path) => path.startsWith(".") && !path.endsWith(".vue") && !isStylePath(path));
|
|
10906
|
-
const stylePathsImported = importPaths.filter((path) => (path.startsWith(".") || isAbsolute3(path)) && isStylePath(path)).map((path) => isAbsolute3(path) ? path :
|
|
10803
|
+
const stylePathsImported = importPaths.filter((path) => (path.startsWith(".") || isAbsolute3(path)) && isStylePath(path)).map((path) => isAbsolute3(path) ? path : resolve17(dirname10(sourceFilePath), path));
|
|
10907
10804
|
for (const stylePath of stylePathsImported) {
|
|
10908
10805
|
addStyleImporter(sourceFilePath, stylePath);
|
|
10909
10806
|
}
|
|
10910
10807
|
const childBuildResults = await Promise.all([
|
|
10911
|
-
...childComponentPaths.map((relativeChildPath) => compileVueFile(
|
|
10808
|
+
...childComponentPaths.map((relativeChildPath) => compileVueFile(resolve17(dirname10(sourceFilePath), relativeChildPath), outputDirs, cacheMap, false, vueRootDir, compiler, stylePreprocessors)),
|
|
10912
10809
|
...packageComponentPaths.map(([, absolutePath]) => compileVueFile(absolutePath, outputDirs, cacheMap, false, vueRootDir, compiler, stylePreprocessors))
|
|
10913
10810
|
]);
|
|
10914
10811
|
const hasScript = descriptor.script || descriptor.scriptSetup;
|
|
@@ -10916,9 +10813,9 @@ var resolveDevClientDir3 = () => {
|
|
|
10916
10813
|
id: componentId,
|
|
10917
10814
|
inlineTemplate: false
|
|
10918
10815
|
}) : { bindings: {}, content: "export default {};" };
|
|
10919
|
-
const strippedScript =
|
|
10920
|
-
const sourceDir =
|
|
10921
|
-
const transpiledScript =
|
|
10816
|
+
const strippedScript = stripExports(compiledScript.content);
|
|
10817
|
+
const sourceDir = dirname10(sourceFilePath);
|
|
10818
|
+
const transpiledScript = transpiler3.transformSync(strippedScript).replace(/(['"])(\.{1,2}\/[^'"]+)(['"])/g, (_2, quoteStart, relativeImport, quoteEnd) => `${quoteStart}${toJs(relativeImport, sourceDir)}${quoteEnd}`);
|
|
10922
10819
|
const packageImportRewrites = new Map;
|
|
10923
10820
|
for (const [bareImport, absolutePath] of packageComponentPaths) {
|
|
10924
10821
|
const childResult = cacheMap.get(absolutePath);
|
|
@@ -10932,8 +10829,6 @@ var resolveDevClientDir3 = () => {
|
|
|
10932
10829
|
const generateRenderFunction = (ssr) => compiler.compileTemplate({
|
|
10933
10830
|
compilerOptions: {
|
|
10934
10831
|
bindingMetadata: compiledScript.bindings,
|
|
10935
|
-
expressionPlugins: ["typescript"],
|
|
10936
|
-
isCustomElement: (tag) => tag === "absolute-island",
|
|
10937
10832
|
prefixIdentifiers: true
|
|
10938
10833
|
},
|
|
10939
10834
|
filename: sourceFilePath,
|
|
@@ -10956,8 +10851,8 @@ var resolveDevClientDir3 = () => {
|
|
|
10956
10851
|
];
|
|
10957
10852
|
let cssOutputPaths = [];
|
|
10958
10853
|
if (isEntryPoint && allCss.length) {
|
|
10959
|
-
const cssOutputFile =
|
|
10960
|
-
await
|
|
10854
|
+
const cssOutputFile = join16(outputDirs.css, `${toKebab(fileBaseName)}-compiled.css`);
|
|
10855
|
+
await mkdir4(dirname10(cssOutputFile), { recursive: true });
|
|
10961
10856
|
await write2(cssOutputFile, allCss.join(`
|
|
10962
10857
|
`));
|
|
10963
10858
|
cssOutputPaths = [cssOutputFile];
|
|
@@ -10975,7 +10870,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
10975
10870
|
window.__VUE_HMR_COMPONENTS__[script.__hmrId] = script;
|
|
10976
10871
|
}
|
|
10977
10872
|
}` : "";
|
|
10978
|
-
return
|
|
10873
|
+
return mergeVueImports([
|
|
10979
10874
|
transpiledScript,
|
|
10980
10875
|
renderCode,
|
|
10981
10876
|
`script.${renderFnName} = ${renderFnName};`,
|
|
@@ -10987,9 +10882,9 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
10987
10882
|
};
|
|
10988
10883
|
const clientCode = assembleModule(generateRenderFunction(false), "render", true) + islandMetadataExports;
|
|
10989
10884
|
const serverCode = assembleModule(generateRenderFunction(true), "ssrRender", false) + islandMetadataExports;
|
|
10990
|
-
const clientOutputPath =
|
|
10991
|
-
const serverOutputPath =
|
|
10992
|
-
const relDir =
|
|
10885
|
+
const clientOutputPath = join16(outputDirs.client, `${relativeWithoutExtension}.js`);
|
|
10886
|
+
const serverOutputPath = join16(outputDirs.server, `${relativeWithoutExtension}.js`);
|
|
10887
|
+
const relDir = dirname10(relativeFilePath);
|
|
10993
10888
|
const relDepth = relDir === "." ? 0 : relDir.split("/").length;
|
|
10994
10889
|
const adjustImports = (code) => code.replace(/(from\s+['"])(\.\.\/(?:\.\.\/)*)/g, (_2, prefix, dots) => {
|
|
10995
10890
|
const upCount = dots.split("/").length - 1;
|
|
@@ -11001,15 +10896,15 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
11001
10896
|
let result2 = code;
|
|
11002
10897
|
for (const [bareImport, paths] of packageImportRewrites) {
|
|
11003
10898
|
const targetPath = mode === "server" ? paths.server : paths.client;
|
|
11004
|
-
let rel =
|
|
10899
|
+
let rel = relative9(dirname10(outputPath), targetPath).replace(/\\/g, "/");
|
|
11005
10900
|
if (!rel.startsWith("."))
|
|
11006
10901
|
rel = `./${rel}`;
|
|
11007
10902
|
result2 = result2.replaceAll(bareImport, rel);
|
|
11008
10903
|
}
|
|
11009
10904
|
return result2;
|
|
11010
10905
|
};
|
|
11011
|
-
await
|
|
11012
|
-
await
|
|
10906
|
+
await mkdir4(dirname10(clientOutputPath), { recursive: true });
|
|
10907
|
+
await mkdir4(dirname10(serverOutputPath), { recursive: true });
|
|
11013
10908
|
await write2(clientOutputPath, rewritePackageImports(adjustImports(clientCode), clientOutputPath, "client"));
|
|
11014
10909
|
await write2(serverOutputPath, rewritePackageImports(adjustImports(serverCode), serverOutputPath, "server"));
|
|
11015
10910
|
const result = {
|
|
@@ -11019,7 +10914,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
11019
10914
|
hmrId,
|
|
11020
10915
|
serverPath: serverOutputPath,
|
|
11021
10916
|
tsHelperPaths: [
|
|
11022
|
-
...helperModulePaths.map((helper) =>
|
|
10917
|
+
...helperModulePaths.map((helper) => resolve17(dirname10(sourceFilePath), helper.endsWith(".ts") ? helper : `${helper}.ts`)),
|
|
11023
10918
|
...childBuildResults.flatMap((child) => child.tsHelperPaths)
|
|
11024
10919
|
]
|
|
11025
10920
|
};
|
|
@@ -11029,36 +10924,36 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
11029
10924
|
}, compileVue = async (entryPoints, vueRootDir, isDev = false, stylePreprocessors) => {
|
|
11030
10925
|
const compiler = await import("@vue/compiler-sfc");
|
|
11031
10926
|
const generatedDir = getFrameworkGeneratedDir("vue");
|
|
11032
|
-
const clientOutputDir =
|
|
11033
|
-
const indexOutputDir =
|
|
11034
|
-
const serverOutputDir =
|
|
11035
|
-
const cssOutputDir =
|
|
10927
|
+
const clientOutputDir = join16(generatedDir, "client");
|
|
10928
|
+
const indexOutputDir = join16(generatedDir, "indexes");
|
|
10929
|
+
const serverOutputDir = join16(generatedDir, "server");
|
|
10930
|
+
const cssOutputDir = join16(generatedDir, "compiled");
|
|
11036
10931
|
await Promise.all([
|
|
11037
|
-
|
|
11038
|
-
|
|
11039
|
-
|
|
11040
|
-
|
|
10932
|
+
mkdir4(clientOutputDir, { recursive: true }),
|
|
10933
|
+
mkdir4(indexOutputDir, { recursive: true }),
|
|
10934
|
+
mkdir4(serverOutputDir, { recursive: true }),
|
|
10935
|
+
mkdir4(cssOutputDir, { recursive: true })
|
|
11041
10936
|
]);
|
|
11042
10937
|
const buildCache = new Map;
|
|
11043
10938
|
const allTsHelperPaths = new Set;
|
|
11044
10939
|
const compiledPages = await Promise.all(entryPoints.map(async (entryPath) => {
|
|
11045
|
-
const result = await compileVueFile(
|
|
10940
|
+
const result = await compileVueFile(resolve17(entryPath), {
|
|
11046
10941
|
client: clientOutputDir,
|
|
11047
10942
|
css: cssOutputDir,
|
|
11048
10943
|
server: serverOutputDir
|
|
11049
10944
|
}, buildCache, true, vueRootDir, compiler, stylePreprocessors);
|
|
11050
10945
|
result.tsHelperPaths.forEach((path) => allTsHelperPaths.add(path));
|
|
11051
10946
|
const entryBaseName = basename5(entryPath, ".vue");
|
|
11052
|
-
const indexOutputFile =
|
|
11053
|
-
const clientOutputFile =
|
|
11054
|
-
await
|
|
10947
|
+
const indexOutputFile = join16(indexOutputDir, `${entryBaseName}.js`);
|
|
10948
|
+
const clientOutputFile = join16(clientOutputDir, relative9(vueRootDir, entryPath).replace(/\\/g, "/").replace(/\.vue$/, ".js"));
|
|
10949
|
+
await mkdir4(dirname10(indexOutputFile), { recursive: true });
|
|
11055
10950
|
const vueHmrImports = isDev ? [
|
|
11056
10951
|
`window.__HMR_FRAMEWORK__ = "vue";`,
|
|
11057
10952
|
`import "${hmrClientPath4}";`
|
|
11058
10953
|
] : [];
|
|
11059
10954
|
await write2(indexOutputFile, [
|
|
11060
10955
|
...vueHmrImports,
|
|
11061
|
-
`import Comp, * as PageModule from "${
|
|
10956
|
+
`import Comp, * as PageModule from "${relative9(dirname10(indexOutputFile), clientOutputFile).replace(/\\/g, "/")}";`,
|
|
11062
10957
|
'import { createSSRApp, createApp } from "vue";',
|
|
11063
10958
|
"",
|
|
11064
10959
|
"// HMR State Preservation: Check for preserved state from HMR",
|
|
@@ -11201,12 +11096,12 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
11201
11096
|
}));
|
|
11202
11097
|
await Promise.all(Array.from(allTsHelperPaths).map(async (tsPath) => {
|
|
11203
11098
|
const sourceCode = await file2(tsPath).text();
|
|
11204
|
-
const transpiledCode =
|
|
11205
|
-
const relativeJsPath =
|
|
11206
|
-
const outClientPath =
|
|
11207
|
-
const outServerPath =
|
|
11208
|
-
await
|
|
11209
|
-
await
|
|
11099
|
+
const transpiledCode = transpiler3.transformSync(sourceCode);
|
|
11100
|
+
const relativeJsPath = relative9(vueRootDir, tsPath).replace(/\.ts$/, ".js");
|
|
11101
|
+
const outClientPath = join16(clientOutputDir, relativeJsPath);
|
|
11102
|
+
const outServerPath = join16(serverOutputDir, relativeJsPath);
|
|
11103
|
+
await mkdir4(dirname10(outClientPath), { recursive: true });
|
|
11104
|
+
await mkdir4(dirname10(outServerPath), { recursive: true });
|
|
11210
11105
|
await write2(outClientPath, transpiledCode);
|
|
11211
11106
|
await write2(outServerPath, transpiledCode);
|
|
11212
11107
|
}));
|
|
@@ -11226,8 +11121,8 @@ var init_compileVue = __esm(() => {
|
|
|
11226
11121
|
init_vueAutoRouterTransform();
|
|
11227
11122
|
init_stylePreprocessor();
|
|
11228
11123
|
devClientDir3 = resolveDevClientDir3();
|
|
11229
|
-
hmrClientPath4 =
|
|
11230
|
-
|
|
11124
|
+
hmrClientPath4 = join16(devClientDir3, "hmrClient.ts").replace(/\\/g, "/");
|
|
11125
|
+
transpiler3 = new Transpiler2({ loader: "ts", target: "browser" });
|
|
11231
11126
|
scriptCache = new Map;
|
|
11232
11127
|
scriptSetupCache = new Map;
|
|
11233
11128
|
templateCache = new Map;
|
|
@@ -11707,17 +11602,17 @@ __export(exports_compileAngular, {
|
|
|
11707
11602
|
compileAngular: () => compileAngular
|
|
11708
11603
|
});
|
|
11709
11604
|
import { existsSync as existsSync16, readFileSync as readFileSync11, promises as fs } from "fs";
|
|
11710
|
-
import { join as
|
|
11605
|
+
import { join as join17, basename as basename6, sep as sep3, dirname as dirname11, resolve as resolve18, relative as relative10 } from "path";
|
|
11711
11606
|
import ts2 from "typescript";
|
|
11712
11607
|
var traceAngularPhase = async (name, fn2, metadata) => {
|
|
11713
11608
|
const tracePhase = globalThis.__absoluteBuildTracePhase;
|
|
11714
11609
|
return tracePhase ? tracePhase(`compile/angular/${name}`, fn2, metadata) : await fn2();
|
|
11715
11610
|
}, readTsconfigPathAliases = () => {
|
|
11716
11611
|
try {
|
|
11717
|
-
const configPath2 =
|
|
11612
|
+
const configPath2 = resolve18(process.cwd(), "tsconfig.json");
|
|
11718
11613
|
const config = ts2.readConfigFile(configPath2, ts2.sys.readFile).config;
|
|
11719
11614
|
const compilerOptions = config?.compilerOptions ?? {};
|
|
11720
|
-
const baseUrl =
|
|
11615
|
+
const baseUrl = resolve18(process.cwd(), compilerOptions.baseUrl ?? ".");
|
|
11721
11616
|
const aliases = Object.entries(compilerOptions.paths ?? {}).map(([pattern, replacements]) => ({ pattern, replacements }));
|
|
11722
11617
|
return { aliases, baseUrl };
|
|
11723
11618
|
} catch {
|
|
@@ -11737,7 +11632,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
11737
11632
|
const wildcardValue = exactMatch ? "" : specifier.slice(prefix.length, specifier.length - suffix.length);
|
|
11738
11633
|
for (const replacement of alias.replacements) {
|
|
11739
11634
|
const candidate = replacement.replace("*", wildcardValue);
|
|
11740
|
-
const resolved = resolveSourceFile(
|
|
11635
|
+
const resolved = resolveSourceFile(resolve18(baseUrl, candidate));
|
|
11741
11636
|
if (resolved)
|
|
11742
11637
|
return resolved;
|
|
11743
11638
|
}
|
|
@@ -11749,20 +11644,20 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
11749
11644
|
`${candidate}.tsx`,
|
|
11750
11645
|
`${candidate}.js`,
|
|
11751
11646
|
`${candidate}.jsx`,
|
|
11752
|
-
|
|
11753
|
-
|
|
11754
|
-
|
|
11755
|
-
|
|
11647
|
+
join17(candidate, "index.ts"),
|
|
11648
|
+
join17(candidate, "index.tsx"),
|
|
11649
|
+
join17(candidate, "index.js"),
|
|
11650
|
+
join17(candidate, "index.jsx")
|
|
11756
11651
|
];
|
|
11757
11652
|
return candidates.find((file3) => existsSync16(file3));
|
|
11758
11653
|
}, createLegacyAngularAnimationUsageResolver = (rootDir) => {
|
|
11759
|
-
const baseDir =
|
|
11654
|
+
const baseDir = resolve18(rootDir);
|
|
11760
11655
|
const tsconfigAliases = readTsconfigPathAliases();
|
|
11761
|
-
const
|
|
11656
|
+
const transpiler4 = new Bun.Transpiler({ loader: "tsx" });
|
|
11762
11657
|
const scanCache = new Map;
|
|
11763
11658
|
const resolveLocalImport = (specifier, fromDir) => {
|
|
11764
11659
|
if (specifier.startsWith(".") || specifier.startsWith("/")) {
|
|
11765
|
-
return resolveSourceFile(
|
|
11660
|
+
return resolveSourceFile(resolve18(fromDir, specifier));
|
|
11766
11661
|
}
|
|
11767
11662
|
const aliased = matchTsconfigAlias(specifier, tsconfigAliases.aliases, tsconfigAliases.baseUrl, resolveSourceFile);
|
|
11768
11663
|
if (aliased)
|
|
@@ -11771,7 +11666,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
11771
11666
|
const resolved = Bun.resolveSync(specifier, fromDir);
|
|
11772
11667
|
if (resolved.includes("/node_modules/"))
|
|
11773
11668
|
return;
|
|
11774
|
-
const absolute =
|
|
11669
|
+
const absolute = resolve18(resolved);
|
|
11775
11670
|
if (!absolute.startsWith(baseDir))
|
|
11776
11671
|
return;
|
|
11777
11672
|
return resolveSourceFile(absolute);
|
|
@@ -11787,7 +11682,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
11787
11682
|
usesLegacyAnimations: false
|
|
11788
11683
|
});
|
|
11789
11684
|
}
|
|
11790
|
-
const resolved =
|
|
11685
|
+
const resolved = resolve18(actualPath);
|
|
11791
11686
|
const cached = scanCache.get(resolved);
|
|
11792
11687
|
if (cached)
|
|
11793
11688
|
return cached;
|
|
@@ -11800,7 +11695,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
11800
11695
|
}
|
|
11801
11696
|
let imports;
|
|
11802
11697
|
try {
|
|
11803
|
-
imports =
|
|
11698
|
+
imports = transpiler4.scanImports(sourceCode);
|
|
11804
11699
|
} catch {
|
|
11805
11700
|
return { imports: [], usesLegacyAnimations: false };
|
|
11806
11701
|
}
|
|
@@ -11816,7 +11711,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
11816
11711
|
const actualPath = resolveSourceFile(filePath);
|
|
11817
11712
|
if (!actualPath)
|
|
11818
11713
|
return false;
|
|
11819
|
-
const resolved =
|
|
11714
|
+
const resolved = resolve18(actualPath);
|
|
11820
11715
|
if (visited.has(resolved))
|
|
11821
11716
|
return false;
|
|
11822
11717
|
visited.add(resolved);
|
|
@@ -11824,7 +11719,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
11824
11719
|
if (scan.usesLegacyAnimations)
|
|
11825
11720
|
return true;
|
|
11826
11721
|
for (const specifier of scan.imports) {
|
|
11827
|
-
const importedPath = resolveLocalImport(specifier,
|
|
11722
|
+
const importedPath = resolveLocalImport(specifier, dirname11(resolved));
|
|
11828
11723
|
if (importedPath && await visit(importedPath, visited)) {
|
|
11829
11724
|
return true;
|
|
11830
11725
|
}
|
|
@@ -11834,14 +11729,14 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
11834
11729
|
return (entryPath) => visit(entryPath);
|
|
11835
11730
|
}, resolveDevClientDir4 = () => {
|
|
11836
11731
|
const projectRoot = process.cwd();
|
|
11837
|
-
const fromSource =
|
|
11732
|
+
const fromSource = resolve18(import.meta.dir, "../dev/client");
|
|
11838
11733
|
if (existsSync16(fromSource) && fromSource.startsWith(projectRoot)) {
|
|
11839
11734
|
return fromSource;
|
|
11840
11735
|
}
|
|
11841
|
-
const fromNodeModules =
|
|
11736
|
+
const fromNodeModules = resolve18(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client");
|
|
11842
11737
|
if (existsSync16(fromNodeModules))
|
|
11843
11738
|
return fromNodeModules;
|
|
11844
|
-
return
|
|
11739
|
+
return resolve18(import.meta.dir, "./dev/client");
|
|
11845
11740
|
}, devClientDir4, hmrClientPath5, formatDiagnosticMessage = (diagnostic) => {
|
|
11846
11741
|
try {
|
|
11847
11742
|
return ts2.flattenDiagnosticMessageText(diagnostic.messageText, `
|
|
@@ -11883,12 +11778,12 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
11883
11778
|
return `${path.replace(/\.ts$/, ".js")}${query}`;
|
|
11884
11779
|
if (hasJsLikeExtension(path))
|
|
11885
11780
|
return `${path}${query}`;
|
|
11886
|
-
const importerDir =
|
|
11887
|
-
const fileCandidate =
|
|
11781
|
+
const importerDir = dirname11(importerOutputPath);
|
|
11782
|
+
const fileCandidate = resolve18(importerDir, `${path}.js`);
|
|
11888
11783
|
if (outputFiles?.has(fileCandidate) || existsSync16(fileCandidate)) {
|
|
11889
11784
|
return `${path}.js${query}`;
|
|
11890
11785
|
}
|
|
11891
|
-
const indexCandidate =
|
|
11786
|
+
const indexCandidate = resolve18(importerDir, path, "index.js");
|
|
11892
11787
|
if (outputFiles?.has(indexCandidate) || existsSync16(indexCandidate)) {
|
|
11893
11788
|
return `${path}/index.js${query}`;
|
|
11894
11789
|
}
|
|
@@ -11916,18 +11811,18 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
11916
11811
|
}, resolveLocalTsImport = (fromFile, specifier) => {
|
|
11917
11812
|
if (!isRelativeModuleSpecifier(specifier))
|
|
11918
11813
|
return null;
|
|
11919
|
-
const basePath =
|
|
11814
|
+
const basePath = resolve18(dirname11(fromFile), specifier);
|
|
11920
11815
|
const candidates = /\.[cm]?[tj]sx?$/.test(basePath) ? [basePath] : [
|
|
11921
11816
|
`${basePath}.ts`,
|
|
11922
11817
|
`${basePath}.tsx`,
|
|
11923
11818
|
`${basePath}.mts`,
|
|
11924
11819
|
`${basePath}.cts`,
|
|
11925
|
-
|
|
11926
|
-
|
|
11927
|
-
|
|
11928
|
-
|
|
11820
|
+
join17(basePath, "index.ts"),
|
|
11821
|
+
join17(basePath, "index.tsx"),
|
|
11822
|
+
join17(basePath, "index.mts"),
|
|
11823
|
+
join17(basePath, "index.cts")
|
|
11929
11824
|
];
|
|
11930
|
-
return candidates.map((candidate) =>
|
|
11825
|
+
return candidates.map((candidate) => resolve18(candidate)).find((candidate) => existsSync16(candidate) && !candidate.endsWith(".d.ts")) ?? null;
|
|
11931
11826
|
}, readFileForAotTransform = async (fileName, readFile6) => {
|
|
11932
11827
|
const hostSource = readFile6?.(fileName);
|
|
11933
11828
|
if (typeof hostSource === "string")
|
|
@@ -11951,18 +11846,18 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
11951
11846
|
const paths = [];
|
|
11952
11847
|
const templateUrlMatch = findUncommentedMatch(source, /templateUrl\s*:\s*['"]([^'"]+)['"]/);
|
|
11953
11848
|
if (templateUrlMatch?.[1])
|
|
11954
|
-
paths.push(
|
|
11849
|
+
paths.push(join17(fileDir, templateUrlMatch[1]));
|
|
11955
11850
|
const styleUrlMatch = findUncommentedMatch(source, /styleUrl\s*:\s*['"]([^'"]+)['"]/);
|
|
11956
11851
|
if (styleUrlMatch?.[1])
|
|
11957
|
-
paths.push(
|
|
11852
|
+
paths.push(join17(fileDir, styleUrlMatch[1]));
|
|
11958
11853
|
const styleUrlsMatch = findUncommentedMatch(source, /styleUrls\s*:\s*\[([^\]]+)\]/);
|
|
11959
11854
|
const urlMatches = styleUrlsMatch?.[1]?.match(/['"]([^'"]+)['"]/g);
|
|
11960
11855
|
if (urlMatches) {
|
|
11961
11856
|
for (const urlMatch of urlMatches) {
|
|
11962
|
-
paths.push(
|
|
11857
|
+
paths.push(join17(fileDir, urlMatch.replace(/['"]/g, "")));
|
|
11963
11858
|
}
|
|
11964
11859
|
}
|
|
11965
|
-
return paths.map((path) =>
|
|
11860
|
+
return paths.map((path) => resolve18(path));
|
|
11966
11861
|
}, readResourceCacheFile = async (cachePath) => {
|
|
11967
11862
|
try {
|
|
11968
11863
|
const entry = JSON.parse(await fs.readFile(cachePath, "utf-8"));
|
|
@@ -11974,13 +11869,13 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
11974
11869
|
return null;
|
|
11975
11870
|
}
|
|
11976
11871
|
}, writeResourceCacheFile = async (cachePath, source) => {
|
|
11977
|
-
await fs.mkdir(
|
|
11872
|
+
await fs.mkdir(dirname11(cachePath), { recursive: true });
|
|
11978
11873
|
await fs.writeFile(cachePath, JSON.stringify({
|
|
11979
11874
|
source,
|
|
11980
11875
|
version: 1
|
|
11981
11876
|
}), "utf-8");
|
|
11982
11877
|
}, resolveResourceTransformCachePath = async (filePath, source, stylePreprocessors) => {
|
|
11983
|
-
const resourcePaths = collectAngularResourcePaths(source,
|
|
11878
|
+
const resourcePaths = collectAngularResourcePaths(source, dirname11(filePath));
|
|
11984
11879
|
const resourceContents = await Promise.all(resourcePaths.map(async (resourcePath) => {
|
|
11985
11880
|
const content = await fs.readFile(resourcePath, "utf-8");
|
|
11986
11881
|
return `${resourcePath}\x00${content}`;
|
|
@@ -11993,7 +11888,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
11993
11888
|
safeStableStringify(stylePreprocessors ?? null)
|
|
11994
11889
|
].join("\x00");
|
|
11995
11890
|
const cacheKey2 = Bun.hash(cacheInput).toString(BASE_36_RADIX);
|
|
11996
|
-
return
|
|
11891
|
+
return join17(process.cwd(), ".absolutejs", "cache", "angular-resources", `${cacheKey2}.json`);
|
|
11997
11892
|
}, precomputeAotResourceTransforms = async (inputPaths, readFile6, stylePreprocessors) => {
|
|
11998
11893
|
const transformedSources = new Map;
|
|
11999
11894
|
const visited = new Set;
|
|
@@ -12004,7 +11899,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
12004
11899
|
transformedFiles: 0
|
|
12005
11900
|
};
|
|
12006
11901
|
const transformFile = async (filePath) => {
|
|
12007
|
-
const resolvedPath =
|
|
11902
|
+
const resolvedPath = resolve18(filePath);
|
|
12008
11903
|
if (visited.has(resolvedPath))
|
|
12009
11904
|
return;
|
|
12010
11905
|
visited.add(resolvedPath);
|
|
@@ -12020,7 +11915,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
12020
11915
|
transformedSource = cached.source;
|
|
12021
11916
|
} else {
|
|
12022
11917
|
stats.cacheMisses += 1;
|
|
12023
|
-
const transformed = await inlineResources(source,
|
|
11918
|
+
const transformed = await inlineResources(source, dirname11(resolvedPath), stylePreprocessors);
|
|
12024
11919
|
transformedSource = transformed.source;
|
|
12025
11920
|
await writeResourceCacheFile(cachePath, transformedSource);
|
|
12026
11921
|
}
|
|
@@ -12039,7 +11934,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
12039
11934
|
return { stats, transformedSources };
|
|
12040
11935
|
}, compileAngularFiles = async (inputPaths, outDir, stylePreprocessors) => {
|
|
12041
11936
|
const islandMetadataByOutputPath = await traceAngularPhase("aot/island-metadata", () => new Map(inputPaths.map((inputPath) => {
|
|
12042
|
-
const outputPath =
|
|
11937
|
+
const outputPath = resolve18(join17(outDir, relative10(process.cwd(), resolve18(inputPath)).replace(/\.[cm]?[tj]sx?$/, ".js")));
|
|
12043
11938
|
return [
|
|
12044
11939
|
outputPath,
|
|
12045
11940
|
buildIslandMetadataExports(readFileSync11(inputPath, "utf-8"))
|
|
@@ -12049,8 +11944,8 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
12049
11944
|
const { readConfiguration, performCompilation, EmitFlags } = await traceAngularPhase("aot/import-compiler-cli", () => import("@angular/compiler-cli"));
|
|
12050
11945
|
const tsLibDir = await traceAngularPhase("aot/resolve-typescript-lib", () => {
|
|
12051
11946
|
const tsPath = __require.resolve("typescript");
|
|
12052
|
-
const tsRootDir =
|
|
12053
|
-
return tsRootDir.endsWith("lib") ? tsRootDir :
|
|
11947
|
+
const tsRootDir = dirname11(tsPath);
|
|
11948
|
+
return tsRootDir.endsWith("lib") ? tsRootDir : resolve18(tsRootDir, "lib");
|
|
12054
11949
|
});
|
|
12055
11950
|
const config = await traceAngularPhase("aot/read-configuration", () => readConfiguration("./tsconfig.json"));
|
|
12056
11951
|
const options = {
|
|
@@ -12086,13 +11981,13 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
12086
11981
|
const originalGetSourceFile = host.getSourceFile;
|
|
12087
11982
|
host.getSourceFile = (fileName, languageVersion, onError) => {
|
|
12088
11983
|
if (fileName.startsWith("lib.") && fileName.endsWith(".d.ts") && tsLibDir) {
|
|
12089
|
-
const resolvedPath =
|
|
11984
|
+
const resolvedPath = join17(tsLibDir, fileName);
|
|
12090
11985
|
return originalGetSourceFile?.call(host, resolvedPath, languageVersion, onError);
|
|
12091
11986
|
}
|
|
12092
11987
|
return originalGetSourceFile?.call(host, fileName, languageVersion, onError);
|
|
12093
11988
|
};
|
|
12094
11989
|
const emitted = {};
|
|
12095
|
-
const resolvedOutDir =
|
|
11990
|
+
const resolvedOutDir = resolve18(outDir);
|
|
12096
11991
|
host.writeFile = (fileName, text) => {
|
|
12097
11992
|
const relativePath = resolveRelativePath(fileName, resolvedOutDir, outDir);
|
|
12098
11993
|
emitted[relativePath] = text;
|
|
@@ -12114,12 +12009,12 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
12114
12009
|
if (!fileName.endsWith(".ts") || fileName.endsWith(".d.ts")) {
|
|
12115
12010
|
return source;
|
|
12116
12011
|
}
|
|
12117
|
-
const resolvedPath =
|
|
12012
|
+
const resolvedPath = resolve18(fileName);
|
|
12118
12013
|
return transformedSources.get(resolvedPath) ?? source;
|
|
12119
12014
|
};
|
|
12120
12015
|
const originalGetSourceFileForCompile = host.getSourceFile;
|
|
12121
12016
|
host.getSourceFile = (fileName, languageVersion, onError) => {
|
|
12122
|
-
const source = transformedSources.get(
|
|
12017
|
+
const source = transformedSources.get(resolve18(fileName));
|
|
12123
12018
|
if (source) {
|
|
12124
12019
|
return ts2.createSourceFile(fileName, source, languageVersion, true);
|
|
12125
12020
|
}
|
|
@@ -12141,9 +12036,9 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
12141
12036
|
const entries = await traceAngularPhase("aot/postprocess-emitted-js", () => {
|
|
12142
12037
|
const rawEntries = Object.entries(emitted).filter(([fileName]) => fileName.endsWith(".js")).map(([fileName, content]) => ({
|
|
12143
12038
|
content,
|
|
12144
|
-
target:
|
|
12039
|
+
target: join17(outDir, fileName)
|
|
12145
12040
|
}));
|
|
12146
|
-
const outputFiles = new Set(rawEntries.map(({ target }) =>
|
|
12041
|
+
const outputFiles = new Set(rawEntries.map(({ target }) => resolve18(target)));
|
|
12147
12042
|
return rawEntries.map(({ content, target }) => {
|
|
12148
12043
|
let processedContent = content.replace(/from\s+(['"])(\.\.?\/[^'"]+)(\1)/g, (match, quote, path) => {
|
|
12149
12044
|
const rewritten = rewriteRelativeJsSpecifier(target, path, outputFiles);
|
|
@@ -12158,12 +12053,12 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
12158
12053
|
return cleaned ? `import { ${cleaned}, InternalInjectFlags } from '@angular/core'` : `import { InternalInjectFlags } from '@angular/core'`;
|
|
12159
12054
|
});
|
|
12160
12055
|
processedContent = processedContent.replace(/\b(?<!Internal)InjectFlags\b/g, "InternalInjectFlags");
|
|
12161
|
-
processedContent += islandMetadataByOutputPath.get(
|
|
12056
|
+
processedContent += islandMetadataByOutputPath.get(resolve18(target)) ?? "";
|
|
12162
12057
|
return { content: processedContent, target };
|
|
12163
12058
|
});
|
|
12164
12059
|
});
|
|
12165
12060
|
await traceAngularPhase("aot/write-output", () => Promise.all(entries.map(async ({ target, content }) => {
|
|
12166
|
-
await fs.mkdir(
|
|
12061
|
+
await fs.mkdir(dirname11(target), { recursive: true });
|
|
12167
12062
|
await fs.writeFile(target, content, "utf-8");
|
|
12168
12063
|
})), { outputs: entries.length });
|
|
12169
12064
|
return await traceAngularPhase("aot/collect-output-paths", () => entries.map(({ target }) => target), { outputs: entries.length });
|
|
@@ -12179,7 +12074,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
12179
12074
|
}
|
|
12180
12075
|
return null;
|
|
12181
12076
|
}, resolveAngularDeferImportSpecifier = () => {
|
|
12182
|
-
const sourceEntry =
|
|
12077
|
+
const sourceEntry = resolve18(import.meta.dir, "../angular/components/index.ts");
|
|
12183
12078
|
if (existsSync16(sourceEntry)) {
|
|
12184
12079
|
return sourceEntry.replace(/\\/g, "/");
|
|
12185
12080
|
}
|
|
@@ -12316,7 +12211,7 @@ ${fields}
|
|
|
12316
12211
|
}, inlineTemplateAndLowerDefer = async (source, fileDir) => {
|
|
12317
12212
|
const templateUrlMatch = findUncommentedMatch(source, /templateUrl\s*:\s*['"]([^'"]+)['"]/);
|
|
12318
12213
|
if (templateUrlMatch?.[1]) {
|
|
12319
|
-
const templatePath =
|
|
12214
|
+
const templatePath = join17(fileDir, templateUrlMatch[1]);
|
|
12320
12215
|
if (!existsSync16(templatePath)) {
|
|
12321
12216
|
throw new Error(`Unable to inline Angular templateUrl "${templateUrlMatch[1]}": file not found at ${templatePath}`);
|
|
12322
12217
|
}
|
|
@@ -12347,7 +12242,7 @@ ${fields}
|
|
|
12347
12242
|
}, inlineTemplateAndLowerDeferSync = (source, fileDir) => {
|
|
12348
12243
|
const templateUrlMatch = findUncommentedMatch(source, /templateUrl\s*:\s*['"]([^'"]+)['"]/);
|
|
12349
12244
|
if (templateUrlMatch?.[1]) {
|
|
12350
|
-
const templatePath =
|
|
12245
|
+
const templatePath = join17(fileDir, templateUrlMatch[1]);
|
|
12351
12246
|
if (!existsSync16(templatePath)) {
|
|
12352
12247
|
throw new Error(`Unable to inline Angular templateUrl "${templateUrlMatch[1]}": file not found at ${templatePath}`);
|
|
12353
12248
|
}
|
|
@@ -12384,7 +12279,7 @@ ${fields}
|
|
|
12384
12279
|
return source;
|
|
12385
12280
|
const stylePromises = urlMatches.map((urlMatch) => {
|
|
12386
12281
|
const styleUrl = urlMatch.replace(/['"]/g, "");
|
|
12387
|
-
return readAndEscapeFile(
|
|
12282
|
+
return readAndEscapeFile(join17(fileDir, styleUrl), stylePreprocessors);
|
|
12388
12283
|
});
|
|
12389
12284
|
const results = await Promise.all(stylePromises);
|
|
12390
12285
|
const inlinedStyles = results.filter(Boolean).map((escaped) => `\`${escaped}\``);
|
|
@@ -12395,7 +12290,7 @@ ${fields}
|
|
|
12395
12290
|
const styleUrlMatch = findUncommentedMatch(source, /styleUrl\s*:\s*['"]([^'"]+)['"]/);
|
|
12396
12291
|
if (!styleUrlMatch?.[1])
|
|
12397
12292
|
return source;
|
|
12398
|
-
const escaped = await readAndEscapeFile(
|
|
12293
|
+
const escaped = await readAndEscapeFile(join17(fileDir, styleUrlMatch[1]), stylePreprocessors);
|
|
12399
12294
|
if (!escaped)
|
|
12400
12295
|
return source;
|
|
12401
12296
|
return source.slice(0, styleUrlMatch.index) + `styles: [\`${escaped}\`]` + source.slice(styleUrlMatch.index + styleUrlMatch[0].length);
|
|
@@ -12409,10 +12304,10 @@ ${fields}
|
|
|
12409
12304
|
source: result
|
|
12410
12305
|
};
|
|
12411
12306
|
}, compileAngularFileJIT = async (inputPath, outDir, rootDir, stylePreprocessors, cacheBuster) => {
|
|
12412
|
-
const entryPath =
|
|
12307
|
+
const entryPath = resolve18(inputPath);
|
|
12413
12308
|
const allOutputs = [];
|
|
12414
12309
|
const visited = new Set;
|
|
12415
|
-
const baseDir =
|
|
12310
|
+
const baseDir = resolve18(rootDir ?? process.cwd());
|
|
12416
12311
|
let usesLegacyAnimations = false;
|
|
12417
12312
|
const angularTranspiler = new Bun.Transpiler({
|
|
12418
12313
|
loader: "ts",
|
|
@@ -12430,16 +12325,16 @@ ${fields}
|
|
|
12430
12325
|
`${candidate}.tsx`,
|
|
12431
12326
|
`${candidate}.js`,
|
|
12432
12327
|
`${candidate}.jsx`,
|
|
12433
|
-
|
|
12434
|
-
|
|
12435
|
-
|
|
12436
|
-
|
|
12328
|
+
join17(candidate, "index.ts"),
|
|
12329
|
+
join17(candidate, "index.tsx"),
|
|
12330
|
+
join17(candidate, "index.js"),
|
|
12331
|
+
join17(candidate, "index.jsx")
|
|
12437
12332
|
];
|
|
12438
12333
|
return candidates.find((file3) => existsSync16(file3));
|
|
12439
12334
|
};
|
|
12440
12335
|
const resolveLocalImport = (specifier, fromDir) => {
|
|
12441
12336
|
if (specifier.startsWith(".") || specifier.startsWith("/")) {
|
|
12442
|
-
return resolveSourceFile2(
|
|
12337
|
+
return resolveSourceFile2(resolve18(fromDir, specifier));
|
|
12443
12338
|
}
|
|
12444
12339
|
const aliased = matchTsconfigAlias(specifier, tsconfigAliases.aliases, tsconfigAliases.baseUrl, resolveSourceFile2);
|
|
12445
12340
|
if (aliased)
|
|
@@ -12448,7 +12343,7 @@ ${fields}
|
|
|
12448
12343
|
const resolved = Bun.resolveSync(specifier, fromDir);
|
|
12449
12344
|
if (resolved.includes("/node_modules/"))
|
|
12450
12345
|
return;
|
|
12451
|
-
const absolute =
|
|
12346
|
+
const absolute = resolve18(resolved);
|
|
12452
12347
|
if (!absolute.startsWith(baseDir))
|
|
12453
12348
|
return;
|
|
12454
12349
|
return resolveSourceFile2(absolute);
|
|
@@ -12457,10 +12352,10 @@ ${fields}
|
|
|
12457
12352
|
}
|
|
12458
12353
|
};
|
|
12459
12354
|
const toOutputPath = (sourcePath) => {
|
|
12460
|
-
const inputDir =
|
|
12355
|
+
const inputDir = dirname11(sourcePath);
|
|
12461
12356
|
const relativeDir = inputDir.startsWith(baseDir) ? inputDir.substring(baseDir.length + 1) : inputDir;
|
|
12462
12357
|
const fileBase = basename6(sourcePath).replace(/\.[cm]?[tj]sx?$/, ".js");
|
|
12463
|
-
return
|
|
12358
|
+
return join17(outDir, relativeDir, fileBase);
|
|
12464
12359
|
};
|
|
12465
12360
|
const withCacheBuster = (specifier) => {
|
|
12466
12361
|
if (!cacheBuster)
|
|
@@ -12497,13 +12392,13 @@ ${fields}
|
|
|
12497
12392
|
return `${prefix}${dots}`;
|
|
12498
12393
|
return `${prefix}../${dots}`;
|
|
12499
12394
|
});
|
|
12500
|
-
if (
|
|
12395
|
+
if (resolve18(actualPath) === entryPath) {
|
|
12501
12396
|
processedContent += buildIslandMetadataExports(sourceCode);
|
|
12502
12397
|
}
|
|
12503
12398
|
return processedContent;
|
|
12504
12399
|
};
|
|
12505
12400
|
const transpileFile = async (filePath) => {
|
|
12506
|
-
const resolved =
|
|
12401
|
+
const resolved = resolve18(filePath);
|
|
12507
12402
|
if (visited.has(resolved))
|
|
12508
12403
|
return;
|
|
12509
12404
|
visited.add(resolved);
|
|
@@ -12513,12 +12408,12 @@ ${fields}
|
|
|
12513
12408
|
if (!existsSync16(actualPath))
|
|
12514
12409
|
return;
|
|
12515
12410
|
let sourceCode = await fs.readFile(actualPath, "utf-8");
|
|
12516
|
-
const inlined = await inlineResources(sourceCode,
|
|
12517
|
-
sourceCode = inlineTemplateAndLowerDeferSync(inlined.source,
|
|
12518
|
-
const inputDir =
|
|
12411
|
+
const inlined = await inlineResources(sourceCode, dirname11(actualPath), stylePreprocessors);
|
|
12412
|
+
sourceCode = inlineTemplateAndLowerDeferSync(inlined.source, dirname11(actualPath)).source;
|
|
12413
|
+
const inputDir = dirname11(actualPath);
|
|
12519
12414
|
const relativeDir = inputDir.startsWith(baseDir) ? inputDir.substring(baseDir.length + 1) : inputDir;
|
|
12520
12415
|
const fileBase = basename6(actualPath).replace(/\.[cm]?[tj]sx?$/, ".js");
|
|
12521
|
-
const targetDir =
|
|
12416
|
+
const targetDir = join17(outDir, relativeDir);
|
|
12522
12417
|
const targetPath = toOutputPath(actualPath);
|
|
12523
12418
|
const localImports = [];
|
|
12524
12419
|
const importRewrites = new Map;
|
|
@@ -12540,12 +12435,12 @@ ${fields}
|
|
|
12540
12435
|
const resolved2 = resolveLocalImport(specifier, inputDir);
|
|
12541
12436
|
if (!resolved2)
|
|
12542
12437
|
return null;
|
|
12543
|
-
const relativeImport =
|
|
12438
|
+
const relativeImport = relative10(targetDir, toOutputPath(resolved2)).replace(/\\/g, "/").replace(/\.js$/, "");
|
|
12544
12439
|
const relativeRewrite = relativeImport.startsWith(".") ? relativeImport : `./${relativeImport}`;
|
|
12545
12440
|
importRewrites.set(specifier, relativeRewrite);
|
|
12546
12441
|
return resolved2;
|
|
12547
12442
|
}).filter((path) => Boolean(path));
|
|
12548
|
-
const isEntry =
|
|
12443
|
+
const isEntry = resolve18(actualPath) === resolve18(entryPath);
|
|
12549
12444
|
const contentHash = Bun.hash(sourceCode).toString(BASE_36_RADIX);
|
|
12550
12445
|
const cacheKey2 = actualPath;
|
|
12551
12446
|
const shouldWriteFile = cacheBuster && isEntry ? true : jitContentCache.get(cacheKey2) !== contentHash || !existsSync16(targetPath);
|
|
@@ -12579,13 +12474,13 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
12579
12474
|
return { clientPaths: [...emptyPaths], serverPaths: [...emptyPaths] };
|
|
12580
12475
|
}
|
|
12581
12476
|
const compiledRoot = compiledParent;
|
|
12582
|
-
const indexesDir =
|
|
12477
|
+
const indexesDir = join17(compiledParent, "indexes");
|
|
12583
12478
|
await traceAngularPhase("setup/create-indexes-dir", () => fs.mkdir(indexesDir, { recursive: true }));
|
|
12584
|
-
const aotOutputs = hmr ? [] : await traceAngularPhase("aot/compile-files", () => compileAngularFiles(entryPoints.map((entry) =>
|
|
12479
|
+
const aotOutputs = hmr ? [] : await traceAngularPhase("aot/compile-files", () => compileAngularFiles(entryPoints.map((entry) => resolve18(entry)), compiledRoot, stylePreprocessors), { entries: entryPoints.length });
|
|
12585
12480
|
const usesLegacyAngularAnimations = await traceAngularPhase("setup/legacy-animation-resolver", () => createLegacyAngularAnimationUsageResolver(outRoot));
|
|
12586
12481
|
const compileTasks = entryPoints.map(async (entry) => {
|
|
12587
|
-
const resolvedEntry =
|
|
12588
|
-
const relativeEntry =
|
|
12482
|
+
const resolvedEntry = resolve18(entry);
|
|
12483
|
+
const relativeEntry = relative10(outRoot, resolvedEntry).replace(/\.[tj]s$/, ".js");
|
|
12589
12484
|
const compileEntry = () => compileAngularFileJIT(resolvedEntry, compiledRoot, outRoot, stylePreprocessors);
|
|
12590
12485
|
let outputs = hmr ? await traceAngularPhase("jit/compile-entry", compileEntry, {
|
|
12591
12486
|
entry: resolvedEntry
|
|
@@ -12593,13 +12488,13 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
12593
12488
|
const fileBase = basename6(resolvedEntry).replace(/\.[tj]s$/, "");
|
|
12594
12489
|
const jsName = `${fileBase}.js`;
|
|
12595
12490
|
const compiledFallbackPaths = [
|
|
12596
|
-
|
|
12597
|
-
|
|
12598
|
-
|
|
12599
|
-
].map((file3) =>
|
|
12491
|
+
join17(compiledRoot, relativeEntry),
|
|
12492
|
+
join17(compiledRoot, "pages", jsName),
|
|
12493
|
+
join17(compiledRoot, jsName)
|
|
12494
|
+
].map((file3) => resolve18(file3));
|
|
12600
12495
|
const resolveRawServerFile = (candidatePaths) => {
|
|
12601
12496
|
const normalizedCandidates = [
|
|
12602
|
-
...candidatePaths.map((file3) =>
|
|
12497
|
+
...candidatePaths.map((file3) => resolve18(file3)),
|
|
12603
12498
|
...compiledFallbackPaths
|
|
12604
12499
|
];
|
|
12605
12500
|
let candidate = normalizedCandidates.find((file3) => existsSync16(file3) && file3.endsWith(`${sep3}pages${sep3}${jsName}`));
|
|
@@ -12640,7 +12535,7 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
12640
12535
|
const usesLegacyAnimations = await traceAngularPhase("wrapper/detect-legacy-animations", () => usesLegacyAngularAnimations(resolvedEntry), { entry: resolvedEntry });
|
|
12641
12536
|
const serverContentHash = Bun.hash(original).toString(BASE_36_RADIX);
|
|
12642
12537
|
const cachedWrapper = wrapperOutputCache.get(resolvedEntry);
|
|
12643
|
-
const clientFile =
|
|
12538
|
+
const clientFile = join17(indexesDir, jsName);
|
|
12644
12539
|
if (hmr && cachedWrapper && cachedWrapper.serverHash === serverContentHash && existsSync16(clientFile) && (usesLegacyAnimations || !original.includes("__ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__")) && (!usesLegacyAnimations || original.includes("__ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__"))) {
|
|
12645
12540
|
return {
|
|
12646
12541
|
clientPath: clientFile,
|
|
@@ -12667,7 +12562,7 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
12667
12562
|
`;
|
|
12668
12563
|
}
|
|
12669
12564
|
await traceAngularPhase("wrapper/write-server-output", () => fs.writeFile(rawServerFile, rewritten, "utf-8"), { entry: resolvedEntry });
|
|
12670
|
-
const relativePath =
|
|
12565
|
+
const relativePath = relative10(indexesDir, rawServerFile).replace(/\\/g, "/");
|
|
12671
12566
|
const normalizedImportPath = relativePath.startsWith(".") ? relativePath : `./${relativePath}`;
|
|
12672
12567
|
const hmrPreamble = hmr ? `window.__HMR_FRAMEWORK__ = "angular";
|
|
12673
12568
|
import "${hmrClientPath5}";
|
|
@@ -12871,14 +12766,14 @@ var init_compileAngular = __esm(() => {
|
|
|
12871
12766
|
init_stylePreprocessor();
|
|
12872
12767
|
init_generatedDir();
|
|
12873
12768
|
devClientDir4 = resolveDevClientDir4();
|
|
12874
|
-
hmrClientPath5 =
|
|
12769
|
+
hmrClientPath5 = join17(devClientDir4, "hmrClient.ts").replace(/\\/g, "/");
|
|
12875
12770
|
jitContentCache = new Map;
|
|
12876
12771
|
wrapperOutputCache = new Map;
|
|
12877
12772
|
});
|
|
12878
12773
|
|
|
12879
12774
|
// node_modules/content-tag/pkg/node/content_tag.cjs
|
|
12880
12775
|
var require_content_tag = __commonJS((exports, module) => {
|
|
12881
|
-
var __dirname = "/
|
|
12776
|
+
var __dirname = "/tmp/absolutejs-clean/node_modules/content-tag/pkg/node";
|
|
12882
12777
|
var imports = {};
|
|
12883
12778
|
imports["__wbindgen_placeholder__"] = exports;
|
|
12884
12779
|
var wasm;
|
|
@@ -13316,7 +13211,7 @@ __export(exports_compileEmber, {
|
|
|
13316
13211
|
getEmberServerCompiledDir: () => getEmberServerCompiledDir,
|
|
13317
13212
|
getEmberCompiledRoot: () => getEmberCompiledRoot,
|
|
13318
13213
|
getEmberClientCompiledDir: () => getEmberClientCompiledDir,
|
|
13319
|
-
dirname: () =>
|
|
13214
|
+
dirname: () => dirname12,
|
|
13320
13215
|
compileEmberFileSource: () => compileEmberFileSource,
|
|
13321
13216
|
compileEmberFile: () => compileEmberFile,
|
|
13322
13217
|
compileEmber: () => compileEmber,
|
|
@@ -13324,16 +13219,16 @@ __export(exports_compileEmber, {
|
|
|
13324
13219
|
basename: () => basename7
|
|
13325
13220
|
});
|
|
13326
13221
|
import { existsSync as existsSync17 } from "fs";
|
|
13327
|
-
import { mkdir as
|
|
13328
|
-
import { basename as basename7, dirname as
|
|
13329
|
-
var {build: bunBuild2, Transpiler:
|
|
13222
|
+
import { mkdir as mkdir5, rm as rm4 } from "fs/promises";
|
|
13223
|
+
import { basename as basename7, dirname as dirname12, extname as extname6, join as join18, resolve as resolve19 } from "path";
|
|
13224
|
+
var {build: bunBuild2, Transpiler: Transpiler3, write: write3, file: file3 } = globalThis.Bun;
|
|
13330
13225
|
var cachedPreprocessor = null, getPreprocessor = async () => {
|
|
13331
13226
|
if (cachedPreprocessor)
|
|
13332
13227
|
return cachedPreprocessor;
|
|
13333
13228
|
const module = await Promise.resolve().then(() => __toESM(require_node(), 1));
|
|
13334
13229
|
cachedPreprocessor = new module.Preprocessor;
|
|
13335
13230
|
return cachedPreprocessor;
|
|
13336
|
-
},
|
|
13231
|
+
}, transpiler4, isTemplateTagFile = (entry) => {
|
|
13337
13232
|
const ext = extname6(entry);
|
|
13338
13233
|
return ext === ".gjs" || ext === ".gts";
|
|
13339
13234
|
}, rewriteTemplateEvalToScope = (source) => {
|
|
@@ -13421,7 +13316,7 @@ export const importSync = (specifier) => {
|
|
|
13421
13316
|
const originalImporter = stagedSourceMap.get(args.importer);
|
|
13422
13317
|
if (!originalImporter)
|
|
13423
13318
|
return;
|
|
13424
|
-
const candidateBase =
|
|
13319
|
+
const candidateBase = resolve19(dirname12(originalImporter), args.path);
|
|
13425
13320
|
const extensionsToTry = ["", ".gts", ".gjs", ".ts", ".js"];
|
|
13426
13321
|
for (const ext of extensionsToTry) {
|
|
13427
13322
|
const candidate = candidateBase + ext;
|
|
@@ -13438,13 +13333,13 @@ export const importSync = (specifier) => {
|
|
|
13438
13333
|
filename: args.path
|
|
13439
13334
|
});
|
|
13440
13335
|
const rewritten = rewriteTemplateEvalToScope(result.code);
|
|
13441
|
-
const transpiled =
|
|
13336
|
+
const transpiled = transpiler4.transformSync(rewritten);
|
|
13442
13337
|
return { contents: transpiled, loader: "js" };
|
|
13443
13338
|
});
|
|
13444
13339
|
build.onResolve({ filter: /^@(?:ember|glimmer|simple-dom)\// }, (args) => {
|
|
13445
13340
|
if (standalonePackages.has(args.path))
|
|
13446
13341
|
return;
|
|
13447
|
-
const internal =
|
|
13342
|
+
const internal = join18(cwd, "node_modules/ember-source/dist/packages", args.path, "index.js");
|
|
13448
13343
|
if (existsSync17(internal))
|
|
13449
13344
|
return { path: internal };
|
|
13450
13345
|
return;
|
|
@@ -13480,7 +13375,7 @@ export const renderToHTML = (props = {}) => {
|
|
|
13480
13375
|
export { PageComponent };
|
|
13481
13376
|
export default PageComponent;
|
|
13482
13377
|
`, compileEmberFile = async (entry, compiledRoot, cwd = process.cwd()) => {
|
|
13483
|
-
const resolvedEntry =
|
|
13378
|
+
const resolvedEntry = resolve19(entry);
|
|
13484
13379
|
const source = await file3(resolvedEntry).text();
|
|
13485
13380
|
let preprocessed = source;
|
|
13486
13381
|
if (isTemplateTagFile(resolvedEntry)) {
|
|
@@ -13490,18 +13385,18 @@ export default PageComponent;
|
|
|
13490
13385
|
});
|
|
13491
13386
|
preprocessed = rewriteTemplateEvalToScope(result.code);
|
|
13492
13387
|
}
|
|
13493
|
-
const transpiled =
|
|
13388
|
+
const transpiled = transpiler4.transformSync(preprocessed);
|
|
13494
13389
|
const baseName = basename7(resolvedEntry).replace(/\.(gjs|gts|ts|js)$/, "");
|
|
13495
|
-
const tmpDir =
|
|
13496
|
-
const serverDir =
|
|
13497
|
-
const clientDir =
|
|
13390
|
+
const tmpDir = join18(compiledRoot, "_tmp");
|
|
13391
|
+
const serverDir = join18(compiledRoot, "server");
|
|
13392
|
+
const clientDir = join18(compiledRoot, "client");
|
|
13498
13393
|
await Promise.all([
|
|
13499
|
-
|
|
13500
|
-
|
|
13501
|
-
|
|
13394
|
+
mkdir5(tmpDir, { recursive: true }),
|
|
13395
|
+
mkdir5(serverDir, { recursive: true }),
|
|
13396
|
+
mkdir5(clientDir, { recursive: true })
|
|
13502
13397
|
]);
|
|
13503
|
-
const tmpPagePath =
|
|
13504
|
-
const tmpHarnessPath =
|
|
13398
|
+
const tmpPagePath = resolve19(join18(tmpDir, `${baseName}.module.js`));
|
|
13399
|
+
const tmpHarnessPath = resolve19(join18(tmpDir, `${baseName}.harness.js`));
|
|
13505
13400
|
await Promise.all([
|
|
13506
13401
|
write3(tmpPagePath, transpiled),
|
|
13507
13402
|
write3(tmpHarnessPath, generateServerHarness(tmpPagePath))
|
|
@@ -13509,7 +13404,7 @@ export default PageComponent;
|
|
|
13509
13404
|
const stagedSourceMap = new Map([
|
|
13510
13405
|
[tmpPagePath, resolvedEntry]
|
|
13511
13406
|
]);
|
|
13512
|
-
const serverPath =
|
|
13407
|
+
const serverPath = join18(serverDir, `${baseName}.js`);
|
|
13513
13408
|
const buildResult = await bunBuild2({
|
|
13514
13409
|
entrypoints: [tmpHarnessPath],
|
|
13515
13410
|
format: "esm",
|
|
@@ -13526,7 +13421,7 @@ export default PageComponent;
|
|
|
13526
13421
|
console.warn(`\u26A0\uFE0F Ember server build for ${baseName} had errors:`, buildResult.logs);
|
|
13527
13422
|
}
|
|
13528
13423
|
await rm4(tmpDir, { force: true, recursive: true });
|
|
13529
|
-
const clientPath =
|
|
13424
|
+
const clientPath = join18(clientDir, `${baseName}.js`);
|
|
13530
13425
|
await write3(clientPath, transpiled);
|
|
13531
13426
|
return { clientPath, serverPath };
|
|
13532
13427
|
}, compileEmber = async (entries, emberDir, cwd = process.cwd(), _hmr = false) => {
|
|
@@ -13543,7 +13438,7 @@ export default PageComponent;
|
|
|
13543
13438
|
serverPaths: outputs.map((o) => o.serverPath)
|
|
13544
13439
|
};
|
|
13545
13440
|
}, compileEmberFileSource = async (entry) => {
|
|
13546
|
-
const resolvedEntry =
|
|
13441
|
+
const resolvedEntry = resolve19(entry);
|
|
13547
13442
|
const source = await file3(resolvedEntry).text();
|
|
13548
13443
|
let preprocessed = source;
|
|
13549
13444
|
if (isTemplateTagFile(resolvedEntry)) {
|
|
@@ -13553,11 +13448,11 @@ export default PageComponent;
|
|
|
13553
13448
|
});
|
|
13554
13449
|
preprocessed = rewriteTemplateEvalToScope(result.code);
|
|
13555
13450
|
}
|
|
13556
|
-
return
|
|
13557
|
-
}, clearEmberCompilerCache = () => {}, getEmberCompiledRoot = (_emberDir) => getFrameworkGeneratedDir("ember"), getEmberServerCompiledDir = (emberDir) =>
|
|
13451
|
+
return transpiler4.transformSync(preprocessed);
|
|
13452
|
+
}, clearEmberCompilerCache = () => {}, getEmberCompiledRoot = (_emberDir) => getFrameworkGeneratedDir("ember"), getEmberServerCompiledDir = (emberDir) => join18(getEmberCompiledRoot(emberDir), "server"), getEmberClientCompiledDir = (emberDir) => join18(getEmberCompiledRoot(emberDir), "client");
|
|
13558
13453
|
var init_compileEmber = __esm(() => {
|
|
13559
13454
|
init_generatedDir();
|
|
13560
|
-
|
|
13455
|
+
transpiler4 = new Transpiler3({
|
|
13561
13456
|
loader: "ts",
|
|
13562
13457
|
target: "browser",
|
|
13563
13458
|
tsconfig: JSON.stringify({
|
|
@@ -13576,24 +13471,24 @@ __export(exports_buildReactVendor, {
|
|
|
13576
13471
|
buildReactVendor: () => buildReactVendor
|
|
13577
13472
|
});
|
|
13578
13473
|
import { existsSync as existsSync18, mkdirSync as mkdirSync7 } from "fs";
|
|
13579
|
-
import { join as
|
|
13474
|
+
import { join as join19, resolve as resolve20 } from "path";
|
|
13580
13475
|
import { rm as rm5 } from "fs/promises";
|
|
13581
13476
|
var {build: bunBuild3 } = globalThis.Bun;
|
|
13582
13477
|
var resolveJsxDevRuntimeCompatPath = () => {
|
|
13583
13478
|
const candidates = [
|
|
13584
|
-
|
|
13585
|
-
|
|
13586
|
-
|
|
13587
|
-
|
|
13588
|
-
|
|
13589
|
-
|
|
13479
|
+
resolve20(import.meta.dir, "react", "jsxDevRuntimeCompat.js"),
|
|
13480
|
+
resolve20(import.meta.dir, "src", "react", "jsxDevRuntimeCompat.ts"),
|
|
13481
|
+
resolve20(import.meta.dir, "..", "react", "jsxDevRuntimeCompat.js"),
|
|
13482
|
+
resolve20(import.meta.dir, "..", "src", "react", "jsxDevRuntimeCompat.ts"),
|
|
13483
|
+
resolve20(import.meta.dir, "..", "..", "dist", "react", "jsxDevRuntimeCompat.js"),
|
|
13484
|
+
resolve20(import.meta.dir, "..", "..", "src", "react", "jsxDevRuntimeCompat.ts")
|
|
13590
13485
|
];
|
|
13591
13486
|
for (const candidate of candidates) {
|
|
13592
13487
|
if (existsSync18(candidate)) {
|
|
13593
13488
|
return candidate.replace(/\\/g, "/");
|
|
13594
13489
|
}
|
|
13595
13490
|
}
|
|
13596
|
-
return (candidates[0] ??
|
|
13491
|
+
return (candidates[0] ?? resolve20(import.meta.dir, "react", "jsxDevRuntimeCompat.js")).replace(/\\/g, "/");
|
|
13597
13492
|
}, jsxDevRuntimeCompatPath, reactSpecifiers, isResolvable = (specifier) => {
|
|
13598
13493
|
try {
|
|
13599
13494
|
Bun.resolveSync(specifier, process.cwd());
|
|
@@ -13630,14 +13525,14 @@ var resolveJsxDevRuntimeCompatPath = () => {
|
|
|
13630
13525
|
`)}
|
|
13631
13526
|
`;
|
|
13632
13527
|
}, buildReactVendor = async (buildDir) => {
|
|
13633
|
-
const vendorDir =
|
|
13528
|
+
const vendorDir = join19(buildDir, "react", "vendor");
|
|
13634
13529
|
mkdirSync7(vendorDir, { recursive: true });
|
|
13635
|
-
const tmpDir =
|
|
13530
|
+
const tmpDir = join19(buildDir, "_vendor_tmp");
|
|
13636
13531
|
mkdirSync7(tmpDir, { recursive: true });
|
|
13637
13532
|
const specifiers = resolveVendorSpecifiers();
|
|
13638
13533
|
const entrypoints = await Promise.all(specifiers.map(async (specifier) => {
|
|
13639
13534
|
const safeName = toSafeFileName(specifier);
|
|
13640
|
-
const entryPath =
|
|
13535
|
+
const entryPath = join19(tmpDir, `${safeName}.ts`);
|
|
13641
13536
|
const source = await generateEntrySource(specifier);
|
|
13642
13537
|
await Bun.write(entryPath, source);
|
|
13643
13538
|
return entryPath;
|
|
@@ -13702,7 +13597,7 @@ __export(exports_buildAngularVendor, {
|
|
|
13702
13597
|
buildAngularServerVendor: () => buildAngularServerVendor
|
|
13703
13598
|
});
|
|
13704
13599
|
import { mkdirSync as mkdirSync8 } from "fs";
|
|
13705
|
-
import { join as
|
|
13600
|
+
import { join as join20 } from "path";
|
|
13706
13601
|
import { rm as rm6 } from "fs/promises";
|
|
13707
13602
|
var {build: bunBuild4, Glob: Glob6 } = globalThis.Bun;
|
|
13708
13603
|
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, isResolvable2 = (specifier) => {
|
|
@@ -13715,7 +13610,7 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
|
|
|
13715
13610
|
}, isBareSpecifier = (spec) => !spec.startsWith(".") && !spec.startsWith("/") && !spec.startsWith("@src/"), isAngularBrowserSpecifier = (spec) => spec.startsWith("@angular/") && !SERVER_ONLY_ANGULAR_SPECIFIERS.has(spec) && !isBuildOnlyAngularSpecifier(spec), scanSourceImports = async (directories) => {
|
|
13716
13611
|
const angular = new Set;
|
|
13717
13612
|
const transitiveRoots = new Set;
|
|
13718
|
-
const
|
|
13613
|
+
const transpiler5 = new Bun.Transpiler({ loader: "tsx" });
|
|
13719
13614
|
const glob = new Glob6("**/*.{ts,tsx,js,jsx}");
|
|
13720
13615
|
for (const dir of directories) {
|
|
13721
13616
|
try {
|
|
@@ -13726,7 +13621,7 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
|
|
|
13726
13621
|
continue;
|
|
13727
13622
|
try {
|
|
13728
13623
|
const content = await Bun.file(file4).text();
|
|
13729
|
-
for (const imp of
|
|
13624
|
+
for (const imp of transpiler5.scanImports(content)) {
|
|
13730
13625
|
if (isAngularBrowserSpecifier(imp.path)) {
|
|
13731
13626
|
angular.add(imp.path);
|
|
13732
13627
|
} else if (isBareSpecifier(imp.path)) {
|
|
@@ -13740,7 +13635,7 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
|
|
|
13740
13635
|
return { angular, transitiveRoots };
|
|
13741
13636
|
}, PARTIAL_DECL_MARKERS, containsPartialDeclarations = (source) => PARTIAL_DECL_MARKERS.some((marker) => source.includes(marker)), collectTransitiveAngularSpecs = async (roots, angularFound) => {
|
|
13742
13637
|
const { readFileSync: readFileSync12 } = await import("fs");
|
|
13743
|
-
const
|
|
13638
|
+
const transpiler5 = new Bun.Transpiler({ loader: "js" });
|
|
13744
13639
|
const visited = new Set;
|
|
13745
13640
|
const frontier = [];
|
|
13746
13641
|
for (const r of roots)
|
|
@@ -13769,7 +13664,7 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
|
|
|
13769
13664
|
}
|
|
13770
13665
|
let imports;
|
|
13771
13666
|
try {
|
|
13772
|
-
imports =
|
|
13667
|
+
imports = transpiler5.scanImports(content);
|
|
13773
13668
|
} catch {
|
|
13774
13669
|
continue;
|
|
13775
13670
|
}
|
|
@@ -13799,14 +13694,14 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
|
|
|
13799
13694
|
await collectTransitiveAngularSpecs([...angular, ...transitiveRoots], angular);
|
|
13800
13695
|
return Array.from(angular).filter(isResolvable2);
|
|
13801
13696
|
}, buildAngularVendor = async (buildDir, directories = [], linkerJitMode = false, depVendorSpecifiers = []) => {
|
|
13802
|
-
const vendorDir =
|
|
13697
|
+
const vendorDir = join20(buildDir, "angular", "vendor");
|
|
13803
13698
|
mkdirSync8(vendorDir, { recursive: true });
|
|
13804
|
-
const tmpDir =
|
|
13699
|
+
const tmpDir = join20(buildDir, "_angular_vendor_tmp");
|
|
13805
13700
|
mkdirSync8(tmpDir, { recursive: true });
|
|
13806
13701
|
const specifiers = await resolveAngularSpecifiers(directories, linkerJitMode);
|
|
13807
13702
|
const entrypoints = await Promise.all(specifiers.map(async (specifier) => {
|
|
13808
13703
|
const safeName = toSafeFileName2(specifier);
|
|
13809
|
-
const entryPath =
|
|
13704
|
+
const entryPath = join20(tmpDir, `${safeName}.ts`);
|
|
13810
13705
|
await Bun.write(entryPath, await generateVendorEntrySource(specifier));
|
|
13811
13706
|
return entryPath;
|
|
13812
13707
|
}));
|
|
@@ -13837,9 +13732,9 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
|
|
|
13837
13732
|
const specifiers = await resolveAngularSpecifiers(directories, linkerJitMode);
|
|
13838
13733
|
return computeAngularVendorPaths(specifiers);
|
|
13839
13734
|
}, buildAngularServerVendor = async (buildDir, directories = [], linkerJitMode = false) => {
|
|
13840
|
-
const vendorDir =
|
|
13735
|
+
const vendorDir = join20(buildDir, "angular", "vendor", "server");
|
|
13841
13736
|
mkdirSync8(vendorDir, { recursive: true });
|
|
13842
|
-
const tmpDir =
|
|
13737
|
+
const tmpDir = join20(buildDir, "_angular_server_vendor_tmp");
|
|
13843
13738
|
mkdirSync8(tmpDir, { recursive: true });
|
|
13844
13739
|
const browserSpecs = await resolveAngularSpecifiers(directories, linkerJitMode);
|
|
13845
13740
|
const allSpecs = new Set(browserSpecs);
|
|
@@ -13850,7 +13745,7 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
|
|
|
13850
13745
|
const specifiers = Array.from(allSpecs);
|
|
13851
13746
|
const entrypoints = await Promise.all(specifiers.map(async (specifier) => {
|
|
13852
13747
|
const safeName = toSafeFileName2(specifier);
|
|
13853
|
-
const entryPath =
|
|
13748
|
+
const entryPath = join20(tmpDir, `${safeName}.ts`);
|
|
13854
13749
|
await Bun.write(entryPath, await generateVendorEntrySource(specifier));
|
|
13855
13750
|
return entryPath;
|
|
13856
13751
|
}));
|
|
@@ -13872,9 +13767,9 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
|
|
|
13872
13767
|
return specifiers;
|
|
13873
13768
|
}, computeAngularServerVendorPaths = (buildDir, specifiers) => {
|
|
13874
13769
|
const paths = {};
|
|
13875
|
-
const vendorDir =
|
|
13770
|
+
const vendorDir = join20(buildDir, "angular", "vendor", "server");
|
|
13876
13771
|
for (const specifier of specifiers) {
|
|
13877
|
-
paths[specifier] =
|
|
13772
|
+
paths[specifier] = join20(vendorDir, `${toSafeFileName2(specifier)}.js`);
|
|
13878
13773
|
}
|
|
13879
13774
|
return paths;
|
|
13880
13775
|
}, computeAngularServerVendorPathsAsync = async (buildDir, directories = [], linkerJitMode = true) => {
|
|
@@ -13930,17 +13825,17 @@ __export(exports_buildVueVendor, {
|
|
|
13930
13825
|
buildVueVendor: () => buildVueVendor
|
|
13931
13826
|
});
|
|
13932
13827
|
import { mkdirSync as mkdirSync9 } from "fs";
|
|
13933
|
-
import { join as
|
|
13828
|
+
import { join as join21 } from "path";
|
|
13934
13829
|
import { rm as rm7 } from "fs/promises";
|
|
13935
13830
|
var {build: bunBuild5 } = globalThis.Bun;
|
|
13936
13831
|
var vueSpecifiers, toSafeFileName3 = (specifier) => specifier.replace(/\//g, "_"), buildVueVendor = async (buildDir) => {
|
|
13937
|
-
const vendorDir =
|
|
13832
|
+
const vendorDir = join21(buildDir, "vue", "vendor");
|
|
13938
13833
|
mkdirSync9(vendorDir, { recursive: true });
|
|
13939
|
-
const tmpDir =
|
|
13834
|
+
const tmpDir = join21(buildDir, "_vue_vendor_tmp");
|
|
13940
13835
|
mkdirSync9(tmpDir, { recursive: true });
|
|
13941
13836
|
const entrypoints = await Promise.all(vueSpecifiers.map(async (specifier) => {
|
|
13942
13837
|
const safeName = toSafeFileName3(specifier);
|
|
13943
|
-
const entryPath =
|
|
13838
|
+
const entryPath = join21(tmpDir, `${safeName}.ts`);
|
|
13944
13839
|
await Bun.write(entryPath, `export * from '${specifier}';
|
|
13945
13840
|
`);
|
|
13946
13841
|
return entryPath;
|
|
@@ -13968,7 +13863,7 @@ var vueSpecifiers, toSafeFileName3 = (specifier) => specifier.replace(/\//g, "_"
|
|
|
13968
13863
|
const { readFileSync: readFileSync12, writeFileSync: writeFileSync7, readdirSync } = await import("fs");
|
|
13969
13864
|
const files = readdirSync(vendorDir).filter((f2) => f2.endsWith(".js"));
|
|
13970
13865
|
for (const file4 of files) {
|
|
13971
|
-
const filePath =
|
|
13866
|
+
const filePath = join21(vendorDir, file4);
|
|
13972
13867
|
const content = readFileSync12(filePath, "utf-8");
|
|
13973
13868
|
if (!content.includes("__VUE_HMR_RUNTIME__"))
|
|
13974
13869
|
continue;
|
|
@@ -13995,7 +13890,7 @@ __export(exports_buildSvelteVendor, {
|
|
|
13995
13890
|
buildSvelteVendor: () => buildSvelteVendor
|
|
13996
13891
|
});
|
|
13997
13892
|
import { mkdirSync as mkdirSync10 } from "fs";
|
|
13998
|
-
import { join as
|
|
13893
|
+
import { join as join22 } from "path";
|
|
13999
13894
|
import { rm as rm8 } from "fs/promises";
|
|
14000
13895
|
var {build: bunBuild6 } = globalThis.Bun;
|
|
14001
13896
|
var svelteSpecifiers, isResolvable3 = (specifier) => {
|
|
@@ -14009,13 +13904,13 @@ var svelteSpecifiers, isResolvable3 = (specifier) => {
|
|
|
14009
13904
|
const specifiers = resolveVendorSpecifiers2();
|
|
14010
13905
|
if (specifiers.length === 0)
|
|
14011
13906
|
return;
|
|
14012
|
-
const vendorDir =
|
|
13907
|
+
const vendorDir = join22(buildDir, "svelte", "vendor");
|
|
14013
13908
|
mkdirSync10(vendorDir, { recursive: true });
|
|
14014
|
-
const tmpDir =
|
|
13909
|
+
const tmpDir = join22(buildDir, "_svelte_vendor_tmp");
|
|
14015
13910
|
mkdirSync10(tmpDir, { recursive: true });
|
|
14016
13911
|
const entrypoints = await Promise.all(specifiers.map(async (specifier) => {
|
|
14017
13912
|
const safeName = toSafeFileName4(specifier);
|
|
14018
|
-
const entryPath =
|
|
13913
|
+
const entryPath = join22(tmpDir, `${safeName}.ts`);
|
|
14019
13914
|
await Bun.write(entryPath, `export * from '${specifier}';
|
|
14020
13915
|
`);
|
|
14021
13916
|
return entryPath;
|
|
@@ -14065,7 +13960,7 @@ __export(exports_rewriteImportsPlugin, {
|
|
|
14065
13960
|
buildWithImportRewrite: () => buildWithImportRewrite
|
|
14066
13961
|
});
|
|
14067
13962
|
import { readdir as readdir3 } from "fs/promises";
|
|
14068
|
-
import { join as
|
|
13963
|
+
import { join as join23 } from "path";
|
|
14069
13964
|
var escapeRegex2 = (str) => str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), jsRewriteImports = (content, replacements) => {
|
|
14070
13965
|
let result = content;
|
|
14071
13966
|
for (const [specifier, webPath] of replacements) {
|
|
@@ -14194,7 +14089,7 @@ ${content}`;
|
|
|
14194
14089
|
const entries = await readdir3(dir);
|
|
14195
14090
|
for (const entry of entries) {
|
|
14196
14091
|
if (entry.endsWith(".js"))
|
|
14197
|
-
allFiles.push(
|
|
14092
|
+
allFiles.push(join23(dir, entry));
|
|
14198
14093
|
}
|
|
14199
14094
|
} catch {}
|
|
14200
14095
|
}
|
|
@@ -14243,7 +14138,7 @@ import {
|
|
|
14243
14138
|
statSync,
|
|
14244
14139
|
writeFileSync as writeFileSync7
|
|
14245
14140
|
} from "fs";
|
|
14246
|
-
import { basename as basename8, dirname as
|
|
14141
|
+
import { basename as basename8, dirname as dirname13, extname as extname7, join as join24, relative as relative11, resolve as resolve21 } from "path";
|
|
14247
14142
|
import { cwd, env as env2, exit } from "process";
|
|
14248
14143
|
var {build: bunBuild7, Glob: Glob7 } = globalThis.Bun;
|
|
14249
14144
|
var isDev, isBuildTraceEnabled = () => {
|
|
@@ -14321,8 +14216,8 @@ var isDev, isBuildTraceEnabled = () => {
|
|
|
14321
14216
|
mkdirSync11(htmxDestDir, { recursive: true });
|
|
14322
14217
|
const glob = new Glob7("htmx*.min.js");
|
|
14323
14218
|
for (const relPath of glob.scanSync({ cwd: htmxDir })) {
|
|
14324
|
-
const src =
|
|
14325
|
-
const dest =
|
|
14219
|
+
const src = join24(htmxDir, relPath);
|
|
14220
|
+
const dest = join24(htmxDestDir, "htmx.min.js");
|
|
14326
14221
|
copyFileSync(src, dest);
|
|
14327
14222
|
return;
|
|
14328
14223
|
}
|
|
@@ -14334,8 +14229,8 @@ var isDev, isBuildTraceEnabled = () => {
|
|
|
14334
14229
|
}
|
|
14335
14230
|
}, resolveAbsoluteVersion = async () => {
|
|
14336
14231
|
const candidates = [
|
|
14337
|
-
|
|
14338
|
-
|
|
14232
|
+
resolve21(import.meta.dir, "..", "..", "package.json"),
|
|
14233
|
+
resolve21(import.meta.dir, "..", "package.json")
|
|
14339
14234
|
];
|
|
14340
14235
|
const resolveCandidate = async (remaining) => {
|
|
14341
14236
|
const [candidate, ...rest] = remaining;
|
|
@@ -14351,7 +14246,7 @@ var isDev, isBuildTraceEnabled = () => {
|
|
|
14351
14246
|
};
|
|
14352
14247
|
await resolveCandidate(candidates);
|
|
14353
14248
|
}, SKIP_DIRS, addWorkerPathIfExists = (file4, relPath, workerPaths) => {
|
|
14354
|
-
const absPath =
|
|
14249
|
+
const absPath = resolve21(file4, "..", relPath);
|
|
14355
14250
|
try {
|
|
14356
14251
|
statSync(absPath);
|
|
14357
14252
|
workerPaths.add(absPath);
|
|
@@ -14397,7 +14292,7 @@ var isDev, isBuildTraceEnabled = () => {
|
|
|
14397
14292
|
vuePagesPath
|
|
14398
14293
|
}) => {
|
|
14399
14294
|
const { readdirSync: readDir } = await import("fs");
|
|
14400
|
-
const devIndexDir =
|
|
14295
|
+
const devIndexDir = join24(buildPath, "_src_indexes");
|
|
14401
14296
|
mkdirSync11(devIndexDir, { recursive: true });
|
|
14402
14297
|
if (reactIndexesPath && reactPagesPath) {
|
|
14403
14298
|
copyReactDevIndexes(reactIndexesPath, reactPagesPath, devIndexDir, readDir);
|
|
@@ -14413,37 +14308,37 @@ var isDev, isBuildTraceEnabled = () => {
|
|
|
14413
14308
|
return;
|
|
14414
14309
|
}
|
|
14415
14310
|
const indexFiles = readDir(reactIndexesPath).filter((file4) => file4.endsWith(".tsx"));
|
|
14416
|
-
const pagesRel =
|
|
14311
|
+
const pagesRel = relative11(process.cwd(), resolve21(reactPagesPath)).replace(/\\/g, "/");
|
|
14417
14312
|
for (const file4 of indexFiles) {
|
|
14418
|
-
let content = readFileSync12(
|
|
14313
|
+
let content = readFileSync12(join24(reactIndexesPath, file4), "utf-8");
|
|
14419
14314
|
content = content.replace(/from\s*['"]([^'"]*\/pages\/([^'"]+))['"]/g, (_match, _fullPath, componentName) => `from '/@src/${pagesRel}/${componentName}'`);
|
|
14420
|
-
writeFileSync7(
|
|
14315
|
+
writeFileSync7(join24(devIndexDir, file4), content);
|
|
14421
14316
|
}
|
|
14422
14317
|
}, copySvelteDevIndexes = (svelteDir, sveltePagesPath, svelteEntries, devIndexDir) => {
|
|
14423
|
-
const svelteIndexDir =
|
|
14424
|
-
const sveltePageEntries = svelteEntries.filter((file4) =>
|
|
14318
|
+
const svelteIndexDir = join24(getFrameworkGeneratedDir("svelte"), "indexes");
|
|
14319
|
+
const sveltePageEntries = svelteEntries.filter((file4) => resolve21(file4).startsWith(resolve21(sveltePagesPath)));
|
|
14425
14320
|
for (const entry of sveltePageEntries) {
|
|
14426
14321
|
const name = basename8(entry).replace(/\.svelte(\.(ts|js))?$/, "");
|
|
14427
|
-
const indexFile =
|
|
14322
|
+
const indexFile = join24(svelteIndexDir, "pages", `${name}.js`);
|
|
14428
14323
|
if (!existsSync19(indexFile))
|
|
14429
14324
|
continue;
|
|
14430
14325
|
let content = readFileSync12(indexFile, "utf-8");
|
|
14431
|
-
const srcRel =
|
|
14326
|
+
const srcRel = relative11(process.cwd(), resolve21(entry)).replace(/\\/g, "/");
|
|
14432
14327
|
content = content.replace(/import\s+Component\s+from\s+['"]([^'"]+)['"]/, `import Component from "/@src/${srcRel}"`);
|
|
14433
|
-
writeFileSync7(
|
|
14328
|
+
writeFileSync7(join24(devIndexDir, `${name}.svelte.js`), content);
|
|
14434
14329
|
}
|
|
14435
14330
|
}, copyVueDevIndexes = (vueDir, vuePagesPath, vueEntries, devIndexDir) => {
|
|
14436
|
-
const vueIndexDir =
|
|
14437
|
-
const vuePageEntries = vueEntries.filter((file4) =>
|
|
14331
|
+
const vueIndexDir = join24(getFrameworkGeneratedDir("vue"), "indexes");
|
|
14332
|
+
const vuePageEntries = vueEntries.filter((file4) => resolve21(file4).startsWith(resolve21(vuePagesPath)));
|
|
14438
14333
|
for (const entry of vuePageEntries) {
|
|
14439
14334
|
const name = basename8(entry, ".vue");
|
|
14440
|
-
const indexFile =
|
|
14335
|
+
const indexFile = join24(vueIndexDir, `${name}.js`);
|
|
14441
14336
|
if (!existsSync19(indexFile))
|
|
14442
14337
|
continue;
|
|
14443
14338
|
let content = readFileSync12(indexFile, "utf-8");
|
|
14444
|
-
const srcRel =
|
|
14339
|
+
const srcRel = relative11(process.cwd(), resolve21(entry)).replace(/\\/g, "/");
|
|
14445
14340
|
content = content.replace(/import\s+Comp(?:\s*,\s*\*\s+as\s+\w+)?\s+from\s+['"]([^'"]+)['"]/, (match) => match.replace(/from\s+['"][^'"]+['"]/, `from "/@src/${srcRel}"`));
|
|
14446
|
-
writeFileSync7(
|
|
14341
|
+
writeFileSync7(join24(devIndexDir, `${name}.vue.js`), content);
|
|
14447
14342
|
}
|
|
14448
14343
|
}, resolveVueRuntimeId = (content, firstUseName, outputPath, projectRoot) => {
|
|
14449
14344
|
const varIdx = content.indexOf(`var ${firstUseName} =`);
|
|
@@ -14454,7 +14349,7 @@ var isDev, isBuildTraceEnabled = () => {
|
|
|
14454
14349
|
const last = allComments[allComments.length - 1];
|
|
14455
14350
|
if (!last?.[1])
|
|
14456
14351
|
return JSON.stringify(outputPath);
|
|
14457
|
-
const srcPath =
|
|
14352
|
+
const srcPath = resolve21(projectRoot, last[1].replace("/client/", "/").replace(/\.js$/, ".ts"));
|
|
14458
14353
|
return JSON.stringify(srcPath);
|
|
14459
14354
|
}, QUOTE_CHARS, OPEN_BRACES, CLOSE_BRACES, findFunctionExpressionEnd = (content, startPos) => {
|
|
14460
14355
|
let depth = 0;
|
|
@@ -14516,7 +14411,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
14516
14411
|
}, buildDevUrlFileMap = (urlReferencedFiles, projectRoot) => {
|
|
14517
14412
|
const urlFileMap = new Map;
|
|
14518
14413
|
for (const srcPath of urlReferencedFiles) {
|
|
14519
|
-
const rel =
|
|
14414
|
+
const rel = relative11(projectRoot, srcPath).replace(/\\/g, "/");
|
|
14520
14415
|
const name = basename8(srcPath);
|
|
14521
14416
|
const mtime = Math.round(statSync(srcPath).mtimeMs);
|
|
14522
14417
|
const url = `/@src/${rel}?v=${mtime}`;
|
|
@@ -14531,7 +14426,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
14531
14426
|
const output = nonReactClientOutputs.find((artifact) => basename8(artifact.path).startsWith(`${srcBase}.`));
|
|
14532
14427
|
if (!output)
|
|
14533
14428
|
continue;
|
|
14534
|
-
urlFileMap.set(basename8(srcPath), `/${
|
|
14429
|
+
urlFileMap.set(basename8(srcPath), `/${relative11(buildPath, output.path).replace(/\\/g, "/")}`);
|
|
14535
14430
|
}
|
|
14536
14431
|
return urlFileMap;
|
|
14537
14432
|
}, buildUrlFileMap = (urlReferencedFiles, hmr, projectRoot, buildPath, nonReactClientOutputs) => {
|
|
@@ -14665,10 +14560,10 @@ ${content.slice(firstUseIdx)}`;
|
|
|
14665
14560
|
restoreTracePhase();
|
|
14666
14561
|
return;
|
|
14667
14562
|
}
|
|
14668
|
-
const traceDir =
|
|
14563
|
+
const traceDir = join24(buildPath2, ".absolute-trace");
|
|
14669
14564
|
const timestamp = new Date().toISOString().replace(/[:.]/g, "-");
|
|
14670
14565
|
mkdirSync11(traceDir, { recursive: true });
|
|
14671
|
-
writeFileSync7(
|
|
14566
|
+
writeFileSync7(join24(traceDir, `build-trace-${timestamp}.json`), JSON.stringify({
|
|
14672
14567
|
events: traceEvents,
|
|
14673
14568
|
frameworks: traceFrameworkNames,
|
|
14674
14569
|
generatedAt: new Date().toISOString(),
|
|
@@ -14699,15 +14594,15 @@ ${content.slice(firstUseIdx)}`;
|
|
|
14699
14594
|
const stylesPath = typeof stylesConfig === "string" ? stylesConfig : stylesConfig?.path;
|
|
14700
14595
|
const stylesIgnore = typeof stylesConfig === "object" ? stylesConfig.ignore : undefined;
|
|
14701
14596
|
const stylesDir = stylesPath && validateSafePath(stylesPath, projectRoot);
|
|
14702
|
-
const reactIndexesPath = reactDir &&
|
|
14703
|
-
const reactPagesPath = reactDir &&
|
|
14704
|
-
const htmlPagesPath = htmlDir &&
|
|
14705
|
-
const htmlScriptsPath = htmlDir &&
|
|
14706
|
-
const sveltePagesPath = svelteDir &&
|
|
14707
|
-
const vuePagesPath = vueDir &&
|
|
14708
|
-
const htmxPagesPath = htmxDir &&
|
|
14709
|
-
const angularPagesPath = angularDir &&
|
|
14710
|
-
const emberPagesPath = emberDir &&
|
|
14597
|
+
const reactIndexesPath = reactDir && join24(getFrameworkGeneratedDir("react"), "indexes");
|
|
14598
|
+
const reactPagesPath = reactDir && join24(reactDir, "pages");
|
|
14599
|
+
const htmlPagesPath = htmlDir && join24(htmlDir, "pages");
|
|
14600
|
+
const htmlScriptsPath = htmlDir && join24(htmlDir, "scripts");
|
|
14601
|
+
const sveltePagesPath = svelteDir && join24(svelteDir, "pages");
|
|
14602
|
+
const vuePagesPath = vueDir && join24(vueDir, "pages");
|
|
14603
|
+
const htmxPagesPath = htmxDir && join24(htmxDir, "pages");
|
|
14604
|
+
const angularPagesPath = angularDir && join24(angularDir, "pages");
|
|
14605
|
+
const emberPagesPath = emberDir && join24(emberDir, "pages");
|
|
14711
14606
|
const frontends = [
|
|
14712
14607
|
reactDir,
|
|
14713
14608
|
htmlDir,
|
|
@@ -14738,7 +14633,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
14738
14633
|
const sourceClientRoots = [
|
|
14739
14634
|
htmlDir,
|
|
14740
14635
|
htmxDir,
|
|
14741
|
-
islandBootstrapPath &&
|
|
14636
|
+
islandBootstrapPath && dirname13(islandBootstrapPath)
|
|
14742
14637
|
].filter((dir) => Boolean(dir));
|
|
14743
14638
|
const usesGenerated = Boolean(reactDir) || Boolean(svelteDir) || Boolean(vueDir) || Boolean(angularDir);
|
|
14744
14639
|
if (usesGenerated)
|
|
@@ -14766,8 +14661,8 @@ ${content.slice(firstUseIdx)}`;
|
|
|
14766
14661
|
const [firstEntry] = serverDirMap;
|
|
14767
14662
|
if (!firstEntry)
|
|
14768
14663
|
throw new Error("Expected at least one server directory entry");
|
|
14769
|
-
serverRoot =
|
|
14770
|
-
serverOutDir =
|
|
14664
|
+
serverRoot = join24(firstEntry.dir, firstEntry.subdir);
|
|
14665
|
+
serverOutDir = join24(buildPath, basename8(firstEntry.dir));
|
|
14771
14666
|
} else if (serverDirMap.length > 1) {
|
|
14772
14667
|
serverRoot = commonAncestor(serverDirMap.map((entry) => entry.dir), projectRoot);
|
|
14773
14668
|
serverOutDir = buildPath;
|
|
@@ -14779,13 +14674,13 @@ ${content.slice(firstUseIdx)}`;
|
|
|
14779
14674
|
const filterToIncrementalEntries = (entryPoints, mapToSource) => {
|
|
14780
14675
|
if (!isIncremental || !incrementalFiles)
|
|
14781
14676
|
return entryPoints;
|
|
14782
|
-
const normalizedIncremental = new Set(incrementalFiles.map((f2) =>
|
|
14677
|
+
const normalizedIncremental = new Set(incrementalFiles.map((f2) => resolve21(f2)));
|
|
14783
14678
|
const matchingEntries = [];
|
|
14784
14679
|
for (const entry of entryPoints) {
|
|
14785
14680
|
const sourceFile = mapToSource(entry);
|
|
14786
14681
|
if (!sourceFile)
|
|
14787
14682
|
continue;
|
|
14788
|
-
if (!normalizedIncremental.has(
|
|
14683
|
+
if (!normalizedIncremental.has(resolve21(sourceFile)))
|
|
14789
14684
|
continue;
|
|
14790
14685
|
matchingEntries.push(entry);
|
|
14791
14686
|
}
|
|
@@ -14795,7 +14690,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
14795
14690
|
await tracePhase("react/index-generation", () => generateReactIndexFiles(reactPagesPath, reactIndexesPath, hmr));
|
|
14796
14691
|
}
|
|
14797
14692
|
if (assetsPath && (!isIncremental || normalizedIncrementalFiles?.some((f2) => f2.includes("/assets/")))) {
|
|
14798
|
-
await tracePhase("assets/copy", () => cpSync(assetsPath,
|
|
14693
|
+
await tracePhase("assets/copy", () => cpSync(assetsPath, join24(buildPath, "assets"), {
|
|
14799
14694
|
force: true,
|
|
14800
14695
|
recursive: true
|
|
14801
14696
|
}));
|
|
@@ -14847,9 +14742,9 @@ ${content.slice(firstUseIdx)}`;
|
|
|
14847
14742
|
}
|
|
14848
14743
|
const shouldIncludeHtmlAssets = !isIncremental || normalizedIncrementalFiles?.some((f2) => f2.includes("/html/") && (f2.endsWith(".html") || isStylePath(f2)));
|
|
14849
14744
|
const reactEntries = isIncremental && reactIndexesPath && reactPagesPath ? filterToIncrementalEntries(allReactEntries, (entry) => {
|
|
14850
|
-
if (entry.startsWith(
|
|
14745
|
+
if (entry.startsWith(resolve21(reactIndexesPath))) {
|
|
14851
14746
|
const pageName = basename8(entry, ".tsx");
|
|
14852
|
-
return
|
|
14747
|
+
return join24(reactPagesPath, `${pageName}.tsx`);
|
|
14853
14748
|
}
|
|
14854
14749
|
return null;
|
|
14855
14750
|
}) : allReactEntries;
|
|
@@ -14926,7 +14821,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
14926
14821
|
const clientPath = islandSvelteClientPaths[idx];
|
|
14927
14822
|
if (!sourcePath || !clientPath)
|
|
14928
14823
|
continue;
|
|
14929
|
-
islandSvelteClientPathMap.set(
|
|
14824
|
+
islandSvelteClientPathMap.set(resolve21(sourcePath), clientPath);
|
|
14930
14825
|
}
|
|
14931
14826
|
const islandVueClientPathMap = new Map;
|
|
14932
14827
|
for (let idx = 0;idx < islandVueSources.length; idx++) {
|
|
@@ -14934,7 +14829,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
14934
14829
|
const clientPath = islandVueClientPaths[idx];
|
|
14935
14830
|
if (!sourcePath || !clientPath)
|
|
14936
14831
|
continue;
|
|
14937
|
-
islandVueClientPathMap.set(
|
|
14832
|
+
islandVueClientPathMap.set(resolve21(sourcePath), clientPath);
|
|
14938
14833
|
}
|
|
14939
14834
|
const islandAngularClientPathMap = new Map;
|
|
14940
14835
|
for (let idx = 0;idx < islandAngularSources.length; idx++) {
|
|
@@ -14942,7 +14837,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
14942
14837
|
const clientPath = islandAngularClientPaths[idx];
|
|
14943
14838
|
if (!sourcePath || !clientPath)
|
|
14944
14839
|
continue;
|
|
14945
|
-
islandAngularClientPathMap.set(
|
|
14840
|
+
islandAngularClientPathMap.set(resolve21(sourcePath), clientPath);
|
|
14946
14841
|
}
|
|
14947
14842
|
const reactConventionSources = collectConventionSourceFiles(conventionsMap.react);
|
|
14948
14843
|
const svelteConventionSources = collectConventionSourceFiles(conventionsMap.svelte);
|
|
@@ -14953,7 +14848,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
14953
14848
|
const compileReactConventions = async () => {
|
|
14954
14849
|
if (reactConventionSources.length === 0)
|
|
14955
14850
|
return emptyStringArray;
|
|
14956
|
-
const destDir =
|
|
14851
|
+
const destDir = join24(buildPath, "conventions", "react");
|
|
14957
14852
|
rmSync2(destDir, { force: true, recursive: true });
|
|
14958
14853
|
mkdirSync11(destDir, { recursive: true });
|
|
14959
14854
|
const destPaths = [];
|
|
@@ -14969,7 +14864,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
14969
14864
|
naming: `${idx}-[name].[ext]`,
|
|
14970
14865
|
outdir: destDir,
|
|
14971
14866
|
plugins: [stylePreprocessorPlugin2],
|
|
14972
|
-
root:
|
|
14867
|
+
root: dirname13(source),
|
|
14973
14868
|
target: "bun",
|
|
14974
14869
|
throw: false,
|
|
14975
14870
|
tsconfig: "./tsconfig.json"
|
|
@@ -14997,7 +14892,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
14997
14892
|
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 }
|
|
14998
14893
|
]);
|
|
14999
14894
|
const bundleConventionFiles = async (framework, compiledPaths) => {
|
|
15000
|
-
const destDir =
|
|
14895
|
+
const destDir = join24(buildPath, "conventions", framework);
|
|
15001
14896
|
rmSync2(destDir, { force: true, recursive: true });
|
|
15002
14897
|
mkdirSync11(destDir, { recursive: true });
|
|
15003
14898
|
const destPaths = [];
|
|
@@ -15071,7 +14966,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
15071
14966
|
}
|
|
15072
14967
|
})) : {
|
|
15073
14968
|
entries: [],
|
|
15074
|
-
generatedRoot:
|
|
14969
|
+
generatedRoot: join24(buildPath, "_island_entries")
|
|
15075
14970
|
};
|
|
15076
14971
|
const islandClientEntryPoints = islandEntryResult.entries.map((entry) => entry.entryPath);
|
|
15077
14972
|
if (serverEntryPoints.length === 0 && reactClientEntryPoints.length === 0 && nonReactClientEntryPoints.length === 0 && islandClientEntryPoints.length === 0 && htmxDir === undefined && htmlDir === undefined) {
|
|
@@ -15107,7 +15002,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
15107
15002
|
return {};
|
|
15108
15003
|
}
|
|
15109
15004
|
if (hmr && reactIndexesPath && reactClientEntryPoints.length > 0) {
|
|
15110
|
-
const refreshEntry =
|
|
15005
|
+
const refreshEntry = join24(reactIndexesPath, "_refresh.tsx");
|
|
15111
15006
|
if (!reactClientEntryPoints.includes(refreshEntry))
|
|
15112
15007
|
reactClientEntryPoints.push(refreshEntry);
|
|
15113
15008
|
}
|
|
@@ -15206,19 +15101,19 @@ ${content.slice(firstUseIdx)}`;
|
|
|
15206
15101
|
throw: false
|
|
15207
15102
|
}, resolveBunBuildOverride(bunBuildConfig, "reactClient")) : undefined;
|
|
15208
15103
|
if (reactDir && reactClientEntryPoints.length > 0) {
|
|
15209
|
-
rmSync2(
|
|
15104
|
+
rmSync2(join24(buildPath, "react", "generated", "indexes"), {
|
|
15210
15105
|
force: true,
|
|
15211
15106
|
recursive: true
|
|
15212
15107
|
});
|
|
15213
15108
|
}
|
|
15214
15109
|
if (angularDir && angularClientPaths.length > 0) {
|
|
15215
|
-
rmSync2(
|
|
15110
|
+
rmSync2(join24(buildPath, "angular", "indexes"), {
|
|
15216
15111
|
force: true,
|
|
15217
15112
|
recursive: true
|
|
15218
15113
|
});
|
|
15219
15114
|
}
|
|
15220
15115
|
if (islandClientEntryPoints.length > 0) {
|
|
15221
|
-
rmSync2(
|
|
15116
|
+
rmSync2(join24(buildPath, "islands"), {
|
|
15222
15117
|
force: true,
|
|
15223
15118
|
recursive: true
|
|
15224
15119
|
});
|
|
@@ -15301,7 +15196,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
15301
15196
|
globalCssEntries.length > 0 ? tracePhase("bun/global-css", () => bunBuild7(mergeBunBuildConfig({
|
|
15302
15197
|
entrypoints: globalCssEntries,
|
|
15303
15198
|
naming: `[dir]/[name].[hash].[ext]`,
|
|
15304
|
-
outdir: stylesDir ?
|
|
15199
|
+
outdir: stylesDir ? join24(buildPath, basename8(stylesDir)) : buildPath,
|
|
15305
15200
|
plugins: [stylePreprocessorPlugin2],
|
|
15306
15201
|
root: stylesDir || clientRoot,
|
|
15307
15202
|
target: "browser",
|
|
@@ -15310,7 +15205,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
15310
15205
|
vueCssPaths.length > 0 ? tracePhase("bun/vue-css", () => bunBuild7(mergeBunBuildConfig({
|
|
15311
15206
|
entrypoints: vueCssPaths,
|
|
15312
15207
|
naming: `[name].[hash].[ext]`,
|
|
15313
|
-
outdir:
|
|
15208
|
+
outdir: join24(buildPath, assetsPath ? basename8(assetsPath) : "assets", "css"),
|
|
15314
15209
|
target: "browser",
|
|
15315
15210
|
throw: false
|
|
15316
15211
|
}, resolveBunBuildOverride(bunBuildConfig, "vueCss")))) : undefined
|
|
@@ -15377,10 +15272,10 @@ ${content.slice(firstUseIdx)}`;
|
|
|
15377
15272
|
if (serverOutputs.length > 0 && angularServerVendorPaths2 && Object.keys(angularServerVendorPaths2).length > 0) {
|
|
15378
15273
|
const { rewriteBuildOutputsWith: rewriteBuildOutputsWith2 } = await Promise.resolve().then(() => (init_rewriteImportsPlugin(), exports_rewriteImportsPlugin));
|
|
15379
15274
|
await tracePhase("postprocess/server-angular-vendor-imports", () => rewriteBuildOutputsWith2(serverOutputs, (artifact) => {
|
|
15380
|
-
const fileDir =
|
|
15275
|
+
const fileDir = dirname13(artifact.path);
|
|
15381
15276
|
const relativePaths = {};
|
|
15382
15277
|
for (const [specifier, absolute] of Object.entries(angularServerVendorPaths2)) {
|
|
15383
|
-
const rel =
|
|
15278
|
+
const rel = relative11(fileDir, absolute);
|
|
15384
15279
|
relativePaths[specifier] = rel.startsWith(".") ? rel : `./${rel}`;
|
|
15385
15280
|
}
|
|
15386
15281
|
return relativePaths;
|
|
@@ -15449,7 +15344,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
15449
15344
|
if (skipAngularClientBundle) {
|
|
15450
15345
|
for (const clientPath of angularClientPaths) {
|
|
15451
15346
|
const fileBase = basename8(clientPath, ".js");
|
|
15452
|
-
const relFromCwd =
|
|
15347
|
+
const relFromCwd = relative11(projectRoot, clientPath).replace(/\\/g, "/");
|
|
15453
15348
|
manifest[`${toPascal(fileBase)}Index`] = `/@src/${relFromCwd}`;
|
|
15454
15349
|
}
|
|
15455
15350
|
}
|
|
@@ -15471,7 +15366,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
15471
15366
|
const processHtmlPages = async () => {
|
|
15472
15367
|
if (!(htmlDir && htmlPagesPath))
|
|
15473
15368
|
return;
|
|
15474
|
-
const outputHtmlPages = isSingle ?
|
|
15369
|
+
const outputHtmlPages = isSingle ? join24(buildPath, "pages") : join24(buildPath, basename8(htmlDir), "pages");
|
|
15475
15370
|
mkdirSync11(outputHtmlPages, { recursive: true });
|
|
15476
15371
|
cpSync(htmlPagesPath, outputHtmlPages, {
|
|
15477
15372
|
force: true,
|
|
@@ -15493,14 +15388,14 @@ ${content.slice(firstUseIdx)}`;
|
|
|
15493
15388
|
const processHtmxPages = async () => {
|
|
15494
15389
|
if (!(htmxDir && htmxPagesPath))
|
|
15495
15390
|
return;
|
|
15496
|
-
const outputHtmxPages = isSingle ?
|
|
15391
|
+
const outputHtmxPages = isSingle ? join24(buildPath, "pages") : join24(buildPath, basename8(htmxDir), "pages");
|
|
15497
15392
|
mkdirSync11(outputHtmxPages, { recursive: true });
|
|
15498
15393
|
cpSync(htmxPagesPath, outputHtmxPages, {
|
|
15499
15394
|
force: true,
|
|
15500
15395
|
recursive: true
|
|
15501
15396
|
});
|
|
15502
15397
|
if (shouldCopyHtmx) {
|
|
15503
|
-
const htmxDestDir = isSingle ? buildPath :
|
|
15398
|
+
const htmxDestDir = isSingle ? buildPath : join24(buildPath, basename8(htmxDir));
|
|
15504
15399
|
copyHtmxVendor(htmxDir, htmxDestDir);
|
|
15505
15400
|
}
|
|
15506
15401
|
if (shouldUpdateHtmxAssetPaths) {
|
|
@@ -15562,9 +15457,9 @@ ${content.slice(firstUseIdx)}`;
|
|
|
15562
15457
|
writeBuildTrace(buildPath);
|
|
15563
15458
|
return { conventions: conventionsMap, manifest };
|
|
15564
15459
|
}
|
|
15565
|
-
writeFileSync7(
|
|
15460
|
+
writeFileSync7(join24(buildPath, "manifest.json"), JSON.stringify(manifest, null, "\t"));
|
|
15566
15461
|
if (Object.keys(conventionsMap).length > 0) {
|
|
15567
|
-
writeFileSync7(
|
|
15462
|
+
writeFileSync7(join24(buildPath, "conventions.json"), JSON.stringify(conventionsMap, null, "\t"));
|
|
15568
15463
|
}
|
|
15569
15464
|
writeBuildTrace(buildPath);
|
|
15570
15465
|
if (tailwind && mode === "production") {
|
|
@@ -15665,7 +15560,7 @@ var init_build = __esm(() => {
|
|
|
15665
15560
|
|
|
15666
15561
|
// src/build/buildEmberVendor.ts
|
|
15667
15562
|
import { mkdirSync as mkdirSync12, existsSync as existsSync20 } from "fs";
|
|
15668
|
-
import { join as
|
|
15563
|
+
import { join as join25 } from "path";
|
|
15669
15564
|
import { rm as rm9 } from "fs/promises";
|
|
15670
15565
|
var {build: bunBuild8 } = globalThis.Bun;
|
|
15671
15566
|
var toSafeFileName5 = (specifier) => specifier.replace(/^@/, "").replace(/\//g, "_"), generateMacrosShim = () => `// Generated shim for @embroider/macros \u2014 provides minimal runtime
|
|
@@ -15717,7 +15612,7 @@ export const importSync = (specifier) => {
|
|
|
15717
15612
|
if (standaloneSpecifiers.has(specifier)) {
|
|
15718
15613
|
return { resolveTo: specifier, specifier };
|
|
15719
15614
|
}
|
|
15720
|
-
const emberInternalPath =
|
|
15615
|
+
const emberInternalPath = join25(cwd2, "node_modules/ember-source/dist/packages", specifier, "index.js");
|
|
15721
15616
|
if (!existsSync20(emberInternalPath)) {
|
|
15722
15617
|
throw new Error(`Ember vendor build: cannot find ${specifier} at ${emberInternalPath}. ` + `Is ember-source installed and at least 6.12?`);
|
|
15723
15618
|
}
|
|
@@ -15749,7 +15644,7 @@ export const importSync = (specifier) => {
|
|
|
15749
15644
|
if (standalonePackages.has(args.path)) {
|
|
15750
15645
|
return;
|
|
15751
15646
|
}
|
|
15752
|
-
const internal =
|
|
15647
|
+
const internal = join25(cwd2, "node_modules/ember-source/dist/packages", args.path, "index.js");
|
|
15753
15648
|
if (existsSync20(internal)) {
|
|
15754
15649
|
return { path: internal };
|
|
15755
15650
|
}
|
|
@@ -15757,16 +15652,16 @@ export const importSync = (specifier) => {
|
|
|
15757
15652
|
});
|
|
15758
15653
|
}
|
|
15759
15654
|
}), buildEmberVendor = async (buildDir, cwd2 = process.cwd()) => {
|
|
15760
|
-
const vendorDir =
|
|
15655
|
+
const vendorDir = join25(buildDir, "ember", "vendor");
|
|
15761
15656
|
mkdirSync12(vendorDir, { recursive: true });
|
|
15762
|
-
const tmpDir =
|
|
15657
|
+
const tmpDir = join25(buildDir, "_ember_vendor_tmp");
|
|
15763
15658
|
mkdirSync12(tmpDir, { recursive: true });
|
|
15764
|
-
const macrosShimPath =
|
|
15659
|
+
const macrosShimPath = join25(tmpDir, "embroider_macros_shim.js");
|
|
15765
15660
|
await Bun.write(macrosShimPath, generateMacrosShim());
|
|
15766
15661
|
const resolutions = REQUIRED_EMBER_SPECIFIERS.map((specifier) => resolveEmberSpecifier(specifier, cwd2));
|
|
15767
15662
|
const entrypoints = await Promise.all(resolutions.map(async (resolution) => {
|
|
15768
15663
|
const safeName = toSafeFileName5(resolution.specifier);
|
|
15769
|
-
const entryPath =
|
|
15664
|
+
const entryPath = join25(tmpDir, `${safeName}.js`);
|
|
15770
15665
|
const source = resolution.specifier === "@embroider/macros" ? `export * from ${JSON.stringify(macrosShimPath)};
|
|
15771
15666
|
` : generateVendorEntrySource2(resolution);
|
|
15772
15667
|
await Bun.write(entryPath, source);
|
|
@@ -15812,7 +15707,7 @@ var init_buildEmberVendor = __esm(() => {
|
|
|
15812
15707
|
// src/dev/dependencyGraph.ts
|
|
15813
15708
|
import { existsSync as existsSync21, readFileSync as readFileSync13 } from "fs";
|
|
15814
15709
|
var {Glob: Glob8 } = globalThis.Bun;
|
|
15815
|
-
import { resolve as
|
|
15710
|
+
import { resolve as resolve22 } from "path";
|
|
15816
15711
|
var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath) => {
|
|
15817
15712
|
const lower = filePath.toLowerCase();
|
|
15818
15713
|
if (lower.endsWith(".ts") || lower.endsWith(".tsx") || lower.endsWith(".jsx"))
|
|
@@ -15826,8 +15721,8 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
15826
15721
|
if (!importPath.startsWith(".") && !importPath.startsWith("/")) {
|
|
15827
15722
|
return null;
|
|
15828
15723
|
}
|
|
15829
|
-
const fromDir =
|
|
15830
|
-
const normalized =
|
|
15724
|
+
const fromDir = resolve22(fromFile, "..");
|
|
15725
|
+
const normalized = resolve22(fromDir, importPath);
|
|
15831
15726
|
const extensions = [
|
|
15832
15727
|
".ts",
|
|
15833
15728
|
".tsx",
|
|
@@ -15857,7 +15752,7 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
15857
15752
|
dependents.delete(normalizedPath);
|
|
15858
15753
|
}
|
|
15859
15754
|
}, addFileToGraph = (graph, filePath) => {
|
|
15860
|
-
const normalizedPath =
|
|
15755
|
+
const normalizedPath = resolve22(filePath);
|
|
15861
15756
|
if (!existsSync21(normalizedPath))
|
|
15862
15757
|
return;
|
|
15863
15758
|
const dependencies = extractDependencies(normalizedPath);
|
|
@@ -15874,10 +15769,10 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
15874
15769
|
}, IGNORED_SEGMENTS, buildInitialDependencyGraph = (graph, directories) => {
|
|
15875
15770
|
const processedFiles = new Set;
|
|
15876
15771
|
const glob = new Glob8("**/*.{ts,tsx,js,jsx,vue,svelte,html,htm}");
|
|
15877
|
-
const resolvedDirs = directories.map((dir) =>
|
|
15772
|
+
const resolvedDirs = directories.map((dir) => resolve22(dir)).filter((dir) => existsSync21(dir));
|
|
15878
15773
|
const allFiles = resolvedDirs.flatMap((dir) => Array.from(glob.scanSync({ absolute: true, cwd: dir })));
|
|
15879
15774
|
for (const file4 of allFiles) {
|
|
15880
|
-
const fullPath =
|
|
15775
|
+
const fullPath = resolve22(file4);
|
|
15881
15776
|
if (IGNORED_SEGMENTS.some((seg) => fullPath.includes(seg)))
|
|
15882
15777
|
continue;
|
|
15883
15778
|
if (processedFiles.has(fullPath))
|
|
@@ -15932,8 +15827,8 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
15932
15827
|
resolveRegexMatches(styleUrlSingularRegex, content, filePath, dependencies);
|
|
15933
15828
|
extractStyleUrlsDependencies(content, filePath, dependencies);
|
|
15934
15829
|
}, extractJsDependencies = (filePath, content, loader) => {
|
|
15935
|
-
const
|
|
15936
|
-
const imports =
|
|
15830
|
+
const transpiler5 = loader === "tsx" ? tsTranspiler : jsTranspiler;
|
|
15831
|
+
const imports = transpiler5.scanImports(content);
|
|
15937
15832
|
const dependencies = [];
|
|
15938
15833
|
for (const imp of imports) {
|
|
15939
15834
|
const resolved = resolveImportPath2(imp.path, filePath);
|
|
@@ -15990,7 +15885,7 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
15990
15885
|
return [];
|
|
15991
15886
|
}
|
|
15992
15887
|
}, getAffectedFiles = (graph, changedFile) => {
|
|
15993
|
-
const normalizedPath =
|
|
15888
|
+
const normalizedPath = resolve22(changedFile);
|
|
15994
15889
|
const affected = new Set;
|
|
15995
15890
|
const toProcess = [normalizedPath];
|
|
15996
15891
|
const processNode = (current) => {
|
|
@@ -16030,7 +15925,7 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
16030
15925
|
}
|
|
16031
15926
|
graph.dependents.delete(normalizedPath);
|
|
16032
15927
|
}, removeFileFromGraph = (graph, filePath) => {
|
|
16033
|
-
const normalizedPath =
|
|
15928
|
+
const normalizedPath = resolve22(filePath);
|
|
16034
15929
|
removeDepsForFile(graph, normalizedPath);
|
|
16035
15930
|
removeDependentsForFile(graph, normalizedPath);
|
|
16036
15931
|
};
|
|
@@ -16073,12 +15968,12 @@ var globalVersionCounter = 0, createModuleVersionTracker = () => new Map, getNex
|
|
|
16073
15968
|
};
|
|
16074
15969
|
|
|
16075
15970
|
// src/dev/configResolver.ts
|
|
16076
|
-
import { resolve as
|
|
15971
|
+
import { resolve as resolve23 } from "path";
|
|
16077
15972
|
var resolveBuildPaths = (config) => {
|
|
16078
15973
|
const cwd2 = process.cwd();
|
|
16079
15974
|
const normalize = (path) => path.replace(/\\/g, "/");
|
|
16080
|
-
const withDefault = (value, fallback) => normalize(
|
|
16081
|
-
const optional = (value) => value ? normalize(
|
|
15975
|
+
const withDefault = (value, fallback) => normalize(resolve23(cwd2, value ?? fallback));
|
|
15976
|
+
const optional = (value) => value ? normalize(resolve23(cwd2, value)) : undefined;
|
|
16082
15977
|
return {
|
|
16083
15978
|
angularDir: optional(config.angularDirectory),
|
|
16084
15979
|
assetsDir: optional(config.assetsDirectory),
|
|
@@ -16131,7 +16026,7 @@ var init_clientManager = __esm(() => {
|
|
|
16131
16026
|
|
|
16132
16027
|
// src/dev/pathUtils.ts
|
|
16133
16028
|
import { existsSync as existsSync22, readdirSync, readFileSync as readFileSync14 } from "fs";
|
|
16134
|
-
import { dirname as
|
|
16029
|
+
import { dirname as dirname14, resolve as resolve24 } from "path";
|
|
16135
16030
|
var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
16136
16031
|
if (shouldIgnorePath(filePath, resolved)) {
|
|
16137
16032
|
return "ignored";
|
|
@@ -16207,7 +16102,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
16207
16102
|
return "unknown";
|
|
16208
16103
|
}, collectAngularResourceDirs = (angularDir) => {
|
|
16209
16104
|
const out = new Set;
|
|
16210
|
-
const angularRoot =
|
|
16105
|
+
const angularRoot = resolve24(angularDir);
|
|
16211
16106
|
const angularRootNormalized = normalizePath(angularRoot);
|
|
16212
16107
|
const walk = (dir) => {
|
|
16213
16108
|
let entries;
|
|
@@ -16220,7 +16115,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
16220
16115
|
if (entry.name.startsWith(".") || entry.name === "node_modules") {
|
|
16221
16116
|
continue;
|
|
16222
16117
|
}
|
|
16223
|
-
const full =
|
|
16118
|
+
const full = resolve24(dir, entry.name);
|
|
16224
16119
|
if (entry.isDirectory()) {
|
|
16225
16120
|
walk(full);
|
|
16226
16121
|
continue;
|
|
@@ -16259,10 +16154,10 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
16259
16154
|
refs.push(strMatch[1]);
|
|
16260
16155
|
}
|
|
16261
16156
|
}
|
|
16262
|
-
const componentDir =
|
|
16157
|
+
const componentDir = dirname14(full);
|
|
16263
16158
|
for (const ref of refs) {
|
|
16264
|
-
const refAbs = normalizePath(
|
|
16265
|
-
const refDir = normalizePath(
|
|
16159
|
+
const refAbs = normalizePath(resolve24(componentDir, ref));
|
|
16160
|
+
const refDir = normalizePath(dirname14(refAbs));
|
|
16266
16161
|
if (refDir === angularRootNormalized || refDir.startsWith(angularRootNormalized + "/")) {
|
|
16267
16162
|
continue;
|
|
16268
16163
|
}
|
|
@@ -16278,7 +16173,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
16278
16173
|
const push = (path) => {
|
|
16279
16174
|
if (!path)
|
|
16280
16175
|
return;
|
|
16281
|
-
const abs = normalizePath(
|
|
16176
|
+
const abs = normalizePath(resolve24(cwd2, path));
|
|
16282
16177
|
if (!roots.includes(abs))
|
|
16283
16178
|
roots.push(abs);
|
|
16284
16179
|
};
|
|
@@ -16303,7 +16198,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
16303
16198
|
push(cfg.assetsDir);
|
|
16304
16199
|
push(cfg.stylesDir);
|
|
16305
16200
|
for (const candidate of ["src", "db", "assets", "styles"]) {
|
|
16306
|
-
const abs = normalizePath(
|
|
16201
|
+
const abs = normalizePath(resolve24(cwd2, candidate));
|
|
16307
16202
|
if (existsSync22(abs) && !roots.includes(abs))
|
|
16308
16203
|
roots.push(abs);
|
|
16309
16204
|
}
|
|
@@ -16374,7 +16269,7 @@ var init_pathUtils = __esm(() => {
|
|
|
16374
16269
|
// src/dev/fileWatcher.ts
|
|
16375
16270
|
import { watch } from "fs";
|
|
16376
16271
|
import { existsSync as existsSync23 } from "fs";
|
|
16377
|
-
import { join as
|
|
16272
|
+
import { join as join26, resolve as resolve25 } from "path";
|
|
16378
16273
|
var safeRemoveFromGraph = (graph, fullPath) => {
|
|
16379
16274
|
try {
|
|
16380
16275
|
removeFileFromGraph(graph, fullPath);
|
|
@@ -16401,7 +16296,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
16401
16296
|
if (shouldSkipFilename(filename, isStylesDir)) {
|
|
16402
16297
|
return;
|
|
16403
16298
|
}
|
|
16404
|
-
const fullPath =
|
|
16299
|
+
const fullPath = join26(absolutePath, filename).replace(/\\/g, "/");
|
|
16405
16300
|
if (shouldIgnorePath(fullPath, state.resolvedPaths)) {
|
|
16406
16301
|
return;
|
|
16407
16302
|
}
|
|
@@ -16419,7 +16314,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
16419
16314
|
}, addFileWatchers = (state, paths, onFileChange) => {
|
|
16420
16315
|
const stylesDir = state.resolvedPaths?.stylesDir;
|
|
16421
16316
|
paths.forEach((path) => {
|
|
16422
|
-
const absolutePath =
|
|
16317
|
+
const absolutePath = resolve25(path).replace(/\\/g, "/");
|
|
16423
16318
|
if (!existsSync23(absolutePath)) {
|
|
16424
16319
|
return;
|
|
16425
16320
|
}
|
|
@@ -16430,7 +16325,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
16430
16325
|
const watchPaths = getWatchPaths(config, state.resolvedPaths);
|
|
16431
16326
|
const stylesDir = state.resolvedPaths?.stylesDir;
|
|
16432
16327
|
watchPaths.forEach((path) => {
|
|
16433
|
-
const absolutePath =
|
|
16328
|
+
const absolutePath = resolve25(path).replace(/\\/g, "/");
|
|
16434
16329
|
if (!existsSync23(absolutePath)) {
|
|
16435
16330
|
return;
|
|
16436
16331
|
}
|
|
@@ -16445,13 +16340,13 @@ var init_fileWatcher = __esm(() => {
|
|
|
16445
16340
|
});
|
|
16446
16341
|
|
|
16447
16342
|
// src/dev/assetStore.ts
|
|
16448
|
-
import { resolve as
|
|
16343
|
+
import { resolve as resolve26 } from "path";
|
|
16449
16344
|
import { readdir as readdir4, unlink } from "fs/promises";
|
|
16450
16345
|
var mimeTypes, getMimeType = (filePath) => {
|
|
16451
16346
|
const ext = filePath.slice(filePath.lastIndexOf("."));
|
|
16452
16347
|
return mimeTypes[ext] ?? "application/octet-stream";
|
|
16453
16348
|
}, HASHED_FILE_RE, stripHash = (webPath) => webPath.replace(/\.[a-z0-9]{8}(\.(js|css|mjs))$/, "$1"), processWalkEntry = (entry, dir, liveByIdentity, walkAndClean) => {
|
|
16454
|
-
const fullPath =
|
|
16349
|
+
const fullPath = resolve26(dir, entry.name);
|
|
16455
16350
|
if (entry.isDirectory()) {
|
|
16456
16351
|
return walkAndClean(fullPath);
|
|
16457
16352
|
}
|
|
@@ -16467,10 +16362,10 @@ var mimeTypes, getMimeType = (filePath) => {
|
|
|
16467
16362
|
}, cleanStaleAssets = async (store, manifest, buildDir) => {
|
|
16468
16363
|
const liveByIdentity = new Map;
|
|
16469
16364
|
for (const webPath of store.keys()) {
|
|
16470
|
-
const diskPath =
|
|
16365
|
+
const diskPath = resolve26(buildDir, webPath.slice(1));
|
|
16471
16366
|
liveByIdentity.set(stripHash(diskPath), diskPath);
|
|
16472
16367
|
}
|
|
16473
|
-
const absBuildDir =
|
|
16368
|
+
const absBuildDir = resolve26(buildDir);
|
|
16474
16369
|
Object.values(manifest).forEach((val) => {
|
|
16475
16370
|
if (!HASHED_FILE_RE.test(val))
|
|
16476
16371
|
return;
|
|
@@ -16488,7 +16383,7 @@ var mimeTypes, getMimeType = (filePath) => {
|
|
|
16488
16383
|
} catch {}
|
|
16489
16384
|
}, lookupAsset = (store, path) => store.get(path), processScanEntry = (entry, dir, prefix, store, scanDir) => {
|
|
16490
16385
|
if (entry.isDirectory()) {
|
|
16491
|
-
return scanDir(
|
|
16386
|
+
return scanDir(resolve26(dir, entry.name), `${prefix}${entry.name}/`);
|
|
16492
16387
|
}
|
|
16493
16388
|
if (!entry.name.startsWith("chunk-")) {
|
|
16494
16389
|
return null;
|
|
@@ -16497,7 +16392,7 @@ var mimeTypes, getMimeType = (filePath) => {
|
|
|
16497
16392
|
if (store.has(webPath)) {
|
|
16498
16393
|
return null;
|
|
16499
16394
|
}
|
|
16500
|
-
return Bun.file(
|
|
16395
|
+
return Bun.file(resolve26(dir, entry.name)).bytes().then((bytes) => {
|
|
16501
16396
|
store.set(webPath, bytes);
|
|
16502
16397
|
return;
|
|
16503
16398
|
}).catch(() => {});
|
|
@@ -16519,7 +16414,7 @@ var mimeTypes, getMimeType = (filePath) => {
|
|
|
16519
16414
|
for (const webPath of newIdentities.values()) {
|
|
16520
16415
|
if (store.has(webPath))
|
|
16521
16416
|
continue;
|
|
16522
|
-
loadPromises.push(Bun.file(
|
|
16417
|
+
loadPromises.push(Bun.file(resolve26(buildDir, webPath.slice(1))).bytes().then((bytes) => {
|
|
16523
16418
|
store.set(webPath, bytes);
|
|
16524
16419
|
return;
|
|
16525
16420
|
}).catch(() => {}));
|
|
@@ -16550,7 +16445,7 @@ var init_assetStore = __esm(() => {
|
|
|
16550
16445
|
|
|
16551
16446
|
// src/islands/pageMetadata.ts
|
|
16552
16447
|
import { readFileSync as readFileSync15 } from "fs";
|
|
16553
|
-
import { dirname as
|
|
16448
|
+
import { dirname as dirname15, resolve as resolve27 } from "path";
|
|
16554
16449
|
var pagePatterns, getPageDirs = (config) => [
|
|
16555
16450
|
{ dir: config.angularDirectory, framework: "angular" },
|
|
16556
16451
|
{ dir: config.emberDirectory, framework: "ember" },
|
|
@@ -16570,15 +16465,15 @@ var pagePatterns, getPageDirs = (config) => [
|
|
|
16570
16465
|
const source = definition.buildReference?.source;
|
|
16571
16466
|
if (!source)
|
|
16572
16467
|
continue;
|
|
16573
|
-
const resolvedSource = source.startsWith("file://") ? new URL(source).pathname :
|
|
16574
|
-
lookup.set(`${definition.framework}:${definition.component}`,
|
|
16468
|
+
const resolvedSource = source.startsWith("file://") ? new URL(source).pathname : resolve27(dirname15(buildInfo.resolvedRegistryPath), source);
|
|
16469
|
+
lookup.set(`${definition.framework}:${definition.component}`, resolve27(resolvedSource));
|
|
16575
16470
|
}
|
|
16576
16471
|
return lookup;
|
|
16577
16472
|
}, getCurrentPageIslandMetadata = () => globalThis.__absolutePageIslandMetadata ?? new Map, metadataUsesSource = (metadata, target) => metadata.islands.some((usage) => {
|
|
16578
16473
|
const candidate = usage.source;
|
|
16579
|
-
return candidate ?
|
|
16474
|
+
return candidate ? resolve27(candidate) === target : false;
|
|
16580
16475
|
}), getPagesUsingIslandSource = (sourcePath) => {
|
|
16581
|
-
const target =
|
|
16476
|
+
const target = resolve27(sourcePath);
|
|
16582
16477
|
return [...getCurrentPageIslandMetadata().values()].filter((metadata) => metadataUsesSource(metadata, target)).map((metadata) => metadata.pagePath);
|
|
16583
16478
|
}, resolveIslandUsages = (islands, islandSourceLookup) => islands.map((usage) => {
|
|
16584
16479
|
const sourcePath = islandSourceLookup.get(`${usage.framework}:${usage.component}`);
|
|
@@ -16590,13 +16485,13 @@ var pagePatterns, getPageDirs = (config) => [
|
|
|
16590
16485
|
const pattern = pagePatterns[entry.framework];
|
|
16591
16486
|
if (!pattern)
|
|
16592
16487
|
return;
|
|
16593
|
-
const files = await scanEntryPoints(
|
|
16488
|
+
const files = await scanEntryPoints(resolve27(entry.dir), pattern);
|
|
16594
16489
|
for (const filePath of files) {
|
|
16595
16490
|
const source = readFileSync15(filePath, "utf-8");
|
|
16596
16491
|
const islands = extractIslandUsagesFromSource(source);
|
|
16597
|
-
pageMetadata.set(
|
|
16492
|
+
pageMetadata.set(resolve27(filePath), {
|
|
16598
16493
|
islands: resolveIslandUsages(islands, islandSourceLookup),
|
|
16599
|
-
pagePath:
|
|
16494
|
+
pagePath: resolve27(filePath)
|
|
16600
16495
|
});
|
|
16601
16496
|
}
|
|
16602
16497
|
}, loadPageIslandMetadata = async (config) => {
|
|
@@ -16719,9 +16614,9 @@ var init_transformCache = __esm(() => {
|
|
|
16719
16614
|
});
|
|
16720
16615
|
|
|
16721
16616
|
// src/dev/reactComponentClassifier.ts
|
|
16722
|
-
import { resolve as
|
|
16617
|
+
import { resolve as resolve28 } from "path";
|
|
16723
16618
|
var classifyComponent = (filePath) => {
|
|
16724
|
-
const normalizedPath =
|
|
16619
|
+
const normalizedPath = resolve28(filePath);
|
|
16725
16620
|
if (normalizedPath.includes("/react/pages/")) {
|
|
16726
16621
|
return "server";
|
|
16727
16622
|
}
|
|
@@ -16733,7 +16628,7 @@ var classifyComponent = (filePath) => {
|
|
|
16733
16628
|
var init_reactComponentClassifier = () => {};
|
|
16734
16629
|
|
|
16735
16630
|
// src/dev/moduleMapper.ts
|
|
16736
|
-
import { basename as basename9, resolve as
|
|
16631
|
+
import { basename as basename9, resolve as resolve29 } from "path";
|
|
16737
16632
|
var buildModulePaths = (moduleKeys, manifest) => {
|
|
16738
16633
|
const modulePaths = {};
|
|
16739
16634
|
moduleKeys.forEach((key) => {
|
|
@@ -16743,7 +16638,7 @@ var buildModulePaths = (moduleKeys, manifest) => {
|
|
|
16743
16638
|
});
|
|
16744
16639
|
return modulePaths;
|
|
16745
16640
|
}, processChangedFile = (sourceFile, framework, manifest, resolvedPaths, processedFiles) => {
|
|
16746
|
-
const normalizedFile =
|
|
16641
|
+
const normalizedFile = resolve29(sourceFile);
|
|
16747
16642
|
const normalizedPath = normalizedFile.replace(/\\/g, "/");
|
|
16748
16643
|
if (processedFiles.has(normalizedFile)) {
|
|
16749
16644
|
return null;
|
|
@@ -16779,7 +16674,7 @@ var buildModulePaths = (moduleKeys, manifest) => {
|
|
|
16779
16674
|
});
|
|
16780
16675
|
return grouped;
|
|
16781
16676
|
}, mapSourceFileToManifestKeys = (sourceFile, framework, resolvedPaths) => {
|
|
16782
|
-
const normalizedFile =
|
|
16677
|
+
const normalizedFile = resolve29(sourceFile);
|
|
16783
16678
|
const fileName = basename9(normalizedFile);
|
|
16784
16679
|
const baseName = fileName.replace(/\.(tsx?|jsx?|vue|svelte|css|html)$/, "");
|
|
16785
16680
|
const pascalName = toPascal(baseName);
|
|
@@ -16975,7 +16870,7 @@ __export(exports_moduleServer, {
|
|
|
16975
16870
|
SRC_URL_PREFIX: () => SRC_URL_PREFIX
|
|
16976
16871
|
});
|
|
16977
16872
|
import { existsSync as existsSync24, readFileSync as readFileSync17, statSync as statSync2 } from "fs";
|
|
16978
|
-
import { basename as basename10, dirname as
|
|
16873
|
+
import { basename as basename10, dirname as dirname16, extname as extname8, join as join27, resolve as resolve30, relative as relative12 } from "path";
|
|
16979
16874
|
var SRC_PREFIX = "/@src/", jsTranspiler2, tsTranspiler2, tsxTranspiler, TRANSPILABLE, ALL_EXPORTS_RE, STRING_CONTENTS_RE, preserveTypeExports = (originalSource, transpiled, valueExports) => {
|
|
16980
16875
|
const codeOnly = originalSource.replace(STRING_CONTENTS_RE, '""');
|
|
16981
16876
|
const allExports = [];
|
|
@@ -16995,7 +16890,7 @@ var SRC_PREFIX = "/@src/", jsTranspiler2, tsTranspiler2, tsxTranspiler, TRANSPIL
|
|
|
16995
16890
|
${stubs}
|
|
16996
16891
|
`;
|
|
16997
16892
|
}, resolveRelativeExtension = (srcPath, projectRoot, extensions) => {
|
|
16998
|
-
const found = extensions.find((ext) => existsSync24(
|
|
16893
|
+
const found = extensions.find((ext) => existsSync24(resolve30(projectRoot, srcPath + ext)));
|
|
16999
16894
|
return found ? srcPath + found : srcPath;
|
|
17000
16895
|
}, IMPORT_EXTENSIONS, SIDE_EFFECT_EXTENSIONS, MODULE_EXTENSIONS, RESOLVED_MODULE_EXTENSIONS, REACT_EXTENSIONS, escapeRegex3 = (str) => str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), buildImportRewriter = (vendorPaths) => {
|
|
17001
16896
|
const entries = Object.entries(vendorPaths).sort(([a], [b2]) => b2.length - a.length);
|
|
@@ -17010,7 +16905,7 @@ ${stubs}
|
|
|
17010
16905
|
return invalidationVersion > 0 ? `${mtime}.${invalidationVersion}` : `${mtime}`;
|
|
17011
16906
|
}, srcUrl = (relPath, projectRoot) => {
|
|
17012
16907
|
const base = `${SRC_PREFIX}${relPath.replace(/\\/g, "/")}`;
|
|
17013
|
-
const absPath =
|
|
16908
|
+
const absPath = resolve30(projectRoot, relPath);
|
|
17014
16909
|
const cached = mtimeCache.get(absPath);
|
|
17015
16910
|
if (cached !== undefined)
|
|
17016
16911
|
return `${base}?v=${buildVersion(cached, absPath)}`;
|
|
@@ -17022,12 +16917,12 @@ ${stubs}
|
|
|
17022
16917
|
return base;
|
|
17023
16918
|
}
|
|
17024
16919
|
}, resolveRelativeImport = (relPath, fileDir, projectRoot, extensions) => {
|
|
17025
|
-
const absPath =
|
|
17026
|
-
const rel =
|
|
16920
|
+
const absPath = resolve30(fileDir, relPath);
|
|
16921
|
+
const rel = relative12(projectRoot, absPath);
|
|
17027
16922
|
const extension = extname8(rel);
|
|
17028
16923
|
let srcPath = RESOLVED_MODULE_EXTENSIONS.has(extension) ? rel : resolveRelativeExtension(rel, projectRoot, extensions);
|
|
17029
16924
|
if (extname8(srcPath) === ".svelte") {
|
|
17030
|
-
srcPath =
|
|
16925
|
+
srcPath = relative12(projectRoot, resolveSvelteModulePath(resolve30(projectRoot, srcPath)));
|
|
17031
16926
|
}
|
|
17032
16927
|
return srcUrl(srcPath, projectRoot);
|
|
17033
16928
|
}, NODE_BUILTIN_RE, resolveAbsoluteSpecifier = (specifier, projectRoot) => {
|
|
@@ -17039,27 +16934,27 @@ ${stubs}
|
|
|
17039
16934
|
"import"
|
|
17040
16935
|
]);
|
|
17041
16936
|
if (fromExports)
|
|
17042
|
-
return
|
|
16937
|
+
return relative12(projectRoot, fromExports);
|
|
17043
16938
|
try {
|
|
17044
16939
|
const isScoped = specifier.startsWith("@");
|
|
17045
16940
|
const parts = specifier.split("/");
|
|
17046
16941
|
const packageName = isScoped ? `${parts[0]}/${parts[1]}` : parts[0];
|
|
17047
16942
|
const subpath = isScoped ? parts.slice(2).join("/") : parts.slice(1).join("/");
|
|
17048
16943
|
if (!subpath) {
|
|
17049
|
-
const pkgDir =
|
|
17050
|
-
const pkgJsonPath =
|
|
16944
|
+
const pkgDir = resolve30(projectRoot, "node_modules", packageName ?? "");
|
|
16945
|
+
const pkgJsonPath = join27(pkgDir, "package.json");
|
|
17051
16946
|
if (existsSync24(pkgJsonPath)) {
|
|
17052
16947
|
const pkg = JSON.parse(readFileSync17(pkgJsonPath, "utf-8"));
|
|
17053
16948
|
const esmEntry = typeof pkg.module === "string" && pkg.module || typeof pkg.browser === "string" && pkg.browser;
|
|
17054
16949
|
if (esmEntry) {
|
|
17055
|
-
const resolved =
|
|
16950
|
+
const resolved = resolve30(pkgDir, esmEntry);
|
|
17056
16951
|
if (existsSync24(resolved))
|
|
17057
|
-
return
|
|
16952
|
+
return relative12(projectRoot, resolved);
|
|
17058
16953
|
}
|
|
17059
16954
|
}
|
|
17060
16955
|
}
|
|
17061
16956
|
} catch {}
|
|
17062
|
-
return
|
|
16957
|
+
return relative12(projectRoot, Bun.resolveSync(specifier, projectRoot));
|
|
17063
16958
|
} catch {
|
|
17064
16959
|
return;
|
|
17065
16960
|
}
|
|
@@ -17084,28 +16979,28 @@ ${stubs}
|
|
|
17084
16979
|
};
|
|
17085
16980
|
result = result.replace(/^((?:import\s+[\s\S]+?\s+from|export\s+[\s\S]+?\s+from|import)\s*["'])([^"'./][^"']*)(["'])/gm, stubReplace);
|
|
17086
16981
|
result = result.replace(/(import\s*\(\s*["'])([^"'./][^"']*)(["']\s*\))/g, stubReplace);
|
|
17087
|
-
const fileDir =
|
|
16982
|
+
const fileDir = dirname16(filePath);
|
|
17088
16983
|
result = result.replace(/(from\s*["'])(\.\.?\/[^"']+)(["'])/g, (_match, prefix, relPath, suffix) => `${prefix}${resolveRelativeImport(relPath, fileDir, projectRoot, IMPORT_EXTENSIONS)}${suffix}`);
|
|
17089
16984
|
result = result.replace(/(import\s*\(\s*["'])(\.\.?\/[^"']+)(["']\s*\))/g, (_match, prefix, relPath, suffix) => `${prefix}${resolveRelativeImport(relPath, fileDir, projectRoot, IMPORT_EXTENSIONS)}${suffix}`);
|
|
17090
16985
|
result = result.replace(/(import\s*["'])(\.\.?\/[^"']+)(["']\s*;?)/g, (_match, prefix, relPath, suffix) => `${prefix}${resolveRelativeImport(relPath, fileDir, projectRoot, SIDE_EFFECT_EXTENSIONS)}${suffix}`);
|
|
17091
16986
|
const rewriteAbsoluteToSrc = (_match, prefix, absPath, _ext, suffix) => {
|
|
17092
16987
|
if (absPath.startsWith(projectRoot)) {
|
|
17093
|
-
const rel2 =
|
|
16988
|
+
const rel2 = relative12(projectRoot, absPath).replace(/\\/g, "/");
|
|
17094
16989
|
return `${prefix}${srcUrl(rel2, projectRoot)}${suffix}`;
|
|
17095
16990
|
}
|
|
17096
|
-
const rel =
|
|
16991
|
+
const rel = relative12(projectRoot, absPath).replace(/\\/g, "/");
|
|
17097
16992
|
return `${prefix}${srcUrl(rel, projectRoot)}${suffix}`;
|
|
17098
16993
|
};
|
|
17099
16994
|
result = result.replace(/((?:from|import)\s*["'])(\/[^"']+\.(tsx?|jsx?|ts))(["'])/g, rewriteAbsoluteToSrc);
|
|
17100
16995
|
result = result.replace(/(import\s*\(\s*["'])(\/[^"']+\.(tsx?|jsx?|ts))(["']\s*\))/g, rewriteAbsoluteToSrc);
|
|
17101
16996
|
result = result.replace(/new\s+URL\(\s*["'](\.\.?\/[^"']+)["']\s*,\s*import\.meta\.url\s*\)/g, (_match, relPath) => {
|
|
17102
|
-
const absPath =
|
|
17103
|
-
const rel =
|
|
16997
|
+
const absPath = resolve30(fileDir, relPath);
|
|
16998
|
+
const rel = relative12(projectRoot, absPath);
|
|
17104
16999
|
return `new URL('${srcUrl(rel, projectRoot)}', import.meta.url)`;
|
|
17105
17000
|
});
|
|
17106
17001
|
result = result.replace(/import\.meta\.resolve\(\s*["'](\.\.?\/[^"']+)["']\s*\)/g, (_match, relPath) => {
|
|
17107
|
-
const absPath =
|
|
17108
|
-
const rel =
|
|
17002
|
+
const absPath = resolve30(fileDir, relPath);
|
|
17003
|
+
const rel = relative12(projectRoot, absPath);
|
|
17109
17004
|
return `'${srcUrl(rel, projectRoot)}'`;
|
|
17110
17005
|
});
|
|
17111
17006
|
return result;
|
|
@@ -17161,7 +17056,7 @@ ${code}`;
|
|
|
17161
17056
|
transpiled = `var $RefreshReg$ = window.$RefreshReg$ || function(){};
|
|
17162
17057
|
` + `var $RefreshSig$ = window.$RefreshSig$ || function(){ return function(t){ return t; }; };
|
|
17163
17058
|
${transpiled}`;
|
|
17164
|
-
const relPath =
|
|
17059
|
+
const relPath = relative12(projectRoot, filePath).replace(/\\/g, "/");
|
|
17165
17060
|
transpiled = transpiled.replace(/\binput\.tsx:/g, `${relPath}:`);
|
|
17166
17061
|
transpiled += buildIslandMetadataExports(raw);
|
|
17167
17062
|
return rewriteImports(transpiled, filePath, projectRoot, rewriter);
|
|
@@ -17170,13 +17065,13 @@ ${transpiled}`;
|
|
|
17170
17065
|
const ext = extname8(filePath);
|
|
17171
17066
|
const isTS = ext === ".ts" || ext === ".tsx";
|
|
17172
17067
|
const isTSX = ext === ".tsx" || ext === ".jsx";
|
|
17173
|
-
let
|
|
17068
|
+
let transpiler5 = jsTranspiler2;
|
|
17174
17069
|
if (isTSX)
|
|
17175
|
-
|
|
17070
|
+
transpiler5 = tsxTranspiler;
|
|
17176
17071
|
else if (isTS)
|
|
17177
|
-
|
|
17178
|
-
const valueExports = isTS ?
|
|
17179
|
-
let transpiled =
|
|
17072
|
+
transpiler5 = tsTranspiler2;
|
|
17073
|
+
const valueExports = isTS ? transpiler5.scan(raw).exports : [];
|
|
17074
|
+
let transpiled = transpiler5.transformSync(raw);
|
|
17180
17075
|
if (isTS) {
|
|
17181
17076
|
transpiled = preserveTypeExports(raw, transpiled, valueExports);
|
|
17182
17077
|
}
|
|
@@ -17322,11 +17217,11 @@ ${code}`;
|
|
|
17322
17217
|
if (compiled.css?.code) {
|
|
17323
17218
|
const cssPath = `${filePath}.css`;
|
|
17324
17219
|
svelteExternalCss.set(cssPath, compiled.css.code);
|
|
17325
|
-
const cssUrl = srcUrl(
|
|
17220
|
+
const cssUrl = srcUrl(relative12(projectRoot, cssPath), projectRoot);
|
|
17326
17221
|
code = `import "${cssUrl}";
|
|
17327
17222
|
${code}`;
|
|
17328
17223
|
}
|
|
17329
|
-
const moduleUrl = `${SRC_PREFIX}${
|
|
17224
|
+
const moduleUrl = `${SRC_PREFIX}${relative12(projectRoot, filePath).replace(/\\/g, "/")}`;
|
|
17330
17225
|
code = code.replace(/if\s*\(import\.meta\.hot\)\s*\{/, `if (typeof window !== "undefined") {
|
|
17331
17226
|
` + ` if (!window.__SVELTE_HMR_ACCEPT__) window.__SVELTE_HMR_ACCEPT__ = {};
|
|
17332
17227
|
` + ` var __hmr_accept = function(cb) { window.__SVELTE_HMR_ACCEPT__[${JSON.stringify(moduleUrl)}] = cb; };`);
|
|
@@ -17352,8 +17247,6 @@ ${code}`;
|
|
|
17352
17247
|
const templateResult = compiler.compileTemplate({
|
|
17353
17248
|
compilerOptions: {
|
|
17354
17249
|
bindingMetadata: compiledScript.bindings,
|
|
17355
|
-
expressionPlugins: ["typescript"],
|
|
17356
|
-
isCustomElement: (tag) => tag === "absolute-island",
|
|
17357
17250
|
prefixIdentifiers: true
|
|
17358
17251
|
},
|
|
17359
17252
|
filename: filePath,
|
|
@@ -17417,8 +17310,8 @@ ${code}`;
|
|
|
17417
17310
|
code = injectVueHmr(code, filePath, projectRoot, vueDir);
|
|
17418
17311
|
return rewriteImports(code, filePath, projectRoot, rewriter);
|
|
17419
17312
|
}, injectVueHmr = (code, filePath, projectRoot, vueDir) => {
|
|
17420
|
-
const hmrBase = vueDir ?
|
|
17421
|
-
const hmrId =
|
|
17313
|
+
const hmrBase = vueDir ? resolve30(vueDir) : projectRoot;
|
|
17314
|
+
const hmrId = relative12(hmrBase, filePath).replace(/\\/g, "/").replace(/\.vue$/, "");
|
|
17422
17315
|
let result = code.replace(/export\s+default\s+/, "var __hmr_comp__ = ");
|
|
17423
17316
|
result += [
|
|
17424
17317
|
"",
|
|
@@ -17581,7 +17474,7 @@ export default {};
|
|
|
17581
17474
|
const escaped = virtualCss.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$/g, "\\$");
|
|
17582
17475
|
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);`);
|
|
17583
17476
|
}, resolveSourcePath = (relPath, projectRoot) => {
|
|
17584
|
-
const filePath =
|
|
17477
|
+
const filePath = resolve30(projectRoot, relPath);
|
|
17585
17478
|
const ext = extname8(filePath);
|
|
17586
17479
|
if (ext === ".svelte")
|
|
17587
17480
|
return { ext, filePath: resolveSvelteModulePath(filePath) };
|
|
@@ -17608,7 +17501,7 @@ export default {};
|
|
|
17608
17501
|
if (!TRANSPILABLE.has(ext))
|
|
17609
17502
|
return;
|
|
17610
17503
|
const stat3 = statSync2(filePath);
|
|
17611
|
-
const resolvedVueDir = vueDir ?
|
|
17504
|
+
const resolvedVueDir = vueDir ? resolve30(vueDir) : undefined;
|
|
17612
17505
|
let content = REACT_EXTENSIONS.has(ext) ? transformReactFile(filePath, projectRoot, rewriter) : transformPlainFile(filePath, projectRoot, rewriter, resolvedVueDir);
|
|
17613
17506
|
const isComponentJs = ext === ".js" && filePath.endsWith(".component.js") && filePath.replace(/\\/g, "/").includes("/.absolutejs/generated/angular/");
|
|
17614
17507
|
if (isComponentJs) {
|
|
@@ -17667,7 +17560,7 @@ export default {};
|
|
|
17667
17560
|
const relPath = pathname.slice(SRC_PREFIX.length);
|
|
17668
17561
|
if (relPath === "bun:wrap" || relPath.startsWith("bun:wrap?"))
|
|
17669
17562
|
return handleBunWrapRequest();
|
|
17670
|
-
const virtualCssResponse = handleVirtualSvelteCss(
|
|
17563
|
+
const virtualCssResponse = handleVirtualSvelteCss(resolve30(projectRoot, relPath));
|
|
17671
17564
|
if (virtualCssResponse)
|
|
17672
17565
|
return virtualCssResponse;
|
|
17673
17566
|
const { filePath, ext } = resolveSourcePath(relPath, projectRoot);
|
|
@@ -17683,11 +17576,11 @@ export default {};
|
|
|
17683
17576
|
SRC_IMPORT_RE.lastIndex = 0;
|
|
17684
17577
|
while ((match = SRC_IMPORT_RE.exec(content)) !== null) {
|
|
17685
17578
|
if (match[1])
|
|
17686
|
-
files.push(
|
|
17579
|
+
files.push(resolve30(projectRoot, match[1]));
|
|
17687
17580
|
}
|
|
17688
17581
|
return files;
|
|
17689
17582
|
}, invalidateModule = (filePath) => {
|
|
17690
|
-
const resolved =
|
|
17583
|
+
const resolved = resolve30(filePath);
|
|
17691
17584
|
invalidate(filePath);
|
|
17692
17585
|
if (resolved !== filePath)
|
|
17693
17586
|
invalidate(resolved);
|
|
@@ -17834,7 +17727,7 @@ __export(exports_resolveOwningComponents, {
|
|
|
17834
17727
|
invalidateResourceIndex: () => invalidateResourceIndex
|
|
17835
17728
|
});
|
|
17836
17729
|
import { readdirSync as readdirSync2, readFileSync as readFileSync18, statSync as statSync3 } from "fs";
|
|
17837
|
-
import { dirname as
|
|
17730
|
+
import { dirname as dirname17, extname as extname9, join as join28, resolve as resolve31 } from "path";
|
|
17838
17731
|
import ts3 from "typescript";
|
|
17839
17732
|
var ENTITY_DECORATORS, isAngularSourceFile = (file4) => file4.endsWith(".ts") || file4.endsWith(".tsx"), walkAngularSourceFiles = (root) => {
|
|
17840
17733
|
const out = [];
|
|
@@ -17849,7 +17742,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file4) => file4.endsWith(".ts") ||
|
|
|
17849
17742
|
if (entry.name.startsWith(".") || entry.name === "node_modules") {
|
|
17850
17743
|
continue;
|
|
17851
17744
|
}
|
|
17852
|
-
const full =
|
|
17745
|
+
const full = join28(dir, entry.name);
|
|
17853
17746
|
if (entry.isDirectory()) {
|
|
17854
17747
|
visit(full);
|
|
17855
17748
|
} else if (entry.isFile() && isAngularSourceFile(entry.name)) {
|
|
@@ -17947,7 +17840,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file4) => file4.endsWith(".ts") ||
|
|
|
17947
17840
|
};
|
|
17948
17841
|
visit(sourceFile);
|
|
17949
17842
|
return out;
|
|
17950
|
-
}, safeNormalize = (path) =>
|
|
17843
|
+
}, safeNormalize = (path) => resolve31(path).replace(/\\/g, "/"), resolveOwningComponents = (params) => {
|
|
17951
17844
|
const { changedFilePath, userAngularRoot } = params;
|
|
17952
17845
|
const changedAbs = safeNormalize(changedFilePath);
|
|
17953
17846
|
const out = [];
|
|
@@ -17988,7 +17881,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file4) => file4.endsWith(".ts") ||
|
|
|
17988
17881
|
return null;
|
|
17989
17882
|
}
|
|
17990
17883
|
const sf = ts3.createSourceFile(childFilePath, source, ts3.ScriptTarget.ES2022, true, ts3.ScriptKind.TS);
|
|
17991
|
-
const childDir =
|
|
17884
|
+
const childDir = dirname17(childFilePath);
|
|
17992
17885
|
for (const stmt of sf.statements) {
|
|
17993
17886
|
if (!ts3.isImportDeclaration(stmt))
|
|
17994
17887
|
continue;
|
|
@@ -18016,7 +17909,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file4) => file4.endsWith(".ts") ||
|
|
|
18016
17909
|
if (!spec.startsWith(".") && !spec.startsWith("/")) {
|
|
18017
17910
|
return null;
|
|
18018
17911
|
}
|
|
18019
|
-
const base =
|
|
17912
|
+
const base = resolve31(childDir, spec);
|
|
18020
17913
|
const candidates = [
|
|
18021
17914
|
`${base}.ts`,
|
|
18022
17915
|
`${base}.tsx`,
|
|
@@ -18045,7 +17938,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file4) => file4.endsWith(".ts") ||
|
|
|
18045
17938
|
const parentFile = new Map;
|
|
18046
17939
|
for (const tsPath of walkAngularSourceFiles(userAngularRoot)) {
|
|
18047
17940
|
const classes = parseDecoratedClasses(tsPath);
|
|
18048
|
-
const componentDir =
|
|
17941
|
+
const componentDir = dirname17(tsPath);
|
|
18049
17942
|
for (const cls of classes) {
|
|
18050
17943
|
const entity = {
|
|
18051
17944
|
className: cls.className,
|
|
@@ -18054,7 +17947,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file4) => file4.endsWith(".ts") ||
|
|
|
18054
17947
|
};
|
|
18055
17948
|
if (cls.kind === "component") {
|
|
18056
17949
|
for (const url of [...cls.templateUrls, ...cls.styleUrls]) {
|
|
18057
|
-
const abs = safeNormalize(
|
|
17950
|
+
const abs = safeNormalize(resolve31(componentDir, url));
|
|
18058
17951
|
const existing = resource.get(abs);
|
|
18059
17952
|
if (existing)
|
|
18060
17953
|
existing.push(entity);
|
|
@@ -18134,6 +18027,8 @@ class Context {
|
|
|
18134
18027
|
}
|
|
18135
18028
|
|
|
18136
18029
|
// src/dev/angular/vendor/translator/translator.ts
|
|
18030
|
+
import * as o from "@angular/compiler";
|
|
18031
|
+
|
|
18137
18032
|
class ExpressionTranslatorVisitor {
|
|
18138
18033
|
factory;
|
|
18139
18034
|
imports;
|
|
@@ -18424,16 +18319,8 @@ function createRange(span) {
|
|
|
18424
18319
|
end: { offset: end.offset, line: end.line, column: end.col }
|
|
18425
18320
|
};
|
|
18426
18321
|
}
|
|
18427
|
-
var
|
|
18322
|
+
var UNARY_OPERATORS, BINARY_OPERATORS;
|
|
18428
18323
|
var init_translator = __esm(() => {
|
|
18429
|
-
o = (() => {
|
|
18430
|
-
try {
|
|
18431
|
-
return __require("@angular/compiler");
|
|
18432
|
-
} catch {
|
|
18433
|
-
const stub = new Proxy(function() {}, { apply: () => stub, construct: () => stub, get: () => stub });
|
|
18434
|
-
return stub;
|
|
18435
|
-
}
|
|
18436
|
-
})();
|
|
18437
18324
|
UNARY_OPERATORS = /* @__PURE__ */ new Map([
|
|
18438
18325
|
[o.UnaryOperator.Minus, "-"],
|
|
18439
18326
|
[o.UnaryOperator.Plus, "+"]
|
|
@@ -18771,18 +18658,9 @@ var init_typescript_ast_factory = __esm(() => {
|
|
|
18771
18658
|
function translateStatement(contextFile, statement, imports, options = {}) {
|
|
18772
18659
|
return statement.visitStatement(new ExpressionTranslatorVisitor(new TypeScriptAstFactory(options.annotateForClosureCompiler === true), imports, contextFile, options), new Context(true));
|
|
18773
18660
|
}
|
|
18774
|
-
var o2;
|
|
18775
18661
|
var init_typescript_translator = __esm(() => {
|
|
18776
18662
|
init_translator();
|
|
18777
18663
|
init_typescript_ast_factory();
|
|
18778
|
-
o2 = (() => {
|
|
18779
|
-
try {
|
|
18780
|
-
return __require("@angular/compiler");
|
|
18781
|
-
} catch {
|
|
18782
|
-
const stub = new Proxy(function() {}, { apply: () => stub, construct: () => stub, get: () => stub });
|
|
18783
|
-
return stub;
|
|
18784
|
-
}
|
|
18785
|
-
})();
|
|
18786
18664
|
});
|
|
18787
18665
|
|
|
18788
18666
|
// src/dev/angular/fastHmrCompiler.ts
|
|
@@ -18794,7 +18672,7 @@ __export(exports_fastHmrCompiler, {
|
|
|
18794
18672
|
invalidateFingerprintCache: () => invalidateFingerprintCache
|
|
18795
18673
|
});
|
|
18796
18674
|
import { existsSync as existsSync25, readFileSync as readFileSync19, statSync as statSync4 } from "fs";
|
|
18797
|
-
import { dirname as
|
|
18675
|
+
import { dirname as dirname18, extname as extname10, relative as relative13, resolve as resolve32 } from "path";
|
|
18798
18676
|
import ts7 from "typescript";
|
|
18799
18677
|
var fail = (reason, detail, location) => ({
|
|
18800
18678
|
ok: false,
|
|
@@ -19016,7 +18894,7 @@ var fail = (reason, detail, location) => ({
|
|
|
19016
18894
|
if (!spec.startsWith(".") && !spec.startsWith("/")) {
|
|
19017
18895
|
return true;
|
|
19018
18896
|
}
|
|
19019
|
-
const base =
|
|
18897
|
+
const base = resolve32(componentDir, spec);
|
|
19020
18898
|
const candidates = [
|
|
19021
18899
|
`${base}.ts`,
|
|
19022
18900
|
`${base}.tsx`,
|
|
@@ -19779,7 +19657,7 @@ var fail = (reason, detail, location) => ({
|
|
|
19779
19657
|
});
|
|
19780
19658
|
if (!names.includes(className))
|
|
19781
19659
|
continue;
|
|
19782
|
-
const nextDts = resolveDtsFromSpec(fromPath,
|
|
19660
|
+
const nextDts = resolveDtsFromSpec(fromPath, dirname18(startDtsPath));
|
|
19783
19661
|
if (!nextDts)
|
|
19784
19662
|
continue;
|
|
19785
19663
|
const found = findDtsContainingClass(nextDts, className, visited);
|
|
@@ -19789,7 +19667,7 @@ var fail = (reason, detail, location) => ({
|
|
|
19789
19667
|
const starReExportRe = /export\s*\*\s*from\s*["']([^"']+)["']/g;
|
|
19790
19668
|
while ((m = starReExportRe.exec(content)) !== null) {
|
|
19791
19669
|
const fromPath = m[1] || "";
|
|
19792
|
-
const nextDts = resolveDtsFromSpec(fromPath,
|
|
19670
|
+
const nextDts = resolveDtsFromSpec(fromPath, dirname18(startDtsPath));
|
|
19793
19671
|
if (!nextDts)
|
|
19794
19672
|
continue;
|
|
19795
19673
|
const found = findDtsContainingClass(nextDts, className, visited);
|
|
@@ -19799,7 +19677,7 @@ var fail = (reason, detail, location) => ({
|
|
|
19799
19677
|
return null;
|
|
19800
19678
|
}, resolveDtsFromSpec = (spec, fromDir) => {
|
|
19801
19679
|
const stripped = spec.replace(/\.[mc]?js$/, "");
|
|
19802
|
-
const base =
|
|
19680
|
+
const base = resolve32(fromDir, stripped);
|
|
19803
19681
|
const candidates = [
|
|
19804
19682
|
`${base}.d.ts`,
|
|
19805
19683
|
`${base}.d.mts`,
|
|
@@ -19823,7 +19701,7 @@ var fail = (reason, detail, location) => ({
|
|
|
19823
19701
|
return null;
|
|
19824
19702
|
}, resolveChildComponentInfo = (className, spec, componentDir, projectRoot) => {
|
|
19825
19703
|
if (spec.startsWith(".") || spec.startsWith("/")) {
|
|
19826
|
-
const base =
|
|
19704
|
+
const base = resolve32(componentDir, spec);
|
|
19827
19705
|
const candidates = [
|
|
19828
19706
|
`${base}.ts`,
|
|
19829
19707
|
`${base}.tsx`,
|
|
@@ -19993,13 +19871,13 @@ var fail = (reason, detail, location) => ({
|
|
|
19993
19871
|
}
|
|
19994
19872
|
if (!matches)
|
|
19995
19873
|
continue;
|
|
19996
|
-
const resolved =
|
|
19874
|
+
const resolved = resolve32(componentDir, spec);
|
|
19997
19875
|
for (const ext of TS_EXTENSIONS) {
|
|
19998
19876
|
const candidate = resolved + ext;
|
|
19999
19877
|
if (existsSync25(candidate))
|
|
20000
19878
|
return candidate;
|
|
20001
19879
|
}
|
|
20002
|
-
const indexCandidate =
|
|
19880
|
+
const indexCandidate = resolve32(resolved, "index.ts");
|
|
20003
19881
|
if (existsSync25(indexCandidate))
|
|
20004
19882
|
return indexCandidate;
|
|
20005
19883
|
}
|
|
@@ -20186,7 +20064,7 @@ ${transpiled}
|
|
|
20186
20064
|
}
|
|
20187
20065
|
}${staticPatch}`;
|
|
20188
20066
|
}, STYLE_PREPROCESSED_EXT, resolveAndReadStyleResource = (componentDir, url) => {
|
|
20189
|
-
const abs =
|
|
20067
|
+
const abs = resolve32(componentDir, url);
|
|
20190
20068
|
if (!existsSync25(abs))
|
|
20191
20069
|
return null;
|
|
20192
20070
|
const ext = extname10(abs).toLowerCase();
|
|
@@ -20226,7 +20104,7 @@ ${block}
|
|
|
20226
20104
|
const cached = projectOptionsCache.get(projectRoot);
|
|
20227
20105
|
if (cached !== undefined)
|
|
20228
20106
|
return cached;
|
|
20229
|
-
const tsconfigPath =
|
|
20107
|
+
const tsconfigPath = resolve32(projectRoot, "tsconfig.json");
|
|
20230
20108
|
const opts = {};
|
|
20231
20109
|
if (existsSync25(tsconfigPath)) {
|
|
20232
20110
|
try {
|
|
@@ -20272,7 +20150,7 @@ ${block}
|
|
|
20272
20150
|
}
|
|
20273
20151
|
const kind = params.kind ?? "component";
|
|
20274
20152
|
if (kind !== "component") {
|
|
20275
|
-
const entityId = encodeURIComponent(`${
|
|
20153
|
+
const entityId = encodeURIComponent(`${relative13(projectRoot, componentFilePath).replace(/\\/g, "/")}@${className}`);
|
|
20276
20154
|
const currentEntityFingerprint = extractEntityFingerprint(classNode, className, sourceFile);
|
|
20277
20155
|
const cachedEntityFingerprint = entityFingerprintCache.get(entityId);
|
|
20278
20156
|
if (cachedEntityFingerprint !== undefined && !entityFingerprintsEqual(cachedEntityFingerprint, currentEntityFingerprint)) {
|
|
@@ -20290,7 +20168,7 @@ ${block}
|
|
|
20290
20168
|
ok: true
|
|
20291
20169
|
};
|
|
20292
20170
|
}
|
|
20293
|
-
if (inheritsDecoratedClass(classNode, sourceFile,
|
|
20171
|
+
if (inheritsDecoratedClass(classNode, sourceFile, dirname18(componentFilePath), projectRoot)) {
|
|
20294
20172
|
return fail("inherits-decorated-class");
|
|
20295
20173
|
}
|
|
20296
20174
|
const decorator = findComponentDecorator(classNode);
|
|
@@ -20302,14 +20180,14 @@ ${block}
|
|
|
20302
20180
|
const projectDefaults = readProjectAngularCompilerOptions(projectRoot);
|
|
20303
20181
|
const decoratorMeta = readDecoratorMeta(decoratorArgs, projectDefaults);
|
|
20304
20182
|
const advancedMetadata = extractAdvancedMetadata(classNode, decoratorArgs, compiler);
|
|
20305
|
-
const componentDir =
|
|
20183
|
+
const componentDir = dirname18(componentFilePath);
|
|
20306
20184
|
let templateText;
|
|
20307
20185
|
let templatePath;
|
|
20308
20186
|
if (decoratorMeta.template !== null) {
|
|
20309
20187
|
templateText = decoratorMeta.template;
|
|
20310
20188
|
templatePath = componentFilePath;
|
|
20311
20189
|
} else if (decoratorMeta.templateUrl) {
|
|
20312
|
-
const tplAbs =
|
|
20190
|
+
const tplAbs = resolve32(componentDir, decoratorMeta.templateUrl);
|
|
20313
20191
|
if (!existsSync25(tplAbs)) {
|
|
20314
20192
|
return fail("template-resource-not-found", `Template file not found: ${tplAbs}`, { file: componentFilePath });
|
|
20315
20193
|
}
|
|
@@ -20360,7 +20238,7 @@ ${block}
|
|
|
20360
20238
|
hasDecoratorIO,
|
|
20361
20239
|
hasSignalIO
|
|
20362
20240
|
} = extractInputsAndOutputs(classNode, compiler);
|
|
20363
|
-
const projectRelPath =
|
|
20241
|
+
const projectRelPath = relative13(projectRoot, componentFilePath).replace(/\\/g, "/");
|
|
20364
20242
|
const fingerprintId = encodeURIComponent(`${projectRelPath}@${className}`);
|
|
20365
20243
|
const currentFingerprint = extractFingerprint(classNode, className, decoratorMeta, inputs, outputs, sourceFile, componentDir);
|
|
20366
20244
|
const cachedFingerprint = fingerprintCache.get(fingerprintId);
|
|
@@ -20614,7 +20492,7 @@ __export(exports_hmrCompiler, {
|
|
|
20614
20492
|
getApplyMetadataModule: () => getApplyMetadataModule,
|
|
20615
20493
|
encodeHmrComponentId: () => encodeHmrComponentId
|
|
20616
20494
|
});
|
|
20617
|
-
import { dirname as
|
|
20495
|
+
import { dirname as dirname19, relative as relative14, resolve as resolve33 } from "path";
|
|
20618
20496
|
import { performance as performance2 } from "perf_hooks";
|
|
20619
20497
|
var getApplyMetadataModule = async (encodedId) => {
|
|
20620
20498
|
const decoded = decodeURIComponent(encodedId);
|
|
@@ -20623,8 +20501,8 @@ var getApplyMetadataModule = async (encodedId) => {
|
|
|
20623
20501
|
return null;
|
|
20624
20502
|
const filePathRel = decoded.slice(0, at2);
|
|
20625
20503
|
const className = decoded.slice(at2 + 1);
|
|
20626
|
-
const componentFilePath =
|
|
20627
|
-
const projectRelPath =
|
|
20504
|
+
const componentFilePath = resolve33(process.cwd(), filePathRel);
|
|
20505
|
+
const projectRelPath = relative14(process.cwd(), componentFilePath).replace(/\\/g, "/");
|
|
20628
20506
|
const cacheKey2 = encodeURIComponent(`${projectRelPath}@${className}`);
|
|
20629
20507
|
const { takePendingModule: takePendingModule2 } = await Promise.resolve().then(() => (init_fastHmrCompiler(), exports_fastHmrCompiler));
|
|
20630
20508
|
const cached = takePendingModule2(cacheKey2);
|
|
@@ -20634,9 +20512,9 @@ var getApplyMetadataModule = async (encodedId) => {
|
|
|
20634
20512
|
const { resolveOwningComponents: resolveOwningComponents2 } = await Promise.resolve().then(() => (init_resolveOwningComponents(), exports_resolveOwningComponents));
|
|
20635
20513
|
const owners = resolveOwningComponents2({
|
|
20636
20514
|
changedFilePath: componentFilePath,
|
|
20637
|
-
userAngularRoot:
|
|
20515
|
+
userAngularRoot: dirname19(componentFilePath)
|
|
20638
20516
|
});
|
|
20639
|
-
const owner = owners.find((
|
|
20517
|
+
const owner = owners.find((o2) => o2.className === className);
|
|
20640
20518
|
const kind = owner?.kind ?? "component";
|
|
20641
20519
|
const fastStart = performance2.now();
|
|
20642
20520
|
const fast = await tryFastHmr({ className, componentFilePath, kind });
|
|
@@ -20646,7 +20524,7 @@ var getApplyMetadataModule = async (encodedId) => {
|
|
|
20646
20524
|
}
|
|
20647
20525
|
return null;
|
|
20648
20526
|
}, encodeHmrComponentId = (absoluteFilePath, className) => {
|
|
20649
|
-
const projectRel =
|
|
20527
|
+
const projectRel = relative14(process.cwd(), absoluteFilePath).replace(/\\/g, "/");
|
|
20650
20528
|
return `${projectRel}@${className}`;
|
|
20651
20529
|
};
|
|
20652
20530
|
var init_hmrCompiler = __esm(() => {
|
|
@@ -20785,11 +20663,11 @@ var exports_simpleHTMLHMR = {};
|
|
|
20785
20663
|
__export(exports_simpleHTMLHMR, {
|
|
20786
20664
|
handleHTMLUpdate: () => handleHTMLUpdate
|
|
20787
20665
|
});
|
|
20788
|
-
import { resolve as
|
|
20666
|
+
import { resolve as resolve34 } from "path";
|
|
20789
20667
|
var handleHTMLUpdate = async (htmlFilePath) => {
|
|
20790
20668
|
let htmlContent;
|
|
20791
20669
|
try {
|
|
20792
|
-
const resolvedPath =
|
|
20670
|
+
const resolvedPath = resolve34(htmlFilePath);
|
|
20793
20671
|
const file4 = Bun.file(resolvedPath);
|
|
20794
20672
|
if (!await file4.exists()) {
|
|
20795
20673
|
return null;
|
|
@@ -20815,11 +20693,11 @@ var exports_simpleHTMXHMR = {};
|
|
|
20815
20693
|
__export(exports_simpleHTMXHMR, {
|
|
20816
20694
|
handleHTMXUpdate: () => handleHTMXUpdate
|
|
20817
20695
|
});
|
|
20818
|
-
import { resolve as
|
|
20696
|
+
import { resolve as resolve35 } from "path";
|
|
20819
20697
|
var handleHTMXUpdate = async (htmxFilePath) => {
|
|
20820
20698
|
let htmlContent;
|
|
20821
20699
|
try {
|
|
20822
|
-
const resolvedPath =
|
|
20700
|
+
const resolvedPath = resolve35(htmxFilePath);
|
|
20823
20701
|
const file4 = Bun.file(resolvedPath);
|
|
20824
20702
|
if (!await file4.exists()) {
|
|
20825
20703
|
return null;
|
|
@@ -20842,7 +20720,7 @@ var init_simpleHTMXHMR = () => {};
|
|
|
20842
20720
|
|
|
20843
20721
|
// src/dev/rebuildTrigger.ts
|
|
20844
20722
|
import { existsSync as existsSync26 } from "fs";
|
|
20845
|
-
import { basename as basename11, dirname as
|
|
20723
|
+
import { basename as basename11, dirname as dirname20, relative as relative15, resolve as resolve36, sep as sep4 } from "path";
|
|
20846
20724
|
var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequentially = (items, action) => items.reduce((chain, item) => chain.then(() => action(item)), Promise.resolve()), getStyleTransformConfig = (config) => createStyleTransformConfig(config.stylePreprocessors, config.postcss), recompileTailwindForFastPath = async (state, config, files) => {
|
|
20847
20725
|
if (!config.tailwind)
|
|
20848
20726
|
return;
|
|
@@ -20934,7 +20812,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
20934
20812
|
state.fileHashes.delete(filePathInSet);
|
|
20935
20813
|
try {
|
|
20936
20814
|
const affectedFiles = getAffectedFiles(state.dependencyGraph, filePathInSet);
|
|
20937
|
-
const deletedPathResolved =
|
|
20815
|
+
const deletedPathResolved = resolve36(filePathInSet);
|
|
20938
20816
|
affectedFiles.forEach((affectedFile) => {
|
|
20939
20817
|
if (isValidDeletedAffectedFile(affectedFile, deletedPathResolved, processedFiles)) {
|
|
20940
20818
|
validFiles.push(affectedFile);
|
|
@@ -20978,7 +20856,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
20978
20856
|
if (storedHash !== undefined && storedHash === fileHash) {
|
|
20979
20857
|
return;
|
|
20980
20858
|
}
|
|
20981
|
-
const normalizedFilePath =
|
|
20859
|
+
const normalizedFilePath = resolve36(filePathInSet);
|
|
20982
20860
|
if (!processedFiles.has(normalizedFilePath)) {
|
|
20983
20861
|
validFiles.push(normalizedFilePath);
|
|
20984
20862
|
processedFiles.add(normalizedFilePath);
|
|
@@ -21082,8 +20960,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
21082
20960
|
return;
|
|
21083
20961
|
}
|
|
21084
20962
|
if (framework === "unknown") {
|
|
21085
|
-
invalidate(
|
|
21086
|
-
const relPath =
|
|
20963
|
+
invalidate(resolve36(filePath));
|
|
20964
|
+
const relPath = relative15(process.cwd(), filePath);
|
|
21087
20965
|
logHmrUpdate(relPath);
|
|
21088
20966
|
return;
|
|
21089
20967
|
}
|
|
@@ -21109,7 +20987,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
21109
20987
|
const userEditedFiles = new Set;
|
|
21110
20988
|
state.fileChangeQueue.forEach((filePaths) => {
|
|
21111
20989
|
for (const filePath2 of filePaths) {
|
|
21112
|
-
userEditedFiles.add(
|
|
20990
|
+
userEditedFiles.add(resolve36(filePath2));
|
|
21113
20991
|
}
|
|
21114
20992
|
});
|
|
21115
20993
|
state.lastUserEditedFiles = userEditedFiles;
|
|
@@ -21138,7 +21016,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
21138
21016
|
}
|
|
21139
21017
|
if (!graph)
|
|
21140
21018
|
return componentFile;
|
|
21141
|
-
const dependents = graph.dependents.get(
|
|
21019
|
+
const dependents = graph.dependents.get(resolve36(componentFile));
|
|
21142
21020
|
if (!dependents)
|
|
21143
21021
|
return componentFile;
|
|
21144
21022
|
for (const dep of dependents) {
|
|
@@ -21147,7 +21025,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
21147
21025
|
}
|
|
21148
21026
|
return componentFile;
|
|
21149
21027
|
}, resolveAngularPageEntries = (state, angularFiles, angularPagesPath) => {
|
|
21150
|
-
const pageEntries = angularFiles.filter((file4) => file4.endsWith(".ts") &&
|
|
21028
|
+
const pageEntries = angularFiles.filter((file4) => file4.endsWith(".ts") && resolve36(file4).startsWith(angularPagesPath));
|
|
21151
21029
|
if (pageEntries.length > 0 || !state.dependencyGraph) {
|
|
21152
21030
|
return pageEntries;
|
|
21153
21031
|
}
|
|
@@ -21156,7 +21034,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
21156
21034
|
const lookupFile = resolveComponentLookupFile(componentFile, state.dependencyGraph);
|
|
21157
21035
|
const affected = getAffectedFiles(state.dependencyGraph, lookupFile);
|
|
21158
21036
|
affected.forEach((file4) => {
|
|
21159
|
-
if (file4.endsWith(".ts") &&
|
|
21037
|
+
if (file4.endsWith(".ts") && resolve36(file4).startsWith(angularPagesPath)) {
|
|
21160
21038
|
resolvedPages.add(file4);
|
|
21161
21039
|
}
|
|
21162
21040
|
});
|
|
@@ -21428,16 +21306,16 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
21428
21306
|
};
|
|
21429
21307
|
const fire = () => {
|
|
21430
21308
|
ctx.debounceTimer = null;
|
|
21431
|
-
const
|
|
21309
|
+
const resolve37 = ctx.debouncedResolve;
|
|
21432
21310
|
ctx.debouncedResolve = null;
|
|
21433
21311
|
ctx.debouncedPromise = null;
|
|
21434
21312
|
if (ctx.inFlight) {
|
|
21435
21313
|
ctx.pending = true;
|
|
21436
|
-
ctx.inFlight.finally(() =>
|
|
21314
|
+
ctx.inFlight.finally(() => resolve37?.());
|
|
21437
21315
|
return;
|
|
21438
21316
|
}
|
|
21439
21317
|
ctx.inFlight = drive();
|
|
21440
|
-
ctx.inFlight.finally(() =>
|
|
21318
|
+
ctx.inFlight.finally(() => resolve37?.());
|
|
21441
21319
|
};
|
|
21442
21320
|
return ({ immediate = false } = {}) => {
|
|
21443
21321
|
if (!ctx.debouncedPromise) {
|
|
@@ -21464,9 +21342,9 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
21464
21342
|
const diskRefreshPromise = (async () => {
|
|
21465
21343
|
if (!angularDir || editedFiles.size === 0)
|
|
21466
21344
|
return;
|
|
21467
|
-
const angularDirAbs =
|
|
21345
|
+
const angularDirAbs = resolve36(angularDir);
|
|
21468
21346
|
const filesUnderAngular = Array.from(editedFiles).filter((file4) => {
|
|
21469
|
-
const abs =
|
|
21347
|
+
const abs = resolve36(file4);
|
|
21470
21348
|
return abs === angularDirAbs || abs.startsWith(angularDirAbs + sep4);
|
|
21471
21349
|
});
|
|
21472
21350
|
if (filesUnderAngular.length === 0)
|
|
@@ -21488,7 +21366,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
21488
21366
|
if (!ext)
|
|
21489
21367
|
continue;
|
|
21490
21368
|
if (ext === ".ts" || ext === ".tsx") {
|
|
21491
|
-
tsFilesToRefresh.add(
|
|
21369
|
+
tsFilesToRefresh.add(resolve36(file4));
|
|
21492
21370
|
continue;
|
|
21493
21371
|
}
|
|
21494
21372
|
const owners = resolveOwningComponents2({
|
|
@@ -21496,7 +21374,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
21496
21374
|
userAngularRoot: angularDirAbs
|
|
21497
21375
|
});
|
|
21498
21376
|
for (const owner of owners) {
|
|
21499
|
-
tsFilesToRefresh.add(
|
|
21377
|
+
tsFilesToRefresh.add(resolve36(owner.componentFilePath));
|
|
21500
21378
|
}
|
|
21501
21379
|
}
|
|
21502
21380
|
if (tsFilesToRefresh.size === 0)
|
|
@@ -21507,8 +21385,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
21507
21385
|
try {
|
|
21508
21386
|
const { invalidateModule: invalidateModule2 } = await Promise.resolve().then(() => (init_moduleServer(), exports_moduleServer));
|
|
21509
21387
|
for (const tsFile of tsFilesToRefresh) {
|
|
21510
|
-
const rel =
|
|
21511
|
-
const compiledFile =
|
|
21388
|
+
const rel = relative15(angularDirAbs, tsFile).replace(/\\/g, "/").replace(/\.[tj]sx?$/, ".js");
|
|
21389
|
+
const compiledFile = resolve36(compiledRoot, rel);
|
|
21512
21390
|
invalidateModule2(compiledFile);
|
|
21513
21391
|
}
|
|
21514
21392
|
} catch {}
|
|
@@ -21537,7 +21415,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
21537
21415
|
serverPaths.forEach((serverPath, idx) => {
|
|
21538
21416
|
const fileBase = basename11(serverPath, ".js");
|
|
21539
21417
|
const ssrPath = ssrPaths[idx] ?? serverPath;
|
|
21540
|
-
state.manifest[toPascal(fileBase)] =
|
|
21418
|
+
state.manifest[toPascal(fileBase)] = resolve36(ssrPath);
|
|
21541
21419
|
});
|
|
21542
21420
|
if (clientPaths.length > 0) {
|
|
21543
21421
|
await bundleAngularClient(state, clientPaths, state.resolvedPaths.buildDir, angularDir);
|
|
@@ -21546,9 +21424,9 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
21546
21424
|
const angularDir = config.angularDirectory ?? "";
|
|
21547
21425
|
const angularFiles = filesToRebuild.filter((file4) => detectFramework(file4, state.resolvedPaths) === "angular");
|
|
21548
21426
|
for (const file4 of angularFiles) {
|
|
21549
|
-
state.fileHashes.set(
|
|
21427
|
+
state.fileHashes.set(resolve36(file4), computeFileHash(file4));
|
|
21550
21428
|
}
|
|
21551
|
-
const angularPagesPath =
|
|
21429
|
+
const angularPagesPath = resolve36(angularDir, "pages");
|
|
21552
21430
|
const pageEntries = resolveAngularPageEntries(state, angularFiles, angularPagesPath);
|
|
21553
21431
|
const tierStart = performance.now();
|
|
21554
21432
|
const verdict = await decideAngularTier(state, angularDir);
|
|
@@ -21578,7 +21456,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
21578
21456
|
}, getModuleUrl = async (pageFile) => {
|
|
21579
21457
|
const { invalidateModule: invalidateModule2, warmCache: warmCache2, SRC_URL_PREFIX: SRC_URL_PREFIX2 } = await Promise.resolve().then(() => (init_moduleServer(), exports_moduleServer));
|
|
21580
21458
|
invalidateModule2(pageFile);
|
|
21581
|
-
const rel =
|
|
21459
|
+
const rel = relative15(process.cwd(), pageFile).replace(/\\/g, "/");
|
|
21582
21460
|
const url = `${SRC_URL_PREFIX2}${rel}`;
|
|
21583
21461
|
warmCache2(url);
|
|
21584
21462
|
return url;
|
|
@@ -21587,11 +21465,11 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
21587
21465
|
if (isComponentFile2)
|
|
21588
21466
|
return primaryFile;
|
|
21589
21467
|
const { findNearestComponent: findNearestComponent2 } = await Promise.resolve().then(() => (init_transformCache(), exports_transformCache));
|
|
21590
|
-
const nearest = findNearestComponent2(
|
|
21468
|
+
const nearest = findNearestComponent2(resolve36(primaryFile));
|
|
21591
21469
|
return nearest ?? primaryFile;
|
|
21592
21470
|
}, handleReactModuleServerPath = async (state, reactFiles, startTime, onRebuildComplete) => {
|
|
21593
21471
|
for (const file4 of reactFiles) {
|
|
21594
|
-
state.fileHashes.set(
|
|
21472
|
+
state.fileHashes.set(resolve36(file4), computeFileHash(file4));
|
|
21595
21473
|
}
|
|
21596
21474
|
markSsrCacheDirty("react");
|
|
21597
21475
|
const primaryFile = reactFiles.find((file4) => !file4.replace(/\\/g, "/").includes("/pages/")) ?? reactFiles[0];
|
|
@@ -21610,7 +21488,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
21610
21488
|
const pageModuleUrl = await getReactModuleUrl(broadcastTarget);
|
|
21611
21489
|
if (pageModuleUrl) {
|
|
21612
21490
|
const serverDuration = Date.now() - startTime;
|
|
21613
|
-
state.lastHmrPath =
|
|
21491
|
+
state.lastHmrPath = relative15(process.cwd(), primaryFile).replace(/\\/g, "/");
|
|
21614
21492
|
state.lastHmrFramework = "react";
|
|
21615
21493
|
broadcastToClients(state, {
|
|
21616
21494
|
data: {
|
|
@@ -21673,7 +21551,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
21673
21551
|
});
|
|
21674
21552
|
}, handleSvelteModuleServerPath = async (state, svelteFiles, startTime, onRebuildComplete) => {
|
|
21675
21553
|
for (const file4 of svelteFiles) {
|
|
21676
|
-
state.fileHashes.set(
|
|
21554
|
+
state.fileHashes.set(resolve36(file4), computeFileHash(file4));
|
|
21677
21555
|
}
|
|
21678
21556
|
markSsrCacheDirty("svelte");
|
|
21679
21557
|
const serverDuration = Date.now() - startTime;
|
|
@@ -21698,8 +21576,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
21698
21576
|
const serverEntries = [...svelteServerPaths];
|
|
21699
21577
|
const clientEntries = [...svelteIndexPaths, ...svelteClientPaths];
|
|
21700
21578
|
const { getFrameworkGeneratedDir: getFrameworkGeneratedDir2 } = await Promise.resolve().then(() => (init_generatedDir(), exports_generatedDir));
|
|
21701
|
-
const serverRoot =
|
|
21702
|
-
const serverOutDir =
|
|
21579
|
+
const serverRoot = resolve36(getFrameworkGeneratedDir2("svelte"), "server");
|
|
21580
|
+
const serverOutDir = resolve36(buildDir, basename11(svelteDir));
|
|
21703
21581
|
const [serverResult, clientResult] = await Promise.all([
|
|
21704
21582
|
serverEntries.length > 0 ? bunBuild9({
|
|
21705
21583
|
entrypoints: serverEntries,
|
|
@@ -21796,7 +21674,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
21796
21674
|
});
|
|
21797
21675
|
}, handleVueModuleServerPath = async (state, vueFiles, nonVueFiles, startTime, onRebuildComplete) => {
|
|
21798
21676
|
for (const file4 of [...vueFiles, ...nonVueFiles]) {
|
|
21799
|
-
state.fileHashes.set(
|
|
21677
|
+
state.fileHashes.set(resolve36(file4), computeFileHash(file4));
|
|
21800
21678
|
}
|
|
21801
21679
|
markSsrCacheDirty("vue");
|
|
21802
21680
|
await invalidateNonVueModules(nonVueFiles);
|
|
@@ -21824,7 +21702,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
21824
21702
|
recursive: true,
|
|
21825
21703
|
withFileTypes: true
|
|
21826
21704
|
});
|
|
21827
|
-
return entries.filter((entry) => entry.isFile() && EMBER_PAGE_EXTENSIONS.some((ext) => entry.name.endsWith(ext))).map((entry) =>
|
|
21705
|
+
return entries.filter((entry) => entry.isFile() && EMBER_PAGE_EXTENSIONS.some((ext) => entry.name.endsWith(ext))).map((entry) => resolve36(emberPagesPath, entry.name));
|
|
21828
21706
|
} catch {
|
|
21829
21707
|
return [];
|
|
21830
21708
|
}
|
|
@@ -21836,10 +21714,10 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
21836
21714
|
return state.manifest;
|
|
21837
21715
|
}
|
|
21838
21716
|
for (const file4 of emberFiles) {
|
|
21839
|
-
state.fileHashes.set(
|
|
21717
|
+
state.fileHashes.set(resolve36(file4), computeFileHash(file4));
|
|
21840
21718
|
}
|
|
21841
|
-
const emberPagesPath =
|
|
21842
|
-
const directPageEntries = emberFiles.filter((file4) =>
|
|
21719
|
+
const emberPagesPath = resolve36(emberDir, "pages");
|
|
21720
|
+
const directPageEntries = emberFiles.filter((file4) => resolve36(file4).startsWith(emberPagesPath));
|
|
21843
21721
|
const allPageEntries = directPageEntries.length > 0 ? directPageEntries : await collectAllEmberPages(emberPagesPath);
|
|
21844
21722
|
if (allPageEntries.length === 0) {
|
|
21845
21723
|
onRebuildComplete({ hmrState: state, manifest: state.manifest });
|
|
@@ -21849,14 +21727,14 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
21849
21727
|
const { serverPaths } = await compileEmber2(allPageEntries, emberDir, process.cwd(), true);
|
|
21850
21728
|
for (const serverPath of serverPaths) {
|
|
21851
21729
|
const fileBase = basename11(serverPath, ".js");
|
|
21852
|
-
state.manifest[toPascal(fileBase)] =
|
|
21730
|
+
state.manifest[toPascal(fileBase)] = resolve36(serverPath);
|
|
21853
21731
|
}
|
|
21854
21732
|
const { invalidateEmberSsrCache: invalidateEmberSsrCache2 } = await Promise.resolve().then(() => (init_ember(), exports_ember));
|
|
21855
21733
|
invalidateEmberSsrCache2();
|
|
21856
21734
|
const duration = Date.now() - startTime;
|
|
21857
21735
|
const [primary] = emberFiles;
|
|
21858
21736
|
if (primary) {
|
|
21859
|
-
state.lastHmrPath =
|
|
21737
|
+
state.lastHmrPath = relative15(process.cwd(), primary).replace(/\\/g, "/");
|
|
21860
21738
|
state.lastHmrFramework = "ember";
|
|
21861
21739
|
logHmrUpdate(primary, "ember", duration);
|
|
21862
21740
|
}
|
|
@@ -21941,8 +21819,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
21941
21819
|
if (!buildReference?.source) {
|
|
21942
21820
|
return;
|
|
21943
21821
|
}
|
|
21944
|
-
const sourcePath = buildReference.source.startsWith("file://") ? new URL(buildReference.source).pathname :
|
|
21945
|
-
islandFiles.add(
|
|
21822
|
+
const sourcePath = buildReference.source.startsWith("file://") ? new URL(buildReference.source).pathname : resolve36(dirname20(buildInfo.resolvedRegistryPath), buildReference.source);
|
|
21823
|
+
islandFiles.add(resolve36(sourcePath));
|
|
21946
21824
|
}, resolveIslandSourceFiles = async (config) => {
|
|
21947
21825
|
const registryPath = config.islands?.registry;
|
|
21948
21826
|
if (!registryPath) {
|
|
@@ -21950,7 +21828,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
21950
21828
|
}
|
|
21951
21829
|
const buildInfo = await loadIslandRegistryBuildInfo(registryPath);
|
|
21952
21830
|
const islandFiles = new Set([
|
|
21953
|
-
|
|
21831
|
+
resolve36(buildInfo.resolvedRegistryPath)
|
|
21954
21832
|
]);
|
|
21955
21833
|
for (const definition of buildInfo.definitions) {
|
|
21956
21834
|
resolveIslandDefinitionSource(definition, buildInfo, islandFiles);
|
|
@@ -21961,7 +21839,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
21961
21839
|
if (islandFiles.size === 0) {
|
|
21962
21840
|
return false;
|
|
21963
21841
|
}
|
|
21964
|
-
return filesToRebuild.some((file4) => islandFiles.has(
|
|
21842
|
+
return filesToRebuild.some((file4) => islandFiles.has(resolve36(file4)));
|
|
21965
21843
|
}, handleIslandSourceReload = async (state, config, filesToRebuild, manifest) => {
|
|
21966
21844
|
const shouldReload = await didStaticPagesNeedIslandRefresh(config, filesToRebuild);
|
|
21967
21845
|
if (!shouldReload) {
|
|
@@ -21996,10 +21874,10 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
21996
21874
|
}, computeOutputPagesDir = (state, config, framework) => {
|
|
21997
21875
|
const isSingle = !config.reactDirectory && !config.svelteDirectory && !config.vueDirectory && (framework === "html" ? !config.htmxDirectory : !config.htmlDirectory);
|
|
21998
21876
|
if (isSingle) {
|
|
21999
|
-
return
|
|
21877
|
+
return resolve36(state.resolvedPaths.buildDir, "pages");
|
|
22000
21878
|
}
|
|
22001
21879
|
const dirName = framework === "html" ? basename11(config.htmlDirectory ?? "html") : basename11(config.htmxDirectory ?? "htmx");
|
|
22002
|
-
return
|
|
21880
|
+
return resolve36(state.resolvedPaths.buildDir, dirName, "pages");
|
|
22003
21881
|
}, processHtmlPageUpdate = async (state, pageFile, builtHtmlPagePath, manifest, duration) => {
|
|
22004
21882
|
try {
|
|
22005
21883
|
const { handleHTMLUpdate: handleHTMLUpdate2 } = await Promise.resolve().then(() => (init_simpleHTMLHMR(), exports_simpleHTMLHMR));
|
|
@@ -22038,7 +21916,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
22038
21916
|
const pageFilesToUpdate = shouldRefreshAllPages ? await scanEntryPoints(outputHtmlPages, "*.html") : htmlPageFiles;
|
|
22039
21917
|
await runSequentially(pageFilesToUpdate, async (pageFile) => {
|
|
22040
21918
|
const htmlPageName = basename11(pageFile);
|
|
22041
|
-
const builtHtmlPagePath =
|
|
21919
|
+
const builtHtmlPagePath = resolve36(outputHtmlPages, htmlPageName);
|
|
22042
21920
|
await processHtmlPageUpdate(state, pageFile, builtHtmlPagePath, manifest, duration);
|
|
22043
21921
|
});
|
|
22044
21922
|
}, handleVueCssOnlyUpdate = (state, vueCssFiles, manifest, duration) => {
|
|
@@ -22099,11 +21977,11 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
22099
21977
|
const baseName = fileName.replace(/\.vue$/, "");
|
|
22100
21978
|
const pascalName = toPascal(baseName);
|
|
22101
21979
|
const vueRoot = config.vueDirectory;
|
|
22102
|
-
const hmrId = vueRoot ?
|
|
21980
|
+
const hmrId = vueRoot ? relative15(vueRoot, vuePagePath).replace(/\\/g, "/").replace(/\.vue$/, "") : baseName;
|
|
22103
21981
|
const cssKey = `${pascalName}CSS`;
|
|
22104
21982
|
const cssUrl = manifest[cssKey] || null;
|
|
22105
21983
|
const { vueHmrMetadata: vueHmrMetadata2 } = await Promise.resolve().then(() => (init_compileVue(), exports_compileVue));
|
|
22106
|
-
const hmrMeta = vueHmrMetadata2.get(
|
|
21984
|
+
const hmrMeta = vueHmrMetadata2.get(resolve36(vuePagePath));
|
|
22107
21985
|
const changeType = hmrMeta?.changeType ?? "full";
|
|
22108
21986
|
if (changeType === "style-only") {
|
|
22109
21987
|
broadcastVueStyleOnly(state, vuePagePath, baseName, cssUrl, hmrId, manifest, duration);
|
|
@@ -22288,7 +22166,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
22288
22166
|
const pageFilesToUpdate = shouldRefreshAllPages ? await scanEntryPoints(outputHtmxPages, "*.html") : htmxPageFiles;
|
|
22289
22167
|
await runSequentially(pageFilesToUpdate, async (htmxPageFile) => {
|
|
22290
22168
|
const htmxPageName = basename11(htmxPageFile);
|
|
22291
|
-
const builtHtmxPagePath =
|
|
22169
|
+
const builtHtmxPagePath = resolve36(outputHtmxPages, htmxPageName);
|
|
22292
22170
|
await processHtmxPageUpdate(state, htmxPageFile, builtHtmxPagePath, manifest, duration);
|
|
22293
22171
|
});
|
|
22294
22172
|
}, collectUpdatedModulePaths = (allModuleUpdates) => {
|
|
@@ -22397,7 +22275,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
22397
22275
|
html = html.slice(0, bodyClose.index) + hmrScript + html.slice(bodyClose.index);
|
|
22398
22276
|
writeFs(destPath, html);
|
|
22399
22277
|
}, processMarkupFileFastPath = async (state, sourceFile, outputDir, framework, startTime, updateAssetPaths2, handleUpdate, readFs, writeFs) => {
|
|
22400
|
-
const destPath =
|
|
22278
|
+
const destPath = resolve36(outputDir, basename11(sourceFile));
|
|
22401
22279
|
const hmrScript = extractHmrScript(destPath, readFs);
|
|
22402
22280
|
const source = await Bun.file(sourceFile).text();
|
|
22403
22281
|
await Bun.write(destPath, source);
|
|
@@ -22707,7 +22585,7 @@ __export(exports_buildDepVendor, {
|
|
|
22707
22585
|
buildDepVendor: () => buildDepVendor
|
|
22708
22586
|
});
|
|
22709
22587
|
import { mkdirSync as mkdirSync13 } from "fs";
|
|
22710
|
-
import { join as
|
|
22588
|
+
import { join as join29 } from "path";
|
|
22711
22589
|
import { rm as rm10 } from "fs/promises";
|
|
22712
22590
|
var {build: bunBuild9, Glob: Glob9 } = globalThis.Bun;
|
|
22713
22591
|
var toSafeFileName6 = (specifier) => {
|
|
@@ -22720,12 +22598,12 @@ var toSafeFileName6 = (specifier) => {
|
|
|
22720
22598
|
} catch {
|
|
22721
22599
|
return false;
|
|
22722
22600
|
}
|
|
22723
|
-
}, isBareSpecifier2 = (spec) => !spec.startsWith(".") && !spec.startsWith("/") && !spec.startsWith("@src/"), isAbsolutePackageSpecifier = (spec) => spec === "@absolutejs/absolute" || spec.startsWith("@absolutejs/absolute/"), FRAMEWORK_SPECIFIERS, FRAMEWORK_NAMESPACE_PREFIXES, isFrameworkSpecifier = (spec) => FRAMEWORK_SPECIFIERS.has(spec) || FRAMEWORK_NAMESPACE_PREFIXES.some((prefix) => spec.startsWith(prefix)), FRAMEWORK_EXTERNALS, isSkippedFile = (file4) => file4.includes("node_modules") || file4.includes("/build/") || file4.includes("/dist/") || file4.includes("/indexes/"), isDepSpecifier = (path) => isBareSpecifier2(path) && !isFrameworkSpecifier(path) && !isAbsolutePackageSpecifier(path), isFrameworkRootCandidate = (path) => isBareSpecifier2(path) && isFrameworkSpecifier(path) && !isAbsolutePackageSpecifier(path), readFileSpecifiers = async (file4,
|
|
22601
|
+
}, isBareSpecifier2 = (spec) => !spec.startsWith(".") && !spec.startsWith("/") && !spec.startsWith("@src/"), isAbsolutePackageSpecifier = (spec) => spec === "@absolutejs/absolute" || spec.startsWith("@absolutejs/absolute/"), FRAMEWORK_SPECIFIERS, FRAMEWORK_NAMESPACE_PREFIXES, isFrameworkSpecifier = (spec) => FRAMEWORK_SPECIFIERS.has(spec) || FRAMEWORK_NAMESPACE_PREFIXES.some((prefix) => spec.startsWith(prefix)), FRAMEWORK_EXTERNALS, isSkippedFile = (file4) => file4.includes("node_modules") || file4.includes("/build/") || file4.includes("/dist/") || file4.includes("/indexes/"), isDepSpecifier = (path) => isBareSpecifier2(path) && !isFrameworkSpecifier(path) && !isAbsolutePackageSpecifier(path), isFrameworkRootCandidate = (path) => isBareSpecifier2(path) && isFrameworkSpecifier(path) && !isAbsolutePackageSpecifier(path), readFileSpecifiers = async (file4, transpiler5) => {
|
|
22724
22602
|
const dep = [];
|
|
22725
22603
|
const framework = [];
|
|
22726
22604
|
try {
|
|
22727
22605
|
const content = await Bun.file(file4).text();
|
|
22728
|
-
for (const imp of
|
|
22606
|
+
for (const imp of transpiler5.scanImports(content)) {
|
|
22729
22607
|
if (isDepSpecifier(imp.path))
|
|
22730
22608
|
dep.push(imp.path);
|
|
22731
22609
|
else if (isFrameworkRootCandidate(imp.path))
|
|
@@ -22742,9 +22620,9 @@ var toSafeFileName6 = (specifier) => {
|
|
|
22742
22620
|
} catch {
|
|
22743
22621
|
return empty;
|
|
22744
22622
|
}
|
|
22745
|
-
}, collectDirSpecifiers = async (dir,
|
|
22623
|
+
}, collectDirSpecifiers = async (dir, transpiler5, dep, framework) => {
|
|
22746
22624
|
const files = await scanDirFiles(dir);
|
|
22747
|
-
const results = await Promise.all(files.map((file4) => readFileSpecifiers(file4,
|
|
22625
|
+
const results = await Promise.all(files.map((file4) => readFileSpecifiers(file4, transpiler5)));
|
|
22748
22626
|
for (const result of results) {
|
|
22749
22627
|
for (const spec of result.dep)
|
|
22750
22628
|
dep.add(spec);
|
|
@@ -22754,15 +22632,15 @@ var toSafeFileName6 = (specifier) => {
|
|
|
22754
22632
|
}, scanBareImports = async (directories) => {
|
|
22755
22633
|
const dep = new Set;
|
|
22756
22634
|
const framework = new Set;
|
|
22757
|
-
const
|
|
22758
|
-
await Promise.all(directories.map((dir) => collectDirSpecifiers(dir,
|
|
22635
|
+
const transpiler5 = new Bun.Transpiler({ loader: "tsx" });
|
|
22636
|
+
await Promise.all(directories.map((dir) => collectDirSpecifiers(dir, transpiler5, dep, framework)));
|
|
22759
22637
|
return {
|
|
22760
22638
|
dep: Array.from(dep).filter(isResolvable4),
|
|
22761
22639
|
framework: Array.from(framework).filter(isResolvable4)
|
|
22762
22640
|
};
|
|
22763
22641
|
}, collectTransitiveImports = async (specs, alreadyVendored, alreadyScanned) => {
|
|
22764
22642
|
const { readFileSync: readFileSync20 } = await import("fs");
|
|
22765
|
-
const
|
|
22643
|
+
const transpiler5 = new Bun.Transpiler({ loader: "js" });
|
|
22766
22644
|
const newSpecs = new Set;
|
|
22767
22645
|
for (const spec of specs) {
|
|
22768
22646
|
if (alreadyScanned.has(spec))
|
|
@@ -22782,7 +22660,7 @@ var toSafeFileName6 = (specifier) => {
|
|
|
22782
22660
|
}
|
|
22783
22661
|
let imports;
|
|
22784
22662
|
try {
|
|
22785
|
-
imports =
|
|
22663
|
+
imports = transpiler5.scanImports(content);
|
|
22786
22664
|
} catch {
|
|
22787
22665
|
continue;
|
|
22788
22666
|
}
|
|
@@ -22818,7 +22696,7 @@ var toSafeFileName6 = (specifier) => {
|
|
|
22818
22696
|
}), buildDepVendorPass = async (specifiers, vendorDir, tmpDir) => {
|
|
22819
22697
|
const entries = await Promise.all(specifiers.map(async (specifier) => {
|
|
22820
22698
|
const safeName = toSafeFileName6(specifier);
|
|
22821
|
-
const entryPath =
|
|
22699
|
+
const entryPath = join29(tmpDir, `${safeName}.ts`);
|
|
22822
22700
|
await Bun.write(entryPath, await generateVendorEntrySource(specifier));
|
|
22823
22701
|
return { entryPath, specifier };
|
|
22824
22702
|
}));
|
|
@@ -22879,9 +22757,9 @@ var toSafeFileName6 = (specifier) => {
|
|
|
22879
22757
|
const { dep: initialSpecs, framework: frameworkRoots } = await scanBareImports(directories);
|
|
22880
22758
|
if (initialSpecs.length === 0 && frameworkRoots.length === 0)
|
|
22881
22759
|
return {};
|
|
22882
|
-
const vendorDir =
|
|
22760
|
+
const vendorDir = join29(buildDir, "vendor");
|
|
22883
22761
|
mkdirSync13(vendorDir, { recursive: true });
|
|
22884
|
-
const tmpDir =
|
|
22762
|
+
const tmpDir = join29(buildDir, "_dep_vendor_tmp");
|
|
22885
22763
|
mkdirSync13(tmpDir, { recursive: true });
|
|
22886
22764
|
const allSpecs = new Set(initialSpecs);
|
|
22887
22765
|
const alreadyScanned = new Set;
|
|
@@ -22964,7 +22842,7 @@ __export(exports_devBuild, {
|
|
|
22964
22842
|
});
|
|
22965
22843
|
import { readdir as readdir5 } from "fs/promises";
|
|
22966
22844
|
import { statSync as statSync5 } from "fs";
|
|
22967
|
-
import { resolve as
|
|
22845
|
+
import { resolve as resolve37 } from "path";
|
|
22968
22846
|
var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
22969
22847
|
const configuredDirs = [
|
|
22970
22848
|
config.reactDirectory,
|
|
@@ -22987,7 +22865,7 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
22987
22865
|
return Object.keys(config).length > 0 ? config : null;
|
|
22988
22866
|
}, reloadConfig = async () => {
|
|
22989
22867
|
try {
|
|
22990
|
-
const configPath2 =
|
|
22868
|
+
const configPath2 = resolve37(process.env.ABSOLUTE_CONFIG ?? "absolute.config.ts");
|
|
22991
22869
|
const source = await Bun.file(configPath2).text();
|
|
22992
22870
|
return parseDirectoryConfig(source);
|
|
22993
22871
|
} catch {
|
|
@@ -23072,7 +22950,7 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
23072
22950
|
state.fileChangeQueue.clear();
|
|
23073
22951
|
}
|
|
23074
22952
|
}, handleCachedReload = async () => {
|
|
23075
|
-
const serverMtime = statSync5(
|
|
22953
|
+
const serverMtime = statSync5(resolve37(Bun.main)).mtimeMs;
|
|
23076
22954
|
const lastMtime = globalThis.__hmrServerMtime;
|
|
23077
22955
|
globalThis.__hmrServerMtime = serverMtime;
|
|
23078
22956
|
const cached = globalThis.__hmrDevResult;
|
|
@@ -23109,8 +22987,8 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
23109
22987
|
return true;
|
|
23110
22988
|
}, resolveAbsoluteVersion2 = async () => {
|
|
23111
22989
|
const candidates = [
|
|
23112
|
-
|
|
23113
|
-
|
|
22990
|
+
resolve37(import.meta.dir, "..", "..", "package.json"),
|
|
22991
|
+
resolve37(import.meta.dir, "..", "package.json")
|
|
23114
22992
|
];
|
|
23115
22993
|
const [candidate, ...remaining] = candidates;
|
|
23116
22994
|
if (!candidate) {
|
|
@@ -23136,7 +23014,7 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
23136
23014
|
const entries = await readdir5(vendorDir).catch(() => emptyStringArray);
|
|
23137
23015
|
await Promise.all(entries.filter((entry) => entry.endsWith(".js")).map(async (entry) => {
|
|
23138
23016
|
const webPath = `/${framework}/vendor/${entry}`;
|
|
23139
|
-
const bytes = await Bun.file(
|
|
23017
|
+
const bytes = await Bun.file(resolve37(vendorDir, entry)).bytes();
|
|
23140
23018
|
assetStore.set(webPath, bytes);
|
|
23141
23019
|
}));
|
|
23142
23020
|
}, devBuild = async (config) => {
|
|
@@ -23204,11 +23082,11 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
23204
23082
|
cleanStaleAssets(state.assetStore, manifest, state.resolvedPaths.buildDir);
|
|
23205
23083
|
recordStep("populate asset store", stepStartedAt);
|
|
23206
23084
|
stepStartedAt = performance.now();
|
|
23207
|
-
const reactVendorDir =
|
|
23208
|
-
const angularVendorDir =
|
|
23209
|
-
const svelteVendorDir =
|
|
23210
|
-
const vueVendorDir =
|
|
23211
|
-
const depVendorDir =
|
|
23085
|
+
const reactVendorDir = resolve37(state.resolvedPaths.buildDir, "react", "vendor");
|
|
23086
|
+
const angularVendorDir = resolve37(state.resolvedPaths.buildDir, "angular", "vendor");
|
|
23087
|
+
const svelteVendorDir = resolve37(state.resolvedPaths.buildDir, "svelte", "vendor");
|
|
23088
|
+
const vueVendorDir = resolve37(state.resolvedPaths.buildDir, "vue", "vendor");
|
|
23089
|
+
const depVendorDir = resolve37(state.resolvedPaths.buildDir, "vendor");
|
|
23212
23090
|
const { buildDepVendor: buildDepVendor2 } = await Promise.resolve().then(() => (init_buildDepVendor(), exports_buildDepVendor));
|
|
23213
23091
|
const [, angularSpecs, , , , , depPaths] = await Promise.all([
|
|
23214
23092
|
config.reactDirectory ? buildReactVendor(state.resolvedPaths.buildDir) : Promise.resolve(undefined),
|
|
@@ -23286,7 +23164,7 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
23286
23164
|
manifest
|
|
23287
23165
|
};
|
|
23288
23166
|
globalThis.__hmrDevResult = result;
|
|
23289
|
-
globalThis.__hmrServerMtime = statSync5(
|
|
23167
|
+
globalThis.__hmrServerMtime = statSync5(resolve37(Bun.main)).mtimeMs;
|
|
23290
23168
|
return result;
|
|
23291
23169
|
};
|
|
23292
23170
|
var init_devBuild = __esm(() => {
|
|
@@ -23323,5 +23201,5 @@ export {
|
|
|
23323
23201
|
build
|
|
23324
23202
|
};
|
|
23325
23203
|
|
|
23326
|
-
//# debugId=
|
|
23204
|
+
//# debugId=084BDA7430AC337364756E2164756E21
|
|
23327
23205
|
//# sourceMappingURL=build.js.map
|