@absolutejs/absolute 0.19.0-beta.984 → 0.19.0-beta.986
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/browser.js +2 -16
- package/dist/angular/browser.js.map +3 -3
- package/dist/angular/components/core/streamingSlotRegistrar.js +1 -1
- package/dist/angular/components/core/streamingSlotRegistry.js +2 -2
- package/dist/angular/index.js +20 -17
- package/dist/angular/index.js.map +5 -5
- package/dist/angular/server.js +19 -2
- package/dist/angular/server.js.map +4 -4
- package/dist/build.js +343 -394
- package/dist/build.js.map +6 -6
- package/dist/index.js +354 -405
- package/dist/index.js.map +6 -6
- package/dist/src/angular/composables/useSubscription.d.ts +13 -6
- package/dist/src/angular/pageHandler.d.ts +14 -7
- package/dist/src/build/scanAngularHandlerCalls.d.ts +0 -22
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -11861,7 +11861,7 @@ var init_validateSafePath = () => {};
|
|
|
11861
11861
|
|
|
11862
11862
|
// src/build/scanAngularHandlerCalls.ts
|
|
11863
11863
|
import { readdirSync as readdirSync2, readFileSync as readFileSync14 } from "fs";
|
|
11864
|
-
import {
|
|
11864
|
+
import { join as join23 } from "path";
|
|
11865
11865
|
import ts6 from "typescript";
|
|
11866
11866
|
var ELYSIA_ROUTE_METHODS2, SKIP_DIRS2, SOURCE_EXTENSIONS2, getScriptKind2 = (filePath) => {
|
|
11867
11867
|
if (filePath.endsWith(".tsx"))
|
|
@@ -11901,86 +11901,7 @@ var ELYSIA_ROUTE_METHODS2, SKIP_DIRS2, SOURCE_EXTENSIONS2, getScriptKind2 = (fil
|
|
|
11901
11901
|
}
|
|
11902
11902
|
}
|
|
11903
11903
|
return out;
|
|
11904
|
-
}, fileMayContainAngularHandler = (source) => source.includes("handleAngularPageRequest"),
|
|
11905
|
-
const map = new Map;
|
|
11906
|
-
const fileDir = dirname13(filePath);
|
|
11907
|
-
const recordSpec = (localName, spec) => {
|
|
11908
|
-
map.set(localName, spec);
|
|
11909
|
-
};
|
|
11910
|
-
const resolveSource = (specifier) => {
|
|
11911
|
-
if (specifier.startsWith(".")) {
|
|
11912
|
-
return resolve22(fileDir, specifier);
|
|
11913
|
-
}
|
|
11914
|
-
if (isAbsolute3(specifier)) {
|
|
11915
|
-
return specifier;
|
|
11916
|
-
}
|
|
11917
|
-
return null;
|
|
11918
|
-
};
|
|
11919
|
-
for (const statement of sf.statements) {
|
|
11920
|
-
if (!ts6.isImportDeclaration(statement))
|
|
11921
|
-
continue;
|
|
11922
|
-
if (!ts6.isStringLiteral(statement.moduleSpecifier))
|
|
11923
|
-
continue;
|
|
11924
|
-
if (statement.importClause?.isTypeOnly)
|
|
11925
|
-
continue;
|
|
11926
|
-
const source = statement.moduleSpecifier.text;
|
|
11927
|
-
const resolvedAbsPath = resolveSource(source);
|
|
11928
|
-
const clause = statement.importClause;
|
|
11929
|
-
if (!clause)
|
|
11930
|
-
continue;
|
|
11931
|
-
if (clause.name) {
|
|
11932
|
-
recordSpec(clause.name.text, {
|
|
11933
|
-
importedName: "default",
|
|
11934
|
-
isDefault: true,
|
|
11935
|
-
localName: clause.name.text,
|
|
11936
|
-
resolvedAbsPath,
|
|
11937
|
-
source
|
|
11938
|
-
});
|
|
11939
|
-
}
|
|
11940
|
-
const bindings = clause.namedBindings;
|
|
11941
|
-
if (!bindings)
|
|
11942
|
-
continue;
|
|
11943
|
-
if (ts6.isNamespaceImport(bindings)) {
|
|
11944
|
-
recordSpec(bindings.name.text, {
|
|
11945
|
-
importedName: "*",
|
|
11946
|
-
isDefault: false,
|
|
11947
|
-
localName: bindings.name.text,
|
|
11948
|
-
resolvedAbsPath,
|
|
11949
|
-
source
|
|
11950
|
-
});
|
|
11951
|
-
continue;
|
|
11952
|
-
}
|
|
11953
|
-
for (const element of bindings.elements) {
|
|
11954
|
-
if (element.isTypeOnly)
|
|
11955
|
-
continue;
|
|
11956
|
-
const localName = element.name.text;
|
|
11957
|
-
const importedName = element.propertyName?.text ?? localName;
|
|
11958
|
-
recordSpec(localName, {
|
|
11959
|
-
importedName,
|
|
11960
|
-
isDefault: false,
|
|
11961
|
-
localName,
|
|
11962
|
-
resolvedAbsPath,
|
|
11963
|
-
source
|
|
11964
|
-
});
|
|
11965
|
-
}
|
|
11966
|
-
}
|
|
11967
|
-
return map;
|
|
11968
|
-
}, collectExpressionIdentifiers = (expr) => {
|
|
11969
|
-
const out = new Set;
|
|
11970
|
-
const visit = (node) => {
|
|
11971
|
-
if (ts6.isIdentifier(node)) {
|
|
11972
|
-
out.add(node.text);
|
|
11973
|
-
return;
|
|
11974
|
-
}
|
|
11975
|
-
if (ts6.isPropertyAccessExpression(node)) {
|
|
11976
|
-
visit(node.expression);
|
|
11977
|
-
return;
|
|
11978
|
-
}
|
|
11979
|
-
ts6.forEachChild(node, visit);
|
|
11980
|
-
};
|
|
11981
|
-
visit(expr);
|
|
11982
|
-
return out;
|
|
11983
|
-
}, extractManifestKey = (pagePathValue) => {
|
|
11904
|
+
}, fileMayContainAngularHandler = (source) => source.includes("handleAngularPageRequest"), extractManifestKey = (pagePathValue) => {
|
|
11984
11905
|
if (!ts6.isCallExpression(pagePathValue))
|
|
11985
11906
|
return null;
|
|
11986
11907
|
const callee = pagePathValue.expression;
|
|
@@ -12017,13 +11938,11 @@ var ELYSIA_ROUTE_METHODS2, SKIP_DIRS2, SOURCE_EXTENSIONS2, getScriptKind2 = (fil
|
|
|
12017
11938
|
if (!fileMayContainAngularHandler(source))
|
|
12018
11939
|
return;
|
|
12019
11940
|
const sf = ts6.createSourceFile(filePath, source, ts6.ScriptTarget.Latest, true, getScriptKind2(filePath));
|
|
12020
|
-
const imports = collectFileImports(sf, filePath);
|
|
12021
11941
|
const visit = (node) => {
|
|
12022
11942
|
if (ts6.isCallExpression(node) && ts6.isIdentifier(node.expression) && node.expression.text === "handleAngularPageRequest") {
|
|
12023
11943
|
const [arg] = node.arguments;
|
|
12024
11944
|
if (arg && ts6.isObjectLiteralExpression(arg)) {
|
|
12025
11945
|
let manifestKey = null;
|
|
12026
|
-
let providersExpr = null;
|
|
12027
11946
|
for (const prop of arg.properties) {
|
|
12028
11947
|
if (ts6.isPropertyAssignment(prop)) {
|
|
12029
11948
|
if (!prop.name)
|
|
@@ -12031,8 +11950,6 @@ var ELYSIA_ROUTE_METHODS2, SKIP_DIRS2, SOURCE_EXTENSIONS2, getScriptKind2 = (fil
|
|
|
12031
11950
|
const name = ts6.isIdentifier(prop.name) ? prop.name.text : ts6.isStringLiteral(prop.name) ? prop.name.text : null;
|
|
12032
11951
|
if (name === "pagePath") {
|
|
12033
11952
|
manifestKey = extractManifestKey(prop.initializer);
|
|
12034
|
-
} else if (name === "providers") {
|
|
12035
|
-
providersExpr = prop.initializer;
|
|
12036
11953
|
}
|
|
12037
11954
|
} else if (ts6.isSpreadAssignment(prop)) {
|
|
12038
11955
|
if (manifestKey)
|
|
@@ -12047,22 +11964,9 @@ var ELYSIA_ROUTE_METHODS2, SKIP_DIRS2, SOURCE_EXTENSIONS2, getScriptKind2 = (fil
|
|
|
12047
11964
|
}
|
|
12048
11965
|
}
|
|
12049
11966
|
if (manifestKey) {
|
|
12050
|
-
const providerImports = [];
|
|
12051
|
-
let providersExprText = null;
|
|
12052
|
-
if (providersExpr) {
|
|
12053
|
-
providersExprText = providersExpr.getText(sf);
|
|
12054
|
-
const idents = collectExpressionIdentifiers(providersExpr);
|
|
12055
|
-
for (const ident of idents) {
|
|
12056
|
-
const spec = imports.get(ident);
|
|
12057
|
-
if (spec)
|
|
12058
|
-
providerImports.push(spec);
|
|
12059
|
-
}
|
|
12060
|
-
}
|
|
12061
11967
|
out.push({
|
|
12062
11968
|
manifestKey,
|
|
12063
11969
|
mountPath: findEnclosingMountPath(node),
|
|
12064
|
-
providerImports,
|
|
12065
|
-
providersExpr: providersExprText,
|
|
12066
11970
|
sourceFile: filePath
|
|
12067
11971
|
});
|
|
12068
11972
|
}
|
|
@@ -12226,7 +12130,7 @@ __export(exports_parseAngularConfigImports, {
|
|
|
12226
12130
|
parseAngularProvidersImport: () => parseAngularProvidersImport
|
|
12227
12131
|
});
|
|
12228
12132
|
import { existsSync as existsSync20, readFileSync as readFileSync16 } from "fs";
|
|
12229
|
-
import { dirname as
|
|
12133
|
+
import { dirname as dirname13, isAbsolute as isAbsolute3, join as join25 } from "path";
|
|
12230
12134
|
import ts8 from "typescript";
|
|
12231
12135
|
var findDefineConfigCall = (sf) => {
|
|
12232
12136
|
let result = null;
|
|
@@ -12279,6 +12183,12 @@ var findDefineConfigCall = (sf) => {
|
|
|
12279
12183
|
}
|
|
12280
12184
|
return null;
|
|
12281
12185
|
}, resolveConfigPath = (projectRoot) => {
|
|
12186
|
+
const envOverride = process.env.ABSOLUTE_CONFIG;
|
|
12187
|
+
if (envOverride) {
|
|
12188
|
+
const resolved = isAbsolute3(envOverride) ? envOverride : join25(projectRoot, envOverride);
|
|
12189
|
+
if (existsSync20(resolved))
|
|
12190
|
+
return resolved;
|
|
12191
|
+
}
|
|
12282
12192
|
const candidates = [
|
|
12283
12193
|
join25(projectRoot, "absolute.config.ts"),
|
|
12284
12194
|
join25(projectRoot, "absolute.config.mts"),
|
|
@@ -12315,8 +12225,8 @@ var findDefineConfigCall = (sf) => {
|
|
|
12315
12225
|
const importInfo = findImportForBinding(sf, binding);
|
|
12316
12226
|
if (!importInfo)
|
|
12317
12227
|
return null;
|
|
12318
|
-
const configDir2 =
|
|
12319
|
-
const absolutePath = importInfo.source.startsWith(".") ? join25(configDir2, importInfo.source).replace(/\.[cm]?[tj]sx?$/, "") :
|
|
12228
|
+
const configDir2 = dirname13(configPath2);
|
|
12229
|
+
const absolutePath = importInfo.source.startsWith(".") ? join25(configDir2, importInfo.source).replace(/\.[cm]?[tj]sx?$/, "") : isAbsolute3(importInfo.source) ? importInfo.source.replace(/\.[cm]?[tj]sx?$/, "") : importInfo.source;
|
|
12320
12230
|
return {
|
|
12321
12231
|
absolutePath,
|
|
12322
12232
|
bindingName: binding,
|
|
@@ -12390,11 +12300,11 @@ __export(exports_compileSvelte, {
|
|
|
12390
12300
|
import { existsSync as existsSync21 } from "fs";
|
|
12391
12301
|
import { mkdir as mkdir4, stat as stat2 } from "fs/promises";
|
|
12392
12302
|
import {
|
|
12393
|
-
dirname as
|
|
12303
|
+
dirname as dirname14,
|
|
12394
12304
|
join as join26,
|
|
12395
12305
|
basename as basename7,
|
|
12396
12306
|
extname as extname5,
|
|
12397
|
-
resolve as
|
|
12307
|
+
resolve as resolve22,
|
|
12398
12308
|
relative as relative9,
|
|
12399
12309
|
sep as sep2
|
|
12400
12310
|
} from "path";
|
|
@@ -12402,14 +12312,14 @@ import { env as env2 } from "process";
|
|
|
12402
12312
|
var {write: write2, file: file2, Transpiler: Transpiler2 } = globalThis.Bun;
|
|
12403
12313
|
var resolveDevClientDir2 = () => {
|
|
12404
12314
|
const projectRoot = process.cwd();
|
|
12405
|
-
const fromSource =
|
|
12315
|
+
const fromSource = resolve22(import.meta.dir, "../dev/client");
|
|
12406
12316
|
if (existsSync21(fromSource) && fromSource.startsWith(projectRoot)) {
|
|
12407
12317
|
return fromSource;
|
|
12408
12318
|
}
|
|
12409
|
-
const fromNodeModules =
|
|
12319
|
+
const fromNodeModules = resolve22(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client");
|
|
12410
12320
|
if (existsSync21(fromNodeModules))
|
|
12411
12321
|
return fromNodeModules;
|
|
12412
|
-
return
|
|
12322
|
+
return resolve22(import.meta.dir, "./dev/client");
|
|
12413
12323
|
}, devClientDir2, hmrClientPath3, persistentCache, sourceHashCache, clearSvelteCompilerCache = () => {
|
|
12414
12324
|
persistentCache.clear();
|
|
12415
12325
|
sourceHashCache.clear();
|
|
@@ -12439,7 +12349,7 @@ var resolveDevClientDir2 = () => {
|
|
|
12439
12349
|
}, resolveRelativeModule2 = async (spec, from) => {
|
|
12440
12350
|
if (!spec.startsWith("."))
|
|
12441
12351
|
return null;
|
|
12442
|
-
const basePath =
|
|
12352
|
+
const basePath = resolve22(dirname14(from), spec);
|
|
12443
12353
|
const candidates = [
|
|
12444
12354
|
basePath,
|
|
12445
12355
|
`${basePath}.ts`,
|
|
@@ -12466,7 +12376,7 @@ var resolveDevClientDir2 = () => {
|
|
|
12466
12376
|
const resolved = resolvePackageImport(spec);
|
|
12467
12377
|
return resolved && /\.svelte(\.(?:ts|js))?$/.test(resolved) ? resolved : null;
|
|
12468
12378
|
}
|
|
12469
|
-
const basePath =
|
|
12379
|
+
const basePath = resolve22(dirname14(from), spec);
|
|
12470
12380
|
const explicit = /\.(svelte|svelte\.(?:ts|js))$/.test(basePath);
|
|
12471
12381
|
if (!explicit) {
|
|
12472
12382
|
const extensions = [".svelte", ".svelte.ts", ".svelte.js"];
|
|
@@ -12526,8 +12436,8 @@ var resolveDevClientDir2 = () => {
|
|
|
12526
12436
|
const preprocessedClient = isModule ? loweredClientSource.code : (await preprocess(loweredClientSource.code, svelteStylePreprocessor)).code;
|
|
12527
12437
|
const transpiledServer = src.endsWith(".ts") || src.endsWith(".svelte.ts") ? transpiler3.transformSync(preprocessedServer) : preprocessedServer;
|
|
12528
12438
|
const transpiledClient = src.endsWith(".ts") || src.endsWith(".svelte.ts") ? transpiler3.transformSync(preprocessedClient) : preprocessedClient;
|
|
12529
|
-
const rawRel =
|
|
12530
|
-
const relDir = rawRel.startsWith("..") ? `_ext/${relative9(process.cwd(),
|
|
12439
|
+
const rawRel = dirname14(relative9(svelteRoot, src)).replace(/\\/g, "/");
|
|
12440
|
+
const relDir = rawRel.startsWith("..") ? `_ext/${relative9(process.cwd(), dirname14(src)).replace(/\\/g, "/")}` : rawRel;
|
|
12531
12441
|
const baseName = basename7(src).replace(/\.svelte(\.(ts|js))?$/, "");
|
|
12532
12442
|
const importPaths = Array.from(transpiledServer.matchAll(/from\s+['"]([^'"]+)['"]/g)).map((match) => match[1]).filter((path) => path !== undefined);
|
|
12533
12443
|
const resolvedModuleImports = await Promise.all(importPaths.map((importPath) => resolveRelativeModule2(importPath, src)));
|
|
@@ -12536,8 +12446,8 @@ var resolveDevClientDir2 = () => {
|
|
|
12536
12446
|
const childBuilt = await Promise.all(childSources.map((child) => build2(child)));
|
|
12537
12447
|
const hasAwaitSlotFromChildren = childBuilt.some((child) => child.hasAwaitSlot);
|
|
12538
12448
|
const externalRewrites = new Map;
|
|
12539
|
-
const ssrOutputDir =
|
|
12540
|
-
const clientOutputDir =
|
|
12449
|
+
const ssrOutputDir = dirname14(join26(serverDir, relDir, `${baseName}.js`));
|
|
12450
|
+
const clientOutputDir = dirname14(join26(clientDir, relDir, `${baseName}.js`));
|
|
12541
12451
|
for (let idx = 0;idx < importPaths.length; idx++) {
|
|
12542
12452
|
const rawSpec = importPaths[idx];
|
|
12543
12453
|
if (!rawSpec)
|
|
@@ -12605,8 +12515,8 @@ var resolveDevClientDir2 = () => {
|
|
|
12605
12515
|
const ssrPath = join26(serverDir, relDir, `${baseName}.js`);
|
|
12606
12516
|
const clientPath = join26(clientDir, relDir, `${baseName}.js`);
|
|
12607
12517
|
await Promise.all([
|
|
12608
|
-
mkdir4(
|
|
12609
|
-
mkdir4(
|
|
12518
|
+
mkdir4(dirname14(ssrPath), { recursive: true }),
|
|
12519
|
+
mkdir4(dirname14(clientPath), { recursive: true })
|
|
12610
12520
|
]);
|
|
12611
12521
|
const inlineMap = (map) => map ? `
|
|
12612
12522
|
//# sourceMappingURL=data:application/json;base64,${Buffer.from(JSON.stringify(map)).toString("base64")}
|
|
@@ -12639,10 +12549,10 @@ var resolveDevClientDir2 = () => {
|
|
|
12639
12549
|
};
|
|
12640
12550
|
const roots = await Promise.all(entryPoints.map(build2));
|
|
12641
12551
|
await Promise.all(roots.map(async ({ client: client2, hasAwaitSlot }) => {
|
|
12642
|
-
const relClientDir =
|
|
12552
|
+
const relClientDir = dirname14(relative9(clientDir, client2));
|
|
12643
12553
|
const name = basename7(client2, extname5(client2));
|
|
12644
12554
|
const indexPath = join26(indexDir, relClientDir, `${name}.js`);
|
|
12645
|
-
const importRaw = relative9(
|
|
12555
|
+
const importRaw = relative9(dirname14(indexPath), client2).split(sep2).join("/");
|
|
12646
12556
|
const importPath = importRaw.startsWith(".") || importRaw.startsWith("/") ? importRaw : `./${importRaw}`;
|
|
12647
12557
|
const hmrImports = isDev2 ? `window.__HMR_FRAMEWORK__ = "svelte";
|
|
12648
12558
|
import "${hmrClientPath3}";
|
|
@@ -12713,13 +12623,13 @@ if (typeof window !== "undefined") {
|
|
|
12713
12623
|
setTimeout(releaseStreamingSlots, 0);
|
|
12714
12624
|
}
|
|
12715
12625
|
}`;
|
|
12716
|
-
await mkdir4(
|
|
12626
|
+
await mkdir4(dirname14(indexPath), { recursive: true });
|
|
12717
12627
|
return write2(indexPath, bootstrap);
|
|
12718
12628
|
}));
|
|
12719
12629
|
return {
|
|
12720
12630
|
svelteClientPaths: roots.map(({ client: client2 }) => client2),
|
|
12721
12631
|
svelteIndexPaths: roots.map(({ client: client2 }) => {
|
|
12722
|
-
const rel =
|
|
12632
|
+
const rel = dirname14(relative9(clientDir, client2));
|
|
12723
12633
|
return join26(indexDir, rel, basename7(client2));
|
|
12724
12634
|
}),
|
|
12725
12635
|
svelteServerPaths: roots.map(({ ssr }) => ssr)
|
|
@@ -13131,23 +13041,23 @@ import { existsSync as existsSync22 } from "fs";
|
|
|
13131
13041
|
import { mkdir as mkdir5 } from "fs/promises";
|
|
13132
13042
|
import {
|
|
13133
13043
|
basename as basename8,
|
|
13134
|
-
dirname as
|
|
13135
|
-
isAbsolute as
|
|
13044
|
+
dirname as dirname15,
|
|
13045
|
+
isAbsolute as isAbsolute4,
|
|
13136
13046
|
join as join27,
|
|
13137
13047
|
relative as relative10,
|
|
13138
|
-
resolve as
|
|
13048
|
+
resolve as resolve23
|
|
13139
13049
|
} from "path";
|
|
13140
13050
|
var {file: file3, write: write3, Transpiler: Transpiler3 } = globalThis.Bun;
|
|
13141
13051
|
var resolveDevClientDir3 = () => {
|
|
13142
13052
|
const projectRoot = process.cwd();
|
|
13143
|
-
const fromSource =
|
|
13053
|
+
const fromSource = resolve23(import.meta.dir, "../dev/client");
|
|
13144
13054
|
if (existsSync22(fromSource) && fromSource.startsWith(projectRoot)) {
|
|
13145
13055
|
return fromSource;
|
|
13146
13056
|
}
|
|
13147
|
-
const fromNodeModules =
|
|
13057
|
+
const fromNodeModules = resolve23(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client");
|
|
13148
13058
|
if (existsSync22(fromNodeModules))
|
|
13149
13059
|
return fromNodeModules;
|
|
13150
|
-
return
|
|
13060
|
+
return resolve23(import.meta.dir, "./dev/client");
|
|
13151
13061
|
}, devClientDir3, hmrClientPath4, transpiler4, scriptCache, scriptSetupCache, templateCache, styleCache, persistentBuildCache, vueSourceHashCache, vueHmrMetadata, clearVueHmrCaches = () => {
|
|
13152
13062
|
scriptCache.clear();
|
|
13153
13063
|
scriptSetupCache.clear();
|
|
@@ -13193,7 +13103,7 @@ var resolveDevClientDir3 = () => {
|
|
|
13193
13103
|
return filePath.replace(/\.ts$/, ".js");
|
|
13194
13104
|
if (isStylePath(filePath)) {
|
|
13195
13105
|
if (sourceDir && (filePath.startsWith("./") || filePath.startsWith("../"))) {
|
|
13196
|
-
return
|
|
13106
|
+
return resolve23(sourceDir, filePath);
|
|
13197
13107
|
}
|
|
13198
13108
|
return filePath;
|
|
13199
13109
|
}
|
|
@@ -13257,12 +13167,12 @@ var resolveDevClientDir3 = () => {
|
|
|
13257
13167
|
const childComponentPaths = importPaths.filter((path) => path.startsWith(".") && path.endsWith(".vue"));
|
|
13258
13168
|
const packageComponentPaths = Array.from(resolvedPackageVueImports.entries());
|
|
13259
13169
|
const helperModulePaths = importPaths.filter((path) => path.startsWith(".") && !path.endsWith(".vue") && !isStylePath(path));
|
|
13260
|
-
const stylePathsImported = importPaths.filter((path) => (path.startsWith(".") ||
|
|
13170
|
+
const stylePathsImported = importPaths.filter((path) => (path.startsWith(".") || isAbsolute4(path)) && isStylePath(path)).map((path) => isAbsolute4(path) ? path : resolve23(dirname15(sourceFilePath), path));
|
|
13261
13171
|
for (const stylePath of stylePathsImported) {
|
|
13262
13172
|
addStyleImporter(sourceFilePath, stylePath);
|
|
13263
13173
|
}
|
|
13264
13174
|
const childBuildResults = await Promise.all([
|
|
13265
|
-
...childComponentPaths.map((relativeChildPath) => compileVueFile(
|
|
13175
|
+
...childComponentPaths.map((relativeChildPath) => compileVueFile(resolve23(dirname15(sourceFilePath), relativeChildPath), outputDirs, cacheMap, false, vueRootDir, compiler, stylePreprocessors)),
|
|
13266
13176
|
...packageComponentPaths.map(([, absolutePath]) => compileVueFile(absolutePath, outputDirs, cacheMap, false, vueRootDir, compiler, stylePreprocessors))
|
|
13267
13177
|
]);
|
|
13268
13178
|
const hasScript = descriptor.script || descriptor.scriptSetup;
|
|
@@ -13272,7 +13182,7 @@ var resolveDevClientDir3 = () => {
|
|
|
13272
13182
|
sourceMap: true
|
|
13273
13183
|
}) : { bindings: {}, content: "export default {};", map: undefined };
|
|
13274
13184
|
const strippedScript = stripExports2(compiledScript.content);
|
|
13275
|
-
const sourceDir =
|
|
13185
|
+
const sourceDir = dirname15(sourceFilePath);
|
|
13276
13186
|
const transpiledScript = transpiler4.transformSync(strippedScript).replace(/(['"])(\.{1,2}\/[^'"]+)(['"])/g, (_2, quoteStart, relativeImport, quoteEnd) => `${quoteStart}${toJs(relativeImport, sourceDir)}${quoteEnd}`);
|
|
13277
13187
|
const packageImportRewrites = new Map;
|
|
13278
13188
|
for (const [bareImport, absolutePath] of packageComponentPaths) {
|
|
@@ -13312,7 +13222,7 @@ var resolveDevClientDir3 = () => {
|
|
|
13312
13222
|
let cssOutputPaths = [];
|
|
13313
13223
|
if (isEntryPoint && allCss.length) {
|
|
13314
13224
|
const cssOutputFile = join27(outputDirs.css, `${toKebab(fileBaseName)}-compiled.css`);
|
|
13315
|
-
await mkdir5(
|
|
13225
|
+
await mkdir5(dirname15(cssOutputFile), { recursive: true });
|
|
13316
13226
|
await write3(cssOutputFile, allCss.join(`
|
|
13317
13227
|
`));
|
|
13318
13228
|
cssOutputPaths = [cssOutputFile];
|
|
@@ -13344,7 +13254,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
13344
13254
|
const serverCode = assembleModule(generateRenderFunction(true), "ssrRender", false) + islandMetadataExports;
|
|
13345
13255
|
const clientOutputPath = join27(outputDirs.client, `${relativeWithoutExtension}.js`);
|
|
13346
13256
|
const serverOutputPath = join27(outputDirs.server, `${relativeWithoutExtension}.js`);
|
|
13347
|
-
const relDir =
|
|
13257
|
+
const relDir = dirname15(relativeFilePath);
|
|
13348
13258
|
const relDepth = relDir === "." ? 0 : relDir.split("/").length;
|
|
13349
13259
|
const adjustImports = (code) => code.replace(/(from\s+['"])(\.\.\/(?:\.\.\/)*)/g, (_2, prefix, dots) => {
|
|
13350
13260
|
const upCount = dots.split("/").length - 1;
|
|
@@ -13356,15 +13266,15 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
13356
13266
|
let result2 = code;
|
|
13357
13267
|
for (const [bareImport, paths] of packageImportRewrites) {
|
|
13358
13268
|
const targetPath = mode === "server" ? paths.server : paths.client;
|
|
13359
|
-
let rel = relative10(
|
|
13269
|
+
let rel = relative10(dirname15(outputPath), targetPath).replace(/\\/g, "/");
|
|
13360
13270
|
if (!rel.startsWith("."))
|
|
13361
13271
|
rel = `./${rel}`;
|
|
13362
13272
|
result2 = result2.replaceAll(bareImport, rel);
|
|
13363
13273
|
}
|
|
13364
13274
|
return result2;
|
|
13365
13275
|
};
|
|
13366
|
-
await mkdir5(
|
|
13367
|
-
await mkdir5(
|
|
13276
|
+
await mkdir5(dirname15(clientOutputPath), { recursive: true });
|
|
13277
|
+
await mkdir5(dirname15(serverOutputPath), { recursive: true });
|
|
13368
13278
|
const clientFinal = rewritePackageImports(adjustImports(clientCode), clientOutputPath, "client");
|
|
13369
13279
|
const serverFinal = rewritePackageImports(adjustImports(serverCode), serverOutputPath, "server");
|
|
13370
13280
|
const inlineSourceMapFor = (finalContent) => {
|
|
@@ -13386,7 +13296,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
13386
13296
|
hmrId,
|
|
13387
13297
|
serverPath: serverOutputPath,
|
|
13388
13298
|
tsHelperPaths: [
|
|
13389
|
-
...helperModulePaths.map((helper) =>
|
|
13299
|
+
...helperModulePaths.map((helper) => resolve23(dirname15(sourceFilePath), helper.endsWith(".ts") ? helper : `${helper}.ts`)),
|
|
13390
13300
|
...childBuildResults.flatMap((child) => child.tsHelperPaths)
|
|
13391
13301
|
]
|
|
13392
13302
|
};
|
|
@@ -13409,7 +13319,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
13409
13319
|
const buildCache = new Map;
|
|
13410
13320
|
const allTsHelperPaths = new Set;
|
|
13411
13321
|
const compiledPages = await Promise.all(entryPoints.map(async (entryPath) => {
|
|
13412
|
-
const result = await compileVueFile(
|
|
13322
|
+
const result = await compileVueFile(resolve23(entryPath), {
|
|
13413
13323
|
client: clientOutputDir,
|
|
13414
13324
|
css: cssOutputDir,
|
|
13415
13325
|
server: serverOutputDir
|
|
@@ -13418,14 +13328,14 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
13418
13328
|
const entryBaseName = basename8(entryPath, ".vue");
|
|
13419
13329
|
const indexOutputFile = join27(indexOutputDir, `${entryBaseName}.js`);
|
|
13420
13330
|
const clientOutputFile = join27(clientOutputDir, relative10(vueRootDir, entryPath).replace(/\\/g, "/").replace(/\.vue$/, ".js"));
|
|
13421
|
-
await mkdir5(
|
|
13331
|
+
await mkdir5(dirname15(indexOutputFile), { recursive: true });
|
|
13422
13332
|
const vueHmrImports = isDev2 ? [
|
|
13423
13333
|
`window.__HMR_FRAMEWORK__ = "vue";`,
|
|
13424
13334
|
`import "${hmrClientPath4}";`
|
|
13425
13335
|
] : [];
|
|
13426
13336
|
await write3(indexOutputFile, [
|
|
13427
13337
|
...vueHmrImports,
|
|
13428
|
-
`import Comp, * as PageModule from "${relative10(
|
|
13338
|
+
`import Comp, * as PageModule from "${relative10(dirname15(indexOutputFile), clientOutputFile).replace(/\\/g, "/")}";`,
|
|
13429
13339
|
'import { createSSRApp, createApp } from "vue";',
|
|
13430
13340
|
"",
|
|
13431
13341
|
"// HMR State Preservation: Check for preserved state from HMR",
|
|
@@ -13572,8 +13482,8 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
13572
13482
|
const relativeJsPath = relative10(vueRootDir, tsPath).replace(/\.ts$/, ".js");
|
|
13573
13483
|
const outClientPath = join27(clientOutputDir, relativeJsPath);
|
|
13574
13484
|
const outServerPath = join27(serverOutputDir, relativeJsPath);
|
|
13575
|
-
await mkdir5(
|
|
13576
|
-
await mkdir5(
|
|
13485
|
+
await mkdir5(dirname15(outClientPath), { recursive: true });
|
|
13486
|
+
await mkdir5(dirname15(outServerPath), { recursive: true });
|
|
13577
13487
|
await write3(outClientPath, transpiledCode);
|
|
13578
13488
|
await write3(outServerPath, transpiledCode);
|
|
13579
13489
|
}));
|
|
@@ -14076,7 +13986,7 @@ __export(exports_compileAngular, {
|
|
|
14076
13986
|
compileAngular: () => compileAngular
|
|
14077
13987
|
});
|
|
14078
13988
|
import { existsSync as existsSync23, readFileSync as readFileSync18, promises as fs5 } from "fs";
|
|
14079
|
-
import { join as join28, basename as basename9, sep as sep3, dirname as
|
|
13989
|
+
import { join as join28, basename as basename9, sep as sep3, dirname as dirname16, resolve as resolve24, relative as relative11 } from "path";
|
|
14080
13990
|
var {Glob: Glob6 } = globalThis.Bun;
|
|
14081
13991
|
import ts9 from "typescript";
|
|
14082
13992
|
var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
@@ -14084,10 +13994,10 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
14084
13994
|
return tracePhase ? tracePhase(`compile/angular/${name}`, fn2, metadata2) : await fn2();
|
|
14085
13995
|
}, readTsconfigPathAliases = () => {
|
|
14086
13996
|
try {
|
|
14087
|
-
const configPath2 =
|
|
13997
|
+
const configPath2 = resolve24(process.cwd(), "tsconfig.json");
|
|
14088
13998
|
const config = ts9.readConfigFile(configPath2, ts9.sys.readFile).config;
|
|
14089
13999
|
const compilerOptions = config?.compilerOptions ?? {};
|
|
14090
|
-
const baseUrl =
|
|
14000
|
+
const baseUrl = resolve24(process.cwd(), compilerOptions.baseUrl ?? ".");
|
|
14091
14001
|
const aliases = Object.entries(compilerOptions.paths ?? {}).map(([pattern, replacements]) => ({ pattern, replacements }));
|
|
14092
14002
|
return { aliases, baseUrl };
|
|
14093
14003
|
} catch {
|
|
@@ -14107,7 +14017,7 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
14107
14017
|
const wildcardValue = exactMatch ? "" : specifier.slice(prefix.length, specifier.length - suffix.length);
|
|
14108
14018
|
for (const replacement of alias.replacements) {
|
|
14109
14019
|
const candidate = replacement.replace("*", wildcardValue);
|
|
14110
|
-
const resolved = resolveSourceFile(
|
|
14020
|
+
const resolved = resolveSourceFile(resolve24(baseUrl, candidate));
|
|
14111
14021
|
if (resolved)
|
|
14112
14022
|
return resolved;
|
|
14113
14023
|
}
|
|
@@ -14126,13 +14036,13 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
14126
14036
|
];
|
|
14127
14037
|
return candidates.find((file4) => existsSync23(file4));
|
|
14128
14038
|
}, createLegacyAngularAnimationUsageResolver = (rootDir) => {
|
|
14129
|
-
const baseDir =
|
|
14039
|
+
const baseDir = resolve24(rootDir);
|
|
14130
14040
|
const tsconfigAliases = readTsconfigPathAliases();
|
|
14131
14041
|
const transpiler5 = new Bun.Transpiler({ loader: "tsx" });
|
|
14132
14042
|
const scanCache = new Map;
|
|
14133
14043
|
const resolveLocalImport = (specifier, fromDir) => {
|
|
14134
14044
|
if (specifier.startsWith(".") || specifier.startsWith("/")) {
|
|
14135
|
-
return resolveSourceFile(
|
|
14045
|
+
return resolveSourceFile(resolve24(fromDir, specifier));
|
|
14136
14046
|
}
|
|
14137
14047
|
const aliased = matchTsconfigAlias(specifier, tsconfigAliases.aliases, tsconfigAliases.baseUrl, resolveSourceFile);
|
|
14138
14048
|
if (aliased)
|
|
@@ -14141,7 +14051,7 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
14141
14051
|
const resolved = Bun.resolveSync(specifier, fromDir);
|
|
14142
14052
|
if (resolved.includes("/node_modules/"))
|
|
14143
14053
|
return;
|
|
14144
|
-
const absolute =
|
|
14054
|
+
const absolute = resolve24(resolved);
|
|
14145
14055
|
if (!absolute.startsWith(baseDir))
|
|
14146
14056
|
return;
|
|
14147
14057
|
return resolveSourceFile(absolute);
|
|
@@ -14157,7 +14067,7 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
14157
14067
|
usesLegacyAnimations: false
|
|
14158
14068
|
});
|
|
14159
14069
|
}
|
|
14160
|
-
const resolved =
|
|
14070
|
+
const resolved = resolve24(actualPath);
|
|
14161
14071
|
const cached = scanCache.get(resolved);
|
|
14162
14072
|
if (cached)
|
|
14163
14073
|
return cached;
|
|
@@ -14186,7 +14096,7 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
14186
14096
|
const actualPath = resolveSourceFile(filePath);
|
|
14187
14097
|
if (!actualPath)
|
|
14188
14098
|
return false;
|
|
14189
|
-
const resolved =
|
|
14099
|
+
const resolved = resolve24(actualPath);
|
|
14190
14100
|
if (visited.has(resolved))
|
|
14191
14101
|
return false;
|
|
14192
14102
|
visited.add(resolved);
|
|
@@ -14194,7 +14104,7 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
14194
14104
|
if (scan.usesLegacyAnimations)
|
|
14195
14105
|
return true;
|
|
14196
14106
|
for (const specifier of scan.imports) {
|
|
14197
|
-
const importedPath = resolveLocalImport(specifier,
|
|
14107
|
+
const importedPath = resolveLocalImport(specifier, dirname16(resolved));
|
|
14198
14108
|
if (importedPath && await visit(importedPath, visited)) {
|
|
14199
14109
|
return true;
|
|
14200
14110
|
}
|
|
@@ -14204,14 +14114,14 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
14204
14114
|
return (entryPath) => visit(entryPath);
|
|
14205
14115
|
}, resolveDevClientDir4 = () => {
|
|
14206
14116
|
const projectRoot = process.cwd();
|
|
14207
|
-
const fromSource =
|
|
14117
|
+
const fromSource = resolve24(import.meta.dir, "../dev/client");
|
|
14208
14118
|
if (existsSync23(fromSource) && fromSource.startsWith(projectRoot)) {
|
|
14209
14119
|
return fromSource;
|
|
14210
14120
|
}
|
|
14211
|
-
const fromNodeModules =
|
|
14121
|
+
const fromNodeModules = resolve24(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client");
|
|
14212
14122
|
if (existsSync23(fromNodeModules))
|
|
14213
14123
|
return fromNodeModules;
|
|
14214
|
-
return
|
|
14124
|
+
return resolve24(import.meta.dir, "./dev/client");
|
|
14215
14125
|
}, devClientDir4, hmrClientPath5, formatDiagnosticMessage = (diagnostic) => {
|
|
14216
14126
|
try {
|
|
14217
14127
|
return ts9.flattenDiagnosticMessageText(diagnostic.messageText, `
|
|
@@ -14253,12 +14163,12 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
14253
14163
|
return `${path.replace(/\.ts$/, ".js")}${query}`;
|
|
14254
14164
|
if (hasJsLikeExtension(path))
|
|
14255
14165
|
return `${path}${query}`;
|
|
14256
|
-
const importerDir =
|
|
14257
|
-
const fileCandidate =
|
|
14166
|
+
const importerDir = dirname16(importerOutputPath);
|
|
14167
|
+
const fileCandidate = resolve24(importerDir, `${path}.js`);
|
|
14258
14168
|
if (outputFiles?.has(fileCandidate) || existsSync23(fileCandidate)) {
|
|
14259
14169
|
return `${path}.js${query}`;
|
|
14260
14170
|
}
|
|
14261
|
-
const indexCandidate =
|
|
14171
|
+
const indexCandidate = resolve24(importerDir, path, "index.js");
|
|
14262
14172
|
if (outputFiles?.has(indexCandidate) || existsSync23(indexCandidate)) {
|
|
14263
14173
|
return `${path}/index.js${query}`;
|
|
14264
14174
|
}
|
|
@@ -14286,7 +14196,7 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
14286
14196
|
}, resolveLocalTsImport = (fromFile, specifier) => {
|
|
14287
14197
|
if (!isRelativeModuleSpecifier(specifier))
|
|
14288
14198
|
return null;
|
|
14289
|
-
const basePath =
|
|
14199
|
+
const basePath = resolve24(dirname16(fromFile), specifier);
|
|
14290
14200
|
const candidates = /\.[cm]?[tj]sx?$/.test(basePath) ? [basePath] : [
|
|
14291
14201
|
`${basePath}.ts`,
|
|
14292
14202
|
`${basePath}.tsx`,
|
|
@@ -14297,7 +14207,7 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
14297
14207
|
join28(basePath, "index.mts"),
|
|
14298
14208
|
join28(basePath, "index.cts")
|
|
14299
14209
|
];
|
|
14300
|
-
return candidates.map((candidate) =>
|
|
14210
|
+
return candidates.map((candidate) => resolve24(candidate)).find((candidate) => existsSync23(candidate) && !candidate.endsWith(".d.ts")) ?? null;
|
|
14301
14211
|
}, readFileForAotTransform = async (fileName, readFile6) => {
|
|
14302
14212
|
const hostSource = readFile6?.(fileName);
|
|
14303
14213
|
if (typeof hostSource === "string")
|
|
@@ -14332,7 +14242,7 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
14332
14242
|
paths.push(join28(fileDir, urlMatch.replace(/['"]/g, "")));
|
|
14333
14243
|
}
|
|
14334
14244
|
}
|
|
14335
|
-
return paths.map((path) =>
|
|
14245
|
+
return paths.map((path) => resolve24(path));
|
|
14336
14246
|
}, readResourceCacheFile = async (cachePath) => {
|
|
14337
14247
|
try {
|
|
14338
14248
|
const entry = JSON.parse(await fs5.readFile(cachePath, "utf-8"));
|
|
@@ -14344,13 +14254,13 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
14344
14254
|
return null;
|
|
14345
14255
|
}
|
|
14346
14256
|
}, writeResourceCacheFile = async (cachePath, source) => {
|
|
14347
|
-
await fs5.mkdir(
|
|
14257
|
+
await fs5.mkdir(dirname16(cachePath), { recursive: true });
|
|
14348
14258
|
await fs5.writeFile(cachePath, JSON.stringify({
|
|
14349
14259
|
source,
|
|
14350
14260
|
version: 1
|
|
14351
14261
|
}), "utf-8");
|
|
14352
14262
|
}, resolveResourceTransformCachePath = async (filePath, source, stylePreprocessors) => {
|
|
14353
|
-
const resourcePaths = collectAngularResourcePaths(source,
|
|
14263
|
+
const resourcePaths = collectAngularResourcePaths(source, dirname16(filePath));
|
|
14354
14264
|
const resourceContents = await Promise.all(resourcePaths.map(async (resourcePath) => {
|
|
14355
14265
|
const content = await fs5.readFile(resourcePath, "utf-8");
|
|
14356
14266
|
return `${resourcePath}\x00${content}`;
|
|
@@ -14374,7 +14284,7 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
14374
14284
|
transformedFiles: 0
|
|
14375
14285
|
};
|
|
14376
14286
|
const transformFile = async (filePath) => {
|
|
14377
|
-
const resolvedPath =
|
|
14287
|
+
const resolvedPath = resolve24(filePath);
|
|
14378
14288
|
if (visited.has(resolvedPath))
|
|
14379
14289
|
return;
|
|
14380
14290
|
visited.add(resolvedPath);
|
|
@@ -14390,7 +14300,7 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
14390
14300
|
transformedSource = cached.source;
|
|
14391
14301
|
} else {
|
|
14392
14302
|
stats.cacheMisses += 1;
|
|
14393
|
-
const transformed = await inlineResources(source,
|
|
14303
|
+
const transformed = await inlineResources(source, dirname16(resolvedPath), stylePreprocessors);
|
|
14394
14304
|
transformedSource = transformed.source;
|
|
14395
14305
|
await writeResourceCacheFile(cachePath, transformedSource);
|
|
14396
14306
|
}
|
|
@@ -14409,7 +14319,7 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
14409
14319
|
return { stats, transformedSources };
|
|
14410
14320
|
}, compileAngularFiles = async (inputPaths, outDir, stylePreprocessors) => {
|
|
14411
14321
|
const islandMetadataByOutputPath = await traceAngularPhase("aot/island-metadata", () => new Map(inputPaths.map((inputPath) => {
|
|
14412
|
-
const outputPath =
|
|
14322
|
+
const outputPath = resolve24(join28(outDir, relative11(process.cwd(), resolve24(inputPath)).replace(/\.[cm]?[tj]sx?$/, ".js")));
|
|
14413
14323
|
return [
|
|
14414
14324
|
outputPath,
|
|
14415
14325
|
buildIslandMetadataExports(readFileSync18(inputPath, "utf-8"))
|
|
@@ -14419,8 +14329,8 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
14419
14329
|
const { readConfiguration, performCompilation, EmitFlags } = await traceAngularPhase("aot/import-compiler-cli", () => import("@angular/compiler-cli"));
|
|
14420
14330
|
const tsLibDir = await traceAngularPhase("aot/resolve-typescript-lib", () => {
|
|
14421
14331
|
const tsPath = __require.resolve("typescript");
|
|
14422
|
-
const tsRootDir =
|
|
14423
|
-
return tsRootDir.endsWith("lib") ? tsRootDir :
|
|
14332
|
+
const tsRootDir = dirname16(tsPath);
|
|
14333
|
+
return tsRootDir.endsWith("lib") ? tsRootDir : resolve24(tsRootDir, "lib");
|
|
14424
14334
|
});
|
|
14425
14335
|
const config = await traceAngularPhase("aot/read-configuration", () => readConfiguration("./tsconfig.json"));
|
|
14426
14336
|
const options = {
|
|
@@ -14462,7 +14372,7 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
14462
14372
|
return originalGetSourceFile?.call(host, fileName, languageVersion, onError);
|
|
14463
14373
|
};
|
|
14464
14374
|
const emitted = {};
|
|
14465
|
-
const resolvedOutDir =
|
|
14375
|
+
const resolvedOutDir = resolve24(outDir);
|
|
14466
14376
|
host.writeFile = (fileName, text) => {
|
|
14467
14377
|
const relativePath = resolveRelativePath(fileName, resolvedOutDir, outDir);
|
|
14468
14378
|
emitted[relativePath] = text;
|
|
@@ -14484,12 +14394,12 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
14484
14394
|
if (!fileName.endsWith(".ts") || fileName.endsWith(".d.ts")) {
|
|
14485
14395
|
return source;
|
|
14486
14396
|
}
|
|
14487
|
-
const resolvedPath =
|
|
14397
|
+
const resolvedPath = resolve24(fileName);
|
|
14488
14398
|
return transformedSources.get(resolvedPath) ?? source;
|
|
14489
14399
|
};
|
|
14490
14400
|
const originalGetSourceFileForCompile = host.getSourceFile;
|
|
14491
14401
|
host.getSourceFile = (fileName, languageVersion, onError) => {
|
|
14492
|
-
const source = transformedSources.get(
|
|
14402
|
+
const source = transformedSources.get(resolve24(fileName));
|
|
14493
14403
|
if (source) {
|
|
14494
14404
|
return ts9.createSourceFile(fileName, source, languageVersion, true);
|
|
14495
14405
|
}
|
|
@@ -14513,7 +14423,7 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
14513
14423
|
content,
|
|
14514
14424
|
target: join28(outDir, fileName)
|
|
14515
14425
|
}));
|
|
14516
|
-
const outputFiles = new Set(rawEntries.map(({ target }) =>
|
|
14426
|
+
const outputFiles = new Set(rawEntries.map(({ target }) => resolve24(target)));
|
|
14517
14427
|
return rawEntries.map(({ content, target }) => {
|
|
14518
14428
|
let processedContent = content.replace(/from\s+(['"])(\.\.?\/[^'"]+)(\1)/g, (match, quote, path) => {
|
|
14519
14429
|
const rewritten = rewriteRelativeJsSpecifier(target, path, outputFiles);
|
|
@@ -14528,17 +14438,17 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
14528
14438
|
return cleaned ? `import { ${cleaned}, InternalInjectFlags } from '@angular/core'` : `import { InternalInjectFlags } from '@angular/core'`;
|
|
14529
14439
|
});
|
|
14530
14440
|
processedContent = processedContent.replace(/\b(?<!Internal)InjectFlags\b/g, "InternalInjectFlags");
|
|
14531
|
-
processedContent += islandMetadataByOutputPath.get(
|
|
14441
|
+
processedContent += islandMetadataByOutputPath.get(resolve24(target)) ?? "";
|
|
14532
14442
|
return { content: processedContent, target };
|
|
14533
14443
|
});
|
|
14534
14444
|
});
|
|
14535
14445
|
await traceAngularPhase("aot/write-output", () => Promise.all(entries.map(async ({ target, content }) => {
|
|
14536
|
-
await fs5.mkdir(
|
|
14446
|
+
await fs5.mkdir(dirname16(target), { recursive: true });
|
|
14537
14447
|
await fs5.writeFile(target, content, "utf-8");
|
|
14538
14448
|
})), { outputs: entries.length });
|
|
14539
14449
|
return await traceAngularPhase("aot/collect-output-paths", () => entries.map(({ target }) => target), { outputs: entries.length });
|
|
14540
14450
|
}, compileAngularFile = async (inputPath, outDir, stylePreprocessors) => compileAngularFiles([inputPath], outDir, stylePreprocessors), jitContentCache, invalidateAngularJitCache = (filePath) => {
|
|
14541
|
-
jitContentCache.delete(
|
|
14451
|
+
jitContentCache.delete(resolve24(filePath));
|
|
14542
14452
|
}, wrapperOutputCache, escapeTemplateContent = (content) => content.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$\{/g, "\\${"), findUncommentedMatch = (source, pattern) => {
|
|
14543
14453
|
const re2 = new RegExp(pattern.source, pattern.flags.includes("g") ? pattern.flags : pattern.flags + "g");
|
|
14544
14454
|
let match;
|
|
@@ -14551,7 +14461,7 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
14551
14461
|
}
|
|
14552
14462
|
return null;
|
|
14553
14463
|
}, resolveAngularDeferImportSpecifier = () => {
|
|
14554
|
-
const sourceEntry =
|
|
14464
|
+
const sourceEntry = resolve24(import.meta.dir, "../angular/components/index.ts");
|
|
14555
14465
|
if (existsSync23(sourceEntry)) {
|
|
14556
14466
|
return sourceEntry.replace(/\\/g, "/");
|
|
14557
14467
|
}
|
|
@@ -14781,10 +14691,10 @@ ${fields}
|
|
|
14781
14691
|
source: result
|
|
14782
14692
|
};
|
|
14783
14693
|
}, compileAngularFileJIT = async (inputPath, outDir, rootDir, stylePreprocessors, cacheBuster) => {
|
|
14784
|
-
const entryPath =
|
|
14694
|
+
const entryPath = resolve24(inputPath);
|
|
14785
14695
|
const allOutputs = [];
|
|
14786
14696
|
const visited = new Set;
|
|
14787
|
-
const baseDir =
|
|
14697
|
+
const baseDir = resolve24(rootDir ?? process.cwd());
|
|
14788
14698
|
let usesLegacyAnimations = false;
|
|
14789
14699
|
const angularTranspiler = new Bun.Transpiler({
|
|
14790
14700
|
loader: "ts",
|
|
@@ -14812,7 +14722,7 @@ ${fields}
|
|
|
14812
14722
|
};
|
|
14813
14723
|
const resolveLocalImport = (specifier, fromDir) => {
|
|
14814
14724
|
if (specifier.startsWith(".") || specifier.startsWith("/")) {
|
|
14815
|
-
return resolveSourceFile2(
|
|
14725
|
+
return resolveSourceFile2(resolve24(fromDir, specifier));
|
|
14816
14726
|
}
|
|
14817
14727
|
const aliased = matchTsconfigAlias(specifier, tsconfigAliases.aliases, tsconfigAliases.baseUrl, resolveSourceFile2);
|
|
14818
14728
|
if (aliased)
|
|
@@ -14821,7 +14731,7 @@ ${fields}
|
|
|
14821
14731
|
const resolved = Bun.resolveSync(specifier, fromDir);
|
|
14822
14732
|
if (resolved.includes("/node_modules/"))
|
|
14823
14733
|
return;
|
|
14824
|
-
const absolute =
|
|
14734
|
+
const absolute = resolve24(resolved);
|
|
14825
14735
|
if (!absolute.startsWith(baseDir))
|
|
14826
14736
|
return;
|
|
14827
14737
|
return resolveSourceFile2(absolute);
|
|
@@ -14830,7 +14740,7 @@ ${fields}
|
|
|
14830
14740
|
}
|
|
14831
14741
|
};
|
|
14832
14742
|
const toOutputPath = (sourcePath) => {
|
|
14833
|
-
const inputDir =
|
|
14743
|
+
const inputDir = dirname16(sourcePath);
|
|
14834
14744
|
const fileBase = basename9(sourcePath).replace(/\.[cm]?[tj]sx?$/, ".js");
|
|
14835
14745
|
if (inputDir === outDir || inputDir.startsWith(`${outDir}${sep3}`)) {
|
|
14836
14746
|
return join28(inputDir, fileBase);
|
|
@@ -14873,18 +14783,18 @@ ${fields}
|
|
|
14873
14783
|
return `${prefix}${dots}`;
|
|
14874
14784
|
return `${prefix}../${dots}`;
|
|
14875
14785
|
});
|
|
14876
|
-
if (
|
|
14786
|
+
if (resolve24(actualPath) === entryPath) {
|
|
14877
14787
|
processedContent += buildIslandMetadataExports(sourceCode);
|
|
14878
14788
|
}
|
|
14879
14789
|
return processedContent;
|
|
14880
14790
|
};
|
|
14881
14791
|
const transpileFile = async (filePath) => {
|
|
14882
|
-
const resolved =
|
|
14792
|
+
const resolved = resolve24(filePath);
|
|
14883
14793
|
if (visited.has(resolved))
|
|
14884
14794
|
return;
|
|
14885
14795
|
visited.add(resolved);
|
|
14886
14796
|
if (resolved.endsWith(".json") && existsSync23(resolved)) {
|
|
14887
|
-
const inputDir2 =
|
|
14797
|
+
const inputDir2 = dirname16(resolved);
|
|
14888
14798
|
const relativeDir2 = inputDir2.startsWith(baseDir) ? inputDir2.substring(baseDir.length + 1) : inputDir2;
|
|
14889
14799
|
const targetDir2 = join28(outDir, relativeDir2);
|
|
14890
14800
|
const targetPath2 = join28(targetDir2, basename9(resolved));
|
|
@@ -14899,12 +14809,12 @@ ${fields}
|
|
|
14899
14809
|
if (!existsSync23(actualPath))
|
|
14900
14810
|
return;
|
|
14901
14811
|
let sourceCode = await fs5.readFile(actualPath, "utf-8");
|
|
14902
|
-
const inlined = await inlineResources(sourceCode,
|
|
14903
|
-
sourceCode = inlineTemplateAndLowerDeferSync(inlined.source,
|
|
14904
|
-
const inputDir =
|
|
14812
|
+
const inlined = await inlineResources(sourceCode, dirname16(actualPath), stylePreprocessors);
|
|
14813
|
+
sourceCode = inlineTemplateAndLowerDeferSync(inlined.source, dirname16(actualPath)).source;
|
|
14814
|
+
const inputDir = dirname16(actualPath);
|
|
14905
14815
|
const fileBase = basename9(actualPath).replace(/\.[cm]?[tj]sx?$/, ".js");
|
|
14906
14816
|
const targetPath = toOutputPath(actualPath);
|
|
14907
|
-
const targetDir =
|
|
14817
|
+
const targetDir = dirname16(targetPath);
|
|
14908
14818
|
const relativeDir = relative11(outDir, targetDir).replace(/\\/g, "/");
|
|
14909
14819
|
const localImports = [];
|
|
14910
14820
|
const importRewrites = new Map;
|
|
@@ -14931,7 +14841,7 @@ ${fields}
|
|
|
14931
14841
|
importRewrites.set(specifier, relativeRewrite);
|
|
14932
14842
|
return resolved2;
|
|
14933
14843
|
}).filter((path) => Boolean(path));
|
|
14934
|
-
const isEntry =
|
|
14844
|
+
const isEntry = resolve24(actualPath) === resolve24(entryPath);
|
|
14935
14845
|
const contentHash = Bun.hash(sourceCode).toString(BASE_36_RADIX);
|
|
14936
14846
|
const cacheKey2 = actualPath;
|
|
14937
14847
|
const shouldWriteFile = cacheBuster && isEntry ? true : jitContentCache.get(cacheKey2) !== contentHash || !existsSync23(targetPath);
|
|
@@ -14967,11 +14877,11 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
14967
14877
|
const compiledRoot = compiledParent;
|
|
14968
14878
|
const indexesDir = join28(compiledParent, "indexes");
|
|
14969
14879
|
await traceAngularPhase("setup/create-indexes-dir", () => fs5.mkdir(indexesDir, { recursive: true }));
|
|
14970
|
-
const aotOutputs = hmr ? [] : await traceAngularPhase("aot/compile-files", () => compileAngularFiles(entryPoints.map((entry) =>
|
|
14880
|
+
const aotOutputs = hmr ? [] : await traceAngularPhase("aot/compile-files", () => compileAngularFiles(entryPoints.map((entry) => resolve24(entry)), compiledRoot, stylePreprocessors), { entries: entryPoints.length });
|
|
14971
14881
|
if (!hmr) {
|
|
14972
14882
|
await traceAngularPhase("aot/copy-json-resources", async () => {
|
|
14973
14883
|
const cwd = process.cwd();
|
|
14974
|
-
const angularSrcDir =
|
|
14884
|
+
const angularSrcDir = resolve24(outRoot);
|
|
14975
14885
|
if (!existsSync23(angularSrcDir))
|
|
14976
14886
|
return;
|
|
14977
14887
|
const jsonGlob = new Glob6("**/*.json");
|
|
@@ -14982,14 +14892,14 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
14982
14892
|
const sourcePath = join28(angularSrcDir, rel);
|
|
14983
14893
|
const cwdRel = relative11(cwd, sourcePath);
|
|
14984
14894
|
const targetPath = join28(compiledRoot, cwdRel);
|
|
14985
|
-
await fs5.mkdir(
|
|
14895
|
+
await fs5.mkdir(dirname16(targetPath), { recursive: true });
|
|
14986
14896
|
await fs5.copyFile(sourcePath, targetPath);
|
|
14987
14897
|
}
|
|
14988
14898
|
});
|
|
14989
14899
|
}
|
|
14990
14900
|
const usesLegacyAngularAnimations = await traceAngularPhase("setup/legacy-animation-resolver", () => createLegacyAngularAnimationUsageResolver(outRoot));
|
|
14991
14901
|
const compileTasks = entryPoints.map(async (entry) => {
|
|
14992
|
-
const resolvedEntry =
|
|
14902
|
+
const resolvedEntry = resolve24(entry);
|
|
14993
14903
|
const relativeEntry = relative11(outRoot, resolvedEntry).replace(/\.[tj]s$/, ".js");
|
|
14994
14904
|
const compileEntry = () => compileAngularFileJIT(resolvedEntry, compiledRoot, outRoot, stylePreprocessors);
|
|
14995
14905
|
let outputs = hmr ? await traceAngularPhase("jit/compile-entry", compileEntry, {
|
|
@@ -15001,10 +14911,10 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
15001
14911
|
join28(compiledRoot, relativeEntry),
|
|
15002
14912
|
join28(compiledRoot, "pages", jsName),
|
|
15003
14913
|
join28(compiledRoot, jsName)
|
|
15004
|
-
].map((file4) =>
|
|
14914
|
+
].map((file4) => resolve24(file4));
|
|
15005
14915
|
const resolveRawServerFile = (candidatePaths) => {
|
|
15006
14916
|
const normalizedCandidates = [
|
|
15007
|
-
...candidatePaths.map((file4) =>
|
|
14917
|
+
...candidatePaths.map((file4) => resolve24(file4)),
|
|
15008
14918
|
...compiledFallbackPaths
|
|
15009
14919
|
];
|
|
15010
14920
|
let candidate = normalizedCandidates.find((file4) => existsSync23(file4) && file4.endsWith(`${sep3}${relativeEntry}`));
|
|
@@ -15046,7 +14956,19 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
15046
14956
|
const detectedClassName = await traceAngularPhase("wrapper/detect-component-class", () => detectExportedComponentClass(original), { entry: resolvedEntry });
|
|
15047
14957
|
const componentClassName = detectedClassName ?? `${toPascal(fileBase)}Component`;
|
|
15048
14958
|
const usesLegacyAnimations = await traceAngularPhase("wrapper/detect-legacy-animations", () => usesLegacyAngularAnimations(resolvedEntry), { entry: resolvedEntry });
|
|
15049
|
-
const
|
|
14959
|
+
const pageInjectionForHash = providersInjection?.pagesByFile.get(resolvedEntry);
|
|
14960
|
+
const providersHashInput = providersInjection ? (() => {
|
|
14961
|
+
let providersSourceContent = "";
|
|
14962
|
+
try {
|
|
14963
|
+
providersSourceContent = readFileSync18(providersInjection.appProvidersSource, "utf-8");
|
|
14964
|
+
} catch {}
|
|
14965
|
+
return JSON.stringify({
|
|
14966
|
+
basePath: pageInjectionForHash?.basePath ?? null,
|
|
14967
|
+
hasRoutes: pageInjectionForHash?.hasRoutes ?? false,
|
|
14968
|
+
source: providersSourceContent
|
|
14969
|
+
});
|
|
14970
|
+
})() : "no-providers";
|
|
14971
|
+
const serverContentHash = `${Bun.hash(original).toString(BASE_36_RADIX)}.${Bun.hash(providersHashInput).toString(BASE_36_RADIX)}`;
|
|
15050
14972
|
const cachedWrapper = wrapperOutputCache.get(resolvedEntry);
|
|
15051
14973
|
const clientFile = join28(indexesDir, jsName);
|
|
15052
14974
|
if (hmr && cachedWrapper && cachedWrapper.serverHash === serverContentHash && existsSync23(clientFile) && (usesLegacyAnimations || !original.includes("__ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__")) && (!usesLegacyAnimations || original.includes("__ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__"))) {
|
|
@@ -15074,15 +14996,16 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
15074
14996
|
`;
|
|
15075
14997
|
}
|
|
15076
14998
|
const pageInjection = providersInjection?.pagesByFile.get(resolvedEntry);
|
|
14999
|
+
rewritten = rewritten.replace(/\n\/\* __ABS_PROVIDERS_INJECTION_START \*\/[\s\S]*?\/\* __ABS_PROVIDERS_INJECTION_END \*\/\n?/g, "");
|
|
15077
15000
|
if (providersInjection && pageInjection) {
|
|
15078
15001
|
const compiledAppProvidersPath = (() => {
|
|
15079
|
-
const angularDirAbs =
|
|
15080
|
-
const appSourceAbs =
|
|
15002
|
+
const angularDirAbs = resolve24(outRoot);
|
|
15003
|
+
const appSourceAbs = resolve24(providersInjection.appProvidersSource);
|
|
15081
15004
|
const rel = relative11(angularDirAbs, appSourceAbs).replace(/\\/g, "/");
|
|
15082
15005
|
return join28(compiledParent, rel).replace(/\.[cm]?[tj]sx?$/, ".js");
|
|
15083
15006
|
})();
|
|
15084
15007
|
const appProvidersSpec = (() => {
|
|
15085
|
-
const rel = relative11(
|
|
15008
|
+
const rel = relative11(dirname16(rawServerFile), compiledAppProvidersPath).replace(/\\/g, "/");
|
|
15086
15009
|
return rel.startsWith(".") ? rel : `./${rel}`;
|
|
15087
15010
|
})();
|
|
15088
15011
|
const importLines = [
|
|
@@ -15098,9 +15021,11 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
15098
15021
|
fragments.push(`{ provide: __abs_APP_BASE_HREF, useValue: ${JSON.stringify(pageInjection.basePath)} }`);
|
|
15099
15022
|
}
|
|
15100
15023
|
rewritten += `
|
|
15024
|
+
/* __ABS_PROVIDERS_INJECTION_START */
|
|
15101
15025
|
${importLines.join(`
|
|
15102
15026
|
`)}
|
|
15103
15027
|
export const providers = [${fragments.join(", ")}];
|
|
15028
|
+
/* __ABS_PROVIDERS_INJECTION_END */
|
|
15104
15029
|
`;
|
|
15105
15030
|
}
|
|
15106
15031
|
await traceAngularPhase("wrapper/write-server-output", () => fs5.writeFile(rawServerFile, rewritten, "utf-8"), { entry: resolvedEntry });
|
|
@@ -16024,7 +15949,7 @@ __export(exports_fastHmrCompiler, {
|
|
|
16024
15949
|
invalidateFingerprintCache: () => invalidateFingerprintCache
|
|
16025
15950
|
});
|
|
16026
15951
|
import { existsSync as existsSync24, readFileSync as readFileSync19, statSync as statSync2 } from "fs";
|
|
16027
|
-
import { dirname as
|
|
15952
|
+
import { dirname as dirname17, extname as extname6, relative as relative12, resolve as resolve25 } from "path";
|
|
16028
15953
|
import ts13 from "typescript";
|
|
16029
15954
|
var fail = (reason, detail, location) => ({
|
|
16030
15955
|
ok: false,
|
|
@@ -16152,7 +16077,7 @@ var fail = (reason, detail, location) => ({
|
|
|
16152
16077
|
continue;
|
|
16153
16078
|
const decoratorMeta = readDecoratorMeta(args);
|
|
16154
16079
|
const { inputs, outputs } = extractInputsAndOutputs(stmt, null);
|
|
16155
|
-
const componentDir =
|
|
16080
|
+
const componentDir = dirname17(componentFilePath);
|
|
16156
16081
|
const fingerprint = extractFingerprint(stmt, className, decoratorMeta, inputs, outputs, sourceFile, componentDir);
|
|
16157
16082
|
fingerprintCache.set(id, fingerprint);
|
|
16158
16083
|
} else {
|
|
@@ -16328,7 +16253,7 @@ var fail = (reason, detail, location) => ({
|
|
|
16328
16253
|
if (!spec.startsWith(".") && !spec.startsWith("/")) {
|
|
16329
16254
|
return true;
|
|
16330
16255
|
}
|
|
16331
|
-
const base =
|
|
16256
|
+
const base = resolve25(componentDir, spec);
|
|
16332
16257
|
const candidates = [
|
|
16333
16258
|
`${base}.ts`,
|
|
16334
16259
|
`${base}.tsx`,
|
|
@@ -17112,7 +17037,7 @@ var fail = (reason, detail, location) => ({
|
|
|
17112
17037
|
});
|
|
17113
17038
|
if (!names.includes(className))
|
|
17114
17039
|
continue;
|
|
17115
|
-
const nextDts = resolveDtsFromSpec(fromPath,
|
|
17040
|
+
const nextDts = resolveDtsFromSpec(fromPath, dirname17(startDtsPath));
|
|
17116
17041
|
if (!nextDts)
|
|
17117
17042
|
continue;
|
|
17118
17043
|
const found = findDtsContainingClass(nextDts, className, visited);
|
|
@@ -17122,7 +17047,7 @@ var fail = (reason, detail, location) => ({
|
|
|
17122
17047
|
const starReExportRe = /export\s*\*\s*from\s*["']([^"']+)["']/g;
|
|
17123
17048
|
while ((m = starReExportRe.exec(content)) !== null) {
|
|
17124
17049
|
const fromPath = m[1] || "";
|
|
17125
|
-
const nextDts = resolveDtsFromSpec(fromPath,
|
|
17050
|
+
const nextDts = resolveDtsFromSpec(fromPath, dirname17(startDtsPath));
|
|
17126
17051
|
if (!nextDts)
|
|
17127
17052
|
continue;
|
|
17128
17053
|
const found = findDtsContainingClass(nextDts, className, visited);
|
|
@@ -17132,7 +17057,7 @@ var fail = (reason, detail, location) => ({
|
|
|
17132
17057
|
return null;
|
|
17133
17058
|
}, resolveDtsFromSpec = (spec, fromDir) => {
|
|
17134
17059
|
const stripped = spec.replace(/\.[mc]?js$/, "");
|
|
17135
|
-
const base =
|
|
17060
|
+
const base = resolve25(fromDir, stripped);
|
|
17136
17061
|
const candidates = [
|
|
17137
17062
|
`${base}.d.ts`,
|
|
17138
17063
|
`${base}.d.mts`,
|
|
@@ -17156,7 +17081,7 @@ var fail = (reason, detail, location) => ({
|
|
|
17156
17081
|
return null;
|
|
17157
17082
|
}, resolveChildComponentInfo = (className, spec, componentDir, projectRoot) => {
|
|
17158
17083
|
if (spec.startsWith(".") || spec.startsWith("/")) {
|
|
17159
|
-
const base =
|
|
17084
|
+
const base = resolve25(componentDir, spec);
|
|
17160
17085
|
const candidates = [
|
|
17161
17086
|
`${base}.ts`,
|
|
17162
17087
|
`${base}.tsx`,
|
|
@@ -17375,13 +17300,13 @@ var fail = (reason, detail, location) => ({
|
|
|
17375
17300
|
}
|
|
17376
17301
|
if (!matches)
|
|
17377
17302
|
continue;
|
|
17378
|
-
const resolved =
|
|
17303
|
+
const resolved = resolve25(componentDir, spec);
|
|
17379
17304
|
for (const ext of TS_EXTENSIONS) {
|
|
17380
17305
|
const candidate = resolved + ext;
|
|
17381
17306
|
if (existsSync24(candidate))
|
|
17382
17307
|
return candidate;
|
|
17383
17308
|
}
|
|
17384
|
-
const indexCandidate =
|
|
17309
|
+
const indexCandidate = resolve25(resolved, "index.ts");
|
|
17385
17310
|
if (existsSync24(indexCandidate))
|
|
17386
17311
|
return indexCandidate;
|
|
17387
17312
|
}
|
|
@@ -17614,7 +17539,7 @@ ${transpiled}
|
|
|
17614
17539
|
}
|
|
17615
17540
|
}${staticPatch}`;
|
|
17616
17541
|
}, STYLE_PREPROCESSED_EXT, resolveAndReadStyleResource = (componentDir, url) => {
|
|
17617
|
-
const abs =
|
|
17542
|
+
const abs = resolve25(componentDir, url);
|
|
17618
17543
|
if (!existsSync24(abs))
|
|
17619
17544
|
return null;
|
|
17620
17545
|
const ext = extname6(abs).toLowerCase();
|
|
@@ -17654,7 +17579,7 @@ ${block}
|
|
|
17654
17579
|
const cached = projectOptionsCache.get(projectRoot);
|
|
17655
17580
|
if (cached !== undefined)
|
|
17656
17581
|
return cached;
|
|
17657
|
-
const tsconfigPath =
|
|
17582
|
+
const tsconfigPath = resolve25(projectRoot, "tsconfig.json");
|
|
17658
17583
|
const opts = {};
|
|
17659
17584
|
if (existsSync24(tsconfigPath)) {
|
|
17660
17585
|
try {
|
|
@@ -17719,7 +17644,7 @@ ${block}
|
|
|
17719
17644
|
rebootstrapRequired: false
|
|
17720
17645
|
};
|
|
17721
17646
|
}
|
|
17722
|
-
if (inheritsDecoratedClass(classNode, sourceFile,
|
|
17647
|
+
if (inheritsDecoratedClass(classNode, sourceFile, dirname17(componentFilePath), projectRoot)) {
|
|
17723
17648
|
return fail("inherits-decorated-class");
|
|
17724
17649
|
}
|
|
17725
17650
|
const decorator = findComponentDecorator(classNode);
|
|
@@ -17731,14 +17656,14 @@ ${block}
|
|
|
17731
17656
|
const projectDefaults = readProjectAngularCompilerOptions(projectRoot);
|
|
17732
17657
|
const decoratorMeta = readDecoratorMeta(decoratorArgs, projectDefaults);
|
|
17733
17658
|
const advancedMetadata = extractAdvancedMetadata(classNode, decoratorArgs, compiler);
|
|
17734
|
-
const componentDir =
|
|
17659
|
+
const componentDir = dirname17(componentFilePath);
|
|
17735
17660
|
let templateText;
|
|
17736
17661
|
let templatePath;
|
|
17737
17662
|
if (decoratorMeta.template !== null) {
|
|
17738
17663
|
templateText = decoratorMeta.template;
|
|
17739
17664
|
templatePath = componentFilePath;
|
|
17740
17665
|
} else if (decoratorMeta.templateUrl) {
|
|
17741
|
-
const tplAbs =
|
|
17666
|
+
const tplAbs = resolve25(componentDir, decoratorMeta.templateUrl);
|
|
17742
17667
|
if (!existsSync24(tplAbs)) {
|
|
17743
17668
|
return fail("template-resource-not-found", `Template file not found: ${tplAbs}`, { file: componentFilePath });
|
|
17744
17669
|
}
|
|
@@ -18492,7 +18417,7 @@ __export(exports_compileEmber, {
|
|
|
18492
18417
|
getEmberServerCompiledDir: () => getEmberServerCompiledDir,
|
|
18493
18418
|
getEmberCompiledRoot: () => getEmberCompiledRoot,
|
|
18494
18419
|
getEmberClientCompiledDir: () => getEmberClientCompiledDir,
|
|
18495
|
-
dirname: () =>
|
|
18420
|
+
dirname: () => dirname18,
|
|
18496
18421
|
compileEmberFileSource: () => compileEmberFileSource,
|
|
18497
18422
|
compileEmberFile: () => compileEmberFile,
|
|
18498
18423
|
compileEmber: () => compileEmber,
|
|
@@ -18501,7 +18426,7 @@ __export(exports_compileEmber, {
|
|
|
18501
18426
|
});
|
|
18502
18427
|
import { existsSync as existsSync25 } from "fs";
|
|
18503
18428
|
import { mkdir as mkdir6, rm as rm4 } from "fs/promises";
|
|
18504
|
-
import { basename as basename10, dirname as
|
|
18429
|
+
import { basename as basename10, dirname as dirname18, extname as extname7, join as join29, resolve as resolve26 } from "path";
|
|
18505
18430
|
var {build: bunBuild2, Transpiler: Transpiler4, write: write4, file: file4 } = globalThis.Bun;
|
|
18506
18431
|
var cachedPreprocessor = null, getPreprocessor = async () => {
|
|
18507
18432
|
if (cachedPreprocessor)
|
|
@@ -18597,7 +18522,7 @@ export const importSync = (specifier) => {
|
|
|
18597
18522
|
const originalImporter = stagedSourceMap.get(args.importer);
|
|
18598
18523
|
if (!originalImporter)
|
|
18599
18524
|
return;
|
|
18600
|
-
const candidateBase =
|
|
18525
|
+
const candidateBase = resolve26(dirname18(originalImporter), args.path);
|
|
18601
18526
|
const extensionsToTry = ["", ".gts", ".gjs", ".ts", ".js"];
|
|
18602
18527
|
for (const ext of extensionsToTry) {
|
|
18603
18528
|
const candidate = candidateBase + ext;
|
|
@@ -18656,7 +18581,7 @@ export const renderToHTML = (props = {}) => {
|
|
|
18656
18581
|
export { PageComponent };
|
|
18657
18582
|
export default PageComponent;
|
|
18658
18583
|
`, compileEmberFile = async (entry, compiledRoot, cwd = process.cwd()) => {
|
|
18659
|
-
const resolvedEntry =
|
|
18584
|
+
const resolvedEntry = resolve26(entry);
|
|
18660
18585
|
const source = await file4(resolvedEntry).text();
|
|
18661
18586
|
let preprocessed = source;
|
|
18662
18587
|
if (isTemplateTagFile(resolvedEntry)) {
|
|
@@ -18676,8 +18601,8 @@ export default PageComponent;
|
|
|
18676
18601
|
mkdir6(serverDir, { recursive: true }),
|
|
18677
18602
|
mkdir6(clientDir, { recursive: true })
|
|
18678
18603
|
]);
|
|
18679
|
-
const tmpPagePath =
|
|
18680
|
-
const tmpHarnessPath =
|
|
18604
|
+
const tmpPagePath = resolve26(join29(tmpDir, `${baseName}.module.js`));
|
|
18605
|
+
const tmpHarnessPath = resolve26(join29(tmpDir, `${baseName}.harness.js`));
|
|
18681
18606
|
await Promise.all([
|
|
18682
18607
|
write4(tmpPagePath, transpiled),
|
|
18683
18608
|
write4(tmpHarnessPath, generateServerHarness(tmpPagePath))
|
|
@@ -18719,7 +18644,7 @@ export default PageComponent;
|
|
|
18719
18644
|
serverPaths: outputs.map((o3) => o3.serverPath)
|
|
18720
18645
|
};
|
|
18721
18646
|
}, compileEmberFileSource = async (entry) => {
|
|
18722
|
-
const resolvedEntry =
|
|
18647
|
+
const resolvedEntry = resolve26(entry);
|
|
18723
18648
|
const source = await file4(resolvedEntry).text();
|
|
18724
18649
|
let preprocessed = source;
|
|
18725
18650
|
if (isTemplateTagFile(resolvedEntry)) {
|
|
@@ -18752,24 +18677,24 @@ __export(exports_buildReactVendor, {
|
|
|
18752
18677
|
buildReactVendor: () => buildReactVendor
|
|
18753
18678
|
});
|
|
18754
18679
|
import { existsSync as existsSync26, mkdirSync as mkdirSync8 } from "fs";
|
|
18755
|
-
import { join as join30, resolve as
|
|
18680
|
+
import { join as join30, resolve as resolve27 } from "path";
|
|
18756
18681
|
import { rm as rm5 } from "fs/promises";
|
|
18757
18682
|
var {build: bunBuild3 } = globalThis.Bun;
|
|
18758
18683
|
var resolveJsxDevRuntimeCompatPath = () => {
|
|
18759
18684
|
const candidates = [
|
|
18760
|
-
|
|
18761
|
-
|
|
18762
|
-
|
|
18763
|
-
|
|
18764
|
-
|
|
18765
|
-
|
|
18685
|
+
resolve27(import.meta.dir, "react", "jsxDevRuntimeCompat.js"),
|
|
18686
|
+
resolve27(import.meta.dir, "src", "react", "jsxDevRuntimeCompat.ts"),
|
|
18687
|
+
resolve27(import.meta.dir, "..", "react", "jsxDevRuntimeCompat.js"),
|
|
18688
|
+
resolve27(import.meta.dir, "..", "src", "react", "jsxDevRuntimeCompat.ts"),
|
|
18689
|
+
resolve27(import.meta.dir, "..", "..", "dist", "react", "jsxDevRuntimeCompat.js"),
|
|
18690
|
+
resolve27(import.meta.dir, "..", "..", "src", "react", "jsxDevRuntimeCompat.ts")
|
|
18766
18691
|
];
|
|
18767
18692
|
for (const candidate of candidates) {
|
|
18768
18693
|
if (existsSync26(candidate)) {
|
|
18769
18694
|
return candidate.replace(/\\/g, "/");
|
|
18770
18695
|
}
|
|
18771
18696
|
}
|
|
18772
|
-
return (candidates[0] ??
|
|
18697
|
+
return (candidates[0] ?? resolve27(import.meta.dir, "react", "jsxDevRuntimeCompat.js")).replace(/\\/g, "/");
|
|
18773
18698
|
}, jsxDevRuntimeCompatPath, reactSpecifiers, isResolvable = (specifier) => {
|
|
18774
18699
|
try {
|
|
18775
18700
|
Bun.resolveSync(specifier, process.cwd());
|
|
@@ -19419,7 +19344,7 @@ import {
|
|
|
19419
19344
|
statSync as statSync3,
|
|
19420
19345
|
writeFileSync as writeFileSync9
|
|
19421
19346
|
} from "fs";
|
|
19422
|
-
import { basename as basename11, dirname as
|
|
19347
|
+
import { basename as basename11, dirname as dirname19, extname as extname8, join as join35, relative as relative13, resolve as resolve28 } from "path";
|
|
19423
19348
|
import { cwd, env as env3, exit } from "process";
|
|
19424
19349
|
var {build: bunBuild7, Glob: Glob8 } = globalThis.Bun;
|
|
19425
19350
|
var isDev2, isBuildTraceEnabled = () => {
|
|
@@ -19510,8 +19435,8 @@ var isDev2, isBuildTraceEnabled = () => {
|
|
|
19510
19435
|
}
|
|
19511
19436
|
}, resolveAbsoluteVersion = async () => {
|
|
19512
19437
|
const candidates = [
|
|
19513
|
-
|
|
19514
|
-
|
|
19438
|
+
resolve28(import.meta.dir, "..", "..", "package.json"),
|
|
19439
|
+
resolve28(import.meta.dir, "..", "package.json")
|
|
19515
19440
|
];
|
|
19516
19441
|
const resolveCandidate = async (remaining) => {
|
|
19517
19442
|
const [candidate, ...rest] = remaining;
|
|
@@ -19527,7 +19452,7 @@ var isDev2, isBuildTraceEnabled = () => {
|
|
|
19527
19452
|
};
|
|
19528
19453
|
await resolveCandidate(candidates);
|
|
19529
19454
|
}, SKIP_DIRS4, addWorkerPathIfExists = (file5, relPath, workerPaths) => {
|
|
19530
|
-
const absPath =
|
|
19455
|
+
const absPath = resolve28(file5, "..", relPath);
|
|
19531
19456
|
try {
|
|
19532
19457
|
statSync3(absPath);
|
|
19533
19458
|
workerPaths.add(absPath);
|
|
@@ -19589,7 +19514,7 @@ var isDev2, isBuildTraceEnabled = () => {
|
|
|
19589
19514
|
return;
|
|
19590
19515
|
}
|
|
19591
19516
|
const indexFiles = readDir(reactIndexesPath).filter((file5) => file5.endsWith(".tsx"));
|
|
19592
|
-
const pagesRel = relative13(process.cwd(),
|
|
19517
|
+
const pagesRel = relative13(process.cwd(), resolve28(reactPagesPath)).replace(/\\/g, "/");
|
|
19593
19518
|
for (const file5 of indexFiles) {
|
|
19594
19519
|
let content = readFileSync20(join35(reactIndexesPath, file5), "utf-8");
|
|
19595
19520
|
content = content.replace(/from\s*['"]([^'"]*\/pages\/([^'"]+))['"]/g, (_match, _fullPath, componentName) => `from '/@src/${pagesRel}/${componentName}'`);
|
|
@@ -19597,27 +19522,27 @@ var isDev2, isBuildTraceEnabled = () => {
|
|
|
19597
19522
|
}
|
|
19598
19523
|
}, copySvelteDevIndexes = (svelteDir, sveltePagesPath, svelteEntries, devIndexDir) => {
|
|
19599
19524
|
const svelteIndexDir = join35(getFrameworkGeneratedDir("svelte"), "indexes");
|
|
19600
|
-
const sveltePageEntries = svelteEntries.filter((file5) =>
|
|
19525
|
+
const sveltePageEntries = svelteEntries.filter((file5) => resolve28(file5).startsWith(resolve28(sveltePagesPath)));
|
|
19601
19526
|
for (const entry of sveltePageEntries) {
|
|
19602
19527
|
const name = basename11(entry).replace(/\.svelte(\.(ts|js))?$/, "");
|
|
19603
19528
|
const indexFile = join35(svelteIndexDir, "pages", `${name}.js`);
|
|
19604
19529
|
if (!existsSync27(indexFile))
|
|
19605
19530
|
continue;
|
|
19606
19531
|
let content = readFileSync20(indexFile, "utf-8");
|
|
19607
|
-
const srcRel = relative13(process.cwd(),
|
|
19532
|
+
const srcRel = relative13(process.cwd(), resolve28(entry)).replace(/\\/g, "/");
|
|
19608
19533
|
content = content.replace(/import\s+Component\s+from\s+['"]([^'"]+)['"]/, `import Component from "/@src/${srcRel}"`);
|
|
19609
19534
|
writeFileSync9(join35(devIndexDir, `${name}.svelte.js`), content);
|
|
19610
19535
|
}
|
|
19611
19536
|
}, copyVueDevIndexes = (vueDir, vuePagesPath, vueEntries, devIndexDir) => {
|
|
19612
19537
|
const vueIndexDir = join35(getFrameworkGeneratedDir("vue"), "indexes");
|
|
19613
|
-
const vuePageEntries = vueEntries.filter((file5) =>
|
|
19538
|
+
const vuePageEntries = vueEntries.filter((file5) => resolve28(file5).startsWith(resolve28(vuePagesPath)));
|
|
19614
19539
|
for (const entry of vuePageEntries) {
|
|
19615
19540
|
const name = basename11(entry, ".vue");
|
|
19616
19541
|
const indexFile = join35(vueIndexDir, `${name}.js`);
|
|
19617
19542
|
if (!existsSync27(indexFile))
|
|
19618
19543
|
continue;
|
|
19619
19544
|
let content = readFileSync20(indexFile, "utf-8");
|
|
19620
|
-
const srcRel = relative13(process.cwd(),
|
|
19545
|
+
const srcRel = relative13(process.cwd(), resolve28(entry)).replace(/\\/g, "/");
|
|
19621
19546
|
content = content.replace(/import\s+Comp(?:\s*,\s*\*\s+as\s+\w+)?\s+from\s+['"]([^'"]+)['"]/, (match) => match.replace(/from\s+['"][^'"]+['"]/, `from "/@src/${srcRel}"`));
|
|
19622
19547
|
writeFileSync9(join35(devIndexDir, `${name}.vue.js`), content);
|
|
19623
19548
|
}
|
|
@@ -19630,7 +19555,7 @@ var isDev2, isBuildTraceEnabled = () => {
|
|
|
19630
19555
|
const last = allComments[allComments.length - 1];
|
|
19631
19556
|
if (!last?.[1])
|
|
19632
19557
|
return JSON.stringify(outputPath);
|
|
19633
|
-
const srcPath =
|
|
19558
|
+
const srcPath = resolve28(projectRoot, last[1].replace("/client/", "/").replace(/\.js$/, ".ts"));
|
|
19634
19559
|
return JSON.stringify(srcPath);
|
|
19635
19560
|
}, QUOTE_CHARS, OPEN_BRACES, CLOSE_BRACES, findFunctionExpressionEnd = (content, startPos) => {
|
|
19636
19561
|
let depth = 0;
|
|
@@ -19915,7 +19840,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
19915
19840
|
const sourceClientRoots = [
|
|
19916
19841
|
htmlDir,
|
|
19917
19842
|
htmxDir,
|
|
19918
|
-
islandBootstrapPath &&
|
|
19843
|
+
islandBootstrapPath && dirname19(islandBootstrapPath)
|
|
19919
19844
|
].filter((dir) => Boolean(dir));
|
|
19920
19845
|
const usesGenerated = Boolean(reactDir) || Boolean(svelteDir) || Boolean(vueDir) || Boolean(angularDir);
|
|
19921
19846
|
if (usesGenerated)
|
|
@@ -19956,13 +19881,13 @@ ${content.slice(firstUseIdx)}`;
|
|
|
19956
19881
|
const filterToIncrementalEntries = (entryPoints, mapToSource) => {
|
|
19957
19882
|
if (!isIncremental || !incrementalFiles)
|
|
19958
19883
|
return entryPoints;
|
|
19959
|
-
const normalizedIncremental = new Set(incrementalFiles.map((f2) =>
|
|
19884
|
+
const normalizedIncremental = new Set(incrementalFiles.map((f2) => resolve28(f2)));
|
|
19960
19885
|
const matchingEntries = [];
|
|
19961
19886
|
for (const entry of entryPoints) {
|
|
19962
19887
|
const sourceFile = mapToSource(entry);
|
|
19963
19888
|
if (!sourceFile)
|
|
19964
19889
|
continue;
|
|
19965
|
-
if (!normalizedIncremental.has(
|
|
19890
|
+
if (!normalizedIncremental.has(resolve28(sourceFile)))
|
|
19966
19891
|
continue;
|
|
19967
19892
|
matchingEntries.push(entry);
|
|
19968
19893
|
}
|
|
@@ -20127,7 +20052,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
20127
20052
|
}
|
|
20128
20053
|
const shouldIncludeHtmlAssets = !isIncremental || normalizedIncrementalFiles?.some((f2) => f2.includes("/html/") && (f2.endsWith(".html") || isStylePath(f2)));
|
|
20129
20054
|
const reactEntries = isIncremental && reactIndexesPath && reactPagesPath ? filterToIncrementalEntries(allReactEntries, (entry) => {
|
|
20130
|
-
if (entry.startsWith(
|
|
20055
|
+
if (entry.startsWith(resolve28(reactIndexesPath))) {
|
|
20131
20056
|
const pageName = basename11(entry, ".tsx");
|
|
20132
20057
|
return join35(reactPagesPath, `${pageName}.tsx`);
|
|
20133
20058
|
}
|
|
@@ -20277,7 +20202,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
20277
20202
|
const clientPath = islandSvelteClientPaths[idx];
|
|
20278
20203
|
if (!sourcePath || !clientPath)
|
|
20279
20204
|
continue;
|
|
20280
|
-
islandSvelteClientPathMap.set(
|
|
20205
|
+
islandSvelteClientPathMap.set(resolve28(sourcePath), clientPath);
|
|
20281
20206
|
}
|
|
20282
20207
|
const islandVueClientPathMap = new Map;
|
|
20283
20208
|
for (let idx = 0;idx < islandVueSources.length; idx++) {
|
|
@@ -20285,7 +20210,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
20285
20210
|
const clientPath = islandVueClientPaths[idx];
|
|
20286
20211
|
if (!sourcePath || !clientPath)
|
|
20287
20212
|
continue;
|
|
20288
|
-
islandVueClientPathMap.set(
|
|
20213
|
+
islandVueClientPathMap.set(resolve28(sourcePath), clientPath);
|
|
20289
20214
|
}
|
|
20290
20215
|
const islandAngularClientPathMap = new Map;
|
|
20291
20216
|
for (let idx = 0;idx < islandAngularSources.length; idx++) {
|
|
@@ -20293,7 +20218,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
20293
20218
|
const clientPath = islandAngularClientPaths[idx];
|
|
20294
20219
|
if (!sourcePath || !clientPath)
|
|
20295
20220
|
continue;
|
|
20296
|
-
islandAngularClientPathMap.set(
|
|
20221
|
+
islandAngularClientPathMap.set(resolve28(sourcePath), clientPath);
|
|
20297
20222
|
}
|
|
20298
20223
|
const reactConventionSources = collectConventionSourceFiles(conventionsMap.react);
|
|
20299
20224
|
const svelteConventionSources = collectConventionSourceFiles(conventionsMap.svelte);
|
|
@@ -20320,7 +20245,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
20320
20245
|
naming: `${idx}-[name].[ext]`,
|
|
20321
20246
|
outdir: destDir,
|
|
20322
20247
|
plugins: [stylePreprocessorPlugin2],
|
|
20323
|
-
root:
|
|
20248
|
+
root: dirname19(source),
|
|
20324
20249
|
target: "bun",
|
|
20325
20250
|
throw: false,
|
|
20326
20251
|
tsconfig: "./tsconfig.json"
|
|
@@ -20744,7 +20669,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
20744
20669
|
if (serverOutputs.length > 0 && angularServerVendorPaths2 && Object.keys(angularServerVendorPaths2).length > 0) {
|
|
20745
20670
|
const { rewriteBuildOutputsWith: rewriteBuildOutputsWith2 } = await Promise.resolve().then(() => (init_rewriteImportsPlugin(), exports_rewriteImportsPlugin));
|
|
20746
20671
|
await tracePhase("postprocess/server-angular-vendor-imports", () => rewriteBuildOutputsWith2(serverOutputs, (artifact) => {
|
|
20747
|
-
const fileDir =
|
|
20672
|
+
const fileDir = dirname19(artifact.path);
|
|
20748
20673
|
const relativePaths = {};
|
|
20749
20674
|
for (const [specifier, absolute] of Object.entries(angularServerVendorPaths2)) {
|
|
20750
20675
|
const rel = relative13(fileDir, absolute);
|
|
@@ -21218,7 +21143,7 @@ __export(exports_dependencyGraph, {
|
|
|
21218
21143
|
});
|
|
21219
21144
|
import { existsSync as existsSync29, readFileSync as readFileSync21 } from "fs";
|
|
21220
21145
|
var {Glob: Glob9 } = globalThis.Bun;
|
|
21221
|
-
import { resolve as
|
|
21146
|
+
import { resolve as resolve29 } from "path";
|
|
21222
21147
|
var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath) => {
|
|
21223
21148
|
const lower = filePath.toLowerCase();
|
|
21224
21149
|
if (lower.endsWith(".ts") || lower.endsWith(".tsx") || lower.endsWith(".jsx"))
|
|
@@ -21232,8 +21157,8 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
21232
21157
|
if (!importPath.startsWith(".") && !importPath.startsWith("/")) {
|
|
21233
21158
|
return null;
|
|
21234
21159
|
}
|
|
21235
|
-
const fromDir =
|
|
21236
|
-
const normalized =
|
|
21160
|
+
const fromDir = resolve29(fromFile, "..");
|
|
21161
|
+
const normalized = resolve29(fromDir, importPath);
|
|
21237
21162
|
const extensions = [
|
|
21238
21163
|
".ts",
|
|
21239
21164
|
".tsx",
|
|
@@ -21263,7 +21188,7 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
21263
21188
|
dependents.delete(normalizedPath);
|
|
21264
21189
|
}
|
|
21265
21190
|
}, addFileToGraph = (graph, filePath) => {
|
|
21266
|
-
const normalizedPath =
|
|
21191
|
+
const normalizedPath = resolve29(filePath);
|
|
21267
21192
|
if (!existsSync29(normalizedPath))
|
|
21268
21193
|
return;
|
|
21269
21194
|
const dependencies = extractDependencies(normalizedPath);
|
|
@@ -21290,10 +21215,10 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
21290
21215
|
}, IGNORED_SEGMENTS, buildInitialDependencyGraph = (graph, directories) => {
|
|
21291
21216
|
const processedFiles = new Set;
|
|
21292
21217
|
const glob = new Glob9("**/*.{ts,tsx,js,jsx,vue,svelte,html,htm}");
|
|
21293
|
-
const resolvedDirs = directories.map((dir) =>
|
|
21218
|
+
const resolvedDirs = directories.map((dir) => resolve29(dir)).filter((dir) => existsSync29(dir));
|
|
21294
21219
|
const allFiles = resolvedDirs.flatMap((dir) => Array.from(glob.scanSync({ absolute: true, cwd: dir })));
|
|
21295
21220
|
for (const file5 of allFiles) {
|
|
21296
|
-
const fullPath =
|
|
21221
|
+
const fullPath = resolve29(file5);
|
|
21297
21222
|
if (IGNORED_SEGMENTS.some((seg) => fullPath.includes(seg)))
|
|
21298
21223
|
continue;
|
|
21299
21224
|
if (processedFiles.has(fullPath))
|
|
@@ -21406,7 +21331,7 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
21406
21331
|
return [];
|
|
21407
21332
|
}
|
|
21408
21333
|
}, getAffectedFiles = (graph, changedFile) => {
|
|
21409
|
-
const normalizedPath =
|
|
21334
|
+
const normalizedPath = resolve29(changedFile);
|
|
21410
21335
|
const affected = new Set;
|
|
21411
21336
|
const toProcess = [normalizedPath];
|
|
21412
21337
|
const processNode = (current) => {
|
|
@@ -21437,7 +21362,7 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
21437
21362
|
}, removeDependentsForFile = (graph, normalizedPath) => {
|
|
21438
21363
|
graph.dependents.delete(normalizedPath);
|
|
21439
21364
|
}, removeFileFromGraph = (graph, filePath) => {
|
|
21440
|
-
const normalizedPath =
|
|
21365
|
+
const normalizedPath = resolve29(filePath);
|
|
21441
21366
|
removeDepsForFile(graph, normalizedPath);
|
|
21442
21367
|
removeDependentsForFile(graph, normalizedPath);
|
|
21443
21368
|
};
|
|
@@ -21480,12 +21405,12 @@ var globalVersionCounter = 0, createModuleVersionTracker = () => new Map, getNex
|
|
|
21480
21405
|
};
|
|
21481
21406
|
|
|
21482
21407
|
// src/dev/configResolver.ts
|
|
21483
|
-
import { resolve as
|
|
21408
|
+
import { resolve as resolve30 } from "path";
|
|
21484
21409
|
var resolveBuildPaths = (config) => {
|
|
21485
21410
|
const cwd2 = process.cwd();
|
|
21486
21411
|
const normalize = (path) => path.replace(/\\/g, "/");
|
|
21487
|
-
const withDefault = (value, fallback) => normalize(
|
|
21488
|
-
const optional = (value) => value ? normalize(
|
|
21412
|
+
const withDefault = (value, fallback) => normalize(resolve30(cwd2, value ?? fallback));
|
|
21413
|
+
const optional = (value) => value ? normalize(resolve30(cwd2, value)) : undefined;
|
|
21489
21414
|
return {
|
|
21490
21415
|
angularDir: optional(config.angularDirectory),
|
|
21491
21416
|
assetsDir: optional(config.assetsDirectory),
|
|
@@ -21539,7 +21464,7 @@ var init_clientManager = __esm(() => {
|
|
|
21539
21464
|
|
|
21540
21465
|
// src/dev/pathUtils.ts
|
|
21541
21466
|
import { existsSync as existsSync30, readdirSync as readdirSync4, readFileSync as readFileSync22 } from "fs";
|
|
21542
|
-
import { dirname as
|
|
21467
|
+
import { dirname as dirname20, resolve as resolve31 } from "path";
|
|
21543
21468
|
var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
21544
21469
|
if (shouldIgnorePath(filePath, resolved)) {
|
|
21545
21470
|
return "ignored";
|
|
@@ -21615,7 +21540,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
21615
21540
|
return "unknown";
|
|
21616
21541
|
}, collectAngularResourceDirs = (angularDir) => {
|
|
21617
21542
|
const out = new Set;
|
|
21618
|
-
const angularRoot =
|
|
21543
|
+
const angularRoot = resolve31(angularDir);
|
|
21619
21544
|
const angularRootNormalized = normalizePath(angularRoot);
|
|
21620
21545
|
const walk = (dir) => {
|
|
21621
21546
|
let entries;
|
|
@@ -21628,7 +21553,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
21628
21553
|
if (entry.name.startsWith(".") || entry.name === "node_modules") {
|
|
21629
21554
|
continue;
|
|
21630
21555
|
}
|
|
21631
|
-
const full =
|
|
21556
|
+
const full = resolve31(dir, entry.name);
|
|
21632
21557
|
if (entry.isDirectory()) {
|
|
21633
21558
|
walk(full);
|
|
21634
21559
|
continue;
|
|
@@ -21667,10 +21592,10 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
21667
21592
|
refs.push(strMatch[1]);
|
|
21668
21593
|
}
|
|
21669
21594
|
}
|
|
21670
|
-
const componentDir =
|
|
21595
|
+
const componentDir = dirname20(full);
|
|
21671
21596
|
for (const ref of refs) {
|
|
21672
|
-
const refAbs = normalizePath(
|
|
21673
|
-
const refDir = normalizePath(
|
|
21597
|
+
const refAbs = normalizePath(resolve31(componentDir, ref));
|
|
21598
|
+
const refDir = normalizePath(dirname20(refAbs));
|
|
21674
21599
|
if (refDir === angularRootNormalized || refDir.startsWith(angularRootNormalized + "/")) {
|
|
21675
21600
|
continue;
|
|
21676
21601
|
}
|
|
@@ -21686,7 +21611,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
21686
21611
|
const push = (path) => {
|
|
21687
21612
|
if (!path)
|
|
21688
21613
|
return;
|
|
21689
|
-
const abs = normalizePath(
|
|
21614
|
+
const abs = normalizePath(resolve31(cwd2, path));
|
|
21690
21615
|
if (!roots.includes(abs))
|
|
21691
21616
|
roots.push(abs);
|
|
21692
21617
|
};
|
|
@@ -21711,7 +21636,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
21711
21636
|
push(cfg.assetsDir);
|
|
21712
21637
|
push(cfg.stylesDir);
|
|
21713
21638
|
for (const candidate of ["src", "db", "assets", "styles"]) {
|
|
21714
|
-
const abs = normalizePath(
|
|
21639
|
+
const abs = normalizePath(resolve31(cwd2, candidate));
|
|
21715
21640
|
if (existsSync30(abs) && !roots.includes(abs))
|
|
21716
21641
|
roots.push(abs);
|
|
21717
21642
|
}
|
|
@@ -21723,7 +21648,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
21723
21648
|
continue;
|
|
21724
21649
|
if (entry.name.startsWith("."))
|
|
21725
21650
|
continue;
|
|
21726
|
-
const abs = normalizePath(
|
|
21651
|
+
const abs = normalizePath(resolve31(cwd2, entry.name));
|
|
21727
21652
|
if (roots.includes(abs))
|
|
21728
21653
|
continue;
|
|
21729
21654
|
if (shouldIgnorePath(abs, resolved))
|
|
@@ -21798,7 +21723,7 @@ var init_pathUtils = __esm(() => {
|
|
|
21798
21723
|
// src/dev/fileWatcher.ts
|
|
21799
21724
|
import { watch } from "fs";
|
|
21800
21725
|
import { existsSync as existsSync31, readdirSync as readdirSync5, statSync as statSync4 } from "fs";
|
|
21801
|
-
import { dirname as
|
|
21726
|
+
import { dirname as dirname21, join as join37, resolve as resolve32 } from "path";
|
|
21802
21727
|
var safeRemoveFromGraph = (graph, fullPath) => {
|
|
21803
21728
|
try {
|
|
21804
21729
|
removeFileFromGraph(graph, fullPath);
|
|
@@ -21856,7 +21781,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
21856
21781
|
return;
|
|
21857
21782
|
if (shouldSkipFilename(filename, isStylesDir)) {
|
|
21858
21783
|
if (event === "rename") {
|
|
21859
|
-
const eventDir =
|
|
21784
|
+
const eventDir = dirname21(join37(absolutePath, filename)).replace(/\\/g, "/");
|
|
21860
21785
|
atomicRecoveryScan(eventDir);
|
|
21861
21786
|
}
|
|
21862
21787
|
return;
|
|
@@ -21879,7 +21804,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
21879
21804
|
}, addFileWatchers = (state, paths, onFileChange) => {
|
|
21880
21805
|
const stylesDir = state.resolvedPaths?.stylesDir;
|
|
21881
21806
|
paths.forEach((path) => {
|
|
21882
|
-
const absolutePath =
|
|
21807
|
+
const absolutePath = resolve32(path).replace(/\\/g, "/");
|
|
21883
21808
|
if (!existsSync31(absolutePath)) {
|
|
21884
21809
|
return;
|
|
21885
21810
|
}
|
|
@@ -21890,7 +21815,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
21890
21815
|
const watchPaths = getWatchPaths(config, state.resolvedPaths);
|
|
21891
21816
|
const stylesDir = state.resolvedPaths?.stylesDir;
|
|
21892
21817
|
watchPaths.forEach((path) => {
|
|
21893
|
-
const absolutePath =
|
|
21818
|
+
const absolutePath = resolve32(path).replace(/\\/g, "/");
|
|
21894
21819
|
if (!existsSync31(absolutePath)) {
|
|
21895
21820
|
return;
|
|
21896
21821
|
}
|
|
@@ -21909,13 +21834,13 @@ var init_fileWatcher = __esm(() => {
|
|
|
21909
21834
|
});
|
|
21910
21835
|
|
|
21911
21836
|
// src/dev/assetStore.ts
|
|
21912
|
-
import { resolve as
|
|
21837
|
+
import { resolve as resolve33 } from "path";
|
|
21913
21838
|
import { readdir as readdir4, unlink } from "fs/promises";
|
|
21914
21839
|
var mimeTypes, getMimeType = (filePath) => {
|
|
21915
21840
|
const ext = filePath.slice(filePath.lastIndexOf("."));
|
|
21916
21841
|
return mimeTypes[ext] ?? "application/octet-stream";
|
|
21917
21842
|
}, HASHED_FILE_RE, stripHash = (webPath) => webPath.replace(/\.[a-z0-9]{8}(\.(js|css|mjs))$/, "$1"), processWalkEntry = (entry, dir, liveByIdentity, walkAndClean) => {
|
|
21918
|
-
const fullPath =
|
|
21843
|
+
const fullPath = resolve33(dir, entry.name);
|
|
21919
21844
|
if (entry.isDirectory()) {
|
|
21920
21845
|
return walkAndClean(fullPath);
|
|
21921
21846
|
}
|
|
@@ -21931,10 +21856,10 @@ var mimeTypes, getMimeType = (filePath) => {
|
|
|
21931
21856
|
}, cleanStaleAssets = async (store, manifest, buildDir) => {
|
|
21932
21857
|
const liveByIdentity = new Map;
|
|
21933
21858
|
for (const webPath of store.keys()) {
|
|
21934
|
-
const diskPath =
|
|
21859
|
+
const diskPath = resolve33(buildDir, webPath.slice(1));
|
|
21935
21860
|
liveByIdentity.set(stripHash(diskPath), diskPath);
|
|
21936
21861
|
}
|
|
21937
|
-
const absBuildDir =
|
|
21862
|
+
const absBuildDir = resolve33(buildDir);
|
|
21938
21863
|
Object.values(manifest).forEach((val) => {
|
|
21939
21864
|
if (!HASHED_FILE_RE.test(val))
|
|
21940
21865
|
return;
|
|
@@ -21952,7 +21877,7 @@ var mimeTypes, getMimeType = (filePath) => {
|
|
|
21952
21877
|
} catch {}
|
|
21953
21878
|
}, lookupAsset = (store, path) => store.get(path), processScanEntry = (entry, dir, prefix, store, scanDir) => {
|
|
21954
21879
|
if (entry.isDirectory()) {
|
|
21955
|
-
return scanDir(
|
|
21880
|
+
return scanDir(resolve33(dir, entry.name), `${prefix}${entry.name}/`);
|
|
21956
21881
|
}
|
|
21957
21882
|
if (!entry.name.startsWith("chunk-")) {
|
|
21958
21883
|
return null;
|
|
@@ -21961,7 +21886,7 @@ var mimeTypes, getMimeType = (filePath) => {
|
|
|
21961
21886
|
if (store.has(webPath)) {
|
|
21962
21887
|
return null;
|
|
21963
21888
|
}
|
|
21964
|
-
return Bun.file(
|
|
21889
|
+
return Bun.file(resolve33(dir, entry.name)).bytes().then((bytes) => {
|
|
21965
21890
|
store.set(webPath, bytes);
|
|
21966
21891
|
return;
|
|
21967
21892
|
}).catch(() => {});
|
|
@@ -21983,7 +21908,7 @@ var mimeTypes, getMimeType = (filePath) => {
|
|
|
21983
21908
|
for (const webPath of newIdentities.values()) {
|
|
21984
21909
|
if (store.has(webPath))
|
|
21985
21910
|
continue;
|
|
21986
|
-
loadPromises.push(Bun.file(
|
|
21911
|
+
loadPromises.push(Bun.file(resolve33(buildDir, webPath.slice(1))).bytes().then((bytes) => {
|
|
21987
21912
|
store.set(webPath, bytes);
|
|
21988
21913
|
return;
|
|
21989
21914
|
}).catch(() => {}));
|
|
@@ -22109,9 +22034,9 @@ var init_transformCache = __esm(() => {
|
|
|
22109
22034
|
});
|
|
22110
22035
|
|
|
22111
22036
|
// src/dev/reactComponentClassifier.ts
|
|
22112
|
-
import { resolve as
|
|
22037
|
+
import { resolve as resolve34 } from "path";
|
|
22113
22038
|
var classifyComponent = (filePath) => {
|
|
22114
|
-
const normalizedPath =
|
|
22039
|
+
const normalizedPath = resolve34(filePath);
|
|
22115
22040
|
if (normalizedPath.includes("/react/pages/")) {
|
|
22116
22041
|
return "server";
|
|
22117
22042
|
}
|
|
@@ -22123,7 +22048,7 @@ var classifyComponent = (filePath) => {
|
|
|
22123
22048
|
var init_reactComponentClassifier = () => {};
|
|
22124
22049
|
|
|
22125
22050
|
// src/dev/moduleMapper.ts
|
|
22126
|
-
import { basename as basename12, resolve as
|
|
22051
|
+
import { basename as basename12, resolve as resolve35 } from "path";
|
|
22127
22052
|
var buildModulePaths = (moduleKeys, manifest) => {
|
|
22128
22053
|
const modulePaths = {};
|
|
22129
22054
|
moduleKeys.forEach((key) => {
|
|
@@ -22133,7 +22058,7 @@ var buildModulePaths = (moduleKeys, manifest) => {
|
|
|
22133
22058
|
});
|
|
22134
22059
|
return modulePaths;
|
|
22135
22060
|
}, processChangedFile = (sourceFile, framework, manifest, resolvedPaths, processedFiles) => {
|
|
22136
|
-
const normalizedFile =
|
|
22061
|
+
const normalizedFile = resolve35(sourceFile);
|
|
22137
22062
|
const normalizedPath = normalizedFile.replace(/\\/g, "/");
|
|
22138
22063
|
if (processedFiles.has(normalizedFile)) {
|
|
22139
22064
|
return null;
|
|
@@ -22169,7 +22094,7 @@ var buildModulePaths = (moduleKeys, manifest) => {
|
|
|
22169
22094
|
});
|
|
22170
22095
|
return grouped;
|
|
22171
22096
|
}, mapSourceFileToManifestKeys = (sourceFile, framework, resolvedPaths) => {
|
|
22172
|
-
const normalizedFile =
|
|
22097
|
+
const normalizedFile = resolve35(sourceFile);
|
|
22173
22098
|
const fileName = basename12(normalizedFile);
|
|
22174
22099
|
const baseName = fileName.replace(/\.(tsx?|jsx?|vue|svelte|css|html)$/, "");
|
|
22175
22100
|
const pascalName = toPascal(baseName);
|
|
@@ -22231,7 +22156,7 @@ __export(exports_resolveOwningComponents, {
|
|
|
22231
22156
|
invalidateResourceIndex: () => invalidateResourceIndex
|
|
22232
22157
|
});
|
|
22233
22158
|
import { readdirSync as readdirSync6, readFileSync as readFileSync24, statSync as statSync5 } from "fs";
|
|
22234
|
-
import { dirname as
|
|
22159
|
+
import { dirname as dirname22, extname as extname9, join as join38, resolve as resolve36 } from "path";
|
|
22235
22160
|
import ts14 from "typescript";
|
|
22236
22161
|
var ENTITY_DECORATORS, isAngularSourceFile = (file5) => file5.endsWith(".ts") || file5.endsWith(".tsx"), walkAngularSourceFiles = (root) => {
|
|
22237
22162
|
const out = [];
|
|
@@ -22344,7 +22269,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file5) => file5.endsWith(".ts") ||
|
|
|
22344
22269
|
};
|
|
22345
22270
|
visit(sourceFile);
|
|
22346
22271
|
return out;
|
|
22347
|
-
}, safeNormalize = (path) =>
|
|
22272
|
+
}, safeNormalize = (path) => resolve36(path).replace(/\\/g, "/"), resolveOwningComponents = (params) => {
|
|
22348
22273
|
const { changedFilePath, userAngularRoot } = params;
|
|
22349
22274
|
const changedAbs = safeNormalize(changedFilePath);
|
|
22350
22275
|
const out = [];
|
|
@@ -22385,7 +22310,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file5) => file5.endsWith(".ts") ||
|
|
|
22385
22310
|
return null;
|
|
22386
22311
|
}
|
|
22387
22312
|
const sf = ts14.createSourceFile(childFilePath, source, ts14.ScriptTarget.ES2022, true, ts14.ScriptKind.TS);
|
|
22388
|
-
const childDir =
|
|
22313
|
+
const childDir = dirname22(childFilePath);
|
|
22389
22314
|
for (const stmt of sf.statements) {
|
|
22390
22315
|
if (!ts14.isImportDeclaration(stmt))
|
|
22391
22316
|
continue;
|
|
@@ -22413,7 +22338,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file5) => file5.endsWith(".ts") ||
|
|
|
22413
22338
|
if (!spec.startsWith(".") && !spec.startsWith("/")) {
|
|
22414
22339
|
return null;
|
|
22415
22340
|
}
|
|
22416
|
-
const base =
|
|
22341
|
+
const base = resolve36(childDir, spec);
|
|
22417
22342
|
const candidates = [
|
|
22418
22343
|
`${base}.ts`,
|
|
22419
22344
|
`${base}.tsx`,
|
|
@@ -22442,7 +22367,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file5) => file5.endsWith(".ts") ||
|
|
|
22442
22367
|
const parentFile = new Map;
|
|
22443
22368
|
for (const tsPath of walkAngularSourceFiles(userAngularRoot)) {
|
|
22444
22369
|
const classes = parseDecoratedClasses(tsPath);
|
|
22445
|
-
const componentDir =
|
|
22370
|
+
const componentDir = dirname22(tsPath);
|
|
22446
22371
|
for (const cls of classes) {
|
|
22447
22372
|
const entity = {
|
|
22448
22373
|
className: cls.className,
|
|
@@ -22451,7 +22376,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file5) => file5.endsWith(".ts") ||
|
|
|
22451
22376
|
};
|
|
22452
22377
|
if (cls.kind === "component") {
|
|
22453
22378
|
for (const url of [...cls.templateUrls, ...cls.styleUrls]) {
|
|
22454
|
-
const abs = safeNormalize(
|
|
22379
|
+
const abs = safeNormalize(resolve36(componentDir, url));
|
|
22455
22380
|
const existing = resource.get(abs);
|
|
22456
22381
|
if (existing)
|
|
22457
22382
|
existing.push(entity);
|
|
@@ -22619,7 +22544,7 @@ __export(exports_moduleServer, {
|
|
|
22619
22544
|
SRC_URL_PREFIX: () => SRC_URL_PREFIX
|
|
22620
22545
|
});
|
|
22621
22546
|
import { existsSync as existsSync32, readFileSync as readFileSync25, statSync as statSync6 } from "fs";
|
|
22622
|
-
import { basename as basename13, dirname as
|
|
22547
|
+
import { basename as basename13, dirname as dirname23, extname as extname10, join as join39, resolve as resolve37, relative as relative14 } from "path";
|
|
22623
22548
|
var SRC_PREFIX = "/@src/", jsTranspiler2, tsTranspiler2, tsxTranspiler, TRANSPILABLE, ALL_EXPORTS_RE, STRING_CONTENTS_RE, preserveTypeExports = (originalSource, transpiled, valueExports) => {
|
|
22624
22549
|
const codeOnly = originalSource.replace(STRING_CONTENTS_RE, '""');
|
|
22625
22550
|
const allExports = [];
|
|
@@ -22639,7 +22564,7 @@ var SRC_PREFIX = "/@src/", jsTranspiler2, tsTranspiler2, tsxTranspiler, TRANSPIL
|
|
|
22639
22564
|
${stubs}
|
|
22640
22565
|
`;
|
|
22641
22566
|
}, resolveRelativeExtension = (srcPath, projectRoot, extensions) => {
|
|
22642
|
-
const found = extensions.find((ext) => existsSync32(
|
|
22567
|
+
const found = extensions.find((ext) => existsSync32(resolve37(projectRoot, srcPath + ext)));
|
|
22643
22568
|
return found ? srcPath + found : srcPath;
|
|
22644
22569
|
}, IMPORT_EXTENSIONS, SIDE_EFFECT_EXTENSIONS, MODULE_EXTENSIONS, RESOLVED_MODULE_EXTENSIONS, REACT_EXTENSIONS, escapeRegex3 = (str) => str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), buildImportRewriter = (vendorPaths) => {
|
|
22645
22570
|
const entries = Object.entries(vendorPaths).sort(([a], [b2]) => b2.length - a.length);
|
|
@@ -22654,7 +22579,7 @@ ${stubs}
|
|
|
22654
22579
|
return invalidationVersion > 0 ? `${mtime}.${invalidationVersion}` : `${mtime}`;
|
|
22655
22580
|
}, srcUrl = (relPath, projectRoot) => {
|
|
22656
22581
|
const base = `${SRC_PREFIX}${relPath.replace(/\\/g, "/")}`;
|
|
22657
|
-
const absPath =
|
|
22582
|
+
const absPath = resolve37(projectRoot, relPath);
|
|
22658
22583
|
const cached = mtimeCache.get(absPath);
|
|
22659
22584
|
if (cached !== undefined)
|
|
22660
22585
|
return `${base}?v=${buildVersion(cached, absPath)}`;
|
|
@@ -22666,12 +22591,12 @@ ${stubs}
|
|
|
22666
22591
|
return base;
|
|
22667
22592
|
}
|
|
22668
22593
|
}, resolveRelativeImport = (relPath, fileDir, projectRoot, extensions) => {
|
|
22669
|
-
const absPath =
|
|
22594
|
+
const absPath = resolve37(fileDir, relPath);
|
|
22670
22595
|
const rel = relative14(projectRoot, absPath);
|
|
22671
22596
|
const extension = extname10(rel);
|
|
22672
22597
|
let srcPath = RESOLVED_MODULE_EXTENSIONS.has(extension) ? rel : resolveRelativeExtension(rel, projectRoot, extensions);
|
|
22673
22598
|
if (extname10(srcPath) === ".svelte") {
|
|
22674
|
-
srcPath = relative14(projectRoot, resolveSvelteModulePath(
|
|
22599
|
+
srcPath = relative14(projectRoot, resolveSvelteModulePath(resolve37(projectRoot, srcPath)));
|
|
22675
22600
|
}
|
|
22676
22601
|
return srcUrl(srcPath, projectRoot);
|
|
22677
22602
|
}, NODE_BUILTIN_RE, resolveAbsoluteSpecifier = (specifier, projectRoot) => {
|
|
@@ -22690,13 +22615,13 @@ ${stubs}
|
|
|
22690
22615
|
const packageName = isScoped ? `${parts[0]}/${parts[1]}` : parts[0];
|
|
22691
22616
|
const subpath = isScoped ? parts.slice(2).join("/") : parts.slice(1).join("/");
|
|
22692
22617
|
if (!subpath) {
|
|
22693
|
-
const pkgDir =
|
|
22618
|
+
const pkgDir = resolve37(projectRoot, "node_modules", packageName ?? "");
|
|
22694
22619
|
const pkgJsonPath = join39(pkgDir, "package.json");
|
|
22695
22620
|
if (existsSync32(pkgJsonPath)) {
|
|
22696
22621
|
const pkg = JSON.parse(readFileSync25(pkgJsonPath, "utf-8"));
|
|
22697
22622
|
const esmEntry = typeof pkg.module === "string" && pkg.module || typeof pkg.browser === "string" && pkg.browser;
|
|
22698
22623
|
if (esmEntry) {
|
|
22699
|
-
const resolved =
|
|
22624
|
+
const resolved = resolve37(pkgDir, esmEntry);
|
|
22700
22625
|
if (existsSync32(resolved))
|
|
22701
22626
|
return relative14(projectRoot, resolved);
|
|
22702
22627
|
}
|
|
@@ -22728,7 +22653,7 @@ ${stubs}
|
|
|
22728
22653
|
};
|
|
22729
22654
|
result = result.replace(/^((?:import\s+[\s\S]+?\s+from|export\s+[\s\S]+?\s+from|import)\s*["'])([^"'./][^"']*)(["'])/gm, stubReplace);
|
|
22730
22655
|
result = result.replace(/(import\s*\(\s*["'])([^"'./][^"']*)(["']\s*\))/g, stubReplace);
|
|
22731
|
-
const fileDir =
|
|
22656
|
+
const fileDir = dirname23(filePath);
|
|
22732
22657
|
result = result.replace(/(from\s*["'])(\.\.?\/[^"']+)(["'])/g, (_match, prefix, relPath, suffix) => `${prefix}${resolveRelativeImport(relPath, fileDir, projectRoot, IMPORT_EXTENSIONS)}${suffix}`);
|
|
22733
22658
|
result = result.replace(/(import\s*\(\s*["'])(\.\.?\/[^"']+)(["']\s*\))/g, (_match, prefix, relPath, suffix) => `${prefix}${resolveRelativeImport(relPath, fileDir, projectRoot, IMPORT_EXTENSIONS)}${suffix}`);
|
|
22734
22659
|
result = result.replace(/(import\s*["'])(\.\.?\/[^"']+)(["']\s*;?)/g, (_match, prefix, relPath, suffix) => `${prefix}${resolveRelativeImport(relPath, fileDir, projectRoot, SIDE_EFFECT_EXTENSIONS)}${suffix}`);
|
|
@@ -22743,12 +22668,12 @@ ${stubs}
|
|
|
22743
22668
|
result = result.replace(/((?:from|import)\s*["'])(\/[^"']+\.(tsx?|jsx?|ts))(["'])/g, rewriteAbsoluteToSrc);
|
|
22744
22669
|
result = result.replace(/(import\s*\(\s*["'])(\/[^"']+\.(tsx?|jsx?|ts))(["']\s*\))/g, rewriteAbsoluteToSrc);
|
|
22745
22670
|
result = result.replace(/new\s+URL\(\s*["'](\.\.?\/[^"']+)["']\s*,\s*import\.meta\.url\s*\)/g, (_match, relPath) => {
|
|
22746
|
-
const absPath =
|
|
22671
|
+
const absPath = resolve37(fileDir, relPath);
|
|
22747
22672
|
const rel = relative14(projectRoot, absPath);
|
|
22748
22673
|
return `new URL('${srcUrl(rel, projectRoot)}', import.meta.url)`;
|
|
22749
22674
|
});
|
|
22750
22675
|
result = result.replace(/import\.meta\.resolve\(\s*["'](\.\.?\/[^"']+)["']\s*\)/g, (_match, relPath) => {
|
|
22751
|
-
const absPath =
|
|
22676
|
+
const absPath = resolve37(fileDir, relPath);
|
|
22752
22677
|
const rel = relative14(projectRoot, absPath);
|
|
22753
22678
|
return `'${srcUrl(rel, projectRoot)}'`;
|
|
22754
22679
|
});
|
|
@@ -23061,7 +22986,7 @@ ${code}`;
|
|
|
23061
22986
|
code = injectVueHmr(code, filePath, projectRoot, vueDir);
|
|
23062
22987
|
return rewriteImports(code, filePath, projectRoot, rewriter);
|
|
23063
22988
|
}, injectVueHmr = (code, filePath, projectRoot, vueDir) => {
|
|
23064
|
-
const hmrBase = vueDir ?
|
|
22989
|
+
const hmrBase = vueDir ? resolve37(vueDir) : projectRoot;
|
|
23065
22990
|
const hmrId = relative14(hmrBase, filePath).replace(/\\/g, "/").replace(/\.vue$/, "");
|
|
23066
22991
|
let result = code.replace(/export\s+default\s+/, "var __hmr_comp__ = ");
|
|
23067
22992
|
result += [
|
|
@@ -23225,7 +23150,7 @@ export default {};
|
|
|
23225
23150
|
const escaped = virtualCss.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$/g, "\\$");
|
|
23226
23151
|
return jsResponse(`var s=document.createElement('style');s.textContent=\`${escaped}\`;s.dataset.svelteHmr=${JSON.stringify(cssCheckPath)};var p=document.querySelector('style[data-svelte-hmr="${cssCheckPath}"]');if(p)p.remove();document.head.appendChild(s);`);
|
|
23227
23152
|
}, resolveSourcePath = (relPath, projectRoot) => {
|
|
23228
|
-
const filePath =
|
|
23153
|
+
const filePath = resolve37(projectRoot, relPath);
|
|
23229
23154
|
const ext = extname10(filePath);
|
|
23230
23155
|
if (ext === ".svelte")
|
|
23231
23156
|
return { ext, filePath: resolveSvelteModulePath(filePath) };
|
|
@@ -23262,14 +23187,14 @@ export default {};
|
|
|
23262
23187
|
const absoluteCandidate = "/" + tail.replace(/^\/+/, "");
|
|
23263
23188
|
const candidates = [
|
|
23264
23189
|
absoluteCandidate,
|
|
23265
|
-
|
|
23190
|
+
resolve37(projectRoot, tail)
|
|
23266
23191
|
];
|
|
23267
23192
|
try {
|
|
23268
23193
|
const { loadConfig: loadConfig2 } = await Promise.resolve().then(() => (init_loadConfig(), exports_loadConfig));
|
|
23269
23194
|
const cfg = await loadConfig2();
|
|
23270
|
-
const angularDir = cfg.angularDirectory &&
|
|
23195
|
+
const angularDir = cfg.angularDirectory && resolve37(projectRoot, cfg.angularDirectory);
|
|
23271
23196
|
if (angularDir)
|
|
23272
|
-
candidates.push(
|
|
23197
|
+
candidates.push(resolve37(angularDir, tail));
|
|
23273
23198
|
} catch {}
|
|
23274
23199
|
for (const candidate of candidates) {
|
|
23275
23200
|
if (await fileExists(candidate)) {
|
|
@@ -23300,7 +23225,7 @@ export default {};
|
|
|
23300
23225
|
if (!TRANSPILABLE.has(ext))
|
|
23301
23226
|
return;
|
|
23302
23227
|
const stat3 = statSync6(filePath);
|
|
23303
|
-
const resolvedVueDir = vueDir ?
|
|
23228
|
+
const resolvedVueDir = vueDir ? resolve37(vueDir) : undefined;
|
|
23304
23229
|
let content = REACT_EXTENSIONS.has(ext) ? transformReactFile(filePath, projectRoot, rewriter) : transformPlainFile(filePath, projectRoot, rewriter, resolvedVueDir);
|
|
23305
23230
|
const isAngularGeneratedJs = ext === ".js" && filePath.replace(/\\/g, "/").includes("/.absolutejs/generated/angular/");
|
|
23306
23231
|
if (isAngularGeneratedJs) {
|
|
@@ -23359,7 +23284,7 @@ export default {};
|
|
|
23359
23284
|
const relPath = pathname.slice(SRC_PREFIX.length);
|
|
23360
23285
|
if (relPath === "bun:wrap" || relPath.startsWith("bun:wrap?"))
|
|
23361
23286
|
return handleBunWrapRequest();
|
|
23362
|
-
const virtualCssResponse = handleVirtualSvelteCss(
|
|
23287
|
+
const virtualCssResponse = handleVirtualSvelteCss(resolve37(projectRoot, relPath));
|
|
23363
23288
|
if (virtualCssResponse)
|
|
23364
23289
|
return virtualCssResponse;
|
|
23365
23290
|
const { filePath, ext } = resolveSourcePath(relPath, projectRoot);
|
|
@@ -23375,11 +23300,11 @@ export default {};
|
|
|
23375
23300
|
SRC_IMPORT_RE.lastIndex = 0;
|
|
23376
23301
|
while ((match = SRC_IMPORT_RE.exec(content)) !== null) {
|
|
23377
23302
|
if (match[1])
|
|
23378
|
-
files.push(
|
|
23303
|
+
files.push(resolve37(projectRoot, match[1]));
|
|
23379
23304
|
}
|
|
23380
23305
|
return files;
|
|
23381
23306
|
}, invalidateModule = (filePath) => {
|
|
23382
|
-
const resolved =
|
|
23307
|
+
const resolved = resolve37(filePath);
|
|
23383
23308
|
invalidate(filePath);
|
|
23384
23309
|
if (resolved !== filePath)
|
|
23385
23310
|
invalidate(resolved);
|
|
@@ -23524,7 +23449,7 @@ __export(exports_hmrCompiler, {
|
|
|
23524
23449
|
getApplyMetadataModule: () => getApplyMetadataModule,
|
|
23525
23450
|
encodeHmrComponentId: () => encodeHmrComponentId
|
|
23526
23451
|
});
|
|
23527
|
-
import { dirname as
|
|
23452
|
+
import { dirname as dirname24, relative as relative15, resolve as resolve38 } from "path";
|
|
23528
23453
|
import { performance as performance2 } from "perf_hooks";
|
|
23529
23454
|
var getApplyMetadataModule = async (encodedId) => {
|
|
23530
23455
|
const decoded = decodeURIComponent(encodedId);
|
|
@@ -23533,7 +23458,7 @@ var getApplyMetadataModule = async (encodedId) => {
|
|
|
23533
23458
|
return null;
|
|
23534
23459
|
const filePathRel = decoded.slice(0, at2);
|
|
23535
23460
|
const className = decoded.slice(at2 + 1);
|
|
23536
|
-
const componentFilePath =
|
|
23461
|
+
const componentFilePath = resolve38(process.cwd(), filePathRel);
|
|
23537
23462
|
const projectRelPath = relative15(process.cwd(), componentFilePath).replace(/\\/g, "/");
|
|
23538
23463
|
const cacheKey2 = encodeURIComponent(`${projectRelPath}@${className}`);
|
|
23539
23464
|
const { takePendingModule: takePendingModule2 } = await Promise.resolve().then(() => (init_fastHmrCompiler(), exports_fastHmrCompiler));
|
|
@@ -23544,7 +23469,7 @@ var getApplyMetadataModule = async (encodedId) => {
|
|
|
23544
23469
|
const { resolveOwningComponents: resolveOwningComponents2 } = await Promise.resolve().then(() => (init_resolveOwningComponents(), exports_resolveOwningComponents));
|
|
23545
23470
|
const owners = resolveOwningComponents2({
|
|
23546
23471
|
changedFilePath: componentFilePath,
|
|
23547
|
-
userAngularRoot:
|
|
23472
|
+
userAngularRoot: dirname24(componentFilePath)
|
|
23548
23473
|
});
|
|
23549
23474
|
const owner = owners.find((o3) => o3.className === className);
|
|
23550
23475
|
const kind = owner?.kind ?? "component";
|
|
@@ -23695,11 +23620,11 @@ var exports_simpleHTMLHMR = {};
|
|
|
23695
23620
|
__export(exports_simpleHTMLHMR, {
|
|
23696
23621
|
handleHTMLUpdate: () => handleHTMLUpdate
|
|
23697
23622
|
});
|
|
23698
|
-
import { resolve as
|
|
23623
|
+
import { resolve as resolve39 } from "path";
|
|
23699
23624
|
var handleHTMLUpdate = async (htmlFilePath) => {
|
|
23700
23625
|
let htmlContent;
|
|
23701
23626
|
try {
|
|
23702
|
-
const resolvedPath =
|
|
23627
|
+
const resolvedPath = resolve39(htmlFilePath);
|
|
23703
23628
|
const file5 = Bun.file(resolvedPath);
|
|
23704
23629
|
if (!await file5.exists()) {
|
|
23705
23630
|
return null;
|
|
@@ -23725,11 +23650,11 @@ var exports_simpleHTMXHMR = {};
|
|
|
23725
23650
|
__export(exports_simpleHTMXHMR, {
|
|
23726
23651
|
handleHTMXUpdate: () => handleHTMXUpdate
|
|
23727
23652
|
});
|
|
23728
|
-
import { resolve as
|
|
23653
|
+
import { resolve as resolve40 } from "path";
|
|
23729
23654
|
var handleHTMXUpdate = async (htmxFilePath) => {
|
|
23730
23655
|
let htmlContent;
|
|
23731
23656
|
try {
|
|
23732
|
-
const resolvedPath =
|
|
23657
|
+
const resolvedPath = resolve40(htmxFilePath);
|
|
23733
23658
|
const file5 = Bun.file(resolvedPath);
|
|
23734
23659
|
if (!await file5.exists()) {
|
|
23735
23660
|
return null;
|
|
@@ -23752,7 +23677,7 @@ var init_simpleHTMXHMR = () => {};
|
|
|
23752
23677
|
|
|
23753
23678
|
// src/dev/rebuildTrigger.ts
|
|
23754
23679
|
import { existsSync as existsSync33, rmSync as rmSync3 } from "fs";
|
|
23755
|
-
import { basename as basename14, dirname as
|
|
23680
|
+
import { basename as basename14, dirname as dirname25, join as join40, relative as relative16, resolve as resolve41, sep as sep4 } from "path";
|
|
23756
23681
|
var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequentially = (items, action) => items.reduce((chain, item) => chain.then(() => action(item)), Promise.resolve()), getStyleTransformConfig = (config) => createStyleTransformConfig(config.stylePreprocessors, config.postcss), recompileTailwindForFastPath = async (state, config, files) => {
|
|
23757
23682
|
if (!config.tailwind)
|
|
23758
23683
|
return;
|
|
@@ -23764,7 +23689,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
23764
23689
|
if (!cssChanged)
|
|
23765
23690
|
return;
|
|
23766
23691
|
try {
|
|
23767
|
-
const outputPath =
|
|
23692
|
+
const outputPath = resolve41(state.resolvedPaths.buildDir, config.tailwind.output);
|
|
23768
23693
|
const bytes = await Bun.file(outputPath).bytes();
|
|
23769
23694
|
const webPath = `/${config.tailwind.output.replace(/^\/+/, "")}`;
|
|
23770
23695
|
state.assetStore.set(webPath, bytes);
|
|
@@ -23854,12 +23779,12 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
23854
23779
|
}, isValidDeletedAffectedFile = (affectedFile, deletedPathResolved, processedFiles) => affectedFile !== deletedPathResolved && !processedFiles.has(affectedFile) && existsSync33(affectedFile), FRAMEWORK_DIR_KEYS_FOR_CLEANUP, removeStaleGenerated = (state, deletedFile) => {
|
|
23855
23780
|
const config = state.config;
|
|
23856
23781
|
const cwd2 = process.cwd();
|
|
23857
|
-
const absDeleted =
|
|
23782
|
+
const absDeleted = resolve41(deletedFile).replace(/\\/g, "/");
|
|
23858
23783
|
for (const { configKey, framework } of FRAMEWORK_DIR_KEYS_FOR_CLEANUP) {
|
|
23859
23784
|
const dir = config[configKey];
|
|
23860
23785
|
if (!dir)
|
|
23861
23786
|
continue;
|
|
23862
|
-
const absDir =
|
|
23787
|
+
const absDir = resolve41(cwd2, dir).replace(/\\/g, "/");
|
|
23863
23788
|
if (!absDeleted.startsWith(`${absDir}/`))
|
|
23864
23789
|
continue;
|
|
23865
23790
|
const rel = absDeleted.slice(absDir.length + 1);
|
|
@@ -23883,7 +23808,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
23883
23808
|
removeStaleGenerated(state, filePathInSet);
|
|
23884
23809
|
try {
|
|
23885
23810
|
const affectedFiles = getAffectedFiles(state.dependencyGraph, filePathInSet);
|
|
23886
|
-
const deletedPathResolved =
|
|
23811
|
+
const deletedPathResolved = resolve41(filePathInSet);
|
|
23887
23812
|
affectedFiles.forEach((affectedFile) => {
|
|
23888
23813
|
if (isValidDeletedAffectedFile(affectedFile, deletedPathResolved, processedFiles)) {
|
|
23889
23814
|
validFiles.push(affectedFile);
|
|
@@ -23927,7 +23852,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
23927
23852
|
if (storedHash !== undefined && storedHash === fileHash) {
|
|
23928
23853
|
return;
|
|
23929
23854
|
}
|
|
23930
|
-
const normalizedFilePath =
|
|
23855
|
+
const normalizedFilePath = resolve41(filePathInSet);
|
|
23931
23856
|
if (!processedFiles.has(normalizedFilePath)) {
|
|
23932
23857
|
validFiles.push(normalizedFilePath);
|
|
23933
23858
|
processedFiles.add(normalizedFilePath);
|
|
@@ -24065,7 +23990,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24065
23990
|
const publicDir = state.resolvedPaths.publicDir;
|
|
24066
23991
|
const assetsDir = state.resolvedPaths.assetsDir;
|
|
24067
23992
|
const handleStaticMirror = async (sourceDir, urlPrefix) => {
|
|
24068
|
-
const absSource =
|
|
23993
|
+
const absSource = resolve41(filePath);
|
|
24069
23994
|
const normalizedSource = absSource.replace(/\\/g, "/");
|
|
24070
23995
|
const normalizedDir = sourceDir.replace(/\\/g, "/");
|
|
24071
23996
|
if (!normalizedSource.startsWith(normalizedDir + "/"))
|
|
@@ -24073,10 +23998,10 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24073
23998
|
try {
|
|
24074
23999
|
const relFromDir = normalizedSource.slice(normalizedDir.length + 1);
|
|
24075
24000
|
const buildDir = state.resolvedPaths.buildDir;
|
|
24076
|
-
const destPath =
|
|
24001
|
+
const destPath = resolve41(buildDir, urlPrefix ? `${urlPrefix}/${relFromDir}` : relFromDir);
|
|
24077
24002
|
const { mkdir: mkdir7, copyFile, readFile: readFile6 } = await import("fs/promises");
|
|
24078
|
-
const { dirname:
|
|
24079
|
-
await mkdir7(
|
|
24003
|
+
const { dirname: dirname26 } = await import("path");
|
|
24004
|
+
await mkdir7(dirname26(destPath), { recursive: true });
|
|
24080
24005
|
await copyFile(absSource, destPath);
|
|
24081
24006
|
const bytes = await readFile6(destPath);
|
|
24082
24007
|
const webPath = urlPrefix ? `/${urlPrefix}/${relFromDir}` : `/${relFromDir}`;
|
|
@@ -24099,7 +24024,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24099
24024
|
if (assetsDir && await handleStaticMirror(assetsDir, "assets"))
|
|
24100
24025
|
return;
|
|
24101
24026
|
if (framework === "unknown") {
|
|
24102
|
-
invalidate(
|
|
24027
|
+
invalidate(resolve41(filePath));
|
|
24103
24028
|
const relPath = relative16(process.cwd(), filePath);
|
|
24104
24029
|
logHmrUpdate(relPath);
|
|
24105
24030
|
const angularDir = state.resolvedPaths.angularDir;
|
|
@@ -24107,10 +24032,10 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24107
24032
|
if (angularDir && state.dependencyGraph) {
|
|
24108
24033
|
try {
|
|
24109
24034
|
const { addFileToGraph: addFileToGraph2 } = await Promise.resolve().then(() => (init_dependencyGraph(), exports_dependencyGraph));
|
|
24110
|
-
addFileToGraph2(state.dependencyGraph,
|
|
24111
|
-
const affected = getAffectedFiles(state.dependencyGraph,
|
|
24035
|
+
addFileToGraph2(state.dependencyGraph, resolve41(filePath));
|
|
24036
|
+
const affected = getAffectedFiles(state.dependencyGraph, resolve41(filePath));
|
|
24112
24037
|
for (const dependent of affected) {
|
|
24113
|
-
if (dependent ===
|
|
24038
|
+
if (dependent === resolve41(filePath))
|
|
24114
24039
|
continue;
|
|
24115
24040
|
const dependentFramework = detectFramework(dependent, state.resolvedPaths);
|
|
24116
24041
|
if (dependentFramework !== "angular")
|
|
@@ -24127,14 +24052,14 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24127
24052
|
} catch {}
|
|
24128
24053
|
}
|
|
24129
24054
|
if (!hasAngularDependent) {
|
|
24130
|
-
console.log(`[abs:restart] ${
|
|
24055
|
+
console.log(`[abs:restart] ${resolve41(filePath)}`);
|
|
24131
24056
|
return;
|
|
24132
24057
|
}
|
|
24133
24058
|
try {
|
|
24134
24059
|
const { getFrameworkGeneratedDir: getFrameworkGeneratedDir2 } = await Promise.resolve().then(() => (init_generatedDir(), exports_generatedDir));
|
|
24135
24060
|
const { invalidateModule: invalidateModuleServer } = await Promise.resolve().then(() => (init_moduleServer(), exports_moduleServer));
|
|
24136
24061
|
const generatedAngularRoot = getFrameworkGeneratedDir2("angular");
|
|
24137
|
-
const sourceAbs =
|
|
24062
|
+
const sourceAbs = resolve41(filePath).replace(/\\/g, "/");
|
|
24138
24063
|
const generatedTwin = `${generatedAngularRoot.replace(/\\/g, "/")}${sourceAbs.replace(/\.ts$/, ".js")}`;
|
|
24139
24064
|
invalidateModuleServer(generatedTwin);
|
|
24140
24065
|
} catch {}
|
|
@@ -24168,7 +24093,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24168
24093
|
const userEditedFiles = new Set;
|
|
24169
24094
|
state.fileChangeQueue.forEach((filePaths) => {
|
|
24170
24095
|
for (const filePath2 of filePaths) {
|
|
24171
|
-
userEditedFiles.add(
|
|
24096
|
+
userEditedFiles.add(resolve41(filePath2));
|
|
24172
24097
|
}
|
|
24173
24098
|
});
|
|
24174
24099
|
state.lastUserEditedFiles = userEditedFiles;
|
|
@@ -24197,7 +24122,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24197
24122
|
}
|
|
24198
24123
|
if (!graph)
|
|
24199
24124
|
return componentFile;
|
|
24200
|
-
const dependents = graph.dependents.get(
|
|
24125
|
+
const dependents = graph.dependents.get(resolve41(componentFile));
|
|
24201
24126
|
if (!dependents)
|
|
24202
24127
|
return componentFile;
|
|
24203
24128
|
for (const dep of dependents) {
|
|
@@ -24206,7 +24131,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24206
24131
|
}
|
|
24207
24132
|
return componentFile;
|
|
24208
24133
|
}, resolveAngularPageEntries = (state, angularFiles, angularPagesPath) => {
|
|
24209
|
-
const pageEntries = angularFiles.filter((file5) => file5.endsWith(".ts") &&
|
|
24134
|
+
const pageEntries = angularFiles.filter((file5) => file5.endsWith(".ts") && resolve41(file5).startsWith(angularPagesPath));
|
|
24210
24135
|
if (pageEntries.length > 0 || !state.dependencyGraph) {
|
|
24211
24136
|
return pageEntries;
|
|
24212
24137
|
}
|
|
@@ -24215,7 +24140,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24215
24140
|
const lookupFile = resolveComponentLookupFile(componentFile, state.dependencyGraph);
|
|
24216
24141
|
const affected = getAffectedFiles(state.dependencyGraph, lookupFile);
|
|
24217
24142
|
affected.forEach((file5) => {
|
|
24218
|
-
if (file5.endsWith(".ts") &&
|
|
24143
|
+
if (file5.endsWith(".ts") && resolve41(file5).startsWith(angularPagesPath)) {
|
|
24219
24144
|
resolvedPages.add(file5);
|
|
24220
24145
|
}
|
|
24221
24146
|
});
|
|
@@ -24256,8 +24181,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24256
24181
|
if (serverDirs.length <= 1) {
|
|
24257
24182
|
const dir = getFrameworkGeneratedDir2(framework, projectRoot);
|
|
24258
24183
|
return {
|
|
24259
|
-
serverOutDir:
|
|
24260
|
-
serverRoot:
|
|
24184
|
+
serverOutDir: resolve41(resolvedPaths.buildDir, basename14(dir)),
|
|
24185
|
+
serverRoot: resolve41(dir, "server")
|
|
24261
24186
|
};
|
|
24262
24187
|
}
|
|
24263
24188
|
return {
|
|
@@ -24278,7 +24203,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24278
24203
|
const keepByDir = new Map;
|
|
24279
24204
|
const prefixByDir = new Map;
|
|
24280
24205
|
for (const artifact of freshOutputs) {
|
|
24281
|
-
const dir =
|
|
24206
|
+
const dir = dirname25(artifact.path);
|
|
24282
24207
|
const name = basename14(artifact.path);
|
|
24283
24208
|
const [prefix] = name.split(".");
|
|
24284
24209
|
if (!prefix)
|
|
@@ -24418,8 +24343,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24418
24343
|
if (detected !== "unknown")
|
|
24419
24344
|
continue;
|
|
24420
24345
|
try {
|
|
24421
|
-
const affected = getAffectedFiles(state.dependencyGraph,
|
|
24422
|
-
const hasAngularConsumer = affected.some((dep) => dep !==
|
|
24346
|
+
const affected = getAffectedFiles(state.dependencyGraph, resolve41(editedFile));
|
|
24347
|
+
const hasAngularConsumer = affected.some((dep) => dep !== resolve41(editedFile) && detectFramework(dep, state.resolvedPaths) === "angular");
|
|
24423
24348
|
if (hasAngularConsumer) {
|
|
24424
24349
|
return {
|
|
24425
24350
|
kind: "rebootstrap",
|
|
@@ -24466,7 +24391,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24466
24391
|
}
|
|
24467
24392
|
if (owners.length === 0 && (editedFile.endsWith(".ts") || editedFile.endsWith(".json")) && !editedFile.endsWith(".d.ts")) {
|
|
24468
24393
|
const normalized = editedFile.replace(/\\/g, "/");
|
|
24469
|
-
const angularDirAbs =
|
|
24394
|
+
const angularDirAbs = resolve41(angularDir).replace(/\\/g, "/");
|
|
24470
24395
|
if (normalized.startsWith(angularDirAbs + "/")) {
|
|
24471
24396
|
return {
|
|
24472
24397
|
kind: "rebootstrap",
|
|
@@ -24609,16 +24534,16 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24609
24534
|
};
|
|
24610
24535
|
const fire = () => {
|
|
24611
24536
|
ctx.debounceTimer = null;
|
|
24612
|
-
const
|
|
24537
|
+
const resolve42 = ctx.debouncedResolve;
|
|
24613
24538
|
ctx.debouncedResolve = null;
|
|
24614
24539
|
ctx.debouncedPromise = null;
|
|
24615
24540
|
if (ctx.inFlight) {
|
|
24616
24541
|
ctx.pending = true;
|
|
24617
|
-
ctx.inFlight.finally(() =>
|
|
24542
|
+
ctx.inFlight.finally(() => resolve42?.());
|
|
24618
24543
|
return;
|
|
24619
24544
|
}
|
|
24620
24545
|
ctx.inFlight = drive();
|
|
24621
|
-
ctx.inFlight.finally(() =>
|
|
24546
|
+
ctx.inFlight.finally(() => resolve42?.());
|
|
24622
24547
|
};
|
|
24623
24548
|
return ({ immediate = false } = {}) => {
|
|
24624
24549
|
if (!ctx.debouncedPromise) {
|
|
@@ -24645,9 +24570,9 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24645
24570
|
const diskRefreshPromise = (async () => {
|
|
24646
24571
|
if (!angularDir || editedFiles.size === 0)
|
|
24647
24572
|
return;
|
|
24648
|
-
const angularDirAbs =
|
|
24573
|
+
const angularDirAbs = resolve41(angularDir);
|
|
24649
24574
|
const filesUnderAngular = Array.from(editedFiles).filter((file5) => {
|
|
24650
|
-
const abs =
|
|
24575
|
+
const abs = resolve41(file5);
|
|
24651
24576
|
return abs === angularDirAbs || abs.startsWith(angularDirAbs + sep4);
|
|
24652
24577
|
});
|
|
24653
24578
|
if (filesUnderAngular.length === 0)
|
|
@@ -24669,7 +24594,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24669
24594
|
if (!ext)
|
|
24670
24595
|
continue;
|
|
24671
24596
|
if (ext === ".ts" || ext === ".tsx") {
|
|
24672
|
-
tsFilesToRefresh.add(
|
|
24597
|
+
tsFilesToRefresh.add(resolve41(file5));
|
|
24673
24598
|
continue;
|
|
24674
24599
|
}
|
|
24675
24600
|
const owners = resolveOwningComponents2({
|
|
@@ -24677,7 +24602,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24677
24602
|
userAngularRoot: angularDirAbs
|
|
24678
24603
|
});
|
|
24679
24604
|
for (const owner of owners) {
|
|
24680
|
-
tsFilesToRefresh.add(
|
|
24605
|
+
tsFilesToRefresh.add(resolve41(owner.componentFilePath));
|
|
24681
24606
|
}
|
|
24682
24607
|
}
|
|
24683
24608
|
if (tsFilesToRefresh.size === 0)
|
|
@@ -24692,7 +24617,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24692
24617
|
const { invalidateModule: invalidateModule2 } = await Promise.resolve().then(() => (init_moduleServer(), exports_moduleServer));
|
|
24693
24618
|
for (const tsFile of tsFilesToRefresh) {
|
|
24694
24619
|
const rel = relative16(angularDirAbs, tsFile).replace(/\\/g, "/").replace(/\.[tj]sx?$/, ".js");
|
|
24695
|
-
const compiledFile =
|
|
24620
|
+
const compiledFile = resolve41(compiledRoot, rel);
|
|
24696
24621
|
invalidateModule2(compiledFile);
|
|
24697
24622
|
}
|
|
24698
24623
|
} catch {}
|
|
@@ -24706,9 +24631,10 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24706
24631
|
const { runAngularHandlerScan: runAngularHandlerScan2 } = await Promise.resolve().then(() => (init_runAngularHandlerScan(), exports_runAngularHandlerScan));
|
|
24707
24632
|
const { parseAngularProvidersImport: parseAngularProvidersImport2 } = await Promise.resolve().then(() => (init_parseAngularConfigImports(), exports_parseAngularConfigImports));
|
|
24708
24633
|
const projectRoot = process.cwd();
|
|
24634
|
+
const resolvedAngularDir = resolve41(angularDir);
|
|
24709
24635
|
const providersImport = parseAngularProvidersImport2(projectRoot);
|
|
24710
24636
|
const providersInjection = providersImport ? (() => {
|
|
24711
|
-
const scan = runAngularHandlerScan2(projectRoot,
|
|
24637
|
+
const scan = runAngularHandlerScan2(projectRoot, resolvedAngularDir);
|
|
24712
24638
|
const basePathByKey = new Map;
|
|
24713
24639
|
for (const call of scan.calls) {
|
|
24714
24640
|
basePathByKey.set(call.manifestKey, call.mountPath?.endsWith("/*") ? call.mountPath.slice(0, -1) : null);
|
|
@@ -24766,7 +24692,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24766
24692
|
serverPaths.forEach((serverPath, idx) => {
|
|
24767
24693
|
const fileBase = basename14(serverPath, ".js");
|
|
24768
24694
|
const ssrPath = ssrPaths[idx] ?? serverPath;
|
|
24769
|
-
state.manifest[toPascal(fileBase)] =
|
|
24695
|
+
state.manifest[toPascal(fileBase)] = resolve41(ssrPath);
|
|
24770
24696
|
});
|
|
24771
24697
|
if (clientPaths.length > 0) {
|
|
24772
24698
|
await bundleAngularClient(state, clientPaths, state.resolvedPaths.buildDir, angularDir);
|
|
@@ -24779,10 +24705,33 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24779
24705
|
const angularDir = config.angularDirectory ?? "";
|
|
24780
24706
|
const angularFiles = filesToRebuild.filter((file5) => detectFramework(file5, state.resolvedPaths) === "angular");
|
|
24781
24707
|
for (const file5 of angularFiles) {
|
|
24782
|
-
state.fileHashes.set(
|
|
24708
|
+
state.fileHashes.set(resolve41(file5), computeFileHash(file5));
|
|
24783
24709
|
}
|
|
24784
|
-
const angularPagesPath =
|
|
24785
|
-
const
|
|
24710
|
+
const angularPagesPath = resolve41(angularDir, "pages");
|
|
24711
|
+
const initialPageEntries = resolveAngularPageEntries(state, angularFiles, angularPagesPath);
|
|
24712
|
+
const projectRoot = process.cwd();
|
|
24713
|
+
const { parseAngularProvidersImport: parseAngularProvidersImport2 } = await Promise.resolve().then(() => (init_parseAngularConfigImports(), exports_parseAngularConfigImports));
|
|
24714
|
+
const providersImport = parseAngularProvidersImport2(projectRoot);
|
|
24715
|
+
const editedProvidersChain = providersImport && angularFiles.some((file5) => resolve41(file5) === resolve41(providersImport.absolutePath) || resolve41(file5).startsWith(`${resolve41(angularDir)}/`));
|
|
24716
|
+
const pageEntries = editedProvidersChain && initialPageEntries.length === 0 ? (() => {
|
|
24717
|
+
const allPages = [];
|
|
24718
|
+
const { readdirSync: readdirSync7 } = __require("fs");
|
|
24719
|
+
const walk = (dir) => {
|
|
24720
|
+
for (const entry of readdirSync7(dir, {
|
|
24721
|
+
withFileTypes: true
|
|
24722
|
+
})) {
|
|
24723
|
+
const full = resolve41(dir, entry.name);
|
|
24724
|
+
if (entry.isDirectory())
|
|
24725
|
+
walk(full);
|
|
24726
|
+
else if (entry.isFile() && entry.name.endsWith(".ts"))
|
|
24727
|
+
allPages.push(full);
|
|
24728
|
+
}
|
|
24729
|
+
};
|
|
24730
|
+
try {
|
|
24731
|
+
walk(angularPagesPath);
|
|
24732
|
+
} catch {}
|
|
24733
|
+
return allPages;
|
|
24734
|
+
})() : initialPageEntries;
|
|
24786
24735
|
const tierStart = performance.now();
|
|
24787
24736
|
const verdict = await decideAngularTier(state, angularDir);
|
|
24788
24737
|
const tierMs = (performance.now() - tierStart).toFixed(0);
|
|
@@ -24822,11 +24771,11 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24822
24771
|
if (isComponentFile2)
|
|
24823
24772
|
return primaryFile;
|
|
24824
24773
|
const { findNearestComponent: findNearestComponent2 } = await Promise.resolve().then(() => (init_transformCache(), exports_transformCache));
|
|
24825
|
-
const nearest = findNearestComponent2(
|
|
24774
|
+
const nearest = findNearestComponent2(resolve41(primaryFile));
|
|
24826
24775
|
return nearest ?? primaryFile;
|
|
24827
24776
|
}, handleReactModuleServerPath = async (state, reactFiles, startTime, onRebuildComplete) => {
|
|
24828
24777
|
for (const file5 of reactFiles) {
|
|
24829
|
-
state.fileHashes.set(
|
|
24778
|
+
state.fileHashes.set(resolve41(file5), computeFileHash(file5));
|
|
24830
24779
|
}
|
|
24831
24780
|
const primaryFile = reactFiles.find((file5) => !file5.replace(/\\/g, "/").includes("/pages/")) ?? reactFiles[0];
|
|
24832
24781
|
if (!primaryFile) {
|
|
@@ -24907,7 +24856,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24907
24856
|
});
|
|
24908
24857
|
}, handleSvelteModuleServerPath = async (state, svelteFiles, config, startTime, onRebuildComplete) => {
|
|
24909
24858
|
for (const file5 of svelteFiles) {
|
|
24910
|
-
state.fileHashes.set(
|
|
24859
|
+
state.fileHashes.set(resolve41(file5), computeFileHash(file5));
|
|
24911
24860
|
}
|
|
24912
24861
|
const serverDuration = Date.now() - startTime;
|
|
24913
24862
|
await runSequentially(svelteFiles, (changedFile) => broadcastSvelteModuleUpdate(state, changedFile, svelteFiles, serverDuration));
|
|
@@ -25154,7 +25103,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
25154
25103
|
});
|
|
25155
25104
|
}, handleVueModuleServerPath = async (state, vueFiles, nonVueFiles, config, startTime, onRebuildComplete) => {
|
|
25156
25105
|
for (const file5 of [...vueFiles, ...nonVueFiles]) {
|
|
25157
|
-
state.fileHashes.set(
|
|
25106
|
+
state.fileHashes.set(resolve41(file5), computeFileHash(file5));
|
|
25158
25107
|
}
|
|
25159
25108
|
await invalidateNonVueModules(nonVueFiles);
|
|
25160
25109
|
const serverDuration = Date.now() - startTime;
|
|
@@ -25303,7 +25252,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
25303
25252
|
recursive: true,
|
|
25304
25253
|
withFileTypes: true
|
|
25305
25254
|
});
|
|
25306
|
-
return entries.filter((entry) => entry.isFile() && EMBER_PAGE_EXTENSIONS.some((ext) => entry.name.endsWith(ext))).map((entry) =>
|
|
25255
|
+
return entries.filter((entry) => entry.isFile() && EMBER_PAGE_EXTENSIONS.some((ext) => entry.name.endsWith(ext))).map((entry) => resolve41(emberPagesPath, entry.name));
|
|
25307
25256
|
} catch {
|
|
25308
25257
|
return [];
|
|
25309
25258
|
}
|
|
@@ -25315,10 +25264,10 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
25315
25264
|
return state.manifest;
|
|
25316
25265
|
}
|
|
25317
25266
|
for (const file5 of emberFiles) {
|
|
25318
|
-
state.fileHashes.set(
|
|
25267
|
+
state.fileHashes.set(resolve41(file5), computeFileHash(file5));
|
|
25319
25268
|
}
|
|
25320
|
-
const emberPagesPath =
|
|
25321
|
-
const directPageEntries = emberFiles.filter((file5) =>
|
|
25269
|
+
const emberPagesPath = resolve41(emberDir, "pages");
|
|
25270
|
+
const directPageEntries = emberFiles.filter((file5) => resolve41(file5).startsWith(emberPagesPath));
|
|
25322
25271
|
const allPageEntries = directPageEntries.length > 0 ? directPageEntries : await collectAllEmberPages(emberPagesPath);
|
|
25323
25272
|
if (allPageEntries.length === 0) {
|
|
25324
25273
|
onRebuildComplete({ hmrState: state, manifest: state.manifest });
|
|
@@ -25328,7 +25277,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
25328
25277
|
const { serverPaths } = await compileEmber2(allPageEntries, emberDir, process.cwd(), true);
|
|
25329
25278
|
for (const serverPath of serverPaths) {
|
|
25330
25279
|
const fileBase = basename14(serverPath, ".js");
|
|
25331
|
-
state.manifest[toPascal(fileBase)] =
|
|
25280
|
+
state.manifest[toPascal(fileBase)] = resolve41(serverPath);
|
|
25332
25281
|
}
|
|
25333
25282
|
const { invalidateEmberSsrCache: invalidateEmberSsrCache2 } = await Promise.resolve().then(() => (init_ember(), exports_ember));
|
|
25334
25283
|
invalidateEmberSsrCache2();
|
|
@@ -25420,8 +25369,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
25420
25369
|
if (!buildReference?.source) {
|
|
25421
25370
|
return;
|
|
25422
25371
|
}
|
|
25423
|
-
const sourcePath = buildReference.source.startsWith("file://") ? new URL(buildReference.source).pathname :
|
|
25424
|
-
islandFiles.add(
|
|
25372
|
+
const sourcePath = buildReference.source.startsWith("file://") ? new URL(buildReference.source).pathname : resolve41(dirname25(buildInfo.resolvedRegistryPath), buildReference.source);
|
|
25373
|
+
islandFiles.add(resolve41(sourcePath));
|
|
25425
25374
|
}, resolveIslandSourceFiles = async (config) => {
|
|
25426
25375
|
const registryPath = config.islands?.registry;
|
|
25427
25376
|
if (!registryPath) {
|
|
@@ -25429,7 +25378,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
25429
25378
|
}
|
|
25430
25379
|
const buildInfo = await loadIslandRegistryBuildInfo(registryPath);
|
|
25431
25380
|
const islandFiles = new Set([
|
|
25432
|
-
|
|
25381
|
+
resolve41(buildInfo.resolvedRegistryPath)
|
|
25433
25382
|
]);
|
|
25434
25383
|
for (const definition of buildInfo.definitions) {
|
|
25435
25384
|
resolveIslandDefinitionSource(definition, buildInfo, islandFiles);
|
|
@@ -25440,7 +25389,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
25440
25389
|
if (islandFiles.size === 0) {
|
|
25441
25390
|
return false;
|
|
25442
25391
|
}
|
|
25443
|
-
return filesToRebuild.some((file5) => islandFiles.has(
|
|
25392
|
+
return filesToRebuild.some((file5) => islandFiles.has(resolve41(file5)));
|
|
25444
25393
|
}, handleIslandSourceReload = async (state, config, filesToRebuild, manifest) => {
|
|
25445
25394
|
const shouldReload = await didStaticPagesNeedIslandRefresh(config, filesToRebuild);
|
|
25446
25395
|
if (!shouldReload) {
|
|
@@ -25475,10 +25424,10 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
25475
25424
|
}, computeOutputPagesDir = (state, config, framework) => {
|
|
25476
25425
|
const isSingle = !config.reactDirectory && !config.svelteDirectory && !config.vueDirectory && (framework === "html" ? !config.htmxDirectory : !config.htmlDirectory);
|
|
25477
25426
|
if (isSingle) {
|
|
25478
|
-
return
|
|
25427
|
+
return resolve41(state.resolvedPaths.buildDir, "pages");
|
|
25479
25428
|
}
|
|
25480
25429
|
const dirName = framework === "html" ? basename14(config.htmlDirectory ?? "html") : basename14(config.htmxDirectory ?? "htmx");
|
|
25481
|
-
return
|
|
25430
|
+
return resolve41(state.resolvedPaths.buildDir, dirName, "pages");
|
|
25482
25431
|
}, processHtmlPageUpdate = async (state, pageFile, builtHtmlPagePath, manifest, duration) => {
|
|
25483
25432
|
try {
|
|
25484
25433
|
const { handleHTMLUpdate: handleHTMLUpdate2 } = await Promise.resolve().then(() => (init_simpleHTMLHMR(), exports_simpleHTMLHMR));
|
|
@@ -25517,7 +25466,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
25517
25466
|
const pageFilesToUpdate = shouldRefreshAllPages ? await scanEntryPoints(outputHtmlPages, "*.html") : htmlPageFiles;
|
|
25518
25467
|
await runSequentially(pageFilesToUpdate, async (pageFile) => {
|
|
25519
25468
|
const htmlPageName = basename14(pageFile);
|
|
25520
|
-
const builtHtmlPagePath =
|
|
25469
|
+
const builtHtmlPagePath = resolve41(outputHtmlPages, htmlPageName);
|
|
25521
25470
|
await processHtmlPageUpdate(state, pageFile, builtHtmlPagePath, manifest, duration);
|
|
25522
25471
|
});
|
|
25523
25472
|
}, handleVueCssOnlyUpdate = (state, vueCssFiles, manifest, duration) => {
|
|
@@ -25582,7 +25531,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
25582
25531
|
const cssKey = `${pascalName}CSS`;
|
|
25583
25532
|
const cssUrl = manifest[cssKey] || null;
|
|
25584
25533
|
const { vueHmrMetadata: vueHmrMetadata2 } = await Promise.resolve().then(() => (init_compileVue(), exports_compileVue));
|
|
25585
|
-
const hmrMeta = vueHmrMetadata2.get(
|
|
25534
|
+
const hmrMeta = vueHmrMetadata2.get(resolve41(vuePagePath));
|
|
25586
25535
|
const changeType = hmrMeta?.changeType ?? "full";
|
|
25587
25536
|
if (changeType === "style-only") {
|
|
25588
25537
|
broadcastVueStyleOnly(state, vuePagePath, baseName, cssUrl, hmrId, manifest, duration);
|
|
@@ -25767,7 +25716,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
25767
25716
|
const pageFilesToUpdate = shouldRefreshAllPages ? await scanEntryPoints(outputHtmxPages, "*.html") : htmxPageFiles;
|
|
25768
25717
|
await runSequentially(pageFilesToUpdate, async (htmxPageFile) => {
|
|
25769
25718
|
const htmxPageName = basename14(htmxPageFile);
|
|
25770
|
-
const builtHtmxPagePath =
|
|
25719
|
+
const builtHtmxPagePath = resolve41(outputHtmxPages, htmxPageName);
|
|
25771
25720
|
await processHtmxPageUpdate(state, htmxPageFile, builtHtmxPagePath, manifest, duration);
|
|
25772
25721
|
});
|
|
25773
25722
|
}, collectUpdatedModulePaths = (allModuleUpdates) => {
|
|
@@ -25876,7 +25825,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
25876
25825
|
html = html.slice(0, bodyClose.index) + hmrScript + html.slice(bodyClose.index);
|
|
25877
25826
|
writeFs(destPath, html);
|
|
25878
25827
|
}, processMarkupFileFastPath = async (state, sourceFile, outputDir, framework, startTime, updateAssetPaths2, handleUpdate, readFs, writeFs) => {
|
|
25879
|
-
const destPath =
|
|
25828
|
+
const destPath = resolve41(outputDir, basename14(sourceFile));
|
|
25880
25829
|
const hmrScript = extractHmrScript(destPath, readFs);
|
|
25881
25830
|
const source = await Bun.file(sourceFile).text();
|
|
25882
25831
|
await Bun.write(destPath, source);
|
|
@@ -26018,7 +25967,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
26018
25967
|
});
|
|
26019
25968
|
if (config.tailwind && filesToRebuild && filesToRebuild.some(isTailwindCandidate)) {
|
|
26020
25969
|
try {
|
|
26021
|
-
const outputPath =
|
|
25970
|
+
const outputPath = resolve41(state.resolvedPaths.buildDir, config.tailwind.output);
|
|
26022
25971
|
const bytes = await Bun.file(outputPath).bytes();
|
|
26023
25972
|
const webPath = `/${config.tailwind.output.replace(/^\/+/, "")}`;
|
|
26024
25973
|
state.assetStore.set(webPath, bytes);
|
|
@@ -26432,7 +26381,7 @@ __export(exports_devBuild, {
|
|
|
26432
26381
|
});
|
|
26433
26382
|
import { readdir as readdir5 } from "fs/promises";
|
|
26434
26383
|
import { statSync as statSync7 } from "fs";
|
|
26435
|
-
import { resolve as
|
|
26384
|
+
import { resolve as resolve42 } from "path";
|
|
26436
26385
|
var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
26437
26386
|
const configuredDirs = [
|
|
26438
26387
|
config.reactDirectory,
|
|
@@ -26455,7 +26404,7 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
26455
26404
|
return Object.keys(config).length > 0 ? config : null;
|
|
26456
26405
|
}, reloadConfig = async () => {
|
|
26457
26406
|
try {
|
|
26458
|
-
const configPath2 =
|
|
26407
|
+
const configPath2 = resolve42(process.env.ABSOLUTE_CONFIG ?? "absolute.config.ts");
|
|
26459
26408
|
const source = await Bun.file(configPath2).text();
|
|
26460
26409
|
return parseDirectoryConfig(source);
|
|
26461
26410
|
} catch {
|
|
@@ -26562,7 +26511,7 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
26562
26511
|
state.fileChangeQueue.clear();
|
|
26563
26512
|
}
|
|
26564
26513
|
}, handleCachedReload = async () => {
|
|
26565
|
-
const serverMtime = statSync7(
|
|
26514
|
+
const serverMtime = statSync7(resolve42(Bun.main)).mtimeMs;
|
|
26566
26515
|
const lastMtime = globalThis.__hmrServerMtime;
|
|
26567
26516
|
globalThis.__hmrServerMtime = serverMtime;
|
|
26568
26517
|
const cached = globalThis.__hmrDevResult;
|
|
@@ -26599,8 +26548,8 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
26599
26548
|
return true;
|
|
26600
26549
|
}, resolveAbsoluteVersion2 = async () => {
|
|
26601
26550
|
const candidates = [
|
|
26602
|
-
|
|
26603
|
-
|
|
26551
|
+
resolve42(import.meta.dir, "..", "..", "package.json"),
|
|
26552
|
+
resolve42(import.meta.dir, "..", "package.json")
|
|
26604
26553
|
];
|
|
26605
26554
|
const [candidate, ...remaining] = candidates;
|
|
26606
26555
|
if (!candidate) {
|
|
@@ -26626,7 +26575,7 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
26626
26575
|
const entries = await readdir5(vendorDir).catch(() => emptyStringArray);
|
|
26627
26576
|
await Promise.all(entries.filter((entry) => entry.endsWith(".js")).map(async (entry) => {
|
|
26628
26577
|
const webPath = `/${framework}/vendor/${entry}`;
|
|
26629
|
-
const bytes = await Bun.file(
|
|
26578
|
+
const bytes = await Bun.file(resolve42(vendorDir, entry)).bytes();
|
|
26630
26579
|
assetStore.set(webPath, bytes);
|
|
26631
26580
|
}));
|
|
26632
26581
|
}, devBuild = async (config) => {
|
|
@@ -26705,11 +26654,11 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
26705
26654
|
cleanStaleAssets(state.assetStore, manifest, state.resolvedPaths.buildDir);
|
|
26706
26655
|
recordStep("populate asset store", stepStartedAt);
|
|
26707
26656
|
stepStartedAt = performance.now();
|
|
26708
|
-
const reactVendorDir =
|
|
26709
|
-
const angularVendorDir =
|
|
26710
|
-
const svelteVendorDir =
|
|
26711
|
-
const vueVendorDir =
|
|
26712
|
-
const depVendorDir =
|
|
26657
|
+
const reactVendorDir = resolve42(state.resolvedPaths.buildDir, "react", "vendor");
|
|
26658
|
+
const angularVendorDir = resolve42(state.resolvedPaths.buildDir, "angular", "vendor");
|
|
26659
|
+
const svelteVendorDir = resolve42(state.resolvedPaths.buildDir, "svelte", "vendor");
|
|
26660
|
+
const vueVendorDir = resolve42(state.resolvedPaths.buildDir, "vue", "vendor");
|
|
26661
|
+
const depVendorDir = resolve42(state.resolvedPaths.buildDir, "vendor");
|
|
26713
26662
|
const { buildDepVendor: buildDepVendor2 } = await Promise.resolve().then(() => (init_buildDepVendor(), exports_buildDepVendor));
|
|
26714
26663
|
const [, angularSpecs, , , , , depPaths] = await Promise.all([
|
|
26715
26664
|
config.reactDirectory ? buildReactVendor(state.resolvedPaths.buildDir) : Promise.resolve(undefined),
|
|
@@ -26820,7 +26769,7 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
26820
26769
|
manifest
|
|
26821
26770
|
};
|
|
26822
26771
|
globalThis.__hmrDevResult = result;
|
|
26823
|
-
globalThis.__hmrServerMtime = statSync7(
|
|
26772
|
+
globalThis.__hmrServerMtime = statSync7(resolve42(Bun.main)).mtimeMs;
|
|
26824
26773
|
return result;
|
|
26825
26774
|
};
|
|
26826
26775
|
var init_devBuild = __esm(() => {
|
|
@@ -26965,8 +26914,8 @@ var STORE_KEY = "__elysiaStore", getGlobalValue = (key) => Reflect.get(globalThi
|
|
|
26965
26914
|
return null;
|
|
26966
26915
|
if (!pathname.startsWith("/"))
|
|
26967
26916
|
return null;
|
|
26968
|
-
const { resolve:
|
|
26969
|
-
const candidate =
|
|
26917
|
+
const { resolve: resolve43, normalize } = await import("path");
|
|
26918
|
+
const candidate = resolve43(buildDir, pathname.slice(1));
|
|
26970
26919
|
const normalizedBuild = normalize(buildDir);
|
|
26971
26920
|
if (!candidate.startsWith(normalizedBuild))
|
|
26972
26921
|
return null;
|
|
@@ -27050,12 +26999,12 @@ __export(exports_devtoolsJson, {
|
|
|
27050
26999
|
devtoolsJson: () => devtoolsJson
|
|
27051
27000
|
});
|
|
27052
27001
|
import { existsSync as existsSync34, mkdirSync as mkdirSync15, readFileSync as readFileSync26, writeFileSync as writeFileSync10 } from "fs";
|
|
27053
|
-
import { dirname as
|
|
27002
|
+
import { dirname as dirname26, join as join42, resolve as resolve43 } from "path";
|
|
27054
27003
|
import { Elysia as Elysia3 } from "elysia";
|
|
27055
27004
|
var ENDPOINT = "/.well-known/appspecific/com.chrome.devtools.json", UUID_CACHE_KEY = "__absoluteDevtoolsWorkspaceUuid", getGlobalUuid = () => Reflect.get(globalThis, UUID_CACHE_KEY), setGlobalUuid = (uuid) => {
|
|
27056
27005
|
Reflect.set(globalThis, UUID_CACHE_KEY, uuid);
|
|
27057
27006
|
return uuid;
|
|
27058
|
-
}, 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) =>
|
|
27007
|
+
}, 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) => resolve43(uuidCachePath ?? join42(buildDir, ".absolute", "chrome-devtools-workspace-uuid")), readCachedUuid = (cachePath) => {
|
|
27059
27008
|
if (!existsSync34(cachePath))
|
|
27060
27009
|
return null;
|
|
27061
27010
|
try {
|
|
@@ -27077,11 +27026,11 @@ var ENDPOINT = "/.well-known/appspecific/com.chrome.devtools.json", UUID_CACHE_K
|
|
|
27077
27026
|
if (cachedUuid)
|
|
27078
27027
|
return setGlobalUuid(cachedUuid);
|
|
27079
27028
|
const uuid = crypto.randomUUID();
|
|
27080
|
-
mkdirSync15(
|
|
27029
|
+
mkdirSync15(dirname26(cachePath), { recursive: true });
|
|
27081
27030
|
writeFileSync10(cachePath, uuid, "utf-8");
|
|
27082
27031
|
return setGlobalUuid(uuid);
|
|
27083
27032
|
}, devtoolsJson = (buildDir, options = {}) => {
|
|
27084
|
-
const rootPath =
|
|
27033
|
+
const rootPath = resolve43(options.projectRoot ?? process.cwd());
|
|
27085
27034
|
const root = options.normalizeForWindowsContainer === false ? rootPath : normalizeDevtoolsWorkspaceRoot(rootPath);
|
|
27086
27035
|
const uuid = getOrCreateUuid(buildDir, options);
|
|
27087
27036
|
return new Elysia3({ name: "absolute-devtools-json" }).get(ENDPOINT, () => ({
|
|
@@ -27110,7 +27059,7 @@ __export(exports_imageOptimizer, {
|
|
|
27110
27059
|
imageOptimizer: () => imageOptimizer
|
|
27111
27060
|
});
|
|
27112
27061
|
import { existsSync as existsSync35 } from "fs";
|
|
27113
|
-
import { resolve as
|
|
27062
|
+
import { resolve as resolve44 } from "path";
|
|
27114
27063
|
import { Elysia as Elysia4 } from "elysia";
|
|
27115
27064
|
var DEFAULT_CACHE_TTL_SECONDS = 60, MS_PER_SECOND = 1000, MAX_QUALITY = 100, avifInProgress, safeResolve = (path, baseDir) => {
|
|
27116
27065
|
try {
|
|
@@ -27123,7 +27072,7 @@ var DEFAULT_CACHE_TTL_SECONDS = 60, MS_PER_SECOND = 1000, MAX_QUALITY = 100, avi
|
|
|
27123
27072
|
}
|
|
27124
27073
|
}, resolveLocalImage = (url, buildDir) => {
|
|
27125
27074
|
const cleanPath = url.startsWith("/") ? url.slice(1) : url;
|
|
27126
|
-
return safeResolve(cleanPath, buildDir) ?? safeResolve(cleanPath,
|
|
27075
|
+
return safeResolve(cleanPath, buildDir) ?? safeResolve(cleanPath, resolve44(process.cwd()));
|
|
27127
27076
|
}, parseQueryParams = (query, allowedSizes, defaultQuality) => {
|
|
27128
27077
|
const url = typeof query["url"] === "string" ? query["url"] : undefined;
|
|
27129
27078
|
const wParam = typeof query["w"] === "string" ? query["w"] : undefined;
|
|
@@ -27530,7 +27479,7 @@ __export(exports_serverEntryWatcher, {
|
|
|
27530
27479
|
});
|
|
27531
27480
|
import { existsSync as existsSync38, statSync as statSync8, watch as watch2 } from "fs";
|
|
27532
27481
|
import { createRequire as createRequire2 } from "module";
|
|
27533
|
-
import { dirname as
|
|
27482
|
+
import { dirname as dirname27, join as join46, resolve as resolve46 } from "path";
|
|
27534
27483
|
var ATOMIC_RECOVERY_WINDOW_MS = 1000, RELOAD_DEBOUNCE_MS = 80, ATOMIC_WRITE_TEMP_PATTERNS2, isAtomicWriteTemp = (filename) => filename.endsWith(".tmp") || filename.includes(".tmp.") || filename.endsWith("~") || filename.startsWith(".#") || ATOMIC_WRITE_TEMP_PATTERNS2.some((re2) => re2.test(filename)), startServerEntryWatcher = () => {
|
|
27535
27484
|
if (globalThis.__absoluteEntryWatcherStarted)
|
|
27536
27485
|
return;
|
|
@@ -27538,11 +27487,11 @@ var ATOMIC_RECOVERY_WINDOW_MS = 1000, RELOAD_DEBOUNCE_MS = 80, ATOMIC_WRITE_TEMP
|
|
|
27538
27487
|
if (!main || !existsSync38(main))
|
|
27539
27488
|
return;
|
|
27540
27489
|
globalThis.__absoluteEntryWatcherStarted = true;
|
|
27541
|
-
const entryPath =
|
|
27542
|
-
const entryDir =
|
|
27490
|
+
const entryPath = resolve46(main);
|
|
27491
|
+
const entryDir = dirname27(entryPath);
|
|
27543
27492
|
const entryBase = entryPath.slice(entryDir.length + 1);
|
|
27544
|
-
const configPath2 =
|
|
27545
|
-
const configDir2 =
|
|
27493
|
+
const configPath2 = resolve46(process.env.ABSOLUTE_CONFIG ?? "absolute.config.ts");
|
|
27494
|
+
const configDir2 = dirname27(configPath2);
|
|
27546
27495
|
const configBase = configPath2.slice(configDir2.length + 1);
|
|
27547
27496
|
const recentlyHandled = new Map;
|
|
27548
27497
|
let entryReloadTimer = null;
|
|
@@ -28189,7 +28138,7 @@ var handleHTMXPageRequest = async (pagePath) => {
|
|
|
28189
28138
|
// src/core/prepare.ts
|
|
28190
28139
|
init_loadConfig();
|
|
28191
28140
|
import { existsSync as existsSync36, readdirSync as readdirSync7, readFileSync as readFileSync28 } from "fs";
|
|
28192
|
-
import { basename as basename15, join as join44, relative as relative17, resolve as
|
|
28141
|
+
import { basename as basename15, join as join44, relative as relative17, resolve as resolve45 } from "path";
|
|
28193
28142
|
import { Elysia as Elysia5 } from "elysia";
|
|
28194
28143
|
|
|
28195
28144
|
// src/core/loadIslandRegistry.ts
|
|
@@ -28551,7 +28500,7 @@ var collectPrewarmFiles = async (prewarmDirs) => {
|
|
|
28551
28500
|
for (const { dir, pattern } of prewarmDirs) {
|
|
28552
28501
|
const glob = new Glob11(pattern);
|
|
28553
28502
|
const matches = [
|
|
28554
|
-
...glob.scanSync({ absolute: true, cwd:
|
|
28503
|
+
...glob.scanSync({ absolute: true, cwd: resolve45(dir) })
|
|
28555
28504
|
];
|
|
28556
28505
|
files.push(...matches);
|
|
28557
28506
|
}
|
|
@@ -28587,7 +28536,7 @@ var patchManifestIndexes = (manifest, devIndexDir, SRC_URL_PREFIX2) => {
|
|
|
28587
28536
|
const fileName = resolveDevIndexFileName(manifest[key], baseName);
|
|
28588
28537
|
if (!fileName)
|
|
28589
28538
|
continue;
|
|
28590
|
-
const srcPath =
|
|
28539
|
+
const srcPath = resolve45(devIndexDir, fileName);
|
|
28591
28540
|
if (!existsSync36(srcPath))
|
|
28592
28541
|
continue;
|
|
28593
28542
|
const rel = relative17(process.cwd(), srcPath).replace(/\\/g, "/");
|
|
@@ -28660,7 +28609,7 @@ var prepareDev = async (config, buildDir) => {
|
|
|
28660
28609
|
stepStartedAt = performance.now();
|
|
28661
28610
|
const hmrPlugin = hmr2(result.hmrState, result.manifest, moduleHandler);
|
|
28662
28611
|
const { devtoolsJson: devtoolsJson2 } = await Promise.resolve().then(() => (init_devtoolsJson(), exports_devtoolsJson));
|
|
28663
|
-
const devIndexDir =
|
|
28612
|
+
const devIndexDir = resolve45(buildDir, "_src_indexes");
|
|
28664
28613
|
patchManifestIndexes(result.manifest, devIndexDir, SRC_URL_PREFIX2);
|
|
28665
28614
|
recordStep("configure dev plugins", stepStartedAt);
|
|
28666
28615
|
stepStartedAt = performance.now();
|
|
@@ -28752,7 +28701,7 @@ var prepare = async (configOrPath) => {
|
|
|
28752
28701
|
recordStep("load config", stepStartedAt);
|
|
28753
28702
|
const nodeEnv = process.env["NODE_ENV"];
|
|
28754
28703
|
const isDev3 = nodeEnv === "development";
|
|
28755
|
-
const buildDir =
|
|
28704
|
+
const buildDir = resolve45(process.env.ABSOLUTE_BUILD_DIR ?? config.buildDirectory ?? "build");
|
|
28756
28705
|
if (isDev3) {
|
|
28757
28706
|
stepStartedAt = performance.now();
|
|
28758
28707
|
const result = await prepareDev(config, buildDir);
|
|
@@ -29227,7 +29176,7 @@ var generateHeadElement = ({
|
|
|
29227
29176
|
// src/utils/defineEnv.ts
|
|
29228
29177
|
var {env: bunEnv } = globalThis.Bun;
|
|
29229
29178
|
import { existsSync as existsSync39, readFileSync as readFileSync30 } from "fs";
|
|
29230
|
-
import { resolve as
|
|
29179
|
+
import { resolve as resolve47 } from "path";
|
|
29231
29180
|
|
|
29232
29181
|
// node_modules/@sinclair/typebox/build/esm/type/guard/value.mjs
|
|
29233
29182
|
var exports_value = {};
|
|
@@ -35262,7 +35211,7 @@ ${lines.join(`
|
|
|
35262
35211
|
};
|
|
35263
35212
|
var checkEnvFileSecurity = (properties) => {
|
|
35264
35213
|
const cwd2 = process.cwd();
|
|
35265
|
-
const envPath =
|
|
35214
|
+
const envPath = resolve47(cwd2, ".env");
|
|
35266
35215
|
if (!existsSync39(envPath))
|
|
35267
35216
|
return;
|
|
35268
35217
|
const sensitiveKeys = Object.keys(properties).filter(isSensitive);
|
|
@@ -35272,7 +35221,7 @@ var checkEnvFileSecurity = (properties) => {
|
|
|
35272
35221
|
const presentKeys = sensitiveKeys.filter((key) => envContent.includes(`${key}=`));
|
|
35273
35222
|
if (presentKeys.length === 0)
|
|
35274
35223
|
return;
|
|
35275
|
-
const gitignorePath =
|
|
35224
|
+
const gitignorePath = resolve47(cwd2, ".gitignore");
|
|
35276
35225
|
if (existsSync39(gitignorePath)) {
|
|
35277
35226
|
const gitignore = readFileSync30(gitignorePath, "utf-8");
|
|
35278
35227
|
if (gitignore.split(`
|
|
@@ -35515,5 +35464,5 @@ export {
|
|
|
35515
35464
|
ANGULAR_INIT_TIMEOUT_MS
|
|
35516
35465
|
};
|
|
35517
35466
|
|
|
35518
|
-
//# debugId=
|
|
35467
|
+
//# debugId=BC09861E4889D03064756E2164756E21
|
|
35519
35468
|
//# sourceMappingURL=index.js.map
|