@absolutejs/absolute 0.19.0-beta.973 → 0.19.0-beta.975
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 +486 -465
- package/dist/build.js.map +7 -7
- package/dist/index.js +496 -475
- package/dist/index.js.map +7 -7
- package/dist/src/build/emitAngularProvidersFiles.d.ts +2 -2
- package/dist/src/build/runAngularHandlerScan.d.ts +9 -0
- 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,9 +12211,11 @@ 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);
|
|
12216
|
+
const angularEntryAddons = providersImport ? [providersImport.absolutePath] : [];
|
|
12200
12217
|
return {
|
|
12218
|
+
angularEntryAddons,
|
|
12201
12219
|
calls,
|
|
12202
12220
|
manifestKeysWithProviders: new Set(providersFiles.map((file) => file.manifestKey)),
|
|
12203
12221
|
pageRoutes,
|
|
@@ -12358,22 +12376,22 @@ import {
|
|
|
12358
12376
|
join as join27,
|
|
12359
12377
|
basename as basename6,
|
|
12360
12378
|
extname as extname5,
|
|
12361
|
-
resolve as
|
|
12362
|
-
relative as
|
|
12379
|
+
resolve as resolve21,
|
|
12380
|
+
relative as relative10,
|
|
12363
12381
|
sep as sep2
|
|
12364
12382
|
} from "path";
|
|
12365
12383
|
import { env } from "process";
|
|
12366
12384
|
var {write: write2, file, Transpiler: Transpiler2 } = globalThis.Bun;
|
|
12367
12385
|
var resolveDevClientDir2 = () => {
|
|
12368
12386
|
const projectRoot = process.cwd();
|
|
12369
|
-
const fromSource =
|
|
12387
|
+
const fromSource = resolve21(import.meta.dir, "../dev/client");
|
|
12370
12388
|
if (existsSync20(fromSource) && fromSource.startsWith(projectRoot)) {
|
|
12371
12389
|
return fromSource;
|
|
12372
12390
|
}
|
|
12373
|
-
const fromNodeModules =
|
|
12391
|
+
const fromNodeModules = resolve21(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client");
|
|
12374
12392
|
if (existsSync20(fromNodeModules))
|
|
12375
12393
|
return fromNodeModules;
|
|
12376
|
-
return
|
|
12394
|
+
return resolve21(import.meta.dir, "./dev/client");
|
|
12377
12395
|
}, devClientDir2, hmrClientPath3, persistentCache, sourceHashCache, clearSvelteCompilerCache = () => {
|
|
12378
12396
|
persistentCache.clear();
|
|
12379
12397
|
sourceHashCache.clear();
|
|
@@ -12403,7 +12421,7 @@ var resolveDevClientDir2 = () => {
|
|
|
12403
12421
|
}, resolveRelativeModule2 = async (spec, from) => {
|
|
12404
12422
|
if (!spec.startsWith("."))
|
|
12405
12423
|
return null;
|
|
12406
|
-
const basePath =
|
|
12424
|
+
const basePath = resolve21(dirname14(from), spec);
|
|
12407
12425
|
const candidates = [
|
|
12408
12426
|
basePath,
|
|
12409
12427
|
`${basePath}.ts`,
|
|
@@ -12430,7 +12448,7 @@ var resolveDevClientDir2 = () => {
|
|
|
12430
12448
|
const resolved = resolvePackageImport(spec);
|
|
12431
12449
|
return resolved && /\.svelte(\.(?:ts|js))?$/.test(resolved) ? resolved : null;
|
|
12432
12450
|
}
|
|
12433
|
-
const basePath =
|
|
12451
|
+
const basePath = resolve21(dirname14(from), spec);
|
|
12434
12452
|
const explicit = /\.(svelte|svelte\.(?:ts|js))$/.test(basePath);
|
|
12435
12453
|
if (!explicit) {
|
|
12436
12454
|
const extensions = [".svelte", ".svelte.ts", ".svelte.js"];
|
|
@@ -12451,8 +12469,8 @@ var resolveDevClientDir2 = () => {
|
|
|
12451
12469
|
return jsPath;
|
|
12452
12470
|
return null;
|
|
12453
12471
|
}, addModuleRewrite = (rewrites, rawSpec, resolvedModule, ssrOutputDir, clientOutputDir) => {
|
|
12454
|
-
const toServer =
|
|
12455
|
-
const toClient =
|
|
12472
|
+
const toServer = relative10(ssrOutputDir, resolvedModule).replace(/\\/g, "/");
|
|
12473
|
+
const toClient = relative10(clientOutputDir, resolvedModule).replace(/\\/g, "/");
|
|
12456
12474
|
rewrites.set(rawSpec, {
|
|
12457
12475
|
client: toClient.startsWith(".") || toClient.startsWith("/") ? toClient : `./${toClient}`,
|
|
12458
12476
|
server: toServer.startsWith(".") ? toServer : `./${toServer}`
|
|
@@ -12490,8 +12508,8 @@ var resolveDevClientDir2 = () => {
|
|
|
12490
12508
|
const preprocessedClient = isModule ? loweredClientSource.code : (await preprocess(loweredClientSource.code, svelteStylePreprocessor)).code;
|
|
12491
12509
|
const transpiledServer = src.endsWith(".ts") || src.endsWith(".svelte.ts") ? transpiler3.transformSync(preprocessedServer) : preprocessedServer;
|
|
12492
12510
|
const transpiledClient = src.endsWith(".ts") || src.endsWith(".svelte.ts") ? transpiler3.transformSync(preprocessedClient) : preprocessedClient;
|
|
12493
|
-
const rawRel = dirname14(
|
|
12494
|
-
const relDir = rawRel.startsWith("..") ? `_ext/${
|
|
12511
|
+
const rawRel = dirname14(relative10(svelteRoot, src)).replace(/\\/g, "/");
|
|
12512
|
+
const relDir = rawRel.startsWith("..") ? `_ext/${relative10(process.cwd(), dirname14(src)).replace(/\\/g, "/")}` : rawRel;
|
|
12495
12513
|
const baseName = basename6(src).replace(/\.svelte(\.(ts|js))?$/, "");
|
|
12496
12514
|
const importPaths = Array.from(transpiledServer.matchAll(/from\s+['"]([^'"]+)['"]/g)).map((match) => match[1]).filter((path) => path !== undefined);
|
|
12497
12515
|
const resolvedModuleImports = await Promise.all(importPaths.map((importPath) => resolveRelativeModule2(importPath, src)));
|
|
@@ -12512,15 +12530,15 @@ var resolveDevClientDir2 = () => {
|
|
|
12512
12530
|
addModuleRewrite(externalRewrites, rawSpec, resolvedModule, ssrOutputDir, clientOutputDir);
|
|
12513
12531
|
if (!resolved)
|
|
12514
12532
|
continue;
|
|
12515
|
-
const childRel =
|
|
12533
|
+
const childRel = relative10(svelteRoot, resolved).replace(/\\/g, "/");
|
|
12516
12534
|
if (!childRel.startsWith(".."))
|
|
12517
12535
|
continue;
|
|
12518
12536
|
const childBuilt2 = cache.get(resolved);
|
|
12519
12537
|
if (!childBuilt2)
|
|
12520
12538
|
continue;
|
|
12521
12539
|
const origSpec = rawSpec.replace(/\.svelte(?:\.(?:ts|js))?$/, ".js");
|
|
12522
|
-
const toServer =
|
|
12523
|
-
const toClient =
|
|
12540
|
+
const toServer = relative10(ssrOutputDir, childBuilt2.ssr).replace(/\\/g, "/");
|
|
12541
|
+
const toClient = relative10(clientOutputDir, childBuilt2.client).replace(/\\/g, "/");
|
|
12524
12542
|
externalRewrites.set(origSpec, {
|
|
12525
12543
|
client: toClient.startsWith(".") ? toClient : `./${toClient}`,
|
|
12526
12544
|
server: toServer.startsWith(".") ? toServer : `./${toServer}`
|
|
@@ -12554,7 +12572,7 @@ var resolveDevClientDir2 = () => {
|
|
|
12554
12572
|
}).js;
|
|
12555
12573
|
let code = compiledJs.code.replace(/\.svelte(?:\.(?:ts|js))?(['"])/g, ".js$1");
|
|
12556
12574
|
if (mode === "client" && isDev) {
|
|
12557
|
-
const moduleKey = `/@src/${
|
|
12575
|
+
const moduleKey = `/@src/${relative10(process.cwd(), src).replace(/\\/g, "/")}`;
|
|
12558
12576
|
code = code.replace(/if\s*\(import\.meta\.hot\)\s*\{/, `if (typeof window !== "undefined") {
|
|
12559
12577
|
if (!window.__SVELTE_HMR_ACCEPT__) window.__SVELTE_HMR_ACCEPT__ = {};
|
|
12560
12578
|
var __hmr_accept = function(cb) { window.__SVELTE_HMR_ACCEPT__[${JSON.stringify(moduleKey)}] = cb; };`);
|
|
@@ -12603,10 +12621,10 @@ var resolveDevClientDir2 = () => {
|
|
|
12603
12621
|
};
|
|
12604
12622
|
const roots = await Promise.all(entryPoints.map(build));
|
|
12605
12623
|
await Promise.all(roots.map(async ({ client, hasAwaitSlot }) => {
|
|
12606
|
-
const relClientDir = dirname14(
|
|
12624
|
+
const relClientDir = dirname14(relative10(clientDir, client));
|
|
12607
12625
|
const name = basename6(client, extname5(client));
|
|
12608
12626
|
const indexPath = join27(indexDir, relClientDir, `${name}.js`);
|
|
12609
|
-
const importRaw =
|
|
12627
|
+
const importRaw = relative10(dirname14(indexPath), client).split(sep2).join("/");
|
|
12610
12628
|
const importPath = importRaw.startsWith(".") || importRaw.startsWith("/") ? importRaw : `./${importRaw}`;
|
|
12611
12629
|
const hmrImports = isDev ? `window.__HMR_FRAMEWORK__ = "svelte";
|
|
12612
12630
|
import "${hmrClientPath3}";
|
|
@@ -12683,7 +12701,7 @@ if (typeof window !== "undefined") {
|
|
|
12683
12701
|
return {
|
|
12684
12702
|
svelteClientPaths: roots.map(({ client }) => client),
|
|
12685
12703
|
svelteIndexPaths: roots.map(({ client }) => {
|
|
12686
|
-
const rel = dirname14(
|
|
12704
|
+
const rel = dirname14(relative10(clientDir, client));
|
|
12687
12705
|
return join27(indexDir, rel, basename6(client));
|
|
12688
12706
|
}),
|
|
12689
12707
|
svelteServerPaths: roots.map(({ ssr }) => ssr)
|
|
@@ -13096,22 +13114,22 @@ import { mkdir as mkdir5 } from "fs/promises";
|
|
|
13096
13114
|
import {
|
|
13097
13115
|
basename as basename7,
|
|
13098
13116
|
dirname as dirname15,
|
|
13099
|
-
isAbsolute as
|
|
13117
|
+
isAbsolute as isAbsolute6,
|
|
13100
13118
|
join as join28,
|
|
13101
|
-
relative as
|
|
13102
|
-
resolve as
|
|
13119
|
+
relative as relative11,
|
|
13120
|
+
resolve as resolve22
|
|
13103
13121
|
} from "path";
|
|
13104
13122
|
var {file: file2, write: write3, Transpiler: Transpiler3 } = globalThis.Bun;
|
|
13105
13123
|
var resolveDevClientDir3 = () => {
|
|
13106
13124
|
const projectRoot = process.cwd();
|
|
13107
|
-
const fromSource =
|
|
13125
|
+
const fromSource = resolve22(import.meta.dir, "../dev/client");
|
|
13108
13126
|
if (existsSync21(fromSource) && fromSource.startsWith(projectRoot)) {
|
|
13109
13127
|
return fromSource;
|
|
13110
13128
|
}
|
|
13111
|
-
const fromNodeModules =
|
|
13129
|
+
const fromNodeModules = resolve22(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client");
|
|
13112
13130
|
if (existsSync21(fromNodeModules))
|
|
13113
13131
|
return fromNodeModules;
|
|
13114
|
-
return
|
|
13132
|
+
return resolve22(import.meta.dir, "./dev/client");
|
|
13115
13133
|
}, devClientDir3, hmrClientPath4, transpiler4, scriptCache, scriptSetupCache, templateCache, styleCache, persistentBuildCache, vueSourceHashCache, vueHmrMetadata, clearVueHmrCaches = () => {
|
|
13116
13134
|
scriptCache.clear();
|
|
13117
13135
|
scriptSetupCache.clear();
|
|
@@ -13150,14 +13168,14 @@ var resolveDevClientDir3 = () => {
|
|
|
13150
13168
|
return "template-only";
|
|
13151
13169
|
}
|
|
13152
13170
|
return "full";
|
|
13153
|
-
}, generateVueHmrId = (sourceFilePath, vueRootDir) =>
|
|
13171
|
+
}, 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
13172
|
if (filePath.endsWith(".vue"))
|
|
13155
13173
|
return filePath.replace(/\.vue$/, ".js");
|
|
13156
13174
|
if (filePath.endsWith(".ts"))
|
|
13157
13175
|
return filePath.replace(/\.ts$/, ".js");
|
|
13158
13176
|
if (isStylePath(filePath)) {
|
|
13159
13177
|
if (sourceDir && (filePath.startsWith("./") || filePath.startsWith("../"))) {
|
|
13160
|
-
return
|
|
13178
|
+
return resolve22(sourceDir, filePath);
|
|
13161
13179
|
}
|
|
13162
13180
|
return filePath;
|
|
13163
13181
|
}
|
|
@@ -13183,7 +13201,7 @@ var resolveDevClientDir3 = () => {
|
|
|
13183
13201
|
const cachedResult = cacheMap.get(sourceFilePath);
|
|
13184
13202
|
if (cachedResult)
|
|
13185
13203
|
return cachedResult;
|
|
13186
|
-
const relativeFilePath =
|
|
13204
|
+
const relativeFilePath = relative11(vueRootDir, sourceFilePath).replace(/\\/g, "/");
|
|
13187
13205
|
const relativeWithoutExtension = relativeFilePath.replace(/\.vue$/, "");
|
|
13188
13206
|
const fileBaseName = basename7(sourceFilePath, ".vue");
|
|
13189
13207
|
const componentId = toKebab(fileBaseName);
|
|
@@ -13221,12 +13239,12 @@ var resolveDevClientDir3 = () => {
|
|
|
13221
13239
|
const childComponentPaths = importPaths.filter((path) => path.startsWith(".") && path.endsWith(".vue"));
|
|
13222
13240
|
const packageComponentPaths = Array.from(resolvedPackageVueImports.entries());
|
|
13223
13241
|
const helperModulePaths = importPaths.filter((path) => path.startsWith(".") && !path.endsWith(".vue") && !isStylePath(path));
|
|
13224
|
-
const stylePathsImported = importPaths.filter((path) => (path.startsWith(".") ||
|
|
13242
|
+
const stylePathsImported = importPaths.filter((path) => (path.startsWith(".") || isAbsolute6(path)) && isStylePath(path)).map((path) => isAbsolute6(path) ? path : resolve22(dirname15(sourceFilePath), path));
|
|
13225
13243
|
for (const stylePath of stylePathsImported) {
|
|
13226
13244
|
addStyleImporter(sourceFilePath, stylePath);
|
|
13227
13245
|
}
|
|
13228
13246
|
const childBuildResults = await Promise.all([
|
|
13229
|
-
...childComponentPaths.map((relativeChildPath) => compileVueFile(
|
|
13247
|
+
...childComponentPaths.map((relativeChildPath) => compileVueFile(resolve22(dirname15(sourceFilePath), relativeChildPath), outputDirs, cacheMap, false, vueRootDir, compiler, stylePreprocessors)),
|
|
13230
13248
|
...packageComponentPaths.map(([, absolutePath]) => compileVueFile(absolutePath, outputDirs, cacheMap, false, vueRootDir, compiler, stylePreprocessors))
|
|
13231
13249
|
]);
|
|
13232
13250
|
const hasScript = descriptor.script || descriptor.scriptSetup;
|
|
@@ -13320,7 +13338,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
13320
13338
|
let result2 = code;
|
|
13321
13339
|
for (const [bareImport, paths] of packageImportRewrites) {
|
|
13322
13340
|
const targetPath = mode === "server" ? paths.server : paths.client;
|
|
13323
|
-
let rel =
|
|
13341
|
+
let rel = relative11(dirname15(outputPath), targetPath).replace(/\\/g, "/");
|
|
13324
13342
|
if (!rel.startsWith("."))
|
|
13325
13343
|
rel = `./${rel}`;
|
|
13326
13344
|
result2 = result2.replaceAll(bareImport, rel);
|
|
@@ -13350,7 +13368,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
13350
13368
|
hmrId,
|
|
13351
13369
|
serverPath: serverOutputPath,
|
|
13352
13370
|
tsHelperPaths: [
|
|
13353
|
-
...helperModulePaths.map((helper) =>
|
|
13371
|
+
...helperModulePaths.map((helper) => resolve22(dirname15(sourceFilePath), helper.endsWith(".ts") ? helper : `${helper}.ts`)),
|
|
13354
13372
|
...childBuildResults.flatMap((child) => child.tsHelperPaths)
|
|
13355
13373
|
]
|
|
13356
13374
|
};
|
|
@@ -13373,7 +13391,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
13373
13391
|
const buildCache = new Map;
|
|
13374
13392
|
const allTsHelperPaths = new Set;
|
|
13375
13393
|
const compiledPages = await Promise.all(entryPoints.map(async (entryPath) => {
|
|
13376
|
-
const result = await compileVueFile(
|
|
13394
|
+
const result = await compileVueFile(resolve22(entryPath), {
|
|
13377
13395
|
client: clientOutputDir,
|
|
13378
13396
|
css: cssOutputDir,
|
|
13379
13397
|
server: serverOutputDir
|
|
@@ -13381,7 +13399,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
13381
13399
|
result.tsHelperPaths.forEach((path) => allTsHelperPaths.add(path));
|
|
13382
13400
|
const entryBaseName = basename7(entryPath, ".vue");
|
|
13383
13401
|
const indexOutputFile = join28(indexOutputDir, `${entryBaseName}.js`);
|
|
13384
|
-
const clientOutputFile = join28(clientOutputDir,
|
|
13402
|
+
const clientOutputFile = join28(clientOutputDir, relative11(vueRootDir, entryPath).replace(/\\/g, "/").replace(/\.vue$/, ".js"));
|
|
13385
13403
|
await mkdir5(dirname15(indexOutputFile), { recursive: true });
|
|
13386
13404
|
const vueHmrImports = isDev ? [
|
|
13387
13405
|
`window.__HMR_FRAMEWORK__ = "vue";`,
|
|
@@ -13389,7 +13407,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
13389
13407
|
] : [];
|
|
13390
13408
|
await write3(indexOutputFile, [
|
|
13391
13409
|
...vueHmrImports,
|
|
13392
|
-
`import Comp, * as PageModule from "${
|
|
13410
|
+
`import Comp, * as PageModule from "${relative11(dirname15(indexOutputFile), clientOutputFile).replace(/\\/g, "/")}";`,
|
|
13393
13411
|
'import { createSSRApp, createApp } from "vue";',
|
|
13394
13412
|
"",
|
|
13395
13413
|
"// HMR State Preservation: Check for preserved state from HMR",
|
|
@@ -13533,7 +13551,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
13533
13551
|
await Promise.all(Array.from(allTsHelperPaths).map(async (tsPath) => {
|
|
13534
13552
|
const sourceCode = await file2(tsPath).text();
|
|
13535
13553
|
const transpiledCode = transpiler4.transformSync(sourceCode);
|
|
13536
|
-
const relativeJsPath =
|
|
13554
|
+
const relativeJsPath = relative11(vueRootDir, tsPath).replace(/\.ts$/, ".js");
|
|
13537
13555
|
const outClientPath = join28(clientOutputDir, relativeJsPath);
|
|
13538
13556
|
const outServerPath = join28(serverOutputDir, relativeJsPath);
|
|
13539
13557
|
await mkdir5(dirname15(outClientPath), { recursive: true });
|
|
@@ -14040,7 +14058,7 @@ __export(exports_compileAngular, {
|
|
|
14040
14058
|
compileAngular: () => compileAngular
|
|
14041
14059
|
});
|
|
14042
14060
|
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
|
|
14061
|
+
import { join as join29, basename as basename8, sep as sep3, dirname as dirname16, resolve as resolve23, relative as relative12 } from "path";
|
|
14044
14062
|
var {Glob: Glob6 } = globalThis.Bun;
|
|
14045
14063
|
import ts9 from "typescript";
|
|
14046
14064
|
var traceAngularPhase = async (name, fn2, metadata) => {
|
|
@@ -14048,10 +14066,10 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
14048
14066
|
return tracePhase ? tracePhase(`compile/angular/${name}`, fn2, metadata) : await fn2();
|
|
14049
14067
|
}, readTsconfigPathAliases = () => {
|
|
14050
14068
|
try {
|
|
14051
|
-
const configPath2 =
|
|
14069
|
+
const configPath2 = resolve23(process.cwd(), "tsconfig.json");
|
|
14052
14070
|
const config = ts9.readConfigFile(configPath2, ts9.sys.readFile).config;
|
|
14053
14071
|
const compilerOptions = config?.compilerOptions ?? {};
|
|
14054
|
-
const baseUrl =
|
|
14072
|
+
const baseUrl = resolve23(process.cwd(), compilerOptions.baseUrl ?? ".");
|
|
14055
14073
|
const aliases = Object.entries(compilerOptions.paths ?? {}).map(([pattern, replacements]) => ({ pattern, replacements }));
|
|
14056
14074
|
return { aliases, baseUrl };
|
|
14057
14075
|
} catch {
|
|
@@ -14071,7 +14089,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
14071
14089
|
const wildcardValue = exactMatch ? "" : specifier.slice(prefix.length, specifier.length - suffix.length);
|
|
14072
14090
|
for (const replacement of alias.replacements) {
|
|
14073
14091
|
const candidate = replacement.replace("*", wildcardValue);
|
|
14074
|
-
const resolved = resolveSourceFile(
|
|
14092
|
+
const resolved = resolveSourceFile(resolve23(baseUrl, candidate));
|
|
14075
14093
|
if (resolved)
|
|
14076
14094
|
return resolved;
|
|
14077
14095
|
}
|
|
@@ -14090,13 +14108,13 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
14090
14108
|
];
|
|
14091
14109
|
return candidates.find((file3) => existsSync22(file3));
|
|
14092
14110
|
}, createLegacyAngularAnimationUsageResolver = (rootDir) => {
|
|
14093
|
-
const baseDir =
|
|
14111
|
+
const baseDir = resolve23(rootDir);
|
|
14094
14112
|
const tsconfigAliases = readTsconfigPathAliases();
|
|
14095
14113
|
const transpiler5 = new Bun.Transpiler({ loader: "tsx" });
|
|
14096
14114
|
const scanCache = new Map;
|
|
14097
14115
|
const resolveLocalImport = (specifier, fromDir) => {
|
|
14098
14116
|
if (specifier.startsWith(".") || specifier.startsWith("/")) {
|
|
14099
|
-
return resolveSourceFile(
|
|
14117
|
+
return resolveSourceFile(resolve23(fromDir, specifier));
|
|
14100
14118
|
}
|
|
14101
14119
|
const aliased = matchTsconfigAlias(specifier, tsconfigAliases.aliases, tsconfigAliases.baseUrl, resolveSourceFile);
|
|
14102
14120
|
if (aliased)
|
|
@@ -14105,7 +14123,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
14105
14123
|
const resolved = Bun.resolveSync(specifier, fromDir);
|
|
14106
14124
|
if (resolved.includes("/node_modules/"))
|
|
14107
14125
|
return;
|
|
14108
|
-
const absolute =
|
|
14126
|
+
const absolute = resolve23(resolved);
|
|
14109
14127
|
if (!absolute.startsWith(baseDir))
|
|
14110
14128
|
return;
|
|
14111
14129
|
return resolveSourceFile(absolute);
|
|
@@ -14121,7 +14139,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
14121
14139
|
usesLegacyAnimations: false
|
|
14122
14140
|
});
|
|
14123
14141
|
}
|
|
14124
|
-
const resolved =
|
|
14142
|
+
const resolved = resolve23(actualPath);
|
|
14125
14143
|
const cached = scanCache.get(resolved);
|
|
14126
14144
|
if (cached)
|
|
14127
14145
|
return cached;
|
|
@@ -14150,7 +14168,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
14150
14168
|
const actualPath = resolveSourceFile(filePath);
|
|
14151
14169
|
if (!actualPath)
|
|
14152
14170
|
return false;
|
|
14153
|
-
const resolved =
|
|
14171
|
+
const resolved = resolve23(actualPath);
|
|
14154
14172
|
if (visited.has(resolved))
|
|
14155
14173
|
return false;
|
|
14156
14174
|
visited.add(resolved);
|
|
@@ -14168,14 +14186,14 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
14168
14186
|
return (entryPath) => visit(entryPath);
|
|
14169
14187
|
}, resolveDevClientDir4 = () => {
|
|
14170
14188
|
const projectRoot = process.cwd();
|
|
14171
|
-
const fromSource =
|
|
14189
|
+
const fromSource = resolve23(import.meta.dir, "../dev/client");
|
|
14172
14190
|
if (existsSync22(fromSource) && fromSource.startsWith(projectRoot)) {
|
|
14173
14191
|
return fromSource;
|
|
14174
14192
|
}
|
|
14175
|
-
const fromNodeModules =
|
|
14193
|
+
const fromNodeModules = resolve23(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client");
|
|
14176
14194
|
if (existsSync22(fromNodeModules))
|
|
14177
14195
|
return fromNodeModules;
|
|
14178
|
-
return
|
|
14196
|
+
return resolve23(import.meta.dir, "./dev/client");
|
|
14179
14197
|
}, devClientDir4, hmrClientPath5, formatDiagnosticMessage = (diagnostic) => {
|
|
14180
14198
|
try {
|
|
14181
14199
|
return ts9.flattenDiagnosticMessageText(diagnostic.messageText, `
|
|
@@ -14218,11 +14236,11 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
14218
14236
|
if (hasJsLikeExtension(path))
|
|
14219
14237
|
return `${path}${query}`;
|
|
14220
14238
|
const importerDir = dirname16(importerOutputPath);
|
|
14221
|
-
const fileCandidate =
|
|
14239
|
+
const fileCandidate = resolve23(importerDir, `${path}.js`);
|
|
14222
14240
|
if (outputFiles?.has(fileCandidate) || existsSync22(fileCandidate)) {
|
|
14223
14241
|
return `${path}.js${query}`;
|
|
14224
14242
|
}
|
|
14225
|
-
const indexCandidate =
|
|
14243
|
+
const indexCandidate = resolve23(importerDir, path, "index.js");
|
|
14226
14244
|
if (outputFiles?.has(indexCandidate) || existsSync22(indexCandidate)) {
|
|
14227
14245
|
return `${path}/index.js${query}`;
|
|
14228
14246
|
}
|
|
@@ -14250,7 +14268,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
14250
14268
|
}, resolveLocalTsImport = (fromFile, specifier) => {
|
|
14251
14269
|
if (!isRelativeModuleSpecifier(specifier))
|
|
14252
14270
|
return null;
|
|
14253
|
-
const basePath =
|
|
14271
|
+
const basePath = resolve23(dirname16(fromFile), specifier);
|
|
14254
14272
|
const candidates = /\.[cm]?[tj]sx?$/.test(basePath) ? [basePath] : [
|
|
14255
14273
|
`${basePath}.ts`,
|
|
14256
14274
|
`${basePath}.tsx`,
|
|
@@ -14261,7 +14279,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
14261
14279
|
join29(basePath, "index.mts"),
|
|
14262
14280
|
join29(basePath, "index.cts")
|
|
14263
14281
|
];
|
|
14264
|
-
return candidates.map((candidate) =>
|
|
14282
|
+
return candidates.map((candidate) => resolve23(candidate)).find((candidate) => existsSync22(candidate) && !candidate.endsWith(".d.ts")) ?? null;
|
|
14265
14283
|
}, readFileForAotTransform = async (fileName, readFile6) => {
|
|
14266
14284
|
const hostSource = readFile6?.(fileName);
|
|
14267
14285
|
if (typeof hostSource === "string")
|
|
@@ -14296,7 +14314,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
14296
14314
|
paths.push(join29(fileDir, urlMatch.replace(/['"]/g, "")));
|
|
14297
14315
|
}
|
|
14298
14316
|
}
|
|
14299
|
-
return paths.map((path) =>
|
|
14317
|
+
return paths.map((path) => resolve23(path));
|
|
14300
14318
|
}, readResourceCacheFile = async (cachePath) => {
|
|
14301
14319
|
try {
|
|
14302
14320
|
const entry = JSON.parse(await fs5.readFile(cachePath, "utf-8"));
|
|
@@ -14338,7 +14356,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
14338
14356
|
transformedFiles: 0
|
|
14339
14357
|
};
|
|
14340
14358
|
const transformFile = async (filePath) => {
|
|
14341
|
-
const resolvedPath =
|
|
14359
|
+
const resolvedPath = resolve23(filePath);
|
|
14342
14360
|
if (visited.has(resolvedPath))
|
|
14343
14361
|
return;
|
|
14344
14362
|
visited.add(resolvedPath);
|
|
@@ -14373,7 +14391,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
14373
14391
|
return { stats, transformedSources };
|
|
14374
14392
|
}, compileAngularFiles = async (inputPaths, outDir, stylePreprocessors) => {
|
|
14375
14393
|
const islandMetadataByOutputPath = await traceAngularPhase("aot/island-metadata", () => new Map(inputPaths.map((inputPath) => {
|
|
14376
|
-
const outputPath =
|
|
14394
|
+
const outputPath = resolve23(join29(outDir, relative12(process.cwd(), resolve23(inputPath)).replace(/\.[cm]?[tj]sx?$/, ".js")));
|
|
14377
14395
|
return [
|
|
14378
14396
|
outputPath,
|
|
14379
14397
|
buildIslandMetadataExports(readFileSync16(inputPath, "utf-8"))
|
|
@@ -14384,7 +14402,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
14384
14402
|
const tsLibDir = await traceAngularPhase("aot/resolve-typescript-lib", () => {
|
|
14385
14403
|
const tsPath = __require.resolve("typescript");
|
|
14386
14404
|
const tsRootDir = dirname16(tsPath);
|
|
14387
|
-
return tsRootDir.endsWith("lib") ? tsRootDir :
|
|
14405
|
+
return tsRootDir.endsWith("lib") ? tsRootDir : resolve23(tsRootDir, "lib");
|
|
14388
14406
|
});
|
|
14389
14407
|
const config = await traceAngularPhase("aot/read-configuration", () => readConfiguration("./tsconfig.json"));
|
|
14390
14408
|
const options = {
|
|
@@ -14426,7 +14444,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
14426
14444
|
return originalGetSourceFile?.call(host, fileName, languageVersion, onError);
|
|
14427
14445
|
};
|
|
14428
14446
|
const emitted = {};
|
|
14429
|
-
const resolvedOutDir =
|
|
14447
|
+
const resolvedOutDir = resolve23(outDir);
|
|
14430
14448
|
host.writeFile = (fileName, text) => {
|
|
14431
14449
|
const relativePath = resolveRelativePath(fileName, resolvedOutDir, outDir);
|
|
14432
14450
|
emitted[relativePath] = text;
|
|
@@ -14448,12 +14466,12 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
14448
14466
|
if (!fileName.endsWith(".ts") || fileName.endsWith(".d.ts")) {
|
|
14449
14467
|
return source;
|
|
14450
14468
|
}
|
|
14451
|
-
const resolvedPath =
|
|
14469
|
+
const resolvedPath = resolve23(fileName);
|
|
14452
14470
|
return transformedSources.get(resolvedPath) ?? source;
|
|
14453
14471
|
};
|
|
14454
14472
|
const originalGetSourceFileForCompile = host.getSourceFile;
|
|
14455
14473
|
host.getSourceFile = (fileName, languageVersion, onError) => {
|
|
14456
|
-
const source = transformedSources.get(
|
|
14474
|
+
const source = transformedSources.get(resolve23(fileName));
|
|
14457
14475
|
if (source) {
|
|
14458
14476
|
return ts9.createSourceFile(fileName, source, languageVersion, true);
|
|
14459
14477
|
}
|
|
@@ -14477,7 +14495,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
14477
14495
|
content,
|
|
14478
14496
|
target: join29(outDir, fileName)
|
|
14479
14497
|
}));
|
|
14480
|
-
const outputFiles = new Set(rawEntries.map(({ target }) =>
|
|
14498
|
+
const outputFiles = new Set(rawEntries.map(({ target }) => resolve23(target)));
|
|
14481
14499
|
return rawEntries.map(({ content, target }) => {
|
|
14482
14500
|
let processedContent = content.replace(/from\s+(['"])(\.\.?\/[^'"]+)(\1)/g, (match, quote, path) => {
|
|
14483
14501
|
const rewritten = rewriteRelativeJsSpecifier(target, path, outputFiles);
|
|
@@ -14492,7 +14510,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
14492
14510
|
return cleaned ? `import { ${cleaned}, InternalInjectFlags } from '@angular/core'` : `import { InternalInjectFlags } from '@angular/core'`;
|
|
14493
14511
|
});
|
|
14494
14512
|
processedContent = processedContent.replace(/\b(?<!Internal)InjectFlags\b/g, "InternalInjectFlags");
|
|
14495
|
-
processedContent += islandMetadataByOutputPath.get(
|
|
14513
|
+
processedContent += islandMetadataByOutputPath.get(resolve23(target)) ?? "";
|
|
14496
14514
|
return { content: processedContent, target };
|
|
14497
14515
|
});
|
|
14498
14516
|
});
|
|
@@ -14502,7 +14520,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
14502
14520
|
})), { outputs: entries.length });
|
|
14503
14521
|
return await traceAngularPhase("aot/collect-output-paths", () => entries.map(({ target }) => target), { outputs: entries.length });
|
|
14504
14522
|
}, compileAngularFile = async (inputPath, outDir, stylePreprocessors) => compileAngularFiles([inputPath], outDir, stylePreprocessors), jitContentCache, invalidateAngularJitCache = (filePath) => {
|
|
14505
|
-
jitContentCache.delete(
|
|
14523
|
+
jitContentCache.delete(resolve23(filePath));
|
|
14506
14524
|
}, wrapperOutputCache, escapeTemplateContent = (content) => content.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$\{/g, "\\${"), findUncommentedMatch = (source, pattern) => {
|
|
14507
14525
|
const re2 = new RegExp(pattern.source, pattern.flags.includes("g") ? pattern.flags : pattern.flags + "g");
|
|
14508
14526
|
let match;
|
|
@@ -14515,7 +14533,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
14515
14533
|
}
|
|
14516
14534
|
return null;
|
|
14517
14535
|
}, resolveAngularDeferImportSpecifier = () => {
|
|
14518
|
-
const sourceEntry =
|
|
14536
|
+
const sourceEntry = resolve23(import.meta.dir, "../angular/components/index.ts");
|
|
14519
14537
|
if (existsSync22(sourceEntry)) {
|
|
14520
14538
|
return sourceEntry.replace(/\\/g, "/");
|
|
14521
14539
|
}
|
|
@@ -14745,10 +14763,10 @@ ${fields}
|
|
|
14745
14763
|
source: result
|
|
14746
14764
|
};
|
|
14747
14765
|
}, compileAngularFileJIT = async (inputPath, outDir, rootDir, stylePreprocessors, cacheBuster) => {
|
|
14748
|
-
const entryPath =
|
|
14766
|
+
const entryPath = resolve23(inputPath);
|
|
14749
14767
|
const allOutputs = [];
|
|
14750
14768
|
const visited = new Set;
|
|
14751
|
-
const baseDir =
|
|
14769
|
+
const baseDir = resolve23(rootDir ?? process.cwd());
|
|
14752
14770
|
let usesLegacyAnimations = false;
|
|
14753
14771
|
const angularTranspiler = new Bun.Transpiler({
|
|
14754
14772
|
loader: "ts",
|
|
@@ -14776,7 +14794,7 @@ ${fields}
|
|
|
14776
14794
|
};
|
|
14777
14795
|
const resolveLocalImport = (specifier, fromDir) => {
|
|
14778
14796
|
if (specifier.startsWith(".") || specifier.startsWith("/")) {
|
|
14779
|
-
return resolveSourceFile2(
|
|
14797
|
+
return resolveSourceFile2(resolve23(fromDir, specifier));
|
|
14780
14798
|
}
|
|
14781
14799
|
const aliased = matchTsconfigAlias(specifier, tsconfigAliases.aliases, tsconfigAliases.baseUrl, resolveSourceFile2);
|
|
14782
14800
|
if (aliased)
|
|
@@ -14785,7 +14803,7 @@ ${fields}
|
|
|
14785
14803
|
const resolved = Bun.resolveSync(specifier, fromDir);
|
|
14786
14804
|
if (resolved.includes("/node_modules/"))
|
|
14787
14805
|
return;
|
|
14788
|
-
const absolute =
|
|
14806
|
+
const absolute = resolve23(resolved);
|
|
14789
14807
|
if (!absolute.startsWith(baseDir))
|
|
14790
14808
|
return;
|
|
14791
14809
|
return resolveSourceFile2(absolute);
|
|
@@ -14834,13 +14852,13 @@ ${fields}
|
|
|
14834
14852
|
return `${prefix}${dots}`;
|
|
14835
14853
|
return `${prefix}../${dots}`;
|
|
14836
14854
|
});
|
|
14837
|
-
if (
|
|
14855
|
+
if (resolve23(actualPath) === entryPath) {
|
|
14838
14856
|
processedContent += buildIslandMetadataExports(sourceCode);
|
|
14839
14857
|
}
|
|
14840
14858
|
return processedContent;
|
|
14841
14859
|
};
|
|
14842
14860
|
const transpileFile = async (filePath) => {
|
|
14843
|
-
const resolved =
|
|
14861
|
+
const resolved = resolve23(filePath);
|
|
14844
14862
|
if (visited.has(resolved))
|
|
14845
14863
|
return;
|
|
14846
14864
|
visited.add(resolved);
|
|
@@ -14887,12 +14905,12 @@ ${fields}
|
|
|
14887
14905
|
const resolved2 = resolveLocalImport(specifier, inputDir);
|
|
14888
14906
|
if (!resolved2)
|
|
14889
14907
|
return null;
|
|
14890
|
-
const relativeImport =
|
|
14908
|
+
const relativeImport = relative12(targetDir, toOutputPath(resolved2)).replace(/\\/g, "/").replace(/\.js$/, "");
|
|
14891
14909
|
const relativeRewrite = relativeImport.startsWith(".") ? relativeImport : `./${relativeImport}`;
|
|
14892
14910
|
importRewrites.set(specifier, relativeRewrite);
|
|
14893
14911
|
return resolved2;
|
|
14894
14912
|
}).filter((path) => Boolean(path));
|
|
14895
|
-
const isEntry =
|
|
14913
|
+
const isEntry = resolve23(actualPath) === resolve23(entryPath);
|
|
14896
14914
|
const contentHash = Bun.hash(sourceCode).toString(BASE_36_RADIX);
|
|
14897
14915
|
const cacheKey2 = actualPath;
|
|
14898
14916
|
const shouldWriteFile = cacheBuster && isEntry ? true : jitContentCache.get(cacheKey2) !== contentHash || !existsSync22(targetPath);
|
|
@@ -14928,11 +14946,11 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
14928
14946
|
const compiledRoot = compiledParent;
|
|
14929
14947
|
const indexesDir = join29(compiledParent, "indexes");
|
|
14930
14948
|
await traceAngularPhase("setup/create-indexes-dir", () => fs5.mkdir(indexesDir, { recursive: true }));
|
|
14931
|
-
const aotOutputs = hmr ? [] : await traceAngularPhase("aot/compile-files", () => compileAngularFiles(entryPoints.map((entry) =>
|
|
14949
|
+
const aotOutputs = hmr ? [] : await traceAngularPhase("aot/compile-files", () => compileAngularFiles(entryPoints.map((entry) => resolve23(entry)), compiledRoot, stylePreprocessors), { entries: entryPoints.length });
|
|
14932
14950
|
if (!hmr) {
|
|
14933
14951
|
await traceAngularPhase("aot/copy-json-resources", async () => {
|
|
14934
14952
|
const cwd = process.cwd();
|
|
14935
|
-
const angularSrcDir =
|
|
14953
|
+
const angularSrcDir = resolve23(outRoot);
|
|
14936
14954
|
if (!existsSync22(angularSrcDir))
|
|
14937
14955
|
return;
|
|
14938
14956
|
const jsonGlob = new Glob6("**/*.json");
|
|
@@ -14941,7 +14959,7 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
14941
14959
|
cwd: angularSrcDir
|
|
14942
14960
|
})) {
|
|
14943
14961
|
const sourcePath = join29(angularSrcDir, rel);
|
|
14944
|
-
const cwdRel =
|
|
14962
|
+
const cwdRel = relative12(cwd, sourcePath);
|
|
14945
14963
|
const targetPath = join29(compiledRoot, cwdRel);
|
|
14946
14964
|
await fs5.mkdir(dirname16(targetPath), { recursive: true });
|
|
14947
14965
|
await fs5.copyFile(sourcePath, targetPath);
|
|
@@ -14950,8 +14968,8 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
14950
14968
|
}
|
|
14951
14969
|
const usesLegacyAngularAnimations = await traceAngularPhase("setup/legacy-animation-resolver", () => createLegacyAngularAnimationUsageResolver(outRoot));
|
|
14952
14970
|
const compileTasks = entryPoints.map(async (entry) => {
|
|
14953
|
-
const resolvedEntry =
|
|
14954
|
-
const relativeEntry =
|
|
14971
|
+
const resolvedEntry = resolve23(entry);
|
|
14972
|
+
const relativeEntry = relative12(outRoot, resolvedEntry).replace(/\.[tj]s$/, ".js");
|
|
14955
14973
|
const compileEntry = () => compileAngularFileJIT(resolvedEntry, compiledRoot, outRoot, stylePreprocessors);
|
|
14956
14974
|
let outputs = hmr ? await traceAngularPhase("jit/compile-entry", compileEntry, {
|
|
14957
14975
|
entry: resolvedEntry
|
|
@@ -14962,10 +14980,10 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
14962
14980
|
join29(compiledRoot, relativeEntry),
|
|
14963
14981
|
join29(compiledRoot, "pages", jsName),
|
|
14964
14982
|
join29(compiledRoot, jsName)
|
|
14965
|
-
].map((file3) =>
|
|
14983
|
+
].map((file3) => resolve23(file3));
|
|
14966
14984
|
const resolveRawServerFile = (candidatePaths) => {
|
|
14967
14985
|
const normalizedCandidates = [
|
|
14968
|
-
...candidatePaths.map((file3) =>
|
|
14986
|
+
...candidatePaths.map((file3) => resolve23(file3)),
|
|
14969
14987
|
...compiledFallbackPaths
|
|
14970
14988
|
];
|
|
14971
14989
|
let candidate = normalizedCandidates.find((file3) => existsSync22(file3) && file3.endsWith(`${sep3}${relativeEntry}`));
|
|
@@ -15035,13 +15053,13 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
15035
15053
|
`;
|
|
15036
15054
|
}
|
|
15037
15055
|
await traceAngularPhase("wrapper/write-server-output", () => fs5.writeFile(rawServerFile, rewritten, "utf-8"), { entry: resolvedEntry });
|
|
15038
|
-
const relativePath =
|
|
15056
|
+
const relativePath = relative12(indexesDir, rawServerFile).replace(/\\/g, "/");
|
|
15039
15057
|
const normalizedImportPath = relativePath.startsWith(".") ? relativePath : `./${relativePath}`;
|
|
15040
15058
|
const manifestKeyForProviders = toPascal(fileBase);
|
|
15041
15059
|
const providersFilePath = join29(compiledParent, "providers", `${manifestKeyForProviders}.providers.ts`);
|
|
15042
15060
|
const hasGeneratedProviders = existsSync22(providersFilePath);
|
|
15043
15061
|
const providersImportPath = hasGeneratedProviders ? (() => {
|
|
15044
|
-
const rel =
|
|
15062
|
+
const rel = relative12(indexesDir, providersFilePath.replace(/\.ts$/, "")).replace(/\\/g, "/");
|
|
15045
15063
|
return rel.startsWith(".") ? rel : `./${rel}`;
|
|
15046
15064
|
})() : null;
|
|
15047
15065
|
const generatedProvidersImport = providersImportPath ? `import { providers as generatedProviders } from '${providersImportPath}';` : "var generatedProviders = null;";
|
|
@@ -15969,7 +15987,7 @@ __export(exports_fastHmrCompiler, {
|
|
|
15969
15987
|
invalidateFingerprintCache: () => invalidateFingerprintCache
|
|
15970
15988
|
});
|
|
15971
15989
|
import { existsSync as existsSync23, readFileSync as readFileSync17, statSync as statSync2 } from "fs";
|
|
15972
|
-
import { dirname as dirname17, extname as extname6, relative as
|
|
15990
|
+
import { dirname as dirname17, extname as extname6, relative as relative13, resolve as resolve24 } from "path";
|
|
15973
15991
|
import ts13 from "typescript";
|
|
15974
15992
|
var fail = (reason, detail, location) => ({
|
|
15975
15993
|
ok: false,
|
|
@@ -16080,7 +16098,7 @@ var fail = (reason, detail, location) => ({
|
|
|
16080
16098
|
})();
|
|
16081
16099
|
if (!decoratorName)
|
|
16082
16100
|
continue;
|
|
16083
|
-
const projectRel =
|
|
16101
|
+
const projectRel = relative13(process.cwd(), componentFilePath).replace(/\\/g, "/");
|
|
16084
16102
|
const id = encodeURIComponent(`${projectRel}@${className}`);
|
|
16085
16103
|
if (decoratorName === "Component") {
|
|
16086
16104
|
const componentDecorator = decorators.find((d2) => {
|
|
@@ -16273,7 +16291,7 @@ var fail = (reason, detail, location) => ({
|
|
|
16273
16291
|
if (!spec.startsWith(".") && !spec.startsWith("/")) {
|
|
16274
16292
|
return true;
|
|
16275
16293
|
}
|
|
16276
|
-
const base =
|
|
16294
|
+
const base = resolve24(componentDir, spec);
|
|
16277
16295
|
const candidates = [
|
|
16278
16296
|
`${base}.ts`,
|
|
16279
16297
|
`${base}.tsx`,
|
|
@@ -17077,7 +17095,7 @@ var fail = (reason, detail, location) => ({
|
|
|
17077
17095
|
return null;
|
|
17078
17096
|
}, resolveDtsFromSpec = (spec, fromDir) => {
|
|
17079
17097
|
const stripped = spec.replace(/\.[mc]?js$/, "");
|
|
17080
|
-
const base =
|
|
17098
|
+
const base = resolve24(fromDir, stripped);
|
|
17081
17099
|
const candidates = [
|
|
17082
17100
|
`${base}.d.ts`,
|
|
17083
17101
|
`${base}.d.mts`,
|
|
@@ -17101,7 +17119,7 @@ var fail = (reason, detail, location) => ({
|
|
|
17101
17119
|
return null;
|
|
17102
17120
|
}, resolveChildComponentInfo = (className, spec, componentDir, projectRoot) => {
|
|
17103
17121
|
if (spec.startsWith(".") || spec.startsWith("/")) {
|
|
17104
|
-
const base =
|
|
17122
|
+
const base = resolve24(componentDir, spec);
|
|
17105
17123
|
const candidates = [
|
|
17106
17124
|
`${base}.ts`,
|
|
17107
17125
|
`${base}.tsx`,
|
|
@@ -17320,13 +17338,13 @@ var fail = (reason, detail, location) => ({
|
|
|
17320
17338
|
}
|
|
17321
17339
|
if (!matches)
|
|
17322
17340
|
continue;
|
|
17323
|
-
const resolved =
|
|
17341
|
+
const resolved = resolve24(componentDir, spec);
|
|
17324
17342
|
for (const ext of TS_EXTENSIONS) {
|
|
17325
17343
|
const candidate = resolved + ext;
|
|
17326
17344
|
if (existsSync23(candidate))
|
|
17327
17345
|
return candidate;
|
|
17328
17346
|
}
|
|
17329
|
-
const indexCandidate =
|
|
17347
|
+
const indexCandidate = resolve24(resolved, "index.ts");
|
|
17330
17348
|
if (existsSync23(indexCandidate))
|
|
17331
17349
|
return indexCandidate;
|
|
17332
17350
|
}
|
|
@@ -17559,7 +17577,7 @@ ${transpiled}
|
|
|
17559
17577
|
}
|
|
17560
17578
|
}${staticPatch}`;
|
|
17561
17579
|
}, STYLE_PREPROCESSED_EXT, resolveAndReadStyleResource = (componentDir, url) => {
|
|
17562
|
-
const abs =
|
|
17580
|
+
const abs = resolve24(componentDir, url);
|
|
17563
17581
|
if (!existsSync23(abs))
|
|
17564
17582
|
return null;
|
|
17565
17583
|
const ext = extname6(abs).toLowerCase();
|
|
@@ -17599,7 +17617,7 @@ ${block}
|
|
|
17599
17617
|
const cached = projectOptionsCache.get(projectRoot);
|
|
17600
17618
|
if (cached !== undefined)
|
|
17601
17619
|
return cached;
|
|
17602
|
-
const tsconfigPath =
|
|
17620
|
+
const tsconfigPath = resolve24(projectRoot, "tsconfig.json");
|
|
17603
17621
|
const opts = {};
|
|
17604
17622
|
if (existsSync23(tsconfigPath)) {
|
|
17605
17623
|
try {
|
|
@@ -17645,7 +17663,7 @@ ${block}
|
|
|
17645
17663
|
}
|
|
17646
17664
|
const kind = params.kind ?? "component";
|
|
17647
17665
|
if (kind !== "component") {
|
|
17648
|
-
const entityId = encodeURIComponent(`${
|
|
17666
|
+
const entityId = encodeURIComponent(`${relative13(projectRoot, componentFilePath).replace(/\\/g, "/")}@${className}`);
|
|
17649
17667
|
const currentEntityFingerprint = extractEntityFingerprint(classNode, className, sourceFile);
|
|
17650
17668
|
const cachedEntityFingerprint = entityFingerprintCache.get(entityId);
|
|
17651
17669
|
if (cachedEntityFingerprint !== undefined && !entityFingerprintsEqual(cachedEntityFingerprint, currentEntityFingerprint)) {
|
|
@@ -17683,7 +17701,7 @@ ${block}
|
|
|
17683
17701
|
templateText = decoratorMeta.template;
|
|
17684
17702
|
templatePath = componentFilePath;
|
|
17685
17703
|
} else if (decoratorMeta.templateUrl) {
|
|
17686
|
-
const tplAbs =
|
|
17704
|
+
const tplAbs = resolve24(componentDir, decoratorMeta.templateUrl);
|
|
17687
17705
|
if (!existsSync23(tplAbs)) {
|
|
17688
17706
|
return fail("template-resource-not-found", `Template file not found: ${tplAbs}`, { file: componentFilePath });
|
|
17689
17707
|
}
|
|
@@ -17729,7 +17747,7 @@ ${block}
|
|
|
17729
17747
|
return fail("class-not-found", "anonymous class");
|
|
17730
17748
|
const wrappedClass = new compiler.WrappedNodeExpr(className_);
|
|
17731
17749
|
const { inputs, outputs, hasDecoratorIO, hasSignalIO } = extractInputsAndOutputs(classNode, compiler);
|
|
17732
|
-
const projectRelPath =
|
|
17750
|
+
const projectRelPath = relative13(projectRoot, componentFilePath).replace(/\\/g, "/");
|
|
17733
17751
|
const fingerprintId = encodeURIComponent(`${projectRelPath}@${className}`);
|
|
17734
17752
|
const currentFingerprint = extractFingerprint(classNode, className, decoratorMeta, inputs, outputs, sourceFile, componentDir);
|
|
17735
17753
|
const cachedFingerprint = fingerprintCache.get(fingerprintId);
|
|
@@ -18446,7 +18464,7 @@ __export(exports_compileEmber, {
|
|
|
18446
18464
|
});
|
|
18447
18465
|
import { existsSync as existsSync24 } from "fs";
|
|
18448
18466
|
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
|
|
18467
|
+
import { basename as basename9, dirname as dirname18, extname as extname7, join as join30, resolve as resolve25 } from "path";
|
|
18450
18468
|
var {build: bunBuild2, Transpiler: Transpiler4, write: write4, file: file3 } = globalThis.Bun;
|
|
18451
18469
|
var cachedPreprocessor = null, getPreprocessor = async () => {
|
|
18452
18470
|
if (cachedPreprocessor)
|
|
@@ -18542,7 +18560,7 @@ export const importSync = (specifier) => {
|
|
|
18542
18560
|
const originalImporter = stagedSourceMap.get(args.importer);
|
|
18543
18561
|
if (!originalImporter)
|
|
18544
18562
|
return;
|
|
18545
|
-
const candidateBase =
|
|
18563
|
+
const candidateBase = resolve25(dirname18(originalImporter), args.path);
|
|
18546
18564
|
const extensionsToTry = ["", ".gts", ".gjs", ".ts", ".js"];
|
|
18547
18565
|
for (const ext of extensionsToTry) {
|
|
18548
18566
|
const candidate = candidateBase + ext;
|
|
@@ -18601,7 +18619,7 @@ export const renderToHTML = (props = {}) => {
|
|
|
18601
18619
|
export { PageComponent };
|
|
18602
18620
|
export default PageComponent;
|
|
18603
18621
|
`, compileEmberFile = async (entry, compiledRoot, cwd = process.cwd()) => {
|
|
18604
|
-
const resolvedEntry =
|
|
18622
|
+
const resolvedEntry = resolve25(entry);
|
|
18605
18623
|
const source = await file3(resolvedEntry).text();
|
|
18606
18624
|
let preprocessed = source;
|
|
18607
18625
|
if (isTemplateTagFile(resolvedEntry)) {
|
|
@@ -18621,8 +18639,8 @@ export default PageComponent;
|
|
|
18621
18639
|
mkdir6(serverDir, { recursive: true }),
|
|
18622
18640
|
mkdir6(clientDir, { recursive: true })
|
|
18623
18641
|
]);
|
|
18624
|
-
const tmpPagePath =
|
|
18625
|
-
const tmpHarnessPath =
|
|
18642
|
+
const tmpPagePath = resolve25(join30(tmpDir, `${baseName}.module.js`));
|
|
18643
|
+
const tmpHarnessPath = resolve25(join30(tmpDir, `${baseName}.harness.js`));
|
|
18626
18644
|
await Promise.all([
|
|
18627
18645
|
write4(tmpPagePath, transpiled),
|
|
18628
18646
|
write4(tmpHarnessPath, generateServerHarness(tmpPagePath))
|
|
@@ -18664,7 +18682,7 @@ export default PageComponent;
|
|
|
18664
18682
|
serverPaths: outputs.map((o3) => o3.serverPath)
|
|
18665
18683
|
};
|
|
18666
18684
|
}, compileEmberFileSource = async (entry) => {
|
|
18667
|
-
const resolvedEntry =
|
|
18685
|
+
const resolvedEntry = resolve25(entry);
|
|
18668
18686
|
const source = await file3(resolvedEntry).text();
|
|
18669
18687
|
let preprocessed = source;
|
|
18670
18688
|
if (isTemplateTagFile(resolvedEntry)) {
|
|
@@ -18697,24 +18715,24 @@ __export(exports_buildReactVendor, {
|
|
|
18697
18715
|
buildReactVendor: () => buildReactVendor
|
|
18698
18716
|
});
|
|
18699
18717
|
import { existsSync as existsSync25, mkdirSync as mkdirSync10 } from "fs";
|
|
18700
|
-
import { join as join31, resolve as
|
|
18718
|
+
import { join as join31, resolve as resolve26 } from "path";
|
|
18701
18719
|
import { rm as rm5 } from "fs/promises";
|
|
18702
18720
|
var {build: bunBuild3 } = globalThis.Bun;
|
|
18703
18721
|
var resolveJsxDevRuntimeCompatPath = () => {
|
|
18704
18722
|
const candidates = [
|
|
18705
|
-
|
|
18706
|
-
|
|
18707
|
-
|
|
18708
|
-
|
|
18709
|
-
|
|
18710
|
-
|
|
18723
|
+
resolve26(import.meta.dir, "react", "jsxDevRuntimeCompat.js"),
|
|
18724
|
+
resolve26(import.meta.dir, "src", "react", "jsxDevRuntimeCompat.ts"),
|
|
18725
|
+
resolve26(import.meta.dir, "..", "react", "jsxDevRuntimeCompat.js"),
|
|
18726
|
+
resolve26(import.meta.dir, "..", "src", "react", "jsxDevRuntimeCompat.ts"),
|
|
18727
|
+
resolve26(import.meta.dir, "..", "..", "dist", "react", "jsxDevRuntimeCompat.js"),
|
|
18728
|
+
resolve26(import.meta.dir, "..", "..", "src", "react", "jsxDevRuntimeCompat.ts")
|
|
18711
18729
|
];
|
|
18712
18730
|
for (const candidate of candidates) {
|
|
18713
18731
|
if (existsSync25(candidate)) {
|
|
18714
18732
|
return candidate.replace(/\\/g, "/");
|
|
18715
18733
|
}
|
|
18716
18734
|
}
|
|
18717
|
-
return (candidates[0] ??
|
|
18735
|
+
return (candidates[0] ?? resolve26(import.meta.dir, "react", "jsxDevRuntimeCompat.js")).replace(/\\/g, "/");
|
|
18718
18736
|
}, jsxDevRuntimeCompatPath, reactSpecifiers, isResolvable = (specifier) => {
|
|
18719
18737
|
try {
|
|
18720
18738
|
Bun.resolveSync(specifier, process.cwd());
|
|
@@ -19364,7 +19382,7 @@ import {
|
|
|
19364
19382
|
statSync as statSync3,
|
|
19365
19383
|
writeFileSync as writeFileSync10
|
|
19366
19384
|
} from "fs";
|
|
19367
|
-
import { basename as basename10, dirname as dirname19, extname as extname8, join as join36, relative as
|
|
19385
|
+
import { basename as basename10, dirname as dirname19, extname as extname8, join as join36, relative as relative14, resolve as resolve27 } from "path";
|
|
19368
19386
|
import { cwd, env as env2, exit } from "process";
|
|
19369
19387
|
var {build: bunBuild7, Glob: Glob8 } = globalThis.Bun;
|
|
19370
19388
|
var isDev, isBuildTraceEnabled = () => {
|
|
@@ -19455,8 +19473,8 @@ var isDev, isBuildTraceEnabled = () => {
|
|
|
19455
19473
|
}
|
|
19456
19474
|
}, resolveAbsoluteVersion = async () => {
|
|
19457
19475
|
const candidates = [
|
|
19458
|
-
|
|
19459
|
-
|
|
19476
|
+
resolve27(import.meta.dir, "..", "..", "package.json"),
|
|
19477
|
+
resolve27(import.meta.dir, "..", "package.json")
|
|
19460
19478
|
];
|
|
19461
19479
|
const resolveCandidate = async (remaining) => {
|
|
19462
19480
|
const [candidate, ...rest] = remaining;
|
|
@@ -19472,7 +19490,7 @@ var isDev, isBuildTraceEnabled = () => {
|
|
|
19472
19490
|
};
|
|
19473
19491
|
await resolveCandidate(candidates);
|
|
19474
19492
|
}, SKIP_DIRS4, addWorkerPathIfExists = (file4, relPath, workerPaths) => {
|
|
19475
|
-
const absPath =
|
|
19493
|
+
const absPath = resolve27(file4, "..", relPath);
|
|
19476
19494
|
try {
|
|
19477
19495
|
statSync3(absPath);
|
|
19478
19496
|
workerPaths.add(absPath);
|
|
@@ -19534,7 +19552,7 @@ var isDev, isBuildTraceEnabled = () => {
|
|
|
19534
19552
|
return;
|
|
19535
19553
|
}
|
|
19536
19554
|
const indexFiles = readDir(reactIndexesPath).filter((file4) => file4.endsWith(".tsx"));
|
|
19537
|
-
const pagesRel =
|
|
19555
|
+
const pagesRel = relative14(process.cwd(), resolve27(reactPagesPath)).replace(/\\/g, "/");
|
|
19538
19556
|
for (const file4 of indexFiles) {
|
|
19539
19557
|
let content = readFileSync18(join36(reactIndexesPath, file4), "utf-8");
|
|
19540
19558
|
content = content.replace(/from\s*['"]([^'"]*\/pages\/([^'"]+))['"]/g, (_match, _fullPath, componentName) => `from '/@src/${pagesRel}/${componentName}'`);
|
|
@@ -19542,27 +19560,27 @@ var isDev, isBuildTraceEnabled = () => {
|
|
|
19542
19560
|
}
|
|
19543
19561
|
}, copySvelteDevIndexes = (svelteDir, sveltePagesPath, svelteEntries, devIndexDir) => {
|
|
19544
19562
|
const svelteIndexDir = join36(getFrameworkGeneratedDir("svelte"), "indexes");
|
|
19545
|
-
const sveltePageEntries = svelteEntries.filter((file4) =>
|
|
19563
|
+
const sveltePageEntries = svelteEntries.filter((file4) => resolve27(file4).startsWith(resolve27(sveltePagesPath)));
|
|
19546
19564
|
for (const entry of sveltePageEntries) {
|
|
19547
19565
|
const name = basename10(entry).replace(/\.svelte(\.(ts|js))?$/, "");
|
|
19548
19566
|
const indexFile = join36(svelteIndexDir, "pages", `${name}.js`);
|
|
19549
19567
|
if (!existsSync26(indexFile))
|
|
19550
19568
|
continue;
|
|
19551
19569
|
let content = readFileSync18(indexFile, "utf-8");
|
|
19552
|
-
const srcRel =
|
|
19570
|
+
const srcRel = relative14(process.cwd(), resolve27(entry)).replace(/\\/g, "/");
|
|
19553
19571
|
content = content.replace(/import\s+Component\s+from\s+['"]([^'"]+)['"]/, `import Component from "/@src/${srcRel}"`);
|
|
19554
19572
|
writeFileSync10(join36(devIndexDir, `${name}.svelte.js`), content);
|
|
19555
19573
|
}
|
|
19556
19574
|
}, copyVueDevIndexes = (vueDir, vuePagesPath, vueEntries, devIndexDir) => {
|
|
19557
19575
|
const vueIndexDir = join36(getFrameworkGeneratedDir("vue"), "indexes");
|
|
19558
|
-
const vuePageEntries = vueEntries.filter((file4) =>
|
|
19576
|
+
const vuePageEntries = vueEntries.filter((file4) => resolve27(file4).startsWith(resolve27(vuePagesPath)));
|
|
19559
19577
|
for (const entry of vuePageEntries) {
|
|
19560
19578
|
const name = basename10(entry, ".vue");
|
|
19561
19579
|
const indexFile = join36(vueIndexDir, `${name}.js`);
|
|
19562
19580
|
if (!existsSync26(indexFile))
|
|
19563
19581
|
continue;
|
|
19564
19582
|
let content = readFileSync18(indexFile, "utf-8");
|
|
19565
|
-
const srcRel =
|
|
19583
|
+
const srcRel = relative14(process.cwd(), resolve27(entry)).replace(/\\/g, "/");
|
|
19566
19584
|
content = content.replace(/import\s+Comp(?:\s*,\s*\*\s+as\s+\w+)?\s+from\s+['"]([^'"]+)['"]/, (match) => match.replace(/from\s+['"][^'"]+['"]/, `from "/@src/${srcRel}"`));
|
|
19567
19585
|
writeFileSync10(join36(devIndexDir, `${name}.vue.js`), content);
|
|
19568
19586
|
}
|
|
@@ -19575,7 +19593,7 @@ var isDev, isBuildTraceEnabled = () => {
|
|
|
19575
19593
|
const last = allComments[allComments.length - 1];
|
|
19576
19594
|
if (!last?.[1])
|
|
19577
19595
|
return JSON.stringify(outputPath);
|
|
19578
|
-
const srcPath =
|
|
19596
|
+
const srcPath = resolve27(projectRoot, last[1].replace("/client/", "/").replace(/\.js$/, ".ts"));
|
|
19579
19597
|
return JSON.stringify(srcPath);
|
|
19580
19598
|
}, QUOTE_CHARS, OPEN_BRACES, CLOSE_BRACES, findFunctionExpressionEnd = (content, startPos) => {
|
|
19581
19599
|
let depth = 0;
|
|
@@ -19637,7 +19655,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
19637
19655
|
}, buildDevUrlFileMap = (urlReferencedFiles, projectRoot) => {
|
|
19638
19656
|
const urlFileMap = new Map;
|
|
19639
19657
|
for (const srcPath of urlReferencedFiles) {
|
|
19640
|
-
const rel =
|
|
19658
|
+
const rel = relative14(projectRoot, srcPath).replace(/\\/g, "/");
|
|
19641
19659
|
const name = basename10(srcPath);
|
|
19642
19660
|
const mtime = Math.round(statSync3(srcPath).mtimeMs);
|
|
19643
19661
|
const url = `/@src/${rel}?v=${mtime}`;
|
|
@@ -19652,7 +19670,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
19652
19670
|
const output = nonReactClientOutputs.find((artifact) => basename10(artifact.path).startsWith(`${srcBase}.`));
|
|
19653
19671
|
if (!output)
|
|
19654
19672
|
continue;
|
|
19655
|
-
urlFileMap.set(basename10(srcPath), `/${
|
|
19673
|
+
urlFileMap.set(basename10(srcPath), `/${relative14(buildPath, output.path).replace(/\\/g, "/")}`);
|
|
19656
19674
|
}
|
|
19657
19675
|
return urlFileMap;
|
|
19658
19676
|
}, buildUrlFileMap = (urlReferencedFiles, hmr, projectRoot, buildPath, nonReactClientOutputs) => {
|
|
@@ -19901,13 +19919,13 @@ ${content.slice(firstUseIdx)}`;
|
|
|
19901
19919
|
const filterToIncrementalEntries = (entryPoints, mapToSource) => {
|
|
19902
19920
|
if (!isIncremental || !incrementalFiles)
|
|
19903
19921
|
return entryPoints;
|
|
19904
|
-
const normalizedIncremental = new Set(incrementalFiles.map((f2) =>
|
|
19922
|
+
const normalizedIncremental = new Set(incrementalFiles.map((f2) => resolve27(f2)));
|
|
19905
19923
|
const matchingEntries = [];
|
|
19906
19924
|
for (const entry of entryPoints) {
|
|
19907
19925
|
const sourceFile = mapToSource(entry);
|
|
19908
19926
|
if (!sourceFile)
|
|
19909
19927
|
continue;
|
|
19910
|
-
if (!normalizedIncremental.has(
|
|
19928
|
+
if (!normalizedIncremental.has(resolve27(sourceFile)))
|
|
19911
19929
|
continue;
|
|
19912
19930
|
matchingEntries.push(entry);
|
|
19913
19931
|
}
|
|
@@ -20072,7 +20090,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
20072
20090
|
}
|
|
20073
20091
|
const shouldIncludeHtmlAssets = !isIncremental || normalizedIncrementalFiles?.some((f2) => f2.includes("/html/") && (f2.endsWith(".html") || isStylePath(f2)));
|
|
20074
20092
|
const reactEntries = isIncremental && reactIndexesPath && reactPagesPath ? filterToIncrementalEntries(allReactEntries, (entry) => {
|
|
20075
|
-
if (entry.startsWith(
|
|
20093
|
+
if (entry.startsWith(resolve27(reactIndexesPath))) {
|
|
20076
20094
|
const pageName = basename10(entry, ".tsx");
|
|
20077
20095
|
return join36(reactPagesPath, `${pageName}.tsx`);
|
|
20078
20096
|
}
|
|
@@ -20107,10 +20125,12 @@ ${content.slice(firstUseIdx)}`;
|
|
|
20107
20125
|
const shouldCompileIslandSvelte = svelteDir && islandSvelteSources.length > 0;
|
|
20108
20126
|
const shouldCompileIslandVue = vueDir && islandVueSources.length > 0;
|
|
20109
20127
|
const shouldCompileIslandAngular = angularDir && islandAngularSources.length > 0;
|
|
20128
|
+
let angularProvidersEntryAddons = [];
|
|
20110
20129
|
if (shouldCompileAngular && angularDir) {
|
|
20111
20130
|
await tracePhase("scan/angular-handlers", async () => {
|
|
20112
20131
|
const { runAngularHandlerScan: runAngularHandlerScan2 } = await Promise.resolve().then(() => (init_runAngularHandlerScan(), exports_runAngularHandlerScan));
|
|
20113
|
-
runAngularHandlerScan2(projectRoot, angularDir);
|
|
20132
|
+
const scanResult = runAngularHandlerScan2(projectRoot, angularDir);
|
|
20133
|
+
angularProvidersEntryAddons = scanResult.angularEntryAddons;
|
|
20114
20134
|
});
|
|
20115
20135
|
}
|
|
20116
20136
|
const [
|
|
@@ -20135,7 +20155,8 @@ ${content.slice(firstUseIdx)}`;
|
|
|
20135
20155
|
},
|
|
20136
20156
|
shouldCompileAngular ? tracePhase("compile/angular", async () => {
|
|
20137
20157
|
const mod = await Promise.resolve().then(() => (init_compileAngular(), exports_compileAngular));
|
|
20138
|
-
const
|
|
20158
|
+
const combinedAngularEntries = angularProvidersEntryAddons.length > 0 ? [...angularEntries, ...angularProvidersEntryAddons] : angularEntries;
|
|
20159
|
+
const result = await mod.compileAngular(combinedAngularEntries, angularDir, hmr, styleTransformConfig);
|
|
20139
20160
|
if (hmr) {
|
|
20140
20161
|
try {
|
|
20141
20162
|
const { primeComponentFingerprint: primeComponentFingerprint2 } = await Promise.resolve().then(() => (init_fastHmrCompiler(), exports_fastHmrCompiler));
|
|
@@ -20185,7 +20206,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
20185
20206
|
const clientPath = islandSvelteClientPaths[idx];
|
|
20186
20207
|
if (!sourcePath || !clientPath)
|
|
20187
20208
|
continue;
|
|
20188
|
-
islandSvelteClientPathMap.set(
|
|
20209
|
+
islandSvelteClientPathMap.set(resolve27(sourcePath), clientPath);
|
|
20189
20210
|
}
|
|
20190
20211
|
const islandVueClientPathMap = new Map;
|
|
20191
20212
|
for (let idx = 0;idx < islandVueSources.length; idx++) {
|
|
@@ -20193,7 +20214,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
20193
20214
|
const clientPath = islandVueClientPaths[idx];
|
|
20194
20215
|
if (!sourcePath || !clientPath)
|
|
20195
20216
|
continue;
|
|
20196
|
-
islandVueClientPathMap.set(
|
|
20217
|
+
islandVueClientPathMap.set(resolve27(sourcePath), clientPath);
|
|
20197
20218
|
}
|
|
20198
20219
|
const islandAngularClientPathMap = new Map;
|
|
20199
20220
|
for (let idx = 0;idx < islandAngularSources.length; idx++) {
|
|
@@ -20201,7 +20222,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
20201
20222
|
const clientPath = islandAngularClientPaths[idx];
|
|
20202
20223
|
if (!sourcePath || !clientPath)
|
|
20203
20224
|
continue;
|
|
20204
|
-
islandAngularClientPathMap.set(
|
|
20225
|
+
islandAngularClientPathMap.set(resolve27(sourcePath), clientPath);
|
|
20205
20226
|
}
|
|
20206
20227
|
const reactConventionSources = collectConventionSourceFiles(conventionsMap.react);
|
|
20207
20228
|
const svelteConventionSources = collectConventionSourceFiles(conventionsMap.svelte);
|
|
@@ -20655,7 +20676,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
20655
20676
|
const fileDir = dirname19(artifact.path);
|
|
20656
20677
|
const relativePaths = {};
|
|
20657
20678
|
for (const [specifier, absolute] of Object.entries(angularServerVendorPaths2)) {
|
|
20658
|
-
const rel =
|
|
20679
|
+
const rel = relative14(fileDir, absolute);
|
|
20659
20680
|
relativePaths[specifier] = rel.startsWith(".") ? rel : `./${rel}`;
|
|
20660
20681
|
}
|
|
20661
20682
|
return relativePaths;
|
|
@@ -20724,7 +20745,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
20724
20745
|
if (skipAngularClientBundle) {
|
|
20725
20746
|
for (const clientPath of angularClientPaths) {
|
|
20726
20747
|
const fileBase = basename10(clientPath, ".js");
|
|
20727
|
-
const relFromCwd =
|
|
20748
|
+
const relFromCwd = relative14(projectRoot, clientPath).replace(/\\/g, "/");
|
|
20728
20749
|
manifest[`${toPascal(fileBase)}Index`] = `/@src/${relFromCwd}`;
|
|
20729
20750
|
}
|
|
20730
20751
|
}
|
|
@@ -21126,7 +21147,7 @@ __export(exports_dependencyGraph, {
|
|
|
21126
21147
|
});
|
|
21127
21148
|
import { existsSync as existsSync28, readFileSync as readFileSync19 } from "fs";
|
|
21128
21149
|
var {Glob: Glob9 } = globalThis.Bun;
|
|
21129
|
-
import { resolve as
|
|
21150
|
+
import { resolve as resolve28 } from "path";
|
|
21130
21151
|
var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath) => {
|
|
21131
21152
|
const lower = filePath.toLowerCase();
|
|
21132
21153
|
if (lower.endsWith(".ts") || lower.endsWith(".tsx") || lower.endsWith(".jsx"))
|
|
@@ -21140,8 +21161,8 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
21140
21161
|
if (!importPath.startsWith(".") && !importPath.startsWith("/")) {
|
|
21141
21162
|
return null;
|
|
21142
21163
|
}
|
|
21143
|
-
const fromDir =
|
|
21144
|
-
const normalized =
|
|
21164
|
+
const fromDir = resolve28(fromFile, "..");
|
|
21165
|
+
const normalized = resolve28(fromDir, importPath);
|
|
21145
21166
|
const extensions = [
|
|
21146
21167
|
".ts",
|
|
21147
21168
|
".tsx",
|
|
@@ -21171,7 +21192,7 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
21171
21192
|
dependents.delete(normalizedPath);
|
|
21172
21193
|
}
|
|
21173
21194
|
}, addFileToGraph = (graph, filePath) => {
|
|
21174
|
-
const normalizedPath =
|
|
21195
|
+
const normalizedPath = resolve28(filePath);
|
|
21175
21196
|
if (!existsSync28(normalizedPath))
|
|
21176
21197
|
return;
|
|
21177
21198
|
const dependencies = extractDependencies(normalizedPath);
|
|
@@ -21198,10 +21219,10 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
21198
21219
|
}, IGNORED_SEGMENTS, buildInitialDependencyGraph = (graph, directories) => {
|
|
21199
21220
|
const processedFiles = new Set;
|
|
21200
21221
|
const glob = new Glob9("**/*.{ts,tsx,js,jsx,vue,svelte,html,htm}");
|
|
21201
|
-
const resolvedDirs = directories.map((dir) =>
|
|
21222
|
+
const resolvedDirs = directories.map((dir) => resolve28(dir)).filter((dir) => existsSync28(dir));
|
|
21202
21223
|
const allFiles = resolvedDirs.flatMap((dir) => Array.from(glob.scanSync({ absolute: true, cwd: dir })));
|
|
21203
21224
|
for (const file4 of allFiles) {
|
|
21204
|
-
const fullPath =
|
|
21225
|
+
const fullPath = resolve28(file4);
|
|
21205
21226
|
if (IGNORED_SEGMENTS.some((seg) => fullPath.includes(seg)))
|
|
21206
21227
|
continue;
|
|
21207
21228
|
if (processedFiles.has(fullPath))
|
|
@@ -21314,7 +21335,7 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
21314
21335
|
return [];
|
|
21315
21336
|
}
|
|
21316
21337
|
}, getAffectedFiles = (graph, changedFile) => {
|
|
21317
|
-
const normalizedPath =
|
|
21338
|
+
const normalizedPath = resolve28(changedFile);
|
|
21318
21339
|
const affected = new Set;
|
|
21319
21340
|
const toProcess = [normalizedPath];
|
|
21320
21341
|
const processNode = (current) => {
|
|
@@ -21345,7 +21366,7 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
21345
21366
|
}, removeDependentsForFile = (graph, normalizedPath) => {
|
|
21346
21367
|
graph.dependents.delete(normalizedPath);
|
|
21347
21368
|
}, removeFileFromGraph = (graph, filePath) => {
|
|
21348
|
-
const normalizedPath =
|
|
21369
|
+
const normalizedPath = resolve28(filePath);
|
|
21349
21370
|
removeDepsForFile(graph, normalizedPath);
|
|
21350
21371
|
removeDependentsForFile(graph, normalizedPath);
|
|
21351
21372
|
};
|
|
@@ -21388,12 +21409,12 @@ var globalVersionCounter = 0, createModuleVersionTracker = () => new Map, getNex
|
|
|
21388
21409
|
};
|
|
21389
21410
|
|
|
21390
21411
|
// src/dev/configResolver.ts
|
|
21391
|
-
import { resolve as
|
|
21412
|
+
import { resolve as resolve29 } from "path";
|
|
21392
21413
|
var resolveBuildPaths = (config) => {
|
|
21393
21414
|
const cwd2 = process.cwd();
|
|
21394
21415
|
const normalize = (path) => path.replace(/\\/g, "/");
|
|
21395
|
-
const withDefault = (value, fallback) => normalize(
|
|
21396
|
-
const optional = (value) => value ? normalize(
|
|
21416
|
+
const withDefault = (value, fallback) => normalize(resolve29(cwd2, value ?? fallback));
|
|
21417
|
+
const optional = (value) => value ? normalize(resolve29(cwd2, value)) : undefined;
|
|
21397
21418
|
return {
|
|
21398
21419
|
angularDir: optional(config.angularDirectory),
|
|
21399
21420
|
assetsDir: optional(config.assetsDirectory),
|
|
@@ -21447,7 +21468,7 @@ var init_clientManager = __esm(() => {
|
|
|
21447
21468
|
|
|
21448
21469
|
// src/dev/pathUtils.ts
|
|
21449
21470
|
import { existsSync as existsSync29, readdirSync as readdirSync4, readFileSync as readFileSync20 } from "fs";
|
|
21450
|
-
import { dirname as dirname20, resolve as
|
|
21471
|
+
import { dirname as dirname20, resolve as resolve30 } from "path";
|
|
21451
21472
|
var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
21452
21473
|
if (shouldIgnorePath(filePath, resolved)) {
|
|
21453
21474
|
return "ignored";
|
|
@@ -21523,7 +21544,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
21523
21544
|
return "unknown";
|
|
21524
21545
|
}, collectAngularResourceDirs = (angularDir) => {
|
|
21525
21546
|
const out = new Set;
|
|
21526
|
-
const angularRoot =
|
|
21547
|
+
const angularRoot = resolve30(angularDir);
|
|
21527
21548
|
const angularRootNormalized = normalizePath(angularRoot);
|
|
21528
21549
|
const walk = (dir) => {
|
|
21529
21550
|
let entries;
|
|
@@ -21536,7 +21557,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
21536
21557
|
if (entry.name.startsWith(".") || entry.name === "node_modules") {
|
|
21537
21558
|
continue;
|
|
21538
21559
|
}
|
|
21539
|
-
const full =
|
|
21560
|
+
const full = resolve30(dir, entry.name);
|
|
21540
21561
|
if (entry.isDirectory()) {
|
|
21541
21562
|
walk(full);
|
|
21542
21563
|
continue;
|
|
@@ -21577,7 +21598,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
21577
21598
|
}
|
|
21578
21599
|
const componentDir = dirname20(full);
|
|
21579
21600
|
for (const ref of refs) {
|
|
21580
|
-
const refAbs = normalizePath(
|
|
21601
|
+
const refAbs = normalizePath(resolve30(componentDir, ref));
|
|
21581
21602
|
const refDir = normalizePath(dirname20(refAbs));
|
|
21582
21603
|
if (refDir === angularRootNormalized || refDir.startsWith(angularRootNormalized + "/")) {
|
|
21583
21604
|
continue;
|
|
@@ -21594,7 +21615,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
21594
21615
|
const push = (path) => {
|
|
21595
21616
|
if (!path)
|
|
21596
21617
|
return;
|
|
21597
|
-
const abs = normalizePath(
|
|
21618
|
+
const abs = normalizePath(resolve30(cwd2, path));
|
|
21598
21619
|
if (!roots.includes(abs))
|
|
21599
21620
|
roots.push(abs);
|
|
21600
21621
|
};
|
|
@@ -21619,7 +21640,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
21619
21640
|
push(cfg.assetsDir);
|
|
21620
21641
|
push(cfg.stylesDir);
|
|
21621
21642
|
for (const candidate of ["src", "db", "assets", "styles"]) {
|
|
21622
|
-
const abs = normalizePath(
|
|
21643
|
+
const abs = normalizePath(resolve30(cwd2, candidate));
|
|
21623
21644
|
if (existsSync29(abs) && !roots.includes(abs))
|
|
21624
21645
|
roots.push(abs);
|
|
21625
21646
|
}
|
|
@@ -21631,7 +21652,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
21631
21652
|
continue;
|
|
21632
21653
|
if (entry.name.startsWith("."))
|
|
21633
21654
|
continue;
|
|
21634
|
-
const abs = normalizePath(
|
|
21655
|
+
const abs = normalizePath(resolve30(cwd2, entry.name));
|
|
21635
21656
|
if (roots.includes(abs))
|
|
21636
21657
|
continue;
|
|
21637
21658
|
if (shouldIgnorePath(abs, resolved))
|
|
@@ -21706,7 +21727,7 @@ var init_pathUtils = __esm(() => {
|
|
|
21706
21727
|
// src/dev/fileWatcher.ts
|
|
21707
21728
|
import { watch } from "fs";
|
|
21708
21729
|
import { existsSync as existsSync30, readdirSync as readdirSync5, statSync as statSync4 } from "fs";
|
|
21709
|
-
import { dirname as dirname21, join as join38, resolve as
|
|
21730
|
+
import { dirname as dirname21, join as join38, resolve as resolve31 } from "path";
|
|
21710
21731
|
var safeRemoveFromGraph = (graph, fullPath) => {
|
|
21711
21732
|
try {
|
|
21712
21733
|
removeFileFromGraph(graph, fullPath);
|
|
@@ -21787,7 +21808,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
21787
21808
|
}, addFileWatchers = (state, paths, onFileChange) => {
|
|
21788
21809
|
const stylesDir = state.resolvedPaths?.stylesDir;
|
|
21789
21810
|
paths.forEach((path) => {
|
|
21790
|
-
const absolutePath =
|
|
21811
|
+
const absolutePath = resolve31(path).replace(/\\/g, "/");
|
|
21791
21812
|
if (!existsSync30(absolutePath)) {
|
|
21792
21813
|
return;
|
|
21793
21814
|
}
|
|
@@ -21798,7 +21819,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
21798
21819
|
const watchPaths = getWatchPaths(config, state.resolvedPaths);
|
|
21799
21820
|
const stylesDir = state.resolvedPaths?.stylesDir;
|
|
21800
21821
|
watchPaths.forEach((path) => {
|
|
21801
|
-
const absolutePath =
|
|
21822
|
+
const absolutePath = resolve31(path).replace(/\\/g, "/");
|
|
21802
21823
|
if (!existsSync30(absolutePath)) {
|
|
21803
21824
|
return;
|
|
21804
21825
|
}
|
|
@@ -21817,13 +21838,13 @@ var init_fileWatcher = __esm(() => {
|
|
|
21817
21838
|
});
|
|
21818
21839
|
|
|
21819
21840
|
// src/dev/assetStore.ts
|
|
21820
|
-
import { resolve as
|
|
21841
|
+
import { resolve as resolve32 } from "path";
|
|
21821
21842
|
import { readdir as readdir4, unlink } from "fs/promises";
|
|
21822
21843
|
var mimeTypes, getMimeType = (filePath) => {
|
|
21823
21844
|
const ext = filePath.slice(filePath.lastIndexOf("."));
|
|
21824
21845
|
return mimeTypes[ext] ?? "application/octet-stream";
|
|
21825
21846
|
}, HASHED_FILE_RE, stripHash = (webPath) => webPath.replace(/\.[a-z0-9]{8}(\.(js|css|mjs))$/, "$1"), processWalkEntry = (entry, dir, liveByIdentity, walkAndClean) => {
|
|
21826
|
-
const fullPath =
|
|
21847
|
+
const fullPath = resolve32(dir, entry.name);
|
|
21827
21848
|
if (entry.isDirectory()) {
|
|
21828
21849
|
return walkAndClean(fullPath);
|
|
21829
21850
|
}
|
|
@@ -21839,10 +21860,10 @@ var mimeTypes, getMimeType = (filePath) => {
|
|
|
21839
21860
|
}, cleanStaleAssets = async (store, manifest, buildDir) => {
|
|
21840
21861
|
const liveByIdentity = new Map;
|
|
21841
21862
|
for (const webPath of store.keys()) {
|
|
21842
|
-
const diskPath =
|
|
21863
|
+
const diskPath = resolve32(buildDir, webPath.slice(1));
|
|
21843
21864
|
liveByIdentity.set(stripHash(diskPath), diskPath);
|
|
21844
21865
|
}
|
|
21845
|
-
const absBuildDir =
|
|
21866
|
+
const absBuildDir = resolve32(buildDir);
|
|
21846
21867
|
Object.values(manifest).forEach((val) => {
|
|
21847
21868
|
if (!HASHED_FILE_RE.test(val))
|
|
21848
21869
|
return;
|
|
@@ -21860,7 +21881,7 @@ var mimeTypes, getMimeType = (filePath) => {
|
|
|
21860
21881
|
} catch {}
|
|
21861
21882
|
}, lookupAsset = (store, path) => store.get(path), processScanEntry = (entry, dir, prefix, store, scanDir) => {
|
|
21862
21883
|
if (entry.isDirectory()) {
|
|
21863
|
-
return scanDir(
|
|
21884
|
+
return scanDir(resolve32(dir, entry.name), `${prefix}${entry.name}/`);
|
|
21864
21885
|
}
|
|
21865
21886
|
if (!entry.name.startsWith("chunk-")) {
|
|
21866
21887
|
return null;
|
|
@@ -21869,7 +21890,7 @@ var mimeTypes, getMimeType = (filePath) => {
|
|
|
21869
21890
|
if (store.has(webPath)) {
|
|
21870
21891
|
return null;
|
|
21871
21892
|
}
|
|
21872
|
-
return Bun.file(
|
|
21893
|
+
return Bun.file(resolve32(dir, entry.name)).bytes().then((bytes) => {
|
|
21873
21894
|
store.set(webPath, bytes);
|
|
21874
21895
|
return;
|
|
21875
21896
|
}).catch(() => {});
|
|
@@ -21891,7 +21912,7 @@ var mimeTypes, getMimeType = (filePath) => {
|
|
|
21891
21912
|
for (const webPath of newIdentities.values()) {
|
|
21892
21913
|
if (store.has(webPath))
|
|
21893
21914
|
continue;
|
|
21894
|
-
loadPromises.push(Bun.file(
|
|
21915
|
+
loadPromises.push(Bun.file(resolve32(buildDir, webPath.slice(1))).bytes().then((bytes) => {
|
|
21895
21916
|
store.set(webPath, bytes);
|
|
21896
21917
|
return;
|
|
21897
21918
|
}).catch(() => {}));
|
|
@@ -21922,7 +21943,7 @@ var init_assetStore = __esm(() => {
|
|
|
21922
21943
|
|
|
21923
21944
|
// src/islands/pageMetadata.ts
|
|
21924
21945
|
import { readFileSync as readFileSync21 } from "fs";
|
|
21925
|
-
import { dirname as dirname22, resolve as
|
|
21946
|
+
import { dirname as dirname22, resolve as resolve33 } from "path";
|
|
21926
21947
|
var pagePatterns, getPageDirs = (config) => [
|
|
21927
21948
|
{ dir: config.angularDirectory, framework: "angular" },
|
|
21928
21949
|
{ dir: config.emberDirectory, framework: "ember" },
|
|
@@ -21942,15 +21963,15 @@ var pagePatterns, getPageDirs = (config) => [
|
|
|
21942
21963
|
const source = definition.buildReference?.source;
|
|
21943
21964
|
if (!source)
|
|
21944
21965
|
continue;
|
|
21945
|
-
const resolvedSource = source.startsWith("file://") ? new URL(source).pathname :
|
|
21946
|
-
lookup.set(`${definition.framework}:${definition.component}`,
|
|
21966
|
+
const resolvedSource = source.startsWith("file://") ? new URL(source).pathname : resolve33(dirname22(buildInfo.resolvedRegistryPath), source);
|
|
21967
|
+
lookup.set(`${definition.framework}:${definition.component}`, resolve33(resolvedSource));
|
|
21947
21968
|
}
|
|
21948
21969
|
return lookup;
|
|
21949
21970
|
}, getCurrentPageIslandMetadata = () => globalThis.__absolutePageIslandMetadata ?? new Map, metadataUsesSource = (metadata, target) => metadata.islands.some((usage) => {
|
|
21950
21971
|
const candidate = usage.source;
|
|
21951
|
-
return candidate ?
|
|
21972
|
+
return candidate ? resolve33(candidate) === target : false;
|
|
21952
21973
|
}), getPagesUsingIslandSource = (sourcePath) => {
|
|
21953
|
-
const target =
|
|
21974
|
+
const target = resolve33(sourcePath);
|
|
21954
21975
|
return [...getCurrentPageIslandMetadata().values()].filter((metadata) => metadataUsesSource(metadata, target)).map((metadata) => metadata.pagePath);
|
|
21955
21976
|
}, resolveIslandUsages = (islands, islandSourceLookup) => islands.map((usage) => {
|
|
21956
21977
|
const sourcePath = islandSourceLookup.get(`${usage.framework}:${usage.component}`);
|
|
@@ -21962,13 +21983,13 @@ var pagePatterns, getPageDirs = (config) => [
|
|
|
21962
21983
|
const pattern = pagePatterns[entry.framework];
|
|
21963
21984
|
if (!pattern)
|
|
21964
21985
|
return;
|
|
21965
|
-
const files = await scanEntryPoints(
|
|
21986
|
+
const files = await scanEntryPoints(resolve33(entry.dir), pattern);
|
|
21966
21987
|
for (const filePath of files) {
|
|
21967
21988
|
const source = readFileSync21(filePath, "utf-8");
|
|
21968
21989
|
const islands = extractIslandUsagesFromSource(source);
|
|
21969
|
-
pageMetadata.set(
|
|
21990
|
+
pageMetadata.set(resolve33(filePath), {
|
|
21970
21991
|
islands: resolveIslandUsages(islands, islandSourceLookup),
|
|
21971
|
-
pagePath:
|
|
21992
|
+
pagePath: resolve33(filePath)
|
|
21972
21993
|
});
|
|
21973
21994
|
}
|
|
21974
21995
|
}, loadPageIslandMetadata = async (config) => {
|
|
@@ -22091,9 +22112,9 @@ var init_transformCache = __esm(() => {
|
|
|
22091
22112
|
});
|
|
22092
22113
|
|
|
22093
22114
|
// src/dev/reactComponentClassifier.ts
|
|
22094
|
-
import { resolve as
|
|
22115
|
+
import { resolve as resolve34 } from "path";
|
|
22095
22116
|
var classifyComponent = (filePath) => {
|
|
22096
|
-
const normalizedPath =
|
|
22117
|
+
const normalizedPath = resolve34(filePath);
|
|
22097
22118
|
if (normalizedPath.includes("/react/pages/")) {
|
|
22098
22119
|
return "server";
|
|
22099
22120
|
}
|
|
@@ -22105,7 +22126,7 @@ var classifyComponent = (filePath) => {
|
|
|
22105
22126
|
var init_reactComponentClassifier = () => {};
|
|
22106
22127
|
|
|
22107
22128
|
// src/dev/moduleMapper.ts
|
|
22108
|
-
import { basename as basename11, resolve as
|
|
22129
|
+
import { basename as basename11, resolve as resolve35 } from "path";
|
|
22109
22130
|
var buildModulePaths = (moduleKeys, manifest) => {
|
|
22110
22131
|
const modulePaths = {};
|
|
22111
22132
|
moduleKeys.forEach((key) => {
|
|
@@ -22115,7 +22136,7 @@ var buildModulePaths = (moduleKeys, manifest) => {
|
|
|
22115
22136
|
});
|
|
22116
22137
|
return modulePaths;
|
|
22117
22138
|
}, processChangedFile = (sourceFile, framework, manifest, resolvedPaths, processedFiles) => {
|
|
22118
|
-
const normalizedFile =
|
|
22139
|
+
const normalizedFile = resolve35(sourceFile);
|
|
22119
22140
|
const normalizedPath = normalizedFile.replace(/\\/g, "/");
|
|
22120
22141
|
if (processedFiles.has(normalizedFile)) {
|
|
22121
22142
|
return null;
|
|
@@ -22151,7 +22172,7 @@ var buildModulePaths = (moduleKeys, manifest) => {
|
|
|
22151
22172
|
});
|
|
22152
22173
|
return grouped;
|
|
22153
22174
|
}, mapSourceFileToManifestKeys = (sourceFile, framework, resolvedPaths) => {
|
|
22154
|
-
const normalizedFile =
|
|
22175
|
+
const normalizedFile = resolve35(sourceFile);
|
|
22155
22176
|
const fileName = basename11(normalizedFile);
|
|
22156
22177
|
const baseName = fileName.replace(/\.(tsx?|jsx?|vue|svelte|css|html)$/, "");
|
|
22157
22178
|
const pascalName = toPascal(baseName);
|
|
@@ -22213,7 +22234,7 @@ __export(exports_resolveOwningComponents, {
|
|
|
22213
22234
|
invalidateResourceIndex: () => invalidateResourceIndex
|
|
22214
22235
|
});
|
|
22215
22236
|
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
|
|
22237
|
+
import { dirname as dirname23, extname as extname9, join as join39, resolve as resolve36 } from "path";
|
|
22217
22238
|
import ts14 from "typescript";
|
|
22218
22239
|
var ENTITY_DECORATORS, isAngularSourceFile = (file4) => file4.endsWith(".ts") || file4.endsWith(".tsx"), walkAngularSourceFiles = (root) => {
|
|
22219
22240
|
const out = [];
|
|
@@ -22326,7 +22347,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file4) => file4.endsWith(".ts") ||
|
|
|
22326
22347
|
};
|
|
22327
22348
|
visit(sourceFile);
|
|
22328
22349
|
return out;
|
|
22329
|
-
}, safeNormalize = (path) =>
|
|
22350
|
+
}, safeNormalize = (path) => resolve36(path).replace(/\\/g, "/"), resolveOwningComponents = (params) => {
|
|
22330
22351
|
const { changedFilePath, userAngularRoot } = params;
|
|
22331
22352
|
const changedAbs = safeNormalize(changedFilePath);
|
|
22332
22353
|
const out = [];
|
|
@@ -22395,7 +22416,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file4) => file4.endsWith(".ts") ||
|
|
|
22395
22416
|
if (!spec.startsWith(".") && !spec.startsWith("/")) {
|
|
22396
22417
|
return null;
|
|
22397
22418
|
}
|
|
22398
|
-
const base =
|
|
22419
|
+
const base = resolve36(childDir, spec);
|
|
22399
22420
|
const candidates = [
|
|
22400
22421
|
`${base}.ts`,
|
|
22401
22422
|
`${base}.tsx`,
|
|
@@ -22433,7 +22454,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file4) => file4.endsWith(".ts") ||
|
|
|
22433
22454
|
};
|
|
22434
22455
|
if (cls.kind === "component") {
|
|
22435
22456
|
for (const url of [...cls.templateUrls, ...cls.styleUrls]) {
|
|
22436
|
-
const abs = safeNormalize(
|
|
22457
|
+
const abs = safeNormalize(resolve36(componentDir, url));
|
|
22437
22458
|
const existing = resource.get(abs);
|
|
22438
22459
|
if (existing)
|
|
22439
22460
|
existing.push(entity);
|
|
@@ -22618,7 +22639,7 @@ __export(exports_loadConfig, {
|
|
|
22618
22639
|
isWorkspaceConfig: () => isWorkspaceConfig,
|
|
22619
22640
|
getWorkspaceServices: () => getWorkspaceServices
|
|
22620
22641
|
});
|
|
22621
|
-
import { resolve as
|
|
22642
|
+
import { resolve as resolve37 } from "path";
|
|
22622
22643
|
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
22644
|
if (!isObject2(config)) {
|
|
22624
22645
|
return false;
|
|
@@ -22669,7 +22690,7 @@ var RESERVED_TOP_LEVEL_KEYS, isObject2 = (value) => typeof value === "object" &&
|
|
|
22669
22690
|
}
|
|
22670
22691
|
return config;
|
|
22671
22692
|
}, loadRawConfig = async (configPath2) => {
|
|
22672
|
-
const resolved =
|
|
22693
|
+
const resolved = resolve37(configPath2 ?? process.env.ABSOLUTE_CONFIG ?? "absolute.config.ts");
|
|
22673
22694
|
const mod = await import(resolved);
|
|
22674
22695
|
const config = mod.default ?? mod.config;
|
|
22675
22696
|
if (!config) {
|
|
@@ -22730,7 +22751,7 @@ __export(exports_moduleServer, {
|
|
|
22730
22751
|
SRC_URL_PREFIX: () => SRC_URL_PREFIX
|
|
22731
22752
|
});
|
|
22732
22753
|
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
|
|
22754
|
+
import { basename as basename12, dirname as dirname24, extname as extname10, join as join40, resolve as resolve38, relative as relative15 } from "path";
|
|
22734
22755
|
var SRC_PREFIX = "/@src/", jsTranspiler2, tsTranspiler2, tsxTranspiler, TRANSPILABLE, ALL_EXPORTS_RE, STRING_CONTENTS_RE, preserveTypeExports = (originalSource, transpiled, valueExports) => {
|
|
22735
22756
|
const codeOnly = originalSource.replace(STRING_CONTENTS_RE, '""');
|
|
22736
22757
|
const allExports = [];
|
|
@@ -22750,7 +22771,7 @@ var SRC_PREFIX = "/@src/", jsTranspiler2, tsTranspiler2, tsxTranspiler, TRANSPIL
|
|
|
22750
22771
|
${stubs}
|
|
22751
22772
|
`;
|
|
22752
22773
|
}, resolveRelativeExtension = (srcPath, projectRoot, extensions) => {
|
|
22753
|
-
const found = extensions.find((ext) => existsSync31(
|
|
22774
|
+
const found = extensions.find((ext) => existsSync31(resolve38(projectRoot, srcPath + ext)));
|
|
22754
22775
|
return found ? srcPath + found : srcPath;
|
|
22755
22776
|
}, IMPORT_EXTENSIONS, SIDE_EFFECT_EXTENSIONS, MODULE_EXTENSIONS, RESOLVED_MODULE_EXTENSIONS, REACT_EXTENSIONS, escapeRegex3 = (str) => str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), buildImportRewriter = (vendorPaths) => {
|
|
22756
22777
|
const entries = Object.entries(vendorPaths).sort(([a], [b2]) => b2.length - a.length);
|
|
@@ -22765,7 +22786,7 @@ ${stubs}
|
|
|
22765
22786
|
return invalidationVersion > 0 ? `${mtime}.${invalidationVersion}` : `${mtime}`;
|
|
22766
22787
|
}, srcUrl = (relPath, projectRoot) => {
|
|
22767
22788
|
const base = `${SRC_PREFIX}${relPath.replace(/\\/g, "/")}`;
|
|
22768
|
-
const absPath =
|
|
22789
|
+
const absPath = resolve38(projectRoot, relPath);
|
|
22769
22790
|
const cached = mtimeCache.get(absPath);
|
|
22770
22791
|
if (cached !== undefined)
|
|
22771
22792
|
return `${base}?v=${buildVersion(cached, absPath)}`;
|
|
@@ -22777,12 +22798,12 @@ ${stubs}
|
|
|
22777
22798
|
return base;
|
|
22778
22799
|
}
|
|
22779
22800
|
}, resolveRelativeImport = (relPath, fileDir, projectRoot, extensions) => {
|
|
22780
|
-
const absPath =
|
|
22781
|
-
const rel =
|
|
22801
|
+
const absPath = resolve38(fileDir, relPath);
|
|
22802
|
+
const rel = relative15(projectRoot, absPath);
|
|
22782
22803
|
const extension = extname10(rel);
|
|
22783
22804
|
let srcPath = RESOLVED_MODULE_EXTENSIONS.has(extension) ? rel : resolveRelativeExtension(rel, projectRoot, extensions);
|
|
22784
22805
|
if (extname10(srcPath) === ".svelte") {
|
|
22785
|
-
srcPath =
|
|
22806
|
+
srcPath = relative15(projectRoot, resolveSvelteModulePath(resolve38(projectRoot, srcPath)));
|
|
22786
22807
|
}
|
|
22787
22808
|
return srcUrl(srcPath, projectRoot);
|
|
22788
22809
|
}, NODE_BUILTIN_RE, resolveAbsoluteSpecifier = (specifier, projectRoot) => {
|
|
@@ -22794,27 +22815,27 @@ ${stubs}
|
|
|
22794
22815
|
"import"
|
|
22795
22816
|
]);
|
|
22796
22817
|
if (fromExports)
|
|
22797
|
-
return
|
|
22818
|
+
return relative15(projectRoot, fromExports);
|
|
22798
22819
|
try {
|
|
22799
22820
|
const isScoped = specifier.startsWith("@");
|
|
22800
22821
|
const parts = specifier.split("/");
|
|
22801
22822
|
const packageName = isScoped ? `${parts[0]}/${parts[1]}` : parts[0];
|
|
22802
22823
|
const subpath = isScoped ? parts.slice(2).join("/") : parts.slice(1).join("/");
|
|
22803
22824
|
if (!subpath) {
|
|
22804
|
-
const pkgDir =
|
|
22825
|
+
const pkgDir = resolve38(projectRoot, "node_modules", packageName ?? "");
|
|
22805
22826
|
const pkgJsonPath = join40(pkgDir, "package.json");
|
|
22806
22827
|
if (existsSync31(pkgJsonPath)) {
|
|
22807
22828
|
const pkg = JSON.parse(readFileSync24(pkgJsonPath, "utf-8"));
|
|
22808
22829
|
const esmEntry = typeof pkg.module === "string" && pkg.module || typeof pkg.browser === "string" && pkg.browser;
|
|
22809
22830
|
if (esmEntry) {
|
|
22810
|
-
const resolved =
|
|
22831
|
+
const resolved = resolve38(pkgDir, esmEntry);
|
|
22811
22832
|
if (existsSync31(resolved))
|
|
22812
|
-
return
|
|
22833
|
+
return relative15(projectRoot, resolved);
|
|
22813
22834
|
}
|
|
22814
22835
|
}
|
|
22815
22836
|
}
|
|
22816
22837
|
} catch {}
|
|
22817
|
-
return
|
|
22838
|
+
return relative15(projectRoot, Bun.resolveSync(specifier, projectRoot));
|
|
22818
22839
|
} catch {
|
|
22819
22840
|
return;
|
|
22820
22841
|
}
|
|
@@ -22845,22 +22866,22 @@ ${stubs}
|
|
|
22845
22866
|
result = result.replace(/(import\s*["'])(\.\.?\/[^"']+)(["']\s*;?)/g, (_match, prefix, relPath, suffix) => `${prefix}${resolveRelativeImport(relPath, fileDir, projectRoot, SIDE_EFFECT_EXTENSIONS)}${suffix}`);
|
|
22846
22867
|
const rewriteAbsoluteToSrc = (_match, prefix, absPath, _ext, suffix) => {
|
|
22847
22868
|
if (absPath.startsWith(projectRoot)) {
|
|
22848
|
-
const rel2 =
|
|
22869
|
+
const rel2 = relative15(projectRoot, absPath).replace(/\\/g, "/");
|
|
22849
22870
|
return `${prefix}${srcUrl(rel2, projectRoot)}${suffix}`;
|
|
22850
22871
|
}
|
|
22851
|
-
const rel =
|
|
22872
|
+
const rel = relative15(projectRoot, absPath).replace(/\\/g, "/");
|
|
22852
22873
|
return `${prefix}${srcUrl(rel, projectRoot)}${suffix}`;
|
|
22853
22874
|
};
|
|
22854
22875
|
result = result.replace(/((?:from|import)\s*["'])(\/[^"']+\.(tsx?|jsx?|ts))(["'])/g, rewriteAbsoluteToSrc);
|
|
22855
22876
|
result = result.replace(/(import\s*\(\s*["'])(\/[^"']+\.(tsx?|jsx?|ts))(["']\s*\))/g, rewriteAbsoluteToSrc);
|
|
22856
22877
|
result = result.replace(/new\s+URL\(\s*["'](\.\.?\/[^"']+)["']\s*,\s*import\.meta\.url\s*\)/g, (_match, relPath) => {
|
|
22857
|
-
const absPath =
|
|
22858
|
-
const rel =
|
|
22878
|
+
const absPath = resolve38(fileDir, relPath);
|
|
22879
|
+
const rel = relative15(projectRoot, absPath);
|
|
22859
22880
|
return `new URL('${srcUrl(rel, projectRoot)}', import.meta.url)`;
|
|
22860
22881
|
});
|
|
22861
22882
|
result = result.replace(/import\.meta\.resolve\(\s*["'](\.\.?\/[^"']+)["']\s*\)/g, (_match, relPath) => {
|
|
22862
|
-
const absPath =
|
|
22863
|
-
const rel =
|
|
22883
|
+
const absPath = resolve38(fileDir, relPath);
|
|
22884
|
+
const rel = relative15(projectRoot, absPath);
|
|
22864
22885
|
return `'${srcUrl(rel, projectRoot)}'`;
|
|
22865
22886
|
});
|
|
22866
22887
|
return result;
|
|
@@ -22916,7 +22937,7 @@ ${code}`;
|
|
|
22916
22937
|
transpiled = `var $RefreshReg$ = window.$RefreshReg$ || function(){};
|
|
22917
22938
|
` + `var $RefreshSig$ = window.$RefreshSig$ || function(){ return function(t){ return t; }; };
|
|
22918
22939
|
${transpiled}`;
|
|
22919
|
-
const relPath =
|
|
22940
|
+
const relPath = relative15(projectRoot, filePath).replace(/\\/g, "/");
|
|
22920
22941
|
transpiled = transpiled.replace(/\binput\.tsx:/g, `${relPath}:`);
|
|
22921
22942
|
transpiled += buildIslandMetadataExports(raw);
|
|
22922
22943
|
return rewriteImports(transpiled, filePath, projectRoot, rewriter);
|
|
@@ -23077,11 +23098,11 @@ ${code}`;
|
|
|
23077
23098
|
if (compiled.css?.code) {
|
|
23078
23099
|
const cssPath = `${filePath}.css`;
|
|
23079
23100
|
svelteExternalCss.set(cssPath, compiled.css.code);
|
|
23080
|
-
const cssUrl = srcUrl(
|
|
23101
|
+
const cssUrl = srcUrl(relative15(projectRoot, cssPath), projectRoot);
|
|
23081
23102
|
code = `import "${cssUrl}";
|
|
23082
23103
|
${code}`;
|
|
23083
23104
|
}
|
|
23084
|
-
const moduleUrl = `${SRC_PREFIX}${
|
|
23105
|
+
const moduleUrl = `${SRC_PREFIX}${relative15(projectRoot, filePath).replace(/\\/g, "/")}`;
|
|
23085
23106
|
code = code.replace(/if\s*\(import\.meta\.hot\)\s*\{/, `if (typeof window !== "undefined") {
|
|
23086
23107
|
` + ` if (!window.__SVELTE_HMR_ACCEPT__) window.__SVELTE_HMR_ACCEPT__ = {};
|
|
23087
23108
|
` + ` var __hmr_accept = function(cb) { window.__SVELTE_HMR_ACCEPT__[${JSON.stringify(moduleUrl)}] = cb; };`);
|
|
@@ -23172,8 +23193,8 @@ ${code}`;
|
|
|
23172
23193
|
code = injectVueHmr(code, filePath, projectRoot, vueDir);
|
|
23173
23194
|
return rewriteImports(code, filePath, projectRoot, rewriter);
|
|
23174
23195
|
}, injectVueHmr = (code, filePath, projectRoot, vueDir) => {
|
|
23175
|
-
const hmrBase = vueDir ?
|
|
23176
|
-
const hmrId =
|
|
23196
|
+
const hmrBase = vueDir ? resolve38(vueDir) : projectRoot;
|
|
23197
|
+
const hmrId = relative15(hmrBase, filePath).replace(/\\/g, "/").replace(/\.vue$/, "");
|
|
23177
23198
|
let result = code.replace(/export\s+default\s+/, "var __hmr_comp__ = ");
|
|
23178
23199
|
result += [
|
|
23179
23200
|
"",
|
|
@@ -23336,7 +23357,7 @@ export default {};
|
|
|
23336
23357
|
const escaped = virtualCss.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$/g, "\\$");
|
|
23337
23358
|
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
23359
|
}, resolveSourcePath = (relPath, projectRoot) => {
|
|
23339
|
-
const filePath =
|
|
23360
|
+
const filePath = resolve38(projectRoot, relPath);
|
|
23340
23361
|
const ext = extname10(filePath);
|
|
23341
23362
|
if (ext === ".svelte")
|
|
23342
23363
|
return { ext, filePath: resolveSvelteModulePath(filePath) };
|
|
@@ -23373,14 +23394,14 @@ export default {};
|
|
|
23373
23394
|
const absoluteCandidate = "/" + tail.replace(/^\/+/, "");
|
|
23374
23395
|
const candidates = [
|
|
23375
23396
|
absoluteCandidate,
|
|
23376
|
-
|
|
23397
|
+
resolve38(projectRoot, tail)
|
|
23377
23398
|
];
|
|
23378
23399
|
try {
|
|
23379
23400
|
const { loadConfig: loadConfig2 } = await Promise.resolve().then(() => (init_loadConfig(), exports_loadConfig));
|
|
23380
23401
|
const cfg = await loadConfig2();
|
|
23381
|
-
const angularDir = cfg.angularDirectory &&
|
|
23402
|
+
const angularDir = cfg.angularDirectory && resolve38(projectRoot, cfg.angularDirectory);
|
|
23382
23403
|
if (angularDir)
|
|
23383
|
-
candidates.push(
|
|
23404
|
+
candidates.push(resolve38(angularDir, tail));
|
|
23384
23405
|
} catch {}
|
|
23385
23406
|
for (const candidate of candidates) {
|
|
23386
23407
|
if (await fileExists(candidate)) {
|
|
@@ -23411,7 +23432,7 @@ export default {};
|
|
|
23411
23432
|
if (!TRANSPILABLE.has(ext))
|
|
23412
23433
|
return;
|
|
23413
23434
|
const stat3 = statSync6(filePath);
|
|
23414
|
-
const resolvedVueDir = vueDir ?
|
|
23435
|
+
const resolvedVueDir = vueDir ? resolve38(vueDir) : undefined;
|
|
23415
23436
|
let content = REACT_EXTENSIONS.has(ext) ? transformReactFile(filePath, projectRoot, rewriter) : transformPlainFile(filePath, projectRoot, rewriter, resolvedVueDir);
|
|
23416
23437
|
const isAngularGeneratedJs = ext === ".js" && filePath.replace(/\\/g, "/").includes("/.absolutejs/generated/angular/");
|
|
23417
23438
|
if (isAngularGeneratedJs) {
|
|
@@ -23470,7 +23491,7 @@ export default {};
|
|
|
23470
23491
|
const relPath = pathname.slice(SRC_PREFIX.length);
|
|
23471
23492
|
if (relPath === "bun:wrap" || relPath.startsWith("bun:wrap?"))
|
|
23472
23493
|
return handleBunWrapRequest();
|
|
23473
|
-
const virtualCssResponse = handleVirtualSvelteCss(
|
|
23494
|
+
const virtualCssResponse = handleVirtualSvelteCss(resolve38(projectRoot, relPath));
|
|
23474
23495
|
if (virtualCssResponse)
|
|
23475
23496
|
return virtualCssResponse;
|
|
23476
23497
|
const { filePath, ext } = resolveSourcePath(relPath, projectRoot);
|
|
@@ -23486,11 +23507,11 @@ export default {};
|
|
|
23486
23507
|
SRC_IMPORT_RE.lastIndex = 0;
|
|
23487
23508
|
while ((match = SRC_IMPORT_RE.exec(content)) !== null) {
|
|
23488
23509
|
if (match[1])
|
|
23489
|
-
files.push(
|
|
23510
|
+
files.push(resolve38(projectRoot, match[1]));
|
|
23490
23511
|
}
|
|
23491
23512
|
return files;
|
|
23492
23513
|
}, invalidateModule = (filePath) => {
|
|
23493
|
-
const resolved =
|
|
23514
|
+
const resolved = resolve38(filePath);
|
|
23494
23515
|
invalidate(filePath);
|
|
23495
23516
|
if (resolved !== filePath)
|
|
23496
23517
|
invalidate(resolved);
|
|
@@ -23635,7 +23656,7 @@ __export(exports_hmrCompiler, {
|
|
|
23635
23656
|
getApplyMetadataModule: () => getApplyMetadataModule,
|
|
23636
23657
|
encodeHmrComponentId: () => encodeHmrComponentId
|
|
23637
23658
|
});
|
|
23638
|
-
import { dirname as dirname25, relative as
|
|
23659
|
+
import { dirname as dirname25, relative as relative16, resolve as resolve39 } from "path";
|
|
23639
23660
|
import { performance as performance2 } from "perf_hooks";
|
|
23640
23661
|
var getApplyMetadataModule = async (encodedId) => {
|
|
23641
23662
|
const decoded = decodeURIComponent(encodedId);
|
|
@@ -23644,8 +23665,8 @@ var getApplyMetadataModule = async (encodedId) => {
|
|
|
23644
23665
|
return null;
|
|
23645
23666
|
const filePathRel = decoded.slice(0, at2);
|
|
23646
23667
|
const className = decoded.slice(at2 + 1);
|
|
23647
|
-
const componentFilePath =
|
|
23648
|
-
const projectRelPath =
|
|
23668
|
+
const componentFilePath = resolve39(process.cwd(), filePathRel);
|
|
23669
|
+
const projectRelPath = relative16(process.cwd(), componentFilePath).replace(/\\/g, "/");
|
|
23649
23670
|
const cacheKey2 = encodeURIComponent(`${projectRelPath}@${className}`);
|
|
23650
23671
|
const { takePendingModule: takePendingModule2 } = await Promise.resolve().then(() => (init_fastHmrCompiler(), exports_fastHmrCompiler));
|
|
23651
23672
|
const cached = takePendingModule2(cacheKey2);
|
|
@@ -23667,7 +23688,7 @@ var getApplyMetadataModule = async (encodedId) => {
|
|
|
23667
23688
|
}
|
|
23668
23689
|
return null;
|
|
23669
23690
|
}, encodeHmrComponentId = (absoluteFilePath, className) => {
|
|
23670
|
-
const projectRel =
|
|
23691
|
+
const projectRel = relative16(process.cwd(), absoluteFilePath).replace(/\\/g, "/");
|
|
23671
23692
|
return `${projectRel}@${className}`;
|
|
23672
23693
|
};
|
|
23673
23694
|
var init_hmrCompiler = __esm(() => {
|
|
@@ -23806,11 +23827,11 @@ var exports_simpleHTMLHMR = {};
|
|
|
23806
23827
|
__export(exports_simpleHTMLHMR, {
|
|
23807
23828
|
handleHTMLUpdate: () => handleHTMLUpdate
|
|
23808
23829
|
});
|
|
23809
|
-
import { resolve as
|
|
23830
|
+
import { resolve as resolve40 } from "path";
|
|
23810
23831
|
var handleHTMLUpdate = async (htmlFilePath) => {
|
|
23811
23832
|
let htmlContent;
|
|
23812
23833
|
try {
|
|
23813
|
-
const resolvedPath =
|
|
23834
|
+
const resolvedPath = resolve40(htmlFilePath);
|
|
23814
23835
|
const file4 = Bun.file(resolvedPath);
|
|
23815
23836
|
if (!await file4.exists()) {
|
|
23816
23837
|
return null;
|
|
@@ -23836,11 +23857,11 @@ var exports_simpleHTMXHMR = {};
|
|
|
23836
23857
|
__export(exports_simpleHTMXHMR, {
|
|
23837
23858
|
handleHTMXUpdate: () => handleHTMXUpdate
|
|
23838
23859
|
});
|
|
23839
|
-
import { resolve as
|
|
23860
|
+
import { resolve as resolve41 } from "path";
|
|
23840
23861
|
var handleHTMXUpdate = async (htmxFilePath) => {
|
|
23841
23862
|
let htmlContent;
|
|
23842
23863
|
try {
|
|
23843
|
-
const resolvedPath =
|
|
23864
|
+
const resolvedPath = resolve41(htmxFilePath);
|
|
23844
23865
|
const file4 = Bun.file(resolvedPath);
|
|
23845
23866
|
if (!await file4.exists()) {
|
|
23846
23867
|
return null;
|
|
@@ -23863,7 +23884,7 @@ var init_simpleHTMXHMR = () => {};
|
|
|
23863
23884
|
|
|
23864
23885
|
// src/dev/rebuildTrigger.ts
|
|
23865
23886
|
import { existsSync as existsSync32, rmSync as rmSync3 } from "fs";
|
|
23866
|
-
import { basename as basename13, dirname as dirname26, join as join41, relative as
|
|
23887
|
+
import { basename as basename13, dirname as dirname26, join as join41, relative as relative17, resolve as resolve42, sep as sep4 } from "path";
|
|
23867
23888
|
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
23889
|
if (!config.tailwind)
|
|
23869
23890
|
return;
|
|
@@ -23875,7 +23896,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
23875
23896
|
if (!cssChanged)
|
|
23876
23897
|
return;
|
|
23877
23898
|
try {
|
|
23878
|
-
const outputPath =
|
|
23899
|
+
const outputPath = resolve42(state.resolvedPaths.buildDir, config.tailwind.output);
|
|
23879
23900
|
const bytes = await Bun.file(outputPath).bytes();
|
|
23880
23901
|
const webPath = `/${config.tailwind.output.replace(/^\/+/, "")}`;
|
|
23881
23902
|
state.assetStore.set(webPath, bytes);
|
|
@@ -23965,12 +23986,12 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
23965
23986
|
}, isValidDeletedAffectedFile = (affectedFile, deletedPathResolved, processedFiles) => affectedFile !== deletedPathResolved && !processedFiles.has(affectedFile) && existsSync32(affectedFile), FRAMEWORK_DIR_KEYS_FOR_CLEANUP, removeStaleGenerated = (state, deletedFile) => {
|
|
23966
23987
|
const config = state.config;
|
|
23967
23988
|
const cwd2 = process.cwd();
|
|
23968
|
-
const absDeleted =
|
|
23989
|
+
const absDeleted = resolve42(deletedFile).replace(/\\/g, "/");
|
|
23969
23990
|
for (const { configKey, framework } of FRAMEWORK_DIR_KEYS_FOR_CLEANUP) {
|
|
23970
23991
|
const dir = config[configKey];
|
|
23971
23992
|
if (!dir)
|
|
23972
23993
|
continue;
|
|
23973
|
-
const absDir =
|
|
23994
|
+
const absDir = resolve42(cwd2, dir).replace(/\\/g, "/");
|
|
23974
23995
|
if (!absDeleted.startsWith(`${absDir}/`))
|
|
23975
23996
|
continue;
|
|
23976
23997
|
const rel = absDeleted.slice(absDir.length + 1);
|
|
@@ -23994,7 +24015,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
23994
24015
|
removeStaleGenerated(state, filePathInSet);
|
|
23995
24016
|
try {
|
|
23996
24017
|
const affectedFiles = getAffectedFiles(state.dependencyGraph, filePathInSet);
|
|
23997
|
-
const deletedPathResolved =
|
|
24018
|
+
const deletedPathResolved = resolve42(filePathInSet);
|
|
23998
24019
|
affectedFiles.forEach((affectedFile) => {
|
|
23999
24020
|
if (isValidDeletedAffectedFile(affectedFile, deletedPathResolved, processedFiles)) {
|
|
24000
24021
|
validFiles.push(affectedFile);
|
|
@@ -24038,7 +24059,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24038
24059
|
if (storedHash !== undefined && storedHash === fileHash) {
|
|
24039
24060
|
return;
|
|
24040
24061
|
}
|
|
24041
|
-
const normalizedFilePath =
|
|
24062
|
+
const normalizedFilePath = resolve42(filePathInSet);
|
|
24042
24063
|
if (!processedFiles.has(normalizedFilePath)) {
|
|
24043
24064
|
validFiles.push(normalizedFilePath);
|
|
24044
24065
|
processedFiles.add(normalizedFilePath);
|
|
@@ -24176,7 +24197,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24176
24197
|
const publicDir = state.resolvedPaths.publicDir;
|
|
24177
24198
|
const assetsDir = state.resolvedPaths.assetsDir;
|
|
24178
24199
|
const handleStaticMirror = async (sourceDir, urlPrefix) => {
|
|
24179
|
-
const absSource =
|
|
24200
|
+
const absSource = resolve42(filePath);
|
|
24180
24201
|
const normalizedSource = absSource.replace(/\\/g, "/");
|
|
24181
24202
|
const normalizedDir = sourceDir.replace(/\\/g, "/");
|
|
24182
24203
|
if (!normalizedSource.startsWith(normalizedDir + "/"))
|
|
@@ -24184,7 +24205,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24184
24205
|
try {
|
|
24185
24206
|
const relFromDir = normalizedSource.slice(normalizedDir.length + 1);
|
|
24186
24207
|
const buildDir = state.resolvedPaths.buildDir;
|
|
24187
|
-
const destPath =
|
|
24208
|
+
const destPath = resolve42(buildDir, urlPrefix ? `${urlPrefix}/${relFromDir}` : relFromDir);
|
|
24188
24209
|
const { mkdir: mkdir7, copyFile, readFile: readFile6 } = await import("fs/promises");
|
|
24189
24210
|
const { dirname: dirname27 } = await import("path");
|
|
24190
24211
|
await mkdir7(dirname27(destPath), { recursive: true });
|
|
@@ -24193,7 +24214,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24193
24214
|
const webPath = urlPrefix ? `/${urlPrefix}/${relFromDir}` : `/${relFromDir}`;
|
|
24194
24215
|
state.assetStore.set(webPath, new Uint8Array(bytes));
|
|
24195
24216
|
state.fileHashes.set(absSource, currentHash);
|
|
24196
|
-
logHmrUpdate(
|
|
24217
|
+
logHmrUpdate(relative17(process.cwd(), filePath));
|
|
24197
24218
|
broadcastToClients(state, {
|
|
24198
24219
|
data: {
|
|
24199
24220
|
framework: urlPrefix || "public",
|
|
@@ -24210,18 +24231,18 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24210
24231
|
if (assetsDir && await handleStaticMirror(assetsDir, "assets"))
|
|
24211
24232
|
return;
|
|
24212
24233
|
if (framework === "unknown") {
|
|
24213
|
-
invalidate(
|
|
24214
|
-
const relPath =
|
|
24234
|
+
invalidate(resolve42(filePath));
|
|
24235
|
+
const relPath = relative17(process.cwd(), filePath);
|
|
24215
24236
|
logHmrUpdate(relPath);
|
|
24216
24237
|
const angularDir = state.resolvedPaths.angularDir;
|
|
24217
24238
|
let hasAngularDependent = false;
|
|
24218
24239
|
if (angularDir && state.dependencyGraph) {
|
|
24219
24240
|
try {
|
|
24220
24241
|
const { addFileToGraph: addFileToGraph2 } = await Promise.resolve().then(() => (init_dependencyGraph(), exports_dependencyGraph));
|
|
24221
|
-
addFileToGraph2(state.dependencyGraph,
|
|
24222
|
-
const affected = getAffectedFiles(state.dependencyGraph,
|
|
24242
|
+
addFileToGraph2(state.dependencyGraph, resolve42(filePath));
|
|
24243
|
+
const affected = getAffectedFiles(state.dependencyGraph, resolve42(filePath));
|
|
24223
24244
|
for (const dependent of affected) {
|
|
24224
|
-
if (dependent ===
|
|
24245
|
+
if (dependent === resolve42(filePath))
|
|
24225
24246
|
continue;
|
|
24226
24247
|
const dependentFramework = detectFramework(dependent, state.resolvedPaths);
|
|
24227
24248
|
if (dependentFramework !== "angular")
|
|
@@ -24238,14 +24259,14 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24238
24259
|
} catch {}
|
|
24239
24260
|
}
|
|
24240
24261
|
if (!hasAngularDependent) {
|
|
24241
|
-
console.log(`[abs:restart] ${
|
|
24262
|
+
console.log(`[abs:restart] ${resolve42(filePath)}`);
|
|
24242
24263
|
return;
|
|
24243
24264
|
}
|
|
24244
24265
|
try {
|
|
24245
24266
|
const { getFrameworkGeneratedDir: getFrameworkGeneratedDir2 } = await Promise.resolve().then(() => (init_generatedDir(), exports_generatedDir));
|
|
24246
24267
|
const { invalidateModule: invalidateModuleServer } = await Promise.resolve().then(() => (init_moduleServer(), exports_moduleServer));
|
|
24247
24268
|
const generatedAngularRoot = getFrameworkGeneratedDir2("angular");
|
|
24248
|
-
const sourceAbs =
|
|
24269
|
+
const sourceAbs = resolve42(filePath).replace(/\\/g, "/");
|
|
24249
24270
|
const generatedTwin = `${generatedAngularRoot.replace(/\\/g, "/")}${sourceAbs.replace(/\.ts$/, ".js")}`;
|
|
24250
24271
|
invalidateModuleServer(generatedTwin);
|
|
24251
24272
|
} catch {}
|
|
@@ -24279,7 +24300,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24279
24300
|
const userEditedFiles = new Set;
|
|
24280
24301
|
state.fileChangeQueue.forEach((filePaths) => {
|
|
24281
24302
|
for (const filePath2 of filePaths) {
|
|
24282
|
-
userEditedFiles.add(
|
|
24303
|
+
userEditedFiles.add(resolve42(filePath2));
|
|
24283
24304
|
}
|
|
24284
24305
|
});
|
|
24285
24306
|
state.lastUserEditedFiles = userEditedFiles;
|
|
@@ -24308,7 +24329,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24308
24329
|
}
|
|
24309
24330
|
if (!graph)
|
|
24310
24331
|
return componentFile;
|
|
24311
|
-
const dependents = graph.dependents.get(
|
|
24332
|
+
const dependents = graph.dependents.get(resolve42(componentFile));
|
|
24312
24333
|
if (!dependents)
|
|
24313
24334
|
return componentFile;
|
|
24314
24335
|
for (const dep of dependents) {
|
|
@@ -24317,7 +24338,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24317
24338
|
}
|
|
24318
24339
|
return componentFile;
|
|
24319
24340
|
}, resolveAngularPageEntries = (state, angularFiles, angularPagesPath) => {
|
|
24320
|
-
const pageEntries = angularFiles.filter((file4) => file4.endsWith(".ts") &&
|
|
24341
|
+
const pageEntries = angularFiles.filter((file4) => file4.endsWith(".ts") && resolve42(file4).startsWith(angularPagesPath));
|
|
24321
24342
|
if (pageEntries.length > 0 || !state.dependencyGraph) {
|
|
24322
24343
|
return pageEntries;
|
|
24323
24344
|
}
|
|
@@ -24326,7 +24347,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24326
24347
|
const lookupFile = resolveComponentLookupFile(componentFile, state.dependencyGraph);
|
|
24327
24348
|
const affected = getAffectedFiles(state.dependencyGraph, lookupFile);
|
|
24328
24349
|
affected.forEach((file4) => {
|
|
24329
|
-
if (file4.endsWith(".ts") &&
|
|
24350
|
+
if (file4.endsWith(".ts") && resolve42(file4).startsWith(angularPagesPath)) {
|
|
24330
24351
|
resolvedPages.add(file4);
|
|
24331
24352
|
}
|
|
24332
24353
|
});
|
|
@@ -24367,8 +24388,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24367
24388
|
if (serverDirs.length <= 1) {
|
|
24368
24389
|
const dir = getFrameworkGeneratedDir2(framework, projectRoot);
|
|
24369
24390
|
return {
|
|
24370
|
-
serverOutDir:
|
|
24371
|
-
serverRoot:
|
|
24391
|
+
serverOutDir: resolve42(resolvedPaths.buildDir, basename13(dir)),
|
|
24392
|
+
serverRoot: resolve42(dir, "server")
|
|
24372
24393
|
};
|
|
24373
24394
|
}
|
|
24374
24395
|
return {
|
|
@@ -24529,8 +24550,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24529
24550
|
if (detected !== "unknown")
|
|
24530
24551
|
continue;
|
|
24531
24552
|
try {
|
|
24532
|
-
const affected = getAffectedFiles(state.dependencyGraph,
|
|
24533
|
-
const hasAngularConsumer = affected.some((dep) => dep !==
|
|
24553
|
+
const affected = getAffectedFiles(state.dependencyGraph, resolve42(editedFile));
|
|
24554
|
+
const hasAngularConsumer = affected.some((dep) => dep !== resolve42(editedFile) && detectFramework(dep, state.resolvedPaths) === "angular");
|
|
24534
24555
|
if (hasAngularConsumer) {
|
|
24535
24556
|
return {
|
|
24536
24557
|
kind: "rebootstrap",
|
|
@@ -24577,7 +24598,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24577
24598
|
}
|
|
24578
24599
|
if (owners.length === 0 && (editedFile.endsWith(".ts") || editedFile.endsWith(".json")) && !editedFile.endsWith(".d.ts")) {
|
|
24579
24600
|
const normalized = editedFile.replace(/\\/g, "/");
|
|
24580
|
-
const angularDirAbs =
|
|
24601
|
+
const angularDirAbs = resolve42(angularDir).replace(/\\/g, "/");
|
|
24581
24602
|
if (normalized.startsWith(angularDirAbs + "/")) {
|
|
24582
24603
|
return {
|
|
24583
24604
|
kind: "rebootstrap",
|
|
@@ -24720,16 +24741,16 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24720
24741
|
};
|
|
24721
24742
|
const fire = () => {
|
|
24722
24743
|
ctx.debounceTimer = null;
|
|
24723
|
-
const
|
|
24744
|
+
const resolve43 = ctx.debouncedResolve;
|
|
24724
24745
|
ctx.debouncedResolve = null;
|
|
24725
24746
|
ctx.debouncedPromise = null;
|
|
24726
24747
|
if (ctx.inFlight) {
|
|
24727
24748
|
ctx.pending = true;
|
|
24728
|
-
ctx.inFlight.finally(() =>
|
|
24749
|
+
ctx.inFlight.finally(() => resolve43?.());
|
|
24729
24750
|
return;
|
|
24730
24751
|
}
|
|
24731
24752
|
ctx.inFlight = drive();
|
|
24732
|
-
ctx.inFlight.finally(() =>
|
|
24753
|
+
ctx.inFlight.finally(() => resolve43?.());
|
|
24733
24754
|
};
|
|
24734
24755
|
return ({ immediate = false } = {}) => {
|
|
24735
24756
|
if (!ctx.debouncedPromise) {
|
|
@@ -24756,9 +24777,9 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24756
24777
|
const diskRefreshPromise = (async () => {
|
|
24757
24778
|
if (!angularDir || editedFiles.size === 0)
|
|
24758
24779
|
return;
|
|
24759
|
-
const angularDirAbs =
|
|
24780
|
+
const angularDirAbs = resolve42(angularDir);
|
|
24760
24781
|
const filesUnderAngular = Array.from(editedFiles).filter((file4) => {
|
|
24761
|
-
const abs =
|
|
24782
|
+
const abs = resolve42(file4);
|
|
24762
24783
|
return abs === angularDirAbs || abs.startsWith(angularDirAbs + sep4);
|
|
24763
24784
|
});
|
|
24764
24785
|
if (filesUnderAngular.length === 0)
|
|
@@ -24780,7 +24801,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24780
24801
|
if (!ext)
|
|
24781
24802
|
continue;
|
|
24782
24803
|
if (ext === ".ts" || ext === ".tsx") {
|
|
24783
|
-
tsFilesToRefresh.add(
|
|
24804
|
+
tsFilesToRefresh.add(resolve42(file4));
|
|
24784
24805
|
continue;
|
|
24785
24806
|
}
|
|
24786
24807
|
const owners = resolveOwningComponents2({
|
|
@@ -24788,7 +24809,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24788
24809
|
userAngularRoot: angularDirAbs
|
|
24789
24810
|
});
|
|
24790
24811
|
for (const owner of owners) {
|
|
24791
|
-
tsFilesToRefresh.add(
|
|
24812
|
+
tsFilesToRefresh.add(resolve42(owner.componentFilePath));
|
|
24792
24813
|
}
|
|
24793
24814
|
}
|
|
24794
24815
|
if (tsFilesToRefresh.size === 0)
|
|
@@ -24802,8 +24823,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24802
24823
|
try {
|
|
24803
24824
|
const { invalidateModule: invalidateModule2 } = await Promise.resolve().then(() => (init_moduleServer(), exports_moduleServer));
|
|
24804
24825
|
for (const tsFile of tsFilesToRefresh) {
|
|
24805
|
-
const rel =
|
|
24806
|
-
const compiledFile =
|
|
24826
|
+
const rel = relative17(angularDirAbs, tsFile).replace(/\\/g, "/").replace(/\.[tj]sx?$/, ".js");
|
|
24827
|
+
const compiledFile = resolve42(compiledRoot, rel);
|
|
24807
24828
|
invalidateModule2(compiledFile);
|
|
24808
24829
|
}
|
|
24809
24830
|
} catch {}
|
|
@@ -24854,7 +24875,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24854
24875
|
serverPaths.forEach((serverPath, idx) => {
|
|
24855
24876
|
const fileBase = basename13(serverPath, ".js");
|
|
24856
24877
|
const ssrPath = ssrPaths[idx] ?? serverPath;
|
|
24857
|
-
state.manifest[toPascal(fileBase)] =
|
|
24878
|
+
state.manifest[toPascal(fileBase)] = resolve42(ssrPath);
|
|
24858
24879
|
});
|
|
24859
24880
|
if (clientPaths.length > 0) {
|
|
24860
24881
|
await bundleAngularClient(state, clientPaths, state.resolvedPaths.buildDir, angularDir);
|
|
@@ -24867,9 +24888,9 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24867
24888
|
const angularDir = config.angularDirectory ?? "";
|
|
24868
24889
|
const angularFiles = filesToRebuild.filter((file4) => detectFramework(file4, state.resolvedPaths) === "angular");
|
|
24869
24890
|
for (const file4 of angularFiles) {
|
|
24870
|
-
state.fileHashes.set(
|
|
24891
|
+
state.fileHashes.set(resolve42(file4), computeFileHash(file4));
|
|
24871
24892
|
}
|
|
24872
|
-
const angularPagesPath =
|
|
24893
|
+
const angularPagesPath = resolve42(angularDir, "pages");
|
|
24873
24894
|
const pageEntries = resolveAngularPageEntries(state, angularFiles, angularPagesPath);
|
|
24874
24895
|
const tierStart = performance.now();
|
|
24875
24896
|
const verdict = await decideAngularTier(state, angularDir);
|
|
@@ -24901,7 +24922,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24901
24922
|
}, getModuleUrl = async (pageFile) => {
|
|
24902
24923
|
const { invalidateModule: invalidateModule2, warmCache: warmCache2, SRC_URL_PREFIX: SRC_URL_PREFIX2 } = await Promise.resolve().then(() => (init_moduleServer(), exports_moduleServer));
|
|
24903
24924
|
invalidateModule2(pageFile);
|
|
24904
|
-
const rel =
|
|
24925
|
+
const rel = relative17(process.cwd(), pageFile).replace(/\\/g, "/");
|
|
24905
24926
|
const url = `${SRC_URL_PREFIX2}${rel}`;
|
|
24906
24927
|
warmCache2(url);
|
|
24907
24928
|
return url;
|
|
@@ -24910,11 +24931,11 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24910
24931
|
if (isComponentFile2)
|
|
24911
24932
|
return primaryFile;
|
|
24912
24933
|
const { findNearestComponent: findNearestComponent2 } = await Promise.resolve().then(() => (init_transformCache(), exports_transformCache));
|
|
24913
|
-
const nearest = findNearestComponent2(
|
|
24934
|
+
const nearest = findNearestComponent2(resolve42(primaryFile));
|
|
24914
24935
|
return nearest ?? primaryFile;
|
|
24915
24936
|
}, handleReactModuleServerPath = async (state, reactFiles, startTime, onRebuildComplete) => {
|
|
24916
24937
|
for (const file4 of reactFiles) {
|
|
24917
|
-
state.fileHashes.set(
|
|
24938
|
+
state.fileHashes.set(resolve42(file4), computeFileHash(file4));
|
|
24918
24939
|
}
|
|
24919
24940
|
const primaryFile = reactFiles.find((file4) => !file4.replace(/\\/g, "/").includes("/pages/")) ?? reactFiles[0];
|
|
24920
24941
|
if (!primaryFile) {
|
|
@@ -24932,7 +24953,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24932
24953
|
const pageModuleUrl = await getReactModuleUrl(broadcastTarget);
|
|
24933
24954
|
if (pageModuleUrl) {
|
|
24934
24955
|
const serverDuration = Date.now() - startTime;
|
|
24935
|
-
state.lastHmrPath =
|
|
24956
|
+
state.lastHmrPath = relative17(process.cwd(), primaryFile).replace(/\\/g, "/");
|
|
24936
24957
|
state.lastHmrFramework = "react";
|
|
24937
24958
|
broadcastToClients(state, {
|
|
24938
24959
|
data: {
|
|
@@ -24995,7 +25016,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24995
25016
|
});
|
|
24996
25017
|
}, handleSvelteModuleServerPath = async (state, svelteFiles, config, startTime, onRebuildComplete) => {
|
|
24997
25018
|
for (const file4 of svelteFiles) {
|
|
24998
|
-
state.fileHashes.set(
|
|
25019
|
+
state.fileHashes.set(resolve42(file4), computeFileHash(file4));
|
|
24999
25020
|
}
|
|
25000
25021
|
const serverDuration = Date.now() - startTime;
|
|
25001
25022
|
await runSequentially(svelteFiles, (changedFile) => broadcastSvelteModuleUpdate(state, changedFile, svelteFiles, serverDuration));
|
|
@@ -25242,7 +25263,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
25242
25263
|
});
|
|
25243
25264
|
}, handleVueModuleServerPath = async (state, vueFiles, nonVueFiles, config, startTime, onRebuildComplete) => {
|
|
25244
25265
|
for (const file4 of [...vueFiles, ...nonVueFiles]) {
|
|
25245
|
-
state.fileHashes.set(
|
|
25266
|
+
state.fileHashes.set(resolve42(file4), computeFileHash(file4));
|
|
25246
25267
|
}
|
|
25247
25268
|
await invalidateNonVueModules(nonVueFiles);
|
|
25248
25269
|
const serverDuration = Date.now() - startTime;
|
|
@@ -25391,7 +25412,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
25391
25412
|
recursive: true,
|
|
25392
25413
|
withFileTypes: true
|
|
25393
25414
|
});
|
|
25394
|
-
return entries.filter((entry) => entry.isFile() && EMBER_PAGE_EXTENSIONS.some((ext) => entry.name.endsWith(ext))).map((entry) =>
|
|
25415
|
+
return entries.filter((entry) => entry.isFile() && EMBER_PAGE_EXTENSIONS.some((ext) => entry.name.endsWith(ext))).map((entry) => resolve42(emberPagesPath, entry.name));
|
|
25395
25416
|
} catch {
|
|
25396
25417
|
return [];
|
|
25397
25418
|
}
|
|
@@ -25403,10 +25424,10 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
25403
25424
|
return state.manifest;
|
|
25404
25425
|
}
|
|
25405
25426
|
for (const file4 of emberFiles) {
|
|
25406
|
-
state.fileHashes.set(
|
|
25427
|
+
state.fileHashes.set(resolve42(file4), computeFileHash(file4));
|
|
25407
25428
|
}
|
|
25408
|
-
const emberPagesPath =
|
|
25409
|
-
const directPageEntries = emberFiles.filter((file4) =>
|
|
25429
|
+
const emberPagesPath = resolve42(emberDir, "pages");
|
|
25430
|
+
const directPageEntries = emberFiles.filter((file4) => resolve42(file4).startsWith(emberPagesPath));
|
|
25410
25431
|
const allPageEntries = directPageEntries.length > 0 ? directPageEntries : await collectAllEmberPages(emberPagesPath);
|
|
25411
25432
|
if (allPageEntries.length === 0) {
|
|
25412
25433
|
onRebuildComplete({ hmrState: state, manifest: state.manifest });
|
|
@@ -25416,14 +25437,14 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
25416
25437
|
const { serverPaths } = await compileEmber2(allPageEntries, emberDir, process.cwd(), true);
|
|
25417
25438
|
for (const serverPath of serverPaths) {
|
|
25418
25439
|
const fileBase = basename13(serverPath, ".js");
|
|
25419
|
-
state.manifest[toPascal(fileBase)] =
|
|
25440
|
+
state.manifest[toPascal(fileBase)] = resolve42(serverPath);
|
|
25420
25441
|
}
|
|
25421
25442
|
const { invalidateEmberSsrCache: invalidateEmberSsrCache2 } = await Promise.resolve().then(() => (init_ember(), exports_ember));
|
|
25422
25443
|
invalidateEmberSsrCache2();
|
|
25423
25444
|
const duration = Date.now() - startTime;
|
|
25424
25445
|
const [primary] = emberFiles;
|
|
25425
25446
|
if (primary) {
|
|
25426
|
-
state.lastHmrPath =
|
|
25447
|
+
state.lastHmrPath = relative17(process.cwd(), primary).replace(/\\/g, "/");
|
|
25427
25448
|
state.lastHmrFramework = "ember";
|
|
25428
25449
|
logHmrUpdate(primary, "ember", duration);
|
|
25429
25450
|
}
|
|
@@ -25508,8 +25529,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
25508
25529
|
if (!buildReference?.source) {
|
|
25509
25530
|
return;
|
|
25510
25531
|
}
|
|
25511
|
-
const sourcePath = buildReference.source.startsWith("file://") ? new URL(buildReference.source).pathname :
|
|
25512
|
-
islandFiles.add(
|
|
25532
|
+
const sourcePath = buildReference.source.startsWith("file://") ? new URL(buildReference.source).pathname : resolve42(dirname26(buildInfo.resolvedRegistryPath), buildReference.source);
|
|
25533
|
+
islandFiles.add(resolve42(sourcePath));
|
|
25513
25534
|
}, resolveIslandSourceFiles = async (config) => {
|
|
25514
25535
|
const registryPath = config.islands?.registry;
|
|
25515
25536
|
if (!registryPath) {
|
|
@@ -25517,7 +25538,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
25517
25538
|
}
|
|
25518
25539
|
const buildInfo = await loadIslandRegistryBuildInfo(registryPath);
|
|
25519
25540
|
const islandFiles = new Set([
|
|
25520
|
-
|
|
25541
|
+
resolve42(buildInfo.resolvedRegistryPath)
|
|
25521
25542
|
]);
|
|
25522
25543
|
for (const definition of buildInfo.definitions) {
|
|
25523
25544
|
resolveIslandDefinitionSource(definition, buildInfo, islandFiles);
|
|
@@ -25528,7 +25549,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
25528
25549
|
if (islandFiles.size === 0) {
|
|
25529
25550
|
return false;
|
|
25530
25551
|
}
|
|
25531
|
-
return filesToRebuild.some((file4) => islandFiles.has(
|
|
25552
|
+
return filesToRebuild.some((file4) => islandFiles.has(resolve42(file4)));
|
|
25532
25553
|
}, handleIslandSourceReload = async (state, config, filesToRebuild, manifest) => {
|
|
25533
25554
|
const shouldReload = await didStaticPagesNeedIslandRefresh(config, filesToRebuild);
|
|
25534
25555
|
if (!shouldReload) {
|
|
@@ -25563,10 +25584,10 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
25563
25584
|
}, computeOutputPagesDir = (state, config, framework) => {
|
|
25564
25585
|
const isSingle = !config.reactDirectory && !config.svelteDirectory && !config.vueDirectory && (framework === "html" ? !config.htmxDirectory : !config.htmlDirectory);
|
|
25565
25586
|
if (isSingle) {
|
|
25566
|
-
return
|
|
25587
|
+
return resolve42(state.resolvedPaths.buildDir, "pages");
|
|
25567
25588
|
}
|
|
25568
25589
|
const dirName = framework === "html" ? basename13(config.htmlDirectory ?? "html") : basename13(config.htmxDirectory ?? "htmx");
|
|
25569
|
-
return
|
|
25590
|
+
return resolve42(state.resolvedPaths.buildDir, dirName, "pages");
|
|
25570
25591
|
}, processHtmlPageUpdate = async (state, pageFile, builtHtmlPagePath, manifest, duration) => {
|
|
25571
25592
|
try {
|
|
25572
25593
|
const { handleHTMLUpdate: handleHTMLUpdate2 } = await Promise.resolve().then(() => (init_simpleHTMLHMR(), exports_simpleHTMLHMR));
|
|
@@ -25605,7 +25626,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
25605
25626
|
const pageFilesToUpdate = shouldRefreshAllPages ? await scanEntryPoints(outputHtmlPages, "*.html") : htmlPageFiles;
|
|
25606
25627
|
await runSequentially(pageFilesToUpdate, async (pageFile) => {
|
|
25607
25628
|
const htmlPageName = basename13(pageFile);
|
|
25608
|
-
const builtHtmlPagePath =
|
|
25629
|
+
const builtHtmlPagePath = resolve42(outputHtmlPages, htmlPageName);
|
|
25609
25630
|
await processHtmlPageUpdate(state, pageFile, builtHtmlPagePath, manifest, duration);
|
|
25610
25631
|
});
|
|
25611
25632
|
}, handleVueCssOnlyUpdate = (state, vueCssFiles, manifest, duration) => {
|
|
@@ -25666,11 +25687,11 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
25666
25687
|
const baseName = fileName.replace(/\.vue$/, "");
|
|
25667
25688
|
const pascalName = toPascal(baseName);
|
|
25668
25689
|
const vueRoot = config.vueDirectory;
|
|
25669
|
-
const hmrId = vueRoot ?
|
|
25690
|
+
const hmrId = vueRoot ? relative17(vueRoot, vuePagePath).replace(/\\/g, "/").replace(/\.vue$/, "") : baseName;
|
|
25670
25691
|
const cssKey = `${pascalName}CSS`;
|
|
25671
25692
|
const cssUrl = manifest[cssKey] || null;
|
|
25672
25693
|
const { vueHmrMetadata: vueHmrMetadata2 } = await Promise.resolve().then(() => (init_compileVue(), exports_compileVue));
|
|
25673
|
-
const hmrMeta = vueHmrMetadata2.get(
|
|
25694
|
+
const hmrMeta = vueHmrMetadata2.get(resolve42(vuePagePath));
|
|
25674
25695
|
const changeType = hmrMeta?.changeType ?? "full";
|
|
25675
25696
|
if (changeType === "style-only") {
|
|
25676
25697
|
broadcastVueStyleOnly(state, vuePagePath, baseName, cssUrl, hmrId, manifest, duration);
|
|
@@ -25855,7 +25876,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
25855
25876
|
const pageFilesToUpdate = shouldRefreshAllPages ? await scanEntryPoints(outputHtmxPages, "*.html") : htmxPageFiles;
|
|
25856
25877
|
await runSequentially(pageFilesToUpdate, async (htmxPageFile) => {
|
|
25857
25878
|
const htmxPageName = basename13(htmxPageFile);
|
|
25858
|
-
const builtHtmxPagePath =
|
|
25879
|
+
const builtHtmxPagePath = resolve42(outputHtmxPages, htmxPageName);
|
|
25859
25880
|
await processHtmxPageUpdate(state, htmxPageFile, builtHtmxPagePath, manifest, duration);
|
|
25860
25881
|
});
|
|
25861
25882
|
}, collectUpdatedModulePaths = (allModuleUpdates) => {
|
|
@@ -25964,7 +25985,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
25964
25985
|
html = html.slice(0, bodyClose.index) + hmrScript + html.slice(bodyClose.index);
|
|
25965
25986
|
writeFs(destPath, html);
|
|
25966
25987
|
}, processMarkupFileFastPath = async (state, sourceFile, outputDir, framework, startTime, updateAssetPaths2, handleUpdate, readFs, writeFs) => {
|
|
25967
|
-
const destPath =
|
|
25988
|
+
const destPath = resolve42(outputDir, basename13(sourceFile));
|
|
25968
25989
|
const hmrScript = extractHmrScript(destPath, readFs);
|
|
25969
25990
|
const source = await Bun.file(sourceFile).text();
|
|
25970
25991
|
await Bun.write(destPath, source);
|
|
@@ -26106,7 +26127,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
26106
26127
|
});
|
|
26107
26128
|
if (config.tailwind && filesToRebuild && filesToRebuild.some(isTailwindCandidate)) {
|
|
26108
26129
|
try {
|
|
26109
|
-
const outputPath =
|
|
26130
|
+
const outputPath = resolve42(state.resolvedPaths.buildDir, config.tailwind.output);
|
|
26110
26131
|
const bytes = await Bun.file(outputPath).bytes();
|
|
26111
26132
|
const webPath = `/${config.tailwind.output.replace(/^\/+/, "")}`;
|
|
26112
26133
|
state.assetStore.set(webPath, bytes);
|
|
@@ -26540,7 +26561,7 @@ __export(exports_devBuild, {
|
|
|
26540
26561
|
});
|
|
26541
26562
|
import { readdir as readdir5 } from "fs/promises";
|
|
26542
26563
|
import { statSync as statSync7 } from "fs";
|
|
26543
|
-
import { resolve as
|
|
26564
|
+
import { resolve as resolve43 } from "path";
|
|
26544
26565
|
var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
26545
26566
|
const configuredDirs = [
|
|
26546
26567
|
config.reactDirectory,
|
|
@@ -26563,7 +26584,7 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
26563
26584
|
return Object.keys(config).length > 0 ? config : null;
|
|
26564
26585
|
}, reloadConfig = async () => {
|
|
26565
26586
|
try {
|
|
26566
|
-
const configPath2 =
|
|
26587
|
+
const configPath2 = resolve43(process.env.ABSOLUTE_CONFIG ?? "absolute.config.ts");
|
|
26567
26588
|
const source = await Bun.file(configPath2).text();
|
|
26568
26589
|
return parseDirectoryConfig(source);
|
|
26569
26590
|
} catch {
|
|
@@ -26670,7 +26691,7 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
26670
26691
|
state.fileChangeQueue.clear();
|
|
26671
26692
|
}
|
|
26672
26693
|
}, handleCachedReload = async () => {
|
|
26673
|
-
const serverMtime = statSync7(
|
|
26694
|
+
const serverMtime = statSync7(resolve43(Bun.main)).mtimeMs;
|
|
26674
26695
|
const lastMtime = globalThis.__hmrServerMtime;
|
|
26675
26696
|
globalThis.__hmrServerMtime = serverMtime;
|
|
26676
26697
|
const cached = globalThis.__hmrDevResult;
|
|
@@ -26707,8 +26728,8 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
26707
26728
|
return true;
|
|
26708
26729
|
}, resolveAbsoluteVersion2 = async () => {
|
|
26709
26730
|
const candidates = [
|
|
26710
|
-
|
|
26711
|
-
|
|
26731
|
+
resolve43(import.meta.dir, "..", "..", "package.json"),
|
|
26732
|
+
resolve43(import.meta.dir, "..", "package.json")
|
|
26712
26733
|
];
|
|
26713
26734
|
const [candidate, ...remaining] = candidates;
|
|
26714
26735
|
if (!candidate) {
|
|
@@ -26734,7 +26755,7 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
26734
26755
|
const entries = await readdir5(vendorDir).catch(() => emptyStringArray);
|
|
26735
26756
|
await Promise.all(entries.filter((entry) => entry.endsWith(".js")).map(async (entry) => {
|
|
26736
26757
|
const webPath = `/${framework}/vendor/${entry}`;
|
|
26737
|
-
const bytes = await Bun.file(
|
|
26758
|
+
const bytes = await Bun.file(resolve43(vendorDir, entry)).bytes();
|
|
26738
26759
|
assetStore.set(webPath, bytes);
|
|
26739
26760
|
}));
|
|
26740
26761
|
}, devBuild = async (config) => {
|
|
@@ -26813,11 +26834,11 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
26813
26834
|
cleanStaleAssets(state.assetStore, manifest, state.resolvedPaths.buildDir);
|
|
26814
26835
|
recordStep("populate asset store", stepStartedAt);
|
|
26815
26836
|
stepStartedAt = performance.now();
|
|
26816
|
-
const reactVendorDir =
|
|
26817
|
-
const angularVendorDir =
|
|
26818
|
-
const svelteVendorDir =
|
|
26819
|
-
const vueVendorDir =
|
|
26820
|
-
const depVendorDir =
|
|
26837
|
+
const reactVendorDir = resolve43(state.resolvedPaths.buildDir, "react", "vendor");
|
|
26838
|
+
const angularVendorDir = resolve43(state.resolvedPaths.buildDir, "angular", "vendor");
|
|
26839
|
+
const svelteVendorDir = resolve43(state.resolvedPaths.buildDir, "svelte", "vendor");
|
|
26840
|
+
const vueVendorDir = resolve43(state.resolvedPaths.buildDir, "vue", "vendor");
|
|
26841
|
+
const depVendorDir = resolve43(state.resolvedPaths.buildDir, "vendor");
|
|
26821
26842
|
const { buildDepVendor: buildDepVendor2 } = await Promise.resolve().then(() => (init_buildDepVendor(), exports_buildDepVendor));
|
|
26822
26843
|
const [, angularSpecs, , , , , depPaths] = await Promise.all([
|
|
26823
26844
|
config.reactDirectory ? buildReactVendor(state.resolvedPaths.buildDir) : Promise.resolve(undefined),
|
|
@@ -26928,7 +26949,7 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
26928
26949
|
manifest
|
|
26929
26950
|
};
|
|
26930
26951
|
globalThis.__hmrDevResult = result;
|
|
26931
|
-
globalThis.__hmrServerMtime = statSync7(
|
|
26952
|
+
globalThis.__hmrServerMtime = statSync7(resolve43(Bun.main)).mtimeMs;
|
|
26932
26953
|
return result;
|
|
26933
26954
|
};
|
|
26934
26955
|
var init_devBuild = __esm(() => {
|
|
@@ -26968,5 +26989,5 @@ export {
|
|
|
26968
26989
|
build
|
|
26969
26990
|
};
|
|
26970
26991
|
|
|
26971
|
-
//# debugId=
|
|
26992
|
+
//# debugId=354E3DD08063F71164756E2164756E21
|
|
26972
26993
|
//# sourceMappingURL=build.js.map
|