@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/build.js
CHANGED
|
@@ -11558,7 +11558,7 @@ var init_validateSafePath = () => {};
|
|
|
11558
11558
|
|
|
11559
11559
|
// src/build/scanAngularHandlerCalls.ts
|
|
11560
11560
|
import { readdirSync as readdirSync2, readFileSync as readFileSync12 } from "fs";
|
|
11561
|
-
import {
|
|
11561
|
+
import { join as join22 } from "path";
|
|
11562
11562
|
import ts6 from "typescript";
|
|
11563
11563
|
var ELYSIA_ROUTE_METHODS2, SKIP_DIRS2, SOURCE_EXTENSIONS2, getScriptKind2 = (filePath) => {
|
|
11564
11564
|
if (filePath.endsWith(".tsx"))
|
|
@@ -11598,86 +11598,7 @@ var ELYSIA_ROUTE_METHODS2, SKIP_DIRS2, SOURCE_EXTENSIONS2, getScriptKind2 = (fil
|
|
|
11598
11598
|
}
|
|
11599
11599
|
}
|
|
11600
11600
|
return out;
|
|
11601
|
-
}, fileMayContainAngularHandler = (source) => source.includes("handleAngularPageRequest"),
|
|
11602
|
-
const map = new Map;
|
|
11603
|
-
const fileDir = dirname11(filePath);
|
|
11604
|
-
const recordSpec = (localName, spec) => {
|
|
11605
|
-
map.set(localName, spec);
|
|
11606
|
-
};
|
|
11607
|
-
const resolveSource = (specifier) => {
|
|
11608
|
-
if (specifier.startsWith(".")) {
|
|
11609
|
-
return resolve19(fileDir, specifier);
|
|
11610
|
-
}
|
|
11611
|
-
if (isAbsolute3(specifier)) {
|
|
11612
|
-
return specifier;
|
|
11613
|
-
}
|
|
11614
|
-
return null;
|
|
11615
|
-
};
|
|
11616
|
-
for (const statement of sf.statements) {
|
|
11617
|
-
if (!ts6.isImportDeclaration(statement))
|
|
11618
|
-
continue;
|
|
11619
|
-
if (!ts6.isStringLiteral(statement.moduleSpecifier))
|
|
11620
|
-
continue;
|
|
11621
|
-
if (statement.importClause?.isTypeOnly)
|
|
11622
|
-
continue;
|
|
11623
|
-
const source = statement.moduleSpecifier.text;
|
|
11624
|
-
const resolvedAbsPath = resolveSource(source);
|
|
11625
|
-
const clause = statement.importClause;
|
|
11626
|
-
if (!clause)
|
|
11627
|
-
continue;
|
|
11628
|
-
if (clause.name) {
|
|
11629
|
-
recordSpec(clause.name.text, {
|
|
11630
|
-
importedName: "default",
|
|
11631
|
-
isDefault: true,
|
|
11632
|
-
localName: clause.name.text,
|
|
11633
|
-
resolvedAbsPath,
|
|
11634
|
-
source
|
|
11635
|
-
});
|
|
11636
|
-
}
|
|
11637
|
-
const bindings = clause.namedBindings;
|
|
11638
|
-
if (!bindings)
|
|
11639
|
-
continue;
|
|
11640
|
-
if (ts6.isNamespaceImport(bindings)) {
|
|
11641
|
-
recordSpec(bindings.name.text, {
|
|
11642
|
-
importedName: "*",
|
|
11643
|
-
isDefault: false,
|
|
11644
|
-
localName: bindings.name.text,
|
|
11645
|
-
resolvedAbsPath,
|
|
11646
|
-
source
|
|
11647
|
-
});
|
|
11648
|
-
continue;
|
|
11649
|
-
}
|
|
11650
|
-
for (const element of bindings.elements) {
|
|
11651
|
-
if (element.isTypeOnly)
|
|
11652
|
-
continue;
|
|
11653
|
-
const localName = element.name.text;
|
|
11654
|
-
const importedName = element.propertyName?.text ?? localName;
|
|
11655
|
-
recordSpec(localName, {
|
|
11656
|
-
importedName,
|
|
11657
|
-
isDefault: false,
|
|
11658
|
-
localName,
|
|
11659
|
-
resolvedAbsPath,
|
|
11660
|
-
source
|
|
11661
|
-
});
|
|
11662
|
-
}
|
|
11663
|
-
}
|
|
11664
|
-
return map;
|
|
11665
|
-
}, collectExpressionIdentifiers = (expr) => {
|
|
11666
|
-
const out = new Set;
|
|
11667
|
-
const visit = (node) => {
|
|
11668
|
-
if (ts6.isIdentifier(node)) {
|
|
11669
|
-
out.add(node.text);
|
|
11670
|
-
return;
|
|
11671
|
-
}
|
|
11672
|
-
if (ts6.isPropertyAccessExpression(node)) {
|
|
11673
|
-
visit(node.expression);
|
|
11674
|
-
return;
|
|
11675
|
-
}
|
|
11676
|
-
ts6.forEachChild(node, visit);
|
|
11677
|
-
};
|
|
11678
|
-
visit(expr);
|
|
11679
|
-
return out;
|
|
11680
|
-
}, extractManifestKey = (pagePathValue) => {
|
|
11601
|
+
}, fileMayContainAngularHandler = (source) => source.includes("handleAngularPageRequest"), extractManifestKey = (pagePathValue) => {
|
|
11681
11602
|
if (!ts6.isCallExpression(pagePathValue))
|
|
11682
11603
|
return null;
|
|
11683
11604
|
const callee = pagePathValue.expression;
|
|
@@ -11714,13 +11635,11 @@ var ELYSIA_ROUTE_METHODS2, SKIP_DIRS2, SOURCE_EXTENSIONS2, getScriptKind2 = (fil
|
|
|
11714
11635
|
if (!fileMayContainAngularHandler(source))
|
|
11715
11636
|
return;
|
|
11716
11637
|
const sf = ts6.createSourceFile(filePath, source, ts6.ScriptTarget.Latest, true, getScriptKind2(filePath));
|
|
11717
|
-
const imports = collectFileImports(sf, filePath);
|
|
11718
11638
|
const visit = (node) => {
|
|
11719
11639
|
if (ts6.isCallExpression(node) && ts6.isIdentifier(node.expression) && node.expression.text === "handleAngularPageRequest") {
|
|
11720
11640
|
const [arg] = node.arguments;
|
|
11721
11641
|
if (arg && ts6.isObjectLiteralExpression(arg)) {
|
|
11722
11642
|
let manifestKey = null;
|
|
11723
|
-
let providersExpr = null;
|
|
11724
11643
|
for (const prop of arg.properties) {
|
|
11725
11644
|
if (ts6.isPropertyAssignment(prop)) {
|
|
11726
11645
|
if (!prop.name)
|
|
@@ -11728,8 +11647,6 @@ var ELYSIA_ROUTE_METHODS2, SKIP_DIRS2, SOURCE_EXTENSIONS2, getScriptKind2 = (fil
|
|
|
11728
11647
|
const name = ts6.isIdentifier(prop.name) ? prop.name.text : ts6.isStringLiteral(prop.name) ? prop.name.text : null;
|
|
11729
11648
|
if (name === "pagePath") {
|
|
11730
11649
|
manifestKey = extractManifestKey(prop.initializer);
|
|
11731
|
-
} else if (name === "providers") {
|
|
11732
|
-
providersExpr = prop.initializer;
|
|
11733
11650
|
}
|
|
11734
11651
|
} else if (ts6.isSpreadAssignment(prop)) {
|
|
11735
11652
|
if (manifestKey)
|
|
@@ -11744,22 +11661,9 @@ var ELYSIA_ROUTE_METHODS2, SKIP_DIRS2, SOURCE_EXTENSIONS2, getScriptKind2 = (fil
|
|
|
11744
11661
|
}
|
|
11745
11662
|
}
|
|
11746
11663
|
if (manifestKey) {
|
|
11747
|
-
const providerImports = [];
|
|
11748
|
-
let providersExprText = null;
|
|
11749
|
-
if (providersExpr) {
|
|
11750
|
-
providersExprText = providersExpr.getText(sf);
|
|
11751
|
-
const idents = collectExpressionIdentifiers(providersExpr);
|
|
11752
|
-
for (const ident of idents) {
|
|
11753
|
-
const spec = imports.get(ident);
|
|
11754
|
-
if (spec)
|
|
11755
|
-
providerImports.push(spec);
|
|
11756
|
-
}
|
|
11757
|
-
}
|
|
11758
11664
|
out.push({
|
|
11759
11665
|
manifestKey,
|
|
11760
11666
|
mountPath: findEnclosingMountPath(node),
|
|
11761
|
-
providerImports,
|
|
11762
|
-
providersExpr: providersExprText,
|
|
11763
11667
|
sourceFile: filePath
|
|
11764
11668
|
});
|
|
11765
11669
|
}
|
|
@@ -11923,7 +11827,7 @@ __export(exports_parseAngularConfigImports, {
|
|
|
11923
11827
|
parseAngularProvidersImport: () => parseAngularProvidersImport
|
|
11924
11828
|
});
|
|
11925
11829
|
import { existsSync as existsSync19, readFileSync as readFileSync14 } from "fs";
|
|
11926
|
-
import { dirname as
|
|
11830
|
+
import { dirname as dirname11, isAbsolute as isAbsolute3, join as join24 } from "path";
|
|
11927
11831
|
import ts8 from "typescript";
|
|
11928
11832
|
var findDefineConfigCall = (sf) => {
|
|
11929
11833
|
let result = null;
|
|
@@ -11976,6 +11880,12 @@ var findDefineConfigCall = (sf) => {
|
|
|
11976
11880
|
}
|
|
11977
11881
|
return null;
|
|
11978
11882
|
}, resolveConfigPath = (projectRoot) => {
|
|
11883
|
+
const envOverride = process.env.ABSOLUTE_CONFIG;
|
|
11884
|
+
if (envOverride) {
|
|
11885
|
+
const resolved = isAbsolute3(envOverride) ? envOverride : join24(projectRoot, envOverride);
|
|
11886
|
+
if (existsSync19(resolved))
|
|
11887
|
+
return resolved;
|
|
11888
|
+
}
|
|
11979
11889
|
const candidates = [
|
|
11980
11890
|
join24(projectRoot, "absolute.config.ts"),
|
|
11981
11891
|
join24(projectRoot, "absolute.config.mts"),
|
|
@@ -12012,8 +11922,8 @@ var findDefineConfigCall = (sf) => {
|
|
|
12012
11922
|
const importInfo = findImportForBinding(sf, binding);
|
|
12013
11923
|
if (!importInfo)
|
|
12014
11924
|
return null;
|
|
12015
|
-
const configDir2 =
|
|
12016
|
-
const absolutePath = importInfo.source.startsWith(".") ? join24(configDir2, importInfo.source).replace(/\.[cm]?[tj]sx?$/, "") :
|
|
11925
|
+
const configDir2 = dirname11(configPath2);
|
|
11926
|
+
const absolutePath = importInfo.source.startsWith(".") ? join24(configDir2, importInfo.source).replace(/\.[cm]?[tj]sx?$/, "") : isAbsolute3(importInfo.source) ? importInfo.source.replace(/\.[cm]?[tj]sx?$/, "") : importInfo.source;
|
|
12017
11927
|
return {
|
|
12018
11928
|
absolutePath,
|
|
12019
11929
|
bindingName: binding,
|
|
@@ -12164,11 +12074,11 @@ __export(exports_compileSvelte, {
|
|
|
12164
12074
|
import { existsSync as existsSync20 } from "fs";
|
|
12165
12075
|
import { mkdir as mkdir4, stat as stat2 } from "fs/promises";
|
|
12166
12076
|
import {
|
|
12167
|
-
dirname as
|
|
12077
|
+
dirname as dirname12,
|
|
12168
12078
|
join as join25,
|
|
12169
12079
|
basename as basename6,
|
|
12170
12080
|
extname as extname5,
|
|
12171
|
-
resolve as
|
|
12081
|
+
resolve as resolve19,
|
|
12172
12082
|
relative as relative9,
|
|
12173
12083
|
sep as sep2
|
|
12174
12084
|
} from "path";
|
|
@@ -12176,14 +12086,14 @@ import { env } from "process";
|
|
|
12176
12086
|
var {write: write2, file, Transpiler: Transpiler2 } = globalThis.Bun;
|
|
12177
12087
|
var resolveDevClientDir2 = () => {
|
|
12178
12088
|
const projectRoot = process.cwd();
|
|
12179
|
-
const fromSource =
|
|
12089
|
+
const fromSource = resolve19(import.meta.dir, "../dev/client");
|
|
12180
12090
|
if (existsSync20(fromSource) && fromSource.startsWith(projectRoot)) {
|
|
12181
12091
|
return fromSource;
|
|
12182
12092
|
}
|
|
12183
|
-
const fromNodeModules =
|
|
12093
|
+
const fromNodeModules = resolve19(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client");
|
|
12184
12094
|
if (existsSync20(fromNodeModules))
|
|
12185
12095
|
return fromNodeModules;
|
|
12186
|
-
return
|
|
12096
|
+
return resolve19(import.meta.dir, "./dev/client");
|
|
12187
12097
|
}, devClientDir2, hmrClientPath3, persistentCache, sourceHashCache, clearSvelteCompilerCache = () => {
|
|
12188
12098
|
persistentCache.clear();
|
|
12189
12099
|
sourceHashCache.clear();
|
|
@@ -12213,7 +12123,7 @@ var resolveDevClientDir2 = () => {
|
|
|
12213
12123
|
}, resolveRelativeModule2 = async (spec, from) => {
|
|
12214
12124
|
if (!spec.startsWith("."))
|
|
12215
12125
|
return null;
|
|
12216
|
-
const basePath =
|
|
12126
|
+
const basePath = resolve19(dirname12(from), spec);
|
|
12217
12127
|
const candidates = [
|
|
12218
12128
|
basePath,
|
|
12219
12129
|
`${basePath}.ts`,
|
|
@@ -12240,7 +12150,7 @@ var resolveDevClientDir2 = () => {
|
|
|
12240
12150
|
const resolved = resolvePackageImport(spec);
|
|
12241
12151
|
return resolved && /\.svelte(\.(?:ts|js))?$/.test(resolved) ? resolved : null;
|
|
12242
12152
|
}
|
|
12243
|
-
const basePath =
|
|
12153
|
+
const basePath = resolve19(dirname12(from), spec);
|
|
12244
12154
|
const explicit = /\.(svelte|svelte\.(?:ts|js))$/.test(basePath);
|
|
12245
12155
|
if (!explicit) {
|
|
12246
12156
|
const extensions = [".svelte", ".svelte.ts", ".svelte.js"];
|
|
@@ -12300,8 +12210,8 @@ var resolveDevClientDir2 = () => {
|
|
|
12300
12210
|
const preprocessedClient = isModule ? loweredClientSource.code : (await preprocess(loweredClientSource.code, svelteStylePreprocessor)).code;
|
|
12301
12211
|
const transpiledServer = src.endsWith(".ts") || src.endsWith(".svelte.ts") ? transpiler3.transformSync(preprocessedServer) : preprocessedServer;
|
|
12302
12212
|
const transpiledClient = src.endsWith(".ts") || src.endsWith(".svelte.ts") ? transpiler3.transformSync(preprocessedClient) : preprocessedClient;
|
|
12303
|
-
const rawRel =
|
|
12304
|
-
const relDir = rawRel.startsWith("..") ? `_ext/${relative9(process.cwd(),
|
|
12213
|
+
const rawRel = dirname12(relative9(svelteRoot, src)).replace(/\\/g, "/");
|
|
12214
|
+
const relDir = rawRel.startsWith("..") ? `_ext/${relative9(process.cwd(), dirname12(src)).replace(/\\/g, "/")}` : rawRel;
|
|
12305
12215
|
const baseName = basename6(src).replace(/\.svelte(\.(ts|js))?$/, "");
|
|
12306
12216
|
const importPaths = Array.from(transpiledServer.matchAll(/from\s+['"]([^'"]+)['"]/g)).map((match) => match[1]).filter((path) => path !== undefined);
|
|
12307
12217
|
const resolvedModuleImports = await Promise.all(importPaths.map((importPath) => resolveRelativeModule2(importPath, src)));
|
|
@@ -12310,8 +12220,8 @@ var resolveDevClientDir2 = () => {
|
|
|
12310
12220
|
const childBuilt = await Promise.all(childSources.map((child) => build(child)));
|
|
12311
12221
|
const hasAwaitSlotFromChildren = childBuilt.some((child) => child.hasAwaitSlot);
|
|
12312
12222
|
const externalRewrites = new Map;
|
|
12313
|
-
const ssrOutputDir =
|
|
12314
|
-
const clientOutputDir =
|
|
12223
|
+
const ssrOutputDir = dirname12(join25(serverDir, relDir, `${baseName}.js`));
|
|
12224
|
+
const clientOutputDir = dirname12(join25(clientDir, relDir, `${baseName}.js`));
|
|
12315
12225
|
for (let idx = 0;idx < importPaths.length; idx++) {
|
|
12316
12226
|
const rawSpec = importPaths[idx];
|
|
12317
12227
|
if (!rawSpec)
|
|
@@ -12379,8 +12289,8 @@ var resolveDevClientDir2 = () => {
|
|
|
12379
12289
|
const ssrPath = join25(serverDir, relDir, `${baseName}.js`);
|
|
12380
12290
|
const clientPath = join25(clientDir, relDir, `${baseName}.js`);
|
|
12381
12291
|
await Promise.all([
|
|
12382
|
-
mkdir4(
|
|
12383
|
-
mkdir4(
|
|
12292
|
+
mkdir4(dirname12(ssrPath), { recursive: true }),
|
|
12293
|
+
mkdir4(dirname12(clientPath), { recursive: true })
|
|
12384
12294
|
]);
|
|
12385
12295
|
const inlineMap = (map) => map ? `
|
|
12386
12296
|
//# sourceMappingURL=data:application/json;base64,${Buffer.from(JSON.stringify(map)).toString("base64")}
|
|
@@ -12413,10 +12323,10 @@ var resolveDevClientDir2 = () => {
|
|
|
12413
12323
|
};
|
|
12414
12324
|
const roots = await Promise.all(entryPoints.map(build));
|
|
12415
12325
|
await Promise.all(roots.map(async ({ client, hasAwaitSlot }) => {
|
|
12416
|
-
const relClientDir =
|
|
12326
|
+
const relClientDir = dirname12(relative9(clientDir, client));
|
|
12417
12327
|
const name = basename6(client, extname5(client));
|
|
12418
12328
|
const indexPath = join25(indexDir, relClientDir, `${name}.js`);
|
|
12419
|
-
const importRaw = relative9(
|
|
12329
|
+
const importRaw = relative9(dirname12(indexPath), client).split(sep2).join("/");
|
|
12420
12330
|
const importPath = importRaw.startsWith(".") || importRaw.startsWith("/") ? importRaw : `./${importRaw}`;
|
|
12421
12331
|
const hmrImports = isDev ? `window.__HMR_FRAMEWORK__ = "svelte";
|
|
12422
12332
|
import "${hmrClientPath3}";
|
|
@@ -12487,13 +12397,13 @@ if (typeof window !== "undefined") {
|
|
|
12487
12397
|
setTimeout(releaseStreamingSlots, 0);
|
|
12488
12398
|
}
|
|
12489
12399
|
}`;
|
|
12490
|
-
await mkdir4(
|
|
12400
|
+
await mkdir4(dirname12(indexPath), { recursive: true });
|
|
12491
12401
|
return write2(indexPath, bootstrap);
|
|
12492
12402
|
}));
|
|
12493
12403
|
return {
|
|
12494
12404
|
svelteClientPaths: roots.map(({ client }) => client),
|
|
12495
12405
|
svelteIndexPaths: roots.map(({ client }) => {
|
|
12496
|
-
const rel =
|
|
12406
|
+
const rel = dirname12(relative9(clientDir, client));
|
|
12497
12407
|
return join25(indexDir, rel, basename6(client));
|
|
12498
12408
|
}),
|
|
12499
12409
|
svelteServerPaths: roots.map(({ ssr }) => ssr)
|
|
@@ -12905,23 +12815,23 @@ import { existsSync as existsSync21 } from "fs";
|
|
|
12905
12815
|
import { mkdir as mkdir5 } from "fs/promises";
|
|
12906
12816
|
import {
|
|
12907
12817
|
basename as basename7,
|
|
12908
|
-
dirname as
|
|
12909
|
-
isAbsolute as
|
|
12818
|
+
dirname as dirname13,
|
|
12819
|
+
isAbsolute as isAbsolute4,
|
|
12910
12820
|
join as join26,
|
|
12911
12821
|
relative as relative10,
|
|
12912
|
-
resolve as
|
|
12822
|
+
resolve as resolve20
|
|
12913
12823
|
} from "path";
|
|
12914
12824
|
var {file: file2, write: write3, Transpiler: Transpiler3 } = globalThis.Bun;
|
|
12915
12825
|
var resolveDevClientDir3 = () => {
|
|
12916
12826
|
const projectRoot = process.cwd();
|
|
12917
|
-
const fromSource =
|
|
12827
|
+
const fromSource = resolve20(import.meta.dir, "../dev/client");
|
|
12918
12828
|
if (existsSync21(fromSource) && fromSource.startsWith(projectRoot)) {
|
|
12919
12829
|
return fromSource;
|
|
12920
12830
|
}
|
|
12921
|
-
const fromNodeModules =
|
|
12831
|
+
const fromNodeModules = resolve20(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client");
|
|
12922
12832
|
if (existsSync21(fromNodeModules))
|
|
12923
12833
|
return fromNodeModules;
|
|
12924
|
-
return
|
|
12834
|
+
return resolve20(import.meta.dir, "./dev/client");
|
|
12925
12835
|
}, devClientDir3, hmrClientPath4, transpiler4, scriptCache, scriptSetupCache, templateCache, styleCache, persistentBuildCache, vueSourceHashCache, vueHmrMetadata, clearVueHmrCaches = () => {
|
|
12926
12836
|
scriptCache.clear();
|
|
12927
12837
|
scriptSetupCache.clear();
|
|
@@ -12967,7 +12877,7 @@ var resolveDevClientDir3 = () => {
|
|
|
12967
12877
|
return filePath.replace(/\.ts$/, ".js");
|
|
12968
12878
|
if (isStylePath(filePath)) {
|
|
12969
12879
|
if (sourceDir && (filePath.startsWith("./") || filePath.startsWith("../"))) {
|
|
12970
|
-
return
|
|
12880
|
+
return resolve20(sourceDir, filePath);
|
|
12971
12881
|
}
|
|
12972
12882
|
return filePath;
|
|
12973
12883
|
}
|
|
@@ -13031,12 +12941,12 @@ var resolveDevClientDir3 = () => {
|
|
|
13031
12941
|
const childComponentPaths = importPaths.filter((path) => path.startsWith(".") && path.endsWith(".vue"));
|
|
13032
12942
|
const packageComponentPaths = Array.from(resolvedPackageVueImports.entries());
|
|
13033
12943
|
const helperModulePaths = importPaths.filter((path) => path.startsWith(".") && !path.endsWith(".vue") && !isStylePath(path));
|
|
13034
|
-
const stylePathsImported = importPaths.filter((path) => (path.startsWith(".") ||
|
|
12944
|
+
const stylePathsImported = importPaths.filter((path) => (path.startsWith(".") || isAbsolute4(path)) && isStylePath(path)).map((path) => isAbsolute4(path) ? path : resolve20(dirname13(sourceFilePath), path));
|
|
13035
12945
|
for (const stylePath of stylePathsImported) {
|
|
13036
12946
|
addStyleImporter(sourceFilePath, stylePath);
|
|
13037
12947
|
}
|
|
13038
12948
|
const childBuildResults = await Promise.all([
|
|
13039
|
-
...childComponentPaths.map((relativeChildPath) => compileVueFile(
|
|
12949
|
+
...childComponentPaths.map((relativeChildPath) => compileVueFile(resolve20(dirname13(sourceFilePath), relativeChildPath), outputDirs, cacheMap, false, vueRootDir, compiler, stylePreprocessors)),
|
|
13040
12950
|
...packageComponentPaths.map(([, absolutePath]) => compileVueFile(absolutePath, outputDirs, cacheMap, false, vueRootDir, compiler, stylePreprocessors))
|
|
13041
12951
|
]);
|
|
13042
12952
|
const hasScript = descriptor.script || descriptor.scriptSetup;
|
|
@@ -13046,7 +12956,7 @@ var resolveDevClientDir3 = () => {
|
|
|
13046
12956
|
sourceMap: true
|
|
13047
12957
|
}) : { bindings: {}, content: "export default {};", map: undefined };
|
|
13048
12958
|
const strippedScript = stripExports2(compiledScript.content);
|
|
13049
|
-
const sourceDir =
|
|
12959
|
+
const sourceDir = dirname13(sourceFilePath);
|
|
13050
12960
|
const transpiledScript = transpiler4.transformSync(strippedScript).replace(/(['"])(\.{1,2}\/[^'"]+)(['"])/g, (_2, quoteStart, relativeImport, quoteEnd) => `${quoteStart}${toJs(relativeImport, sourceDir)}${quoteEnd}`);
|
|
13051
12961
|
const packageImportRewrites = new Map;
|
|
13052
12962
|
for (const [bareImport, absolutePath] of packageComponentPaths) {
|
|
@@ -13086,7 +12996,7 @@ var resolveDevClientDir3 = () => {
|
|
|
13086
12996
|
let cssOutputPaths = [];
|
|
13087
12997
|
if (isEntryPoint && allCss.length) {
|
|
13088
12998
|
const cssOutputFile = join26(outputDirs.css, `${toKebab(fileBaseName)}-compiled.css`);
|
|
13089
|
-
await mkdir5(
|
|
12999
|
+
await mkdir5(dirname13(cssOutputFile), { recursive: true });
|
|
13090
13000
|
await write3(cssOutputFile, allCss.join(`
|
|
13091
13001
|
`));
|
|
13092
13002
|
cssOutputPaths = [cssOutputFile];
|
|
@@ -13118,7 +13028,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
13118
13028
|
const serverCode = assembleModule(generateRenderFunction(true), "ssrRender", false) + islandMetadataExports;
|
|
13119
13029
|
const clientOutputPath = join26(outputDirs.client, `${relativeWithoutExtension}.js`);
|
|
13120
13030
|
const serverOutputPath = join26(outputDirs.server, `${relativeWithoutExtension}.js`);
|
|
13121
|
-
const relDir =
|
|
13031
|
+
const relDir = dirname13(relativeFilePath);
|
|
13122
13032
|
const relDepth = relDir === "." ? 0 : relDir.split("/").length;
|
|
13123
13033
|
const adjustImports = (code) => code.replace(/(from\s+['"])(\.\.\/(?:\.\.\/)*)/g, (_2, prefix, dots) => {
|
|
13124
13034
|
const upCount = dots.split("/").length - 1;
|
|
@@ -13130,15 +13040,15 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
13130
13040
|
let result2 = code;
|
|
13131
13041
|
for (const [bareImport, paths] of packageImportRewrites) {
|
|
13132
13042
|
const targetPath = mode === "server" ? paths.server : paths.client;
|
|
13133
|
-
let rel = relative10(
|
|
13043
|
+
let rel = relative10(dirname13(outputPath), targetPath).replace(/\\/g, "/");
|
|
13134
13044
|
if (!rel.startsWith("."))
|
|
13135
13045
|
rel = `./${rel}`;
|
|
13136
13046
|
result2 = result2.replaceAll(bareImport, rel);
|
|
13137
13047
|
}
|
|
13138
13048
|
return result2;
|
|
13139
13049
|
};
|
|
13140
|
-
await mkdir5(
|
|
13141
|
-
await mkdir5(
|
|
13050
|
+
await mkdir5(dirname13(clientOutputPath), { recursive: true });
|
|
13051
|
+
await mkdir5(dirname13(serverOutputPath), { recursive: true });
|
|
13142
13052
|
const clientFinal = rewritePackageImports(adjustImports(clientCode), clientOutputPath, "client");
|
|
13143
13053
|
const serverFinal = rewritePackageImports(adjustImports(serverCode), serverOutputPath, "server");
|
|
13144
13054
|
const inlineSourceMapFor = (finalContent) => {
|
|
@@ -13160,7 +13070,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
13160
13070
|
hmrId,
|
|
13161
13071
|
serverPath: serverOutputPath,
|
|
13162
13072
|
tsHelperPaths: [
|
|
13163
|
-
...helperModulePaths.map((helper) =>
|
|
13073
|
+
...helperModulePaths.map((helper) => resolve20(dirname13(sourceFilePath), helper.endsWith(".ts") ? helper : `${helper}.ts`)),
|
|
13164
13074
|
...childBuildResults.flatMap((child) => child.tsHelperPaths)
|
|
13165
13075
|
]
|
|
13166
13076
|
};
|
|
@@ -13183,7 +13093,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
13183
13093
|
const buildCache = new Map;
|
|
13184
13094
|
const allTsHelperPaths = new Set;
|
|
13185
13095
|
const compiledPages = await Promise.all(entryPoints.map(async (entryPath) => {
|
|
13186
|
-
const result = await compileVueFile(
|
|
13096
|
+
const result = await compileVueFile(resolve20(entryPath), {
|
|
13187
13097
|
client: clientOutputDir,
|
|
13188
13098
|
css: cssOutputDir,
|
|
13189
13099
|
server: serverOutputDir
|
|
@@ -13192,14 +13102,14 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
13192
13102
|
const entryBaseName = basename7(entryPath, ".vue");
|
|
13193
13103
|
const indexOutputFile = join26(indexOutputDir, `${entryBaseName}.js`);
|
|
13194
13104
|
const clientOutputFile = join26(clientOutputDir, relative10(vueRootDir, entryPath).replace(/\\/g, "/").replace(/\.vue$/, ".js"));
|
|
13195
|
-
await mkdir5(
|
|
13105
|
+
await mkdir5(dirname13(indexOutputFile), { recursive: true });
|
|
13196
13106
|
const vueHmrImports = isDev ? [
|
|
13197
13107
|
`window.__HMR_FRAMEWORK__ = "vue";`,
|
|
13198
13108
|
`import "${hmrClientPath4}";`
|
|
13199
13109
|
] : [];
|
|
13200
13110
|
await write3(indexOutputFile, [
|
|
13201
13111
|
...vueHmrImports,
|
|
13202
|
-
`import Comp, * as PageModule from "${relative10(
|
|
13112
|
+
`import Comp, * as PageModule from "${relative10(dirname13(indexOutputFile), clientOutputFile).replace(/\\/g, "/")}";`,
|
|
13203
13113
|
'import { createSSRApp, createApp } from "vue";',
|
|
13204
13114
|
"",
|
|
13205
13115
|
"// HMR State Preservation: Check for preserved state from HMR",
|
|
@@ -13346,8 +13256,8 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
13346
13256
|
const relativeJsPath = relative10(vueRootDir, tsPath).replace(/\.ts$/, ".js");
|
|
13347
13257
|
const outClientPath = join26(clientOutputDir, relativeJsPath);
|
|
13348
13258
|
const outServerPath = join26(serverOutputDir, relativeJsPath);
|
|
13349
|
-
await mkdir5(
|
|
13350
|
-
await mkdir5(
|
|
13259
|
+
await mkdir5(dirname13(outClientPath), { recursive: true });
|
|
13260
|
+
await mkdir5(dirname13(outServerPath), { recursive: true });
|
|
13351
13261
|
await write3(outClientPath, transpiledCode);
|
|
13352
13262
|
await write3(outServerPath, transpiledCode);
|
|
13353
13263
|
}));
|
|
@@ -13850,7 +13760,7 @@ __export(exports_compileAngular, {
|
|
|
13850
13760
|
compileAngular: () => compileAngular
|
|
13851
13761
|
});
|
|
13852
13762
|
import { existsSync as existsSync22, readFileSync as readFileSync16, promises as fs5 } from "fs";
|
|
13853
|
-
import { join as join27, basename as basename8, sep as sep3, dirname as
|
|
13763
|
+
import { join as join27, basename as basename8, sep as sep3, dirname as dirname14, resolve as resolve21, relative as relative11 } from "path";
|
|
13854
13764
|
var {Glob: Glob6 } = globalThis.Bun;
|
|
13855
13765
|
import ts9 from "typescript";
|
|
13856
13766
|
var traceAngularPhase = async (name, fn2, metadata) => {
|
|
@@ -13858,10 +13768,10 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
13858
13768
|
return tracePhase ? tracePhase(`compile/angular/${name}`, fn2, metadata) : await fn2();
|
|
13859
13769
|
}, readTsconfigPathAliases = () => {
|
|
13860
13770
|
try {
|
|
13861
|
-
const configPath2 =
|
|
13771
|
+
const configPath2 = resolve21(process.cwd(), "tsconfig.json");
|
|
13862
13772
|
const config = ts9.readConfigFile(configPath2, ts9.sys.readFile).config;
|
|
13863
13773
|
const compilerOptions = config?.compilerOptions ?? {};
|
|
13864
|
-
const baseUrl =
|
|
13774
|
+
const baseUrl = resolve21(process.cwd(), compilerOptions.baseUrl ?? ".");
|
|
13865
13775
|
const aliases = Object.entries(compilerOptions.paths ?? {}).map(([pattern, replacements]) => ({ pattern, replacements }));
|
|
13866
13776
|
return { aliases, baseUrl };
|
|
13867
13777
|
} catch {
|
|
@@ -13881,7 +13791,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
13881
13791
|
const wildcardValue = exactMatch ? "" : specifier.slice(prefix.length, specifier.length - suffix.length);
|
|
13882
13792
|
for (const replacement of alias.replacements) {
|
|
13883
13793
|
const candidate = replacement.replace("*", wildcardValue);
|
|
13884
|
-
const resolved = resolveSourceFile(
|
|
13794
|
+
const resolved = resolveSourceFile(resolve21(baseUrl, candidate));
|
|
13885
13795
|
if (resolved)
|
|
13886
13796
|
return resolved;
|
|
13887
13797
|
}
|
|
@@ -13900,13 +13810,13 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
13900
13810
|
];
|
|
13901
13811
|
return candidates.find((file3) => existsSync22(file3));
|
|
13902
13812
|
}, createLegacyAngularAnimationUsageResolver = (rootDir) => {
|
|
13903
|
-
const baseDir =
|
|
13813
|
+
const baseDir = resolve21(rootDir);
|
|
13904
13814
|
const tsconfigAliases = readTsconfigPathAliases();
|
|
13905
13815
|
const transpiler5 = new Bun.Transpiler({ loader: "tsx" });
|
|
13906
13816
|
const scanCache = new Map;
|
|
13907
13817
|
const resolveLocalImport = (specifier, fromDir) => {
|
|
13908
13818
|
if (specifier.startsWith(".") || specifier.startsWith("/")) {
|
|
13909
|
-
return resolveSourceFile(
|
|
13819
|
+
return resolveSourceFile(resolve21(fromDir, specifier));
|
|
13910
13820
|
}
|
|
13911
13821
|
const aliased = matchTsconfigAlias(specifier, tsconfigAliases.aliases, tsconfigAliases.baseUrl, resolveSourceFile);
|
|
13912
13822
|
if (aliased)
|
|
@@ -13915,7 +13825,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
13915
13825
|
const resolved = Bun.resolveSync(specifier, fromDir);
|
|
13916
13826
|
if (resolved.includes("/node_modules/"))
|
|
13917
13827
|
return;
|
|
13918
|
-
const absolute =
|
|
13828
|
+
const absolute = resolve21(resolved);
|
|
13919
13829
|
if (!absolute.startsWith(baseDir))
|
|
13920
13830
|
return;
|
|
13921
13831
|
return resolveSourceFile(absolute);
|
|
@@ -13931,7 +13841,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
13931
13841
|
usesLegacyAnimations: false
|
|
13932
13842
|
});
|
|
13933
13843
|
}
|
|
13934
|
-
const resolved =
|
|
13844
|
+
const resolved = resolve21(actualPath);
|
|
13935
13845
|
const cached = scanCache.get(resolved);
|
|
13936
13846
|
if (cached)
|
|
13937
13847
|
return cached;
|
|
@@ -13960,7 +13870,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
13960
13870
|
const actualPath = resolveSourceFile(filePath);
|
|
13961
13871
|
if (!actualPath)
|
|
13962
13872
|
return false;
|
|
13963
|
-
const resolved =
|
|
13873
|
+
const resolved = resolve21(actualPath);
|
|
13964
13874
|
if (visited.has(resolved))
|
|
13965
13875
|
return false;
|
|
13966
13876
|
visited.add(resolved);
|
|
@@ -13968,7 +13878,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
13968
13878
|
if (scan.usesLegacyAnimations)
|
|
13969
13879
|
return true;
|
|
13970
13880
|
for (const specifier of scan.imports) {
|
|
13971
|
-
const importedPath = resolveLocalImport(specifier,
|
|
13881
|
+
const importedPath = resolveLocalImport(specifier, dirname14(resolved));
|
|
13972
13882
|
if (importedPath && await visit(importedPath, visited)) {
|
|
13973
13883
|
return true;
|
|
13974
13884
|
}
|
|
@@ -13978,14 +13888,14 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
13978
13888
|
return (entryPath) => visit(entryPath);
|
|
13979
13889
|
}, resolveDevClientDir4 = () => {
|
|
13980
13890
|
const projectRoot = process.cwd();
|
|
13981
|
-
const fromSource =
|
|
13891
|
+
const fromSource = resolve21(import.meta.dir, "../dev/client");
|
|
13982
13892
|
if (existsSync22(fromSource) && fromSource.startsWith(projectRoot)) {
|
|
13983
13893
|
return fromSource;
|
|
13984
13894
|
}
|
|
13985
|
-
const fromNodeModules =
|
|
13895
|
+
const fromNodeModules = resolve21(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client");
|
|
13986
13896
|
if (existsSync22(fromNodeModules))
|
|
13987
13897
|
return fromNodeModules;
|
|
13988
|
-
return
|
|
13898
|
+
return resolve21(import.meta.dir, "./dev/client");
|
|
13989
13899
|
}, devClientDir4, hmrClientPath5, formatDiagnosticMessage = (diagnostic) => {
|
|
13990
13900
|
try {
|
|
13991
13901
|
return ts9.flattenDiagnosticMessageText(diagnostic.messageText, `
|
|
@@ -14027,12 +13937,12 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
14027
13937
|
return `${path.replace(/\.ts$/, ".js")}${query}`;
|
|
14028
13938
|
if (hasJsLikeExtension(path))
|
|
14029
13939
|
return `${path}${query}`;
|
|
14030
|
-
const importerDir =
|
|
14031
|
-
const fileCandidate =
|
|
13940
|
+
const importerDir = dirname14(importerOutputPath);
|
|
13941
|
+
const fileCandidate = resolve21(importerDir, `${path}.js`);
|
|
14032
13942
|
if (outputFiles?.has(fileCandidate) || existsSync22(fileCandidate)) {
|
|
14033
13943
|
return `${path}.js${query}`;
|
|
14034
13944
|
}
|
|
14035
|
-
const indexCandidate =
|
|
13945
|
+
const indexCandidate = resolve21(importerDir, path, "index.js");
|
|
14036
13946
|
if (outputFiles?.has(indexCandidate) || existsSync22(indexCandidate)) {
|
|
14037
13947
|
return `${path}/index.js${query}`;
|
|
14038
13948
|
}
|
|
@@ -14060,7 +13970,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
14060
13970
|
}, resolveLocalTsImport = (fromFile, specifier) => {
|
|
14061
13971
|
if (!isRelativeModuleSpecifier(specifier))
|
|
14062
13972
|
return null;
|
|
14063
|
-
const basePath =
|
|
13973
|
+
const basePath = resolve21(dirname14(fromFile), specifier);
|
|
14064
13974
|
const candidates = /\.[cm]?[tj]sx?$/.test(basePath) ? [basePath] : [
|
|
14065
13975
|
`${basePath}.ts`,
|
|
14066
13976
|
`${basePath}.tsx`,
|
|
@@ -14071,7 +13981,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
14071
13981
|
join27(basePath, "index.mts"),
|
|
14072
13982
|
join27(basePath, "index.cts")
|
|
14073
13983
|
];
|
|
14074
|
-
return candidates.map((candidate) =>
|
|
13984
|
+
return candidates.map((candidate) => resolve21(candidate)).find((candidate) => existsSync22(candidate) && !candidate.endsWith(".d.ts")) ?? null;
|
|
14075
13985
|
}, readFileForAotTransform = async (fileName, readFile6) => {
|
|
14076
13986
|
const hostSource = readFile6?.(fileName);
|
|
14077
13987
|
if (typeof hostSource === "string")
|
|
@@ -14106,7 +14016,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
14106
14016
|
paths.push(join27(fileDir, urlMatch.replace(/['"]/g, "")));
|
|
14107
14017
|
}
|
|
14108
14018
|
}
|
|
14109
|
-
return paths.map((path) =>
|
|
14019
|
+
return paths.map((path) => resolve21(path));
|
|
14110
14020
|
}, readResourceCacheFile = async (cachePath) => {
|
|
14111
14021
|
try {
|
|
14112
14022
|
const entry = JSON.parse(await fs5.readFile(cachePath, "utf-8"));
|
|
@@ -14118,13 +14028,13 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
14118
14028
|
return null;
|
|
14119
14029
|
}
|
|
14120
14030
|
}, writeResourceCacheFile = async (cachePath, source) => {
|
|
14121
|
-
await fs5.mkdir(
|
|
14031
|
+
await fs5.mkdir(dirname14(cachePath), { recursive: true });
|
|
14122
14032
|
await fs5.writeFile(cachePath, JSON.stringify({
|
|
14123
14033
|
source,
|
|
14124
14034
|
version: 1
|
|
14125
14035
|
}), "utf-8");
|
|
14126
14036
|
}, resolveResourceTransformCachePath = async (filePath, source, stylePreprocessors) => {
|
|
14127
|
-
const resourcePaths = collectAngularResourcePaths(source,
|
|
14037
|
+
const resourcePaths = collectAngularResourcePaths(source, dirname14(filePath));
|
|
14128
14038
|
const resourceContents = await Promise.all(resourcePaths.map(async (resourcePath) => {
|
|
14129
14039
|
const content = await fs5.readFile(resourcePath, "utf-8");
|
|
14130
14040
|
return `${resourcePath}\x00${content}`;
|
|
@@ -14148,7 +14058,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
14148
14058
|
transformedFiles: 0
|
|
14149
14059
|
};
|
|
14150
14060
|
const transformFile = async (filePath) => {
|
|
14151
|
-
const resolvedPath =
|
|
14061
|
+
const resolvedPath = resolve21(filePath);
|
|
14152
14062
|
if (visited.has(resolvedPath))
|
|
14153
14063
|
return;
|
|
14154
14064
|
visited.add(resolvedPath);
|
|
@@ -14164,7 +14074,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
14164
14074
|
transformedSource = cached.source;
|
|
14165
14075
|
} else {
|
|
14166
14076
|
stats.cacheMisses += 1;
|
|
14167
|
-
const transformed = await inlineResources(source,
|
|
14077
|
+
const transformed = await inlineResources(source, dirname14(resolvedPath), stylePreprocessors);
|
|
14168
14078
|
transformedSource = transformed.source;
|
|
14169
14079
|
await writeResourceCacheFile(cachePath, transformedSource);
|
|
14170
14080
|
}
|
|
@@ -14183,7 +14093,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
14183
14093
|
return { stats, transformedSources };
|
|
14184
14094
|
}, compileAngularFiles = async (inputPaths, outDir, stylePreprocessors) => {
|
|
14185
14095
|
const islandMetadataByOutputPath = await traceAngularPhase("aot/island-metadata", () => new Map(inputPaths.map((inputPath) => {
|
|
14186
|
-
const outputPath =
|
|
14096
|
+
const outputPath = resolve21(join27(outDir, relative11(process.cwd(), resolve21(inputPath)).replace(/\.[cm]?[tj]sx?$/, ".js")));
|
|
14187
14097
|
return [
|
|
14188
14098
|
outputPath,
|
|
14189
14099
|
buildIslandMetadataExports(readFileSync16(inputPath, "utf-8"))
|
|
@@ -14193,8 +14103,8 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
14193
14103
|
const { readConfiguration, performCompilation, EmitFlags } = await traceAngularPhase("aot/import-compiler-cli", () => import("@angular/compiler-cli"));
|
|
14194
14104
|
const tsLibDir = await traceAngularPhase("aot/resolve-typescript-lib", () => {
|
|
14195
14105
|
const tsPath = __require.resolve("typescript");
|
|
14196
|
-
const tsRootDir =
|
|
14197
|
-
return tsRootDir.endsWith("lib") ? tsRootDir :
|
|
14106
|
+
const tsRootDir = dirname14(tsPath);
|
|
14107
|
+
return tsRootDir.endsWith("lib") ? tsRootDir : resolve21(tsRootDir, "lib");
|
|
14198
14108
|
});
|
|
14199
14109
|
const config = await traceAngularPhase("aot/read-configuration", () => readConfiguration("./tsconfig.json"));
|
|
14200
14110
|
const options = {
|
|
@@ -14236,7 +14146,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
14236
14146
|
return originalGetSourceFile?.call(host, fileName, languageVersion, onError);
|
|
14237
14147
|
};
|
|
14238
14148
|
const emitted = {};
|
|
14239
|
-
const resolvedOutDir =
|
|
14149
|
+
const resolvedOutDir = resolve21(outDir);
|
|
14240
14150
|
host.writeFile = (fileName, text) => {
|
|
14241
14151
|
const relativePath = resolveRelativePath(fileName, resolvedOutDir, outDir);
|
|
14242
14152
|
emitted[relativePath] = text;
|
|
@@ -14258,12 +14168,12 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
14258
14168
|
if (!fileName.endsWith(".ts") || fileName.endsWith(".d.ts")) {
|
|
14259
14169
|
return source;
|
|
14260
14170
|
}
|
|
14261
|
-
const resolvedPath =
|
|
14171
|
+
const resolvedPath = resolve21(fileName);
|
|
14262
14172
|
return transformedSources.get(resolvedPath) ?? source;
|
|
14263
14173
|
};
|
|
14264
14174
|
const originalGetSourceFileForCompile = host.getSourceFile;
|
|
14265
14175
|
host.getSourceFile = (fileName, languageVersion, onError) => {
|
|
14266
|
-
const source = transformedSources.get(
|
|
14176
|
+
const source = transformedSources.get(resolve21(fileName));
|
|
14267
14177
|
if (source) {
|
|
14268
14178
|
return ts9.createSourceFile(fileName, source, languageVersion, true);
|
|
14269
14179
|
}
|
|
@@ -14287,7 +14197,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
14287
14197
|
content,
|
|
14288
14198
|
target: join27(outDir, fileName)
|
|
14289
14199
|
}));
|
|
14290
|
-
const outputFiles = new Set(rawEntries.map(({ target }) =>
|
|
14200
|
+
const outputFiles = new Set(rawEntries.map(({ target }) => resolve21(target)));
|
|
14291
14201
|
return rawEntries.map(({ content, target }) => {
|
|
14292
14202
|
let processedContent = content.replace(/from\s+(['"])(\.\.?\/[^'"]+)(\1)/g, (match, quote, path) => {
|
|
14293
14203
|
const rewritten = rewriteRelativeJsSpecifier(target, path, outputFiles);
|
|
@@ -14302,17 +14212,17 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
14302
14212
|
return cleaned ? `import { ${cleaned}, InternalInjectFlags } from '@angular/core'` : `import { InternalInjectFlags } from '@angular/core'`;
|
|
14303
14213
|
});
|
|
14304
14214
|
processedContent = processedContent.replace(/\b(?<!Internal)InjectFlags\b/g, "InternalInjectFlags");
|
|
14305
|
-
processedContent += islandMetadataByOutputPath.get(
|
|
14215
|
+
processedContent += islandMetadataByOutputPath.get(resolve21(target)) ?? "";
|
|
14306
14216
|
return { content: processedContent, target };
|
|
14307
14217
|
});
|
|
14308
14218
|
});
|
|
14309
14219
|
await traceAngularPhase("aot/write-output", () => Promise.all(entries.map(async ({ target, content }) => {
|
|
14310
|
-
await fs5.mkdir(
|
|
14220
|
+
await fs5.mkdir(dirname14(target), { recursive: true });
|
|
14311
14221
|
await fs5.writeFile(target, content, "utf-8");
|
|
14312
14222
|
})), { outputs: entries.length });
|
|
14313
14223
|
return await traceAngularPhase("aot/collect-output-paths", () => entries.map(({ target }) => target), { outputs: entries.length });
|
|
14314
14224
|
}, compileAngularFile = async (inputPath, outDir, stylePreprocessors) => compileAngularFiles([inputPath], outDir, stylePreprocessors), jitContentCache, invalidateAngularJitCache = (filePath) => {
|
|
14315
|
-
jitContentCache.delete(
|
|
14225
|
+
jitContentCache.delete(resolve21(filePath));
|
|
14316
14226
|
}, wrapperOutputCache, escapeTemplateContent = (content) => content.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$\{/g, "\\${"), findUncommentedMatch = (source, pattern) => {
|
|
14317
14227
|
const re2 = new RegExp(pattern.source, pattern.flags.includes("g") ? pattern.flags : pattern.flags + "g");
|
|
14318
14228
|
let match;
|
|
@@ -14325,7 +14235,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
14325
14235
|
}
|
|
14326
14236
|
return null;
|
|
14327
14237
|
}, resolveAngularDeferImportSpecifier = () => {
|
|
14328
|
-
const sourceEntry =
|
|
14238
|
+
const sourceEntry = resolve21(import.meta.dir, "../angular/components/index.ts");
|
|
14329
14239
|
if (existsSync22(sourceEntry)) {
|
|
14330
14240
|
return sourceEntry.replace(/\\/g, "/");
|
|
14331
14241
|
}
|
|
@@ -14555,10 +14465,10 @@ ${fields}
|
|
|
14555
14465
|
source: result
|
|
14556
14466
|
};
|
|
14557
14467
|
}, compileAngularFileJIT = async (inputPath, outDir, rootDir, stylePreprocessors, cacheBuster) => {
|
|
14558
|
-
const entryPath =
|
|
14468
|
+
const entryPath = resolve21(inputPath);
|
|
14559
14469
|
const allOutputs = [];
|
|
14560
14470
|
const visited = new Set;
|
|
14561
|
-
const baseDir =
|
|
14471
|
+
const baseDir = resolve21(rootDir ?? process.cwd());
|
|
14562
14472
|
let usesLegacyAnimations = false;
|
|
14563
14473
|
const angularTranspiler = new Bun.Transpiler({
|
|
14564
14474
|
loader: "ts",
|
|
@@ -14586,7 +14496,7 @@ ${fields}
|
|
|
14586
14496
|
};
|
|
14587
14497
|
const resolveLocalImport = (specifier, fromDir) => {
|
|
14588
14498
|
if (specifier.startsWith(".") || specifier.startsWith("/")) {
|
|
14589
|
-
return resolveSourceFile2(
|
|
14499
|
+
return resolveSourceFile2(resolve21(fromDir, specifier));
|
|
14590
14500
|
}
|
|
14591
14501
|
const aliased = matchTsconfigAlias(specifier, tsconfigAliases.aliases, tsconfigAliases.baseUrl, resolveSourceFile2);
|
|
14592
14502
|
if (aliased)
|
|
@@ -14595,7 +14505,7 @@ ${fields}
|
|
|
14595
14505
|
const resolved = Bun.resolveSync(specifier, fromDir);
|
|
14596
14506
|
if (resolved.includes("/node_modules/"))
|
|
14597
14507
|
return;
|
|
14598
|
-
const absolute =
|
|
14508
|
+
const absolute = resolve21(resolved);
|
|
14599
14509
|
if (!absolute.startsWith(baseDir))
|
|
14600
14510
|
return;
|
|
14601
14511
|
return resolveSourceFile2(absolute);
|
|
@@ -14604,7 +14514,7 @@ ${fields}
|
|
|
14604
14514
|
}
|
|
14605
14515
|
};
|
|
14606
14516
|
const toOutputPath = (sourcePath) => {
|
|
14607
|
-
const inputDir =
|
|
14517
|
+
const inputDir = dirname14(sourcePath);
|
|
14608
14518
|
const fileBase = basename8(sourcePath).replace(/\.[cm]?[tj]sx?$/, ".js");
|
|
14609
14519
|
if (inputDir === outDir || inputDir.startsWith(`${outDir}${sep3}`)) {
|
|
14610
14520
|
return join27(inputDir, fileBase);
|
|
@@ -14647,18 +14557,18 @@ ${fields}
|
|
|
14647
14557
|
return `${prefix}${dots}`;
|
|
14648
14558
|
return `${prefix}../${dots}`;
|
|
14649
14559
|
});
|
|
14650
|
-
if (
|
|
14560
|
+
if (resolve21(actualPath) === entryPath) {
|
|
14651
14561
|
processedContent += buildIslandMetadataExports(sourceCode);
|
|
14652
14562
|
}
|
|
14653
14563
|
return processedContent;
|
|
14654
14564
|
};
|
|
14655
14565
|
const transpileFile = async (filePath) => {
|
|
14656
|
-
const resolved =
|
|
14566
|
+
const resolved = resolve21(filePath);
|
|
14657
14567
|
if (visited.has(resolved))
|
|
14658
14568
|
return;
|
|
14659
14569
|
visited.add(resolved);
|
|
14660
14570
|
if (resolved.endsWith(".json") && existsSync22(resolved)) {
|
|
14661
|
-
const inputDir2 =
|
|
14571
|
+
const inputDir2 = dirname14(resolved);
|
|
14662
14572
|
const relativeDir2 = inputDir2.startsWith(baseDir) ? inputDir2.substring(baseDir.length + 1) : inputDir2;
|
|
14663
14573
|
const targetDir2 = join27(outDir, relativeDir2);
|
|
14664
14574
|
const targetPath2 = join27(targetDir2, basename8(resolved));
|
|
@@ -14673,12 +14583,12 @@ ${fields}
|
|
|
14673
14583
|
if (!existsSync22(actualPath))
|
|
14674
14584
|
return;
|
|
14675
14585
|
let sourceCode = await fs5.readFile(actualPath, "utf-8");
|
|
14676
|
-
const inlined = await inlineResources(sourceCode,
|
|
14677
|
-
sourceCode = inlineTemplateAndLowerDeferSync(inlined.source,
|
|
14678
|
-
const inputDir =
|
|
14586
|
+
const inlined = await inlineResources(sourceCode, dirname14(actualPath), stylePreprocessors);
|
|
14587
|
+
sourceCode = inlineTemplateAndLowerDeferSync(inlined.source, dirname14(actualPath)).source;
|
|
14588
|
+
const inputDir = dirname14(actualPath);
|
|
14679
14589
|
const fileBase = basename8(actualPath).replace(/\.[cm]?[tj]sx?$/, ".js");
|
|
14680
14590
|
const targetPath = toOutputPath(actualPath);
|
|
14681
|
-
const targetDir =
|
|
14591
|
+
const targetDir = dirname14(targetPath);
|
|
14682
14592
|
const relativeDir = relative11(outDir, targetDir).replace(/\\/g, "/");
|
|
14683
14593
|
const localImports = [];
|
|
14684
14594
|
const importRewrites = new Map;
|
|
@@ -14705,7 +14615,7 @@ ${fields}
|
|
|
14705
14615
|
importRewrites.set(specifier, relativeRewrite);
|
|
14706
14616
|
return resolved2;
|
|
14707
14617
|
}).filter((path) => Boolean(path));
|
|
14708
|
-
const isEntry =
|
|
14618
|
+
const isEntry = resolve21(actualPath) === resolve21(entryPath);
|
|
14709
14619
|
const contentHash = Bun.hash(sourceCode).toString(BASE_36_RADIX);
|
|
14710
14620
|
const cacheKey2 = actualPath;
|
|
14711
14621
|
const shouldWriteFile = cacheBuster && isEntry ? true : jitContentCache.get(cacheKey2) !== contentHash || !existsSync22(targetPath);
|
|
@@ -14741,11 +14651,11 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
14741
14651
|
const compiledRoot = compiledParent;
|
|
14742
14652
|
const indexesDir = join27(compiledParent, "indexes");
|
|
14743
14653
|
await traceAngularPhase("setup/create-indexes-dir", () => fs5.mkdir(indexesDir, { recursive: true }));
|
|
14744
|
-
const aotOutputs = hmr ? [] : await traceAngularPhase("aot/compile-files", () => compileAngularFiles(entryPoints.map((entry) =>
|
|
14654
|
+
const aotOutputs = hmr ? [] : await traceAngularPhase("aot/compile-files", () => compileAngularFiles(entryPoints.map((entry) => resolve21(entry)), compiledRoot, stylePreprocessors), { entries: entryPoints.length });
|
|
14745
14655
|
if (!hmr) {
|
|
14746
14656
|
await traceAngularPhase("aot/copy-json-resources", async () => {
|
|
14747
14657
|
const cwd = process.cwd();
|
|
14748
|
-
const angularSrcDir =
|
|
14658
|
+
const angularSrcDir = resolve21(outRoot);
|
|
14749
14659
|
if (!existsSync22(angularSrcDir))
|
|
14750
14660
|
return;
|
|
14751
14661
|
const jsonGlob = new Glob6("**/*.json");
|
|
@@ -14756,14 +14666,14 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
14756
14666
|
const sourcePath = join27(angularSrcDir, rel);
|
|
14757
14667
|
const cwdRel = relative11(cwd, sourcePath);
|
|
14758
14668
|
const targetPath = join27(compiledRoot, cwdRel);
|
|
14759
|
-
await fs5.mkdir(
|
|
14669
|
+
await fs5.mkdir(dirname14(targetPath), { recursive: true });
|
|
14760
14670
|
await fs5.copyFile(sourcePath, targetPath);
|
|
14761
14671
|
}
|
|
14762
14672
|
});
|
|
14763
14673
|
}
|
|
14764
14674
|
const usesLegacyAngularAnimations = await traceAngularPhase("setup/legacy-animation-resolver", () => createLegacyAngularAnimationUsageResolver(outRoot));
|
|
14765
14675
|
const compileTasks = entryPoints.map(async (entry) => {
|
|
14766
|
-
const resolvedEntry =
|
|
14676
|
+
const resolvedEntry = resolve21(entry);
|
|
14767
14677
|
const relativeEntry = relative11(outRoot, resolvedEntry).replace(/\.[tj]s$/, ".js");
|
|
14768
14678
|
const compileEntry = () => compileAngularFileJIT(resolvedEntry, compiledRoot, outRoot, stylePreprocessors);
|
|
14769
14679
|
let outputs = hmr ? await traceAngularPhase("jit/compile-entry", compileEntry, {
|
|
@@ -14775,10 +14685,10 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
14775
14685
|
join27(compiledRoot, relativeEntry),
|
|
14776
14686
|
join27(compiledRoot, "pages", jsName),
|
|
14777
14687
|
join27(compiledRoot, jsName)
|
|
14778
|
-
].map((file3) =>
|
|
14688
|
+
].map((file3) => resolve21(file3));
|
|
14779
14689
|
const resolveRawServerFile = (candidatePaths) => {
|
|
14780
14690
|
const normalizedCandidates = [
|
|
14781
|
-
...candidatePaths.map((file3) =>
|
|
14691
|
+
...candidatePaths.map((file3) => resolve21(file3)),
|
|
14782
14692
|
...compiledFallbackPaths
|
|
14783
14693
|
];
|
|
14784
14694
|
let candidate = normalizedCandidates.find((file3) => existsSync22(file3) && file3.endsWith(`${sep3}${relativeEntry}`));
|
|
@@ -14820,7 +14730,19 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
14820
14730
|
const detectedClassName = await traceAngularPhase("wrapper/detect-component-class", () => detectExportedComponentClass(original), { entry: resolvedEntry });
|
|
14821
14731
|
const componentClassName = detectedClassName ?? `${toPascal(fileBase)}Component`;
|
|
14822
14732
|
const usesLegacyAnimations = await traceAngularPhase("wrapper/detect-legacy-animations", () => usesLegacyAngularAnimations(resolvedEntry), { entry: resolvedEntry });
|
|
14823
|
-
const
|
|
14733
|
+
const pageInjectionForHash = providersInjection?.pagesByFile.get(resolvedEntry);
|
|
14734
|
+
const providersHashInput = providersInjection ? (() => {
|
|
14735
|
+
let providersSourceContent = "";
|
|
14736
|
+
try {
|
|
14737
|
+
providersSourceContent = readFileSync16(providersInjection.appProvidersSource, "utf-8");
|
|
14738
|
+
} catch {}
|
|
14739
|
+
return JSON.stringify({
|
|
14740
|
+
basePath: pageInjectionForHash?.basePath ?? null,
|
|
14741
|
+
hasRoutes: pageInjectionForHash?.hasRoutes ?? false,
|
|
14742
|
+
source: providersSourceContent
|
|
14743
|
+
});
|
|
14744
|
+
})() : "no-providers";
|
|
14745
|
+
const serverContentHash = `${Bun.hash(original).toString(BASE_36_RADIX)}.${Bun.hash(providersHashInput).toString(BASE_36_RADIX)}`;
|
|
14824
14746
|
const cachedWrapper = wrapperOutputCache.get(resolvedEntry);
|
|
14825
14747
|
const clientFile = join27(indexesDir, jsName);
|
|
14826
14748
|
if (hmr && cachedWrapper && cachedWrapper.serverHash === serverContentHash && existsSync22(clientFile) && (usesLegacyAnimations || !original.includes("__ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__")) && (!usesLegacyAnimations || original.includes("__ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__"))) {
|
|
@@ -14848,15 +14770,16 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
14848
14770
|
`;
|
|
14849
14771
|
}
|
|
14850
14772
|
const pageInjection = providersInjection?.pagesByFile.get(resolvedEntry);
|
|
14773
|
+
rewritten = rewritten.replace(/\n\/\* __ABS_PROVIDERS_INJECTION_START \*\/[\s\S]*?\/\* __ABS_PROVIDERS_INJECTION_END \*\/\n?/g, "");
|
|
14851
14774
|
if (providersInjection && pageInjection) {
|
|
14852
14775
|
const compiledAppProvidersPath = (() => {
|
|
14853
|
-
const angularDirAbs =
|
|
14854
|
-
const appSourceAbs =
|
|
14776
|
+
const angularDirAbs = resolve21(outRoot);
|
|
14777
|
+
const appSourceAbs = resolve21(providersInjection.appProvidersSource);
|
|
14855
14778
|
const rel = relative11(angularDirAbs, appSourceAbs).replace(/\\/g, "/");
|
|
14856
14779
|
return join27(compiledParent, rel).replace(/\.[cm]?[tj]sx?$/, ".js");
|
|
14857
14780
|
})();
|
|
14858
14781
|
const appProvidersSpec = (() => {
|
|
14859
|
-
const rel = relative11(
|
|
14782
|
+
const rel = relative11(dirname14(rawServerFile), compiledAppProvidersPath).replace(/\\/g, "/");
|
|
14860
14783
|
return rel.startsWith(".") ? rel : `./${rel}`;
|
|
14861
14784
|
})();
|
|
14862
14785
|
const importLines = [
|
|
@@ -14872,9 +14795,11 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
14872
14795
|
fragments.push(`{ provide: __abs_APP_BASE_HREF, useValue: ${JSON.stringify(pageInjection.basePath)} }`);
|
|
14873
14796
|
}
|
|
14874
14797
|
rewritten += `
|
|
14798
|
+
/* __ABS_PROVIDERS_INJECTION_START */
|
|
14875
14799
|
${importLines.join(`
|
|
14876
14800
|
`)}
|
|
14877
14801
|
export const providers = [${fragments.join(", ")}];
|
|
14802
|
+
/* __ABS_PROVIDERS_INJECTION_END */
|
|
14878
14803
|
`;
|
|
14879
14804
|
}
|
|
14880
14805
|
await traceAngularPhase("wrapper/write-server-output", () => fs5.writeFile(rawServerFile, rewritten, "utf-8"), { entry: resolvedEntry });
|
|
@@ -15798,7 +15723,7 @@ __export(exports_fastHmrCompiler, {
|
|
|
15798
15723
|
invalidateFingerprintCache: () => invalidateFingerprintCache
|
|
15799
15724
|
});
|
|
15800
15725
|
import { existsSync as existsSync23, readFileSync as readFileSync17, statSync as statSync2 } from "fs";
|
|
15801
|
-
import { dirname as
|
|
15726
|
+
import { dirname as dirname15, extname as extname6, relative as relative12, resolve as resolve22 } from "path";
|
|
15802
15727
|
import ts13 from "typescript";
|
|
15803
15728
|
var fail = (reason, detail, location) => ({
|
|
15804
15729
|
ok: false,
|
|
@@ -15926,7 +15851,7 @@ var fail = (reason, detail, location) => ({
|
|
|
15926
15851
|
continue;
|
|
15927
15852
|
const decoratorMeta = readDecoratorMeta(args);
|
|
15928
15853
|
const { inputs, outputs } = extractInputsAndOutputs(stmt, null);
|
|
15929
|
-
const componentDir =
|
|
15854
|
+
const componentDir = dirname15(componentFilePath);
|
|
15930
15855
|
const fingerprint = extractFingerprint(stmt, className, decoratorMeta, inputs, outputs, sourceFile, componentDir);
|
|
15931
15856
|
fingerprintCache.set(id, fingerprint);
|
|
15932
15857
|
} else {
|
|
@@ -16102,7 +16027,7 @@ var fail = (reason, detail, location) => ({
|
|
|
16102
16027
|
if (!spec.startsWith(".") && !spec.startsWith("/")) {
|
|
16103
16028
|
return true;
|
|
16104
16029
|
}
|
|
16105
|
-
const base =
|
|
16030
|
+
const base = resolve22(componentDir, spec);
|
|
16106
16031
|
const candidates = [
|
|
16107
16032
|
`${base}.ts`,
|
|
16108
16033
|
`${base}.tsx`,
|
|
@@ -16886,7 +16811,7 @@ var fail = (reason, detail, location) => ({
|
|
|
16886
16811
|
});
|
|
16887
16812
|
if (!names.includes(className))
|
|
16888
16813
|
continue;
|
|
16889
|
-
const nextDts = resolveDtsFromSpec(fromPath,
|
|
16814
|
+
const nextDts = resolveDtsFromSpec(fromPath, dirname15(startDtsPath));
|
|
16890
16815
|
if (!nextDts)
|
|
16891
16816
|
continue;
|
|
16892
16817
|
const found = findDtsContainingClass(nextDts, className, visited);
|
|
@@ -16896,7 +16821,7 @@ var fail = (reason, detail, location) => ({
|
|
|
16896
16821
|
const starReExportRe = /export\s*\*\s*from\s*["']([^"']+)["']/g;
|
|
16897
16822
|
while ((m = starReExportRe.exec(content)) !== null) {
|
|
16898
16823
|
const fromPath = m[1] || "";
|
|
16899
|
-
const nextDts = resolveDtsFromSpec(fromPath,
|
|
16824
|
+
const nextDts = resolveDtsFromSpec(fromPath, dirname15(startDtsPath));
|
|
16900
16825
|
if (!nextDts)
|
|
16901
16826
|
continue;
|
|
16902
16827
|
const found = findDtsContainingClass(nextDts, className, visited);
|
|
@@ -16906,7 +16831,7 @@ var fail = (reason, detail, location) => ({
|
|
|
16906
16831
|
return null;
|
|
16907
16832
|
}, resolveDtsFromSpec = (spec, fromDir) => {
|
|
16908
16833
|
const stripped = spec.replace(/\.[mc]?js$/, "");
|
|
16909
|
-
const base =
|
|
16834
|
+
const base = resolve22(fromDir, stripped);
|
|
16910
16835
|
const candidates = [
|
|
16911
16836
|
`${base}.d.ts`,
|
|
16912
16837
|
`${base}.d.mts`,
|
|
@@ -16930,7 +16855,7 @@ var fail = (reason, detail, location) => ({
|
|
|
16930
16855
|
return null;
|
|
16931
16856
|
}, resolveChildComponentInfo = (className, spec, componentDir, projectRoot) => {
|
|
16932
16857
|
if (spec.startsWith(".") || spec.startsWith("/")) {
|
|
16933
|
-
const base =
|
|
16858
|
+
const base = resolve22(componentDir, spec);
|
|
16934
16859
|
const candidates = [
|
|
16935
16860
|
`${base}.ts`,
|
|
16936
16861
|
`${base}.tsx`,
|
|
@@ -17149,13 +17074,13 @@ var fail = (reason, detail, location) => ({
|
|
|
17149
17074
|
}
|
|
17150
17075
|
if (!matches)
|
|
17151
17076
|
continue;
|
|
17152
|
-
const resolved =
|
|
17077
|
+
const resolved = resolve22(componentDir, spec);
|
|
17153
17078
|
for (const ext of TS_EXTENSIONS) {
|
|
17154
17079
|
const candidate = resolved + ext;
|
|
17155
17080
|
if (existsSync23(candidate))
|
|
17156
17081
|
return candidate;
|
|
17157
17082
|
}
|
|
17158
|
-
const indexCandidate =
|
|
17083
|
+
const indexCandidate = resolve22(resolved, "index.ts");
|
|
17159
17084
|
if (existsSync23(indexCandidate))
|
|
17160
17085
|
return indexCandidate;
|
|
17161
17086
|
}
|
|
@@ -17388,7 +17313,7 @@ ${transpiled}
|
|
|
17388
17313
|
}
|
|
17389
17314
|
}${staticPatch}`;
|
|
17390
17315
|
}, STYLE_PREPROCESSED_EXT, resolveAndReadStyleResource = (componentDir, url) => {
|
|
17391
|
-
const abs =
|
|
17316
|
+
const abs = resolve22(componentDir, url);
|
|
17392
17317
|
if (!existsSync23(abs))
|
|
17393
17318
|
return null;
|
|
17394
17319
|
const ext = extname6(abs).toLowerCase();
|
|
@@ -17428,7 +17353,7 @@ ${block}
|
|
|
17428
17353
|
const cached = projectOptionsCache.get(projectRoot);
|
|
17429
17354
|
if (cached !== undefined)
|
|
17430
17355
|
return cached;
|
|
17431
|
-
const tsconfigPath =
|
|
17356
|
+
const tsconfigPath = resolve22(projectRoot, "tsconfig.json");
|
|
17432
17357
|
const opts = {};
|
|
17433
17358
|
if (existsSync23(tsconfigPath)) {
|
|
17434
17359
|
try {
|
|
@@ -17493,7 +17418,7 @@ ${block}
|
|
|
17493
17418
|
rebootstrapRequired: false
|
|
17494
17419
|
};
|
|
17495
17420
|
}
|
|
17496
|
-
if (inheritsDecoratedClass(classNode, sourceFile,
|
|
17421
|
+
if (inheritsDecoratedClass(classNode, sourceFile, dirname15(componentFilePath), projectRoot)) {
|
|
17497
17422
|
return fail("inherits-decorated-class");
|
|
17498
17423
|
}
|
|
17499
17424
|
const decorator = findComponentDecorator(classNode);
|
|
@@ -17505,14 +17430,14 @@ ${block}
|
|
|
17505
17430
|
const projectDefaults = readProjectAngularCompilerOptions(projectRoot);
|
|
17506
17431
|
const decoratorMeta = readDecoratorMeta(decoratorArgs, projectDefaults);
|
|
17507
17432
|
const advancedMetadata = extractAdvancedMetadata(classNode, decoratorArgs, compiler);
|
|
17508
|
-
const componentDir =
|
|
17433
|
+
const componentDir = dirname15(componentFilePath);
|
|
17509
17434
|
let templateText;
|
|
17510
17435
|
let templatePath;
|
|
17511
17436
|
if (decoratorMeta.template !== null) {
|
|
17512
17437
|
templateText = decoratorMeta.template;
|
|
17513
17438
|
templatePath = componentFilePath;
|
|
17514
17439
|
} else if (decoratorMeta.templateUrl) {
|
|
17515
|
-
const tplAbs =
|
|
17440
|
+
const tplAbs = resolve22(componentDir, decoratorMeta.templateUrl);
|
|
17516
17441
|
if (!existsSync23(tplAbs)) {
|
|
17517
17442
|
return fail("template-resource-not-found", `Template file not found: ${tplAbs}`, { file: componentFilePath });
|
|
17518
17443
|
}
|
|
@@ -18266,7 +18191,7 @@ __export(exports_compileEmber, {
|
|
|
18266
18191
|
getEmberServerCompiledDir: () => getEmberServerCompiledDir,
|
|
18267
18192
|
getEmberCompiledRoot: () => getEmberCompiledRoot,
|
|
18268
18193
|
getEmberClientCompiledDir: () => getEmberClientCompiledDir,
|
|
18269
|
-
dirname: () =>
|
|
18194
|
+
dirname: () => dirname16,
|
|
18270
18195
|
compileEmberFileSource: () => compileEmberFileSource,
|
|
18271
18196
|
compileEmberFile: () => compileEmberFile,
|
|
18272
18197
|
compileEmber: () => compileEmber,
|
|
@@ -18275,7 +18200,7 @@ __export(exports_compileEmber, {
|
|
|
18275
18200
|
});
|
|
18276
18201
|
import { existsSync as existsSync24 } from "fs";
|
|
18277
18202
|
import { mkdir as mkdir6, rm as rm4 } from "fs/promises";
|
|
18278
|
-
import { basename as basename9, dirname as
|
|
18203
|
+
import { basename as basename9, dirname as dirname16, extname as extname7, join as join28, resolve as resolve23 } from "path";
|
|
18279
18204
|
var {build: bunBuild2, Transpiler: Transpiler4, write: write4, file: file3 } = globalThis.Bun;
|
|
18280
18205
|
var cachedPreprocessor = null, getPreprocessor = async () => {
|
|
18281
18206
|
if (cachedPreprocessor)
|
|
@@ -18371,7 +18296,7 @@ export const importSync = (specifier) => {
|
|
|
18371
18296
|
const originalImporter = stagedSourceMap.get(args.importer);
|
|
18372
18297
|
if (!originalImporter)
|
|
18373
18298
|
return;
|
|
18374
|
-
const candidateBase =
|
|
18299
|
+
const candidateBase = resolve23(dirname16(originalImporter), args.path);
|
|
18375
18300
|
const extensionsToTry = ["", ".gts", ".gjs", ".ts", ".js"];
|
|
18376
18301
|
for (const ext of extensionsToTry) {
|
|
18377
18302
|
const candidate = candidateBase + ext;
|
|
@@ -18430,7 +18355,7 @@ export const renderToHTML = (props = {}) => {
|
|
|
18430
18355
|
export { PageComponent };
|
|
18431
18356
|
export default PageComponent;
|
|
18432
18357
|
`, compileEmberFile = async (entry, compiledRoot, cwd = process.cwd()) => {
|
|
18433
|
-
const resolvedEntry =
|
|
18358
|
+
const resolvedEntry = resolve23(entry);
|
|
18434
18359
|
const source = await file3(resolvedEntry).text();
|
|
18435
18360
|
let preprocessed = source;
|
|
18436
18361
|
if (isTemplateTagFile(resolvedEntry)) {
|
|
@@ -18450,8 +18375,8 @@ export default PageComponent;
|
|
|
18450
18375
|
mkdir6(serverDir, { recursive: true }),
|
|
18451
18376
|
mkdir6(clientDir, { recursive: true })
|
|
18452
18377
|
]);
|
|
18453
|
-
const tmpPagePath =
|
|
18454
|
-
const tmpHarnessPath =
|
|
18378
|
+
const tmpPagePath = resolve23(join28(tmpDir, `${baseName}.module.js`));
|
|
18379
|
+
const tmpHarnessPath = resolve23(join28(tmpDir, `${baseName}.harness.js`));
|
|
18455
18380
|
await Promise.all([
|
|
18456
18381
|
write4(tmpPagePath, transpiled),
|
|
18457
18382
|
write4(tmpHarnessPath, generateServerHarness(tmpPagePath))
|
|
@@ -18493,7 +18418,7 @@ export default PageComponent;
|
|
|
18493
18418
|
serverPaths: outputs.map((o3) => o3.serverPath)
|
|
18494
18419
|
};
|
|
18495
18420
|
}, compileEmberFileSource = async (entry) => {
|
|
18496
|
-
const resolvedEntry =
|
|
18421
|
+
const resolvedEntry = resolve23(entry);
|
|
18497
18422
|
const source = await file3(resolvedEntry).text();
|
|
18498
18423
|
let preprocessed = source;
|
|
18499
18424
|
if (isTemplateTagFile(resolvedEntry)) {
|
|
@@ -18526,24 +18451,24 @@ __export(exports_buildReactVendor, {
|
|
|
18526
18451
|
buildReactVendor: () => buildReactVendor
|
|
18527
18452
|
});
|
|
18528
18453
|
import { existsSync as existsSync25, mkdirSync as mkdirSync8 } from "fs";
|
|
18529
|
-
import { join as join29, resolve as
|
|
18454
|
+
import { join as join29, resolve as resolve24 } from "path";
|
|
18530
18455
|
import { rm as rm5 } from "fs/promises";
|
|
18531
18456
|
var {build: bunBuild3 } = globalThis.Bun;
|
|
18532
18457
|
var resolveJsxDevRuntimeCompatPath = () => {
|
|
18533
18458
|
const candidates = [
|
|
18534
|
-
|
|
18535
|
-
|
|
18536
|
-
|
|
18537
|
-
|
|
18538
|
-
|
|
18539
|
-
|
|
18459
|
+
resolve24(import.meta.dir, "react", "jsxDevRuntimeCompat.js"),
|
|
18460
|
+
resolve24(import.meta.dir, "src", "react", "jsxDevRuntimeCompat.ts"),
|
|
18461
|
+
resolve24(import.meta.dir, "..", "react", "jsxDevRuntimeCompat.js"),
|
|
18462
|
+
resolve24(import.meta.dir, "..", "src", "react", "jsxDevRuntimeCompat.ts"),
|
|
18463
|
+
resolve24(import.meta.dir, "..", "..", "dist", "react", "jsxDevRuntimeCompat.js"),
|
|
18464
|
+
resolve24(import.meta.dir, "..", "..", "src", "react", "jsxDevRuntimeCompat.ts")
|
|
18540
18465
|
];
|
|
18541
18466
|
for (const candidate of candidates) {
|
|
18542
18467
|
if (existsSync25(candidate)) {
|
|
18543
18468
|
return candidate.replace(/\\/g, "/");
|
|
18544
18469
|
}
|
|
18545
18470
|
}
|
|
18546
|
-
return (candidates[0] ??
|
|
18471
|
+
return (candidates[0] ?? resolve24(import.meta.dir, "react", "jsxDevRuntimeCompat.js")).replace(/\\/g, "/");
|
|
18547
18472
|
}, jsxDevRuntimeCompatPath, reactSpecifiers, isResolvable = (specifier) => {
|
|
18548
18473
|
try {
|
|
18549
18474
|
Bun.resolveSync(specifier, process.cwd());
|
|
@@ -19193,7 +19118,7 @@ import {
|
|
|
19193
19118
|
statSync as statSync3,
|
|
19194
19119
|
writeFileSync as writeFileSync8
|
|
19195
19120
|
} from "fs";
|
|
19196
|
-
import { basename as basename10, dirname as
|
|
19121
|
+
import { basename as basename10, dirname as dirname17, extname as extname8, join as join34, relative as relative13, resolve as resolve25 } from "path";
|
|
19197
19122
|
import { cwd, env as env2, exit } from "process";
|
|
19198
19123
|
var {build: bunBuild7, Glob: Glob8 } = globalThis.Bun;
|
|
19199
19124
|
var isDev, isBuildTraceEnabled = () => {
|
|
@@ -19284,8 +19209,8 @@ var isDev, isBuildTraceEnabled = () => {
|
|
|
19284
19209
|
}
|
|
19285
19210
|
}, resolveAbsoluteVersion = async () => {
|
|
19286
19211
|
const candidates = [
|
|
19287
|
-
|
|
19288
|
-
|
|
19212
|
+
resolve25(import.meta.dir, "..", "..", "package.json"),
|
|
19213
|
+
resolve25(import.meta.dir, "..", "package.json")
|
|
19289
19214
|
];
|
|
19290
19215
|
const resolveCandidate = async (remaining) => {
|
|
19291
19216
|
const [candidate, ...rest] = remaining;
|
|
@@ -19301,7 +19226,7 @@ var isDev, isBuildTraceEnabled = () => {
|
|
|
19301
19226
|
};
|
|
19302
19227
|
await resolveCandidate(candidates);
|
|
19303
19228
|
}, SKIP_DIRS4, addWorkerPathIfExists = (file4, relPath, workerPaths) => {
|
|
19304
|
-
const absPath =
|
|
19229
|
+
const absPath = resolve25(file4, "..", relPath);
|
|
19305
19230
|
try {
|
|
19306
19231
|
statSync3(absPath);
|
|
19307
19232
|
workerPaths.add(absPath);
|
|
@@ -19363,7 +19288,7 @@ var isDev, isBuildTraceEnabled = () => {
|
|
|
19363
19288
|
return;
|
|
19364
19289
|
}
|
|
19365
19290
|
const indexFiles = readDir(reactIndexesPath).filter((file4) => file4.endsWith(".tsx"));
|
|
19366
|
-
const pagesRel = relative13(process.cwd(),
|
|
19291
|
+
const pagesRel = relative13(process.cwd(), resolve25(reactPagesPath)).replace(/\\/g, "/");
|
|
19367
19292
|
for (const file4 of indexFiles) {
|
|
19368
19293
|
let content = readFileSync18(join34(reactIndexesPath, file4), "utf-8");
|
|
19369
19294
|
content = content.replace(/from\s*['"]([^'"]*\/pages\/([^'"]+))['"]/g, (_match, _fullPath, componentName) => `from '/@src/${pagesRel}/${componentName}'`);
|
|
@@ -19371,27 +19296,27 @@ var isDev, isBuildTraceEnabled = () => {
|
|
|
19371
19296
|
}
|
|
19372
19297
|
}, copySvelteDevIndexes = (svelteDir, sveltePagesPath, svelteEntries, devIndexDir) => {
|
|
19373
19298
|
const svelteIndexDir = join34(getFrameworkGeneratedDir("svelte"), "indexes");
|
|
19374
|
-
const sveltePageEntries = svelteEntries.filter((file4) =>
|
|
19299
|
+
const sveltePageEntries = svelteEntries.filter((file4) => resolve25(file4).startsWith(resolve25(sveltePagesPath)));
|
|
19375
19300
|
for (const entry of sveltePageEntries) {
|
|
19376
19301
|
const name = basename10(entry).replace(/\.svelte(\.(ts|js))?$/, "");
|
|
19377
19302
|
const indexFile = join34(svelteIndexDir, "pages", `${name}.js`);
|
|
19378
19303
|
if (!existsSync26(indexFile))
|
|
19379
19304
|
continue;
|
|
19380
19305
|
let content = readFileSync18(indexFile, "utf-8");
|
|
19381
|
-
const srcRel = relative13(process.cwd(),
|
|
19306
|
+
const srcRel = relative13(process.cwd(), resolve25(entry)).replace(/\\/g, "/");
|
|
19382
19307
|
content = content.replace(/import\s+Component\s+from\s+['"]([^'"]+)['"]/, `import Component from "/@src/${srcRel}"`);
|
|
19383
19308
|
writeFileSync8(join34(devIndexDir, `${name}.svelte.js`), content);
|
|
19384
19309
|
}
|
|
19385
19310
|
}, copyVueDevIndexes = (vueDir, vuePagesPath, vueEntries, devIndexDir) => {
|
|
19386
19311
|
const vueIndexDir = join34(getFrameworkGeneratedDir("vue"), "indexes");
|
|
19387
|
-
const vuePageEntries = vueEntries.filter((file4) =>
|
|
19312
|
+
const vuePageEntries = vueEntries.filter((file4) => resolve25(file4).startsWith(resolve25(vuePagesPath)));
|
|
19388
19313
|
for (const entry of vuePageEntries) {
|
|
19389
19314
|
const name = basename10(entry, ".vue");
|
|
19390
19315
|
const indexFile = join34(vueIndexDir, `${name}.js`);
|
|
19391
19316
|
if (!existsSync26(indexFile))
|
|
19392
19317
|
continue;
|
|
19393
19318
|
let content = readFileSync18(indexFile, "utf-8");
|
|
19394
|
-
const srcRel = relative13(process.cwd(),
|
|
19319
|
+
const srcRel = relative13(process.cwd(), resolve25(entry)).replace(/\\/g, "/");
|
|
19395
19320
|
content = content.replace(/import\s+Comp(?:\s*,\s*\*\s+as\s+\w+)?\s+from\s+['"]([^'"]+)['"]/, (match) => match.replace(/from\s+['"][^'"]+['"]/, `from "/@src/${srcRel}"`));
|
|
19396
19321
|
writeFileSync8(join34(devIndexDir, `${name}.vue.js`), content);
|
|
19397
19322
|
}
|
|
@@ -19404,7 +19329,7 @@ var isDev, isBuildTraceEnabled = () => {
|
|
|
19404
19329
|
const last = allComments[allComments.length - 1];
|
|
19405
19330
|
if (!last?.[1])
|
|
19406
19331
|
return JSON.stringify(outputPath);
|
|
19407
|
-
const srcPath =
|
|
19332
|
+
const srcPath = resolve25(projectRoot, last[1].replace("/client/", "/").replace(/\.js$/, ".ts"));
|
|
19408
19333
|
return JSON.stringify(srcPath);
|
|
19409
19334
|
}, QUOTE_CHARS, OPEN_BRACES, CLOSE_BRACES, findFunctionExpressionEnd = (content, startPos) => {
|
|
19410
19335
|
let depth = 0;
|
|
@@ -19689,7 +19614,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
19689
19614
|
const sourceClientRoots = [
|
|
19690
19615
|
htmlDir,
|
|
19691
19616
|
htmxDir,
|
|
19692
|
-
islandBootstrapPath &&
|
|
19617
|
+
islandBootstrapPath && dirname17(islandBootstrapPath)
|
|
19693
19618
|
].filter((dir) => Boolean(dir));
|
|
19694
19619
|
const usesGenerated = Boolean(reactDir) || Boolean(svelteDir) || Boolean(vueDir) || Boolean(angularDir);
|
|
19695
19620
|
if (usesGenerated)
|
|
@@ -19730,13 +19655,13 @@ ${content.slice(firstUseIdx)}`;
|
|
|
19730
19655
|
const filterToIncrementalEntries = (entryPoints, mapToSource) => {
|
|
19731
19656
|
if (!isIncremental || !incrementalFiles)
|
|
19732
19657
|
return entryPoints;
|
|
19733
|
-
const normalizedIncremental = new Set(incrementalFiles.map((f2) =>
|
|
19658
|
+
const normalizedIncremental = new Set(incrementalFiles.map((f2) => resolve25(f2)));
|
|
19734
19659
|
const matchingEntries = [];
|
|
19735
19660
|
for (const entry of entryPoints) {
|
|
19736
19661
|
const sourceFile = mapToSource(entry);
|
|
19737
19662
|
if (!sourceFile)
|
|
19738
19663
|
continue;
|
|
19739
|
-
if (!normalizedIncremental.has(
|
|
19664
|
+
if (!normalizedIncremental.has(resolve25(sourceFile)))
|
|
19740
19665
|
continue;
|
|
19741
19666
|
matchingEntries.push(entry);
|
|
19742
19667
|
}
|
|
@@ -19901,7 +19826,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
19901
19826
|
}
|
|
19902
19827
|
const shouldIncludeHtmlAssets = !isIncremental || normalizedIncrementalFiles?.some((f2) => f2.includes("/html/") && (f2.endsWith(".html") || isStylePath(f2)));
|
|
19903
19828
|
const reactEntries = isIncremental && reactIndexesPath && reactPagesPath ? filterToIncrementalEntries(allReactEntries, (entry) => {
|
|
19904
|
-
if (entry.startsWith(
|
|
19829
|
+
if (entry.startsWith(resolve25(reactIndexesPath))) {
|
|
19905
19830
|
const pageName = basename10(entry, ".tsx");
|
|
19906
19831
|
return join34(reactPagesPath, `${pageName}.tsx`);
|
|
19907
19832
|
}
|
|
@@ -20051,7 +19976,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
20051
19976
|
const clientPath = islandSvelteClientPaths[idx];
|
|
20052
19977
|
if (!sourcePath || !clientPath)
|
|
20053
19978
|
continue;
|
|
20054
|
-
islandSvelteClientPathMap.set(
|
|
19979
|
+
islandSvelteClientPathMap.set(resolve25(sourcePath), clientPath);
|
|
20055
19980
|
}
|
|
20056
19981
|
const islandVueClientPathMap = new Map;
|
|
20057
19982
|
for (let idx = 0;idx < islandVueSources.length; idx++) {
|
|
@@ -20059,7 +19984,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
20059
19984
|
const clientPath = islandVueClientPaths[idx];
|
|
20060
19985
|
if (!sourcePath || !clientPath)
|
|
20061
19986
|
continue;
|
|
20062
|
-
islandVueClientPathMap.set(
|
|
19987
|
+
islandVueClientPathMap.set(resolve25(sourcePath), clientPath);
|
|
20063
19988
|
}
|
|
20064
19989
|
const islandAngularClientPathMap = new Map;
|
|
20065
19990
|
for (let idx = 0;idx < islandAngularSources.length; idx++) {
|
|
@@ -20067,7 +19992,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
20067
19992
|
const clientPath = islandAngularClientPaths[idx];
|
|
20068
19993
|
if (!sourcePath || !clientPath)
|
|
20069
19994
|
continue;
|
|
20070
|
-
islandAngularClientPathMap.set(
|
|
19995
|
+
islandAngularClientPathMap.set(resolve25(sourcePath), clientPath);
|
|
20071
19996
|
}
|
|
20072
19997
|
const reactConventionSources = collectConventionSourceFiles(conventionsMap.react);
|
|
20073
19998
|
const svelteConventionSources = collectConventionSourceFiles(conventionsMap.svelte);
|
|
@@ -20094,7 +20019,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
20094
20019
|
naming: `${idx}-[name].[ext]`,
|
|
20095
20020
|
outdir: destDir,
|
|
20096
20021
|
plugins: [stylePreprocessorPlugin2],
|
|
20097
|
-
root:
|
|
20022
|
+
root: dirname17(source),
|
|
20098
20023
|
target: "bun",
|
|
20099
20024
|
throw: false,
|
|
20100
20025
|
tsconfig: "./tsconfig.json"
|
|
@@ -20518,7 +20443,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
20518
20443
|
if (serverOutputs.length > 0 && angularServerVendorPaths2 && Object.keys(angularServerVendorPaths2).length > 0) {
|
|
20519
20444
|
const { rewriteBuildOutputsWith: rewriteBuildOutputsWith2 } = await Promise.resolve().then(() => (init_rewriteImportsPlugin(), exports_rewriteImportsPlugin));
|
|
20520
20445
|
await tracePhase("postprocess/server-angular-vendor-imports", () => rewriteBuildOutputsWith2(serverOutputs, (artifact) => {
|
|
20521
|
-
const fileDir =
|
|
20446
|
+
const fileDir = dirname17(artifact.path);
|
|
20522
20447
|
const relativePaths = {};
|
|
20523
20448
|
for (const [specifier, absolute] of Object.entries(angularServerVendorPaths2)) {
|
|
20524
20449
|
const rel = relative13(fileDir, absolute);
|
|
@@ -20992,7 +20917,7 @@ __export(exports_dependencyGraph, {
|
|
|
20992
20917
|
});
|
|
20993
20918
|
import { existsSync as existsSync28, readFileSync as readFileSync19 } from "fs";
|
|
20994
20919
|
var {Glob: Glob9 } = globalThis.Bun;
|
|
20995
|
-
import { resolve as
|
|
20920
|
+
import { resolve as resolve26 } from "path";
|
|
20996
20921
|
var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath) => {
|
|
20997
20922
|
const lower = filePath.toLowerCase();
|
|
20998
20923
|
if (lower.endsWith(".ts") || lower.endsWith(".tsx") || lower.endsWith(".jsx"))
|
|
@@ -21006,8 +20931,8 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
21006
20931
|
if (!importPath.startsWith(".") && !importPath.startsWith("/")) {
|
|
21007
20932
|
return null;
|
|
21008
20933
|
}
|
|
21009
|
-
const fromDir =
|
|
21010
|
-
const normalized =
|
|
20934
|
+
const fromDir = resolve26(fromFile, "..");
|
|
20935
|
+
const normalized = resolve26(fromDir, importPath);
|
|
21011
20936
|
const extensions = [
|
|
21012
20937
|
".ts",
|
|
21013
20938
|
".tsx",
|
|
@@ -21037,7 +20962,7 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
21037
20962
|
dependents.delete(normalizedPath);
|
|
21038
20963
|
}
|
|
21039
20964
|
}, addFileToGraph = (graph, filePath) => {
|
|
21040
|
-
const normalizedPath =
|
|
20965
|
+
const normalizedPath = resolve26(filePath);
|
|
21041
20966
|
if (!existsSync28(normalizedPath))
|
|
21042
20967
|
return;
|
|
21043
20968
|
const dependencies = extractDependencies(normalizedPath);
|
|
@@ -21064,10 +20989,10 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
21064
20989
|
}, IGNORED_SEGMENTS, buildInitialDependencyGraph = (graph, directories) => {
|
|
21065
20990
|
const processedFiles = new Set;
|
|
21066
20991
|
const glob = new Glob9("**/*.{ts,tsx,js,jsx,vue,svelte,html,htm}");
|
|
21067
|
-
const resolvedDirs = directories.map((dir) =>
|
|
20992
|
+
const resolvedDirs = directories.map((dir) => resolve26(dir)).filter((dir) => existsSync28(dir));
|
|
21068
20993
|
const allFiles = resolvedDirs.flatMap((dir) => Array.from(glob.scanSync({ absolute: true, cwd: dir })));
|
|
21069
20994
|
for (const file4 of allFiles) {
|
|
21070
|
-
const fullPath =
|
|
20995
|
+
const fullPath = resolve26(file4);
|
|
21071
20996
|
if (IGNORED_SEGMENTS.some((seg) => fullPath.includes(seg)))
|
|
21072
20997
|
continue;
|
|
21073
20998
|
if (processedFiles.has(fullPath))
|
|
@@ -21180,7 +21105,7 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
21180
21105
|
return [];
|
|
21181
21106
|
}
|
|
21182
21107
|
}, getAffectedFiles = (graph, changedFile) => {
|
|
21183
|
-
const normalizedPath =
|
|
21108
|
+
const normalizedPath = resolve26(changedFile);
|
|
21184
21109
|
const affected = new Set;
|
|
21185
21110
|
const toProcess = [normalizedPath];
|
|
21186
21111
|
const processNode = (current) => {
|
|
@@ -21211,7 +21136,7 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
21211
21136
|
}, removeDependentsForFile = (graph, normalizedPath) => {
|
|
21212
21137
|
graph.dependents.delete(normalizedPath);
|
|
21213
21138
|
}, removeFileFromGraph = (graph, filePath) => {
|
|
21214
|
-
const normalizedPath =
|
|
21139
|
+
const normalizedPath = resolve26(filePath);
|
|
21215
21140
|
removeDepsForFile(graph, normalizedPath);
|
|
21216
21141
|
removeDependentsForFile(graph, normalizedPath);
|
|
21217
21142
|
};
|
|
@@ -21254,12 +21179,12 @@ var globalVersionCounter = 0, createModuleVersionTracker = () => new Map, getNex
|
|
|
21254
21179
|
};
|
|
21255
21180
|
|
|
21256
21181
|
// src/dev/configResolver.ts
|
|
21257
|
-
import { resolve as
|
|
21182
|
+
import { resolve as resolve27 } from "path";
|
|
21258
21183
|
var resolveBuildPaths = (config) => {
|
|
21259
21184
|
const cwd2 = process.cwd();
|
|
21260
21185
|
const normalize = (path) => path.replace(/\\/g, "/");
|
|
21261
|
-
const withDefault = (value, fallback) => normalize(
|
|
21262
|
-
const optional = (value) => value ? normalize(
|
|
21186
|
+
const withDefault = (value, fallback) => normalize(resolve27(cwd2, value ?? fallback));
|
|
21187
|
+
const optional = (value) => value ? normalize(resolve27(cwd2, value)) : undefined;
|
|
21263
21188
|
return {
|
|
21264
21189
|
angularDir: optional(config.angularDirectory),
|
|
21265
21190
|
assetsDir: optional(config.assetsDirectory),
|
|
@@ -21313,7 +21238,7 @@ var init_clientManager = __esm(() => {
|
|
|
21313
21238
|
|
|
21314
21239
|
// src/dev/pathUtils.ts
|
|
21315
21240
|
import { existsSync as existsSync29, readdirSync as readdirSync4, readFileSync as readFileSync20 } from "fs";
|
|
21316
|
-
import { dirname as
|
|
21241
|
+
import { dirname as dirname18, resolve as resolve28 } from "path";
|
|
21317
21242
|
var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
21318
21243
|
if (shouldIgnorePath(filePath, resolved)) {
|
|
21319
21244
|
return "ignored";
|
|
@@ -21389,7 +21314,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
21389
21314
|
return "unknown";
|
|
21390
21315
|
}, collectAngularResourceDirs = (angularDir) => {
|
|
21391
21316
|
const out = new Set;
|
|
21392
|
-
const angularRoot =
|
|
21317
|
+
const angularRoot = resolve28(angularDir);
|
|
21393
21318
|
const angularRootNormalized = normalizePath(angularRoot);
|
|
21394
21319
|
const walk = (dir) => {
|
|
21395
21320
|
let entries;
|
|
@@ -21402,7 +21327,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
21402
21327
|
if (entry.name.startsWith(".") || entry.name === "node_modules") {
|
|
21403
21328
|
continue;
|
|
21404
21329
|
}
|
|
21405
|
-
const full =
|
|
21330
|
+
const full = resolve28(dir, entry.name);
|
|
21406
21331
|
if (entry.isDirectory()) {
|
|
21407
21332
|
walk(full);
|
|
21408
21333
|
continue;
|
|
@@ -21441,10 +21366,10 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
21441
21366
|
refs.push(strMatch[1]);
|
|
21442
21367
|
}
|
|
21443
21368
|
}
|
|
21444
|
-
const componentDir =
|
|
21369
|
+
const componentDir = dirname18(full);
|
|
21445
21370
|
for (const ref of refs) {
|
|
21446
|
-
const refAbs = normalizePath(
|
|
21447
|
-
const refDir = normalizePath(
|
|
21371
|
+
const refAbs = normalizePath(resolve28(componentDir, ref));
|
|
21372
|
+
const refDir = normalizePath(dirname18(refAbs));
|
|
21448
21373
|
if (refDir === angularRootNormalized || refDir.startsWith(angularRootNormalized + "/")) {
|
|
21449
21374
|
continue;
|
|
21450
21375
|
}
|
|
@@ -21460,7 +21385,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
21460
21385
|
const push = (path) => {
|
|
21461
21386
|
if (!path)
|
|
21462
21387
|
return;
|
|
21463
|
-
const abs = normalizePath(
|
|
21388
|
+
const abs = normalizePath(resolve28(cwd2, path));
|
|
21464
21389
|
if (!roots.includes(abs))
|
|
21465
21390
|
roots.push(abs);
|
|
21466
21391
|
};
|
|
@@ -21485,7 +21410,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
21485
21410
|
push(cfg.assetsDir);
|
|
21486
21411
|
push(cfg.stylesDir);
|
|
21487
21412
|
for (const candidate of ["src", "db", "assets", "styles"]) {
|
|
21488
|
-
const abs = normalizePath(
|
|
21413
|
+
const abs = normalizePath(resolve28(cwd2, candidate));
|
|
21489
21414
|
if (existsSync29(abs) && !roots.includes(abs))
|
|
21490
21415
|
roots.push(abs);
|
|
21491
21416
|
}
|
|
@@ -21497,7 +21422,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
21497
21422
|
continue;
|
|
21498
21423
|
if (entry.name.startsWith("."))
|
|
21499
21424
|
continue;
|
|
21500
|
-
const abs = normalizePath(
|
|
21425
|
+
const abs = normalizePath(resolve28(cwd2, entry.name));
|
|
21501
21426
|
if (roots.includes(abs))
|
|
21502
21427
|
continue;
|
|
21503
21428
|
if (shouldIgnorePath(abs, resolved))
|
|
@@ -21572,7 +21497,7 @@ var init_pathUtils = __esm(() => {
|
|
|
21572
21497
|
// src/dev/fileWatcher.ts
|
|
21573
21498
|
import { watch } from "fs";
|
|
21574
21499
|
import { existsSync as existsSync30, readdirSync as readdirSync5, statSync as statSync4 } from "fs";
|
|
21575
|
-
import { dirname as
|
|
21500
|
+
import { dirname as dirname19, join as join36, resolve as resolve29 } from "path";
|
|
21576
21501
|
var safeRemoveFromGraph = (graph, fullPath) => {
|
|
21577
21502
|
try {
|
|
21578
21503
|
removeFileFromGraph(graph, fullPath);
|
|
@@ -21630,7 +21555,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
21630
21555
|
return;
|
|
21631
21556
|
if (shouldSkipFilename(filename, isStylesDir)) {
|
|
21632
21557
|
if (event === "rename") {
|
|
21633
|
-
const eventDir =
|
|
21558
|
+
const eventDir = dirname19(join36(absolutePath, filename)).replace(/\\/g, "/");
|
|
21634
21559
|
atomicRecoveryScan(eventDir);
|
|
21635
21560
|
}
|
|
21636
21561
|
return;
|
|
@@ -21653,7 +21578,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
21653
21578
|
}, addFileWatchers = (state, paths, onFileChange) => {
|
|
21654
21579
|
const stylesDir = state.resolvedPaths?.stylesDir;
|
|
21655
21580
|
paths.forEach((path) => {
|
|
21656
|
-
const absolutePath =
|
|
21581
|
+
const absolutePath = resolve29(path).replace(/\\/g, "/");
|
|
21657
21582
|
if (!existsSync30(absolutePath)) {
|
|
21658
21583
|
return;
|
|
21659
21584
|
}
|
|
@@ -21664,7 +21589,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
21664
21589
|
const watchPaths = getWatchPaths(config, state.resolvedPaths);
|
|
21665
21590
|
const stylesDir = state.resolvedPaths?.stylesDir;
|
|
21666
21591
|
watchPaths.forEach((path) => {
|
|
21667
|
-
const absolutePath =
|
|
21592
|
+
const absolutePath = resolve29(path).replace(/\\/g, "/");
|
|
21668
21593
|
if (!existsSync30(absolutePath)) {
|
|
21669
21594
|
return;
|
|
21670
21595
|
}
|
|
@@ -21683,13 +21608,13 @@ var init_fileWatcher = __esm(() => {
|
|
|
21683
21608
|
});
|
|
21684
21609
|
|
|
21685
21610
|
// src/dev/assetStore.ts
|
|
21686
|
-
import { resolve as
|
|
21611
|
+
import { resolve as resolve30 } from "path";
|
|
21687
21612
|
import { readdir as readdir4, unlink } from "fs/promises";
|
|
21688
21613
|
var mimeTypes, getMimeType = (filePath) => {
|
|
21689
21614
|
const ext = filePath.slice(filePath.lastIndexOf("."));
|
|
21690
21615
|
return mimeTypes[ext] ?? "application/octet-stream";
|
|
21691
21616
|
}, HASHED_FILE_RE, stripHash = (webPath) => webPath.replace(/\.[a-z0-9]{8}(\.(js|css|mjs))$/, "$1"), processWalkEntry = (entry, dir, liveByIdentity, walkAndClean) => {
|
|
21692
|
-
const fullPath =
|
|
21617
|
+
const fullPath = resolve30(dir, entry.name);
|
|
21693
21618
|
if (entry.isDirectory()) {
|
|
21694
21619
|
return walkAndClean(fullPath);
|
|
21695
21620
|
}
|
|
@@ -21705,10 +21630,10 @@ var mimeTypes, getMimeType = (filePath) => {
|
|
|
21705
21630
|
}, cleanStaleAssets = async (store, manifest, buildDir) => {
|
|
21706
21631
|
const liveByIdentity = new Map;
|
|
21707
21632
|
for (const webPath of store.keys()) {
|
|
21708
|
-
const diskPath =
|
|
21633
|
+
const diskPath = resolve30(buildDir, webPath.slice(1));
|
|
21709
21634
|
liveByIdentity.set(stripHash(diskPath), diskPath);
|
|
21710
21635
|
}
|
|
21711
|
-
const absBuildDir =
|
|
21636
|
+
const absBuildDir = resolve30(buildDir);
|
|
21712
21637
|
Object.values(manifest).forEach((val) => {
|
|
21713
21638
|
if (!HASHED_FILE_RE.test(val))
|
|
21714
21639
|
return;
|
|
@@ -21726,7 +21651,7 @@ var mimeTypes, getMimeType = (filePath) => {
|
|
|
21726
21651
|
} catch {}
|
|
21727
21652
|
}, lookupAsset = (store, path) => store.get(path), processScanEntry = (entry, dir, prefix, store, scanDir) => {
|
|
21728
21653
|
if (entry.isDirectory()) {
|
|
21729
|
-
return scanDir(
|
|
21654
|
+
return scanDir(resolve30(dir, entry.name), `${prefix}${entry.name}/`);
|
|
21730
21655
|
}
|
|
21731
21656
|
if (!entry.name.startsWith("chunk-")) {
|
|
21732
21657
|
return null;
|
|
@@ -21735,7 +21660,7 @@ var mimeTypes, getMimeType = (filePath) => {
|
|
|
21735
21660
|
if (store.has(webPath)) {
|
|
21736
21661
|
return null;
|
|
21737
21662
|
}
|
|
21738
|
-
return Bun.file(
|
|
21663
|
+
return Bun.file(resolve30(dir, entry.name)).bytes().then((bytes) => {
|
|
21739
21664
|
store.set(webPath, bytes);
|
|
21740
21665
|
return;
|
|
21741
21666
|
}).catch(() => {});
|
|
@@ -21757,7 +21682,7 @@ var mimeTypes, getMimeType = (filePath) => {
|
|
|
21757
21682
|
for (const webPath of newIdentities.values()) {
|
|
21758
21683
|
if (store.has(webPath))
|
|
21759
21684
|
continue;
|
|
21760
|
-
loadPromises.push(Bun.file(
|
|
21685
|
+
loadPromises.push(Bun.file(resolve30(buildDir, webPath.slice(1))).bytes().then((bytes) => {
|
|
21761
21686
|
store.set(webPath, bytes);
|
|
21762
21687
|
return;
|
|
21763
21688
|
}).catch(() => {}));
|
|
@@ -21788,7 +21713,7 @@ var init_assetStore = __esm(() => {
|
|
|
21788
21713
|
|
|
21789
21714
|
// src/islands/pageMetadata.ts
|
|
21790
21715
|
import { readFileSync as readFileSync21 } from "fs";
|
|
21791
|
-
import { dirname as
|
|
21716
|
+
import { dirname as dirname20, resolve as resolve31 } from "path";
|
|
21792
21717
|
var pagePatterns, getPageDirs = (config) => [
|
|
21793
21718
|
{ dir: config.angularDirectory, framework: "angular" },
|
|
21794
21719
|
{ dir: config.emberDirectory, framework: "ember" },
|
|
@@ -21808,15 +21733,15 @@ var pagePatterns, getPageDirs = (config) => [
|
|
|
21808
21733
|
const source = definition.buildReference?.source;
|
|
21809
21734
|
if (!source)
|
|
21810
21735
|
continue;
|
|
21811
|
-
const resolvedSource = source.startsWith("file://") ? new URL(source).pathname :
|
|
21812
|
-
lookup.set(`${definition.framework}:${definition.component}`,
|
|
21736
|
+
const resolvedSource = source.startsWith("file://") ? new URL(source).pathname : resolve31(dirname20(buildInfo.resolvedRegistryPath), source);
|
|
21737
|
+
lookup.set(`${definition.framework}:${definition.component}`, resolve31(resolvedSource));
|
|
21813
21738
|
}
|
|
21814
21739
|
return lookup;
|
|
21815
21740
|
}, getCurrentPageIslandMetadata = () => globalThis.__absolutePageIslandMetadata ?? new Map, metadataUsesSource = (metadata, target) => metadata.islands.some((usage) => {
|
|
21816
21741
|
const candidate = usage.source;
|
|
21817
|
-
return candidate ?
|
|
21742
|
+
return candidate ? resolve31(candidate) === target : false;
|
|
21818
21743
|
}), getPagesUsingIslandSource = (sourcePath) => {
|
|
21819
|
-
const target =
|
|
21744
|
+
const target = resolve31(sourcePath);
|
|
21820
21745
|
return [...getCurrentPageIslandMetadata().values()].filter((metadata) => metadataUsesSource(metadata, target)).map((metadata) => metadata.pagePath);
|
|
21821
21746
|
}, resolveIslandUsages = (islands, islandSourceLookup) => islands.map((usage) => {
|
|
21822
21747
|
const sourcePath = islandSourceLookup.get(`${usage.framework}:${usage.component}`);
|
|
@@ -21828,13 +21753,13 @@ var pagePatterns, getPageDirs = (config) => [
|
|
|
21828
21753
|
const pattern = pagePatterns[entry.framework];
|
|
21829
21754
|
if (!pattern)
|
|
21830
21755
|
return;
|
|
21831
|
-
const files = await scanEntryPoints(
|
|
21756
|
+
const files = await scanEntryPoints(resolve31(entry.dir), pattern);
|
|
21832
21757
|
for (const filePath of files) {
|
|
21833
21758
|
const source = readFileSync21(filePath, "utf-8");
|
|
21834
21759
|
const islands = extractIslandUsagesFromSource(source);
|
|
21835
|
-
pageMetadata.set(
|
|
21760
|
+
pageMetadata.set(resolve31(filePath), {
|
|
21836
21761
|
islands: resolveIslandUsages(islands, islandSourceLookup),
|
|
21837
|
-
pagePath:
|
|
21762
|
+
pagePath: resolve31(filePath)
|
|
21838
21763
|
});
|
|
21839
21764
|
}
|
|
21840
21765
|
}, loadPageIslandMetadata = async (config) => {
|
|
@@ -21957,9 +21882,9 @@ var init_transformCache = __esm(() => {
|
|
|
21957
21882
|
});
|
|
21958
21883
|
|
|
21959
21884
|
// src/dev/reactComponentClassifier.ts
|
|
21960
|
-
import { resolve as
|
|
21885
|
+
import { resolve as resolve32 } from "path";
|
|
21961
21886
|
var classifyComponent = (filePath) => {
|
|
21962
|
-
const normalizedPath =
|
|
21887
|
+
const normalizedPath = resolve32(filePath);
|
|
21963
21888
|
if (normalizedPath.includes("/react/pages/")) {
|
|
21964
21889
|
return "server";
|
|
21965
21890
|
}
|
|
@@ -21971,7 +21896,7 @@ var classifyComponent = (filePath) => {
|
|
|
21971
21896
|
var init_reactComponentClassifier = () => {};
|
|
21972
21897
|
|
|
21973
21898
|
// src/dev/moduleMapper.ts
|
|
21974
|
-
import { basename as basename11, resolve as
|
|
21899
|
+
import { basename as basename11, resolve as resolve33 } from "path";
|
|
21975
21900
|
var buildModulePaths = (moduleKeys, manifest) => {
|
|
21976
21901
|
const modulePaths = {};
|
|
21977
21902
|
moduleKeys.forEach((key) => {
|
|
@@ -21981,7 +21906,7 @@ var buildModulePaths = (moduleKeys, manifest) => {
|
|
|
21981
21906
|
});
|
|
21982
21907
|
return modulePaths;
|
|
21983
21908
|
}, processChangedFile = (sourceFile, framework, manifest, resolvedPaths, processedFiles) => {
|
|
21984
|
-
const normalizedFile =
|
|
21909
|
+
const normalizedFile = resolve33(sourceFile);
|
|
21985
21910
|
const normalizedPath = normalizedFile.replace(/\\/g, "/");
|
|
21986
21911
|
if (processedFiles.has(normalizedFile)) {
|
|
21987
21912
|
return null;
|
|
@@ -22017,7 +21942,7 @@ var buildModulePaths = (moduleKeys, manifest) => {
|
|
|
22017
21942
|
});
|
|
22018
21943
|
return grouped;
|
|
22019
21944
|
}, mapSourceFileToManifestKeys = (sourceFile, framework, resolvedPaths) => {
|
|
22020
|
-
const normalizedFile =
|
|
21945
|
+
const normalizedFile = resolve33(sourceFile);
|
|
22021
21946
|
const fileName = basename11(normalizedFile);
|
|
22022
21947
|
const baseName = fileName.replace(/\.(tsx?|jsx?|vue|svelte|css|html)$/, "");
|
|
22023
21948
|
const pascalName = toPascal(baseName);
|
|
@@ -22079,7 +22004,7 @@ __export(exports_resolveOwningComponents, {
|
|
|
22079
22004
|
invalidateResourceIndex: () => invalidateResourceIndex
|
|
22080
22005
|
});
|
|
22081
22006
|
import { readdirSync as readdirSync6, readFileSync as readFileSync23, statSync as statSync5 } from "fs";
|
|
22082
|
-
import { dirname as
|
|
22007
|
+
import { dirname as dirname21, extname as extname9, join as join37, resolve as resolve34 } from "path";
|
|
22083
22008
|
import ts14 from "typescript";
|
|
22084
22009
|
var ENTITY_DECORATORS, isAngularSourceFile = (file4) => file4.endsWith(".ts") || file4.endsWith(".tsx"), walkAngularSourceFiles = (root) => {
|
|
22085
22010
|
const out = [];
|
|
@@ -22192,7 +22117,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file4) => file4.endsWith(".ts") ||
|
|
|
22192
22117
|
};
|
|
22193
22118
|
visit(sourceFile);
|
|
22194
22119
|
return out;
|
|
22195
|
-
}, safeNormalize = (path) =>
|
|
22120
|
+
}, safeNormalize = (path) => resolve34(path).replace(/\\/g, "/"), resolveOwningComponents = (params) => {
|
|
22196
22121
|
const { changedFilePath, userAngularRoot } = params;
|
|
22197
22122
|
const changedAbs = safeNormalize(changedFilePath);
|
|
22198
22123
|
const out = [];
|
|
@@ -22233,7 +22158,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file4) => file4.endsWith(".ts") ||
|
|
|
22233
22158
|
return null;
|
|
22234
22159
|
}
|
|
22235
22160
|
const sf = ts14.createSourceFile(childFilePath, source, ts14.ScriptTarget.ES2022, true, ts14.ScriptKind.TS);
|
|
22236
|
-
const childDir =
|
|
22161
|
+
const childDir = dirname21(childFilePath);
|
|
22237
22162
|
for (const stmt of sf.statements) {
|
|
22238
22163
|
if (!ts14.isImportDeclaration(stmt))
|
|
22239
22164
|
continue;
|
|
@@ -22261,7 +22186,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file4) => file4.endsWith(".ts") ||
|
|
|
22261
22186
|
if (!spec.startsWith(".") && !spec.startsWith("/")) {
|
|
22262
22187
|
return null;
|
|
22263
22188
|
}
|
|
22264
|
-
const base =
|
|
22189
|
+
const base = resolve34(childDir, spec);
|
|
22265
22190
|
const candidates = [
|
|
22266
22191
|
`${base}.ts`,
|
|
22267
22192
|
`${base}.tsx`,
|
|
@@ -22290,7 +22215,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file4) => file4.endsWith(".ts") ||
|
|
|
22290
22215
|
const parentFile = new Map;
|
|
22291
22216
|
for (const tsPath of walkAngularSourceFiles(userAngularRoot)) {
|
|
22292
22217
|
const classes = parseDecoratedClasses(tsPath);
|
|
22293
|
-
const componentDir =
|
|
22218
|
+
const componentDir = dirname21(tsPath);
|
|
22294
22219
|
for (const cls of classes) {
|
|
22295
22220
|
const entity = {
|
|
22296
22221
|
className: cls.className,
|
|
@@ -22299,7 +22224,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file4) => file4.endsWith(".ts") ||
|
|
|
22299
22224
|
};
|
|
22300
22225
|
if (cls.kind === "component") {
|
|
22301
22226
|
for (const url of [...cls.templateUrls, ...cls.styleUrls]) {
|
|
22302
|
-
const abs = safeNormalize(
|
|
22227
|
+
const abs = safeNormalize(resolve34(componentDir, url));
|
|
22303
22228
|
const existing = resource.get(abs);
|
|
22304
22229
|
if (existing)
|
|
22305
22230
|
existing.push(entity);
|
|
@@ -22484,7 +22409,7 @@ __export(exports_loadConfig, {
|
|
|
22484
22409
|
isWorkspaceConfig: () => isWorkspaceConfig,
|
|
22485
22410
|
getWorkspaceServices: () => getWorkspaceServices
|
|
22486
22411
|
});
|
|
22487
|
-
import { resolve as
|
|
22412
|
+
import { resolve as resolve35 } from "path";
|
|
22488
22413
|
var RESERVED_TOP_LEVEL_KEYS, isObject2 = (value) => typeof value === "object" && value !== null, isCommandService = (service) => service.kind === "command" || Array.isArray(service.command), isServiceCandidate = (value) => isObject2(value) && (typeof value.entry === "string" || Array.isArray(value.command)), isWorkspaceConfig = (config) => {
|
|
22489
22414
|
if (!isObject2(config)) {
|
|
22490
22415
|
return false;
|
|
@@ -22535,7 +22460,7 @@ var RESERVED_TOP_LEVEL_KEYS, isObject2 = (value) => typeof value === "object" &&
|
|
|
22535
22460
|
}
|
|
22536
22461
|
return config;
|
|
22537
22462
|
}, loadRawConfig = async (configPath2) => {
|
|
22538
|
-
const resolved =
|
|
22463
|
+
const resolved = resolve35(configPath2 ?? process.env.ABSOLUTE_CONFIG ?? "absolute.config.ts");
|
|
22539
22464
|
const mod = await import(resolved);
|
|
22540
22465
|
const config = mod.default ?? mod.config;
|
|
22541
22466
|
if (!config) {
|
|
@@ -22596,7 +22521,7 @@ __export(exports_moduleServer, {
|
|
|
22596
22521
|
SRC_URL_PREFIX: () => SRC_URL_PREFIX
|
|
22597
22522
|
});
|
|
22598
22523
|
import { existsSync as existsSync31, readFileSync as readFileSync24, statSync as statSync6 } from "fs";
|
|
22599
|
-
import { basename as basename12, dirname as
|
|
22524
|
+
import { basename as basename12, dirname as dirname22, extname as extname10, join as join38, resolve as resolve36, relative as relative14 } from "path";
|
|
22600
22525
|
var SRC_PREFIX = "/@src/", jsTranspiler2, tsTranspiler2, tsxTranspiler, TRANSPILABLE, ALL_EXPORTS_RE, STRING_CONTENTS_RE, preserveTypeExports = (originalSource, transpiled, valueExports) => {
|
|
22601
22526
|
const codeOnly = originalSource.replace(STRING_CONTENTS_RE, '""');
|
|
22602
22527
|
const allExports = [];
|
|
@@ -22616,7 +22541,7 @@ var SRC_PREFIX = "/@src/", jsTranspiler2, tsTranspiler2, tsxTranspiler, TRANSPIL
|
|
|
22616
22541
|
${stubs}
|
|
22617
22542
|
`;
|
|
22618
22543
|
}, resolveRelativeExtension = (srcPath, projectRoot, extensions) => {
|
|
22619
|
-
const found = extensions.find((ext) => existsSync31(
|
|
22544
|
+
const found = extensions.find((ext) => existsSync31(resolve36(projectRoot, srcPath + ext)));
|
|
22620
22545
|
return found ? srcPath + found : srcPath;
|
|
22621
22546
|
}, IMPORT_EXTENSIONS, SIDE_EFFECT_EXTENSIONS, MODULE_EXTENSIONS, RESOLVED_MODULE_EXTENSIONS, REACT_EXTENSIONS, escapeRegex3 = (str) => str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), buildImportRewriter = (vendorPaths) => {
|
|
22622
22547
|
const entries = Object.entries(vendorPaths).sort(([a], [b2]) => b2.length - a.length);
|
|
@@ -22631,7 +22556,7 @@ ${stubs}
|
|
|
22631
22556
|
return invalidationVersion > 0 ? `${mtime}.${invalidationVersion}` : `${mtime}`;
|
|
22632
22557
|
}, srcUrl = (relPath, projectRoot) => {
|
|
22633
22558
|
const base = `${SRC_PREFIX}${relPath.replace(/\\/g, "/")}`;
|
|
22634
|
-
const absPath =
|
|
22559
|
+
const absPath = resolve36(projectRoot, relPath);
|
|
22635
22560
|
const cached = mtimeCache.get(absPath);
|
|
22636
22561
|
if (cached !== undefined)
|
|
22637
22562
|
return `${base}?v=${buildVersion(cached, absPath)}`;
|
|
@@ -22643,12 +22568,12 @@ ${stubs}
|
|
|
22643
22568
|
return base;
|
|
22644
22569
|
}
|
|
22645
22570
|
}, resolveRelativeImport = (relPath, fileDir, projectRoot, extensions) => {
|
|
22646
|
-
const absPath =
|
|
22571
|
+
const absPath = resolve36(fileDir, relPath);
|
|
22647
22572
|
const rel = relative14(projectRoot, absPath);
|
|
22648
22573
|
const extension = extname10(rel);
|
|
22649
22574
|
let srcPath = RESOLVED_MODULE_EXTENSIONS.has(extension) ? rel : resolveRelativeExtension(rel, projectRoot, extensions);
|
|
22650
22575
|
if (extname10(srcPath) === ".svelte") {
|
|
22651
|
-
srcPath = relative14(projectRoot, resolveSvelteModulePath(
|
|
22576
|
+
srcPath = relative14(projectRoot, resolveSvelteModulePath(resolve36(projectRoot, srcPath)));
|
|
22652
22577
|
}
|
|
22653
22578
|
return srcUrl(srcPath, projectRoot);
|
|
22654
22579
|
}, NODE_BUILTIN_RE, resolveAbsoluteSpecifier = (specifier, projectRoot) => {
|
|
@@ -22667,13 +22592,13 @@ ${stubs}
|
|
|
22667
22592
|
const packageName = isScoped ? `${parts[0]}/${parts[1]}` : parts[0];
|
|
22668
22593
|
const subpath = isScoped ? parts.slice(2).join("/") : parts.slice(1).join("/");
|
|
22669
22594
|
if (!subpath) {
|
|
22670
|
-
const pkgDir =
|
|
22595
|
+
const pkgDir = resolve36(projectRoot, "node_modules", packageName ?? "");
|
|
22671
22596
|
const pkgJsonPath = join38(pkgDir, "package.json");
|
|
22672
22597
|
if (existsSync31(pkgJsonPath)) {
|
|
22673
22598
|
const pkg = JSON.parse(readFileSync24(pkgJsonPath, "utf-8"));
|
|
22674
22599
|
const esmEntry = typeof pkg.module === "string" && pkg.module || typeof pkg.browser === "string" && pkg.browser;
|
|
22675
22600
|
if (esmEntry) {
|
|
22676
|
-
const resolved =
|
|
22601
|
+
const resolved = resolve36(pkgDir, esmEntry);
|
|
22677
22602
|
if (existsSync31(resolved))
|
|
22678
22603
|
return relative14(projectRoot, resolved);
|
|
22679
22604
|
}
|
|
@@ -22705,7 +22630,7 @@ ${stubs}
|
|
|
22705
22630
|
};
|
|
22706
22631
|
result = result.replace(/^((?:import\s+[\s\S]+?\s+from|export\s+[\s\S]+?\s+from|import)\s*["'])([^"'./][^"']*)(["'])/gm, stubReplace);
|
|
22707
22632
|
result = result.replace(/(import\s*\(\s*["'])([^"'./][^"']*)(["']\s*\))/g, stubReplace);
|
|
22708
|
-
const fileDir =
|
|
22633
|
+
const fileDir = dirname22(filePath);
|
|
22709
22634
|
result = result.replace(/(from\s*["'])(\.\.?\/[^"']+)(["'])/g, (_match, prefix, relPath, suffix) => `${prefix}${resolveRelativeImport(relPath, fileDir, projectRoot, IMPORT_EXTENSIONS)}${suffix}`);
|
|
22710
22635
|
result = result.replace(/(import\s*\(\s*["'])(\.\.?\/[^"']+)(["']\s*\))/g, (_match, prefix, relPath, suffix) => `${prefix}${resolveRelativeImport(relPath, fileDir, projectRoot, IMPORT_EXTENSIONS)}${suffix}`);
|
|
22711
22636
|
result = result.replace(/(import\s*["'])(\.\.?\/[^"']+)(["']\s*;?)/g, (_match, prefix, relPath, suffix) => `${prefix}${resolveRelativeImport(relPath, fileDir, projectRoot, SIDE_EFFECT_EXTENSIONS)}${suffix}`);
|
|
@@ -22720,12 +22645,12 @@ ${stubs}
|
|
|
22720
22645
|
result = result.replace(/((?:from|import)\s*["'])(\/[^"']+\.(tsx?|jsx?|ts))(["'])/g, rewriteAbsoluteToSrc);
|
|
22721
22646
|
result = result.replace(/(import\s*\(\s*["'])(\/[^"']+\.(tsx?|jsx?|ts))(["']\s*\))/g, rewriteAbsoluteToSrc);
|
|
22722
22647
|
result = result.replace(/new\s+URL\(\s*["'](\.\.?\/[^"']+)["']\s*,\s*import\.meta\.url\s*\)/g, (_match, relPath) => {
|
|
22723
|
-
const absPath =
|
|
22648
|
+
const absPath = resolve36(fileDir, relPath);
|
|
22724
22649
|
const rel = relative14(projectRoot, absPath);
|
|
22725
22650
|
return `new URL('${srcUrl(rel, projectRoot)}', import.meta.url)`;
|
|
22726
22651
|
});
|
|
22727
22652
|
result = result.replace(/import\.meta\.resolve\(\s*["'](\.\.?\/[^"']+)["']\s*\)/g, (_match, relPath) => {
|
|
22728
|
-
const absPath =
|
|
22653
|
+
const absPath = resolve36(fileDir, relPath);
|
|
22729
22654
|
const rel = relative14(projectRoot, absPath);
|
|
22730
22655
|
return `'${srcUrl(rel, projectRoot)}'`;
|
|
22731
22656
|
});
|
|
@@ -23038,7 +22963,7 @@ ${code}`;
|
|
|
23038
22963
|
code = injectVueHmr(code, filePath, projectRoot, vueDir);
|
|
23039
22964
|
return rewriteImports(code, filePath, projectRoot, rewriter);
|
|
23040
22965
|
}, injectVueHmr = (code, filePath, projectRoot, vueDir) => {
|
|
23041
|
-
const hmrBase = vueDir ?
|
|
22966
|
+
const hmrBase = vueDir ? resolve36(vueDir) : projectRoot;
|
|
23042
22967
|
const hmrId = relative14(hmrBase, filePath).replace(/\\/g, "/").replace(/\.vue$/, "");
|
|
23043
22968
|
let result = code.replace(/export\s+default\s+/, "var __hmr_comp__ = ");
|
|
23044
22969
|
result += [
|
|
@@ -23202,7 +23127,7 @@ export default {};
|
|
|
23202
23127
|
const escaped = virtualCss.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$/g, "\\$");
|
|
23203
23128
|
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);`);
|
|
23204
23129
|
}, resolveSourcePath = (relPath, projectRoot) => {
|
|
23205
|
-
const filePath =
|
|
23130
|
+
const filePath = resolve36(projectRoot, relPath);
|
|
23206
23131
|
const ext = extname10(filePath);
|
|
23207
23132
|
if (ext === ".svelte")
|
|
23208
23133
|
return { ext, filePath: resolveSvelteModulePath(filePath) };
|
|
@@ -23239,14 +23164,14 @@ export default {};
|
|
|
23239
23164
|
const absoluteCandidate = "/" + tail.replace(/^\/+/, "");
|
|
23240
23165
|
const candidates = [
|
|
23241
23166
|
absoluteCandidate,
|
|
23242
|
-
|
|
23167
|
+
resolve36(projectRoot, tail)
|
|
23243
23168
|
];
|
|
23244
23169
|
try {
|
|
23245
23170
|
const { loadConfig: loadConfig2 } = await Promise.resolve().then(() => (init_loadConfig(), exports_loadConfig));
|
|
23246
23171
|
const cfg = await loadConfig2();
|
|
23247
|
-
const angularDir = cfg.angularDirectory &&
|
|
23172
|
+
const angularDir = cfg.angularDirectory && resolve36(projectRoot, cfg.angularDirectory);
|
|
23248
23173
|
if (angularDir)
|
|
23249
|
-
candidates.push(
|
|
23174
|
+
candidates.push(resolve36(angularDir, tail));
|
|
23250
23175
|
} catch {}
|
|
23251
23176
|
for (const candidate of candidates) {
|
|
23252
23177
|
if (await fileExists(candidate)) {
|
|
@@ -23277,7 +23202,7 @@ export default {};
|
|
|
23277
23202
|
if (!TRANSPILABLE.has(ext))
|
|
23278
23203
|
return;
|
|
23279
23204
|
const stat3 = statSync6(filePath);
|
|
23280
|
-
const resolvedVueDir = vueDir ?
|
|
23205
|
+
const resolvedVueDir = vueDir ? resolve36(vueDir) : undefined;
|
|
23281
23206
|
let content = REACT_EXTENSIONS.has(ext) ? transformReactFile(filePath, projectRoot, rewriter) : transformPlainFile(filePath, projectRoot, rewriter, resolvedVueDir);
|
|
23282
23207
|
const isAngularGeneratedJs = ext === ".js" && filePath.replace(/\\/g, "/").includes("/.absolutejs/generated/angular/");
|
|
23283
23208
|
if (isAngularGeneratedJs) {
|
|
@@ -23336,7 +23261,7 @@ export default {};
|
|
|
23336
23261
|
const relPath = pathname.slice(SRC_PREFIX.length);
|
|
23337
23262
|
if (relPath === "bun:wrap" || relPath.startsWith("bun:wrap?"))
|
|
23338
23263
|
return handleBunWrapRequest();
|
|
23339
|
-
const virtualCssResponse = handleVirtualSvelteCss(
|
|
23264
|
+
const virtualCssResponse = handleVirtualSvelteCss(resolve36(projectRoot, relPath));
|
|
23340
23265
|
if (virtualCssResponse)
|
|
23341
23266
|
return virtualCssResponse;
|
|
23342
23267
|
const { filePath, ext } = resolveSourcePath(relPath, projectRoot);
|
|
@@ -23352,11 +23277,11 @@ export default {};
|
|
|
23352
23277
|
SRC_IMPORT_RE.lastIndex = 0;
|
|
23353
23278
|
while ((match = SRC_IMPORT_RE.exec(content)) !== null) {
|
|
23354
23279
|
if (match[1])
|
|
23355
|
-
files.push(
|
|
23280
|
+
files.push(resolve36(projectRoot, match[1]));
|
|
23356
23281
|
}
|
|
23357
23282
|
return files;
|
|
23358
23283
|
}, invalidateModule = (filePath) => {
|
|
23359
|
-
const resolved =
|
|
23284
|
+
const resolved = resolve36(filePath);
|
|
23360
23285
|
invalidate(filePath);
|
|
23361
23286
|
if (resolved !== filePath)
|
|
23362
23287
|
invalidate(resolved);
|
|
@@ -23501,7 +23426,7 @@ __export(exports_hmrCompiler, {
|
|
|
23501
23426
|
getApplyMetadataModule: () => getApplyMetadataModule,
|
|
23502
23427
|
encodeHmrComponentId: () => encodeHmrComponentId
|
|
23503
23428
|
});
|
|
23504
|
-
import { dirname as
|
|
23429
|
+
import { dirname as dirname23, relative as relative15, resolve as resolve37 } from "path";
|
|
23505
23430
|
import { performance as performance2 } from "perf_hooks";
|
|
23506
23431
|
var getApplyMetadataModule = async (encodedId) => {
|
|
23507
23432
|
const decoded = decodeURIComponent(encodedId);
|
|
@@ -23510,7 +23435,7 @@ var getApplyMetadataModule = async (encodedId) => {
|
|
|
23510
23435
|
return null;
|
|
23511
23436
|
const filePathRel = decoded.slice(0, at2);
|
|
23512
23437
|
const className = decoded.slice(at2 + 1);
|
|
23513
|
-
const componentFilePath =
|
|
23438
|
+
const componentFilePath = resolve37(process.cwd(), filePathRel);
|
|
23514
23439
|
const projectRelPath = relative15(process.cwd(), componentFilePath).replace(/\\/g, "/");
|
|
23515
23440
|
const cacheKey2 = encodeURIComponent(`${projectRelPath}@${className}`);
|
|
23516
23441
|
const { takePendingModule: takePendingModule2 } = await Promise.resolve().then(() => (init_fastHmrCompiler(), exports_fastHmrCompiler));
|
|
@@ -23521,7 +23446,7 @@ var getApplyMetadataModule = async (encodedId) => {
|
|
|
23521
23446
|
const { resolveOwningComponents: resolveOwningComponents2 } = await Promise.resolve().then(() => (init_resolveOwningComponents(), exports_resolveOwningComponents));
|
|
23522
23447
|
const owners = resolveOwningComponents2({
|
|
23523
23448
|
changedFilePath: componentFilePath,
|
|
23524
|
-
userAngularRoot:
|
|
23449
|
+
userAngularRoot: dirname23(componentFilePath)
|
|
23525
23450
|
});
|
|
23526
23451
|
const owner = owners.find((o3) => o3.className === className);
|
|
23527
23452
|
const kind = owner?.kind ?? "component";
|
|
@@ -23672,11 +23597,11 @@ var exports_simpleHTMLHMR = {};
|
|
|
23672
23597
|
__export(exports_simpleHTMLHMR, {
|
|
23673
23598
|
handleHTMLUpdate: () => handleHTMLUpdate
|
|
23674
23599
|
});
|
|
23675
|
-
import { resolve as
|
|
23600
|
+
import { resolve as resolve38 } from "path";
|
|
23676
23601
|
var handleHTMLUpdate = async (htmlFilePath) => {
|
|
23677
23602
|
let htmlContent;
|
|
23678
23603
|
try {
|
|
23679
|
-
const resolvedPath =
|
|
23604
|
+
const resolvedPath = resolve38(htmlFilePath);
|
|
23680
23605
|
const file4 = Bun.file(resolvedPath);
|
|
23681
23606
|
if (!await file4.exists()) {
|
|
23682
23607
|
return null;
|
|
@@ -23702,11 +23627,11 @@ var exports_simpleHTMXHMR = {};
|
|
|
23702
23627
|
__export(exports_simpleHTMXHMR, {
|
|
23703
23628
|
handleHTMXUpdate: () => handleHTMXUpdate
|
|
23704
23629
|
});
|
|
23705
|
-
import { resolve as
|
|
23630
|
+
import { resolve as resolve39 } from "path";
|
|
23706
23631
|
var handleHTMXUpdate = async (htmxFilePath) => {
|
|
23707
23632
|
let htmlContent;
|
|
23708
23633
|
try {
|
|
23709
|
-
const resolvedPath =
|
|
23634
|
+
const resolvedPath = resolve39(htmxFilePath);
|
|
23710
23635
|
const file4 = Bun.file(resolvedPath);
|
|
23711
23636
|
if (!await file4.exists()) {
|
|
23712
23637
|
return null;
|
|
@@ -23729,7 +23654,7 @@ var init_simpleHTMXHMR = () => {};
|
|
|
23729
23654
|
|
|
23730
23655
|
// src/dev/rebuildTrigger.ts
|
|
23731
23656
|
import { existsSync as existsSync32, rmSync as rmSync3 } from "fs";
|
|
23732
|
-
import { basename as basename13, dirname as
|
|
23657
|
+
import { basename as basename13, dirname as dirname24, join as join39, relative as relative16, resolve as resolve40, sep as sep4 } from "path";
|
|
23733
23658
|
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) => {
|
|
23734
23659
|
if (!config.tailwind)
|
|
23735
23660
|
return;
|
|
@@ -23741,7 +23666,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
23741
23666
|
if (!cssChanged)
|
|
23742
23667
|
return;
|
|
23743
23668
|
try {
|
|
23744
|
-
const outputPath =
|
|
23669
|
+
const outputPath = resolve40(state.resolvedPaths.buildDir, config.tailwind.output);
|
|
23745
23670
|
const bytes = await Bun.file(outputPath).bytes();
|
|
23746
23671
|
const webPath = `/${config.tailwind.output.replace(/^\/+/, "")}`;
|
|
23747
23672
|
state.assetStore.set(webPath, bytes);
|
|
@@ -23831,12 +23756,12 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
23831
23756
|
}, isValidDeletedAffectedFile = (affectedFile, deletedPathResolved, processedFiles) => affectedFile !== deletedPathResolved && !processedFiles.has(affectedFile) && existsSync32(affectedFile), FRAMEWORK_DIR_KEYS_FOR_CLEANUP, removeStaleGenerated = (state, deletedFile) => {
|
|
23832
23757
|
const config = state.config;
|
|
23833
23758
|
const cwd2 = process.cwd();
|
|
23834
|
-
const absDeleted =
|
|
23759
|
+
const absDeleted = resolve40(deletedFile).replace(/\\/g, "/");
|
|
23835
23760
|
for (const { configKey, framework } of FRAMEWORK_DIR_KEYS_FOR_CLEANUP) {
|
|
23836
23761
|
const dir = config[configKey];
|
|
23837
23762
|
if (!dir)
|
|
23838
23763
|
continue;
|
|
23839
|
-
const absDir =
|
|
23764
|
+
const absDir = resolve40(cwd2, dir).replace(/\\/g, "/");
|
|
23840
23765
|
if (!absDeleted.startsWith(`${absDir}/`))
|
|
23841
23766
|
continue;
|
|
23842
23767
|
const rel = absDeleted.slice(absDir.length + 1);
|
|
@@ -23860,7 +23785,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
23860
23785
|
removeStaleGenerated(state, filePathInSet);
|
|
23861
23786
|
try {
|
|
23862
23787
|
const affectedFiles = getAffectedFiles(state.dependencyGraph, filePathInSet);
|
|
23863
|
-
const deletedPathResolved =
|
|
23788
|
+
const deletedPathResolved = resolve40(filePathInSet);
|
|
23864
23789
|
affectedFiles.forEach((affectedFile) => {
|
|
23865
23790
|
if (isValidDeletedAffectedFile(affectedFile, deletedPathResolved, processedFiles)) {
|
|
23866
23791
|
validFiles.push(affectedFile);
|
|
@@ -23904,7 +23829,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
23904
23829
|
if (storedHash !== undefined && storedHash === fileHash) {
|
|
23905
23830
|
return;
|
|
23906
23831
|
}
|
|
23907
|
-
const normalizedFilePath =
|
|
23832
|
+
const normalizedFilePath = resolve40(filePathInSet);
|
|
23908
23833
|
if (!processedFiles.has(normalizedFilePath)) {
|
|
23909
23834
|
validFiles.push(normalizedFilePath);
|
|
23910
23835
|
processedFiles.add(normalizedFilePath);
|
|
@@ -24042,7 +23967,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24042
23967
|
const publicDir = state.resolvedPaths.publicDir;
|
|
24043
23968
|
const assetsDir = state.resolvedPaths.assetsDir;
|
|
24044
23969
|
const handleStaticMirror = async (sourceDir, urlPrefix) => {
|
|
24045
|
-
const absSource =
|
|
23970
|
+
const absSource = resolve40(filePath);
|
|
24046
23971
|
const normalizedSource = absSource.replace(/\\/g, "/");
|
|
24047
23972
|
const normalizedDir = sourceDir.replace(/\\/g, "/");
|
|
24048
23973
|
if (!normalizedSource.startsWith(normalizedDir + "/"))
|
|
@@ -24050,10 +23975,10 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24050
23975
|
try {
|
|
24051
23976
|
const relFromDir = normalizedSource.slice(normalizedDir.length + 1);
|
|
24052
23977
|
const buildDir = state.resolvedPaths.buildDir;
|
|
24053
|
-
const destPath =
|
|
23978
|
+
const destPath = resolve40(buildDir, urlPrefix ? `${urlPrefix}/${relFromDir}` : relFromDir);
|
|
24054
23979
|
const { mkdir: mkdir7, copyFile, readFile: readFile6 } = await import("fs/promises");
|
|
24055
|
-
const { dirname:
|
|
24056
|
-
await mkdir7(
|
|
23980
|
+
const { dirname: dirname25 } = await import("path");
|
|
23981
|
+
await mkdir7(dirname25(destPath), { recursive: true });
|
|
24057
23982
|
await copyFile(absSource, destPath);
|
|
24058
23983
|
const bytes = await readFile6(destPath);
|
|
24059
23984
|
const webPath = urlPrefix ? `/${urlPrefix}/${relFromDir}` : `/${relFromDir}`;
|
|
@@ -24076,7 +24001,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24076
24001
|
if (assetsDir && await handleStaticMirror(assetsDir, "assets"))
|
|
24077
24002
|
return;
|
|
24078
24003
|
if (framework === "unknown") {
|
|
24079
|
-
invalidate(
|
|
24004
|
+
invalidate(resolve40(filePath));
|
|
24080
24005
|
const relPath = relative16(process.cwd(), filePath);
|
|
24081
24006
|
logHmrUpdate(relPath);
|
|
24082
24007
|
const angularDir = state.resolvedPaths.angularDir;
|
|
@@ -24084,10 +24009,10 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24084
24009
|
if (angularDir && state.dependencyGraph) {
|
|
24085
24010
|
try {
|
|
24086
24011
|
const { addFileToGraph: addFileToGraph2 } = await Promise.resolve().then(() => (init_dependencyGraph(), exports_dependencyGraph));
|
|
24087
|
-
addFileToGraph2(state.dependencyGraph,
|
|
24088
|
-
const affected = getAffectedFiles(state.dependencyGraph,
|
|
24012
|
+
addFileToGraph2(state.dependencyGraph, resolve40(filePath));
|
|
24013
|
+
const affected = getAffectedFiles(state.dependencyGraph, resolve40(filePath));
|
|
24089
24014
|
for (const dependent of affected) {
|
|
24090
|
-
if (dependent ===
|
|
24015
|
+
if (dependent === resolve40(filePath))
|
|
24091
24016
|
continue;
|
|
24092
24017
|
const dependentFramework = detectFramework(dependent, state.resolvedPaths);
|
|
24093
24018
|
if (dependentFramework !== "angular")
|
|
@@ -24104,14 +24029,14 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24104
24029
|
} catch {}
|
|
24105
24030
|
}
|
|
24106
24031
|
if (!hasAngularDependent) {
|
|
24107
|
-
console.log(`[abs:restart] ${
|
|
24032
|
+
console.log(`[abs:restart] ${resolve40(filePath)}`);
|
|
24108
24033
|
return;
|
|
24109
24034
|
}
|
|
24110
24035
|
try {
|
|
24111
24036
|
const { getFrameworkGeneratedDir: getFrameworkGeneratedDir2 } = await Promise.resolve().then(() => (init_generatedDir(), exports_generatedDir));
|
|
24112
24037
|
const { invalidateModule: invalidateModuleServer } = await Promise.resolve().then(() => (init_moduleServer(), exports_moduleServer));
|
|
24113
24038
|
const generatedAngularRoot = getFrameworkGeneratedDir2("angular");
|
|
24114
|
-
const sourceAbs =
|
|
24039
|
+
const sourceAbs = resolve40(filePath).replace(/\\/g, "/");
|
|
24115
24040
|
const generatedTwin = `${generatedAngularRoot.replace(/\\/g, "/")}${sourceAbs.replace(/\.ts$/, ".js")}`;
|
|
24116
24041
|
invalidateModuleServer(generatedTwin);
|
|
24117
24042
|
} catch {}
|
|
@@ -24145,7 +24070,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24145
24070
|
const userEditedFiles = new Set;
|
|
24146
24071
|
state.fileChangeQueue.forEach((filePaths) => {
|
|
24147
24072
|
for (const filePath2 of filePaths) {
|
|
24148
|
-
userEditedFiles.add(
|
|
24073
|
+
userEditedFiles.add(resolve40(filePath2));
|
|
24149
24074
|
}
|
|
24150
24075
|
});
|
|
24151
24076
|
state.lastUserEditedFiles = userEditedFiles;
|
|
@@ -24174,7 +24099,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24174
24099
|
}
|
|
24175
24100
|
if (!graph)
|
|
24176
24101
|
return componentFile;
|
|
24177
|
-
const dependents = graph.dependents.get(
|
|
24102
|
+
const dependents = graph.dependents.get(resolve40(componentFile));
|
|
24178
24103
|
if (!dependents)
|
|
24179
24104
|
return componentFile;
|
|
24180
24105
|
for (const dep of dependents) {
|
|
@@ -24183,7 +24108,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24183
24108
|
}
|
|
24184
24109
|
return componentFile;
|
|
24185
24110
|
}, resolveAngularPageEntries = (state, angularFiles, angularPagesPath) => {
|
|
24186
|
-
const pageEntries = angularFiles.filter((file4) => file4.endsWith(".ts") &&
|
|
24111
|
+
const pageEntries = angularFiles.filter((file4) => file4.endsWith(".ts") && resolve40(file4).startsWith(angularPagesPath));
|
|
24187
24112
|
if (pageEntries.length > 0 || !state.dependencyGraph) {
|
|
24188
24113
|
return pageEntries;
|
|
24189
24114
|
}
|
|
@@ -24192,7 +24117,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24192
24117
|
const lookupFile = resolveComponentLookupFile(componentFile, state.dependencyGraph);
|
|
24193
24118
|
const affected = getAffectedFiles(state.dependencyGraph, lookupFile);
|
|
24194
24119
|
affected.forEach((file4) => {
|
|
24195
|
-
if (file4.endsWith(".ts") &&
|
|
24120
|
+
if (file4.endsWith(".ts") && resolve40(file4).startsWith(angularPagesPath)) {
|
|
24196
24121
|
resolvedPages.add(file4);
|
|
24197
24122
|
}
|
|
24198
24123
|
});
|
|
@@ -24233,8 +24158,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24233
24158
|
if (serverDirs.length <= 1) {
|
|
24234
24159
|
const dir = getFrameworkGeneratedDir2(framework, projectRoot);
|
|
24235
24160
|
return {
|
|
24236
|
-
serverOutDir:
|
|
24237
|
-
serverRoot:
|
|
24161
|
+
serverOutDir: resolve40(resolvedPaths.buildDir, basename13(dir)),
|
|
24162
|
+
serverRoot: resolve40(dir, "server")
|
|
24238
24163
|
};
|
|
24239
24164
|
}
|
|
24240
24165
|
return {
|
|
@@ -24255,7 +24180,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24255
24180
|
const keepByDir = new Map;
|
|
24256
24181
|
const prefixByDir = new Map;
|
|
24257
24182
|
for (const artifact of freshOutputs) {
|
|
24258
|
-
const dir =
|
|
24183
|
+
const dir = dirname24(artifact.path);
|
|
24259
24184
|
const name = basename13(artifact.path);
|
|
24260
24185
|
const [prefix] = name.split(".");
|
|
24261
24186
|
if (!prefix)
|
|
@@ -24395,8 +24320,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24395
24320
|
if (detected !== "unknown")
|
|
24396
24321
|
continue;
|
|
24397
24322
|
try {
|
|
24398
|
-
const affected = getAffectedFiles(state.dependencyGraph,
|
|
24399
|
-
const hasAngularConsumer = affected.some((dep) => dep !==
|
|
24323
|
+
const affected = getAffectedFiles(state.dependencyGraph, resolve40(editedFile));
|
|
24324
|
+
const hasAngularConsumer = affected.some((dep) => dep !== resolve40(editedFile) && detectFramework(dep, state.resolvedPaths) === "angular");
|
|
24400
24325
|
if (hasAngularConsumer) {
|
|
24401
24326
|
return {
|
|
24402
24327
|
kind: "rebootstrap",
|
|
@@ -24443,7 +24368,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24443
24368
|
}
|
|
24444
24369
|
if (owners.length === 0 && (editedFile.endsWith(".ts") || editedFile.endsWith(".json")) && !editedFile.endsWith(".d.ts")) {
|
|
24445
24370
|
const normalized = editedFile.replace(/\\/g, "/");
|
|
24446
|
-
const angularDirAbs =
|
|
24371
|
+
const angularDirAbs = resolve40(angularDir).replace(/\\/g, "/");
|
|
24447
24372
|
if (normalized.startsWith(angularDirAbs + "/")) {
|
|
24448
24373
|
return {
|
|
24449
24374
|
kind: "rebootstrap",
|
|
@@ -24586,16 +24511,16 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24586
24511
|
};
|
|
24587
24512
|
const fire = () => {
|
|
24588
24513
|
ctx.debounceTimer = null;
|
|
24589
|
-
const
|
|
24514
|
+
const resolve41 = ctx.debouncedResolve;
|
|
24590
24515
|
ctx.debouncedResolve = null;
|
|
24591
24516
|
ctx.debouncedPromise = null;
|
|
24592
24517
|
if (ctx.inFlight) {
|
|
24593
24518
|
ctx.pending = true;
|
|
24594
|
-
ctx.inFlight.finally(() =>
|
|
24519
|
+
ctx.inFlight.finally(() => resolve41?.());
|
|
24595
24520
|
return;
|
|
24596
24521
|
}
|
|
24597
24522
|
ctx.inFlight = drive();
|
|
24598
|
-
ctx.inFlight.finally(() =>
|
|
24523
|
+
ctx.inFlight.finally(() => resolve41?.());
|
|
24599
24524
|
};
|
|
24600
24525
|
return ({ immediate = false } = {}) => {
|
|
24601
24526
|
if (!ctx.debouncedPromise) {
|
|
@@ -24622,9 +24547,9 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24622
24547
|
const diskRefreshPromise = (async () => {
|
|
24623
24548
|
if (!angularDir || editedFiles.size === 0)
|
|
24624
24549
|
return;
|
|
24625
|
-
const angularDirAbs =
|
|
24550
|
+
const angularDirAbs = resolve40(angularDir);
|
|
24626
24551
|
const filesUnderAngular = Array.from(editedFiles).filter((file4) => {
|
|
24627
|
-
const abs =
|
|
24552
|
+
const abs = resolve40(file4);
|
|
24628
24553
|
return abs === angularDirAbs || abs.startsWith(angularDirAbs + sep4);
|
|
24629
24554
|
});
|
|
24630
24555
|
if (filesUnderAngular.length === 0)
|
|
@@ -24646,7 +24571,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24646
24571
|
if (!ext)
|
|
24647
24572
|
continue;
|
|
24648
24573
|
if (ext === ".ts" || ext === ".tsx") {
|
|
24649
|
-
tsFilesToRefresh.add(
|
|
24574
|
+
tsFilesToRefresh.add(resolve40(file4));
|
|
24650
24575
|
continue;
|
|
24651
24576
|
}
|
|
24652
24577
|
const owners = resolveOwningComponents2({
|
|
@@ -24654,7 +24579,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24654
24579
|
userAngularRoot: angularDirAbs
|
|
24655
24580
|
});
|
|
24656
24581
|
for (const owner of owners) {
|
|
24657
|
-
tsFilesToRefresh.add(
|
|
24582
|
+
tsFilesToRefresh.add(resolve40(owner.componentFilePath));
|
|
24658
24583
|
}
|
|
24659
24584
|
}
|
|
24660
24585
|
if (tsFilesToRefresh.size === 0)
|
|
@@ -24669,7 +24594,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24669
24594
|
const { invalidateModule: invalidateModule2 } = await Promise.resolve().then(() => (init_moduleServer(), exports_moduleServer));
|
|
24670
24595
|
for (const tsFile of tsFilesToRefresh) {
|
|
24671
24596
|
const rel = relative16(angularDirAbs, tsFile).replace(/\\/g, "/").replace(/\.[tj]sx?$/, ".js");
|
|
24672
|
-
const compiledFile =
|
|
24597
|
+
const compiledFile = resolve40(compiledRoot, rel);
|
|
24673
24598
|
invalidateModule2(compiledFile);
|
|
24674
24599
|
}
|
|
24675
24600
|
} catch {}
|
|
@@ -24683,9 +24608,10 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24683
24608
|
const { runAngularHandlerScan: runAngularHandlerScan2 } = await Promise.resolve().then(() => (init_runAngularHandlerScan(), exports_runAngularHandlerScan));
|
|
24684
24609
|
const { parseAngularProvidersImport: parseAngularProvidersImport2 } = await Promise.resolve().then(() => (init_parseAngularConfigImports(), exports_parseAngularConfigImports));
|
|
24685
24610
|
const projectRoot = process.cwd();
|
|
24611
|
+
const resolvedAngularDir = resolve40(angularDir);
|
|
24686
24612
|
const providersImport = parseAngularProvidersImport2(projectRoot);
|
|
24687
24613
|
const providersInjection = providersImport ? (() => {
|
|
24688
|
-
const scan = runAngularHandlerScan2(projectRoot,
|
|
24614
|
+
const scan = runAngularHandlerScan2(projectRoot, resolvedAngularDir);
|
|
24689
24615
|
const basePathByKey = new Map;
|
|
24690
24616
|
for (const call of scan.calls) {
|
|
24691
24617
|
basePathByKey.set(call.manifestKey, call.mountPath?.endsWith("/*") ? call.mountPath.slice(0, -1) : null);
|
|
@@ -24743,7 +24669,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24743
24669
|
serverPaths.forEach((serverPath, idx) => {
|
|
24744
24670
|
const fileBase = basename13(serverPath, ".js");
|
|
24745
24671
|
const ssrPath = ssrPaths[idx] ?? serverPath;
|
|
24746
|
-
state.manifest[toPascal(fileBase)] =
|
|
24672
|
+
state.manifest[toPascal(fileBase)] = resolve40(ssrPath);
|
|
24747
24673
|
});
|
|
24748
24674
|
if (clientPaths.length > 0) {
|
|
24749
24675
|
await bundleAngularClient(state, clientPaths, state.resolvedPaths.buildDir, angularDir);
|
|
@@ -24756,10 +24682,33 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24756
24682
|
const angularDir = config.angularDirectory ?? "";
|
|
24757
24683
|
const angularFiles = filesToRebuild.filter((file4) => detectFramework(file4, state.resolvedPaths) === "angular");
|
|
24758
24684
|
for (const file4 of angularFiles) {
|
|
24759
|
-
state.fileHashes.set(
|
|
24685
|
+
state.fileHashes.set(resolve40(file4), computeFileHash(file4));
|
|
24760
24686
|
}
|
|
24761
|
-
const angularPagesPath =
|
|
24762
|
-
const
|
|
24687
|
+
const angularPagesPath = resolve40(angularDir, "pages");
|
|
24688
|
+
const initialPageEntries = resolveAngularPageEntries(state, angularFiles, angularPagesPath);
|
|
24689
|
+
const projectRoot = process.cwd();
|
|
24690
|
+
const { parseAngularProvidersImport: parseAngularProvidersImport2 } = await Promise.resolve().then(() => (init_parseAngularConfigImports(), exports_parseAngularConfigImports));
|
|
24691
|
+
const providersImport = parseAngularProvidersImport2(projectRoot);
|
|
24692
|
+
const editedProvidersChain = providersImport && angularFiles.some((file4) => resolve40(file4) === resolve40(providersImport.absolutePath) || resolve40(file4).startsWith(`${resolve40(angularDir)}/`));
|
|
24693
|
+
const pageEntries = editedProvidersChain && initialPageEntries.length === 0 ? (() => {
|
|
24694
|
+
const allPages = [];
|
|
24695
|
+
const { readdirSync: readdirSync7 } = __require("fs");
|
|
24696
|
+
const walk = (dir) => {
|
|
24697
|
+
for (const entry of readdirSync7(dir, {
|
|
24698
|
+
withFileTypes: true
|
|
24699
|
+
})) {
|
|
24700
|
+
const full = resolve40(dir, entry.name);
|
|
24701
|
+
if (entry.isDirectory())
|
|
24702
|
+
walk(full);
|
|
24703
|
+
else if (entry.isFile() && entry.name.endsWith(".ts"))
|
|
24704
|
+
allPages.push(full);
|
|
24705
|
+
}
|
|
24706
|
+
};
|
|
24707
|
+
try {
|
|
24708
|
+
walk(angularPagesPath);
|
|
24709
|
+
} catch {}
|
|
24710
|
+
return allPages;
|
|
24711
|
+
})() : initialPageEntries;
|
|
24763
24712
|
const tierStart = performance.now();
|
|
24764
24713
|
const verdict = await decideAngularTier(state, angularDir);
|
|
24765
24714
|
const tierMs = (performance.now() - tierStart).toFixed(0);
|
|
@@ -24799,11 +24748,11 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24799
24748
|
if (isComponentFile2)
|
|
24800
24749
|
return primaryFile;
|
|
24801
24750
|
const { findNearestComponent: findNearestComponent2 } = await Promise.resolve().then(() => (init_transformCache(), exports_transformCache));
|
|
24802
|
-
const nearest = findNearestComponent2(
|
|
24751
|
+
const nearest = findNearestComponent2(resolve40(primaryFile));
|
|
24803
24752
|
return nearest ?? primaryFile;
|
|
24804
24753
|
}, handleReactModuleServerPath = async (state, reactFiles, startTime, onRebuildComplete) => {
|
|
24805
24754
|
for (const file4 of reactFiles) {
|
|
24806
|
-
state.fileHashes.set(
|
|
24755
|
+
state.fileHashes.set(resolve40(file4), computeFileHash(file4));
|
|
24807
24756
|
}
|
|
24808
24757
|
const primaryFile = reactFiles.find((file4) => !file4.replace(/\\/g, "/").includes("/pages/")) ?? reactFiles[0];
|
|
24809
24758
|
if (!primaryFile) {
|
|
@@ -24884,7 +24833,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24884
24833
|
});
|
|
24885
24834
|
}, handleSvelteModuleServerPath = async (state, svelteFiles, config, startTime, onRebuildComplete) => {
|
|
24886
24835
|
for (const file4 of svelteFiles) {
|
|
24887
|
-
state.fileHashes.set(
|
|
24836
|
+
state.fileHashes.set(resolve40(file4), computeFileHash(file4));
|
|
24888
24837
|
}
|
|
24889
24838
|
const serverDuration = Date.now() - startTime;
|
|
24890
24839
|
await runSequentially(svelteFiles, (changedFile) => broadcastSvelteModuleUpdate(state, changedFile, svelteFiles, serverDuration));
|
|
@@ -25131,7 +25080,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
25131
25080
|
});
|
|
25132
25081
|
}, handleVueModuleServerPath = async (state, vueFiles, nonVueFiles, config, startTime, onRebuildComplete) => {
|
|
25133
25082
|
for (const file4 of [...vueFiles, ...nonVueFiles]) {
|
|
25134
|
-
state.fileHashes.set(
|
|
25083
|
+
state.fileHashes.set(resolve40(file4), computeFileHash(file4));
|
|
25135
25084
|
}
|
|
25136
25085
|
await invalidateNonVueModules(nonVueFiles);
|
|
25137
25086
|
const serverDuration = Date.now() - startTime;
|
|
@@ -25280,7 +25229,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
25280
25229
|
recursive: true,
|
|
25281
25230
|
withFileTypes: true
|
|
25282
25231
|
});
|
|
25283
|
-
return entries.filter((entry) => entry.isFile() && EMBER_PAGE_EXTENSIONS.some((ext) => entry.name.endsWith(ext))).map((entry) =>
|
|
25232
|
+
return entries.filter((entry) => entry.isFile() && EMBER_PAGE_EXTENSIONS.some((ext) => entry.name.endsWith(ext))).map((entry) => resolve40(emberPagesPath, entry.name));
|
|
25284
25233
|
} catch {
|
|
25285
25234
|
return [];
|
|
25286
25235
|
}
|
|
@@ -25292,10 +25241,10 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
25292
25241
|
return state.manifest;
|
|
25293
25242
|
}
|
|
25294
25243
|
for (const file4 of emberFiles) {
|
|
25295
|
-
state.fileHashes.set(
|
|
25244
|
+
state.fileHashes.set(resolve40(file4), computeFileHash(file4));
|
|
25296
25245
|
}
|
|
25297
|
-
const emberPagesPath =
|
|
25298
|
-
const directPageEntries = emberFiles.filter((file4) =>
|
|
25246
|
+
const emberPagesPath = resolve40(emberDir, "pages");
|
|
25247
|
+
const directPageEntries = emberFiles.filter((file4) => resolve40(file4).startsWith(emberPagesPath));
|
|
25299
25248
|
const allPageEntries = directPageEntries.length > 0 ? directPageEntries : await collectAllEmberPages(emberPagesPath);
|
|
25300
25249
|
if (allPageEntries.length === 0) {
|
|
25301
25250
|
onRebuildComplete({ hmrState: state, manifest: state.manifest });
|
|
@@ -25305,7 +25254,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
25305
25254
|
const { serverPaths } = await compileEmber2(allPageEntries, emberDir, process.cwd(), true);
|
|
25306
25255
|
for (const serverPath of serverPaths) {
|
|
25307
25256
|
const fileBase = basename13(serverPath, ".js");
|
|
25308
|
-
state.manifest[toPascal(fileBase)] =
|
|
25257
|
+
state.manifest[toPascal(fileBase)] = resolve40(serverPath);
|
|
25309
25258
|
}
|
|
25310
25259
|
const { invalidateEmberSsrCache: invalidateEmberSsrCache2 } = await Promise.resolve().then(() => (init_ember(), exports_ember));
|
|
25311
25260
|
invalidateEmberSsrCache2();
|
|
@@ -25397,8 +25346,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
25397
25346
|
if (!buildReference?.source) {
|
|
25398
25347
|
return;
|
|
25399
25348
|
}
|
|
25400
|
-
const sourcePath = buildReference.source.startsWith("file://") ? new URL(buildReference.source).pathname :
|
|
25401
|
-
islandFiles.add(
|
|
25349
|
+
const sourcePath = buildReference.source.startsWith("file://") ? new URL(buildReference.source).pathname : resolve40(dirname24(buildInfo.resolvedRegistryPath), buildReference.source);
|
|
25350
|
+
islandFiles.add(resolve40(sourcePath));
|
|
25402
25351
|
}, resolveIslandSourceFiles = async (config) => {
|
|
25403
25352
|
const registryPath = config.islands?.registry;
|
|
25404
25353
|
if (!registryPath) {
|
|
@@ -25406,7 +25355,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
25406
25355
|
}
|
|
25407
25356
|
const buildInfo = await loadIslandRegistryBuildInfo(registryPath);
|
|
25408
25357
|
const islandFiles = new Set([
|
|
25409
|
-
|
|
25358
|
+
resolve40(buildInfo.resolvedRegistryPath)
|
|
25410
25359
|
]);
|
|
25411
25360
|
for (const definition of buildInfo.definitions) {
|
|
25412
25361
|
resolveIslandDefinitionSource(definition, buildInfo, islandFiles);
|
|
@@ -25417,7 +25366,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
25417
25366
|
if (islandFiles.size === 0) {
|
|
25418
25367
|
return false;
|
|
25419
25368
|
}
|
|
25420
|
-
return filesToRebuild.some((file4) => islandFiles.has(
|
|
25369
|
+
return filesToRebuild.some((file4) => islandFiles.has(resolve40(file4)));
|
|
25421
25370
|
}, handleIslandSourceReload = async (state, config, filesToRebuild, manifest) => {
|
|
25422
25371
|
const shouldReload = await didStaticPagesNeedIslandRefresh(config, filesToRebuild);
|
|
25423
25372
|
if (!shouldReload) {
|
|
@@ -25452,10 +25401,10 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
25452
25401
|
}, computeOutputPagesDir = (state, config, framework) => {
|
|
25453
25402
|
const isSingle = !config.reactDirectory && !config.svelteDirectory && !config.vueDirectory && (framework === "html" ? !config.htmxDirectory : !config.htmlDirectory);
|
|
25454
25403
|
if (isSingle) {
|
|
25455
|
-
return
|
|
25404
|
+
return resolve40(state.resolvedPaths.buildDir, "pages");
|
|
25456
25405
|
}
|
|
25457
25406
|
const dirName = framework === "html" ? basename13(config.htmlDirectory ?? "html") : basename13(config.htmxDirectory ?? "htmx");
|
|
25458
|
-
return
|
|
25407
|
+
return resolve40(state.resolvedPaths.buildDir, dirName, "pages");
|
|
25459
25408
|
}, processHtmlPageUpdate = async (state, pageFile, builtHtmlPagePath, manifest, duration) => {
|
|
25460
25409
|
try {
|
|
25461
25410
|
const { handleHTMLUpdate: handleHTMLUpdate2 } = await Promise.resolve().then(() => (init_simpleHTMLHMR(), exports_simpleHTMLHMR));
|
|
@@ -25494,7 +25443,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
25494
25443
|
const pageFilesToUpdate = shouldRefreshAllPages ? await scanEntryPoints(outputHtmlPages, "*.html") : htmlPageFiles;
|
|
25495
25444
|
await runSequentially(pageFilesToUpdate, async (pageFile) => {
|
|
25496
25445
|
const htmlPageName = basename13(pageFile);
|
|
25497
|
-
const builtHtmlPagePath =
|
|
25446
|
+
const builtHtmlPagePath = resolve40(outputHtmlPages, htmlPageName);
|
|
25498
25447
|
await processHtmlPageUpdate(state, pageFile, builtHtmlPagePath, manifest, duration);
|
|
25499
25448
|
});
|
|
25500
25449
|
}, handleVueCssOnlyUpdate = (state, vueCssFiles, manifest, duration) => {
|
|
@@ -25559,7 +25508,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
25559
25508
|
const cssKey = `${pascalName}CSS`;
|
|
25560
25509
|
const cssUrl = manifest[cssKey] || null;
|
|
25561
25510
|
const { vueHmrMetadata: vueHmrMetadata2 } = await Promise.resolve().then(() => (init_compileVue(), exports_compileVue));
|
|
25562
|
-
const hmrMeta = vueHmrMetadata2.get(
|
|
25511
|
+
const hmrMeta = vueHmrMetadata2.get(resolve40(vuePagePath));
|
|
25563
25512
|
const changeType = hmrMeta?.changeType ?? "full";
|
|
25564
25513
|
if (changeType === "style-only") {
|
|
25565
25514
|
broadcastVueStyleOnly(state, vuePagePath, baseName, cssUrl, hmrId, manifest, duration);
|
|
@@ -25744,7 +25693,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
25744
25693
|
const pageFilesToUpdate = shouldRefreshAllPages ? await scanEntryPoints(outputHtmxPages, "*.html") : htmxPageFiles;
|
|
25745
25694
|
await runSequentially(pageFilesToUpdate, async (htmxPageFile) => {
|
|
25746
25695
|
const htmxPageName = basename13(htmxPageFile);
|
|
25747
|
-
const builtHtmxPagePath =
|
|
25696
|
+
const builtHtmxPagePath = resolve40(outputHtmxPages, htmxPageName);
|
|
25748
25697
|
await processHtmxPageUpdate(state, htmxPageFile, builtHtmxPagePath, manifest, duration);
|
|
25749
25698
|
});
|
|
25750
25699
|
}, collectUpdatedModulePaths = (allModuleUpdates) => {
|
|
@@ -25853,7 +25802,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
25853
25802
|
html = html.slice(0, bodyClose.index) + hmrScript + html.slice(bodyClose.index);
|
|
25854
25803
|
writeFs(destPath, html);
|
|
25855
25804
|
}, processMarkupFileFastPath = async (state, sourceFile, outputDir, framework, startTime, updateAssetPaths2, handleUpdate, readFs, writeFs) => {
|
|
25856
|
-
const destPath =
|
|
25805
|
+
const destPath = resolve40(outputDir, basename13(sourceFile));
|
|
25857
25806
|
const hmrScript = extractHmrScript(destPath, readFs);
|
|
25858
25807
|
const source = await Bun.file(sourceFile).text();
|
|
25859
25808
|
await Bun.write(destPath, source);
|
|
@@ -25995,7 +25944,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
25995
25944
|
});
|
|
25996
25945
|
if (config.tailwind && filesToRebuild && filesToRebuild.some(isTailwindCandidate)) {
|
|
25997
25946
|
try {
|
|
25998
|
-
const outputPath =
|
|
25947
|
+
const outputPath = resolve40(state.resolvedPaths.buildDir, config.tailwind.output);
|
|
25999
25948
|
const bytes = await Bun.file(outputPath).bytes();
|
|
26000
25949
|
const webPath = `/${config.tailwind.output.replace(/^\/+/, "")}`;
|
|
26001
25950
|
state.assetStore.set(webPath, bytes);
|
|
@@ -26429,7 +26378,7 @@ __export(exports_devBuild, {
|
|
|
26429
26378
|
});
|
|
26430
26379
|
import { readdir as readdir5 } from "fs/promises";
|
|
26431
26380
|
import { statSync as statSync7 } from "fs";
|
|
26432
|
-
import { resolve as
|
|
26381
|
+
import { resolve as resolve41 } from "path";
|
|
26433
26382
|
var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
26434
26383
|
const configuredDirs = [
|
|
26435
26384
|
config.reactDirectory,
|
|
@@ -26452,7 +26401,7 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
26452
26401
|
return Object.keys(config).length > 0 ? config : null;
|
|
26453
26402
|
}, reloadConfig = async () => {
|
|
26454
26403
|
try {
|
|
26455
|
-
const configPath2 =
|
|
26404
|
+
const configPath2 = resolve41(process.env.ABSOLUTE_CONFIG ?? "absolute.config.ts");
|
|
26456
26405
|
const source = await Bun.file(configPath2).text();
|
|
26457
26406
|
return parseDirectoryConfig(source);
|
|
26458
26407
|
} catch {
|
|
@@ -26559,7 +26508,7 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
26559
26508
|
state.fileChangeQueue.clear();
|
|
26560
26509
|
}
|
|
26561
26510
|
}, handleCachedReload = async () => {
|
|
26562
|
-
const serverMtime = statSync7(
|
|
26511
|
+
const serverMtime = statSync7(resolve41(Bun.main)).mtimeMs;
|
|
26563
26512
|
const lastMtime = globalThis.__hmrServerMtime;
|
|
26564
26513
|
globalThis.__hmrServerMtime = serverMtime;
|
|
26565
26514
|
const cached = globalThis.__hmrDevResult;
|
|
@@ -26596,8 +26545,8 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
26596
26545
|
return true;
|
|
26597
26546
|
}, resolveAbsoluteVersion2 = async () => {
|
|
26598
26547
|
const candidates = [
|
|
26599
|
-
|
|
26600
|
-
|
|
26548
|
+
resolve41(import.meta.dir, "..", "..", "package.json"),
|
|
26549
|
+
resolve41(import.meta.dir, "..", "package.json")
|
|
26601
26550
|
];
|
|
26602
26551
|
const [candidate, ...remaining] = candidates;
|
|
26603
26552
|
if (!candidate) {
|
|
@@ -26623,7 +26572,7 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
26623
26572
|
const entries = await readdir5(vendorDir).catch(() => emptyStringArray);
|
|
26624
26573
|
await Promise.all(entries.filter((entry) => entry.endsWith(".js")).map(async (entry) => {
|
|
26625
26574
|
const webPath = `/${framework}/vendor/${entry}`;
|
|
26626
|
-
const bytes = await Bun.file(
|
|
26575
|
+
const bytes = await Bun.file(resolve41(vendorDir, entry)).bytes();
|
|
26627
26576
|
assetStore.set(webPath, bytes);
|
|
26628
26577
|
}));
|
|
26629
26578
|
}, devBuild = async (config) => {
|
|
@@ -26702,11 +26651,11 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
26702
26651
|
cleanStaleAssets(state.assetStore, manifest, state.resolvedPaths.buildDir);
|
|
26703
26652
|
recordStep("populate asset store", stepStartedAt);
|
|
26704
26653
|
stepStartedAt = performance.now();
|
|
26705
|
-
const reactVendorDir =
|
|
26706
|
-
const angularVendorDir =
|
|
26707
|
-
const svelteVendorDir =
|
|
26708
|
-
const vueVendorDir =
|
|
26709
|
-
const depVendorDir =
|
|
26654
|
+
const reactVendorDir = resolve41(state.resolvedPaths.buildDir, "react", "vendor");
|
|
26655
|
+
const angularVendorDir = resolve41(state.resolvedPaths.buildDir, "angular", "vendor");
|
|
26656
|
+
const svelteVendorDir = resolve41(state.resolvedPaths.buildDir, "svelte", "vendor");
|
|
26657
|
+
const vueVendorDir = resolve41(state.resolvedPaths.buildDir, "vue", "vendor");
|
|
26658
|
+
const depVendorDir = resolve41(state.resolvedPaths.buildDir, "vendor");
|
|
26710
26659
|
const { buildDepVendor: buildDepVendor2 } = await Promise.resolve().then(() => (init_buildDepVendor(), exports_buildDepVendor));
|
|
26711
26660
|
const [, angularSpecs, , , , , depPaths] = await Promise.all([
|
|
26712
26661
|
config.reactDirectory ? buildReactVendor(state.resolvedPaths.buildDir) : Promise.resolve(undefined),
|
|
@@ -26817,7 +26766,7 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
26817
26766
|
manifest
|
|
26818
26767
|
};
|
|
26819
26768
|
globalThis.__hmrDevResult = result;
|
|
26820
|
-
globalThis.__hmrServerMtime = statSync7(
|
|
26769
|
+
globalThis.__hmrServerMtime = statSync7(resolve41(Bun.main)).mtimeMs;
|
|
26821
26770
|
return result;
|
|
26822
26771
|
};
|
|
26823
26772
|
var init_devBuild = __esm(() => {
|
|
@@ -26857,5 +26806,5 @@ export {
|
|
|
26857
26806
|
build
|
|
26858
26807
|
};
|
|
26859
26808
|
|
|
26860
|
-
//# debugId=
|
|
26809
|
+
//# debugId=4F18A2DD76FF7F8064756E2164756E21
|
|
26861
26810
|
//# sourceMappingURL=build.js.map
|