@absolutejs/absolute 0.19.0-beta.973 → 0.19.0-beta.974
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/angular/components/core/streamingSlotRegistrar.js +1 -1
- package/dist/angular/components/core/streamingSlotRegistry.js +2 -2
- package/dist/build.js +479 -463
- package/dist/build.js.map +6 -6
- package/dist/index.js +489 -473
- package/dist/index.js.map +6 -6
- package/dist/src/build/emitAngularProvidersFiles.d.ts +2 -2
- package/dist/src/build/scanAngularPageRoutes.d.ts +0 -4
- package/package.json +1 -1
package/dist/build.js
CHANGED
|
@@ -11556,118 +11556,27 @@ var validateSafePath = (targetPath, baseDirectory) => {
|
|
|
11556
11556
|
};
|
|
11557
11557
|
var init_validateSafePath = () => {};
|
|
11558
11558
|
|
|
11559
|
-
// src/build/scanAngularPageRoutes.ts
|
|
11560
|
-
import { readdirSync as readdirSync2, readFileSync as readFileSync12 } from "fs";
|
|
11561
|
-
import { basename as basename5, join as join22, relative as relative9 } from "path";
|
|
11562
|
-
import ts6 from "typescript";
|
|
11563
|
-
var SOURCE_EXTENSIONS2, SKIP_DIRS2, hasSourceExtension2 = (filePath) => {
|
|
11564
|
-
const idx = filePath.lastIndexOf(".");
|
|
11565
|
-
if (idx === -1)
|
|
11566
|
-
return false;
|
|
11567
|
-
return SOURCE_EXTENSIONS2.has(filePath.slice(idx));
|
|
11568
|
-
}, isPageFile = (filePath) => {
|
|
11569
|
-
if (!hasSourceExtension2(filePath))
|
|
11570
|
-
return false;
|
|
11571
|
-
const base = basename5(filePath);
|
|
11572
|
-
if (base.endsWith(".d.ts"))
|
|
11573
|
-
return false;
|
|
11574
|
-
if (base.endsWith(".test.ts"))
|
|
11575
|
-
return false;
|
|
11576
|
-
if (base.endsWith(".spec.ts"))
|
|
11577
|
-
return false;
|
|
11578
|
-
return true;
|
|
11579
|
-
}, collectPageFiles = (pagesRoot) => {
|
|
11580
|
-
const out = [];
|
|
11581
|
-
const stack = [pagesRoot];
|
|
11582
|
-
while (stack.length > 0) {
|
|
11583
|
-
const dir = stack.pop();
|
|
11584
|
-
if (!dir)
|
|
11585
|
-
continue;
|
|
11586
|
-
let entries;
|
|
11587
|
-
try {
|
|
11588
|
-
entries = readdirSync2(dir, {
|
|
11589
|
-
encoding: "utf-8",
|
|
11590
|
-
withFileTypes: true
|
|
11591
|
-
});
|
|
11592
|
-
} catch {
|
|
11593
|
-
continue;
|
|
11594
|
-
}
|
|
11595
|
-
for (const entry of entries) {
|
|
11596
|
-
if (entry.isDirectory()) {
|
|
11597
|
-
if (SKIP_DIRS2.has(entry.name))
|
|
11598
|
-
continue;
|
|
11599
|
-
if (entry.name.startsWith("."))
|
|
11600
|
-
continue;
|
|
11601
|
-
stack.push(join22(dir, entry.name));
|
|
11602
|
-
} else if (entry.isFile() && isPageFile(entry.name)) {
|
|
11603
|
-
out.push(join22(dir, entry.name));
|
|
11604
|
-
}
|
|
11605
|
-
}
|
|
11606
|
-
}
|
|
11607
|
-
return out;
|
|
11608
|
-
}, hasTopLevelRoutesExport = (source, filePath) => {
|
|
11609
|
-
if (!source.includes("routes"))
|
|
11610
|
-
return false;
|
|
11611
|
-
const sf = ts6.createSourceFile(filePath, source, ts6.ScriptTarget.Latest, true, ts6.ScriptKind.TS);
|
|
11612
|
-
for (const statement of sf.statements) {
|
|
11613
|
-
if (!ts6.isVariableStatement(statement))
|
|
11614
|
-
continue;
|
|
11615
|
-
const isExported = statement.modifiers?.some((modifier) => modifier.kind === ts6.SyntaxKind.ExportKeyword);
|
|
11616
|
-
if (!isExported)
|
|
11617
|
-
continue;
|
|
11618
|
-
for (const declaration of statement.declarationList.declarations) {
|
|
11619
|
-
if (!ts6.isIdentifier(declaration.name))
|
|
11620
|
-
continue;
|
|
11621
|
-
if (declaration.name.text === "routes")
|
|
11622
|
-
return true;
|
|
11623
|
-
}
|
|
11624
|
-
}
|
|
11625
|
-
return false;
|
|
11626
|
-
}, scanAngularPageRoutes = (pagesRoot) => {
|
|
11627
|
-
const files = collectPageFiles(pagesRoot);
|
|
11628
|
-
const out = [];
|
|
11629
|
-
for (const file of files) {
|
|
11630
|
-
let source;
|
|
11631
|
-
try {
|
|
11632
|
-
source = readFileSync12(file, "utf-8");
|
|
11633
|
-
} catch {
|
|
11634
|
-
continue;
|
|
11635
|
-
}
|
|
11636
|
-
const hasRoutes = hasTopLevelRoutesExport(source, file);
|
|
11637
|
-
const base = basename5(file).replace(/\.[cm]?[tj]sx?$/, "");
|
|
11638
|
-
const manifestKey = toPascal(base);
|
|
11639
|
-
out.push({
|
|
11640
|
-
hasRoutes,
|
|
11641
|
-
manifestKey,
|
|
11642
|
-
pageFile: file
|
|
11643
|
-
});
|
|
11644
|
-
}
|
|
11645
|
-
return out;
|
|
11646
|
-
}, relativeRoutesImport = (emittedFromDir, pageFile) => {
|
|
11647
|
-
const rel = relative9(emittedFromDir, pageFile.replace(/\.ts$/, "")).replace(/\\/g, "/");
|
|
11648
|
-
return rel.startsWith(".") ? rel : `./${rel}`;
|
|
11649
|
-
};
|
|
11650
|
-
var init_scanAngularPageRoutes = __esm(() => {
|
|
11651
|
-
SOURCE_EXTENSIONS2 = new Set([".ts", ".tsx", ".mts", ".cts"]);
|
|
11652
|
-
SKIP_DIRS2 = new Set([
|
|
11653
|
-
".absolutejs",
|
|
11654
|
-
".generated",
|
|
11655
|
-
".git",
|
|
11656
|
-
"build",
|
|
11657
|
-
"compiled",
|
|
11658
|
-
"dist",
|
|
11659
|
-
"node_modules"
|
|
11660
|
-
]);
|
|
11661
|
-
});
|
|
11662
|
-
|
|
11663
11559
|
// src/build/emitAngularProvidersFiles.ts
|
|
11664
11560
|
import { mkdirSync as mkdirSync8, writeFileSync as writeFileSync7 } from "fs";
|
|
11665
|
-
import { dirname as dirname11, join as
|
|
11666
|
-
var
|
|
11561
|
+
import { dirname as dirname11, isAbsolute as isAbsolute3, join as join22, relative as relative9, resolve as resolve19 } from "path";
|
|
11562
|
+
var mapToCompiledPath = (sourceAbsPath, angularDir, angularGeneratedDir) => {
|
|
11563
|
+
const normalizedSrc = resolve19(sourceAbsPath);
|
|
11564
|
+
const normalizedAngularDir = resolve19(angularDir);
|
|
11565
|
+
if (!normalizedSrc.startsWith(`${normalizedAngularDir}/`) && normalizedSrc !== normalizedAngularDir) {
|
|
11566
|
+
return normalizedSrc;
|
|
11567
|
+
}
|
|
11568
|
+
const relPath = normalizedSrc.slice(normalizedAngularDir.length + 1);
|
|
11569
|
+
const compiledRelPath = relPath.replace(/\.[cm]?[tj]sx?$/, ".js");
|
|
11570
|
+
return join22(angularGeneratedDir, compiledRelPath);
|
|
11571
|
+
}, relativeImportSpecifier = (fromDir, targetAbsPath) => {
|
|
11572
|
+
const targetWithoutExt = targetAbsPath.replace(/\.[cm]?[tj]sx?$/, "");
|
|
11573
|
+
const rel = relative9(fromDir, targetWithoutExt).replace(/\\/g, "/");
|
|
11574
|
+
return rel.startsWith(".") ? rel : `./${rel}`;
|
|
11575
|
+
}, buildModuleSpecifier = (importSpec, outputPath) => {
|
|
11667
11576
|
if (!importSpec.resolvedAbsPath)
|
|
11668
11577
|
return importSpec.source;
|
|
11669
11578
|
const outputDir = dirname11(outputPath);
|
|
11670
|
-
const rel =
|
|
11579
|
+
const rel = relative9(outputDir, importSpec.resolvedAbsPath).replace(/\\/g, "/");
|
|
11671
11580
|
const withoutExt = rel.replace(/\.[cm]?[tj]sx?$/, "");
|
|
11672
11581
|
return withoutExt.startsWith(".") ? withoutExt : `./${withoutExt}`;
|
|
11673
11582
|
}, buildImportLine = (importSpec, outputPath) => {
|
|
@@ -11713,7 +11622,7 @@ var buildModuleSpecifier = (importSpec, outputPath) => {
|
|
|
11713
11622
|
}
|
|
11714
11623
|
return lines.join(`
|
|
11715
11624
|
`);
|
|
11716
|
-
}, ROUTER_FEATURES_DEFAULT, renderFile = (call, outputPath, basePath, pageRoutes, providersImport) => {
|
|
11625
|
+
}, ROUTER_FEATURES_DEFAULT, renderFile = (call, outputPath, basePath, pageRoutes, providersImport, context) => {
|
|
11717
11626
|
const sections = [];
|
|
11718
11627
|
sections.push("/* AUTOGENERATED by AbsoluteJS \u2014 see `scanAngularHandlerCalls`. */", "/* eslint-disable */");
|
|
11719
11628
|
const groups = groupImports(call.providerImports);
|
|
@@ -11724,8 +11633,8 @@ var buildModuleSpecifier = (importSpec, outputPath) => {
|
|
|
11724
11633
|
}
|
|
11725
11634
|
if (providersImport) {
|
|
11726
11635
|
const outputDir = dirname11(outputPath);
|
|
11727
|
-
const
|
|
11728
|
-
const specifier =
|
|
11636
|
+
const compiledTarget = mapToCompiledPath(providersImport.absolutePath, context.angularDir, context.angularGeneratedDir);
|
|
11637
|
+
const specifier = relativeImportSpecifier(outputDir, compiledTarget);
|
|
11729
11638
|
const importClause = providersImport.importedName === providersImport.bindingName ? `{ ${providersImport.bindingName} as __globalProviders }` : `{ ${providersImport.importedName} as __globalProviders }`;
|
|
11730
11639
|
sections.push(`import ${importClause} from "${specifier}";`);
|
|
11731
11640
|
}
|
|
@@ -11733,7 +11642,8 @@ var buildModuleSpecifier = (importSpec, outputPath) => {
|
|
|
11733
11642
|
sections.push(`import { APP_BASE_HREF } from "@angular/common";`, `const __basePathProvider = { provide: APP_BASE_HREF, useValue: ${JSON.stringify(basePath)} };`);
|
|
11734
11643
|
}
|
|
11735
11644
|
if (pageRoutes?.hasRoutes) {
|
|
11736
|
-
const
|
|
11645
|
+
const compiledPageTarget = mapToCompiledPath(pageRoutes.pageFile, context.angularDir, context.angularGeneratedDir);
|
|
11646
|
+
const routesImport = relativeImportSpecifier(dirname11(outputPath), compiledPageTarget);
|
|
11737
11647
|
sections.push(`import { ${["provideRouter", ...ROUTER_FEATURES_DEFAULT].join(", ")} } from "@angular/router";`, `import { routes as __pageRoutes } from "${routesImport}";`, `const __routerProvider = provideRouter(__pageRoutes, ${ROUTER_FEATURES_DEFAULT.map((name) => `${name}()`).join(", ")});`);
|
|
11738
11648
|
}
|
|
11739
11649
|
const userProvidersExpr = call.providersExpr ?? "[]";
|
|
@@ -11759,19 +11669,25 @@ var buildModuleSpecifier = (importSpec, outputPath) => {
|
|
|
11759
11669
|
return null;
|
|
11760
11670
|
const trimmed = mountPath.slice(0, -1);
|
|
11761
11671
|
return trimmed === "/" ? null : trimmed;
|
|
11762
|
-
}, emitAngularProvidersFiles = (projectRoot, calls, pageRoutes, options = {}) => {
|
|
11672
|
+
}, emitAngularProvidersFiles = (projectRoot, angularDir, calls, pageRoutes, options = {}) => {
|
|
11763
11673
|
const outputDir = getProvidersOutputDir(projectRoot);
|
|
11764
11674
|
mkdirSync8(outputDir, { recursive: true });
|
|
11675
|
+
const angularGeneratedDir = getFrameworkGeneratedDir("angular", projectRoot);
|
|
11676
|
+
const resolvedAngularDir = isAbsolute3(angularDir) ? resolve19(angularDir) : resolve19(projectRoot, angularDir);
|
|
11677
|
+
const context = {
|
|
11678
|
+
angularDir: resolvedAngularDir,
|
|
11679
|
+
angularGeneratedDir
|
|
11680
|
+
};
|
|
11765
11681
|
const pageRoutesByKey = new Map;
|
|
11766
11682
|
for (const entry of pageRoutes) {
|
|
11767
11683
|
pageRoutesByKey.set(entry.manifestKey, entry);
|
|
11768
11684
|
}
|
|
11769
11685
|
const emitted = [];
|
|
11770
11686
|
for (const call of calls) {
|
|
11771
|
-
const outputPath =
|
|
11687
|
+
const outputPath = join22(outputDir, `${call.manifestKey}.providers.ts`);
|
|
11772
11688
|
const basePath = deriveBasePath(call.mountPath);
|
|
11773
11689
|
const pageRoute = pageRoutesByKey.get(call.manifestKey);
|
|
11774
|
-
const content = renderFile(call, outputPath, basePath, pageRoute, options.providersImport ?? null);
|
|
11690
|
+
const content = renderFile(call, outputPath, basePath, pageRoute, options.providersImport ?? null, context);
|
|
11775
11691
|
writeFileSync7(outputPath, content, "utf-8");
|
|
11776
11692
|
emitted.push({
|
|
11777
11693
|
basePath,
|
|
@@ -11781,10 +11697,9 @@ var buildModuleSpecifier = (importSpec, outputPath) => {
|
|
|
11781
11697
|
});
|
|
11782
11698
|
}
|
|
11783
11699
|
return emitted;
|
|
11784
|
-
}, getProvidersOutputDir = (projectRoot) =>
|
|
11700
|
+
}, getProvidersOutputDir = (projectRoot) => join22(getFrameworkGeneratedDir("angular", projectRoot), "providers");
|
|
11785
11701
|
var init_emitAngularProvidersFiles = __esm(() => {
|
|
11786
11702
|
init_generatedDir();
|
|
11787
|
-
init_scanAngularPageRoutes();
|
|
11788
11703
|
ROUTER_FEATURES_DEFAULT = [
|
|
11789
11704
|
"withComponentInputBinding",
|
|
11790
11705
|
"withViewTransitions"
|
|
@@ -11793,7 +11708,7 @@ var init_emitAngularProvidersFiles = __esm(() => {
|
|
|
11793
11708
|
|
|
11794
11709
|
// src/build/emitAngularRouteMounts.ts
|
|
11795
11710
|
import { mkdirSync as mkdirSync9, writeFileSync as writeFileSync8 } from "fs";
|
|
11796
|
-
import { join as
|
|
11711
|
+
import { join as join23 } from "path";
|
|
11797
11712
|
var deriveBasePath2 = (mountPath) => {
|
|
11798
11713
|
if (!mountPath)
|
|
11799
11714
|
return null;
|
|
@@ -11804,7 +11719,7 @@ var deriveBasePath2 = (mountPath) => {
|
|
|
11804
11719
|
}, escapeForRegex = (literal) => literal.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), mountToPatternSource = (basePath) => {
|
|
11805
11720
|
const withoutTrailing = basePath.replace(/\/$/, "");
|
|
11806
11721
|
return `^${escapeForRegex(withoutTrailing)}(\\/|$)`;
|
|
11807
|
-
}, getRouteMountsOutputPath = (projectRoot) =>
|
|
11722
|
+
}, getRouteMountsOutputPath = (projectRoot) => join23(getFrameworkGeneratedDir("angular", projectRoot), "route-mounts.ts"), emitAngularRouteMounts = (projectRoot, calls) => {
|
|
11808
11723
|
const entries = [];
|
|
11809
11724
|
const seen = new Set;
|
|
11810
11725
|
for (const call of calls) {
|
|
@@ -11840,46 +11755,46 @@ var init_emitAngularRouteMounts = __esm(() => {
|
|
|
11840
11755
|
});
|
|
11841
11756
|
|
|
11842
11757
|
// src/build/parseAngularConfigImports.ts
|
|
11843
|
-
import { existsSync as existsSync19, readFileSync as
|
|
11844
|
-
import { dirname as dirname12, isAbsolute as
|
|
11845
|
-
import
|
|
11758
|
+
import { existsSync as existsSync19, readFileSync as readFileSync12 } from "fs";
|
|
11759
|
+
import { dirname as dirname12, isAbsolute as isAbsolute4, join as join24 } from "path";
|
|
11760
|
+
import ts6 from "typescript";
|
|
11846
11761
|
var findDefineConfigCall = (sf) => {
|
|
11847
11762
|
let result = null;
|
|
11848
11763
|
const visit = (node) => {
|
|
11849
11764
|
if (result)
|
|
11850
11765
|
return;
|
|
11851
|
-
if (
|
|
11766
|
+
if (ts6.isCallExpression(node) && ts6.isIdentifier(node.expression) && node.expression.text === "defineConfig") {
|
|
11852
11767
|
const [arg] = node.arguments;
|
|
11853
|
-
if (arg &&
|
|
11768
|
+
if (arg && ts6.isObjectLiteralExpression(arg)) {
|
|
11854
11769
|
result = arg;
|
|
11855
11770
|
return;
|
|
11856
11771
|
}
|
|
11857
11772
|
}
|
|
11858
|
-
|
|
11773
|
+
ts6.forEachChild(node, visit);
|
|
11859
11774
|
};
|
|
11860
|
-
|
|
11775
|
+
ts6.forEachChild(sf, visit);
|
|
11861
11776
|
return result;
|
|
11862
11777
|
}, findPropertyInitializer = (object, name) => {
|
|
11863
11778
|
for (const prop of object.properties) {
|
|
11864
|
-
if (!
|
|
11779
|
+
if (!ts6.isPropertyAssignment(prop))
|
|
11865
11780
|
continue;
|
|
11866
11781
|
if (!prop.name)
|
|
11867
11782
|
continue;
|
|
11868
|
-
const key =
|
|
11783
|
+
const key = ts6.isIdentifier(prop.name) ? prop.name.text : ts6.isStringLiteral(prop.name) ? prop.name.text : null;
|
|
11869
11784
|
if (key === name)
|
|
11870
11785
|
return prop.initializer;
|
|
11871
11786
|
}
|
|
11872
11787
|
return null;
|
|
11873
11788
|
}, findImportForBinding = (sf, binding) => {
|
|
11874
11789
|
for (const statement of sf.statements) {
|
|
11875
|
-
if (!
|
|
11790
|
+
if (!ts6.isImportDeclaration(statement))
|
|
11876
11791
|
continue;
|
|
11877
|
-
if (!
|
|
11792
|
+
if (!ts6.isStringLiteral(statement.moduleSpecifier))
|
|
11878
11793
|
continue;
|
|
11879
11794
|
if (statement.importClause?.isTypeOnly)
|
|
11880
11795
|
continue;
|
|
11881
11796
|
const named = statement.importClause?.namedBindings;
|
|
11882
|
-
if (!named || !
|
|
11797
|
+
if (!named || !ts6.isNamedImports(named))
|
|
11883
11798
|
continue;
|
|
11884
11799
|
for (const element of named.elements) {
|
|
11885
11800
|
if (element.isTypeOnly)
|
|
@@ -11895,10 +11810,10 @@ var findDefineConfigCall = (sf) => {
|
|
|
11895
11810
|
return null;
|
|
11896
11811
|
}, resolveConfigPath = (projectRoot) => {
|
|
11897
11812
|
const candidates = [
|
|
11898
|
-
|
|
11899
|
-
|
|
11900
|
-
|
|
11901
|
-
|
|
11813
|
+
join24(projectRoot, "absolute.config.ts"),
|
|
11814
|
+
join24(projectRoot, "absolute.config.mts"),
|
|
11815
|
+
join24(projectRoot, "absolute.config.js"),
|
|
11816
|
+
join24(projectRoot, "absolute.config.mjs")
|
|
11902
11817
|
];
|
|
11903
11818
|
for (const candidate of candidates) {
|
|
11904
11819
|
if (existsSync19(candidate))
|
|
@@ -11909,29 +11824,29 @@ var findDefineConfigCall = (sf) => {
|
|
|
11909
11824
|
const configPath2 = resolveConfigPath(projectRoot);
|
|
11910
11825
|
if (!configPath2)
|
|
11911
11826
|
return null;
|
|
11912
|
-
const source =
|
|
11827
|
+
const source = readFileSync12(configPath2, "utf-8");
|
|
11913
11828
|
if (!source.includes("angular"))
|
|
11914
11829
|
return null;
|
|
11915
11830
|
if (!source.includes("providers"))
|
|
11916
11831
|
return null;
|
|
11917
|
-
const sf =
|
|
11832
|
+
const sf = ts6.createSourceFile(configPath2, source, ts6.ScriptTarget.Latest, true, ts6.ScriptKind.TS);
|
|
11918
11833
|
const configObject = findDefineConfigCall(sf);
|
|
11919
11834
|
if (!configObject)
|
|
11920
11835
|
return null;
|
|
11921
11836
|
const angularField = findPropertyInitializer(configObject, "angular");
|
|
11922
|
-
if (!angularField || !
|
|
11837
|
+
if (!angularField || !ts6.isObjectLiteralExpression(angularField))
|
|
11923
11838
|
return null;
|
|
11924
11839
|
const providersField = findPropertyInitializer(angularField, "providers");
|
|
11925
11840
|
if (!providersField)
|
|
11926
11841
|
return null;
|
|
11927
|
-
if (!
|
|
11842
|
+
if (!ts6.isIdentifier(providersField))
|
|
11928
11843
|
return null;
|
|
11929
11844
|
const binding = providersField.text;
|
|
11930
11845
|
const importInfo = findImportForBinding(sf, binding);
|
|
11931
11846
|
if (!importInfo)
|
|
11932
11847
|
return null;
|
|
11933
11848
|
const configDir2 = dirname12(configPath2);
|
|
11934
|
-
const absolutePath = importInfo.source.startsWith(".") ?
|
|
11849
|
+
const absolutePath = importInfo.source.startsWith(".") ? join24(configDir2, importInfo.source).replace(/\.[cm]?[tj]sx?$/, "") : isAbsolute4(importInfo.source) ? importInfo.source.replace(/\.[cm]?[tj]sx?$/, "") : importInfo.source;
|
|
11935
11850
|
return {
|
|
11936
11851
|
absolutePath,
|
|
11937
11852
|
bindingName: binding,
|
|
@@ -11941,18 +11856,18 @@ var findDefineConfigCall = (sf) => {
|
|
|
11941
11856
|
var init_parseAngularConfigImports = () => {};
|
|
11942
11857
|
|
|
11943
11858
|
// src/build/scanAngularHandlerCalls.ts
|
|
11944
|
-
import { readdirSync as
|
|
11945
|
-
import { dirname as dirname13, isAbsolute as
|
|
11946
|
-
import
|
|
11947
|
-
var ELYSIA_ROUTE_METHODS2,
|
|
11859
|
+
import { readdirSync as readdirSync2, readFileSync as readFileSync13 } from "fs";
|
|
11860
|
+
import { dirname as dirname13, isAbsolute as isAbsolute5, join as join25, resolve as resolve20 } from "path";
|
|
11861
|
+
import ts7 from "typescript";
|
|
11862
|
+
var ELYSIA_ROUTE_METHODS2, SKIP_DIRS2, SOURCE_EXTENSIONS2, getScriptKind2 = (filePath) => {
|
|
11948
11863
|
if (filePath.endsWith(".tsx"))
|
|
11949
|
-
return
|
|
11950
|
-
return
|
|
11951
|
-
},
|
|
11864
|
+
return ts7.ScriptKind.TSX;
|
|
11865
|
+
return ts7.ScriptKind.TS;
|
|
11866
|
+
}, hasSourceExtension2 = (filePath) => {
|
|
11952
11867
|
const idx = filePath.lastIndexOf(".");
|
|
11953
11868
|
if (idx === -1)
|
|
11954
11869
|
return false;
|
|
11955
|
-
return
|
|
11870
|
+
return SOURCE_EXTENSIONS2.has(filePath.slice(idx));
|
|
11956
11871
|
}, collectSourceFiles2 = (root) => {
|
|
11957
11872
|
const out = [];
|
|
11958
11873
|
const stack = [root];
|
|
@@ -11962,7 +11877,7 @@ var ELYSIA_ROUTE_METHODS2, SKIP_DIRS3, SOURCE_EXTENSIONS3, getScriptKind2 = (fil
|
|
|
11962
11877
|
continue;
|
|
11963
11878
|
let entries;
|
|
11964
11879
|
try {
|
|
11965
|
-
entries =
|
|
11880
|
+
entries = readdirSync2(dir, {
|
|
11966
11881
|
encoding: "utf-8",
|
|
11967
11882
|
withFileTypes: true
|
|
11968
11883
|
});
|
|
@@ -11971,13 +11886,13 @@ var ELYSIA_ROUTE_METHODS2, SKIP_DIRS3, SOURCE_EXTENSIONS3, getScriptKind2 = (fil
|
|
|
11971
11886
|
}
|
|
11972
11887
|
for (const entry of entries) {
|
|
11973
11888
|
if (entry.isDirectory()) {
|
|
11974
|
-
if (
|
|
11889
|
+
if (SKIP_DIRS2.has(entry.name))
|
|
11975
11890
|
continue;
|
|
11976
11891
|
if (entry.name.startsWith("."))
|
|
11977
11892
|
continue;
|
|
11978
|
-
stack.push(
|
|
11979
|
-
} else if (entry.isFile() &&
|
|
11980
|
-
out.push(
|
|
11893
|
+
stack.push(join25(dir, entry.name));
|
|
11894
|
+
} else if (entry.isFile() && hasSourceExtension2(entry.name)) {
|
|
11895
|
+
out.push(join25(dir, entry.name));
|
|
11981
11896
|
}
|
|
11982
11897
|
}
|
|
11983
11898
|
}
|
|
@@ -11990,17 +11905,17 @@ var ELYSIA_ROUTE_METHODS2, SKIP_DIRS3, SOURCE_EXTENSIONS3, getScriptKind2 = (fil
|
|
|
11990
11905
|
};
|
|
11991
11906
|
const resolveSource = (specifier) => {
|
|
11992
11907
|
if (specifier.startsWith(".")) {
|
|
11993
|
-
return
|
|
11908
|
+
return resolve20(fileDir, specifier);
|
|
11994
11909
|
}
|
|
11995
|
-
if (
|
|
11910
|
+
if (isAbsolute5(specifier)) {
|
|
11996
11911
|
return specifier;
|
|
11997
11912
|
}
|
|
11998
11913
|
return null;
|
|
11999
11914
|
};
|
|
12000
11915
|
for (const statement of sf.statements) {
|
|
12001
|
-
if (!
|
|
11916
|
+
if (!ts7.isImportDeclaration(statement))
|
|
12002
11917
|
continue;
|
|
12003
|
-
if (!
|
|
11918
|
+
if (!ts7.isStringLiteral(statement.moduleSpecifier))
|
|
12004
11919
|
continue;
|
|
12005
11920
|
if (statement.importClause?.isTypeOnly)
|
|
12006
11921
|
continue;
|
|
@@ -12021,7 +11936,7 @@ var ELYSIA_ROUTE_METHODS2, SKIP_DIRS3, SOURCE_EXTENSIONS3, getScriptKind2 = (fil
|
|
|
12021
11936
|
const bindings = clause.namedBindings;
|
|
12022
11937
|
if (!bindings)
|
|
12023
11938
|
continue;
|
|
12024
|
-
if (
|
|
11939
|
+
if (ts7.isNamespaceImport(bindings)) {
|
|
12025
11940
|
recordSpec(bindings.name.text, {
|
|
12026
11941
|
importedName: "*",
|
|
12027
11942
|
isDefault: false,
|
|
@@ -12049,38 +11964,38 @@ var ELYSIA_ROUTE_METHODS2, SKIP_DIRS3, SOURCE_EXTENSIONS3, getScriptKind2 = (fil
|
|
|
12049
11964
|
}, collectExpressionIdentifiers = (expr) => {
|
|
12050
11965
|
const out = new Set;
|
|
12051
11966
|
const visit = (node) => {
|
|
12052
|
-
if (
|
|
11967
|
+
if (ts7.isIdentifier(node)) {
|
|
12053
11968
|
out.add(node.text);
|
|
12054
11969
|
return;
|
|
12055
11970
|
}
|
|
12056
|
-
if (
|
|
11971
|
+
if (ts7.isPropertyAccessExpression(node)) {
|
|
12057
11972
|
visit(node.expression);
|
|
12058
11973
|
return;
|
|
12059
11974
|
}
|
|
12060
|
-
|
|
11975
|
+
ts7.forEachChild(node, visit);
|
|
12061
11976
|
};
|
|
12062
11977
|
visit(expr);
|
|
12063
11978
|
return out;
|
|
12064
11979
|
}, extractManifestKey = (pagePathValue) => {
|
|
12065
|
-
if (!
|
|
11980
|
+
if (!ts7.isCallExpression(pagePathValue))
|
|
12066
11981
|
return null;
|
|
12067
11982
|
const callee = pagePathValue.expression;
|
|
12068
|
-
if (!
|
|
11983
|
+
if (!ts7.isIdentifier(callee) || callee.text !== "asset")
|
|
12069
11984
|
return null;
|
|
12070
11985
|
const [, second] = pagePathValue.arguments;
|
|
12071
11986
|
if (!second)
|
|
12072
11987
|
return null;
|
|
12073
|
-
if (!
|
|
11988
|
+
if (!ts7.isStringLiteral(second))
|
|
12074
11989
|
return null;
|
|
12075
11990
|
return second.text;
|
|
12076
11991
|
}, findEnclosingMountPath = (node) => {
|
|
12077
11992
|
let cursor = node.parent;
|
|
12078
11993
|
while (cursor) {
|
|
12079
|
-
if (
|
|
11994
|
+
if (ts7.isCallExpression(cursor)) {
|
|
12080
11995
|
const callee = cursor.expression;
|
|
12081
|
-
if (
|
|
11996
|
+
if (ts7.isPropertyAccessExpression(callee) && ts7.isIdentifier(callee.name) && ELYSIA_ROUTE_METHODS2.has(callee.name.text)) {
|
|
12082
11997
|
const firstArg = cursor.arguments[0];
|
|
12083
|
-
if (firstArg &&
|
|
11998
|
+
if (firstArg && ts7.isStringLiteral(firstArg) && firstArg.text.startsWith("/")) {
|
|
12084
11999
|
return firstArg.text;
|
|
12085
12000
|
}
|
|
12086
12001
|
}
|
|
@@ -12091,37 +12006,37 @@ var ELYSIA_ROUTE_METHODS2, SKIP_DIRS3, SOURCE_EXTENSIONS3, getScriptKind2 = (fil
|
|
|
12091
12006
|
}, extractCallsFromFile = (filePath, out) => {
|
|
12092
12007
|
let source;
|
|
12093
12008
|
try {
|
|
12094
|
-
source =
|
|
12009
|
+
source = readFileSync13(filePath, "utf-8");
|
|
12095
12010
|
} catch {
|
|
12096
12011
|
return;
|
|
12097
12012
|
}
|
|
12098
12013
|
if (!fileMayContainAngularHandler(source))
|
|
12099
12014
|
return;
|
|
12100
|
-
const sf =
|
|
12015
|
+
const sf = ts7.createSourceFile(filePath, source, ts7.ScriptTarget.Latest, true, getScriptKind2(filePath));
|
|
12101
12016
|
const imports = collectFileImports(sf, filePath);
|
|
12102
12017
|
const visit = (node) => {
|
|
12103
|
-
if (
|
|
12018
|
+
if (ts7.isCallExpression(node) && ts7.isIdentifier(node.expression) && node.expression.text === "handleAngularPageRequest") {
|
|
12104
12019
|
const [arg] = node.arguments;
|
|
12105
|
-
if (arg &&
|
|
12020
|
+
if (arg && ts7.isObjectLiteralExpression(arg)) {
|
|
12106
12021
|
let manifestKey = null;
|
|
12107
12022
|
let providersExpr = null;
|
|
12108
12023
|
for (const prop of arg.properties) {
|
|
12109
|
-
if (
|
|
12024
|
+
if (ts7.isPropertyAssignment(prop)) {
|
|
12110
12025
|
if (!prop.name)
|
|
12111
12026
|
continue;
|
|
12112
|
-
const name =
|
|
12027
|
+
const name = ts7.isIdentifier(prop.name) ? prop.name.text : ts7.isStringLiteral(prop.name) ? prop.name.text : null;
|
|
12113
12028
|
if (name === "pagePath") {
|
|
12114
12029
|
manifestKey = extractManifestKey(prop.initializer);
|
|
12115
12030
|
} else if (name === "providers") {
|
|
12116
12031
|
providersExpr = prop.initializer;
|
|
12117
12032
|
}
|
|
12118
|
-
} else if (
|
|
12033
|
+
} else if (ts7.isSpreadAssignment(prop)) {
|
|
12119
12034
|
if (manifestKey)
|
|
12120
12035
|
continue;
|
|
12121
12036
|
const spreadExpr = prop.expression;
|
|
12122
|
-
if (
|
|
12037
|
+
if (ts7.isCallExpression(spreadExpr) && spreadExpr.arguments.length > 0) {
|
|
12123
12038
|
const [firstArg] = spreadExpr.arguments;
|
|
12124
|
-
if (firstArg &&
|
|
12039
|
+
if (firstArg && ts7.isStringLiteral(firstArg)) {
|
|
12125
12040
|
manifestKey = firstArg.text;
|
|
12126
12041
|
}
|
|
12127
12042
|
}
|
|
@@ -12149,9 +12064,9 @@ var ELYSIA_ROUTE_METHODS2, SKIP_DIRS3, SOURCE_EXTENSIONS3, getScriptKind2 = (fil
|
|
|
12149
12064
|
}
|
|
12150
12065
|
}
|
|
12151
12066
|
}
|
|
12152
|
-
|
|
12067
|
+
ts7.forEachChild(node, visit);
|
|
12153
12068
|
};
|
|
12154
|
-
|
|
12069
|
+
ts7.forEachChild(sf, visit);
|
|
12155
12070
|
}, scanAngularHandlerCalls = (projectRoot) => {
|
|
12156
12071
|
const files = collectSourceFiles2(projectRoot);
|
|
12157
12072
|
const collected = [];
|
|
@@ -12171,7 +12086,7 @@ var init_scanAngularHandlerCalls = __esm(() => {
|
|
|
12171
12086
|
"post",
|
|
12172
12087
|
"put"
|
|
12173
12088
|
]);
|
|
12174
|
-
|
|
12089
|
+
SKIP_DIRS2 = new Set([
|
|
12175
12090
|
".absolutejs",
|
|
12176
12091
|
".generated",
|
|
12177
12092
|
".git",
|
|
@@ -12183,7 +12098,108 @@ var init_scanAngularHandlerCalls = __esm(() => {
|
|
|
12183
12098
|
"dist",
|
|
12184
12099
|
"node_modules"
|
|
12185
12100
|
]);
|
|
12101
|
+
SOURCE_EXTENSIONS2 = new Set([".ts", ".tsx", ".mts", ".cts"]);
|
|
12102
|
+
});
|
|
12103
|
+
|
|
12104
|
+
// src/build/scanAngularPageRoutes.ts
|
|
12105
|
+
import { readdirSync as readdirSync3, readFileSync as readFileSync14 } from "fs";
|
|
12106
|
+
import { basename as basename5, join as join26 } from "path";
|
|
12107
|
+
import ts8 from "typescript";
|
|
12108
|
+
var SOURCE_EXTENSIONS3, SKIP_DIRS3, hasSourceExtension3 = (filePath) => {
|
|
12109
|
+
const idx = filePath.lastIndexOf(".");
|
|
12110
|
+
if (idx === -1)
|
|
12111
|
+
return false;
|
|
12112
|
+
return SOURCE_EXTENSIONS3.has(filePath.slice(idx));
|
|
12113
|
+
}, isPageFile = (filePath) => {
|
|
12114
|
+
if (!hasSourceExtension3(filePath))
|
|
12115
|
+
return false;
|
|
12116
|
+
const base = basename5(filePath);
|
|
12117
|
+
if (base.endsWith(".d.ts"))
|
|
12118
|
+
return false;
|
|
12119
|
+
if (base.endsWith(".test.ts"))
|
|
12120
|
+
return false;
|
|
12121
|
+
if (base.endsWith(".spec.ts"))
|
|
12122
|
+
return false;
|
|
12123
|
+
return true;
|
|
12124
|
+
}, collectPageFiles = (pagesRoot) => {
|
|
12125
|
+
const out = [];
|
|
12126
|
+
const stack = [pagesRoot];
|
|
12127
|
+
while (stack.length > 0) {
|
|
12128
|
+
const dir = stack.pop();
|
|
12129
|
+
if (!dir)
|
|
12130
|
+
continue;
|
|
12131
|
+
let entries;
|
|
12132
|
+
try {
|
|
12133
|
+
entries = readdirSync3(dir, {
|
|
12134
|
+
encoding: "utf-8",
|
|
12135
|
+
withFileTypes: true
|
|
12136
|
+
});
|
|
12137
|
+
} catch {
|
|
12138
|
+
continue;
|
|
12139
|
+
}
|
|
12140
|
+
for (const entry of entries) {
|
|
12141
|
+
if (entry.isDirectory()) {
|
|
12142
|
+
if (SKIP_DIRS3.has(entry.name))
|
|
12143
|
+
continue;
|
|
12144
|
+
if (entry.name.startsWith("."))
|
|
12145
|
+
continue;
|
|
12146
|
+
stack.push(join26(dir, entry.name));
|
|
12147
|
+
} else if (entry.isFile() && isPageFile(entry.name)) {
|
|
12148
|
+
out.push(join26(dir, entry.name));
|
|
12149
|
+
}
|
|
12150
|
+
}
|
|
12151
|
+
}
|
|
12152
|
+
return out;
|
|
12153
|
+
}, hasTopLevelRoutesExport = (source, filePath) => {
|
|
12154
|
+
if (!source.includes("routes"))
|
|
12155
|
+
return false;
|
|
12156
|
+
const sf = ts8.createSourceFile(filePath, source, ts8.ScriptTarget.Latest, true, ts8.ScriptKind.TS);
|
|
12157
|
+
for (const statement of sf.statements) {
|
|
12158
|
+
if (!ts8.isVariableStatement(statement))
|
|
12159
|
+
continue;
|
|
12160
|
+
const isExported = statement.modifiers?.some((modifier) => modifier.kind === ts8.SyntaxKind.ExportKeyword);
|
|
12161
|
+
if (!isExported)
|
|
12162
|
+
continue;
|
|
12163
|
+
for (const declaration of statement.declarationList.declarations) {
|
|
12164
|
+
if (!ts8.isIdentifier(declaration.name))
|
|
12165
|
+
continue;
|
|
12166
|
+
if (declaration.name.text === "routes")
|
|
12167
|
+
return true;
|
|
12168
|
+
}
|
|
12169
|
+
}
|
|
12170
|
+
return false;
|
|
12171
|
+
}, scanAngularPageRoutes = (pagesRoot) => {
|
|
12172
|
+
const files = collectPageFiles(pagesRoot);
|
|
12173
|
+
const out = [];
|
|
12174
|
+
for (const file of files) {
|
|
12175
|
+
let source;
|
|
12176
|
+
try {
|
|
12177
|
+
source = readFileSync14(file, "utf-8");
|
|
12178
|
+
} catch {
|
|
12179
|
+
continue;
|
|
12180
|
+
}
|
|
12181
|
+
const hasRoutes = hasTopLevelRoutesExport(source, file);
|
|
12182
|
+
const base = basename5(file).replace(/\.[cm]?[tj]sx?$/, "");
|
|
12183
|
+
const manifestKey = toPascal(base);
|
|
12184
|
+
out.push({
|
|
12185
|
+
hasRoutes,
|
|
12186
|
+
manifestKey,
|
|
12187
|
+
pageFile: file
|
|
12188
|
+
});
|
|
12189
|
+
}
|
|
12190
|
+
return out;
|
|
12191
|
+
};
|
|
12192
|
+
var init_scanAngularPageRoutes = __esm(() => {
|
|
12186
12193
|
SOURCE_EXTENSIONS3 = new Set([".ts", ".tsx", ".mts", ".cts"]);
|
|
12194
|
+
SKIP_DIRS3 = new Set([
|
|
12195
|
+
".absolutejs",
|
|
12196
|
+
".generated",
|
|
12197
|
+
".git",
|
|
12198
|
+
"build",
|
|
12199
|
+
"compiled",
|
|
12200
|
+
"dist",
|
|
12201
|
+
"node_modules"
|
|
12202
|
+
]);
|
|
12187
12203
|
});
|
|
12188
12204
|
|
|
12189
12205
|
// src/build/runAngularHandlerScan.ts
|
|
@@ -12195,7 +12211,7 @@ var runAngularHandlerScan = (projectRoot, angularDirectory) => {
|
|
|
12195
12211
|
const calls = scanAngularHandlerCalls(projectRoot);
|
|
12196
12212
|
const pageRoutes = scanAngularPageRoutes(angularDirectory);
|
|
12197
12213
|
const providersImport = parseAngularProvidersImport(projectRoot);
|
|
12198
|
-
const providersFiles = emitAngularProvidersFiles(projectRoot, calls, pageRoutes, { providersImport });
|
|
12214
|
+
const providersFiles = emitAngularProvidersFiles(projectRoot, angularDirectory, calls, pageRoutes, { providersImport });
|
|
12199
12215
|
emitAngularRouteMounts(projectRoot, calls);
|
|
12200
12216
|
return {
|
|
12201
12217
|
calls,
|
|
@@ -12358,22 +12374,22 @@ import {
|
|
|
12358
12374
|
join as join27,
|
|
12359
12375
|
basename as basename6,
|
|
12360
12376
|
extname as extname5,
|
|
12361
|
-
resolve as
|
|
12362
|
-
relative as
|
|
12377
|
+
resolve as resolve21,
|
|
12378
|
+
relative as relative10,
|
|
12363
12379
|
sep as sep2
|
|
12364
12380
|
} from "path";
|
|
12365
12381
|
import { env } from "process";
|
|
12366
12382
|
var {write: write2, file, Transpiler: Transpiler2 } = globalThis.Bun;
|
|
12367
12383
|
var resolveDevClientDir2 = () => {
|
|
12368
12384
|
const projectRoot = process.cwd();
|
|
12369
|
-
const fromSource =
|
|
12385
|
+
const fromSource = resolve21(import.meta.dir, "../dev/client");
|
|
12370
12386
|
if (existsSync20(fromSource) && fromSource.startsWith(projectRoot)) {
|
|
12371
12387
|
return fromSource;
|
|
12372
12388
|
}
|
|
12373
|
-
const fromNodeModules =
|
|
12389
|
+
const fromNodeModules = resolve21(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client");
|
|
12374
12390
|
if (existsSync20(fromNodeModules))
|
|
12375
12391
|
return fromNodeModules;
|
|
12376
|
-
return
|
|
12392
|
+
return resolve21(import.meta.dir, "./dev/client");
|
|
12377
12393
|
}, devClientDir2, hmrClientPath3, persistentCache, sourceHashCache, clearSvelteCompilerCache = () => {
|
|
12378
12394
|
persistentCache.clear();
|
|
12379
12395
|
sourceHashCache.clear();
|
|
@@ -12403,7 +12419,7 @@ var resolveDevClientDir2 = () => {
|
|
|
12403
12419
|
}, resolveRelativeModule2 = async (spec, from) => {
|
|
12404
12420
|
if (!spec.startsWith("."))
|
|
12405
12421
|
return null;
|
|
12406
|
-
const basePath =
|
|
12422
|
+
const basePath = resolve21(dirname14(from), spec);
|
|
12407
12423
|
const candidates = [
|
|
12408
12424
|
basePath,
|
|
12409
12425
|
`${basePath}.ts`,
|
|
@@ -12430,7 +12446,7 @@ var resolveDevClientDir2 = () => {
|
|
|
12430
12446
|
const resolved = resolvePackageImport(spec);
|
|
12431
12447
|
return resolved && /\.svelte(\.(?:ts|js))?$/.test(resolved) ? resolved : null;
|
|
12432
12448
|
}
|
|
12433
|
-
const basePath =
|
|
12449
|
+
const basePath = resolve21(dirname14(from), spec);
|
|
12434
12450
|
const explicit = /\.(svelte|svelte\.(?:ts|js))$/.test(basePath);
|
|
12435
12451
|
if (!explicit) {
|
|
12436
12452
|
const extensions = [".svelte", ".svelte.ts", ".svelte.js"];
|
|
@@ -12451,8 +12467,8 @@ var resolveDevClientDir2 = () => {
|
|
|
12451
12467
|
return jsPath;
|
|
12452
12468
|
return null;
|
|
12453
12469
|
}, addModuleRewrite = (rewrites, rawSpec, resolvedModule, ssrOutputDir, clientOutputDir) => {
|
|
12454
|
-
const toServer =
|
|
12455
|
-
const toClient =
|
|
12470
|
+
const toServer = relative10(ssrOutputDir, resolvedModule).replace(/\\/g, "/");
|
|
12471
|
+
const toClient = relative10(clientOutputDir, resolvedModule).replace(/\\/g, "/");
|
|
12456
12472
|
rewrites.set(rawSpec, {
|
|
12457
12473
|
client: toClient.startsWith(".") || toClient.startsWith("/") ? toClient : `./${toClient}`,
|
|
12458
12474
|
server: toServer.startsWith(".") ? toServer : `./${toServer}`
|
|
@@ -12490,8 +12506,8 @@ var resolveDevClientDir2 = () => {
|
|
|
12490
12506
|
const preprocessedClient = isModule ? loweredClientSource.code : (await preprocess(loweredClientSource.code, svelteStylePreprocessor)).code;
|
|
12491
12507
|
const transpiledServer = src.endsWith(".ts") || src.endsWith(".svelte.ts") ? transpiler3.transformSync(preprocessedServer) : preprocessedServer;
|
|
12492
12508
|
const transpiledClient = src.endsWith(".ts") || src.endsWith(".svelte.ts") ? transpiler3.transformSync(preprocessedClient) : preprocessedClient;
|
|
12493
|
-
const rawRel = dirname14(
|
|
12494
|
-
const relDir = rawRel.startsWith("..") ? `_ext/${
|
|
12509
|
+
const rawRel = dirname14(relative10(svelteRoot, src)).replace(/\\/g, "/");
|
|
12510
|
+
const relDir = rawRel.startsWith("..") ? `_ext/${relative10(process.cwd(), dirname14(src)).replace(/\\/g, "/")}` : rawRel;
|
|
12495
12511
|
const baseName = basename6(src).replace(/\.svelte(\.(ts|js))?$/, "");
|
|
12496
12512
|
const importPaths = Array.from(transpiledServer.matchAll(/from\s+['"]([^'"]+)['"]/g)).map((match) => match[1]).filter((path) => path !== undefined);
|
|
12497
12513
|
const resolvedModuleImports = await Promise.all(importPaths.map((importPath) => resolveRelativeModule2(importPath, src)));
|
|
@@ -12512,15 +12528,15 @@ var resolveDevClientDir2 = () => {
|
|
|
12512
12528
|
addModuleRewrite(externalRewrites, rawSpec, resolvedModule, ssrOutputDir, clientOutputDir);
|
|
12513
12529
|
if (!resolved)
|
|
12514
12530
|
continue;
|
|
12515
|
-
const childRel =
|
|
12531
|
+
const childRel = relative10(svelteRoot, resolved).replace(/\\/g, "/");
|
|
12516
12532
|
if (!childRel.startsWith(".."))
|
|
12517
12533
|
continue;
|
|
12518
12534
|
const childBuilt2 = cache.get(resolved);
|
|
12519
12535
|
if (!childBuilt2)
|
|
12520
12536
|
continue;
|
|
12521
12537
|
const origSpec = rawSpec.replace(/\.svelte(?:\.(?:ts|js))?$/, ".js");
|
|
12522
|
-
const toServer =
|
|
12523
|
-
const toClient =
|
|
12538
|
+
const toServer = relative10(ssrOutputDir, childBuilt2.ssr).replace(/\\/g, "/");
|
|
12539
|
+
const toClient = relative10(clientOutputDir, childBuilt2.client).replace(/\\/g, "/");
|
|
12524
12540
|
externalRewrites.set(origSpec, {
|
|
12525
12541
|
client: toClient.startsWith(".") ? toClient : `./${toClient}`,
|
|
12526
12542
|
server: toServer.startsWith(".") ? toServer : `./${toServer}`
|
|
@@ -12554,7 +12570,7 @@ var resolveDevClientDir2 = () => {
|
|
|
12554
12570
|
}).js;
|
|
12555
12571
|
let code = compiledJs.code.replace(/\.svelte(?:\.(?:ts|js))?(['"])/g, ".js$1");
|
|
12556
12572
|
if (mode === "client" && isDev) {
|
|
12557
|
-
const moduleKey = `/@src/${
|
|
12573
|
+
const moduleKey = `/@src/${relative10(process.cwd(), src).replace(/\\/g, "/")}`;
|
|
12558
12574
|
code = code.replace(/if\s*\(import\.meta\.hot\)\s*\{/, `if (typeof window !== "undefined") {
|
|
12559
12575
|
if (!window.__SVELTE_HMR_ACCEPT__) window.__SVELTE_HMR_ACCEPT__ = {};
|
|
12560
12576
|
var __hmr_accept = function(cb) { window.__SVELTE_HMR_ACCEPT__[${JSON.stringify(moduleKey)}] = cb; };`);
|
|
@@ -12603,10 +12619,10 @@ var resolveDevClientDir2 = () => {
|
|
|
12603
12619
|
};
|
|
12604
12620
|
const roots = await Promise.all(entryPoints.map(build));
|
|
12605
12621
|
await Promise.all(roots.map(async ({ client, hasAwaitSlot }) => {
|
|
12606
|
-
const relClientDir = dirname14(
|
|
12622
|
+
const relClientDir = dirname14(relative10(clientDir, client));
|
|
12607
12623
|
const name = basename6(client, extname5(client));
|
|
12608
12624
|
const indexPath = join27(indexDir, relClientDir, `${name}.js`);
|
|
12609
|
-
const importRaw =
|
|
12625
|
+
const importRaw = relative10(dirname14(indexPath), client).split(sep2).join("/");
|
|
12610
12626
|
const importPath = importRaw.startsWith(".") || importRaw.startsWith("/") ? importRaw : `./${importRaw}`;
|
|
12611
12627
|
const hmrImports = isDev ? `window.__HMR_FRAMEWORK__ = "svelte";
|
|
12612
12628
|
import "${hmrClientPath3}";
|
|
@@ -12683,7 +12699,7 @@ if (typeof window !== "undefined") {
|
|
|
12683
12699
|
return {
|
|
12684
12700
|
svelteClientPaths: roots.map(({ client }) => client),
|
|
12685
12701
|
svelteIndexPaths: roots.map(({ client }) => {
|
|
12686
|
-
const rel = dirname14(
|
|
12702
|
+
const rel = dirname14(relative10(clientDir, client));
|
|
12687
12703
|
return join27(indexDir, rel, basename6(client));
|
|
12688
12704
|
}),
|
|
12689
12705
|
svelteServerPaths: roots.map(({ ssr }) => ssr)
|
|
@@ -13096,22 +13112,22 @@ import { mkdir as mkdir5 } from "fs/promises";
|
|
|
13096
13112
|
import {
|
|
13097
13113
|
basename as basename7,
|
|
13098
13114
|
dirname as dirname15,
|
|
13099
|
-
isAbsolute as
|
|
13115
|
+
isAbsolute as isAbsolute6,
|
|
13100
13116
|
join as join28,
|
|
13101
|
-
relative as
|
|
13102
|
-
resolve as
|
|
13117
|
+
relative as relative11,
|
|
13118
|
+
resolve as resolve22
|
|
13103
13119
|
} from "path";
|
|
13104
13120
|
var {file: file2, write: write3, Transpiler: Transpiler3 } = globalThis.Bun;
|
|
13105
13121
|
var resolveDevClientDir3 = () => {
|
|
13106
13122
|
const projectRoot = process.cwd();
|
|
13107
|
-
const fromSource =
|
|
13123
|
+
const fromSource = resolve22(import.meta.dir, "../dev/client");
|
|
13108
13124
|
if (existsSync21(fromSource) && fromSource.startsWith(projectRoot)) {
|
|
13109
13125
|
return fromSource;
|
|
13110
13126
|
}
|
|
13111
|
-
const fromNodeModules =
|
|
13127
|
+
const fromNodeModules = resolve22(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client");
|
|
13112
13128
|
if (existsSync21(fromNodeModules))
|
|
13113
13129
|
return fromNodeModules;
|
|
13114
|
-
return
|
|
13130
|
+
return resolve22(import.meta.dir, "./dev/client");
|
|
13115
13131
|
}, devClientDir3, hmrClientPath4, transpiler4, scriptCache, scriptSetupCache, templateCache, styleCache, persistentBuildCache, vueSourceHashCache, vueHmrMetadata, clearVueHmrCaches = () => {
|
|
13116
13132
|
scriptCache.clear();
|
|
13117
13133
|
scriptSetupCache.clear();
|
|
@@ -13150,14 +13166,14 @@ var resolveDevClientDir3 = () => {
|
|
|
13150
13166
|
return "template-only";
|
|
13151
13167
|
}
|
|
13152
13168
|
return "full";
|
|
13153
|
-
}, generateVueHmrId = (sourceFilePath, vueRootDir) =>
|
|
13169
|
+
}, generateVueHmrId = (sourceFilePath, vueRootDir) => relative11(vueRootDir, sourceFilePath).replace(/\\/g, "/").replace(/\.vue$/, ""), extractImports = (sourceCode) => Array.from(sourceCode.matchAll(/import\s+[\s\S]+?['"]([^'"]+)['"]/g)).map((match) => match[1]).filter((importPath) => importPath !== undefined), toJs = (filePath, sourceDir) => {
|
|
13154
13170
|
if (filePath.endsWith(".vue"))
|
|
13155
13171
|
return filePath.replace(/\.vue$/, ".js");
|
|
13156
13172
|
if (filePath.endsWith(".ts"))
|
|
13157
13173
|
return filePath.replace(/\.ts$/, ".js");
|
|
13158
13174
|
if (isStylePath(filePath)) {
|
|
13159
13175
|
if (sourceDir && (filePath.startsWith("./") || filePath.startsWith("../"))) {
|
|
13160
|
-
return
|
|
13176
|
+
return resolve22(sourceDir, filePath);
|
|
13161
13177
|
}
|
|
13162
13178
|
return filePath;
|
|
13163
13179
|
}
|
|
@@ -13183,7 +13199,7 @@ var resolveDevClientDir3 = () => {
|
|
|
13183
13199
|
const cachedResult = cacheMap.get(sourceFilePath);
|
|
13184
13200
|
if (cachedResult)
|
|
13185
13201
|
return cachedResult;
|
|
13186
|
-
const relativeFilePath =
|
|
13202
|
+
const relativeFilePath = relative11(vueRootDir, sourceFilePath).replace(/\\/g, "/");
|
|
13187
13203
|
const relativeWithoutExtension = relativeFilePath.replace(/\.vue$/, "");
|
|
13188
13204
|
const fileBaseName = basename7(sourceFilePath, ".vue");
|
|
13189
13205
|
const componentId = toKebab(fileBaseName);
|
|
@@ -13221,12 +13237,12 @@ var resolveDevClientDir3 = () => {
|
|
|
13221
13237
|
const childComponentPaths = importPaths.filter((path) => path.startsWith(".") && path.endsWith(".vue"));
|
|
13222
13238
|
const packageComponentPaths = Array.from(resolvedPackageVueImports.entries());
|
|
13223
13239
|
const helperModulePaths = importPaths.filter((path) => path.startsWith(".") && !path.endsWith(".vue") && !isStylePath(path));
|
|
13224
|
-
const stylePathsImported = importPaths.filter((path) => (path.startsWith(".") ||
|
|
13240
|
+
const stylePathsImported = importPaths.filter((path) => (path.startsWith(".") || isAbsolute6(path)) && isStylePath(path)).map((path) => isAbsolute6(path) ? path : resolve22(dirname15(sourceFilePath), path));
|
|
13225
13241
|
for (const stylePath of stylePathsImported) {
|
|
13226
13242
|
addStyleImporter(sourceFilePath, stylePath);
|
|
13227
13243
|
}
|
|
13228
13244
|
const childBuildResults = await Promise.all([
|
|
13229
|
-
...childComponentPaths.map((relativeChildPath) => compileVueFile(
|
|
13245
|
+
...childComponentPaths.map((relativeChildPath) => compileVueFile(resolve22(dirname15(sourceFilePath), relativeChildPath), outputDirs, cacheMap, false, vueRootDir, compiler, stylePreprocessors)),
|
|
13230
13246
|
...packageComponentPaths.map(([, absolutePath]) => compileVueFile(absolutePath, outputDirs, cacheMap, false, vueRootDir, compiler, stylePreprocessors))
|
|
13231
13247
|
]);
|
|
13232
13248
|
const hasScript = descriptor.script || descriptor.scriptSetup;
|
|
@@ -13320,7 +13336,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
13320
13336
|
let result2 = code;
|
|
13321
13337
|
for (const [bareImport, paths] of packageImportRewrites) {
|
|
13322
13338
|
const targetPath = mode === "server" ? paths.server : paths.client;
|
|
13323
|
-
let rel =
|
|
13339
|
+
let rel = relative11(dirname15(outputPath), targetPath).replace(/\\/g, "/");
|
|
13324
13340
|
if (!rel.startsWith("."))
|
|
13325
13341
|
rel = `./${rel}`;
|
|
13326
13342
|
result2 = result2.replaceAll(bareImport, rel);
|
|
@@ -13350,7 +13366,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
13350
13366
|
hmrId,
|
|
13351
13367
|
serverPath: serverOutputPath,
|
|
13352
13368
|
tsHelperPaths: [
|
|
13353
|
-
...helperModulePaths.map((helper) =>
|
|
13369
|
+
...helperModulePaths.map((helper) => resolve22(dirname15(sourceFilePath), helper.endsWith(".ts") ? helper : `${helper}.ts`)),
|
|
13354
13370
|
...childBuildResults.flatMap((child) => child.tsHelperPaths)
|
|
13355
13371
|
]
|
|
13356
13372
|
};
|
|
@@ -13373,7 +13389,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
13373
13389
|
const buildCache = new Map;
|
|
13374
13390
|
const allTsHelperPaths = new Set;
|
|
13375
13391
|
const compiledPages = await Promise.all(entryPoints.map(async (entryPath) => {
|
|
13376
|
-
const result = await compileVueFile(
|
|
13392
|
+
const result = await compileVueFile(resolve22(entryPath), {
|
|
13377
13393
|
client: clientOutputDir,
|
|
13378
13394
|
css: cssOutputDir,
|
|
13379
13395
|
server: serverOutputDir
|
|
@@ -13381,7 +13397,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
13381
13397
|
result.tsHelperPaths.forEach((path) => allTsHelperPaths.add(path));
|
|
13382
13398
|
const entryBaseName = basename7(entryPath, ".vue");
|
|
13383
13399
|
const indexOutputFile = join28(indexOutputDir, `${entryBaseName}.js`);
|
|
13384
|
-
const clientOutputFile = join28(clientOutputDir,
|
|
13400
|
+
const clientOutputFile = join28(clientOutputDir, relative11(vueRootDir, entryPath).replace(/\\/g, "/").replace(/\.vue$/, ".js"));
|
|
13385
13401
|
await mkdir5(dirname15(indexOutputFile), { recursive: true });
|
|
13386
13402
|
const vueHmrImports = isDev ? [
|
|
13387
13403
|
`window.__HMR_FRAMEWORK__ = "vue";`,
|
|
@@ -13389,7 +13405,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
13389
13405
|
] : [];
|
|
13390
13406
|
await write3(indexOutputFile, [
|
|
13391
13407
|
...vueHmrImports,
|
|
13392
|
-
`import Comp, * as PageModule from "${
|
|
13408
|
+
`import Comp, * as PageModule from "${relative11(dirname15(indexOutputFile), clientOutputFile).replace(/\\/g, "/")}";`,
|
|
13393
13409
|
'import { createSSRApp, createApp } from "vue";',
|
|
13394
13410
|
"",
|
|
13395
13411
|
"// HMR State Preservation: Check for preserved state from HMR",
|
|
@@ -13533,7 +13549,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
13533
13549
|
await Promise.all(Array.from(allTsHelperPaths).map(async (tsPath) => {
|
|
13534
13550
|
const sourceCode = await file2(tsPath).text();
|
|
13535
13551
|
const transpiledCode = transpiler4.transformSync(sourceCode);
|
|
13536
|
-
const relativeJsPath =
|
|
13552
|
+
const relativeJsPath = relative11(vueRootDir, tsPath).replace(/\.ts$/, ".js");
|
|
13537
13553
|
const outClientPath = join28(clientOutputDir, relativeJsPath);
|
|
13538
13554
|
const outServerPath = join28(serverOutputDir, relativeJsPath);
|
|
13539
13555
|
await mkdir5(dirname15(outClientPath), { recursive: true });
|
|
@@ -14040,7 +14056,7 @@ __export(exports_compileAngular, {
|
|
|
14040
14056
|
compileAngular: () => compileAngular
|
|
14041
14057
|
});
|
|
14042
14058
|
import { existsSync as existsSync22, readFileSync as readFileSync16, promises as fs5 } from "fs";
|
|
14043
|
-
import { join as join29, basename as basename8, sep as sep3, dirname as dirname16, resolve as
|
|
14059
|
+
import { join as join29, basename as basename8, sep as sep3, dirname as dirname16, resolve as resolve23, relative as relative12 } from "path";
|
|
14044
14060
|
var {Glob: Glob6 } = globalThis.Bun;
|
|
14045
14061
|
import ts9 from "typescript";
|
|
14046
14062
|
var traceAngularPhase = async (name, fn2, metadata) => {
|
|
@@ -14048,10 +14064,10 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
14048
14064
|
return tracePhase ? tracePhase(`compile/angular/${name}`, fn2, metadata) : await fn2();
|
|
14049
14065
|
}, readTsconfigPathAliases = () => {
|
|
14050
14066
|
try {
|
|
14051
|
-
const configPath2 =
|
|
14067
|
+
const configPath2 = resolve23(process.cwd(), "tsconfig.json");
|
|
14052
14068
|
const config = ts9.readConfigFile(configPath2, ts9.sys.readFile).config;
|
|
14053
14069
|
const compilerOptions = config?.compilerOptions ?? {};
|
|
14054
|
-
const baseUrl =
|
|
14070
|
+
const baseUrl = resolve23(process.cwd(), compilerOptions.baseUrl ?? ".");
|
|
14055
14071
|
const aliases = Object.entries(compilerOptions.paths ?? {}).map(([pattern, replacements]) => ({ pattern, replacements }));
|
|
14056
14072
|
return { aliases, baseUrl };
|
|
14057
14073
|
} catch {
|
|
@@ -14071,7 +14087,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
14071
14087
|
const wildcardValue = exactMatch ? "" : specifier.slice(prefix.length, specifier.length - suffix.length);
|
|
14072
14088
|
for (const replacement of alias.replacements) {
|
|
14073
14089
|
const candidate = replacement.replace("*", wildcardValue);
|
|
14074
|
-
const resolved = resolveSourceFile(
|
|
14090
|
+
const resolved = resolveSourceFile(resolve23(baseUrl, candidate));
|
|
14075
14091
|
if (resolved)
|
|
14076
14092
|
return resolved;
|
|
14077
14093
|
}
|
|
@@ -14090,13 +14106,13 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
14090
14106
|
];
|
|
14091
14107
|
return candidates.find((file3) => existsSync22(file3));
|
|
14092
14108
|
}, createLegacyAngularAnimationUsageResolver = (rootDir) => {
|
|
14093
|
-
const baseDir =
|
|
14109
|
+
const baseDir = resolve23(rootDir);
|
|
14094
14110
|
const tsconfigAliases = readTsconfigPathAliases();
|
|
14095
14111
|
const transpiler5 = new Bun.Transpiler({ loader: "tsx" });
|
|
14096
14112
|
const scanCache = new Map;
|
|
14097
14113
|
const resolveLocalImport = (specifier, fromDir) => {
|
|
14098
14114
|
if (specifier.startsWith(".") || specifier.startsWith("/")) {
|
|
14099
|
-
return resolveSourceFile(
|
|
14115
|
+
return resolveSourceFile(resolve23(fromDir, specifier));
|
|
14100
14116
|
}
|
|
14101
14117
|
const aliased = matchTsconfigAlias(specifier, tsconfigAliases.aliases, tsconfigAliases.baseUrl, resolveSourceFile);
|
|
14102
14118
|
if (aliased)
|
|
@@ -14105,7 +14121,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
14105
14121
|
const resolved = Bun.resolveSync(specifier, fromDir);
|
|
14106
14122
|
if (resolved.includes("/node_modules/"))
|
|
14107
14123
|
return;
|
|
14108
|
-
const absolute =
|
|
14124
|
+
const absolute = resolve23(resolved);
|
|
14109
14125
|
if (!absolute.startsWith(baseDir))
|
|
14110
14126
|
return;
|
|
14111
14127
|
return resolveSourceFile(absolute);
|
|
@@ -14121,7 +14137,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
14121
14137
|
usesLegacyAnimations: false
|
|
14122
14138
|
});
|
|
14123
14139
|
}
|
|
14124
|
-
const resolved =
|
|
14140
|
+
const resolved = resolve23(actualPath);
|
|
14125
14141
|
const cached = scanCache.get(resolved);
|
|
14126
14142
|
if (cached)
|
|
14127
14143
|
return cached;
|
|
@@ -14150,7 +14166,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
14150
14166
|
const actualPath = resolveSourceFile(filePath);
|
|
14151
14167
|
if (!actualPath)
|
|
14152
14168
|
return false;
|
|
14153
|
-
const resolved =
|
|
14169
|
+
const resolved = resolve23(actualPath);
|
|
14154
14170
|
if (visited.has(resolved))
|
|
14155
14171
|
return false;
|
|
14156
14172
|
visited.add(resolved);
|
|
@@ -14168,14 +14184,14 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
14168
14184
|
return (entryPath) => visit(entryPath);
|
|
14169
14185
|
}, resolveDevClientDir4 = () => {
|
|
14170
14186
|
const projectRoot = process.cwd();
|
|
14171
|
-
const fromSource =
|
|
14187
|
+
const fromSource = resolve23(import.meta.dir, "../dev/client");
|
|
14172
14188
|
if (existsSync22(fromSource) && fromSource.startsWith(projectRoot)) {
|
|
14173
14189
|
return fromSource;
|
|
14174
14190
|
}
|
|
14175
|
-
const fromNodeModules =
|
|
14191
|
+
const fromNodeModules = resolve23(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client");
|
|
14176
14192
|
if (existsSync22(fromNodeModules))
|
|
14177
14193
|
return fromNodeModules;
|
|
14178
|
-
return
|
|
14194
|
+
return resolve23(import.meta.dir, "./dev/client");
|
|
14179
14195
|
}, devClientDir4, hmrClientPath5, formatDiagnosticMessage = (diagnostic) => {
|
|
14180
14196
|
try {
|
|
14181
14197
|
return ts9.flattenDiagnosticMessageText(diagnostic.messageText, `
|
|
@@ -14218,11 +14234,11 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
14218
14234
|
if (hasJsLikeExtension(path))
|
|
14219
14235
|
return `${path}${query}`;
|
|
14220
14236
|
const importerDir = dirname16(importerOutputPath);
|
|
14221
|
-
const fileCandidate =
|
|
14237
|
+
const fileCandidate = resolve23(importerDir, `${path}.js`);
|
|
14222
14238
|
if (outputFiles?.has(fileCandidate) || existsSync22(fileCandidate)) {
|
|
14223
14239
|
return `${path}.js${query}`;
|
|
14224
14240
|
}
|
|
14225
|
-
const indexCandidate =
|
|
14241
|
+
const indexCandidate = resolve23(importerDir, path, "index.js");
|
|
14226
14242
|
if (outputFiles?.has(indexCandidate) || existsSync22(indexCandidate)) {
|
|
14227
14243
|
return `${path}/index.js${query}`;
|
|
14228
14244
|
}
|
|
@@ -14250,7 +14266,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
14250
14266
|
}, resolveLocalTsImport = (fromFile, specifier) => {
|
|
14251
14267
|
if (!isRelativeModuleSpecifier(specifier))
|
|
14252
14268
|
return null;
|
|
14253
|
-
const basePath =
|
|
14269
|
+
const basePath = resolve23(dirname16(fromFile), specifier);
|
|
14254
14270
|
const candidates = /\.[cm]?[tj]sx?$/.test(basePath) ? [basePath] : [
|
|
14255
14271
|
`${basePath}.ts`,
|
|
14256
14272
|
`${basePath}.tsx`,
|
|
@@ -14261,7 +14277,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
14261
14277
|
join29(basePath, "index.mts"),
|
|
14262
14278
|
join29(basePath, "index.cts")
|
|
14263
14279
|
];
|
|
14264
|
-
return candidates.map((candidate) =>
|
|
14280
|
+
return candidates.map((candidate) => resolve23(candidate)).find((candidate) => existsSync22(candidate) && !candidate.endsWith(".d.ts")) ?? null;
|
|
14265
14281
|
}, readFileForAotTransform = async (fileName, readFile6) => {
|
|
14266
14282
|
const hostSource = readFile6?.(fileName);
|
|
14267
14283
|
if (typeof hostSource === "string")
|
|
@@ -14296,7 +14312,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
14296
14312
|
paths.push(join29(fileDir, urlMatch.replace(/['"]/g, "")));
|
|
14297
14313
|
}
|
|
14298
14314
|
}
|
|
14299
|
-
return paths.map((path) =>
|
|
14315
|
+
return paths.map((path) => resolve23(path));
|
|
14300
14316
|
}, readResourceCacheFile = async (cachePath) => {
|
|
14301
14317
|
try {
|
|
14302
14318
|
const entry = JSON.parse(await fs5.readFile(cachePath, "utf-8"));
|
|
@@ -14338,7 +14354,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
14338
14354
|
transformedFiles: 0
|
|
14339
14355
|
};
|
|
14340
14356
|
const transformFile = async (filePath) => {
|
|
14341
|
-
const resolvedPath =
|
|
14357
|
+
const resolvedPath = resolve23(filePath);
|
|
14342
14358
|
if (visited.has(resolvedPath))
|
|
14343
14359
|
return;
|
|
14344
14360
|
visited.add(resolvedPath);
|
|
@@ -14373,7 +14389,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
14373
14389
|
return { stats, transformedSources };
|
|
14374
14390
|
}, compileAngularFiles = async (inputPaths, outDir, stylePreprocessors) => {
|
|
14375
14391
|
const islandMetadataByOutputPath = await traceAngularPhase("aot/island-metadata", () => new Map(inputPaths.map((inputPath) => {
|
|
14376
|
-
const outputPath =
|
|
14392
|
+
const outputPath = resolve23(join29(outDir, relative12(process.cwd(), resolve23(inputPath)).replace(/\.[cm]?[tj]sx?$/, ".js")));
|
|
14377
14393
|
return [
|
|
14378
14394
|
outputPath,
|
|
14379
14395
|
buildIslandMetadataExports(readFileSync16(inputPath, "utf-8"))
|
|
@@ -14384,7 +14400,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
14384
14400
|
const tsLibDir = await traceAngularPhase("aot/resolve-typescript-lib", () => {
|
|
14385
14401
|
const tsPath = __require.resolve("typescript");
|
|
14386
14402
|
const tsRootDir = dirname16(tsPath);
|
|
14387
|
-
return tsRootDir.endsWith("lib") ? tsRootDir :
|
|
14403
|
+
return tsRootDir.endsWith("lib") ? tsRootDir : resolve23(tsRootDir, "lib");
|
|
14388
14404
|
});
|
|
14389
14405
|
const config = await traceAngularPhase("aot/read-configuration", () => readConfiguration("./tsconfig.json"));
|
|
14390
14406
|
const options = {
|
|
@@ -14426,7 +14442,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
14426
14442
|
return originalGetSourceFile?.call(host, fileName, languageVersion, onError);
|
|
14427
14443
|
};
|
|
14428
14444
|
const emitted = {};
|
|
14429
|
-
const resolvedOutDir =
|
|
14445
|
+
const resolvedOutDir = resolve23(outDir);
|
|
14430
14446
|
host.writeFile = (fileName, text) => {
|
|
14431
14447
|
const relativePath = resolveRelativePath(fileName, resolvedOutDir, outDir);
|
|
14432
14448
|
emitted[relativePath] = text;
|
|
@@ -14448,12 +14464,12 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
14448
14464
|
if (!fileName.endsWith(".ts") || fileName.endsWith(".d.ts")) {
|
|
14449
14465
|
return source;
|
|
14450
14466
|
}
|
|
14451
|
-
const resolvedPath =
|
|
14467
|
+
const resolvedPath = resolve23(fileName);
|
|
14452
14468
|
return transformedSources.get(resolvedPath) ?? source;
|
|
14453
14469
|
};
|
|
14454
14470
|
const originalGetSourceFileForCompile = host.getSourceFile;
|
|
14455
14471
|
host.getSourceFile = (fileName, languageVersion, onError) => {
|
|
14456
|
-
const source = transformedSources.get(
|
|
14472
|
+
const source = transformedSources.get(resolve23(fileName));
|
|
14457
14473
|
if (source) {
|
|
14458
14474
|
return ts9.createSourceFile(fileName, source, languageVersion, true);
|
|
14459
14475
|
}
|
|
@@ -14477,7 +14493,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
14477
14493
|
content,
|
|
14478
14494
|
target: join29(outDir, fileName)
|
|
14479
14495
|
}));
|
|
14480
|
-
const outputFiles = new Set(rawEntries.map(({ target }) =>
|
|
14496
|
+
const outputFiles = new Set(rawEntries.map(({ target }) => resolve23(target)));
|
|
14481
14497
|
return rawEntries.map(({ content, target }) => {
|
|
14482
14498
|
let processedContent = content.replace(/from\s+(['"])(\.\.?\/[^'"]+)(\1)/g, (match, quote, path) => {
|
|
14483
14499
|
const rewritten = rewriteRelativeJsSpecifier(target, path, outputFiles);
|
|
@@ -14492,7 +14508,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
14492
14508
|
return cleaned ? `import { ${cleaned}, InternalInjectFlags } from '@angular/core'` : `import { InternalInjectFlags } from '@angular/core'`;
|
|
14493
14509
|
});
|
|
14494
14510
|
processedContent = processedContent.replace(/\b(?<!Internal)InjectFlags\b/g, "InternalInjectFlags");
|
|
14495
|
-
processedContent += islandMetadataByOutputPath.get(
|
|
14511
|
+
processedContent += islandMetadataByOutputPath.get(resolve23(target)) ?? "";
|
|
14496
14512
|
return { content: processedContent, target };
|
|
14497
14513
|
});
|
|
14498
14514
|
});
|
|
@@ -14502,7 +14518,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
14502
14518
|
})), { outputs: entries.length });
|
|
14503
14519
|
return await traceAngularPhase("aot/collect-output-paths", () => entries.map(({ target }) => target), { outputs: entries.length });
|
|
14504
14520
|
}, compileAngularFile = async (inputPath, outDir, stylePreprocessors) => compileAngularFiles([inputPath], outDir, stylePreprocessors), jitContentCache, invalidateAngularJitCache = (filePath) => {
|
|
14505
|
-
jitContentCache.delete(
|
|
14521
|
+
jitContentCache.delete(resolve23(filePath));
|
|
14506
14522
|
}, wrapperOutputCache, escapeTemplateContent = (content) => content.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$\{/g, "\\${"), findUncommentedMatch = (source, pattern) => {
|
|
14507
14523
|
const re2 = new RegExp(pattern.source, pattern.flags.includes("g") ? pattern.flags : pattern.flags + "g");
|
|
14508
14524
|
let match;
|
|
@@ -14515,7 +14531,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
14515
14531
|
}
|
|
14516
14532
|
return null;
|
|
14517
14533
|
}, resolveAngularDeferImportSpecifier = () => {
|
|
14518
|
-
const sourceEntry =
|
|
14534
|
+
const sourceEntry = resolve23(import.meta.dir, "../angular/components/index.ts");
|
|
14519
14535
|
if (existsSync22(sourceEntry)) {
|
|
14520
14536
|
return sourceEntry.replace(/\\/g, "/");
|
|
14521
14537
|
}
|
|
@@ -14745,10 +14761,10 @@ ${fields}
|
|
|
14745
14761
|
source: result
|
|
14746
14762
|
};
|
|
14747
14763
|
}, compileAngularFileJIT = async (inputPath, outDir, rootDir, stylePreprocessors, cacheBuster) => {
|
|
14748
|
-
const entryPath =
|
|
14764
|
+
const entryPath = resolve23(inputPath);
|
|
14749
14765
|
const allOutputs = [];
|
|
14750
14766
|
const visited = new Set;
|
|
14751
|
-
const baseDir =
|
|
14767
|
+
const baseDir = resolve23(rootDir ?? process.cwd());
|
|
14752
14768
|
let usesLegacyAnimations = false;
|
|
14753
14769
|
const angularTranspiler = new Bun.Transpiler({
|
|
14754
14770
|
loader: "ts",
|
|
@@ -14776,7 +14792,7 @@ ${fields}
|
|
|
14776
14792
|
};
|
|
14777
14793
|
const resolveLocalImport = (specifier, fromDir) => {
|
|
14778
14794
|
if (specifier.startsWith(".") || specifier.startsWith("/")) {
|
|
14779
|
-
return resolveSourceFile2(
|
|
14795
|
+
return resolveSourceFile2(resolve23(fromDir, specifier));
|
|
14780
14796
|
}
|
|
14781
14797
|
const aliased = matchTsconfigAlias(specifier, tsconfigAliases.aliases, tsconfigAliases.baseUrl, resolveSourceFile2);
|
|
14782
14798
|
if (aliased)
|
|
@@ -14785,7 +14801,7 @@ ${fields}
|
|
|
14785
14801
|
const resolved = Bun.resolveSync(specifier, fromDir);
|
|
14786
14802
|
if (resolved.includes("/node_modules/"))
|
|
14787
14803
|
return;
|
|
14788
|
-
const absolute =
|
|
14804
|
+
const absolute = resolve23(resolved);
|
|
14789
14805
|
if (!absolute.startsWith(baseDir))
|
|
14790
14806
|
return;
|
|
14791
14807
|
return resolveSourceFile2(absolute);
|
|
@@ -14834,13 +14850,13 @@ ${fields}
|
|
|
14834
14850
|
return `${prefix}${dots}`;
|
|
14835
14851
|
return `${prefix}../${dots}`;
|
|
14836
14852
|
});
|
|
14837
|
-
if (
|
|
14853
|
+
if (resolve23(actualPath) === entryPath) {
|
|
14838
14854
|
processedContent += buildIslandMetadataExports(sourceCode);
|
|
14839
14855
|
}
|
|
14840
14856
|
return processedContent;
|
|
14841
14857
|
};
|
|
14842
14858
|
const transpileFile = async (filePath) => {
|
|
14843
|
-
const resolved =
|
|
14859
|
+
const resolved = resolve23(filePath);
|
|
14844
14860
|
if (visited.has(resolved))
|
|
14845
14861
|
return;
|
|
14846
14862
|
visited.add(resolved);
|
|
@@ -14887,12 +14903,12 @@ ${fields}
|
|
|
14887
14903
|
const resolved2 = resolveLocalImport(specifier, inputDir);
|
|
14888
14904
|
if (!resolved2)
|
|
14889
14905
|
return null;
|
|
14890
|
-
const relativeImport =
|
|
14906
|
+
const relativeImport = relative12(targetDir, toOutputPath(resolved2)).replace(/\\/g, "/").replace(/\.js$/, "");
|
|
14891
14907
|
const relativeRewrite = relativeImport.startsWith(".") ? relativeImport : `./${relativeImport}`;
|
|
14892
14908
|
importRewrites.set(specifier, relativeRewrite);
|
|
14893
14909
|
return resolved2;
|
|
14894
14910
|
}).filter((path) => Boolean(path));
|
|
14895
|
-
const isEntry =
|
|
14911
|
+
const isEntry = resolve23(actualPath) === resolve23(entryPath);
|
|
14896
14912
|
const contentHash = Bun.hash(sourceCode).toString(BASE_36_RADIX);
|
|
14897
14913
|
const cacheKey2 = actualPath;
|
|
14898
14914
|
const shouldWriteFile = cacheBuster && isEntry ? true : jitContentCache.get(cacheKey2) !== contentHash || !existsSync22(targetPath);
|
|
@@ -14928,11 +14944,11 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
14928
14944
|
const compiledRoot = compiledParent;
|
|
14929
14945
|
const indexesDir = join29(compiledParent, "indexes");
|
|
14930
14946
|
await traceAngularPhase("setup/create-indexes-dir", () => fs5.mkdir(indexesDir, { recursive: true }));
|
|
14931
|
-
const aotOutputs = hmr ? [] : await traceAngularPhase("aot/compile-files", () => compileAngularFiles(entryPoints.map((entry) =>
|
|
14947
|
+
const aotOutputs = hmr ? [] : await traceAngularPhase("aot/compile-files", () => compileAngularFiles(entryPoints.map((entry) => resolve23(entry)), compiledRoot, stylePreprocessors), { entries: entryPoints.length });
|
|
14932
14948
|
if (!hmr) {
|
|
14933
14949
|
await traceAngularPhase("aot/copy-json-resources", async () => {
|
|
14934
14950
|
const cwd = process.cwd();
|
|
14935
|
-
const angularSrcDir =
|
|
14951
|
+
const angularSrcDir = resolve23(outRoot);
|
|
14936
14952
|
if (!existsSync22(angularSrcDir))
|
|
14937
14953
|
return;
|
|
14938
14954
|
const jsonGlob = new Glob6("**/*.json");
|
|
@@ -14941,7 +14957,7 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
14941
14957
|
cwd: angularSrcDir
|
|
14942
14958
|
})) {
|
|
14943
14959
|
const sourcePath = join29(angularSrcDir, rel);
|
|
14944
|
-
const cwdRel =
|
|
14960
|
+
const cwdRel = relative12(cwd, sourcePath);
|
|
14945
14961
|
const targetPath = join29(compiledRoot, cwdRel);
|
|
14946
14962
|
await fs5.mkdir(dirname16(targetPath), { recursive: true });
|
|
14947
14963
|
await fs5.copyFile(sourcePath, targetPath);
|
|
@@ -14950,8 +14966,8 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
14950
14966
|
}
|
|
14951
14967
|
const usesLegacyAngularAnimations = await traceAngularPhase("setup/legacy-animation-resolver", () => createLegacyAngularAnimationUsageResolver(outRoot));
|
|
14952
14968
|
const compileTasks = entryPoints.map(async (entry) => {
|
|
14953
|
-
const resolvedEntry =
|
|
14954
|
-
const relativeEntry =
|
|
14969
|
+
const resolvedEntry = resolve23(entry);
|
|
14970
|
+
const relativeEntry = relative12(outRoot, resolvedEntry).replace(/\.[tj]s$/, ".js");
|
|
14955
14971
|
const compileEntry = () => compileAngularFileJIT(resolvedEntry, compiledRoot, outRoot, stylePreprocessors);
|
|
14956
14972
|
let outputs = hmr ? await traceAngularPhase("jit/compile-entry", compileEntry, {
|
|
14957
14973
|
entry: resolvedEntry
|
|
@@ -14962,10 +14978,10 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
14962
14978
|
join29(compiledRoot, relativeEntry),
|
|
14963
14979
|
join29(compiledRoot, "pages", jsName),
|
|
14964
14980
|
join29(compiledRoot, jsName)
|
|
14965
|
-
].map((file3) =>
|
|
14981
|
+
].map((file3) => resolve23(file3));
|
|
14966
14982
|
const resolveRawServerFile = (candidatePaths) => {
|
|
14967
14983
|
const normalizedCandidates = [
|
|
14968
|
-
...candidatePaths.map((file3) =>
|
|
14984
|
+
...candidatePaths.map((file3) => resolve23(file3)),
|
|
14969
14985
|
...compiledFallbackPaths
|
|
14970
14986
|
];
|
|
14971
14987
|
let candidate = normalizedCandidates.find((file3) => existsSync22(file3) && file3.endsWith(`${sep3}${relativeEntry}`));
|
|
@@ -15035,13 +15051,13 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
15035
15051
|
`;
|
|
15036
15052
|
}
|
|
15037
15053
|
await traceAngularPhase("wrapper/write-server-output", () => fs5.writeFile(rawServerFile, rewritten, "utf-8"), { entry: resolvedEntry });
|
|
15038
|
-
const relativePath =
|
|
15054
|
+
const relativePath = relative12(indexesDir, rawServerFile).replace(/\\/g, "/");
|
|
15039
15055
|
const normalizedImportPath = relativePath.startsWith(".") ? relativePath : `./${relativePath}`;
|
|
15040
15056
|
const manifestKeyForProviders = toPascal(fileBase);
|
|
15041
15057
|
const providersFilePath = join29(compiledParent, "providers", `${manifestKeyForProviders}.providers.ts`);
|
|
15042
15058
|
const hasGeneratedProviders = existsSync22(providersFilePath);
|
|
15043
15059
|
const providersImportPath = hasGeneratedProviders ? (() => {
|
|
15044
|
-
const rel =
|
|
15060
|
+
const rel = relative12(indexesDir, providersFilePath.replace(/\.ts$/, "")).replace(/\\/g, "/");
|
|
15045
15061
|
return rel.startsWith(".") ? rel : `./${rel}`;
|
|
15046
15062
|
})() : null;
|
|
15047
15063
|
const generatedProvidersImport = providersImportPath ? `import { providers as generatedProviders } from '${providersImportPath}';` : "var generatedProviders = null;";
|
|
@@ -15969,7 +15985,7 @@ __export(exports_fastHmrCompiler, {
|
|
|
15969
15985
|
invalidateFingerprintCache: () => invalidateFingerprintCache
|
|
15970
15986
|
});
|
|
15971
15987
|
import { existsSync as existsSync23, readFileSync as readFileSync17, statSync as statSync2 } from "fs";
|
|
15972
|
-
import { dirname as dirname17, extname as extname6, relative as
|
|
15988
|
+
import { dirname as dirname17, extname as extname6, relative as relative13, resolve as resolve24 } from "path";
|
|
15973
15989
|
import ts13 from "typescript";
|
|
15974
15990
|
var fail = (reason, detail, location) => ({
|
|
15975
15991
|
ok: false,
|
|
@@ -16080,7 +16096,7 @@ var fail = (reason, detail, location) => ({
|
|
|
16080
16096
|
})();
|
|
16081
16097
|
if (!decoratorName)
|
|
16082
16098
|
continue;
|
|
16083
|
-
const projectRel =
|
|
16099
|
+
const projectRel = relative13(process.cwd(), componentFilePath).replace(/\\/g, "/");
|
|
16084
16100
|
const id = encodeURIComponent(`${projectRel}@${className}`);
|
|
16085
16101
|
if (decoratorName === "Component") {
|
|
16086
16102
|
const componentDecorator = decorators.find((d2) => {
|
|
@@ -16273,7 +16289,7 @@ var fail = (reason, detail, location) => ({
|
|
|
16273
16289
|
if (!spec.startsWith(".") && !spec.startsWith("/")) {
|
|
16274
16290
|
return true;
|
|
16275
16291
|
}
|
|
16276
|
-
const base =
|
|
16292
|
+
const base = resolve24(componentDir, spec);
|
|
16277
16293
|
const candidates = [
|
|
16278
16294
|
`${base}.ts`,
|
|
16279
16295
|
`${base}.tsx`,
|
|
@@ -17077,7 +17093,7 @@ var fail = (reason, detail, location) => ({
|
|
|
17077
17093
|
return null;
|
|
17078
17094
|
}, resolveDtsFromSpec = (spec, fromDir) => {
|
|
17079
17095
|
const stripped = spec.replace(/\.[mc]?js$/, "");
|
|
17080
|
-
const base =
|
|
17096
|
+
const base = resolve24(fromDir, stripped);
|
|
17081
17097
|
const candidates = [
|
|
17082
17098
|
`${base}.d.ts`,
|
|
17083
17099
|
`${base}.d.mts`,
|
|
@@ -17101,7 +17117,7 @@ var fail = (reason, detail, location) => ({
|
|
|
17101
17117
|
return null;
|
|
17102
17118
|
}, resolveChildComponentInfo = (className, spec, componentDir, projectRoot) => {
|
|
17103
17119
|
if (spec.startsWith(".") || spec.startsWith("/")) {
|
|
17104
|
-
const base =
|
|
17120
|
+
const base = resolve24(componentDir, spec);
|
|
17105
17121
|
const candidates = [
|
|
17106
17122
|
`${base}.ts`,
|
|
17107
17123
|
`${base}.tsx`,
|
|
@@ -17320,13 +17336,13 @@ var fail = (reason, detail, location) => ({
|
|
|
17320
17336
|
}
|
|
17321
17337
|
if (!matches)
|
|
17322
17338
|
continue;
|
|
17323
|
-
const resolved =
|
|
17339
|
+
const resolved = resolve24(componentDir, spec);
|
|
17324
17340
|
for (const ext of TS_EXTENSIONS) {
|
|
17325
17341
|
const candidate = resolved + ext;
|
|
17326
17342
|
if (existsSync23(candidate))
|
|
17327
17343
|
return candidate;
|
|
17328
17344
|
}
|
|
17329
|
-
const indexCandidate =
|
|
17345
|
+
const indexCandidate = resolve24(resolved, "index.ts");
|
|
17330
17346
|
if (existsSync23(indexCandidate))
|
|
17331
17347
|
return indexCandidate;
|
|
17332
17348
|
}
|
|
@@ -17559,7 +17575,7 @@ ${transpiled}
|
|
|
17559
17575
|
}
|
|
17560
17576
|
}${staticPatch}`;
|
|
17561
17577
|
}, STYLE_PREPROCESSED_EXT, resolveAndReadStyleResource = (componentDir, url) => {
|
|
17562
|
-
const abs =
|
|
17578
|
+
const abs = resolve24(componentDir, url);
|
|
17563
17579
|
if (!existsSync23(abs))
|
|
17564
17580
|
return null;
|
|
17565
17581
|
const ext = extname6(abs).toLowerCase();
|
|
@@ -17599,7 +17615,7 @@ ${block}
|
|
|
17599
17615
|
const cached = projectOptionsCache.get(projectRoot);
|
|
17600
17616
|
if (cached !== undefined)
|
|
17601
17617
|
return cached;
|
|
17602
|
-
const tsconfigPath =
|
|
17618
|
+
const tsconfigPath = resolve24(projectRoot, "tsconfig.json");
|
|
17603
17619
|
const opts = {};
|
|
17604
17620
|
if (existsSync23(tsconfigPath)) {
|
|
17605
17621
|
try {
|
|
@@ -17645,7 +17661,7 @@ ${block}
|
|
|
17645
17661
|
}
|
|
17646
17662
|
const kind = params.kind ?? "component";
|
|
17647
17663
|
if (kind !== "component") {
|
|
17648
|
-
const entityId = encodeURIComponent(`${
|
|
17664
|
+
const entityId = encodeURIComponent(`${relative13(projectRoot, componentFilePath).replace(/\\/g, "/")}@${className}`);
|
|
17649
17665
|
const currentEntityFingerprint = extractEntityFingerprint(classNode, className, sourceFile);
|
|
17650
17666
|
const cachedEntityFingerprint = entityFingerprintCache.get(entityId);
|
|
17651
17667
|
if (cachedEntityFingerprint !== undefined && !entityFingerprintsEqual(cachedEntityFingerprint, currentEntityFingerprint)) {
|
|
@@ -17683,7 +17699,7 @@ ${block}
|
|
|
17683
17699
|
templateText = decoratorMeta.template;
|
|
17684
17700
|
templatePath = componentFilePath;
|
|
17685
17701
|
} else if (decoratorMeta.templateUrl) {
|
|
17686
|
-
const tplAbs =
|
|
17702
|
+
const tplAbs = resolve24(componentDir, decoratorMeta.templateUrl);
|
|
17687
17703
|
if (!existsSync23(tplAbs)) {
|
|
17688
17704
|
return fail("template-resource-not-found", `Template file not found: ${tplAbs}`, { file: componentFilePath });
|
|
17689
17705
|
}
|
|
@@ -17729,7 +17745,7 @@ ${block}
|
|
|
17729
17745
|
return fail("class-not-found", "anonymous class");
|
|
17730
17746
|
const wrappedClass = new compiler.WrappedNodeExpr(className_);
|
|
17731
17747
|
const { inputs, outputs, hasDecoratorIO, hasSignalIO } = extractInputsAndOutputs(classNode, compiler);
|
|
17732
|
-
const projectRelPath =
|
|
17748
|
+
const projectRelPath = relative13(projectRoot, componentFilePath).replace(/\\/g, "/");
|
|
17733
17749
|
const fingerprintId = encodeURIComponent(`${projectRelPath}@${className}`);
|
|
17734
17750
|
const currentFingerprint = extractFingerprint(classNode, className, decoratorMeta, inputs, outputs, sourceFile, componentDir);
|
|
17735
17751
|
const cachedFingerprint = fingerprintCache.get(fingerprintId);
|
|
@@ -18446,7 +18462,7 @@ __export(exports_compileEmber, {
|
|
|
18446
18462
|
});
|
|
18447
18463
|
import { existsSync as existsSync24 } from "fs";
|
|
18448
18464
|
import { mkdir as mkdir6, rm as rm4 } from "fs/promises";
|
|
18449
|
-
import { basename as basename9, dirname as dirname18, extname as extname7, join as join30, resolve as
|
|
18465
|
+
import { basename as basename9, dirname as dirname18, extname as extname7, join as join30, resolve as resolve25 } from "path";
|
|
18450
18466
|
var {build: bunBuild2, Transpiler: Transpiler4, write: write4, file: file3 } = globalThis.Bun;
|
|
18451
18467
|
var cachedPreprocessor = null, getPreprocessor = async () => {
|
|
18452
18468
|
if (cachedPreprocessor)
|
|
@@ -18542,7 +18558,7 @@ export const importSync = (specifier) => {
|
|
|
18542
18558
|
const originalImporter = stagedSourceMap.get(args.importer);
|
|
18543
18559
|
if (!originalImporter)
|
|
18544
18560
|
return;
|
|
18545
|
-
const candidateBase =
|
|
18561
|
+
const candidateBase = resolve25(dirname18(originalImporter), args.path);
|
|
18546
18562
|
const extensionsToTry = ["", ".gts", ".gjs", ".ts", ".js"];
|
|
18547
18563
|
for (const ext of extensionsToTry) {
|
|
18548
18564
|
const candidate = candidateBase + ext;
|
|
@@ -18601,7 +18617,7 @@ export const renderToHTML = (props = {}) => {
|
|
|
18601
18617
|
export { PageComponent };
|
|
18602
18618
|
export default PageComponent;
|
|
18603
18619
|
`, compileEmberFile = async (entry, compiledRoot, cwd = process.cwd()) => {
|
|
18604
|
-
const resolvedEntry =
|
|
18620
|
+
const resolvedEntry = resolve25(entry);
|
|
18605
18621
|
const source = await file3(resolvedEntry).text();
|
|
18606
18622
|
let preprocessed = source;
|
|
18607
18623
|
if (isTemplateTagFile(resolvedEntry)) {
|
|
@@ -18621,8 +18637,8 @@ export default PageComponent;
|
|
|
18621
18637
|
mkdir6(serverDir, { recursive: true }),
|
|
18622
18638
|
mkdir6(clientDir, { recursive: true })
|
|
18623
18639
|
]);
|
|
18624
|
-
const tmpPagePath =
|
|
18625
|
-
const tmpHarnessPath =
|
|
18640
|
+
const tmpPagePath = resolve25(join30(tmpDir, `${baseName}.module.js`));
|
|
18641
|
+
const tmpHarnessPath = resolve25(join30(tmpDir, `${baseName}.harness.js`));
|
|
18626
18642
|
await Promise.all([
|
|
18627
18643
|
write4(tmpPagePath, transpiled),
|
|
18628
18644
|
write4(tmpHarnessPath, generateServerHarness(tmpPagePath))
|
|
@@ -18664,7 +18680,7 @@ export default PageComponent;
|
|
|
18664
18680
|
serverPaths: outputs.map((o3) => o3.serverPath)
|
|
18665
18681
|
};
|
|
18666
18682
|
}, compileEmberFileSource = async (entry) => {
|
|
18667
|
-
const resolvedEntry =
|
|
18683
|
+
const resolvedEntry = resolve25(entry);
|
|
18668
18684
|
const source = await file3(resolvedEntry).text();
|
|
18669
18685
|
let preprocessed = source;
|
|
18670
18686
|
if (isTemplateTagFile(resolvedEntry)) {
|
|
@@ -18697,24 +18713,24 @@ __export(exports_buildReactVendor, {
|
|
|
18697
18713
|
buildReactVendor: () => buildReactVendor
|
|
18698
18714
|
});
|
|
18699
18715
|
import { existsSync as existsSync25, mkdirSync as mkdirSync10 } from "fs";
|
|
18700
|
-
import { join as join31, resolve as
|
|
18716
|
+
import { join as join31, resolve as resolve26 } from "path";
|
|
18701
18717
|
import { rm as rm5 } from "fs/promises";
|
|
18702
18718
|
var {build: bunBuild3 } = globalThis.Bun;
|
|
18703
18719
|
var resolveJsxDevRuntimeCompatPath = () => {
|
|
18704
18720
|
const candidates = [
|
|
18705
|
-
|
|
18706
|
-
|
|
18707
|
-
|
|
18708
|
-
|
|
18709
|
-
|
|
18710
|
-
|
|
18721
|
+
resolve26(import.meta.dir, "react", "jsxDevRuntimeCompat.js"),
|
|
18722
|
+
resolve26(import.meta.dir, "src", "react", "jsxDevRuntimeCompat.ts"),
|
|
18723
|
+
resolve26(import.meta.dir, "..", "react", "jsxDevRuntimeCompat.js"),
|
|
18724
|
+
resolve26(import.meta.dir, "..", "src", "react", "jsxDevRuntimeCompat.ts"),
|
|
18725
|
+
resolve26(import.meta.dir, "..", "..", "dist", "react", "jsxDevRuntimeCompat.js"),
|
|
18726
|
+
resolve26(import.meta.dir, "..", "..", "src", "react", "jsxDevRuntimeCompat.ts")
|
|
18711
18727
|
];
|
|
18712
18728
|
for (const candidate of candidates) {
|
|
18713
18729
|
if (existsSync25(candidate)) {
|
|
18714
18730
|
return candidate.replace(/\\/g, "/");
|
|
18715
18731
|
}
|
|
18716
18732
|
}
|
|
18717
|
-
return (candidates[0] ??
|
|
18733
|
+
return (candidates[0] ?? resolve26(import.meta.dir, "react", "jsxDevRuntimeCompat.js")).replace(/\\/g, "/");
|
|
18718
18734
|
}, jsxDevRuntimeCompatPath, reactSpecifiers, isResolvable = (specifier) => {
|
|
18719
18735
|
try {
|
|
18720
18736
|
Bun.resolveSync(specifier, process.cwd());
|
|
@@ -19364,7 +19380,7 @@ import {
|
|
|
19364
19380
|
statSync as statSync3,
|
|
19365
19381
|
writeFileSync as writeFileSync10
|
|
19366
19382
|
} from "fs";
|
|
19367
|
-
import { basename as basename10, dirname as dirname19, extname as extname8, join as join36, relative as
|
|
19383
|
+
import { basename as basename10, dirname as dirname19, extname as extname8, join as join36, relative as relative14, resolve as resolve27 } from "path";
|
|
19368
19384
|
import { cwd, env as env2, exit } from "process";
|
|
19369
19385
|
var {build: bunBuild7, Glob: Glob8 } = globalThis.Bun;
|
|
19370
19386
|
var isDev, isBuildTraceEnabled = () => {
|
|
@@ -19455,8 +19471,8 @@ var isDev, isBuildTraceEnabled = () => {
|
|
|
19455
19471
|
}
|
|
19456
19472
|
}, resolveAbsoluteVersion = async () => {
|
|
19457
19473
|
const candidates = [
|
|
19458
|
-
|
|
19459
|
-
|
|
19474
|
+
resolve27(import.meta.dir, "..", "..", "package.json"),
|
|
19475
|
+
resolve27(import.meta.dir, "..", "package.json")
|
|
19460
19476
|
];
|
|
19461
19477
|
const resolveCandidate = async (remaining) => {
|
|
19462
19478
|
const [candidate, ...rest] = remaining;
|
|
@@ -19472,7 +19488,7 @@ var isDev, isBuildTraceEnabled = () => {
|
|
|
19472
19488
|
};
|
|
19473
19489
|
await resolveCandidate(candidates);
|
|
19474
19490
|
}, SKIP_DIRS4, addWorkerPathIfExists = (file4, relPath, workerPaths) => {
|
|
19475
|
-
const absPath =
|
|
19491
|
+
const absPath = resolve27(file4, "..", relPath);
|
|
19476
19492
|
try {
|
|
19477
19493
|
statSync3(absPath);
|
|
19478
19494
|
workerPaths.add(absPath);
|
|
@@ -19534,7 +19550,7 @@ var isDev, isBuildTraceEnabled = () => {
|
|
|
19534
19550
|
return;
|
|
19535
19551
|
}
|
|
19536
19552
|
const indexFiles = readDir(reactIndexesPath).filter((file4) => file4.endsWith(".tsx"));
|
|
19537
|
-
const pagesRel =
|
|
19553
|
+
const pagesRel = relative14(process.cwd(), resolve27(reactPagesPath)).replace(/\\/g, "/");
|
|
19538
19554
|
for (const file4 of indexFiles) {
|
|
19539
19555
|
let content = readFileSync18(join36(reactIndexesPath, file4), "utf-8");
|
|
19540
19556
|
content = content.replace(/from\s*['"]([^'"]*\/pages\/([^'"]+))['"]/g, (_match, _fullPath, componentName) => `from '/@src/${pagesRel}/${componentName}'`);
|
|
@@ -19542,27 +19558,27 @@ var isDev, isBuildTraceEnabled = () => {
|
|
|
19542
19558
|
}
|
|
19543
19559
|
}, copySvelteDevIndexes = (svelteDir, sveltePagesPath, svelteEntries, devIndexDir) => {
|
|
19544
19560
|
const svelteIndexDir = join36(getFrameworkGeneratedDir("svelte"), "indexes");
|
|
19545
|
-
const sveltePageEntries = svelteEntries.filter((file4) =>
|
|
19561
|
+
const sveltePageEntries = svelteEntries.filter((file4) => resolve27(file4).startsWith(resolve27(sveltePagesPath)));
|
|
19546
19562
|
for (const entry of sveltePageEntries) {
|
|
19547
19563
|
const name = basename10(entry).replace(/\.svelte(\.(ts|js))?$/, "");
|
|
19548
19564
|
const indexFile = join36(svelteIndexDir, "pages", `${name}.js`);
|
|
19549
19565
|
if (!existsSync26(indexFile))
|
|
19550
19566
|
continue;
|
|
19551
19567
|
let content = readFileSync18(indexFile, "utf-8");
|
|
19552
|
-
const srcRel =
|
|
19568
|
+
const srcRel = relative14(process.cwd(), resolve27(entry)).replace(/\\/g, "/");
|
|
19553
19569
|
content = content.replace(/import\s+Component\s+from\s+['"]([^'"]+)['"]/, `import Component from "/@src/${srcRel}"`);
|
|
19554
19570
|
writeFileSync10(join36(devIndexDir, `${name}.svelte.js`), content);
|
|
19555
19571
|
}
|
|
19556
19572
|
}, copyVueDevIndexes = (vueDir, vuePagesPath, vueEntries, devIndexDir) => {
|
|
19557
19573
|
const vueIndexDir = join36(getFrameworkGeneratedDir("vue"), "indexes");
|
|
19558
|
-
const vuePageEntries = vueEntries.filter((file4) =>
|
|
19574
|
+
const vuePageEntries = vueEntries.filter((file4) => resolve27(file4).startsWith(resolve27(vuePagesPath)));
|
|
19559
19575
|
for (const entry of vuePageEntries) {
|
|
19560
19576
|
const name = basename10(entry, ".vue");
|
|
19561
19577
|
const indexFile = join36(vueIndexDir, `${name}.js`);
|
|
19562
19578
|
if (!existsSync26(indexFile))
|
|
19563
19579
|
continue;
|
|
19564
19580
|
let content = readFileSync18(indexFile, "utf-8");
|
|
19565
|
-
const srcRel =
|
|
19581
|
+
const srcRel = relative14(process.cwd(), resolve27(entry)).replace(/\\/g, "/");
|
|
19566
19582
|
content = content.replace(/import\s+Comp(?:\s*,\s*\*\s+as\s+\w+)?\s+from\s+['"]([^'"]+)['"]/, (match) => match.replace(/from\s+['"][^'"]+['"]/, `from "/@src/${srcRel}"`));
|
|
19567
19583
|
writeFileSync10(join36(devIndexDir, `${name}.vue.js`), content);
|
|
19568
19584
|
}
|
|
@@ -19575,7 +19591,7 @@ var isDev, isBuildTraceEnabled = () => {
|
|
|
19575
19591
|
const last = allComments[allComments.length - 1];
|
|
19576
19592
|
if (!last?.[1])
|
|
19577
19593
|
return JSON.stringify(outputPath);
|
|
19578
|
-
const srcPath =
|
|
19594
|
+
const srcPath = resolve27(projectRoot, last[1].replace("/client/", "/").replace(/\.js$/, ".ts"));
|
|
19579
19595
|
return JSON.stringify(srcPath);
|
|
19580
19596
|
}, QUOTE_CHARS, OPEN_BRACES, CLOSE_BRACES, findFunctionExpressionEnd = (content, startPos) => {
|
|
19581
19597
|
let depth = 0;
|
|
@@ -19637,7 +19653,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
19637
19653
|
}, buildDevUrlFileMap = (urlReferencedFiles, projectRoot) => {
|
|
19638
19654
|
const urlFileMap = new Map;
|
|
19639
19655
|
for (const srcPath of urlReferencedFiles) {
|
|
19640
|
-
const rel =
|
|
19656
|
+
const rel = relative14(projectRoot, srcPath).replace(/\\/g, "/");
|
|
19641
19657
|
const name = basename10(srcPath);
|
|
19642
19658
|
const mtime = Math.round(statSync3(srcPath).mtimeMs);
|
|
19643
19659
|
const url = `/@src/${rel}?v=${mtime}`;
|
|
@@ -19652,7 +19668,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
19652
19668
|
const output = nonReactClientOutputs.find((artifact) => basename10(artifact.path).startsWith(`${srcBase}.`));
|
|
19653
19669
|
if (!output)
|
|
19654
19670
|
continue;
|
|
19655
|
-
urlFileMap.set(basename10(srcPath), `/${
|
|
19671
|
+
urlFileMap.set(basename10(srcPath), `/${relative14(buildPath, output.path).replace(/\\/g, "/")}`);
|
|
19656
19672
|
}
|
|
19657
19673
|
return urlFileMap;
|
|
19658
19674
|
}, buildUrlFileMap = (urlReferencedFiles, hmr, projectRoot, buildPath, nonReactClientOutputs) => {
|
|
@@ -19901,13 +19917,13 @@ ${content.slice(firstUseIdx)}`;
|
|
|
19901
19917
|
const filterToIncrementalEntries = (entryPoints, mapToSource) => {
|
|
19902
19918
|
if (!isIncremental || !incrementalFiles)
|
|
19903
19919
|
return entryPoints;
|
|
19904
|
-
const normalizedIncremental = new Set(incrementalFiles.map((f2) =>
|
|
19920
|
+
const normalizedIncremental = new Set(incrementalFiles.map((f2) => resolve27(f2)));
|
|
19905
19921
|
const matchingEntries = [];
|
|
19906
19922
|
for (const entry of entryPoints) {
|
|
19907
19923
|
const sourceFile = mapToSource(entry);
|
|
19908
19924
|
if (!sourceFile)
|
|
19909
19925
|
continue;
|
|
19910
|
-
if (!normalizedIncremental.has(
|
|
19926
|
+
if (!normalizedIncremental.has(resolve27(sourceFile)))
|
|
19911
19927
|
continue;
|
|
19912
19928
|
matchingEntries.push(entry);
|
|
19913
19929
|
}
|
|
@@ -20072,7 +20088,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
20072
20088
|
}
|
|
20073
20089
|
const shouldIncludeHtmlAssets = !isIncremental || normalizedIncrementalFiles?.some((f2) => f2.includes("/html/") && (f2.endsWith(".html") || isStylePath(f2)));
|
|
20074
20090
|
const reactEntries = isIncremental && reactIndexesPath && reactPagesPath ? filterToIncrementalEntries(allReactEntries, (entry) => {
|
|
20075
|
-
if (entry.startsWith(
|
|
20091
|
+
if (entry.startsWith(resolve27(reactIndexesPath))) {
|
|
20076
20092
|
const pageName = basename10(entry, ".tsx");
|
|
20077
20093
|
return join36(reactPagesPath, `${pageName}.tsx`);
|
|
20078
20094
|
}
|
|
@@ -20185,7 +20201,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
20185
20201
|
const clientPath = islandSvelteClientPaths[idx];
|
|
20186
20202
|
if (!sourcePath || !clientPath)
|
|
20187
20203
|
continue;
|
|
20188
|
-
islandSvelteClientPathMap.set(
|
|
20204
|
+
islandSvelteClientPathMap.set(resolve27(sourcePath), clientPath);
|
|
20189
20205
|
}
|
|
20190
20206
|
const islandVueClientPathMap = new Map;
|
|
20191
20207
|
for (let idx = 0;idx < islandVueSources.length; idx++) {
|
|
@@ -20193,7 +20209,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
20193
20209
|
const clientPath = islandVueClientPaths[idx];
|
|
20194
20210
|
if (!sourcePath || !clientPath)
|
|
20195
20211
|
continue;
|
|
20196
|
-
islandVueClientPathMap.set(
|
|
20212
|
+
islandVueClientPathMap.set(resolve27(sourcePath), clientPath);
|
|
20197
20213
|
}
|
|
20198
20214
|
const islandAngularClientPathMap = new Map;
|
|
20199
20215
|
for (let idx = 0;idx < islandAngularSources.length; idx++) {
|
|
@@ -20201,7 +20217,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
20201
20217
|
const clientPath = islandAngularClientPaths[idx];
|
|
20202
20218
|
if (!sourcePath || !clientPath)
|
|
20203
20219
|
continue;
|
|
20204
|
-
islandAngularClientPathMap.set(
|
|
20220
|
+
islandAngularClientPathMap.set(resolve27(sourcePath), clientPath);
|
|
20205
20221
|
}
|
|
20206
20222
|
const reactConventionSources = collectConventionSourceFiles(conventionsMap.react);
|
|
20207
20223
|
const svelteConventionSources = collectConventionSourceFiles(conventionsMap.svelte);
|
|
@@ -20655,7 +20671,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
20655
20671
|
const fileDir = dirname19(artifact.path);
|
|
20656
20672
|
const relativePaths = {};
|
|
20657
20673
|
for (const [specifier, absolute] of Object.entries(angularServerVendorPaths2)) {
|
|
20658
|
-
const rel =
|
|
20674
|
+
const rel = relative14(fileDir, absolute);
|
|
20659
20675
|
relativePaths[specifier] = rel.startsWith(".") ? rel : `./${rel}`;
|
|
20660
20676
|
}
|
|
20661
20677
|
return relativePaths;
|
|
@@ -20724,7 +20740,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
20724
20740
|
if (skipAngularClientBundle) {
|
|
20725
20741
|
for (const clientPath of angularClientPaths) {
|
|
20726
20742
|
const fileBase = basename10(clientPath, ".js");
|
|
20727
|
-
const relFromCwd =
|
|
20743
|
+
const relFromCwd = relative14(projectRoot, clientPath).replace(/\\/g, "/");
|
|
20728
20744
|
manifest[`${toPascal(fileBase)}Index`] = `/@src/${relFromCwd}`;
|
|
20729
20745
|
}
|
|
20730
20746
|
}
|
|
@@ -21126,7 +21142,7 @@ __export(exports_dependencyGraph, {
|
|
|
21126
21142
|
});
|
|
21127
21143
|
import { existsSync as existsSync28, readFileSync as readFileSync19 } from "fs";
|
|
21128
21144
|
var {Glob: Glob9 } = globalThis.Bun;
|
|
21129
|
-
import { resolve as
|
|
21145
|
+
import { resolve as resolve28 } from "path";
|
|
21130
21146
|
var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath) => {
|
|
21131
21147
|
const lower = filePath.toLowerCase();
|
|
21132
21148
|
if (lower.endsWith(".ts") || lower.endsWith(".tsx") || lower.endsWith(".jsx"))
|
|
@@ -21140,8 +21156,8 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
21140
21156
|
if (!importPath.startsWith(".") && !importPath.startsWith("/")) {
|
|
21141
21157
|
return null;
|
|
21142
21158
|
}
|
|
21143
|
-
const fromDir =
|
|
21144
|
-
const normalized =
|
|
21159
|
+
const fromDir = resolve28(fromFile, "..");
|
|
21160
|
+
const normalized = resolve28(fromDir, importPath);
|
|
21145
21161
|
const extensions = [
|
|
21146
21162
|
".ts",
|
|
21147
21163
|
".tsx",
|
|
@@ -21171,7 +21187,7 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
21171
21187
|
dependents.delete(normalizedPath);
|
|
21172
21188
|
}
|
|
21173
21189
|
}, addFileToGraph = (graph, filePath) => {
|
|
21174
|
-
const normalizedPath =
|
|
21190
|
+
const normalizedPath = resolve28(filePath);
|
|
21175
21191
|
if (!existsSync28(normalizedPath))
|
|
21176
21192
|
return;
|
|
21177
21193
|
const dependencies = extractDependencies(normalizedPath);
|
|
@@ -21198,10 +21214,10 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
21198
21214
|
}, IGNORED_SEGMENTS, buildInitialDependencyGraph = (graph, directories) => {
|
|
21199
21215
|
const processedFiles = new Set;
|
|
21200
21216
|
const glob = new Glob9("**/*.{ts,tsx,js,jsx,vue,svelte,html,htm}");
|
|
21201
|
-
const resolvedDirs = directories.map((dir) =>
|
|
21217
|
+
const resolvedDirs = directories.map((dir) => resolve28(dir)).filter((dir) => existsSync28(dir));
|
|
21202
21218
|
const allFiles = resolvedDirs.flatMap((dir) => Array.from(glob.scanSync({ absolute: true, cwd: dir })));
|
|
21203
21219
|
for (const file4 of allFiles) {
|
|
21204
|
-
const fullPath =
|
|
21220
|
+
const fullPath = resolve28(file4);
|
|
21205
21221
|
if (IGNORED_SEGMENTS.some((seg) => fullPath.includes(seg)))
|
|
21206
21222
|
continue;
|
|
21207
21223
|
if (processedFiles.has(fullPath))
|
|
@@ -21314,7 +21330,7 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
21314
21330
|
return [];
|
|
21315
21331
|
}
|
|
21316
21332
|
}, getAffectedFiles = (graph, changedFile) => {
|
|
21317
|
-
const normalizedPath =
|
|
21333
|
+
const normalizedPath = resolve28(changedFile);
|
|
21318
21334
|
const affected = new Set;
|
|
21319
21335
|
const toProcess = [normalizedPath];
|
|
21320
21336
|
const processNode = (current) => {
|
|
@@ -21345,7 +21361,7 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
21345
21361
|
}, removeDependentsForFile = (graph, normalizedPath) => {
|
|
21346
21362
|
graph.dependents.delete(normalizedPath);
|
|
21347
21363
|
}, removeFileFromGraph = (graph, filePath) => {
|
|
21348
|
-
const normalizedPath =
|
|
21364
|
+
const normalizedPath = resolve28(filePath);
|
|
21349
21365
|
removeDepsForFile(graph, normalizedPath);
|
|
21350
21366
|
removeDependentsForFile(graph, normalizedPath);
|
|
21351
21367
|
};
|
|
@@ -21388,12 +21404,12 @@ var globalVersionCounter = 0, createModuleVersionTracker = () => new Map, getNex
|
|
|
21388
21404
|
};
|
|
21389
21405
|
|
|
21390
21406
|
// src/dev/configResolver.ts
|
|
21391
|
-
import { resolve as
|
|
21407
|
+
import { resolve as resolve29 } from "path";
|
|
21392
21408
|
var resolveBuildPaths = (config) => {
|
|
21393
21409
|
const cwd2 = process.cwd();
|
|
21394
21410
|
const normalize = (path) => path.replace(/\\/g, "/");
|
|
21395
|
-
const withDefault = (value, fallback) => normalize(
|
|
21396
|
-
const optional = (value) => value ? normalize(
|
|
21411
|
+
const withDefault = (value, fallback) => normalize(resolve29(cwd2, value ?? fallback));
|
|
21412
|
+
const optional = (value) => value ? normalize(resolve29(cwd2, value)) : undefined;
|
|
21397
21413
|
return {
|
|
21398
21414
|
angularDir: optional(config.angularDirectory),
|
|
21399
21415
|
assetsDir: optional(config.assetsDirectory),
|
|
@@ -21447,7 +21463,7 @@ var init_clientManager = __esm(() => {
|
|
|
21447
21463
|
|
|
21448
21464
|
// src/dev/pathUtils.ts
|
|
21449
21465
|
import { existsSync as existsSync29, readdirSync as readdirSync4, readFileSync as readFileSync20 } from "fs";
|
|
21450
|
-
import { dirname as dirname20, resolve as
|
|
21466
|
+
import { dirname as dirname20, resolve as resolve30 } from "path";
|
|
21451
21467
|
var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
21452
21468
|
if (shouldIgnorePath(filePath, resolved)) {
|
|
21453
21469
|
return "ignored";
|
|
@@ -21523,7 +21539,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
21523
21539
|
return "unknown";
|
|
21524
21540
|
}, collectAngularResourceDirs = (angularDir) => {
|
|
21525
21541
|
const out = new Set;
|
|
21526
|
-
const angularRoot =
|
|
21542
|
+
const angularRoot = resolve30(angularDir);
|
|
21527
21543
|
const angularRootNormalized = normalizePath(angularRoot);
|
|
21528
21544
|
const walk = (dir) => {
|
|
21529
21545
|
let entries;
|
|
@@ -21536,7 +21552,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
21536
21552
|
if (entry.name.startsWith(".") || entry.name === "node_modules") {
|
|
21537
21553
|
continue;
|
|
21538
21554
|
}
|
|
21539
|
-
const full =
|
|
21555
|
+
const full = resolve30(dir, entry.name);
|
|
21540
21556
|
if (entry.isDirectory()) {
|
|
21541
21557
|
walk(full);
|
|
21542
21558
|
continue;
|
|
@@ -21577,7 +21593,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
21577
21593
|
}
|
|
21578
21594
|
const componentDir = dirname20(full);
|
|
21579
21595
|
for (const ref of refs) {
|
|
21580
|
-
const refAbs = normalizePath(
|
|
21596
|
+
const refAbs = normalizePath(resolve30(componentDir, ref));
|
|
21581
21597
|
const refDir = normalizePath(dirname20(refAbs));
|
|
21582
21598
|
if (refDir === angularRootNormalized || refDir.startsWith(angularRootNormalized + "/")) {
|
|
21583
21599
|
continue;
|
|
@@ -21594,7 +21610,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
21594
21610
|
const push = (path) => {
|
|
21595
21611
|
if (!path)
|
|
21596
21612
|
return;
|
|
21597
|
-
const abs = normalizePath(
|
|
21613
|
+
const abs = normalizePath(resolve30(cwd2, path));
|
|
21598
21614
|
if (!roots.includes(abs))
|
|
21599
21615
|
roots.push(abs);
|
|
21600
21616
|
};
|
|
@@ -21619,7 +21635,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
21619
21635
|
push(cfg.assetsDir);
|
|
21620
21636
|
push(cfg.stylesDir);
|
|
21621
21637
|
for (const candidate of ["src", "db", "assets", "styles"]) {
|
|
21622
|
-
const abs = normalizePath(
|
|
21638
|
+
const abs = normalizePath(resolve30(cwd2, candidate));
|
|
21623
21639
|
if (existsSync29(abs) && !roots.includes(abs))
|
|
21624
21640
|
roots.push(abs);
|
|
21625
21641
|
}
|
|
@@ -21631,7 +21647,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
21631
21647
|
continue;
|
|
21632
21648
|
if (entry.name.startsWith("."))
|
|
21633
21649
|
continue;
|
|
21634
|
-
const abs = normalizePath(
|
|
21650
|
+
const abs = normalizePath(resolve30(cwd2, entry.name));
|
|
21635
21651
|
if (roots.includes(abs))
|
|
21636
21652
|
continue;
|
|
21637
21653
|
if (shouldIgnorePath(abs, resolved))
|
|
@@ -21706,7 +21722,7 @@ var init_pathUtils = __esm(() => {
|
|
|
21706
21722
|
// src/dev/fileWatcher.ts
|
|
21707
21723
|
import { watch } from "fs";
|
|
21708
21724
|
import { existsSync as existsSync30, readdirSync as readdirSync5, statSync as statSync4 } from "fs";
|
|
21709
|
-
import { dirname as dirname21, join as join38, resolve as
|
|
21725
|
+
import { dirname as dirname21, join as join38, resolve as resolve31 } from "path";
|
|
21710
21726
|
var safeRemoveFromGraph = (graph, fullPath) => {
|
|
21711
21727
|
try {
|
|
21712
21728
|
removeFileFromGraph(graph, fullPath);
|
|
@@ -21787,7 +21803,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
21787
21803
|
}, addFileWatchers = (state, paths, onFileChange) => {
|
|
21788
21804
|
const stylesDir = state.resolvedPaths?.stylesDir;
|
|
21789
21805
|
paths.forEach((path) => {
|
|
21790
|
-
const absolutePath =
|
|
21806
|
+
const absolutePath = resolve31(path).replace(/\\/g, "/");
|
|
21791
21807
|
if (!existsSync30(absolutePath)) {
|
|
21792
21808
|
return;
|
|
21793
21809
|
}
|
|
@@ -21798,7 +21814,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
21798
21814
|
const watchPaths = getWatchPaths(config, state.resolvedPaths);
|
|
21799
21815
|
const stylesDir = state.resolvedPaths?.stylesDir;
|
|
21800
21816
|
watchPaths.forEach((path) => {
|
|
21801
|
-
const absolutePath =
|
|
21817
|
+
const absolutePath = resolve31(path).replace(/\\/g, "/");
|
|
21802
21818
|
if (!existsSync30(absolutePath)) {
|
|
21803
21819
|
return;
|
|
21804
21820
|
}
|
|
@@ -21817,13 +21833,13 @@ var init_fileWatcher = __esm(() => {
|
|
|
21817
21833
|
});
|
|
21818
21834
|
|
|
21819
21835
|
// src/dev/assetStore.ts
|
|
21820
|
-
import { resolve as
|
|
21836
|
+
import { resolve as resolve32 } from "path";
|
|
21821
21837
|
import { readdir as readdir4, unlink } from "fs/promises";
|
|
21822
21838
|
var mimeTypes, getMimeType = (filePath) => {
|
|
21823
21839
|
const ext = filePath.slice(filePath.lastIndexOf("."));
|
|
21824
21840
|
return mimeTypes[ext] ?? "application/octet-stream";
|
|
21825
21841
|
}, HASHED_FILE_RE, stripHash = (webPath) => webPath.replace(/\.[a-z0-9]{8}(\.(js|css|mjs))$/, "$1"), processWalkEntry = (entry, dir, liveByIdentity, walkAndClean) => {
|
|
21826
|
-
const fullPath =
|
|
21842
|
+
const fullPath = resolve32(dir, entry.name);
|
|
21827
21843
|
if (entry.isDirectory()) {
|
|
21828
21844
|
return walkAndClean(fullPath);
|
|
21829
21845
|
}
|
|
@@ -21839,10 +21855,10 @@ var mimeTypes, getMimeType = (filePath) => {
|
|
|
21839
21855
|
}, cleanStaleAssets = async (store, manifest, buildDir) => {
|
|
21840
21856
|
const liveByIdentity = new Map;
|
|
21841
21857
|
for (const webPath of store.keys()) {
|
|
21842
|
-
const diskPath =
|
|
21858
|
+
const diskPath = resolve32(buildDir, webPath.slice(1));
|
|
21843
21859
|
liveByIdentity.set(stripHash(diskPath), diskPath);
|
|
21844
21860
|
}
|
|
21845
|
-
const absBuildDir =
|
|
21861
|
+
const absBuildDir = resolve32(buildDir);
|
|
21846
21862
|
Object.values(manifest).forEach((val) => {
|
|
21847
21863
|
if (!HASHED_FILE_RE.test(val))
|
|
21848
21864
|
return;
|
|
@@ -21860,7 +21876,7 @@ var mimeTypes, getMimeType = (filePath) => {
|
|
|
21860
21876
|
} catch {}
|
|
21861
21877
|
}, lookupAsset = (store, path) => store.get(path), processScanEntry = (entry, dir, prefix, store, scanDir) => {
|
|
21862
21878
|
if (entry.isDirectory()) {
|
|
21863
|
-
return scanDir(
|
|
21879
|
+
return scanDir(resolve32(dir, entry.name), `${prefix}${entry.name}/`);
|
|
21864
21880
|
}
|
|
21865
21881
|
if (!entry.name.startsWith("chunk-")) {
|
|
21866
21882
|
return null;
|
|
@@ -21869,7 +21885,7 @@ var mimeTypes, getMimeType = (filePath) => {
|
|
|
21869
21885
|
if (store.has(webPath)) {
|
|
21870
21886
|
return null;
|
|
21871
21887
|
}
|
|
21872
|
-
return Bun.file(
|
|
21888
|
+
return Bun.file(resolve32(dir, entry.name)).bytes().then((bytes) => {
|
|
21873
21889
|
store.set(webPath, bytes);
|
|
21874
21890
|
return;
|
|
21875
21891
|
}).catch(() => {});
|
|
@@ -21891,7 +21907,7 @@ var mimeTypes, getMimeType = (filePath) => {
|
|
|
21891
21907
|
for (const webPath of newIdentities.values()) {
|
|
21892
21908
|
if (store.has(webPath))
|
|
21893
21909
|
continue;
|
|
21894
|
-
loadPromises.push(Bun.file(
|
|
21910
|
+
loadPromises.push(Bun.file(resolve32(buildDir, webPath.slice(1))).bytes().then((bytes) => {
|
|
21895
21911
|
store.set(webPath, bytes);
|
|
21896
21912
|
return;
|
|
21897
21913
|
}).catch(() => {}));
|
|
@@ -21922,7 +21938,7 @@ var init_assetStore = __esm(() => {
|
|
|
21922
21938
|
|
|
21923
21939
|
// src/islands/pageMetadata.ts
|
|
21924
21940
|
import { readFileSync as readFileSync21 } from "fs";
|
|
21925
|
-
import { dirname as dirname22, resolve as
|
|
21941
|
+
import { dirname as dirname22, resolve as resolve33 } from "path";
|
|
21926
21942
|
var pagePatterns, getPageDirs = (config) => [
|
|
21927
21943
|
{ dir: config.angularDirectory, framework: "angular" },
|
|
21928
21944
|
{ dir: config.emberDirectory, framework: "ember" },
|
|
@@ -21942,15 +21958,15 @@ var pagePatterns, getPageDirs = (config) => [
|
|
|
21942
21958
|
const source = definition.buildReference?.source;
|
|
21943
21959
|
if (!source)
|
|
21944
21960
|
continue;
|
|
21945
|
-
const resolvedSource = source.startsWith("file://") ? new URL(source).pathname :
|
|
21946
|
-
lookup.set(`${definition.framework}:${definition.component}`,
|
|
21961
|
+
const resolvedSource = source.startsWith("file://") ? new URL(source).pathname : resolve33(dirname22(buildInfo.resolvedRegistryPath), source);
|
|
21962
|
+
lookup.set(`${definition.framework}:${definition.component}`, resolve33(resolvedSource));
|
|
21947
21963
|
}
|
|
21948
21964
|
return lookup;
|
|
21949
21965
|
}, getCurrentPageIslandMetadata = () => globalThis.__absolutePageIslandMetadata ?? new Map, metadataUsesSource = (metadata, target) => metadata.islands.some((usage) => {
|
|
21950
21966
|
const candidate = usage.source;
|
|
21951
|
-
return candidate ?
|
|
21967
|
+
return candidate ? resolve33(candidate) === target : false;
|
|
21952
21968
|
}), getPagesUsingIslandSource = (sourcePath) => {
|
|
21953
|
-
const target =
|
|
21969
|
+
const target = resolve33(sourcePath);
|
|
21954
21970
|
return [...getCurrentPageIslandMetadata().values()].filter((metadata) => metadataUsesSource(metadata, target)).map((metadata) => metadata.pagePath);
|
|
21955
21971
|
}, resolveIslandUsages = (islands, islandSourceLookup) => islands.map((usage) => {
|
|
21956
21972
|
const sourcePath = islandSourceLookup.get(`${usage.framework}:${usage.component}`);
|
|
@@ -21962,13 +21978,13 @@ var pagePatterns, getPageDirs = (config) => [
|
|
|
21962
21978
|
const pattern = pagePatterns[entry.framework];
|
|
21963
21979
|
if (!pattern)
|
|
21964
21980
|
return;
|
|
21965
|
-
const files = await scanEntryPoints(
|
|
21981
|
+
const files = await scanEntryPoints(resolve33(entry.dir), pattern);
|
|
21966
21982
|
for (const filePath of files) {
|
|
21967
21983
|
const source = readFileSync21(filePath, "utf-8");
|
|
21968
21984
|
const islands = extractIslandUsagesFromSource(source);
|
|
21969
|
-
pageMetadata.set(
|
|
21985
|
+
pageMetadata.set(resolve33(filePath), {
|
|
21970
21986
|
islands: resolveIslandUsages(islands, islandSourceLookup),
|
|
21971
|
-
pagePath:
|
|
21987
|
+
pagePath: resolve33(filePath)
|
|
21972
21988
|
});
|
|
21973
21989
|
}
|
|
21974
21990
|
}, loadPageIslandMetadata = async (config) => {
|
|
@@ -22091,9 +22107,9 @@ var init_transformCache = __esm(() => {
|
|
|
22091
22107
|
});
|
|
22092
22108
|
|
|
22093
22109
|
// src/dev/reactComponentClassifier.ts
|
|
22094
|
-
import { resolve as
|
|
22110
|
+
import { resolve as resolve34 } from "path";
|
|
22095
22111
|
var classifyComponent = (filePath) => {
|
|
22096
|
-
const normalizedPath =
|
|
22112
|
+
const normalizedPath = resolve34(filePath);
|
|
22097
22113
|
if (normalizedPath.includes("/react/pages/")) {
|
|
22098
22114
|
return "server";
|
|
22099
22115
|
}
|
|
@@ -22105,7 +22121,7 @@ var classifyComponent = (filePath) => {
|
|
|
22105
22121
|
var init_reactComponentClassifier = () => {};
|
|
22106
22122
|
|
|
22107
22123
|
// src/dev/moduleMapper.ts
|
|
22108
|
-
import { basename as basename11, resolve as
|
|
22124
|
+
import { basename as basename11, resolve as resolve35 } from "path";
|
|
22109
22125
|
var buildModulePaths = (moduleKeys, manifest) => {
|
|
22110
22126
|
const modulePaths = {};
|
|
22111
22127
|
moduleKeys.forEach((key) => {
|
|
@@ -22115,7 +22131,7 @@ var buildModulePaths = (moduleKeys, manifest) => {
|
|
|
22115
22131
|
});
|
|
22116
22132
|
return modulePaths;
|
|
22117
22133
|
}, processChangedFile = (sourceFile, framework, manifest, resolvedPaths, processedFiles) => {
|
|
22118
|
-
const normalizedFile =
|
|
22134
|
+
const normalizedFile = resolve35(sourceFile);
|
|
22119
22135
|
const normalizedPath = normalizedFile.replace(/\\/g, "/");
|
|
22120
22136
|
if (processedFiles.has(normalizedFile)) {
|
|
22121
22137
|
return null;
|
|
@@ -22151,7 +22167,7 @@ var buildModulePaths = (moduleKeys, manifest) => {
|
|
|
22151
22167
|
});
|
|
22152
22168
|
return grouped;
|
|
22153
22169
|
}, mapSourceFileToManifestKeys = (sourceFile, framework, resolvedPaths) => {
|
|
22154
|
-
const normalizedFile =
|
|
22170
|
+
const normalizedFile = resolve35(sourceFile);
|
|
22155
22171
|
const fileName = basename11(normalizedFile);
|
|
22156
22172
|
const baseName = fileName.replace(/\.(tsx?|jsx?|vue|svelte|css|html)$/, "");
|
|
22157
22173
|
const pascalName = toPascal(baseName);
|
|
@@ -22213,7 +22229,7 @@ __export(exports_resolveOwningComponents, {
|
|
|
22213
22229
|
invalidateResourceIndex: () => invalidateResourceIndex
|
|
22214
22230
|
});
|
|
22215
22231
|
import { readdirSync as readdirSync6, readFileSync as readFileSync23, statSync as statSync5 } from "fs";
|
|
22216
|
-
import { dirname as dirname23, extname as extname9, join as join39, resolve as
|
|
22232
|
+
import { dirname as dirname23, extname as extname9, join as join39, resolve as resolve36 } from "path";
|
|
22217
22233
|
import ts14 from "typescript";
|
|
22218
22234
|
var ENTITY_DECORATORS, isAngularSourceFile = (file4) => file4.endsWith(".ts") || file4.endsWith(".tsx"), walkAngularSourceFiles = (root) => {
|
|
22219
22235
|
const out = [];
|
|
@@ -22326,7 +22342,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file4) => file4.endsWith(".ts") ||
|
|
|
22326
22342
|
};
|
|
22327
22343
|
visit(sourceFile);
|
|
22328
22344
|
return out;
|
|
22329
|
-
}, safeNormalize = (path) =>
|
|
22345
|
+
}, safeNormalize = (path) => resolve36(path).replace(/\\/g, "/"), resolveOwningComponents = (params) => {
|
|
22330
22346
|
const { changedFilePath, userAngularRoot } = params;
|
|
22331
22347
|
const changedAbs = safeNormalize(changedFilePath);
|
|
22332
22348
|
const out = [];
|
|
@@ -22395,7 +22411,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file4) => file4.endsWith(".ts") ||
|
|
|
22395
22411
|
if (!spec.startsWith(".") && !spec.startsWith("/")) {
|
|
22396
22412
|
return null;
|
|
22397
22413
|
}
|
|
22398
|
-
const base =
|
|
22414
|
+
const base = resolve36(childDir, spec);
|
|
22399
22415
|
const candidates = [
|
|
22400
22416
|
`${base}.ts`,
|
|
22401
22417
|
`${base}.tsx`,
|
|
@@ -22433,7 +22449,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file4) => file4.endsWith(".ts") ||
|
|
|
22433
22449
|
};
|
|
22434
22450
|
if (cls.kind === "component") {
|
|
22435
22451
|
for (const url of [...cls.templateUrls, ...cls.styleUrls]) {
|
|
22436
|
-
const abs = safeNormalize(
|
|
22452
|
+
const abs = safeNormalize(resolve36(componentDir, url));
|
|
22437
22453
|
const existing = resource.get(abs);
|
|
22438
22454
|
if (existing)
|
|
22439
22455
|
existing.push(entity);
|
|
@@ -22618,7 +22634,7 @@ __export(exports_loadConfig, {
|
|
|
22618
22634
|
isWorkspaceConfig: () => isWorkspaceConfig,
|
|
22619
22635
|
getWorkspaceServices: () => getWorkspaceServices
|
|
22620
22636
|
});
|
|
22621
|
-
import { resolve as
|
|
22637
|
+
import { resolve as resolve37 } from "path";
|
|
22622
22638
|
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) => {
|
|
22623
22639
|
if (!isObject2(config)) {
|
|
22624
22640
|
return false;
|
|
@@ -22669,7 +22685,7 @@ var RESERVED_TOP_LEVEL_KEYS, isObject2 = (value) => typeof value === "object" &&
|
|
|
22669
22685
|
}
|
|
22670
22686
|
return config;
|
|
22671
22687
|
}, loadRawConfig = async (configPath2) => {
|
|
22672
|
-
const resolved =
|
|
22688
|
+
const resolved = resolve37(configPath2 ?? process.env.ABSOLUTE_CONFIG ?? "absolute.config.ts");
|
|
22673
22689
|
const mod = await import(resolved);
|
|
22674
22690
|
const config = mod.default ?? mod.config;
|
|
22675
22691
|
if (!config) {
|
|
@@ -22730,7 +22746,7 @@ __export(exports_moduleServer, {
|
|
|
22730
22746
|
SRC_URL_PREFIX: () => SRC_URL_PREFIX
|
|
22731
22747
|
});
|
|
22732
22748
|
import { existsSync as existsSync31, readFileSync as readFileSync24, statSync as statSync6 } from "fs";
|
|
22733
|
-
import { basename as basename12, dirname as dirname24, extname as extname10, join as join40, resolve as
|
|
22749
|
+
import { basename as basename12, dirname as dirname24, extname as extname10, join as join40, resolve as resolve38, relative as relative15 } from "path";
|
|
22734
22750
|
var SRC_PREFIX = "/@src/", jsTranspiler2, tsTranspiler2, tsxTranspiler, TRANSPILABLE, ALL_EXPORTS_RE, STRING_CONTENTS_RE, preserveTypeExports = (originalSource, transpiled, valueExports) => {
|
|
22735
22751
|
const codeOnly = originalSource.replace(STRING_CONTENTS_RE, '""');
|
|
22736
22752
|
const allExports = [];
|
|
@@ -22750,7 +22766,7 @@ var SRC_PREFIX = "/@src/", jsTranspiler2, tsTranspiler2, tsxTranspiler, TRANSPIL
|
|
|
22750
22766
|
${stubs}
|
|
22751
22767
|
`;
|
|
22752
22768
|
}, resolveRelativeExtension = (srcPath, projectRoot, extensions) => {
|
|
22753
|
-
const found = extensions.find((ext) => existsSync31(
|
|
22769
|
+
const found = extensions.find((ext) => existsSync31(resolve38(projectRoot, srcPath + ext)));
|
|
22754
22770
|
return found ? srcPath + found : srcPath;
|
|
22755
22771
|
}, IMPORT_EXTENSIONS, SIDE_EFFECT_EXTENSIONS, MODULE_EXTENSIONS, RESOLVED_MODULE_EXTENSIONS, REACT_EXTENSIONS, escapeRegex3 = (str) => str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), buildImportRewriter = (vendorPaths) => {
|
|
22756
22772
|
const entries = Object.entries(vendorPaths).sort(([a], [b2]) => b2.length - a.length);
|
|
@@ -22765,7 +22781,7 @@ ${stubs}
|
|
|
22765
22781
|
return invalidationVersion > 0 ? `${mtime}.${invalidationVersion}` : `${mtime}`;
|
|
22766
22782
|
}, srcUrl = (relPath, projectRoot) => {
|
|
22767
22783
|
const base = `${SRC_PREFIX}${relPath.replace(/\\/g, "/")}`;
|
|
22768
|
-
const absPath =
|
|
22784
|
+
const absPath = resolve38(projectRoot, relPath);
|
|
22769
22785
|
const cached = mtimeCache.get(absPath);
|
|
22770
22786
|
if (cached !== undefined)
|
|
22771
22787
|
return `${base}?v=${buildVersion(cached, absPath)}`;
|
|
@@ -22777,12 +22793,12 @@ ${stubs}
|
|
|
22777
22793
|
return base;
|
|
22778
22794
|
}
|
|
22779
22795
|
}, resolveRelativeImport = (relPath, fileDir, projectRoot, extensions) => {
|
|
22780
|
-
const absPath =
|
|
22781
|
-
const rel =
|
|
22796
|
+
const absPath = resolve38(fileDir, relPath);
|
|
22797
|
+
const rel = relative15(projectRoot, absPath);
|
|
22782
22798
|
const extension = extname10(rel);
|
|
22783
22799
|
let srcPath = RESOLVED_MODULE_EXTENSIONS.has(extension) ? rel : resolveRelativeExtension(rel, projectRoot, extensions);
|
|
22784
22800
|
if (extname10(srcPath) === ".svelte") {
|
|
22785
|
-
srcPath =
|
|
22801
|
+
srcPath = relative15(projectRoot, resolveSvelteModulePath(resolve38(projectRoot, srcPath)));
|
|
22786
22802
|
}
|
|
22787
22803
|
return srcUrl(srcPath, projectRoot);
|
|
22788
22804
|
}, NODE_BUILTIN_RE, resolveAbsoluteSpecifier = (specifier, projectRoot) => {
|
|
@@ -22794,27 +22810,27 @@ ${stubs}
|
|
|
22794
22810
|
"import"
|
|
22795
22811
|
]);
|
|
22796
22812
|
if (fromExports)
|
|
22797
|
-
return
|
|
22813
|
+
return relative15(projectRoot, fromExports);
|
|
22798
22814
|
try {
|
|
22799
22815
|
const isScoped = specifier.startsWith("@");
|
|
22800
22816
|
const parts = specifier.split("/");
|
|
22801
22817
|
const packageName = isScoped ? `${parts[0]}/${parts[1]}` : parts[0];
|
|
22802
22818
|
const subpath = isScoped ? parts.slice(2).join("/") : parts.slice(1).join("/");
|
|
22803
22819
|
if (!subpath) {
|
|
22804
|
-
const pkgDir =
|
|
22820
|
+
const pkgDir = resolve38(projectRoot, "node_modules", packageName ?? "");
|
|
22805
22821
|
const pkgJsonPath = join40(pkgDir, "package.json");
|
|
22806
22822
|
if (existsSync31(pkgJsonPath)) {
|
|
22807
22823
|
const pkg = JSON.parse(readFileSync24(pkgJsonPath, "utf-8"));
|
|
22808
22824
|
const esmEntry = typeof pkg.module === "string" && pkg.module || typeof pkg.browser === "string" && pkg.browser;
|
|
22809
22825
|
if (esmEntry) {
|
|
22810
|
-
const resolved =
|
|
22826
|
+
const resolved = resolve38(pkgDir, esmEntry);
|
|
22811
22827
|
if (existsSync31(resolved))
|
|
22812
|
-
return
|
|
22828
|
+
return relative15(projectRoot, resolved);
|
|
22813
22829
|
}
|
|
22814
22830
|
}
|
|
22815
22831
|
}
|
|
22816
22832
|
} catch {}
|
|
22817
|
-
return
|
|
22833
|
+
return relative15(projectRoot, Bun.resolveSync(specifier, projectRoot));
|
|
22818
22834
|
} catch {
|
|
22819
22835
|
return;
|
|
22820
22836
|
}
|
|
@@ -22845,22 +22861,22 @@ ${stubs}
|
|
|
22845
22861
|
result = result.replace(/(import\s*["'])(\.\.?\/[^"']+)(["']\s*;?)/g, (_match, prefix, relPath, suffix) => `${prefix}${resolveRelativeImport(relPath, fileDir, projectRoot, SIDE_EFFECT_EXTENSIONS)}${suffix}`);
|
|
22846
22862
|
const rewriteAbsoluteToSrc = (_match, prefix, absPath, _ext, suffix) => {
|
|
22847
22863
|
if (absPath.startsWith(projectRoot)) {
|
|
22848
|
-
const rel2 =
|
|
22864
|
+
const rel2 = relative15(projectRoot, absPath).replace(/\\/g, "/");
|
|
22849
22865
|
return `${prefix}${srcUrl(rel2, projectRoot)}${suffix}`;
|
|
22850
22866
|
}
|
|
22851
|
-
const rel =
|
|
22867
|
+
const rel = relative15(projectRoot, absPath).replace(/\\/g, "/");
|
|
22852
22868
|
return `${prefix}${srcUrl(rel, projectRoot)}${suffix}`;
|
|
22853
22869
|
};
|
|
22854
22870
|
result = result.replace(/((?:from|import)\s*["'])(\/[^"']+\.(tsx?|jsx?|ts))(["'])/g, rewriteAbsoluteToSrc);
|
|
22855
22871
|
result = result.replace(/(import\s*\(\s*["'])(\/[^"']+\.(tsx?|jsx?|ts))(["']\s*\))/g, rewriteAbsoluteToSrc);
|
|
22856
22872
|
result = result.replace(/new\s+URL\(\s*["'](\.\.?\/[^"']+)["']\s*,\s*import\.meta\.url\s*\)/g, (_match, relPath) => {
|
|
22857
|
-
const absPath =
|
|
22858
|
-
const rel =
|
|
22873
|
+
const absPath = resolve38(fileDir, relPath);
|
|
22874
|
+
const rel = relative15(projectRoot, absPath);
|
|
22859
22875
|
return `new URL('${srcUrl(rel, projectRoot)}', import.meta.url)`;
|
|
22860
22876
|
});
|
|
22861
22877
|
result = result.replace(/import\.meta\.resolve\(\s*["'](\.\.?\/[^"']+)["']\s*\)/g, (_match, relPath) => {
|
|
22862
|
-
const absPath =
|
|
22863
|
-
const rel =
|
|
22878
|
+
const absPath = resolve38(fileDir, relPath);
|
|
22879
|
+
const rel = relative15(projectRoot, absPath);
|
|
22864
22880
|
return `'${srcUrl(rel, projectRoot)}'`;
|
|
22865
22881
|
});
|
|
22866
22882
|
return result;
|
|
@@ -22916,7 +22932,7 @@ ${code}`;
|
|
|
22916
22932
|
transpiled = `var $RefreshReg$ = window.$RefreshReg$ || function(){};
|
|
22917
22933
|
` + `var $RefreshSig$ = window.$RefreshSig$ || function(){ return function(t){ return t; }; };
|
|
22918
22934
|
${transpiled}`;
|
|
22919
|
-
const relPath =
|
|
22935
|
+
const relPath = relative15(projectRoot, filePath).replace(/\\/g, "/");
|
|
22920
22936
|
transpiled = transpiled.replace(/\binput\.tsx:/g, `${relPath}:`);
|
|
22921
22937
|
transpiled += buildIslandMetadataExports(raw);
|
|
22922
22938
|
return rewriteImports(transpiled, filePath, projectRoot, rewriter);
|
|
@@ -23077,11 +23093,11 @@ ${code}`;
|
|
|
23077
23093
|
if (compiled.css?.code) {
|
|
23078
23094
|
const cssPath = `${filePath}.css`;
|
|
23079
23095
|
svelteExternalCss.set(cssPath, compiled.css.code);
|
|
23080
|
-
const cssUrl = srcUrl(
|
|
23096
|
+
const cssUrl = srcUrl(relative15(projectRoot, cssPath), projectRoot);
|
|
23081
23097
|
code = `import "${cssUrl}";
|
|
23082
23098
|
${code}`;
|
|
23083
23099
|
}
|
|
23084
|
-
const moduleUrl = `${SRC_PREFIX}${
|
|
23100
|
+
const moduleUrl = `${SRC_PREFIX}${relative15(projectRoot, filePath).replace(/\\/g, "/")}`;
|
|
23085
23101
|
code = code.replace(/if\s*\(import\.meta\.hot\)\s*\{/, `if (typeof window !== "undefined") {
|
|
23086
23102
|
` + ` if (!window.__SVELTE_HMR_ACCEPT__) window.__SVELTE_HMR_ACCEPT__ = {};
|
|
23087
23103
|
` + ` var __hmr_accept = function(cb) { window.__SVELTE_HMR_ACCEPT__[${JSON.stringify(moduleUrl)}] = cb; };`);
|
|
@@ -23172,8 +23188,8 @@ ${code}`;
|
|
|
23172
23188
|
code = injectVueHmr(code, filePath, projectRoot, vueDir);
|
|
23173
23189
|
return rewriteImports(code, filePath, projectRoot, rewriter);
|
|
23174
23190
|
}, injectVueHmr = (code, filePath, projectRoot, vueDir) => {
|
|
23175
|
-
const hmrBase = vueDir ?
|
|
23176
|
-
const hmrId =
|
|
23191
|
+
const hmrBase = vueDir ? resolve38(vueDir) : projectRoot;
|
|
23192
|
+
const hmrId = relative15(hmrBase, filePath).replace(/\\/g, "/").replace(/\.vue$/, "");
|
|
23177
23193
|
let result = code.replace(/export\s+default\s+/, "var __hmr_comp__ = ");
|
|
23178
23194
|
result += [
|
|
23179
23195
|
"",
|
|
@@ -23336,7 +23352,7 @@ export default {};
|
|
|
23336
23352
|
const escaped = virtualCss.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$/g, "\\$");
|
|
23337
23353
|
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);`);
|
|
23338
23354
|
}, resolveSourcePath = (relPath, projectRoot) => {
|
|
23339
|
-
const filePath =
|
|
23355
|
+
const filePath = resolve38(projectRoot, relPath);
|
|
23340
23356
|
const ext = extname10(filePath);
|
|
23341
23357
|
if (ext === ".svelte")
|
|
23342
23358
|
return { ext, filePath: resolveSvelteModulePath(filePath) };
|
|
@@ -23373,14 +23389,14 @@ export default {};
|
|
|
23373
23389
|
const absoluteCandidate = "/" + tail.replace(/^\/+/, "");
|
|
23374
23390
|
const candidates = [
|
|
23375
23391
|
absoluteCandidate,
|
|
23376
|
-
|
|
23392
|
+
resolve38(projectRoot, tail)
|
|
23377
23393
|
];
|
|
23378
23394
|
try {
|
|
23379
23395
|
const { loadConfig: loadConfig2 } = await Promise.resolve().then(() => (init_loadConfig(), exports_loadConfig));
|
|
23380
23396
|
const cfg = await loadConfig2();
|
|
23381
|
-
const angularDir = cfg.angularDirectory &&
|
|
23397
|
+
const angularDir = cfg.angularDirectory && resolve38(projectRoot, cfg.angularDirectory);
|
|
23382
23398
|
if (angularDir)
|
|
23383
|
-
candidates.push(
|
|
23399
|
+
candidates.push(resolve38(angularDir, tail));
|
|
23384
23400
|
} catch {}
|
|
23385
23401
|
for (const candidate of candidates) {
|
|
23386
23402
|
if (await fileExists(candidate)) {
|
|
@@ -23411,7 +23427,7 @@ export default {};
|
|
|
23411
23427
|
if (!TRANSPILABLE.has(ext))
|
|
23412
23428
|
return;
|
|
23413
23429
|
const stat3 = statSync6(filePath);
|
|
23414
|
-
const resolvedVueDir = vueDir ?
|
|
23430
|
+
const resolvedVueDir = vueDir ? resolve38(vueDir) : undefined;
|
|
23415
23431
|
let content = REACT_EXTENSIONS.has(ext) ? transformReactFile(filePath, projectRoot, rewriter) : transformPlainFile(filePath, projectRoot, rewriter, resolvedVueDir);
|
|
23416
23432
|
const isAngularGeneratedJs = ext === ".js" && filePath.replace(/\\/g, "/").includes("/.absolutejs/generated/angular/");
|
|
23417
23433
|
if (isAngularGeneratedJs) {
|
|
@@ -23470,7 +23486,7 @@ export default {};
|
|
|
23470
23486
|
const relPath = pathname.slice(SRC_PREFIX.length);
|
|
23471
23487
|
if (relPath === "bun:wrap" || relPath.startsWith("bun:wrap?"))
|
|
23472
23488
|
return handleBunWrapRequest();
|
|
23473
|
-
const virtualCssResponse = handleVirtualSvelteCss(
|
|
23489
|
+
const virtualCssResponse = handleVirtualSvelteCss(resolve38(projectRoot, relPath));
|
|
23474
23490
|
if (virtualCssResponse)
|
|
23475
23491
|
return virtualCssResponse;
|
|
23476
23492
|
const { filePath, ext } = resolveSourcePath(relPath, projectRoot);
|
|
@@ -23486,11 +23502,11 @@ export default {};
|
|
|
23486
23502
|
SRC_IMPORT_RE.lastIndex = 0;
|
|
23487
23503
|
while ((match = SRC_IMPORT_RE.exec(content)) !== null) {
|
|
23488
23504
|
if (match[1])
|
|
23489
|
-
files.push(
|
|
23505
|
+
files.push(resolve38(projectRoot, match[1]));
|
|
23490
23506
|
}
|
|
23491
23507
|
return files;
|
|
23492
23508
|
}, invalidateModule = (filePath) => {
|
|
23493
|
-
const resolved =
|
|
23509
|
+
const resolved = resolve38(filePath);
|
|
23494
23510
|
invalidate(filePath);
|
|
23495
23511
|
if (resolved !== filePath)
|
|
23496
23512
|
invalidate(resolved);
|
|
@@ -23635,7 +23651,7 @@ __export(exports_hmrCompiler, {
|
|
|
23635
23651
|
getApplyMetadataModule: () => getApplyMetadataModule,
|
|
23636
23652
|
encodeHmrComponentId: () => encodeHmrComponentId
|
|
23637
23653
|
});
|
|
23638
|
-
import { dirname as dirname25, relative as
|
|
23654
|
+
import { dirname as dirname25, relative as relative16, resolve as resolve39 } from "path";
|
|
23639
23655
|
import { performance as performance2 } from "perf_hooks";
|
|
23640
23656
|
var getApplyMetadataModule = async (encodedId) => {
|
|
23641
23657
|
const decoded = decodeURIComponent(encodedId);
|
|
@@ -23644,8 +23660,8 @@ var getApplyMetadataModule = async (encodedId) => {
|
|
|
23644
23660
|
return null;
|
|
23645
23661
|
const filePathRel = decoded.slice(0, at2);
|
|
23646
23662
|
const className = decoded.slice(at2 + 1);
|
|
23647
|
-
const componentFilePath =
|
|
23648
|
-
const projectRelPath =
|
|
23663
|
+
const componentFilePath = resolve39(process.cwd(), filePathRel);
|
|
23664
|
+
const projectRelPath = relative16(process.cwd(), componentFilePath).replace(/\\/g, "/");
|
|
23649
23665
|
const cacheKey2 = encodeURIComponent(`${projectRelPath}@${className}`);
|
|
23650
23666
|
const { takePendingModule: takePendingModule2 } = await Promise.resolve().then(() => (init_fastHmrCompiler(), exports_fastHmrCompiler));
|
|
23651
23667
|
const cached = takePendingModule2(cacheKey2);
|
|
@@ -23667,7 +23683,7 @@ var getApplyMetadataModule = async (encodedId) => {
|
|
|
23667
23683
|
}
|
|
23668
23684
|
return null;
|
|
23669
23685
|
}, encodeHmrComponentId = (absoluteFilePath, className) => {
|
|
23670
|
-
const projectRel =
|
|
23686
|
+
const projectRel = relative16(process.cwd(), absoluteFilePath).replace(/\\/g, "/");
|
|
23671
23687
|
return `${projectRel}@${className}`;
|
|
23672
23688
|
};
|
|
23673
23689
|
var init_hmrCompiler = __esm(() => {
|
|
@@ -23806,11 +23822,11 @@ var exports_simpleHTMLHMR = {};
|
|
|
23806
23822
|
__export(exports_simpleHTMLHMR, {
|
|
23807
23823
|
handleHTMLUpdate: () => handleHTMLUpdate
|
|
23808
23824
|
});
|
|
23809
|
-
import { resolve as
|
|
23825
|
+
import { resolve as resolve40 } from "path";
|
|
23810
23826
|
var handleHTMLUpdate = async (htmlFilePath) => {
|
|
23811
23827
|
let htmlContent;
|
|
23812
23828
|
try {
|
|
23813
|
-
const resolvedPath =
|
|
23829
|
+
const resolvedPath = resolve40(htmlFilePath);
|
|
23814
23830
|
const file4 = Bun.file(resolvedPath);
|
|
23815
23831
|
if (!await file4.exists()) {
|
|
23816
23832
|
return null;
|
|
@@ -23836,11 +23852,11 @@ var exports_simpleHTMXHMR = {};
|
|
|
23836
23852
|
__export(exports_simpleHTMXHMR, {
|
|
23837
23853
|
handleHTMXUpdate: () => handleHTMXUpdate
|
|
23838
23854
|
});
|
|
23839
|
-
import { resolve as
|
|
23855
|
+
import { resolve as resolve41 } from "path";
|
|
23840
23856
|
var handleHTMXUpdate = async (htmxFilePath) => {
|
|
23841
23857
|
let htmlContent;
|
|
23842
23858
|
try {
|
|
23843
|
-
const resolvedPath =
|
|
23859
|
+
const resolvedPath = resolve41(htmxFilePath);
|
|
23844
23860
|
const file4 = Bun.file(resolvedPath);
|
|
23845
23861
|
if (!await file4.exists()) {
|
|
23846
23862
|
return null;
|
|
@@ -23863,7 +23879,7 @@ var init_simpleHTMXHMR = () => {};
|
|
|
23863
23879
|
|
|
23864
23880
|
// src/dev/rebuildTrigger.ts
|
|
23865
23881
|
import { existsSync as existsSync32, rmSync as rmSync3 } from "fs";
|
|
23866
|
-
import { basename as basename13, dirname as dirname26, join as join41, relative as
|
|
23882
|
+
import { basename as basename13, dirname as dirname26, join as join41, relative as relative17, resolve as resolve42, sep as sep4 } from "path";
|
|
23867
23883
|
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) => {
|
|
23868
23884
|
if (!config.tailwind)
|
|
23869
23885
|
return;
|
|
@@ -23875,7 +23891,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
23875
23891
|
if (!cssChanged)
|
|
23876
23892
|
return;
|
|
23877
23893
|
try {
|
|
23878
|
-
const outputPath =
|
|
23894
|
+
const outputPath = resolve42(state.resolvedPaths.buildDir, config.tailwind.output);
|
|
23879
23895
|
const bytes = await Bun.file(outputPath).bytes();
|
|
23880
23896
|
const webPath = `/${config.tailwind.output.replace(/^\/+/, "")}`;
|
|
23881
23897
|
state.assetStore.set(webPath, bytes);
|
|
@@ -23965,12 +23981,12 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
23965
23981
|
}, isValidDeletedAffectedFile = (affectedFile, deletedPathResolved, processedFiles) => affectedFile !== deletedPathResolved && !processedFiles.has(affectedFile) && existsSync32(affectedFile), FRAMEWORK_DIR_KEYS_FOR_CLEANUP, removeStaleGenerated = (state, deletedFile) => {
|
|
23966
23982
|
const config = state.config;
|
|
23967
23983
|
const cwd2 = process.cwd();
|
|
23968
|
-
const absDeleted =
|
|
23984
|
+
const absDeleted = resolve42(deletedFile).replace(/\\/g, "/");
|
|
23969
23985
|
for (const { configKey, framework } of FRAMEWORK_DIR_KEYS_FOR_CLEANUP) {
|
|
23970
23986
|
const dir = config[configKey];
|
|
23971
23987
|
if (!dir)
|
|
23972
23988
|
continue;
|
|
23973
|
-
const absDir =
|
|
23989
|
+
const absDir = resolve42(cwd2, dir).replace(/\\/g, "/");
|
|
23974
23990
|
if (!absDeleted.startsWith(`${absDir}/`))
|
|
23975
23991
|
continue;
|
|
23976
23992
|
const rel = absDeleted.slice(absDir.length + 1);
|
|
@@ -23994,7 +24010,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
23994
24010
|
removeStaleGenerated(state, filePathInSet);
|
|
23995
24011
|
try {
|
|
23996
24012
|
const affectedFiles = getAffectedFiles(state.dependencyGraph, filePathInSet);
|
|
23997
|
-
const deletedPathResolved =
|
|
24013
|
+
const deletedPathResolved = resolve42(filePathInSet);
|
|
23998
24014
|
affectedFiles.forEach((affectedFile) => {
|
|
23999
24015
|
if (isValidDeletedAffectedFile(affectedFile, deletedPathResolved, processedFiles)) {
|
|
24000
24016
|
validFiles.push(affectedFile);
|
|
@@ -24038,7 +24054,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24038
24054
|
if (storedHash !== undefined && storedHash === fileHash) {
|
|
24039
24055
|
return;
|
|
24040
24056
|
}
|
|
24041
|
-
const normalizedFilePath =
|
|
24057
|
+
const normalizedFilePath = resolve42(filePathInSet);
|
|
24042
24058
|
if (!processedFiles.has(normalizedFilePath)) {
|
|
24043
24059
|
validFiles.push(normalizedFilePath);
|
|
24044
24060
|
processedFiles.add(normalizedFilePath);
|
|
@@ -24176,7 +24192,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24176
24192
|
const publicDir = state.resolvedPaths.publicDir;
|
|
24177
24193
|
const assetsDir = state.resolvedPaths.assetsDir;
|
|
24178
24194
|
const handleStaticMirror = async (sourceDir, urlPrefix) => {
|
|
24179
|
-
const absSource =
|
|
24195
|
+
const absSource = resolve42(filePath);
|
|
24180
24196
|
const normalizedSource = absSource.replace(/\\/g, "/");
|
|
24181
24197
|
const normalizedDir = sourceDir.replace(/\\/g, "/");
|
|
24182
24198
|
if (!normalizedSource.startsWith(normalizedDir + "/"))
|
|
@@ -24184,7 +24200,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24184
24200
|
try {
|
|
24185
24201
|
const relFromDir = normalizedSource.slice(normalizedDir.length + 1);
|
|
24186
24202
|
const buildDir = state.resolvedPaths.buildDir;
|
|
24187
|
-
const destPath =
|
|
24203
|
+
const destPath = resolve42(buildDir, urlPrefix ? `${urlPrefix}/${relFromDir}` : relFromDir);
|
|
24188
24204
|
const { mkdir: mkdir7, copyFile, readFile: readFile6 } = await import("fs/promises");
|
|
24189
24205
|
const { dirname: dirname27 } = await import("path");
|
|
24190
24206
|
await mkdir7(dirname27(destPath), { recursive: true });
|
|
@@ -24193,7 +24209,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24193
24209
|
const webPath = urlPrefix ? `/${urlPrefix}/${relFromDir}` : `/${relFromDir}`;
|
|
24194
24210
|
state.assetStore.set(webPath, new Uint8Array(bytes));
|
|
24195
24211
|
state.fileHashes.set(absSource, currentHash);
|
|
24196
|
-
logHmrUpdate(
|
|
24212
|
+
logHmrUpdate(relative17(process.cwd(), filePath));
|
|
24197
24213
|
broadcastToClients(state, {
|
|
24198
24214
|
data: {
|
|
24199
24215
|
framework: urlPrefix || "public",
|
|
@@ -24210,18 +24226,18 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24210
24226
|
if (assetsDir && await handleStaticMirror(assetsDir, "assets"))
|
|
24211
24227
|
return;
|
|
24212
24228
|
if (framework === "unknown") {
|
|
24213
|
-
invalidate(
|
|
24214
|
-
const relPath =
|
|
24229
|
+
invalidate(resolve42(filePath));
|
|
24230
|
+
const relPath = relative17(process.cwd(), filePath);
|
|
24215
24231
|
logHmrUpdate(relPath);
|
|
24216
24232
|
const angularDir = state.resolvedPaths.angularDir;
|
|
24217
24233
|
let hasAngularDependent = false;
|
|
24218
24234
|
if (angularDir && state.dependencyGraph) {
|
|
24219
24235
|
try {
|
|
24220
24236
|
const { addFileToGraph: addFileToGraph2 } = await Promise.resolve().then(() => (init_dependencyGraph(), exports_dependencyGraph));
|
|
24221
|
-
addFileToGraph2(state.dependencyGraph,
|
|
24222
|
-
const affected = getAffectedFiles(state.dependencyGraph,
|
|
24237
|
+
addFileToGraph2(state.dependencyGraph, resolve42(filePath));
|
|
24238
|
+
const affected = getAffectedFiles(state.dependencyGraph, resolve42(filePath));
|
|
24223
24239
|
for (const dependent of affected) {
|
|
24224
|
-
if (dependent ===
|
|
24240
|
+
if (dependent === resolve42(filePath))
|
|
24225
24241
|
continue;
|
|
24226
24242
|
const dependentFramework = detectFramework(dependent, state.resolvedPaths);
|
|
24227
24243
|
if (dependentFramework !== "angular")
|
|
@@ -24238,14 +24254,14 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24238
24254
|
} catch {}
|
|
24239
24255
|
}
|
|
24240
24256
|
if (!hasAngularDependent) {
|
|
24241
|
-
console.log(`[abs:restart] ${
|
|
24257
|
+
console.log(`[abs:restart] ${resolve42(filePath)}`);
|
|
24242
24258
|
return;
|
|
24243
24259
|
}
|
|
24244
24260
|
try {
|
|
24245
24261
|
const { getFrameworkGeneratedDir: getFrameworkGeneratedDir2 } = await Promise.resolve().then(() => (init_generatedDir(), exports_generatedDir));
|
|
24246
24262
|
const { invalidateModule: invalidateModuleServer } = await Promise.resolve().then(() => (init_moduleServer(), exports_moduleServer));
|
|
24247
24263
|
const generatedAngularRoot = getFrameworkGeneratedDir2("angular");
|
|
24248
|
-
const sourceAbs =
|
|
24264
|
+
const sourceAbs = resolve42(filePath).replace(/\\/g, "/");
|
|
24249
24265
|
const generatedTwin = `${generatedAngularRoot.replace(/\\/g, "/")}${sourceAbs.replace(/\.ts$/, ".js")}`;
|
|
24250
24266
|
invalidateModuleServer(generatedTwin);
|
|
24251
24267
|
} catch {}
|
|
@@ -24279,7 +24295,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24279
24295
|
const userEditedFiles = new Set;
|
|
24280
24296
|
state.fileChangeQueue.forEach((filePaths) => {
|
|
24281
24297
|
for (const filePath2 of filePaths) {
|
|
24282
|
-
userEditedFiles.add(
|
|
24298
|
+
userEditedFiles.add(resolve42(filePath2));
|
|
24283
24299
|
}
|
|
24284
24300
|
});
|
|
24285
24301
|
state.lastUserEditedFiles = userEditedFiles;
|
|
@@ -24308,7 +24324,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24308
24324
|
}
|
|
24309
24325
|
if (!graph)
|
|
24310
24326
|
return componentFile;
|
|
24311
|
-
const dependents = graph.dependents.get(
|
|
24327
|
+
const dependents = graph.dependents.get(resolve42(componentFile));
|
|
24312
24328
|
if (!dependents)
|
|
24313
24329
|
return componentFile;
|
|
24314
24330
|
for (const dep of dependents) {
|
|
@@ -24317,7 +24333,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24317
24333
|
}
|
|
24318
24334
|
return componentFile;
|
|
24319
24335
|
}, resolveAngularPageEntries = (state, angularFiles, angularPagesPath) => {
|
|
24320
|
-
const pageEntries = angularFiles.filter((file4) => file4.endsWith(".ts") &&
|
|
24336
|
+
const pageEntries = angularFiles.filter((file4) => file4.endsWith(".ts") && resolve42(file4).startsWith(angularPagesPath));
|
|
24321
24337
|
if (pageEntries.length > 0 || !state.dependencyGraph) {
|
|
24322
24338
|
return pageEntries;
|
|
24323
24339
|
}
|
|
@@ -24326,7 +24342,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24326
24342
|
const lookupFile = resolveComponentLookupFile(componentFile, state.dependencyGraph);
|
|
24327
24343
|
const affected = getAffectedFiles(state.dependencyGraph, lookupFile);
|
|
24328
24344
|
affected.forEach((file4) => {
|
|
24329
|
-
if (file4.endsWith(".ts") &&
|
|
24345
|
+
if (file4.endsWith(".ts") && resolve42(file4).startsWith(angularPagesPath)) {
|
|
24330
24346
|
resolvedPages.add(file4);
|
|
24331
24347
|
}
|
|
24332
24348
|
});
|
|
@@ -24367,8 +24383,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24367
24383
|
if (serverDirs.length <= 1) {
|
|
24368
24384
|
const dir = getFrameworkGeneratedDir2(framework, projectRoot);
|
|
24369
24385
|
return {
|
|
24370
|
-
serverOutDir:
|
|
24371
|
-
serverRoot:
|
|
24386
|
+
serverOutDir: resolve42(resolvedPaths.buildDir, basename13(dir)),
|
|
24387
|
+
serverRoot: resolve42(dir, "server")
|
|
24372
24388
|
};
|
|
24373
24389
|
}
|
|
24374
24390
|
return {
|
|
@@ -24529,8 +24545,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24529
24545
|
if (detected !== "unknown")
|
|
24530
24546
|
continue;
|
|
24531
24547
|
try {
|
|
24532
|
-
const affected = getAffectedFiles(state.dependencyGraph,
|
|
24533
|
-
const hasAngularConsumer = affected.some((dep) => dep !==
|
|
24548
|
+
const affected = getAffectedFiles(state.dependencyGraph, resolve42(editedFile));
|
|
24549
|
+
const hasAngularConsumer = affected.some((dep) => dep !== resolve42(editedFile) && detectFramework(dep, state.resolvedPaths) === "angular");
|
|
24534
24550
|
if (hasAngularConsumer) {
|
|
24535
24551
|
return {
|
|
24536
24552
|
kind: "rebootstrap",
|
|
@@ -24577,7 +24593,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24577
24593
|
}
|
|
24578
24594
|
if (owners.length === 0 && (editedFile.endsWith(".ts") || editedFile.endsWith(".json")) && !editedFile.endsWith(".d.ts")) {
|
|
24579
24595
|
const normalized = editedFile.replace(/\\/g, "/");
|
|
24580
|
-
const angularDirAbs =
|
|
24596
|
+
const angularDirAbs = resolve42(angularDir).replace(/\\/g, "/");
|
|
24581
24597
|
if (normalized.startsWith(angularDirAbs + "/")) {
|
|
24582
24598
|
return {
|
|
24583
24599
|
kind: "rebootstrap",
|
|
@@ -24720,16 +24736,16 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24720
24736
|
};
|
|
24721
24737
|
const fire = () => {
|
|
24722
24738
|
ctx.debounceTimer = null;
|
|
24723
|
-
const
|
|
24739
|
+
const resolve43 = ctx.debouncedResolve;
|
|
24724
24740
|
ctx.debouncedResolve = null;
|
|
24725
24741
|
ctx.debouncedPromise = null;
|
|
24726
24742
|
if (ctx.inFlight) {
|
|
24727
24743
|
ctx.pending = true;
|
|
24728
|
-
ctx.inFlight.finally(() =>
|
|
24744
|
+
ctx.inFlight.finally(() => resolve43?.());
|
|
24729
24745
|
return;
|
|
24730
24746
|
}
|
|
24731
24747
|
ctx.inFlight = drive();
|
|
24732
|
-
ctx.inFlight.finally(() =>
|
|
24748
|
+
ctx.inFlight.finally(() => resolve43?.());
|
|
24733
24749
|
};
|
|
24734
24750
|
return ({ immediate = false } = {}) => {
|
|
24735
24751
|
if (!ctx.debouncedPromise) {
|
|
@@ -24756,9 +24772,9 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24756
24772
|
const diskRefreshPromise = (async () => {
|
|
24757
24773
|
if (!angularDir || editedFiles.size === 0)
|
|
24758
24774
|
return;
|
|
24759
|
-
const angularDirAbs =
|
|
24775
|
+
const angularDirAbs = resolve42(angularDir);
|
|
24760
24776
|
const filesUnderAngular = Array.from(editedFiles).filter((file4) => {
|
|
24761
|
-
const abs =
|
|
24777
|
+
const abs = resolve42(file4);
|
|
24762
24778
|
return abs === angularDirAbs || abs.startsWith(angularDirAbs + sep4);
|
|
24763
24779
|
});
|
|
24764
24780
|
if (filesUnderAngular.length === 0)
|
|
@@ -24780,7 +24796,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24780
24796
|
if (!ext)
|
|
24781
24797
|
continue;
|
|
24782
24798
|
if (ext === ".ts" || ext === ".tsx") {
|
|
24783
|
-
tsFilesToRefresh.add(
|
|
24799
|
+
tsFilesToRefresh.add(resolve42(file4));
|
|
24784
24800
|
continue;
|
|
24785
24801
|
}
|
|
24786
24802
|
const owners = resolveOwningComponents2({
|
|
@@ -24788,7 +24804,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24788
24804
|
userAngularRoot: angularDirAbs
|
|
24789
24805
|
});
|
|
24790
24806
|
for (const owner of owners) {
|
|
24791
|
-
tsFilesToRefresh.add(
|
|
24807
|
+
tsFilesToRefresh.add(resolve42(owner.componentFilePath));
|
|
24792
24808
|
}
|
|
24793
24809
|
}
|
|
24794
24810
|
if (tsFilesToRefresh.size === 0)
|
|
@@ -24802,8 +24818,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24802
24818
|
try {
|
|
24803
24819
|
const { invalidateModule: invalidateModule2 } = await Promise.resolve().then(() => (init_moduleServer(), exports_moduleServer));
|
|
24804
24820
|
for (const tsFile of tsFilesToRefresh) {
|
|
24805
|
-
const rel =
|
|
24806
|
-
const compiledFile =
|
|
24821
|
+
const rel = relative17(angularDirAbs, tsFile).replace(/\\/g, "/").replace(/\.[tj]sx?$/, ".js");
|
|
24822
|
+
const compiledFile = resolve42(compiledRoot, rel);
|
|
24807
24823
|
invalidateModule2(compiledFile);
|
|
24808
24824
|
}
|
|
24809
24825
|
} catch {}
|
|
@@ -24854,7 +24870,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24854
24870
|
serverPaths.forEach((serverPath, idx) => {
|
|
24855
24871
|
const fileBase = basename13(serverPath, ".js");
|
|
24856
24872
|
const ssrPath = ssrPaths[idx] ?? serverPath;
|
|
24857
|
-
state.manifest[toPascal(fileBase)] =
|
|
24873
|
+
state.manifest[toPascal(fileBase)] = resolve42(ssrPath);
|
|
24858
24874
|
});
|
|
24859
24875
|
if (clientPaths.length > 0) {
|
|
24860
24876
|
await bundleAngularClient(state, clientPaths, state.resolvedPaths.buildDir, angularDir);
|
|
@@ -24867,9 +24883,9 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24867
24883
|
const angularDir = config.angularDirectory ?? "";
|
|
24868
24884
|
const angularFiles = filesToRebuild.filter((file4) => detectFramework(file4, state.resolvedPaths) === "angular");
|
|
24869
24885
|
for (const file4 of angularFiles) {
|
|
24870
|
-
state.fileHashes.set(
|
|
24886
|
+
state.fileHashes.set(resolve42(file4), computeFileHash(file4));
|
|
24871
24887
|
}
|
|
24872
|
-
const angularPagesPath =
|
|
24888
|
+
const angularPagesPath = resolve42(angularDir, "pages");
|
|
24873
24889
|
const pageEntries = resolveAngularPageEntries(state, angularFiles, angularPagesPath);
|
|
24874
24890
|
const tierStart = performance.now();
|
|
24875
24891
|
const verdict = await decideAngularTier(state, angularDir);
|
|
@@ -24901,7 +24917,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24901
24917
|
}, getModuleUrl = async (pageFile) => {
|
|
24902
24918
|
const { invalidateModule: invalidateModule2, warmCache: warmCache2, SRC_URL_PREFIX: SRC_URL_PREFIX2 } = await Promise.resolve().then(() => (init_moduleServer(), exports_moduleServer));
|
|
24903
24919
|
invalidateModule2(pageFile);
|
|
24904
|
-
const rel =
|
|
24920
|
+
const rel = relative17(process.cwd(), pageFile).replace(/\\/g, "/");
|
|
24905
24921
|
const url = `${SRC_URL_PREFIX2}${rel}`;
|
|
24906
24922
|
warmCache2(url);
|
|
24907
24923
|
return url;
|
|
@@ -24910,11 +24926,11 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24910
24926
|
if (isComponentFile2)
|
|
24911
24927
|
return primaryFile;
|
|
24912
24928
|
const { findNearestComponent: findNearestComponent2 } = await Promise.resolve().then(() => (init_transformCache(), exports_transformCache));
|
|
24913
|
-
const nearest = findNearestComponent2(
|
|
24929
|
+
const nearest = findNearestComponent2(resolve42(primaryFile));
|
|
24914
24930
|
return nearest ?? primaryFile;
|
|
24915
24931
|
}, handleReactModuleServerPath = async (state, reactFiles, startTime, onRebuildComplete) => {
|
|
24916
24932
|
for (const file4 of reactFiles) {
|
|
24917
|
-
state.fileHashes.set(
|
|
24933
|
+
state.fileHashes.set(resolve42(file4), computeFileHash(file4));
|
|
24918
24934
|
}
|
|
24919
24935
|
const primaryFile = reactFiles.find((file4) => !file4.replace(/\\/g, "/").includes("/pages/")) ?? reactFiles[0];
|
|
24920
24936
|
if (!primaryFile) {
|
|
@@ -24932,7 +24948,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24932
24948
|
const pageModuleUrl = await getReactModuleUrl(broadcastTarget);
|
|
24933
24949
|
if (pageModuleUrl) {
|
|
24934
24950
|
const serverDuration = Date.now() - startTime;
|
|
24935
|
-
state.lastHmrPath =
|
|
24951
|
+
state.lastHmrPath = relative17(process.cwd(), primaryFile).replace(/\\/g, "/");
|
|
24936
24952
|
state.lastHmrFramework = "react";
|
|
24937
24953
|
broadcastToClients(state, {
|
|
24938
24954
|
data: {
|
|
@@ -24995,7 +25011,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24995
25011
|
});
|
|
24996
25012
|
}, handleSvelteModuleServerPath = async (state, svelteFiles, config, startTime, onRebuildComplete) => {
|
|
24997
25013
|
for (const file4 of svelteFiles) {
|
|
24998
|
-
state.fileHashes.set(
|
|
25014
|
+
state.fileHashes.set(resolve42(file4), computeFileHash(file4));
|
|
24999
25015
|
}
|
|
25000
25016
|
const serverDuration = Date.now() - startTime;
|
|
25001
25017
|
await runSequentially(svelteFiles, (changedFile) => broadcastSvelteModuleUpdate(state, changedFile, svelteFiles, serverDuration));
|
|
@@ -25242,7 +25258,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
25242
25258
|
});
|
|
25243
25259
|
}, handleVueModuleServerPath = async (state, vueFiles, nonVueFiles, config, startTime, onRebuildComplete) => {
|
|
25244
25260
|
for (const file4 of [...vueFiles, ...nonVueFiles]) {
|
|
25245
|
-
state.fileHashes.set(
|
|
25261
|
+
state.fileHashes.set(resolve42(file4), computeFileHash(file4));
|
|
25246
25262
|
}
|
|
25247
25263
|
await invalidateNonVueModules(nonVueFiles);
|
|
25248
25264
|
const serverDuration = Date.now() - startTime;
|
|
@@ -25391,7 +25407,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
25391
25407
|
recursive: true,
|
|
25392
25408
|
withFileTypes: true
|
|
25393
25409
|
});
|
|
25394
|
-
return entries.filter((entry) => entry.isFile() && EMBER_PAGE_EXTENSIONS.some((ext) => entry.name.endsWith(ext))).map((entry) =>
|
|
25410
|
+
return entries.filter((entry) => entry.isFile() && EMBER_PAGE_EXTENSIONS.some((ext) => entry.name.endsWith(ext))).map((entry) => resolve42(emberPagesPath, entry.name));
|
|
25395
25411
|
} catch {
|
|
25396
25412
|
return [];
|
|
25397
25413
|
}
|
|
@@ -25403,10 +25419,10 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
25403
25419
|
return state.manifest;
|
|
25404
25420
|
}
|
|
25405
25421
|
for (const file4 of emberFiles) {
|
|
25406
|
-
state.fileHashes.set(
|
|
25422
|
+
state.fileHashes.set(resolve42(file4), computeFileHash(file4));
|
|
25407
25423
|
}
|
|
25408
|
-
const emberPagesPath =
|
|
25409
|
-
const directPageEntries = emberFiles.filter((file4) =>
|
|
25424
|
+
const emberPagesPath = resolve42(emberDir, "pages");
|
|
25425
|
+
const directPageEntries = emberFiles.filter((file4) => resolve42(file4).startsWith(emberPagesPath));
|
|
25410
25426
|
const allPageEntries = directPageEntries.length > 0 ? directPageEntries : await collectAllEmberPages(emberPagesPath);
|
|
25411
25427
|
if (allPageEntries.length === 0) {
|
|
25412
25428
|
onRebuildComplete({ hmrState: state, manifest: state.manifest });
|
|
@@ -25416,14 +25432,14 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
25416
25432
|
const { serverPaths } = await compileEmber2(allPageEntries, emberDir, process.cwd(), true);
|
|
25417
25433
|
for (const serverPath of serverPaths) {
|
|
25418
25434
|
const fileBase = basename13(serverPath, ".js");
|
|
25419
|
-
state.manifest[toPascal(fileBase)] =
|
|
25435
|
+
state.manifest[toPascal(fileBase)] = resolve42(serverPath);
|
|
25420
25436
|
}
|
|
25421
25437
|
const { invalidateEmberSsrCache: invalidateEmberSsrCache2 } = await Promise.resolve().then(() => (init_ember(), exports_ember));
|
|
25422
25438
|
invalidateEmberSsrCache2();
|
|
25423
25439
|
const duration = Date.now() - startTime;
|
|
25424
25440
|
const [primary] = emberFiles;
|
|
25425
25441
|
if (primary) {
|
|
25426
|
-
state.lastHmrPath =
|
|
25442
|
+
state.lastHmrPath = relative17(process.cwd(), primary).replace(/\\/g, "/");
|
|
25427
25443
|
state.lastHmrFramework = "ember";
|
|
25428
25444
|
logHmrUpdate(primary, "ember", duration);
|
|
25429
25445
|
}
|
|
@@ -25508,8 +25524,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
25508
25524
|
if (!buildReference?.source) {
|
|
25509
25525
|
return;
|
|
25510
25526
|
}
|
|
25511
|
-
const sourcePath = buildReference.source.startsWith("file://") ? new URL(buildReference.source).pathname :
|
|
25512
|
-
islandFiles.add(
|
|
25527
|
+
const sourcePath = buildReference.source.startsWith("file://") ? new URL(buildReference.source).pathname : resolve42(dirname26(buildInfo.resolvedRegistryPath), buildReference.source);
|
|
25528
|
+
islandFiles.add(resolve42(sourcePath));
|
|
25513
25529
|
}, resolveIslandSourceFiles = async (config) => {
|
|
25514
25530
|
const registryPath = config.islands?.registry;
|
|
25515
25531
|
if (!registryPath) {
|
|
@@ -25517,7 +25533,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
25517
25533
|
}
|
|
25518
25534
|
const buildInfo = await loadIslandRegistryBuildInfo(registryPath);
|
|
25519
25535
|
const islandFiles = new Set([
|
|
25520
|
-
|
|
25536
|
+
resolve42(buildInfo.resolvedRegistryPath)
|
|
25521
25537
|
]);
|
|
25522
25538
|
for (const definition of buildInfo.definitions) {
|
|
25523
25539
|
resolveIslandDefinitionSource(definition, buildInfo, islandFiles);
|
|
@@ -25528,7 +25544,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
25528
25544
|
if (islandFiles.size === 0) {
|
|
25529
25545
|
return false;
|
|
25530
25546
|
}
|
|
25531
|
-
return filesToRebuild.some((file4) => islandFiles.has(
|
|
25547
|
+
return filesToRebuild.some((file4) => islandFiles.has(resolve42(file4)));
|
|
25532
25548
|
}, handleIslandSourceReload = async (state, config, filesToRebuild, manifest) => {
|
|
25533
25549
|
const shouldReload = await didStaticPagesNeedIslandRefresh(config, filesToRebuild);
|
|
25534
25550
|
if (!shouldReload) {
|
|
@@ -25563,10 +25579,10 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
25563
25579
|
}, computeOutputPagesDir = (state, config, framework) => {
|
|
25564
25580
|
const isSingle = !config.reactDirectory && !config.svelteDirectory && !config.vueDirectory && (framework === "html" ? !config.htmxDirectory : !config.htmlDirectory);
|
|
25565
25581
|
if (isSingle) {
|
|
25566
|
-
return
|
|
25582
|
+
return resolve42(state.resolvedPaths.buildDir, "pages");
|
|
25567
25583
|
}
|
|
25568
25584
|
const dirName = framework === "html" ? basename13(config.htmlDirectory ?? "html") : basename13(config.htmxDirectory ?? "htmx");
|
|
25569
|
-
return
|
|
25585
|
+
return resolve42(state.resolvedPaths.buildDir, dirName, "pages");
|
|
25570
25586
|
}, processHtmlPageUpdate = async (state, pageFile, builtHtmlPagePath, manifest, duration) => {
|
|
25571
25587
|
try {
|
|
25572
25588
|
const { handleHTMLUpdate: handleHTMLUpdate2 } = await Promise.resolve().then(() => (init_simpleHTMLHMR(), exports_simpleHTMLHMR));
|
|
@@ -25605,7 +25621,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
25605
25621
|
const pageFilesToUpdate = shouldRefreshAllPages ? await scanEntryPoints(outputHtmlPages, "*.html") : htmlPageFiles;
|
|
25606
25622
|
await runSequentially(pageFilesToUpdate, async (pageFile) => {
|
|
25607
25623
|
const htmlPageName = basename13(pageFile);
|
|
25608
|
-
const builtHtmlPagePath =
|
|
25624
|
+
const builtHtmlPagePath = resolve42(outputHtmlPages, htmlPageName);
|
|
25609
25625
|
await processHtmlPageUpdate(state, pageFile, builtHtmlPagePath, manifest, duration);
|
|
25610
25626
|
});
|
|
25611
25627
|
}, handleVueCssOnlyUpdate = (state, vueCssFiles, manifest, duration) => {
|
|
@@ -25666,11 +25682,11 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
25666
25682
|
const baseName = fileName.replace(/\.vue$/, "");
|
|
25667
25683
|
const pascalName = toPascal(baseName);
|
|
25668
25684
|
const vueRoot = config.vueDirectory;
|
|
25669
|
-
const hmrId = vueRoot ?
|
|
25685
|
+
const hmrId = vueRoot ? relative17(vueRoot, vuePagePath).replace(/\\/g, "/").replace(/\.vue$/, "") : baseName;
|
|
25670
25686
|
const cssKey = `${pascalName}CSS`;
|
|
25671
25687
|
const cssUrl = manifest[cssKey] || null;
|
|
25672
25688
|
const { vueHmrMetadata: vueHmrMetadata2 } = await Promise.resolve().then(() => (init_compileVue(), exports_compileVue));
|
|
25673
|
-
const hmrMeta = vueHmrMetadata2.get(
|
|
25689
|
+
const hmrMeta = vueHmrMetadata2.get(resolve42(vuePagePath));
|
|
25674
25690
|
const changeType = hmrMeta?.changeType ?? "full";
|
|
25675
25691
|
if (changeType === "style-only") {
|
|
25676
25692
|
broadcastVueStyleOnly(state, vuePagePath, baseName, cssUrl, hmrId, manifest, duration);
|
|
@@ -25855,7 +25871,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
25855
25871
|
const pageFilesToUpdate = shouldRefreshAllPages ? await scanEntryPoints(outputHtmxPages, "*.html") : htmxPageFiles;
|
|
25856
25872
|
await runSequentially(pageFilesToUpdate, async (htmxPageFile) => {
|
|
25857
25873
|
const htmxPageName = basename13(htmxPageFile);
|
|
25858
|
-
const builtHtmxPagePath =
|
|
25874
|
+
const builtHtmxPagePath = resolve42(outputHtmxPages, htmxPageName);
|
|
25859
25875
|
await processHtmxPageUpdate(state, htmxPageFile, builtHtmxPagePath, manifest, duration);
|
|
25860
25876
|
});
|
|
25861
25877
|
}, collectUpdatedModulePaths = (allModuleUpdates) => {
|
|
@@ -25964,7 +25980,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
25964
25980
|
html = html.slice(0, bodyClose.index) + hmrScript + html.slice(bodyClose.index);
|
|
25965
25981
|
writeFs(destPath, html);
|
|
25966
25982
|
}, processMarkupFileFastPath = async (state, sourceFile, outputDir, framework, startTime, updateAssetPaths2, handleUpdate, readFs, writeFs) => {
|
|
25967
|
-
const destPath =
|
|
25983
|
+
const destPath = resolve42(outputDir, basename13(sourceFile));
|
|
25968
25984
|
const hmrScript = extractHmrScript(destPath, readFs);
|
|
25969
25985
|
const source = await Bun.file(sourceFile).text();
|
|
25970
25986
|
await Bun.write(destPath, source);
|
|
@@ -26106,7 +26122,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
26106
26122
|
});
|
|
26107
26123
|
if (config.tailwind && filesToRebuild && filesToRebuild.some(isTailwindCandidate)) {
|
|
26108
26124
|
try {
|
|
26109
|
-
const outputPath =
|
|
26125
|
+
const outputPath = resolve42(state.resolvedPaths.buildDir, config.tailwind.output);
|
|
26110
26126
|
const bytes = await Bun.file(outputPath).bytes();
|
|
26111
26127
|
const webPath = `/${config.tailwind.output.replace(/^\/+/, "")}`;
|
|
26112
26128
|
state.assetStore.set(webPath, bytes);
|
|
@@ -26540,7 +26556,7 @@ __export(exports_devBuild, {
|
|
|
26540
26556
|
});
|
|
26541
26557
|
import { readdir as readdir5 } from "fs/promises";
|
|
26542
26558
|
import { statSync as statSync7 } from "fs";
|
|
26543
|
-
import { resolve as
|
|
26559
|
+
import { resolve as resolve43 } from "path";
|
|
26544
26560
|
var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
26545
26561
|
const configuredDirs = [
|
|
26546
26562
|
config.reactDirectory,
|
|
@@ -26563,7 +26579,7 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
26563
26579
|
return Object.keys(config).length > 0 ? config : null;
|
|
26564
26580
|
}, reloadConfig = async () => {
|
|
26565
26581
|
try {
|
|
26566
|
-
const configPath2 =
|
|
26582
|
+
const configPath2 = resolve43(process.env.ABSOLUTE_CONFIG ?? "absolute.config.ts");
|
|
26567
26583
|
const source = await Bun.file(configPath2).text();
|
|
26568
26584
|
return parseDirectoryConfig(source);
|
|
26569
26585
|
} catch {
|
|
@@ -26670,7 +26686,7 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
26670
26686
|
state.fileChangeQueue.clear();
|
|
26671
26687
|
}
|
|
26672
26688
|
}, handleCachedReload = async () => {
|
|
26673
|
-
const serverMtime = statSync7(
|
|
26689
|
+
const serverMtime = statSync7(resolve43(Bun.main)).mtimeMs;
|
|
26674
26690
|
const lastMtime = globalThis.__hmrServerMtime;
|
|
26675
26691
|
globalThis.__hmrServerMtime = serverMtime;
|
|
26676
26692
|
const cached = globalThis.__hmrDevResult;
|
|
@@ -26707,8 +26723,8 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
26707
26723
|
return true;
|
|
26708
26724
|
}, resolveAbsoluteVersion2 = async () => {
|
|
26709
26725
|
const candidates = [
|
|
26710
|
-
|
|
26711
|
-
|
|
26726
|
+
resolve43(import.meta.dir, "..", "..", "package.json"),
|
|
26727
|
+
resolve43(import.meta.dir, "..", "package.json")
|
|
26712
26728
|
];
|
|
26713
26729
|
const [candidate, ...remaining] = candidates;
|
|
26714
26730
|
if (!candidate) {
|
|
@@ -26734,7 +26750,7 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
26734
26750
|
const entries = await readdir5(vendorDir).catch(() => emptyStringArray);
|
|
26735
26751
|
await Promise.all(entries.filter((entry) => entry.endsWith(".js")).map(async (entry) => {
|
|
26736
26752
|
const webPath = `/${framework}/vendor/${entry}`;
|
|
26737
|
-
const bytes = await Bun.file(
|
|
26753
|
+
const bytes = await Bun.file(resolve43(vendorDir, entry)).bytes();
|
|
26738
26754
|
assetStore.set(webPath, bytes);
|
|
26739
26755
|
}));
|
|
26740
26756
|
}, devBuild = async (config) => {
|
|
@@ -26813,11 +26829,11 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
26813
26829
|
cleanStaleAssets(state.assetStore, manifest, state.resolvedPaths.buildDir);
|
|
26814
26830
|
recordStep("populate asset store", stepStartedAt);
|
|
26815
26831
|
stepStartedAt = performance.now();
|
|
26816
|
-
const reactVendorDir =
|
|
26817
|
-
const angularVendorDir =
|
|
26818
|
-
const svelteVendorDir =
|
|
26819
|
-
const vueVendorDir =
|
|
26820
|
-
const depVendorDir =
|
|
26832
|
+
const reactVendorDir = resolve43(state.resolvedPaths.buildDir, "react", "vendor");
|
|
26833
|
+
const angularVendorDir = resolve43(state.resolvedPaths.buildDir, "angular", "vendor");
|
|
26834
|
+
const svelteVendorDir = resolve43(state.resolvedPaths.buildDir, "svelte", "vendor");
|
|
26835
|
+
const vueVendorDir = resolve43(state.resolvedPaths.buildDir, "vue", "vendor");
|
|
26836
|
+
const depVendorDir = resolve43(state.resolvedPaths.buildDir, "vendor");
|
|
26821
26837
|
const { buildDepVendor: buildDepVendor2 } = await Promise.resolve().then(() => (init_buildDepVendor(), exports_buildDepVendor));
|
|
26822
26838
|
const [, angularSpecs, , , , , depPaths] = await Promise.all([
|
|
26823
26839
|
config.reactDirectory ? buildReactVendor(state.resolvedPaths.buildDir) : Promise.resolve(undefined),
|
|
@@ -26928,7 +26944,7 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
26928
26944
|
manifest
|
|
26929
26945
|
};
|
|
26930
26946
|
globalThis.__hmrDevResult = result;
|
|
26931
|
-
globalThis.__hmrServerMtime = statSync7(
|
|
26947
|
+
globalThis.__hmrServerMtime = statSync7(resolve43(Bun.main)).mtimeMs;
|
|
26932
26948
|
return result;
|
|
26933
26949
|
};
|
|
26934
26950
|
var init_devBuild = __esm(() => {
|
|
@@ -26968,5 +26984,5 @@ export {
|
|
|
26968
26984
|
build
|
|
26969
26985
|
};
|
|
26970
26986
|
|
|
26971
|
-
//# debugId=
|
|
26987
|
+
//# debugId=69B335409A68661664756E2164756E21
|
|
26972
26988
|
//# sourceMappingURL=build.js.map
|