@absolutejs/absolute 0.19.0-beta.984 → 0.19.0-beta.985
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 +4 -16
- package/dist/angular/index.js.map +4 -4
- package/dist/angular/server.js +3 -1
- package/dist/angular/server.js.map +3 -3
- package/dist/build.js +295 -391
- package/dist/build.js.map +3 -3
- package/dist/index.js +306 -402
- package/dist/index.js.map +3 -3
- 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;
|
|
@@ -12012,8 +11916,8 @@ var findDefineConfigCall = (sf) => {
|
|
|
12012
11916
|
const importInfo = findImportForBinding(sf, binding);
|
|
12013
11917
|
if (!importInfo)
|
|
12014
11918
|
return null;
|
|
12015
|
-
const configDir2 =
|
|
12016
|
-
const absolutePath = importInfo.source.startsWith(".") ? join24(configDir2, importInfo.source).replace(/\.[cm]?[tj]sx?$/, "") :
|
|
11919
|
+
const configDir2 = dirname11(configPath2);
|
|
11920
|
+
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
11921
|
return {
|
|
12018
11922
|
absolutePath,
|
|
12019
11923
|
bindingName: binding,
|
|
@@ -12164,11 +12068,11 @@ __export(exports_compileSvelte, {
|
|
|
12164
12068
|
import { existsSync as existsSync20 } from "fs";
|
|
12165
12069
|
import { mkdir as mkdir4, stat as stat2 } from "fs/promises";
|
|
12166
12070
|
import {
|
|
12167
|
-
dirname as
|
|
12071
|
+
dirname as dirname12,
|
|
12168
12072
|
join as join25,
|
|
12169
12073
|
basename as basename6,
|
|
12170
12074
|
extname as extname5,
|
|
12171
|
-
resolve as
|
|
12075
|
+
resolve as resolve19,
|
|
12172
12076
|
relative as relative9,
|
|
12173
12077
|
sep as sep2
|
|
12174
12078
|
} from "path";
|
|
@@ -12176,14 +12080,14 @@ import { env } from "process";
|
|
|
12176
12080
|
var {write: write2, file, Transpiler: Transpiler2 } = globalThis.Bun;
|
|
12177
12081
|
var resolveDevClientDir2 = () => {
|
|
12178
12082
|
const projectRoot = process.cwd();
|
|
12179
|
-
const fromSource =
|
|
12083
|
+
const fromSource = resolve19(import.meta.dir, "../dev/client");
|
|
12180
12084
|
if (existsSync20(fromSource) && fromSource.startsWith(projectRoot)) {
|
|
12181
12085
|
return fromSource;
|
|
12182
12086
|
}
|
|
12183
|
-
const fromNodeModules =
|
|
12087
|
+
const fromNodeModules = resolve19(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client");
|
|
12184
12088
|
if (existsSync20(fromNodeModules))
|
|
12185
12089
|
return fromNodeModules;
|
|
12186
|
-
return
|
|
12090
|
+
return resolve19(import.meta.dir, "./dev/client");
|
|
12187
12091
|
}, devClientDir2, hmrClientPath3, persistentCache, sourceHashCache, clearSvelteCompilerCache = () => {
|
|
12188
12092
|
persistentCache.clear();
|
|
12189
12093
|
sourceHashCache.clear();
|
|
@@ -12213,7 +12117,7 @@ var resolveDevClientDir2 = () => {
|
|
|
12213
12117
|
}, resolveRelativeModule2 = async (spec, from) => {
|
|
12214
12118
|
if (!spec.startsWith("."))
|
|
12215
12119
|
return null;
|
|
12216
|
-
const basePath =
|
|
12120
|
+
const basePath = resolve19(dirname12(from), spec);
|
|
12217
12121
|
const candidates = [
|
|
12218
12122
|
basePath,
|
|
12219
12123
|
`${basePath}.ts`,
|
|
@@ -12240,7 +12144,7 @@ var resolveDevClientDir2 = () => {
|
|
|
12240
12144
|
const resolved = resolvePackageImport(spec);
|
|
12241
12145
|
return resolved && /\.svelte(\.(?:ts|js))?$/.test(resolved) ? resolved : null;
|
|
12242
12146
|
}
|
|
12243
|
-
const basePath =
|
|
12147
|
+
const basePath = resolve19(dirname12(from), spec);
|
|
12244
12148
|
const explicit = /\.(svelte|svelte\.(?:ts|js))$/.test(basePath);
|
|
12245
12149
|
if (!explicit) {
|
|
12246
12150
|
const extensions = [".svelte", ".svelte.ts", ".svelte.js"];
|
|
@@ -12300,8 +12204,8 @@ var resolveDevClientDir2 = () => {
|
|
|
12300
12204
|
const preprocessedClient = isModule ? loweredClientSource.code : (await preprocess(loweredClientSource.code, svelteStylePreprocessor)).code;
|
|
12301
12205
|
const transpiledServer = src.endsWith(".ts") || src.endsWith(".svelte.ts") ? transpiler3.transformSync(preprocessedServer) : preprocessedServer;
|
|
12302
12206
|
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(),
|
|
12207
|
+
const rawRel = dirname12(relative9(svelteRoot, src)).replace(/\\/g, "/");
|
|
12208
|
+
const relDir = rawRel.startsWith("..") ? `_ext/${relative9(process.cwd(), dirname12(src)).replace(/\\/g, "/")}` : rawRel;
|
|
12305
12209
|
const baseName = basename6(src).replace(/\.svelte(\.(ts|js))?$/, "");
|
|
12306
12210
|
const importPaths = Array.from(transpiledServer.matchAll(/from\s+['"]([^'"]+)['"]/g)).map((match) => match[1]).filter((path) => path !== undefined);
|
|
12307
12211
|
const resolvedModuleImports = await Promise.all(importPaths.map((importPath) => resolveRelativeModule2(importPath, src)));
|
|
@@ -12310,8 +12214,8 @@ var resolveDevClientDir2 = () => {
|
|
|
12310
12214
|
const childBuilt = await Promise.all(childSources.map((child) => build(child)));
|
|
12311
12215
|
const hasAwaitSlotFromChildren = childBuilt.some((child) => child.hasAwaitSlot);
|
|
12312
12216
|
const externalRewrites = new Map;
|
|
12313
|
-
const ssrOutputDir =
|
|
12314
|
-
const clientOutputDir =
|
|
12217
|
+
const ssrOutputDir = dirname12(join25(serverDir, relDir, `${baseName}.js`));
|
|
12218
|
+
const clientOutputDir = dirname12(join25(clientDir, relDir, `${baseName}.js`));
|
|
12315
12219
|
for (let idx = 0;idx < importPaths.length; idx++) {
|
|
12316
12220
|
const rawSpec = importPaths[idx];
|
|
12317
12221
|
if (!rawSpec)
|
|
@@ -12379,8 +12283,8 @@ var resolveDevClientDir2 = () => {
|
|
|
12379
12283
|
const ssrPath = join25(serverDir, relDir, `${baseName}.js`);
|
|
12380
12284
|
const clientPath = join25(clientDir, relDir, `${baseName}.js`);
|
|
12381
12285
|
await Promise.all([
|
|
12382
|
-
mkdir4(
|
|
12383
|
-
mkdir4(
|
|
12286
|
+
mkdir4(dirname12(ssrPath), { recursive: true }),
|
|
12287
|
+
mkdir4(dirname12(clientPath), { recursive: true })
|
|
12384
12288
|
]);
|
|
12385
12289
|
const inlineMap = (map) => map ? `
|
|
12386
12290
|
//# sourceMappingURL=data:application/json;base64,${Buffer.from(JSON.stringify(map)).toString("base64")}
|
|
@@ -12413,10 +12317,10 @@ var resolveDevClientDir2 = () => {
|
|
|
12413
12317
|
};
|
|
12414
12318
|
const roots = await Promise.all(entryPoints.map(build));
|
|
12415
12319
|
await Promise.all(roots.map(async ({ client, hasAwaitSlot }) => {
|
|
12416
|
-
const relClientDir =
|
|
12320
|
+
const relClientDir = dirname12(relative9(clientDir, client));
|
|
12417
12321
|
const name = basename6(client, extname5(client));
|
|
12418
12322
|
const indexPath = join25(indexDir, relClientDir, `${name}.js`);
|
|
12419
|
-
const importRaw = relative9(
|
|
12323
|
+
const importRaw = relative9(dirname12(indexPath), client).split(sep2).join("/");
|
|
12420
12324
|
const importPath = importRaw.startsWith(".") || importRaw.startsWith("/") ? importRaw : `./${importRaw}`;
|
|
12421
12325
|
const hmrImports = isDev ? `window.__HMR_FRAMEWORK__ = "svelte";
|
|
12422
12326
|
import "${hmrClientPath3}";
|
|
@@ -12487,13 +12391,13 @@ if (typeof window !== "undefined") {
|
|
|
12487
12391
|
setTimeout(releaseStreamingSlots, 0);
|
|
12488
12392
|
}
|
|
12489
12393
|
}`;
|
|
12490
|
-
await mkdir4(
|
|
12394
|
+
await mkdir4(dirname12(indexPath), { recursive: true });
|
|
12491
12395
|
return write2(indexPath, bootstrap);
|
|
12492
12396
|
}));
|
|
12493
12397
|
return {
|
|
12494
12398
|
svelteClientPaths: roots.map(({ client }) => client),
|
|
12495
12399
|
svelteIndexPaths: roots.map(({ client }) => {
|
|
12496
|
-
const rel =
|
|
12400
|
+
const rel = dirname12(relative9(clientDir, client));
|
|
12497
12401
|
return join25(indexDir, rel, basename6(client));
|
|
12498
12402
|
}),
|
|
12499
12403
|
svelteServerPaths: roots.map(({ ssr }) => ssr)
|
|
@@ -12905,23 +12809,23 @@ import { existsSync as existsSync21 } from "fs";
|
|
|
12905
12809
|
import { mkdir as mkdir5 } from "fs/promises";
|
|
12906
12810
|
import {
|
|
12907
12811
|
basename as basename7,
|
|
12908
|
-
dirname as
|
|
12909
|
-
isAbsolute as
|
|
12812
|
+
dirname as dirname13,
|
|
12813
|
+
isAbsolute as isAbsolute4,
|
|
12910
12814
|
join as join26,
|
|
12911
12815
|
relative as relative10,
|
|
12912
|
-
resolve as
|
|
12816
|
+
resolve as resolve20
|
|
12913
12817
|
} from "path";
|
|
12914
12818
|
var {file: file2, write: write3, Transpiler: Transpiler3 } = globalThis.Bun;
|
|
12915
12819
|
var resolveDevClientDir3 = () => {
|
|
12916
12820
|
const projectRoot = process.cwd();
|
|
12917
|
-
const fromSource =
|
|
12821
|
+
const fromSource = resolve20(import.meta.dir, "../dev/client");
|
|
12918
12822
|
if (existsSync21(fromSource) && fromSource.startsWith(projectRoot)) {
|
|
12919
12823
|
return fromSource;
|
|
12920
12824
|
}
|
|
12921
|
-
const fromNodeModules =
|
|
12825
|
+
const fromNodeModules = resolve20(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client");
|
|
12922
12826
|
if (existsSync21(fromNodeModules))
|
|
12923
12827
|
return fromNodeModules;
|
|
12924
|
-
return
|
|
12828
|
+
return resolve20(import.meta.dir, "./dev/client");
|
|
12925
12829
|
}, devClientDir3, hmrClientPath4, transpiler4, scriptCache, scriptSetupCache, templateCache, styleCache, persistentBuildCache, vueSourceHashCache, vueHmrMetadata, clearVueHmrCaches = () => {
|
|
12926
12830
|
scriptCache.clear();
|
|
12927
12831
|
scriptSetupCache.clear();
|
|
@@ -12967,7 +12871,7 @@ var resolveDevClientDir3 = () => {
|
|
|
12967
12871
|
return filePath.replace(/\.ts$/, ".js");
|
|
12968
12872
|
if (isStylePath(filePath)) {
|
|
12969
12873
|
if (sourceDir && (filePath.startsWith("./") || filePath.startsWith("../"))) {
|
|
12970
|
-
return
|
|
12874
|
+
return resolve20(sourceDir, filePath);
|
|
12971
12875
|
}
|
|
12972
12876
|
return filePath;
|
|
12973
12877
|
}
|
|
@@ -13031,12 +12935,12 @@ var resolveDevClientDir3 = () => {
|
|
|
13031
12935
|
const childComponentPaths = importPaths.filter((path) => path.startsWith(".") && path.endsWith(".vue"));
|
|
13032
12936
|
const packageComponentPaths = Array.from(resolvedPackageVueImports.entries());
|
|
13033
12937
|
const helperModulePaths = importPaths.filter((path) => path.startsWith(".") && !path.endsWith(".vue") && !isStylePath(path));
|
|
13034
|
-
const stylePathsImported = importPaths.filter((path) => (path.startsWith(".") ||
|
|
12938
|
+
const stylePathsImported = importPaths.filter((path) => (path.startsWith(".") || isAbsolute4(path)) && isStylePath(path)).map((path) => isAbsolute4(path) ? path : resolve20(dirname13(sourceFilePath), path));
|
|
13035
12939
|
for (const stylePath of stylePathsImported) {
|
|
13036
12940
|
addStyleImporter(sourceFilePath, stylePath);
|
|
13037
12941
|
}
|
|
13038
12942
|
const childBuildResults = await Promise.all([
|
|
13039
|
-
...childComponentPaths.map((relativeChildPath) => compileVueFile(
|
|
12943
|
+
...childComponentPaths.map((relativeChildPath) => compileVueFile(resolve20(dirname13(sourceFilePath), relativeChildPath), outputDirs, cacheMap, false, vueRootDir, compiler, stylePreprocessors)),
|
|
13040
12944
|
...packageComponentPaths.map(([, absolutePath]) => compileVueFile(absolutePath, outputDirs, cacheMap, false, vueRootDir, compiler, stylePreprocessors))
|
|
13041
12945
|
]);
|
|
13042
12946
|
const hasScript = descriptor.script || descriptor.scriptSetup;
|
|
@@ -13046,7 +12950,7 @@ var resolveDevClientDir3 = () => {
|
|
|
13046
12950
|
sourceMap: true
|
|
13047
12951
|
}) : { bindings: {}, content: "export default {};", map: undefined };
|
|
13048
12952
|
const strippedScript = stripExports2(compiledScript.content);
|
|
13049
|
-
const sourceDir =
|
|
12953
|
+
const sourceDir = dirname13(sourceFilePath);
|
|
13050
12954
|
const transpiledScript = transpiler4.transformSync(strippedScript).replace(/(['"])(\.{1,2}\/[^'"]+)(['"])/g, (_2, quoteStart, relativeImport, quoteEnd) => `${quoteStart}${toJs(relativeImport, sourceDir)}${quoteEnd}`);
|
|
13051
12955
|
const packageImportRewrites = new Map;
|
|
13052
12956
|
for (const [bareImport, absolutePath] of packageComponentPaths) {
|
|
@@ -13086,7 +12990,7 @@ var resolveDevClientDir3 = () => {
|
|
|
13086
12990
|
let cssOutputPaths = [];
|
|
13087
12991
|
if (isEntryPoint && allCss.length) {
|
|
13088
12992
|
const cssOutputFile = join26(outputDirs.css, `${toKebab(fileBaseName)}-compiled.css`);
|
|
13089
|
-
await mkdir5(
|
|
12993
|
+
await mkdir5(dirname13(cssOutputFile), { recursive: true });
|
|
13090
12994
|
await write3(cssOutputFile, allCss.join(`
|
|
13091
12995
|
`));
|
|
13092
12996
|
cssOutputPaths = [cssOutputFile];
|
|
@@ -13118,7 +13022,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
13118
13022
|
const serverCode = assembleModule(generateRenderFunction(true), "ssrRender", false) + islandMetadataExports;
|
|
13119
13023
|
const clientOutputPath = join26(outputDirs.client, `${relativeWithoutExtension}.js`);
|
|
13120
13024
|
const serverOutputPath = join26(outputDirs.server, `${relativeWithoutExtension}.js`);
|
|
13121
|
-
const relDir =
|
|
13025
|
+
const relDir = dirname13(relativeFilePath);
|
|
13122
13026
|
const relDepth = relDir === "." ? 0 : relDir.split("/").length;
|
|
13123
13027
|
const adjustImports = (code) => code.replace(/(from\s+['"])(\.\.\/(?:\.\.\/)*)/g, (_2, prefix, dots) => {
|
|
13124
13028
|
const upCount = dots.split("/").length - 1;
|
|
@@ -13130,15 +13034,15 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
13130
13034
|
let result2 = code;
|
|
13131
13035
|
for (const [bareImport, paths] of packageImportRewrites) {
|
|
13132
13036
|
const targetPath = mode === "server" ? paths.server : paths.client;
|
|
13133
|
-
let rel = relative10(
|
|
13037
|
+
let rel = relative10(dirname13(outputPath), targetPath).replace(/\\/g, "/");
|
|
13134
13038
|
if (!rel.startsWith("."))
|
|
13135
13039
|
rel = `./${rel}`;
|
|
13136
13040
|
result2 = result2.replaceAll(bareImport, rel);
|
|
13137
13041
|
}
|
|
13138
13042
|
return result2;
|
|
13139
13043
|
};
|
|
13140
|
-
await mkdir5(
|
|
13141
|
-
await mkdir5(
|
|
13044
|
+
await mkdir5(dirname13(clientOutputPath), { recursive: true });
|
|
13045
|
+
await mkdir5(dirname13(serverOutputPath), { recursive: true });
|
|
13142
13046
|
const clientFinal = rewritePackageImports(adjustImports(clientCode), clientOutputPath, "client");
|
|
13143
13047
|
const serverFinal = rewritePackageImports(adjustImports(serverCode), serverOutputPath, "server");
|
|
13144
13048
|
const inlineSourceMapFor = (finalContent) => {
|
|
@@ -13160,7 +13064,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
13160
13064
|
hmrId,
|
|
13161
13065
|
serverPath: serverOutputPath,
|
|
13162
13066
|
tsHelperPaths: [
|
|
13163
|
-
...helperModulePaths.map((helper) =>
|
|
13067
|
+
...helperModulePaths.map((helper) => resolve20(dirname13(sourceFilePath), helper.endsWith(".ts") ? helper : `${helper}.ts`)),
|
|
13164
13068
|
...childBuildResults.flatMap((child) => child.tsHelperPaths)
|
|
13165
13069
|
]
|
|
13166
13070
|
};
|
|
@@ -13183,7 +13087,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
13183
13087
|
const buildCache = new Map;
|
|
13184
13088
|
const allTsHelperPaths = new Set;
|
|
13185
13089
|
const compiledPages = await Promise.all(entryPoints.map(async (entryPath) => {
|
|
13186
|
-
const result = await compileVueFile(
|
|
13090
|
+
const result = await compileVueFile(resolve20(entryPath), {
|
|
13187
13091
|
client: clientOutputDir,
|
|
13188
13092
|
css: cssOutputDir,
|
|
13189
13093
|
server: serverOutputDir
|
|
@@ -13192,14 +13096,14 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
13192
13096
|
const entryBaseName = basename7(entryPath, ".vue");
|
|
13193
13097
|
const indexOutputFile = join26(indexOutputDir, `${entryBaseName}.js`);
|
|
13194
13098
|
const clientOutputFile = join26(clientOutputDir, relative10(vueRootDir, entryPath).replace(/\\/g, "/").replace(/\.vue$/, ".js"));
|
|
13195
|
-
await mkdir5(
|
|
13099
|
+
await mkdir5(dirname13(indexOutputFile), { recursive: true });
|
|
13196
13100
|
const vueHmrImports = isDev ? [
|
|
13197
13101
|
`window.__HMR_FRAMEWORK__ = "vue";`,
|
|
13198
13102
|
`import "${hmrClientPath4}";`
|
|
13199
13103
|
] : [];
|
|
13200
13104
|
await write3(indexOutputFile, [
|
|
13201
13105
|
...vueHmrImports,
|
|
13202
|
-
`import Comp, * as PageModule from "${relative10(
|
|
13106
|
+
`import Comp, * as PageModule from "${relative10(dirname13(indexOutputFile), clientOutputFile).replace(/\\/g, "/")}";`,
|
|
13203
13107
|
'import { createSSRApp, createApp } from "vue";',
|
|
13204
13108
|
"",
|
|
13205
13109
|
"// HMR State Preservation: Check for preserved state from HMR",
|
|
@@ -13346,8 +13250,8 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
13346
13250
|
const relativeJsPath = relative10(vueRootDir, tsPath).replace(/\.ts$/, ".js");
|
|
13347
13251
|
const outClientPath = join26(clientOutputDir, relativeJsPath);
|
|
13348
13252
|
const outServerPath = join26(serverOutputDir, relativeJsPath);
|
|
13349
|
-
await mkdir5(
|
|
13350
|
-
await mkdir5(
|
|
13253
|
+
await mkdir5(dirname13(outClientPath), { recursive: true });
|
|
13254
|
+
await mkdir5(dirname13(outServerPath), { recursive: true });
|
|
13351
13255
|
await write3(outClientPath, transpiledCode);
|
|
13352
13256
|
await write3(outServerPath, transpiledCode);
|
|
13353
13257
|
}));
|
|
@@ -13850,7 +13754,7 @@ __export(exports_compileAngular, {
|
|
|
13850
13754
|
compileAngular: () => compileAngular
|
|
13851
13755
|
});
|
|
13852
13756
|
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
|
|
13757
|
+
import { join as join27, basename as basename8, sep as sep3, dirname as dirname14, resolve as resolve21, relative as relative11 } from "path";
|
|
13854
13758
|
var {Glob: Glob6 } = globalThis.Bun;
|
|
13855
13759
|
import ts9 from "typescript";
|
|
13856
13760
|
var traceAngularPhase = async (name, fn2, metadata) => {
|
|
@@ -13858,10 +13762,10 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
13858
13762
|
return tracePhase ? tracePhase(`compile/angular/${name}`, fn2, metadata) : await fn2();
|
|
13859
13763
|
}, readTsconfigPathAliases = () => {
|
|
13860
13764
|
try {
|
|
13861
|
-
const configPath2 =
|
|
13765
|
+
const configPath2 = resolve21(process.cwd(), "tsconfig.json");
|
|
13862
13766
|
const config = ts9.readConfigFile(configPath2, ts9.sys.readFile).config;
|
|
13863
13767
|
const compilerOptions = config?.compilerOptions ?? {};
|
|
13864
|
-
const baseUrl =
|
|
13768
|
+
const baseUrl = resolve21(process.cwd(), compilerOptions.baseUrl ?? ".");
|
|
13865
13769
|
const aliases = Object.entries(compilerOptions.paths ?? {}).map(([pattern, replacements]) => ({ pattern, replacements }));
|
|
13866
13770
|
return { aliases, baseUrl };
|
|
13867
13771
|
} catch {
|
|
@@ -13881,7 +13785,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
13881
13785
|
const wildcardValue = exactMatch ? "" : specifier.slice(prefix.length, specifier.length - suffix.length);
|
|
13882
13786
|
for (const replacement of alias.replacements) {
|
|
13883
13787
|
const candidate = replacement.replace("*", wildcardValue);
|
|
13884
|
-
const resolved = resolveSourceFile(
|
|
13788
|
+
const resolved = resolveSourceFile(resolve21(baseUrl, candidate));
|
|
13885
13789
|
if (resolved)
|
|
13886
13790
|
return resolved;
|
|
13887
13791
|
}
|
|
@@ -13900,13 +13804,13 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
13900
13804
|
];
|
|
13901
13805
|
return candidates.find((file3) => existsSync22(file3));
|
|
13902
13806
|
}, createLegacyAngularAnimationUsageResolver = (rootDir) => {
|
|
13903
|
-
const baseDir =
|
|
13807
|
+
const baseDir = resolve21(rootDir);
|
|
13904
13808
|
const tsconfigAliases = readTsconfigPathAliases();
|
|
13905
13809
|
const transpiler5 = new Bun.Transpiler({ loader: "tsx" });
|
|
13906
13810
|
const scanCache = new Map;
|
|
13907
13811
|
const resolveLocalImport = (specifier, fromDir) => {
|
|
13908
13812
|
if (specifier.startsWith(".") || specifier.startsWith("/")) {
|
|
13909
|
-
return resolveSourceFile(
|
|
13813
|
+
return resolveSourceFile(resolve21(fromDir, specifier));
|
|
13910
13814
|
}
|
|
13911
13815
|
const aliased = matchTsconfigAlias(specifier, tsconfigAliases.aliases, tsconfigAliases.baseUrl, resolveSourceFile);
|
|
13912
13816
|
if (aliased)
|
|
@@ -13915,7 +13819,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
13915
13819
|
const resolved = Bun.resolveSync(specifier, fromDir);
|
|
13916
13820
|
if (resolved.includes("/node_modules/"))
|
|
13917
13821
|
return;
|
|
13918
|
-
const absolute =
|
|
13822
|
+
const absolute = resolve21(resolved);
|
|
13919
13823
|
if (!absolute.startsWith(baseDir))
|
|
13920
13824
|
return;
|
|
13921
13825
|
return resolveSourceFile(absolute);
|
|
@@ -13931,7 +13835,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
13931
13835
|
usesLegacyAnimations: false
|
|
13932
13836
|
});
|
|
13933
13837
|
}
|
|
13934
|
-
const resolved =
|
|
13838
|
+
const resolved = resolve21(actualPath);
|
|
13935
13839
|
const cached = scanCache.get(resolved);
|
|
13936
13840
|
if (cached)
|
|
13937
13841
|
return cached;
|
|
@@ -13960,7 +13864,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
13960
13864
|
const actualPath = resolveSourceFile(filePath);
|
|
13961
13865
|
if (!actualPath)
|
|
13962
13866
|
return false;
|
|
13963
|
-
const resolved =
|
|
13867
|
+
const resolved = resolve21(actualPath);
|
|
13964
13868
|
if (visited.has(resolved))
|
|
13965
13869
|
return false;
|
|
13966
13870
|
visited.add(resolved);
|
|
@@ -13968,7 +13872,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
13968
13872
|
if (scan.usesLegacyAnimations)
|
|
13969
13873
|
return true;
|
|
13970
13874
|
for (const specifier of scan.imports) {
|
|
13971
|
-
const importedPath = resolveLocalImport(specifier,
|
|
13875
|
+
const importedPath = resolveLocalImport(specifier, dirname14(resolved));
|
|
13972
13876
|
if (importedPath && await visit(importedPath, visited)) {
|
|
13973
13877
|
return true;
|
|
13974
13878
|
}
|
|
@@ -13978,14 +13882,14 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
13978
13882
|
return (entryPath) => visit(entryPath);
|
|
13979
13883
|
}, resolveDevClientDir4 = () => {
|
|
13980
13884
|
const projectRoot = process.cwd();
|
|
13981
|
-
const fromSource =
|
|
13885
|
+
const fromSource = resolve21(import.meta.dir, "../dev/client");
|
|
13982
13886
|
if (existsSync22(fromSource) && fromSource.startsWith(projectRoot)) {
|
|
13983
13887
|
return fromSource;
|
|
13984
13888
|
}
|
|
13985
|
-
const fromNodeModules =
|
|
13889
|
+
const fromNodeModules = resolve21(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client");
|
|
13986
13890
|
if (existsSync22(fromNodeModules))
|
|
13987
13891
|
return fromNodeModules;
|
|
13988
|
-
return
|
|
13892
|
+
return resolve21(import.meta.dir, "./dev/client");
|
|
13989
13893
|
}, devClientDir4, hmrClientPath5, formatDiagnosticMessage = (diagnostic) => {
|
|
13990
13894
|
try {
|
|
13991
13895
|
return ts9.flattenDiagnosticMessageText(diagnostic.messageText, `
|
|
@@ -14027,12 +13931,12 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
14027
13931
|
return `${path.replace(/\.ts$/, ".js")}${query}`;
|
|
14028
13932
|
if (hasJsLikeExtension(path))
|
|
14029
13933
|
return `${path}${query}`;
|
|
14030
|
-
const importerDir =
|
|
14031
|
-
const fileCandidate =
|
|
13934
|
+
const importerDir = dirname14(importerOutputPath);
|
|
13935
|
+
const fileCandidate = resolve21(importerDir, `${path}.js`);
|
|
14032
13936
|
if (outputFiles?.has(fileCandidate) || existsSync22(fileCandidate)) {
|
|
14033
13937
|
return `${path}.js${query}`;
|
|
14034
13938
|
}
|
|
14035
|
-
const indexCandidate =
|
|
13939
|
+
const indexCandidate = resolve21(importerDir, path, "index.js");
|
|
14036
13940
|
if (outputFiles?.has(indexCandidate) || existsSync22(indexCandidate)) {
|
|
14037
13941
|
return `${path}/index.js${query}`;
|
|
14038
13942
|
}
|
|
@@ -14060,7 +13964,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
14060
13964
|
}, resolveLocalTsImport = (fromFile, specifier) => {
|
|
14061
13965
|
if (!isRelativeModuleSpecifier(specifier))
|
|
14062
13966
|
return null;
|
|
14063
|
-
const basePath =
|
|
13967
|
+
const basePath = resolve21(dirname14(fromFile), specifier);
|
|
14064
13968
|
const candidates = /\.[cm]?[tj]sx?$/.test(basePath) ? [basePath] : [
|
|
14065
13969
|
`${basePath}.ts`,
|
|
14066
13970
|
`${basePath}.tsx`,
|
|
@@ -14071,7 +13975,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
14071
13975
|
join27(basePath, "index.mts"),
|
|
14072
13976
|
join27(basePath, "index.cts")
|
|
14073
13977
|
];
|
|
14074
|
-
return candidates.map((candidate) =>
|
|
13978
|
+
return candidates.map((candidate) => resolve21(candidate)).find((candidate) => existsSync22(candidate) && !candidate.endsWith(".d.ts")) ?? null;
|
|
14075
13979
|
}, readFileForAotTransform = async (fileName, readFile6) => {
|
|
14076
13980
|
const hostSource = readFile6?.(fileName);
|
|
14077
13981
|
if (typeof hostSource === "string")
|
|
@@ -14106,7 +14010,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
14106
14010
|
paths.push(join27(fileDir, urlMatch.replace(/['"]/g, "")));
|
|
14107
14011
|
}
|
|
14108
14012
|
}
|
|
14109
|
-
return paths.map((path) =>
|
|
14013
|
+
return paths.map((path) => resolve21(path));
|
|
14110
14014
|
}, readResourceCacheFile = async (cachePath) => {
|
|
14111
14015
|
try {
|
|
14112
14016
|
const entry = JSON.parse(await fs5.readFile(cachePath, "utf-8"));
|
|
@@ -14118,13 +14022,13 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
14118
14022
|
return null;
|
|
14119
14023
|
}
|
|
14120
14024
|
}, writeResourceCacheFile = async (cachePath, source) => {
|
|
14121
|
-
await fs5.mkdir(
|
|
14025
|
+
await fs5.mkdir(dirname14(cachePath), { recursive: true });
|
|
14122
14026
|
await fs5.writeFile(cachePath, JSON.stringify({
|
|
14123
14027
|
source,
|
|
14124
14028
|
version: 1
|
|
14125
14029
|
}), "utf-8");
|
|
14126
14030
|
}, resolveResourceTransformCachePath = async (filePath, source, stylePreprocessors) => {
|
|
14127
|
-
const resourcePaths = collectAngularResourcePaths(source,
|
|
14031
|
+
const resourcePaths = collectAngularResourcePaths(source, dirname14(filePath));
|
|
14128
14032
|
const resourceContents = await Promise.all(resourcePaths.map(async (resourcePath) => {
|
|
14129
14033
|
const content = await fs5.readFile(resourcePath, "utf-8");
|
|
14130
14034
|
return `${resourcePath}\x00${content}`;
|
|
@@ -14148,7 +14052,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
14148
14052
|
transformedFiles: 0
|
|
14149
14053
|
};
|
|
14150
14054
|
const transformFile = async (filePath) => {
|
|
14151
|
-
const resolvedPath =
|
|
14055
|
+
const resolvedPath = resolve21(filePath);
|
|
14152
14056
|
if (visited.has(resolvedPath))
|
|
14153
14057
|
return;
|
|
14154
14058
|
visited.add(resolvedPath);
|
|
@@ -14164,7 +14068,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
14164
14068
|
transformedSource = cached.source;
|
|
14165
14069
|
} else {
|
|
14166
14070
|
stats.cacheMisses += 1;
|
|
14167
|
-
const transformed = await inlineResources(source,
|
|
14071
|
+
const transformed = await inlineResources(source, dirname14(resolvedPath), stylePreprocessors);
|
|
14168
14072
|
transformedSource = transformed.source;
|
|
14169
14073
|
await writeResourceCacheFile(cachePath, transformedSource);
|
|
14170
14074
|
}
|
|
@@ -14183,7 +14087,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
14183
14087
|
return { stats, transformedSources };
|
|
14184
14088
|
}, compileAngularFiles = async (inputPaths, outDir, stylePreprocessors) => {
|
|
14185
14089
|
const islandMetadataByOutputPath = await traceAngularPhase("aot/island-metadata", () => new Map(inputPaths.map((inputPath) => {
|
|
14186
|
-
const outputPath =
|
|
14090
|
+
const outputPath = resolve21(join27(outDir, relative11(process.cwd(), resolve21(inputPath)).replace(/\.[cm]?[tj]sx?$/, ".js")));
|
|
14187
14091
|
return [
|
|
14188
14092
|
outputPath,
|
|
14189
14093
|
buildIslandMetadataExports(readFileSync16(inputPath, "utf-8"))
|
|
@@ -14193,8 +14097,8 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
14193
14097
|
const { readConfiguration, performCompilation, EmitFlags } = await traceAngularPhase("aot/import-compiler-cli", () => import("@angular/compiler-cli"));
|
|
14194
14098
|
const tsLibDir = await traceAngularPhase("aot/resolve-typescript-lib", () => {
|
|
14195
14099
|
const tsPath = __require.resolve("typescript");
|
|
14196
|
-
const tsRootDir =
|
|
14197
|
-
return tsRootDir.endsWith("lib") ? tsRootDir :
|
|
14100
|
+
const tsRootDir = dirname14(tsPath);
|
|
14101
|
+
return tsRootDir.endsWith("lib") ? tsRootDir : resolve21(tsRootDir, "lib");
|
|
14198
14102
|
});
|
|
14199
14103
|
const config = await traceAngularPhase("aot/read-configuration", () => readConfiguration("./tsconfig.json"));
|
|
14200
14104
|
const options = {
|
|
@@ -14236,7 +14140,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
14236
14140
|
return originalGetSourceFile?.call(host, fileName, languageVersion, onError);
|
|
14237
14141
|
};
|
|
14238
14142
|
const emitted = {};
|
|
14239
|
-
const resolvedOutDir =
|
|
14143
|
+
const resolvedOutDir = resolve21(outDir);
|
|
14240
14144
|
host.writeFile = (fileName, text) => {
|
|
14241
14145
|
const relativePath = resolveRelativePath(fileName, resolvedOutDir, outDir);
|
|
14242
14146
|
emitted[relativePath] = text;
|
|
@@ -14258,12 +14162,12 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
14258
14162
|
if (!fileName.endsWith(".ts") || fileName.endsWith(".d.ts")) {
|
|
14259
14163
|
return source;
|
|
14260
14164
|
}
|
|
14261
|
-
const resolvedPath =
|
|
14165
|
+
const resolvedPath = resolve21(fileName);
|
|
14262
14166
|
return transformedSources.get(resolvedPath) ?? source;
|
|
14263
14167
|
};
|
|
14264
14168
|
const originalGetSourceFileForCompile = host.getSourceFile;
|
|
14265
14169
|
host.getSourceFile = (fileName, languageVersion, onError) => {
|
|
14266
|
-
const source = transformedSources.get(
|
|
14170
|
+
const source = transformedSources.get(resolve21(fileName));
|
|
14267
14171
|
if (source) {
|
|
14268
14172
|
return ts9.createSourceFile(fileName, source, languageVersion, true);
|
|
14269
14173
|
}
|
|
@@ -14287,7 +14191,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
14287
14191
|
content,
|
|
14288
14192
|
target: join27(outDir, fileName)
|
|
14289
14193
|
}));
|
|
14290
|
-
const outputFiles = new Set(rawEntries.map(({ target }) =>
|
|
14194
|
+
const outputFiles = new Set(rawEntries.map(({ target }) => resolve21(target)));
|
|
14291
14195
|
return rawEntries.map(({ content, target }) => {
|
|
14292
14196
|
let processedContent = content.replace(/from\s+(['"])(\.\.?\/[^'"]+)(\1)/g, (match, quote, path) => {
|
|
14293
14197
|
const rewritten = rewriteRelativeJsSpecifier(target, path, outputFiles);
|
|
@@ -14302,17 +14206,17 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
14302
14206
|
return cleaned ? `import { ${cleaned}, InternalInjectFlags } from '@angular/core'` : `import { InternalInjectFlags } from '@angular/core'`;
|
|
14303
14207
|
});
|
|
14304
14208
|
processedContent = processedContent.replace(/\b(?<!Internal)InjectFlags\b/g, "InternalInjectFlags");
|
|
14305
|
-
processedContent += islandMetadataByOutputPath.get(
|
|
14209
|
+
processedContent += islandMetadataByOutputPath.get(resolve21(target)) ?? "";
|
|
14306
14210
|
return { content: processedContent, target };
|
|
14307
14211
|
});
|
|
14308
14212
|
});
|
|
14309
14213
|
await traceAngularPhase("aot/write-output", () => Promise.all(entries.map(async ({ target, content }) => {
|
|
14310
|
-
await fs5.mkdir(
|
|
14214
|
+
await fs5.mkdir(dirname14(target), { recursive: true });
|
|
14311
14215
|
await fs5.writeFile(target, content, "utf-8");
|
|
14312
14216
|
})), { outputs: entries.length });
|
|
14313
14217
|
return await traceAngularPhase("aot/collect-output-paths", () => entries.map(({ target }) => target), { outputs: entries.length });
|
|
14314
14218
|
}, compileAngularFile = async (inputPath, outDir, stylePreprocessors) => compileAngularFiles([inputPath], outDir, stylePreprocessors), jitContentCache, invalidateAngularJitCache = (filePath) => {
|
|
14315
|
-
jitContentCache.delete(
|
|
14219
|
+
jitContentCache.delete(resolve21(filePath));
|
|
14316
14220
|
}, wrapperOutputCache, escapeTemplateContent = (content) => content.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$\{/g, "\\${"), findUncommentedMatch = (source, pattern) => {
|
|
14317
14221
|
const re2 = new RegExp(pattern.source, pattern.flags.includes("g") ? pattern.flags : pattern.flags + "g");
|
|
14318
14222
|
let match;
|
|
@@ -14325,7 +14229,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
14325
14229
|
}
|
|
14326
14230
|
return null;
|
|
14327
14231
|
}, resolveAngularDeferImportSpecifier = () => {
|
|
14328
|
-
const sourceEntry =
|
|
14232
|
+
const sourceEntry = resolve21(import.meta.dir, "../angular/components/index.ts");
|
|
14329
14233
|
if (existsSync22(sourceEntry)) {
|
|
14330
14234
|
return sourceEntry.replace(/\\/g, "/");
|
|
14331
14235
|
}
|
|
@@ -14555,10 +14459,10 @@ ${fields}
|
|
|
14555
14459
|
source: result
|
|
14556
14460
|
};
|
|
14557
14461
|
}, compileAngularFileJIT = async (inputPath, outDir, rootDir, stylePreprocessors, cacheBuster) => {
|
|
14558
|
-
const entryPath =
|
|
14462
|
+
const entryPath = resolve21(inputPath);
|
|
14559
14463
|
const allOutputs = [];
|
|
14560
14464
|
const visited = new Set;
|
|
14561
|
-
const baseDir =
|
|
14465
|
+
const baseDir = resolve21(rootDir ?? process.cwd());
|
|
14562
14466
|
let usesLegacyAnimations = false;
|
|
14563
14467
|
const angularTranspiler = new Bun.Transpiler({
|
|
14564
14468
|
loader: "ts",
|
|
@@ -14586,7 +14490,7 @@ ${fields}
|
|
|
14586
14490
|
};
|
|
14587
14491
|
const resolveLocalImport = (specifier, fromDir) => {
|
|
14588
14492
|
if (specifier.startsWith(".") || specifier.startsWith("/")) {
|
|
14589
|
-
return resolveSourceFile2(
|
|
14493
|
+
return resolveSourceFile2(resolve21(fromDir, specifier));
|
|
14590
14494
|
}
|
|
14591
14495
|
const aliased = matchTsconfigAlias(specifier, tsconfigAliases.aliases, tsconfigAliases.baseUrl, resolveSourceFile2);
|
|
14592
14496
|
if (aliased)
|
|
@@ -14595,7 +14499,7 @@ ${fields}
|
|
|
14595
14499
|
const resolved = Bun.resolveSync(specifier, fromDir);
|
|
14596
14500
|
if (resolved.includes("/node_modules/"))
|
|
14597
14501
|
return;
|
|
14598
|
-
const absolute =
|
|
14502
|
+
const absolute = resolve21(resolved);
|
|
14599
14503
|
if (!absolute.startsWith(baseDir))
|
|
14600
14504
|
return;
|
|
14601
14505
|
return resolveSourceFile2(absolute);
|
|
@@ -14604,7 +14508,7 @@ ${fields}
|
|
|
14604
14508
|
}
|
|
14605
14509
|
};
|
|
14606
14510
|
const toOutputPath = (sourcePath) => {
|
|
14607
|
-
const inputDir =
|
|
14511
|
+
const inputDir = dirname14(sourcePath);
|
|
14608
14512
|
const fileBase = basename8(sourcePath).replace(/\.[cm]?[tj]sx?$/, ".js");
|
|
14609
14513
|
if (inputDir === outDir || inputDir.startsWith(`${outDir}${sep3}`)) {
|
|
14610
14514
|
return join27(inputDir, fileBase);
|
|
@@ -14647,18 +14551,18 @@ ${fields}
|
|
|
14647
14551
|
return `${prefix}${dots}`;
|
|
14648
14552
|
return `${prefix}../${dots}`;
|
|
14649
14553
|
});
|
|
14650
|
-
if (
|
|
14554
|
+
if (resolve21(actualPath) === entryPath) {
|
|
14651
14555
|
processedContent += buildIslandMetadataExports(sourceCode);
|
|
14652
14556
|
}
|
|
14653
14557
|
return processedContent;
|
|
14654
14558
|
};
|
|
14655
14559
|
const transpileFile = async (filePath) => {
|
|
14656
|
-
const resolved =
|
|
14560
|
+
const resolved = resolve21(filePath);
|
|
14657
14561
|
if (visited.has(resolved))
|
|
14658
14562
|
return;
|
|
14659
14563
|
visited.add(resolved);
|
|
14660
14564
|
if (resolved.endsWith(".json") && existsSync22(resolved)) {
|
|
14661
|
-
const inputDir2 =
|
|
14565
|
+
const inputDir2 = dirname14(resolved);
|
|
14662
14566
|
const relativeDir2 = inputDir2.startsWith(baseDir) ? inputDir2.substring(baseDir.length + 1) : inputDir2;
|
|
14663
14567
|
const targetDir2 = join27(outDir, relativeDir2);
|
|
14664
14568
|
const targetPath2 = join27(targetDir2, basename8(resolved));
|
|
@@ -14673,12 +14577,12 @@ ${fields}
|
|
|
14673
14577
|
if (!existsSync22(actualPath))
|
|
14674
14578
|
return;
|
|
14675
14579
|
let sourceCode = await fs5.readFile(actualPath, "utf-8");
|
|
14676
|
-
const inlined = await inlineResources(sourceCode,
|
|
14677
|
-
sourceCode = inlineTemplateAndLowerDeferSync(inlined.source,
|
|
14678
|
-
const inputDir =
|
|
14580
|
+
const inlined = await inlineResources(sourceCode, dirname14(actualPath), stylePreprocessors);
|
|
14581
|
+
sourceCode = inlineTemplateAndLowerDeferSync(inlined.source, dirname14(actualPath)).source;
|
|
14582
|
+
const inputDir = dirname14(actualPath);
|
|
14679
14583
|
const fileBase = basename8(actualPath).replace(/\.[cm]?[tj]sx?$/, ".js");
|
|
14680
14584
|
const targetPath = toOutputPath(actualPath);
|
|
14681
|
-
const targetDir =
|
|
14585
|
+
const targetDir = dirname14(targetPath);
|
|
14682
14586
|
const relativeDir = relative11(outDir, targetDir).replace(/\\/g, "/");
|
|
14683
14587
|
const localImports = [];
|
|
14684
14588
|
const importRewrites = new Map;
|
|
@@ -14705,7 +14609,7 @@ ${fields}
|
|
|
14705
14609
|
importRewrites.set(specifier, relativeRewrite);
|
|
14706
14610
|
return resolved2;
|
|
14707
14611
|
}).filter((path) => Boolean(path));
|
|
14708
|
-
const isEntry =
|
|
14612
|
+
const isEntry = resolve21(actualPath) === resolve21(entryPath);
|
|
14709
14613
|
const contentHash = Bun.hash(sourceCode).toString(BASE_36_RADIX);
|
|
14710
14614
|
const cacheKey2 = actualPath;
|
|
14711
14615
|
const shouldWriteFile = cacheBuster && isEntry ? true : jitContentCache.get(cacheKey2) !== contentHash || !existsSync22(targetPath);
|
|
@@ -14741,11 +14645,11 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
14741
14645
|
const compiledRoot = compiledParent;
|
|
14742
14646
|
const indexesDir = join27(compiledParent, "indexes");
|
|
14743
14647
|
await traceAngularPhase("setup/create-indexes-dir", () => fs5.mkdir(indexesDir, { recursive: true }));
|
|
14744
|
-
const aotOutputs = hmr ? [] : await traceAngularPhase("aot/compile-files", () => compileAngularFiles(entryPoints.map((entry) =>
|
|
14648
|
+
const aotOutputs = hmr ? [] : await traceAngularPhase("aot/compile-files", () => compileAngularFiles(entryPoints.map((entry) => resolve21(entry)), compiledRoot, stylePreprocessors), { entries: entryPoints.length });
|
|
14745
14649
|
if (!hmr) {
|
|
14746
14650
|
await traceAngularPhase("aot/copy-json-resources", async () => {
|
|
14747
14651
|
const cwd = process.cwd();
|
|
14748
|
-
const angularSrcDir =
|
|
14652
|
+
const angularSrcDir = resolve21(outRoot);
|
|
14749
14653
|
if (!existsSync22(angularSrcDir))
|
|
14750
14654
|
return;
|
|
14751
14655
|
const jsonGlob = new Glob6("**/*.json");
|
|
@@ -14756,14 +14660,14 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
14756
14660
|
const sourcePath = join27(angularSrcDir, rel);
|
|
14757
14661
|
const cwdRel = relative11(cwd, sourcePath);
|
|
14758
14662
|
const targetPath = join27(compiledRoot, cwdRel);
|
|
14759
|
-
await fs5.mkdir(
|
|
14663
|
+
await fs5.mkdir(dirname14(targetPath), { recursive: true });
|
|
14760
14664
|
await fs5.copyFile(sourcePath, targetPath);
|
|
14761
14665
|
}
|
|
14762
14666
|
});
|
|
14763
14667
|
}
|
|
14764
14668
|
const usesLegacyAngularAnimations = await traceAngularPhase("setup/legacy-animation-resolver", () => createLegacyAngularAnimationUsageResolver(outRoot));
|
|
14765
14669
|
const compileTasks = entryPoints.map(async (entry) => {
|
|
14766
|
-
const resolvedEntry =
|
|
14670
|
+
const resolvedEntry = resolve21(entry);
|
|
14767
14671
|
const relativeEntry = relative11(outRoot, resolvedEntry).replace(/\.[tj]s$/, ".js");
|
|
14768
14672
|
const compileEntry = () => compileAngularFileJIT(resolvedEntry, compiledRoot, outRoot, stylePreprocessors);
|
|
14769
14673
|
let outputs = hmr ? await traceAngularPhase("jit/compile-entry", compileEntry, {
|
|
@@ -14775,10 +14679,10 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
14775
14679
|
join27(compiledRoot, relativeEntry),
|
|
14776
14680
|
join27(compiledRoot, "pages", jsName),
|
|
14777
14681
|
join27(compiledRoot, jsName)
|
|
14778
|
-
].map((file3) =>
|
|
14682
|
+
].map((file3) => resolve21(file3));
|
|
14779
14683
|
const resolveRawServerFile = (candidatePaths) => {
|
|
14780
14684
|
const normalizedCandidates = [
|
|
14781
|
-
...candidatePaths.map((file3) =>
|
|
14685
|
+
...candidatePaths.map((file3) => resolve21(file3)),
|
|
14782
14686
|
...compiledFallbackPaths
|
|
14783
14687
|
];
|
|
14784
14688
|
let candidate = normalizedCandidates.find((file3) => existsSync22(file3) && file3.endsWith(`${sep3}${relativeEntry}`));
|
|
@@ -14850,13 +14754,13 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
14850
14754
|
const pageInjection = providersInjection?.pagesByFile.get(resolvedEntry);
|
|
14851
14755
|
if (providersInjection && pageInjection) {
|
|
14852
14756
|
const compiledAppProvidersPath = (() => {
|
|
14853
|
-
const angularDirAbs =
|
|
14854
|
-
const appSourceAbs =
|
|
14757
|
+
const angularDirAbs = resolve21(outRoot);
|
|
14758
|
+
const appSourceAbs = resolve21(providersInjection.appProvidersSource);
|
|
14855
14759
|
const rel = relative11(angularDirAbs, appSourceAbs).replace(/\\/g, "/");
|
|
14856
14760
|
return join27(compiledParent, rel).replace(/\.[cm]?[tj]sx?$/, ".js");
|
|
14857
14761
|
})();
|
|
14858
14762
|
const appProvidersSpec = (() => {
|
|
14859
|
-
const rel = relative11(
|
|
14763
|
+
const rel = relative11(dirname14(rawServerFile), compiledAppProvidersPath).replace(/\\/g, "/");
|
|
14860
14764
|
return rel.startsWith(".") ? rel : `./${rel}`;
|
|
14861
14765
|
})();
|
|
14862
14766
|
const importLines = [
|
|
@@ -15798,7 +15702,7 @@ __export(exports_fastHmrCompiler, {
|
|
|
15798
15702
|
invalidateFingerprintCache: () => invalidateFingerprintCache
|
|
15799
15703
|
});
|
|
15800
15704
|
import { existsSync as existsSync23, readFileSync as readFileSync17, statSync as statSync2 } from "fs";
|
|
15801
|
-
import { dirname as
|
|
15705
|
+
import { dirname as dirname15, extname as extname6, relative as relative12, resolve as resolve22 } from "path";
|
|
15802
15706
|
import ts13 from "typescript";
|
|
15803
15707
|
var fail = (reason, detail, location) => ({
|
|
15804
15708
|
ok: false,
|
|
@@ -15926,7 +15830,7 @@ var fail = (reason, detail, location) => ({
|
|
|
15926
15830
|
continue;
|
|
15927
15831
|
const decoratorMeta = readDecoratorMeta(args);
|
|
15928
15832
|
const { inputs, outputs } = extractInputsAndOutputs(stmt, null);
|
|
15929
|
-
const componentDir =
|
|
15833
|
+
const componentDir = dirname15(componentFilePath);
|
|
15930
15834
|
const fingerprint = extractFingerprint(stmt, className, decoratorMeta, inputs, outputs, sourceFile, componentDir);
|
|
15931
15835
|
fingerprintCache.set(id, fingerprint);
|
|
15932
15836
|
} else {
|
|
@@ -16102,7 +16006,7 @@ var fail = (reason, detail, location) => ({
|
|
|
16102
16006
|
if (!spec.startsWith(".") && !spec.startsWith("/")) {
|
|
16103
16007
|
return true;
|
|
16104
16008
|
}
|
|
16105
|
-
const base =
|
|
16009
|
+
const base = resolve22(componentDir, spec);
|
|
16106
16010
|
const candidates = [
|
|
16107
16011
|
`${base}.ts`,
|
|
16108
16012
|
`${base}.tsx`,
|
|
@@ -16886,7 +16790,7 @@ var fail = (reason, detail, location) => ({
|
|
|
16886
16790
|
});
|
|
16887
16791
|
if (!names.includes(className))
|
|
16888
16792
|
continue;
|
|
16889
|
-
const nextDts = resolveDtsFromSpec(fromPath,
|
|
16793
|
+
const nextDts = resolveDtsFromSpec(fromPath, dirname15(startDtsPath));
|
|
16890
16794
|
if (!nextDts)
|
|
16891
16795
|
continue;
|
|
16892
16796
|
const found = findDtsContainingClass(nextDts, className, visited);
|
|
@@ -16896,7 +16800,7 @@ var fail = (reason, detail, location) => ({
|
|
|
16896
16800
|
const starReExportRe = /export\s*\*\s*from\s*["']([^"']+)["']/g;
|
|
16897
16801
|
while ((m = starReExportRe.exec(content)) !== null) {
|
|
16898
16802
|
const fromPath = m[1] || "";
|
|
16899
|
-
const nextDts = resolveDtsFromSpec(fromPath,
|
|
16803
|
+
const nextDts = resolveDtsFromSpec(fromPath, dirname15(startDtsPath));
|
|
16900
16804
|
if (!nextDts)
|
|
16901
16805
|
continue;
|
|
16902
16806
|
const found = findDtsContainingClass(nextDts, className, visited);
|
|
@@ -16906,7 +16810,7 @@ var fail = (reason, detail, location) => ({
|
|
|
16906
16810
|
return null;
|
|
16907
16811
|
}, resolveDtsFromSpec = (spec, fromDir) => {
|
|
16908
16812
|
const stripped = spec.replace(/\.[mc]?js$/, "");
|
|
16909
|
-
const base =
|
|
16813
|
+
const base = resolve22(fromDir, stripped);
|
|
16910
16814
|
const candidates = [
|
|
16911
16815
|
`${base}.d.ts`,
|
|
16912
16816
|
`${base}.d.mts`,
|
|
@@ -16930,7 +16834,7 @@ var fail = (reason, detail, location) => ({
|
|
|
16930
16834
|
return null;
|
|
16931
16835
|
}, resolveChildComponentInfo = (className, spec, componentDir, projectRoot) => {
|
|
16932
16836
|
if (spec.startsWith(".") || spec.startsWith("/")) {
|
|
16933
|
-
const base =
|
|
16837
|
+
const base = resolve22(componentDir, spec);
|
|
16934
16838
|
const candidates = [
|
|
16935
16839
|
`${base}.ts`,
|
|
16936
16840
|
`${base}.tsx`,
|
|
@@ -17149,13 +17053,13 @@ var fail = (reason, detail, location) => ({
|
|
|
17149
17053
|
}
|
|
17150
17054
|
if (!matches)
|
|
17151
17055
|
continue;
|
|
17152
|
-
const resolved =
|
|
17056
|
+
const resolved = resolve22(componentDir, spec);
|
|
17153
17057
|
for (const ext of TS_EXTENSIONS) {
|
|
17154
17058
|
const candidate = resolved + ext;
|
|
17155
17059
|
if (existsSync23(candidate))
|
|
17156
17060
|
return candidate;
|
|
17157
17061
|
}
|
|
17158
|
-
const indexCandidate =
|
|
17062
|
+
const indexCandidate = resolve22(resolved, "index.ts");
|
|
17159
17063
|
if (existsSync23(indexCandidate))
|
|
17160
17064
|
return indexCandidate;
|
|
17161
17065
|
}
|
|
@@ -17388,7 +17292,7 @@ ${transpiled}
|
|
|
17388
17292
|
}
|
|
17389
17293
|
}${staticPatch}`;
|
|
17390
17294
|
}, STYLE_PREPROCESSED_EXT, resolveAndReadStyleResource = (componentDir, url) => {
|
|
17391
|
-
const abs =
|
|
17295
|
+
const abs = resolve22(componentDir, url);
|
|
17392
17296
|
if (!existsSync23(abs))
|
|
17393
17297
|
return null;
|
|
17394
17298
|
const ext = extname6(abs).toLowerCase();
|
|
@@ -17428,7 +17332,7 @@ ${block}
|
|
|
17428
17332
|
const cached = projectOptionsCache.get(projectRoot);
|
|
17429
17333
|
if (cached !== undefined)
|
|
17430
17334
|
return cached;
|
|
17431
|
-
const tsconfigPath =
|
|
17335
|
+
const tsconfigPath = resolve22(projectRoot, "tsconfig.json");
|
|
17432
17336
|
const opts = {};
|
|
17433
17337
|
if (existsSync23(tsconfigPath)) {
|
|
17434
17338
|
try {
|
|
@@ -17493,7 +17397,7 @@ ${block}
|
|
|
17493
17397
|
rebootstrapRequired: false
|
|
17494
17398
|
};
|
|
17495
17399
|
}
|
|
17496
|
-
if (inheritsDecoratedClass(classNode, sourceFile,
|
|
17400
|
+
if (inheritsDecoratedClass(classNode, sourceFile, dirname15(componentFilePath), projectRoot)) {
|
|
17497
17401
|
return fail("inherits-decorated-class");
|
|
17498
17402
|
}
|
|
17499
17403
|
const decorator = findComponentDecorator(classNode);
|
|
@@ -17505,14 +17409,14 @@ ${block}
|
|
|
17505
17409
|
const projectDefaults = readProjectAngularCompilerOptions(projectRoot);
|
|
17506
17410
|
const decoratorMeta = readDecoratorMeta(decoratorArgs, projectDefaults);
|
|
17507
17411
|
const advancedMetadata = extractAdvancedMetadata(classNode, decoratorArgs, compiler);
|
|
17508
|
-
const componentDir =
|
|
17412
|
+
const componentDir = dirname15(componentFilePath);
|
|
17509
17413
|
let templateText;
|
|
17510
17414
|
let templatePath;
|
|
17511
17415
|
if (decoratorMeta.template !== null) {
|
|
17512
17416
|
templateText = decoratorMeta.template;
|
|
17513
17417
|
templatePath = componentFilePath;
|
|
17514
17418
|
} else if (decoratorMeta.templateUrl) {
|
|
17515
|
-
const tplAbs =
|
|
17419
|
+
const tplAbs = resolve22(componentDir, decoratorMeta.templateUrl);
|
|
17516
17420
|
if (!existsSync23(tplAbs)) {
|
|
17517
17421
|
return fail("template-resource-not-found", `Template file not found: ${tplAbs}`, { file: componentFilePath });
|
|
17518
17422
|
}
|
|
@@ -18266,7 +18170,7 @@ __export(exports_compileEmber, {
|
|
|
18266
18170
|
getEmberServerCompiledDir: () => getEmberServerCompiledDir,
|
|
18267
18171
|
getEmberCompiledRoot: () => getEmberCompiledRoot,
|
|
18268
18172
|
getEmberClientCompiledDir: () => getEmberClientCompiledDir,
|
|
18269
|
-
dirname: () =>
|
|
18173
|
+
dirname: () => dirname16,
|
|
18270
18174
|
compileEmberFileSource: () => compileEmberFileSource,
|
|
18271
18175
|
compileEmberFile: () => compileEmberFile,
|
|
18272
18176
|
compileEmber: () => compileEmber,
|
|
@@ -18275,7 +18179,7 @@ __export(exports_compileEmber, {
|
|
|
18275
18179
|
});
|
|
18276
18180
|
import { existsSync as existsSync24 } from "fs";
|
|
18277
18181
|
import { mkdir as mkdir6, rm as rm4 } from "fs/promises";
|
|
18278
|
-
import { basename as basename9, dirname as
|
|
18182
|
+
import { basename as basename9, dirname as dirname16, extname as extname7, join as join28, resolve as resolve23 } from "path";
|
|
18279
18183
|
var {build: bunBuild2, Transpiler: Transpiler4, write: write4, file: file3 } = globalThis.Bun;
|
|
18280
18184
|
var cachedPreprocessor = null, getPreprocessor = async () => {
|
|
18281
18185
|
if (cachedPreprocessor)
|
|
@@ -18371,7 +18275,7 @@ export const importSync = (specifier) => {
|
|
|
18371
18275
|
const originalImporter = stagedSourceMap.get(args.importer);
|
|
18372
18276
|
if (!originalImporter)
|
|
18373
18277
|
return;
|
|
18374
|
-
const candidateBase =
|
|
18278
|
+
const candidateBase = resolve23(dirname16(originalImporter), args.path);
|
|
18375
18279
|
const extensionsToTry = ["", ".gts", ".gjs", ".ts", ".js"];
|
|
18376
18280
|
for (const ext of extensionsToTry) {
|
|
18377
18281
|
const candidate = candidateBase + ext;
|
|
@@ -18430,7 +18334,7 @@ export const renderToHTML = (props = {}) => {
|
|
|
18430
18334
|
export { PageComponent };
|
|
18431
18335
|
export default PageComponent;
|
|
18432
18336
|
`, compileEmberFile = async (entry, compiledRoot, cwd = process.cwd()) => {
|
|
18433
|
-
const resolvedEntry =
|
|
18337
|
+
const resolvedEntry = resolve23(entry);
|
|
18434
18338
|
const source = await file3(resolvedEntry).text();
|
|
18435
18339
|
let preprocessed = source;
|
|
18436
18340
|
if (isTemplateTagFile(resolvedEntry)) {
|
|
@@ -18450,8 +18354,8 @@ export default PageComponent;
|
|
|
18450
18354
|
mkdir6(serverDir, { recursive: true }),
|
|
18451
18355
|
mkdir6(clientDir, { recursive: true })
|
|
18452
18356
|
]);
|
|
18453
|
-
const tmpPagePath =
|
|
18454
|
-
const tmpHarnessPath =
|
|
18357
|
+
const tmpPagePath = resolve23(join28(tmpDir, `${baseName}.module.js`));
|
|
18358
|
+
const tmpHarnessPath = resolve23(join28(tmpDir, `${baseName}.harness.js`));
|
|
18455
18359
|
await Promise.all([
|
|
18456
18360
|
write4(tmpPagePath, transpiled),
|
|
18457
18361
|
write4(tmpHarnessPath, generateServerHarness(tmpPagePath))
|
|
@@ -18493,7 +18397,7 @@ export default PageComponent;
|
|
|
18493
18397
|
serverPaths: outputs.map((o3) => o3.serverPath)
|
|
18494
18398
|
};
|
|
18495
18399
|
}, compileEmberFileSource = async (entry) => {
|
|
18496
|
-
const resolvedEntry =
|
|
18400
|
+
const resolvedEntry = resolve23(entry);
|
|
18497
18401
|
const source = await file3(resolvedEntry).text();
|
|
18498
18402
|
let preprocessed = source;
|
|
18499
18403
|
if (isTemplateTagFile(resolvedEntry)) {
|
|
@@ -18526,24 +18430,24 @@ __export(exports_buildReactVendor, {
|
|
|
18526
18430
|
buildReactVendor: () => buildReactVendor
|
|
18527
18431
|
});
|
|
18528
18432
|
import { existsSync as existsSync25, mkdirSync as mkdirSync8 } from "fs";
|
|
18529
|
-
import { join as join29, resolve as
|
|
18433
|
+
import { join as join29, resolve as resolve24 } from "path";
|
|
18530
18434
|
import { rm as rm5 } from "fs/promises";
|
|
18531
18435
|
var {build: bunBuild3 } = globalThis.Bun;
|
|
18532
18436
|
var resolveJsxDevRuntimeCompatPath = () => {
|
|
18533
18437
|
const candidates = [
|
|
18534
|
-
|
|
18535
|
-
|
|
18536
|
-
|
|
18537
|
-
|
|
18538
|
-
|
|
18539
|
-
|
|
18438
|
+
resolve24(import.meta.dir, "react", "jsxDevRuntimeCompat.js"),
|
|
18439
|
+
resolve24(import.meta.dir, "src", "react", "jsxDevRuntimeCompat.ts"),
|
|
18440
|
+
resolve24(import.meta.dir, "..", "react", "jsxDevRuntimeCompat.js"),
|
|
18441
|
+
resolve24(import.meta.dir, "..", "src", "react", "jsxDevRuntimeCompat.ts"),
|
|
18442
|
+
resolve24(import.meta.dir, "..", "..", "dist", "react", "jsxDevRuntimeCompat.js"),
|
|
18443
|
+
resolve24(import.meta.dir, "..", "..", "src", "react", "jsxDevRuntimeCompat.ts")
|
|
18540
18444
|
];
|
|
18541
18445
|
for (const candidate of candidates) {
|
|
18542
18446
|
if (existsSync25(candidate)) {
|
|
18543
18447
|
return candidate.replace(/\\/g, "/");
|
|
18544
18448
|
}
|
|
18545
18449
|
}
|
|
18546
|
-
return (candidates[0] ??
|
|
18450
|
+
return (candidates[0] ?? resolve24(import.meta.dir, "react", "jsxDevRuntimeCompat.js")).replace(/\\/g, "/");
|
|
18547
18451
|
}, jsxDevRuntimeCompatPath, reactSpecifiers, isResolvable = (specifier) => {
|
|
18548
18452
|
try {
|
|
18549
18453
|
Bun.resolveSync(specifier, process.cwd());
|
|
@@ -19193,7 +19097,7 @@ import {
|
|
|
19193
19097
|
statSync as statSync3,
|
|
19194
19098
|
writeFileSync as writeFileSync8
|
|
19195
19099
|
} from "fs";
|
|
19196
|
-
import { basename as basename10, dirname as
|
|
19100
|
+
import { basename as basename10, dirname as dirname17, extname as extname8, join as join34, relative as relative13, resolve as resolve25 } from "path";
|
|
19197
19101
|
import { cwd, env as env2, exit } from "process";
|
|
19198
19102
|
var {build: bunBuild7, Glob: Glob8 } = globalThis.Bun;
|
|
19199
19103
|
var isDev, isBuildTraceEnabled = () => {
|
|
@@ -19284,8 +19188,8 @@ var isDev, isBuildTraceEnabled = () => {
|
|
|
19284
19188
|
}
|
|
19285
19189
|
}, resolveAbsoluteVersion = async () => {
|
|
19286
19190
|
const candidates = [
|
|
19287
|
-
|
|
19288
|
-
|
|
19191
|
+
resolve25(import.meta.dir, "..", "..", "package.json"),
|
|
19192
|
+
resolve25(import.meta.dir, "..", "package.json")
|
|
19289
19193
|
];
|
|
19290
19194
|
const resolveCandidate = async (remaining) => {
|
|
19291
19195
|
const [candidate, ...rest] = remaining;
|
|
@@ -19301,7 +19205,7 @@ var isDev, isBuildTraceEnabled = () => {
|
|
|
19301
19205
|
};
|
|
19302
19206
|
await resolveCandidate(candidates);
|
|
19303
19207
|
}, SKIP_DIRS4, addWorkerPathIfExists = (file4, relPath, workerPaths) => {
|
|
19304
|
-
const absPath =
|
|
19208
|
+
const absPath = resolve25(file4, "..", relPath);
|
|
19305
19209
|
try {
|
|
19306
19210
|
statSync3(absPath);
|
|
19307
19211
|
workerPaths.add(absPath);
|
|
@@ -19363,7 +19267,7 @@ var isDev, isBuildTraceEnabled = () => {
|
|
|
19363
19267
|
return;
|
|
19364
19268
|
}
|
|
19365
19269
|
const indexFiles = readDir(reactIndexesPath).filter((file4) => file4.endsWith(".tsx"));
|
|
19366
|
-
const pagesRel = relative13(process.cwd(),
|
|
19270
|
+
const pagesRel = relative13(process.cwd(), resolve25(reactPagesPath)).replace(/\\/g, "/");
|
|
19367
19271
|
for (const file4 of indexFiles) {
|
|
19368
19272
|
let content = readFileSync18(join34(reactIndexesPath, file4), "utf-8");
|
|
19369
19273
|
content = content.replace(/from\s*['"]([^'"]*\/pages\/([^'"]+))['"]/g, (_match, _fullPath, componentName) => `from '/@src/${pagesRel}/${componentName}'`);
|
|
@@ -19371,27 +19275,27 @@ var isDev, isBuildTraceEnabled = () => {
|
|
|
19371
19275
|
}
|
|
19372
19276
|
}, copySvelteDevIndexes = (svelteDir, sveltePagesPath, svelteEntries, devIndexDir) => {
|
|
19373
19277
|
const svelteIndexDir = join34(getFrameworkGeneratedDir("svelte"), "indexes");
|
|
19374
|
-
const sveltePageEntries = svelteEntries.filter((file4) =>
|
|
19278
|
+
const sveltePageEntries = svelteEntries.filter((file4) => resolve25(file4).startsWith(resolve25(sveltePagesPath)));
|
|
19375
19279
|
for (const entry of sveltePageEntries) {
|
|
19376
19280
|
const name = basename10(entry).replace(/\.svelte(\.(ts|js))?$/, "");
|
|
19377
19281
|
const indexFile = join34(svelteIndexDir, "pages", `${name}.js`);
|
|
19378
19282
|
if (!existsSync26(indexFile))
|
|
19379
19283
|
continue;
|
|
19380
19284
|
let content = readFileSync18(indexFile, "utf-8");
|
|
19381
|
-
const srcRel = relative13(process.cwd(),
|
|
19285
|
+
const srcRel = relative13(process.cwd(), resolve25(entry)).replace(/\\/g, "/");
|
|
19382
19286
|
content = content.replace(/import\s+Component\s+from\s+['"]([^'"]+)['"]/, `import Component from "/@src/${srcRel}"`);
|
|
19383
19287
|
writeFileSync8(join34(devIndexDir, `${name}.svelte.js`), content);
|
|
19384
19288
|
}
|
|
19385
19289
|
}, copyVueDevIndexes = (vueDir, vuePagesPath, vueEntries, devIndexDir) => {
|
|
19386
19290
|
const vueIndexDir = join34(getFrameworkGeneratedDir("vue"), "indexes");
|
|
19387
|
-
const vuePageEntries = vueEntries.filter((file4) =>
|
|
19291
|
+
const vuePageEntries = vueEntries.filter((file4) => resolve25(file4).startsWith(resolve25(vuePagesPath)));
|
|
19388
19292
|
for (const entry of vuePageEntries) {
|
|
19389
19293
|
const name = basename10(entry, ".vue");
|
|
19390
19294
|
const indexFile = join34(vueIndexDir, `${name}.js`);
|
|
19391
19295
|
if (!existsSync26(indexFile))
|
|
19392
19296
|
continue;
|
|
19393
19297
|
let content = readFileSync18(indexFile, "utf-8");
|
|
19394
|
-
const srcRel = relative13(process.cwd(),
|
|
19298
|
+
const srcRel = relative13(process.cwd(), resolve25(entry)).replace(/\\/g, "/");
|
|
19395
19299
|
content = content.replace(/import\s+Comp(?:\s*,\s*\*\s+as\s+\w+)?\s+from\s+['"]([^'"]+)['"]/, (match) => match.replace(/from\s+['"][^'"]+['"]/, `from "/@src/${srcRel}"`));
|
|
19396
19300
|
writeFileSync8(join34(devIndexDir, `${name}.vue.js`), content);
|
|
19397
19301
|
}
|
|
@@ -19404,7 +19308,7 @@ var isDev, isBuildTraceEnabled = () => {
|
|
|
19404
19308
|
const last = allComments[allComments.length - 1];
|
|
19405
19309
|
if (!last?.[1])
|
|
19406
19310
|
return JSON.stringify(outputPath);
|
|
19407
|
-
const srcPath =
|
|
19311
|
+
const srcPath = resolve25(projectRoot, last[1].replace("/client/", "/").replace(/\.js$/, ".ts"));
|
|
19408
19312
|
return JSON.stringify(srcPath);
|
|
19409
19313
|
}, QUOTE_CHARS, OPEN_BRACES, CLOSE_BRACES, findFunctionExpressionEnd = (content, startPos) => {
|
|
19410
19314
|
let depth = 0;
|
|
@@ -19689,7 +19593,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
19689
19593
|
const sourceClientRoots = [
|
|
19690
19594
|
htmlDir,
|
|
19691
19595
|
htmxDir,
|
|
19692
|
-
islandBootstrapPath &&
|
|
19596
|
+
islandBootstrapPath && dirname17(islandBootstrapPath)
|
|
19693
19597
|
].filter((dir) => Boolean(dir));
|
|
19694
19598
|
const usesGenerated = Boolean(reactDir) || Boolean(svelteDir) || Boolean(vueDir) || Boolean(angularDir);
|
|
19695
19599
|
if (usesGenerated)
|
|
@@ -19730,13 +19634,13 @@ ${content.slice(firstUseIdx)}`;
|
|
|
19730
19634
|
const filterToIncrementalEntries = (entryPoints, mapToSource) => {
|
|
19731
19635
|
if (!isIncremental || !incrementalFiles)
|
|
19732
19636
|
return entryPoints;
|
|
19733
|
-
const normalizedIncremental = new Set(incrementalFiles.map((f2) =>
|
|
19637
|
+
const normalizedIncremental = new Set(incrementalFiles.map((f2) => resolve25(f2)));
|
|
19734
19638
|
const matchingEntries = [];
|
|
19735
19639
|
for (const entry of entryPoints) {
|
|
19736
19640
|
const sourceFile = mapToSource(entry);
|
|
19737
19641
|
if (!sourceFile)
|
|
19738
19642
|
continue;
|
|
19739
|
-
if (!normalizedIncremental.has(
|
|
19643
|
+
if (!normalizedIncremental.has(resolve25(sourceFile)))
|
|
19740
19644
|
continue;
|
|
19741
19645
|
matchingEntries.push(entry);
|
|
19742
19646
|
}
|
|
@@ -19901,7 +19805,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
19901
19805
|
}
|
|
19902
19806
|
const shouldIncludeHtmlAssets = !isIncremental || normalizedIncrementalFiles?.some((f2) => f2.includes("/html/") && (f2.endsWith(".html") || isStylePath(f2)));
|
|
19903
19807
|
const reactEntries = isIncremental && reactIndexesPath && reactPagesPath ? filterToIncrementalEntries(allReactEntries, (entry) => {
|
|
19904
|
-
if (entry.startsWith(
|
|
19808
|
+
if (entry.startsWith(resolve25(reactIndexesPath))) {
|
|
19905
19809
|
const pageName = basename10(entry, ".tsx");
|
|
19906
19810
|
return join34(reactPagesPath, `${pageName}.tsx`);
|
|
19907
19811
|
}
|
|
@@ -20051,7 +19955,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
20051
19955
|
const clientPath = islandSvelteClientPaths[idx];
|
|
20052
19956
|
if (!sourcePath || !clientPath)
|
|
20053
19957
|
continue;
|
|
20054
|
-
islandSvelteClientPathMap.set(
|
|
19958
|
+
islandSvelteClientPathMap.set(resolve25(sourcePath), clientPath);
|
|
20055
19959
|
}
|
|
20056
19960
|
const islandVueClientPathMap = new Map;
|
|
20057
19961
|
for (let idx = 0;idx < islandVueSources.length; idx++) {
|
|
@@ -20059,7 +19963,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
20059
19963
|
const clientPath = islandVueClientPaths[idx];
|
|
20060
19964
|
if (!sourcePath || !clientPath)
|
|
20061
19965
|
continue;
|
|
20062
|
-
islandVueClientPathMap.set(
|
|
19966
|
+
islandVueClientPathMap.set(resolve25(sourcePath), clientPath);
|
|
20063
19967
|
}
|
|
20064
19968
|
const islandAngularClientPathMap = new Map;
|
|
20065
19969
|
for (let idx = 0;idx < islandAngularSources.length; idx++) {
|
|
@@ -20067,7 +19971,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
20067
19971
|
const clientPath = islandAngularClientPaths[idx];
|
|
20068
19972
|
if (!sourcePath || !clientPath)
|
|
20069
19973
|
continue;
|
|
20070
|
-
islandAngularClientPathMap.set(
|
|
19974
|
+
islandAngularClientPathMap.set(resolve25(sourcePath), clientPath);
|
|
20071
19975
|
}
|
|
20072
19976
|
const reactConventionSources = collectConventionSourceFiles(conventionsMap.react);
|
|
20073
19977
|
const svelteConventionSources = collectConventionSourceFiles(conventionsMap.svelte);
|
|
@@ -20094,7 +19998,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
20094
19998
|
naming: `${idx}-[name].[ext]`,
|
|
20095
19999
|
outdir: destDir,
|
|
20096
20000
|
plugins: [stylePreprocessorPlugin2],
|
|
20097
|
-
root:
|
|
20001
|
+
root: dirname17(source),
|
|
20098
20002
|
target: "bun",
|
|
20099
20003
|
throw: false,
|
|
20100
20004
|
tsconfig: "./tsconfig.json"
|
|
@@ -20518,7 +20422,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
20518
20422
|
if (serverOutputs.length > 0 && angularServerVendorPaths2 && Object.keys(angularServerVendorPaths2).length > 0) {
|
|
20519
20423
|
const { rewriteBuildOutputsWith: rewriteBuildOutputsWith2 } = await Promise.resolve().then(() => (init_rewriteImportsPlugin(), exports_rewriteImportsPlugin));
|
|
20520
20424
|
await tracePhase("postprocess/server-angular-vendor-imports", () => rewriteBuildOutputsWith2(serverOutputs, (artifact) => {
|
|
20521
|
-
const fileDir =
|
|
20425
|
+
const fileDir = dirname17(artifact.path);
|
|
20522
20426
|
const relativePaths = {};
|
|
20523
20427
|
for (const [specifier, absolute] of Object.entries(angularServerVendorPaths2)) {
|
|
20524
20428
|
const rel = relative13(fileDir, absolute);
|
|
@@ -20992,7 +20896,7 @@ __export(exports_dependencyGraph, {
|
|
|
20992
20896
|
});
|
|
20993
20897
|
import { existsSync as existsSync28, readFileSync as readFileSync19 } from "fs";
|
|
20994
20898
|
var {Glob: Glob9 } = globalThis.Bun;
|
|
20995
|
-
import { resolve as
|
|
20899
|
+
import { resolve as resolve26 } from "path";
|
|
20996
20900
|
var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath) => {
|
|
20997
20901
|
const lower = filePath.toLowerCase();
|
|
20998
20902
|
if (lower.endsWith(".ts") || lower.endsWith(".tsx") || lower.endsWith(".jsx"))
|
|
@@ -21006,8 +20910,8 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
21006
20910
|
if (!importPath.startsWith(".") && !importPath.startsWith("/")) {
|
|
21007
20911
|
return null;
|
|
21008
20912
|
}
|
|
21009
|
-
const fromDir =
|
|
21010
|
-
const normalized =
|
|
20913
|
+
const fromDir = resolve26(fromFile, "..");
|
|
20914
|
+
const normalized = resolve26(fromDir, importPath);
|
|
21011
20915
|
const extensions = [
|
|
21012
20916
|
".ts",
|
|
21013
20917
|
".tsx",
|
|
@@ -21037,7 +20941,7 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
21037
20941
|
dependents.delete(normalizedPath);
|
|
21038
20942
|
}
|
|
21039
20943
|
}, addFileToGraph = (graph, filePath) => {
|
|
21040
|
-
const normalizedPath =
|
|
20944
|
+
const normalizedPath = resolve26(filePath);
|
|
21041
20945
|
if (!existsSync28(normalizedPath))
|
|
21042
20946
|
return;
|
|
21043
20947
|
const dependencies = extractDependencies(normalizedPath);
|
|
@@ -21064,10 +20968,10 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
21064
20968
|
}, IGNORED_SEGMENTS, buildInitialDependencyGraph = (graph, directories) => {
|
|
21065
20969
|
const processedFiles = new Set;
|
|
21066
20970
|
const glob = new Glob9("**/*.{ts,tsx,js,jsx,vue,svelte,html,htm}");
|
|
21067
|
-
const resolvedDirs = directories.map((dir) =>
|
|
20971
|
+
const resolvedDirs = directories.map((dir) => resolve26(dir)).filter((dir) => existsSync28(dir));
|
|
21068
20972
|
const allFiles = resolvedDirs.flatMap((dir) => Array.from(glob.scanSync({ absolute: true, cwd: dir })));
|
|
21069
20973
|
for (const file4 of allFiles) {
|
|
21070
|
-
const fullPath =
|
|
20974
|
+
const fullPath = resolve26(file4);
|
|
21071
20975
|
if (IGNORED_SEGMENTS.some((seg) => fullPath.includes(seg)))
|
|
21072
20976
|
continue;
|
|
21073
20977
|
if (processedFiles.has(fullPath))
|
|
@@ -21180,7 +21084,7 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
21180
21084
|
return [];
|
|
21181
21085
|
}
|
|
21182
21086
|
}, getAffectedFiles = (graph, changedFile) => {
|
|
21183
|
-
const normalizedPath =
|
|
21087
|
+
const normalizedPath = resolve26(changedFile);
|
|
21184
21088
|
const affected = new Set;
|
|
21185
21089
|
const toProcess = [normalizedPath];
|
|
21186
21090
|
const processNode = (current) => {
|
|
@@ -21211,7 +21115,7 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
21211
21115
|
}, removeDependentsForFile = (graph, normalizedPath) => {
|
|
21212
21116
|
graph.dependents.delete(normalizedPath);
|
|
21213
21117
|
}, removeFileFromGraph = (graph, filePath) => {
|
|
21214
|
-
const normalizedPath =
|
|
21118
|
+
const normalizedPath = resolve26(filePath);
|
|
21215
21119
|
removeDepsForFile(graph, normalizedPath);
|
|
21216
21120
|
removeDependentsForFile(graph, normalizedPath);
|
|
21217
21121
|
};
|
|
@@ -21254,12 +21158,12 @@ var globalVersionCounter = 0, createModuleVersionTracker = () => new Map, getNex
|
|
|
21254
21158
|
};
|
|
21255
21159
|
|
|
21256
21160
|
// src/dev/configResolver.ts
|
|
21257
|
-
import { resolve as
|
|
21161
|
+
import { resolve as resolve27 } from "path";
|
|
21258
21162
|
var resolveBuildPaths = (config) => {
|
|
21259
21163
|
const cwd2 = process.cwd();
|
|
21260
21164
|
const normalize = (path) => path.replace(/\\/g, "/");
|
|
21261
|
-
const withDefault = (value, fallback) => normalize(
|
|
21262
|
-
const optional = (value) => value ? normalize(
|
|
21165
|
+
const withDefault = (value, fallback) => normalize(resolve27(cwd2, value ?? fallback));
|
|
21166
|
+
const optional = (value) => value ? normalize(resolve27(cwd2, value)) : undefined;
|
|
21263
21167
|
return {
|
|
21264
21168
|
angularDir: optional(config.angularDirectory),
|
|
21265
21169
|
assetsDir: optional(config.assetsDirectory),
|
|
@@ -21313,7 +21217,7 @@ var init_clientManager = __esm(() => {
|
|
|
21313
21217
|
|
|
21314
21218
|
// src/dev/pathUtils.ts
|
|
21315
21219
|
import { existsSync as existsSync29, readdirSync as readdirSync4, readFileSync as readFileSync20 } from "fs";
|
|
21316
|
-
import { dirname as
|
|
21220
|
+
import { dirname as dirname18, resolve as resolve28 } from "path";
|
|
21317
21221
|
var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
21318
21222
|
if (shouldIgnorePath(filePath, resolved)) {
|
|
21319
21223
|
return "ignored";
|
|
@@ -21389,7 +21293,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
21389
21293
|
return "unknown";
|
|
21390
21294
|
}, collectAngularResourceDirs = (angularDir) => {
|
|
21391
21295
|
const out = new Set;
|
|
21392
|
-
const angularRoot =
|
|
21296
|
+
const angularRoot = resolve28(angularDir);
|
|
21393
21297
|
const angularRootNormalized = normalizePath(angularRoot);
|
|
21394
21298
|
const walk = (dir) => {
|
|
21395
21299
|
let entries;
|
|
@@ -21402,7 +21306,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
21402
21306
|
if (entry.name.startsWith(".") || entry.name === "node_modules") {
|
|
21403
21307
|
continue;
|
|
21404
21308
|
}
|
|
21405
|
-
const full =
|
|
21309
|
+
const full = resolve28(dir, entry.name);
|
|
21406
21310
|
if (entry.isDirectory()) {
|
|
21407
21311
|
walk(full);
|
|
21408
21312
|
continue;
|
|
@@ -21441,10 +21345,10 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
21441
21345
|
refs.push(strMatch[1]);
|
|
21442
21346
|
}
|
|
21443
21347
|
}
|
|
21444
|
-
const componentDir =
|
|
21348
|
+
const componentDir = dirname18(full);
|
|
21445
21349
|
for (const ref of refs) {
|
|
21446
|
-
const refAbs = normalizePath(
|
|
21447
|
-
const refDir = normalizePath(
|
|
21350
|
+
const refAbs = normalizePath(resolve28(componentDir, ref));
|
|
21351
|
+
const refDir = normalizePath(dirname18(refAbs));
|
|
21448
21352
|
if (refDir === angularRootNormalized || refDir.startsWith(angularRootNormalized + "/")) {
|
|
21449
21353
|
continue;
|
|
21450
21354
|
}
|
|
@@ -21460,7 +21364,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
21460
21364
|
const push = (path) => {
|
|
21461
21365
|
if (!path)
|
|
21462
21366
|
return;
|
|
21463
|
-
const abs = normalizePath(
|
|
21367
|
+
const abs = normalizePath(resolve28(cwd2, path));
|
|
21464
21368
|
if (!roots.includes(abs))
|
|
21465
21369
|
roots.push(abs);
|
|
21466
21370
|
};
|
|
@@ -21485,7 +21389,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
21485
21389
|
push(cfg.assetsDir);
|
|
21486
21390
|
push(cfg.stylesDir);
|
|
21487
21391
|
for (const candidate of ["src", "db", "assets", "styles"]) {
|
|
21488
|
-
const abs = normalizePath(
|
|
21392
|
+
const abs = normalizePath(resolve28(cwd2, candidate));
|
|
21489
21393
|
if (existsSync29(abs) && !roots.includes(abs))
|
|
21490
21394
|
roots.push(abs);
|
|
21491
21395
|
}
|
|
@@ -21497,7 +21401,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
21497
21401
|
continue;
|
|
21498
21402
|
if (entry.name.startsWith("."))
|
|
21499
21403
|
continue;
|
|
21500
|
-
const abs = normalizePath(
|
|
21404
|
+
const abs = normalizePath(resolve28(cwd2, entry.name));
|
|
21501
21405
|
if (roots.includes(abs))
|
|
21502
21406
|
continue;
|
|
21503
21407
|
if (shouldIgnorePath(abs, resolved))
|
|
@@ -21572,7 +21476,7 @@ var init_pathUtils = __esm(() => {
|
|
|
21572
21476
|
// src/dev/fileWatcher.ts
|
|
21573
21477
|
import { watch } from "fs";
|
|
21574
21478
|
import { existsSync as existsSync30, readdirSync as readdirSync5, statSync as statSync4 } from "fs";
|
|
21575
|
-
import { dirname as
|
|
21479
|
+
import { dirname as dirname19, join as join36, resolve as resolve29 } from "path";
|
|
21576
21480
|
var safeRemoveFromGraph = (graph, fullPath) => {
|
|
21577
21481
|
try {
|
|
21578
21482
|
removeFileFromGraph(graph, fullPath);
|
|
@@ -21630,7 +21534,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
21630
21534
|
return;
|
|
21631
21535
|
if (shouldSkipFilename(filename, isStylesDir)) {
|
|
21632
21536
|
if (event === "rename") {
|
|
21633
|
-
const eventDir =
|
|
21537
|
+
const eventDir = dirname19(join36(absolutePath, filename)).replace(/\\/g, "/");
|
|
21634
21538
|
atomicRecoveryScan(eventDir);
|
|
21635
21539
|
}
|
|
21636
21540
|
return;
|
|
@@ -21653,7 +21557,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
21653
21557
|
}, addFileWatchers = (state, paths, onFileChange) => {
|
|
21654
21558
|
const stylesDir = state.resolvedPaths?.stylesDir;
|
|
21655
21559
|
paths.forEach((path) => {
|
|
21656
|
-
const absolutePath =
|
|
21560
|
+
const absolutePath = resolve29(path).replace(/\\/g, "/");
|
|
21657
21561
|
if (!existsSync30(absolutePath)) {
|
|
21658
21562
|
return;
|
|
21659
21563
|
}
|
|
@@ -21664,7 +21568,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
21664
21568
|
const watchPaths = getWatchPaths(config, state.resolvedPaths);
|
|
21665
21569
|
const stylesDir = state.resolvedPaths?.stylesDir;
|
|
21666
21570
|
watchPaths.forEach((path) => {
|
|
21667
|
-
const absolutePath =
|
|
21571
|
+
const absolutePath = resolve29(path).replace(/\\/g, "/");
|
|
21668
21572
|
if (!existsSync30(absolutePath)) {
|
|
21669
21573
|
return;
|
|
21670
21574
|
}
|
|
@@ -21683,13 +21587,13 @@ var init_fileWatcher = __esm(() => {
|
|
|
21683
21587
|
});
|
|
21684
21588
|
|
|
21685
21589
|
// src/dev/assetStore.ts
|
|
21686
|
-
import { resolve as
|
|
21590
|
+
import { resolve as resolve30 } from "path";
|
|
21687
21591
|
import { readdir as readdir4, unlink } from "fs/promises";
|
|
21688
21592
|
var mimeTypes, getMimeType = (filePath) => {
|
|
21689
21593
|
const ext = filePath.slice(filePath.lastIndexOf("."));
|
|
21690
21594
|
return mimeTypes[ext] ?? "application/octet-stream";
|
|
21691
21595
|
}, HASHED_FILE_RE, stripHash = (webPath) => webPath.replace(/\.[a-z0-9]{8}(\.(js|css|mjs))$/, "$1"), processWalkEntry = (entry, dir, liveByIdentity, walkAndClean) => {
|
|
21692
|
-
const fullPath =
|
|
21596
|
+
const fullPath = resolve30(dir, entry.name);
|
|
21693
21597
|
if (entry.isDirectory()) {
|
|
21694
21598
|
return walkAndClean(fullPath);
|
|
21695
21599
|
}
|
|
@@ -21705,10 +21609,10 @@ var mimeTypes, getMimeType = (filePath) => {
|
|
|
21705
21609
|
}, cleanStaleAssets = async (store, manifest, buildDir) => {
|
|
21706
21610
|
const liveByIdentity = new Map;
|
|
21707
21611
|
for (const webPath of store.keys()) {
|
|
21708
|
-
const diskPath =
|
|
21612
|
+
const diskPath = resolve30(buildDir, webPath.slice(1));
|
|
21709
21613
|
liveByIdentity.set(stripHash(diskPath), diskPath);
|
|
21710
21614
|
}
|
|
21711
|
-
const absBuildDir =
|
|
21615
|
+
const absBuildDir = resolve30(buildDir);
|
|
21712
21616
|
Object.values(manifest).forEach((val) => {
|
|
21713
21617
|
if (!HASHED_FILE_RE.test(val))
|
|
21714
21618
|
return;
|
|
@@ -21726,7 +21630,7 @@ var mimeTypes, getMimeType = (filePath) => {
|
|
|
21726
21630
|
} catch {}
|
|
21727
21631
|
}, lookupAsset = (store, path) => store.get(path), processScanEntry = (entry, dir, prefix, store, scanDir) => {
|
|
21728
21632
|
if (entry.isDirectory()) {
|
|
21729
|
-
return scanDir(
|
|
21633
|
+
return scanDir(resolve30(dir, entry.name), `${prefix}${entry.name}/`);
|
|
21730
21634
|
}
|
|
21731
21635
|
if (!entry.name.startsWith("chunk-")) {
|
|
21732
21636
|
return null;
|
|
@@ -21735,7 +21639,7 @@ var mimeTypes, getMimeType = (filePath) => {
|
|
|
21735
21639
|
if (store.has(webPath)) {
|
|
21736
21640
|
return null;
|
|
21737
21641
|
}
|
|
21738
|
-
return Bun.file(
|
|
21642
|
+
return Bun.file(resolve30(dir, entry.name)).bytes().then((bytes) => {
|
|
21739
21643
|
store.set(webPath, bytes);
|
|
21740
21644
|
return;
|
|
21741
21645
|
}).catch(() => {});
|
|
@@ -21757,7 +21661,7 @@ var mimeTypes, getMimeType = (filePath) => {
|
|
|
21757
21661
|
for (const webPath of newIdentities.values()) {
|
|
21758
21662
|
if (store.has(webPath))
|
|
21759
21663
|
continue;
|
|
21760
|
-
loadPromises.push(Bun.file(
|
|
21664
|
+
loadPromises.push(Bun.file(resolve30(buildDir, webPath.slice(1))).bytes().then((bytes) => {
|
|
21761
21665
|
store.set(webPath, bytes);
|
|
21762
21666
|
return;
|
|
21763
21667
|
}).catch(() => {}));
|
|
@@ -21788,7 +21692,7 @@ var init_assetStore = __esm(() => {
|
|
|
21788
21692
|
|
|
21789
21693
|
// src/islands/pageMetadata.ts
|
|
21790
21694
|
import { readFileSync as readFileSync21 } from "fs";
|
|
21791
|
-
import { dirname as
|
|
21695
|
+
import { dirname as dirname20, resolve as resolve31 } from "path";
|
|
21792
21696
|
var pagePatterns, getPageDirs = (config) => [
|
|
21793
21697
|
{ dir: config.angularDirectory, framework: "angular" },
|
|
21794
21698
|
{ dir: config.emberDirectory, framework: "ember" },
|
|
@@ -21808,15 +21712,15 @@ var pagePatterns, getPageDirs = (config) => [
|
|
|
21808
21712
|
const source = definition.buildReference?.source;
|
|
21809
21713
|
if (!source)
|
|
21810
21714
|
continue;
|
|
21811
|
-
const resolvedSource = source.startsWith("file://") ? new URL(source).pathname :
|
|
21812
|
-
lookup.set(`${definition.framework}:${definition.component}`,
|
|
21715
|
+
const resolvedSource = source.startsWith("file://") ? new URL(source).pathname : resolve31(dirname20(buildInfo.resolvedRegistryPath), source);
|
|
21716
|
+
lookup.set(`${definition.framework}:${definition.component}`, resolve31(resolvedSource));
|
|
21813
21717
|
}
|
|
21814
21718
|
return lookup;
|
|
21815
21719
|
}, getCurrentPageIslandMetadata = () => globalThis.__absolutePageIslandMetadata ?? new Map, metadataUsesSource = (metadata, target) => metadata.islands.some((usage) => {
|
|
21816
21720
|
const candidate = usage.source;
|
|
21817
|
-
return candidate ?
|
|
21721
|
+
return candidate ? resolve31(candidate) === target : false;
|
|
21818
21722
|
}), getPagesUsingIslandSource = (sourcePath) => {
|
|
21819
|
-
const target =
|
|
21723
|
+
const target = resolve31(sourcePath);
|
|
21820
21724
|
return [...getCurrentPageIslandMetadata().values()].filter((metadata) => metadataUsesSource(metadata, target)).map((metadata) => metadata.pagePath);
|
|
21821
21725
|
}, resolveIslandUsages = (islands, islandSourceLookup) => islands.map((usage) => {
|
|
21822
21726
|
const sourcePath = islandSourceLookup.get(`${usage.framework}:${usage.component}`);
|
|
@@ -21828,13 +21732,13 @@ var pagePatterns, getPageDirs = (config) => [
|
|
|
21828
21732
|
const pattern = pagePatterns[entry.framework];
|
|
21829
21733
|
if (!pattern)
|
|
21830
21734
|
return;
|
|
21831
|
-
const files = await scanEntryPoints(
|
|
21735
|
+
const files = await scanEntryPoints(resolve31(entry.dir), pattern);
|
|
21832
21736
|
for (const filePath of files) {
|
|
21833
21737
|
const source = readFileSync21(filePath, "utf-8");
|
|
21834
21738
|
const islands = extractIslandUsagesFromSource(source);
|
|
21835
|
-
pageMetadata.set(
|
|
21739
|
+
pageMetadata.set(resolve31(filePath), {
|
|
21836
21740
|
islands: resolveIslandUsages(islands, islandSourceLookup),
|
|
21837
|
-
pagePath:
|
|
21741
|
+
pagePath: resolve31(filePath)
|
|
21838
21742
|
});
|
|
21839
21743
|
}
|
|
21840
21744
|
}, loadPageIslandMetadata = async (config) => {
|
|
@@ -21957,9 +21861,9 @@ var init_transformCache = __esm(() => {
|
|
|
21957
21861
|
});
|
|
21958
21862
|
|
|
21959
21863
|
// src/dev/reactComponentClassifier.ts
|
|
21960
|
-
import { resolve as
|
|
21864
|
+
import { resolve as resolve32 } from "path";
|
|
21961
21865
|
var classifyComponent = (filePath) => {
|
|
21962
|
-
const normalizedPath =
|
|
21866
|
+
const normalizedPath = resolve32(filePath);
|
|
21963
21867
|
if (normalizedPath.includes("/react/pages/")) {
|
|
21964
21868
|
return "server";
|
|
21965
21869
|
}
|
|
@@ -21971,7 +21875,7 @@ var classifyComponent = (filePath) => {
|
|
|
21971
21875
|
var init_reactComponentClassifier = () => {};
|
|
21972
21876
|
|
|
21973
21877
|
// src/dev/moduleMapper.ts
|
|
21974
|
-
import { basename as basename11, resolve as
|
|
21878
|
+
import { basename as basename11, resolve as resolve33 } from "path";
|
|
21975
21879
|
var buildModulePaths = (moduleKeys, manifest) => {
|
|
21976
21880
|
const modulePaths = {};
|
|
21977
21881
|
moduleKeys.forEach((key) => {
|
|
@@ -21981,7 +21885,7 @@ var buildModulePaths = (moduleKeys, manifest) => {
|
|
|
21981
21885
|
});
|
|
21982
21886
|
return modulePaths;
|
|
21983
21887
|
}, processChangedFile = (sourceFile, framework, manifest, resolvedPaths, processedFiles) => {
|
|
21984
|
-
const normalizedFile =
|
|
21888
|
+
const normalizedFile = resolve33(sourceFile);
|
|
21985
21889
|
const normalizedPath = normalizedFile.replace(/\\/g, "/");
|
|
21986
21890
|
if (processedFiles.has(normalizedFile)) {
|
|
21987
21891
|
return null;
|
|
@@ -22017,7 +21921,7 @@ var buildModulePaths = (moduleKeys, manifest) => {
|
|
|
22017
21921
|
});
|
|
22018
21922
|
return grouped;
|
|
22019
21923
|
}, mapSourceFileToManifestKeys = (sourceFile, framework, resolvedPaths) => {
|
|
22020
|
-
const normalizedFile =
|
|
21924
|
+
const normalizedFile = resolve33(sourceFile);
|
|
22021
21925
|
const fileName = basename11(normalizedFile);
|
|
22022
21926
|
const baseName = fileName.replace(/\.(tsx?|jsx?|vue|svelte|css|html)$/, "");
|
|
22023
21927
|
const pascalName = toPascal(baseName);
|
|
@@ -22079,7 +21983,7 @@ __export(exports_resolveOwningComponents, {
|
|
|
22079
21983
|
invalidateResourceIndex: () => invalidateResourceIndex
|
|
22080
21984
|
});
|
|
22081
21985
|
import { readdirSync as readdirSync6, readFileSync as readFileSync23, statSync as statSync5 } from "fs";
|
|
22082
|
-
import { dirname as
|
|
21986
|
+
import { dirname as dirname21, extname as extname9, join as join37, resolve as resolve34 } from "path";
|
|
22083
21987
|
import ts14 from "typescript";
|
|
22084
21988
|
var ENTITY_DECORATORS, isAngularSourceFile = (file4) => file4.endsWith(".ts") || file4.endsWith(".tsx"), walkAngularSourceFiles = (root) => {
|
|
22085
21989
|
const out = [];
|
|
@@ -22192,7 +22096,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file4) => file4.endsWith(".ts") ||
|
|
|
22192
22096
|
};
|
|
22193
22097
|
visit(sourceFile);
|
|
22194
22098
|
return out;
|
|
22195
|
-
}, safeNormalize = (path) =>
|
|
22099
|
+
}, safeNormalize = (path) => resolve34(path).replace(/\\/g, "/"), resolveOwningComponents = (params) => {
|
|
22196
22100
|
const { changedFilePath, userAngularRoot } = params;
|
|
22197
22101
|
const changedAbs = safeNormalize(changedFilePath);
|
|
22198
22102
|
const out = [];
|
|
@@ -22233,7 +22137,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file4) => file4.endsWith(".ts") ||
|
|
|
22233
22137
|
return null;
|
|
22234
22138
|
}
|
|
22235
22139
|
const sf = ts14.createSourceFile(childFilePath, source, ts14.ScriptTarget.ES2022, true, ts14.ScriptKind.TS);
|
|
22236
|
-
const childDir =
|
|
22140
|
+
const childDir = dirname21(childFilePath);
|
|
22237
22141
|
for (const stmt of sf.statements) {
|
|
22238
22142
|
if (!ts14.isImportDeclaration(stmt))
|
|
22239
22143
|
continue;
|
|
@@ -22261,7 +22165,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file4) => file4.endsWith(".ts") ||
|
|
|
22261
22165
|
if (!spec.startsWith(".") && !spec.startsWith("/")) {
|
|
22262
22166
|
return null;
|
|
22263
22167
|
}
|
|
22264
|
-
const base =
|
|
22168
|
+
const base = resolve34(childDir, spec);
|
|
22265
22169
|
const candidates = [
|
|
22266
22170
|
`${base}.ts`,
|
|
22267
22171
|
`${base}.tsx`,
|
|
@@ -22290,7 +22194,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file4) => file4.endsWith(".ts") ||
|
|
|
22290
22194
|
const parentFile = new Map;
|
|
22291
22195
|
for (const tsPath of walkAngularSourceFiles(userAngularRoot)) {
|
|
22292
22196
|
const classes = parseDecoratedClasses(tsPath);
|
|
22293
|
-
const componentDir =
|
|
22197
|
+
const componentDir = dirname21(tsPath);
|
|
22294
22198
|
for (const cls of classes) {
|
|
22295
22199
|
const entity = {
|
|
22296
22200
|
className: cls.className,
|
|
@@ -22299,7 +22203,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file4) => file4.endsWith(".ts") ||
|
|
|
22299
22203
|
};
|
|
22300
22204
|
if (cls.kind === "component") {
|
|
22301
22205
|
for (const url of [...cls.templateUrls, ...cls.styleUrls]) {
|
|
22302
|
-
const abs = safeNormalize(
|
|
22206
|
+
const abs = safeNormalize(resolve34(componentDir, url));
|
|
22303
22207
|
const existing = resource.get(abs);
|
|
22304
22208
|
if (existing)
|
|
22305
22209
|
existing.push(entity);
|
|
@@ -22484,7 +22388,7 @@ __export(exports_loadConfig, {
|
|
|
22484
22388
|
isWorkspaceConfig: () => isWorkspaceConfig,
|
|
22485
22389
|
getWorkspaceServices: () => getWorkspaceServices
|
|
22486
22390
|
});
|
|
22487
|
-
import { resolve as
|
|
22391
|
+
import { resolve as resolve35 } from "path";
|
|
22488
22392
|
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
22393
|
if (!isObject2(config)) {
|
|
22490
22394
|
return false;
|
|
@@ -22535,7 +22439,7 @@ var RESERVED_TOP_LEVEL_KEYS, isObject2 = (value) => typeof value === "object" &&
|
|
|
22535
22439
|
}
|
|
22536
22440
|
return config;
|
|
22537
22441
|
}, loadRawConfig = async (configPath2) => {
|
|
22538
|
-
const resolved =
|
|
22442
|
+
const resolved = resolve35(configPath2 ?? process.env.ABSOLUTE_CONFIG ?? "absolute.config.ts");
|
|
22539
22443
|
const mod = await import(resolved);
|
|
22540
22444
|
const config = mod.default ?? mod.config;
|
|
22541
22445
|
if (!config) {
|
|
@@ -22596,7 +22500,7 @@ __export(exports_moduleServer, {
|
|
|
22596
22500
|
SRC_URL_PREFIX: () => SRC_URL_PREFIX
|
|
22597
22501
|
});
|
|
22598
22502
|
import { existsSync as existsSync31, readFileSync as readFileSync24, statSync as statSync6 } from "fs";
|
|
22599
|
-
import { basename as basename12, dirname as
|
|
22503
|
+
import { basename as basename12, dirname as dirname22, extname as extname10, join as join38, resolve as resolve36, relative as relative14 } from "path";
|
|
22600
22504
|
var SRC_PREFIX = "/@src/", jsTranspiler2, tsTranspiler2, tsxTranspiler, TRANSPILABLE, ALL_EXPORTS_RE, STRING_CONTENTS_RE, preserveTypeExports = (originalSource, transpiled, valueExports) => {
|
|
22601
22505
|
const codeOnly = originalSource.replace(STRING_CONTENTS_RE, '""');
|
|
22602
22506
|
const allExports = [];
|
|
@@ -22616,7 +22520,7 @@ var SRC_PREFIX = "/@src/", jsTranspiler2, tsTranspiler2, tsxTranspiler, TRANSPIL
|
|
|
22616
22520
|
${stubs}
|
|
22617
22521
|
`;
|
|
22618
22522
|
}, resolveRelativeExtension = (srcPath, projectRoot, extensions) => {
|
|
22619
|
-
const found = extensions.find((ext) => existsSync31(
|
|
22523
|
+
const found = extensions.find((ext) => existsSync31(resolve36(projectRoot, srcPath + ext)));
|
|
22620
22524
|
return found ? srcPath + found : srcPath;
|
|
22621
22525
|
}, IMPORT_EXTENSIONS, SIDE_EFFECT_EXTENSIONS, MODULE_EXTENSIONS, RESOLVED_MODULE_EXTENSIONS, REACT_EXTENSIONS, escapeRegex3 = (str) => str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), buildImportRewriter = (vendorPaths) => {
|
|
22622
22526
|
const entries = Object.entries(vendorPaths).sort(([a], [b2]) => b2.length - a.length);
|
|
@@ -22631,7 +22535,7 @@ ${stubs}
|
|
|
22631
22535
|
return invalidationVersion > 0 ? `${mtime}.${invalidationVersion}` : `${mtime}`;
|
|
22632
22536
|
}, srcUrl = (relPath, projectRoot) => {
|
|
22633
22537
|
const base = `${SRC_PREFIX}${relPath.replace(/\\/g, "/")}`;
|
|
22634
|
-
const absPath =
|
|
22538
|
+
const absPath = resolve36(projectRoot, relPath);
|
|
22635
22539
|
const cached = mtimeCache.get(absPath);
|
|
22636
22540
|
if (cached !== undefined)
|
|
22637
22541
|
return `${base}?v=${buildVersion(cached, absPath)}`;
|
|
@@ -22643,12 +22547,12 @@ ${stubs}
|
|
|
22643
22547
|
return base;
|
|
22644
22548
|
}
|
|
22645
22549
|
}, resolveRelativeImport = (relPath, fileDir, projectRoot, extensions) => {
|
|
22646
|
-
const absPath =
|
|
22550
|
+
const absPath = resolve36(fileDir, relPath);
|
|
22647
22551
|
const rel = relative14(projectRoot, absPath);
|
|
22648
22552
|
const extension = extname10(rel);
|
|
22649
22553
|
let srcPath = RESOLVED_MODULE_EXTENSIONS.has(extension) ? rel : resolveRelativeExtension(rel, projectRoot, extensions);
|
|
22650
22554
|
if (extname10(srcPath) === ".svelte") {
|
|
22651
|
-
srcPath = relative14(projectRoot, resolveSvelteModulePath(
|
|
22555
|
+
srcPath = relative14(projectRoot, resolveSvelteModulePath(resolve36(projectRoot, srcPath)));
|
|
22652
22556
|
}
|
|
22653
22557
|
return srcUrl(srcPath, projectRoot);
|
|
22654
22558
|
}, NODE_BUILTIN_RE, resolveAbsoluteSpecifier = (specifier, projectRoot) => {
|
|
@@ -22667,13 +22571,13 @@ ${stubs}
|
|
|
22667
22571
|
const packageName = isScoped ? `${parts[0]}/${parts[1]}` : parts[0];
|
|
22668
22572
|
const subpath = isScoped ? parts.slice(2).join("/") : parts.slice(1).join("/");
|
|
22669
22573
|
if (!subpath) {
|
|
22670
|
-
const pkgDir =
|
|
22574
|
+
const pkgDir = resolve36(projectRoot, "node_modules", packageName ?? "");
|
|
22671
22575
|
const pkgJsonPath = join38(pkgDir, "package.json");
|
|
22672
22576
|
if (existsSync31(pkgJsonPath)) {
|
|
22673
22577
|
const pkg = JSON.parse(readFileSync24(pkgJsonPath, "utf-8"));
|
|
22674
22578
|
const esmEntry = typeof pkg.module === "string" && pkg.module || typeof pkg.browser === "string" && pkg.browser;
|
|
22675
22579
|
if (esmEntry) {
|
|
22676
|
-
const resolved =
|
|
22580
|
+
const resolved = resolve36(pkgDir, esmEntry);
|
|
22677
22581
|
if (existsSync31(resolved))
|
|
22678
22582
|
return relative14(projectRoot, resolved);
|
|
22679
22583
|
}
|
|
@@ -22705,7 +22609,7 @@ ${stubs}
|
|
|
22705
22609
|
};
|
|
22706
22610
|
result = result.replace(/^((?:import\s+[\s\S]+?\s+from|export\s+[\s\S]+?\s+from|import)\s*["'])([^"'./][^"']*)(["'])/gm, stubReplace);
|
|
22707
22611
|
result = result.replace(/(import\s*\(\s*["'])([^"'./][^"']*)(["']\s*\))/g, stubReplace);
|
|
22708
|
-
const fileDir =
|
|
22612
|
+
const fileDir = dirname22(filePath);
|
|
22709
22613
|
result = result.replace(/(from\s*["'])(\.\.?\/[^"']+)(["'])/g, (_match, prefix, relPath, suffix) => `${prefix}${resolveRelativeImport(relPath, fileDir, projectRoot, IMPORT_EXTENSIONS)}${suffix}`);
|
|
22710
22614
|
result = result.replace(/(import\s*\(\s*["'])(\.\.?\/[^"']+)(["']\s*\))/g, (_match, prefix, relPath, suffix) => `${prefix}${resolveRelativeImport(relPath, fileDir, projectRoot, IMPORT_EXTENSIONS)}${suffix}`);
|
|
22711
22615
|
result = result.replace(/(import\s*["'])(\.\.?\/[^"']+)(["']\s*;?)/g, (_match, prefix, relPath, suffix) => `${prefix}${resolveRelativeImport(relPath, fileDir, projectRoot, SIDE_EFFECT_EXTENSIONS)}${suffix}`);
|
|
@@ -22720,12 +22624,12 @@ ${stubs}
|
|
|
22720
22624
|
result = result.replace(/((?:from|import)\s*["'])(\/[^"']+\.(tsx?|jsx?|ts))(["'])/g, rewriteAbsoluteToSrc);
|
|
22721
22625
|
result = result.replace(/(import\s*\(\s*["'])(\/[^"']+\.(tsx?|jsx?|ts))(["']\s*\))/g, rewriteAbsoluteToSrc);
|
|
22722
22626
|
result = result.replace(/new\s+URL\(\s*["'](\.\.?\/[^"']+)["']\s*,\s*import\.meta\.url\s*\)/g, (_match, relPath) => {
|
|
22723
|
-
const absPath =
|
|
22627
|
+
const absPath = resolve36(fileDir, relPath);
|
|
22724
22628
|
const rel = relative14(projectRoot, absPath);
|
|
22725
22629
|
return `new URL('${srcUrl(rel, projectRoot)}', import.meta.url)`;
|
|
22726
22630
|
});
|
|
22727
22631
|
result = result.replace(/import\.meta\.resolve\(\s*["'](\.\.?\/[^"']+)["']\s*\)/g, (_match, relPath) => {
|
|
22728
|
-
const absPath =
|
|
22632
|
+
const absPath = resolve36(fileDir, relPath);
|
|
22729
22633
|
const rel = relative14(projectRoot, absPath);
|
|
22730
22634
|
return `'${srcUrl(rel, projectRoot)}'`;
|
|
22731
22635
|
});
|
|
@@ -23038,7 +22942,7 @@ ${code}`;
|
|
|
23038
22942
|
code = injectVueHmr(code, filePath, projectRoot, vueDir);
|
|
23039
22943
|
return rewriteImports(code, filePath, projectRoot, rewriter);
|
|
23040
22944
|
}, injectVueHmr = (code, filePath, projectRoot, vueDir) => {
|
|
23041
|
-
const hmrBase = vueDir ?
|
|
22945
|
+
const hmrBase = vueDir ? resolve36(vueDir) : projectRoot;
|
|
23042
22946
|
const hmrId = relative14(hmrBase, filePath).replace(/\\/g, "/").replace(/\.vue$/, "");
|
|
23043
22947
|
let result = code.replace(/export\s+default\s+/, "var __hmr_comp__ = ");
|
|
23044
22948
|
result += [
|
|
@@ -23202,7 +23106,7 @@ export default {};
|
|
|
23202
23106
|
const escaped = virtualCss.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$/g, "\\$");
|
|
23203
23107
|
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
23108
|
}, resolveSourcePath = (relPath, projectRoot) => {
|
|
23205
|
-
const filePath =
|
|
23109
|
+
const filePath = resolve36(projectRoot, relPath);
|
|
23206
23110
|
const ext = extname10(filePath);
|
|
23207
23111
|
if (ext === ".svelte")
|
|
23208
23112
|
return { ext, filePath: resolveSvelteModulePath(filePath) };
|
|
@@ -23239,14 +23143,14 @@ export default {};
|
|
|
23239
23143
|
const absoluteCandidate = "/" + tail.replace(/^\/+/, "");
|
|
23240
23144
|
const candidates = [
|
|
23241
23145
|
absoluteCandidate,
|
|
23242
|
-
|
|
23146
|
+
resolve36(projectRoot, tail)
|
|
23243
23147
|
];
|
|
23244
23148
|
try {
|
|
23245
23149
|
const { loadConfig: loadConfig2 } = await Promise.resolve().then(() => (init_loadConfig(), exports_loadConfig));
|
|
23246
23150
|
const cfg = await loadConfig2();
|
|
23247
|
-
const angularDir = cfg.angularDirectory &&
|
|
23151
|
+
const angularDir = cfg.angularDirectory && resolve36(projectRoot, cfg.angularDirectory);
|
|
23248
23152
|
if (angularDir)
|
|
23249
|
-
candidates.push(
|
|
23153
|
+
candidates.push(resolve36(angularDir, tail));
|
|
23250
23154
|
} catch {}
|
|
23251
23155
|
for (const candidate of candidates) {
|
|
23252
23156
|
if (await fileExists(candidate)) {
|
|
@@ -23277,7 +23181,7 @@ export default {};
|
|
|
23277
23181
|
if (!TRANSPILABLE.has(ext))
|
|
23278
23182
|
return;
|
|
23279
23183
|
const stat3 = statSync6(filePath);
|
|
23280
|
-
const resolvedVueDir = vueDir ?
|
|
23184
|
+
const resolvedVueDir = vueDir ? resolve36(vueDir) : undefined;
|
|
23281
23185
|
let content = REACT_EXTENSIONS.has(ext) ? transformReactFile(filePath, projectRoot, rewriter) : transformPlainFile(filePath, projectRoot, rewriter, resolvedVueDir);
|
|
23282
23186
|
const isAngularGeneratedJs = ext === ".js" && filePath.replace(/\\/g, "/").includes("/.absolutejs/generated/angular/");
|
|
23283
23187
|
if (isAngularGeneratedJs) {
|
|
@@ -23336,7 +23240,7 @@ export default {};
|
|
|
23336
23240
|
const relPath = pathname.slice(SRC_PREFIX.length);
|
|
23337
23241
|
if (relPath === "bun:wrap" || relPath.startsWith("bun:wrap?"))
|
|
23338
23242
|
return handleBunWrapRequest();
|
|
23339
|
-
const virtualCssResponse = handleVirtualSvelteCss(
|
|
23243
|
+
const virtualCssResponse = handleVirtualSvelteCss(resolve36(projectRoot, relPath));
|
|
23340
23244
|
if (virtualCssResponse)
|
|
23341
23245
|
return virtualCssResponse;
|
|
23342
23246
|
const { filePath, ext } = resolveSourcePath(relPath, projectRoot);
|
|
@@ -23352,11 +23256,11 @@ export default {};
|
|
|
23352
23256
|
SRC_IMPORT_RE.lastIndex = 0;
|
|
23353
23257
|
while ((match = SRC_IMPORT_RE.exec(content)) !== null) {
|
|
23354
23258
|
if (match[1])
|
|
23355
|
-
files.push(
|
|
23259
|
+
files.push(resolve36(projectRoot, match[1]));
|
|
23356
23260
|
}
|
|
23357
23261
|
return files;
|
|
23358
23262
|
}, invalidateModule = (filePath) => {
|
|
23359
|
-
const resolved =
|
|
23263
|
+
const resolved = resolve36(filePath);
|
|
23360
23264
|
invalidate(filePath);
|
|
23361
23265
|
if (resolved !== filePath)
|
|
23362
23266
|
invalidate(resolved);
|
|
@@ -23501,7 +23405,7 @@ __export(exports_hmrCompiler, {
|
|
|
23501
23405
|
getApplyMetadataModule: () => getApplyMetadataModule,
|
|
23502
23406
|
encodeHmrComponentId: () => encodeHmrComponentId
|
|
23503
23407
|
});
|
|
23504
|
-
import { dirname as
|
|
23408
|
+
import { dirname as dirname23, relative as relative15, resolve as resolve37 } from "path";
|
|
23505
23409
|
import { performance as performance2 } from "perf_hooks";
|
|
23506
23410
|
var getApplyMetadataModule = async (encodedId) => {
|
|
23507
23411
|
const decoded = decodeURIComponent(encodedId);
|
|
@@ -23510,7 +23414,7 @@ var getApplyMetadataModule = async (encodedId) => {
|
|
|
23510
23414
|
return null;
|
|
23511
23415
|
const filePathRel = decoded.slice(0, at2);
|
|
23512
23416
|
const className = decoded.slice(at2 + 1);
|
|
23513
|
-
const componentFilePath =
|
|
23417
|
+
const componentFilePath = resolve37(process.cwd(), filePathRel);
|
|
23514
23418
|
const projectRelPath = relative15(process.cwd(), componentFilePath).replace(/\\/g, "/");
|
|
23515
23419
|
const cacheKey2 = encodeURIComponent(`${projectRelPath}@${className}`);
|
|
23516
23420
|
const { takePendingModule: takePendingModule2 } = await Promise.resolve().then(() => (init_fastHmrCompiler(), exports_fastHmrCompiler));
|
|
@@ -23521,7 +23425,7 @@ var getApplyMetadataModule = async (encodedId) => {
|
|
|
23521
23425
|
const { resolveOwningComponents: resolveOwningComponents2 } = await Promise.resolve().then(() => (init_resolveOwningComponents(), exports_resolveOwningComponents));
|
|
23522
23426
|
const owners = resolveOwningComponents2({
|
|
23523
23427
|
changedFilePath: componentFilePath,
|
|
23524
|
-
userAngularRoot:
|
|
23428
|
+
userAngularRoot: dirname23(componentFilePath)
|
|
23525
23429
|
});
|
|
23526
23430
|
const owner = owners.find((o3) => o3.className === className);
|
|
23527
23431
|
const kind = owner?.kind ?? "component";
|
|
@@ -23672,11 +23576,11 @@ var exports_simpleHTMLHMR = {};
|
|
|
23672
23576
|
__export(exports_simpleHTMLHMR, {
|
|
23673
23577
|
handleHTMLUpdate: () => handleHTMLUpdate
|
|
23674
23578
|
});
|
|
23675
|
-
import { resolve as
|
|
23579
|
+
import { resolve as resolve38 } from "path";
|
|
23676
23580
|
var handleHTMLUpdate = async (htmlFilePath) => {
|
|
23677
23581
|
let htmlContent;
|
|
23678
23582
|
try {
|
|
23679
|
-
const resolvedPath =
|
|
23583
|
+
const resolvedPath = resolve38(htmlFilePath);
|
|
23680
23584
|
const file4 = Bun.file(resolvedPath);
|
|
23681
23585
|
if (!await file4.exists()) {
|
|
23682
23586
|
return null;
|
|
@@ -23702,11 +23606,11 @@ var exports_simpleHTMXHMR = {};
|
|
|
23702
23606
|
__export(exports_simpleHTMXHMR, {
|
|
23703
23607
|
handleHTMXUpdate: () => handleHTMXUpdate
|
|
23704
23608
|
});
|
|
23705
|
-
import { resolve as
|
|
23609
|
+
import { resolve as resolve39 } from "path";
|
|
23706
23610
|
var handleHTMXUpdate = async (htmxFilePath) => {
|
|
23707
23611
|
let htmlContent;
|
|
23708
23612
|
try {
|
|
23709
|
-
const resolvedPath =
|
|
23613
|
+
const resolvedPath = resolve39(htmxFilePath);
|
|
23710
23614
|
const file4 = Bun.file(resolvedPath);
|
|
23711
23615
|
if (!await file4.exists()) {
|
|
23712
23616
|
return null;
|
|
@@ -23729,7 +23633,7 @@ var init_simpleHTMXHMR = () => {};
|
|
|
23729
23633
|
|
|
23730
23634
|
// src/dev/rebuildTrigger.ts
|
|
23731
23635
|
import { existsSync as existsSync32, rmSync as rmSync3 } from "fs";
|
|
23732
|
-
import { basename as basename13, dirname as
|
|
23636
|
+
import { basename as basename13, dirname as dirname24, join as join39, relative as relative16, resolve as resolve40, sep as sep4 } from "path";
|
|
23733
23637
|
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
23638
|
if (!config.tailwind)
|
|
23735
23639
|
return;
|
|
@@ -23741,7 +23645,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
23741
23645
|
if (!cssChanged)
|
|
23742
23646
|
return;
|
|
23743
23647
|
try {
|
|
23744
|
-
const outputPath =
|
|
23648
|
+
const outputPath = resolve40(state.resolvedPaths.buildDir, config.tailwind.output);
|
|
23745
23649
|
const bytes = await Bun.file(outputPath).bytes();
|
|
23746
23650
|
const webPath = `/${config.tailwind.output.replace(/^\/+/, "")}`;
|
|
23747
23651
|
state.assetStore.set(webPath, bytes);
|
|
@@ -23831,12 +23735,12 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
23831
23735
|
}, isValidDeletedAffectedFile = (affectedFile, deletedPathResolved, processedFiles) => affectedFile !== deletedPathResolved && !processedFiles.has(affectedFile) && existsSync32(affectedFile), FRAMEWORK_DIR_KEYS_FOR_CLEANUP, removeStaleGenerated = (state, deletedFile) => {
|
|
23832
23736
|
const config = state.config;
|
|
23833
23737
|
const cwd2 = process.cwd();
|
|
23834
|
-
const absDeleted =
|
|
23738
|
+
const absDeleted = resolve40(deletedFile).replace(/\\/g, "/");
|
|
23835
23739
|
for (const { configKey, framework } of FRAMEWORK_DIR_KEYS_FOR_CLEANUP) {
|
|
23836
23740
|
const dir = config[configKey];
|
|
23837
23741
|
if (!dir)
|
|
23838
23742
|
continue;
|
|
23839
|
-
const absDir =
|
|
23743
|
+
const absDir = resolve40(cwd2, dir).replace(/\\/g, "/");
|
|
23840
23744
|
if (!absDeleted.startsWith(`${absDir}/`))
|
|
23841
23745
|
continue;
|
|
23842
23746
|
const rel = absDeleted.slice(absDir.length + 1);
|
|
@@ -23860,7 +23764,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
23860
23764
|
removeStaleGenerated(state, filePathInSet);
|
|
23861
23765
|
try {
|
|
23862
23766
|
const affectedFiles = getAffectedFiles(state.dependencyGraph, filePathInSet);
|
|
23863
|
-
const deletedPathResolved =
|
|
23767
|
+
const deletedPathResolved = resolve40(filePathInSet);
|
|
23864
23768
|
affectedFiles.forEach((affectedFile) => {
|
|
23865
23769
|
if (isValidDeletedAffectedFile(affectedFile, deletedPathResolved, processedFiles)) {
|
|
23866
23770
|
validFiles.push(affectedFile);
|
|
@@ -23904,7 +23808,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
23904
23808
|
if (storedHash !== undefined && storedHash === fileHash) {
|
|
23905
23809
|
return;
|
|
23906
23810
|
}
|
|
23907
|
-
const normalizedFilePath =
|
|
23811
|
+
const normalizedFilePath = resolve40(filePathInSet);
|
|
23908
23812
|
if (!processedFiles.has(normalizedFilePath)) {
|
|
23909
23813
|
validFiles.push(normalizedFilePath);
|
|
23910
23814
|
processedFiles.add(normalizedFilePath);
|
|
@@ -24042,7 +23946,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24042
23946
|
const publicDir = state.resolvedPaths.publicDir;
|
|
24043
23947
|
const assetsDir = state.resolvedPaths.assetsDir;
|
|
24044
23948
|
const handleStaticMirror = async (sourceDir, urlPrefix) => {
|
|
24045
|
-
const absSource =
|
|
23949
|
+
const absSource = resolve40(filePath);
|
|
24046
23950
|
const normalizedSource = absSource.replace(/\\/g, "/");
|
|
24047
23951
|
const normalizedDir = sourceDir.replace(/\\/g, "/");
|
|
24048
23952
|
if (!normalizedSource.startsWith(normalizedDir + "/"))
|
|
@@ -24050,10 +23954,10 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24050
23954
|
try {
|
|
24051
23955
|
const relFromDir = normalizedSource.slice(normalizedDir.length + 1);
|
|
24052
23956
|
const buildDir = state.resolvedPaths.buildDir;
|
|
24053
|
-
const destPath =
|
|
23957
|
+
const destPath = resolve40(buildDir, urlPrefix ? `${urlPrefix}/${relFromDir}` : relFromDir);
|
|
24054
23958
|
const { mkdir: mkdir7, copyFile, readFile: readFile6 } = await import("fs/promises");
|
|
24055
|
-
const { dirname:
|
|
24056
|
-
await mkdir7(
|
|
23959
|
+
const { dirname: dirname25 } = await import("path");
|
|
23960
|
+
await mkdir7(dirname25(destPath), { recursive: true });
|
|
24057
23961
|
await copyFile(absSource, destPath);
|
|
24058
23962
|
const bytes = await readFile6(destPath);
|
|
24059
23963
|
const webPath = urlPrefix ? `/${urlPrefix}/${relFromDir}` : `/${relFromDir}`;
|
|
@@ -24076,7 +23980,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24076
23980
|
if (assetsDir && await handleStaticMirror(assetsDir, "assets"))
|
|
24077
23981
|
return;
|
|
24078
23982
|
if (framework === "unknown") {
|
|
24079
|
-
invalidate(
|
|
23983
|
+
invalidate(resolve40(filePath));
|
|
24080
23984
|
const relPath = relative16(process.cwd(), filePath);
|
|
24081
23985
|
logHmrUpdate(relPath);
|
|
24082
23986
|
const angularDir = state.resolvedPaths.angularDir;
|
|
@@ -24084,10 +23988,10 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24084
23988
|
if (angularDir && state.dependencyGraph) {
|
|
24085
23989
|
try {
|
|
24086
23990
|
const { addFileToGraph: addFileToGraph2 } = await Promise.resolve().then(() => (init_dependencyGraph(), exports_dependencyGraph));
|
|
24087
|
-
addFileToGraph2(state.dependencyGraph,
|
|
24088
|
-
const affected = getAffectedFiles(state.dependencyGraph,
|
|
23991
|
+
addFileToGraph2(state.dependencyGraph, resolve40(filePath));
|
|
23992
|
+
const affected = getAffectedFiles(state.dependencyGraph, resolve40(filePath));
|
|
24089
23993
|
for (const dependent of affected) {
|
|
24090
|
-
if (dependent ===
|
|
23994
|
+
if (dependent === resolve40(filePath))
|
|
24091
23995
|
continue;
|
|
24092
23996
|
const dependentFramework = detectFramework(dependent, state.resolvedPaths);
|
|
24093
23997
|
if (dependentFramework !== "angular")
|
|
@@ -24104,14 +24008,14 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24104
24008
|
} catch {}
|
|
24105
24009
|
}
|
|
24106
24010
|
if (!hasAngularDependent) {
|
|
24107
|
-
console.log(`[abs:restart] ${
|
|
24011
|
+
console.log(`[abs:restart] ${resolve40(filePath)}`);
|
|
24108
24012
|
return;
|
|
24109
24013
|
}
|
|
24110
24014
|
try {
|
|
24111
24015
|
const { getFrameworkGeneratedDir: getFrameworkGeneratedDir2 } = await Promise.resolve().then(() => (init_generatedDir(), exports_generatedDir));
|
|
24112
24016
|
const { invalidateModule: invalidateModuleServer } = await Promise.resolve().then(() => (init_moduleServer(), exports_moduleServer));
|
|
24113
24017
|
const generatedAngularRoot = getFrameworkGeneratedDir2("angular");
|
|
24114
|
-
const sourceAbs =
|
|
24018
|
+
const sourceAbs = resolve40(filePath).replace(/\\/g, "/");
|
|
24115
24019
|
const generatedTwin = `${generatedAngularRoot.replace(/\\/g, "/")}${sourceAbs.replace(/\.ts$/, ".js")}`;
|
|
24116
24020
|
invalidateModuleServer(generatedTwin);
|
|
24117
24021
|
} catch {}
|
|
@@ -24145,7 +24049,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24145
24049
|
const userEditedFiles = new Set;
|
|
24146
24050
|
state.fileChangeQueue.forEach((filePaths) => {
|
|
24147
24051
|
for (const filePath2 of filePaths) {
|
|
24148
|
-
userEditedFiles.add(
|
|
24052
|
+
userEditedFiles.add(resolve40(filePath2));
|
|
24149
24053
|
}
|
|
24150
24054
|
});
|
|
24151
24055
|
state.lastUserEditedFiles = userEditedFiles;
|
|
@@ -24174,7 +24078,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24174
24078
|
}
|
|
24175
24079
|
if (!graph)
|
|
24176
24080
|
return componentFile;
|
|
24177
|
-
const dependents = graph.dependents.get(
|
|
24081
|
+
const dependents = graph.dependents.get(resolve40(componentFile));
|
|
24178
24082
|
if (!dependents)
|
|
24179
24083
|
return componentFile;
|
|
24180
24084
|
for (const dep of dependents) {
|
|
@@ -24183,7 +24087,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24183
24087
|
}
|
|
24184
24088
|
return componentFile;
|
|
24185
24089
|
}, resolveAngularPageEntries = (state, angularFiles, angularPagesPath) => {
|
|
24186
|
-
const pageEntries = angularFiles.filter((file4) => file4.endsWith(".ts") &&
|
|
24090
|
+
const pageEntries = angularFiles.filter((file4) => file4.endsWith(".ts") && resolve40(file4).startsWith(angularPagesPath));
|
|
24187
24091
|
if (pageEntries.length > 0 || !state.dependencyGraph) {
|
|
24188
24092
|
return pageEntries;
|
|
24189
24093
|
}
|
|
@@ -24192,7 +24096,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24192
24096
|
const lookupFile = resolveComponentLookupFile(componentFile, state.dependencyGraph);
|
|
24193
24097
|
const affected = getAffectedFiles(state.dependencyGraph, lookupFile);
|
|
24194
24098
|
affected.forEach((file4) => {
|
|
24195
|
-
if (file4.endsWith(".ts") &&
|
|
24099
|
+
if (file4.endsWith(".ts") && resolve40(file4).startsWith(angularPagesPath)) {
|
|
24196
24100
|
resolvedPages.add(file4);
|
|
24197
24101
|
}
|
|
24198
24102
|
});
|
|
@@ -24233,8 +24137,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24233
24137
|
if (serverDirs.length <= 1) {
|
|
24234
24138
|
const dir = getFrameworkGeneratedDir2(framework, projectRoot);
|
|
24235
24139
|
return {
|
|
24236
|
-
serverOutDir:
|
|
24237
|
-
serverRoot:
|
|
24140
|
+
serverOutDir: resolve40(resolvedPaths.buildDir, basename13(dir)),
|
|
24141
|
+
serverRoot: resolve40(dir, "server")
|
|
24238
24142
|
};
|
|
24239
24143
|
}
|
|
24240
24144
|
return {
|
|
@@ -24255,7 +24159,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24255
24159
|
const keepByDir = new Map;
|
|
24256
24160
|
const prefixByDir = new Map;
|
|
24257
24161
|
for (const artifact of freshOutputs) {
|
|
24258
|
-
const dir =
|
|
24162
|
+
const dir = dirname24(artifact.path);
|
|
24259
24163
|
const name = basename13(artifact.path);
|
|
24260
24164
|
const [prefix] = name.split(".");
|
|
24261
24165
|
if (!prefix)
|
|
@@ -24395,8 +24299,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24395
24299
|
if (detected !== "unknown")
|
|
24396
24300
|
continue;
|
|
24397
24301
|
try {
|
|
24398
|
-
const affected = getAffectedFiles(state.dependencyGraph,
|
|
24399
|
-
const hasAngularConsumer = affected.some((dep) => dep !==
|
|
24302
|
+
const affected = getAffectedFiles(state.dependencyGraph, resolve40(editedFile));
|
|
24303
|
+
const hasAngularConsumer = affected.some((dep) => dep !== resolve40(editedFile) && detectFramework(dep, state.resolvedPaths) === "angular");
|
|
24400
24304
|
if (hasAngularConsumer) {
|
|
24401
24305
|
return {
|
|
24402
24306
|
kind: "rebootstrap",
|
|
@@ -24443,7 +24347,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24443
24347
|
}
|
|
24444
24348
|
if (owners.length === 0 && (editedFile.endsWith(".ts") || editedFile.endsWith(".json")) && !editedFile.endsWith(".d.ts")) {
|
|
24445
24349
|
const normalized = editedFile.replace(/\\/g, "/");
|
|
24446
|
-
const angularDirAbs =
|
|
24350
|
+
const angularDirAbs = resolve40(angularDir).replace(/\\/g, "/");
|
|
24447
24351
|
if (normalized.startsWith(angularDirAbs + "/")) {
|
|
24448
24352
|
return {
|
|
24449
24353
|
kind: "rebootstrap",
|
|
@@ -24586,16 +24490,16 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24586
24490
|
};
|
|
24587
24491
|
const fire = () => {
|
|
24588
24492
|
ctx.debounceTimer = null;
|
|
24589
|
-
const
|
|
24493
|
+
const resolve41 = ctx.debouncedResolve;
|
|
24590
24494
|
ctx.debouncedResolve = null;
|
|
24591
24495
|
ctx.debouncedPromise = null;
|
|
24592
24496
|
if (ctx.inFlight) {
|
|
24593
24497
|
ctx.pending = true;
|
|
24594
|
-
ctx.inFlight.finally(() =>
|
|
24498
|
+
ctx.inFlight.finally(() => resolve41?.());
|
|
24595
24499
|
return;
|
|
24596
24500
|
}
|
|
24597
24501
|
ctx.inFlight = drive();
|
|
24598
|
-
ctx.inFlight.finally(() =>
|
|
24502
|
+
ctx.inFlight.finally(() => resolve41?.());
|
|
24599
24503
|
};
|
|
24600
24504
|
return ({ immediate = false } = {}) => {
|
|
24601
24505
|
if (!ctx.debouncedPromise) {
|
|
@@ -24622,9 +24526,9 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24622
24526
|
const diskRefreshPromise = (async () => {
|
|
24623
24527
|
if (!angularDir || editedFiles.size === 0)
|
|
24624
24528
|
return;
|
|
24625
|
-
const angularDirAbs =
|
|
24529
|
+
const angularDirAbs = resolve40(angularDir);
|
|
24626
24530
|
const filesUnderAngular = Array.from(editedFiles).filter((file4) => {
|
|
24627
|
-
const abs =
|
|
24531
|
+
const abs = resolve40(file4);
|
|
24628
24532
|
return abs === angularDirAbs || abs.startsWith(angularDirAbs + sep4);
|
|
24629
24533
|
});
|
|
24630
24534
|
if (filesUnderAngular.length === 0)
|
|
@@ -24646,7 +24550,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24646
24550
|
if (!ext)
|
|
24647
24551
|
continue;
|
|
24648
24552
|
if (ext === ".ts" || ext === ".tsx") {
|
|
24649
|
-
tsFilesToRefresh.add(
|
|
24553
|
+
tsFilesToRefresh.add(resolve40(file4));
|
|
24650
24554
|
continue;
|
|
24651
24555
|
}
|
|
24652
24556
|
const owners = resolveOwningComponents2({
|
|
@@ -24654,7 +24558,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24654
24558
|
userAngularRoot: angularDirAbs
|
|
24655
24559
|
});
|
|
24656
24560
|
for (const owner of owners) {
|
|
24657
|
-
tsFilesToRefresh.add(
|
|
24561
|
+
tsFilesToRefresh.add(resolve40(owner.componentFilePath));
|
|
24658
24562
|
}
|
|
24659
24563
|
}
|
|
24660
24564
|
if (tsFilesToRefresh.size === 0)
|
|
@@ -24669,7 +24573,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24669
24573
|
const { invalidateModule: invalidateModule2 } = await Promise.resolve().then(() => (init_moduleServer(), exports_moduleServer));
|
|
24670
24574
|
for (const tsFile of tsFilesToRefresh) {
|
|
24671
24575
|
const rel = relative16(angularDirAbs, tsFile).replace(/\\/g, "/").replace(/\.[tj]sx?$/, ".js");
|
|
24672
|
-
const compiledFile =
|
|
24576
|
+
const compiledFile = resolve40(compiledRoot, rel);
|
|
24673
24577
|
invalidateModule2(compiledFile);
|
|
24674
24578
|
}
|
|
24675
24579
|
} catch {}
|
|
@@ -24743,7 +24647,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24743
24647
|
serverPaths.forEach((serverPath, idx) => {
|
|
24744
24648
|
const fileBase = basename13(serverPath, ".js");
|
|
24745
24649
|
const ssrPath = ssrPaths[idx] ?? serverPath;
|
|
24746
|
-
state.manifest[toPascal(fileBase)] =
|
|
24650
|
+
state.manifest[toPascal(fileBase)] = resolve40(ssrPath);
|
|
24747
24651
|
});
|
|
24748
24652
|
if (clientPaths.length > 0) {
|
|
24749
24653
|
await bundleAngularClient(state, clientPaths, state.resolvedPaths.buildDir, angularDir);
|
|
@@ -24756,9 +24660,9 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24756
24660
|
const angularDir = config.angularDirectory ?? "";
|
|
24757
24661
|
const angularFiles = filesToRebuild.filter((file4) => detectFramework(file4, state.resolvedPaths) === "angular");
|
|
24758
24662
|
for (const file4 of angularFiles) {
|
|
24759
|
-
state.fileHashes.set(
|
|
24663
|
+
state.fileHashes.set(resolve40(file4), computeFileHash(file4));
|
|
24760
24664
|
}
|
|
24761
|
-
const angularPagesPath =
|
|
24665
|
+
const angularPagesPath = resolve40(angularDir, "pages");
|
|
24762
24666
|
const pageEntries = resolveAngularPageEntries(state, angularFiles, angularPagesPath);
|
|
24763
24667
|
const tierStart = performance.now();
|
|
24764
24668
|
const verdict = await decideAngularTier(state, angularDir);
|
|
@@ -24799,11 +24703,11 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24799
24703
|
if (isComponentFile2)
|
|
24800
24704
|
return primaryFile;
|
|
24801
24705
|
const { findNearestComponent: findNearestComponent2 } = await Promise.resolve().then(() => (init_transformCache(), exports_transformCache));
|
|
24802
|
-
const nearest = findNearestComponent2(
|
|
24706
|
+
const nearest = findNearestComponent2(resolve40(primaryFile));
|
|
24803
24707
|
return nearest ?? primaryFile;
|
|
24804
24708
|
}, handleReactModuleServerPath = async (state, reactFiles, startTime, onRebuildComplete) => {
|
|
24805
24709
|
for (const file4 of reactFiles) {
|
|
24806
|
-
state.fileHashes.set(
|
|
24710
|
+
state.fileHashes.set(resolve40(file4), computeFileHash(file4));
|
|
24807
24711
|
}
|
|
24808
24712
|
const primaryFile = reactFiles.find((file4) => !file4.replace(/\\/g, "/").includes("/pages/")) ?? reactFiles[0];
|
|
24809
24713
|
if (!primaryFile) {
|
|
@@ -24884,7 +24788,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24884
24788
|
});
|
|
24885
24789
|
}, handleSvelteModuleServerPath = async (state, svelteFiles, config, startTime, onRebuildComplete) => {
|
|
24886
24790
|
for (const file4 of svelteFiles) {
|
|
24887
|
-
state.fileHashes.set(
|
|
24791
|
+
state.fileHashes.set(resolve40(file4), computeFileHash(file4));
|
|
24888
24792
|
}
|
|
24889
24793
|
const serverDuration = Date.now() - startTime;
|
|
24890
24794
|
await runSequentially(svelteFiles, (changedFile) => broadcastSvelteModuleUpdate(state, changedFile, svelteFiles, serverDuration));
|
|
@@ -25131,7 +25035,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
25131
25035
|
});
|
|
25132
25036
|
}, handleVueModuleServerPath = async (state, vueFiles, nonVueFiles, config, startTime, onRebuildComplete) => {
|
|
25133
25037
|
for (const file4 of [...vueFiles, ...nonVueFiles]) {
|
|
25134
|
-
state.fileHashes.set(
|
|
25038
|
+
state.fileHashes.set(resolve40(file4), computeFileHash(file4));
|
|
25135
25039
|
}
|
|
25136
25040
|
await invalidateNonVueModules(nonVueFiles);
|
|
25137
25041
|
const serverDuration = Date.now() - startTime;
|
|
@@ -25280,7 +25184,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
25280
25184
|
recursive: true,
|
|
25281
25185
|
withFileTypes: true
|
|
25282
25186
|
});
|
|
25283
|
-
return entries.filter((entry) => entry.isFile() && EMBER_PAGE_EXTENSIONS.some((ext) => entry.name.endsWith(ext))).map((entry) =>
|
|
25187
|
+
return entries.filter((entry) => entry.isFile() && EMBER_PAGE_EXTENSIONS.some((ext) => entry.name.endsWith(ext))).map((entry) => resolve40(emberPagesPath, entry.name));
|
|
25284
25188
|
} catch {
|
|
25285
25189
|
return [];
|
|
25286
25190
|
}
|
|
@@ -25292,10 +25196,10 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
25292
25196
|
return state.manifest;
|
|
25293
25197
|
}
|
|
25294
25198
|
for (const file4 of emberFiles) {
|
|
25295
|
-
state.fileHashes.set(
|
|
25199
|
+
state.fileHashes.set(resolve40(file4), computeFileHash(file4));
|
|
25296
25200
|
}
|
|
25297
|
-
const emberPagesPath =
|
|
25298
|
-
const directPageEntries = emberFiles.filter((file4) =>
|
|
25201
|
+
const emberPagesPath = resolve40(emberDir, "pages");
|
|
25202
|
+
const directPageEntries = emberFiles.filter((file4) => resolve40(file4).startsWith(emberPagesPath));
|
|
25299
25203
|
const allPageEntries = directPageEntries.length > 0 ? directPageEntries : await collectAllEmberPages(emberPagesPath);
|
|
25300
25204
|
if (allPageEntries.length === 0) {
|
|
25301
25205
|
onRebuildComplete({ hmrState: state, manifest: state.manifest });
|
|
@@ -25305,7 +25209,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
25305
25209
|
const { serverPaths } = await compileEmber2(allPageEntries, emberDir, process.cwd(), true);
|
|
25306
25210
|
for (const serverPath of serverPaths) {
|
|
25307
25211
|
const fileBase = basename13(serverPath, ".js");
|
|
25308
|
-
state.manifest[toPascal(fileBase)] =
|
|
25212
|
+
state.manifest[toPascal(fileBase)] = resolve40(serverPath);
|
|
25309
25213
|
}
|
|
25310
25214
|
const { invalidateEmberSsrCache: invalidateEmberSsrCache2 } = await Promise.resolve().then(() => (init_ember(), exports_ember));
|
|
25311
25215
|
invalidateEmberSsrCache2();
|
|
@@ -25397,8 +25301,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
25397
25301
|
if (!buildReference?.source) {
|
|
25398
25302
|
return;
|
|
25399
25303
|
}
|
|
25400
|
-
const sourcePath = buildReference.source.startsWith("file://") ? new URL(buildReference.source).pathname :
|
|
25401
|
-
islandFiles.add(
|
|
25304
|
+
const sourcePath = buildReference.source.startsWith("file://") ? new URL(buildReference.source).pathname : resolve40(dirname24(buildInfo.resolvedRegistryPath), buildReference.source);
|
|
25305
|
+
islandFiles.add(resolve40(sourcePath));
|
|
25402
25306
|
}, resolveIslandSourceFiles = async (config) => {
|
|
25403
25307
|
const registryPath = config.islands?.registry;
|
|
25404
25308
|
if (!registryPath) {
|
|
@@ -25406,7 +25310,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
25406
25310
|
}
|
|
25407
25311
|
const buildInfo = await loadIslandRegistryBuildInfo(registryPath);
|
|
25408
25312
|
const islandFiles = new Set([
|
|
25409
|
-
|
|
25313
|
+
resolve40(buildInfo.resolvedRegistryPath)
|
|
25410
25314
|
]);
|
|
25411
25315
|
for (const definition of buildInfo.definitions) {
|
|
25412
25316
|
resolveIslandDefinitionSource(definition, buildInfo, islandFiles);
|
|
@@ -25417,7 +25321,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
25417
25321
|
if (islandFiles.size === 0) {
|
|
25418
25322
|
return false;
|
|
25419
25323
|
}
|
|
25420
|
-
return filesToRebuild.some((file4) => islandFiles.has(
|
|
25324
|
+
return filesToRebuild.some((file4) => islandFiles.has(resolve40(file4)));
|
|
25421
25325
|
}, handleIslandSourceReload = async (state, config, filesToRebuild, manifest) => {
|
|
25422
25326
|
const shouldReload = await didStaticPagesNeedIslandRefresh(config, filesToRebuild);
|
|
25423
25327
|
if (!shouldReload) {
|
|
@@ -25452,10 +25356,10 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
25452
25356
|
}, computeOutputPagesDir = (state, config, framework) => {
|
|
25453
25357
|
const isSingle = !config.reactDirectory && !config.svelteDirectory && !config.vueDirectory && (framework === "html" ? !config.htmxDirectory : !config.htmlDirectory);
|
|
25454
25358
|
if (isSingle) {
|
|
25455
|
-
return
|
|
25359
|
+
return resolve40(state.resolvedPaths.buildDir, "pages");
|
|
25456
25360
|
}
|
|
25457
25361
|
const dirName = framework === "html" ? basename13(config.htmlDirectory ?? "html") : basename13(config.htmxDirectory ?? "htmx");
|
|
25458
|
-
return
|
|
25362
|
+
return resolve40(state.resolvedPaths.buildDir, dirName, "pages");
|
|
25459
25363
|
}, processHtmlPageUpdate = async (state, pageFile, builtHtmlPagePath, manifest, duration) => {
|
|
25460
25364
|
try {
|
|
25461
25365
|
const { handleHTMLUpdate: handleHTMLUpdate2 } = await Promise.resolve().then(() => (init_simpleHTMLHMR(), exports_simpleHTMLHMR));
|
|
@@ -25494,7 +25398,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
25494
25398
|
const pageFilesToUpdate = shouldRefreshAllPages ? await scanEntryPoints(outputHtmlPages, "*.html") : htmlPageFiles;
|
|
25495
25399
|
await runSequentially(pageFilesToUpdate, async (pageFile) => {
|
|
25496
25400
|
const htmlPageName = basename13(pageFile);
|
|
25497
|
-
const builtHtmlPagePath =
|
|
25401
|
+
const builtHtmlPagePath = resolve40(outputHtmlPages, htmlPageName);
|
|
25498
25402
|
await processHtmlPageUpdate(state, pageFile, builtHtmlPagePath, manifest, duration);
|
|
25499
25403
|
});
|
|
25500
25404
|
}, handleVueCssOnlyUpdate = (state, vueCssFiles, manifest, duration) => {
|
|
@@ -25559,7 +25463,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
25559
25463
|
const cssKey = `${pascalName}CSS`;
|
|
25560
25464
|
const cssUrl = manifest[cssKey] || null;
|
|
25561
25465
|
const { vueHmrMetadata: vueHmrMetadata2 } = await Promise.resolve().then(() => (init_compileVue(), exports_compileVue));
|
|
25562
|
-
const hmrMeta = vueHmrMetadata2.get(
|
|
25466
|
+
const hmrMeta = vueHmrMetadata2.get(resolve40(vuePagePath));
|
|
25563
25467
|
const changeType = hmrMeta?.changeType ?? "full";
|
|
25564
25468
|
if (changeType === "style-only") {
|
|
25565
25469
|
broadcastVueStyleOnly(state, vuePagePath, baseName, cssUrl, hmrId, manifest, duration);
|
|
@@ -25744,7 +25648,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
25744
25648
|
const pageFilesToUpdate = shouldRefreshAllPages ? await scanEntryPoints(outputHtmxPages, "*.html") : htmxPageFiles;
|
|
25745
25649
|
await runSequentially(pageFilesToUpdate, async (htmxPageFile) => {
|
|
25746
25650
|
const htmxPageName = basename13(htmxPageFile);
|
|
25747
|
-
const builtHtmxPagePath =
|
|
25651
|
+
const builtHtmxPagePath = resolve40(outputHtmxPages, htmxPageName);
|
|
25748
25652
|
await processHtmxPageUpdate(state, htmxPageFile, builtHtmxPagePath, manifest, duration);
|
|
25749
25653
|
});
|
|
25750
25654
|
}, collectUpdatedModulePaths = (allModuleUpdates) => {
|
|
@@ -25853,7 +25757,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
25853
25757
|
html = html.slice(0, bodyClose.index) + hmrScript + html.slice(bodyClose.index);
|
|
25854
25758
|
writeFs(destPath, html);
|
|
25855
25759
|
}, processMarkupFileFastPath = async (state, sourceFile, outputDir, framework, startTime, updateAssetPaths2, handleUpdate, readFs, writeFs) => {
|
|
25856
|
-
const destPath =
|
|
25760
|
+
const destPath = resolve40(outputDir, basename13(sourceFile));
|
|
25857
25761
|
const hmrScript = extractHmrScript(destPath, readFs);
|
|
25858
25762
|
const source = await Bun.file(sourceFile).text();
|
|
25859
25763
|
await Bun.write(destPath, source);
|
|
@@ -25995,7 +25899,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
25995
25899
|
});
|
|
25996
25900
|
if (config.tailwind && filesToRebuild && filesToRebuild.some(isTailwindCandidate)) {
|
|
25997
25901
|
try {
|
|
25998
|
-
const outputPath =
|
|
25902
|
+
const outputPath = resolve40(state.resolvedPaths.buildDir, config.tailwind.output);
|
|
25999
25903
|
const bytes = await Bun.file(outputPath).bytes();
|
|
26000
25904
|
const webPath = `/${config.tailwind.output.replace(/^\/+/, "")}`;
|
|
26001
25905
|
state.assetStore.set(webPath, bytes);
|
|
@@ -26429,7 +26333,7 @@ __export(exports_devBuild, {
|
|
|
26429
26333
|
});
|
|
26430
26334
|
import { readdir as readdir5 } from "fs/promises";
|
|
26431
26335
|
import { statSync as statSync7 } from "fs";
|
|
26432
|
-
import { resolve as
|
|
26336
|
+
import { resolve as resolve41 } from "path";
|
|
26433
26337
|
var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
26434
26338
|
const configuredDirs = [
|
|
26435
26339
|
config.reactDirectory,
|
|
@@ -26452,7 +26356,7 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
26452
26356
|
return Object.keys(config).length > 0 ? config : null;
|
|
26453
26357
|
}, reloadConfig = async () => {
|
|
26454
26358
|
try {
|
|
26455
|
-
const configPath2 =
|
|
26359
|
+
const configPath2 = resolve41(process.env.ABSOLUTE_CONFIG ?? "absolute.config.ts");
|
|
26456
26360
|
const source = await Bun.file(configPath2).text();
|
|
26457
26361
|
return parseDirectoryConfig(source);
|
|
26458
26362
|
} catch {
|
|
@@ -26559,7 +26463,7 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
26559
26463
|
state.fileChangeQueue.clear();
|
|
26560
26464
|
}
|
|
26561
26465
|
}, handleCachedReload = async () => {
|
|
26562
|
-
const serverMtime = statSync7(
|
|
26466
|
+
const serverMtime = statSync7(resolve41(Bun.main)).mtimeMs;
|
|
26563
26467
|
const lastMtime = globalThis.__hmrServerMtime;
|
|
26564
26468
|
globalThis.__hmrServerMtime = serverMtime;
|
|
26565
26469
|
const cached = globalThis.__hmrDevResult;
|
|
@@ -26596,8 +26500,8 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
26596
26500
|
return true;
|
|
26597
26501
|
}, resolveAbsoluteVersion2 = async () => {
|
|
26598
26502
|
const candidates = [
|
|
26599
|
-
|
|
26600
|
-
|
|
26503
|
+
resolve41(import.meta.dir, "..", "..", "package.json"),
|
|
26504
|
+
resolve41(import.meta.dir, "..", "package.json")
|
|
26601
26505
|
];
|
|
26602
26506
|
const [candidate, ...remaining] = candidates;
|
|
26603
26507
|
if (!candidate) {
|
|
@@ -26623,7 +26527,7 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
26623
26527
|
const entries = await readdir5(vendorDir).catch(() => emptyStringArray);
|
|
26624
26528
|
await Promise.all(entries.filter((entry) => entry.endsWith(".js")).map(async (entry) => {
|
|
26625
26529
|
const webPath = `/${framework}/vendor/${entry}`;
|
|
26626
|
-
const bytes = await Bun.file(
|
|
26530
|
+
const bytes = await Bun.file(resolve41(vendorDir, entry)).bytes();
|
|
26627
26531
|
assetStore.set(webPath, bytes);
|
|
26628
26532
|
}));
|
|
26629
26533
|
}, devBuild = async (config) => {
|
|
@@ -26702,11 +26606,11 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
26702
26606
|
cleanStaleAssets(state.assetStore, manifest, state.resolvedPaths.buildDir);
|
|
26703
26607
|
recordStep("populate asset store", stepStartedAt);
|
|
26704
26608
|
stepStartedAt = performance.now();
|
|
26705
|
-
const reactVendorDir =
|
|
26706
|
-
const angularVendorDir =
|
|
26707
|
-
const svelteVendorDir =
|
|
26708
|
-
const vueVendorDir =
|
|
26709
|
-
const depVendorDir =
|
|
26609
|
+
const reactVendorDir = resolve41(state.resolvedPaths.buildDir, "react", "vendor");
|
|
26610
|
+
const angularVendorDir = resolve41(state.resolvedPaths.buildDir, "angular", "vendor");
|
|
26611
|
+
const svelteVendorDir = resolve41(state.resolvedPaths.buildDir, "svelte", "vendor");
|
|
26612
|
+
const vueVendorDir = resolve41(state.resolvedPaths.buildDir, "vue", "vendor");
|
|
26613
|
+
const depVendorDir = resolve41(state.resolvedPaths.buildDir, "vendor");
|
|
26710
26614
|
const { buildDepVendor: buildDepVendor2 } = await Promise.resolve().then(() => (init_buildDepVendor(), exports_buildDepVendor));
|
|
26711
26615
|
const [, angularSpecs, , , , , depPaths] = await Promise.all([
|
|
26712
26616
|
config.reactDirectory ? buildReactVendor(state.resolvedPaths.buildDir) : Promise.resolve(undefined),
|
|
@@ -26817,7 +26721,7 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
26817
26721
|
manifest
|
|
26818
26722
|
};
|
|
26819
26723
|
globalThis.__hmrDevResult = result;
|
|
26820
|
-
globalThis.__hmrServerMtime = statSync7(
|
|
26724
|
+
globalThis.__hmrServerMtime = statSync7(resolve41(Bun.main)).mtimeMs;
|
|
26821
26725
|
return result;
|
|
26822
26726
|
};
|
|
26823
26727
|
var init_devBuild = __esm(() => {
|
|
@@ -26857,5 +26761,5 @@ export {
|
|
|
26857
26761
|
build
|
|
26858
26762
|
};
|
|
26859
26763
|
|
|
26860
|
-
//# debugId=
|
|
26764
|
+
//# debugId=078CF7870DEFB49E64756E2164756E21
|
|
26861
26765
|
//# sourceMappingURL=build.js.map
|