@absolutejs/absolute 0.19.0-beta.931 → 0.19.0-beta.932
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 +285 -136
- package/dist/angular/index.js.map +6 -5
- package/dist/angular/server.js +267 -118
- package/dist/angular/server.js.map +6 -5
- package/dist/build.js +736 -584
- package/dist/build.js.map +17 -16
- package/dist/dev/client/handlers/angularHmrShim.ts +4 -1
- package/dist/dev/client/handlers/angularRemount.ts +2 -2
- package/dist/dev/client/handlers/angularRemountWiring.ts +1 -4
- package/dist/dev/client/vendor/lview/lViewOps.ts +8 -6
- package/dist/index.js +854 -651
- package/dist/index.js.map +21 -19
- package/dist/islands/index.js +105 -2
- package/dist/islands/index.js.map +5 -4
- package/dist/react/index.js +167 -18
- package/dist/react/index.js.map +6 -5
- package/dist/react/server.js +63 -17
- package/dist/react/server.js.map +3 -3
- package/dist/src/core/normalizeIslandProps.d.ts +15 -0
- package/dist/src/core/vueServerModule.d.ts +1 -0
- package/dist/src/utils/defineConvention.d.ts +3 -0
- package/dist/src/utils/index.d.ts +1 -0
- package/dist/src/vue/Island.browser.d.ts +36 -12
- package/dist/src/vue/Island.d.ts +35 -11
- package/dist/src/vue/pageHandler.d.ts +8 -0
- package/dist/svelte/index.js +167 -18
- package/dist/svelte/index.js.map +6 -5
- package/dist/svelte/server.js +63 -17
- package/dist/svelte/server.js.map +3 -3
- package/dist/types/conventions.d.ts +5 -0
- package/dist/vue/browser.js +57 -4
- package/dist/vue/browser.js.map +5 -4
- package/dist/vue/index.js +234 -24
- package/dist/vue/index.js.map +9 -7
- package/dist/vue/server.js +73 -20
- package/dist/vue/server.js.map +4 -4
- package/package.json +1 -1
package/dist/build.js
CHANGED
|
@@ -3381,6 +3381,100 @@ 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
|
+
|
|
3384
3478
|
// src/core/islandMarkupAttributes.ts
|
|
3385
3479
|
var getIslandMarkerAttributes = (props, islandId) => ({
|
|
3386
3480
|
"data-component": props.component,
|
|
@@ -3416,9 +3510,17 @@ var islandSequence = 0, resolvedServerComponentCache, resolvedServerBuildCompone
|
|
|
3416
3510
|
const loadPromise = loadAndCompileServerBuildComponent(buildReferencePath);
|
|
3417
3511
|
resolvedServerBuildComponentCache.set(buildReferencePath, loadPromise);
|
|
3418
3512
|
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;
|
|
3419
3521
|
}, loadServerImportComponent = async (resolvedComponent, exportName) => {
|
|
3420
3522
|
const resolvedModulePath = resolvedComponent.startsWith(".") ? new URL(resolvedComponent, import.meta.url).pathname : resolvedComponent;
|
|
3421
|
-
const importTarget =
|
|
3523
|
+
const importTarget = await resolveRuntimeImportTarget(resolvedModulePath);
|
|
3422
3524
|
const loadedModule = await import(importTarget);
|
|
3423
3525
|
if (exportName && exportName !== "default" && exportName in loadedModule) {
|
|
3424
3526
|
return loadedModule[exportName];
|
|
@@ -3522,6 +3624,7 @@ var islandSequence = 0, resolvedServerComponentCache, resolvedServerBuildCompone
|
|
|
3522
3624
|
var init_renderIslandMarkup = __esm(() => {
|
|
3523
3625
|
init_islandSsr();
|
|
3524
3626
|
init_svelteServerModule();
|
|
3627
|
+
init_vueServerModule();
|
|
3525
3628
|
init_islandMarkupAttributes();
|
|
3526
3629
|
init_islands();
|
|
3527
3630
|
resolvedServerComponentCache = new Map;
|
|
@@ -8752,7 +8855,7 @@ __export(exports_tailwindCompiler, {
|
|
|
8752
8855
|
import { createHash as createHash2 } from "crypto";
|
|
8753
8856
|
import { existsSync as existsSync8, readFileSync as readFileSync5 } from "fs";
|
|
8754
8857
|
import { readFile as readFile2, stat } from "fs/promises";
|
|
8755
|
-
import { dirname as
|
|
8858
|
+
import { dirname as dirname5, isAbsolute as isAbsolute2, resolve as resolve9 } from "path";
|
|
8756
8859
|
var compilerCache, cachedTailwindCompile = null, loadTailwindCompile = async () => {
|
|
8757
8860
|
if (cachedTailwindCompile)
|
|
8758
8861
|
return cachedTailwindCompile;
|
|
@@ -8783,7 +8886,7 @@ var compilerCache, cachedTailwindCompile = null, loadTailwindCompile = async ()
|
|
|
8783
8886
|
} catch {
|
|
8784
8887
|
return Bun.resolveSync(id, base);
|
|
8785
8888
|
}
|
|
8786
|
-
const pkgDir =
|
|
8889
|
+
const pkgDir = dirname5(pkgJsonPath);
|
|
8787
8890
|
let pkg = {};
|
|
8788
8891
|
try {
|
|
8789
8892
|
pkg = JSON.parse(readFileSync5(pkgJsonPath, "utf-8"));
|
|
@@ -8799,29 +8902,29 @@ var compilerCache, cachedTailwindCompile = null, loadTailwindCompile = async ()
|
|
|
8799
8902
|
"dist/index.css"
|
|
8800
8903
|
].filter((entry) => typeof entry === "string");
|
|
8801
8904
|
for (const candidate of candidates) {
|
|
8802
|
-
const candidatePath =
|
|
8905
|
+
const candidatePath = resolve9(pkgDir, candidate);
|
|
8803
8906
|
if (existsSync8(candidatePath))
|
|
8804
8907
|
return candidatePath;
|
|
8805
8908
|
}
|
|
8806
8909
|
return Bun.resolveSync(id, base);
|
|
8807
8910
|
}, createLoadStylesheet = (deps) => async (id, base) => {
|
|
8808
|
-
const path = id.startsWith(".") || isAbsolute2(id) ?
|
|
8911
|
+
const path = id.startsWith(".") || isAbsolute2(id) ? resolve9(base, id) : resolveBareCssImport(id, base);
|
|
8809
8912
|
const content = await readFile2(path, "utf-8");
|
|
8810
8913
|
await recordDependency(deps, path);
|
|
8811
|
-
return { base:
|
|
8914
|
+
return { base: dirname5(path), content, path };
|
|
8812
8915
|
}, loadModule = async (id, base, _kind) => {
|
|
8813
|
-
const path = id.startsWith(".") || isAbsolute2(id) ?
|
|
8916
|
+
const path = id.startsWith(".") || isAbsolute2(id) ? resolve9(base, id) : Bun.resolveSync(id, base);
|
|
8814
8917
|
const module = await import(path);
|
|
8815
|
-
return { base:
|
|
8918
|
+
return { base: dirname5(path), module, path };
|
|
8816
8919
|
}, buildCompilerEntry = async (cssPath) => {
|
|
8817
8920
|
const compile = await loadTailwindCompile();
|
|
8818
|
-
const absPath =
|
|
8921
|
+
const absPath = resolve9(cssPath);
|
|
8819
8922
|
const css = await readFile2(absPath, "utf-8");
|
|
8820
8923
|
const cssMtimeMs = (await stat(absPath)).mtimeMs;
|
|
8821
8924
|
const cssDependencies = new Map;
|
|
8822
8925
|
cssDependencies.set(absPath, cssMtimeMs);
|
|
8823
8926
|
const compiler = await compile(css, {
|
|
8824
|
-
base:
|
|
8927
|
+
base: dirname5(absPath),
|
|
8825
8928
|
loadModule,
|
|
8826
8929
|
loadStylesheet: createLoadStylesheet(cssDependencies)
|
|
8827
8930
|
});
|
|
@@ -8844,11 +8947,11 @@ var compilerCache, cachedTailwindCompile = null, loadTailwindCompile = async ()
|
|
|
8844
8947
|
}, hashCss = (css) => createHash2("sha1").update(css).digest("hex"), fileMatchesSources = (file, sources) => {
|
|
8845
8948
|
if (sources.length === 0)
|
|
8846
8949
|
return true;
|
|
8847
|
-
const absFile =
|
|
8950
|
+
const absFile = resolve9(file);
|
|
8848
8951
|
for (const source of sources) {
|
|
8849
8952
|
if (source.negated)
|
|
8850
8953
|
continue;
|
|
8851
|
-
const absolutePattern =
|
|
8954
|
+
const absolutePattern = resolve9(source.base, source.pattern);
|
|
8852
8955
|
if (!/[*?{[]/.test(absolutePattern)) {
|
|
8853
8956
|
if (absolutePattern === absFile)
|
|
8854
8957
|
return true;
|
|
@@ -8893,7 +8996,7 @@ var compilerCache, cachedTailwindCompile = null, loadTailwindCompile = async ()
|
|
|
8893
8996
|
const seen = new Set;
|
|
8894
8997
|
const collected = [];
|
|
8895
8998
|
const scans = sources.filter((source) => !source.negated).map(async (source) => {
|
|
8896
|
-
const absolutePattern =
|
|
8999
|
+
const absolutePattern = resolve9(source.base, source.pattern);
|
|
8897
9000
|
const { glob: relativePattern, root } = splitGlobAtFirstMeta(absolutePattern);
|
|
8898
9001
|
if (!relativePattern) {
|
|
8899
9002
|
try {
|
|
@@ -8905,12 +9008,12 @@ var compilerCache, cachedTailwindCompile = null, loadTailwindCompile = async ()
|
|
|
8905
9008
|
}
|
|
8906
9009
|
const glob = new Bun.Glob(relativePattern);
|
|
8907
9010
|
const matches = [];
|
|
8908
|
-
for await (const
|
|
9011
|
+
for await (const relative6 of glob.scan({
|
|
8909
9012
|
absolute: false,
|
|
8910
9013
|
cwd: root,
|
|
8911
9014
|
onlyFiles: true
|
|
8912
9015
|
})) {
|
|
8913
|
-
matches.push(
|
|
9016
|
+
matches.push(resolve9(root, relative6));
|
|
8914
9017
|
}
|
|
8915
9018
|
return matches;
|
|
8916
9019
|
});
|
|
@@ -8942,7 +9045,7 @@ var compilerCache, cachedTailwindCompile = null, loadTailwindCompile = async ()
|
|
|
8942
9045
|
const results = await Promise.all(checks);
|
|
8943
9046
|
return results.some(Boolean);
|
|
8944
9047
|
}, getCompilerEntry = async (cssPath) => {
|
|
8945
|
-
const key =
|
|
9048
|
+
const key = resolve9(cssPath);
|
|
8946
9049
|
const cached = compilerCache.get(key);
|
|
8947
9050
|
if (cached && !await isCompilerStale(cached))
|
|
8948
9051
|
return cached;
|
|
@@ -8955,14 +9058,14 @@ var compilerCache, cachedTailwindCompile = null, loadTailwindCompile = async ()
|
|
|
8955
9058
|
compilerCache.clear();
|
|
8956
9059
|
return;
|
|
8957
9060
|
}
|
|
8958
|
-
compilerCache.delete(
|
|
9061
|
+
compilerCache.delete(resolve9(cssPath));
|
|
8959
9062
|
}, incrementalTailwindBuild = async (tailwind, buildPath, changedFiles, styleTransformConfig) => {
|
|
8960
9063
|
const startedAt = performance.now();
|
|
8961
9064
|
const entry = await getCompilerEntry(tailwind.input);
|
|
8962
9065
|
const inputAbs = entry.cssPath;
|
|
8963
9066
|
const filesToRescan = [];
|
|
8964
9067
|
for (const file of changedFiles) {
|
|
8965
|
-
const abs =
|
|
9068
|
+
const abs = resolve9(file);
|
|
8966
9069
|
if (abs === inputAbs)
|
|
8967
9070
|
continue;
|
|
8968
9071
|
if (!fileMatchesSources(abs, entry.sources))
|
|
@@ -8971,7 +9074,7 @@ var compilerCache, cachedTailwindCompile = null, loadTailwindCompile = async ()
|
|
|
8971
9074
|
}
|
|
8972
9075
|
await Promise.all(filesToRescan.map((file) => ingestFile(entry, file)));
|
|
8973
9076
|
const rawCss = entry.compiler.build([...entry.candidateCounts.keys()]);
|
|
8974
|
-
const outputPath =
|
|
9077
|
+
const outputPath = resolve9(buildPath, tailwind.output);
|
|
8975
9078
|
const finalCss = await compileStyleSource(outputPath, rawCss, "css", styleTransformConfig);
|
|
8976
9079
|
const hash = hashCss(finalCss);
|
|
8977
9080
|
const durationMs = performance.now() - startedAt;
|
|
@@ -8991,11 +9094,11 @@ var init_tailwindCompiler = __esm(() => {
|
|
|
8991
9094
|
});
|
|
8992
9095
|
|
|
8993
9096
|
// src/build/compileTailwind.ts
|
|
8994
|
-
import { mkdir as
|
|
8995
|
-
import { dirname as
|
|
9097
|
+
import { mkdir as mkdir3 } from "fs/promises";
|
|
9098
|
+
import { dirname as dirname6, join as join8 } from "path";
|
|
8996
9099
|
var TAILWIND_CANDIDATE_EXTENSION_PATTERN, isTailwindCandidate = (filePath) => TAILWIND_CANDIDATE_EXTENSION_PATTERN.test(filePath), compileTailwind = async (input, output, buildPath, styleTransformConfig) => {
|
|
8997
|
-
const outputPath =
|
|
8998
|
-
await
|
|
9100
|
+
const outputPath = join8(buildPath, output);
|
|
9101
|
+
await mkdir3(dirname6(outputPath), { recursive: true });
|
|
8999
9102
|
await incrementalTailwindBuild({ input, output }, buildPath, [], styleTransformConfig);
|
|
9000
9103
|
}, compileTailwindConfig = async (tailwind, buildPath, styleTransformConfig) => compileTailwind(tailwind.input, tailwind.output, buildPath, styleTransformConfig);
|
|
9001
9104
|
var init_compileTailwind = __esm(() => {
|
|
@@ -9005,7 +9108,7 @@ var init_compileTailwind = __esm(() => {
|
|
|
9005
9108
|
|
|
9006
9109
|
// src/utils/imageProcessing.ts
|
|
9007
9110
|
import { existsSync as existsSync9, mkdirSync as mkdirSync3, readFileSync as readFileSync6, writeFileSync as writeFileSync3 } from "fs";
|
|
9008
|
-
import { join as
|
|
9111
|
+
import { join as join9, resolve as resolve10 } from "path";
|
|
9009
9112
|
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) => {
|
|
9010
9113
|
for (const size of sizes) {
|
|
9011
9114
|
if (size >= target)
|
|
@@ -9060,7 +9163,7 @@ var DEFAULT_DEVICE_SIZES, DEFAULT_IMAGE_SIZES, DEFAULT_QUALITY, OPTIMIZATION_END
|
|
|
9060
9163
|
const image = config?.imageSizes ?? DEFAULT_IMAGE_SIZES;
|
|
9061
9164
|
return [...device, ...image].sort((left, right) => left - right);
|
|
9062
9165
|
}, getCacheDir = (buildDir) => {
|
|
9063
|
-
const dir =
|
|
9166
|
+
const dir = join9(buildDir, ".cache", "images");
|
|
9064
9167
|
if (!existsSync9(dir))
|
|
9065
9168
|
mkdirSync3(dir, { recursive: true });
|
|
9066
9169
|
return dir;
|
|
@@ -9117,8 +9220,8 @@ var DEFAULT_DEVICE_SIZES, DEFAULT_IMAGE_SIZES, DEFAULT_QUALITY, OPTIMIZATION_END
|
|
|
9117
9220
|
return toBuffer(buffer);
|
|
9118
9221
|
}
|
|
9119
9222
|
}, readFromCache = (cacheDir, cacheKey) => {
|
|
9120
|
-
const metaPath =
|
|
9121
|
-
const dataPath =
|
|
9223
|
+
const metaPath = join9(cacheDir, `${cacheKey}.meta`);
|
|
9224
|
+
const dataPath = join9(cacheDir, `${cacheKey}.data`);
|
|
9122
9225
|
if (!existsSync9(metaPath) || !existsSync9(dataPath))
|
|
9123
9226
|
return null;
|
|
9124
9227
|
try {
|
|
@@ -9133,7 +9236,7 @@ var DEFAULT_DEVICE_SIZES, DEFAULT_IMAGE_SIZES, DEFAULT_QUALITY, OPTIMIZATION_END
|
|
|
9133
9236
|
return sharpModule;
|
|
9134
9237
|
sharpLoaded = true;
|
|
9135
9238
|
try {
|
|
9136
|
-
const sharpPath =
|
|
9239
|
+
const sharpPath = resolve10(process.cwd(), "node_modules/sharp");
|
|
9137
9240
|
const mod = await import(sharpPath);
|
|
9138
9241
|
sharpModule = mod.default ?? mod;
|
|
9139
9242
|
return sharpModule;
|
|
@@ -9145,8 +9248,8 @@ var DEFAULT_DEVICE_SIZES, DEFAULT_IMAGE_SIZES, DEFAULT_QUALITY, OPTIMIZATION_END
|
|
|
9145
9248
|
return null;
|
|
9146
9249
|
}
|
|
9147
9250
|
}, writeToCache = (cacheDir, cacheKey, buffer, meta) => {
|
|
9148
|
-
const metaPath =
|
|
9149
|
-
const dataPath =
|
|
9251
|
+
const metaPath = join9(cacheDir, `${cacheKey}.meta`);
|
|
9252
|
+
const dataPath = join9(cacheDir, `${cacheKey}.data`);
|
|
9150
9253
|
writeFileSync3(dataPath, buffer);
|
|
9151
9254
|
writeFileSync3(metaPath, JSON.stringify(meta));
|
|
9152
9255
|
};
|
|
@@ -9234,7 +9337,7 @@ var init_optimizeHtmlImages = __esm(() => {
|
|
|
9234
9337
|
// src/cli/scripts/telemetry.ts
|
|
9235
9338
|
import { existsSync as existsSync10, mkdirSync as mkdirSync4, readFileSync as readFileSync7, writeFileSync as writeFileSync4 } from "fs";
|
|
9236
9339
|
import { homedir } from "os";
|
|
9237
|
-
import { join as
|
|
9340
|
+
import { join as join10 } from "path";
|
|
9238
9341
|
var configDir, configPath, getTelemetryConfig = () => {
|
|
9239
9342
|
try {
|
|
9240
9343
|
if (!existsSync10(configPath))
|
|
@@ -9247,14 +9350,14 @@ var configDir, configPath, getTelemetryConfig = () => {
|
|
|
9247
9350
|
}
|
|
9248
9351
|
};
|
|
9249
9352
|
var init_telemetry = __esm(() => {
|
|
9250
|
-
configDir =
|
|
9251
|
-
configPath =
|
|
9353
|
+
configDir = join10(homedir(), ".absolutejs");
|
|
9354
|
+
configPath = join10(configDir, "telemetry.json");
|
|
9252
9355
|
});
|
|
9253
9356
|
|
|
9254
9357
|
// src/cli/telemetryEvent.ts
|
|
9255
9358
|
import { existsSync as existsSync11, readFileSync as readFileSync8 } from "fs";
|
|
9256
9359
|
import { arch, platform } from "os";
|
|
9257
|
-
import { dirname as
|
|
9360
|
+
import { dirname as dirname7, join as join11, parse } from "path";
|
|
9258
9361
|
var checkCandidate = (candidate) => {
|
|
9259
9362
|
if (!existsSync11(candidate)) {
|
|
9260
9363
|
return null;
|
|
@@ -9274,12 +9377,12 @@ var checkCandidate = (candidate) => {
|
|
|
9274
9377
|
}, findPackageVersion = () => {
|
|
9275
9378
|
let { dir } = import.meta;
|
|
9276
9379
|
while (dir !== parse(dir).root) {
|
|
9277
|
-
const candidate =
|
|
9380
|
+
const candidate = join11(dir, "package.json");
|
|
9278
9381
|
const version = checkCandidate(candidate);
|
|
9279
9382
|
if (version) {
|
|
9280
9383
|
return version;
|
|
9281
9384
|
}
|
|
9282
|
-
dir =
|
|
9385
|
+
dir = dirname7(dir);
|
|
9283
9386
|
}
|
|
9284
9387
|
return "unknown";
|
|
9285
9388
|
}, sendTelemetryEvent = (event, payload) => {
|
|
@@ -9365,18 +9468,18 @@ var init_updateAssetPaths = __esm(() => {
|
|
|
9365
9468
|
|
|
9366
9469
|
// src/dev/buildHMRClient.ts
|
|
9367
9470
|
import { existsSync as existsSync12 } from "fs";
|
|
9368
|
-
import { resolve as
|
|
9471
|
+
import { resolve as resolve11 } from "path";
|
|
9369
9472
|
var {build: bunBuild } = globalThis.Bun;
|
|
9370
9473
|
var resolveHmrClientPath = () => {
|
|
9371
9474
|
const projectRoot = process.cwd();
|
|
9372
|
-
const fromSource =
|
|
9475
|
+
const fromSource = resolve11(import.meta.dir, "client/hmrClient.ts");
|
|
9373
9476
|
if (existsSync12(fromSource) && fromSource.startsWith(projectRoot)) {
|
|
9374
9477
|
return fromSource;
|
|
9375
9478
|
}
|
|
9376
|
-
const fromNodeModules =
|
|
9479
|
+
const fromNodeModules = resolve11(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client/hmrClient.ts");
|
|
9377
9480
|
if (existsSync12(fromNodeModules))
|
|
9378
9481
|
return fromNodeModules;
|
|
9379
|
-
return
|
|
9482
|
+
return resolve11(import.meta.dir, "dev/client/hmrClient.ts");
|
|
9380
9483
|
}, hmrClientPath2, buildHMRClient = async () => {
|
|
9381
9484
|
const entryPoint = hmrClientPath2;
|
|
9382
9485
|
const result = await bunBuild({
|
|
@@ -9406,7 +9509,7 @@ var init_buildHMRClient = __esm(() => {
|
|
|
9406
9509
|
// src/build/nativeRewrite.ts
|
|
9407
9510
|
import { dlopen, FFIType, ptr } from "bun:ffi";
|
|
9408
9511
|
import { platform as platform2, arch as arch2 } from "os";
|
|
9409
|
-
import { resolve as
|
|
9512
|
+
import { resolve as resolve12 } from "path";
|
|
9410
9513
|
var ffiDefinition, nativeLib = null, loadNative = () => {
|
|
9411
9514
|
if (nativeLib !== null)
|
|
9412
9515
|
return nativeLib;
|
|
@@ -9424,7 +9527,7 @@ var ffiDefinition, nativeLib = null, loadNative = () => {
|
|
|
9424
9527
|
if (!libPath)
|
|
9425
9528
|
return null;
|
|
9426
9529
|
try {
|
|
9427
|
-
const fullPath =
|
|
9530
|
+
const fullPath = resolve12(import.meta.dir, "../../native/packages", libPath);
|
|
9428
9531
|
const lib = dlopen(fullPath, ffiDefinition);
|
|
9429
9532
|
nativeLib = lib.symbols;
|
|
9430
9533
|
return nativeLib;
|
|
@@ -9570,7 +9673,7 @@ var devVendorPaths = null, getDevVendorPaths = () => devVendorPaths, setDevVendo
|
|
|
9570
9673
|
|
|
9571
9674
|
// src/build/angularLinkerPlugin.ts
|
|
9572
9675
|
import { existsSync as existsSync13, mkdirSync as mkdirSync5, readFileSync as readFileSync9, writeFileSync as writeFileSync5 } from "fs";
|
|
9573
|
-
import { dirname as
|
|
9676
|
+
import { dirname as dirname8, join as join12, relative as relative6, resolve as resolve13 } from "path";
|
|
9574
9677
|
import { createHash as createHash3 } from "crypto";
|
|
9575
9678
|
var CACHE_ROOT, createAngularLinkerPlugin = (linkerJitMode) => ({
|
|
9576
9679
|
name: "angular-linker",
|
|
@@ -9578,7 +9681,7 @@ var CACHE_ROOT, createAngularLinkerPlugin = (linkerJitMode) => ({
|
|
|
9578
9681
|
let needsLinking;
|
|
9579
9682
|
let babelTransform;
|
|
9580
9683
|
let linkerPlugin;
|
|
9581
|
-
const cacheDir =
|
|
9684
|
+
const cacheDir = join12(CACHE_ROOT, linkerJitMode ? "jit" : "aot");
|
|
9582
9685
|
bld.onLoad({ filter: /[\\/]@angular[\\/].*\.m?js$/ }, async (args) => {
|
|
9583
9686
|
const source = await Bun.file(args.path).text();
|
|
9584
9687
|
if (!needsLinking) {
|
|
@@ -9591,7 +9694,7 @@ var CACHE_ROOT, createAngularLinkerPlugin = (linkerJitMode) => ({
|
|
|
9591
9694
|
return;
|
|
9592
9695
|
}
|
|
9593
9696
|
const hash = createHash3("md5").update(source).digest("hex");
|
|
9594
|
-
const cachePath =
|
|
9697
|
+
const cachePath = join12(cacheDir, `${hash}.js`);
|
|
9595
9698
|
if (existsSync13(cachePath)) {
|
|
9596
9699
|
return {
|
|
9597
9700
|
contents: readFileSync9(cachePath, "utf-8"),
|
|
@@ -9608,11 +9711,11 @@ var CACHE_ROOT, createAngularLinkerPlugin = (linkerJitMode) => ({
|
|
|
9608
9711
|
const mod = await import(linkerSpecifier);
|
|
9609
9712
|
linkerPlugin = mod.createEs2015LinkerPlugin({
|
|
9610
9713
|
fileSystem: {
|
|
9611
|
-
dirname:
|
|
9714
|
+
dirname: dirname8,
|
|
9612
9715
|
exists: existsSync13,
|
|
9613
9716
|
readFile: readFileSync9,
|
|
9614
|
-
relative:
|
|
9615
|
-
resolve:
|
|
9717
|
+
relative: relative6,
|
|
9718
|
+
resolve: resolve13
|
|
9616
9719
|
},
|
|
9617
9720
|
linkerJitMode,
|
|
9618
9721
|
logger: {
|
|
@@ -9643,7 +9746,7 @@ var CACHE_ROOT, createAngularLinkerPlugin = (linkerJitMode) => ({
|
|
|
9643
9746
|
}
|
|
9644
9747
|
}), angularLinkerPlugin;
|
|
9645
9748
|
var init_angularLinkerPlugin = __esm(() => {
|
|
9646
|
-
CACHE_ROOT =
|
|
9749
|
+
CACHE_ROOT = resolve13(".absolutejs", "cache", "angular-linker");
|
|
9647
9750
|
angularLinkerPlugin = createAngularLinkerPlugin(false);
|
|
9648
9751
|
});
|
|
9649
9752
|
|
|
@@ -9654,7 +9757,7 @@ __export(exports_hmrInjectionPlugin, {
|
|
|
9654
9757
|
applyAngularHmrInjection: () => applyAngularHmrInjection
|
|
9655
9758
|
});
|
|
9656
9759
|
import { readFile as readFile5 } from "fs/promises";
|
|
9657
|
-
import { relative as
|
|
9760
|
+
import { relative as relative7, resolve as resolve14 } from "path";
|
|
9658
9761
|
var ENTITY_DECORATOR_RE, IMPORT_RE, TOP_LEVEL_DECL_RE, extractAllTopLevelNames = (jsSource) => {
|
|
9659
9762
|
const names = new Set;
|
|
9660
9763
|
IMPORT_RE.lastIndex = 0;
|
|
@@ -9817,7 +9920,7 @@ var ENTITY_DECORATOR_RE, IMPORT_RE, TOP_LEVEL_DECL_RE, extractAllTopLevelNames =
|
|
|
9817
9920
|
}
|
|
9818
9921
|
`, applyAngularHmrInjection = (jsSource, componentJsAbsPath, params) => {
|
|
9819
9922
|
const { generatedAngularRoot, userAngularRoot, projectRoot } = params;
|
|
9820
|
-
const normalizedGenRoot =
|
|
9923
|
+
const normalizedGenRoot = resolve14(generatedAngularRoot).replace(/\\/g, "/");
|
|
9821
9924
|
const normalizedPath = componentJsAbsPath.replace(/\\/g, "/");
|
|
9822
9925
|
if (!normalizedPath.startsWith(normalizedGenRoot + "/"))
|
|
9823
9926
|
return;
|
|
@@ -9834,9 +9937,9 @@ var ENTITY_DECORATOR_RE, IMPORT_RE, TOP_LEVEL_DECL_RE, extractAllTopLevelNames =
|
|
|
9834
9937
|
}
|
|
9835
9938
|
if (classNames.length === 0)
|
|
9836
9939
|
return;
|
|
9837
|
-
const relFromGenRoot =
|
|
9838
|
-
const userTsPath =
|
|
9839
|
-
const projectRel =
|
|
9940
|
+
const relFromGenRoot = relative7(generatedAngularRoot, componentJsAbsPath).replace(/\\/g, "/");
|
|
9941
|
+
const userTsPath = resolve14(userAngularRoot, relFromGenRoot.replace(/\.js$/, ".ts"));
|
|
9942
|
+
const projectRel = relative7(projectRoot, userTsPath).replace(/\\/g, "/");
|
|
9840
9943
|
const tail = classNames.map((className) => {
|
|
9841
9944
|
const id = `${projectRel}@${className}`;
|
|
9842
9945
|
return buildHmrTail(className, JSON.stringify(id));
|
|
@@ -9870,17 +9973,17 @@ var init_hmrInjectionPlugin = __esm(() => {
|
|
|
9870
9973
|
|
|
9871
9974
|
// src/utils/cleanStaleOutputs.ts
|
|
9872
9975
|
import { rm as rm2 } from "fs/promises";
|
|
9873
|
-
import { resolve as
|
|
9976
|
+
import { resolve as resolve15 } from "path";
|
|
9874
9977
|
var {Glob: Glob5 } = globalThis.Bun;
|
|
9875
9978
|
var HASHED_FILE_PATTERN, cleanStaleOutputs = async (buildPath, currentOutputPaths) => {
|
|
9876
|
-
const currentPaths = new Set(currentOutputPaths.map((path) =>
|
|
9979
|
+
const currentPaths = new Set(currentOutputPaths.map((path) => resolve15(path)));
|
|
9877
9980
|
const glob = new Glob5("**/*");
|
|
9878
9981
|
const removals = [];
|
|
9879
|
-
for (const
|
|
9880
|
-
const absolute =
|
|
9982
|
+
for (const relative8 of glob.scanSync({ cwd: buildPath })) {
|
|
9983
|
+
const absolute = resolve15(buildPath, relative8);
|
|
9881
9984
|
if (currentPaths.has(absolute))
|
|
9882
9985
|
continue;
|
|
9883
|
-
if (!HASHED_FILE_PATTERN.test(
|
|
9986
|
+
if (!HASHED_FILE_PATTERN.test(relative8))
|
|
9884
9987
|
continue;
|
|
9885
9988
|
removals.push(rm2(absolute, { force: true }));
|
|
9886
9989
|
}
|
|
@@ -9896,20 +9999,20 @@ __export(exports_generatedDir, {
|
|
|
9896
9999
|
getGeneratedRoot: () => getGeneratedRoot,
|
|
9897
10000
|
getFrameworkGeneratedDir: () => getFrameworkGeneratedDir
|
|
9898
10001
|
});
|
|
9899
|
-
import { join as
|
|
9900
|
-
var GENERATED_DIR_NAME = "generated", ABSOLUTE_CACHE_DIR_NAME = ".absolutejs", getGeneratedRoot = (projectRoot = process.cwd()) =>
|
|
10002
|
+
import { join as join13 } from "path";
|
|
10003
|
+
var GENERATED_DIR_NAME = "generated", ABSOLUTE_CACHE_DIR_NAME = ".absolutejs", getGeneratedRoot = (projectRoot = process.cwd()) => join13(projectRoot, ABSOLUTE_CACHE_DIR_NAME, GENERATED_DIR_NAME), getFrameworkGeneratedDir = (framework, projectRoot = process.cwd()) => join13(getGeneratedRoot(projectRoot), framework);
|
|
9901
10004
|
var init_generatedDir = () => {};
|
|
9902
10005
|
|
|
9903
10006
|
// src/utils/cleanup.ts
|
|
9904
10007
|
import { rm as rm3 } from "fs/promises";
|
|
9905
|
-
import { join as
|
|
10008
|
+
import { join as join14 } from "path";
|
|
9906
10009
|
var removeIfExists = (path) => rm3(path, { force: true, recursive: true }), cleanFramework = (framework, frameworkDir, skipGenerated = false) => {
|
|
9907
10010
|
const tasks = [];
|
|
9908
10011
|
if (!skipGenerated) {
|
|
9909
10012
|
tasks.push(removeIfExists(getFrameworkGeneratedDir(framework)));
|
|
9910
10013
|
}
|
|
9911
10014
|
if (frameworkDir)
|
|
9912
|
-
tasks.push(removeIfExists(
|
|
10015
|
+
tasks.push(removeIfExists(join14(frameworkDir, "generated")));
|
|
9913
10016
|
return Promise.all(tasks);
|
|
9914
10017
|
}, cleanup = async ({
|
|
9915
10018
|
angularDir,
|
|
@@ -9948,7 +10051,7 @@ var init_commonAncestor = () => {};
|
|
|
9948
10051
|
|
|
9949
10052
|
// src/utils/buildDirectoryLock.ts
|
|
9950
10053
|
import { mkdirSync as mkdirSync6, unlinkSync, writeFileSync as writeFileSync6, readFileSync as readFileSync10 } from "fs";
|
|
9951
|
-
import { dirname as
|
|
10054
|
+
import { dirname as dirname9, join as join15 } from "path";
|
|
9952
10055
|
var heldLocks, HELD_LOCKS_ENV = "ABSOLUTE_HELD_BUILD_DIRECTORY_LOCKS", exitHandlersRegistered = false, registerExitHandlersOnce = () => {
|
|
9953
10056
|
if (exitHandlersRegistered)
|
|
9954
10057
|
return;
|
|
@@ -9974,7 +10077,7 @@ var heldLocks, HELD_LOCKS_ENV = "ABSOLUTE_HELD_BUILD_DIRECTORY_LOCKS", exitHandl
|
|
|
9974
10077
|
releaseAllSync();
|
|
9975
10078
|
throw err;
|
|
9976
10079
|
});
|
|
9977
|
-
}, isAlreadyExistsError = (error) => error instanceof Error && ("code" in error) && error.code === "EEXIST", lockPathForBuildDirectory = (buildDirectory) =>
|
|
10080
|
+
}, isAlreadyExistsError = (error) => error instanceof Error && ("code" in error) && error.code === "EEXIST", lockPathForBuildDirectory = (buildDirectory) => join15(dirname9(buildDirectory), ".absolutejs", "build.lock"), readHeldLockEnv = () => new Set((process.env[HELD_LOCKS_ENV] ?? "").split(`
|
|
9978
10081
|
`).filter((entry) => entry.length > 0)), writeHeldLockEnv = (locks) => {
|
|
9979
10082
|
if (locks.size === 0) {
|
|
9980
10083
|
delete process.env[HELD_LOCKS_ENV];
|
|
@@ -9991,7 +10094,7 @@ var heldLocks, HELD_LOCKS_ENV = "ABSOLUTE_HELD_BUILD_DIRECTORY_LOCKS", exitHandl
|
|
|
9991
10094
|
locks.delete(buildDirectory);
|
|
9992
10095
|
writeHeldLockEnv(locks);
|
|
9993
10096
|
}, writeLockFileSync = (lockPath, metadata) => {
|
|
9994
|
-
mkdirSync6(
|
|
10097
|
+
mkdirSync6(dirname9(lockPath), { recursive: true });
|
|
9995
10098
|
writeFileSync6(lockPath, JSON.stringify(metadata, null, 2), { flag: "wx" });
|
|
9996
10099
|
}, readLockMetadata = (lockPath) => {
|
|
9997
10100
|
try {
|
|
@@ -10111,11 +10214,11 @@ var init_buildDirectoryLock = __esm(() => {
|
|
|
10111
10214
|
});
|
|
10112
10215
|
|
|
10113
10216
|
// src/utils/validateSafePath.ts
|
|
10114
|
-
import { resolve as
|
|
10217
|
+
import { resolve as resolve16, relative as relative8 } from "path";
|
|
10115
10218
|
var validateSafePath = (targetPath, baseDirectory) => {
|
|
10116
|
-
const absoluteBase =
|
|
10117
|
-
const absoluteTarget =
|
|
10118
|
-
const relativePath = normalizePath(
|
|
10219
|
+
const absoluteBase = resolve16(baseDirectory);
|
|
10220
|
+
const absoluteTarget = resolve16(baseDirectory, targetPath);
|
|
10221
|
+
const relativePath = normalizePath(relative8(absoluteBase, absoluteTarget));
|
|
10119
10222
|
if (relativePath.startsWith("../") || relativePath === "..") {
|
|
10120
10223
|
throw new Error(`Unsafe path: ${targetPath}`);
|
|
10121
10224
|
}
|
|
@@ -10263,32 +10366,32 @@ __export(exports_compileSvelte, {
|
|
|
10263
10366
|
clearSvelteCompilerCache: () => clearSvelteCompilerCache
|
|
10264
10367
|
});
|
|
10265
10368
|
import { existsSync as existsSync14 } from "fs";
|
|
10266
|
-
import { mkdir as
|
|
10369
|
+
import { mkdir as mkdir4, stat as stat2 } from "fs/promises";
|
|
10267
10370
|
import {
|
|
10268
|
-
dirname as
|
|
10269
|
-
join as
|
|
10371
|
+
dirname as dirname10,
|
|
10372
|
+
join as join16,
|
|
10270
10373
|
basename as basename4,
|
|
10271
10374
|
extname as extname5,
|
|
10272
|
-
resolve as
|
|
10273
|
-
relative as
|
|
10375
|
+
resolve as resolve17,
|
|
10376
|
+
relative as relative9,
|
|
10274
10377
|
sep as sep2
|
|
10275
10378
|
} from "path";
|
|
10276
10379
|
import { env } from "process";
|
|
10277
|
-
var {write, file, Transpiler } = globalThis.Bun;
|
|
10380
|
+
var {write, file, Transpiler: Transpiler2 } = globalThis.Bun;
|
|
10278
10381
|
var resolveDevClientDir2 = () => {
|
|
10279
10382
|
const projectRoot = process.cwd();
|
|
10280
|
-
const fromSource =
|
|
10383
|
+
const fromSource = resolve17(import.meta.dir, "../dev/client");
|
|
10281
10384
|
if (existsSync14(fromSource) && fromSource.startsWith(projectRoot)) {
|
|
10282
10385
|
return fromSource;
|
|
10283
10386
|
}
|
|
10284
|
-
const fromNodeModules =
|
|
10387
|
+
const fromNodeModules = resolve17(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client");
|
|
10285
10388
|
if (existsSync14(fromNodeModules))
|
|
10286
10389
|
return fromNodeModules;
|
|
10287
|
-
return
|
|
10390
|
+
return resolve17(import.meta.dir, "./dev/client");
|
|
10288
10391
|
}, devClientDir2, hmrClientPath3, persistentCache, sourceHashCache, clearSvelteCompilerCache = () => {
|
|
10289
10392
|
persistentCache.clear();
|
|
10290
10393
|
sourceHashCache.clear();
|
|
10291
|
-
},
|
|
10394
|
+
}, transpiler3, removeUnusedRequireHelper = (code) => {
|
|
10292
10395
|
const helperStart = code.indexOf("var __require = /* @__PURE__ */");
|
|
10293
10396
|
if (helperStart === -1) {
|
|
10294
10397
|
return code;
|
|
@@ -10314,7 +10417,7 @@ var resolveDevClientDir2 = () => {
|
|
|
10314
10417
|
}, resolveRelativeModule2 = async (spec, from) => {
|
|
10315
10418
|
if (!spec.startsWith("."))
|
|
10316
10419
|
return null;
|
|
10317
|
-
const basePath =
|
|
10420
|
+
const basePath = resolve17(dirname10(from), spec);
|
|
10318
10421
|
const candidates = [
|
|
10319
10422
|
basePath,
|
|
10320
10423
|
`${basePath}.ts`,
|
|
@@ -10325,14 +10428,14 @@ var resolveDevClientDir2 = () => {
|
|
|
10325
10428
|
`${basePath}.svelte`,
|
|
10326
10429
|
`${basePath}.svelte.ts`,
|
|
10327
10430
|
`${basePath}.svelte.js`,
|
|
10328
|
-
|
|
10329
|
-
|
|
10330
|
-
|
|
10331
|
-
|
|
10332
|
-
|
|
10333
|
-
|
|
10334
|
-
|
|
10335
|
-
|
|
10431
|
+
join16(basePath, "index.ts"),
|
|
10432
|
+
join16(basePath, "index.js"),
|
|
10433
|
+
join16(basePath, "index.mjs"),
|
|
10434
|
+
join16(basePath, "index.cjs"),
|
|
10435
|
+
join16(basePath, "index.json"),
|
|
10436
|
+
join16(basePath, "index.svelte"),
|
|
10437
|
+
join16(basePath, "index.svelte.ts"),
|
|
10438
|
+
join16(basePath, "index.svelte.js")
|
|
10336
10439
|
];
|
|
10337
10440
|
const checks = await Promise.all(candidates.map(exists));
|
|
10338
10441
|
return candidates.find((_2, index) => checks[index]) ?? null;
|
|
@@ -10341,7 +10444,7 @@ var resolveDevClientDir2 = () => {
|
|
|
10341
10444
|
const resolved = resolvePackageImport(spec);
|
|
10342
10445
|
return resolved && /\.svelte(\.(?:ts|js))?$/.test(resolved) ? resolved : null;
|
|
10343
10446
|
}
|
|
10344
|
-
const basePath =
|
|
10447
|
+
const basePath = resolve17(dirname10(from), spec);
|
|
10345
10448
|
const explicit = /\.(svelte|svelte\.(?:ts|js))$/.test(basePath);
|
|
10346
10449
|
if (!explicit) {
|
|
10347
10450
|
const extensions = [".svelte", ".svelte.ts", ".svelte.js"];
|
|
@@ -10362,8 +10465,8 @@ var resolveDevClientDir2 = () => {
|
|
|
10362
10465
|
return jsPath;
|
|
10363
10466
|
return null;
|
|
10364
10467
|
}, addModuleRewrite = (rewrites, rawSpec, resolvedModule, ssrOutputDir, clientOutputDir) => {
|
|
10365
|
-
const toServer =
|
|
10366
|
-
const toClient =
|
|
10468
|
+
const toServer = relative9(ssrOutputDir, resolvedModule).replace(/\\/g, "/");
|
|
10469
|
+
const toClient = relative9(clientOutputDir, resolvedModule).replace(/\\/g, "/");
|
|
10367
10470
|
rewrites.set(rawSpec, {
|
|
10368
10471
|
client: toClient.startsWith(".") || toClient.startsWith("/") ? toClient : `./${toClient}`,
|
|
10369
10472
|
server: toServer.startsWith(".") ? toServer : `./${toServer}`
|
|
@@ -10371,10 +10474,10 @@ var resolveDevClientDir2 = () => {
|
|
|
10371
10474
|
}, compileSvelte = async (entryPoints, svelteRoot, cache = new Map, isDev = false, stylePreprocessors) => {
|
|
10372
10475
|
const { compile, compileModule, preprocess } = await import("svelte/compiler");
|
|
10373
10476
|
const generatedDir = getFrameworkGeneratedDir("svelte");
|
|
10374
|
-
const clientDir =
|
|
10375
|
-
const indexDir =
|
|
10376
|
-
const serverDir =
|
|
10377
|
-
await Promise.all([clientDir, indexDir, serverDir].map((dir) =>
|
|
10477
|
+
const clientDir = join16(generatedDir, "client");
|
|
10478
|
+
const indexDir = join16(generatedDir, "indexes");
|
|
10479
|
+
const serverDir = join16(generatedDir, "server");
|
|
10480
|
+
await Promise.all([clientDir, indexDir, serverDir].map((dir) => mkdir4(dir, { recursive: true })));
|
|
10378
10481
|
const dev = env.NODE_ENV !== "production";
|
|
10379
10482
|
const build = async (src) => {
|
|
10380
10483
|
const memoized = cache.get(src);
|
|
@@ -10399,10 +10502,10 @@ var resolveDevClientDir2 = () => {
|
|
|
10399
10502
|
const svelteStylePreprocessor = createSvelteStylePreprocessor(stylePreprocessors);
|
|
10400
10503
|
const preprocessedServer = isModule ? loweredServerSource.code : (await preprocess(loweredServerSource.code, svelteStylePreprocessor)).code;
|
|
10401
10504
|
const preprocessedClient = isModule ? loweredClientSource.code : (await preprocess(loweredClientSource.code, svelteStylePreprocessor)).code;
|
|
10402
|
-
const transpiledServer = src.endsWith(".ts") || src.endsWith(".svelte.ts") ?
|
|
10403
|
-
const transpiledClient = src.endsWith(".ts") || src.endsWith(".svelte.ts") ?
|
|
10404
|
-
const rawRel =
|
|
10405
|
-
const relDir = rawRel.startsWith("..") ? `_ext/${
|
|
10505
|
+
const transpiledServer = src.endsWith(".ts") || src.endsWith(".svelte.ts") ? transpiler3.transformSync(preprocessedServer) : preprocessedServer;
|
|
10506
|
+
const transpiledClient = src.endsWith(".ts") || src.endsWith(".svelte.ts") ? transpiler3.transformSync(preprocessedClient) : preprocessedClient;
|
|
10507
|
+
const rawRel = dirname10(relative9(svelteRoot, src)).replace(/\\/g, "/");
|
|
10508
|
+
const relDir = rawRel.startsWith("..") ? `_ext/${relative9(process.cwd(), dirname10(src)).replace(/\\/g, "/")}` : rawRel;
|
|
10406
10509
|
const baseName = basename4(src).replace(/\.svelte(\.(ts|js))?$/, "");
|
|
10407
10510
|
const importPaths = Array.from(transpiledServer.matchAll(/from\s+['"]([^'"]+)['"]/g)).map((match) => match[1]).filter((path) => path !== undefined);
|
|
10408
10511
|
const resolvedModuleImports = await Promise.all(importPaths.map((importPath) => resolveRelativeModule2(importPath, src)));
|
|
@@ -10411,8 +10514,8 @@ var resolveDevClientDir2 = () => {
|
|
|
10411
10514
|
const childBuilt = await Promise.all(childSources.map((child) => build(child)));
|
|
10412
10515
|
const hasAwaitSlotFromChildren = childBuilt.some((child) => child.hasAwaitSlot);
|
|
10413
10516
|
const externalRewrites = new Map;
|
|
10414
|
-
const ssrOutputDir =
|
|
10415
|
-
const clientOutputDir =
|
|
10517
|
+
const ssrOutputDir = dirname10(join16(serverDir, relDir, `${baseName}.js`));
|
|
10518
|
+
const clientOutputDir = dirname10(join16(clientDir, relDir, `${baseName}.js`));
|
|
10416
10519
|
for (let idx = 0;idx < importPaths.length; idx++) {
|
|
10417
10520
|
const rawSpec = importPaths[idx];
|
|
10418
10521
|
if (!rawSpec)
|
|
@@ -10423,15 +10526,15 @@ var resolveDevClientDir2 = () => {
|
|
|
10423
10526
|
addModuleRewrite(externalRewrites, rawSpec, resolvedModule, ssrOutputDir, clientOutputDir);
|
|
10424
10527
|
if (!resolved)
|
|
10425
10528
|
continue;
|
|
10426
|
-
const childRel =
|
|
10529
|
+
const childRel = relative9(svelteRoot, resolved).replace(/\\/g, "/");
|
|
10427
10530
|
if (!childRel.startsWith(".."))
|
|
10428
10531
|
continue;
|
|
10429
10532
|
const childBuilt2 = cache.get(resolved);
|
|
10430
10533
|
if (!childBuilt2)
|
|
10431
10534
|
continue;
|
|
10432
10535
|
const origSpec = rawSpec.replace(/\.svelte(?:\.(?:ts|js))?$/, ".js");
|
|
10433
|
-
const toServer =
|
|
10434
|
-
const toClient =
|
|
10536
|
+
const toServer = relative9(ssrOutputDir, childBuilt2.ssr).replace(/\\/g, "/");
|
|
10537
|
+
const toClient = relative9(clientOutputDir, childBuilt2.client).replace(/\\/g, "/");
|
|
10435
10538
|
externalRewrites.set(origSpec, {
|
|
10436
10539
|
client: toClient.startsWith(".") ? toClient : `./${toClient}`,
|
|
10437
10540
|
server: toServer.startsWith(".") ? toServer : `./${toServer}`
|
|
@@ -10465,7 +10568,7 @@ var resolveDevClientDir2 = () => {
|
|
|
10465
10568
|
}).js.code;
|
|
10466
10569
|
let code = compiled.replace(/\.svelte(?:\.(?:ts|js))?(['"])/g, ".js$1");
|
|
10467
10570
|
if (mode === "client" && isDev) {
|
|
10468
|
-
const moduleKey = `/@src/${
|
|
10571
|
+
const moduleKey = `/@src/${relative9(process.cwd(), src).replace(/\\/g, "/")}`;
|
|
10469
10572
|
code = code.replace(/if\s*\(import\.meta\.hot\)\s*\{/, `if (typeof window !== "undefined") {
|
|
10470
10573
|
if (!window.__SVELTE_HMR_ACCEPT__) window.__SVELTE_HMR_ACCEPT__ = {};
|
|
10471
10574
|
var __hmr_accept = function(cb) { window.__SVELTE_HMR_ACCEPT__[${JSON.stringify(moduleKey)}] = cb; };`);
|
|
@@ -10477,11 +10580,11 @@ var resolveDevClientDir2 = () => {
|
|
|
10477
10580
|
code += islandMetadataExports;
|
|
10478
10581
|
return code;
|
|
10479
10582
|
};
|
|
10480
|
-
const ssrPath =
|
|
10481
|
-
const clientPath =
|
|
10583
|
+
const ssrPath = join16(serverDir, relDir, `${baseName}.js`);
|
|
10584
|
+
const clientPath = join16(clientDir, relDir, `${baseName}.js`);
|
|
10482
10585
|
await Promise.all([
|
|
10483
|
-
|
|
10484
|
-
|
|
10586
|
+
mkdir4(dirname10(ssrPath), { recursive: true }),
|
|
10587
|
+
mkdir4(dirname10(clientPath), { recursive: true })
|
|
10485
10588
|
]);
|
|
10486
10589
|
if (isModule) {
|
|
10487
10590
|
const bundle = rewriteExternalImports(generate("client"), "client");
|
|
@@ -10508,10 +10611,10 @@ var resolveDevClientDir2 = () => {
|
|
|
10508
10611
|
};
|
|
10509
10612
|
const roots = await Promise.all(entryPoints.map(build));
|
|
10510
10613
|
await Promise.all(roots.map(async ({ client, hasAwaitSlot }) => {
|
|
10511
|
-
const relClientDir =
|
|
10614
|
+
const relClientDir = dirname10(relative9(clientDir, client));
|
|
10512
10615
|
const name = basename4(client, extname5(client));
|
|
10513
|
-
const indexPath =
|
|
10514
|
-
const importRaw =
|
|
10616
|
+
const indexPath = join16(indexDir, relClientDir, `${name}.js`);
|
|
10617
|
+
const importRaw = relative9(dirname10(indexPath), client).split(sep2).join("/");
|
|
10515
10618
|
const importPath = importRaw.startsWith(".") || importRaw.startsWith("/") ? importRaw : `./${importRaw}`;
|
|
10516
10619
|
const hmrImports = isDev ? `window.__HMR_FRAMEWORK__ = "svelte";
|
|
10517
10620
|
import "${hmrClientPath3}";
|
|
@@ -10582,14 +10685,14 @@ if (typeof window !== "undefined") {
|
|
|
10582
10685
|
setTimeout(releaseStreamingSlots, 0);
|
|
10583
10686
|
}
|
|
10584
10687
|
}`;
|
|
10585
|
-
await
|
|
10688
|
+
await mkdir4(dirname10(indexPath), { recursive: true });
|
|
10586
10689
|
return write(indexPath, bootstrap);
|
|
10587
10690
|
}));
|
|
10588
10691
|
return {
|
|
10589
10692
|
svelteClientPaths: roots.map(({ client }) => client),
|
|
10590
10693
|
svelteIndexPaths: roots.map(({ client }) => {
|
|
10591
|
-
const rel =
|
|
10592
|
-
return
|
|
10694
|
+
const rel = dirname10(relative9(clientDir, client));
|
|
10695
|
+
return join16(indexDir, rel, basename4(client));
|
|
10593
10696
|
}),
|
|
10594
10697
|
svelteServerPaths: roots.map(({ ssr }) => ssr)
|
|
10595
10698
|
};
|
|
@@ -10604,10 +10707,10 @@ var init_compileSvelte = __esm(() => {
|
|
|
10604
10707
|
init_lowerAwaitSlotSyntax();
|
|
10605
10708
|
init_renderToReadableStream();
|
|
10606
10709
|
devClientDir2 = resolveDevClientDir2();
|
|
10607
|
-
hmrClientPath3 =
|
|
10710
|
+
hmrClientPath3 = join16(devClientDir2, "hmrClient.ts").replace(/\\/g, "/");
|
|
10608
10711
|
persistentCache = new Map;
|
|
10609
10712
|
sourceHashCache = new Map;
|
|
10610
|
-
|
|
10713
|
+
transpiler3 = new Transpiler2({ loader: "ts", target: "browser" });
|
|
10611
10714
|
});
|
|
10612
10715
|
|
|
10613
10716
|
// src/build/vueAutoRouterTransform.ts
|
|
@@ -10671,27 +10774,27 @@ __export(exports_compileVue, {
|
|
|
10671
10774
|
clearVueHmrCaches: () => clearVueHmrCaches
|
|
10672
10775
|
});
|
|
10673
10776
|
import { existsSync as existsSync15 } from "fs";
|
|
10674
|
-
import { mkdir as
|
|
10777
|
+
import { mkdir as mkdir5 } from "fs/promises";
|
|
10675
10778
|
import {
|
|
10676
10779
|
basename as basename5,
|
|
10677
|
-
dirname as
|
|
10780
|
+
dirname as dirname11,
|
|
10678
10781
|
isAbsolute as isAbsolute3,
|
|
10679
|
-
join as
|
|
10680
|
-
relative as
|
|
10681
|
-
resolve as
|
|
10782
|
+
join as join17,
|
|
10783
|
+
relative as relative10,
|
|
10784
|
+
resolve as resolve18
|
|
10682
10785
|
} from "path";
|
|
10683
|
-
var {file: file2, write: write2, Transpiler:
|
|
10786
|
+
var {file: file2, write: write2, Transpiler: Transpiler3 } = globalThis.Bun;
|
|
10684
10787
|
var resolveDevClientDir3 = () => {
|
|
10685
10788
|
const projectRoot = process.cwd();
|
|
10686
|
-
const fromSource =
|
|
10789
|
+
const fromSource = resolve18(import.meta.dir, "../dev/client");
|
|
10687
10790
|
if (existsSync15(fromSource) && fromSource.startsWith(projectRoot)) {
|
|
10688
10791
|
return fromSource;
|
|
10689
10792
|
}
|
|
10690
|
-
const fromNodeModules =
|
|
10793
|
+
const fromNodeModules = resolve18(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client");
|
|
10691
10794
|
if (existsSync15(fromNodeModules))
|
|
10692
10795
|
return fromNodeModules;
|
|
10693
|
-
return
|
|
10694
|
-
}, devClientDir3, hmrClientPath4,
|
|
10796
|
+
return resolve18(import.meta.dir, "./dev/client");
|
|
10797
|
+
}, devClientDir3, hmrClientPath4, transpiler4, scriptCache, scriptSetupCache, templateCache, styleCache, persistentBuildCache, vueSourceHashCache, vueHmrMetadata, clearVueHmrCaches = () => {
|
|
10695
10798
|
scriptCache.clear();
|
|
10696
10799
|
scriptSetupCache.clear();
|
|
10697
10800
|
templateCache.clear();
|
|
@@ -10729,19 +10832,19 @@ var resolveDevClientDir3 = () => {
|
|
|
10729
10832
|
return "template-only";
|
|
10730
10833
|
}
|
|
10731
10834
|
return "full";
|
|
10732
|
-
}, generateVueHmrId = (sourceFilePath, vueRootDir) =>
|
|
10835
|
+
}, generateVueHmrId = (sourceFilePath, vueRootDir) => relative10(vueRootDir, sourceFilePath).replace(/\\/g, "/").replace(/\.vue$/, ""), extractImports = (sourceCode) => Array.from(sourceCode.matchAll(/import\s+[\s\S]+?['"]([^'"]+)['"]/g)).map((match) => match[1]).filter((importPath) => importPath !== undefined), toJs = (filePath, sourceDir) => {
|
|
10733
10836
|
if (filePath.endsWith(".vue"))
|
|
10734
10837
|
return filePath.replace(/\.vue$/, ".js");
|
|
10735
10838
|
if (filePath.endsWith(".ts"))
|
|
10736
10839
|
return filePath.replace(/\.ts$/, ".js");
|
|
10737
10840
|
if (isStylePath(filePath)) {
|
|
10738
10841
|
if (sourceDir && (filePath.startsWith("./") || filePath.startsWith("../"))) {
|
|
10739
|
-
return
|
|
10842
|
+
return resolve18(sourceDir, filePath);
|
|
10740
10843
|
}
|
|
10741
10844
|
return filePath;
|
|
10742
10845
|
}
|
|
10743
10846
|
return `${filePath}.js`;
|
|
10744
|
-
},
|
|
10847
|
+
}, stripExports2 = (code) => code.replace(/export\s+default/, "const script ="), mergeVueImports2 = (code) => {
|
|
10745
10848
|
const lines = code.split(`
|
|
10746
10849
|
`);
|
|
10747
10850
|
const specifierSet = new Set;
|
|
@@ -10762,7 +10865,7 @@ var resolveDevClientDir3 = () => {
|
|
|
10762
10865
|
const cachedResult = cacheMap.get(sourceFilePath);
|
|
10763
10866
|
if (cachedResult)
|
|
10764
10867
|
return cachedResult;
|
|
10765
|
-
const relativeFilePath =
|
|
10868
|
+
const relativeFilePath = relative10(vueRootDir, sourceFilePath).replace(/\\/g, "/");
|
|
10766
10869
|
const relativeWithoutExtension = relativeFilePath.replace(/\.vue$/, "");
|
|
10767
10870
|
const fileBaseName = basename5(sourceFilePath, ".vue");
|
|
10768
10871
|
const componentId = toKebab(fileBaseName);
|
|
@@ -10800,12 +10903,12 @@ var resolveDevClientDir3 = () => {
|
|
|
10800
10903
|
const childComponentPaths = importPaths.filter((path) => path.startsWith(".") && path.endsWith(".vue"));
|
|
10801
10904
|
const packageComponentPaths = Array.from(resolvedPackageVueImports.entries());
|
|
10802
10905
|
const helperModulePaths = importPaths.filter((path) => path.startsWith(".") && !path.endsWith(".vue") && !isStylePath(path));
|
|
10803
|
-
const stylePathsImported = importPaths.filter((path) => (path.startsWith(".") || isAbsolute3(path)) && isStylePath(path)).map((path) => isAbsolute3(path) ? path :
|
|
10906
|
+
const stylePathsImported = importPaths.filter((path) => (path.startsWith(".") || isAbsolute3(path)) && isStylePath(path)).map((path) => isAbsolute3(path) ? path : resolve18(dirname11(sourceFilePath), path));
|
|
10804
10907
|
for (const stylePath of stylePathsImported) {
|
|
10805
10908
|
addStyleImporter(sourceFilePath, stylePath);
|
|
10806
10909
|
}
|
|
10807
10910
|
const childBuildResults = await Promise.all([
|
|
10808
|
-
...childComponentPaths.map((relativeChildPath) => compileVueFile(
|
|
10911
|
+
...childComponentPaths.map((relativeChildPath) => compileVueFile(resolve18(dirname11(sourceFilePath), relativeChildPath), outputDirs, cacheMap, false, vueRootDir, compiler, stylePreprocessors)),
|
|
10809
10912
|
...packageComponentPaths.map(([, absolutePath]) => compileVueFile(absolutePath, outputDirs, cacheMap, false, vueRootDir, compiler, stylePreprocessors))
|
|
10810
10913
|
]);
|
|
10811
10914
|
const hasScript = descriptor.script || descriptor.scriptSetup;
|
|
@@ -10813,9 +10916,9 @@ var resolveDevClientDir3 = () => {
|
|
|
10813
10916
|
id: componentId,
|
|
10814
10917
|
inlineTemplate: false
|
|
10815
10918
|
}) : { bindings: {}, content: "export default {};" };
|
|
10816
|
-
const strippedScript =
|
|
10817
|
-
const sourceDir =
|
|
10818
|
-
const transpiledScript =
|
|
10919
|
+
const strippedScript = stripExports2(compiledScript.content);
|
|
10920
|
+
const sourceDir = dirname11(sourceFilePath);
|
|
10921
|
+
const transpiledScript = transpiler4.transformSync(strippedScript).replace(/(['"])(\.{1,2}\/[^'"]+)(['"])/g, (_2, quoteStart, relativeImport, quoteEnd) => `${quoteStart}${toJs(relativeImport, sourceDir)}${quoteEnd}`);
|
|
10819
10922
|
const packageImportRewrites = new Map;
|
|
10820
10923
|
for (const [bareImport, absolutePath] of packageComponentPaths) {
|
|
10821
10924
|
const childResult = cacheMap.get(absolutePath);
|
|
@@ -10829,6 +10932,8 @@ var resolveDevClientDir3 = () => {
|
|
|
10829
10932
|
const generateRenderFunction = (ssr) => compiler.compileTemplate({
|
|
10830
10933
|
compilerOptions: {
|
|
10831
10934
|
bindingMetadata: compiledScript.bindings,
|
|
10935
|
+
expressionPlugins: ["typescript"],
|
|
10936
|
+
isCustomElement: (tag) => tag === "absolute-island",
|
|
10832
10937
|
prefixIdentifiers: true
|
|
10833
10938
|
},
|
|
10834
10939
|
filename: sourceFilePath,
|
|
@@ -10851,8 +10956,8 @@ var resolveDevClientDir3 = () => {
|
|
|
10851
10956
|
];
|
|
10852
10957
|
let cssOutputPaths = [];
|
|
10853
10958
|
if (isEntryPoint && allCss.length) {
|
|
10854
|
-
const cssOutputFile =
|
|
10855
|
-
await
|
|
10959
|
+
const cssOutputFile = join17(outputDirs.css, `${toKebab(fileBaseName)}-compiled.css`);
|
|
10960
|
+
await mkdir5(dirname11(cssOutputFile), { recursive: true });
|
|
10856
10961
|
await write2(cssOutputFile, allCss.join(`
|
|
10857
10962
|
`));
|
|
10858
10963
|
cssOutputPaths = [cssOutputFile];
|
|
@@ -10870,7 +10975,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
10870
10975
|
window.__VUE_HMR_COMPONENTS__[script.__hmrId] = script;
|
|
10871
10976
|
}
|
|
10872
10977
|
}` : "";
|
|
10873
|
-
return
|
|
10978
|
+
return mergeVueImports2([
|
|
10874
10979
|
transpiledScript,
|
|
10875
10980
|
renderCode,
|
|
10876
10981
|
`script.${renderFnName} = ${renderFnName};`,
|
|
@@ -10882,9 +10987,9 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
10882
10987
|
};
|
|
10883
10988
|
const clientCode = assembleModule(generateRenderFunction(false), "render", true) + islandMetadataExports;
|
|
10884
10989
|
const serverCode = assembleModule(generateRenderFunction(true), "ssrRender", false) + islandMetadataExports;
|
|
10885
|
-
const clientOutputPath =
|
|
10886
|
-
const serverOutputPath =
|
|
10887
|
-
const relDir =
|
|
10990
|
+
const clientOutputPath = join17(outputDirs.client, `${relativeWithoutExtension}.js`);
|
|
10991
|
+
const serverOutputPath = join17(outputDirs.server, `${relativeWithoutExtension}.js`);
|
|
10992
|
+
const relDir = dirname11(relativeFilePath);
|
|
10888
10993
|
const relDepth = relDir === "." ? 0 : relDir.split("/").length;
|
|
10889
10994
|
const adjustImports = (code) => code.replace(/(from\s+['"])(\.\.\/(?:\.\.\/)*)/g, (_2, prefix, dots) => {
|
|
10890
10995
|
const upCount = dots.split("/").length - 1;
|
|
@@ -10896,15 +11001,15 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
10896
11001
|
let result2 = code;
|
|
10897
11002
|
for (const [bareImport, paths] of packageImportRewrites) {
|
|
10898
11003
|
const targetPath = mode === "server" ? paths.server : paths.client;
|
|
10899
|
-
let rel =
|
|
11004
|
+
let rel = relative10(dirname11(outputPath), targetPath).replace(/\\/g, "/");
|
|
10900
11005
|
if (!rel.startsWith("."))
|
|
10901
11006
|
rel = `./${rel}`;
|
|
10902
11007
|
result2 = result2.replaceAll(bareImport, rel);
|
|
10903
11008
|
}
|
|
10904
11009
|
return result2;
|
|
10905
11010
|
};
|
|
10906
|
-
await
|
|
10907
|
-
await
|
|
11011
|
+
await mkdir5(dirname11(clientOutputPath), { recursive: true });
|
|
11012
|
+
await mkdir5(dirname11(serverOutputPath), { recursive: true });
|
|
10908
11013
|
await write2(clientOutputPath, rewritePackageImports(adjustImports(clientCode), clientOutputPath, "client"));
|
|
10909
11014
|
await write2(serverOutputPath, rewritePackageImports(adjustImports(serverCode), serverOutputPath, "server"));
|
|
10910
11015
|
const result = {
|
|
@@ -10914,7 +11019,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
10914
11019
|
hmrId,
|
|
10915
11020
|
serverPath: serverOutputPath,
|
|
10916
11021
|
tsHelperPaths: [
|
|
10917
|
-
...helperModulePaths.map((helper) =>
|
|
11022
|
+
...helperModulePaths.map((helper) => resolve18(dirname11(sourceFilePath), helper.endsWith(".ts") ? helper : `${helper}.ts`)),
|
|
10918
11023
|
...childBuildResults.flatMap((child) => child.tsHelperPaths)
|
|
10919
11024
|
]
|
|
10920
11025
|
};
|
|
@@ -10924,36 +11029,36 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
10924
11029
|
}, compileVue = async (entryPoints, vueRootDir, isDev = false, stylePreprocessors) => {
|
|
10925
11030
|
const compiler = await import("@vue/compiler-sfc");
|
|
10926
11031
|
const generatedDir = getFrameworkGeneratedDir("vue");
|
|
10927
|
-
const clientOutputDir =
|
|
10928
|
-
const indexOutputDir =
|
|
10929
|
-
const serverOutputDir =
|
|
10930
|
-
const cssOutputDir =
|
|
11032
|
+
const clientOutputDir = join17(generatedDir, "client");
|
|
11033
|
+
const indexOutputDir = join17(generatedDir, "indexes");
|
|
11034
|
+
const serverOutputDir = join17(generatedDir, "server");
|
|
11035
|
+
const cssOutputDir = join17(generatedDir, "compiled");
|
|
10931
11036
|
await Promise.all([
|
|
10932
|
-
|
|
10933
|
-
|
|
10934
|
-
|
|
10935
|
-
|
|
11037
|
+
mkdir5(clientOutputDir, { recursive: true }),
|
|
11038
|
+
mkdir5(indexOutputDir, { recursive: true }),
|
|
11039
|
+
mkdir5(serverOutputDir, { recursive: true }),
|
|
11040
|
+
mkdir5(cssOutputDir, { recursive: true })
|
|
10936
11041
|
]);
|
|
10937
11042
|
const buildCache = new Map;
|
|
10938
11043
|
const allTsHelperPaths = new Set;
|
|
10939
11044
|
const compiledPages = await Promise.all(entryPoints.map(async (entryPath) => {
|
|
10940
|
-
const result = await compileVueFile(
|
|
11045
|
+
const result = await compileVueFile(resolve18(entryPath), {
|
|
10941
11046
|
client: clientOutputDir,
|
|
10942
11047
|
css: cssOutputDir,
|
|
10943
11048
|
server: serverOutputDir
|
|
10944
11049
|
}, buildCache, true, vueRootDir, compiler, stylePreprocessors);
|
|
10945
11050
|
result.tsHelperPaths.forEach((path) => allTsHelperPaths.add(path));
|
|
10946
11051
|
const entryBaseName = basename5(entryPath, ".vue");
|
|
10947
|
-
const indexOutputFile =
|
|
10948
|
-
const clientOutputFile =
|
|
10949
|
-
await
|
|
11052
|
+
const indexOutputFile = join17(indexOutputDir, `${entryBaseName}.js`);
|
|
11053
|
+
const clientOutputFile = join17(clientOutputDir, relative10(vueRootDir, entryPath).replace(/\\/g, "/").replace(/\.vue$/, ".js"));
|
|
11054
|
+
await mkdir5(dirname11(indexOutputFile), { recursive: true });
|
|
10950
11055
|
const vueHmrImports = isDev ? [
|
|
10951
11056
|
`window.__HMR_FRAMEWORK__ = "vue";`,
|
|
10952
11057
|
`import "${hmrClientPath4}";`
|
|
10953
11058
|
] : [];
|
|
10954
11059
|
await write2(indexOutputFile, [
|
|
10955
11060
|
...vueHmrImports,
|
|
10956
|
-
`import Comp, * as PageModule from "${
|
|
11061
|
+
`import Comp, * as PageModule from "${relative10(dirname11(indexOutputFile), clientOutputFile).replace(/\\/g, "/")}";`,
|
|
10957
11062
|
'import { createSSRApp, createApp } from "vue";',
|
|
10958
11063
|
"",
|
|
10959
11064
|
"// HMR State Preservation: Check for preserved state from HMR",
|
|
@@ -11096,12 +11201,12 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
11096
11201
|
}));
|
|
11097
11202
|
await Promise.all(Array.from(allTsHelperPaths).map(async (tsPath) => {
|
|
11098
11203
|
const sourceCode = await file2(tsPath).text();
|
|
11099
|
-
const transpiledCode =
|
|
11100
|
-
const relativeJsPath =
|
|
11101
|
-
const outClientPath =
|
|
11102
|
-
const outServerPath =
|
|
11103
|
-
await
|
|
11104
|
-
await
|
|
11204
|
+
const transpiledCode = transpiler4.transformSync(sourceCode);
|
|
11205
|
+
const relativeJsPath = relative10(vueRootDir, tsPath).replace(/\.ts$/, ".js");
|
|
11206
|
+
const outClientPath = join17(clientOutputDir, relativeJsPath);
|
|
11207
|
+
const outServerPath = join17(serverOutputDir, relativeJsPath);
|
|
11208
|
+
await mkdir5(dirname11(outClientPath), { recursive: true });
|
|
11209
|
+
await mkdir5(dirname11(outServerPath), { recursive: true });
|
|
11105
11210
|
await write2(outClientPath, transpiledCode);
|
|
11106
11211
|
await write2(outServerPath, transpiledCode);
|
|
11107
11212
|
}));
|
|
@@ -11121,8 +11226,8 @@ var init_compileVue = __esm(() => {
|
|
|
11121
11226
|
init_vueAutoRouterTransform();
|
|
11122
11227
|
init_stylePreprocessor();
|
|
11123
11228
|
devClientDir3 = resolveDevClientDir3();
|
|
11124
|
-
hmrClientPath4 =
|
|
11125
|
-
|
|
11229
|
+
hmrClientPath4 = join17(devClientDir3, "hmrClient.ts").replace(/\\/g, "/");
|
|
11230
|
+
transpiler4 = new Transpiler3({ loader: "ts", target: "browser" });
|
|
11126
11231
|
scriptCache = new Map;
|
|
11127
11232
|
scriptSetupCache = new Map;
|
|
11128
11233
|
templateCache = new Map;
|
|
@@ -11602,17 +11707,17 @@ __export(exports_compileAngular, {
|
|
|
11602
11707
|
compileAngular: () => compileAngular
|
|
11603
11708
|
});
|
|
11604
11709
|
import { existsSync as existsSync16, readFileSync as readFileSync11, promises as fs } from "fs";
|
|
11605
|
-
import { join as
|
|
11710
|
+
import { join as join18, basename as basename6, sep as sep3, dirname as dirname12, resolve as resolve19, relative as relative11 } from "path";
|
|
11606
11711
|
import ts2 from "typescript";
|
|
11607
11712
|
var traceAngularPhase = async (name, fn2, metadata) => {
|
|
11608
11713
|
const tracePhase = globalThis.__absoluteBuildTracePhase;
|
|
11609
11714
|
return tracePhase ? tracePhase(`compile/angular/${name}`, fn2, metadata) : await fn2();
|
|
11610
11715
|
}, readTsconfigPathAliases = () => {
|
|
11611
11716
|
try {
|
|
11612
|
-
const configPath2 =
|
|
11717
|
+
const configPath2 = resolve19(process.cwd(), "tsconfig.json");
|
|
11613
11718
|
const config = ts2.readConfigFile(configPath2, ts2.sys.readFile).config;
|
|
11614
11719
|
const compilerOptions = config?.compilerOptions ?? {};
|
|
11615
|
-
const baseUrl =
|
|
11720
|
+
const baseUrl = resolve19(process.cwd(), compilerOptions.baseUrl ?? ".");
|
|
11616
11721
|
const aliases = Object.entries(compilerOptions.paths ?? {}).map(([pattern, replacements]) => ({ pattern, replacements }));
|
|
11617
11722
|
return { aliases, baseUrl };
|
|
11618
11723
|
} catch {
|
|
@@ -11632,7 +11737,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
11632
11737
|
const wildcardValue = exactMatch ? "" : specifier.slice(prefix.length, specifier.length - suffix.length);
|
|
11633
11738
|
for (const replacement of alias.replacements) {
|
|
11634
11739
|
const candidate = replacement.replace("*", wildcardValue);
|
|
11635
|
-
const resolved = resolveSourceFile(
|
|
11740
|
+
const resolved = resolveSourceFile(resolve19(baseUrl, candidate));
|
|
11636
11741
|
if (resolved)
|
|
11637
11742
|
return resolved;
|
|
11638
11743
|
}
|
|
@@ -11644,20 +11749,20 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
11644
11749
|
`${candidate}.tsx`,
|
|
11645
11750
|
`${candidate}.js`,
|
|
11646
11751
|
`${candidate}.jsx`,
|
|
11647
|
-
|
|
11648
|
-
|
|
11649
|
-
|
|
11650
|
-
|
|
11752
|
+
join18(candidate, "index.ts"),
|
|
11753
|
+
join18(candidate, "index.tsx"),
|
|
11754
|
+
join18(candidate, "index.js"),
|
|
11755
|
+
join18(candidate, "index.jsx")
|
|
11651
11756
|
];
|
|
11652
11757
|
return candidates.find((file3) => existsSync16(file3));
|
|
11653
11758
|
}, createLegacyAngularAnimationUsageResolver = (rootDir) => {
|
|
11654
|
-
const baseDir =
|
|
11759
|
+
const baseDir = resolve19(rootDir);
|
|
11655
11760
|
const tsconfigAliases = readTsconfigPathAliases();
|
|
11656
|
-
const
|
|
11761
|
+
const transpiler5 = new Bun.Transpiler({ loader: "tsx" });
|
|
11657
11762
|
const scanCache = new Map;
|
|
11658
11763
|
const resolveLocalImport = (specifier, fromDir) => {
|
|
11659
11764
|
if (specifier.startsWith(".") || specifier.startsWith("/")) {
|
|
11660
|
-
return resolveSourceFile(
|
|
11765
|
+
return resolveSourceFile(resolve19(fromDir, specifier));
|
|
11661
11766
|
}
|
|
11662
11767
|
const aliased = matchTsconfigAlias(specifier, tsconfigAliases.aliases, tsconfigAliases.baseUrl, resolveSourceFile);
|
|
11663
11768
|
if (aliased)
|
|
@@ -11666,7 +11771,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
11666
11771
|
const resolved = Bun.resolveSync(specifier, fromDir);
|
|
11667
11772
|
if (resolved.includes("/node_modules/"))
|
|
11668
11773
|
return;
|
|
11669
|
-
const absolute =
|
|
11774
|
+
const absolute = resolve19(resolved);
|
|
11670
11775
|
if (!absolute.startsWith(baseDir))
|
|
11671
11776
|
return;
|
|
11672
11777
|
return resolveSourceFile(absolute);
|
|
@@ -11682,7 +11787,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
11682
11787
|
usesLegacyAnimations: false
|
|
11683
11788
|
});
|
|
11684
11789
|
}
|
|
11685
|
-
const resolved =
|
|
11790
|
+
const resolved = resolve19(actualPath);
|
|
11686
11791
|
const cached = scanCache.get(resolved);
|
|
11687
11792
|
if (cached)
|
|
11688
11793
|
return cached;
|
|
@@ -11695,7 +11800,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
11695
11800
|
}
|
|
11696
11801
|
let imports;
|
|
11697
11802
|
try {
|
|
11698
|
-
imports =
|
|
11803
|
+
imports = transpiler5.scanImports(sourceCode);
|
|
11699
11804
|
} catch {
|
|
11700
11805
|
return { imports: [], usesLegacyAnimations: false };
|
|
11701
11806
|
}
|
|
@@ -11711,7 +11816,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
11711
11816
|
const actualPath = resolveSourceFile(filePath);
|
|
11712
11817
|
if (!actualPath)
|
|
11713
11818
|
return false;
|
|
11714
|
-
const resolved =
|
|
11819
|
+
const resolved = resolve19(actualPath);
|
|
11715
11820
|
if (visited.has(resolved))
|
|
11716
11821
|
return false;
|
|
11717
11822
|
visited.add(resolved);
|
|
@@ -11719,7 +11824,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
11719
11824
|
if (scan.usesLegacyAnimations)
|
|
11720
11825
|
return true;
|
|
11721
11826
|
for (const specifier of scan.imports) {
|
|
11722
|
-
const importedPath = resolveLocalImport(specifier,
|
|
11827
|
+
const importedPath = resolveLocalImport(specifier, dirname12(resolved));
|
|
11723
11828
|
if (importedPath && await visit(importedPath, visited)) {
|
|
11724
11829
|
return true;
|
|
11725
11830
|
}
|
|
@@ -11729,14 +11834,14 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
11729
11834
|
return (entryPath) => visit(entryPath);
|
|
11730
11835
|
}, resolveDevClientDir4 = () => {
|
|
11731
11836
|
const projectRoot = process.cwd();
|
|
11732
|
-
const fromSource =
|
|
11837
|
+
const fromSource = resolve19(import.meta.dir, "../dev/client");
|
|
11733
11838
|
if (existsSync16(fromSource) && fromSource.startsWith(projectRoot)) {
|
|
11734
11839
|
return fromSource;
|
|
11735
11840
|
}
|
|
11736
|
-
const fromNodeModules =
|
|
11841
|
+
const fromNodeModules = resolve19(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client");
|
|
11737
11842
|
if (existsSync16(fromNodeModules))
|
|
11738
11843
|
return fromNodeModules;
|
|
11739
|
-
return
|
|
11844
|
+
return resolve19(import.meta.dir, "./dev/client");
|
|
11740
11845
|
}, devClientDir4, hmrClientPath5, formatDiagnosticMessage = (diagnostic) => {
|
|
11741
11846
|
try {
|
|
11742
11847
|
return ts2.flattenDiagnosticMessageText(diagnostic.messageText, `
|
|
@@ -11778,12 +11883,12 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
11778
11883
|
return `${path.replace(/\.ts$/, ".js")}${query}`;
|
|
11779
11884
|
if (hasJsLikeExtension(path))
|
|
11780
11885
|
return `${path}${query}`;
|
|
11781
|
-
const importerDir =
|
|
11782
|
-
const fileCandidate =
|
|
11886
|
+
const importerDir = dirname12(importerOutputPath);
|
|
11887
|
+
const fileCandidate = resolve19(importerDir, `${path}.js`);
|
|
11783
11888
|
if (outputFiles?.has(fileCandidate) || existsSync16(fileCandidate)) {
|
|
11784
11889
|
return `${path}.js${query}`;
|
|
11785
11890
|
}
|
|
11786
|
-
const indexCandidate =
|
|
11891
|
+
const indexCandidate = resolve19(importerDir, path, "index.js");
|
|
11787
11892
|
if (outputFiles?.has(indexCandidate) || existsSync16(indexCandidate)) {
|
|
11788
11893
|
return `${path}/index.js${query}`;
|
|
11789
11894
|
}
|
|
@@ -11811,18 +11916,18 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
11811
11916
|
}, resolveLocalTsImport = (fromFile, specifier) => {
|
|
11812
11917
|
if (!isRelativeModuleSpecifier(specifier))
|
|
11813
11918
|
return null;
|
|
11814
|
-
const basePath =
|
|
11919
|
+
const basePath = resolve19(dirname12(fromFile), specifier);
|
|
11815
11920
|
const candidates = /\.[cm]?[tj]sx?$/.test(basePath) ? [basePath] : [
|
|
11816
11921
|
`${basePath}.ts`,
|
|
11817
11922
|
`${basePath}.tsx`,
|
|
11818
11923
|
`${basePath}.mts`,
|
|
11819
11924
|
`${basePath}.cts`,
|
|
11820
|
-
|
|
11821
|
-
|
|
11822
|
-
|
|
11823
|
-
|
|
11925
|
+
join18(basePath, "index.ts"),
|
|
11926
|
+
join18(basePath, "index.tsx"),
|
|
11927
|
+
join18(basePath, "index.mts"),
|
|
11928
|
+
join18(basePath, "index.cts")
|
|
11824
11929
|
];
|
|
11825
|
-
return candidates.map((candidate) =>
|
|
11930
|
+
return candidates.map((candidate) => resolve19(candidate)).find((candidate) => existsSync16(candidate) && !candidate.endsWith(".d.ts")) ?? null;
|
|
11826
11931
|
}, readFileForAotTransform = async (fileName, readFile6) => {
|
|
11827
11932
|
const hostSource = readFile6?.(fileName);
|
|
11828
11933
|
if (typeof hostSource === "string")
|
|
@@ -11846,18 +11951,18 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
11846
11951
|
const paths = [];
|
|
11847
11952
|
const templateUrlMatch = findUncommentedMatch(source, /templateUrl\s*:\s*['"]([^'"]+)['"]/);
|
|
11848
11953
|
if (templateUrlMatch?.[1])
|
|
11849
|
-
paths.push(
|
|
11954
|
+
paths.push(join18(fileDir, templateUrlMatch[1]));
|
|
11850
11955
|
const styleUrlMatch = findUncommentedMatch(source, /styleUrl\s*:\s*['"]([^'"]+)['"]/);
|
|
11851
11956
|
if (styleUrlMatch?.[1])
|
|
11852
|
-
paths.push(
|
|
11957
|
+
paths.push(join18(fileDir, styleUrlMatch[1]));
|
|
11853
11958
|
const styleUrlsMatch = findUncommentedMatch(source, /styleUrls\s*:\s*\[([^\]]+)\]/);
|
|
11854
11959
|
const urlMatches = styleUrlsMatch?.[1]?.match(/['"]([^'"]+)['"]/g);
|
|
11855
11960
|
if (urlMatches) {
|
|
11856
11961
|
for (const urlMatch of urlMatches) {
|
|
11857
|
-
paths.push(
|
|
11962
|
+
paths.push(join18(fileDir, urlMatch.replace(/['"]/g, "")));
|
|
11858
11963
|
}
|
|
11859
11964
|
}
|
|
11860
|
-
return paths.map((path) =>
|
|
11965
|
+
return paths.map((path) => resolve19(path));
|
|
11861
11966
|
}, readResourceCacheFile = async (cachePath) => {
|
|
11862
11967
|
try {
|
|
11863
11968
|
const entry = JSON.parse(await fs.readFile(cachePath, "utf-8"));
|
|
@@ -11869,13 +11974,13 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
11869
11974
|
return null;
|
|
11870
11975
|
}
|
|
11871
11976
|
}, writeResourceCacheFile = async (cachePath, source) => {
|
|
11872
|
-
await fs.mkdir(
|
|
11977
|
+
await fs.mkdir(dirname12(cachePath), { recursive: true });
|
|
11873
11978
|
await fs.writeFile(cachePath, JSON.stringify({
|
|
11874
11979
|
source,
|
|
11875
11980
|
version: 1
|
|
11876
11981
|
}), "utf-8");
|
|
11877
11982
|
}, resolveResourceTransformCachePath = async (filePath, source, stylePreprocessors) => {
|
|
11878
|
-
const resourcePaths = collectAngularResourcePaths(source,
|
|
11983
|
+
const resourcePaths = collectAngularResourcePaths(source, dirname12(filePath));
|
|
11879
11984
|
const resourceContents = await Promise.all(resourcePaths.map(async (resourcePath) => {
|
|
11880
11985
|
const content = await fs.readFile(resourcePath, "utf-8");
|
|
11881
11986
|
return `${resourcePath}\x00${content}`;
|
|
@@ -11888,7 +11993,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
11888
11993
|
safeStableStringify(stylePreprocessors ?? null)
|
|
11889
11994
|
].join("\x00");
|
|
11890
11995
|
const cacheKey2 = Bun.hash(cacheInput).toString(BASE_36_RADIX);
|
|
11891
|
-
return
|
|
11996
|
+
return join18(process.cwd(), ".absolutejs", "cache", "angular-resources", `${cacheKey2}.json`);
|
|
11892
11997
|
}, precomputeAotResourceTransforms = async (inputPaths, readFile6, stylePreprocessors) => {
|
|
11893
11998
|
const transformedSources = new Map;
|
|
11894
11999
|
const visited = new Set;
|
|
@@ -11899,7 +12004,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
11899
12004
|
transformedFiles: 0
|
|
11900
12005
|
};
|
|
11901
12006
|
const transformFile = async (filePath) => {
|
|
11902
|
-
const resolvedPath =
|
|
12007
|
+
const resolvedPath = resolve19(filePath);
|
|
11903
12008
|
if (visited.has(resolvedPath))
|
|
11904
12009
|
return;
|
|
11905
12010
|
visited.add(resolvedPath);
|
|
@@ -11915,7 +12020,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
11915
12020
|
transformedSource = cached.source;
|
|
11916
12021
|
} else {
|
|
11917
12022
|
stats.cacheMisses += 1;
|
|
11918
|
-
const transformed = await inlineResources(source,
|
|
12023
|
+
const transformed = await inlineResources(source, dirname12(resolvedPath), stylePreprocessors);
|
|
11919
12024
|
transformedSource = transformed.source;
|
|
11920
12025
|
await writeResourceCacheFile(cachePath, transformedSource);
|
|
11921
12026
|
}
|
|
@@ -11934,7 +12039,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
11934
12039
|
return { stats, transformedSources };
|
|
11935
12040
|
}, compileAngularFiles = async (inputPaths, outDir, stylePreprocessors) => {
|
|
11936
12041
|
const islandMetadataByOutputPath = await traceAngularPhase("aot/island-metadata", () => new Map(inputPaths.map((inputPath) => {
|
|
11937
|
-
const outputPath =
|
|
12042
|
+
const outputPath = resolve19(join18(outDir, relative11(process.cwd(), resolve19(inputPath)).replace(/\.[cm]?[tj]sx?$/, ".js")));
|
|
11938
12043
|
return [
|
|
11939
12044
|
outputPath,
|
|
11940
12045
|
buildIslandMetadataExports(readFileSync11(inputPath, "utf-8"))
|
|
@@ -11944,8 +12049,8 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
11944
12049
|
const { readConfiguration, performCompilation, EmitFlags } = await traceAngularPhase("aot/import-compiler-cli", () => import("@angular/compiler-cli"));
|
|
11945
12050
|
const tsLibDir = await traceAngularPhase("aot/resolve-typescript-lib", () => {
|
|
11946
12051
|
const tsPath = __require.resolve("typescript");
|
|
11947
|
-
const tsRootDir =
|
|
11948
|
-
return tsRootDir.endsWith("lib") ? tsRootDir :
|
|
12052
|
+
const tsRootDir = dirname12(tsPath);
|
|
12053
|
+
return tsRootDir.endsWith("lib") ? tsRootDir : resolve19(tsRootDir, "lib");
|
|
11949
12054
|
});
|
|
11950
12055
|
const config = await traceAngularPhase("aot/read-configuration", () => readConfiguration("./tsconfig.json"));
|
|
11951
12056
|
const options = {
|
|
@@ -11981,13 +12086,13 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
11981
12086
|
const originalGetSourceFile = host.getSourceFile;
|
|
11982
12087
|
host.getSourceFile = (fileName, languageVersion, onError) => {
|
|
11983
12088
|
if (fileName.startsWith("lib.") && fileName.endsWith(".d.ts") && tsLibDir) {
|
|
11984
|
-
const resolvedPath =
|
|
12089
|
+
const resolvedPath = join18(tsLibDir, fileName);
|
|
11985
12090
|
return originalGetSourceFile?.call(host, resolvedPath, languageVersion, onError);
|
|
11986
12091
|
}
|
|
11987
12092
|
return originalGetSourceFile?.call(host, fileName, languageVersion, onError);
|
|
11988
12093
|
};
|
|
11989
12094
|
const emitted = {};
|
|
11990
|
-
const resolvedOutDir =
|
|
12095
|
+
const resolvedOutDir = resolve19(outDir);
|
|
11991
12096
|
host.writeFile = (fileName, text) => {
|
|
11992
12097
|
const relativePath = resolveRelativePath(fileName, resolvedOutDir, outDir);
|
|
11993
12098
|
emitted[relativePath] = text;
|
|
@@ -12009,12 +12114,12 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
12009
12114
|
if (!fileName.endsWith(".ts") || fileName.endsWith(".d.ts")) {
|
|
12010
12115
|
return source;
|
|
12011
12116
|
}
|
|
12012
|
-
const resolvedPath =
|
|
12117
|
+
const resolvedPath = resolve19(fileName);
|
|
12013
12118
|
return transformedSources.get(resolvedPath) ?? source;
|
|
12014
12119
|
};
|
|
12015
12120
|
const originalGetSourceFileForCompile = host.getSourceFile;
|
|
12016
12121
|
host.getSourceFile = (fileName, languageVersion, onError) => {
|
|
12017
|
-
const source = transformedSources.get(
|
|
12122
|
+
const source = transformedSources.get(resolve19(fileName));
|
|
12018
12123
|
if (source) {
|
|
12019
12124
|
return ts2.createSourceFile(fileName, source, languageVersion, true);
|
|
12020
12125
|
}
|
|
@@ -12036,9 +12141,9 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
12036
12141
|
const entries = await traceAngularPhase("aot/postprocess-emitted-js", () => {
|
|
12037
12142
|
const rawEntries = Object.entries(emitted).filter(([fileName]) => fileName.endsWith(".js")).map(([fileName, content]) => ({
|
|
12038
12143
|
content,
|
|
12039
|
-
target:
|
|
12144
|
+
target: join18(outDir, fileName)
|
|
12040
12145
|
}));
|
|
12041
|
-
const outputFiles = new Set(rawEntries.map(({ target }) =>
|
|
12146
|
+
const outputFiles = new Set(rawEntries.map(({ target }) => resolve19(target)));
|
|
12042
12147
|
return rawEntries.map(({ content, target }) => {
|
|
12043
12148
|
let processedContent = content.replace(/from\s+(['"])(\.\.?\/[^'"]+)(\1)/g, (match, quote, path) => {
|
|
12044
12149
|
const rewritten = rewriteRelativeJsSpecifier(target, path, outputFiles);
|
|
@@ -12053,12 +12158,12 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
12053
12158
|
return cleaned ? `import { ${cleaned}, InternalInjectFlags } from '@angular/core'` : `import { InternalInjectFlags } from '@angular/core'`;
|
|
12054
12159
|
});
|
|
12055
12160
|
processedContent = processedContent.replace(/\b(?<!Internal)InjectFlags\b/g, "InternalInjectFlags");
|
|
12056
|
-
processedContent += islandMetadataByOutputPath.get(
|
|
12161
|
+
processedContent += islandMetadataByOutputPath.get(resolve19(target)) ?? "";
|
|
12057
12162
|
return { content: processedContent, target };
|
|
12058
12163
|
});
|
|
12059
12164
|
});
|
|
12060
12165
|
await traceAngularPhase("aot/write-output", () => Promise.all(entries.map(async ({ target, content }) => {
|
|
12061
|
-
await fs.mkdir(
|
|
12166
|
+
await fs.mkdir(dirname12(target), { recursive: true });
|
|
12062
12167
|
await fs.writeFile(target, content, "utf-8");
|
|
12063
12168
|
})), { outputs: entries.length });
|
|
12064
12169
|
return await traceAngularPhase("aot/collect-output-paths", () => entries.map(({ target }) => target), { outputs: entries.length });
|
|
@@ -12074,7 +12179,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
12074
12179
|
}
|
|
12075
12180
|
return null;
|
|
12076
12181
|
}, resolveAngularDeferImportSpecifier = () => {
|
|
12077
|
-
const sourceEntry =
|
|
12182
|
+
const sourceEntry = resolve19(import.meta.dir, "../angular/components/index.ts");
|
|
12078
12183
|
if (existsSync16(sourceEntry)) {
|
|
12079
12184
|
return sourceEntry.replace(/\\/g, "/");
|
|
12080
12185
|
}
|
|
@@ -12211,7 +12316,7 @@ ${fields}
|
|
|
12211
12316
|
}, inlineTemplateAndLowerDefer = async (source, fileDir) => {
|
|
12212
12317
|
const templateUrlMatch = findUncommentedMatch(source, /templateUrl\s*:\s*['"]([^'"]+)['"]/);
|
|
12213
12318
|
if (templateUrlMatch?.[1]) {
|
|
12214
|
-
const templatePath =
|
|
12319
|
+
const templatePath = join18(fileDir, templateUrlMatch[1]);
|
|
12215
12320
|
if (!existsSync16(templatePath)) {
|
|
12216
12321
|
throw new Error(`Unable to inline Angular templateUrl "${templateUrlMatch[1]}": file not found at ${templatePath}`);
|
|
12217
12322
|
}
|
|
@@ -12242,7 +12347,7 @@ ${fields}
|
|
|
12242
12347
|
}, inlineTemplateAndLowerDeferSync = (source, fileDir) => {
|
|
12243
12348
|
const templateUrlMatch = findUncommentedMatch(source, /templateUrl\s*:\s*['"]([^'"]+)['"]/);
|
|
12244
12349
|
if (templateUrlMatch?.[1]) {
|
|
12245
|
-
const templatePath =
|
|
12350
|
+
const templatePath = join18(fileDir, templateUrlMatch[1]);
|
|
12246
12351
|
if (!existsSync16(templatePath)) {
|
|
12247
12352
|
throw new Error(`Unable to inline Angular templateUrl "${templateUrlMatch[1]}": file not found at ${templatePath}`);
|
|
12248
12353
|
}
|
|
@@ -12279,7 +12384,7 @@ ${fields}
|
|
|
12279
12384
|
return source;
|
|
12280
12385
|
const stylePromises = urlMatches.map((urlMatch) => {
|
|
12281
12386
|
const styleUrl = urlMatch.replace(/['"]/g, "");
|
|
12282
|
-
return readAndEscapeFile(
|
|
12387
|
+
return readAndEscapeFile(join18(fileDir, styleUrl), stylePreprocessors);
|
|
12283
12388
|
});
|
|
12284
12389
|
const results = await Promise.all(stylePromises);
|
|
12285
12390
|
const inlinedStyles = results.filter(Boolean).map((escaped) => `\`${escaped}\``);
|
|
@@ -12290,7 +12395,7 @@ ${fields}
|
|
|
12290
12395
|
const styleUrlMatch = findUncommentedMatch(source, /styleUrl\s*:\s*['"]([^'"]+)['"]/);
|
|
12291
12396
|
if (!styleUrlMatch?.[1])
|
|
12292
12397
|
return source;
|
|
12293
|
-
const escaped = await readAndEscapeFile(
|
|
12398
|
+
const escaped = await readAndEscapeFile(join18(fileDir, styleUrlMatch[1]), stylePreprocessors);
|
|
12294
12399
|
if (!escaped)
|
|
12295
12400
|
return source;
|
|
12296
12401
|
return source.slice(0, styleUrlMatch.index) + `styles: [\`${escaped}\`]` + source.slice(styleUrlMatch.index + styleUrlMatch[0].length);
|
|
@@ -12304,10 +12409,10 @@ ${fields}
|
|
|
12304
12409
|
source: result
|
|
12305
12410
|
};
|
|
12306
12411
|
}, compileAngularFileJIT = async (inputPath, outDir, rootDir, stylePreprocessors, cacheBuster) => {
|
|
12307
|
-
const entryPath =
|
|
12412
|
+
const entryPath = resolve19(inputPath);
|
|
12308
12413
|
const allOutputs = [];
|
|
12309
12414
|
const visited = new Set;
|
|
12310
|
-
const baseDir =
|
|
12415
|
+
const baseDir = resolve19(rootDir ?? process.cwd());
|
|
12311
12416
|
let usesLegacyAnimations = false;
|
|
12312
12417
|
const angularTranspiler = new Bun.Transpiler({
|
|
12313
12418
|
loader: "ts",
|
|
@@ -12325,16 +12430,16 @@ ${fields}
|
|
|
12325
12430
|
`${candidate}.tsx`,
|
|
12326
12431
|
`${candidate}.js`,
|
|
12327
12432
|
`${candidate}.jsx`,
|
|
12328
|
-
|
|
12329
|
-
|
|
12330
|
-
|
|
12331
|
-
|
|
12433
|
+
join18(candidate, "index.ts"),
|
|
12434
|
+
join18(candidate, "index.tsx"),
|
|
12435
|
+
join18(candidate, "index.js"),
|
|
12436
|
+
join18(candidate, "index.jsx")
|
|
12332
12437
|
];
|
|
12333
12438
|
return candidates.find((file3) => existsSync16(file3));
|
|
12334
12439
|
};
|
|
12335
12440
|
const resolveLocalImport = (specifier, fromDir) => {
|
|
12336
12441
|
if (specifier.startsWith(".") || specifier.startsWith("/")) {
|
|
12337
|
-
return resolveSourceFile2(
|
|
12442
|
+
return resolveSourceFile2(resolve19(fromDir, specifier));
|
|
12338
12443
|
}
|
|
12339
12444
|
const aliased = matchTsconfigAlias(specifier, tsconfigAliases.aliases, tsconfigAliases.baseUrl, resolveSourceFile2);
|
|
12340
12445
|
if (aliased)
|
|
@@ -12343,7 +12448,7 @@ ${fields}
|
|
|
12343
12448
|
const resolved = Bun.resolveSync(specifier, fromDir);
|
|
12344
12449
|
if (resolved.includes("/node_modules/"))
|
|
12345
12450
|
return;
|
|
12346
|
-
const absolute =
|
|
12451
|
+
const absolute = resolve19(resolved);
|
|
12347
12452
|
if (!absolute.startsWith(baseDir))
|
|
12348
12453
|
return;
|
|
12349
12454
|
return resolveSourceFile2(absolute);
|
|
@@ -12352,10 +12457,10 @@ ${fields}
|
|
|
12352
12457
|
}
|
|
12353
12458
|
};
|
|
12354
12459
|
const toOutputPath = (sourcePath) => {
|
|
12355
|
-
const inputDir =
|
|
12460
|
+
const inputDir = dirname12(sourcePath);
|
|
12356
12461
|
const relativeDir = inputDir.startsWith(baseDir) ? inputDir.substring(baseDir.length + 1) : inputDir;
|
|
12357
12462
|
const fileBase = basename6(sourcePath).replace(/\.[cm]?[tj]sx?$/, ".js");
|
|
12358
|
-
return
|
|
12463
|
+
return join18(outDir, relativeDir, fileBase);
|
|
12359
12464
|
};
|
|
12360
12465
|
const withCacheBuster = (specifier) => {
|
|
12361
12466
|
if (!cacheBuster)
|
|
@@ -12392,13 +12497,13 @@ ${fields}
|
|
|
12392
12497
|
return `${prefix}${dots}`;
|
|
12393
12498
|
return `${prefix}../${dots}`;
|
|
12394
12499
|
});
|
|
12395
|
-
if (
|
|
12500
|
+
if (resolve19(actualPath) === entryPath) {
|
|
12396
12501
|
processedContent += buildIslandMetadataExports(sourceCode);
|
|
12397
12502
|
}
|
|
12398
12503
|
return processedContent;
|
|
12399
12504
|
};
|
|
12400
12505
|
const transpileFile = async (filePath) => {
|
|
12401
|
-
const resolved =
|
|
12506
|
+
const resolved = resolve19(filePath);
|
|
12402
12507
|
if (visited.has(resolved))
|
|
12403
12508
|
return;
|
|
12404
12509
|
visited.add(resolved);
|
|
@@ -12408,12 +12513,12 @@ ${fields}
|
|
|
12408
12513
|
if (!existsSync16(actualPath))
|
|
12409
12514
|
return;
|
|
12410
12515
|
let sourceCode = await fs.readFile(actualPath, "utf-8");
|
|
12411
|
-
const inlined = await inlineResources(sourceCode,
|
|
12412
|
-
sourceCode = inlineTemplateAndLowerDeferSync(inlined.source,
|
|
12413
|
-
const inputDir =
|
|
12516
|
+
const inlined = await inlineResources(sourceCode, dirname12(actualPath), stylePreprocessors);
|
|
12517
|
+
sourceCode = inlineTemplateAndLowerDeferSync(inlined.source, dirname12(actualPath)).source;
|
|
12518
|
+
const inputDir = dirname12(actualPath);
|
|
12414
12519
|
const relativeDir = inputDir.startsWith(baseDir) ? inputDir.substring(baseDir.length + 1) : inputDir;
|
|
12415
12520
|
const fileBase = basename6(actualPath).replace(/\.[cm]?[tj]sx?$/, ".js");
|
|
12416
|
-
const targetDir =
|
|
12521
|
+
const targetDir = join18(outDir, relativeDir);
|
|
12417
12522
|
const targetPath = toOutputPath(actualPath);
|
|
12418
12523
|
const localImports = [];
|
|
12419
12524
|
const importRewrites = new Map;
|
|
@@ -12435,12 +12540,12 @@ ${fields}
|
|
|
12435
12540
|
const resolved2 = resolveLocalImport(specifier, inputDir);
|
|
12436
12541
|
if (!resolved2)
|
|
12437
12542
|
return null;
|
|
12438
|
-
const relativeImport =
|
|
12543
|
+
const relativeImport = relative11(targetDir, toOutputPath(resolved2)).replace(/\\/g, "/").replace(/\.js$/, "");
|
|
12439
12544
|
const relativeRewrite = relativeImport.startsWith(".") ? relativeImport : `./${relativeImport}`;
|
|
12440
12545
|
importRewrites.set(specifier, relativeRewrite);
|
|
12441
12546
|
return resolved2;
|
|
12442
12547
|
}).filter((path) => Boolean(path));
|
|
12443
|
-
const isEntry =
|
|
12548
|
+
const isEntry = resolve19(actualPath) === resolve19(entryPath);
|
|
12444
12549
|
const contentHash = Bun.hash(sourceCode).toString(BASE_36_RADIX);
|
|
12445
12550
|
const cacheKey2 = actualPath;
|
|
12446
12551
|
const shouldWriteFile = cacheBuster && isEntry ? true : jitContentCache.get(cacheKey2) !== contentHash || !existsSync16(targetPath);
|
|
@@ -12474,13 +12579,13 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
12474
12579
|
return { clientPaths: [...emptyPaths], serverPaths: [...emptyPaths] };
|
|
12475
12580
|
}
|
|
12476
12581
|
const compiledRoot = compiledParent;
|
|
12477
|
-
const indexesDir =
|
|
12582
|
+
const indexesDir = join18(compiledParent, "indexes");
|
|
12478
12583
|
await traceAngularPhase("setup/create-indexes-dir", () => fs.mkdir(indexesDir, { recursive: true }));
|
|
12479
|
-
const aotOutputs = hmr ? [] : await traceAngularPhase("aot/compile-files", () => compileAngularFiles(entryPoints.map((entry) =>
|
|
12584
|
+
const aotOutputs = hmr ? [] : await traceAngularPhase("aot/compile-files", () => compileAngularFiles(entryPoints.map((entry) => resolve19(entry)), compiledRoot, stylePreprocessors), { entries: entryPoints.length });
|
|
12480
12585
|
const usesLegacyAngularAnimations = await traceAngularPhase("setup/legacy-animation-resolver", () => createLegacyAngularAnimationUsageResolver(outRoot));
|
|
12481
12586
|
const compileTasks = entryPoints.map(async (entry) => {
|
|
12482
|
-
const resolvedEntry =
|
|
12483
|
-
const relativeEntry =
|
|
12587
|
+
const resolvedEntry = resolve19(entry);
|
|
12588
|
+
const relativeEntry = relative11(outRoot, resolvedEntry).replace(/\.[tj]s$/, ".js");
|
|
12484
12589
|
const compileEntry = () => compileAngularFileJIT(resolvedEntry, compiledRoot, outRoot, stylePreprocessors);
|
|
12485
12590
|
let outputs = hmr ? await traceAngularPhase("jit/compile-entry", compileEntry, {
|
|
12486
12591
|
entry: resolvedEntry
|
|
@@ -12488,13 +12593,13 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
12488
12593
|
const fileBase = basename6(resolvedEntry).replace(/\.[tj]s$/, "");
|
|
12489
12594
|
const jsName = `${fileBase}.js`;
|
|
12490
12595
|
const compiledFallbackPaths = [
|
|
12491
|
-
|
|
12492
|
-
|
|
12493
|
-
|
|
12494
|
-
].map((file3) =>
|
|
12596
|
+
join18(compiledRoot, relativeEntry),
|
|
12597
|
+
join18(compiledRoot, "pages", jsName),
|
|
12598
|
+
join18(compiledRoot, jsName)
|
|
12599
|
+
].map((file3) => resolve19(file3));
|
|
12495
12600
|
const resolveRawServerFile = (candidatePaths) => {
|
|
12496
12601
|
const normalizedCandidates = [
|
|
12497
|
-
...candidatePaths.map((file3) =>
|
|
12602
|
+
...candidatePaths.map((file3) => resolve19(file3)),
|
|
12498
12603
|
...compiledFallbackPaths
|
|
12499
12604
|
];
|
|
12500
12605
|
let candidate = normalizedCandidates.find((file3) => existsSync16(file3) && file3.endsWith(`${sep3}pages${sep3}${jsName}`));
|
|
@@ -12535,7 +12640,7 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
12535
12640
|
const usesLegacyAnimations = await traceAngularPhase("wrapper/detect-legacy-animations", () => usesLegacyAngularAnimations(resolvedEntry), { entry: resolvedEntry });
|
|
12536
12641
|
const serverContentHash = Bun.hash(original).toString(BASE_36_RADIX);
|
|
12537
12642
|
const cachedWrapper = wrapperOutputCache.get(resolvedEntry);
|
|
12538
|
-
const clientFile =
|
|
12643
|
+
const clientFile = join18(indexesDir, jsName);
|
|
12539
12644
|
if (hmr && cachedWrapper && cachedWrapper.serverHash === serverContentHash && existsSync16(clientFile) && (usesLegacyAnimations || !original.includes("__ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__")) && (!usesLegacyAnimations || original.includes("__ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__"))) {
|
|
12540
12645
|
return {
|
|
12541
12646
|
clientPath: clientFile,
|
|
@@ -12562,7 +12667,7 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
12562
12667
|
`;
|
|
12563
12668
|
}
|
|
12564
12669
|
await traceAngularPhase("wrapper/write-server-output", () => fs.writeFile(rawServerFile, rewritten, "utf-8"), { entry: resolvedEntry });
|
|
12565
|
-
const relativePath =
|
|
12670
|
+
const relativePath = relative11(indexesDir, rawServerFile).replace(/\\/g, "/");
|
|
12566
12671
|
const normalizedImportPath = relativePath.startsWith(".") ? relativePath : `./${relativePath}`;
|
|
12567
12672
|
const hmrPreamble = hmr ? `window.__HMR_FRAMEWORK__ = "angular";
|
|
12568
12673
|
import "${hmrClientPath5}";
|
|
@@ -12766,14 +12871,14 @@ var init_compileAngular = __esm(() => {
|
|
|
12766
12871
|
init_stylePreprocessor();
|
|
12767
12872
|
init_generatedDir();
|
|
12768
12873
|
devClientDir4 = resolveDevClientDir4();
|
|
12769
|
-
hmrClientPath5 =
|
|
12874
|
+
hmrClientPath5 = join18(devClientDir4, "hmrClient.ts").replace(/\\/g, "/");
|
|
12770
12875
|
jitContentCache = new Map;
|
|
12771
12876
|
wrapperOutputCache = new Map;
|
|
12772
12877
|
});
|
|
12773
12878
|
|
|
12774
12879
|
// node_modules/content-tag/pkg/node/content_tag.cjs
|
|
12775
12880
|
var require_content_tag = __commonJS((exports, module) => {
|
|
12776
|
-
var __dirname = "/
|
|
12881
|
+
var __dirname = "/home/alexkahn/abs/absolutejs/node_modules/content-tag/pkg/node";
|
|
12777
12882
|
var imports = {};
|
|
12778
12883
|
imports["__wbindgen_placeholder__"] = exports;
|
|
12779
12884
|
var wasm;
|
|
@@ -13211,7 +13316,7 @@ __export(exports_compileEmber, {
|
|
|
13211
13316
|
getEmberServerCompiledDir: () => getEmberServerCompiledDir,
|
|
13212
13317
|
getEmberCompiledRoot: () => getEmberCompiledRoot,
|
|
13213
13318
|
getEmberClientCompiledDir: () => getEmberClientCompiledDir,
|
|
13214
|
-
dirname: () =>
|
|
13319
|
+
dirname: () => dirname13,
|
|
13215
13320
|
compileEmberFileSource: () => compileEmberFileSource,
|
|
13216
13321
|
compileEmberFile: () => compileEmberFile,
|
|
13217
13322
|
compileEmber: () => compileEmber,
|
|
@@ -13219,16 +13324,16 @@ __export(exports_compileEmber, {
|
|
|
13219
13324
|
basename: () => basename7
|
|
13220
13325
|
});
|
|
13221
13326
|
import { existsSync as existsSync17 } from "fs";
|
|
13222
|
-
import { mkdir as
|
|
13223
|
-
import { basename as basename7, dirname as
|
|
13224
|
-
var {build: bunBuild2, Transpiler:
|
|
13327
|
+
import { mkdir as mkdir6, rm as rm4 } from "fs/promises";
|
|
13328
|
+
import { basename as basename7, dirname as dirname13, extname as extname6, join as join19, resolve as resolve20 } from "path";
|
|
13329
|
+
var {build: bunBuild2, Transpiler: Transpiler4, write: write3, file: file3 } = globalThis.Bun;
|
|
13225
13330
|
var cachedPreprocessor = null, getPreprocessor = async () => {
|
|
13226
13331
|
if (cachedPreprocessor)
|
|
13227
13332
|
return cachedPreprocessor;
|
|
13228
13333
|
const module = await Promise.resolve().then(() => __toESM(require_node(), 1));
|
|
13229
13334
|
cachedPreprocessor = new module.Preprocessor;
|
|
13230
13335
|
return cachedPreprocessor;
|
|
13231
|
-
},
|
|
13336
|
+
}, transpiler5, isTemplateTagFile = (entry) => {
|
|
13232
13337
|
const ext = extname6(entry);
|
|
13233
13338
|
return ext === ".gjs" || ext === ".gts";
|
|
13234
13339
|
}, rewriteTemplateEvalToScope = (source) => {
|
|
@@ -13316,7 +13421,7 @@ export const importSync = (specifier) => {
|
|
|
13316
13421
|
const originalImporter = stagedSourceMap.get(args.importer);
|
|
13317
13422
|
if (!originalImporter)
|
|
13318
13423
|
return;
|
|
13319
|
-
const candidateBase =
|
|
13424
|
+
const candidateBase = resolve20(dirname13(originalImporter), args.path);
|
|
13320
13425
|
const extensionsToTry = ["", ".gts", ".gjs", ".ts", ".js"];
|
|
13321
13426
|
for (const ext of extensionsToTry) {
|
|
13322
13427
|
const candidate = candidateBase + ext;
|
|
@@ -13333,13 +13438,13 @@ export const importSync = (specifier) => {
|
|
|
13333
13438
|
filename: args.path
|
|
13334
13439
|
});
|
|
13335
13440
|
const rewritten = rewriteTemplateEvalToScope(result.code);
|
|
13336
|
-
const transpiled =
|
|
13441
|
+
const transpiled = transpiler5.transformSync(rewritten);
|
|
13337
13442
|
return { contents: transpiled, loader: "js" };
|
|
13338
13443
|
});
|
|
13339
13444
|
build.onResolve({ filter: /^@(?:ember|glimmer|simple-dom)\// }, (args) => {
|
|
13340
13445
|
if (standalonePackages.has(args.path))
|
|
13341
13446
|
return;
|
|
13342
|
-
const internal =
|
|
13447
|
+
const internal = join19(cwd, "node_modules/ember-source/dist/packages", args.path, "index.js");
|
|
13343
13448
|
if (existsSync17(internal))
|
|
13344
13449
|
return { path: internal };
|
|
13345
13450
|
return;
|
|
@@ -13375,7 +13480,7 @@ export const renderToHTML = (props = {}) => {
|
|
|
13375
13480
|
export { PageComponent };
|
|
13376
13481
|
export default PageComponent;
|
|
13377
13482
|
`, compileEmberFile = async (entry, compiledRoot, cwd = process.cwd()) => {
|
|
13378
|
-
const resolvedEntry =
|
|
13483
|
+
const resolvedEntry = resolve20(entry);
|
|
13379
13484
|
const source = await file3(resolvedEntry).text();
|
|
13380
13485
|
let preprocessed = source;
|
|
13381
13486
|
if (isTemplateTagFile(resolvedEntry)) {
|
|
@@ -13385,18 +13490,18 @@ export default PageComponent;
|
|
|
13385
13490
|
});
|
|
13386
13491
|
preprocessed = rewriteTemplateEvalToScope(result.code);
|
|
13387
13492
|
}
|
|
13388
|
-
const transpiled =
|
|
13493
|
+
const transpiled = transpiler5.transformSync(preprocessed);
|
|
13389
13494
|
const baseName = basename7(resolvedEntry).replace(/\.(gjs|gts|ts|js)$/, "");
|
|
13390
|
-
const tmpDir =
|
|
13391
|
-
const serverDir =
|
|
13392
|
-
const clientDir =
|
|
13495
|
+
const tmpDir = join19(compiledRoot, "_tmp");
|
|
13496
|
+
const serverDir = join19(compiledRoot, "server");
|
|
13497
|
+
const clientDir = join19(compiledRoot, "client");
|
|
13393
13498
|
await Promise.all([
|
|
13394
|
-
|
|
13395
|
-
|
|
13396
|
-
|
|
13499
|
+
mkdir6(tmpDir, { recursive: true }),
|
|
13500
|
+
mkdir6(serverDir, { recursive: true }),
|
|
13501
|
+
mkdir6(clientDir, { recursive: true })
|
|
13397
13502
|
]);
|
|
13398
|
-
const tmpPagePath =
|
|
13399
|
-
const tmpHarnessPath =
|
|
13503
|
+
const tmpPagePath = resolve20(join19(tmpDir, `${baseName}.module.js`));
|
|
13504
|
+
const tmpHarnessPath = resolve20(join19(tmpDir, `${baseName}.harness.js`));
|
|
13400
13505
|
await Promise.all([
|
|
13401
13506
|
write3(tmpPagePath, transpiled),
|
|
13402
13507
|
write3(tmpHarnessPath, generateServerHarness(tmpPagePath))
|
|
@@ -13404,7 +13509,7 @@ export default PageComponent;
|
|
|
13404
13509
|
const stagedSourceMap = new Map([
|
|
13405
13510
|
[tmpPagePath, resolvedEntry]
|
|
13406
13511
|
]);
|
|
13407
|
-
const serverPath =
|
|
13512
|
+
const serverPath = join19(serverDir, `${baseName}.js`);
|
|
13408
13513
|
const buildResult = await bunBuild2({
|
|
13409
13514
|
entrypoints: [tmpHarnessPath],
|
|
13410
13515
|
format: "esm",
|
|
@@ -13421,7 +13526,7 @@ export default PageComponent;
|
|
|
13421
13526
|
console.warn(`\u26A0\uFE0F Ember server build for ${baseName} had errors:`, buildResult.logs);
|
|
13422
13527
|
}
|
|
13423
13528
|
await rm4(tmpDir, { force: true, recursive: true });
|
|
13424
|
-
const clientPath =
|
|
13529
|
+
const clientPath = join19(clientDir, `${baseName}.js`);
|
|
13425
13530
|
await write3(clientPath, transpiled);
|
|
13426
13531
|
return { clientPath, serverPath };
|
|
13427
13532
|
}, compileEmber = async (entries, emberDir, cwd = process.cwd(), _hmr = false) => {
|
|
@@ -13438,7 +13543,7 @@ export default PageComponent;
|
|
|
13438
13543
|
serverPaths: outputs.map((o) => o.serverPath)
|
|
13439
13544
|
};
|
|
13440
13545
|
}, compileEmberFileSource = async (entry) => {
|
|
13441
|
-
const resolvedEntry =
|
|
13546
|
+
const resolvedEntry = resolve20(entry);
|
|
13442
13547
|
const source = await file3(resolvedEntry).text();
|
|
13443
13548
|
let preprocessed = source;
|
|
13444
13549
|
if (isTemplateTagFile(resolvedEntry)) {
|
|
@@ -13448,11 +13553,11 @@ export default PageComponent;
|
|
|
13448
13553
|
});
|
|
13449
13554
|
preprocessed = rewriteTemplateEvalToScope(result.code);
|
|
13450
13555
|
}
|
|
13451
|
-
return
|
|
13452
|
-
}, clearEmberCompilerCache = () => {}, getEmberCompiledRoot = (_emberDir) => getFrameworkGeneratedDir("ember"), getEmberServerCompiledDir = (emberDir) =>
|
|
13556
|
+
return transpiler5.transformSync(preprocessed);
|
|
13557
|
+
}, clearEmberCompilerCache = () => {}, getEmberCompiledRoot = (_emberDir) => getFrameworkGeneratedDir("ember"), getEmberServerCompiledDir = (emberDir) => join19(getEmberCompiledRoot(emberDir), "server"), getEmberClientCompiledDir = (emberDir) => join19(getEmberCompiledRoot(emberDir), "client");
|
|
13453
13558
|
var init_compileEmber = __esm(() => {
|
|
13454
13559
|
init_generatedDir();
|
|
13455
|
-
|
|
13560
|
+
transpiler5 = new Transpiler4({
|
|
13456
13561
|
loader: "ts",
|
|
13457
13562
|
target: "browser",
|
|
13458
13563
|
tsconfig: JSON.stringify({
|
|
@@ -13471,24 +13576,24 @@ __export(exports_buildReactVendor, {
|
|
|
13471
13576
|
buildReactVendor: () => buildReactVendor
|
|
13472
13577
|
});
|
|
13473
13578
|
import { existsSync as existsSync18, mkdirSync as mkdirSync7 } from "fs";
|
|
13474
|
-
import { join as
|
|
13579
|
+
import { join as join20, resolve as resolve21 } from "path";
|
|
13475
13580
|
import { rm as rm5 } from "fs/promises";
|
|
13476
13581
|
var {build: bunBuild3 } = globalThis.Bun;
|
|
13477
13582
|
var resolveJsxDevRuntimeCompatPath = () => {
|
|
13478
13583
|
const candidates = [
|
|
13479
|
-
|
|
13480
|
-
|
|
13481
|
-
|
|
13482
|
-
|
|
13483
|
-
|
|
13484
|
-
|
|
13584
|
+
resolve21(import.meta.dir, "react", "jsxDevRuntimeCompat.js"),
|
|
13585
|
+
resolve21(import.meta.dir, "src", "react", "jsxDevRuntimeCompat.ts"),
|
|
13586
|
+
resolve21(import.meta.dir, "..", "react", "jsxDevRuntimeCompat.js"),
|
|
13587
|
+
resolve21(import.meta.dir, "..", "src", "react", "jsxDevRuntimeCompat.ts"),
|
|
13588
|
+
resolve21(import.meta.dir, "..", "..", "dist", "react", "jsxDevRuntimeCompat.js"),
|
|
13589
|
+
resolve21(import.meta.dir, "..", "..", "src", "react", "jsxDevRuntimeCompat.ts")
|
|
13485
13590
|
];
|
|
13486
13591
|
for (const candidate of candidates) {
|
|
13487
13592
|
if (existsSync18(candidate)) {
|
|
13488
13593
|
return candidate.replace(/\\/g, "/");
|
|
13489
13594
|
}
|
|
13490
13595
|
}
|
|
13491
|
-
return (candidates[0] ??
|
|
13596
|
+
return (candidates[0] ?? resolve21(import.meta.dir, "react", "jsxDevRuntimeCompat.js")).replace(/\\/g, "/");
|
|
13492
13597
|
}, jsxDevRuntimeCompatPath, reactSpecifiers, isResolvable = (specifier) => {
|
|
13493
13598
|
try {
|
|
13494
13599
|
Bun.resolveSync(specifier, process.cwd());
|
|
@@ -13525,14 +13630,14 @@ var resolveJsxDevRuntimeCompatPath = () => {
|
|
|
13525
13630
|
`)}
|
|
13526
13631
|
`;
|
|
13527
13632
|
}, buildReactVendor = async (buildDir) => {
|
|
13528
|
-
const vendorDir =
|
|
13633
|
+
const vendorDir = join20(buildDir, "react", "vendor");
|
|
13529
13634
|
mkdirSync7(vendorDir, { recursive: true });
|
|
13530
|
-
const tmpDir =
|
|
13635
|
+
const tmpDir = join20(buildDir, "_vendor_tmp");
|
|
13531
13636
|
mkdirSync7(tmpDir, { recursive: true });
|
|
13532
13637
|
const specifiers = resolveVendorSpecifiers();
|
|
13533
13638
|
const entrypoints = await Promise.all(specifiers.map(async (specifier) => {
|
|
13534
13639
|
const safeName = toSafeFileName(specifier);
|
|
13535
|
-
const entryPath =
|
|
13640
|
+
const entryPath = join20(tmpDir, `${safeName}.ts`);
|
|
13536
13641
|
const source = await generateEntrySource(specifier);
|
|
13537
13642
|
await Bun.write(entryPath, source);
|
|
13538
13643
|
return entryPath;
|
|
@@ -13597,7 +13702,7 @@ __export(exports_buildAngularVendor, {
|
|
|
13597
13702
|
buildAngularServerVendor: () => buildAngularServerVendor
|
|
13598
13703
|
});
|
|
13599
13704
|
import { mkdirSync as mkdirSync8 } from "fs";
|
|
13600
|
-
import { join as
|
|
13705
|
+
import { join as join21 } from "path";
|
|
13601
13706
|
import { rm as rm6 } from "fs/promises";
|
|
13602
13707
|
var {build: bunBuild4, Glob: Glob6 } = globalThis.Bun;
|
|
13603
13708
|
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) => {
|
|
@@ -13610,7 +13715,7 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
|
|
|
13610
13715
|
}, 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) => {
|
|
13611
13716
|
const angular = new Set;
|
|
13612
13717
|
const transitiveRoots = new Set;
|
|
13613
|
-
const
|
|
13718
|
+
const transpiler6 = new Bun.Transpiler({ loader: "tsx" });
|
|
13614
13719
|
const glob = new Glob6("**/*.{ts,tsx,js,jsx}");
|
|
13615
13720
|
for (const dir of directories) {
|
|
13616
13721
|
try {
|
|
@@ -13621,7 +13726,7 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
|
|
|
13621
13726
|
continue;
|
|
13622
13727
|
try {
|
|
13623
13728
|
const content = await Bun.file(file4).text();
|
|
13624
|
-
for (const imp of
|
|
13729
|
+
for (const imp of transpiler6.scanImports(content)) {
|
|
13625
13730
|
if (isAngularBrowserSpecifier(imp.path)) {
|
|
13626
13731
|
angular.add(imp.path);
|
|
13627
13732
|
} else if (isBareSpecifier(imp.path)) {
|
|
@@ -13635,7 +13740,7 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
|
|
|
13635
13740
|
return { angular, transitiveRoots };
|
|
13636
13741
|
}, PARTIAL_DECL_MARKERS, containsPartialDeclarations = (source) => PARTIAL_DECL_MARKERS.some((marker) => source.includes(marker)), collectTransitiveAngularSpecs = async (roots, angularFound) => {
|
|
13637
13742
|
const { readFileSync: readFileSync12 } = await import("fs");
|
|
13638
|
-
const
|
|
13743
|
+
const transpiler6 = new Bun.Transpiler({ loader: "js" });
|
|
13639
13744
|
const visited = new Set;
|
|
13640
13745
|
const frontier = [];
|
|
13641
13746
|
for (const r of roots)
|
|
@@ -13664,7 +13769,7 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
|
|
|
13664
13769
|
}
|
|
13665
13770
|
let imports;
|
|
13666
13771
|
try {
|
|
13667
|
-
imports =
|
|
13772
|
+
imports = transpiler6.scanImports(content);
|
|
13668
13773
|
} catch {
|
|
13669
13774
|
continue;
|
|
13670
13775
|
}
|
|
@@ -13694,14 +13799,14 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
|
|
|
13694
13799
|
await collectTransitiveAngularSpecs([...angular, ...transitiveRoots], angular);
|
|
13695
13800
|
return Array.from(angular).filter(isResolvable2);
|
|
13696
13801
|
}, buildAngularVendor = async (buildDir, directories = [], linkerJitMode = false, depVendorSpecifiers = []) => {
|
|
13697
|
-
const vendorDir =
|
|
13802
|
+
const vendorDir = join21(buildDir, "angular", "vendor");
|
|
13698
13803
|
mkdirSync8(vendorDir, { recursive: true });
|
|
13699
|
-
const tmpDir =
|
|
13804
|
+
const tmpDir = join21(buildDir, "_angular_vendor_tmp");
|
|
13700
13805
|
mkdirSync8(tmpDir, { recursive: true });
|
|
13701
13806
|
const specifiers = await resolveAngularSpecifiers(directories, linkerJitMode);
|
|
13702
13807
|
const entrypoints = await Promise.all(specifiers.map(async (specifier) => {
|
|
13703
13808
|
const safeName = toSafeFileName2(specifier);
|
|
13704
|
-
const entryPath =
|
|
13809
|
+
const entryPath = join21(tmpDir, `${safeName}.ts`);
|
|
13705
13810
|
await Bun.write(entryPath, await generateVendorEntrySource(specifier));
|
|
13706
13811
|
return entryPath;
|
|
13707
13812
|
}));
|
|
@@ -13732,9 +13837,9 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
|
|
|
13732
13837
|
const specifiers = await resolveAngularSpecifiers(directories, linkerJitMode);
|
|
13733
13838
|
return computeAngularVendorPaths(specifiers);
|
|
13734
13839
|
}, buildAngularServerVendor = async (buildDir, directories = [], linkerJitMode = false) => {
|
|
13735
|
-
const vendorDir =
|
|
13840
|
+
const vendorDir = join21(buildDir, "angular", "vendor", "server");
|
|
13736
13841
|
mkdirSync8(vendorDir, { recursive: true });
|
|
13737
|
-
const tmpDir =
|
|
13842
|
+
const tmpDir = join21(buildDir, "_angular_server_vendor_tmp");
|
|
13738
13843
|
mkdirSync8(tmpDir, { recursive: true });
|
|
13739
13844
|
const browserSpecs = await resolveAngularSpecifiers(directories, linkerJitMode);
|
|
13740
13845
|
const allSpecs = new Set(browserSpecs);
|
|
@@ -13745,7 +13850,7 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
|
|
|
13745
13850
|
const specifiers = Array.from(allSpecs);
|
|
13746
13851
|
const entrypoints = await Promise.all(specifiers.map(async (specifier) => {
|
|
13747
13852
|
const safeName = toSafeFileName2(specifier);
|
|
13748
|
-
const entryPath =
|
|
13853
|
+
const entryPath = join21(tmpDir, `${safeName}.ts`);
|
|
13749
13854
|
await Bun.write(entryPath, await generateVendorEntrySource(specifier));
|
|
13750
13855
|
return entryPath;
|
|
13751
13856
|
}));
|
|
@@ -13767,9 +13872,9 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
|
|
|
13767
13872
|
return specifiers;
|
|
13768
13873
|
}, computeAngularServerVendorPaths = (buildDir, specifiers) => {
|
|
13769
13874
|
const paths = {};
|
|
13770
|
-
const vendorDir =
|
|
13875
|
+
const vendorDir = join21(buildDir, "angular", "vendor", "server");
|
|
13771
13876
|
for (const specifier of specifiers) {
|
|
13772
|
-
paths[specifier] =
|
|
13877
|
+
paths[specifier] = join21(vendorDir, `${toSafeFileName2(specifier)}.js`);
|
|
13773
13878
|
}
|
|
13774
13879
|
return paths;
|
|
13775
13880
|
}, computeAngularServerVendorPathsAsync = async (buildDir, directories = [], linkerJitMode = true) => {
|
|
@@ -13825,17 +13930,17 @@ __export(exports_buildVueVendor, {
|
|
|
13825
13930
|
buildVueVendor: () => buildVueVendor
|
|
13826
13931
|
});
|
|
13827
13932
|
import { mkdirSync as mkdirSync9 } from "fs";
|
|
13828
|
-
import { join as
|
|
13933
|
+
import { join as join22 } from "path";
|
|
13829
13934
|
import { rm as rm7 } from "fs/promises";
|
|
13830
13935
|
var {build: bunBuild5 } = globalThis.Bun;
|
|
13831
13936
|
var vueSpecifiers, toSafeFileName3 = (specifier) => specifier.replace(/\//g, "_"), buildVueVendor = async (buildDir) => {
|
|
13832
|
-
const vendorDir =
|
|
13937
|
+
const vendorDir = join22(buildDir, "vue", "vendor");
|
|
13833
13938
|
mkdirSync9(vendorDir, { recursive: true });
|
|
13834
|
-
const tmpDir =
|
|
13939
|
+
const tmpDir = join22(buildDir, "_vue_vendor_tmp");
|
|
13835
13940
|
mkdirSync9(tmpDir, { recursive: true });
|
|
13836
13941
|
const entrypoints = await Promise.all(vueSpecifiers.map(async (specifier) => {
|
|
13837
13942
|
const safeName = toSafeFileName3(specifier);
|
|
13838
|
-
const entryPath =
|
|
13943
|
+
const entryPath = join22(tmpDir, `${safeName}.ts`);
|
|
13839
13944
|
await Bun.write(entryPath, `export * from '${specifier}';
|
|
13840
13945
|
`);
|
|
13841
13946
|
return entryPath;
|
|
@@ -13863,7 +13968,7 @@ var vueSpecifiers, toSafeFileName3 = (specifier) => specifier.replace(/\//g, "_"
|
|
|
13863
13968
|
const { readFileSync: readFileSync12, writeFileSync: writeFileSync7, readdirSync } = await import("fs");
|
|
13864
13969
|
const files = readdirSync(vendorDir).filter((f2) => f2.endsWith(".js"));
|
|
13865
13970
|
for (const file4 of files) {
|
|
13866
|
-
const filePath =
|
|
13971
|
+
const filePath = join22(vendorDir, file4);
|
|
13867
13972
|
const content = readFileSync12(filePath, "utf-8");
|
|
13868
13973
|
if (!content.includes("__VUE_HMR_RUNTIME__"))
|
|
13869
13974
|
continue;
|
|
@@ -13890,7 +13995,7 @@ __export(exports_buildSvelteVendor, {
|
|
|
13890
13995
|
buildSvelteVendor: () => buildSvelteVendor
|
|
13891
13996
|
});
|
|
13892
13997
|
import { mkdirSync as mkdirSync10 } from "fs";
|
|
13893
|
-
import { join as
|
|
13998
|
+
import { join as join23 } from "path";
|
|
13894
13999
|
import { rm as rm8 } from "fs/promises";
|
|
13895
14000
|
var {build: bunBuild6 } = globalThis.Bun;
|
|
13896
14001
|
var svelteSpecifiers, isResolvable3 = (specifier) => {
|
|
@@ -13904,13 +14009,13 @@ var svelteSpecifiers, isResolvable3 = (specifier) => {
|
|
|
13904
14009
|
const specifiers = resolveVendorSpecifiers2();
|
|
13905
14010
|
if (specifiers.length === 0)
|
|
13906
14011
|
return;
|
|
13907
|
-
const vendorDir =
|
|
14012
|
+
const vendorDir = join23(buildDir, "svelte", "vendor");
|
|
13908
14013
|
mkdirSync10(vendorDir, { recursive: true });
|
|
13909
|
-
const tmpDir =
|
|
14014
|
+
const tmpDir = join23(buildDir, "_svelte_vendor_tmp");
|
|
13910
14015
|
mkdirSync10(tmpDir, { recursive: true });
|
|
13911
14016
|
const entrypoints = await Promise.all(specifiers.map(async (specifier) => {
|
|
13912
14017
|
const safeName = toSafeFileName4(specifier);
|
|
13913
|
-
const entryPath =
|
|
14018
|
+
const entryPath = join23(tmpDir, `${safeName}.ts`);
|
|
13914
14019
|
await Bun.write(entryPath, `export * from '${specifier}';
|
|
13915
14020
|
`);
|
|
13916
14021
|
return entryPath;
|
|
@@ -13960,7 +14065,7 @@ __export(exports_rewriteImportsPlugin, {
|
|
|
13960
14065
|
buildWithImportRewrite: () => buildWithImportRewrite
|
|
13961
14066
|
});
|
|
13962
14067
|
import { readdir as readdir3 } from "fs/promises";
|
|
13963
|
-
import { join as
|
|
14068
|
+
import { join as join24 } from "path";
|
|
13964
14069
|
var escapeRegex2 = (str) => str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), jsRewriteImports = (content, replacements) => {
|
|
13965
14070
|
let result = content;
|
|
13966
14071
|
for (const [specifier, webPath] of replacements) {
|
|
@@ -14089,7 +14194,7 @@ ${content}`;
|
|
|
14089
14194
|
const entries = await readdir3(dir);
|
|
14090
14195
|
for (const entry of entries) {
|
|
14091
14196
|
if (entry.endsWith(".js"))
|
|
14092
|
-
allFiles.push(
|
|
14197
|
+
allFiles.push(join24(dir, entry));
|
|
14093
14198
|
}
|
|
14094
14199
|
} catch {}
|
|
14095
14200
|
}
|
|
@@ -14138,7 +14243,7 @@ import {
|
|
|
14138
14243
|
statSync,
|
|
14139
14244
|
writeFileSync as writeFileSync7
|
|
14140
14245
|
} from "fs";
|
|
14141
|
-
import { basename as basename8, dirname as
|
|
14246
|
+
import { basename as basename8, dirname as dirname14, extname as extname7, join as join25, relative as relative12, resolve as resolve22 } from "path";
|
|
14142
14247
|
import { cwd, env as env2, exit } from "process";
|
|
14143
14248
|
var {build: bunBuild7, Glob: Glob7 } = globalThis.Bun;
|
|
14144
14249
|
var isDev, isBuildTraceEnabled = () => {
|
|
@@ -14216,8 +14321,8 @@ var isDev, isBuildTraceEnabled = () => {
|
|
|
14216
14321
|
mkdirSync11(htmxDestDir, { recursive: true });
|
|
14217
14322
|
const glob = new Glob7("htmx*.min.js");
|
|
14218
14323
|
for (const relPath of glob.scanSync({ cwd: htmxDir })) {
|
|
14219
|
-
const src =
|
|
14220
|
-
const dest =
|
|
14324
|
+
const src = join25(htmxDir, relPath);
|
|
14325
|
+
const dest = join25(htmxDestDir, "htmx.min.js");
|
|
14221
14326
|
copyFileSync(src, dest);
|
|
14222
14327
|
return;
|
|
14223
14328
|
}
|
|
@@ -14229,8 +14334,8 @@ var isDev, isBuildTraceEnabled = () => {
|
|
|
14229
14334
|
}
|
|
14230
14335
|
}, resolveAbsoluteVersion = async () => {
|
|
14231
14336
|
const candidates = [
|
|
14232
|
-
|
|
14233
|
-
|
|
14337
|
+
resolve22(import.meta.dir, "..", "..", "package.json"),
|
|
14338
|
+
resolve22(import.meta.dir, "..", "package.json")
|
|
14234
14339
|
];
|
|
14235
14340
|
const resolveCandidate = async (remaining) => {
|
|
14236
14341
|
const [candidate, ...rest] = remaining;
|
|
@@ -14246,7 +14351,7 @@ var isDev, isBuildTraceEnabled = () => {
|
|
|
14246
14351
|
};
|
|
14247
14352
|
await resolveCandidate(candidates);
|
|
14248
14353
|
}, SKIP_DIRS, addWorkerPathIfExists = (file4, relPath, workerPaths) => {
|
|
14249
|
-
const absPath =
|
|
14354
|
+
const absPath = resolve22(file4, "..", relPath);
|
|
14250
14355
|
try {
|
|
14251
14356
|
statSync(absPath);
|
|
14252
14357
|
workerPaths.add(absPath);
|
|
@@ -14292,7 +14397,7 @@ var isDev, isBuildTraceEnabled = () => {
|
|
|
14292
14397
|
vuePagesPath
|
|
14293
14398
|
}) => {
|
|
14294
14399
|
const { readdirSync: readDir } = await import("fs");
|
|
14295
|
-
const devIndexDir =
|
|
14400
|
+
const devIndexDir = join25(buildPath, "_src_indexes");
|
|
14296
14401
|
mkdirSync11(devIndexDir, { recursive: true });
|
|
14297
14402
|
if (reactIndexesPath && reactPagesPath) {
|
|
14298
14403
|
copyReactDevIndexes(reactIndexesPath, reactPagesPath, devIndexDir, readDir);
|
|
@@ -14308,37 +14413,37 @@ var isDev, isBuildTraceEnabled = () => {
|
|
|
14308
14413
|
return;
|
|
14309
14414
|
}
|
|
14310
14415
|
const indexFiles = readDir(reactIndexesPath).filter((file4) => file4.endsWith(".tsx"));
|
|
14311
|
-
const pagesRel =
|
|
14416
|
+
const pagesRel = relative12(process.cwd(), resolve22(reactPagesPath)).replace(/\\/g, "/");
|
|
14312
14417
|
for (const file4 of indexFiles) {
|
|
14313
|
-
let content = readFileSync12(
|
|
14418
|
+
let content = readFileSync12(join25(reactIndexesPath, file4), "utf-8");
|
|
14314
14419
|
content = content.replace(/from\s*['"]([^'"]*\/pages\/([^'"]+))['"]/g, (_match, _fullPath, componentName) => `from '/@src/${pagesRel}/${componentName}'`);
|
|
14315
|
-
writeFileSync7(
|
|
14420
|
+
writeFileSync7(join25(devIndexDir, file4), content);
|
|
14316
14421
|
}
|
|
14317
14422
|
}, copySvelteDevIndexes = (svelteDir, sveltePagesPath, svelteEntries, devIndexDir) => {
|
|
14318
|
-
const svelteIndexDir =
|
|
14319
|
-
const sveltePageEntries = svelteEntries.filter((file4) =>
|
|
14423
|
+
const svelteIndexDir = join25(getFrameworkGeneratedDir("svelte"), "indexes");
|
|
14424
|
+
const sveltePageEntries = svelteEntries.filter((file4) => resolve22(file4).startsWith(resolve22(sveltePagesPath)));
|
|
14320
14425
|
for (const entry of sveltePageEntries) {
|
|
14321
14426
|
const name = basename8(entry).replace(/\.svelte(\.(ts|js))?$/, "");
|
|
14322
|
-
const indexFile =
|
|
14427
|
+
const indexFile = join25(svelteIndexDir, "pages", `${name}.js`);
|
|
14323
14428
|
if (!existsSync19(indexFile))
|
|
14324
14429
|
continue;
|
|
14325
14430
|
let content = readFileSync12(indexFile, "utf-8");
|
|
14326
|
-
const srcRel =
|
|
14431
|
+
const srcRel = relative12(process.cwd(), resolve22(entry)).replace(/\\/g, "/");
|
|
14327
14432
|
content = content.replace(/import\s+Component\s+from\s+['"]([^'"]+)['"]/, `import Component from "/@src/${srcRel}"`);
|
|
14328
|
-
writeFileSync7(
|
|
14433
|
+
writeFileSync7(join25(devIndexDir, `${name}.svelte.js`), content);
|
|
14329
14434
|
}
|
|
14330
14435
|
}, copyVueDevIndexes = (vueDir, vuePagesPath, vueEntries, devIndexDir) => {
|
|
14331
|
-
const vueIndexDir =
|
|
14332
|
-
const vuePageEntries = vueEntries.filter((file4) =>
|
|
14436
|
+
const vueIndexDir = join25(getFrameworkGeneratedDir("vue"), "indexes");
|
|
14437
|
+
const vuePageEntries = vueEntries.filter((file4) => resolve22(file4).startsWith(resolve22(vuePagesPath)));
|
|
14333
14438
|
for (const entry of vuePageEntries) {
|
|
14334
14439
|
const name = basename8(entry, ".vue");
|
|
14335
|
-
const indexFile =
|
|
14440
|
+
const indexFile = join25(vueIndexDir, `${name}.js`);
|
|
14336
14441
|
if (!existsSync19(indexFile))
|
|
14337
14442
|
continue;
|
|
14338
14443
|
let content = readFileSync12(indexFile, "utf-8");
|
|
14339
|
-
const srcRel =
|
|
14444
|
+
const srcRel = relative12(process.cwd(), resolve22(entry)).replace(/\\/g, "/");
|
|
14340
14445
|
content = content.replace(/import\s+Comp(?:\s*,\s*\*\s+as\s+\w+)?\s+from\s+['"]([^'"]+)['"]/, (match) => match.replace(/from\s+['"][^'"]+['"]/, `from "/@src/${srcRel}"`));
|
|
14341
|
-
writeFileSync7(
|
|
14446
|
+
writeFileSync7(join25(devIndexDir, `${name}.vue.js`), content);
|
|
14342
14447
|
}
|
|
14343
14448
|
}, resolveVueRuntimeId = (content, firstUseName, outputPath, projectRoot) => {
|
|
14344
14449
|
const varIdx = content.indexOf(`var ${firstUseName} =`);
|
|
@@ -14349,7 +14454,7 @@ var isDev, isBuildTraceEnabled = () => {
|
|
|
14349
14454
|
const last = allComments[allComments.length - 1];
|
|
14350
14455
|
if (!last?.[1])
|
|
14351
14456
|
return JSON.stringify(outputPath);
|
|
14352
|
-
const srcPath =
|
|
14457
|
+
const srcPath = resolve22(projectRoot, last[1].replace("/client/", "/").replace(/\.js$/, ".ts"));
|
|
14353
14458
|
return JSON.stringify(srcPath);
|
|
14354
14459
|
}, QUOTE_CHARS, OPEN_BRACES, CLOSE_BRACES, findFunctionExpressionEnd = (content, startPos) => {
|
|
14355
14460
|
let depth = 0;
|
|
@@ -14411,7 +14516,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
14411
14516
|
}, buildDevUrlFileMap = (urlReferencedFiles, projectRoot) => {
|
|
14412
14517
|
const urlFileMap = new Map;
|
|
14413
14518
|
for (const srcPath of urlReferencedFiles) {
|
|
14414
|
-
const rel =
|
|
14519
|
+
const rel = relative12(projectRoot, srcPath).replace(/\\/g, "/");
|
|
14415
14520
|
const name = basename8(srcPath);
|
|
14416
14521
|
const mtime = Math.round(statSync(srcPath).mtimeMs);
|
|
14417
14522
|
const url = `/@src/${rel}?v=${mtime}`;
|
|
@@ -14426,7 +14531,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
14426
14531
|
const output = nonReactClientOutputs.find((artifact) => basename8(artifact.path).startsWith(`${srcBase}.`));
|
|
14427
14532
|
if (!output)
|
|
14428
14533
|
continue;
|
|
14429
|
-
urlFileMap.set(basename8(srcPath), `/${
|
|
14534
|
+
urlFileMap.set(basename8(srcPath), `/${relative12(buildPath, output.path).replace(/\\/g, "/")}`);
|
|
14430
14535
|
}
|
|
14431
14536
|
return urlFileMap;
|
|
14432
14537
|
}, buildUrlFileMap = (urlReferencedFiles, hmr, projectRoot, buildPath, nonReactClientOutputs) => {
|
|
@@ -14560,10 +14665,10 @@ ${content.slice(firstUseIdx)}`;
|
|
|
14560
14665
|
restoreTracePhase();
|
|
14561
14666
|
return;
|
|
14562
14667
|
}
|
|
14563
|
-
const traceDir =
|
|
14668
|
+
const traceDir = join25(buildPath2, ".absolute-trace");
|
|
14564
14669
|
const timestamp = new Date().toISOString().replace(/[:.]/g, "-");
|
|
14565
14670
|
mkdirSync11(traceDir, { recursive: true });
|
|
14566
|
-
writeFileSync7(
|
|
14671
|
+
writeFileSync7(join25(traceDir, `build-trace-${timestamp}.json`), JSON.stringify({
|
|
14567
14672
|
events: traceEvents,
|
|
14568
14673
|
frameworks: traceFrameworkNames,
|
|
14569
14674
|
generatedAt: new Date().toISOString(),
|
|
@@ -14594,15 +14699,15 @@ ${content.slice(firstUseIdx)}`;
|
|
|
14594
14699
|
const stylesPath = typeof stylesConfig === "string" ? stylesConfig : stylesConfig?.path;
|
|
14595
14700
|
const stylesIgnore = typeof stylesConfig === "object" ? stylesConfig.ignore : undefined;
|
|
14596
14701
|
const stylesDir = stylesPath && validateSafePath(stylesPath, projectRoot);
|
|
14597
|
-
const reactIndexesPath = reactDir &&
|
|
14598
|
-
const reactPagesPath = reactDir &&
|
|
14599
|
-
const htmlPagesPath = htmlDir &&
|
|
14600
|
-
const htmlScriptsPath = htmlDir &&
|
|
14601
|
-
const sveltePagesPath = svelteDir &&
|
|
14602
|
-
const vuePagesPath = vueDir &&
|
|
14603
|
-
const htmxPagesPath = htmxDir &&
|
|
14604
|
-
const angularPagesPath = angularDir &&
|
|
14605
|
-
const emberPagesPath = emberDir &&
|
|
14702
|
+
const reactIndexesPath = reactDir && join25(getFrameworkGeneratedDir("react"), "indexes");
|
|
14703
|
+
const reactPagesPath = reactDir && join25(reactDir, "pages");
|
|
14704
|
+
const htmlPagesPath = htmlDir && join25(htmlDir, "pages");
|
|
14705
|
+
const htmlScriptsPath = htmlDir && join25(htmlDir, "scripts");
|
|
14706
|
+
const sveltePagesPath = svelteDir && join25(svelteDir, "pages");
|
|
14707
|
+
const vuePagesPath = vueDir && join25(vueDir, "pages");
|
|
14708
|
+
const htmxPagesPath = htmxDir && join25(htmxDir, "pages");
|
|
14709
|
+
const angularPagesPath = angularDir && join25(angularDir, "pages");
|
|
14710
|
+
const emberPagesPath = emberDir && join25(emberDir, "pages");
|
|
14606
14711
|
const frontends = [
|
|
14607
14712
|
reactDir,
|
|
14608
14713
|
htmlDir,
|
|
@@ -14633,7 +14738,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
14633
14738
|
const sourceClientRoots = [
|
|
14634
14739
|
htmlDir,
|
|
14635
14740
|
htmxDir,
|
|
14636
|
-
islandBootstrapPath &&
|
|
14741
|
+
islandBootstrapPath && dirname14(islandBootstrapPath)
|
|
14637
14742
|
].filter((dir) => Boolean(dir));
|
|
14638
14743
|
const usesGenerated = Boolean(reactDir) || Boolean(svelteDir) || Boolean(vueDir) || Boolean(angularDir);
|
|
14639
14744
|
if (usesGenerated)
|
|
@@ -14661,8 +14766,8 @@ ${content.slice(firstUseIdx)}`;
|
|
|
14661
14766
|
const [firstEntry] = serverDirMap;
|
|
14662
14767
|
if (!firstEntry)
|
|
14663
14768
|
throw new Error("Expected at least one server directory entry");
|
|
14664
|
-
serverRoot =
|
|
14665
|
-
serverOutDir =
|
|
14769
|
+
serverRoot = join25(firstEntry.dir, firstEntry.subdir);
|
|
14770
|
+
serverOutDir = join25(buildPath, basename8(firstEntry.dir));
|
|
14666
14771
|
} else if (serverDirMap.length > 1) {
|
|
14667
14772
|
serverRoot = commonAncestor(serverDirMap.map((entry) => entry.dir), projectRoot);
|
|
14668
14773
|
serverOutDir = buildPath;
|
|
@@ -14674,13 +14779,13 @@ ${content.slice(firstUseIdx)}`;
|
|
|
14674
14779
|
const filterToIncrementalEntries = (entryPoints, mapToSource) => {
|
|
14675
14780
|
if (!isIncremental || !incrementalFiles)
|
|
14676
14781
|
return entryPoints;
|
|
14677
|
-
const normalizedIncremental = new Set(incrementalFiles.map((f2) =>
|
|
14782
|
+
const normalizedIncremental = new Set(incrementalFiles.map((f2) => resolve22(f2)));
|
|
14678
14783
|
const matchingEntries = [];
|
|
14679
14784
|
for (const entry of entryPoints) {
|
|
14680
14785
|
const sourceFile = mapToSource(entry);
|
|
14681
14786
|
if (!sourceFile)
|
|
14682
14787
|
continue;
|
|
14683
|
-
if (!normalizedIncremental.has(
|
|
14788
|
+
if (!normalizedIncremental.has(resolve22(sourceFile)))
|
|
14684
14789
|
continue;
|
|
14685
14790
|
matchingEntries.push(entry);
|
|
14686
14791
|
}
|
|
@@ -14690,7 +14795,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
14690
14795
|
await tracePhase("react/index-generation", () => generateReactIndexFiles(reactPagesPath, reactIndexesPath, hmr));
|
|
14691
14796
|
}
|
|
14692
14797
|
if (assetsPath && (!isIncremental || normalizedIncrementalFiles?.some((f2) => f2.includes("/assets/")))) {
|
|
14693
|
-
await tracePhase("assets/copy", () => cpSync(assetsPath,
|
|
14798
|
+
await tracePhase("assets/copy", () => cpSync(assetsPath, join25(buildPath, "assets"), {
|
|
14694
14799
|
force: true,
|
|
14695
14800
|
recursive: true
|
|
14696
14801
|
}));
|
|
@@ -14709,6 +14814,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
14709
14814
|
vueConventionResult,
|
|
14710
14815
|
angularConventionResult,
|
|
14711
14816
|
emberConventionResult,
|
|
14817
|
+
htmlConventionResult,
|
|
14712
14818
|
allGlobalCssEntries
|
|
14713
14819
|
] = await Promise.all([
|
|
14714
14820
|
tailwindPromise,
|
|
@@ -14719,6 +14825,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
14719
14825
|
vuePagesPath ? tracePhase("scan/vue-conventions", () => scanConventions(vuePagesPath, "*.vue")) : emptyConventionResult,
|
|
14720
14826
|
angularPagesPath ? tracePhase("scan/angular-conventions", () => scanConventions(angularPagesPath, "*.ts")) : emptyConventionResult,
|
|
14721
14827
|
emberPagesPath ? tracePhase("scan/ember-conventions", () => scanConventions(emberPagesPath, "*.{gjs,gts,ts}")) : emptyConventionResult,
|
|
14828
|
+
htmlPagesPath ? tracePhase("scan/html-conventions", () => scanConventions(htmlPagesPath, "*.html")) : emptyConventionResult,
|
|
14722
14829
|
stylesDir ? tracePhase("scan/css", () => scanCssEntryPoints(stylesDir, stylesIgnore)) : []
|
|
14723
14830
|
]);
|
|
14724
14831
|
const allSvelteEntries = svelteConventionResult.pageFiles;
|
|
@@ -14736,15 +14843,37 @@ ${content.slice(firstUseIdx)}`;
|
|
|
14736
14843
|
conventionsMap.angular = angularConventionResult.conventions;
|
|
14737
14844
|
if (emberConventionResult.conventions)
|
|
14738
14845
|
conventionsMap.ember = emberConventionResult.conventions;
|
|
14739
|
-
|
|
14846
|
+
if (htmlConventionResult.conventions && htmlDir && htmlPagesPath) {
|
|
14847
|
+
const outputHtmlPages = isSingle ? join25(buildPath, "pages") : join25(buildPath, basename8(htmlDir), "pages");
|
|
14848
|
+
const remap = (sourcePath) => join25(outputHtmlPages, relative12(htmlPagesPath, sourcePath));
|
|
14849
|
+
const htmlConventions = htmlConventionResult.conventions;
|
|
14850
|
+
if (htmlConventions.defaults) {
|
|
14851
|
+
if (htmlConventions.defaults.error)
|
|
14852
|
+
htmlConventions.defaults.error = remap(htmlConventions.defaults.error);
|
|
14853
|
+
if (htmlConventions.defaults.notFound)
|
|
14854
|
+
htmlConventions.defaults.notFound = remap(htmlConventions.defaults.notFound);
|
|
14855
|
+
if (htmlConventions.defaults.loading)
|
|
14856
|
+
htmlConventions.defaults.loading = remap(htmlConventions.defaults.loading);
|
|
14857
|
+
}
|
|
14858
|
+
if (htmlConventions.pages) {
|
|
14859
|
+
for (const page of Object.values(htmlConventions.pages)) {
|
|
14860
|
+
if (page.error)
|
|
14861
|
+
page.error = remap(page.error);
|
|
14862
|
+
if (page.loading)
|
|
14863
|
+
page.loading = remap(page.loading);
|
|
14864
|
+
}
|
|
14865
|
+
}
|
|
14866
|
+
conventionsMap.html = htmlConventions;
|
|
14867
|
+
}
|
|
14868
|
+
const notFoundFrameworks = ["react", "svelte", "vue", "angular", "ember", "html"].filter((framework) => conventionsMap[framework]?.defaults?.notFound);
|
|
14740
14869
|
if (notFoundFrameworks.length > 1) {
|
|
14741
14870
|
logWarn(`Multiple frameworks define not-found convention files: ${notFoundFrameworks.join(", ")}. Only one will be used (priority: ${notFoundFrameworks[0]}). Remove not-found files from other frameworks to avoid ambiguity.`);
|
|
14742
14871
|
}
|
|
14743
14872
|
const shouldIncludeHtmlAssets = !isIncremental || normalizedIncrementalFiles?.some((f2) => f2.includes("/html/") && (f2.endsWith(".html") || isStylePath(f2)));
|
|
14744
14873
|
const reactEntries = isIncremental && reactIndexesPath && reactPagesPath ? filterToIncrementalEntries(allReactEntries, (entry) => {
|
|
14745
|
-
if (entry.startsWith(
|
|
14874
|
+
if (entry.startsWith(resolve22(reactIndexesPath))) {
|
|
14746
14875
|
const pageName = basename8(entry, ".tsx");
|
|
14747
|
-
return
|
|
14876
|
+
return join25(reactPagesPath, `${pageName}.tsx`);
|
|
14748
14877
|
}
|
|
14749
14878
|
return null;
|
|
14750
14879
|
}) : allReactEntries;
|
|
@@ -14821,7 +14950,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
14821
14950
|
const clientPath = islandSvelteClientPaths[idx];
|
|
14822
14951
|
if (!sourcePath || !clientPath)
|
|
14823
14952
|
continue;
|
|
14824
|
-
islandSvelteClientPathMap.set(
|
|
14953
|
+
islandSvelteClientPathMap.set(resolve22(sourcePath), clientPath);
|
|
14825
14954
|
}
|
|
14826
14955
|
const islandVueClientPathMap = new Map;
|
|
14827
14956
|
for (let idx = 0;idx < islandVueSources.length; idx++) {
|
|
@@ -14829,7 +14958,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
14829
14958
|
const clientPath = islandVueClientPaths[idx];
|
|
14830
14959
|
if (!sourcePath || !clientPath)
|
|
14831
14960
|
continue;
|
|
14832
|
-
islandVueClientPathMap.set(
|
|
14961
|
+
islandVueClientPathMap.set(resolve22(sourcePath), clientPath);
|
|
14833
14962
|
}
|
|
14834
14963
|
const islandAngularClientPathMap = new Map;
|
|
14835
14964
|
for (let idx = 0;idx < islandAngularSources.length; idx++) {
|
|
@@ -14837,7 +14966,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
14837
14966
|
const clientPath = islandAngularClientPaths[idx];
|
|
14838
14967
|
if (!sourcePath || !clientPath)
|
|
14839
14968
|
continue;
|
|
14840
|
-
islandAngularClientPathMap.set(
|
|
14969
|
+
islandAngularClientPathMap.set(resolve22(sourcePath), clientPath);
|
|
14841
14970
|
}
|
|
14842
14971
|
const reactConventionSources = collectConventionSourceFiles(conventionsMap.react);
|
|
14843
14972
|
const svelteConventionSources = collectConventionSourceFiles(conventionsMap.svelte);
|
|
@@ -14848,7 +14977,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
14848
14977
|
const compileReactConventions = async () => {
|
|
14849
14978
|
if (reactConventionSources.length === 0)
|
|
14850
14979
|
return emptyStringArray;
|
|
14851
|
-
const destDir =
|
|
14980
|
+
const destDir = join25(buildPath, "conventions", "react");
|
|
14852
14981
|
rmSync2(destDir, { force: true, recursive: true });
|
|
14853
14982
|
mkdirSync11(destDir, { recursive: true });
|
|
14854
14983
|
const destPaths = [];
|
|
@@ -14864,7 +14993,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
14864
14993
|
naming: `${idx}-[name].[ext]`,
|
|
14865
14994
|
outdir: destDir,
|
|
14866
14995
|
plugins: [stylePreprocessorPlugin2],
|
|
14867
|
-
root:
|
|
14996
|
+
root: dirname14(source),
|
|
14868
14997
|
target: "bun",
|
|
14869
14998
|
throw: false,
|
|
14870
14999
|
tsconfig: "./tsconfig.json"
|
|
@@ -14892,7 +15021,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
14892
15021
|
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 }
|
|
14893
15022
|
]);
|
|
14894
15023
|
const bundleConventionFiles = async (framework, compiledPaths) => {
|
|
14895
|
-
const destDir =
|
|
15024
|
+
const destDir = join25(buildPath, "conventions", framework);
|
|
14896
15025
|
rmSync2(destDir, { force: true, recursive: true });
|
|
14897
15026
|
mkdirSync11(destDir, { recursive: true });
|
|
14898
15027
|
const destPaths = [];
|
|
@@ -14966,7 +15095,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
14966
15095
|
}
|
|
14967
15096
|
})) : {
|
|
14968
15097
|
entries: [],
|
|
14969
|
-
generatedRoot:
|
|
15098
|
+
generatedRoot: join25(buildPath, "_island_entries")
|
|
14970
15099
|
};
|
|
14971
15100
|
const islandClientEntryPoints = islandEntryResult.entries.map((entry) => entry.entryPath);
|
|
14972
15101
|
if (serverEntryPoints.length === 0 && reactClientEntryPoints.length === 0 && nonReactClientEntryPoints.length === 0 && islandClientEntryPoints.length === 0 && htmxDir === undefined && htmlDir === undefined) {
|
|
@@ -15002,7 +15131,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
15002
15131
|
return {};
|
|
15003
15132
|
}
|
|
15004
15133
|
if (hmr && reactIndexesPath && reactClientEntryPoints.length > 0) {
|
|
15005
|
-
const refreshEntry =
|
|
15134
|
+
const refreshEntry = join25(reactIndexesPath, "_refresh.tsx");
|
|
15006
15135
|
if (!reactClientEntryPoints.includes(refreshEntry))
|
|
15007
15136
|
reactClientEntryPoints.push(refreshEntry);
|
|
15008
15137
|
}
|
|
@@ -15101,19 +15230,19 @@ ${content.slice(firstUseIdx)}`;
|
|
|
15101
15230
|
throw: false
|
|
15102
15231
|
}, resolveBunBuildOverride(bunBuildConfig, "reactClient")) : undefined;
|
|
15103
15232
|
if (reactDir && reactClientEntryPoints.length > 0) {
|
|
15104
|
-
rmSync2(
|
|
15233
|
+
rmSync2(join25(buildPath, "react", "generated", "indexes"), {
|
|
15105
15234
|
force: true,
|
|
15106
15235
|
recursive: true
|
|
15107
15236
|
});
|
|
15108
15237
|
}
|
|
15109
15238
|
if (angularDir && angularClientPaths.length > 0) {
|
|
15110
|
-
rmSync2(
|
|
15239
|
+
rmSync2(join25(buildPath, "angular", "indexes"), {
|
|
15111
15240
|
force: true,
|
|
15112
15241
|
recursive: true
|
|
15113
15242
|
});
|
|
15114
15243
|
}
|
|
15115
15244
|
if (islandClientEntryPoints.length > 0) {
|
|
15116
|
-
rmSync2(
|
|
15245
|
+
rmSync2(join25(buildPath, "islands"), {
|
|
15117
15246
|
force: true,
|
|
15118
15247
|
recursive: true
|
|
15119
15248
|
});
|
|
@@ -15196,7 +15325,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
15196
15325
|
globalCssEntries.length > 0 ? tracePhase("bun/global-css", () => bunBuild7(mergeBunBuildConfig({
|
|
15197
15326
|
entrypoints: globalCssEntries,
|
|
15198
15327
|
naming: `[dir]/[name].[hash].[ext]`,
|
|
15199
|
-
outdir: stylesDir ?
|
|
15328
|
+
outdir: stylesDir ? join25(buildPath, basename8(stylesDir)) : buildPath,
|
|
15200
15329
|
plugins: [stylePreprocessorPlugin2],
|
|
15201
15330
|
root: stylesDir || clientRoot,
|
|
15202
15331
|
target: "browser",
|
|
@@ -15205,7 +15334,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
15205
15334
|
vueCssPaths.length > 0 ? tracePhase("bun/vue-css", () => bunBuild7(mergeBunBuildConfig({
|
|
15206
15335
|
entrypoints: vueCssPaths,
|
|
15207
15336
|
naming: `[name].[hash].[ext]`,
|
|
15208
|
-
outdir:
|
|
15337
|
+
outdir: join25(buildPath, assetsPath ? basename8(assetsPath) : "assets", "css"),
|
|
15209
15338
|
target: "browser",
|
|
15210
15339
|
throw: false
|
|
15211
15340
|
}, resolveBunBuildOverride(bunBuildConfig, "vueCss")))) : undefined
|
|
@@ -15272,10 +15401,10 @@ ${content.slice(firstUseIdx)}`;
|
|
|
15272
15401
|
if (serverOutputs.length > 0 && angularServerVendorPaths2 && Object.keys(angularServerVendorPaths2).length > 0) {
|
|
15273
15402
|
const { rewriteBuildOutputsWith: rewriteBuildOutputsWith2 } = await Promise.resolve().then(() => (init_rewriteImportsPlugin(), exports_rewriteImportsPlugin));
|
|
15274
15403
|
await tracePhase("postprocess/server-angular-vendor-imports", () => rewriteBuildOutputsWith2(serverOutputs, (artifact) => {
|
|
15275
|
-
const fileDir =
|
|
15404
|
+
const fileDir = dirname14(artifact.path);
|
|
15276
15405
|
const relativePaths = {};
|
|
15277
15406
|
for (const [specifier, absolute] of Object.entries(angularServerVendorPaths2)) {
|
|
15278
|
-
const rel =
|
|
15407
|
+
const rel = relative12(fileDir, absolute);
|
|
15279
15408
|
relativePaths[specifier] = rel.startsWith(".") ? rel : `./${rel}`;
|
|
15280
15409
|
}
|
|
15281
15410
|
return relativePaths;
|
|
@@ -15344,7 +15473,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
15344
15473
|
if (skipAngularClientBundle) {
|
|
15345
15474
|
for (const clientPath of angularClientPaths) {
|
|
15346
15475
|
const fileBase = basename8(clientPath, ".js");
|
|
15347
|
-
const relFromCwd =
|
|
15476
|
+
const relFromCwd = relative12(projectRoot, clientPath).replace(/\\/g, "/");
|
|
15348
15477
|
manifest[`${toPascal(fileBase)}Index`] = `/@src/${relFromCwd}`;
|
|
15349
15478
|
}
|
|
15350
15479
|
}
|
|
@@ -15366,7 +15495,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
15366
15495
|
const processHtmlPages = async () => {
|
|
15367
15496
|
if (!(htmlDir && htmlPagesPath))
|
|
15368
15497
|
return;
|
|
15369
|
-
const outputHtmlPages = isSingle ?
|
|
15498
|
+
const outputHtmlPages = isSingle ? join25(buildPath, "pages") : join25(buildPath, basename8(htmlDir), "pages");
|
|
15370
15499
|
mkdirSync11(outputHtmlPages, { recursive: true });
|
|
15371
15500
|
cpSync(htmlPagesPath, outputHtmlPages, {
|
|
15372
15501
|
force: true,
|
|
@@ -15388,14 +15517,14 @@ ${content.slice(firstUseIdx)}`;
|
|
|
15388
15517
|
const processHtmxPages = async () => {
|
|
15389
15518
|
if (!(htmxDir && htmxPagesPath))
|
|
15390
15519
|
return;
|
|
15391
|
-
const outputHtmxPages = isSingle ?
|
|
15520
|
+
const outputHtmxPages = isSingle ? join25(buildPath, "pages") : join25(buildPath, basename8(htmxDir), "pages");
|
|
15392
15521
|
mkdirSync11(outputHtmxPages, { recursive: true });
|
|
15393
15522
|
cpSync(htmxPagesPath, outputHtmxPages, {
|
|
15394
15523
|
force: true,
|
|
15395
15524
|
recursive: true
|
|
15396
15525
|
});
|
|
15397
15526
|
if (shouldCopyHtmx) {
|
|
15398
|
-
const htmxDestDir = isSingle ? buildPath :
|
|
15527
|
+
const htmxDestDir = isSingle ? buildPath : join25(buildPath, basename8(htmxDir));
|
|
15399
15528
|
copyHtmxVendor(htmxDir, htmxDestDir);
|
|
15400
15529
|
}
|
|
15401
15530
|
if (shouldUpdateHtmxAssetPaths) {
|
|
@@ -15457,9 +15586,9 @@ ${content.slice(firstUseIdx)}`;
|
|
|
15457
15586
|
writeBuildTrace(buildPath);
|
|
15458
15587
|
return { conventions: conventionsMap, manifest };
|
|
15459
15588
|
}
|
|
15460
|
-
writeFileSync7(
|
|
15589
|
+
writeFileSync7(join25(buildPath, "manifest.json"), JSON.stringify(manifest, null, "\t"));
|
|
15461
15590
|
if (Object.keys(conventionsMap).length > 0) {
|
|
15462
|
-
writeFileSync7(
|
|
15591
|
+
writeFileSync7(join25(buildPath, "conventions.json"), JSON.stringify(conventionsMap, null, "\t"));
|
|
15463
15592
|
}
|
|
15464
15593
|
writeBuildTrace(buildPath);
|
|
15465
15594
|
if (tailwind && mode === "production") {
|
|
@@ -15560,7 +15689,7 @@ var init_build = __esm(() => {
|
|
|
15560
15689
|
|
|
15561
15690
|
// src/build/buildEmberVendor.ts
|
|
15562
15691
|
import { mkdirSync as mkdirSync12, existsSync as existsSync20 } from "fs";
|
|
15563
|
-
import { join as
|
|
15692
|
+
import { join as join26 } from "path";
|
|
15564
15693
|
import { rm as rm9 } from "fs/promises";
|
|
15565
15694
|
var {build: bunBuild8 } = globalThis.Bun;
|
|
15566
15695
|
var toSafeFileName5 = (specifier) => specifier.replace(/^@/, "").replace(/\//g, "_"), generateMacrosShim = () => `// Generated shim for @embroider/macros \u2014 provides minimal runtime
|
|
@@ -15612,7 +15741,7 @@ export const importSync = (specifier) => {
|
|
|
15612
15741
|
if (standaloneSpecifiers.has(specifier)) {
|
|
15613
15742
|
return { resolveTo: specifier, specifier };
|
|
15614
15743
|
}
|
|
15615
|
-
const emberInternalPath =
|
|
15744
|
+
const emberInternalPath = join26(cwd2, "node_modules/ember-source/dist/packages", specifier, "index.js");
|
|
15616
15745
|
if (!existsSync20(emberInternalPath)) {
|
|
15617
15746
|
throw new Error(`Ember vendor build: cannot find ${specifier} at ${emberInternalPath}. ` + `Is ember-source installed and at least 6.12?`);
|
|
15618
15747
|
}
|
|
@@ -15644,7 +15773,7 @@ export const importSync = (specifier) => {
|
|
|
15644
15773
|
if (standalonePackages.has(args.path)) {
|
|
15645
15774
|
return;
|
|
15646
15775
|
}
|
|
15647
|
-
const internal =
|
|
15776
|
+
const internal = join26(cwd2, "node_modules/ember-source/dist/packages", args.path, "index.js");
|
|
15648
15777
|
if (existsSync20(internal)) {
|
|
15649
15778
|
return { path: internal };
|
|
15650
15779
|
}
|
|
@@ -15652,16 +15781,16 @@ export const importSync = (specifier) => {
|
|
|
15652
15781
|
});
|
|
15653
15782
|
}
|
|
15654
15783
|
}), buildEmberVendor = async (buildDir, cwd2 = process.cwd()) => {
|
|
15655
|
-
const vendorDir =
|
|
15784
|
+
const vendorDir = join26(buildDir, "ember", "vendor");
|
|
15656
15785
|
mkdirSync12(vendorDir, { recursive: true });
|
|
15657
|
-
const tmpDir =
|
|
15786
|
+
const tmpDir = join26(buildDir, "_ember_vendor_tmp");
|
|
15658
15787
|
mkdirSync12(tmpDir, { recursive: true });
|
|
15659
|
-
const macrosShimPath =
|
|
15788
|
+
const macrosShimPath = join26(tmpDir, "embroider_macros_shim.js");
|
|
15660
15789
|
await Bun.write(macrosShimPath, generateMacrosShim());
|
|
15661
15790
|
const resolutions = REQUIRED_EMBER_SPECIFIERS.map((specifier) => resolveEmberSpecifier(specifier, cwd2));
|
|
15662
15791
|
const entrypoints = await Promise.all(resolutions.map(async (resolution) => {
|
|
15663
15792
|
const safeName = toSafeFileName5(resolution.specifier);
|
|
15664
|
-
const entryPath =
|
|
15793
|
+
const entryPath = join26(tmpDir, `${safeName}.js`);
|
|
15665
15794
|
const source = resolution.specifier === "@embroider/macros" ? `export * from ${JSON.stringify(macrosShimPath)};
|
|
15666
15795
|
` : generateVendorEntrySource2(resolution);
|
|
15667
15796
|
await Bun.write(entryPath, source);
|
|
@@ -15707,7 +15836,7 @@ var init_buildEmberVendor = __esm(() => {
|
|
|
15707
15836
|
// src/dev/dependencyGraph.ts
|
|
15708
15837
|
import { existsSync as existsSync21, readFileSync as readFileSync13 } from "fs";
|
|
15709
15838
|
var {Glob: Glob8 } = globalThis.Bun;
|
|
15710
|
-
import { resolve as
|
|
15839
|
+
import { resolve as resolve23 } from "path";
|
|
15711
15840
|
var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath) => {
|
|
15712
15841
|
const lower = filePath.toLowerCase();
|
|
15713
15842
|
if (lower.endsWith(".ts") || lower.endsWith(".tsx") || lower.endsWith(".jsx"))
|
|
@@ -15721,8 +15850,8 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
15721
15850
|
if (!importPath.startsWith(".") && !importPath.startsWith("/")) {
|
|
15722
15851
|
return null;
|
|
15723
15852
|
}
|
|
15724
|
-
const fromDir =
|
|
15725
|
-
const normalized =
|
|
15853
|
+
const fromDir = resolve23(fromFile, "..");
|
|
15854
|
+
const normalized = resolve23(fromDir, importPath);
|
|
15726
15855
|
const extensions = [
|
|
15727
15856
|
".ts",
|
|
15728
15857
|
".tsx",
|
|
@@ -15752,7 +15881,7 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
15752
15881
|
dependents.delete(normalizedPath);
|
|
15753
15882
|
}
|
|
15754
15883
|
}, addFileToGraph = (graph, filePath) => {
|
|
15755
|
-
const normalizedPath =
|
|
15884
|
+
const normalizedPath = resolve23(filePath);
|
|
15756
15885
|
if (!existsSync21(normalizedPath))
|
|
15757
15886
|
return;
|
|
15758
15887
|
const dependencies = extractDependencies(normalizedPath);
|
|
@@ -15769,10 +15898,10 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
15769
15898
|
}, IGNORED_SEGMENTS, buildInitialDependencyGraph = (graph, directories) => {
|
|
15770
15899
|
const processedFiles = new Set;
|
|
15771
15900
|
const glob = new Glob8("**/*.{ts,tsx,js,jsx,vue,svelte,html,htm}");
|
|
15772
|
-
const resolvedDirs = directories.map((dir) =>
|
|
15901
|
+
const resolvedDirs = directories.map((dir) => resolve23(dir)).filter((dir) => existsSync21(dir));
|
|
15773
15902
|
const allFiles = resolvedDirs.flatMap((dir) => Array.from(glob.scanSync({ absolute: true, cwd: dir })));
|
|
15774
15903
|
for (const file4 of allFiles) {
|
|
15775
|
-
const fullPath =
|
|
15904
|
+
const fullPath = resolve23(file4);
|
|
15776
15905
|
if (IGNORED_SEGMENTS.some((seg) => fullPath.includes(seg)))
|
|
15777
15906
|
continue;
|
|
15778
15907
|
if (processedFiles.has(fullPath))
|
|
@@ -15827,8 +15956,8 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
15827
15956
|
resolveRegexMatches(styleUrlSingularRegex, content, filePath, dependencies);
|
|
15828
15957
|
extractStyleUrlsDependencies(content, filePath, dependencies);
|
|
15829
15958
|
}, extractJsDependencies = (filePath, content, loader) => {
|
|
15830
|
-
const
|
|
15831
|
-
const imports =
|
|
15959
|
+
const transpiler6 = loader === "tsx" ? tsTranspiler : jsTranspiler;
|
|
15960
|
+
const imports = transpiler6.scanImports(content);
|
|
15832
15961
|
const dependencies = [];
|
|
15833
15962
|
for (const imp of imports) {
|
|
15834
15963
|
const resolved = resolveImportPath2(imp.path, filePath);
|
|
@@ -15885,7 +16014,7 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
15885
16014
|
return [];
|
|
15886
16015
|
}
|
|
15887
16016
|
}, getAffectedFiles = (graph, changedFile) => {
|
|
15888
|
-
const normalizedPath =
|
|
16017
|
+
const normalizedPath = resolve23(changedFile);
|
|
15889
16018
|
const affected = new Set;
|
|
15890
16019
|
const toProcess = [normalizedPath];
|
|
15891
16020
|
const processNode = (current) => {
|
|
@@ -15925,7 +16054,7 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
15925
16054
|
}
|
|
15926
16055
|
graph.dependents.delete(normalizedPath);
|
|
15927
16056
|
}, removeFileFromGraph = (graph, filePath) => {
|
|
15928
|
-
const normalizedPath =
|
|
16057
|
+
const normalizedPath = resolve23(filePath);
|
|
15929
16058
|
removeDepsForFile(graph, normalizedPath);
|
|
15930
16059
|
removeDependentsForFile(graph, normalizedPath);
|
|
15931
16060
|
};
|
|
@@ -15968,12 +16097,12 @@ var globalVersionCounter = 0, createModuleVersionTracker = () => new Map, getNex
|
|
|
15968
16097
|
};
|
|
15969
16098
|
|
|
15970
16099
|
// src/dev/configResolver.ts
|
|
15971
|
-
import { resolve as
|
|
16100
|
+
import { resolve as resolve24 } from "path";
|
|
15972
16101
|
var resolveBuildPaths = (config) => {
|
|
15973
16102
|
const cwd2 = process.cwd();
|
|
15974
16103
|
const normalize = (path) => path.replace(/\\/g, "/");
|
|
15975
|
-
const withDefault = (value, fallback) => normalize(
|
|
15976
|
-
const optional = (value) => value ? normalize(
|
|
16104
|
+
const withDefault = (value, fallback) => normalize(resolve24(cwd2, value ?? fallback));
|
|
16105
|
+
const optional = (value) => value ? normalize(resolve24(cwd2, value)) : undefined;
|
|
15977
16106
|
return {
|
|
15978
16107
|
angularDir: optional(config.angularDirectory),
|
|
15979
16108
|
assetsDir: optional(config.assetsDirectory),
|
|
@@ -16026,7 +16155,7 @@ var init_clientManager = __esm(() => {
|
|
|
16026
16155
|
|
|
16027
16156
|
// src/dev/pathUtils.ts
|
|
16028
16157
|
import { existsSync as existsSync22, readdirSync, readFileSync as readFileSync14 } from "fs";
|
|
16029
|
-
import { dirname as
|
|
16158
|
+
import { dirname as dirname15, resolve as resolve25 } from "path";
|
|
16030
16159
|
var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
16031
16160
|
if (shouldIgnorePath(filePath, resolved)) {
|
|
16032
16161
|
return "ignored";
|
|
@@ -16102,7 +16231,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
16102
16231
|
return "unknown";
|
|
16103
16232
|
}, collectAngularResourceDirs = (angularDir) => {
|
|
16104
16233
|
const out = new Set;
|
|
16105
|
-
const angularRoot =
|
|
16234
|
+
const angularRoot = resolve25(angularDir);
|
|
16106
16235
|
const angularRootNormalized = normalizePath(angularRoot);
|
|
16107
16236
|
const walk = (dir) => {
|
|
16108
16237
|
let entries;
|
|
@@ -16115,7 +16244,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
16115
16244
|
if (entry.name.startsWith(".") || entry.name === "node_modules") {
|
|
16116
16245
|
continue;
|
|
16117
16246
|
}
|
|
16118
|
-
const full =
|
|
16247
|
+
const full = resolve25(dir, entry.name);
|
|
16119
16248
|
if (entry.isDirectory()) {
|
|
16120
16249
|
walk(full);
|
|
16121
16250
|
continue;
|
|
@@ -16154,10 +16283,10 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
16154
16283
|
refs.push(strMatch[1]);
|
|
16155
16284
|
}
|
|
16156
16285
|
}
|
|
16157
|
-
const componentDir =
|
|
16286
|
+
const componentDir = dirname15(full);
|
|
16158
16287
|
for (const ref of refs) {
|
|
16159
|
-
const refAbs = normalizePath(
|
|
16160
|
-
const refDir = normalizePath(
|
|
16288
|
+
const refAbs = normalizePath(resolve25(componentDir, ref));
|
|
16289
|
+
const refDir = normalizePath(dirname15(refAbs));
|
|
16161
16290
|
if (refDir === angularRootNormalized || refDir.startsWith(angularRootNormalized + "/")) {
|
|
16162
16291
|
continue;
|
|
16163
16292
|
}
|
|
@@ -16173,7 +16302,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
16173
16302
|
const push = (path) => {
|
|
16174
16303
|
if (!path)
|
|
16175
16304
|
return;
|
|
16176
|
-
const abs = normalizePath(
|
|
16305
|
+
const abs = normalizePath(resolve25(cwd2, path));
|
|
16177
16306
|
if (!roots.includes(abs))
|
|
16178
16307
|
roots.push(abs);
|
|
16179
16308
|
};
|
|
@@ -16198,7 +16327,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
16198
16327
|
push(cfg.assetsDir);
|
|
16199
16328
|
push(cfg.stylesDir);
|
|
16200
16329
|
for (const candidate of ["src", "db", "assets", "styles"]) {
|
|
16201
|
-
const abs = normalizePath(
|
|
16330
|
+
const abs = normalizePath(resolve25(cwd2, candidate));
|
|
16202
16331
|
if (existsSync22(abs) && !roots.includes(abs))
|
|
16203
16332
|
roots.push(abs);
|
|
16204
16333
|
}
|
|
@@ -16269,7 +16398,7 @@ var init_pathUtils = __esm(() => {
|
|
|
16269
16398
|
// src/dev/fileWatcher.ts
|
|
16270
16399
|
import { watch } from "fs";
|
|
16271
16400
|
import { existsSync as existsSync23 } from "fs";
|
|
16272
|
-
import { join as
|
|
16401
|
+
import { join as join27, resolve as resolve26 } from "path";
|
|
16273
16402
|
var safeRemoveFromGraph = (graph, fullPath) => {
|
|
16274
16403
|
try {
|
|
16275
16404
|
removeFileFromGraph(graph, fullPath);
|
|
@@ -16296,7 +16425,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
16296
16425
|
if (shouldSkipFilename(filename, isStylesDir)) {
|
|
16297
16426
|
return;
|
|
16298
16427
|
}
|
|
16299
|
-
const fullPath =
|
|
16428
|
+
const fullPath = join27(absolutePath, filename).replace(/\\/g, "/");
|
|
16300
16429
|
if (shouldIgnorePath(fullPath, state.resolvedPaths)) {
|
|
16301
16430
|
return;
|
|
16302
16431
|
}
|
|
@@ -16314,7 +16443,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
16314
16443
|
}, addFileWatchers = (state, paths, onFileChange) => {
|
|
16315
16444
|
const stylesDir = state.resolvedPaths?.stylesDir;
|
|
16316
16445
|
paths.forEach((path) => {
|
|
16317
|
-
const absolutePath =
|
|
16446
|
+
const absolutePath = resolve26(path).replace(/\\/g, "/");
|
|
16318
16447
|
if (!existsSync23(absolutePath)) {
|
|
16319
16448
|
return;
|
|
16320
16449
|
}
|
|
@@ -16325,7 +16454,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
16325
16454
|
const watchPaths = getWatchPaths(config, state.resolvedPaths);
|
|
16326
16455
|
const stylesDir = state.resolvedPaths?.stylesDir;
|
|
16327
16456
|
watchPaths.forEach((path) => {
|
|
16328
|
-
const absolutePath =
|
|
16457
|
+
const absolutePath = resolve26(path).replace(/\\/g, "/");
|
|
16329
16458
|
if (!existsSync23(absolutePath)) {
|
|
16330
16459
|
return;
|
|
16331
16460
|
}
|
|
@@ -16340,13 +16469,13 @@ var init_fileWatcher = __esm(() => {
|
|
|
16340
16469
|
});
|
|
16341
16470
|
|
|
16342
16471
|
// src/dev/assetStore.ts
|
|
16343
|
-
import { resolve as
|
|
16472
|
+
import { resolve as resolve27 } from "path";
|
|
16344
16473
|
import { readdir as readdir4, unlink } from "fs/promises";
|
|
16345
16474
|
var mimeTypes, getMimeType = (filePath) => {
|
|
16346
16475
|
const ext = filePath.slice(filePath.lastIndexOf("."));
|
|
16347
16476
|
return mimeTypes[ext] ?? "application/octet-stream";
|
|
16348
16477
|
}, HASHED_FILE_RE, stripHash = (webPath) => webPath.replace(/\.[a-z0-9]{8}(\.(js|css|mjs))$/, "$1"), processWalkEntry = (entry, dir, liveByIdentity, walkAndClean) => {
|
|
16349
|
-
const fullPath =
|
|
16478
|
+
const fullPath = resolve27(dir, entry.name);
|
|
16350
16479
|
if (entry.isDirectory()) {
|
|
16351
16480
|
return walkAndClean(fullPath);
|
|
16352
16481
|
}
|
|
@@ -16362,10 +16491,10 @@ var mimeTypes, getMimeType = (filePath) => {
|
|
|
16362
16491
|
}, cleanStaleAssets = async (store, manifest, buildDir) => {
|
|
16363
16492
|
const liveByIdentity = new Map;
|
|
16364
16493
|
for (const webPath of store.keys()) {
|
|
16365
|
-
const diskPath =
|
|
16494
|
+
const diskPath = resolve27(buildDir, webPath.slice(1));
|
|
16366
16495
|
liveByIdentity.set(stripHash(diskPath), diskPath);
|
|
16367
16496
|
}
|
|
16368
|
-
const absBuildDir =
|
|
16497
|
+
const absBuildDir = resolve27(buildDir);
|
|
16369
16498
|
Object.values(manifest).forEach((val) => {
|
|
16370
16499
|
if (!HASHED_FILE_RE.test(val))
|
|
16371
16500
|
return;
|
|
@@ -16383,7 +16512,7 @@ var mimeTypes, getMimeType = (filePath) => {
|
|
|
16383
16512
|
} catch {}
|
|
16384
16513
|
}, lookupAsset = (store, path) => store.get(path), processScanEntry = (entry, dir, prefix, store, scanDir) => {
|
|
16385
16514
|
if (entry.isDirectory()) {
|
|
16386
|
-
return scanDir(
|
|
16515
|
+
return scanDir(resolve27(dir, entry.name), `${prefix}${entry.name}/`);
|
|
16387
16516
|
}
|
|
16388
16517
|
if (!entry.name.startsWith("chunk-")) {
|
|
16389
16518
|
return null;
|
|
@@ -16392,7 +16521,7 @@ var mimeTypes, getMimeType = (filePath) => {
|
|
|
16392
16521
|
if (store.has(webPath)) {
|
|
16393
16522
|
return null;
|
|
16394
16523
|
}
|
|
16395
|
-
return Bun.file(
|
|
16524
|
+
return Bun.file(resolve27(dir, entry.name)).bytes().then((bytes) => {
|
|
16396
16525
|
store.set(webPath, bytes);
|
|
16397
16526
|
return;
|
|
16398
16527
|
}).catch(() => {});
|
|
@@ -16414,7 +16543,7 @@ var mimeTypes, getMimeType = (filePath) => {
|
|
|
16414
16543
|
for (const webPath of newIdentities.values()) {
|
|
16415
16544
|
if (store.has(webPath))
|
|
16416
16545
|
continue;
|
|
16417
|
-
loadPromises.push(Bun.file(
|
|
16546
|
+
loadPromises.push(Bun.file(resolve27(buildDir, webPath.slice(1))).bytes().then((bytes) => {
|
|
16418
16547
|
store.set(webPath, bytes);
|
|
16419
16548
|
return;
|
|
16420
16549
|
}).catch(() => {}));
|
|
@@ -16445,7 +16574,7 @@ var init_assetStore = __esm(() => {
|
|
|
16445
16574
|
|
|
16446
16575
|
// src/islands/pageMetadata.ts
|
|
16447
16576
|
import { readFileSync as readFileSync15 } from "fs";
|
|
16448
|
-
import { dirname as
|
|
16577
|
+
import { dirname as dirname16, resolve as resolve28 } from "path";
|
|
16449
16578
|
var pagePatterns, getPageDirs = (config) => [
|
|
16450
16579
|
{ dir: config.angularDirectory, framework: "angular" },
|
|
16451
16580
|
{ dir: config.emberDirectory, framework: "ember" },
|
|
@@ -16465,15 +16594,15 @@ var pagePatterns, getPageDirs = (config) => [
|
|
|
16465
16594
|
const source = definition.buildReference?.source;
|
|
16466
16595
|
if (!source)
|
|
16467
16596
|
continue;
|
|
16468
|
-
const resolvedSource = source.startsWith("file://") ? new URL(source).pathname :
|
|
16469
|
-
lookup.set(`${definition.framework}:${definition.component}`,
|
|
16597
|
+
const resolvedSource = source.startsWith("file://") ? new URL(source).pathname : resolve28(dirname16(buildInfo.resolvedRegistryPath), source);
|
|
16598
|
+
lookup.set(`${definition.framework}:${definition.component}`, resolve28(resolvedSource));
|
|
16470
16599
|
}
|
|
16471
16600
|
return lookup;
|
|
16472
16601
|
}, getCurrentPageIslandMetadata = () => globalThis.__absolutePageIslandMetadata ?? new Map, metadataUsesSource = (metadata, target) => metadata.islands.some((usage) => {
|
|
16473
16602
|
const candidate = usage.source;
|
|
16474
|
-
return candidate ?
|
|
16603
|
+
return candidate ? resolve28(candidate) === target : false;
|
|
16475
16604
|
}), getPagesUsingIslandSource = (sourcePath) => {
|
|
16476
|
-
const target =
|
|
16605
|
+
const target = resolve28(sourcePath);
|
|
16477
16606
|
return [...getCurrentPageIslandMetadata().values()].filter((metadata) => metadataUsesSource(metadata, target)).map((metadata) => metadata.pagePath);
|
|
16478
16607
|
}, resolveIslandUsages = (islands, islandSourceLookup) => islands.map((usage) => {
|
|
16479
16608
|
const sourcePath = islandSourceLookup.get(`${usage.framework}:${usage.component}`);
|
|
@@ -16485,13 +16614,13 @@ var pagePatterns, getPageDirs = (config) => [
|
|
|
16485
16614
|
const pattern = pagePatterns[entry.framework];
|
|
16486
16615
|
if (!pattern)
|
|
16487
16616
|
return;
|
|
16488
|
-
const files = await scanEntryPoints(
|
|
16617
|
+
const files = await scanEntryPoints(resolve28(entry.dir), pattern);
|
|
16489
16618
|
for (const filePath of files) {
|
|
16490
16619
|
const source = readFileSync15(filePath, "utf-8");
|
|
16491
16620
|
const islands = extractIslandUsagesFromSource(source);
|
|
16492
|
-
pageMetadata.set(
|
|
16621
|
+
pageMetadata.set(resolve28(filePath), {
|
|
16493
16622
|
islands: resolveIslandUsages(islands, islandSourceLookup),
|
|
16494
|
-
pagePath:
|
|
16623
|
+
pagePath: resolve28(filePath)
|
|
16495
16624
|
});
|
|
16496
16625
|
}
|
|
16497
16626
|
}, loadPageIslandMetadata = async (config) => {
|
|
@@ -16614,9 +16743,9 @@ var init_transformCache = __esm(() => {
|
|
|
16614
16743
|
});
|
|
16615
16744
|
|
|
16616
16745
|
// src/dev/reactComponentClassifier.ts
|
|
16617
|
-
import { resolve as
|
|
16746
|
+
import { resolve as resolve29 } from "path";
|
|
16618
16747
|
var classifyComponent = (filePath) => {
|
|
16619
|
-
const normalizedPath =
|
|
16748
|
+
const normalizedPath = resolve29(filePath);
|
|
16620
16749
|
if (normalizedPath.includes("/react/pages/")) {
|
|
16621
16750
|
return "server";
|
|
16622
16751
|
}
|
|
@@ -16628,7 +16757,7 @@ var classifyComponent = (filePath) => {
|
|
|
16628
16757
|
var init_reactComponentClassifier = () => {};
|
|
16629
16758
|
|
|
16630
16759
|
// src/dev/moduleMapper.ts
|
|
16631
|
-
import { basename as basename9, resolve as
|
|
16760
|
+
import { basename as basename9, resolve as resolve30 } from "path";
|
|
16632
16761
|
var buildModulePaths = (moduleKeys, manifest) => {
|
|
16633
16762
|
const modulePaths = {};
|
|
16634
16763
|
moduleKeys.forEach((key) => {
|
|
@@ -16638,7 +16767,7 @@ var buildModulePaths = (moduleKeys, manifest) => {
|
|
|
16638
16767
|
});
|
|
16639
16768
|
return modulePaths;
|
|
16640
16769
|
}, processChangedFile = (sourceFile, framework, manifest, resolvedPaths, processedFiles) => {
|
|
16641
|
-
const normalizedFile =
|
|
16770
|
+
const normalizedFile = resolve30(sourceFile);
|
|
16642
16771
|
const normalizedPath = normalizedFile.replace(/\\/g, "/");
|
|
16643
16772
|
if (processedFiles.has(normalizedFile)) {
|
|
16644
16773
|
return null;
|
|
@@ -16674,7 +16803,7 @@ var buildModulePaths = (moduleKeys, manifest) => {
|
|
|
16674
16803
|
});
|
|
16675
16804
|
return grouped;
|
|
16676
16805
|
}, mapSourceFileToManifestKeys = (sourceFile, framework, resolvedPaths) => {
|
|
16677
|
-
const normalizedFile =
|
|
16806
|
+
const normalizedFile = resolve30(sourceFile);
|
|
16678
16807
|
const fileName = basename9(normalizedFile);
|
|
16679
16808
|
const baseName = fileName.replace(/\.(tsx?|jsx?|vue|svelte|css|html)$/, "");
|
|
16680
16809
|
const pascalName = toPascal(baseName);
|
|
@@ -16870,7 +16999,7 @@ __export(exports_moduleServer, {
|
|
|
16870
16999
|
SRC_URL_PREFIX: () => SRC_URL_PREFIX
|
|
16871
17000
|
});
|
|
16872
17001
|
import { existsSync as existsSync24, readFileSync as readFileSync17, statSync as statSync2 } from "fs";
|
|
16873
|
-
import { basename as basename10, dirname as
|
|
17002
|
+
import { basename as basename10, dirname as dirname17, extname as extname8, join as join28, resolve as resolve31, relative as relative13 } from "path";
|
|
16874
17003
|
var SRC_PREFIX = "/@src/", jsTranspiler2, tsTranspiler2, tsxTranspiler, TRANSPILABLE, ALL_EXPORTS_RE, STRING_CONTENTS_RE, preserveTypeExports = (originalSource, transpiled, valueExports) => {
|
|
16875
17004
|
const codeOnly = originalSource.replace(STRING_CONTENTS_RE, '""');
|
|
16876
17005
|
const allExports = [];
|
|
@@ -16890,7 +17019,7 @@ var SRC_PREFIX = "/@src/", jsTranspiler2, tsTranspiler2, tsxTranspiler, TRANSPIL
|
|
|
16890
17019
|
${stubs}
|
|
16891
17020
|
`;
|
|
16892
17021
|
}, resolveRelativeExtension = (srcPath, projectRoot, extensions) => {
|
|
16893
|
-
const found = extensions.find((ext) => existsSync24(
|
|
17022
|
+
const found = extensions.find((ext) => existsSync24(resolve31(projectRoot, srcPath + ext)));
|
|
16894
17023
|
return found ? srcPath + found : srcPath;
|
|
16895
17024
|
}, IMPORT_EXTENSIONS, SIDE_EFFECT_EXTENSIONS, MODULE_EXTENSIONS, RESOLVED_MODULE_EXTENSIONS, REACT_EXTENSIONS, escapeRegex3 = (str) => str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), buildImportRewriter = (vendorPaths) => {
|
|
16896
17025
|
const entries = Object.entries(vendorPaths).sort(([a], [b2]) => b2.length - a.length);
|
|
@@ -16905,7 +17034,7 @@ ${stubs}
|
|
|
16905
17034
|
return invalidationVersion > 0 ? `${mtime}.${invalidationVersion}` : `${mtime}`;
|
|
16906
17035
|
}, srcUrl = (relPath, projectRoot) => {
|
|
16907
17036
|
const base = `${SRC_PREFIX}${relPath.replace(/\\/g, "/")}`;
|
|
16908
|
-
const absPath =
|
|
17037
|
+
const absPath = resolve31(projectRoot, relPath);
|
|
16909
17038
|
const cached = mtimeCache.get(absPath);
|
|
16910
17039
|
if (cached !== undefined)
|
|
16911
17040
|
return `${base}?v=${buildVersion(cached, absPath)}`;
|
|
@@ -16917,12 +17046,12 @@ ${stubs}
|
|
|
16917
17046
|
return base;
|
|
16918
17047
|
}
|
|
16919
17048
|
}, resolveRelativeImport = (relPath, fileDir, projectRoot, extensions) => {
|
|
16920
|
-
const absPath =
|
|
16921
|
-
const rel =
|
|
17049
|
+
const absPath = resolve31(fileDir, relPath);
|
|
17050
|
+
const rel = relative13(projectRoot, absPath);
|
|
16922
17051
|
const extension = extname8(rel);
|
|
16923
17052
|
let srcPath = RESOLVED_MODULE_EXTENSIONS.has(extension) ? rel : resolveRelativeExtension(rel, projectRoot, extensions);
|
|
16924
17053
|
if (extname8(srcPath) === ".svelte") {
|
|
16925
|
-
srcPath =
|
|
17054
|
+
srcPath = relative13(projectRoot, resolveSvelteModulePath(resolve31(projectRoot, srcPath)));
|
|
16926
17055
|
}
|
|
16927
17056
|
return srcUrl(srcPath, projectRoot);
|
|
16928
17057
|
}, NODE_BUILTIN_RE, resolveAbsoluteSpecifier = (specifier, projectRoot) => {
|
|
@@ -16934,27 +17063,27 @@ ${stubs}
|
|
|
16934
17063
|
"import"
|
|
16935
17064
|
]);
|
|
16936
17065
|
if (fromExports)
|
|
16937
|
-
return
|
|
17066
|
+
return relative13(projectRoot, fromExports);
|
|
16938
17067
|
try {
|
|
16939
17068
|
const isScoped = specifier.startsWith("@");
|
|
16940
17069
|
const parts = specifier.split("/");
|
|
16941
17070
|
const packageName = isScoped ? `${parts[0]}/${parts[1]}` : parts[0];
|
|
16942
17071
|
const subpath = isScoped ? parts.slice(2).join("/") : parts.slice(1).join("/");
|
|
16943
17072
|
if (!subpath) {
|
|
16944
|
-
const pkgDir =
|
|
16945
|
-
const pkgJsonPath =
|
|
17073
|
+
const pkgDir = resolve31(projectRoot, "node_modules", packageName ?? "");
|
|
17074
|
+
const pkgJsonPath = join28(pkgDir, "package.json");
|
|
16946
17075
|
if (existsSync24(pkgJsonPath)) {
|
|
16947
17076
|
const pkg = JSON.parse(readFileSync17(pkgJsonPath, "utf-8"));
|
|
16948
17077
|
const esmEntry = typeof pkg.module === "string" && pkg.module || typeof pkg.browser === "string" && pkg.browser;
|
|
16949
17078
|
if (esmEntry) {
|
|
16950
|
-
const resolved =
|
|
17079
|
+
const resolved = resolve31(pkgDir, esmEntry);
|
|
16951
17080
|
if (existsSync24(resolved))
|
|
16952
|
-
return
|
|
17081
|
+
return relative13(projectRoot, resolved);
|
|
16953
17082
|
}
|
|
16954
17083
|
}
|
|
16955
17084
|
}
|
|
16956
17085
|
} catch {}
|
|
16957
|
-
return
|
|
17086
|
+
return relative13(projectRoot, Bun.resolveSync(specifier, projectRoot));
|
|
16958
17087
|
} catch {
|
|
16959
17088
|
return;
|
|
16960
17089
|
}
|
|
@@ -16979,28 +17108,28 @@ ${stubs}
|
|
|
16979
17108
|
};
|
|
16980
17109
|
result = result.replace(/^((?:import\s+[\s\S]+?\s+from|export\s+[\s\S]+?\s+from|import)\s*["'])([^"'./][^"']*)(["'])/gm, stubReplace);
|
|
16981
17110
|
result = result.replace(/(import\s*\(\s*["'])([^"'./][^"']*)(["']\s*\))/g, stubReplace);
|
|
16982
|
-
const fileDir =
|
|
17111
|
+
const fileDir = dirname17(filePath);
|
|
16983
17112
|
result = result.replace(/(from\s*["'])(\.\.?\/[^"']+)(["'])/g, (_match, prefix, relPath, suffix) => `${prefix}${resolveRelativeImport(relPath, fileDir, projectRoot, IMPORT_EXTENSIONS)}${suffix}`);
|
|
16984
17113
|
result = result.replace(/(import\s*\(\s*["'])(\.\.?\/[^"']+)(["']\s*\))/g, (_match, prefix, relPath, suffix) => `${prefix}${resolveRelativeImport(relPath, fileDir, projectRoot, IMPORT_EXTENSIONS)}${suffix}`);
|
|
16985
17114
|
result = result.replace(/(import\s*["'])(\.\.?\/[^"']+)(["']\s*;?)/g, (_match, prefix, relPath, suffix) => `${prefix}${resolveRelativeImport(relPath, fileDir, projectRoot, SIDE_EFFECT_EXTENSIONS)}${suffix}`);
|
|
16986
17115
|
const rewriteAbsoluteToSrc = (_match, prefix, absPath, _ext, suffix) => {
|
|
16987
17116
|
if (absPath.startsWith(projectRoot)) {
|
|
16988
|
-
const rel2 =
|
|
17117
|
+
const rel2 = relative13(projectRoot, absPath).replace(/\\/g, "/");
|
|
16989
17118
|
return `${prefix}${srcUrl(rel2, projectRoot)}${suffix}`;
|
|
16990
17119
|
}
|
|
16991
|
-
const rel =
|
|
17120
|
+
const rel = relative13(projectRoot, absPath).replace(/\\/g, "/");
|
|
16992
17121
|
return `${prefix}${srcUrl(rel, projectRoot)}${suffix}`;
|
|
16993
17122
|
};
|
|
16994
17123
|
result = result.replace(/((?:from|import)\s*["'])(\/[^"']+\.(tsx?|jsx?|ts))(["'])/g, rewriteAbsoluteToSrc);
|
|
16995
17124
|
result = result.replace(/(import\s*\(\s*["'])(\/[^"']+\.(tsx?|jsx?|ts))(["']\s*\))/g, rewriteAbsoluteToSrc);
|
|
16996
17125
|
result = result.replace(/new\s+URL\(\s*["'](\.\.?\/[^"']+)["']\s*,\s*import\.meta\.url\s*\)/g, (_match, relPath) => {
|
|
16997
|
-
const absPath =
|
|
16998
|
-
const rel =
|
|
17126
|
+
const absPath = resolve31(fileDir, relPath);
|
|
17127
|
+
const rel = relative13(projectRoot, absPath);
|
|
16999
17128
|
return `new URL('${srcUrl(rel, projectRoot)}', import.meta.url)`;
|
|
17000
17129
|
});
|
|
17001
17130
|
result = result.replace(/import\.meta\.resolve\(\s*["'](\.\.?\/[^"']+)["']\s*\)/g, (_match, relPath) => {
|
|
17002
|
-
const absPath =
|
|
17003
|
-
const rel =
|
|
17131
|
+
const absPath = resolve31(fileDir, relPath);
|
|
17132
|
+
const rel = relative13(projectRoot, absPath);
|
|
17004
17133
|
return `'${srcUrl(rel, projectRoot)}'`;
|
|
17005
17134
|
});
|
|
17006
17135
|
return result;
|
|
@@ -17056,7 +17185,7 @@ ${code}`;
|
|
|
17056
17185
|
transpiled = `var $RefreshReg$ = window.$RefreshReg$ || function(){};
|
|
17057
17186
|
` + `var $RefreshSig$ = window.$RefreshSig$ || function(){ return function(t){ return t; }; };
|
|
17058
17187
|
${transpiled}`;
|
|
17059
|
-
const relPath =
|
|
17188
|
+
const relPath = relative13(projectRoot, filePath).replace(/\\/g, "/");
|
|
17060
17189
|
transpiled = transpiled.replace(/\binput\.tsx:/g, `${relPath}:`);
|
|
17061
17190
|
transpiled += buildIslandMetadataExports(raw);
|
|
17062
17191
|
return rewriteImports(transpiled, filePath, projectRoot, rewriter);
|
|
@@ -17065,13 +17194,13 @@ ${transpiled}`;
|
|
|
17065
17194
|
const ext = extname8(filePath);
|
|
17066
17195
|
const isTS = ext === ".ts" || ext === ".tsx";
|
|
17067
17196
|
const isTSX = ext === ".tsx" || ext === ".jsx";
|
|
17068
|
-
let
|
|
17197
|
+
let transpiler6 = jsTranspiler2;
|
|
17069
17198
|
if (isTSX)
|
|
17070
|
-
|
|
17199
|
+
transpiler6 = tsxTranspiler;
|
|
17071
17200
|
else if (isTS)
|
|
17072
|
-
|
|
17073
|
-
const valueExports = isTS ?
|
|
17074
|
-
let transpiled =
|
|
17201
|
+
transpiler6 = tsTranspiler2;
|
|
17202
|
+
const valueExports = isTS ? transpiler6.scan(raw).exports : [];
|
|
17203
|
+
let transpiled = transpiler6.transformSync(raw);
|
|
17075
17204
|
if (isTS) {
|
|
17076
17205
|
transpiled = preserveTypeExports(raw, transpiled, valueExports);
|
|
17077
17206
|
}
|
|
@@ -17217,11 +17346,11 @@ ${code}`;
|
|
|
17217
17346
|
if (compiled.css?.code) {
|
|
17218
17347
|
const cssPath = `${filePath}.css`;
|
|
17219
17348
|
svelteExternalCss.set(cssPath, compiled.css.code);
|
|
17220
|
-
const cssUrl = srcUrl(
|
|
17349
|
+
const cssUrl = srcUrl(relative13(projectRoot, cssPath), projectRoot);
|
|
17221
17350
|
code = `import "${cssUrl}";
|
|
17222
17351
|
${code}`;
|
|
17223
17352
|
}
|
|
17224
|
-
const moduleUrl = `${SRC_PREFIX}${
|
|
17353
|
+
const moduleUrl = `${SRC_PREFIX}${relative13(projectRoot, filePath).replace(/\\/g, "/")}`;
|
|
17225
17354
|
code = code.replace(/if\s*\(import\.meta\.hot\)\s*\{/, `if (typeof window !== "undefined") {
|
|
17226
17355
|
` + ` if (!window.__SVELTE_HMR_ACCEPT__) window.__SVELTE_HMR_ACCEPT__ = {};
|
|
17227
17356
|
` + ` var __hmr_accept = function(cb) { window.__SVELTE_HMR_ACCEPT__[${JSON.stringify(moduleUrl)}] = cb; };`);
|
|
@@ -17247,6 +17376,8 @@ ${code}`;
|
|
|
17247
17376
|
const templateResult = compiler.compileTemplate({
|
|
17248
17377
|
compilerOptions: {
|
|
17249
17378
|
bindingMetadata: compiledScript.bindings,
|
|
17379
|
+
expressionPlugins: ["typescript"],
|
|
17380
|
+
isCustomElement: (tag) => tag === "absolute-island",
|
|
17250
17381
|
prefixIdentifiers: true
|
|
17251
17382
|
},
|
|
17252
17383
|
filename: filePath,
|
|
@@ -17310,8 +17441,8 @@ ${code}`;
|
|
|
17310
17441
|
code = injectVueHmr(code, filePath, projectRoot, vueDir);
|
|
17311
17442
|
return rewriteImports(code, filePath, projectRoot, rewriter);
|
|
17312
17443
|
}, injectVueHmr = (code, filePath, projectRoot, vueDir) => {
|
|
17313
|
-
const hmrBase = vueDir ?
|
|
17314
|
-
const hmrId =
|
|
17444
|
+
const hmrBase = vueDir ? resolve31(vueDir) : projectRoot;
|
|
17445
|
+
const hmrId = relative13(hmrBase, filePath).replace(/\\/g, "/").replace(/\.vue$/, "");
|
|
17315
17446
|
let result = code.replace(/export\s+default\s+/, "var __hmr_comp__ = ");
|
|
17316
17447
|
result += [
|
|
17317
17448
|
"",
|
|
@@ -17474,7 +17605,7 @@ export default {};
|
|
|
17474
17605
|
const escaped = virtualCss.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$/g, "\\$");
|
|
17475
17606
|
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);`);
|
|
17476
17607
|
}, resolveSourcePath = (relPath, projectRoot) => {
|
|
17477
|
-
const filePath =
|
|
17608
|
+
const filePath = resolve31(projectRoot, relPath);
|
|
17478
17609
|
const ext = extname8(filePath);
|
|
17479
17610
|
if (ext === ".svelte")
|
|
17480
17611
|
return { ext, filePath: resolveSvelteModulePath(filePath) };
|
|
@@ -17501,7 +17632,7 @@ export default {};
|
|
|
17501
17632
|
if (!TRANSPILABLE.has(ext))
|
|
17502
17633
|
return;
|
|
17503
17634
|
const stat3 = statSync2(filePath);
|
|
17504
|
-
const resolvedVueDir = vueDir ?
|
|
17635
|
+
const resolvedVueDir = vueDir ? resolve31(vueDir) : undefined;
|
|
17505
17636
|
let content = REACT_EXTENSIONS.has(ext) ? transformReactFile(filePath, projectRoot, rewriter) : transformPlainFile(filePath, projectRoot, rewriter, resolvedVueDir);
|
|
17506
17637
|
const isComponentJs = ext === ".js" && filePath.endsWith(".component.js") && filePath.replace(/\\/g, "/").includes("/.absolutejs/generated/angular/");
|
|
17507
17638
|
if (isComponentJs) {
|
|
@@ -17560,7 +17691,7 @@ export default {};
|
|
|
17560
17691
|
const relPath = pathname.slice(SRC_PREFIX.length);
|
|
17561
17692
|
if (relPath === "bun:wrap" || relPath.startsWith("bun:wrap?"))
|
|
17562
17693
|
return handleBunWrapRequest();
|
|
17563
|
-
const virtualCssResponse = handleVirtualSvelteCss(
|
|
17694
|
+
const virtualCssResponse = handleVirtualSvelteCss(resolve31(projectRoot, relPath));
|
|
17564
17695
|
if (virtualCssResponse)
|
|
17565
17696
|
return virtualCssResponse;
|
|
17566
17697
|
const { filePath, ext } = resolveSourcePath(relPath, projectRoot);
|
|
@@ -17576,11 +17707,11 @@ export default {};
|
|
|
17576
17707
|
SRC_IMPORT_RE.lastIndex = 0;
|
|
17577
17708
|
while ((match = SRC_IMPORT_RE.exec(content)) !== null) {
|
|
17578
17709
|
if (match[1])
|
|
17579
|
-
files.push(
|
|
17710
|
+
files.push(resolve31(projectRoot, match[1]));
|
|
17580
17711
|
}
|
|
17581
17712
|
return files;
|
|
17582
17713
|
}, invalidateModule = (filePath) => {
|
|
17583
|
-
const resolved =
|
|
17714
|
+
const resolved = resolve31(filePath);
|
|
17584
17715
|
invalidate(filePath);
|
|
17585
17716
|
if (resolved !== filePath)
|
|
17586
17717
|
invalidate(resolved);
|
|
@@ -17727,7 +17858,7 @@ __export(exports_resolveOwningComponents, {
|
|
|
17727
17858
|
invalidateResourceIndex: () => invalidateResourceIndex
|
|
17728
17859
|
});
|
|
17729
17860
|
import { readdirSync as readdirSync2, readFileSync as readFileSync18, statSync as statSync3 } from "fs";
|
|
17730
|
-
import { dirname as
|
|
17861
|
+
import { dirname as dirname18, extname as extname9, join as join29, resolve as resolve32 } from "path";
|
|
17731
17862
|
import ts3 from "typescript";
|
|
17732
17863
|
var ENTITY_DECORATORS, isAngularSourceFile = (file4) => file4.endsWith(".ts") || file4.endsWith(".tsx"), walkAngularSourceFiles = (root) => {
|
|
17733
17864
|
const out = [];
|
|
@@ -17742,7 +17873,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file4) => file4.endsWith(".ts") ||
|
|
|
17742
17873
|
if (entry.name.startsWith(".") || entry.name === "node_modules") {
|
|
17743
17874
|
continue;
|
|
17744
17875
|
}
|
|
17745
|
-
const full =
|
|
17876
|
+
const full = join29(dir, entry.name);
|
|
17746
17877
|
if (entry.isDirectory()) {
|
|
17747
17878
|
visit(full);
|
|
17748
17879
|
} else if (entry.isFile() && isAngularSourceFile(entry.name)) {
|
|
@@ -17840,7 +17971,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file4) => file4.endsWith(".ts") ||
|
|
|
17840
17971
|
};
|
|
17841
17972
|
visit(sourceFile);
|
|
17842
17973
|
return out;
|
|
17843
|
-
}, safeNormalize = (path) =>
|
|
17974
|
+
}, safeNormalize = (path) => resolve32(path).replace(/\\/g, "/"), resolveOwningComponents = (params) => {
|
|
17844
17975
|
const { changedFilePath, userAngularRoot } = params;
|
|
17845
17976
|
const changedAbs = safeNormalize(changedFilePath);
|
|
17846
17977
|
const out = [];
|
|
@@ -17881,7 +18012,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file4) => file4.endsWith(".ts") ||
|
|
|
17881
18012
|
return null;
|
|
17882
18013
|
}
|
|
17883
18014
|
const sf = ts3.createSourceFile(childFilePath, source, ts3.ScriptTarget.ES2022, true, ts3.ScriptKind.TS);
|
|
17884
|
-
const childDir =
|
|
18015
|
+
const childDir = dirname18(childFilePath);
|
|
17885
18016
|
for (const stmt of sf.statements) {
|
|
17886
18017
|
if (!ts3.isImportDeclaration(stmt))
|
|
17887
18018
|
continue;
|
|
@@ -17909,7 +18040,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file4) => file4.endsWith(".ts") ||
|
|
|
17909
18040
|
if (!spec.startsWith(".") && !spec.startsWith("/")) {
|
|
17910
18041
|
return null;
|
|
17911
18042
|
}
|
|
17912
|
-
const base =
|
|
18043
|
+
const base = resolve32(childDir, spec);
|
|
17913
18044
|
const candidates = [
|
|
17914
18045
|
`${base}.ts`,
|
|
17915
18046
|
`${base}.tsx`,
|
|
@@ -17938,7 +18069,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file4) => file4.endsWith(".ts") ||
|
|
|
17938
18069
|
const parentFile = new Map;
|
|
17939
18070
|
for (const tsPath of walkAngularSourceFiles(userAngularRoot)) {
|
|
17940
18071
|
const classes = parseDecoratedClasses(tsPath);
|
|
17941
|
-
const componentDir =
|
|
18072
|
+
const componentDir = dirname18(tsPath);
|
|
17942
18073
|
for (const cls of classes) {
|
|
17943
18074
|
const entity = {
|
|
17944
18075
|
className: cls.className,
|
|
@@ -17947,7 +18078,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file4) => file4.endsWith(".ts") ||
|
|
|
17947
18078
|
};
|
|
17948
18079
|
if (cls.kind === "component") {
|
|
17949
18080
|
for (const url of [...cls.templateUrls, ...cls.styleUrls]) {
|
|
17950
|
-
const abs = safeNormalize(
|
|
18081
|
+
const abs = safeNormalize(resolve32(componentDir, url));
|
|
17951
18082
|
const existing = resource.get(abs);
|
|
17952
18083
|
if (existing)
|
|
17953
18084
|
existing.push(entity);
|
|
@@ -18027,8 +18158,6 @@ class Context {
|
|
|
18027
18158
|
}
|
|
18028
18159
|
|
|
18029
18160
|
// src/dev/angular/vendor/translator/translator.ts
|
|
18030
|
-
import * as o from "@angular/compiler";
|
|
18031
|
-
|
|
18032
18161
|
class ExpressionTranslatorVisitor {
|
|
18033
18162
|
factory;
|
|
18034
18163
|
imports;
|
|
@@ -18084,7 +18213,9 @@ class ExpressionTranslatorVisitor {
|
|
|
18084
18213
|
return this.setSourceMapRange(this.factory.createRegularExpressionLiteral(ast.body, ast.flags), ast.sourceSpan);
|
|
18085
18214
|
}
|
|
18086
18215
|
visitLocalizedString(ast, context) {
|
|
18087
|
-
const elements = [
|
|
18216
|
+
const elements = [
|
|
18217
|
+
createTemplateElement(ast.serializeI18nHead())
|
|
18218
|
+
];
|
|
18088
18219
|
const expressions = [];
|
|
18089
18220
|
for (let i = 0;i < ast.expressions.length; i++) {
|
|
18090
18221
|
const placeholder = this.setSourceMapRange(ast.expressions[i].visitExpression(this, context), ast.getPlaceholderSourceSpan(i));
|
|
@@ -18092,7 +18223,10 @@ class ExpressionTranslatorVisitor {
|
|
|
18092
18223
|
elements.push(createTemplateElement(ast.serializeI18nTemplatePart(i + 1)));
|
|
18093
18224
|
}
|
|
18094
18225
|
const localizeTag = this.factory.createIdentifier("$localize");
|
|
18095
|
-
return this.setSourceMapRange(this.createTaggedTemplateExpression(localizeTag, {
|
|
18226
|
+
return this.setSourceMapRange(this.createTaggedTemplateExpression(localizeTag, {
|
|
18227
|
+
elements,
|
|
18228
|
+
expressions
|
|
18229
|
+
}), ast.sourceSpan);
|
|
18096
18230
|
}
|
|
18097
18231
|
visitBuiltinType(ast) {
|
|
18098
18232
|
let builtInType;
|
|
@@ -18149,7 +18283,10 @@ class ExpressionTranslatorVisitor {
|
|
|
18149
18283
|
cooked.push(this.factory.setSourceMapRange(this.factory.createLiteral(element.cooked), element.range));
|
|
18150
18284
|
raw.push(this.factory.setSourceMapRange(this.factory.createLiteral(element.raw), element.range));
|
|
18151
18285
|
}
|
|
18152
|
-
const templateHelperCall = this.factory.createCallExpression(__makeTemplateObjectHelper, [
|
|
18286
|
+
const templateHelperCall = this.factory.createCallExpression(__makeTemplateObjectHelper, [
|
|
18287
|
+
this.factory.createArrayLiteral(cooked),
|
|
18288
|
+
this.factory.createArrayLiteral(raw)
|
|
18289
|
+
], false);
|
|
18153
18290
|
return this.factory.createCallExpression(tagHandler, [templateHelperCall, ...expressions], false);
|
|
18154
18291
|
}
|
|
18155
18292
|
visitExternalExpr(ast, _context) {
|
|
@@ -18179,7 +18316,9 @@ class ExpressionTranslatorVisitor {
|
|
|
18179
18316
|
visitDynamicImportExpr(ast, context) {
|
|
18180
18317
|
const urlExpression = typeof ast.url === "string" ? this.factory.createLiteral(ast.url) : ast.url.visitExpression(this, context);
|
|
18181
18318
|
if (ast.urlComment) {
|
|
18182
|
-
this.factory.attachComments(urlExpression, [
|
|
18319
|
+
this.factory.attachComments(urlExpression, [
|
|
18320
|
+
o.leadingComment(ast.urlComment, true)
|
|
18321
|
+
]);
|
|
18183
18322
|
}
|
|
18184
18323
|
return this.factory.createDynamicImport(urlExpression);
|
|
18185
18324
|
}
|
|
@@ -18319,8 +18458,16 @@ function createRange(span) {
|
|
|
18319
18458
|
end: { offset: end.offset, line: end.line, column: end.col }
|
|
18320
18459
|
};
|
|
18321
18460
|
}
|
|
18322
|
-
var UNARY_OPERATORS, BINARY_OPERATORS;
|
|
18461
|
+
var o, UNARY_OPERATORS, BINARY_OPERATORS;
|
|
18323
18462
|
var init_translator = __esm(() => {
|
|
18463
|
+
o = (() => {
|
|
18464
|
+
try {
|
|
18465
|
+
return __require("@angular/compiler");
|
|
18466
|
+
} catch {
|
|
18467
|
+
const stub = new Proxy(function() {}, { apply: () => stub, construct: () => stub, get: () => stub });
|
|
18468
|
+
return stub;
|
|
18469
|
+
}
|
|
18470
|
+
})();
|
|
18324
18471
|
UNARY_OPERATORS = /* @__PURE__ */ new Map([
|
|
18325
18472
|
[o.UnaryOperator.Minus, "-"],
|
|
18326
18473
|
[o.UnaryOperator.Plus, "+"]
|
|
@@ -18455,7 +18602,9 @@ class TypeScriptAstFactory {
|
|
|
18455
18602
|
createElementAccess = ts6.factory.createElementAccessExpression;
|
|
18456
18603
|
createExpressionStatement = ts6.factory.createExpressionStatement;
|
|
18457
18604
|
createDynamicImport(url) {
|
|
18458
|
-
return ts6.factory.createCallExpression(ts6.factory.createToken(ts6.SyntaxKind.ImportKeyword), undefined, [
|
|
18605
|
+
return ts6.factory.createCallExpression(ts6.factory.createToken(ts6.SyntaxKind.ImportKeyword), undefined, [
|
|
18606
|
+
typeof url === "string" ? ts6.factory.createStringLiteral(url) : url
|
|
18607
|
+
]);
|
|
18459
18608
|
}
|
|
18460
18609
|
createFunctionDeclaration(functionName, parameters, body) {
|
|
18461
18610
|
if (!ts6.isBlock(body)) {
|
|
@@ -18658,9 +18807,18 @@ var init_typescript_ast_factory = __esm(() => {
|
|
|
18658
18807
|
function translateStatement(contextFile, statement, imports, options = {}) {
|
|
18659
18808
|
return statement.visitStatement(new ExpressionTranslatorVisitor(new TypeScriptAstFactory(options.annotateForClosureCompiler === true), imports, contextFile, options), new Context(true));
|
|
18660
18809
|
}
|
|
18810
|
+
var o2;
|
|
18661
18811
|
var init_typescript_translator = __esm(() => {
|
|
18662
18812
|
init_translator();
|
|
18663
18813
|
init_typescript_ast_factory();
|
|
18814
|
+
o2 = (() => {
|
|
18815
|
+
try {
|
|
18816
|
+
return __require("@angular/compiler");
|
|
18817
|
+
} catch {
|
|
18818
|
+
const stub = new Proxy(function() {}, { apply: () => stub, construct: () => stub, get: () => stub });
|
|
18819
|
+
return stub;
|
|
18820
|
+
}
|
|
18821
|
+
})();
|
|
18664
18822
|
});
|
|
18665
18823
|
|
|
18666
18824
|
// src/dev/angular/fastHmrCompiler.ts
|
|
@@ -18672,7 +18830,7 @@ __export(exports_fastHmrCompiler, {
|
|
|
18672
18830
|
invalidateFingerprintCache: () => invalidateFingerprintCache
|
|
18673
18831
|
});
|
|
18674
18832
|
import { existsSync as existsSync25, readFileSync as readFileSync19, statSync as statSync4 } from "fs";
|
|
18675
|
-
import { dirname as
|
|
18833
|
+
import { dirname as dirname19, extname as extname10, relative as relative14, resolve as resolve33 } from "path";
|
|
18676
18834
|
import ts7 from "typescript";
|
|
18677
18835
|
var fail = (reason, detail, location) => ({
|
|
18678
18836
|
ok: false,
|
|
@@ -18894,7 +19052,7 @@ var fail = (reason, detail, location) => ({
|
|
|
18894
19052
|
if (!spec.startsWith(".") && !spec.startsWith("/")) {
|
|
18895
19053
|
return true;
|
|
18896
19054
|
}
|
|
18897
|
-
const base =
|
|
19055
|
+
const base = resolve33(componentDir, spec);
|
|
18898
19056
|
const candidates = [
|
|
18899
19057
|
`${base}.ts`,
|
|
18900
19058
|
`${base}.tsx`,
|
|
@@ -19469,7 +19627,10 @@ var fail = (reason, detail, location) => ({
|
|
|
19469
19627
|
try {
|
|
19470
19628
|
source = readFileSync19(filePath, "utf-8");
|
|
19471
19629
|
} catch {
|
|
19472
|
-
childComponentInfoCache.set(cacheKey2, {
|
|
19630
|
+
childComponentInfoCache.set(cacheKey2, {
|
|
19631
|
+
info: null,
|
|
19632
|
+
mtimeMs: stat3.mtimeMs
|
|
19633
|
+
});
|
|
19473
19634
|
return null;
|
|
19474
19635
|
}
|
|
19475
19636
|
const sf = ts7.createSourceFile(filePath, source, ts7.ScriptTarget.Latest, true);
|
|
@@ -19657,7 +19818,7 @@ var fail = (reason, detail, location) => ({
|
|
|
19657
19818
|
});
|
|
19658
19819
|
if (!names.includes(className))
|
|
19659
19820
|
continue;
|
|
19660
|
-
const nextDts = resolveDtsFromSpec(fromPath,
|
|
19821
|
+
const nextDts = resolveDtsFromSpec(fromPath, dirname19(startDtsPath));
|
|
19661
19822
|
if (!nextDts)
|
|
19662
19823
|
continue;
|
|
19663
19824
|
const found = findDtsContainingClass(nextDts, className, visited);
|
|
@@ -19667,7 +19828,7 @@ var fail = (reason, detail, location) => ({
|
|
|
19667
19828
|
const starReExportRe = /export\s*\*\s*from\s*["']([^"']+)["']/g;
|
|
19668
19829
|
while ((m = starReExportRe.exec(content)) !== null) {
|
|
19669
19830
|
const fromPath = m[1] || "";
|
|
19670
|
-
const nextDts = resolveDtsFromSpec(fromPath,
|
|
19831
|
+
const nextDts = resolveDtsFromSpec(fromPath, dirname19(startDtsPath));
|
|
19671
19832
|
if (!nextDts)
|
|
19672
19833
|
continue;
|
|
19673
19834
|
const found = findDtsContainingClass(nextDts, className, visited);
|
|
@@ -19677,7 +19838,7 @@ var fail = (reason, detail, location) => ({
|
|
|
19677
19838
|
return null;
|
|
19678
19839
|
}, resolveDtsFromSpec = (spec, fromDir) => {
|
|
19679
19840
|
const stripped = spec.replace(/\.[mc]?js$/, "");
|
|
19680
|
-
const base =
|
|
19841
|
+
const base = resolve33(fromDir, stripped);
|
|
19681
19842
|
const candidates = [
|
|
19682
19843
|
`${base}.d.ts`,
|
|
19683
19844
|
`${base}.d.mts`,
|
|
@@ -19701,7 +19862,7 @@ var fail = (reason, detail, location) => ({
|
|
|
19701
19862
|
return null;
|
|
19702
19863
|
}, resolveChildComponentInfo = (className, spec, componentDir, projectRoot) => {
|
|
19703
19864
|
if (spec.startsWith(".") || spec.startsWith("/")) {
|
|
19704
|
-
const base =
|
|
19865
|
+
const base = resolve33(componentDir, spec);
|
|
19705
19866
|
const candidates = [
|
|
19706
19867
|
`${base}.ts`,
|
|
19707
19868
|
`${base}.tsx`,
|
|
@@ -19871,13 +20032,13 @@ var fail = (reason, detail, location) => ({
|
|
|
19871
20032
|
}
|
|
19872
20033
|
if (!matches)
|
|
19873
20034
|
continue;
|
|
19874
|
-
const resolved =
|
|
20035
|
+
const resolved = resolve33(componentDir, spec);
|
|
19875
20036
|
for (const ext of TS_EXTENSIONS) {
|
|
19876
20037
|
const candidate = resolved + ext;
|
|
19877
20038
|
if (existsSync25(candidate))
|
|
19878
20039
|
return candidate;
|
|
19879
20040
|
}
|
|
19880
|
-
const indexCandidate =
|
|
20041
|
+
const indexCandidate = resolve33(resolved, "index.ts");
|
|
19881
20042
|
if (existsSync25(indexCandidate))
|
|
19882
20043
|
return indexCandidate;
|
|
19883
20044
|
}
|
|
@@ -20064,7 +20225,7 @@ ${transpiled}
|
|
|
20064
20225
|
}
|
|
20065
20226
|
}${staticPatch}`;
|
|
20066
20227
|
}, STYLE_PREPROCESSED_EXT, resolveAndReadStyleResource = (componentDir, url) => {
|
|
20067
|
-
const abs =
|
|
20228
|
+
const abs = resolve33(componentDir, url);
|
|
20068
20229
|
if (!existsSync25(abs))
|
|
20069
20230
|
return null;
|
|
20070
20231
|
const ext = extname10(abs).toLowerCase();
|
|
@@ -20104,7 +20265,7 @@ ${block}
|
|
|
20104
20265
|
const cached = projectOptionsCache.get(projectRoot);
|
|
20105
20266
|
if (cached !== undefined)
|
|
20106
20267
|
return cached;
|
|
20107
|
-
const tsconfigPath =
|
|
20268
|
+
const tsconfigPath = resolve33(projectRoot, "tsconfig.json");
|
|
20108
20269
|
const opts = {};
|
|
20109
20270
|
if (existsSync25(tsconfigPath)) {
|
|
20110
20271
|
try {
|
|
@@ -20150,7 +20311,7 @@ ${block}
|
|
|
20150
20311
|
}
|
|
20151
20312
|
const kind = params.kind ?? "component";
|
|
20152
20313
|
if (kind !== "component") {
|
|
20153
|
-
const entityId = encodeURIComponent(`${
|
|
20314
|
+
const entityId = encodeURIComponent(`${relative14(projectRoot, componentFilePath).replace(/\\/g, "/")}@${className}`);
|
|
20154
20315
|
const currentEntityFingerprint = extractEntityFingerprint(classNode, className, sourceFile);
|
|
20155
20316
|
const cachedEntityFingerprint = entityFingerprintCache.get(entityId);
|
|
20156
20317
|
if (cachedEntityFingerprint !== undefined && !entityFingerprintsEqual(cachedEntityFingerprint, currentEntityFingerprint)) {
|
|
@@ -20168,7 +20329,7 @@ ${block}
|
|
|
20168
20329
|
ok: true
|
|
20169
20330
|
};
|
|
20170
20331
|
}
|
|
20171
|
-
if (inheritsDecoratedClass(classNode, sourceFile,
|
|
20332
|
+
if (inheritsDecoratedClass(classNode, sourceFile, dirname19(componentFilePath), projectRoot)) {
|
|
20172
20333
|
return fail("inherits-decorated-class");
|
|
20173
20334
|
}
|
|
20174
20335
|
const decorator = findComponentDecorator(classNode);
|
|
@@ -20180,14 +20341,14 @@ ${block}
|
|
|
20180
20341
|
const projectDefaults = readProjectAngularCompilerOptions(projectRoot);
|
|
20181
20342
|
const decoratorMeta = readDecoratorMeta(decoratorArgs, projectDefaults);
|
|
20182
20343
|
const advancedMetadata = extractAdvancedMetadata(classNode, decoratorArgs, compiler);
|
|
20183
|
-
const componentDir =
|
|
20344
|
+
const componentDir = dirname19(componentFilePath);
|
|
20184
20345
|
let templateText;
|
|
20185
20346
|
let templatePath;
|
|
20186
20347
|
if (decoratorMeta.template !== null) {
|
|
20187
20348
|
templateText = decoratorMeta.template;
|
|
20188
20349
|
templatePath = componentFilePath;
|
|
20189
20350
|
} else if (decoratorMeta.templateUrl) {
|
|
20190
|
-
const tplAbs =
|
|
20351
|
+
const tplAbs = resolve33(componentDir, decoratorMeta.templateUrl);
|
|
20191
20352
|
if (!existsSync25(tplAbs)) {
|
|
20192
20353
|
return fail("template-resource-not-found", `Template file not found: ${tplAbs}`, { file: componentFilePath });
|
|
20193
20354
|
}
|
|
@@ -20232,13 +20393,8 @@ ${block}
|
|
|
20232
20393
|
if (!className_)
|
|
20233
20394
|
return fail("class-not-found", "anonymous class");
|
|
20234
20395
|
const wrappedClass = new compiler.WrappedNodeExpr(className_);
|
|
20235
|
-
const {
|
|
20236
|
-
|
|
20237
|
-
outputs,
|
|
20238
|
-
hasDecoratorIO,
|
|
20239
|
-
hasSignalIO
|
|
20240
|
-
} = extractInputsAndOutputs(classNode, compiler);
|
|
20241
|
-
const projectRelPath = relative13(projectRoot, componentFilePath).replace(/\\/g, "/");
|
|
20396
|
+
const { inputs, outputs, hasDecoratorIO, hasSignalIO } = extractInputsAndOutputs(classNode, compiler);
|
|
20397
|
+
const projectRelPath = relative14(projectRoot, componentFilePath).replace(/\\/g, "/");
|
|
20242
20398
|
const fingerprintId = encodeURIComponent(`${projectRelPath}@${className}`);
|
|
20243
20399
|
const currentFingerprint = extractFingerprint(classNode, className, decoratorMeta, inputs, outputs, sourceFile, componentDir);
|
|
20244
20400
|
const cachedFingerprint = fingerprintCache.get(fingerprintId);
|
|
@@ -20441,11 +20597,7 @@ var init_fastHmrCompiler = __esm(() => {
|
|
|
20441
20597
|
fingerprintCache = new Map;
|
|
20442
20598
|
pendingModuleCache = new Map;
|
|
20443
20599
|
entityFingerprintCache = new Map;
|
|
20444
|
-
ENTITY_DECORATOR_NAMES = new Set([
|
|
20445
|
-
"Pipe",
|
|
20446
|
-
"Directive",
|
|
20447
|
-
"Injectable"
|
|
20448
|
-
]);
|
|
20600
|
+
ENTITY_DECORATOR_NAMES = new Set(["Pipe", "Directive", "Injectable"]);
|
|
20449
20601
|
VIEW_ENCAPSULATION_VALUES = {
|
|
20450
20602
|
Emulated: 0,
|
|
20451
20603
|
ExperimentalIsolatedShadowDom: 4,
|
|
@@ -20492,7 +20644,7 @@ __export(exports_hmrCompiler, {
|
|
|
20492
20644
|
getApplyMetadataModule: () => getApplyMetadataModule,
|
|
20493
20645
|
encodeHmrComponentId: () => encodeHmrComponentId
|
|
20494
20646
|
});
|
|
20495
|
-
import { dirname as
|
|
20647
|
+
import { dirname as dirname20, relative as relative15, resolve as resolve34 } from "path";
|
|
20496
20648
|
import { performance as performance2 } from "perf_hooks";
|
|
20497
20649
|
var getApplyMetadataModule = async (encodedId) => {
|
|
20498
20650
|
const decoded = decodeURIComponent(encodedId);
|
|
@@ -20501,8 +20653,8 @@ var getApplyMetadataModule = async (encodedId) => {
|
|
|
20501
20653
|
return null;
|
|
20502
20654
|
const filePathRel = decoded.slice(0, at2);
|
|
20503
20655
|
const className = decoded.slice(at2 + 1);
|
|
20504
|
-
const componentFilePath =
|
|
20505
|
-
const projectRelPath =
|
|
20656
|
+
const componentFilePath = resolve34(process.cwd(), filePathRel);
|
|
20657
|
+
const projectRelPath = relative15(process.cwd(), componentFilePath).replace(/\\/g, "/");
|
|
20506
20658
|
const cacheKey2 = encodeURIComponent(`${projectRelPath}@${className}`);
|
|
20507
20659
|
const { takePendingModule: takePendingModule2 } = await Promise.resolve().then(() => (init_fastHmrCompiler(), exports_fastHmrCompiler));
|
|
20508
20660
|
const cached = takePendingModule2(cacheKey2);
|
|
@@ -20512,9 +20664,9 @@ var getApplyMetadataModule = async (encodedId) => {
|
|
|
20512
20664
|
const { resolveOwningComponents: resolveOwningComponents2 } = await Promise.resolve().then(() => (init_resolveOwningComponents(), exports_resolveOwningComponents));
|
|
20513
20665
|
const owners = resolveOwningComponents2({
|
|
20514
20666
|
changedFilePath: componentFilePath,
|
|
20515
|
-
userAngularRoot:
|
|
20667
|
+
userAngularRoot: dirname20(componentFilePath)
|
|
20516
20668
|
});
|
|
20517
|
-
const owner = owners.find((
|
|
20669
|
+
const owner = owners.find((o3) => o3.className === className);
|
|
20518
20670
|
const kind = owner?.kind ?? "component";
|
|
20519
20671
|
const fastStart = performance2.now();
|
|
20520
20672
|
const fast = await tryFastHmr({ className, componentFilePath, kind });
|
|
@@ -20524,7 +20676,7 @@ var getApplyMetadataModule = async (encodedId) => {
|
|
|
20524
20676
|
}
|
|
20525
20677
|
return null;
|
|
20526
20678
|
}, encodeHmrComponentId = (absoluteFilePath, className) => {
|
|
20527
|
-
const projectRel =
|
|
20679
|
+
const projectRel = relative15(process.cwd(), absoluteFilePath).replace(/\\/g, "/");
|
|
20528
20680
|
return `${projectRel}@${className}`;
|
|
20529
20681
|
};
|
|
20530
20682
|
var init_hmrCompiler = __esm(() => {
|
|
@@ -20663,11 +20815,11 @@ var exports_simpleHTMLHMR = {};
|
|
|
20663
20815
|
__export(exports_simpleHTMLHMR, {
|
|
20664
20816
|
handleHTMLUpdate: () => handleHTMLUpdate
|
|
20665
20817
|
});
|
|
20666
|
-
import { resolve as
|
|
20818
|
+
import { resolve as resolve35 } from "path";
|
|
20667
20819
|
var handleHTMLUpdate = async (htmlFilePath) => {
|
|
20668
20820
|
let htmlContent;
|
|
20669
20821
|
try {
|
|
20670
|
-
const resolvedPath =
|
|
20822
|
+
const resolvedPath = resolve35(htmlFilePath);
|
|
20671
20823
|
const file4 = Bun.file(resolvedPath);
|
|
20672
20824
|
if (!await file4.exists()) {
|
|
20673
20825
|
return null;
|
|
@@ -20693,11 +20845,11 @@ var exports_simpleHTMXHMR = {};
|
|
|
20693
20845
|
__export(exports_simpleHTMXHMR, {
|
|
20694
20846
|
handleHTMXUpdate: () => handleHTMXUpdate
|
|
20695
20847
|
});
|
|
20696
|
-
import { resolve as
|
|
20848
|
+
import { resolve as resolve36 } from "path";
|
|
20697
20849
|
var handleHTMXUpdate = async (htmxFilePath) => {
|
|
20698
20850
|
let htmlContent;
|
|
20699
20851
|
try {
|
|
20700
|
-
const resolvedPath =
|
|
20852
|
+
const resolvedPath = resolve36(htmxFilePath);
|
|
20701
20853
|
const file4 = Bun.file(resolvedPath);
|
|
20702
20854
|
if (!await file4.exists()) {
|
|
20703
20855
|
return null;
|
|
@@ -20720,7 +20872,7 @@ var init_simpleHTMXHMR = () => {};
|
|
|
20720
20872
|
|
|
20721
20873
|
// src/dev/rebuildTrigger.ts
|
|
20722
20874
|
import { existsSync as existsSync26 } from "fs";
|
|
20723
|
-
import { basename as basename11, dirname as
|
|
20875
|
+
import { basename as basename11, dirname as dirname21, relative as relative16, resolve as resolve37, sep as sep4 } from "path";
|
|
20724
20876
|
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) => {
|
|
20725
20877
|
if (!config.tailwind)
|
|
20726
20878
|
return;
|
|
@@ -20812,7 +20964,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
20812
20964
|
state.fileHashes.delete(filePathInSet);
|
|
20813
20965
|
try {
|
|
20814
20966
|
const affectedFiles = getAffectedFiles(state.dependencyGraph, filePathInSet);
|
|
20815
|
-
const deletedPathResolved =
|
|
20967
|
+
const deletedPathResolved = resolve37(filePathInSet);
|
|
20816
20968
|
affectedFiles.forEach((affectedFile) => {
|
|
20817
20969
|
if (isValidDeletedAffectedFile(affectedFile, deletedPathResolved, processedFiles)) {
|
|
20818
20970
|
validFiles.push(affectedFile);
|
|
@@ -20856,7 +21008,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
20856
21008
|
if (storedHash !== undefined && storedHash === fileHash) {
|
|
20857
21009
|
return;
|
|
20858
21010
|
}
|
|
20859
|
-
const normalizedFilePath =
|
|
21011
|
+
const normalizedFilePath = resolve37(filePathInSet);
|
|
20860
21012
|
if (!processedFiles.has(normalizedFilePath)) {
|
|
20861
21013
|
validFiles.push(normalizedFilePath);
|
|
20862
21014
|
processedFiles.add(normalizedFilePath);
|
|
@@ -20960,8 +21112,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
20960
21112
|
return;
|
|
20961
21113
|
}
|
|
20962
21114
|
if (framework === "unknown") {
|
|
20963
|
-
invalidate(
|
|
20964
|
-
const relPath =
|
|
21115
|
+
invalidate(resolve37(filePath));
|
|
21116
|
+
const relPath = relative16(process.cwd(), filePath);
|
|
20965
21117
|
logHmrUpdate(relPath);
|
|
20966
21118
|
return;
|
|
20967
21119
|
}
|
|
@@ -20987,7 +21139,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
20987
21139
|
const userEditedFiles = new Set;
|
|
20988
21140
|
state.fileChangeQueue.forEach((filePaths) => {
|
|
20989
21141
|
for (const filePath2 of filePaths) {
|
|
20990
|
-
userEditedFiles.add(
|
|
21142
|
+
userEditedFiles.add(resolve37(filePath2));
|
|
20991
21143
|
}
|
|
20992
21144
|
});
|
|
20993
21145
|
state.lastUserEditedFiles = userEditedFiles;
|
|
@@ -21016,7 +21168,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
21016
21168
|
}
|
|
21017
21169
|
if (!graph)
|
|
21018
21170
|
return componentFile;
|
|
21019
|
-
const dependents = graph.dependents.get(
|
|
21171
|
+
const dependents = graph.dependents.get(resolve37(componentFile));
|
|
21020
21172
|
if (!dependents)
|
|
21021
21173
|
return componentFile;
|
|
21022
21174
|
for (const dep of dependents) {
|
|
@@ -21025,7 +21177,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
21025
21177
|
}
|
|
21026
21178
|
return componentFile;
|
|
21027
21179
|
}, resolveAngularPageEntries = (state, angularFiles, angularPagesPath) => {
|
|
21028
|
-
const pageEntries = angularFiles.filter((file4) => file4.endsWith(".ts") &&
|
|
21180
|
+
const pageEntries = angularFiles.filter((file4) => file4.endsWith(".ts") && resolve37(file4).startsWith(angularPagesPath));
|
|
21029
21181
|
if (pageEntries.length > 0 || !state.dependencyGraph) {
|
|
21030
21182
|
return pageEntries;
|
|
21031
21183
|
}
|
|
@@ -21034,7 +21186,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
21034
21186
|
const lookupFile = resolveComponentLookupFile(componentFile, state.dependencyGraph);
|
|
21035
21187
|
const affected = getAffectedFiles(state.dependencyGraph, lookupFile);
|
|
21036
21188
|
affected.forEach((file4) => {
|
|
21037
|
-
if (file4.endsWith(".ts") &&
|
|
21189
|
+
if (file4.endsWith(".ts") && resolve37(file4).startsWith(angularPagesPath)) {
|
|
21038
21190
|
resolvedPages.add(file4);
|
|
21039
21191
|
}
|
|
21040
21192
|
});
|
|
@@ -21306,16 +21458,16 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
21306
21458
|
};
|
|
21307
21459
|
const fire = () => {
|
|
21308
21460
|
ctx.debounceTimer = null;
|
|
21309
|
-
const
|
|
21461
|
+
const resolve38 = ctx.debouncedResolve;
|
|
21310
21462
|
ctx.debouncedResolve = null;
|
|
21311
21463
|
ctx.debouncedPromise = null;
|
|
21312
21464
|
if (ctx.inFlight) {
|
|
21313
21465
|
ctx.pending = true;
|
|
21314
|
-
ctx.inFlight.finally(() =>
|
|
21466
|
+
ctx.inFlight.finally(() => resolve38?.());
|
|
21315
21467
|
return;
|
|
21316
21468
|
}
|
|
21317
21469
|
ctx.inFlight = drive();
|
|
21318
|
-
ctx.inFlight.finally(() =>
|
|
21470
|
+
ctx.inFlight.finally(() => resolve38?.());
|
|
21319
21471
|
};
|
|
21320
21472
|
return ({ immediate = false } = {}) => {
|
|
21321
21473
|
if (!ctx.debouncedPromise) {
|
|
@@ -21342,9 +21494,9 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
21342
21494
|
const diskRefreshPromise = (async () => {
|
|
21343
21495
|
if (!angularDir || editedFiles.size === 0)
|
|
21344
21496
|
return;
|
|
21345
|
-
const angularDirAbs =
|
|
21497
|
+
const angularDirAbs = resolve37(angularDir);
|
|
21346
21498
|
const filesUnderAngular = Array.from(editedFiles).filter((file4) => {
|
|
21347
|
-
const abs =
|
|
21499
|
+
const abs = resolve37(file4);
|
|
21348
21500
|
return abs === angularDirAbs || abs.startsWith(angularDirAbs + sep4);
|
|
21349
21501
|
});
|
|
21350
21502
|
if (filesUnderAngular.length === 0)
|
|
@@ -21366,7 +21518,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
21366
21518
|
if (!ext)
|
|
21367
21519
|
continue;
|
|
21368
21520
|
if (ext === ".ts" || ext === ".tsx") {
|
|
21369
|
-
tsFilesToRefresh.add(
|
|
21521
|
+
tsFilesToRefresh.add(resolve37(file4));
|
|
21370
21522
|
continue;
|
|
21371
21523
|
}
|
|
21372
21524
|
const owners = resolveOwningComponents2({
|
|
@@ -21374,7 +21526,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
21374
21526
|
userAngularRoot: angularDirAbs
|
|
21375
21527
|
});
|
|
21376
21528
|
for (const owner of owners) {
|
|
21377
|
-
tsFilesToRefresh.add(
|
|
21529
|
+
tsFilesToRefresh.add(resolve37(owner.componentFilePath));
|
|
21378
21530
|
}
|
|
21379
21531
|
}
|
|
21380
21532
|
if (tsFilesToRefresh.size === 0)
|
|
@@ -21385,8 +21537,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
21385
21537
|
try {
|
|
21386
21538
|
const { invalidateModule: invalidateModule2 } = await Promise.resolve().then(() => (init_moduleServer(), exports_moduleServer));
|
|
21387
21539
|
for (const tsFile of tsFilesToRefresh) {
|
|
21388
|
-
const rel =
|
|
21389
|
-
const compiledFile =
|
|
21540
|
+
const rel = relative16(angularDirAbs, tsFile).replace(/\\/g, "/").replace(/\.[tj]sx?$/, ".js");
|
|
21541
|
+
const compiledFile = resolve37(compiledRoot, rel);
|
|
21390
21542
|
invalidateModule2(compiledFile);
|
|
21391
21543
|
}
|
|
21392
21544
|
} catch {}
|
|
@@ -21415,7 +21567,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
21415
21567
|
serverPaths.forEach((serverPath, idx) => {
|
|
21416
21568
|
const fileBase = basename11(serverPath, ".js");
|
|
21417
21569
|
const ssrPath = ssrPaths[idx] ?? serverPath;
|
|
21418
|
-
state.manifest[toPascal(fileBase)] =
|
|
21570
|
+
state.manifest[toPascal(fileBase)] = resolve37(ssrPath);
|
|
21419
21571
|
});
|
|
21420
21572
|
if (clientPaths.length > 0) {
|
|
21421
21573
|
await bundleAngularClient(state, clientPaths, state.resolvedPaths.buildDir, angularDir);
|
|
@@ -21424,9 +21576,9 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
21424
21576
|
const angularDir = config.angularDirectory ?? "";
|
|
21425
21577
|
const angularFiles = filesToRebuild.filter((file4) => detectFramework(file4, state.resolvedPaths) === "angular");
|
|
21426
21578
|
for (const file4 of angularFiles) {
|
|
21427
|
-
state.fileHashes.set(
|
|
21579
|
+
state.fileHashes.set(resolve37(file4), computeFileHash(file4));
|
|
21428
21580
|
}
|
|
21429
|
-
const angularPagesPath =
|
|
21581
|
+
const angularPagesPath = resolve37(angularDir, "pages");
|
|
21430
21582
|
const pageEntries = resolveAngularPageEntries(state, angularFiles, angularPagesPath);
|
|
21431
21583
|
const tierStart = performance.now();
|
|
21432
21584
|
const verdict = await decideAngularTier(state, angularDir);
|
|
@@ -21456,7 +21608,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
21456
21608
|
}, getModuleUrl = async (pageFile) => {
|
|
21457
21609
|
const { invalidateModule: invalidateModule2, warmCache: warmCache2, SRC_URL_PREFIX: SRC_URL_PREFIX2 } = await Promise.resolve().then(() => (init_moduleServer(), exports_moduleServer));
|
|
21458
21610
|
invalidateModule2(pageFile);
|
|
21459
|
-
const rel =
|
|
21611
|
+
const rel = relative16(process.cwd(), pageFile).replace(/\\/g, "/");
|
|
21460
21612
|
const url = `${SRC_URL_PREFIX2}${rel}`;
|
|
21461
21613
|
warmCache2(url);
|
|
21462
21614
|
return url;
|
|
@@ -21465,11 +21617,11 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
21465
21617
|
if (isComponentFile2)
|
|
21466
21618
|
return primaryFile;
|
|
21467
21619
|
const { findNearestComponent: findNearestComponent2 } = await Promise.resolve().then(() => (init_transformCache(), exports_transformCache));
|
|
21468
|
-
const nearest = findNearestComponent2(
|
|
21620
|
+
const nearest = findNearestComponent2(resolve37(primaryFile));
|
|
21469
21621
|
return nearest ?? primaryFile;
|
|
21470
21622
|
}, handleReactModuleServerPath = async (state, reactFiles, startTime, onRebuildComplete) => {
|
|
21471
21623
|
for (const file4 of reactFiles) {
|
|
21472
|
-
state.fileHashes.set(
|
|
21624
|
+
state.fileHashes.set(resolve37(file4), computeFileHash(file4));
|
|
21473
21625
|
}
|
|
21474
21626
|
markSsrCacheDirty("react");
|
|
21475
21627
|
const primaryFile = reactFiles.find((file4) => !file4.replace(/\\/g, "/").includes("/pages/")) ?? reactFiles[0];
|
|
@@ -21488,7 +21640,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
21488
21640
|
const pageModuleUrl = await getReactModuleUrl(broadcastTarget);
|
|
21489
21641
|
if (pageModuleUrl) {
|
|
21490
21642
|
const serverDuration = Date.now() - startTime;
|
|
21491
|
-
state.lastHmrPath =
|
|
21643
|
+
state.lastHmrPath = relative16(process.cwd(), primaryFile).replace(/\\/g, "/");
|
|
21492
21644
|
state.lastHmrFramework = "react";
|
|
21493
21645
|
broadcastToClients(state, {
|
|
21494
21646
|
data: {
|
|
@@ -21551,7 +21703,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
21551
21703
|
});
|
|
21552
21704
|
}, handleSvelteModuleServerPath = async (state, svelteFiles, startTime, onRebuildComplete) => {
|
|
21553
21705
|
for (const file4 of svelteFiles) {
|
|
21554
|
-
state.fileHashes.set(
|
|
21706
|
+
state.fileHashes.set(resolve37(file4), computeFileHash(file4));
|
|
21555
21707
|
}
|
|
21556
21708
|
markSsrCacheDirty("svelte");
|
|
21557
21709
|
const serverDuration = Date.now() - startTime;
|
|
@@ -21576,8 +21728,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
21576
21728
|
const serverEntries = [...svelteServerPaths];
|
|
21577
21729
|
const clientEntries = [...svelteIndexPaths, ...svelteClientPaths];
|
|
21578
21730
|
const { getFrameworkGeneratedDir: getFrameworkGeneratedDir2 } = await Promise.resolve().then(() => (init_generatedDir(), exports_generatedDir));
|
|
21579
|
-
const serverRoot =
|
|
21580
|
-
const serverOutDir =
|
|
21731
|
+
const serverRoot = resolve37(getFrameworkGeneratedDir2("svelte"), "server");
|
|
21732
|
+
const serverOutDir = resolve37(buildDir, basename11(svelteDir));
|
|
21581
21733
|
const [serverResult, clientResult] = await Promise.all([
|
|
21582
21734
|
serverEntries.length > 0 ? bunBuild9({
|
|
21583
21735
|
entrypoints: serverEntries,
|
|
@@ -21674,7 +21826,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
21674
21826
|
});
|
|
21675
21827
|
}, handleVueModuleServerPath = async (state, vueFiles, nonVueFiles, startTime, onRebuildComplete) => {
|
|
21676
21828
|
for (const file4 of [...vueFiles, ...nonVueFiles]) {
|
|
21677
|
-
state.fileHashes.set(
|
|
21829
|
+
state.fileHashes.set(resolve37(file4), computeFileHash(file4));
|
|
21678
21830
|
}
|
|
21679
21831
|
markSsrCacheDirty("vue");
|
|
21680
21832
|
await invalidateNonVueModules(nonVueFiles);
|
|
@@ -21702,7 +21854,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
21702
21854
|
recursive: true,
|
|
21703
21855
|
withFileTypes: true
|
|
21704
21856
|
});
|
|
21705
|
-
return entries.filter((entry) => entry.isFile() && EMBER_PAGE_EXTENSIONS.some((ext) => entry.name.endsWith(ext))).map((entry) =>
|
|
21857
|
+
return entries.filter((entry) => entry.isFile() && EMBER_PAGE_EXTENSIONS.some((ext) => entry.name.endsWith(ext))).map((entry) => resolve37(emberPagesPath, entry.name));
|
|
21706
21858
|
} catch {
|
|
21707
21859
|
return [];
|
|
21708
21860
|
}
|
|
@@ -21714,10 +21866,10 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
21714
21866
|
return state.manifest;
|
|
21715
21867
|
}
|
|
21716
21868
|
for (const file4 of emberFiles) {
|
|
21717
|
-
state.fileHashes.set(
|
|
21869
|
+
state.fileHashes.set(resolve37(file4), computeFileHash(file4));
|
|
21718
21870
|
}
|
|
21719
|
-
const emberPagesPath =
|
|
21720
|
-
const directPageEntries = emberFiles.filter((file4) =>
|
|
21871
|
+
const emberPagesPath = resolve37(emberDir, "pages");
|
|
21872
|
+
const directPageEntries = emberFiles.filter((file4) => resolve37(file4).startsWith(emberPagesPath));
|
|
21721
21873
|
const allPageEntries = directPageEntries.length > 0 ? directPageEntries : await collectAllEmberPages(emberPagesPath);
|
|
21722
21874
|
if (allPageEntries.length === 0) {
|
|
21723
21875
|
onRebuildComplete({ hmrState: state, manifest: state.manifest });
|
|
@@ -21727,14 +21879,14 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
21727
21879
|
const { serverPaths } = await compileEmber2(allPageEntries, emberDir, process.cwd(), true);
|
|
21728
21880
|
for (const serverPath of serverPaths) {
|
|
21729
21881
|
const fileBase = basename11(serverPath, ".js");
|
|
21730
|
-
state.manifest[toPascal(fileBase)] =
|
|
21882
|
+
state.manifest[toPascal(fileBase)] = resolve37(serverPath);
|
|
21731
21883
|
}
|
|
21732
21884
|
const { invalidateEmberSsrCache: invalidateEmberSsrCache2 } = await Promise.resolve().then(() => (init_ember(), exports_ember));
|
|
21733
21885
|
invalidateEmberSsrCache2();
|
|
21734
21886
|
const duration = Date.now() - startTime;
|
|
21735
21887
|
const [primary] = emberFiles;
|
|
21736
21888
|
if (primary) {
|
|
21737
|
-
state.lastHmrPath =
|
|
21889
|
+
state.lastHmrPath = relative16(process.cwd(), primary).replace(/\\/g, "/");
|
|
21738
21890
|
state.lastHmrFramework = "ember";
|
|
21739
21891
|
logHmrUpdate(primary, "ember", duration);
|
|
21740
21892
|
}
|
|
@@ -21819,8 +21971,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
21819
21971
|
if (!buildReference?.source) {
|
|
21820
21972
|
return;
|
|
21821
21973
|
}
|
|
21822
|
-
const sourcePath = buildReference.source.startsWith("file://") ? new URL(buildReference.source).pathname :
|
|
21823
|
-
islandFiles.add(
|
|
21974
|
+
const sourcePath = buildReference.source.startsWith("file://") ? new URL(buildReference.source).pathname : resolve37(dirname21(buildInfo.resolvedRegistryPath), buildReference.source);
|
|
21975
|
+
islandFiles.add(resolve37(sourcePath));
|
|
21824
21976
|
}, resolveIslandSourceFiles = async (config) => {
|
|
21825
21977
|
const registryPath = config.islands?.registry;
|
|
21826
21978
|
if (!registryPath) {
|
|
@@ -21828,7 +21980,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
21828
21980
|
}
|
|
21829
21981
|
const buildInfo = await loadIslandRegistryBuildInfo(registryPath);
|
|
21830
21982
|
const islandFiles = new Set([
|
|
21831
|
-
|
|
21983
|
+
resolve37(buildInfo.resolvedRegistryPath)
|
|
21832
21984
|
]);
|
|
21833
21985
|
for (const definition of buildInfo.definitions) {
|
|
21834
21986
|
resolveIslandDefinitionSource(definition, buildInfo, islandFiles);
|
|
@@ -21839,7 +21991,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
21839
21991
|
if (islandFiles.size === 0) {
|
|
21840
21992
|
return false;
|
|
21841
21993
|
}
|
|
21842
|
-
return filesToRebuild.some((file4) => islandFiles.has(
|
|
21994
|
+
return filesToRebuild.some((file4) => islandFiles.has(resolve37(file4)));
|
|
21843
21995
|
}, handleIslandSourceReload = async (state, config, filesToRebuild, manifest) => {
|
|
21844
21996
|
const shouldReload = await didStaticPagesNeedIslandRefresh(config, filesToRebuild);
|
|
21845
21997
|
if (!shouldReload) {
|
|
@@ -21874,10 +22026,10 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
21874
22026
|
}, computeOutputPagesDir = (state, config, framework) => {
|
|
21875
22027
|
const isSingle = !config.reactDirectory && !config.svelteDirectory && !config.vueDirectory && (framework === "html" ? !config.htmxDirectory : !config.htmlDirectory);
|
|
21876
22028
|
if (isSingle) {
|
|
21877
|
-
return
|
|
22029
|
+
return resolve37(state.resolvedPaths.buildDir, "pages");
|
|
21878
22030
|
}
|
|
21879
22031
|
const dirName = framework === "html" ? basename11(config.htmlDirectory ?? "html") : basename11(config.htmxDirectory ?? "htmx");
|
|
21880
|
-
return
|
|
22032
|
+
return resolve37(state.resolvedPaths.buildDir, dirName, "pages");
|
|
21881
22033
|
}, processHtmlPageUpdate = async (state, pageFile, builtHtmlPagePath, manifest, duration) => {
|
|
21882
22034
|
try {
|
|
21883
22035
|
const { handleHTMLUpdate: handleHTMLUpdate2 } = await Promise.resolve().then(() => (init_simpleHTMLHMR(), exports_simpleHTMLHMR));
|
|
@@ -21916,7 +22068,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
21916
22068
|
const pageFilesToUpdate = shouldRefreshAllPages ? await scanEntryPoints(outputHtmlPages, "*.html") : htmlPageFiles;
|
|
21917
22069
|
await runSequentially(pageFilesToUpdate, async (pageFile) => {
|
|
21918
22070
|
const htmlPageName = basename11(pageFile);
|
|
21919
|
-
const builtHtmlPagePath =
|
|
22071
|
+
const builtHtmlPagePath = resolve37(outputHtmlPages, htmlPageName);
|
|
21920
22072
|
await processHtmlPageUpdate(state, pageFile, builtHtmlPagePath, manifest, duration);
|
|
21921
22073
|
});
|
|
21922
22074
|
}, handleVueCssOnlyUpdate = (state, vueCssFiles, manifest, duration) => {
|
|
@@ -21977,11 +22129,11 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
21977
22129
|
const baseName = fileName.replace(/\.vue$/, "");
|
|
21978
22130
|
const pascalName = toPascal(baseName);
|
|
21979
22131
|
const vueRoot = config.vueDirectory;
|
|
21980
|
-
const hmrId = vueRoot ?
|
|
22132
|
+
const hmrId = vueRoot ? relative16(vueRoot, vuePagePath).replace(/\\/g, "/").replace(/\.vue$/, "") : baseName;
|
|
21981
22133
|
const cssKey = `${pascalName}CSS`;
|
|
21982
22134
|
const cssUrl = manifest[cssKey] || null;
|
|
21983
22135
|
const { vueHmrMetadata: vueHmrMetadata2 } = await Promise.resolve().then(() => (init_compileVue(), exports_compileVue));
|
|
21984
|
-
const hmrMeta = vueHmrMetadata2.get(
|
|
22136
|
+
const hmrMeta = vueHmrMetadata2.get(resolve37(vuePagePath));
|
|
21985
22137
|
const changeType = hmrMeta?.changeType ?? "full";
|
|
21986
22138
|
if (changeType === "style-only") {
|
|
21987
22139
|
broadcastVueStyleOnly(state, vuePagePath, baseName, cssUrl, hmrId, manifest, duration);
|
|
@@ -22166,7 +22318,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
22166
22318
|
const pageFilesToUpdate = shouldRefreshAllPages ? await scanEntryPoints(outputHtmxPages, "*.html") : htmxPageFiles;
|
|
22167
22319
|
await runSequentially(pageFilesToUpdate, async (htmxPageFile) => {
|
|
22168
22320
|
const htmxPageName = basename11(htmxPageFile);
|
|
22169
|
-
const builtHtmxPagePath =
|
|
22321
|
+
const builtHtmxPagePath = resolve37(outputHtmxPages, htmxPageName);
|
|
22170
22322
|
await processHtmxPageUpdate(state, htmxPageFile, builtHtmxPagePath, manifest, duration);
|
|
22171
22323
|
});
|
|
22172
22324
|
}, collectUpdatedModulePaths = (allModuleUpdates) => {
|
|
@@ -22275,7 +22427,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
22275
22427
|
html = html.slice(0, bodyClose.index) + hmrScript + html.slice(bodyClose.index);
|
|
22276
22428
|
writeFs(destPath, html);
|
|
22277
22429
|
}, processMarkupFileFastPath = async (state, sourceFile, outputDir, framework, startTime, updateAssetPaths2, handleUpdate, readFs, writeFs) => {
|
|
22278
|
-
const destPath =
|
|
22430
|
+
const destPath = resolve37(outputDir, basename11(sourceFile));
|
|
22279
22431
|
const hmrScript = extractHmrScript(destPath, readFs);
|
|
22280
22432
|
const source = await Bun.file(sourceFile).text();
|
|
22281
22433
|
await Bun.write(destPath, source);
|
|
@@ -22585,7 +22737,7 @@ __export(exports_buildDepVendor, {
|
|
|
22585
22737
|
buildDepVendor: () => buildDepVendor
|
|
22586
22738
|
});
|
|
22587
22739
|
import { mkdirSync as mkdirSync13 } from "fs";
|
|
22588
|
-
import { join as
|
|
22740
|
+
import { join as join30 } from "path";
|
|
22589
22741
|
import { rm as rm10 } from "fs/promises";
|
|
22590
22742
|
var {build: bunBuild9, Glob: Glob9 } = globalThis.Bun;
|
|
22591
22743
|
var toSafeFileName6 = (specifier) => {
|
|
@@ -22598,12 +22750,12 @@ var toSafeFileName6 = (specifier) => {
|
|
|
22598
22750
|
} catch {
|
|
22599
22751
|
return false;
|
|
22600
22752
|
}
|
|
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,
|
|
22753
|
+
}, 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, transpiler6) => {
|
|
22602
22754
|
const dep = [];
|
|
22603
22755
|
const framework = [];
|
|
22604
22756
|
try {
|
|
22605
22757
|
const content = await Bun.file(file4).text();
|
|
22606
|
-
for (const imp of
|
|
22758
|
+
for (const imp of transpiler6.scanImports(content)) {
|
|
22607
22759
|
if (isDepSpecifier(imp.path))
|
|
22608
22760
|
dep.push(imp.path);
|
|
22609
22761
|
else if (isFrameworkRootCandidate(imp.path))
|
|
@@ -22620,9 +22772,9 @@ var toSafeFileName6 = (specifier) => {
|
|
|
22620
22772
|
} catch {
|
|
22621
22773
|
return empty;
|
|
22622
22774
|
}
|
|
22623
|
-
}, collectDirSpecifiers = async (dir,
|
|
22775
|
+
}, collectDirSpecifiers = async (dir, transpiler6, dep, framework) => {
|
|
22624
22776
|
const files = await scanDirFiles(dir);
|
|
22625
|
-
const results = await Promise.all(files.map((file4) => readFileSpecifiers(file4,
|
|
22777
|
+
const results = await Promise.all(files.map((file4) => readFileSpecifiers(file4, transpiler6)));
|
|
22626
22778
|
for (const result of results) {
|
|
22627
22779
|
for (const spec of result.dep)
|
|
22628
22780
|
dep.add(spec);
|
|
@@ -22632,15 +22784,15 @@ var toSafeFileName6 = (specifier) => {
|
|
|
22632
22784
|
}, scanBareImports = async (directories) => {
|
|
22633
22785
|
const dep = new Set;
|
|
22634
22786
|
const framework = new Set;
|
|
22635
|
-
const
|
|
22636
|
-
await Promise.all(directories.map((dir) => collectDirSpecifiers(dir,
|
|
22787
|
+
const transpiler6 = new Bun.Transpiler({ loader: "tsx" });
|
|
22788
|
+
await Promise.all(directories.map((dir) => collectDirSpecifiers(dir, transpiler6, dep, framework)));
|
|
22637
22789
|
return {
|
|
22638
22790
|
dep: Array.from(dep).filter(isResolvable4),
|
|
22639
22791
|
framework: Array.from(framework).filter(isResolvable4)
|
|
22640
22792
|
};
|
|
22641
22793
|
}, collectTransitiveImports = async (specs, alreadyVendored, alreadyScanned) => {
|
|
22642
22794
|
const { readFileSync: readFileSync20 } = await import("fs");
|
|
22643
|
-
const
|
|
22795
|
+
const transpiler6 = new Bun.Transpiler({ loader: "js" });
|
|
22644
22796
|
const newSpecs = new Set;
|
|
22645
22797
|
for (const spec of specs) {
|
|
22646
22798
|
if (alreadyScanned.has(spec))
|
|
@@ -22660,7 +22812,7 @@ var toSafeFileName6 = (specifier) => {
|
|
|
22660
22812
|
}
|
|
22661
22813
|
let imports;
|
|
22662
22814
|
try {
|
|
22663
|
-
imports =
|
|
22815
|
+
imports = transpiler6.scanImports(content);
|
|
22664
22816
|
} catch {
|
|
22665
22817
|
continue;
|
|
22666
22818
|
}
|
|
@@ -22696,7 +22848,7 @@ var toSafeFileName6 = (specifier) => {
|
|
|
22696
22848
|
}), buildDepVendorPass = async (specifiers, vendorDir, tmpDir) => {
|
|
22697
22849
|
const entries = await Promise.all(specifiers.map(async (specifier) => {
|
|
22698
22850
|
const safeName = toSafeFileName6(specifier);
|
|
22699
|
-
const entryPath =
|
|
22851
|
+
const entryPath = join30(tmpDir, `${safeName}.ts`);
|
|
22700
22852
|
await Bun.write(entryPath, await generateVendorEntrySource(specifier));
|
|
22701
22853
|
return { entryPath, specifier };
|
|
22702
22854
|
}));
|
|
@@ -22757,9 +22909,9 @@ var toSafeFileName6 = (specifier) => {
|
|
|
22757
22909
|
const { dep: initialSpecs, framework: frameworkRoots } = await scanBareImports(directories);
|
|
22758
22910
|
if (initialSpecs.length === 0 && frameworkRoots.length === 0)
|
|
22759
22911
|
return {};
|
|
22760
|
-
const vendorDir =
|
|
22912
|
+
const vendorDir = join30(buildDir, "vendor");
|
|
22761
22913
|
mkdirSync13(vendorDir, { recursive: true });
|
|
22762
|
-
const tmpDir =
|
|
22914
|
+
const tmpDir = join30(buildDir, "_dep_vendor_tmp");
|
|
22763
22915
|
mkdirSync13(tmpDir, { recursive: true });
|
|
22764
22916
|
const allSpecs = new Set(initialSpecs);
|
|
22765
22917
|
const alreadyScanned = new Set;
|
|
@@ -22842,7 +22994,7 @@ __export(exports_devBuild, {
|
|
|
22842
22994
|
});
|
|
22843
22995
|
import { readdir as readdir5 } from "fs/promises";
|
|
22844
22996
|
import { statSync as statSync5 } from "fs";
|
|
22845
|
-
import { resolve as
|
|
22997
|
+
import { resolve as resolve38 } from "path";
|
|
22846
22998
|
var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
22847
22999
|
const configuredDirs = [
|
|
22848
23000
|
config.reactDirectory,
|
|
@@ -22865,7 +23017,7 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
22865
23017
|
return Object.keys(config).length > 0 ? config : null;
|
|
22866
23018
|
}, reloadConfig = async () => {
|
|
22867
23019
|
try {
|
|
22868
|
-
const configPath2 =
|
|
23020
|
+
const configPath2 = resolve38(process.env.ABSOLUTE_CONFIG ?? "absolute.config.ts");
|
|
22869
23021
|
const source = await Bun.file(configPath2).text();
|
|
22870
23022
|
return parseDirectoryConfig(source);
|
|
22871
23023
|
} catch {
|
|
@@ -22950,7 +23102,7 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
22950
23102
|
state.fileChangeQueue.clear();
|
|
22951
23103
|
}
|
|
22952
23104
|
}, handleCachedReload = async () => {
|
|
22953
|
-
const serverMtime = statSync5(
|
|
23105
|
+
const serverMtime = statSync5(resolve38(Bun.main)).mtimeMs;
|
|
22954
23106
|
const lastMtime = globalThis.__hmrServerMtime;
|
|
22955
23107
|
globalThis.__hmrServerMtime = serverMtime;
|
|
22956
23108
|
const cached = globalThis.__hmrDevResult;
|
|
@@ -22987,8 +23139,8 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
22987
23139
|
return true;
|
|
22988
23140
|
}, resolveAbsoluteVersion2 = async () => {
|
|
22989
23141
|
const candidates = [
|
|
22990
|
-
|
|
22991
|
-
|
|
23142
|
+
resolve38(import.meta.dir, "..", "..", "package.json"),
|
|
23143
|
+
resolve38(import.meta.dir, "..", "package.json")
|
|
22992
23144
|
];
|
|
22993
23145
|
const [candidate, ...remaining] = candidates;
|
|
22994
23146
|
if (!candidate) {
|
|
@@ -23014,7 +23166,7 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
23014
23166
|
const entries = await readdir5(vendorDir).catch(() => emptyStringArray);
|
|
23015
23167
|
await Promise.all(entries.filter((entry) => entry.endsWith(".js")).map(async (entry) => {
|
|
23016
23168
|
const webPath = `/${framework}/vendor/${entry}`;
|
|
23017
|
-
const bytes = await Bun.file(
|
|
23169
|
+
const bytes = await Bun.file(resolve38(vendorDir, entry)).bytes();
|
|
23018
23170
|
assetStore.set(webPath, bytes);
|
|
23019
23171
|
}));
|
|
23020
23172
|
}, devBuild = async (config) => {
|
|
@@ -23082,11 +23234,11 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
23082
23234
|
cleanStaleAssets(state.assetStore, manifest, state.resolvedPaths.buildDir);
|
|
23083
23235
|
recordStep("populate asset store", stepStartedAt);
|
|
23084
23236
|
stepStartedAt = performance.now();
|
|
23085
|
-
const reactVendorDir =
|
|
23086
|
-
const angularVendorDir =
|
|
23087
|
-
const svelteVendorDir =
|
|
23088
|
-
const vueVendorDir =
|
|
23089
|
-
const depVendorDir =
|
|
23237
|
+
const reactVendorDir = resolve38(state.resolvedPaths.buildDir, "react", "vendor");
|
|
23238
|
+
const angularVendorDir = resolve38(state.resolvedPaths.buildDir, "angular", "vendor");
|
|
23239
|
+
const svelteVendorDir = resolve38(state.resolvedPaths.buildDir, "svelte", "vendor");
|
|
23240
|
+
const vueVendorDir = resolve38(state.resolvedPaths.buildDir, "vue", "vendor");
|
|
23241
|
+
const depVendorDir = resolve38(state.resolvedPaths.buildDir, "vendor");
|
|
23090
23242
|
const { buildDepVendor: buildDepVendor2 } = await Promise.resolve().then(() => (init_buildDepVendor(), exports_buildDepVendor));
|
|
23091
23243
|
const [, angularSpecs, , , , , depPaths] = await Promise.all([
|
|
23092
23244
|
config.reactDirectory ? buildReactVendor(state.resolvedPaths.buildDir) : Promise.resolve(undefined),
|
|
@@ -23164,7 +23316,7 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
23164
23316
|
manifest
|
|
23165
23317
|
};
|
|
23166
23318
|
globalThis.__hmrDevResult = result;
|
|
23167
|
-
globalThis.__hmrServerMtime = statSync5(
|
|
23319
|
+
globalThis.__hmrServerMtime = statSync5(resolve38(Bun.main)).mtimeMs;
|
|
23168
23320
|
return result;
|
|
23169
23321
|
};
|
|
23170
23322
|
var init_devBuild = __esm(() => {
|
|
@@ -23201,5 +23353,5 @@ export {
|
|
|
23201
23353
|
build
|
|
23202
23354
|
};
|
|
23203
23355
|
|
|
23204
|
-
//# debugId=
|
|
23356
|
+
//# debugId=59EBF06239810C7964756E2164756E21
|
|
23205
23357
|
//# sourceMappingURL=build.js.map
|