@absolutejs/absolute 0.19.0-beta.846 → 0.19.0-beta.848
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 +99 -44
- package/dist/angular/index.js.map +6 -5
- package/dist/angular/server.js +99 -44
- package/dist/angular/server.js.map +6 -5
- package/dist/build.js +266 -203
- package/dist/build.js.map +12 -11
- package/dist/index.js +282 -219
- package/dist/index.js.map +12 -11
- package/dist/islands/index.js +51 -7
- package/dist/islands/index.js.map +3 -3
- package/dist/react/index.js +51 -7
- package/dist/react/index.js.map +3 -3
- package/dist/src/build/compileEmber.d.ts +1 -1
- package/dist/src/utils/generatedDir.d.ts +3 -0
- package/dist/svelte/index.js +51 -7
- package/dist/svelte/index.js.map +3 -3
- package/dist/svelte/server.js +51 -7
- package/dist/svelte/server.js.map +3 -3
- package/dist/vue/index.js +51 -7
- package/dist/vue/index.js.map +3 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -615,11 +615,53 @@ ${contents}` : contents, normalizePostcssModule = (mod) => {
|
|
|
615
615
|
code: await compileStyleSource(path, content, language, config)
|
|
616
616
|
};
|
|
617
617
|
}
|
|
618
|
-
}),
|
|
619
|
-
|
|
620
|
-
|
|
618
|
+
}), CSS_IMPORT_PATTERN, resolveCssImportsAsync = async (content, baseDir, visited) => {
|
|
619
|
+
const matches = Array.from(content.matchAll(CSS_IMPORT_PATTERN));
|
|
620
|
+
if (matches.length === 0)
|
|
621
|
+
return content;
|
|
622
|
+
let cursor = 0;
|
|
623
|
+
const parts = [];
|
|
624
|
+
for (const match of matches) {
|
|
625
|
+
const importPath = match[1];
|
|
626
|
+
if (importPath === undefined)
|
|
627
|
+
continue;
|
|
628
|
+
const start = match.index ?? 0;
|
|
629
|
+
const end = start + match[0].length;
|
|
630
|
+
parts.push(content.slice(cursor, start));
|
|
631
|
+
const fullPath = isAbsolute(importPath) ? importPath : resolve2(baseDir, importPath);
|
|
632
|
+
if (visited.has(fullPath) || !existsSync3(fullPath)) {
|
|
633
|
+
parts.push(visited.has(fullPath) ? "" : match[0]);
|
|
634
|
+
cursor = end;
|
|
635
|
+
continue;
|
|
636
|
+
}
|
|
637
|
+
const nextVisited = new Set(visited);
|
|
638
|
+
nextVisited.add(fullPath);
|
|
639
|
+
const imported = await readFile(fullPath, "utf-8");
|
|
640
|
+
parts.push(await resolveCssImportsAsync(imported, dirname2(fullPath), nextVisited));
|
|
641
|
+
cursor = end;
|
|
621
642
|
}
|
|
622
|
-
|
|
643
|
+
parts.push(content.slice(cursor));
|
|
644
|
+
return parts.join("");
|
|
645
|
+
}, compileStyleFileIfNeeded = async (filePath, config) => {
|
|
646
|
+
if (!isPreprocessableStylePath(filePath)) {
|
|
647
|
+
const raw = await readFile(filePath, "utf-8");
|
|
648
|
+
const processed = await runPostcss(raw, filePath, config);
|
|
649
|
+
return resolveCssImportsAsync(processed, dirname2(filePath), new Set([filePath]));
|
|
650
|
+
}
|
|
651
|
+
const compiled = await compileStyleSource(filePath, undefined, undefined, config);
|
|
652
|
+
return resolveCssImportsAsync(compiled, dirname2(filePath), new Set([filePath]));
|
|
653
|
+
}, resolveCssImportsSync = (content, baseDir, visited) => {
|
|
654
|
+
return content.replace(CSS_IMPORT_PATTERN, (match, importPath) => {
|
|
655
|
+
const fullPath = isAbsolute(importPath) ? importPath : resolve2(baseDir, importPath);
|
|
656
|
+
if (visited.has(fullPath))
|
|
657
|
+
return "";
|
|
658
|
+
if (!existsSync3(fullPath))
|
|
659
|
+
return match;
|
|
660
|
+
const nextVisited = new Set(visited);
|
|
661
|
+
nextVisited.add(fullPath);
|
|
662
|
+
const imported = readFileSync3(fullPath, "utf-8");
|
|
663
|
+
return resolveCssImportsSync(imported, dirname2(fullPath), nextVisited);
|
|
664
|
+
});
|
|
623
665
|
}, compileStyleFileIfNeededSync = (filePath, config) => {
|
|
624
666
|
const rawContents = readFileSync3(filePath, "utf-8");
|
|
625
667
|
const language = getStyleLanguage(filePath);
|
|
@@ -637,7 +679,7 @@ ${contents}` : contents, normalizePostcssModule = (mod) => {
|
|
|
637
679
|
}
|
|
638
680
|
const contents = withAdditionalData(rawContents, options.additionalData);
|
|
639
681
|
const loadPaths = normalizeLoadPaths(filePath, options.loadPaths);
|
|
640
|
-
|
|
682
|
+
const compiled = sass.compileString(contents, {
|
|
641
683
|
importers: [
|
|
642
684
|
createSassImporter(filePath, loadPaths, language, config)
|
|
643
685
|
],
|
|
@@ -646,6 +688,7 @@ ${contents}` : contents, normalizePostcssModule = (mod) => {
|
|
|
646
688
|
syntax: language === "sass" ? "indented" : "scss",
|
|
647
689
|
url: new URL(`file://${filePath}`)
|
|
648
690
|
}).css;
|
|
691
|
+
return resolveCssImportsSync(compiled, dirname2(filePath), new Set([filePath]));
|
|
649
692
|
}
|
|
650
693
|
if (language === "less") {
|
|
651
694
|
throw new Error(`Unable to compile ${filePath}: Less styleUrl preprocessing is async-only. Import the Less file from a bundled entrypoint or use SCSS/CSS for Angular styleUrl.`);
|
|
@@ -653,7 +696,7 @@ ${contents}` : contents, normalizePostcssModule = (mod) => {
|
|
|
653
696
|
if (language === "stylus") {
|
|
654
697
|
throw new Error(`Unable to compile ${filePath}: Stylus styleUrl preprocessing is async-only. Import the Stylus file from a bundled entrypoint or use SCSS/CSS for Angular styleUrl.`);
|
|
655
698
|
}
|
|
656
|
-
return rawContents;
|
|
699
|
+
return resolveCssImportsSync(rawContents, dirname2(filePath), new Set([filePath]));
|
|
657
700
|
}, getCssOutputExtension = (filePath) => isPreprocessableStylePath(filePath) ? ".css" : extname(filePath);
|
|
658
701
|
var init_stylePreprocessor = __esm(() => {
|
|
659
702
|
CSS_EXTENSION_PATTERN = /\.css$/i;
|
|
@@ -666,6 +709,7 @@ var init_stylePreprocessor = __esm(() => {
|
|
|
666
709
|
styleDependencyGraph = new Map;
|
|
667
710
|
styleOutputHashes = new Map;
|
|
668
711
|
stylePreprocessorPlugin = createStylePreprocessorPlugin();
|
|
712
|
+
CSS_IMPORT_PATTERN = /@import\s+["']([^"']+)["']\s*;?/g;
|
|
669
713
|
});
|
|
670
714
|
|
|
671
715
|
// node_modules/tailwindcss/dist/chunk-HTB5LLOP.mjs
|
|
@@ -9801,35 +9845,42 @@ var init_cleanStaleOutputs = __esm(() => {
|
|
|
9801
9845
|
HASHED_FILE_PATTERN = /\.[a-f0-9]{8,}\.\w+$/;
|
|
9802
9846
|
});
|
|
9803
9847
|
|
|
9848
|
+
// src/utils/generatedDir.ts
|
|
9849
|
+
var exports_generatedDir = {};
|
|
9850
|
+
__export(exports_generatedDir, {
|
|
9851
|
+
getGeneratedRoot: () => getGeneratedRoot,
|
|
9852
|
+
getFrameworkGeneratedDir: () => getFrameworkGeneratedDir
|
|
9853
|
+
});
|
|
9854
|
+
import { join as join13 } from "path";
|
|
9855
|
+
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);
|
|
9856
|
+
var init_generatedDir = () => {};
|
|
9857
|
+
|
|
9804
9858
|
// src/utils/cleanup.ts
|
|
9805
9859
|
import { rm as rm3 } from "fs/promises";
|
|
9806
|
-
import { join as
|
|
9807
|
-
var
|
|
9860
|
+
import { join as join14 } from "path";
|
|
9861
|
+
var removeIfExists = (path) => rm3(path, { force: true, recursive: true }), cleanFramework = (framework, frameworkDir) => {
|
|
9862
|
+
const tasks = [
|
|
9863
|
+
removeIfExists(getFrameworkGeneratedDir(framework))
|
|
9864
|
+
];
|
|
9865
|
+
if (frameworkDir)
|
|
9866
|
+
tasks.push(removeIfExists(join14(frameworkDir, "generated")));
|
|
9867
|
+
return Promise.all(tasks);
|
|
9868
|
+
}, cleanup = async ({
|
|
9808
9869
|
angularDir,
|
|
9809
9870
|
reactDir,
|
|
9810
9871
|
svelteDir,
|
|
9811
9872
|
vueDir
|
|
9812
9873
|
}) => {
|
|
9813
9874
|
await Promise.all([
|
|
9814
|
-
|
|
9815
|
-
|
|
9816
|
-
|
|
9817
|
-
|
|
9818
|
-
reactDir ? rm3(join13(reactDir, "generated"), {
|
|
9819
|
-
force: true,
|
|
9820
|
-
recursive: true
|
|
9821
|
-
}) : undefined,
|
|
9822
|
-
svelteDir ? rm3(join13(svelteDir, "generated"), {
|
|
9823
|
-
force: true,
|
|
9824
|
-
recursive: true
|
|
9825
|
-
}) : undefined,
|
|
9826
|
-
vueDir ? rm3(join13(vueDir, "generated"), {
|
|
9827
|
-
force: true,
|
|
9828
|
-
recursive: true
|
|
9829
|
-
}) : undefined
|
|
9875
|
+
cleanFramework("angular", angularDir),
|
|
9876
|
+
cleanFramework("react", reactDir),
|
|
9877
|
+
cleanFramework("svelte", svelteDir),
|
|
9878
|
+
cleanFramework("vue", vueDir)
|
|
9830
9879
|
]);
|
|
9831
9880
|
};
|
|
9832
|
-
var init_cleanup = () => {
|
|
9881
|
+
var init_cleanup = __esm(() => {
|
|
9882
|
+
init_generatedDir();
|
|
9883
|
+
});
|
|
9833
9884
|
|
|
9834
9885
|
// src/utils/commonAncestor.ts
|
|
9835
9886
|
var exports_commonAncestor = {};
|
|
@@ -9850,7 +9901,7 @@ var init_commonAncestor = () => {};
|
|
|
9850
9901
|
|
|
9851
9902
|
// src/utils/buildDirectoryLock.ts
|
|
9852
9903
|
import { mkdirSync as mkdirSync6, unlinkSync, writeFileSync as writeFileSync7, readFileSync as readFileSync12 } from "fs";
|
|
9853
|
-
import { dirname as dirname10, join as
|
|
9904
|
+
import { dirname as dirname10, join as join15 } from "path";
|
|
9854
9905
|
var heldLocks, HELD_LOCKS_ENV = "ABSOLUTE_HELD_BUILD_DIRECTORY_LOCKS", exitHandlersRegistered = false, registerExitHandlersOnce = () => {
|
|
9855
9906
|
if (exitHandlersRegistered)
|
|
9856
9907
|
return;
|
|
@@ -9876,7 +9927,7 @@ var heldLocks, HELD_LOCKS_ENV = "ABSOLUTE_HELD_BUILD_DIRECTORY_LOCKS", exitHandl
|
|
|
9876
9927
|
releaseAllSync();
|
|
9877
9928
|
throw err;
|
|
9878
9929
|
});
|
|
9879
|
-
}, isAlreadyExistsError = (error) => error instanceof Error && ("code" in error) && error.code === "EEXIST", lockPathForBuildDirectory = (buildDirectory) =>
|
|
9930
|
+
}, isAlreadyExistsError = (error) => error instanceof Error && ("code" in error) && error.code === "EEXIST", lockPathForBuildDirectory = (buildDirectory) => join15(dirname10(buildDirectory), ".absolutejs", "build.lock"), readHeldLockEnv = () => new Set((process.env[HELD_LOCKS_ENV] ?? "").split(`
|
|
9880
9931
|
`).filter((entry) => entry.length > 0)), writeHeldLockEnv = (locks) => {
|
|
9881
9932
|
if (locks.size === 0) {
|
|
9882
9933
|
delete process.env[HELD_LOCKS_ENV];
|
|
@@ -10091,7 +10142,7 @@ import { existsSync as existsSync15 } from "fs";
|
|
|
10091
10142
|
import { mkdir as mkdir3, stat as stat2 } from "fs/promises";
|
|
10092
10143
|
import {
|
|
10093
10144
|
dirname as dirname11,
|
|
10094
|
-
join as
|
|
10145
|
+
join as join16,
|
|
10095
10146
|
basename as basename5,
|
|
10096
10147
|
extname as extname5,
|
|
10097
10148
|
resolve as resolve17,
|
|
@@ -10150,14 +10201,14 @@ var resolveDevClientDir2 = () => {
|
|
|
10150
10201
|
`${basePath}.svelte`,
|
|
10151
10202
|
`${basePath}.svelte.ts`,
|
|
10152
10203
|
`${basePath}.svelte.js`,
|
|
10153
|
-
|
|
10154
|
-
|
|
10155
|
-
|
|
10156
|
-
|
|
10157
|
-
|
|
10158
|
-
|
|
10159
|
-
|
|
10160
|
-
|
|
10204
|
+
join16(basePath, "index.ts"),
|
|
10205
|
+
join16(basePath, "index.js"),
|
|
10206
|
+
join16(basePath, "index.mjs"),
|
|
10207
|
+
join16(basePath, "index.cjs"),
|
|
10208
|
+
join16(basePath, "index.json"),
|
|
10209
|
+
join16(basePath, "index.svelte"),
|
|
10210
|
+
join16(basePath, "index.svelte.ts"),
|
|
10211
|
+
join16(basePath, "index.svelte.js")
|
|
10161
10212
|
];
|
|
10162
10213
|
const checks = await Promise.all(candidates.map(exists));
|
|
10163
10214
|
return candidates.find((_2, index) => checks[index]) ?? null;
|
|
@@ -10195,10 +10246,10 @@ var resolveDevClientDir2 = () => {
|
|
|
10195
10246
|
});
|
|
10196
10247
|
}, compileSvelte = async (entryPoints, svelteRoot, cache = new Map, isDev2 = false, stylePreprocessors) => {
|
|
10197
10248
|
const { compile, compileModule, preprocess } = await import("svelte/compiler");
|
|
10198
|
-
const generatedDir =
|
|
10199
|
-
const clientDir =
|
|
10200
|
-
const indexDir =
|
|
10201
|
-
const serverDir =
|
|
10249
|
+
const generatedDir = getFrameworkGeneratedDir("svelte");
|
|
10250
|
+
const clientDir = join16(generatedDir, "client");
|
|
10251
|
+
const indexDir = join16(generatedDir, "indexes");
|
|
10252
|
+
const serverDir = join16(generatedDir, "server");
|
|
10202
10253
|
await Promise.all([clientDir, indexDir, serverDir].map((dir) => mkdir3(dir, { recursive: true })));
|
|
10203
10254
|
const dev = env2.NODE_ENV !== "production";
|
|
10204
10255
|
const build2 = async (src) => {
|
|
@@ -10236,8 +10287,8 @@ var resolveDevClientDir2 = () => {
|
|
|
10236
10287
|
const childBuilt = await Promise.all(childSources.map((child) => build2(child)));
|
|
10237
10288
|
const hasAwaitSlotFromChildren = childBuilt.some((child) => child.hasAwaitSlot);
|
|
10238
10289
|
const externalRewrites = new Map;
|
|
10239
|
-
const ssrOutputDir = dirname11(
|
|
10240
|
-
const clientOutputDir = dirname11(
|
|
10290
|
+
const ssrOutputDir = dirname11(join16(serverDir, relDir, `${baseName}.js`));
|
|
10291
|
+
const clientOutputDir = dirname11(join16(clientDir, relDir, `${baseName}.js`));
|
|
10241
10292
|
for (let idx = 0;idx < importPaths.length; idx++) {
|
|
10242
10293
|
const rawSpec = importPaths[idx];
|
|
10243
10294
|
if (!rawSpec)
|
|
@@ -10302,8 +10353,8 @@ var resolveDevClientDir2 = () => {
|
|
|
10302
10353
|
code += islandMetadataExports;
|
|
10303
10354
|
return code;
|
|
10304
10355
|
};
|
|
10305
|
-
const ssrPath =
|
|
10306
|
-
const clientPath =
|
|
10356
|
+
const ssrPath = join16(serverDir, relDir, `${baseName}.js`);
|
|
10357
|
+
const clientPath = join16(clientDir, relDir, `${baseName}.js`);
|
|
10307
10358
|
await Promise.all([
|
|
10308
10359
|
mkdir3(dirname11(ssrPath), { recursive: true }),
|
|
10309
10360
|
mkdir3(dirname11(clientPath), { recursive: true })
|
|
@@ -10335,7 +10386,7 @@ var resolveDevClientDir2 = () => {
|
|
|
10335
10386
|
await Promise.all(roots.map(async ({ client: client2, hasAwaitSlot }) => {
|
|
10336
10387
|
const relClientDir = dirname11(relative7(clientDir, client2));
|
|
10337
10388
|
const name = basename5(client2, extname5(client2));
|
|
10338
|
-
const indexPath =
|
|
10389
|
+
const indexPath = join16(indexDir, relClientDir, `${name}.js`);
|
|
10339
10390
|
const importRaw = relative7(dirname11(indexPath), client2).split(sep2).join("/");
|
|
10340
10391
|
const importPath = importRaw.startsWith(".") || importRaw.startsWith("/") ? importRaw : `./${importRaw}`;
|
|
10341
10392
|
const hmrImports = isDev2 ? `window.__HMR_FRAMEWORK__ = "svelte";
|
|
@@ -10414,7 +10465,7 @@ if (typeof window !== "undefined") {
|
|
|
10414
10465
|
svelteClientPaths: roots.map(({ client: client2 }) => client2),
|
|
10415
10466
|
svelteIndexPaths: roots.map(({ client: client2 }) => {
|
|
10416
10467
|
const rel = dirname11(relative7(clientDir, client2));
|
|
10417
|
-
return
|
|
10468
|
+
return join16(indexDir, rel, basename5(client2));
|
|
10418
10469
|
}),
|
|
10419
10470
|
svelteServerPaths: roots.map(({ ssr }) => ssr)
|
|
10420
10471
|
};
|
|
@@ -10422,13 +10473,14 @@ if (typeof window !== "undefined") {
|
|
|
10422
10473
|
var init_compileSvelte = __esm(() => {
|
|
10423
10474
|
init_constants();
|
|
10424
10475
|
init_resolvePackageImport();
|
|
10476
|
+
init_generatedDir();
|
|
10425
10477
|
init_sourceMetadata();
|
|
10426
10478
|
init_stylePreprocessor();
|
|
10427
10479
|
init_lowerIslandSyntax();
|
|
10428
10480
|
init_lowerAwaitSlotSyntax();
|
|
10429
10481
|
init_renderToReadableStream();
|
|
10430
10482
|
devClientDir2 = resolveDevClientDir2();
|
|
10431
|
-
hmrClientPath3 =
|
|
10483
|
+
hmrClientPath3 = join16(devClientDir2, "hmrClient.ts").replace(/\\/g, "/");
|
|
10432
10484
|
persistentCache = new Map;
|
|
10433
10485
|
sourceHashCache = new Map;
|
|
10434
10486
|
transpiler2 = new Transpiler({ loader: "ts", target: "browser" });
|
|
@@ -10500,7 +10552,7 @@ import {
|
|
|
10500
10552
|
basename as basename6,
|
|
10501
10553
|
dirname as dirname12,
|
|
10502
10554
|
isAbsolute as isAbsolute3,
|
|
10503
|
-
join as
|
|
10555
|
+
join as join17,
|
|
10504
10556
|
relative as relative8,
|
|
10505
10557
|
resolve as resolve18
|
|
10506
10558
|
} from "path";
|
|
@@ -10675,7 +10727,7 @@ var resolveDevClientDir3 = () => {
|
|
|
10675
10727
|
];
|
|
10676
10728
|
let cssOutputPaths = [];
|
|
10677
10729
|
if (isEntryPoint && allCss.length) {
|
|
10678
|
-
const cssOutputFile =
|
|
10730
|
+
const cssOutputFile = join17(outputDirs.css, `${toKebab(fileBaseName)}-compiled.css`);
|
|
10679
10731
|
await mkdir4(dirname12(cssOutputFile), { recursive: true });
|
|
10680
10732
|
await write2(cssOutputFile, allCss.join(`
|
|
10681
10733
|
`));
|
|
@@ -10706,8 +10758,8 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
10706
10758
|
};
|
|
10707
10759
|
const clientCode = assembleModule(generateRenderFunction(false), "render", true) + islandMetadataExports;
|
|
10708
10760
|
const serverCode = assembleModule(generateRenderFunction(true), "ssrRender", false) + islandMetadataExports;
|
|
10709
|
-
const clientOutputPath =
|
|
10710
|
-
const serverOutputPath =
|
|
10761
|
+
const clientOutputPath = join17(outputDirs.client, `${relativeWithoutExtension}.js`);
|
|
10762
|
+
const serverOutputPath = join17(outputDirs.server, `${relativeWithoutExtension}.js`);
|
|
10711
10763
|
const relDir = dirname12(relativeFilePath);
|
|
10712
10764
|
const relDepth = relDir === "." ? 0 : relDir.split("/").length;
|
|
10713
10765
|
const adjustImports = (code) => code.replace(/(from\s+['"])(\.\.\/(?:\.\.\/)*)/g, (_2, prefix, dots) => {
|
|
@@ -10747,11 +10799,11 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
10747
10799
|
return result;
|
|
10748
10800
|
}, compileVue = async (entryPoints, vueRootDir, isDev2 = false, stylePreprocessors) => {
|
|
10749
10801
|
const compiler = await import("@vue/compiler-sfc");
|
|
10750
|
-
const generatedDir =
|
|
10751
|
-
const clientOutputDir =
|
|
10752
|
-
const indexOutputDir =
|
|
10753
|
-
const serverOutputDir =
|
|
10754
|
-
const cssOutputDir =
|
|
10802
|
+
const generatedDir = getFrameworkGeneratedDir("vue");
|
|
10803
|
+
const clientOutputDir = join17(generatedDir, "client");
|
|
10804
|
+
const indexOutputDir = join17(generatedDir, "indexes");
|
|
10805
|
+
const serverOutputDir = join17(generatedDir, "server");
|
|
10806
|
+
const cssOutputDir = join17(generatedDir, "compiled");
|
|
10755
10807
|
await Promise.all([
|
|
10756
10808
|
mkdir4(clientOutputDir, { recursive: true }),
|
|
10757
10809
|
mkdir4(indexOutputDir, { recursive: true }),
|
|
@@ -10768,8 +10820,8 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
10768
10820
|
}, buildCache, true, vueRootDir, compiler, stylePreprocessors);
|
|
10769
10821
|
result.tsHelperPaths.forEach((path) => allTsHelperPaths.add(path));
|
|
10770
10822
|
const entryBaseName = basename6(entryPath, ".vue");
|
|
10771
|
-
const indexOutputFile =
|
|
10772
|
-
const clientOutputFile =
|
|
10823
|
+
const indexOutputFile = join17(indexOutputDir, `${entryBaseName}.js`);
|
|
10824
|
+
const clientOutputFile = join17(clientOutputDir, relative8(vueRootDir, entryPath).replace(/\\/g, "/").replace(/\.vue$/, ".js"));
|
|
10773
10825
|
await mkdir4(dirname12(indexOutputFile), { recursive: true });
|
|
10774
10826
|
const vueHmrImports = isDev2 ? [
|
|
10775
10827
|
`window.__HMR_FRAMEWORK__ = "vue";`,
|
|
@@ -10922,8 +10974,8 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
10922
10974
|
const sourceCode = await file3(tsPath).text();
|
|
10923
10975
|
const transpiledCode = transpiler3.transformSync(sourceCode);
|
|
10924
10976
|
const relativeJsPath = relative8(vueRootDir, tsPath).replace(/\.ts$/, ".js");
|
|
10925
|
-
const outClientPath =
|
|
10926
|
-
const outServerPath =
|
|
10977
|
+
const outClientPath = join17(clientOutputDir, relativeJsPath);
|
|
10978
|
+
const outServerPath = join17(serverOutputDir, relativeJsPath);
|
|
10927
10979
|
await mkdir4(dirname12(outClientPath), { recursive: true });
|
|
10928
10980
|
await mkdir4(dirname12(outServerPath), { recursive: true });
|
|
10929
10981
|
await write2(outClientPath, transpiledCode);
|
|
@@ -10939,12 +10991,13 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
10939
10991
|
};
|
|
10940
10992
|
var init_compileVue = __esm(() => {
|
|
10941
10993
|
init_constants();
|
|
10994
|
+
init_generatedDir();
|
|
10942
10995
|
init_resolvePackageImport();
|
|
10943
10996
|
init_sourceMetadata();
|
|
10944
10997
|
init_vueAutoRouterTransform();
|
|
10945
10998
|
init_stylePreprocessor();
|
|
10946
10999
|
devClientDir3 = resolveDevClientDir3();
|
|
10947
|
-
hmrClientPath4 =
|
|
11000
|
+
hmrClientPath4 = join17(devClientDir3, "hmrClient.ts").replace(/\\/g, "/");
|
|
10948
11001
|
transpiler3 = new Transpiler2({ loader: "ts", target: "browser" });
|
|
10949
11002
|
scriptCache = new Map;
|
|
10950
11003
|
scriptSetupCache = new Map;
|
|
@@ -11425,7 +11478,7 @@ __export(exports_compileAngular, {
|
|
|
11425
11478
|
compileAngular: () => compileAngular
|
|
11426
11479
|
});
|
|
11427
11480
|
import { existsSync as existsSync17, readFileSync as readFileSync13, promises as fs } from "fs";
|
|
11428
|
-
import { join as
|
|
11481
|
+
import { join as join18, basename as basename7, sep as sep3, dirname as dirname13, resolve as resolve19, relative as relative9 } from "path";
|
|
11429
11482
|
import ts2 from "typescript";
|
|
11430
11483
|
var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
11431
11484
|
const tracePhase = globalThis.__absoluteBuildTracePhase;
|
|
@@ -11467,10 +11520,10 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
11467
11520
|
`${candidate}.tsx`,
|
|
11468
11521
|
`${candidate}.js`,
|
|
11469
11522
|
`${candidate}.jsx`,
|
|
11470
|
-
|
|
11471
|
-
|
|
11472
|
-
|
|
11473
|
-
|
|
11523
|
+
join18(candidate, "index.ts"),
|
|
11524
|
+
join18(candidate, "index.tsx"),
|
|
11525
|
+
join18(candidate, "index.js"),
|
|
11526
|
+
join18(candidate, "index.jsx")
|
|
11474
11527
|
];
|
|
11475
11528
|
return candidates.find((file4) => existsSync17(file4));
|
|
11476
11529
|
}, createLegacyAngularAnimationUsageResolver = (rootDir) => {
|
|
@@ -11659,10 +11712,10 @@ ${registrations}
|
|
|
11659
11712
|
`${basePath}.tsx`,
|
|
11660
11713
|
`${basePath}.mts`,
|
|
11661
11714
|
`${basePath}.cts`,
|
|
11662
|
-
|
|
11663
|
-
|
|
11664
|
-
|
|
11665
|
-
|
|
11715
|
+
join18(basePath, "index.ts"),
|
|
11716
|
+
join18(basePath, "index.tsx"),
|
|
11717
|
+
join18(basePath, "index.mts"),
|
|
11718
|
+
join18(basePath, "index.cts")
|
|
11666
11719
|
];
|
|
11667
11720
|
return candidates.map((candidate) => resolve19(candidate)).find((candidate) => existsSync17(candidate) && !candidate.endsWith(".d.ts")) ?? null;
|
|
11668
11721
|
}, readFileForAotTransform = async (fileName, readFile5) => {
|
|
@@ -11688,15 +11741,15 @@ ${registrations}
|
|
|
11688
11741
|
const paths = [];
|
|
11689
11742
|
const templateUrlMatch = findUncommentedMatch(source, /templateUrl\s*:\s*['"]([^'"]+)['"]/);
|
|
11690
11743
|
if (templateUrlMatch?.[1])
|
|
11691
|
-
paths.push(
|
|
11744
|
+
paths.push(join18(fileDir, templateUrlMatch[1]));
|
|
11692
11745
|
const styleUrlMatch = findUncommentedMatch(source, /styleUrl\s*:\s*['"]([^'"]+)['"]/);
|
|
11693
11746
|
if (styleUrlMatch?.[1])
|
|
11694
|
-
paths.push(
|
|
11747
|
+
paths.push(join18(fileDir, styleUrlMatch[1]));
|
|
11695
11748
|
const styleUrlsMatch = findUncommentedMatch(source, /styleUrls\s*:\s*\[([^\]]+)\]/);
|
|
11696
11749
|
const urlMatches = styleUrlsMatch?.[1]?.match(/['"]([^'"]+)['"]/g);
|
|
11697
11750
|
if (urlMatches) {
|
|
11698
11751
|
for (const urlMatch of urlMatches) {
|
|
11699
|
-
paths.push(
|
|
11752
|
+
paths.push(join18(fileDir, urlMatch.replace(/['"]/g, "")));
|
|
11700
11753
|
}
|
|
11701
11754
|
}
|
|
11702
11755
|
return paths.map((path) => resolve19(path));
|
|
@@ -11730,7 +11783,7 @@ ${registrations}
|
|
|
11730
11783
|
safeStableStringify(stylePreprocessors ?? null)
|
|
11731
11784
|
].join("\x00");
|
|
11732
11785
|
const cacheKey2 = Bun.hash(cacheInput).toString(BASE_36_RADIX);
|
|
11733
|
-
return
|
|
11786
|
+
return join18(process.cwd(), ".absolutejs", "cache", "angular-resources", `${cacheKey2}.json`);
|
|
11734
11787
|
}, precomputeAotResourceTransforms = async (inputPaths, readFile5, stylePreprocessors) => {
|
|
11735
11788
|
const transformedSources = new Map;
|
|
11736
11789
|
const visited = new Set;
|
|
@@ -11776,7 +11829,7 @@ ${registrations}
|
|
|
11776
11829
|
return { stats, transformedSources };
|
|
11777
11830
|
}, compileAngularFiles = async (inputPaths, outDir, stylePreprocessors) => {
|
|
11778
11831
|
const islandMetadataByOutputPath = await traceAngularPhase("aot/island-metadata", () => new Map(inputPaths.map((inputPath) => {
|
|
11779
|
-
const outputPath = resolve19(
|
|
11832
|
+
const outputPath = resolve19(join18(outDir, relative9(process.cwd(), resolve19(inputPath)).replace(/\.[cm]?[tj]sx?$/, ".js")));
|
|
11780
11833
|
return [
|
|
11781
11834
|
outputPath,
|
|
11782
11835
|
buildIslandMetadataExports(readFileSync13(inputPath, "utf-8"))
|
|
@@ -11823,7 +11876,7 @@ ${registrations}
|
|
|
11823
11876
|
const originalGetSourceFile = host.getSourceFile;
|
|
11824
11877
|
host.getSourceFile = (fileName, languageVersion, onError) => {
|
|
11825
11878
|
if (fileName.startsWith("lib.") && fileName.endsWith(".d.ts") && tsLibDir) {
|
|
11826
|
-
const resolvedPath =
|
|
11879
|
+
const resolvedPath = join18(tsLibDir, fileName);
|
|
11827
11880
|
return originalGetSourceFile?.call(host, resolvedPath, languageVersion, onError);
|
|
11828
11881
|
}
|
|
11829
11882
|
return originalGetSourceFile?.call(host, fileName, languageVersion, onError);
|
|
@@ -11878,7 +11931,7 @@ ${registrations}
|
|
|
11878
11931
|
const entries = await traceAngularPhase("aot/postprocess-emitted-js", () => {
|
|
11879
11932
|
const rawEntries = Object.entries(emitted).filter(([fileName]) => fileName.endsWith(".js")).map(([fileName, content]) => ({
|
|
11880
11933
|
content,
|
|
11881
|
-
target:
|
|
11934
|
+
target: join18(outDir, fileName)
|
|
11882
11935
|
}));
|
|
11883
11936
|
const outputFiles = new Set(rawEntries.map(({ target }) => resolve19(target)));
|
|
11884
11937
|
return rawEntries.map(({ content, target }) => {
|
|
@@ -12053,7 +12106,7 @@ ${fields}
|
|
|
12053
12106
|
}, inlineTemplateAndLowerDefer = async (source, fileDir) => {
|
|
12054
12107
|
const templateUrlMatch = findUncommentedMatch(source, /templateUrl\s*:\s*['"]([^'"]+)['"]/);
|
|
12055
12108
|
if (templateUrlMatch?.[1]) {
|
|
12056
|
-
const templatePath =
|
|
12109
|
+
const templatePath = join18(fileDir, templateUrlMatch[1]);
|
|
12057
12110
|
if (!existsSync17(templatePath)) {
|
|
12058
12111
|
throw new Error(`Unable to inline Angular templateUrl "${templateUrlMatch[1]}": file not found at ${templatePath}`);
|
|
12059
12112
|
}
|
|
@@ -12084,7 +12137,7 @@ ${fields}
|
|
|
12084
12137
|
}, inlineTemplateAndLowerDeferSync = (source, fileDir) => {
|
|
12085
12138
|
const templateUrlMatch = findUncommentedMatch(source, /templateUrl\s*:\s*['"]([^'"]+)['"]/);
|
|
12086
12139
|
if (templateUrlMatch?.[1]) {
|
|
12087
|
-
const templatePath =
|
|
12140
|
+
const templatePath = join18(fileDir, templateUrlMatch[1]);
|
|
12088
12141
|
if (!existsSync17(templatePath)) {
|
|
12089
12142
|
throw new Error(`Unable to inline Angular templateUrl "${templateUrlMatch[1]}": file not found at ${templatePath}`);
|
|
12090
12143
|
}
|
|
@@ -12121,7 +12174,7 @@ ${fields}
|
|
|
12121
12174
|
return source;
|
|
12122
12175
|
const stylePromises = urlMatches.map((urlMatch) => {
|
|
12123
12176
|
const styleUrl = urlMatch.replace(/['"]/g, "");
|
|
12124
|
-
return readAndEscapeFile(
|
|
12177
|
+
return readAndEscapeFile(join18(fileDir, styleUrl), stylePreprocessors);
|
|
12125
12178
|
});
|
|
12126
12179
|
const results = await Promise.all(stylePromises);
|
|
12127
12180
|
const inlinedStyles = results.filter(Boolean).map((escaped) => `\`${escaped}\``);
|
|
@@ -12132,7 +12185,7 @@ ${fields}
|
|
|
12132
12185
|
const styleUrlMatch = findUncommentedMatch(source, /styleUrl\s*:\s*['"]([^'"]+)['"]/);
|
|
12133
12186
|
if (!styleUrlMatch?.[1])
|
|
12134
12187
|
return source;
|
|
12135
|
-
const escaped = await readAndEscapeFile(
|
|
12188
|
+
const escaped = await readAndEscapeFile(join18(fileDir, styleUrlMatch[1]), stylePreprocessors);
|
|
12136
12189
|
if (!escaped)
|
|
12137
12190
|
return source;
|
|
12138
12191
|
return source.slice(0, styleUrlMatch.index) + `styles: [\`${escaped}\`]` + source.slice(styleUrlMatch.index + styleUrlMatch[0].length);
|
|
@@ -12167,10 +12220,10 @@ ${fields}
|
|
|
12167
12220
|
`${candidate}.tsx`,
|
|
12168
12221
|
`${candidate}.js`,
|
|
12169
12222
|
`${candidate}.jsx`,
|
|
12170
|
-
|
|
12171
|
-
|
|
12172
|
-
|
|
12173
|
-
|
|
12223
|
+
join18(candidate, "index.ts"),
|
|
12224
|
+
join18(candidate, "index.tsx"),
|
|
12225
|
+
join18(candidate, "index.js"),
|
|
12226
|
+
join18(candidate, "index.jsx")
|
|
12174
12227
|
];
|
|
12175
12228
|
return candidates.find((file4) => existsSync17(file4));
|
|
12176
12229
|
};
|
|
@@ -12197,7 +12250,7 @@ ${fields}
|
|
|
12197
12250
|
const inputDir = dirname13(sourcePath);
|
|
12198
12251
|
const relativeDir = inputDir.startsWith(baseDir) ? inputDir.substring(baseDir.length + 1) : inputDir;
|
|
12199
12252
|
const fileBase = basename7(sourcePath).replace(/\.[cm]?[tj]sx?$/, ".js");
|
|
12200
|
-
return
|
|
12253
|
+
return join18(outDir, relativeDir, fileBase);
|
|
12201
12254
|
};
|
|
12202
12255
|
const withCacheBuster = (specifier) => {
|
|
12203
12256
|
if (!cacheBuster)
|
|
@@ -12255,7 +12308,7 @@ ${fields}
|
|
|
12255
12308
|
const inputDir = dirname13(actualPath);
|
|
12256
12309
|
const relativeDir = inputDir.startsWith(baseDir) ? inputDir.substring(baseDir.length + 1) : inputDir;
|
|
12257
12310
|
const fileBase = basename7(actualPath).replace(/\.[cm]?[tj]sx?$/, ".js");
|
|
12258
|
-
const targetDir =
|
|
12311
|
+
const targetDir = join18(outDir, relativeDir);
|
|
12259
12312
|
const targetPath = toOutputPath(actualPath);
|
|
12260
12313
|
const localImports = [];
|
|
12261
12314
|
const importRewrites = new Map;
|
|
@@ -12309,13 +12362,13 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
12309
12362
|
}
|
|
12310
12363
|
return allOutputs;
|
|
12311
12364
|
}, compileAngular = async (entryPoints, outRoot, hmr = false, stylePreprocessors) => {
|
|
12312
|
-
const compiledParent =
|
|
12365
|
+
const compiledParent = getFrameworkGeneratedDir("angular");
|
|
12313
12366
|
if (entryPoints.length === 0) {
|
|
12314
12367
|
const emptyPaths = [];
|
|
12315
12368
|
return { clientPaths: [...emptyPaths], serverPaths: [...emptyPaths] };
|
|
12316
12369
|
}
|
|
12317
12370
|
const compiledRoot = compiledParent;
|
|
12318
|
-
const indexesDir =
|
|
12371
|
+
const indexesDir = join18(compiledParent, "indexes");
|
|
12319
12372
|
await traceAngularPhase("setup/create-indexes-dir", () => fs.mkdir(indexesDir, { recursive: true }));
|
|
12320
12373
|
const aotOutputs = hmr ? [] : await traceAngularPhase("aot/compile-files", () => compileAngularFiles(entryPoints.map((entry) => resolve19(entry)), compiledRoot, stylePreprocessors), { entries: entryPoints.length });
|
|
12321
12374
|
const usesLegacyAngularAnimations = await traceAngularPhase("setup/legacy-animation-resolver", () => createLegacyAngularAnimationUsageResolver(outRoot));
|
|
@@ -12329,9 +12382,9 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
12329
12382
|
const fileBase = basename7(resolvedEntry).replace(/\.[tj]s$/, "");
|
|
12330
12383
|
const jsName = `${fileBase}.js`;
|
|
12331
12384
|
const compiledFallbackPaths = [
|
|
12332
|
-
|
|
12333
|
-
|
|
12334
|
-
|
|
12385
|
+
join18(compiledRoot, relativeEntry),
|
|
12386
|
+
join18(compiledRoot, "pages", jsName),
|
|
12387
|
+
join18(compiledRoot, jsName)
|
|
12335
12388
|
].map((file4) => resolve19(file4));
|
|
12336
12389
|
const resolveRawServerFile = (candidatePaths) => {
|
|
12337
12390
|
const normalizedCandidates = [
|
|
@@ -12376,7 +12429,7 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
12376
12429
|
const usesLegacyAnimations = await traceAngularPhase("wrapper/detect-legacy-animations", () => usesLegacyAngularAnimations(resolvedEntry), { entry: resolvedEntry });
|
|
12377
12430
|
const serverContentHash = Bun.hash(original).toString(BASE_36_RADIX);
|
|
12378
12431
|
const cachedWrapper = wrapperOutputCache.get(resolvedEntry);
|
|
12379
|
-
const clientFile =
|
|
12432
|
+
const clientFile = join18(indexesDir, jsName);
|
|
12380
12433
|
if (hmr && cachedWrapper && cachedWrapper.serverHash === serverContentHash && existsSync17(clientFile) && (usesLegacyAnimations || !original.includes("__ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__")) && (!usesLegacyAnimations || original.includes("__ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__"))) {
|
|
12381
12434
|
return {
|
|
12382
12435
|
clientPath: clientFile,
|
|
@@ -12611,9 +12664,10 @@ var init_compileAngular = __esm(() => {
|
|
|
12611
12664
|
init_sourceMetadata();
|
|
12612
12665
|
init_lowerDeferSyntax();
|
|
12613
12666
|
init_stylePreprocessor();
|
|
12667
|
+
init_generatedDir();
|
|
12614
12668
|
devClientDir4 = resolveDevClientDir4();
|
|
12615
|
-
hmrClientPath5 =
|
|
12616
|
-
hmrRuntimePath =
|
|
12669
|
+
hmrClientPath5 = join18(devClientDir4, "hmrClient.ts").replace(/\\/g, "/");
|
|
12670
|
+
hmrRuntimePath = join18(devClientDir4, "handlers", "angularRuntime.ts").replace(/\\/g, "/");
|
|
12617
12671
|
jitContentCache = new Map;
|
|
12618
12672
|
wrapperOutputCache = new Map;
|
|
12619
12673
|
});
|
|
@@ -13067,7 +13121,7 @@ __export(exports_compileEmber, {
|
|
|
13067
13121
|
});
|
|
13068
13122
|
import { existsSync as existsSync18 } from "fs";
|
|
13069
13123
|
import { mkdir as mkdir5, rm as rm4 } from "fs/promises";
|
|
13070
|
-
import { basename as basename8, dirname as dirname14, extname as extname6, join as
|
|
13124
|
+
import { basename as basename8, dirname as dirname14, extname as extname6, join as join19, resolve as resolve20 } from "path";
|
|
13071
13125
|
var {build: bunBuild2, Transpiler: Transpiler3, write: write3, file: file4 } = globalThis.Bun;
|
|
13072
13126
|
var cachedPreprocessor = null, getPreprocessor = async () => {
|
|
13073
13127
|
if (cachedPreprocessor)
|
|
@@ -13186,7 +13240,7 @@ export const importSync = (specifier) => {
|
|
|
13186
13240
|
build2.onResolve({ filter: /^@(?:ember|glimmer|simple-dom)\// }, (args) => {
|
|
13187
13241
|
if (standalonePackages.has(args.path))
|
|
13188
13242
|
return;
|
|
13189
|
-
const internal =
|
|
13243
|
+
const internal = join19(cwd, "node_modules/ember-source/dist/packages", args.path, "index.js");
|
|
13190
13244
|
if (existsSync18(internal))
|
|
13191
13245
|
return { path: internal };
|
|
13192
13246
|
return;
|
|
@@ -13234,16 +13288,16 @@ export default PageComponent;
|
|
|
13234
13288
|
}
|
|
13235
13289
|
const transpiled = transpiler4.transformSync(preprocessed);
|
|
13236
13290
|
const baseName = basename8(resolvedEntry).replace(/\.(gjs|gts|ts|js)$/, "");
|
|
13237
|
-
const tmpDir =
|
|
13238
|
-
const serverDir =
|
|
13239
|
-
const clientDir =
|
|
13291
|
+
const tmpDir = join19(compiledRoot, "_tmp");
|
|
13292
|
+
const serverDir = join19(compiledRoot, "server");
|
|
13293
|
+
const clientDir = join19(compiledRoot, "client");
|
|
13240
13294
|
await Promise.all([
|
|
13241
13295
|
mkdir5(tmpDir, { recursive: true }),
|
|
13242
13296
|
mkdir5(serverDir, { recursive: true }),
|
|
13243
13297
|
mkdir5(clientDir, { recursive: true })
|
|
13244
13298
|
]);
|
|
13245
|
-
const tmpPagePath = resolve20(
|
|
13246
|
-
const tmpHarnessPath = resolve20(
|
|
13299
|
+
const tmpPagePath = resolve20(join19(tmpDir, `${baseName}.module.js`));
|
|
13300
|
+
const tmpHarnessPath = resolve20(join19(tmpDir, `${baseName}.harness.js`));
|
|
13247
13301
|
await Promise.all([
|
|
13248
13302
|
write3(tmpPagePath, transpiled),
|
|
13249
13303
|
write3(tmpHarnessPath, generateServerHarness(tmpPagePath))
|
|
@@ -13251,7 +13305,7 @@ export default PageComponent;
|
|
|
13251
13305
|
const stagedSourceMap = new Map([
|
|
13252
13306
|
[tmpPagePath, resolvedEntry]
|
|
13253
13307
|
]);
|
|
13254
|
-
const serverPath =
|
|
13308
|
+
const serverPath = join19(serverDir, `${baseName}.js`);
|
|
13255
13309
|
const buildResult = await bunBuild2({
|
|
13256
13310
|
entrypoints: [tmpHarnessPath],
|
|
13257
13311
|
format: "esm",
|
|
@@ -13268,7 +13322,7 @@ export default PageComponent;
|
|
|
13268
13322
|
console.warn(`\u26A0\uFE0F Ember server build for ${baseName} had errors:`, buildResult.logs);
|
|
13269
13323
|
}
|
|
13270
13324
|
await rm4(tmpDir, { force: true, recursive: true });
|
|
13271
|
-
const clientPath =
|
|
13325
|
+
const clientPath = join19(clientDir, `${baseName}.js`);
|
|
13272
13326
|
await write3(clientPath, transpiled);
|
|
13273
13327
|
return { clientPath, serverPath };
|
|
13274
13328
|
}, compileEmber = async (entries, emberDir, cwd = process.cwd(), _hmr = false) => {
|
|
@@ -13278,7 +13332,7 @@ export default PageComponent;
|
|
|
13278
13332
|
serverPaths: []
|
|
13279
13333
|
};
|
|
13280
13334
|
}
|
|
13281
|
-
const compiledRoot =
|
|
13335
|
+
const compiledRoot = getFrameworkGeneratedDir("ember");
|
|
13282
13336
|
const outputs = await Promise.all(entries.map((entry) => compileEmberFile(entry, compiledRoot, cwd)));
|
|
13283
13337
|
return {
|
|
13284
13338
|
clientPaths: outputs.map((o) => o.clientPath),
|
|
@@ -13296,8 +13350,9 @@ export default PageComponent;
|
|
|
13296
13350
|
preprocessed = rewriteTemplateEvalToScope(result.code);
|
|
13297
13351
|
}
|
|
13298
13352
|
return transpiler4.transformSync(preprocessed);
|
|
13299
|
-
}, clearEmberCompilerCache = () => {}, getEmberCompiledRoot = (
|
|
13353
|
+
}, clearEmberCompilerCache = () => {}, getEmberCompiledRoot = (_emberDir) => getFrameworkGeneratedDir("ember"), getEmberServerCompiledDir = (emberDir) => join19(getEmberCompiledRoot(emberDir), "server"), getEmberClientCompiledDir = (emberDir) => join19(getEmberCompiledRoot(emberDir), "client");
|
|
13300
13354
|
var init_compileEmber = __esm(() => {
|
|
13355
|
+
init_generatedDir();
|
|
13301
13356
|
transpiler4 = new Transpiler3({
|
|
13302
13357
|
loader: "ts",
|
|
13303
13358
|
target: "browser",
|
|
@@ -13317,7 +13372,7 @@ __export(exports_buildReactVendor, {
|
|
|
13317
13372
|
buildReactVendor: () => buildReactVendor
|
|
13318
13373
|
});
|
|
13319
13374
|
import { existsSync as existsSync19, mkdirSync as mkdirSync7 } from "fs";
|
|
13320
|
-
import { join as
|
|
13375
|
+
import { join as join20, resolve as resolve21 } from "path";
|
|
13321
13376
|
import { rm as rm5 } from "fs/promises";
|
|
13322
13377
|
var {build: bunBuild3 } = globalThis.Bun;
|
|
13323
13378
|
var resolveJsxDevRuntimeCompatPath = () => {
|
|
@@ -13371,14 +13426,14 @@ var resolveJsxDevRuntimeCompatPath = () => {
|
|
|
13371
13426
|
`)}
|
|
13372
13427
|
`;
|
|
13373
13428
|
}, buildReactVendor = async (buildDir) => {
|
|
13374
|
-
const vendorDir =
|
|
13429
|
+
const vendorDir = join20(buildDir, "react", "vendor");
|
|
13375
13430
|
mkdirSync7(vendorDir, { recursive: true });
|
|
13376
|
-
const tmpDir =
|
|
13431
|
+
const tmpDir = join20(buildDir, "_vendor_tmp");
|
|
13377
13432
|
mkdirSync7(tmpDir, { recursive: true });
|
|
13378
13433
|
const specifiers = resolveVendorSpecifiers();
|
|
13379
13434
|
const entrypoints = await Promise.all(specifiers.map(async (specifier) => {
|
|
13380
13435
|
const safeName = toSafeFileName(specifier);
|
|
13381
|
-
const entryPath =
|
|
13436
|
+
const entryPath = join20(tmpDir, `${safeName}.ts`);
|
|
13382
13437
|
const source = await generateEntrySource(specifier);
|
|
13383
13438
|
await Bun.write(entryPath, source);
|
|
13384
13439
|
return entryPath;
|
|
@@ -13443,7 +13498,7 @@ __export(exports_buildAngularVendor, {
|
|
|
13443
13498
|
buildAngularServerVendor: () => buildAngularServerVendor
|
|
13444
13499
|
});
|
|
13445
13500
|
import { mkdirSync as mkdirSync8 } from "fs";
|
|
13446
|
-
import { join as
|
|
13501
|
+
import { join as join21 } from "path";
|
|
13447
13502
|
import { rm as rm6 } from "fs/promises";
|
|
13448
13503
|
var {build: bunBuild4, Glob: Glob6 } = globalThis.Bun;
|
|
13449
13504
|
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) => {
|
|
@@ -13540,14 +13595,14 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
|
|
|
13540
13595
|
await collectTransitiveAngularSpecs([...angular, ...transitiveRoots], angular);
|
|
13541
13596
|
return Array.from(angular).filter(isResolvable2);
|
|
13542
13597
|
}, buildAngularVendor = async (buildDir, directories = [], linkerJitMode = false, depVendorSpecifiers = []) => {
|
|
13543
|
-
const vendorDir =
|
|
13598
|
+
const vendorDir = join21(buildDir, "angular", "vendor");
|
|
13544
13599
|
mkdirSync8(vendorDir, { recursive: true });
|
|
13545
|
-
const tmpDir =
|
|
13600
|
+
const tmpDir = join21(buildDir, "_angular_vendor_tmp");
|
|
13546
13601
|
mkdirSync8(tmpDir, { recursive: true });
|
|
13547
13602
|
const specifiers = await resolveAngularSpecifiers(directories, linkerJitMode);
|
|
13548
13603
|
const entrypoints = await Promise.all(specifiers.map(async (specifier) => {
|
|
13549
13604
|
const safeName = toSafeFileName2(specifier);
|
|
13550
|
-
const entryPath =
|
|
13605
|
+
const entryPath = join21(tmpDir, `${safeName}.ts`);
|
|
13551
13606
|
await Bun.write(entryPath, await generateVendorEntrySource(specifier));
|
|
13552
13607
|
return entryPath;
|
|
13553
13608
|
}));
|
|
@@ -13578,9 +13633,9 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
|
|
|
13578
13633
|
const specifiers = await resolveAngularSpecifiers(directories, linkerJitMode);
|
|
13579
13634
|
return computeAngularVendorPaths(specifiers);
|
|
13580
13635
|
}, buildAngularServerVendor = async (buildDir, directories = [], linkerJitMode = false) => {
|
|
13581
|
-
const vendorDir =
|
|
13636
|
+
const vendorDir = join21(buildDir, "angular", "vendor", "server");
|
|
13582
13637
|
mkdirSync8(vendorDir, { recursive: true });
|
|
13583
|
-
const tmpDir =
|
|
13638
|
+
const tmpDir = join21(buildDir, "_angular_server_vendor_tmp");
|
|
13584
13639
|
mkdirSync8(tmpDir, { recursive: true });
|
|
13585
13640
|
const browserSpecs = await resolveAngularSpecifiers(directories, linkerJitMode);
|
|
13586
13641
|
const allSpecs = new Set(browserSpecs);
|
|
@@ -13591,7 +13646,7 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
|
|
|
13591
13646
|
const specifiers = Array.from(allSpecs);
|
|
13592
13647
|
const entrypoints = await Promise.all(specifiers.map(async (specifier) => {
|
|
13593
13648
|
const safeName = toSafeFileName2(specifier);
|
|
13594
|
-
const entryPath =
|
|
13649
|
+
const entryPath = join21(tmpDir, `${safeName}.ts`);
|
|
13595
13650
|
await Bun.write(entryPath, await generateVendorEntrySource(specifier));
|
|
13596
13651
|
return entryPath;
|
|
13597
13652
|
}));
|
|
@@ -13613,9 +13668,9 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
|
|
|
13613
13668
|
return specifiers;
|
|
13614
13669
|
}, computeAngularServerVendorPaths = (buildDir, specifiers) => {
|
|
13615
13670
|
const paths = {};
|
|
13616
|
-
const vendorDir =
|
|
13671
|
+
const vendorDir = join21(buildDir, "angular", "vendor", "server");
|
|
13617
13672
|
for (const specifier of specifiers) {
|
|
13618
|
-
paths[specifier] =
|
|
13673
|
+
paths[specifier] = join21(vendorDir, `${toSafeFileName2(specifier)}.js`);
|
|
13619
13674
|
}
|
|
13620
13675
|
return paths;
|
|
13621
13676
|
}, computeAngularServerVendorPathsAsync = async (buildDir, directories = [], linkerJitMode = true) => {
|
|
@@ -13671,17 +13726,17 @@ __export(exports_buildVueVendor, {
|
|
|
13671
13726
|
buildVueVendor: () => buildVueVendor
|
|
13672
13727
|
});
|
|
13673
13728
|
import { mkdirSync as mkdirSync9 } from "fs";
|
|
13674
|
-
import { join as
|
|
13729
|
+
import { join as join22 } from "path";
|
|
13675
13730
|
import { rm as rm7 } from "fs/promises";
|
|
13676
13731
|
var {build: bunBuild5 } = globalThis.Bun;
|
|
13677
13732
|
var vueSpecifiers, toSafeFileName3 = (specifier) => specifier.replace(/\//g, "_"), buildVueVendor = async (buildDir) => {
|
|
13678
|
-
const vendorDir =
|
|
13733
|
+
const vendorDir = join22(buildDir, "vue", "vendor");
|
|
13679
13734
|
mkdirSync9(vendorDir, { recursive: true });
|
|
13680
|
-
const tmpDir =
|
|
13735
|
+
const tmpDir = join22(buildDir, "_vue_vendor_tmp");
|
|
13681
13736
|
mkdirSync9(tmpDir, { recursive: true });
|
|
13682
13737
|
const entrypoints = await Promise.all(vueSpecifiers.map(async (specifier) => {
|
|
13683
13738
|
const safeName = toSafeFileName3(specifier);
|
|
13684
|
-
const entryPath =
|
|
13739
|
+
const entryPath = join22(tmpDir, `${safeName}.ts`);
|
|
13685
13740
|
await Bun.write(entryPath, `export * from '${specifier}';
|
|
13686
13741
|
`);
|
|
13687
13742
|
return entryPath;
|
|
@@ -13709,7 +13764,7 @@ var vueSpecifiers, toSafeFileName3 = (specifier) => specifier.replace(/\//g, "_"
|
|
|
13709
13764
|
const { readFileSync: readFileSync14, writeFileSync: writeFileSync8, readdirSync } = await import("fs");
|
|
13710
13765
|
const files = readdirSync(vendorDir).filter((f2) => f2.endsWith(".js"));
|
|
13711
13766
|
for (const file5 of files) {
|
|
13712
|
-
const filePath =
|
|
13767
|
+
const filePath = join22(vendorDir, file5);
|
|
13713
13768
|
const content = readFileSync14(filePath, "utf-8");
|
|
13714
13769
|
if (!content.includes("__VUE_HMR_RUNTIME__"))
|
|
13715
13770
|
continue;
|
|
@@ -13736,7 +13791,7 @@ __export(exports_buildSvelteVendor, {
|
|
|
13736
13791
|
buildSvelteVendor: () => buildSvelteVendor
|
|
13737
13792
|
});
|
|
13738
13793
|
import { mkdirSync as mkdirSync10 } from "fs";
|
|
13739
|
-
import { join as
|
|
13794
|
+
import { join as join23 } from "path";
|
|
13740
13795
|
import { rm as rm8 } from "fs/promises";
|
|
13741
13796
|
var {build: bunBuild6 } = globalThis.Bun;
|
|
13742
13797
|
var svelteSpecifiers, isResolvable3 = (specifier) => {
|
|
@@ -13750,13 +13805,13 @@ var svelteSpecifiers, isResolvable3 = (specifier) => {
|
|
|
13750
13805
|
const specifiers = resolveVendorSpecifiers2();
|
|
13751
13806
|
if (specifiers.length === 0)
|
|
13752
13807
|
return;
|
|
13753
|
-
const vendorDir =
|
|
13808
|
+
const vendorDir = join23(buildDir, "svelte", "vendor");
|
|
13754
13809
|
mkdirSync10(vendorDir, { recursive: true });
|
|
13755
|
-
const tmpDir =
|
|
13810
|
+
const tmpDir = join23(buildDir, "_svelte_vendor_tmp");
|
|
13756
13811
|
mkdirSync10(tmpDir, { recursive: true });
|
|
13757
13812
|
const entrypoints = await Promise.all(specifiers.map(async (specifier) => {
|
|
13758
13813
|
const safeName = toSafeFileName4(specifier);
|
|
13759
|
-
const entryPath =
|
|
13814
|
+
const entryPath = join23(tmpDir, `${safeName}.ts`);
|
|
13760
13815
|
await Bun.write(entryPath, `export * from '${specifier}';
|
|
13761
13816
|
`);
|
|
13762
13817
|
return entryPath;
|
|
@@ -13806,7 +13861,7 @@ __export(exports_rewriteImportsPlugin, {
|
|
|
13806
13861
|
buildWithImportRewrite: () => buildWithImportRewrite
|
|
13807
13862
|
});
|
|
13808
13863
|
import { readdir as readdir3 } from "fs/promises";
|
|
13809
|
-
import { join as
|
|
13864
|
+
import { join as join24 } from "path";
|
|
13810
13865
|
var escapeRegex2 = (str) => str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), jsRewriteImports = (content, replacements) => {
|
|
13811
13866
|
let result = content;
|
|
13812
13867
|
for (const [specifier, webPath] of replacements) {
|
|
@@ -13935,7 +13990,7 @@ ${content}`;
|
|
|
13935
13990
|
const entries = await readdir3(dir);
|
|
13936
13991
|
for (const entry of entries) {
|
|
13937
13992
|
if (entry.endsWith(".js"))
|
|
13938
|
-
allFiles.push(
|
|
13993
|
+
allFiles.push(join24(dir, entry));
|
|
13939
13994
|
}
|
|
13940
13995
|
} catch {}
|
|
13941
13996
|
}
|
|
@@ -13984,7 +14039,7 @@ import {
|
|
|
13984
14039
|
statSync,
|
|
13985
14040
|
writeFileSync as writeFileSync8
|
|
13986
14041
|
} from "fs";
|
|
13987
|
-
import { basename as basename9, dirname as dirname15, extname as extname7, join as
|
|
14042
|
+
import { basename as basename9, dirname as dirname15, extname as extname7, join as join25, relative as relative10, resolve as resolve22 } from "path";
|
|
13988
14043
|
import { cwd, env as env3, exit } from "process";
|
|
13989
14044
|
var {build: bunBuild7, Glob: Glob7 } = globalThis.Bun;
|
|
13990
14045
|
var isDev2, isBuildTraceEnabled = () => {
|
|
@@ -14062,8 +14117,8 @@ var isDev2, isBuildTraceEnabled = () => {
|
|
|
14062
14117
|
mkdirSync11(htmxDestDir, { recursive: true });
|
|
14063
14118
|
const glob = new Glob7("htmx*.min.js");
|
|
14064
14119
|
for (const relPath of glob.scanSync({ cwd: htmxDir })) {
|
|
14065
|
-
const src =
|
|
14066
|
-
const dest =
|
|
14120
|
+
const src = join25(htmxDir, relPath);
|
|
14121
|
+
const dest = join25(htmxDestDir, "htmx.min.js");
|
|
14067
14122
|
copyFileSync(src, dest);
|
|
14068
14123
|
return;
|
|
14069
14124
|
}
|
|
@@ -14138,7 +14193,7 @@ var isDev2, isBuildTraceEnabled = () => {
|
|
|
14138
14193
|
vuePagesPath
|
|
14139
14194
|
}) => {
|
|
14140
14195
|
const { readdirSync: readDir } = await import("fs");
|
|
14141
|
-
const devIndexDir =
|
|
14196
|
+
const devIndexDir = join25(buildPath, "_src_indexes");
|
|
14142
14197
|
mkdirSync11(devIndexDir, { recursive: true });
|
|
14143
14198
|
if (reactIndexesPath && reactPagesPath) {
|
|
14144
14199
|
copyReactDevIndexes(reactIndexesPath, reactPagesPath, devIndexDir, readDir);
|
|
@@ -14156,35 +14211,35 @@ var isDev2, isBuildTraceEnabled = () => {
|
|
|
14156
14211
|
const indexFiles = readDir(reactIndexesPath).filter((file5) => file5.endsWith(".tsx"));
|
|
14157
14212
|
const pagesRel = relative10(process.cwd(), resolve22(reactPagesPath)).replace(/\\/g, "/");
|
|
14158
14213
|
for (const file5 of indexFiles) {
|
|
14159
|
-
let content = readFileSync14(
|
|
14214
|
+
let content = readFileSync14(join25(reactIndexesPath, file5), "utf-8");
|
|
14160
14215
|
content = content.replace(/from\s*['"]([^'"]*\/pages\/([^'"]+))['"]/g, (_match, _fullPath, componentName) => `from '/@src/${pagesRel}/${componentName}'`);
|
|
14161
|
-
writeFileSync8(
|
|
14216
|
+
writeFileSync8(join25(devIndexDir, file5), content);
|
|
14162
14217
|
}
|
|
14163
14218
|
}, copySvelteDevIndexes = (svelteDir, sveltePagesPath, svelteEntries, devIndexDir) => {
|
|
14164
|
-
const svelteIndexDir =
|
|
14219
|
+
const svelteIndexDir = join25(getFrameworkGeneratedDir("svelte"), "indexes");
|
|
14165
14220
|
const sveltePageEntries = svelteEntries.filter((file5) => resolve22(file5).startsWith(resolve22(sveltePagesPath)));
|
|
14166
14221
|
for (const entry of sveltePageEntries) {
|
|
14167
14222
|
const name = basename9(entry).replace(/\.svelte(\.(ts|js))?$/, "");
|
|
14168
|
-
const indexFile =
|
|
14223
|
+
const indexFile = join25(svelteIndexDir, "pages", `${name}.js`);
|
|
14169
14224
|
if (!existsSync20(indexFile))
|
|
14170
14225
|
continue;
|
|
14171
14226
|
let content = readFileSync14(indexFile, "utf-8");
|
|
14172
14227
|
const srcRel = relative10(process.cwd(), resolve22(entry)).replace(/\\/g, "/");
|
|
14173
14228
|
content = content.replace(/import\s+Component\s+from\s+['"]([^'"]+)['"]/, `import Component from "/@src/${srcRel}"`);
|
|
14174
|
-
writeFileSync8(
|
|
14229
|
+
writeFileSync8(join25(devIndexDir, `${name}.svelte.js`), content);
|
|
14175
14230
|
}
|
|
14176
14231
|
}, copyVueDevIndexes = (vueDir, vuePagesPath, vueEntries, devIndexDir) => {
|
|
14177
|
-
const vueIndexDir =
|
|
14232
|
+
const vueIndexDir = join25(getFrameworkGeneratedDir("vue"), "indexes");
|
|
14178
14233
|
const vuePageEntries = vueEntries.filter((file5) => resolve22(file5).startsWith(resolve22(vuePagesPath)));
|
|
14179
14234
|
for (const entry of vuePageEntries) {
|
|
14180
14235
|
const name = basename9(entry, ".vue");
|
|
14181
|
-
const indexFile =
|
|
14236
|
+
const indexFile = join25(vueIndexDir, `${name}.js`);
|
|
14182
14237
|
if (!existsSync20(indexFile))
|
|
14183
14238
|
continue;
|
|
14184
14239
|
let content = readFileSync14(indexFile, "utf-8");
|
|
14185
14240
|
const srcRel = relative10(process.cwd(), resolve22(entry)).replace(/\\/g, "/");
|
|
14186
14241
|
content = content.replace(/import\s+Comp(?:\s*,\s*\*\s+as\s+\w+)?\s+from\s+['"]([^'"]+)['"]/, (match) => match.replace(/from\s+['"][^'"]+['"]/, `from "/@src/${srcRel}"`));
|
|
14187
|
-
writeFileSync8(
|
|
14242
|
+
writeFileSync8(join25(devIndexDir, `${name}.vue.js`), content);
|
|
14188
14243
|
}
|
|
14189
14244
|
}, resolveVueRuntimeId = (content, firstUseName, outputPath, projectRoot) => {
|
|
14190
14245
|
const varIdx = content.indexOf(`var ${firstUseName} =`);
|
|
@@ -14406,10 +14461,10 @@ ${content.slice(firstUseIdx)}`;
|
|
|
14406
14461
|
restoreTracePhase();
|
|
14407
14462
|
return;
|
|
14408
14463
|
}
|
|
14409
|
-
const traceDir =
|
|
14464
|
+
const traceDir = join25(buildPath2, ".absolute-trace");
|
|
14410
14465
|
const timestamp = new Date().toISOString().replace(/[:.]/g, "-");
|
|
14411
14466
|
mkdirSync11(traceDir, { recursive: true });
|
|
14412
|
-
writeFileSync8(
|
|
14467
|
+
writeFileSync8(join25(traceDir, `build-trace-${timestamp}.json`), JSON.stringify({
|
|
14413
14468
|
events: traceEvents,
|
|
14414
14469
|
frameworks: traceFrameworkNames,
|
|
14415
14470
|
generatedAt: new Date().toISOString(),
|
|
@@ -14440,15 +14495,15 @@ ${content.slice(firstUseIdx)}`;
|
|
|
14440
14495
|
const stylesPath = typeof stylesConfig === "string" ? stylesConfig : stylesConfig?.path;
|
|
14441
14496
|
const stylesIgnore = typeof stylesConfig === "object" ? stylesConfig.ignore : undefined;
|
|
14442
14497
|
const stylesDir = stylesPath && validateSafePath(stylesPath, projectRoot);
|
|
14443
|
-
const reactIndexesPath = reactDir &&
|
|
14444
|
-
const reactPagesPath = reactDir &&
|
|
14445
|
-
const htmlPagesPath = htmlDir &&
|
|
14446
|
-
const htmlScriptsPath = htmlDir &&
|
|
14447
|
-
const sveltePagesPath = svelteDir &&
|
|
14448
|
-
const vuePagesPath = vueDir &&
|
|
14449
|
-
const htmxPagesPath = htmxDir &&
|
|
14450
|
-
const angularPagesPath = angularDir &&
|
|
14451
|
-
const emberPagesPath = emberDir &&
|
|
14498
|
+
const reactIndexesPath = reactDir && join25(getFrameworkGeneratedDir("react"), "indexes");
|
|
14499
|
+
const reactPagesPath = reactDir && join25(reactDir, "pages");
|
|
14500
|
+
const htmlPagesPath = htmlDir && join25(htmlDir, "pages");
|
|
14501
|
+
const htmlScriptsPath = htmlDir && join25(htmlDir, "scripts");
|
|
14502
|
+
const sveltePagesPath = svelteDir && join25(svelteDir, "pages");
|
|
14503
|
+
const vuePagesPath = vueDir && join25(vueDir, "pages");
|
|
14504
|
+
const htmxPagesPath = htmxDir && join25(htmxDir, "pages");
|
|
14505
|
+
const angularPagesPath = angularDir && join25(angularDir, "pages");
|
|
14506
|
+
const emberPagesPath = emberDir && join25(emberDir, "pages");
|
|
14452
14507
|
const frontends = [
|
|
14453
14508
|
reactDir,
|
|
14454
14509
|
htmlDir,
|
|
@@ -14475,36 +14530,40 @@ ${content.slice(firstUseIdx)}`;
|
|
|
14475
14530
|
mode: mode ?? (isDev2 ? "development" : "production"),
|
|
14476
14531
|
tailwind: Boolean(tailwind)
|
|
14477
14532
|
});
|
|
14533
|
+
const generatedRoot = getGeneratedRoot(projectRoot);
|
|
14478
14534
|
const sourceClientRoots = [
|
|
14479
|
-
reactDir,
|
|
14480
|
-
svelteDir,
|
|
14481
14535
|
htmlDir,
|
|
14482
|
-
|
|
14483
|
-
angularDir,
|
|
14536
|
+
htmxDir,
|
|
14484
14537
|
islandBootstrapPath && dirname15(islandBootstrapPath)
|
|
14485
14538
|
].filter((dir) => Boolean(dir));
|
|
14486
|
-
const
|
|
14539
|
+
const usesGenerated = Boolean(reactDir) || Boolean(svelteDir) || Boolean(vueDir) || Boolean(angularDir);
|
|
14540
|
+
if (usesGenerated)
|
|
14541
|
+
sourceClientRoots.push(generatedRoot);
|
|
14542
|
+
const clientRoot = sourceClientRoots.length === 1 ? sourceClientRoots[0] ?? projectRoot : commonAncestor(sourceClientRoots, projectRoot);
|
|
14487
14543
|
const serverDirMap = [];
|
|
14488
14544
|
if (svelteDir)
|
|
14489
14545
|
serverDirMap.push({
|
|
14490
|
-
dir:
|
|
14491
|
-
subdir:
|
|
14546
|
+
dir: getFrameworkGeneratedDir("svelte", projectRoot),
|
|
14547
|
+
subdir: "server"
|
|
14492
14548
|
});
|
|
14493
14549
|
if (vueDir)
|
|
14494
14550
|
serverDirMap.push({
|
|
14495
|
-
dir:
|
|
14496
|
-
subdir:
|
|
14551
|
+
dir: getFrameworkGeneratedDir("vue", projectRoot),
|
|
14552
|
+
subdir: "server"
|
|
14497
14553
|
});
|
|
14498
14554
|
if (angularDir)
|
|
14499
|
-
serverDirMap.push({
|
|
14555
|
+
serverDirMap.push({
|
|
14556
|
+
dir: getFrameworkGeneratedDir("angular", projectRoot),
|
|
14557
|
+
subdir: ""
|
|
14558
|
+
});
|
|
14500
14559
|
let serverOutDir;
|
|
14501
14560
|
let serverRoot;
|
|
14502
14561
|
if (serverDirMap.length === 1) {
|
|
14503
14562
|
const [firstEntry] = serverDirMap;
|
|
14504
14563
|
if (!firstEntry)
|
|
14505
14564
|
throw new Error("Expected at least one server directory entry");
|
|
14506
|
-
serverRoot =
|
|
14507
|
-
serverOutDir =
|
|
14565
|
+
serverRoot = join25(firstEntry.dir, firstEntry.subdir);
|
|
14566
|
+
serverOutDir = join25(buildPath, basename9(firstEntry.dir));
|
|
14508
14567
|
} else if (serverDirMap.length > 1) {
|
|
14509
14568
|
serverRoot = commonAncestor(serverDirMap.map((entry) => entry.dir), projectRoot);
|
|
14510
14569
|
serverOutDir = buildPath;
|
|
@@ -14532,7 +14591,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
14532
14591
|
await tracePhase("react/index-generation", () => generateReactIndexFiles(reactPagesPath, reactIndexesPath, hmr));
|
|
14533
14592
|
}
|
|
14534
14593
|
if (assetsPath && (!isIncremental || normalizedIncrementalFiles?.some((f2) => f2.includes("/assets/")))) {
|
|
14535
|
-
await tracePhase("assets/copy", () => cpSync(assetsPath,
|
|
14594
|
+
await tracePhase("assets/copy", () => cpSync(assetsPath, join25(buildPath, "assets"), {
|
|
14536
14595
|
force: true,
|
|
14537
14596
|
recursive: true
|
|
14538
14597
|
}));
|
|
@@ -14586,7 +14645,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
14586
14645
|
const reactEntries = isIncremental && reactIndexesPath && reactPagesPath ? filterToIncrementalEntries(allReactEntries, (entry) => {
|
|
14587
14646
|
if (entry.startsWith(resolve22(reactIndexesPath))) {
|
|
14588
14647
|
const pageName = basename9(entry, ".tsx");
|
|
14589
|
-
return
|
|
14648
|
+
return join25(reactPagesPath, `${pageName}.tsx`);
|
|
14590
14649
|
}
|
|
14591
14650
|
return null;
|
|
14592
14651
|
}) : allReactEntries;
|
|
@@ -14690,7 +14749,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
14690
14749
|
const compileReactConventions = async () => {
|
|
14691
14750
|
if (reactConventionSources.length === 0)
|
|
14692
14751
|
return emptyStringArray;
|
|
14693
|
-
const destDir =
|
|
14752
|
+
const destDir = join25(buildPath, "conventions", "react");
|
|
14694
14753
|
rmSync2(destDir, { force: true, recursive: true });
|
|
14695
14754
|
mkdirSync11(destDir, { recursive: true });
|
|
14696
14755
|
const destPaths = [];
|
|
@@ -14734,7 +14793,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
14734
14793
|
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 }
|
|
14735
14794
|
]);
|
|
14736
14795
|
const bundleConventionFiles = async (framework, compiledPaths) => {
|
|
14737
|
-
const destDir =
|
|
14796
|
+
const destDir = join25(buildPath, "conventions", framework);
|
|
14738
14797
|
rmSync2(destDir, { force: true, recursive: true });
|
|
14739
14798
|
mkdirSync11(destDir, { recursive: true });
|
|
14740
14799
|
const destPaths = [];
|
|
@@ -14807,7 +14866,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
14807
14866
|
}
|
|
14808
14867
|
})) : {
|
|
14809
14868
|
entries: [],
|
|
14810
|
-
generatedRoot:
|
|
14869
|
+
generatedRoot: join25(buildPath, "_island_entries")
|
|
14811
14870
|
};
|
|
14812
14871
|
const islandClientEntryPoints = islandEntryResult.entries.map((entry) => entry.entryPath);
|
|
14813
14872
|
if (serverEntryPoints.length === 0 && reactClientEntryPoints.length === 0 && nonReactClientEntryPoints.length === 0 && islandClientEntryPoints.length === 0 && htmxDir === undefined && htmlDir === undefined) {
|
|
@@ -14843,7 +14902,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
14843
14902
|
return {};
|
|
14844
14903
|
}
|
|
14845
14904
|
if (hmr && reactIndexesPath && reactClientEntryPoints.length > 0) {
|
|
14846
|
-
const refreshEntry =
|
|
14905
|
+
const refreshEntry = join25(reactIndexesPath, "_refresh.tsx");
|
|
14847
14906
|
if (!reactClientEntryPoints.includes(refreshEntry))
|
|
14848
14907
|
reactClientEntryPoints.push(refreshEntry);
|
|
14849
14908
|
}
|
|
@@ -14942,19 +15001,19 @@ ${content.slice(firstUseIdx)}`;
|
|
|
14942
15001
|
throw: false
|
|
14943
15002
|
}, resolveBunBuildOverride(bunBuildConfig, "reactClient")) : undefined;
|
|
14944
15003
|
if (reactDir && reactClientEntryPoints.length > 0) {
|
|
14945
|
-
rmSync2(
|
|
15004
|
+
rmSync2(join25(buildPath, "react", "generated", "indexes"), {
|
|
14946
15005
|
force: true,
|
|
14947
15006
|
recursive: true
|
|
14948
15007
|
});
|
|
14949
15008
|
}
|
|
14950
15009
|
if (angularDir && angularClientPaths.length > 0) {
|
|
14951
|
-
rmSync2(
|
|
15010
|
+
rmSync2(join25(buildPath, "angular", "indexes"), {
|
|
14952
15011
|
force: true,
|
|
14953
15012
|
recursive: true
|
|
14954
15013
|
});
|
|
14955
15014
|
}
|
|
14956
15015
|
if (islandClientEntryPoints.length > 0) {
|
|
14957
|
-
rmSync2(
|
|
15016
|
+
rmSync2(join25(buildPath, "islands"), {
|
|
14958
15017
|
force: true,
|
|
14959
15018
|
recursive: true
|
|
14960
15019
|
});
|
|
@@ -15023,7 +15082,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
15023
15082
|
globalCssEntries.length > 0 ? tracePhase("bun/global-css", () => bunBuild7(mergeBunBuildConfig({
|
|
15024
15083
|
entrypoints: globalCssEntries,
|
|
15025
15084
|
naming: `[dir]/[name].[hash].[ext]`,
|
|
15026
|
-
outdir: stylesDir ?
|
|
15085
|
+
outdir: stylesDir ? join25(buildPath, basename9(stylesDir)) : buildPath,
|
|
15027
15086
|
plugins: [stylePreprocessorPlugin2],
|
|
15028
15087
|
root: stylesDir || clientRoot,
|
|
15029
15088
|
target: "browser",
|
|
@@ -15032,7 +15091,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
15032
15091
|
vueCssPaths.length > 0 ? tracePhase("bun/vue-css", () => bunBuild7(mergeBunBuildConfig({
|
|
15033
15092
|
entrypoints: vueCssPaths,
|
|
15034
15093
|
naming: `[name].[hash].[ext]`,
|
|
15035
|
-
outdir:
|
|
15094
|
+
outdir: join25(buildPath, assetsPath ? basename9(assetsPath) : "assets", "css"),
|
|
15036
15095
|
target: "browser",
|
|
15037
15096
|
throw: false
|
|
15038
15097
|
}, resolveBunBuildOverride(bunBuildConfig, "vueCss")))) : undefined
|
|
@@ -15183,7 +15242,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
15183
15242
|
const processHtmlPages = async () => {
|
|
15184
15243
|
if (!(htmlDir && htmlPagesPath))
|
|
15185
15244
|
return;
|
|
15186
|
-
const outputHtmlPages = isSingle ?
|
|
15245
|
+
const outputHtmlPages = isSingle ? join25(buildPath, "pages") : join25(buildPath, basename9(htmlDir), "pages");
|
|
15187
15246
|
mkdirSync11(outputHtmlPages, { recursive: true });
|
|
15188
15247
|
cpSync(htmlPagesPath, outputHtmlPages, {
|
|
15189
15248
|
force: true,
|
|
@@ -15205,14 +15264,14 @@ ${content.slice(firstUseIdx)}`;
|
|
|
15205
15264
|
const processHtmxPages = async () => {
|
|
15206
15265
|
if (!(htmxDir && htmxPagesPath))
|
|
15207
15266
|
return;
|
|
15208
|
-
const outputHtmxPages = isSingle ?
|
|
15267
|
+
const outputHtmxPages = isSingle ? join25(buildPath, "pages") : join25(buildPath, basename9(htmxDir), "pages");
|
|
15209
15268
|
mkdirSync11(outputHtmxPages, { recursive: true });
|
|
15210
15269
|
cpSync(htmxPagesPath, outputHtmxPages, {
|
|
15211
15270
|
force: true,
|
|
15212
15271
|
recursive: true
|
|
15213
15272
|
});
|
|
15214
15273
|
if (shouldCopyHtmx) {
|
|
15215
|
-
const htmxDestDir = isSingle ? buildPath :
|
|
15274
|
+
const htmxDestDir = isSingle ? buildPath : join25(buildPath, basename9(htmxDir));
|
|
15216
15275
|
copyHtmxVendor(htmxDir, htmxDestDir);
|
|
15217
15276
|
}
|
|
15218
15277
|
if (shouldUpdateHtmxAssetPaths) {
|
|
@@ -15273,9 +15332,9 @@ ${content.slice(firstUseIdx)}`;
|
|
|
15273
15332
|
writeBuildTrace(buildPath);
|
|
15274
15333
|
return { conventions: conventionsMap, manifest };
|
|
15275
15334
|
}
|
|
15276
|
-
writeFileSync8(
|
|
15335
|
+
writeFileSync8(join25(buildPath, "manifest.json"), JSON.stringify(manifest, null, "\t"));
|
|
15277
15336
|
if (Object.keys(conventionsMap).length > 0) {
|
|
15278
|
-
writeFileSync8(
|
|
15337
|
+
writeFileSync8(join25(buildPath, "conventions.json"), JSON.stringify(conventionsMap, null, "\t"));
|
|
15279
15338
|
}
|
|
15280
15339
|
writeBuildTrace(buildPath);
|
|
15281
15340
|
if (tailwind && mode === "production") {
|
|
@@ -15310,6 +15369,7 @@ var init_build = __esm(() => {
|
|
|
15310
15369
|
init_cleanStaleOutputs();
|
|
15311
15370
|
init_cleanup();
|
|
15312
15371
|
init_commonAncestor();
|
|
15372
|
+
init_generatedDir();
|
|
15313
15373
|
init_buildDirectoryLock();
|
|
15314
15374
|
init_logger();
|
|
15315
15375
|
init_validateSafePath();
|
|
@@ -15373,7 +15433,7 @@ var init_build = __esm(() => {
|
|
|
15373
15433
|
|
|
15374
15434
|
// src/build/buildEmberVendor.ts
|
|
15375
15435
|
import { mkdirSync as mkdirSync12, existsSync as existsSync21 } from "fs";
|
|
15376
|
-
import { join as
|
|
15436
|
+
import { join as join26 } from "path";
|
|
15377
15437
|
import { rm as rm9 } from "fs/promises";
|
|
15378
15438
|
var {build: bunBuild8 } = globalThis.Bun;
|
|
15379
15439
|
var toSafeFileName5 = (specifier) => specifier.replace(/^@/, "").replace(/\//g, "_"), generateMacrosShim = () => `// Generated shim for @embroider/macros \u2014 provides minimal runtime
|
|
@@ -15425,7 +15485,7 @@ export const importSync = (specifier) => {
|
|
|
15425
15485
|
if (standaloneSpecifiers.has(specifier)) {
|
|
15426
15486
|
return { resolveTo: specifier, specifier };
|
|
15427
15487
|
}
|
|
15428
|
-
const emberInternalPath =
|
|
15488
|
+
const emberInternalPath = join26(cwd2, "node_modules/ember-source/dist/packages", specifier, "index.js");
|
|
15429
15489
|
if (!existsSync21(emberInternalPath)) {
|
|
15430
15490
|
throw new Error(`Ember vendor build: cannot find ${specifier} at ${emberInternalPath}. ` + `Is ember-source installed and at least 6.12?`);
|
|
15431
15491
|
}
|
|
@@ -15457,7 +15517,7 @@ export const importSync = (specifier) => {
|
|
|
15457
15517
|
if (standalonePackages.has(args.path)) {
|
|
15458
15518
|
return;
|
|
15459
15519
|
}
|
|
15460
|
-
const internal =
|
|
15520
|
+
const internal = join26(cwd2, "node_modules/ember-source/dist/packages", args.path, "index.js");
|
|
15461
15521
|
if (existsSync21(internal)) {
|
|
15462
15522
|
return { path: internal };
|
|
15463
15523
|
}
|
|
@@ -15465,16 +15525,16 @@ export const importSync = (specifier) => {
|
|
|
15465
15525
|
});
|
|
15466
15526
|
}
|
|
15467
15527
|
}), buildEmberVendor = async (buildDir, cwd2 = process.cwd()) => {
|
|
15468
|
-
const vendorDir =
|
|
15528
|
+
const vendorDir = join26(buildDir, "ember", "vendor");
|
|
15469
15529
|
mkdirSync12(vendorDir, { recursive: true });
|
|
15470
|
-
const tmpDir =
|
|
15530
|
+
const tmpDir = join26(buildDir, "_ember_vendor_tmp");
|
|
15471
15531
|
mkdirSync12(tmpDir, { recursive: true });
|
|
15472
|
-
const macrosShimPath =
|
|
15532
|
+
const macrosShimPath = join26(tmpDir, "embroider_macros_shim.js");
|
|
15473
15533
|
await Bun.write(macrosShimPath, generateMacrosShim());
|
|
15474
15534
|
const resolutions = REQUIRED_EMBER_SPECIFIERS.map((specifier) => resolveEmberSpecifier(specifier, cwd2));
|
|
15475
15535
|
const entrypoints = await Promise.all(resolutions.map(async (resolution) => {
|
|
15476
15536
|
const safeName = toSafeFileName5(resolution.specifier);
|
|
15477
|
-
const entryPath =
|
|
15537
|
+
const entryPath = join26(tmpDir, `${safeName}.js`);
|
|
15478
15538
|
const source = resolution.specifier === "@embroider/macros" ? `export * from ${JSON.stringify(macrosShimPath)};
|
|
15479
15539
|
` : generateVendorEntrySource2(resolution);
|
|
15480
15540
|
await Bun.write(entryPath, source);
|
|
@@ -16008,7 +16068,7 @@ var init_pathUtils = __esm(() => {
|
|
|
16008
16068
|
// src/dev/fileWatcher.ts
|
|
16009
16069
|
import { watch } from "fs";
|
|
16010
16070
|
import { existsSync as existsSync24 } from "fs";
|
|
16011
|
-
import { join as
|
|
16071
|
+
import { join as join27, resolve as resolve26 } from "path";
|
|
16012
16072
|
var safeRemoveFromGraph = (graph, fullPath) => {
|
|
16013
16073
|
try {
|
|
16014
16074
|
removeFileFromGraph(graph, fullPath);
|
|
@@ -16035,7 +16095,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
16035
16095
|
if (shouldSkipFilename(filename, isStylesDir)) {
|
|
16036
16096
|
return;
|
|
16037
16097
|
}
|
|
16038
|
-
const fullPath =
|
|
16098
|
+
const fullPath = join27(absolutePath, filename).replace(/\\/g, "/");
|
|
16039
16099
|
if (shouldIgnorePath(fullPath, state.resolvedPaths)) {
|
|
16040
16100
|
return;
|
|
16041
16101
|
}
|
|
@@ -16730,7 +16790,7 @@ __export(exports_moduleServer, {
|
|
|
16730
16790
|
SRC_URL_PREFIX: () => SRC_URL_PREFIX
|
|
16731
16791
|
});
|
|
16732
16792
|
import { existsSync as existsSync25, readFileSync as readFileSync18, statSync as statSync2 } from "fs";
|
|
16733
|
-
import { basename as basename12, dirname as dirname16, extname as extname8, join as
|
|
16793
|
+
import { basename as basename12, dirname as dirname16, extname as extname8, join as join28, resolve as resolve30, relative as relative11 } from "path";
|
|
16734
16794
|
var SRC_PREFIX = "/@src/", jsTranspiler2, tsTranspiler2, tsxTranspiler, TRANSPILABLE, ALL_EXPORTS_RE, STRING_CONTENTS_RE, preserveTypeExports = (originalSource, transpiled, valueExports) => {
|
|
16735
16795
|
const codeOnly = originalSource.replace(STRING_CONTENTS_RE, '""');
|
|
16736
16796
|
const allExports = [];
|
|
@@ -16800,7 +16860,7 @@ ${stubs}
|
|
|
16800
16860
|
const subpath = isScoped ? parts.slice(2).join("/") : parts.slice(1).join("/");
|
|
16801
16861
|
if (!subpath) {
|
|
16802
16862
|
const pkgDir = resolve30(projectRoot, "node_modules", packageName ?? "");
|
|
16803
|
-
const pkgJsonPath =
|
|
16863
|
+
const pkgJsonPath = join28(pkgDir, "package.json");
|
|
16804
16864
|
if (existsSync25(pkgJsonPath)) {
|
|
16805
16865
|
const pkg = JSON.parse(readFileSync18(pkgJsonPath, "utf-8"));
|
|
16806
16866
|
const esmEntry = typeof pkg.module === "string" && pkg.module || typeof pkg.browser === "string" && pkg.browser;
|
|
@@ -18020,15 +18080,17 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
18020
18080
|
});
|
|
18021
18081
|
return Array.from(resolvedPages);
|
|
18022
18082
|
}, computeClientRoot = async (resolvedPaths) => {
|
|
18083
|
+
const { getGeneratedRoot: getGeneratedRoot2 } = await Promise.resolve().then(() => (init_generatedDir(), exports_generatedDir));
|
|
18084
|
+
const projectRoot = process.cwd();
|
|
18023
18085
|
const clientRoots = [
|
|
18024
|
-
resolvedPaths.reactDir,
|
|
18025
|
-
resolvedPaths.svelteDir,
|
|
18026
18086
|
resolvedPaths.htmlDir,
|
|
18027
|
-
resolvedPaths.
|
|
18028
|
-
resolvedPaths.angularDir
|
|
18087
|
+
resolvedPaths.htmxDir
|
|
18029
18088
|
].filter((dir) => Boolean(dir));
|
|
18089
|
+
const usesGenerated = Boolean(resolvedPaths.reactDir) || Boolean(resolvedPaths.svelteDir) || Boolean(resolvedPaths.vueDir) || Boolean(resolvedPaths.angularDir);
|
|
18090
|
+
if (usesGenerated)
|
|
18091
|
+
clientRoots.push(getGeneratedRoot2(projectRoot));
|
|
18030
18092
|
const { commonAncestor: commonAncestor2 } = await Promise.resolve().then(() => (init_commonAncestor(), exports_commonAncestor));
|
|
18031
|
-
return clientRoots.length === 1 ? clientRoots[0] ??
|
|
18093
|
+
return clientRoots.length === 1 ? clientRoots[0] ?? projectRoot : commonAncestor2(clientRoots, projectRoot);
|
|
18032
18094
|
}, updateServerManifestEntry = (state, artifact) => {
|
|
18033
18095
|
const fileWithHash = basename13(artifact.path);
|
|
18034
18096
|
const [baseName] = fileWithHash.split(`.${artifact.hash}.`);
|
|
@@ -18273,7 +18335,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
18273
18335
|
const { svelteServerPaths, svelteIndexPaths, svelteClientPaths } = await compileSvelte2(svelteFiles, svelteDir, new Map, true, getStyleTransformConfig(state.config));
|
|
18274
18336
|
const serverEntries = [...svelteServerPaths];
|
|
18275
18337
|
const clientEntries = [...svelteIndexPaths, ...svelteClientPaths];
|
|
18276
|
-
const
|
|
18338
|
+
const { getFrameworkGeneratedDir: getFrameworkGeneratedDir2 } = await Promise.resolve().then(() => (init_generatedDir(), exports_generatedDir));
|
|
18339
|
+
const serverRoot = resolve33(getFrameworkGeneratedDir2("svelte"), "server");
|
|
18277
18340
|
const serverOutDir = resolve33(buildDir, basename13(svelteDir));
|
|
18278
18341
|
const [serverResult, clientResult] = await Promise.all([
|
|
18279
18342
|
serverEntries.length > 0 ? bunBuild9({
|
|
@@ -19285,7 +19348,7 @@ __export(exports_buildDepVendor, {
|
|
|
19285
19348
|
buildDepVendor: () => buildDepVendor
|
|
19286
19349
|
});
|
|
19287
19350
|
import { mkdirSync as mkdirSync13 } from "fs";
|
|
19288
|
-
import { join as
|
|
19351
|
+
import { join as join29 } from "path";
|
|
19289
19352
|
import { rm as rm10 } from "fs/promises";
|
|
19290
19353
|
var {build: bunBuild9, Glob: Glob9 } = globalThis.Bun;
|
|
19291
19354
|
var toSafeFileName6 = (specifier) => {
|
|
@@ -19396,7 +19459,7 @@ var toSafeFileName6 = (specifier) => {
|
|
|
19396
19459
|
}), buildDepVendorPass = async (specifiers, vendorDir, tmpDir) => {
|
|
19397
19460
|
const entries = await Promise.all(specifiers.map(async (specifier) => {
|
|
19398
19461
|
const safeName = toSafeFileName6(specifier);
|
|
19399
|
-
const entryPath =
|
|
19462
|
+
const entryPath = join29(tmpDir, `${safeName}.ts`);
|
|
19400
19463
|
await Bun.write(entryPath, await generateVendorEntrySource(specifier));
|
|
19401
19464
|
return { entryPath, specifier };
|
|
19402
19465
|
}));
|
|
@@ -19457,9 +19520,9 @@ var toSafeFileName6 = (specifier) => {
|
|
|
19457
19520
|
const { dep: initialSpecs, framework: frameworkRoots } = await scanBareImports(directories);
|
|
19458
19521
|
if (initialSpecs.length === 0 && frameworkRoots.length === 0)
|
|
19459
19522
|
return {};
|
|
19460
|
-
const vendorDir =
|
|
19523
|
+
const vendorDir = join29(buildDir, "vendor");
|
|
19461
19524
|
mkdirSync13(vendorDir, { recursive: true });
|
|
19462
|
-
const tmpDir =
|
|
19525
|
+
const tmpDir = join29(buildDir, "_dep_vendor_tmp");
|
|
19463
19526
|
mkdirSync13(tmpDir, { recursive: true });
|
|
19464
19527
|
const allSpecs = new Set(initialSpecs);
|
|
19465
19528
|
const alreadyScanned = new Set;
|
|
@@ -20038,12 +20101,12 @@ __export(exports_devtoolsJson, {
|
|
|
20038
20101
|
devtoolsJson: () => devtoolsJson
|
|
20039
20102
|
});
|
|
20040
20103
|
import { existsSync as existsSync27, mkdirSync as mkdirSync14, readFileSync as readFileSync19, writeFileSync as writeFileSync9 } from "fs";
|
|
20041
|
-
import { dirname as dirname18, join as
|
|
20104
|
+
import { dirname as dirname18, join as join30, resolve as resolve35 } from "path";
|
|
20042
20105
|
import { Elysia as Elysia3 } from "elysia";
|
|
20043
20106
|
var ENDPOINT = "/.well-known/appspecific/com.chrome.devtools.json", UUID_CACHE_KEY = "__absoluteDevtoolsWorkspaceUuid", getGlobalUuid = () => Reflect.get(globalThis, UUID_CACHE_KEY), setGlobalUuid = (uuid) => {
|
|
20044
20107
|
Reflect.set(globalThis, UUID_CACHE_KEY, uuid);
|
|
20045
20108
|
return uuid;
|
|
20046
|
-
}, isUuidV4 = (value) => /^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(value), resolveDevtoolsUuidCachePath = (buildDir, uuidCachePath) => resolve35(uuidCachePath ??
|
|
20109
|
+
}, isUuidV4 = (value) => /^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(value), resolveDevtoolsUuidCachePath = (buildDir, uuidCachePath) => resolve35(uuidCachePath ?? join30(buildDir, ".absolute", "chrome-devtools-workspace-uuid")), readCachedUuid = (cachePath) => {
|
|
20047
20110
|
if (!existsSync27(cachePath))
|
|
20048
20111
|
return null;
|
|
20049
20112
|
try {
|
|
@@ -20082,11 +20145,11 @@ var ENDPOINT = "/.well-known/appspecific/com.chrome.devtools.json", UUID_CACHE_K
|
|
|
20082
20145
|
if (process.env.WSL_DISTRO_NAME) {
|
|
20083
20146
|
const distro = process.env.WSL_DISTRO_NAME;
|
|
20084
20147
|
const withoutLeadingSlash = root.replace(/^\//, "");
|
|
20085
|
-
return
|
|
20148
|
+
return join30("\\\\wsl.localhost", distro, withoutLeadingSlash).replace(/\//g, "\\");
|
|
20086
20149
|
}
|
|
20087
20150
|
if (process.env.DOCKER_DESKTOP && !root.startsWith("\\\\")) {
|
|
20088
20151
|
const withoutLeadingSlash = root.replace(/^\//, "");
|
|
20089
|
-
return
|
|
20152
|
+
return join30("\\\\wsl.localhost", "docker-desktop-data", withoutLeadingSlash).replace(/\//g, "\\");
|
|
20090
20153
|
}
|
|
20091
20154
|
return root;
|
|
20092
20155
|
};
|
|
@@ -20403,7 +20466,7 @@ __export(exports_prerender, {
|
|
|
20403
20466
|
PRERENDER_BYPASS_HEADER: () => PRERENDER_BYPASS_HEADER
|
|
20404
20467
|
});
|
|
20405
20468
|
import { mkdirSync as mkdirSync15, readFileSync as readFileSync20 } from "fs";
|
|
20406
|
-
import { join as
|
|
20469
|
+
import { join as join31 } from "path";
|
|
20407
20470
|
var SERVER_OUTPUT_LIMIT = 4000, STARTUP_POLL_INTERVAL_MS = 100, DEFAULT_STARTUP_TIMEOUT_MS = 30000, PRERENDER_BYPASS_HEADER = "X-Absolute-Prerender-Bypass", routeToFilename = (route) => route === "/" ? "index.html" : `${route.slice(1).replace(/\//g, "-")}.html`, writeTimestamp = async (htmlPath) => {
|
|
20408
20471
|
const metaPath = htmlPath.replace(/\.html$/, ".meta");
|
|
20409
20472
|
await Bun.write(metaPath, String(Date.now()));
|
|
@@ -20469,7 +20532,7 @@ var SERVER_OUTPUT_LIMIT = 4000, STARTUP_POLL_INTERVAL_MS = 100, DEFAULT_STARTUP_
|
|
|
20469
20532
|
return false;
|
|
20470
20533
|
const html = await res.text();
|
|
20471
20534
|
const fileName = routeToFilename(route);
|
|
20472
|
-
const filePath =
|
|
20535
|
+
const filePath = join31(prerenderDir, fileName);
|
|
20473
20536
|
await Bun.write(filePath, html);
|
|
20474
20537
|
await writeTimestamp(filePath);
|
|
20475
20538
|
return true;
|
|
@@ -20495,13 +20558,13 @@ var SERVER_OUTPUT_LIMIT = 4000, STARTUP_POLL_INTERVAL_MS = 100, DEFAULT_STARTUP_
|
|
|
20495
20558
|
}
|
|
20496
20559
|
const html = await res.text();
|
|
20497
20560
|
const fileName = routeToFilename(route);
|
|
20498
|
-
const filePath =
|
|
20561
|
+
const filePath = join31(prerenderDir, fileName);
|
|
20499
20562
|
await Bun.write(filePath, html);
|
|
20500
20563
|
await writeTimestamp(filePath);
|
|
20501
20564
|
result.routes.set(route, filePath);
|
|
20502
20565
|
log2?.(` Pre-rendered ${route} \u2192 ${fileName} (${html.length} bytes)`);
|
|
20503
20566
|
}, prerender = async (port, outDir, staticConfig, log2) => {
|
|
20504
|
-
const prerenderDir =
|
|
20567
|
+
const prerenderDir = join31(outDir, "_prerendered");
|
|
20505
20568
|
mkdirSync15(prerenderDir, { recursive: true });
|
|
20506
20569
|
const baseUrl = `http://localhost:${port}`;
|
|
20507
20570
|
let routes;
|
|
@@ -21098,7 +21161,7 @@ var handleHTMXPageRequest = async (pagePath) => {
|
|
|
21098
21161
|
};
|
|
21099
21162
|
// src/core/prepare.ts
|
|
21100
21163
|
import { existsSync as existsSync29, readdirSync, readFileSync as readFileSync21 } from "fs";
|
|
21101
|
-
import { basename as basename14, join as
|
|
21164
|
+
import { basename as basename14, join as join32, relative as relative13, resolve as resolve37 } from "path";
|
|
21102
21165
|
import { Elysia as Elysia5 } from "elysia";
|
|
21103
21166
|
|
|
21104
21167
|
// src/utils/loadConfig.ts
|
|
@@ -21679,7 +21742,7 @@ var loadPrerenderMap = (prerenderDir) => {
|
|
|
21679
21742
|
continue;
|
|
21680
21743
|
const name = basename14(entry, ".html");
|
|
21681
21744
|
const route = name === "index" ? "/" : `/${name}`;
|
|
21682
|
-
map.set(route,
|
|
21745
|
+
map.set(route, join32(prerenderDir, entry));
|
|
21683
21746
|
}
|
|
21684
21747
|
return map;
|
|
21685
21748
|
};
|
|
@@ -21728,7 +21791,7 @@ var prepare = async (configOrPath) => {
|
|
|
21728
21791
|
setCurrentPageIslandMetadata(await loadPageIslandMetadata(config));
|
|
21729
21792
|
recordStep("load production manifest and island metadata", stepStartedAt);
|
|
21730
21793
|
stepStartedAt = performance.now();
|
|
21731
|
-
const conventionsPath =
|
|
21794
|
+
const conventionsPath = join32(buildDir, "conventions.json");
|
|
21732
21795
|
if (existsSync29(conventionsPath)) {
|
|
21733
21796
|
const conventions2 = JSON.parse(readFileSync21(conventionsPath, "utf-8"));
|
|
21734
21797
|
setConventions(conventions2);
|
|
@@ -21744,7 +21807,7 @@ var prepare = async (configOrPath) => {
|
|
|
21744
21807
|
});
|
|
21745
21808
|
recordStep("create static plugin", stepStartedAt);
|
|
21746
21809
|
stepStartedAt = performance.now();
|
|
21747
|
-
const prerenderDir =
|
|
21810
|
+
const prerenderDir = join32(buildDir, "_prerendered");
|
|
21748
21811
|
const prerenderMap = loadPrerenderMap(prerenderDir);
|
|
21749
21812
|
recordStep("load prerender map", stepStartedAt);
|
|
21750
21813
|
if (prerenderMap.size > 0) {
|
|
@@ -21803,10 +21866,10 @@ var {env: env4 } = globalThis.Bun;
|
|
|
21803
21866
|
|
|
21804
21867
|
// src/dev/devCert.ts
|
|
21805
21868
|
import { existsSync as existsSync30, mkdirSync as mkdirSync16, readFileSync as readFileSync22, rmSync as rmSync3 } from "fs";
|
|
21806
|
-
import { join as
|
|
21807
|
-
var CERT_DIR =
|
|
21808
|
-
var CERT_PATH =
|
|
21809
|
-
var KEY_PATH =
|
|
21869
|
+
import { join as join33 } from "path";
|
|
21870
|
+
var CERT_DIR = join33(process.cwd(), ".absolutejs");
|
|
21871
|
+
var CERT_PATH = join33(CERT_DIR, "cert.pem");
|
|
21872
|
+
var KEY_PATH = join33(CERT_DIR, "key.pem");
|
|
21810
21873
|
var CERT_VALIDITY_DAYS = 365;
|
|
21811
21874
|
var devLog = (msg) => console.log(`\x1B[2m${new Date().toLocaleTimeString()}\x1B[0m \x1B[36m[dev]\x1B[0m ${msg}`);
|
|
21812
21875
|
var devWarn = (msg) => console.log(`\x1B[2m${new Date().toLocaleTimeString()}\x1B[0m \x1B[33m[dev]\x1B[0m \x1B[33m${msg}\x1B[0m`);
|
|
@@ -28424,5 +28487,5 @@ export {
|
|
|
28424
28487
|
ANGULAR_INIT_TIMEOUT_MS
|
|
28425
28488
|
};
|
|
28426
28489
|
|
|
28427
|
-
//# debugId=
|
|
28490
|
+
//# debugId=D12AF094146BC5F864756E2164756E21
|
|
28428
28491
|
//# sourceMappingURL=index.js.map
|