@absolutejs/absolute 0.19.0-beta.847 → 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 +83 -42
- package/dist/angular/index.js.map +6 -5
- package/dist/angular/server.js +83 -42
- package/dist/angular/server.js.map +6 -5
- package/dist/build.js +250 -201
- package/dist/build.js.map +12 -11
- package/dist/index.js +266 -217
- package/dist/index.js.map +12 -11
- package/dist/islands/index.js +35 -5
- package/dist/islands/index.js.map +3 -3
- package/dist/react/index.js +35 -5
- 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 +35 -5
- package/dist/svelte/index.js.map +3 -3
- package/dist/svelte/server.js +35 -5
- package/dist/svelte/server.js.map +3 -3
- package/dist/vue/index.js +35 -5
- package/dist/vue/index.js.map +3 -3
- package/package.json +1 -1
package/dist/build.js
CHANGED
|
@@ -3009,12 +3009,42 @@ ${contents}` : contents, normalizePostcssModule = (mod) => {
|
|
|
3009
3009
|
code: await compileStyleSource(path, content, language, config)
|
|
3010
3010
|
};
|
|
3011
3011
|
}
|
|
3012
|
-
}),
|
|
3012
|
+
}), CSS_IMPORT_PATTERN, resolveCssImportsAsync = async (content, baseDir, visited) => {
|
|
3013
|
+
const matches = Array.from(content.matchAll(CSS_IMPORT_PATTERN));
|
|
3014
|
+
if (matches.length === 0)
|
|
3015
|
+
return content;
|
|
3016
|
+
let cursor = 0;
|
|
3017
|
+
const parts = [];
|
|
3018
|
+
for (const match of matches) {
|
|
3019
|
+
const importPath = match[1];
|
|
3020
|
+
if (importPath === undefined)
|
|
3021
|
+
continue;
|
|
3022
|
+
const start = match.index ?? 0;
|
|
3023
|
+
const end = start + match[0].length;
|
|
3024
|
+
parts.push(content.slice(cursor, start));
|
|
3025
|
+
const fullPath = isAbsolute(importPath) ? importPath : resolve5(baseDir, importPath);
|
|
3026
|
+
if (visited.has(fullPath) || !existsSync4(fullPath)) {
|
|
3027
|
+
parts.push(visited.has(fullPath) ? "" : match[0]);
|
|
3028
|
+
cursor = end;
|
|
3029
|
+
continue;
|
|
3030
|
+
}
|
|
3031
|
+
const nextVisited = new Set(visited);
|
|
3032
|
+
nextVisited.add(fullPath);
|
|
3033
|
+
const imported = await readFile(fullPath, "utf-8");
|
|
3034
|
+
parts.push(await resolveCssImportsAsync(imported, dirname2(fullPath), nextVisited));
|
|
3035
|
+
cursor = end;
|
|
3036
|
+
}
|
|
3037
|
+
parts.push(content.slice(cursor));
|
|
3038
|
+
return parts.join("");
|
|
3039
|
+
}, compileStyleFileIfNeeded = async (filePath, config) => {
|
|
3013
3040
|
if (!isPreprocessableStylePath(filePath)) {
|
|
3014
|
-
|
|
3041
|
+
const raw = await readFile(filePath, "utf-8");
|
|
3042
|
+
const processed = await runPostcss(raw, filePath, config);
|
|
3043
|
+
return resolveCssImportsAsync(processed, dirname2(filePath), new Set([filePath]));
|
|
3015
3044
|
}
|
|
3016
|
-
|
|
3017
|
-
|
|
3045
|
+
const compiled = await compileStyleSource(filePath, undefined, undefined, config);
|
|
3046
|
+
return resolveCssImportsAsync(compiled, dirname2(filePath), new Set([filePath]));
|
|
3047
|
+
}, resolveCssImportsSync = (content, baseDir, visited) => {
|
|
3018
3048
|
return content.replace(CSS_IMPORT_PATTERN, (match, importPath) => {
|
|
3019
3049
|
const fullPath = isAbsolute(importPath) ? importPath : resolve5(baseDir, importPath);
|
|
3020
3050
|
if (visited.has(fullPath))
|
|
@@ -9544,35 +9574,42 @@ var init_cleanStaleOutputs = __esm(() => {
|
|
|
9544
9574
|
HASHED_FILE_PATTERN = /\.[a-f0-9]{8,}\.\w+$/;
|
|
9545
9575
|
});
|
|
9546
9576
|
|
|
9577
|
+
// src/utils/generatedDir.ts
|
|
9578
|
+
var exports_generatedDir = {};
|
|
9579
|
+
__export(exports_generatedDir, {
|
|
9580
|
+
getGeneratedRoot: () => getGeneratedRoot,
|
|
9581
|
+
getFrameworkGeneratedDir: () => getFrameworkGeneratedDir
|
|
9582
|
+
});
|
|
9583
|
+
import { join as join12 } from "path";
|
|
9584
|
+
var GENERATED_DIR_NAME = "generated", ABSOLUTE_CACHE_DIR_NAME = ".absolutejs", getGeneratedRoot = (projectRoot = process.cwd()) => join12(projectRoot, ABSOLUTE_CACHE_DIR_NAME, GENERATED_DIR_NAME), getFrameworkGeneratedDir = (framework, projectRoot = process.cwd()) => join12(getGeneratedRoot(projectRoot), framework);
|
|
9585
|
+
var init_generatedDir = () => {};
|
|
9586
|
+
|
|
9547
9587
|
// src/utils/cleanup.ts
|
|
9548
9588
|
import { rm as rm3 } from "fs/promises";
|
|
9549
|
-
import { join as
|
|
9550
|
-
var
|
|
9589
|
+
import { join as join13 } from "path";
|
|
9590
|
+
var removeIfExists = (path) => rm3(path, { force: true, recursive: true }), cleanFramework = (framework, frameworkDir) => {
|
|
9591
|
+
const tasks = [
|
|
9592
|
+
removeIfExists(getFrameworkGeneratedDir(framework))
|
|
9593
|
+
];
|
|
9594
|
+
if (frameworkDir)
|
|
9595
|
+
tasks.push(removeIfExists(join13(frameworkDir, "generated")));
|
|
9596
|
+
return Promise.all(tasks);
|
|
9597
|
+
}, cleanup = async ({
|
|
9551
9598
|
angularDir,
|
|
9552
9599
|
reactDir,
|
|
9553
9600
|
svelteDir,
|
|
9554
9601
|
vueDir
|
|
9555
9602
|
}) => {
|
|
9556
9603
|
await Promise.all([
|
|
9557
|
-
|
|
9558
|
-
|
|
9559
|
-
|
|
9560
|
-
|
|
9561
|
-
reactDir ? rm3(join12(reactDir, "generated"), {
|
|
9562
|
-
force: true,
|
|
9563
|
-
recursive: true
|
|
9564
|
-
}) : undefined,
|
|
9565
|
-
svelteDir ? rm3(join12(svelteDir, "generated"), {
|
|
9566
|
-
force: true,
|
|
9567
|
-
recursive: true
|
|
9568
|
-
}) : undefined,
|
|
9569
|
-
vueDir ? rm3(join12(vueDir, "generated"), {
|
|
9570
|
-
force: true,
|
|
9571
|
-
recursive: true
|
|
9572
|
-
}) : undefined
|
|
9604
|
+
cleanFramework("angular", angularDir),
|
|
9605
|
+
cleanFramework("react", reactDir),
|
|
9606
|
+
cleanFramework("svelte", svelteDir),
|
|
9607
|
+
cleanFramework("vue", vueDir)
|
|
9573
9608
|
]);
|
|
9574
9609
|
};
|
|
9575
|
-
var init_cleanup = () => {
|
|
9610
|
+
var init_cleanup = __esm(() => {
|
|
9611
|
+
init_generatedDir();
|
|
9612
|
+
});
|
|
9576
9613
|
|
|
9577
9614
|
// src/utils/commonAncestor.ts
|
|
9578
9615
|
var exports_commonAncestor = {};
|
|
@@ -9593,7 +9630,7 @@ var init_commonAncestor = () => {};
|
|
|
9593
9630
|
|
|
9594
9631
|
// src/utils/buildDirectoryLock.ts
|
|
9595
9632
|
import { mkdirSync as mkdirSync6, unlinkSync, writeFileSync as writeFileSync6, readFileSync as readFileSync10 } from "fs";
|
|
9596
|
-
import { dirname as dirname8, join as
|
|
9633
|
+
import { dirname as dirname8, join as join14 } from "path";
|
|
9597
9634
|
var heldLocks, HELD_LOCKS_ENV = "ABSOLUTE_HELD_BUILD_DIRECTORY_LOCKS", exitHandlersRegistered = false, registerExitHandlersOnce = () => {
|
|
9598
9635
|
if (exitHandlersRegistered)
|
|
9599
9636
|
return;
|
|
@@ -9619,7 +9656,7 @@ var heldLocks, HELD_LOCKS_ENV = "ABSOLUTE_HELD_BUILD_DIRECTORY_LOCKS", exitHandl
|
|
|
9619
9656
|
releaseAllSync();
|
|
9620
9657
|
throw err;
|
|
9621
9658
|
});
|
|
9622
|
-
}, isAlreadyExistsError = (error) => error instanceof Error && ("code" in error) && error.code === "EEXIST", lockPathForBuildDirectory = (buildDirectory) =>
|
|
9659
|
+
}, isAlreadyExistsError = (error) => error instanceof Error && ("code" in error) && error.code === "EEXIST", lockPathForBuildDirectory = (buildDirectory) => join14(dirname8(buildDirectory), ".absolutejs", "build.lock"), readHeldLockEnv = () => new Set((process.env[HELD_LOCKS_ENV] ?? "").split(`
|
|
9623
9660
|
`).filter((entry) => entry.length > 0)), writeHeldLockEnv = (locks) => {
|
|
9624
9661
|
if (locks.size === 0) {
|
|
9625
9662
|
delete process.env[HELD_LOCKS_ENV];
|
|
@@ -9911,7 +9948,7 @@ import { existsSync as existsSync14 } from "fs";
|
|
|
9911
9948
|
import { mkdir as mkdir3, stat as stat2 } from "fs/promises";
|
|
9912
9949
|
import {
|
|
9913
9950
|
dirname as dirname9,
|
|
9914
|
-
join as
|
|
9951
|
+
join as join15,
|
|
9915
9952
|
basename as basename4,
|
|
9916
9953
|
extname as extname5,
|
|
9917
9954
|
resolve as resolve14,
|
|
@@ -9970,14 +10007,14 @@ var resolveDevClientDir2 = () => {
|
|
|
9970
10007
|
`${basePath}.svelte`,
|
|
9971
10008
|
`${basePath}.svelte.ts`,
|
|
9972
10009
|
`${basePath}.svelte.js`,
|
|
9973
|
-
|
|
9974
|
-
|
|
9975
|
-
|
|
9976
|
-
|
|
9977
|
-
|
|
9978
|
-
|
|
9979
|
-
|
|
9980
|
-
|
|
10010
|
+
join15(basePath, "index.ts"),
|
|
10011
|
+
join15(basePath, "index.js"),
|
|
10012
|
+
join15(basePath, "index.mjs"),
|
|
10013
|
+
join15(basePath, "index.cjs"),
|
|
10014
|
+
join15(basePath, "index.json"),
|
|
10015
|
+
join15(basePath, "index.svelte"),
|
|
10016
|
+
join15(basePath, "index.svelte.ts"),
|
|
10017
|
+
join15(basePath, "index.svelte.js")
|
|
9981
10018
|
];
|
|
9982
10019
|
const checks = await Promise.all(candidates.map(exists));
|
|
9983
10020
|
return candidates.find((_2, index) => checks[index]) ?? null;
|
|
@@ -10015,10 +10052,10 @@ var resolveDevClientDir2 = () => {
|
|
|
10015
10052
|
});
|
|
10016
10053
|
}, compileSvelte = async (entryPoints, svelteRoot, cache = new Map, isDev = false, stylePreprocessors) => {
|
|
10017
10054
|
const { compile, compileModule, preprocess } = await import("svelte/compiler");
|
|
10018
|
-
const generatedDir =
|
|
10019
|
-
const clientDir =
|
|
10020
|
-
const indexDir =
|
|
10021
|
-
const serverDir =
|
|
10055
|
+
const generatedDir = getFrameworkGeneratedDir("svelte");
|
|
10056
|
+
const clientDir = join15(generatedDir, "client");
|
|
10057
|
+
const indexDir = join15(generatedDir, "indexes");
|
|
10058
|
+
const serverDir = join15(generatedDir, "server");
|
|
10022
10059
|
await Promise.all([clientDir, indexDir, serverDir].map((dir) => mkdir3(dir, { recursive: true })));
|
|
10023
10060
|
const dev = env.NODE_ENV !== "production";
|
|
10024
10061
|
const build = async (src) => {
|
|
@@ -10056,8 +10093,8 @@ var resolveDevClientDir2 = () => {
|
|
|
10056
10093
|
const childBuilt = await Promise.all(childSources.map((child) => build(child)));
|
|
10057
10094
|
const hasAwaitSlotFromChildren = childBuilt.some((child) => child.hasAwaitSlot);
|
|
10058
10095
|
const externalRewrites = new Map;
|
|
10059
|
-
const ssrOutputDir = dirname9(
|
|
10060
|
-
const clientOutputDir = dirname9(
|
|
10096
|
+
const ssrOutputDir = dirname9(join15(serverDir, relDir, `${baseName}.js`));
|
|
10097
|
+
const clientOutputDir = dirname9(join15(clientDir, relDir, `${baseName}.js`));
|
|
10061
10098
|
for (let idx = 0;idx < importPaths.length; idx++) {
|
|
10062
10099
|
const rawSpec = importPaths[idx];
|
|
10063
10100
|
if (!rawSpec)
|
|
@@ -10122,8 +10159,8 @@ var resolveDevClientDir2 = () => {
|
|
|
10122
10159
|
code += islandMetadataExports;
|
|
10123
10160
|
return code;
|
|
10124
10161
|
};
|
|
10125
|
-
const ssrPath =
|
|
10126
|
-
const clientPath =
|
|
10162
|
+
const ssrPath = join15(serverDir, relDir, `${baseName}.js`);
|
|
10163
|
+
const clientPath = join15(clientDir, relDir, `${baseName}.js`);
|
|
10127
10164
|
await Promise.all([
|
|
10128
10165
|
mkdir3(dirname9(ssrPath), { recursive: true }),
|
|
10129
10166
|
mkdir3(dirname9(clientPath), { recursive: true })
|
|
@@ -10155,7 +10192,7 @@ var resolveDevClientDir2 = () => {
|
|
|
10155
10192
|
await Promise.all(roots.map(async ({ client, hasAwaitSlot }) => {
|
|
10156
10193
|
const relClientDir = dirname9(relative7(clientDir, client));
|
|
10157
10194
|
const name = basename4(client, extname5(client));
|
|
10158
|
-
const indexPath =
|
|
10195
|
+
const indexPath = join15(indexDir, relClientDir, `${name}.js`);
|
|
10159
10196
|
const importRaw = relative7(dirname9(indexPath), client).split(sep2).join("/");
|
|
10160
10197
|
const importPath = importRaw.startsWith(".") || importRaw.startsWith("/") ? importRaw : `./${importRaw}`;
|
|
10161
10198
|
const hmrImports = isDev ? `window.__HMR_FRAMEWORK__ = "svelte";
|
|
@@ -10234,7 +10271,7 @@ if (typeof window !== "undefined") {
|
|
|
10234
10271
|
svelteClientPaths: roots.map(({ client }) => client),
|
|
10235
10272
|
svelteIndexPaths: roots.map(({ client }) => {
|
|
10236
10273
|
const rel = dirname9(relative7(clientDir, client));
|
|
10237
|
-
return
|
|
10274
|
+
return join15(indexDir, rel, basename4(client));
|
|
10238
10275
|
}),
|
|
10239
10276
|
svelteServerPaths: roots.map(({ ssr }) => ssr)
|
|
10240
10277
|
};
|
|
@@ -10242,13 +10279,14 @@ if (typeof window !== "undefined") {
|
|
|
10242
10279
|
var init_compileSvelte = __esm(() => {
|
|
10243
10280
|
init_constants();
|
|
10244
10281
|
init_resolvePackageImport();
|
|
10282
|
+
init_generatedDir();
|
|
10245
10283
|
init_sourceMetadata();
|
|
10246
10284
|
init_stylePreprocessor();
|
|
10247
10285
|
init_lowerIslandSyntax();
|
|
10248
10286
|
init_lowerAwaitSlotSyntax();
|
|
10249
10287
|
init_renderToReadableStream();
|
|
10250
10288
|
devClientDir2 = resolveDevClientDir2();
|
|
10251
|
-
hmrClientPath3 =
|
|
10289
|
+
hmrClientPath3 = join15(devClientDir2, "hmrClient.ts").replace(/\\/g, "/");
|
|
10252
10290
|
persistentCache = new Map;
|
|
10253
10291
|
sourceHashCache = new Map;
|
|
10254
10292
|
transpiler2 = new Transpiler({ loader: "ts", target: "browser" });
|
|
@@ -10320,7 +10358,7 @@ import {
|
|
|
10320
10358
|
basename as basename5,
|
|
10321
10359
|
dirname as dirname10,
|
|
10322
10360
|
isAbsolute as isAbsolute3,
|
|
10323
|
-
join as
|
|
10361
|
+
join as join16,
|
|
10324
10362
|
relative as relative8,
|
|
10325
10363
|
resolve as resolve15
|
|
10326
10364
|
} from "path";
|
|
@@ -10495,7 +10533,7 @@ var resolveDevClientDir3 = () => {
|
|
|
10495
10533
|
];
|
|
10496
10534
|
let cssOutputPaths = [];
|
|
10497
10535
|
if (isEntryPoint && allCss.length) {
|
|
10498
|
-
const cssOutputFile =
|
|
10536
|
+
const cssOutputFile = join16(outputDirs.css, `${toKebab(fileBaseName)}-compiled.css`);
|
|
10499
10537
|
await mkdir4(dirname10(cssOutputFile), { recursive: true });
|
|
10500
10538
|
await write2(cssOutputFile, allCss.join(`
|
|
10501
10539
|
`));
|
|
@@ -10526,8 +10564,8 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
10526
10564
|
};
|
|
10527
10565
|
const clientCode = assembleModule(generateRenderFunction(false), "render", true) + islandMetadataExports;
|
|
10528
10566
|
const serverCode = assembleModule(generateRenderFunction(true), "ssrRender", false) + islandMetadataExports;
|
|
10529
|
-
const clientOutputPath =
|
|
10530
|
-
const serverOutputPath =
|
|
10567
|
+
const clientOutputPath = join16(outputDirs.client, `${relativeWithoutExtension}.js`);
|
|
10568
|
+
const serverOutputPath = join16(outputDirs.server, `${relativeWithoutExtension}.js`);
|
|
10531
10569
|
const relDir = dirname10(relativeFilePath);
|
|
10532
10570
|
const relDepth = relDir === "." ? 0 : relDir.split("/").length;
|
|
10533
10571
|
const adjustImports = (code) => code.replace(/(from\s+['"])(\.\.\/(?:\.\.\/)*)/g, (_2, prefix, dots) => {
|
|
@@ -10567,11 +10605,11 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
10567
10605
|
return result;
|
|
10568
10606
|
}, compileVue = async (entryPoints, vueRootDir, isDev = false, stylePreprocessors) => {
|
|
10569
10607
|
const compiler = await import("@vue/compiler-sfc");
|
|
10570
|
-
const generatedDir =
|
|
10571
|
-
const clientOutputDir =
|
|
10572
|
-
const indexOutputDir =
|
|
10573
|
-
const serverOutputDir =
|
|
10574
|
-
const cssOutputDir =
|
|
10608
|
+
const generatedDir = getFrameworkGeneratedDir("vue");
|
|
10609
|
+
const clientOutputDir = join16(generatedDir, "client");
|
|
10610
|
+
const indexOutputDir = join16(generatedDir, "indexes");
|
|
10611
|
+
const serverOutputDir = join16(generatedDir, "server");
|
|
10612
|
+
const cssOutputDir = join16(generatedDir, "compiled");
|
|
10575
10613
|
await Promise.all([
|
|
10576
10614
|
mkdir4(clientOutputDir, { recursive: true }),
|
|
10577
10615
|
mkdir4(indexOutputDir, { recursive: true }),
|
|
@@ -10588,8 +10626,8 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
10588
10626
|
}, buildCache, true, vueRootDir, compiler, stylePreprocessors);
|
|
10589
10627
|
result.tsHelperPaths.forEach((path) => allTsHelperPaths.add(path));
|
|
10590
10628
|
const entryBaseName = basename5(entryPath, ".vue");
|
|
10591
|
-
const indexOutputFile =
|
|
10592
|
-
const clientOutputFile =
|
|
10629
|
+
const indexOutputFile = join16(indexOutputDir, `${entryBaseName}.js`);
|
|
10630
|
+
const clientOutputFile = join16(clientOutputDir, relative8(vueRootDir, entryPath).replace(/\\/g, "/").replace(/\.vue$/, ".js"));
|
|
10593
10631
|
await mkdir4(dirname10(indexOutputFile), { recursive: true });
|
|
10594
10632
|
const vueHmrImports = isDev ? [
|
|
10595
10633
|
`window.__HMR_FRAMEWORK__ = "vue";`,
|
|
@@ -10742,8 +10780,8 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
10742
10780
|
const sourceCode = await file2(tsPath).text();
|
|
10743
10781
|
const transpiledCode = transpiler3.transformSync(sourceCode);
|
|
10744
10782
|
const relativeJsPath = relative8(vueRootDir, tsPath).replace(/\.ts$/, ".js");
|
|
10745
|
-
const outClientPath =
|
|
10746
|
-
const outServerPath =
|
|
10783
|
+
const outClientPath = join16(clientOutputDir, relativeJsPath);
|
|
10784
|
+
const outServerPath = join16(serverOutputDir, relativeJsPath);
|
|
10747
10785
|
await mkdir4(dirname10(outClientPath), { recursive: true });
|
|
10748
10786
|
await mkdir4(dirname10(outServerPath), { recursive: true });
|
|
10749
10787
|
await write2(outClientPath, transpiledCode);
|
|
@@ -10759,12 +10797,13 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
10759
10797
|
};
|
|
10760
10798
|
var init_compileVue = __esm(() => {
|
|
10761
10799
|
init_constants();
|
|
10800
|
+
init_generatedDir();
|
|
10762
10801
|
init_resolvePackageImport();
|
|
10763
10802
|
init_sourceMetadata();
|
|
10764
10803
|
init_vueAutoRouterTransform();
|
|
10765
10804
|
init_stylePreprocessor();
|
|
10766
10805
|
devClientDir3 = resolveDevClientDir3();
|
|
10767
|
-
hmrClientPath4 =
|
|
10806
|
+
hmrClientPath4 = join16(devClientDir3, "hmrClient.ts").replace(/\\/g, "/");
|
|
10768
10807
|
transpiler3 = new Transpiler2({ loader: "ts", target: "browser" });
|
|
10769
10808
|
scriptCache = new Map;
|
|
10770
10809
|
scriptSetupCache = new Map;
|
|
@@ -11245,7 +11284,7 @@ __export(exports_compileAngular, {
|
|
|
11245
11284
|
compileAngular: () => compileAngular
|
|
11246
11285
|
});
|
|
11247
11286
|
import { existsSync as existsSync16, readFileSync as readFileSync11, promises as fs } from "fs";
|
|
11248
|
-
import { join as
|
|
11287
|
+
import { join as join17, basename as basename6, sep as sep3, dirname as dirname11, resolve as resolve16, relative as relative9 } from "path";
|
|
11249
11288
|
import ts2 from "typescript";
|
|
11250
11289
|
var traceAngularPhase = async (name, fn2, metadata) => {
|
|
11251
11290
|
const tracePhase = globalThis.__absoluteBuildTracePhase;
|
|
@@ -11287,10 +11326,10 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
11287
11326
|
`${candidate}.tsx`,
|
|
11288
11327
|
`${candidate}.js`,
|
|
11289
11328
|
`${candidate}.jsx`,
|
|
11290
|
-
|
|
11291
|
-
|
|
11292
|
-
|
|
11293
|
-
|
|
11329
|
+
join17(candidate, "index.ts"),
|
|
11330
|
+
join17(candidate, "index.tsx"),
|
|
11331
|
+
join17(candidate, "index.js"),
|
|
11332
|
+
join17(candidate, "index.jsx")
|
|
11294
11333
|
];
|
|
11295
11334
|
return candidates.find((file3) => existsSync16(file3));
|
|
11296
11335
|
}, createLegacyAngularAnimationUsageResolver = (rootDir) => {
|
|
@@ -11479,10 +11518,10 @@ ${registrations}
|
|
|
11479
11518
|
`${basePath}.tsx`,
|
|
11480
11519
|
`${basePath}.mts`,
|
|
11481
11520
|
`${basePath}.cts`,
|
|
11482
|
-
|
|
11483
|
-
|
|
11484
|
-
|
|
11485
|
-
|
|
11521
|
+
join17(basePath, "index.ts"),
|
|
11522
|
+
join17(basePath, "index.tsx"),
|
|
11523
|
+
join17(basePath, "index.mts"),
|
|
11524
|
+
join17(basePath, "index.cts")
|
|
11486
11525
|
];
|
|
11487
11526
|
return candidates.map((candidate) => resolve16(candidate)).find((candidate) => existsSync16(candidate) && !candidate.endsWith(".d.ts")) ?? null;
|
|
11488
11527
|
}, readFileForAotTransform = async (fileName, readFile5) => {
|
|
@@ -11508,15 +11547,15 @@ ${registrations}
|
|
|
11508
11547
|
const paths = [];
|
|
11509
11548
|
const templateUrlMatch = findUncommentedMatch(source, /templateUrl\s*:\s*['"]([^'"]+)['"]/);
|
|
11510
11549
|
if (templateUrlMatch?.[1])
|
|
11511
|
-
paths.push(
|
|
11550
|
+
paths.push(join17(fileDir, templateUrlMatch[1]));
|
|
11512
11551
|
const styleUrlMatch = findUncommentedMatch(source, /styleUrl\s*:\s*['"]([^'"]+)['"]/);
|
|
11513
11552
|
if (styleUrlMatch?.[1])
|
|
11514
|
-
paths.push(
|
|
11553
|
+
paths.push(join17(fileDir, styleUrlMatch[1]));
|
|
11515
11554
|
const styleUrlsMatch = findUncommentedMatch(source, /styleUrls\s*:\s*\[([^\]]+)\]/);
|
|
11516
11555
|
const urlMatches = styleUrlsMatch?.[1]?.match(/['"]([^'"]+)['"]/g);
|
|
11517
11556
|
if (urlMatches) {
|
|
11518
11557
|
for (const urlMatch of urlMatches) {
|
|
11519
|
-
paths.push(
|
|
11558
|
+
paths.push(join17(fileDir, urlMatch.replace(/['"]/g, "")));
|
|
11520
11559
|
}
|
|
11521
11560
|
}
|
|
11522
11561
|
return paths.map((path) => resolve16(path));
|
|
@@ -11550,7 +11589,7 @@ ${registrations}
|
|
|
11550
11589
|
safeStableStringify(stylePreprocessors ?? null)
|
|
11551
11590
|
].join("\x00");
|
|
11552
11591
|
const cacheKey2 = Bun.hash(cacheInput).toString(BASE_36_RADIX);
|
|
11553
|
-
return
|
|
11592
|
+
return join17(process.cwd(), ".absolutejs", "cache", "angular-resources", `${cacheKey2}.json`);
|
|
11554
11593
|
}, precomputeAotResourceTransforms = async (inputPaths, readFile5, stylePreprocessors) => {
|
|
11555
11594
|
const transformedSources = new Map;
|
|
11556
11595
|
const visited = new Set;
|
|
@@ -11596,7 +11635,7 @@ ${registrations}
|
|
|
11596
11635
|
return { stats, transformedSources };
|
|
11597
11636
|
}, compileAngularFiles = async (inputPaths, outDir, stylePreprocessors) => {
|
|
11598
11637
|
const islandMetadataByOutputPath = await traceAngularPhase("aot/island-metadata", () => new Map(inputPaths.map((inputPath) => {
|
|
11599
|
-
const outputPath = resolve16(
|
|
11638
|
+
const outputPath = resolve16(join17(outDir, relative9(process.cwd(), resolve16(inputPath)).replace(/\.[cm]?[tj]sx?$/, ".js")));
|
|
11600
11639
|
return [
|
|
11601
11640
|
outputPath,
|
|
11602
11641
|
buildIslandMetadataExports(readFileSync11(inputPath, "utf-8"))
|
|
@@ -11643,7 +11682,7 @@ ${registrations}
|
|
|
11643
11682
|
const originalGetSourceFile = host.getSourceFile;
|
|
11644
11683
|
host.getSourceFile = (fileName, languageVersion, onError) => {
|
|
11645
11684
|
if (fileName.startsWith("lib.") && fileName.endsWith(".d.ts") && tsLibDir) {
|
|
11646
|
-
const resolvedPath =
|
|
11685
|
+
const resolvedPath = join17(tsLibDir, fileName);
|
|
11647
11686
|
return originalGetSourceFile?.call(host, resolvedPath, languageVersion, onError);
|
|
11648
11687
|
}
|
|
11649
11688
|
return originalGetSourceFile?.call(host, fileName, languageVersion, onError);
|
|
@@ -11698,7 +11737,7 @@ ${registrations}
|
|
|
11698
11737
|
const entries = await traceAngularPhase("aot/postprocess-emitted-js", () => {
|
|
11699
11738
|
const rawEntries = Object.entries(emitted).filter(([fileName]) => fileName.endsWith(".js")).map(([fileName, content]) => ({
|
|
11700
11739
|
content,
|
|
11701
|
-
target:
|
|
11740
|
+
target: join17(outDir, fileName)
|
|
11702
11741
|
}));
|
|
11703
11742
|
const outputFiles = new Set(rawEntries.map(({ target }) => resolve16(target)));
|
|
11704
11743
|
return rawEntries.map(({ content, target }) => {
|
|
@@ -11873,7 +11912,7 @@ ${fields}
|
|
|
11873
11912
|
}, inlineTemplateAndLowerDefer = async (source, fileDir) => {
|
|
11874
11913
|
const templateUrlMatch = findUncommentedMatch(source, /templateUrl\s*:\s*['"]([^'"]+)['"]/);
|
|
11875
11914
|
if (templateUrlMatch?.[1]) {
|
|
11876
|
-
const templatePath =
|
|
11915
|
+
const templatePath = join17(fileDir, templateUrlMatch[1]);
|
|
11877
11916
|
if (!existsSync16(templatePath)) {
|
|
11878
11917
|
throw new Error(`Unable to inline Angular templateUrl "${templateUrlMatch[1]}": file not found at ${templatePath}`);
|
|
11879
11918
|
}
|
|
@@ -11904,7 +11943,7 @@ ${fields}
|
|
|
11904
11943
|
}, inlineTemplateAndLowerDeferSync = (source, fileDir) => {
|
|
11905
11944
|
const templateUrlMatch = findUncommentedMatch(source, /templateUrl\s*:\s*['"]([^'"]+)['"]/);
|
|
11906
11945
|
if (templateUrlMatch?.[1]) {
|
|
11907
|
-
const templatePath =
|
|
11946
|
+
const templatePath = join17(fileDir, templateUrlMatch[1]);
|
|
11908
11947
|
if (!existsSync16(templatePath)) {
|
|
11909
11948
|
throw new Error(`Unable to inline Angular templateUrl "${templateUrlMatch[1]}": file not found at ${templatePath}`);
|
|
11910
11949
|
}
|
|
@@ -11941,7 +11980,7 @@ ${fields}
|
|
|
11941
11980
|
return source;
|
|
11942
11981
|
const stylePromises = urlMatches.map((urlMatch) => {
|
|
11943
11982
|
const styleUrl = urlMatch.replace(/['"]/g, "");
|
|
11944
|
-
return readAndEscapeFile(
|
|
11983
|
+
return readAndEscapeFile(join17(fileDir, styleUrl), stylePreprocessors);
|
|
11945
11984
|
});
|
|
11946
11985
|
const results = await Promise.all(stylePromises);
|
|
11947
11986
|
const inlinedStyles = results.filter(Boolean).map((escaped) => `\`${escaped}\``);
|
|
@@ -11952,7 +11991,7 @@ ${fields}
|
|
|
11952
11991
|
const styleUrlMatch = findUncommentedMatch(source, /styleUrl\s*:\s*['"]([^'"]+)['"]/);
|
|
11953
11992
|
if (!styleUrlMatch?.[1])
|
|
11954
11993
|
return source;
|
|
11955
|
-
const escaped = await readAndEscapeFile(
|
|
11994
|
+
const escaped = await readAndEscapeFile(join17(fileDir, styleUrlMatch[1]), stylePreprocessors);
|
|
11956
11995
|
if (!escaped)
|
|
11957
11996
|
return source;
|
|
11958
11997
|
return source.slice(0, styleUrlMatch.index) + `styles: [\`${escaped}\`]` + source.slice(styleUrlMatch.index + styleUrlMatch[0].length);
|
|
@@ -11987,10 +12026,10 @@ ${fields}
|
|
|
11987
12026
|
`${candidate}.tsx`,
|
|
11988
12027
|
`${candidate}.js`,
|
|
11989
12028
|
`${candidate}.jsx`,
|
|
11990
|
-
|
|
11991
|
-
|
|
11992
|
-
|
|
11993
|
-
|
|
12029
|
+
join17(candidate, "index.ts"),
|
|
12030
|
+
join17(candidate, "index.tsx"),
|
|
12031
|
+
join17(candidate, "index.js"),
|
|
12032
|
+
join17(candidate, "index.jsx")
|
|
11994
12033
|
];
|
|
11995
12034
|
return candidates.find((file3) => existsSync16(file3));
|
|
11996
12035
|
};
|
|
@@ -12017,7 +12056,7 @@ ${fields}
|
|
|
12017
12056
|
const inputDir = dirname11(sourcePath);
|
|
12018
12057
|
const relativeDir = inputDir.startsWith(baseDir) ? inputDir.substring(baseDir.length + 1) : inputDir;
|
|
12019
12058
|
const fileBase = basename6(sourcePath).replace(/\.[cm]?[tj]sx?$/, ".js");
|
|
12020
|
-
return
|
|
12059
|
+
return join17(outDir, relativeDir, fileBase);
|
|
12021
12060
|
};
|
|
12022
12061
|
const withCacheBuster = (specifier) => {
|
|
12023
12062
|
if (!cacheBuster)
|
|
@@ -12075,7 +12114,7 @@ ${fields}
|
|
|
12075
12114
|
const inputDir = dirname11(actualPath);
|
|
12076
12115
|
const relativeDir = inputDir.startsWith(baseDir) ? inputDir.substring(baseDir.length + 1) : inputDir;
|
|
12077
12116
|
const fileBase = basename6(actualPath).replace(/\.[cm]?[tj]sx?$/, ".js");
|
|
12078
|
-
const targetDir =
|
|
12117
|
+
const targetDir = join17(outDir, relativeDir);
|
|
12079
12118
|
const targetPath = toOutputPath(actualPath);
|
|
12080
12119
|
const localImports = [];
|
|
12081
12120
|
const importRewrites = new Map;
|
|
@@ -12129,13 +12168,13 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
12129
12168
|
}
|
|
12130
12169
|
return allOutputs;
|
|
12131
12170
|
}, compileAngular = async (entryPoints, outRoot, hmr = false, stylePreprocessors) => {
|
|
12132
|
-
const compiledParent =
|
|
12171
|
+
const compiledParent = getFrameworkGeneratedDir("angular");
|
|
12133
12172
|
if (entryPoints.length === 0) {
|
|
12134
12173
|
const emptyPaths = [];
|
|
12135
12174
|
return { clientPaths: [...emptyPaths], serverPaths: [...emptyPaths] };
|
|
12136
12175
|
}
|
|
12137
12176
|
const compiledRoot = compiledParent;
|
|
12138
|
-
const indexesDir =
|
|
12177
|
+
const indexesDir = join17(compiledParent, "indexes");
|
|
12139
12178
|
await traceAngularPhase("setup/create-indexes-dir", () => fs.mkdir(indexesDir, { recursive: true }));
|
|
12140
12179
|
const aotOutputs = hmr ? [] : await traceAngularPhase("aot/compile-files", () => compileAngularFiles(entryPoints.map((entry) => resolve16(entry)), compiledRoot, stylePreprocessors), { entries: entryPoints.length });
|
|
12141
12180
|
const usesLegacyAngularAnimations = await traceAngularPhase("setup/legacy-animation-resolver", () => createLegacyAngularAnimationUsageResolver(outRoot));
|
|
@@ -12149,9 +12188,9 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
12149
12188
|
const fileBase = basename6(resolvedEntry).replace(/\.[tj]s$/, "");
|
|
12150
12189
|
const jsName = `${fileBase}.js`;
|
|
12151
12190
|
const compiledFallbackPaths = [
|
|
12152
|
-
|
|
12153
|
-
|
|
12154
|
-
|
|
12191
|
+
join17(compiledRoot, relativeEntry),
|
|
12192
|
+
join17(compiledRoot, "pages", jsName),
|
|
12193
|
+
join17(compiledRoot, jsName)
|
|
12155
12194
|
].map((file3) => resolve16(file3));
|
|
12156
12195
|
const resolveRawServerFile = (candidatePaths) => {
|
|
12157
12196
|
const normalizedCandidates = [
|
|
@@ -12196,7 +12235,7 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
12196
12235
|
const usesLegacyAnimations = await traceAngularPhase("wrapper/detect-legacy-animations", () => usesLegacyAngularAnimations(resolvedEntry), { entry: resolvedEntry });
|
|
12197
12236
|
const serverContentHash = Bun.hash(original).toString(BASE_36_RADIX);
|
|
12198
12237
|
const cachedWrapper = wrapperOutputCache.get(resolvedEntry);
|
|
12199
|
-
const clientFile =
|
|
12238
|
+
const clientFile = join17(indexesDir, jsName);
|
|
12200
12239
|
if (hmr && cachedWrapper && cachedWrapper.serverHash === serverContentHash && existsSync16(clientFile) && (usesLegacyAnimations || !original.includes("__ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__")) && (!usesLegacyAnimations || original.includes("__ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__"))) {
|
|
12201
12240
|
return {
|
|
12202
12241
|
clientPath: clientFile,
|
|
@@ -12431,9 +12470,10 @@ var init_compileAngular = __esm(() => {
|
|
|
12431
12470
|
init_sourceMetadata();
|
|
12432
12471
|
init_lowerDeferSyntax();
|
|
12433
12472
|
init_stylePreprocessor();
|
|
12473
|
+
init_generatedDir();
|
|
12434
12474
|
devClientDir4 = resolveDevClientDir4();
|
|
12435
|
-
hmrClientPath5 =
|
|
12436
|
-
hmrRuntimePath =
|
|
12475
|
+
hmrClientPath5 = join17(devClientDir4, "hmrClient.ts").replace(/\\/g, "/");
|
|
12476
|
+
hmrRuntimePath = join17(devClientDir4, "handlers", "angularRuntime.ts").replace(/\\/g, "/");
|
|
12437
12477
|
jitContentCache = new Map;
|
|
12438
12478
|
wrapperOutputCache = new Map;
|
|
12439
12479
|
});
|
|
@@ -12887,7 +12927,7 @@ __export(exports_compileEmber, {
|
|
|
12887
12927
|
});
|
|
12888
12928
|
import { existsSync as existsSync17 } from "fs";
|
|
12889
12929
|
import { mkdir as mkdir5, rm as rm4 } from "fs/promises";
|
|
12890
|
-
import { basename as basename7, dirname as dirname12, extname as extname6, join as
|
|
12930
|
+
import { basename as basename7, dirname as dirname12, extname as extname6, join as join18, resolve as resolve17 } from "path";
|
|
12891
12931
|
var {build: bunBuild2, Transpiler: Transpiler3, write: write3, file: file3 } = globalThis.Bun;
|
|
12892
12932
|
var cachedPreprocessor = null, getPreprocessor = async () => {
|
|
12893
12933
|
if (cachedPreprocessor)
|
|
@@ -13006,7 +13046,7 @@ export const importSync = (specifier) => {
|
|
|
13006
13046
|
build.onResolve({ filter: /^@(?:ember|glimmer|simple-dom)\// }, (args) => {
|
|
13007
13047
|
if (standalonePackages.has(args.path))
|
|
13008
13048
|
return;
|
|
13009
|
-
const internal =
|
|
13049
|
+
const internal = join18(cwd, "node_modules/ember-source/dist/packages", args.path, "index.js");
|
|
13010
13050
|
if (existsSync17(internal))
|
|
13011
13051
|
return { path: internal };
|
|
13012
13052
|
return;
|
|
@@ -13054,16 +13094,16 @@ export default PageComponent;
|
|
|
13054
13094
|
}
|
|
13055
13095
|
const transpiled = transpiler4.transformSync(preprocessed);
|
|
13056
13096
|
const baseName = basename7(resolvedEntry).replace(/\.(gjs|gts|ts|js)$/, "");
|
|
13057
|
-
const tmpDir =
|
|
13058
|
-
const serverDir =
|
|
13059
|
-
const clientDir =
|
|
13097
|
+
const tmpDir = join18(compiledRoot, "_tmp");
|
|
13098
|
+
const serverDir = join18(compiledRoot, "server");
|
|
13099
|
+
const clientDir = join18(compiledRoot, "client");
|
|
13060
13100
|
await Promise.all([
|
|
13061
13101
|
mkdir5(tmpDir, { recursive: true }),
|
|
13062
13102
|
mkdir5(serverDir, { recursive: true }),
|
|
13063
13103
|
mkdir5(clientDir, { recursive: true })
|
|
13064
13104
|
]);
|
|
13065
|
-
const tmpPagePath = resolve17(
|
|
13066
|
-
const tmpHarnessPath = resolve17(
|
|
13105
|
+
const tmpPagePath = resolve17(join18(tmpDir, `${baseName}.module.js`));
|
|
13106
|
+
const tmpHarnessPath = resolve17(join18(tmpDir, `${baseName}.harness.js`));
|
|
13067
13107
|
await Promise.all([
|
|
13068
13108
|
write3(tmpPagePath, transpiled),
|
|
13069
13109
|
write3(tmpHarnessPath, generateServerHarness(tmpPagePath))
|
|
@@ -13071,7 +13111,7 @@ export default PageComponent;
|
|
|
13071
13111
|
const stagedSourceMap = new Map([
|
|
13072
13112
|
[tmpPagePath, resolvedEntry]
|
|
13073
13113
|
]);
|
|
13074
|
-
const serverPath =
|
|
13114
|
+
const serverPath = join18(serverDir, `${baseName}.js`);
|
|
13075
13115
|
const buildResult = await bunBuild2({
|
|
13076
13116
|
entrypoints: [tmpHarnessPath],
|
|
13077
13117
|
format: "esm",
|
|
@@ -13088,7 +13128,7 @@ export default PageComponent;
|
|
|
13088
13128
|
console.warn(`\u26A0\uFE0F Ember server build for ${baseName} had errors:`, buildResult.logs);
|
|
13089
13129
|
}
|
|
13090
13130
|
await rm4(tmpDir, { force: true, recursive: true });
|
|
13091
|
-
const clientPath =
|
|
13131
|
+
const clientPath = join18(clientDir, `${baseName}.js`);
|
|
13092
13132
|
await write3(clientPath, transpiled);
|
|
13093
13133
|
return { clientPath, serverPath };
|
|
13094
13134
|
}, compileEmber = async (entries, emberDir, cwd = process.cwd(), _hmr = false) => {
|
|
@@ -13098,7 +13138,7 @@ export default PageComponent;
|
|
|
13098
13138
|
serverPaths: []
|
|
13099
13139
|
};
|
|
13100
13140
|
}
|
|
13101
|
-
const compiledRoot =
|
|
13141
|
+
const compiledRoot = getFrameworkGeneratedDir("ember");
|
|
13102
13142
|
const outputs = await Promise.all(entries.map((entry) => compileEmberFile(entry, compiledRoot, cwd)));
|
|
13103
13143
|
return {
|
|
13104
13144
|
clientPaths: outputs.map((o) => o.clientPath),
|
|
@@ -13116,8 +13156,9 @@ export default PageComponent;
|
|
|
13116
13156
|
preprocessed = rewriteTemplateEvalToScope(result.code);
|
|
13117
13157
|
}
|
|
13118
13158
|
return transpiler4.transformSync(preprocessed);
|
|
13119
|
-
}, clearEmberCompilerCache = () => {}, getEmberCompiledRoot = (
|
|
13159
|
+
}, clearEmberCompilerCache = () => {}, getEmberCompiledRoot = (_emberDir) => getFrameworkGeneratedDir("ember"), getEmberServerCompiledDir = (emberDir) => join18(getEmberCompiledRoot(emberDir), "server"), getEmberClientCompiledDir = (emberDir) => join18(getEmberCompiledRoot(emberDir), "client");
|
|
13120
13160
|
var init_compileEmber = __esm(() => {
|
|
13161
|
+
init_generatedDir();
|
|
13121
13162
|
transpiler4 = new Transpiler3({
|
|
13122
13163
|
loader: "ts",
|
|
13123
13164
|
target: "browser",
|
|
@@ -13137,7 +13178,7 @@ __export(exports_buildReactVendor, {
|
|
|
13137
13178
|
buildReactVendor: () => buildReactVendor
|
|
13138
13179
|
});
|
|
13139
13180
|
import { existsSync as existsSync18, mkdirSync as mkdirSync7 } from "fs";
|
|
13140
|
-
import { join as
|
|
13181
|
+
import { join as join19, resolve as resolve18 } from "path";
|
|
13141
13182
|
import { rm as rm5 } from "fs/promises";
|
|
13142
13183
|
var {build: bunBuild3 } = globalThis.Bun;
|
|
13143
13184
|
var resolveJsxDevRuntimeCompatPath = () => {
|
|
@@ -13191,14 +13232,14 @@ var resolveJsxDevRuntimeCompatPath = () => {
|
|
|
13191
13232
|
`)}
|
|
13192
13233
|
`;
|
|
13193
13234
|
}, buildReactVendor = async (buildDir) => {
|
|
13194
|
-
const vendorDir =
|
|
13235
|
+
const vendorDir = join19(buildDir, "react", "vendor");
|
|
13195
13236
|
mkdirSync7(vendorDir, { recursive: true });
|
|
13196
|
-
const tmpDir =
|
|
13237
|
+
const tmpDir = join19(buildDir, "_vendor_tmp");
|
|
13197
13238
|
mkdirSync7(tmpDir, { recursive: true });
|
|
13198
13239
|
const specifiers = resolveVendorSpecifiers();
|
|
13199
13240
|
const entrypoints = await Promise.all(specifiers.map(async (specifier) => {
|
|
13200
13241
|
const safeName = toSafeFileName(specifier);
|
|
13201
|
-
const entryPath =
|
|
13242
|
+
const entryPath = join19(tmpDir, `${safeName}.ts`);
|
|
13202
13243
|
const source = await generateEntrySource(specifier);
|
|
13203
13244
|
await Bun.write(entryPath, source);
|
|
13204
13245
|
return entryPath;
|
|
@@ -13263,7 +13304,7 @@ __export(exports_buildAngularVendor, {
|
|
|
13263
13304
|
buildAngularServerVendor: () => buildAngularServerVendor
|
|
13264
13305
|
});
|
|
13265
13306
|
import { mkdirSync as mkdirSync8 } from "fs";
|
|
13266
|
-
import { join as
|
|
13307
|
+
import { join as join20 } from "path";
|
|
13267
13308
|
import { rm as rm6 } from "fs/promises";
|
|
13268
13309
|
var {build: bunBuild4, Glob: Glob6 } = globalThis.Bun;
|
|
13269
13310
|
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) => {
|
|
@@ -13360,14 +13401,14 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
|
|
|
13360
13401
|
await collectTransitiveAngularSpecs([...angular, ...transitiveRoots], angular);
|
|
13361
13402
|
return Array.from(angular).filter(isResolvable2);
|
|
13362
13403
|
}, buildAngularVendor = async (buildDir, directories = [], linkerJitMode = false, depVendorSpecifiers = []) => {
|
|
13363
|
-
const vendorDir =
|
|
13404
|
+
const vendorDir = join20(buildDir, "angular", "vendor");
|
|
13364
13405
|
mkdirSync8(vendorDir, { recursive: true });
|
|
13365
|
-
const tmpDir =
|
|
13406
|
+
const tmpDir = join20(buildDir, "_angular_vendor_tmp");
|
|
13366
13407
|
mkdirSync8(tmpDir, { recursive: true });
|
|
13367
13408
|
const specifiers = await resolveAngularSpecifiers(directories, linkerJitMode);
|
|
13368
13409
|
const entrypoints = await Promise.all(specifiers.map(async (specifier) => {
|
|
13369
13410
|
const safeName = toSafeFileName2(specifier);
|
|
13370
|
-
const entryPath =
|
|
13411
|
+
const entryPath = join20(tmpDir, `${safeName}.ts`);
|
|
13371
13412
|
await Bun.write(entryPath, await generateVendorEntrySource(specifier));
|
|
13372
13413
|
return entryPath;
|
|
13373
13414
|
}));
|
|
@@ -13398,9 +13439,9 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
|
|
|
13398
13439
|
const specifiers = await resolveAngularSpecifiers(directories, linkerJitMode);
|
|
13399
13440
|
return computeAngularVendorPaths(specifiers);
|
|
13400
13441
|
}, buildAngularServerVendor = async (buildDir, directories = [], linkerJitMode = false) => {
|
|
13401
|
-
const vendorDir =
|
|
13442
|
+
const vendorDir = join20(buildDir, "angular", "vendor", "server");
|
|
13402
13443
|
mkdirSync8(vendorDir, { recursive: true });
|
|
13403
|
-
const tmpDir =
|
|
13444
|
+
const tmpDir = join20(buildDir, "_angular_server_vendor_tmp");
|
|
13404
13445
|
mkdirSync8(tmpDir, { recursive: true });
|
|
13405
13446
|
const browserSpecs = await resolveAngularSpecifiers(directories, linkerJitMode);
|
|
13406
13447
|
const allSpecs = new Set(browserSpecs);
|
|
@@ -13411,7 +13452,7 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
|
|
|
13411
13452
|
const specifiers = Array.from(allSpecs);
|
|
13412
13453
|
const entrypoints = await Promise.all(specifiers.map(async (specifier) => {
|
|
13413
13454
|
const safeName = toSafeFileName2(specifier);
|
|
13414
|
-
const entryPath =
|
|
13455
|
+
const entryPath = join20(tmpDir, `${safeName}.ts`);
|
|
13415
13456
|
await Bun.write(entryPath, await generateVendorEntrySource(specifier));
|
|
13416
13457
|
return entryPath;
|
|
13417
13458
|
}));
|
|
@@ -13433,9 +13474,9 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
|
|
|
13433
13474
|
return specifiers;
|
|
13434
13475
|
}, computeAngularServerVendorPaths = (buildDir, specifiers) => {
|
|
13435
13476
|
const paths = {};
|
|
13436
|
-
const vendorDir =
|
|
13477
|
+
const vendorDir = join20(buildDir, "angular", "vendor", "server");
|
|
13437
13478
|
for (const specifier of specifiers) {
|
|
13438
|
-
paths[specifier] =
|
|
13479
|
+
paths[specifier] = join20(vendorDir, `${toSafeFileName2(specifier)}.js`);
|
|
13439
13480
|
}
|
|
13440
13481
|
return paths;
|
|
13441
13482
|
}, computeAngularServerVendorPathsAsync = async (buildDir, directories = [], linkerJitMode = true) => {
|
|
@@ -13491,17 +13532,17 @@ __export(exports_buildVueVendor, {
|
|
|
13491
13532
|
buildVueVendor: () => buildVueVendor
|
|
13492
13533
|
});
|
|
13493
13534
|
import { mkdirSync as mkdirSync9 } from "fs";
|
|
13494
|
-
import { join as
|
|
13535
|
+
import { join as join21 } from "path";
|
|
13495
13536
|
import { rm as rm7 } from "fs/promises";
|
|
13496
13537
|
var {build: bunBuild5 } = globalThis.Bun;
|
|
13497
13538
|
var vueSpecifiers, toSafeFileName3 = (specifier) => specifier.replace(/\//g, "_"), buildVueVendor = async (buildDir) => {
|
|
13498
|
-
const vendorDir =
|
|
13539
|
+
const vendorDir = join21(buildDir, "vue", "vendor");
|
|
13499
13540
|
mkdirSync9(vendorDir, { recursive: true });
|
|
13500
|
-
const tmpDir =
|
|
13541
|
+
const tmpDir = join21(buildDir, "_vue_vendor_tmp");
|
|
13501
13542
|
mkdirSync9(tmpDir, { recursive: true });
|
|
13502
13543
|
const entrypoints = await Promise.all(vueSpecifiers.map(async (specifier) => {
|
|
13503
13544
|
const safeName = toSafeFileName3(specifier);
|
|
13504
|
-
const entryPath =
|
|
13545
|
+
const entryPath = join21(tmpDir, `${safeName}.ts`);
|
|
13505
13546
|
await Bun.write(entryPath, `export * from '${specifier}';
|
|
13506
13547
|
`);
|
|
13507
13548
|
return entryPath;
|
|
@@ -13529,7 +13570,7 @@ var vueSpecifiers, toSafeFileName3 = (specifier) => specifier.replace(/\//g, "_"
|
|
|
13529
13570
|
const { readFileSync: readFileSync12, writeFileSync: writeFileSync7, readdirSync } = await import("fs");
|
|
13530
13571
|
const files = readdirSync(vendorDir).filter((f2) => f2.endsWith(".js"));
|
|
13531
13572
|
for (const file4 of files) {
|
|
13532
|
-
const filePath =
|
|
13573
|
+
const filePath = join21(vendorDir, file4);
|
|
13533
13574
|
const content = readFileSync12(filePath, "utf-8");
|
|
13534
13575
|
if (!content.includes("__VUE_HMR_RUNTIME__"))
|
|
13535
13576
|
continue;
|
|
@@ -13556,7 +13597,7 @@ __export(exports_buildSvelteVendor, {
|
|
|
13556
13597
|
buildSvelteVendor: () => buildSvelteVendor
|
|
13557
13598
|
});
|
|
13558
13599
|
import { mkdirSync as mkdirSync10 } from "fs";
|
|
13559
|
-
import { join as
|
|
13600
|
+
import { join as join22 } from "path";
|
|
13560
13601
|
import { rm as rm8 } from "fs/promises";
|
|
13561
13602
|
var {build: bunBuild6 } = globalThis.Bun;
|
|
13562
13603
|
var svelteSpecifiers, isResolvable3 = (specifier) => {
|
|
@@ -13570,13 +13611,13 @@ var svelteSpecifiers, isResolvable3 = (specifier) => {
|
|
|
13570
13611
|
const specifiers = resolveVendorSpecifiers2();
|
|
13571
13612
|
if (specifiers.length === 0)
|
|
13572
13613
|
return;
|
|
13573
|
-
const vendorDir =
|
|
13614
|
+
const vendorDir = join22(buildDir, "svelte", "vendor");
|
|
13574
13615
|
mkdirSync10(vendorDir, { recursive: true });
|
|
13575
|
-
const tmpDir =
|
|
13616
|
+
const tmpDir = join22(buildDir, "_svelte_vendor_tmp");
|
|
13576
13617
|
mkdirSync10(tmpDir, { recursive: true });
|
|
13577
13618
|
const entrypoints = await Promise.all(specifiers.map(async (specifier) => {
|
|
13578
13619
|
const safeName = toSafeFileName4(specifier);
|
|
13579
|
-
const entryPath =
|
|
13620
|
+
const entryPath = join22(tmpDir, `${safeName}.ts`);
|
|
13580
13621
|
await Bun.write(entryPath, `export * from '${specifier}';
|
|
13581
13622
|
`);
|
|
13582
13623
|
return entryPath;
|
|
@@ -13626,7 +13667,7 @@ __export(exports_rewriteImportsPlugin, {
|
|
|
13626
13667
|
buildWithImportRewrite: () => buildWithImportRewrite
|
|
13627
13668
|
});
|
|
13628
13669
|
import { readdir as readdir3 } from "fs/promises";
|
|
13629
|
-
import { join as
|
|
13670
|
+
import { join as join23 } from "path";
|
|
13630
13671
|
var escapeRegex2 = (str) => str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), jsRewriteImports = (content, replacements) => {
|
|
13631
13672
|
let result = content;
|
|
13632
13673
|
for (const [specifier, webPath] of replacements) {
|
|
@@ -13755,7 +13796,7 @@ ${content}`;
|
|
|
13755
13796
|
const entries = await readdir3(dir);
|
|
13756
13797
|
for (const entry of entries) {
|
|
13757
13798
|
if (entry.endsWith(".js"))
|
|
13758
|
-
allFiles.push(
|
|
13799
|
+
allFiles.push(join23(dir, entry));
|
|
13759
13800
|
}
|
|
13760
13801
|
} catch {}
|
|
13761
13802
|
}
|
|
@@ -13804,7 +13845,7 @@ import {
|
|
|
13804
13845
|
statSync,
|
|
13805
13846
|
writeFileSync as writeFileSync7
|
|
13806
13847
|
} from "fs";
|
|
13807
|
-
import { basename as basename8, dirname as dirname13, extname as extname7, join as
|
|
13848
|
+
import { basename as basename8, dirname as dirname13, extname as extname7, join as join24, relative as relative10, resolve as resolve19 } from "path";
|
|
13808
13849
|
import { cwd, env as env2, exit } from "process";
|
|
13809
13850
|
var {build: bunBuild7, Glob: Glob7 } = globalThis.Bun;
|
|
13810
13851
|
var isDev, isBuildTraceEnabled = () => {
|
|
@@ -13882,8 +13923,8 @@ var isDev, isBuildTraceEnabled = () => {
|
|
|
13882
13923
|
mkdirSync11(htmxDestDir, { recursive: true });
|
|
13883
13924
|
const glob = new Glob7("htmx*.min.js");
|
|
13884
13925
|
for (const relPath of glob.scanSync({ cwd: htmxDir })) {
|
|
13885
|
-
const src =
|
|
13886
|
-
const dest =
|
|
13926
|
+
const src = join24(htmxDir, relPath);
|
|
13927
|
+
const dest = join24(htmxDestDir, "htmx.min.js");
|
|
13887
13928
|
copyFileSync(src, dest);
|
|
13888
13929
|
return;
|
|
13889
13930
|
}
|
|
@@ -13958,7 +13999,7 @@ var isDev, isBuildTraceEnabled = () => {
|
|
|
13958
13999
|
vuePagesPath
|
|
13959
14000
|
}) => {
|
|
13960
14001
|
const { readdirSync: readDir } = await import("fs");
|
|
13961
|
-
const devIndexDir =
|
|
14002
|
+
const devIndexDir = join24(buildPath, "_src_indexes");
|
|
13962
14003
|
mkdirSync11(devIndexDir, { recursive: true });
|
|
13963
14004
|
if (reactIndexesPath && reactPagesPath) {
|
|
13964
14005
|
copyReactDevIndexes(reactIndexesPath, reactPagesPath, devIndexDir, readDir);
|
|
@@ -13976,35 +14017,35 @@ var isDev, isBuildTraceEnabled = () => {
|
|
|
13976
14017
|
const indexFiles = readDir(reactIndexesPath).filter((file4) => file4.endsWith(".tsx"));
|
|
13977
14018
|
const pagesRel = relative10(process.cwd(), resolve19(reactPagesPath)).replace(/\\/g, "/");
|
|
13978
14019
|
for (const file4 of indexFiles) {
|
|
13979
|
-
let content = readFileSync12(
|
|
14020
|
+
let content = readFileSync12(join24(reactIndexesPath, file4), "utf-8");
|
|
13980
14021
|
content = content.replace(/from\s*['"]([^'"]*\/pages\/([^'"]+))['"]/g, (_match, _fullPath, componentName) => `from '/@src/${pagesRel}/${componentName}'`);
|
|
13981
|
-
writeFileSync7(
|
|
14022
|
+
writeFileSync7(join24(devIndexDir, file4), content);
|
|
13982
14023
|
}
|
|
13983
14024
|
}, copySvelteDevIndexes = (svelteDir, sveltePagesPath, svelteEntries, devIndexDir) => {
|
|
13984
|
-
const svelteIndexDir =
|
|
14025
|
+
const svelteIndexDir = join24(getFrameworkGeneratedDir("svelte"), "indexes");
|
|
13985
14026
|
const sveltePageEntries = svelteEntries.filter((file4) => resolve19(file4).startsWith(resolve19(sveltePagesPath)));
|
|
13986
14027
|
for (const entry of sveltePageEntries) {
|
|
13987
14028
|
const name = basename8(entry).replace(/\.svelte(\.(ts|js))?$/, "");
|
|
13988
|
-
const indexFile =
|
|
14029
|
+
const indexFile = join24(svelteIndexDir, "pages", `${name}.js`);
|
|
13989
14030
|
if (!existsSync19(indexFile))
|
|
13990
14031
|
continue;
|
|
13991
14032
|
let content = readFileSync12(indexFile, "utf-8");
|
|
13992
14033
|
const srcRel = relative10(process.cwd(), resolve19(entry)).replace(/\\/g, "/");
|
|
13993
14034
|
content = content.replace(/import\s+Component\s+from\s+['"]([^'"]+)['"]/, `import Component from "/@src/${srcRel}"`);
|
|
13994
|
-
writeFileSync7(
|
|
14035
|
+
writeFileSync7(join24(devIndexDir, `${name}.svelte.js`), content);
|
|
13995
14036
|
}
|
|
13996
14037
|
}, copyVueDevIndexes = (vueDir, vuePagesPath, vueEntries, devIndexDir) => {
|
|
13997
|
-
const vueIndexDir =
|
|
14038
|
+
const vueIndexDir = join24(getFrameworkGeneratedDir("vue"), "indexes");
|
|
13998
14039
|
const vuePageEntries = vueEntries.filter((file4) => resolve19(file4).startsWith(resolve19(vuePagesPath)));
|
|
13999
14040
|
for (const entry of vuePageEntries) {
|
|
14000
14041
|
const name = basename8(entry, ".vue");
|
|
14001
|
-
const indexFile =
|
|
14042
|
+
const indexFile = join24(vueIndexDir, `${name}.js`);
|
|
14002
14043
|
if (!existsSync19(indexFile))
|
|
14003
14044
|
continue;
|
|
14004
14045
|
let content = readFileSync12(indexFile, "utf-8");
|
|
14005
14046
|
const srcRel = relative10(process.cwd(), resolve19(entry)).replace(/\\/g, "/");
|
|
14006
14047
|
content = content.replace(/import\s+Comp(?:\s*,\s*\*\s+as\s+\w+)?\s+from\s+['"]([^'"]+)['"]/, (match) => match.replace(/from\s+['"][^'"]+['"]/, `from "/@src/${srcRel}"`));
|
|
14007
|
-
writeFileSync7(
|
|
14048
|
+
writeFileSync7(join24(devIndexDir, `${name}.vue.js`), content);
|
|
14008
14049
|
}
|
|
14009
14050
|
}, resolveVueRuntimeId = (content, firstUseName, outputPath, projectRoot) => {
|
|
14010
14051
|
const varIdx = content.indexOf(`var ${firstUseName} =`);
|
|
@@ -14226,10 +14267,10 @@ ${content.slice(firstUseIdx)}`;
|
|
|
14226
14267
|
restoreTracePhase();
|
|
14227
14268
|
return;
|
|
14228
14269
|
}
|
|
14229
|
-
const traceDir =
|
|
14270
|
+
const traceDir = join24(buildPath2, ".absolute-trace");
|
|
14230
14271
|
const timestamp = new Date().toISOString().replace(/[:.]/g, "-");
|
|
14231
14272
|
mkdirSync11(traceDir, { recursive: true });
|
|
14232
|
-
writeFileSync7(
|
|
14273
|
+
writeFileSync7(join24(traceDir, `build-trace-${timestamp}.json`), JSON.stringify({
|
|
14233
14274
|
events: traceEvents,
|
|
14234
14275
|
frameworks: traceFrameworkNames,
|
|
14235
14276
|
generatedAt: new Date().toISOString(),
|
|
@@ -14260,15 +14301,15 @@ ${content.slice(firstUseIdx)}`;
|
|
|
14260
14301
|
const stylesPath = typeof stylesConfig === "string" ? stylesConfig : stylesConfig?.path;
|
|
14261
14302
|
const stylesIgnore = typeof stylesConfig === "object" ? stylesConfig.ignore : undefined;
|
|
14262
14303
|
const stylesDir = stylesPath && validateSafePath(stylesPath, projectRoot);
|
|
14263
|
-
const reactIndexesPath = reactDir &&
|
|
14264
|
-
const reactPagesPath = reactDir &&
|
|
14265
|
-
const htmlPagesPath = htmlDir &&
|
|
14266
|
-
const htmlScriptsPath = htmlDir &&
|
|
14267
|
-
const sveltePagesPath = svelteDir &&
|
|
14268
|
-
const vuePagesPath = vueDir &&
|
|
14269
|
-
const htmxPagesPath = htmxDir &&
|
|
14270
|
-
const angularPagesPath = angularDir &&
|
|
14271
|
-
const emberPagesPath = emberDir &&
|
|
14304
|
+
const reactIndexesPath = reactDir && join24(getFrameworkGeneratedDir("react"), "indexes");
|
|
14305
|
+
const reactPagesPath = reactDir && join24(reactDir, "pages");
|
|
14306
|
+
const htmlPagesPath = htmlDir && join24(htmlDir, "pages");
|
|
14307
|
+
const htmlScriptsPath = htmlDir && join24(htmlDir, "scripts");
|
|
14308
|
+
const sveltePagesPath = svelteDir && join24(svelteDir, "pages");
|
|
14309
|
+
const vuePagesPath = vueDir && join24(vueDir, "pages");
|
|
14310
|
+
const htmxPagesPath = htmxDir && join24(htmxDir, "pages");
|
|
14311
|
+
const angularPagesPath = angularDir && join24(angularDir, "pages");
|
|
14312
|
+
const emberPagesPath = emberDir && join24(emberDir, "pages");
|
|
14272
14313
|
const frontends = [
|
|
14273
14314
|
reactDir,
|
|
14274
14315
|
htmlDir,
|
|
@@ -14295,36 +14336,40 @@ ${content.slice(firstUseIdx)}`;
|
|
|
14295
14336
|
mode: mode ?? (isDev ? "development" : "production"),
|
|
14296
14337
|
tailwind: Boolean(tailwind)
|
|
14297
14338
|
});
|
|
14339
|
+
const generatedRoot = getGeneratedRoot(projectRoot);
|
|
14298
14340
|
const sourceClientRoots = [
|
|
14299
|
-
reactDir,
|
|
14300
|
-
svelteDir,
|
|
14301
14341
|
htmlDir,
|
|
14302
|
-
|
|
14303
|
-
angularDir,
|
|
14342
|
+
htmxDir,
|
|
14304
14343
|
islandBootstrapPath && dirname13(islandBootstrapPath)
|
|
14305
14344
|
].filter((dir) => Boolean(dir));
|
|
14306
|
-
const
|
|
14345
|
+
const usesGenerated = Boolean(reactDir) || Boolean(svelteDir) || Boolean(vueDir) || Boolean(angularDir);
|
|
14346
|
+
if (usesGenerated)
|
|
14347
|
+
sourceClientRoots.push(generatedRoot);
|
|
14348
|
+
const clientRoot = sourceClientRoots.length === 1 ? sourceClientRoots[0] ?? projectRoot : commonAncestor(sourceClientRoots, projectRoot);
|
|
14307
14349
|
const serverDirMap = [];
|
|
14308
14350
|
if (svelteDir)
|
|
14309
14351
|
serverDirMap.push({
|
|
14310
|
-
dir:
|
|
14311
|
-
subdir:
|
|
14352
|
+
dir: getFrameworkGeneratedDir("svelte", projectRoot),
|
|
14353
|
+
subdir: "server"
|
|
14312
14354
|
});
|
|
14313
14355
|
if (vueDir)
|
|
14314
14356
|
serverDirMap.push({
|
|
14315
|
-
dir:
|
|
14316
|
-
subdir:
|
|
14357
|
+
dir: getFrameworkGeneratedDir("vue", projectRoot),
|
|
14358
|
+
subdir: "server"
|
|
14317
14359
|
});
|
|
14318
14360
|
if (angularDir)
|
|
14319
|
-
serverDirMap.push({
|
|
14361
|
+
serverDirMap.push({
|
|
14362
|
+
dir: getFrameworkGeneratedDir("angular", projectRoot),
|
|
14363
|
+
subdir: ""
|
|
14364
|
+
});
|
|
14320
14365
|
let serverOutDir;
|
|
14321
14366
|
let serverRoot;
|
|
14322
14367
|
if (serverDirMap.length === 1) {
|
|
14323
14368
|
const [firstEntry] = serverDirMap;
|
|
14324
14369
|
if (!firstEntry)
|
|
14325
14370
|
throw new Error("Expected at least one server directory entry");
|
|
14326
|
-
serverRoot =
|
|
14327
|
-
serverOutDir =
|
|
14371
|
+
serverRoot = join24(firstEntry.dir, firstEntry.subdir);
|
|
14372
|
+
serverOutDir = join24(buildPath, basename8(firstEntry.dir));
|
|
14328
14373
|
} else if (serverDirMap.length > 1) {
|
|
14329
14374
|
serverRoot = commonAncestor(serverDirMap.map((entry) => entry.dir), projectRoot);
|
|
14330
14375
|
serverOutDir = buildPath;
|
|
@@ -14352,7 +14397,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
14352
14397
|
await tracePhase("react/index-generation", () => generateReactIndexFiles(reactPagesPath, reactIndexesPath, hmr));
|
|
14353
14398
|
}
|
|
14354
14399
|
if (assetsPath && (!isIncremental || normalizedIncrementalFiles?.some((f2) => f2.includes("/assets/")))) {
|
|
14355
|
-
await tracePhase("assets/copy", () => cpSync(assetsPath,
|
|
14400
|
+
await tracePhase("assets/copy", () => cpSync(assetsPath, join24(buildPath, "assets"), {
|
|
14356
14401
|
force: true,
|
|
14357
14402
|
recursive: true
|
|
14358
14403
|
}));
|
|
@@ -14406,7 +14451,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
14406
14451
|
const reactEntries = isIncremental && reactIndexesPath && reactPagesPath ? filterToIncrementalEntries(allReactEntries, (entry) => {
|
|
14407
14452
|
if (entry.startsWith(resolve19(reactIndexesPath))) {
|
|
14408
14453
|
const pageName = basename8(entry, ".tsx");
|
|
14409
|
-
return
|
|
14454
|
+
return join24(reactPagesPath, `${pageName}.tsx`);
|
|
14410
14455
|
}
|
|
14411
14456
|
return null;
|
|
14412
14457
|
}) : allReactEntries;
|
|
@@ -14510,7 +14555,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
14510
14555
|
const compileReactConventions = async () => {
|
|
14511
14556
|
if (reactConventionSources.length === 0)
|
|
14512
14557
|
return emptyStringArray;
|
|
14513
|
-
const destDir =
|
|
14558
|
+
const destDir = join24(buildPath, "conventions", "react");
|
|
14514
14559
|
rmSync2(destDir, { force: true, recursive: true });
|
|
14515
14560
|
mkdirSync11(destDir, { recursive: true });
|
|
14516
14561
|
const destPaths = [];
|
|
@@ -14554,7 +14599,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
14554
14599
|
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 }
|
|
14555
14600
|
]);
|
|
14556
14601
|
const bundleConventionFiles = async (framework, compiledPaths) => {
|
|
14557
|
-
const destDir =
|
|
14602
|
+
const destDir = join24(buildPath, "conventions", framework);
|
|
14558
14603
|
rmSync2(destDir, { force: true, recursive: true });
|
|
14559
14604
|
mkdirSync11(destDir, { recursive: true });
|
|
14560
14605
|
const destPaths = [];
|
|
@@ -14627,7 +14672,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
14627
14672
|
}
|
|
14628
14673
|
})) : {
|
|
14629
14674
|
entries: [],
|
|
14630
|
-
generatedRoot:
|
|
14675
|
+
generatedRoot: join24(buildPath, "_island_entries")
|
|
14631
14676
|
};
|
|
14632
14677
|
const islandClientEntryPoints = islandEntryResult.entries.map((entry) => entry.entryPath);
|
|
14633
14678
|
if (serverEntryPoints.length === 0 && reactClientEntryPoints.length === 0 && nonReactClientEntryPoints.length === 0 && islandClientEntryPoints.length === 0 && htmxDir === undefined && htmlDir === undefined) {
|
|
@@ -14663,7 +14708,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
14663
14708
|
return {};
|
|
14664
14709
|
}
|
|
14665
14710
|
if (hmr && reactIndexesPath && reactClientEntryPoints.length > 0) {
|
|
14666
|
-
const refreshEntry =
|
|
14711
|
+
const refreshEntry = join24(reactIndexesPath, "_refresh.tsx");
|
|
14667
14712
|
if (!reactClientEntryPoints.includes(refreshEntry))
|
|
14668
14713
|
reactClientEntryPoints.push(refreshEntry);
|
|
14669
14714
|
}
|
|
@@ -14762,19 +14807,19 @@ ${content.slice(firstUseIdx)}`;
|
|
|
14762
14807
|
throw: false
|
|
14763
14808
|
}, resolveBunBuildOverride(bunBuildConfig, "reactClient")) : undefined;
|
|
14764
14809
|
if (reactDir && reactClientEntryPoints.length > 0) {
|
|
14765
|
-
rmSync2(
|
|
14810
|
+
rmSync2(join24(buildPath, "react", "generated", "indexes"), {
|
|
14766
14811
|
force: true,
|
|
14767
14812
|
recursive: true
|
|
14768
14813
|
});
|
|
14769
14814
|
}
|
|
14770
14815
|
if (angularDir && angularClientPaths.length > 0) {
|
|
14771
|
-
rmSync2(
|
|
14816
|
+
rmSync2(join24(buildPath, "angular", "indexes"), {
|
|
14772
14817
|
force: true,
|
|
14773
14818
|
recursive: true
|
|
14774
14819
|
});
|
|
14775
14820
|
}
|
|
14776
14821
|
if (islandClientEntryPoints.length > 0) {
|
|
14777
|
-
rmSync2(
|
|
14822
|
+
rmSync2(join24(buildPath, "islands"), {
|
|
14778
14823
|
force: true,
|
|
14779
14824
|
recursive: true
|
|
14780
14825
|
});
|
|
@@ -14843,7 +14888,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
14843
14888
|
globalCssEntries.length > 0 ? tracePhase("bun/global-css", () => bunBuild7(mergeBunBuildConfig({
|
|
14844
14889
|
entrypoints: globalCssEntries,
|
|
14845
14890
|
naming: `[dir]/[name].[hash].[ext]`,
|
|
14846
|
-
outdir: stylesDir ?
|
|
14891
|
+
outdir: stylesDir ? join24(buildPath, basename8(stylesDir)) : buildPath,
|
|
14847
14892
|
plugins: [stylePreprocessorPlugin2],
|
|
14848
14893
|
root: stylesDir || clientRoot,
|
|
14849
14894
|
target: "browser",
|
|
@@ -14852,7 +14897,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
14852
14897
|
vueCssPaths.length > 0 ? tracePhase("bun/vue-css", () => bunBuild7(mergeBunBuildConfig({
|
|
14853
14898
|
entrypoints: vueCssPaths,
|
|
14854
14899
|
naming: `[name].[hash].[ext]`,
|
|
14855
|
-
outdir:
|
|
14900
|
+
outdir: join24(buildPath, assetsPath ? basename8(assetsPath) : "assets", "css"),
|
|
14856
14901
|
target: "browser",
|
|
14857
14902
|
throw: false
|
|
14858
14903
|
}, resolveBunBuildOverride(bunBuildConfig, "vueCss")))) : undefined
|
|
@@ -15003,7 +15048,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
15003
15048
|
const processHtmlPages = async () => {
|
|
15004
15049
|
if (!(htmlDir && htmlPagesPath))
|
|
15005
15050
|
return;
|
|
15006
|
-
const outputHtmlPages = isSingle ?
|
|
15051
|
+
const outputHtmlPages = isSingle ? join24(buildPath, "pages") : join24(buildPath, basename8(htmlDir), "pages");
|
|
15007
15052
|
mkdirSync11(outputHtmlPages, { recursive: true });
|
|
15008
15053
|
cpSync(htmlPagesPath, outputHtmlPages, {
|
|
15009
15054
|
force: true,
|
|
@@ -15025,14 +15070,14 @@ ${content.slice(firstUseIdx)}`;
|
|
|
15025
15070
|
const processHtmxPages = async () => {
|
|
15026
15071
|
if (!(htmxDir && htmxPagesPath))
|
|
15027
15072
|
return;
|
|
15028
|
-
const outputHtmxPages = isSingle ?
|
|
15073
|
+
const outputHtmxPages = isSingle ? join24(buildPath, "pages") : join24(buildPath, basename8(htmxDir), "pages");
|
|
15029
15074
|
mkdirSync11(outputHtmxPages, { recursive: true });
|
|
15030
15075
|
cpSync(htmxPagesPath, outputHtmxPages, {
|
|
15031
15076
|
force: true,
|
|
15032
15077
|
recursive: true
|
|
15033
15078
|
});
|
|
15034
15079
|
if (shouldCopyHtmx) {
|
|
15035
|
-
const htmxDestDir = isSingle ? buildPath :
|
|
15080
|
+
const htmxDestDir = isSingle ? buildPath : join24(buildPath, basename8(htmxDir));
|
|
15036
15081
|
copyHtmxVendor(htmxDir, htmxDestDir);
|
|
15037
15082
|
}
|
|
15038
15083
|
if (shouldUpdateHtmxAssetPaths) {
|
|
@@ -15093,9 +15138,9 @@ ${content.slice(firstUseIdx)}`;
|
|
|
15093
15138
|
writeBuildTrace(buildPath);
|
|
15094
15139
|
return { conventions: conventionsMap, manifest };
|
|
15095
15140
|
}
|
|
15096
|
-
writeFileSync7(
|
|
15141
|
+
writeFileSync7(join24(buildPath, "manifest.json"), JSON.stringify(manifest, null, "\t"));
|
|
15097
15142
|
if (Object.keys(conventionsMap).length > 0) {
|
|
15098
|
-
writeFileSync7(
|
|
15143
|
+
writeFileSync7(join24(buildPath, "conventions.json"), JSON.stringify(conventionsMap, null, "\t"));
|
|
15099
15144
|
}
|
|
15100
15145
|
writeBuildTrace(buildPath);
|
|
15101
15146
|
if (tailwind && mode === "production") {
|
|
@@ -15130,6 +15175,7 @@ var init_build = __esm(() => {
|
|
|
15130
15175
|
init_cleanStaleOutputs();
|
|
15131
15176
|
init_cleanup();
|
|
15132
15177
|
init_commonAncestor();
|
|
15178
|
+
init_generatedDir();
|
|
15133
15179
|
init_buildDirectoryLock();
|
|
15134
15180
|
init_logger();
|
|
15135
15181
|
init_validateSafePath();
|
|
@@ -15193,7 +15239,7 @@ var init_build = __esm(() => {
|
|
|
15193
15239
|
|
|
15194
15240
|
// src/build/buildEmberVendor.ts
|
|
15195
15241
|
import { mkdirSync as mkdirSync12, existsSync as existsSync20 } from "fs";
|
|
15196
|
-
import { join as
|
|
15242
|
+
import { join as join25 } from "path";
|
|
15197
15243
|
import { rm as rm9 } from "fs/promises";
|
|
15198
15244
|
var {build: bunBuild8 } = globalThis.Bun;
|
|
15199
15245
|
var toSafeFileName5 = (specifier) => specifier.replace(/^@/, "").replace(/\//g, "_"), generateMacrosShim = () => `// Generated shim for @embroider/macros \u2014 provides minimal runtime
|
|
@@ -15245,7 +15291,7 @@ export const importSync = (specifier) => {
|
|
|
15245
15291
|
if (standaloneSpecifiers.has(specifier)) {
|
|
15246
15292
|
return { resolveTo: specifier, specifier };
|
|
15247
15293
|
}
|
|
15248
|
-
const emberInternalPath =
|
|
15294
|
+
const emberInternalPath = join25(cwd2, "node_modules/ember-source/dist/packages", specifier, "index.js");
|
|
15249
15295
|
if (!existsSync20(emberInternalPath)) {
|
|
15250
15296
|
throw new Error(`Ember vendor build: cannot find ${specifier} at ${emberInternalPath}. ` + `Is ember-source installed and at least 6.12?`);
|
|
15251
15297
|
}
|
|
@@ -15277,7 +15323,7 @@ export const importSync = (specifier) => {
|
|
|
15277
15323
|
if (standalonePackages.has(args.path)) {
|
|
15278
15324
|
return;
|
|
15279
15325
|
}
|
|
15280
|
-
const internal =
|
|
15326
|
+
const internal = join25(cwd2, "node_modules/ember-source/dist/packages", args.path, "index.js");
|
|
15281
15327
|
if (existsSync20(internal)) {
|
|
15282
15328
|
return { path: internal };
|
|
15283
15329
|
}
|
|
@@ -15285,16 +15331,16 @@ export const importSync = (specifier) => {
|
|
|
15285
15331
|
});
|
|
15286
15332
|
}
|
|
15287
15333
|
}), buildEmberVendor = async (buildDir, cwd2 = process.cwd()) => {
|
|
15288
|
-
const vendorDir =
|
|
15334
|
+
const vendorDir = join25(buildDir, "ember", "vendor");
|
|
15289
15335
|
mkdirSync12(vendorDir, { recursive: true });
|
|
15290
|
-
const tmpDir =
|
|
15336
|
+
const tmpDir = join25(buildDir, "_ember_vendor_tmp");
|
|
15291
15337
|
mkdirSync12(tmpDir, { recursive: true });
|
|
15292
|
-
const macrosShimPath =
|
|
15338
|
+
const macrosShimPath = join25(tmpDir, "embroider_macros_shim.js");
|
|
15293
15339
|
await Bun.write(macrosShimPath, generateMacrosShim());
|
|
15294
15340
|
const resolutions = REQUIRED_EMBER_SPECIFIERS.map((specifier) => resolveEmberSpecifier(specifier, cwd2));
|
|
15295
15341
|
const entrypoints = await Promise.all(resolutions.map(async (resolution) => {
|
|
15296
15342
|
const safeName = toSafeFileName5(resolution.specifier);
|
|
15297
|
-
const entryPath =
|
|
15343
|
+
const entryPath = join25(tmpDir, `${safeName}.js`);
|
|
15298
15344
|
const source = resolution.specifier === "@embroider/macros" ? `export * from ${JSON.stringify(macrosShimPath)};
|
|
15299
15345
|
` : generateVendorEntrySource2(resolution);
|
|
15300
15346
|
await Bun.write(entryPath, source);
|
|
@@ -15828,7 +15874,7 @@ var init_pathUtils = __esm(() => {
|
|
|
15828
15874
|
// src/dev/fileWatcher.ts
|
|
15829
15875
|
import { watch } from "fs";
|
|
15830
15876
|
import { existsSync as existsSync23 } from "fs";
|
|
15831
|
-
import { join as
|
|
15877
|
+
import { join as join26, resolve as resolve23 } from "path";
|
|
15832
15878
|
var safeRemoveFromGraph = (graph, fullPath) => {
|
|
15833
15879
|
try {
|
|
15834
15880
|
removeFileFromGraph(graph, fullPath);
|
|
@@ -15855,7 +15901,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
15855
15901
|
if (shouldSkipFilename(filename, isStylesDir)) {
|
|
15856
15902
|
return;
|
|
15857
15903
|
}
|
|
15858
|
-
const fullPath =
|
|
15904
|
+
const fullPath = join26(absolutePath, filename).replace(/\\/g, "/");
|
|
15859
15905
|
if (shouldIgnorePath(fullPath, state.resolvedPaths)) {
|
|
15860
15906
|
return;
|
|
15861
15907
|
}
|
|
@@ -16647,7 +16693,7 @@ __export(exports_moduleServer, {
|
|
|
16647
16693
|
SRC_URL_PREFIX: () => SRC_URL_PREFIX
|
|
16648
16694
|
});
|
|
16649
16695
|
import { existsSync as existsSync24, readFileSync as readFileSync17, statSync as statSync2 } from "fs";
|
|
16650
|
-
import { basename as basename11, dirname as dirname15, extname as extname8, join as
|
|
16696
|
+
import { basename as basename11, dirname as dirname15, extname as extname8, join as join27, resolve as resolve28, relative as relative11 } from "path";
|
|
16651
16697
|
var SRC_PREFIX = "/@src/", jsTranspiler2, tsTranspiler2, tsxTranspiler, TRANSPILABLE, ALL_EXPORTS_RE, STRING_CONTENTS_RE, preserveTypeExports = (originalSource, transpiled, valueExports) => {
|
|
16652
16698
|
const codeOnly = originalSource.replace(STRING_CONTENTS_RE, '""');
|
|
16653
16699
|
const allExports = [];
|
|
@@ -16717,7 +16763,7 @@ ${stubs}
|
|
|
16717
16763
|
const subpath = isScoped ? parts.slice(2).join("/") : parts.slice(1).join("/");
|
|
16718
16764
|
if (!subpath) {
|
|
16719
16765
|
const pkgDir = resolve28(projectRoot, "node_modules", packageName ?? "");
|
|
16720
|
-
const pkgJsonPath =
|
|
16766
|
+
const pkgJsonPath = join27(pkgDir, "package.json");
|
|
16721
16767
|
if (existsSync24(pkgJsonPath)) {
|
|
16722
16768
|
const pkg = JSON.parse(readFileSync17(pkgJsonPath, "utf-8"));
|
|
16723
16769
|
const esmEntry = typeof pkg.module === "string" && pkg.module || typeof pkg.browser === "string" && pkg.browser;
|
|
@@ -17937,15 +17983,17 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
17937
17983
|
});
|
|
17938
17984
|
return Array.from(resolvedPages);
|
|
17939
17985
|
}, computeClientRoot = async (resolvedPaths) => {
|
|
17986
|
+
const { getGeneratedRoot: getGeneratedRoot2 } = await Promise.resolve().then(() => (init_generatedDir(), exports_generatedDir));
|
|
17987
|
+
const projectRoot = process.cwd();
|
|
17940
17988
|
const clientRoots = [
|
|
17941
|
-
resolvedPaths.reactDir,
|
|
17942
|
-
resolvedPaths.svelteDir,
|
|
17943
17989
|
resolvedPaths.htmlDir,
|
|
17944
|
-
resolvedPaths.
|
|
17945
|
-
resolvedPaths.angularDir
|
|
17990
|
+
resolvedPaths.htmxDir
|
|
17946
17991
|
].filter((dir) => Boolean(dir));
|
|
17992
|
+
const usesGenerated = Boolean(resolvedPaths.reactDir) || Boolean(resolvedPaths.svelteDir) || Boolean(resolvedPaths.vueDir) || Boolean(resolvedPaths.angularDir);
|
|
17993
|
+
if (usesGenerated)
|
|
17994
|
+
clientRoots.push(getGeneratedRoot2(projectRoot));
|
|
17947
17995
|
const { commonAncestor: commonAncestor2 } = await Promise.resolve().then(() => (init_commonAncestor(), exports_commonAncestor));
|
|
17948
|
-
return clientRoots.length === 1 ? clientRoots[0] ??
|
|
17996
|
+
return clientRoots.length === 1 ? clientRoots[0] ?? projectRoot : commonAncestor2(clientRoots, projectRoot);
|
|
17949
17997
|
}, updateServerManifestEntry = (state, artifact) => {
|
|
17950
17998
|
const fileWithHash = basename12(artifact.path);
|
|
17951
17999
|
const [baseName] = fileWithHash.split(`.${artifact.hash}.`);
|
|
@@ -18190,7 +18238,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
18190
18238
|
const { svelteServerPaths, svelteIndexPaths, svelteClientPaths } = await compileSvelte2(svelteFiles, svelteDir, new Map, true, getStyleTransformConfig(state.config));
|
|
18191
18239
|
const serverEntries = [...svelteServerPaths];
|
|
18192
18240
|
const clientEntries = [...svelteIndexPaths, ...svelteClientPaths];
|
|
18193
|
-
const
|
|
18241
|
+
const { getFrameworkGeneratedDir: getFrameworkGeneratedDir2 } = await Promise.resolve().then(() => (init_generatedDir(), exports_generatedDir));
|
|
18242
|
+
const serverRoot = resolve31(getFrameworkGeneratedDir2("svelte"), "server");
|
|
18194
18243
|
const serverOutDir = resolve31(buildDir, basename12(svelteDir));
|
|
18195
18244
|
const [serverResult, clientResult] = await Promise.all([
|
|
18196
18245
|
serverEntries.length > 0 ? bunBuild9({
|
|
@@ -19222,7 +19271,7 @@ __export(exports_buildDepVendor, {
|
|
|
19222
19271
|
buildDepVendor: () => buildDepVendor
|
|
19223
19272
|
});
|
|
19224
19273
|
import { mkdirSync as mkdirSync13 } from "fs";
|
|
19225
|
-
import { join as
|
|
19274
|
+
import { join as join28 } from "path";
|
|
19226
19275
|
import { rm as rm10 } from "fs/promises";
|
|
19227
19276
|
var {build: bunBuild9, Glob: Glob9 } = globalThis.Bun;
|
|
19228
19277
|
var toSafeFileName6 = (specifier) => {
|
|
@@ -19333,7 +19382,7 @@ var toSafeFileName6 = (specifier) => {
|
|
|
19333
19382
|
}), buildDepVendorPass = async (specifiers, vendorDir, tmpDir) => {
|
|
19334
19383
|
const entries = await Promise.all(specifiers.map(async (specifier) => {
|
|
19335
19384
|
const safeName = toSafeFileName6(specifier);
|
|
19336
|
-
const entryPath =
|
|
19385
|
+
const entryPath = join28(tmpDir, `${safeName}.ts`);
|
|
19337
19386
|
await Bun.write(entryPath, await generateVendorEntrySource(specifier));
|
|
19338
19387
|
return { entryPath, specifier };
|
|
19339
19388
|
}));
|
|
@@ -19394,9 +19443,9 @@ var toSafeFileName6 = (specifier) => {
|
|
|
19394
19443
|
const { dep: initialSpecs, framework: frameworkRoots } = await scanBareImports(directories);
|
|
19395
19444
|
if (initialSpecs.length === 0 && frameworkRoots.length === 0)
|
|
19396
19445
|
return {};
|
|
19397
|
-
const vendorDir =
|
|
19446
|
+
const vendorDir = join28(buildDir, "vendor");
|
|
19398
19447
|
mkdirSync13(vendorDir, { recursive: true });
|
|
19399
|
-
const tmpDir =
|
|
19448
|
+
const tmpDir = join28(buildDir, "_dep_vendor_tmp");
|
|
19400
19449
|
mkdirSync13(tmpDir, { recursive: true });
|
|
19401
19450
|
const allSpecs = new Set(initialSpecs);
|
|
19402
19451
|
const alreadyScanned = new Set;
|
|
@@ -19838,5 +19887,5 @@ export {
|
|
|
19838
19887
|
build
|
|
19839
19888
|
};
|
|
19840
19889
|
|
|
19841
|
-
//# debugId=
|
|
19890
|
+
//# debugId=39499099B3E8310A64756E2164756E21
|
|
19842
19891
|
//# sourceMappingURL=build.js.map
|