@absolutejs/absolute 0.19.0-beta.968 → 0.19.0-beta.969
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 +872 -746
- package/dist/build.js.map +7 -6
- package/dist/index.js +908 -782
- package/dist/index.js.map +7 -6
- package/dist/src/build/emitAngularProvidersFiles.d.ts +2 -1
- package/dist/src/build/runAngularHandlerScan.d.ts +3 -1
- package/dist/src/build/scanAngularPageRoutes.d.ts +14 -0
- package/package.json +1 -1
package/dist/build.js
CHANGED
|
@@ -11556,14 +11556,118 @@ 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
|
+
|
|
11559
11663
|
// src/build/emitAngularProvidersFiles.ts
|
|
11560
11664
|
import { mkdirSync as mkdirSync8, writeFileSync as writeFileSync7 } from "fs";
|
|
11561
|
-
import { dirname as dirname11, join as
|
|
11665
|
+
import { dirname as dirname11, join as join23, relative as relative10 } from "path";
|
|
11562
11666
|
var buildModuleSpecifier = (importSpec, outputPath) => {
|
|
11563
11667
|
if (!importSpec.resolvedAbsPath)
|
|
11564
11668
|
return importSpec.source;
|
|
11565
11669
|
const outputDir = dirname11(outputPath);
|
|
11566
|
-
const rel =
|
|
11670
|
+
const rel = relative10(outputDir, importSpec.resolvedAbsPath).replace(/\\/g, "/");
|
|
11567
11671
|
const withoutExt = rel.replace(/\.[cm]?[tj]sx?$/, "");
|
|
11568
11672
|
return withoutExt.startsWith(".") ? withoutExt : `./${withoutExt}`;
|
|
11569
11673
|
}, buildImportLine = (importSpec, outputPath) => {
|
|
@@ -11609,7 +11713,7 @@ var buildModuleSpecifier = (importSpec, outputPath) => {
|
|
|
11609
11713
|
}
|
|
11610
11714
|
return lines.join(`
|
|
11611
11715
|
`);
|
|
11612
|
-
}, renderFile = (call, outputPath, basePath) => {
|
|
11716
|
+
}, ROUTER_FEATURES_DEFAULT, renderFile = (call, outputPath, basePath, pageRoutes) => {
|
|
11613
11717
|
const sections = [];
|
|
11614
11718
|
sections.push("/* AUTOGENERATED by AbsoluteJS \u2014 see `scanAngularHandlerCalls`. */", "/* eslint-disable */");
|
|
11615
11719
|
const groups = groupImports(call.providerImports);
|
|
@@ -11621,8 +11725,17 @@ var buildModuleSpecifier = (importSpec, outputPath) => {
|
|
|
11621
11725
|
if (basePath !== null) {
|
|
11622
11726
|
sections.push(`import { APP_BASE_HREF } from "@angular/common";`, `const __basePathProvider = { provide: APP_BASE_HREF, useValue: ${JSON.stringify(basePath)} };`);
|
|
11623
11727
|
}
|
|
11728
|
+
if (pageRoutes?.hasRoutes) {
|
|
11729
|
+
const routesImport = relativeRoutesImport(dirname11(outputPath), pageRoutes.pageFile);
|
|
11730
|
+
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(", ")});`);
|
|
11731
|
+
}
|
|
11624
11732
|
const userProviders = call.providersExpr ?? "[]";
|
|
11625
|
-
const
|
|
11733
|
+
const extras = [];
|
|
11734
|
+
if (pageRoutes?.hasRoutes)
|
|
11735
|
+
extras.push("__routerProvider");
|
|
11736
|
+
if (basePath !== null)
|
|
11737
|
+
extras.push("__basePathProvider");
|
|
11738
|
+
const exportExpr = extras.length === 0 ? userProviders : `[...(${userProviders}), ${extras.join(", ")}]`;
|
|
11626
11739
|
sections.push(`export const providers = ${exportExpr};`);
|
|
11627
11740
|
return sections.join(`
|
|
11628
11741
|
|
|
@@ -11635,14 +11748,19 @@ var buildModuleSpecifier = (importSpec, outputPath) => {
|
|
|
11635
11748
|
return null;
|
|
11636
11749
|
const trimmed = mountPath.slice(0, -1);
|
|
11637
11750
|
return trimmed === "/" ? null : trimmed;
|
|
11638
|
-
}, emitAngularProvidersFiles = (projectRoot, calls) => {
|
|
11751
|
+
}, emitAngularProvidersFiles = (projectRoot, calls, pageRoutes) => {
|
|
11639
11752
|
const outputDir = getProvidersOutputDir(projectRoot);
|
|
11640
11753
|
mkdirSync8(outputDir, { recursive: true });
|
|
11754
|
+
const pageRoutesByKey = new Map;
|
|
11755
|
+
for (const entry of pageRoutes) {
|
|
11756
|
+
pageRoutesByKey.set(entry.manifestKey, entry);
|
|
11757
|
+
}
|
|
11641
11758
|
const emitted = [];
|
|
11642
11759
|
for (const call of calls) {
|
|
11643
|
-
const outputPath =
|
|
11760
|
+
const outputPath = join23(outputDir, `${call.manifestKey}.providers.ts`);
|
|
11644
11761
|
const basePath = deriveBasePath(call.mountPath);
|
|
11645
|
-
const
|
|
11762
|
+
const pageRoute = pageRoutesByKey.get(call.manifestKey);
|
|
11763
|
+
const content = renderFile(call, outputPath, basePath, pageRoute);
|
|
11646
11764
|
writeFileSync7(outputPath, content, "utf-8");
|
|
11647
11765
|
emitted.push({
|
|
11648
11766
|
basePath,
|
|
@@ -11652,14 +11770,19 @@ var buildModuleSpecifier = (importSpec, outputPath) => {
|
|
|
11652
11770
|
});
|
|
11653
11771
|
}
|
|
11654
11772
|
return emitted;
|
|
11655
|
-
}, getProvidersOutputDir = (projectRoot) =>
|
|
11773
|
+
}, getProvidersOutputDir = (projectRoot) => join23(getFrameworkGeneratedDir("angular", projectRoot), "providers");
|
|
11656
11774
|
var init_emitAngularProvidersFiles = __esm(() => {
|
|
11657
11775
|
init_generatedDir();
|
|
11776
|
+
init_scanAngularPageRoutes();
|
|
11777
|
+
ROUTER_FEATURES_DEFAULT = [
|
|
11778
|
+
"withComponentInputBinding",
|
|
11779
|
+
"withViewTransitions"
|
|
11780
|
+
];
|
|
11658
11781
|
});
|
|
11659
11782
|
|
|
11660
11783
|
// src/build/emitAngularRouteMounts.ts
|
|
11661
11784
|
import { mkdirSync as mkdirSync9, writeFileSync as writeFileSync8 } from "fs";
|
|
11662
|
-
import { join as
|
|
11785
|
+
import { join as join24 } from "path";
|
|
11663
11786
|
var deriveBasePath2 = (mountPath) => {
|
|
11664
11787
|
if (!mountPath)
|
|
11665
11788
|
return null;
|
|
@@ -11670,7 +11793,7 @@ var deriveBasePath2 = (mountPath) => {
|
|
|
11670
11793
|
}, escapeForRegex = (literal) => literal.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), mountToPatternSource = (basePath) => {
|
|
11671
11794
|
const withoutTrailing = basePath.replace(/\/$/, "");
|
|
11672
11795
|
return `^${escapeForRegex(withoutTrailing)}(\\/|$)`;
|
|
11673
|
-
}, getRouteMountsOutputPath = (projectRoot) =>
|
|
11796
|
+
}, getRouteMountsOutputPath = (projectRoot) => join24(getFrameworkGeneratedDir("angular", projectRoot), "route-mounts.ts"), emitAngularRouteMounts = (projectRoot, calls) => {
|
|
11674
11797
|
const entries = [];
|
|
11675
11798
|
const seen = new Set;
|
|
11676
11799
|
for (const call of calls) {
|
|
@@ -11706,18 +11829,18 @@ var init_emitAngularRouteMounts = __esm(() => {
|
|
|
11706
11829
|
});
|
|
11707
11830
|
|
|
11708
11831
|
// src/build/scanAngularHandlerCalls.ts
|
|
11709
|
-
import { readdirSync as
|
|
11710
|
-
import { dirname as dirname12, isAbsolute as isAbsolute3, join as
|
|
11711
|
-
import
|
|
11712
|
-
var ELYSIA_ROUTE_METHODS2,
|
|
11832
|
+
import { readdirSync as readdirSync3, readFileSync as readFileSync13 } from "fs";
|
|
11833
|
+
import { dirname as dirname12, isAbsolute as isAbsolute3, join as join25, resolve as resolve19 } from "path";
|
|
11834
|
+
import ts7 from "typescript";
|
|
11835
|
+
var ELYSIA_ROUTE_METHODS2, SKIP_DIRS3, SOURCE_EXTENSIONS3, getScriptKind2 = (filePath) => {
|
|
11713
11836
|
if (filePath.endsWith(".tsx"))
|
|
11714
|
-
return
|
|
11715
|
-
return
|
|
11716
|
-
},
|
|
11837
|
+
return ts7.ScriptKind.TSX;
|
|
11838
|
+
return ts7.ScriptKind.TS;
|
|
11839
|
+
}, hasSourceExtension3 = (filePath) => {
|
|
11717
11840
|
const idx = filePath.lastIndexOf(".");
|
|
11718
11841
|
if (idx === -1)
|
|
11719
11842
|
return false;
|
|
11720
|
-
return
|
|
11843
|
+
return SOURCE_EXTENSIONS3.has(filePath.slice(idx));
|
|
11721
11844
|
}, collectSourceFiles2 = (root) => {
|
|
11722
11845
|
const out = [];
|
|
11723
11846
|
const stack = [root];
|
|
@@ -11727,7 +11850,7 @@ var ELYSIA_ROUTE_METHODS2, SKIP_DIRS2, SOURCE_EXTENSIONS2, getScriptKind2 = (fil
|
|
|
11727
11850
|
continue;
|
|
11728
11851
|
let entries;
|
|
11729
11852
|
try {
|
|
11730
|
-
entries =
|
|
11853
|
+
entries = readdirSync3(dir, {
|
|
11731
11854
|
encoding: "utf-8",
|
|
11732
11855
|
withFileTypes: true
|
|
11733
11856
|
});
|
|
@@ -11736,13 +11859,13 @@ var ELYSIA_ROUTE_METHODS2, SKIP_DIRS2, SOURCE_EXTENSIONS2, getScriptKind2 = (fil
|
|
|
11736
11859
|
}
|
|
11737
11860
|
for (const entry of entries) {
|
|
11738
11861
|
if (entry.isDirectory()) {
|
|
11739
|
-
if (
|
|
11862
|
+
if (SKIP_DIRS3.has(entry.name))
|
|
11740
11863
|
continue;
|
|
11741
11864
|
if (entry.name.startsWith("."))
|
|
11742
11865
|
continue;
|
|
11743
|
-
stack.push(
|
|
11744
|
-
} else if (entry.isFile() &&
|
|
11745
|
-
out.push(
|
|
11866
|
+
stack.push(join25(dir, entry.name));
|
|
11867
|
+
} else if (entry.isFile() && hasSourceExtension3(entry.name)) {
|
|
11868
|
+
out.push(join25(dir, entry.name));
|
|
11746
11869
|
}
|
|
11747
11870
|
}
|
|
11748
11871
|
}
|
|
@@ -11763,9 +11886,9 @@ var ELYSIA_ROUTE_METHODS2, SKIP_DIRS2, SOURCE_EXTENSIONS2, getScriptKind2 = (fil
|
|
|
11763
11886
|
return null;
|
|
11764
11887
|
};
|
|
11765
11888
|
for (const statement of sf.statements) {
|
|
11766
|
-
if (!
|
|
11889
|
+
if (!ts7.isImportDeclaration(statement))
|
|
11767
11890
|
continue;
|
|
11768
|
-
if (!
|
|
11891
|
+
if (!ts7.isStringLiteral(statement.moduleSpecifier))
|
|
11769
11892
|
continue;
|
|
11770
11893
|
if (statement.importClause?.isTypeOnly)
|
|
11771
11894
|
continue;
|
|
@@ -11786,7 +11909,7 @@ var ELYSIA_ROUTE_METHODS2, SKIP_DIRS2, SOURCE_EXTENSIONS2, getScriptKind2 = (fil
|
|
|
11786
11909
|
const bindings = clause.namedBindings;
|
|
11787
11910
|
if (!bindings)
|
|
11788
11911
|
continue;
|
|
11789
|
-
if (
|
|
11912
|
+
if (ts7.isNamespaceImport(bindings)) {
|
|
11790
11913
|
recordSpec(bindings.name.text, {
|
|
11791
11914
|
importedName: "*",
|
|
11792
11915
|
isDefault: false,
|
|
@@ -11814,38 +11937,38 @@ var ELYSIA_ROUTE_METHODS2, SKIP_DIRS2, SOURCE_EXTENSIONS2, getScriptKind2 = (fil
|
|
|
11814
11937
|
}, collectExpressionIdentifiers = (expr) => {
|
|
11815
11938
|
const out = new Set;
|
|
11816
11939
|
const visit = (node) => {
|
|
11817
|
-
if (
|
|
11940
|
+
if (ts7.isIdentifier(node)) {
|
|
11818
11941
|
out.add(node.text);
|
|
11819
11942
|
return;
|
|
11820
11943
|
}
|
|
11821
|
-
if (
|
|
11944
|
+
if (ts7.isPropertyAccessExpression(node)) {
|
|
11822
11945
|
visit(node.expression);
|
|
11823
11946
|
return;
|
|
11824
11947
|
}
|
|
11825
|
-
|
|
11948
|
+
ts7.forEachChild(node, visit);
|
|
11826
11949
|
};
|
|
11827
11950
|
visit(expr);
|
|
11828
11951
|
return out;
|
|
11829
11952
|
}, extractManifestKey = (pagePathValue) => {
|
|
11830
|
-
if (!
|
|
11953
|
+
if (!ts7.isCallExpression(pagePathValue))
|
|
11831
11954
|
return null;
|
|
11832
11955
|
const callee = pagePathValue.expression;
|
|
11833
|
-
if (!
|
|
11956
|
+
if (!ts7.isIdentifier(callee) || callee.text !== "asset")
|
|
11834
11957
|
return null;
|
|
11835
11958
|
const [, second] = pagePathValue.arguments;
|
|
11836
11959
|
if (!second)
|
|
11837
11960
|
return null;
|
|
11838
|
-
if (!
|
|
11961
|
+
if (!ts7.isStringLiteral(second))
|
|
11839
11962
|
return null;
|
|
11840
11963
|
return second.text;
|
|
11841
11964
|
}, findEnclosingMountPath = (node) => {
|
|
11842
11965
|
let cursor = node.parent;
|
|
11843
11966
|
while (cursor) {
|
|
11844
|
-
if (
|
|
11967
|
+
if (ts7.isCallExpression(cursor)) {
|
|
11845
11968
|
const callee = cursor.expression;
|
|
11846
|
-
if (
|
|
11969
|
+
if (ts7.isPropertyAccessExpression(callee) && ts7.isIdentifier(callee.name) && ELYSIA_ROUTE_METHODS2.has(callee.name.text)) {
|
|
11847
11970
|
const firstArg = cursor.arguments[0];
|
|
11848
|
-
if (firstArg &&
|
|
11971
|
+
if (firstArg && ts7.isStringLiteral(firstArg) && firstArg.text.startsWith("/")) {
|
|
11849
11972
|
return firstArg.text;
|
|
11850
11973
|
}
|
|
11851
11974
|
}
|
|
@@ -11856,37 +11979,37 @@ var ELYSIA_ROUTE_METHODS2, SKIP_DIRS2, SOURCE_EXTENSIONS2, getScriptKind2 = (fil
|
|
|
11856
11979
|
}, extractCallsFromFile = (filePath, out) => {
|
|
11857
11980
|
let source;
|
|
11858
11981
|
try {
|
|
11859
|
-
source =
|
|
11982
|
+
source = readFileSync13(filePath, "utf-8");
|
|
11860
11983
|
} catch {
|
|
11861
11984
|
return;
|
|
11862
11985
|
}
|
|
11863
11986
|
if (!fileMayContainAngularHandler(source))
|
|
11864
11987
|
return;
|
|
11865
|
-
const sf =
|
|
11988
|
+
const sf = ts7.createSourceFile(filePath, source, ts7.ScriptTarget.Latest, true, getScriptKind2(filePath));
|
|
11866
11989
|
const imports = collectFileImports(sf, filePath);
|
|
11867
11990
|
const visit = (node) => {
|
|
11868
|
-
if (
|
|
11991
|
+
if (ts7.isCallExpression(node) && ts7.isIdentifier(node.expression) && node.expression.text === "handleAngularPageRequest") {
|
|
11869
11992
|
const [arg] = node.arguments;
|
|
11870
|
-
if (arg &&
|
|
11993
|
+
if (arg && ts7.isObjectLiteralExpression(arg)) {
|
|
11871
11994
|
let manifestKey = null;
|
|
11872
11995
|
let providersExpr = null;
|
|
11873
11996
|
for (const prop of arg.properties) {
|
|
11874
|
-
if (
|
|
11997
|
+
if (ts7.isPropertyAssignment(prop)) {
|
|
11875
11998
|
if (!prop.name)
|
|
11876
11999
|
continue;
|
|
11877
|
-
const name =
|
|
12000
|
+
const name = ts7.isIdentifier(prop.name) ? prop.name.text : ts7.isStringLiteral(prop.name) ? prop.name.text : null;
|
|
11878
12001
|
if (name === "pagePath") {
|
|
11879
12002
|
manifestKey = extractManifestKey(prop.initializer);
|
|
11880
12003
|
} else if (name === "providers") {
|
|
11881
12004
|
providersExpr = prop.initializer;
|
|
11882
12005
|
}
|
|
11883
|
-
} else if (
|
|
12006
|
+
} else if (ts7.isSpreadAssignment(prop)) {
|
|
11884
12007
|
if (manifestKey)
|
|
11885
12008
|
continue;
|
|
11886
12009
|
const spreadExpr = prop.expression;
|
|
11887
|
-
if (
|
|
12010
|
+
if (ts7.isCallExpression(spreadExpr) && spreadExpr.arguments.length > 0) {
|
|
11888
12011
|
const [firstArg] = spreadExpr.arguments;
|
|
11889
|
-
if (firstArg &&
|
|
12012
|
+
if (firstArg && ts7.isStringLiteral(firstArg)) {
|
|
11890
12013
|
manifestKey = firstArg.text;
|
|
11891
12014
|
}
|
|
11892
12015
|
}
|
|
@@ -11914,9 +12037,9 @@ var ELYSIA_ROUTE_METHODS2, SKIP_DIRS2, SOURCE_EXTENSIONS2, getScriptKind2 = (fil
|
|
|
11914
12037
|
}
|
|
11915
12038
|
}
|
|
11916
12039
|
}
|
|
11917
|
-
|
|
12040
|
+
ts7.forEachChild(node, visit);
|
|
11918
12041
|
};
|
|
11919
|
-
|
|
12042
|
+
ts7.forEachChild(sf, visit);
|
|
11920
12043
|
}, scanAngularHandlerCalls = (projectRoot) => {
|
|
11921
12044
|
const files = collectSourceFiles2(projectRoot);
|
|
11922
12045
|
const collected = [];
|
|
@@ -11936,7 +12059,7 @@ var init_scanAngularHandlerCalls = __esm(() => {
|
|
|
11936
12059
|
"post",
|
|
11937
12060
|
"put"
|
|
11938
12061
|
]);
|
|
11939
|
-
|
|
12062
|
+
SKIP_DIRS3 = new Set([
|
|
11940
12063
|
".absolutejs",
|
|
11941
12064
|
".generated",
|
|
11942
12065
|
".git",
|
|
@@ -11948,7 +12071,7 @@ var init_scanAngularHandlerCalls = __esm(() => {
|
|
|
11948
12071
|
"dist",
|
|
11949
12072
|
"node_modules"
|
|
11950
12073
|
]);
|
|
11951
|
-
|
|
12074
|
+
SOURCE_EXTENSIONS3 = new Set([".ts", ".tsx", ".mts", ".cts"]);
|
|
11952
12075
|
});
|
|
11953
12076
|
|
|
11954
12077
|
// src/build/runAngularHandlerScan.ts
|
|
@@ -11956,13 +12079,15 @@ var exports_runAngularHandlerScan = {};
|
|
|
11956
12079
|
__export(exports_runAngularHandlerScan, {
|
|
11957
12080
|
runAngularHandlerScan: () => runAngularHandlerScan
|
|
11958
12081
|
});
|
|
11959
|
-
var runAngularHandlerScan = (projectRoot) => {
|
|
12082
|
+
var runAngularHandlerScan = (projectRoot, angularDirectory) => {
|
|
11960
12083
|
const calls = scanAngularHandlerCalls(projectRoot);
|
|
11961
|
-
const
|
|
12084
|
+
const pageRoutes = scanAngularPageRoutes(angularDirectory);
|
|
12085
|
+
const providersFiles = emitAngularProvidersFiles(projectRoot, calls, pageRoutes);
|
|
11962
12086
|
emitAngularRouteMounts(projectRoot, calls);
|
|
11963
12087
|
return {
|
|
11964
12088
|
calls,
|
|
11965
12089
|
manifestKeysWithProviders: new Set(providersFiles.map((file) => file.manifestKey)),
|
|
12090
|
+
pageRoutes,
|
|
11966
12091
|
providersFiles
|
|
11967
12092
|
};
|
|
11968
12093
|
};
|
|
@@ -11970,6 +12095,7 @@ var init_runAngularHandlerScan = __esm(() => {
|
|
|
11970
12095
|
init_emitAngularProvidersFiles();
|
|
11971
12096
|
init_emitAngularRouteMounts();
|
|
11972
12097
|
init_scanAngularHandlerCalls();
|
|
12098
|
+
init_scanAngularPageRoutes();
|
|
11973
12099
|
});
|
|
11974
12100
|
|
|
11975
12101
|
// src/islands/sourceMetadata.ts
|
|
@@ -12115,11 +12241,11 @@ import { existsSync as existsSync19 } from "fs";
|
|
|
12115
12241
|
import { mkdir as mkdir4, stat as stat2 } from "fs/promises";
|
|
12116
12242
|
import {
|
|
12117
12243
|
dirname as dirname13,
|
|
12118
|
-
join as
|
|
12119
|
-
basename as
|
|
12244
|
+
join as join26,
|
|
12245
|
+
basename as basename6,
|
|
12120
12246
|
extname as extname5,
|
|
12121
12247
|
resolve as resolve20,
|
|
12122
|
-
relative as
|
|
12248
|
+
relative as relative11,
|
|
12123
12249
|
sep as sep2
|
|
12124
12250
|
} from "path";
|
|
12125
12251
|
import { env } from "process";
|
|
@@ -12174,14 +12300,14 @@ var resolveDevClientDir2 = () => {
|
|
|
12174
12300
|
`${basePath}.svelte`,
|
|
12175
12301
|
`${basePath}.svelte.ts`,
|
|
12176
12302
|
`${basePath}.svelte.js`,
|
|
12177
|
-
|
|
12178
|
-
|
|
12179
|
-
|
|
12180
|
-
|
|
12181
|
-
|
|
12182
|
-
|
|
12183
|
-
|
|
12184
|
-
|
|
12303
|
+
join26(basePath, "index.ts"),
|
|
12304
|
+
join26(basePath, "index.js"),
|
|
12305
|
+
join26(basePath, "index.mjs"),
|
|
12306
|
+
join26(basePath, "index.cjs"),
|
|
12307
|
+
join26(basePath, "index.json"),
|
|
12308
|
+
join26(basePath, "index.svelte"),
|
|
12309
|
+
join26(basePath, "index.svelte.ts"),
|
|
12310
|
+
join26(basePath, "index.svelte.js")
|
|
12185
12311
|
];
|
|
12186
12312
|
const checks = await Promise.all(candidates.map(exists));
|
|
12187
12313
|
return candidates.find((_2, index) => checks[index]) ?? null;
|
|
@@ -12211,8 +12337,8 @@ var resolveDevClientDir2 = () => {
|
|
|
12211
12337
|
return jsPath;
|
|
12212
12338
|
return null;
|
|
12213
12339
|
}, addModuleRewrite = (rewrites, rawSpec, resolvedModule, ssrOutputDir, clientOutputDir) => {
|
|
12214
|
-
const toServer =
|
|
12215
|
-
const toClient =
|
|
12340
|
+
const toServer = relative11(ssrOutputDir, resolvedModule).replace(/\\/g, "/");
|
|
12341
|
+
const toClient = relative11(clientOutputDir, resolvedModule).replace(/\\/g, "/");
|
|
12216
12342
|
rewrites.set(rawSpec, {
|
|
12217
12343
|
client: toClient.startsWith(".") || toClient.startsWith("/") ? toClient : `./${toClient}`,
|
|
12218
12344
|
server: toServer.startsWith(".") ? toServer : `./${toServer}`
|
|
@@ -12220,9 +12346,9 @@ var resolveDevClientDir2 = () => {
|
|
|
12220
12346
|
}, compileSvelte = async (entryPoints, svelteRoot, cache = new Map, isDev = false, stylePreprocessors) => {
|
|
12221
12347
|
const { compile, compileModule, preprocess } = await import("svelte/compiler");
|
|
12222
12348
|
const generatedDir = getFrameworkGeneratedDir("svelte");
|
|
12223
|
-
const clientDir =
|
|
12224
|
-
const indexDir =
|
|
12225
|
-
const serverDir =
|
|
12349
|
+
const clientDir = join26(generatedDir, "client");
|
|
12350
|
+
const indexDir = join26(generatedDir, "indexes");
|
|
12351
|
+
const serverDir = join26(generatedDir, "server");
|
|
12226
12352
|
await Promise.all([clientDir, indexDir, serverDir].map((dir) => mkdir4(dir, { recursive: true })));
|
|
12227
12353
|
const dev = env.NODE_ENV !== "production";
|
|
12228
12354
|
const build = async (src) => {
|
|
@@ -12250,9 +12376,9 @@ var resolveDevClientDir2 = () => {
|
|
|
12250
12376
|
const preprocessedClient = isModule ? loweredClientSource.code : (await preprocess(loweredClientSource.code, svelteStylePreprocessor)).code;
|
|
12251
12377
|
const transpiledServer = src.endsWith(".ts") || src.endsWith(".svelte.ts") ? transpiler3.transformSync(preprocessedServer) : preprocessedServer;
|
|
12252
12378
|
const transpiledClient = src.endsWith(".ts") || src.endsWith(".svelte.ts") ? transpiler3.transformSync(preprocessedClient) : preprocessedClient;
|
|
12253
|
-
const rawRel = dirname13(
|
|
12254
|
-
const relDir = rawRel.startsWith("..") ? `_ext/${
|
|
12255
|
-
const baseName =
|
|
12379
|
+
const rawRel = dirname13(relative11(svelteRoot, src)).replace(/\\/g, "/");
|
|
12380
|
+
const relDir = rawRel.startsWith("..") ? `_ext/${relative11(process.cwd(), dirname13(src)).replace(/\\/g, "/")}` : rawRel;
|
|
12381
|
+
const baseName = basename6(src).replace(/\.svelte(\.(ts|js))?$/, "");
|
|
12256
12382
|
const importPaths = Array.from(transpiledServer.matchAll(/from\s+['"]([^'"]+)['"]/g)).map((match) => match[1]).filter((path) => path !== undefined);
|
|
12257
12383
|
const resolvedModuleImports = await Promise.all(importPaths.map((importPath) => resolveRelativeModule2(importPath, src)));
|
|
12258
12384
|
const resolvedImports = await Promise.all(importPaths.map((importPath) => resolveSvelte(importPath, src)));
|
|
@@ -12260,8 +12386,8 @@ var resolveDevClientDir2 = () => {
|
|
|
12260
12386
|
const childBuilt = await Promise.all(childSources.map((child) => build(child)));
|
|
12261
12387
|
const hasAwaitSlotFromChildren = childBuilt.some((child) => child.hasAwaitSlot);
|
|
12262
12388
|
const externalRewrites = new Map;
|
|
12263
|
-
const ssrOutputDir = dirname13(
|
|
12264
|
-
const clientOutputDir = dirname13(
|
|
12389
|
+
const ssrOutputDir = dirname13(join26(serverDir, relDir, `${baseName}.js`));
|
|
12390
|
+
const clientOutputDir = dirname13(join26(clientDir, relDir, `${baseName}.js`));
|
|
12265
12391
|
for (let idx = 0;idx < importPaths.length; idx++) {
|
|
12266
12392
|
const rawSpec = importPaths[idx];
|
|
12267
12393
|
if (!rawSpec)
|
|
@@ -12272,15 +12398,15 @@ var resolveDevClientDir2 = () => {
|
|
|
12272
12398
|
addModuleRewrite(externalRewrites, rawSpec, resolvedModule, ssrOutputDir, clientOutputDir);
|
|
12273
12399
|
if (!resolved)
|
|
12274
12400
|
continue;
|
|
12275
|
-
const childRel =
|
|
12401
|
+
const childRel = relative11(svelteRoot, resolved).replace(/\\/g, "/");
|
|
12276
12402
|
if (!childRel.startsWith(".."))
|
|
12277
12403
|
continue;
|
|
12278
12404
|
const childBuilt2 = cache.get(resolved);
|
|
12279
12405
|
if (!childBuilt2)
|
|
12280
12406
|
continue;
|
|
12281
12407
|
const origSpec = rawSpec.replace(/\.svelte(?:\.(?:ts|js))?$/, ".js");
|
|
12282
|
-
const toServer =
|
|
12283
|
-
const toClient =
|
|
12408
|
+
const toServer = relative11(ssrOutputDir, childBuilt2.ssr).replace(/\\/g, "/");
|
|
12409
|
+
const toClient = relative11(clientOutputDir, childBuilt2.client).replace(/\\/g, "/");
|
|
12284
12410
|
externalRewrites.set(origSpec, {
|
|
12285
12411
|
client: toClient.startsWith(".") ? toClient : `./${toClient}`,
|
|
12286
12412
|
server: toServer.startsWith(".") ? toServer : `./${toServer}`
|
|
@@ -12314,7 +12440,7 @@ var resolveDevClientDir2 = () => {
|
|
|
12314
12440
|
}).js;
|
|
12315
12441
|
let code = compiledJs.code.replace(/\.svelte(?:\.(?:ts|js))?(['"])/g, ".js$1");
|
|
12316
12442
|
if (mode === "client" && isDev) {
|
|
12317
|
-
const moduleKey = `/@src/${
|
|
12443
|
+
const moduleKey = `/@src/${relative11(process.cwd(), src).replace(/\\/g, "/")}`;
|
|
12318
12444
|
code = code.replace(/if\s*\(import\.meta\.hot\)\s*\{/, `if (typeof window !== "undefined") {
|
|
12319
12445
|
if (!window.__SVELTE_HMR_ACCEPT__) window.__SVELTE_HMR_ACCEPT__ = {};
|
|
12320
12446
|
var __hmr_accept = function(cb) { window.__SVELTE_HMR_ACCEPT__[${JSON.stringify(moduleKey)}] = cb; };`);
|
|
@@ -12326,8 +12452,8 @@ var resolveDevClientDir2 = () => {
|
|
|
12326
12452
|
code += islandMetadataExports;
|
|
12327
12453
|
return { code, map: compiledJs.map };
|
|
12328
12454
|
};
|
|
12329
|
-
const ssrPath =
|
|
12330
|
-
const clientPath =
|
|
12455
|
+
const ssrPath = join26(serverDir, relDir, `${baseName}.js`);
|
|
12456
|
+
const clientPath = join26(clientDir, relDir, `${baseName}.js`);
|
|
12331
12457
|
await Promise.all([
|
|
12332
12458
|
mkdir4(dirname13(ssrPath), { recursive: true }),
|
|
12333
12459
|
mkdir4(dirname13(clientPath), { recursive: true })
|
|
@@ -12363,10 +12489,10 @@ var resolveDevClientDir2 = () => {
|
|
|
12363
12489
|
};
|
|
12364
12490
|
const roots = await Promise.all(entryPoints.map(build));
|
|
12365
12491
|
await Promise.all(roots.map(async ({ client, hasAwaitSlot }) => {
|
|
12366
|
-
const relClientDir = dirname13(
|
|
12367
|
-
const name =
|
|
12368
|
-
const indexPath =
|
|
12369
|
-
const importRaw =
|
|
12492
|
+
const relClientDir = dirname13(relative11(clientDir, client));
|
|
12493
|
+
const name = basename6(client, extname5(client));
|
|
12494
|
+
const indexPath = join26(indexDir, relClientDir, `${name}.js`);
|
|
12495
|
+
const importRaw = relative11(dirname13(indexPath), client).split(sep2).join("/");
|
|
12370
12496
|
const importPath = importRaw.startsWith(".") || importRaw.startsWith("/") ? importRaw : `./${importRaw}`;
|
|
12371
12497
|
const hmrImports = isDev ? `window.__HMR_FRAMEWORK__ = "svelte";
|
|
12372
12498
|
import "${hmrClientPath3}";
|
|
@@ -12443,8 +12569,8 @@ if (typeof window !== "undefined") {
|
|
|
12443
12569
|
return {
|
|
12444
12570
|
svelteClientPaths: roots.map(({ client }) => client),
|
|
12445
12571
|
svelteIndexPaths: roots.map(({ client }) => {
|
|
12446
|
-
const rel = dirname13(
|
|
12447
|
-
return
|
|
12572
|
+
const rel = dirname13(relative11(clientDir, client));
|
|
12573
|
+
return join26(indexDir, rel, basename6(client));
|
|
12448
12574
|
}),
|
|
12449
12575
|
svelteServerPaths: roots.map(({ ssr }) => ssr)
|
|
12450
12576
|
};
|
|
@@ -12459,7 +12585,7 @@ var init_compileSvelte = __esm(() => {
|
|
|
12459
12585
|
init_lowerAwaitSlotSyntax();
|
|
12460
12586
|
init_renderToReadableStream();
|
|
12461
12587
|
devClientDir2 = resolveDevClientDir2();
|
|
12462
|
-
hmrClientPath3 =
|
|
12588
|
+
hmrClientPath3 = join26(devClientDir2, "hmrClient.ts").replace(/\\/g, "/");
|
|
12463
12589
|
persistentCache = new Map;
|
|
12464
12590
|
sourceHashCache = new Map;
|
|
12465
12591
|
transpiler3 = new Transpiler2({ loader: "ts", target: "browser" });
|
|
@@ -12474,7 +12600,7 @@ __export(exports_chainInlineSourcemaps, {
|
|
|
12474
12600
|
chainBundleInlineSourcemap: () => chainBundleInlineSourcemap,
|
|
12475
12601
|
buildLineRemap: () => buildLineRemap
|
|
12476
12602
|
});
|
|
12477
|
-
import { readFileSync as
|
|
12603
|
+
import { readFileSync as readFileSync14, writeFileSync as writeFileSync9 } from "fs";
|
|
12478
12604
|
var BASE64_CHARS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", BASE64_TO_INT, decodeVlq = (str, startPos) => {
|
|
12479
12605
|
let result = 0;
|
|
12480
12606
|
let shift = 0;
|
|
@@ -12765,7 +12891,7 @@ var BASE64_CHARS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz01234567
|
|
|
12765
12891
|
version: 3
|
|
12766
12892
|
};
|
|
12767
12893
|
}, chainBundleInlineSourcemap = (bundleFilePath) => {
|
|
12768
|
-
const text =
|
|
12894
|
+
const text = readFileSync14(bundleFilePath, "utf-8");
|
|
12769
12895
|
const outerMap = extractInlineMap(text);
|
|
12770
12896
|
if (!outerMap)
|
|
12771
12897
|
return;
|
|
@@ -12854,11 +12980,11 @@ __export(exports_compileVue, {
|
|
|
12854
12980
|
import { existsSync as existsSync20 } from "fs";
|
|
12855
12981
|
import { mkdir as mkdir5 } from "fs/promises";
|
|
12856
12982
|
import {
|
|
12857
|
-
basename as
|
|
12983
|
+
basename as basename7,
|
|
12858
12984
|
dirname as dirname14,
|
|
12859
12985
|
isAbsolute as isAbsolute4,
|
|
12860
|
-
join as
|
|
12861
|
-
relative as
|
|
12986
|
+
join as join27,
|
|
12987
|
+
relative as relative12,
|
|
12862
12988
|
resolve as resolve21
|
|
12863
12989
|
} from "path";
|
|
12864
12990
|
var {file: file2, write: write3, Transpiler: Transpiler3 } = globalThis.Bun;
|
|
@@ -12910,7 +13036,7 @@ var resolveDevClientDir3 = () => {
|
|
|
12910
13036
|
return "template-only";
|
|
12911
13037
|
}
|
|
12912
13038
|
return "full";
|
|
12913
|
-
}, generateVueHmrId = (sourceFilePath, vueRootDir) =>
|
|
13039
|
+
}, generateVueHmrId = (sourceFilePath, vueRootDir) => relative12(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) => {
|
|
12914
13040
|
if (filePath.endsWith(".vue"))
|
|
12915
13041
|
return filePath.replace(/\.vue$/, ".js");
|
|
12916
13042
|
if (filePath.endsWith(".ts"))
|
|
@@ -12943,9 +13069,9 @@ var resolveDevClientDir3 = () => {
|
|
|
12943
13069
|
const cachedResult = cacheMap.get(sourceFilePath);
|
|
12944
13070
|
if (cachedResult)
|
|
12945
13071
|
return cachedResult;
|
|
12946
|
-
const relativeFilePath =
|
|
13072
|
+
const relativeFilePath = relative12(vueRootDir, sourceFilePath).replace(/\\/g, "/");
|
|
12947
13073
|
const relativeWithoutExtension = relativeFilePath.replace(/\.vue$/, "");
|
|
12948
|
-
const fileBaseName =
|
|
13074
|
+
const fileBaseName = basename7(sourceFilePath, ".vue");
|
|
12949
13075
|
const componentId = toKebab(fileBaseName);
|
|
12950
13076
|
const rawSourceContent = await file2(sourceFilePath).text();
|
|
12951
13077
|
const sourceContent = isEntryPoint ? addAutoRouterSetupApp(rawSourceContent) : rawSourceContent;
|
|
@@ -13035,7 +13161,7 @@ var resolveDevClientDir3 = () => {
|
|
|
13035
13161
|
];
|
|
13036
13162
|
let cssOutputPaths = [];
|
|
13037
13163
|
if (isEntryPoint && allCss.length) {
|
|
13038
|
-
const cssOutputFile =
|
|
13164
|
+
const cssOutputFile = join27(outputDirs.css, `${toKebab(fileBaseName)}-compiled.css`);
|
|
13039
13165
|
await mkdir5(dirname14(cssOutputFile), { recursive: true });
|
|
13040
13166
|
await write3(cssOutputFile, allCss.join(`
|
|
13041
13167
|
`));
|
|
@@ -13066,8 +13192,8 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
13066
13192
|
};
|
|
13067
13193
|
const clientCode = assembleModule(generateRenderFunction(false), "render", true) + islandMetadataExports;
|
|
13068
13194
|
const serverCode = assembleModule(generateRenderFunction(true), "ssrRender", false) + islandMetadataExports;
|
|
13069
|
-
const clientOutputPath =
|
|
13070
|
-
const serverOutputPath =
|
|
13195
|
+
const clientOutputPath = join27(outputDirs.client, `${relativeWithoutExtension}.js`);
|
|
13196
|
+
const serverOutputPath = join27(outputDirs.server, `${relativeWithoutExtension}.js`);
|
|
13071
13197
|
const relDir = dirname14(relativeFilePath);
|
|
13072
13198
|
const relDepth = relDir === "." ? 0 : relDir.split("/").length;
|
|
13073
13199
|
const adjustImports = (code) => code.replace(/(from\s+['"])(\.\.\/(?:\.\.\/)*)/g, (_2, prefix, dots) => {
|
|
@@ -13080,7 +13206,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
13080
13206
|
let result2 = code;
|
|
13081
13207
|
for (const [bareImport, paths] of packageImportRewrites) {
|
|
13082
13208
|
const targetPath = mode === "server" ? paths.server : paths.client;
|
|
13083
|
-
let rel =
|
|
13209
|
+
let rel = relative12(dirname14(outputPath), targetPath).replace(/\\/g, "/");
|
|
13084
13210
|
if (!rel.startsWith("."))
|
|
13085
13211
|
rel = `./${rel}`;
|
|
13086
13212
|
result2 = result2.replaceAll(bareImport, rel);
|
|
@@ -13120,10 +13246,10 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
13120
13246
|
}, compileVue = async (entryPoints, vueRootDir, isDev = false, stylePreprocessors) => {
|
|
13121
13247
|
const compiler = await import("@vue/compiler-sfc");
|
|
13122
13248
|
const generatedDir = getFrameworkGeneratedDir("vue");
|
|
13123
|
-
const clientOutputDir =
|
|
13124
|
-
const indexOutputDir =
|
|
13125
|
-
const serverOutputDir =
|
|
13126
|
-
const cssOutputDir =
|
|
13249
|
+
const clientOutputDir = join27(generatedDir, "client");
|
|
13250
|
+
const indexOutputDir = join27(generatedDir, "indexes");
|
|
13251
|
+
const serverOutputDir = join27(generatedDir, "server");
|
|
13252
|
+
const cssOutputDir = join27(generatedDir, "compiled");
|
|
13127
13253
|
await Promise.all([
|
|
13128
13254
|
mkdir5(clientOutputDir, { recursive: true }),
|
|
13129
13255
|
mkdir5(indexOutputDir, { recursive: true }),
|
|
@@ -13139,9 +13265,9 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
13139
13265
|
server: serverOutputDir
|
|
13140
13266
|
}, buildCache, true, vueRootDir, compiler, stylePreprocessors);
|
|
13141
13267
|
result.tsHelperPaths.forEach((path) => allTsHelperPaths.add(path));
|
|
13142
|
-
const entryBaseName =
|
|
13143
|
-
const indexOutputFile =
|
|
13144
|
-
const clientOutputFile =
|
|
13268
|
+
const entryBaseName = basename7(entryPath, ".vue");
|
|
13269
|
+
const indexOutputFile = join27(indexOutputDir, `${entryBaseName}.js`);
|
|
13270
|
+
const clientOutputFile = join27(clientOutputDir, relative12(vueRootDir, entryPath).replace(/\\/g, "/").replace(/\.vue$/, ".js"));
|
|
13145
13271
|
await mkdir5(dirname14(indexOutputFile), { recursive: true });
|
|
13146
13272
|
const vueHmrImports = isDev ? [
|
|
13147
13273
|
`window.__HMR_FRAMEWORK__ = "vue";`,
|
|
@@ -13149,7 +13275,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
13149
13275
|
] : [];
|
|
13150
13276
|
await write3(indexOutputFile, [
|
|
13151
13277
|
...vueHmrImports,
|
|
13152
|
-
`import Comp, * as PageModule from "${
|
|
13278
|
+
`import Comp, * as PageModule from "${relative12(dirname14(indexOutputFile), clientOutputFile).replace(/\\/g, "/")}";`,
|
|
13153
13279
|
'import { createSSRApp, createApp } from "vue";',
|
|
13154
13280
|
"",
|
|
13155
13281
|
"// HMR State Preservation: Check for preserved state from HMR",
|
|
@@ -13293,9 +13419,9 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
13293
13419
|
await Promise.all(Array.from(allTsHelperPaths).map(async (tsPath) => {
|
|
13294
13420
|
const sourceCode = await file2(tsPath).text();
|
|
13295
13421
|
const transpiledCode = transpiler4.transformSync(sourceCode);
|
|
13296
|
-
const relativeJsPath =
|
|
13297
|
-
const outClientPath =
|
|
13298
|
-
const outServerPath =
|
|
13422
|
+
const relativeJsPath = relative12(vueRootDir, tsPath).replace(/\.ts$/, ".js");
|
|
13423
|
+
const outClientPath = join27(clientOutputDir, relativeJsPath);
|
|
13424
|
+
const outServerPath = join27(serverOutputDir, relativeJsPath);
|
|
13299
13425
|
await mkdir5(dirname14(outClientPath), { recursive: true });
|
|
13300
13426
|
await mkdir5(dirname14(outServerPath), { recursive: true });
|
|
13301
13427
|
await write3(outClientPath, transpiledCode);
|
|
@@ -13318,7 +13444,7 @@ var init_compileVue = __esm(() => {
|
|
|
13318
13444
|
init_vueAutoRouterTransform();
|
|
13319
13445
|
init_stylePreprocessor();
|
|
13320
13446
|
devClientDir3 = resolveDevClientDir3();
|
|
13321
|
-
hmrClientPath4 =
|
|
13447
|
+
hmrClientPath4 = join27(devClientDir3, "hmrClient.ts").replace(/\\/g, "/");
|
|
13322
13448
|
transpiler4 = new Transpiler3({ loader: "ts", target: "browser" });
|
|
13323
13449
|
scriptCache = new Map;
|
|
13324
13450
|
scriptSetupCache = new Map;
|
|
@@ -13799,17 +13925,17 @@ __export(exports_compileAngular, {
|
|
|
13799
13925
|
compileAngularFile: () => compileAngularFile,
|
|
13800
13926
|
compileAngular: () => compileAngular
|
|
13801
13927
|
});
|
|
13802
|
-
import { existsSync as existsSync21, readFileSync as
|
|
13803
|
-
import { join as
|
|
13928
|
+
import { existsSync as existsSync21, readFileSync as readFileSync15, promises as fs5 } from "fs";
|
|
13929
|
+
import { join as join28, basename as basename8, sep as sep3, dirname as dirname15, resolve as resolve22, relative as relative13 } from "path";
|
|
13804
13930
|
var {Glob: Glob6 } = globalThis.Bun;
|
|
13805
|
-
import
|
|
13931
|
+
import ts8 from "typescript";
|
|
13806
13932
|
var traceAngularPhase = async (name, fn2, metadata) => {
|
|
13807
13933
|
const tracePhase = globalThis.__absoluteBuildTracePhase;
|
|
13808
13934
|
return tracePhase ? tracePhase(`compile/angular/${name}`, fn2, metadata) : await fn2();
|
|
13809
13935
|
}, readTsconfigPathAliases = () => {
|
|
13810
13936
|
try {
|
|
13811
13937
|
const configPath2 = resolve22(process.cwd(), "tsconfig.json");
|
|
13812
|
-
const config =
|
|
13938
|
+
const config = ts8.readConfigFile(configPath2, ts8.sys.readFile).config;
|
|
13813
13939
|
const compilerOptions = config?.compilerOptions ?? {};
|
|
13814
13940
|
const baseUrl = resolve22(process.cwd(), compilerOptions.baseUrl ?? ".");
|
|
13815
13941
|
const aliases = Object.entries(compilerOptions.paths ?? {}).map(([pattern, replacements]) => ({ pattern, replacements }));
|
|
@@ -13843,10 +13969,10 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
13843
13969
|
`${candidate}.tsx`,
|
|
13844
13970
|
`${candidate}.js`,
|
|
13845
13971
|
`${candidate}.jsx`,
|
|
13846
|
-
|
|
13847
|
-
|
|
13848
|
-
|
|
13849
|
-
|
|
13972
|
+
join28(candidate, "index.ts"),
|
|
13973
|
+
join28(candidate, "index.tsx"),
|
|
13974
|
+
join28(candidate, "index.js"),
|
|
13975
|
+
join28(candidate, "index.jsx")
|
|
13850
13976
|
];
|
|
13851
13977
|
return candidates.find((file3) => existsSync21(file3));
|
|
13852
13978
|
}, createLegacyAngularAnimationUsageResolver = (rootDir) => {
|
|
@@ -13938,7 +14064,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
13938
14064
|
return resolve22(import.meta.dir, "./dev/client");
|
|
13939
14065
|
}, devClientDir4, hmrClientPath5, formatDiagnosticMessage = (diagnostic) => {
|
|
13940
14066
|
try {
|
|
13941
|
-
return
|
|
14067
|
+
return ts8.flattenDiagnosticMessageText(diagnostic.messageText, `
|
|
13942
14068
|
`);
|
|
13943
14069
|
} catch {
|
|
13944
14070
|
return String(diagnostic.messageText || "Unknown error");
|
|
@@ -13946,7 +14072,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
13946
14072
|
}, throwOnCompilationErrors = (diagnostics) => {
|
|
13947
14073
|
if (!diagnostics?.length)
|
|
13948
14074
|
return;
|
|
13949
|
-
const errors = diagnostics.filter((diag) => diag.category ===
|
|
14075
|
+
const errors = diagnostics.filter((diag) => diag.category === ts8.DiagnosticCategory.Error);
|
|
13950
14076
|
if (!errors.length)
|
|
13951
14077
|
return;
|
|
13952
14078
|
const fullMessage = errors.map(formatDiagnosticMessage).join(`
|
|
@@ -13988,22 +14114,22 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
13988
14114
|
}
|
|
13989
14115
|
return `${path}.js${query}`;
|
|
13990
14116
|
}, isRelativeModuleSpecifier = (specifier) => specifier.startsWith("./") || specifier.startsWith("../"), extractLocalImportSpecifiers = (source, fileName) => {
|
|
13991
|
-
const sourceFile =
|
|
14117
|
+
const sourceFile = ts8.createSourceFile(fileName, source, ts8.ScriptTarget.Latest, true, ts8.ScriptKind.TS);
|
|
13992
14118
|
const specifiers = [];
|
|
13993
14119
|
const addSpecifier = (node) => {
|
|
13994
|
-
if (!node || !
|
|
14120
|
+
if (!node || !ts8.isStringLiteralLike(node))
|
|
13995
14121
|
return;
|
|
13996
14122
|
const specifier = node.text;
|
|
13997
14123
|
if (isRelativeModuleSpecifier(specifier))
|
|
13998
14124
|
specifiers.push(specifier);
|
|
13999
14125
|
};
|
|
14000
14126
|
const visit = (node) => {
|
|
14001
|
-
if (
|
|
14127
|
+
if (ts8.isImportDeclaration(node) || ts8.isExportDeclaration(node)) {
|
|
14002
14128
|
addSpecifier(node.moduleSpecifier);
|
|
14003
|
-
} else if (
|
|
14129
|
+
} else if (ts8.isCallExpression(node) && node.expression.kind === ts8.SyntaxKind.ImportKeyword) {
|
|
14004
14130
|
addSpecifier(node.arguments[0]);
|
|
14005
14131
|
}
|
|
14006
|
-
|
|
14132
|
+
ts8.forEachChild(node, visit);
|
|
14007
14133
|
};
|
|
14008
14134
|
visit(sourceFile);
|
|
14009
14135
|
return specifiers;
|
|
@@ -14016,10 +14142,10 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
14016
14142
|
`${basePath}.tsx`,
|
|
14017
14143
|
`${basePath}.mts`,
|
|
14018
14144
|
`${basePath}.cts`,
|
|
14019
|
-
|
|
14020
|
-
|
|
14021
|
-
|
|
14022
|
-
|
|
14145
|
+
join28(basePath, "index.ts"),
|
|
14146
|
+
join28(basePath, "index.tsx"),
|
|
14147
|
+
join28(basePath, "index.mts"),
|
|
14148
|
+
join28(basePath, "index.cts")
|
|
14023
14149
|
];
|
|
14024
14150
|
return candidates.map((candidate) => resolve22(candidate)).find((candidate) => existsSync21(candidate) && !candidate.endsWith(".d.ts")) ?? null;
|
|
14025
14151
|
}, readFileForAotTransform = async (fileName, readFile6) => {
|
|
@@ -14045,15 +14171,15 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
14045
14171
|
const paths = [];
|
|
14046
14172
|
const templateUrlMatch = findUncommentedMatch(source, /templateUrl\s*:\s*['"]([^'"]+)['"]/);
|
|
14047
14173
|
if (templateUrlMatch?.[1])
|
|
14048
|
-
paths.push(
|
|
14174
|
+
paths.push(join28(fileDir, templateUrlMatch[1]));
|
|
14049
14175
|
const styleUrlMatch = findUncommentedMatch(source, /styleUrl\s*:\s*['"]([^'"]+)['"]/);
|
|
14050
14176
|
if (styleUrlMatch?.[1])
|
|
14051
|
-
paths.push(
|
|
14177
|
+
paths.push(join28(fileDir, styleUrlMatch[1]));
|
|
14052
14178
|
const styleUrlsMatch = findUncommentedMatch(source, /styleUrls\s*:\s*\[([^\]]+)\]/);
|
|
14053
14179
|
const urlMatches = styleUrlsMatch?.[1]?.match(/['"]([^'"]+)['"]/g);
|
|
14054
14180
|
if (urlMatches) {
|
|
14055
14181
|
for (const urlMatch of urlMatches) {
|
|
14056
|
-
paths.push(
|
|
14182
|
+
paths.push(join28(fileDir, urlMatch.replace(/['"]/g, "")));
|
|
14057
14183
|
}
|
|
14058
14184
|
}
|
|
14059
14185
|
return paths.map((path) => resolve22(path));
|
|
@@ -14087,7 +14213,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
14087
14213
|
safeStableStringify(stylePreprocessors ?? null)
|
|
14088
14214
|
].join("\x00");
|
|
14089
14215
|
const cacheKey2 = Bun.hash(cacheInput).toString(BASE_36_RADIX);
|
|
14090
|
-
return
|
|
14216
|
+
return join28(process.cwd(), ".absolutejs", "cache", "angular-resources", `${cacheKey2}.json`);
|
|
14091
14217
|
}, precomputeAotResourceTransforms = async (inputPaths, readFile6, stylePreprocessors) => {
|
|
14092
14218
|
const transformedSources = new Map;
|
|
14093
14219
|
const visited = new Set;
|
|
@@ -14133,10 +14259,10 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
14133
14259
|
return { stats, transformedSources };
|
|
14134
14260
|
}, compileAngularFiles = async (inputPaths, outDir, stylePreprocessors) => {
|
|
14135
14261
|
const islandMetadataByOutputPath = await traceAngularPhase("aot/island-metadata", () => new Map(inputPaths.map((inputPath) => {
|
|
14136
|
-
const outputPath = resolve22(
|
|
14262
|
+
const outputPath = resolve22(join28(outDir, relative13(process.cwd(), resolve22(inputPath)).replace(/\.[cm]?[tj]sx?$/, ".js")));
|
|
14137
14263
|
return [
|
|
14138
14264
|
outputPath,
|
|
14139
|
-
buildIslandMetadataExports(
|
|
14265
|
+
buildIslandMetadataExports(readFileSync15(inputPath, "utf-8"))
|
|
14140
14266
|
];
|
|
14141
14267
|
})), { entries: inputPaths.length });
|
|
14142
14268
|
await traceAngularPhase("aot/preload-compiler", () => import("@angular/compiler"));
|
|
@@ -14151,36 +14277,36 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
14151
14277
|
emitDecoratorMetadata: true,
|
|
14152
14278
|
esModuleInterop: true,
|
|
14153
14279
|
experimentalDecorators: true,
|
|
14154
|
-
module:
|
|
14155
|
-
moduleResolution:
|
|
14156
|
-
newLine:
|
|
14280
|
+
module: ts8.ModuleKind.ESNext,
|
|
14281
|
+
moduleResolution: ts8.ModuleResolutionKind.Bundler,
|
|
14282
|
+
newLine: ts8.NewLineKind.LineFeed,
|
|
14157
14283
|
noLib: false,
|
|
14158
14284
|
outDir,
|
|
14159
14285
|
skipLibCheck: true,
|
|
14160
|
-
target:
|
|
14286
|
+
target: ts8.ScriptTarget.ES2022,
|
|
14161
14287
|
...config.options
|
|
14162
14288
|
};
|
|
14163
|
-
options.target =
|
|
14289
|
+
options.target = ts8.ScriptTarget.ES2022;
|
|
14164
14290
|
options.experimentalDecorators = true;
|
|
14165
14291
|
options.emitDecoratorMetadata = true;
|
|
14166
|
-
options.newLine =
|
|
14292
|
+
options.newLine = ts8.NewLineKind.LineFeed;
|
|
14167
14293
|
options.outDir = outDir;
|
|
14168
14294
|
options.noEmit = false;
|
|
14169
14295
|
options.incremental = false;
|
|
14170
14296
|
options.tsBuildInfoFile = undefined;
|
|
14171
14297
|
options.rootDir = process.cwd();
|
|
14172
|
-
const host = await traceAngularPhase("aot/create-compiler-host", () =>
|
|
14298
|
+
const host = await traceAngularPhase("aot/create-compiler-host", () => ts8.createCompilerHost(options));
|
|
14173
14299
|
const originalGetDefaultLibLocation = host.getDefaultLibLocation;
|
|
14174
14300
|
host.getDefaultLibLocation = () => tsLibDir || (originalGetDefaultLibLocation ? originalGetDefaultLibLocation() : "");
|
|
14175
14301
|
const originalGetDefaultLibFileName = host.getDefaultLibFileName;
|
|
14176
14302
|
host.getDefaultLibFileName = (opts) => {
|
|
14177
14303
|
const fileName = originalGetDefaultLibFileName ? originalGetDefaultLibFileName(opts) : "lib.d.ts";
|
|
14178
|
-
return
|
|
14304
|
+
return basename8(fileName);
|
|
14179
14305
|
};
|
|
14180
14306
|
const originalGetSourceFile = host.getSourceFile;
|
|
14181
14307
|
host.getSourceFile = (fileName, languageVersion, onError) => {
|
|
14182
14308
|
if (fileName.startsWith("lib.") && fileName.endsWith(".d.ts") && tsLibDir) {
|
|
14183
|
-
const resolvedPath =
|
|
14309
|
+
const resolvedPath = join28(tsLibDir, fileName);
|
|
14184
14310
|
return originalGetSourceFile?.call(host, resolvedPath, languageVersion, onError);
|
|
14185
14311
|
}
|
|
14186
14312
|
return originalGetSourceFile?.call(host, fileName, languageVersion, onError);
|
|
@@ -14215,7 +14341,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
14215
14341
|
host.getSourceFile = (fileName, languageVersion, onError) => {
|
|
14216
14342
|
const source = transformedSources.get(resolve22(fileName));
|
|
14217
14343
|
if (source) {
|
|
14218
|
-
return
|
|
14344
|
+
return ts8.createSourceFile(fileName, source, languageVersion, true);
|
|
14219
14345
|
}
|
|
14220
14346
|
return originalGetSourceFileForCompile?.call(host, fileName, languageVersion, onError);
|
|
14221
14347
|
};
|
|
@@ -14235,7 +14361,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
14235
14361
|
const entries = await traceAngularPhase("aot/postprocess-emitted-js", () => {
|
|
14236
14362
|
const rawEntries = Object.entries(emitted).filter(([fileName]) => fileName.endsWith(".js")).map(([fileName, content]) => ({
|
|
14237
14363
|
content,
|
|
14238
|
-
target:
|
|
14364
|
+
target: join28(outDir, fileName)
|
|
14239
14365
|
}));
|
|
14240
14366
|
const outputFiles = new Set(rawEntries.map(({ target }) => resolve22(target)));
|
|
14241
14367
|
return rawEntries.map(({ content, target }) => {
|
|
@@ -14412,7 +14538,7 @@ ${fields}
|
|
|
14412
14538
|
}, inlineTemplateAndLowerDefer = async (source, fileDir) => {
|
|
14413
14539
|
const templateUrlMatch = findUncommentedMatch(source, /templateUrl\s*:\s*['"]([^'"]+)['"]/);
|
|
14414
14540
|
if (templateUrlMatch?.[1]) {
|
|
14415
|
-
const templatePath =
|
|
14541
|
+
const templatePath = join28(fileDir, templateUrlMatch[1]);
|
|
14416
14542
|
if (!existsSync21(templatePath)) {
|
|
14417
14543
|
throw new Error(`Unable to inline Angular templateUrl "${templateUrlMatch[1]}": file not found at ${templatePath}`);
|
|
14418
14544
|
}
|
|
@@ -14443,11 +14569,11 @@ ${fields}
|
|
|
14443
14569
|
}, inlineTemplateAndLowerDeferSync = (source, fileDir) => {
|
|
14444
14570
|
const templateUrlMatch = findUncommentedMatch(source, /templateUrl\s*:\s*['"]([^'"]+)['"]/);
|
|
14445
14571
|
if (templateUrlMatch?.[1]) {
|
|
14446
|
-
const templatePath =
|
|
14572
|
+
const templatePath = join28(fileDir, templateUrlMatch[1]);
|
|
14447
14573
|
if (!existsSync21(templatePath)) {
|
|
14448
14574
|
throw new Error(`Unable to inline Angular templateUrl "${templateUrlMatch[1]}": file not found at ${templatePath}`);
|
|
14449
14575
|
}
|
|
14450
|
-
const templateRaw2 =
|
|
14576
|
+
const templateRaw2 = readFileSync15(templatePath, "utf-8");
|
|
14451
14577
|
const lowered2 = lowerAngularDeferSyntax(templateRaw2);
|
|
14452
14578
|
const escaped2 = escapeTemplateContent(lowered2.template);
|
|
14453
14579
|
const replacedSource2 = source.slice(0, templateUrlMatch.index) + `template: \`${escaped2}\`` + source.slice(templateUrlMatch.index + templateUrlMatch[0].length);
|
|
@@ -14480,7 +14606,7 @@ ${fields}
|
|
|
14480
14606
|
return source;
|
|
14481
14607
|
const stylePromises = urlMatches.map((urlMatch) => {
|
|
14482
14608
|
const styleUrl = urlMatch.replace(/['"]/g, "");
|
|
14483
|
-
return readAndEscapeFile(
|
|
14609
|
+
return readAndEscapeFile(join28(fileDir, styleUrl), stylePreprocessors);
|
|
14484
14610
|
});
|
|
14485
14611
|
const results = await Promise.all(stylePromises);
|
|
14486
14612
|
const inlinedStyles = results.filter(Boolean).map((escaped) => `\`${escaped}\``);
|
|
@@ -14491,7 +14617,7 @@ ${fields}
|
|
|
14491
14617
|
const styleUrlMatch = findUncommentedMatch(source, /styleUrl\s*:\s*['"]([^'"]+)['"]/);
|
|
14492
14618
|
if (!styleUrlMatch?.[1])
|
|
14493
14619
|
return source;
|
|
14494
|
-
const escaped = await readAndEscapeFile(
|
|
14620
|
+
const escaped = await readAndEscapeFile(join28(fileDir, styleUrlMatch[1]), stylePreprocessors);
|
|
14495
14621
|
if (!escaped)
|
|
14496
14622
|
return source;
|
|
14497
14623
|
return source.slice(0, styleUrlMatch.index) + `styles: [\`${escaped}\`]` + source.slice(styleUrlMatch.index + styleUrlMatch[0].length);
|
|
@@ -14527,10 +14653,10 @@ ${fields}
|
|
|
14527
14653
|
`${candidate}.js`,
|
|
14528
14654
|
`${candidate}.jsx`,
|
|
14529
14655
|
`${candidate}.json`,
|
|
14530
|
-
|
|
14531
|
-
|
|
14532
|
-
|
|
14533
|
-
|
|
14656
|
+
join28(candidate, "index.ts"),
|
|
14657
|
+
join28(candidate, "index.tsx"),
|
|
14658
|
+
join28(candidate, "index.js"),
|
|
14659
|
+
join28(candidate, "index.jsx")
|
|
14534
14660
|
];
|
|
14535
14661
|
return candidates.find((file3) => existsSync21(file3));
|
|
14536
14662
|
};
|
|
@@ -14556,8 +14682,8 @@ ${fields}
|
|
|
14556
14682
|
const toOutputPath = (sourcePath) => {
|
|
14557
14683
|
const inputDir = dirname15(sourcePath);
|
|
14558
14684
|
const relativeDir = inputDir.startsWith(baseDir) ? inputDir.substring(baseDir.length + 1) : inputDir;
|
|
14559
|
-
const fileBase =
|
|
14560
|
-
return
|
|
14685
|
+
const fileBase = basename8(sourcePath).replace(/\.[cm]?[tj]sx?$/, ".js");
|
|
14686
|
+
return join28(outDir, relativeDir, fileBase);
|
|
14561
14687
|
};
|
|
14562
14688
|
const withCacheBuster = (specifier) => {
|
|
14563
14689
|
if (!cacheBuster)
|
|
@@ -14607,8 +14733,8 @@ ${fields}
|
|
|
14607
14733
|
if (resolved.endsWith(".json") && existsSync21(resolved)) {
|
|
14608
14734
|
const inputDir2 = dirname15(resolved);
|
|
14609
14735
|
const relativeDir2 = inputDir2.startsWith(baseDir) ? inputDir2.substring(baseDir.length + 1) : inputDir2;
|
|
14610
|
-
const targetDir2 =
|
|
14611
|
-
const targetPath2 =
|
|
14736
|
+
const targetDir2 = join28(outDir, relativeDir2);
|
|
14737
|
+
const targetPath2 = join28(targetDir2, basename8(resolved));
|
|
14612
14738
|
await fs5.mkdir(targetDir2, { recursive: true });
|
|
14613
14739
|
await fs5.copyFile(resolved, targetPath2);
|
|
14614
14740
|
allOutputs.push(targetPath2);
|
|
@@ -14624,8 +14750,8 @@ ${fields}
|
|
|
14624
14750
|
sourceCode = inlineTemplateAndLowerDeferSync(inlined.source, dirname15(actualPath)).source;
|
|
14625
14751
|
const inputDir = dirname15(actualPath);
|
|
14626
14752
|
const relativeDir = inputDir.startsWith(baseDir) ? inputDir.substring(baseDir.length + 1) : inputDir;
|
|
14627
|
-
const fileBase =
|
|
14628
|
-
const targetDir =
|
|
14753
|
+
const fileBase = basename8(actualPath).replace(/\.[cm]?[tj]sx?$/, ".js");
|
|
14754
|
+
const targetDir = join28(outDir, relativeDir);
|
|
14629
14755
|
const targetPath = toOutputPath(actualPath);
|
|
14630
14756
|
const localImports = [];
|
|
14631
14757
|
const importRewrites = new Map;
|
|
@@ -14647,7 +14773,7 @@ ${fields}
|
|
|
14647
14773
|
const resolved2 = resolveLocalImport(specifier, inputDir);
|
|
14648
14774
|
if (!resolved2)
|
|
14649
14775
|
return null;
|
|
14650
|
-
const relativeImport =
|
|
14776
|
+
const relativeImport = relative13(targetDir, toOutputPath(resolved2)).replace(/\\/g, "/").replace(/\.js$/, "");
|
|
14651
14777
|
const relativeRewrite = relativeImport.startsWith(".") ? relativeImport : `./${relativeImport}`;
|
|
14652
14778
|
importRewrites.set(specifier, relativeRewrite);
|
|
14653
14779
|
return resolved2;
|
|
@@ -14686,7 +14812,7 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
14686
14812
|
return { clientPaths: [...emptyPaths], serverPaths: [...emptyPaths] };
|
|
14687
14813
|
}
|
|
14688
14814
|
const compiledRoot = compiledParent;
|
|
14689
|
-
const indexesDir =
|
|
14815
|
+
const indexesDir = join28(compiledParent, "indexes");
|
|
14690
14816
|
await traceAngularPhase("setup/create-indexes-dir", () => fs5.mkdir(indexesDir, { recursive: true }));
|
|
14691
14817
|
const aotOutputs = hmr ? [] : await traceAngularPhase("aot/compile-files", () => compileAngularFiles(entryPoints.map((entry) => resolve22(entry)), compiledRoot, stylePreprocessors), { entries: entryPoints.length });
|
|
14692
14818
|
if (!hmr) {
|
|
@@ -14700,9 +14826,9 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
14700
14826
|
absolute: false,
|
|
14701
14827
|
cwd: angularSrcDir
|
|
14702
14828
|
})) {
|
|
14703
|
-
const sourcePath =
|
|
14704
|
-
const cwdRel =
|
|
14705
|
-
const targetPath =
|
|
14829
|
+
const sourcePath = join28(angularSrcDir, rel);
|
|
14830
|
+
const cwdRel = relative13(cwd, sourcePath);
|
|
14831
|
+
const targetPath = join28(compiledRoot, cwdRel);
|
|
14706
14832
|
await fs5.mkdir(dirname15(targetPath), { recursive: true });
|
|
14707
14833
|
await fs5.copyFile(sourcePath, targetPath);
|
|
14708
14834
|
}
|
|
@@ -14711,17 +14837,17 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
14711
14837
|
const usesLegacyAngularAnimations = await traceAngularPhase("setup/legacy-animation-resolver", () => createLegacyAngularAnimationUsageResolver(outRoot));
|
|
14712
14838
|
const compileTasks = entryPoints.map(async (entry) => {
|
|
14713
14839
|
const resolvedEntry = resolve22(entry);
|
|
14714
|
-
const relativeEntry =
|
|
14840
|
+
const relativeEntry = relative13(outRoot, resolvedEntry).replace(/\.[tj]s$/, ".js");
|
|
14715
14841
|
const compileEntry = () => compileAngularFileJIT(resolvedEntry, compiledRoot, outRoot, stylePreprocessors);
|
|
14716
14842
|
let outputs = hmr ? await traceAngularPhase("jit/compile-entry", compileEntry, {
|
|
14717
14843
|
entry: resolvedEntry
|
|
14718
14844
|
}) : aotOutputs;
|
|
14719
|
-
const fileBase =
|
|
14845
|
+
const fileBase = basename8(resolvedEntry).replace(/\.[tj]s$/, "");
|
|
14720
14846
|
const jsName = `${fileBase}.js`;
|
|
14721
14847
|
const compiledFallbackPaths = [
|
|
14722
|
-
|
|
14723
|
-
|
|
14724
|
-
|
|
14848
|
+
join28(compiledRoot, relativeEntry),
|
|
14849
|
+
join28(compiledRoot, "pages", jsName),
|
|
14850
|
+
join28(compiledRoot, jsName)
|
|
14725
14851
|
].map((file3) => resolve22(file3));
|
|
14726
14852
|
const resolveRawServerFile = (candidatePaths) => {
|
|
14727
14853
|
const normalizedCandidates = [
|
|
@@ -14769,7 +14895,7 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
14769
14895
|
const usesLegacyAnimations = await traceAngularPhase("wrapper/detect-legacy-animations", () => usesLegacyAngularAnimations(resolvedEntry), { entry: resolvedEntry });
|
|
14770
14896
|
const serverContentHash = Bun.hash(original).toString(BASE_36_RADIX);
|
|
14771
14897
|
const cachedWrapper = wrapperOutputCache.get(resolvedEntry);
|
|
14772
|
-
const clientFile =
|
|
14898
|
+
const clientFile = join28(indexesDir, jsName);
|
|
14773
14899
|
if (hmr && cachedWrapper && cachedWrapper.serverHash === serverContentHash && existsSync21(clientFile) && (usesLegacyAnimations || !original.includes("__ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__")) && (!usesLegacyAnimations || original.includes("__ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__"))) {
|
|
14774
14900
|
return {
|
|
14775
14901
|
clientPath: clientFile,
|
|
@@ -14795,13 +14921,13 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
14795
14921
|
`;
|
|
14796
14922
|
}
|
|
14797
14923
|
await traceAngularPhase("wrapper/write-server-output", () => fs5.writeFile(rawServerFile, rewritten, "utf-8"), { entry: resolvedEntry });
|
|
14798
|
-
const relativePath =
|
|
14924
|
+
const relativePath = relative13(indexesDir, rawServerFile).replace(/\\/g, "/");
|
|
14799
14925
|
const normalizedImportPath = relativePath.startsWith(".") ? relativePath : `./${relativePath}`;
|
|
14800
14926
|
const manifestKeyForProviders = toPascal(fileBase);
|
|
14801
|
-
const providersFilePath =
|
|
14927
|
+
const providersFilePath = join28(compiledParent, "providers", `${manifestKeyForProviders}.providers.ts`);
|
|
14802
14928
|
const hasGeneratedProviders = existsSync21(providersFilePath);
|
|
14803
14929
|
const providersImportPath = hasGeneratedProviders ? (() => {
|
|
14804
|
-
const rel =
|
|
14930
|
+
const rel = relative13(indexesDir, providersFilePath.replace(/\.ts$/, "")).replace(/\\/g, "/");
|
|
14805
14931
|
return rel.startsWith(".") ? rel : `./${rel}`;
|
|
14806
14932
|
})() : null;
|
|
14807
14933
|
const generatedProvidersImport = providersImportPath ? `import { providers as generatedProviders } from '${providersImportPath}';` : "var generatedProviders = null;";
|
|
@@ -15005,24 +15131,24 @@ var init_compileAngular = __esm(() => {
|
|
|
15005
15131
|
init_stylePreprocessor();
|
|
15006
15132
|
init_generatedDir();
|
|
15007
15133
|
devClientDir4 = resolveDevClientDir4();
|
|
15008
|
-
hmrClientPath5 =
|
|
15134
|
+
hmrClientPath5 = join28(devClientDir4, "hmrClient.ts").replace(/\\/g, "/");
|
|
15009
15135
|
jitContentCache = new Map;
|
|
15010
15136
|
wrapperOutputCache = new Map;
|
|
15011
15137
|
});
|
|
15012
15138
|
|
|
15013
15139
|
// src/dev/angular/hmrImportGenerator.ts
|
|
15014
|
-
import
|
|
15140
|
+
import ts9 from "typescript";
|
|
15015
15141
|
var createHmrImportGenerator = (namespaceMap) => ({
|
|
15016
15142
|
addImport(request) {
|
|
15017
15143
|
const ns = namespaceMap.get(request.exportModuleSpecifier);
|
|
15018
15144
|
if (!ns) {
|
|
15019
15145
|
throw new Error(`HMR import generator has no namespace mapping for ${request.exportModuleSpecifier}. ` + `Add it to namespaceDependencies before calling compileHmrUpdateCallback.`);
|
|
15020
15146
|
}
|
|
15021
|
-
const namespaceId =
|
|
15147
|
+
const namespaceId = ts9.factory.createIdentifier(ns);
|
|
15022
15148
|
if (request.exportSymbolName === null) {
|
|
15023
15149
|
return namespaceId;
|
|
15024
15150
|
}
|
|
15025
|
-
return
|
|
15151
|
+
return ts9.factory.createPropertyAccessExpression(namespaceId, ts9.factory.createIdentifier(request.exportSymbolName));
|
|
15026
15152
|
}
|
|
15027
15153
|
});
|
|
15028
15154
|
var init_hmrImportGenerator = () => {};
|
|
@@ -15395,13 +15521,13 @@ var init_translator = __esm(() => {
|
|
|
15395
15521
|
});
|
|
15396
15522
|
|
|
15397
15523
|
// src/dev/angular/vendor/translator/ts_util.ts
|
|
15398
|
-
import
|
|
15524
|
+
import ts10 from "typescript";
|
|
15399
15525
|
function tsNumericExpression(value) {
|
|
15400
15526
|
if (value < 0) {
|
|
15401
|
-
const operand =
|
|
15402
|
-
return
|
|
15527
|
+
const operand = ts10.factory.createNumericLiteral(Math.abs(value));
|
|
15528
|
+
return ts10.factory.createPrefixUnaryExpression(ts10.SyntaxKind.MinusToken, operand);
|
|
15403
15529
|
}
|
|
15404
|
-
return
|
|
15530
|
+
return ts10.factory.createNumericLiteral(value);
|
|
15405
15531
|
}
|
|
15406
15532
|
var init_ts_util = __esm(() => {
|
|
15407
15533
|
/*!
|
|
@@ -15414,142 +15540,142 @@ var init_ts_util = __esm(() => {
|
|
|
15414
15540
|
});
|
|
15415
15541
|
|
|
15416
15542
|
// src/dev/angular/vendor/translator/typescript_ast_factory.ts
|
|
15417
|
-
import
|
|
15543
|
+
import ts11 from "typescript";
|
|
15418
15544
|
|
|
15419
15545
|
class TypeScriptAstFactory {
|
|
15420
15546
|
annotateForClosureCompiler;
|
|
15421
15547
|
externalSourceFiles = new Map;
|
|
15422
15548
|
UNARY_OPERATORS = /* @__PURE__ */ (() => ({
|
|
15423
|
-
"+":
|
|
15424
|
-
"-":
|
|
15425
|
-
"!":
|
|
15549
|
+
"+": ts11.SyntaxKind.PlusToken,
|
|
15550
|
+
"-": ts11.SyntaxKind.MinusToken,
|
|
15551
|
+
"!": ts11.SyntaxKind.ExclamationToken
|
|
15426
15552
|
}))();
|
|
15427
15553
|
BINARY_OPERATORS = /* @__PURE__ */ (() => ({
|
|
15428
|
-
"&&":
|
|
15429
|
-
">":
|
|
15430
|
-
">=":
|
|
15431
|
-
"&":
|
|
15432
|
-
"|":
|
|
15433
|
-
"/":
|
|
15434
|
-
"==":
|
|
15435
|
-
"===":
|
|
15436
|
-
"<":
|
|
15437
|
-
"<=":
|
|
15438
|
-
"-":
|
|
15439
|
-
"%":
|
|
15440
|
-
"*":
|
|
15441
|
-
"**":
|
|
15442
|
-
"!=":
|
|
15443
|
-
"!==":
|
|
15444
|
-
"||":
|
|
15445
|
-
"+":
|
|
15446
|
-
"??":
|
|
15447
|
-
"=":
|
|
15448
|
-
"+=":
|
|
15449
|
-
"-=":
|
|
15450
|
-
"*=":
|
|
15451
|
-
"/=":
|
|
15452
|
-
"%=":
|
|
15453
|
-
"**=":
|
|
15454
|
-
"&&=":
|
|
15455
|
-
"||=":
|
|
15456
|
-
"??=":
|
|
15457
|
-
in:
|
|
15458
|
-
instanceof:
|
|
15554
|
+
"&&": ts11.SyntaxKind.AmpersandAmpersandToken,
|
|
15555
|
+
">": ts11.SyntaxKind.GreaterThanToken,
|
|
15556
|
+
">=": ts11.SyntaxKind.GreaterThanEqualsToken,
|
|
15557
|
+
"&": ts11.SyntaxKind.AmpersandToken,
|
|
15558
|
+
"|": ts11.SyntaxKind.BarToken,
|
|
15559
|
+
"/": ts11.SyntaxKind.SlashToken,
|
|
15560
|
+
"==": ts11.SyntaxKind.EqualsEqualsToken,
|
|
15561
|
+
"===": ts11.SyntaxKind.EqualsEqualsEqualsToken,
|
|
15562
|
+
"<": ts11.SyntaxKind.LessThanToken,
|
|
15563
|
+
"<=": ts11.SyntaxKind.LessThanEqualsToken,
|
|
15564
|
+
"-": ts11.SyntaxKind.MinusToken,
|
|
15565
|
+
"%": ts11.SyntaxKind.PercentToken,
|
|
15566
|
+
"*": ts11.SyntaxKind.AsteriskToken,
|
|
15567
|
+
"**": ts11.SyntaxKind.AsteriskAsteriskToken,
|
|
15568
|
+
"!=": ts11.SyntaxKind.ExclamationEqualsToken,
|
|
15569
|
+
"!==": ts11.SyntaxKind.ExclamationEqualsEqualsToken,
|
|
15570
|
+
"||": ts11.SyntaxKind.BarBarToken,
|
|
15571
|
+
"+": ts11.SyntaxKind.PlusToken,
|
|
15572
|
+
"??": ts11.SyntaxKind.QuestionQuestionToken,
|
|
15573
|
+
"=": ts11.SyntaxKind.EqualsToken,
|
|
15574
|
+
"+=": ts11.SyntaxKind.PlusEqualsToken,
|
|
15575
|
+
"-=": ts11.SyntaxKind.MinusEqualsToken,
|
|
15576
|
+
"*=": ts11.SyntaxKind.AsteriskEqualsToken,
|
|
15577
|
+
"/=": ts11.SyntaxKind.SlashEqualsToken,
|
|
15578
|
+
"%=": ts11.SyntaxKind.PercentEqualsToken,
|
|
15579
|
+
"**=": ts11.SyntaxKind.AsteriskAsteriskEqualsToken,
|
|
15580
|
+
"&&=": ts11.SyntaxKind.AmpersandAmpersandEqualsToken,
|
|
15581
|
+
"||=": ts11.SyntaxKind.BarBarEqualsToken,
|
|
15582
|
+
"??=": ts11.SyntaxKind.QuestionQuestionEqualsToken,
|
|
15583
|
+
in: ts11.SyntaxKind.InKeyword,
|
|
15584
|
+
instanceof: ts11.SyntaxKind.InstanceOfKeyword
|
|
15459
15585
|
}))();
|
|
15460
15586
|
VAR_TYPES = /* @__PURE__ */ (() => ({
|
|
15461
|
-
const:
|
|
15462
|
-
let:
|
|
15463
|
-
var:
|
|
15587
|
+
const: ts11.NodeFlags.Const,
|
|
15588
|
+
let: ts11.NodeFlags.Let,
|
|
15589
|
+
var: ts11.NodeFlags.None
|
|
15464
15590
|
}))();
|
|
15465
15591
|
constructor(annotateForClosureCompiler) {
|
|
15466
15592
|
this.annotateForClosureCompiler = annotateForClosureCompiler;
|
|
15467
15593
|
}
|
|
15468
15594
|
attachComments = attachComments;
|
|
15469
|
-
createArrayLiteral =
|
|
15595
|
+
createArrayLiteral = ts11.factory.createArrayLiteralExpression;
|
|
15470
15596
|
createAssignment(target, operator, value) {
|
|
15471
|
-
return
|
|
15597
|
+
return ts11.factory.createBinaryExpression(target, this.BINARY_OPERATORS[operator], value);
|
|
15472
15598
|
}
|
|
15473
15599
|
createBinaryExpression(leftOperand, operator, rightOperand) {
|
|
15474
|
-
return
|
|
15600
|
+
return ts11.factory.createBinaryExpression(leftOperand, this.BINARY_OPERATORS[operator], rightOperand);
|
|
15475
15601
|
}
|
|
15476
15602
|
createBlock(body) {
|
|
15477
|
-
return
|
|
15603
|
+
return ts11.factory.createBlock(body);
|
|
15478
15604
|
}
|
|
15479
15605
|
createCallExpression(callee, args, pure) {
|
|
15480
|
-
const call =
|
|
15606
|
+
const call = ts11.factory.createCallExpression(callee, undefined, args);
|
|
15481
15607
|
if (pure) {
|
|
15482
|
-
|
|
15608
|
+
ts11.addSyntheticLeadingComment(call, ts11.SyntaxKind.MultiLineCommentTrivia, this.annotateForClosureCompiler ? "* @pureOrBreakMyCode " /* CLOSURE */ : "@__PURE__" /* TERSER */, false);
|
|
15483
15609
|
}
|
|
15484
15610
|
return call;
|
|
15485
15611
|
}
|
|
15486
15612
|
createConditional(condition, whenTrue, whenFalse) {
|
|
15487
|
-
return
|
|
15613
|
+
return ts11.factory.createConditionalExpression(condition, undefined, whenTrue, undefined, whenFalse);
|
|
15488
15614
|
}
|
|
15489
|
-
createElementAccess =
|
|
15490
|
-
createExpressionStatement =
|
|
15615
|
+
createElementAccess = ts11.factory.createElementAccessExpression;
|
|
15616
|
+
createExpressionStatement = ts11.factory.createExpressionStatement;
|
|
15491
15617
|
createDynamicImport(url) {
|
|
15492
|
-
return
|
|
15493
|
-
typeof url === "string" ?
|
|
15618
|
+
return ts11.factory.createCallExpression(ts11.factory.createToken(ts11.SyntaxKind.ImportKeyword), undefined, [
|
|
15619
|
+
typeof url === "string" ? ts11.factory.createStringLiteral(url) : url
|
|
15494
15620
|
]);
|
|
15495
15621
|
}
|
|
15496
15622
|
createFunctionDeclaration(functionName, parameters, body) {
|
|
15497
|
-
if (!
|
|
15498
|
-
throw new Error(`Invalid syntax, expected a block, but got ${
|
|
15623
|
+
if (!ts11.isBlock(body)) {
|
|
15624
|
+
throw new Error(`Invalid syntax, expected a block, but got ${ts11.SyntaxKind[body.kind]}.`);
|
|
15499
15625
|
}
|
|
15500
|
-
return
|
|
15626
|
+
return ts11.factory.createFunctionDeclaration(undefined, undefined, functionName, undefined, parameters.map((param) => this.createParameter(param)), undefined, body);
|
|
15501
15627
|
}
|
|
15502
15628
|
createFunctionExpression(functionName, parameters, body) {
|
|
15503
|
-
if (!
|
|
15504
|
-
throw new Error(`Invalid syntax, expected a block, but got ${
|
|
15629
|
+
if (!ts11.isBlock(body)) {
|
|
15630
|
+
throw new Error(`Invalid syntax, expected a block, but got ${ts11.SyntaxKind[body.kind]}.`);
|
|
15505
15631
|
}
|
|
15506
|
-
return
|
|
15632
|
+
return ts11.factory.createFunctionExpression(undefined, undefined, functionName ?? undefined, undefined, parameters.map((param) => this.createParameter(param)), undefined, body);
|
|
15507
15633
|
}
|
|
15508
15634
|
createArrowFunctionExpression(parameters, body) {
|
|
15509
|
-
if (
|
|
15510
|
-
throw new Error(`Invalid syntax, expected a block, but got ${
|
|
15635
|
+
if (ts11.isStatement(body) && !ts11.isBlock(body)) {
|
|
15636
|
+
throw new Error(`Invalid syntax, expected a block, but got ${ts11.SyntaxKind[body.kind]}.`);
|
|
15511
15637
|
}
|
|
15512
|
-
return
|
|
15638
|
+
return ts11.factory.createArrowFunction(undefined, undefined, parameters.map((param) => this.createParameter(param)), undefined, undefined, body);
|
|
15513
15639
|
}
|
|
15514
15640
|
createParameter(param) {
|
|
15515
|
-
return
|
|
15641
|
+
return ts11.factory.createParameterDeclaration(undefined, undefined, param.name, undefined, param.type ?? undefined);
|
|
15516
15642
|
}
|
|
15517
|
-
createIdentifier =
|
|
15643
|
+
createIdentifier = ts11.factory.createIdentifier;
|
|
15518
15644
|
createIfStatement(condition, thenStatement, elseStatement) {
|
|
15519
|
-
return
|
|
15645
|
+
return ts11.factory.createIfStatement(condition, thenStatement, elseStatement ?? undefined);
|
|
15520
15646
|
}
|
|
15521
15647
|
createLiteral(value) {
|
|
15522
15648
|
if (value === undefined) {
|
|
15523
|
-
return
|
|
15649
|
+
return ts11.factory.createIdentifier("undefined");
|
|
15524
15650
|
} else if (value === null) {
|
|
15525
|
-
return
|
|
15651
|
+
return ts11.factory.createNull();
|
|
15526
15652
|
} else if (typeof value === "boolean") {
|
|
15527
|
-
return value ?
|
|
15653
|
+
return value ? ts11.factory.createTrue() : ts11.factory.createFalse();
|
|
15528
15654
|
} else if (typeof value === "number") {
|
|
15529
15655
|
return tsNumericExpression(value);
|
|
15530
15656
|
} else {
|
|
15531
|
-
return
|
|
15657
|
+
return ts11.factory.createStringLiteral(value);
|
|
15532
15658
|
}
|
|
15533
15659
|
}
|
|
15534
15660
|
createNewExpression(expression, args) {
|
|
15535
|
-
return
|
|
15661
|
+
return ts11.factory.createNewExpression(expression, undefined, args);
|
|
15536
15662
|
}
|
|
15537
15663
|
createObjectLiteral(properties) {
|
|
15538
|
-
return
|
|
15664
|
+
return ts11.factory.createObjectLiteralExpression(properties.map((prop) => {
|
|
15539
15665
|
if (prop.kind === "spread") {
|
|
15540
|
-
return
|
|
15666
|
+
return ts11.factory.createSpreadAssignment(prop.expression);
|
|
15541
15667
|
}
|
|
15542
|
-
return
|
|
15668
|
+
return ts11.factory.createPropertyAssignment(prop.quoted ? ts11.factory.createStringLiteral(prop.propertyName) : ts11.factory.createIdentifier(prop.propertyName), prop.value);
|
|
15543
15669
|
}));
|
|
15544
15670
|
}
|
|
15545
|
-
createParenthesizedExpression =
|
|
15546
|
-
createPropertyAccess =
|
|
15547
|
-
createSpreadElement =
|
|
15671
|
+
createParenthesizedExpression = ts11.factory.createParenthesizedExpression;
|
|
15672
|
+
createPropertyAccess = ts11.factory.createPropertyAccessExpression;
|
|
15673
|
+
createSpreadElement = ts11.factory.createSpreadElement;
|
|
15548
15674
|
createReturnStatement(expression) {
|
|
15549
|
-
return
|
|
15675
|
+
return ts11.factory.createReturnStatement(expression ?? undefined);
|
|
15550
15676
|
}
|
|
15551
15677
|
createTaggedTemplate(tag, template) {
|
|
15552
|
-
return
|
|
15678
|
+
return ts11.factory.createTaggedTemplateExpression(tag, undefined, this.createTemplateLiteral(template));
|
|
15553
15679
|
}
|
|
15554
15680
|
createTemplateLiteral(template) {
|
|
15555
15681
|
let templateLiteral;
|
|
@@ -15559,7 +15685,7 @@ class TypeScriptAstFactory {
|
|
|
15559
15685
|
throw new Error("createTemplateLiteral: template has no elements");
|
|
15560
15686
|
}
|
|
15561
15687
|
if (length === 1) {
|
|
15562
|
-
templateLiteral =
|
|
15688
|
+
templateLiteral = ts11.factory.createNoSubstitutionTemplateLiteral(head.cooked, head.raw);
|
|
15563
15689
|
} else {
|
|
15564
15690
|
const spans = [];
|
|
15565
15691
|
for (let i = 1;i < length - 1; i++) {
|
|
@@ -15573,7 +15699,7 @@ class TypeScriptAstFactory {
|
|
|
15573
15699
|
if (range !== null) {
|
|
15574
15700
|
this.setSourceMapRange(middle, range);
|
|
15575
15701
|
}
|
|
15576
|
-
spans.push(
|
|
15702
|
+
spans.push(ts11.factory.createTemplateSpan(expression, middle));
|
|
15577
15703
|
}
|
|
15578
15704
|
const resolvedExpression = template.expressions[length - 2];
|
|
15579
15705
|
const templatePart = template.elements[length - 1];
|
|
@@ -15584,27 +15710,27 @@ class TypeScriptAstFactory {
|
|
|
15584
15710
|
if (templatePart.range !== null) {
|
|
15585
15711
|
this.setSourceMapRange(templateTail, templatePart.range);
|
|
15586
15712
|
}
|
|
15587
|
-
spans.push(
|
|
15588
|
-
templateLiteral =
|
|
15713
|
+
spans.push(ts11.factory.createTemplateSpan(resolvedExpression, templateTail));
|
|
15714
|
+
templateLiteral = ts11.factory.createTemplateExpression(ts11.factory.createTemplateHead(head.cooked, head.raw), spans);
|
|
15589
15715
|
}
|
|
15590
15716
|
if (head.range !== null) {
|
|
15591
15717
|
this.setSourceMapRange(templateLiteral, head.range);
|
|
15592
15718
|
}
|
|
15593
15719
|
return templateLiteral;
|
|
15594
15720
|
}
|
|
15595
|
-
createThrowStatement =
|
|
15596
|
-
createTypeOfExpression =
|
|
15597
|
-
createVoidExpression =
|
|
15721
|
+
createThrowStatement = ts11.factory.createThrowStatement;
|
|
15722
|
+
createTypeOfExpression = ts11.factory.createTypeOfExpression;
|
|
15723
|
+
createVoidExpression = ts11.factory.createVoidExpression;
|
|
15598
15724
|
createUnaryExpression(operator, operand) {
|
|
15599
|
-
return
|
|
15725
|
+
return ts11.factory.createPrefixUnaryExpression(this.UNARY_OPERATORS[operator], operand);
|
|
15600
15726
|
}
|
|
15601
15727
|
createVariableDeclaration(variableName, initializer, variableType, type) {
|
|
15602
|
-
return
|
|
15603
|
-
|
|
15728
|
+
return ts11.factory.createVariableStatement(undefined, ts11.factory.createVariableDeclarationList([
|
|
15729
|
+
ts11.factory.createVariableDeclaration(variableName, undefined, type ?? undefined, initializer ?? undefined)
|
|
15604
15730
|
], this.VAR_TYPES[variableType]));
|
|
15605
15731
|
}
|
|
15606
15732
|
createRegularExpressionLiteral(body, flags) {
|
|
15607
|
-
return
|
|
15733
|
+
return ts11.factory.createRegularExpressionLiteral(`/${body}/${flags ?? ""}`);
|
|
15608
15734
|
}
|
|
15609
15735
|
setSourceMapRange(node, sourceMapRange) {
|
|
15610
15736
|
if (sourceMapRange === null) {
|
|
@@ -15612,10 +15738,10 @@ class TypeScriptAstFactory {
|
|
|
15612
15738
|
}
|
|
15613
15739
|
const url = sourceMapRange.url;
|
|
15614
15740
|
if (!this.externalSourceFiles.has(url)) {
|
|
15615
|
-
this.externalSourceFiles.set(url,
|
|
15741
|
+
this.externalSourceFiles.set(url, ts11.createSourceMapSource(url, sourceMapRange.content, (pos) => pos));
|
|
15616
15742
|
}
|
|
15617
15743
|
const source = this.externalSourceFiles.get(url);
|
|
15618
|
-
|
|
15744
|
+
ts11.setSourceMapRange(node, {
|
|
15619
15745
|
pos: sourceMapRange.start.offset,
|
|
15620
15746
|
end: sourceMapRange.end.offset,
|
|
15621
15747
|
source
|
|
@@ -15625,77 +15751,77 @@ class TypeScriptAstFactory {
|
|
|
15625
15751
|
createBuiltInType(type) {
|
|
15626
15752
|
switch (type) {
|
|
15627
15753
|
case "any":
|
|
15628
|
-
return
|
|
15754
|
+
return ts11.factory.createKeywordTypeNode(ts11.SyntaxKind.AnyKeyword);
|
|
15629
15755
|
case "boolean":
|
|
15630
|
-
return
|
|
15756
|
+
return ts11.factory.createKeywordTypeNode(ts11.SyntaxKind.BooleanKeyword);
|
|
15631
15757
|
case "number":
|
|
15632
|
-
return
|
|
15758
|
+
return ts11.factory.createKeywordTypeNode(ts11.SyntaxKind.NumberKeyword);
|
|
15633
15759
|
case "string":
|
|
15634
|
-
return
|
|
15760
|
+
return ts11.factory.createKeywordTypeNode(ts11.SyntaxKind.StringKeyword);
|
|
15635
15761
|
case "function":
|
|
15636
|
-
return
|
|
15762
|
+
return ts11.factory.createTypeReferenceNode(ts11.factory.createIdentifier("Function"));
|
|
15637
15763
|
case "never":
|
|
15638
|
-
return
|
|
15764
|
+
return ts11.factory.createKeywordTypeNode(ts11.SyntaxKind.NeverKeyword);
|
|
15639
15765
|
case "unknown":
|
|
15640
|
-
return
|
|
15766
|
+
return ts11.factory.createKeywordTypeNode(ts11.SyntaxKind.UnknownKeyword);
|
|
15641
15767
|
}
|
|
15642
15768
|
}
|
|
15643
15769
|
createExpressionType(expression, typeParams) {
|
|
15644
15770
|
const typeName = getEntityTypeFromExpression(expression);
|
|
15645
|
-
return
|
|
15771
|
+
return ts11.factory.createTypeReferenceNode(typeName, typeParams ?? undefined);
|
|
15646
15772
|
}
|
|
15647
15773
|
createArrayType(elementType) {
|
|
15648
|
-
return
|
|
15774
|
+
return ts11.factory.createArrayTypeNode(elementType);
|
|
15649
15775
|
}
|
|
15650
15776
|
createMapType(valueType) {
|
|
15651
|
-
return
|
|
15652
|
-
|
|
15653
|
-
|
|
15777
|
+
return ts11.factory.createTypeLiteralNode([
|
|
15778
|
+
ts11.factory.createIndexSignature(undefined, [
|
|
15779
|
+
ts11.factory.createParameterDeclaration(undefined, undefined, "key", undefined, ts11.factory.createKeywordTypeNode(ts11.SyntaxKind.StringKeyword))
|
|
15654
15780
|
], valueType)
|
|
15655
15781
|
]);
|
|
15656
15782
|
}
|
|
15657
15783
|
transplantType(type) {
|
|
15658
|
-
if (typeof type.kind === "number" && typeof type.getSourceFile === "function" &&
|
|
15784
|
+
if (typeof type.kind === "number" && typeof type.getSourceFile === "function" && ts11.isTypeNode(type)) {
|
|
15659
15785
|
return type;
|
|
15660
15786
|
}
|
|
15661
15787
|
throw new Error("Attempting to transplant a type node from a non-TypeScript AST: " + type);
|
|
15662
15788
|
}
|
|
15663
15789
|
}
|
|
15664
15790
|
function createTemplateMiddle(cooked, raw) {
|
|
15665
|
-
const node =
|
|
15666
|
-
node.kind =
|
|
15791
|
+
const node = ts11.factory.createTemplateHead(cooked, raw);
|
|
15792
|
+
node.kind = ts11.SyntaxKind.TemplateMiddle;
|
|
15667
15793
|
return node;
|
|
15668
15794
|
}
|
|
15669
15795
|
function createTemplateTail(cooked, raw) {
|
|
15670
|
-
const node =
|
|
15671
|
-
node.kind =
|
|
15796
|
+
const node = ts11.factory.createTemplateHead(cooked, raw);
|
|
15797
|
+
node.kind = ts11.SyntaxKind.TemplateTail;
|
|
15672
15798
|
return node;
|
|
15673
15799
|
}
|
|
15674
15800
|
function attachComments(statement, leadingComments) {
|
|
15675
15801
|
for (const comment of leadingComments) {
|
|
15676
|
-
const commentKind = comment.multiline ?
|
|
15802
|
+
const commentKind = comment.multiline ? ts11.SyntaxKind.MultiLineCommentTrivia : ts11.SyntaxKind.SingleLineCommentTrivia;
|
|
15677
15803
|
if (comment.multiline) {
|
|
15678
|
-
|
|
15804
|
+
ts11.addSyntheticLeadingComment(statement, commentKind, comment.toString(), comment.trailingNewline);
|
|
15679
15805
|
} else {
|
|
15680
15806
|
for (const line of comment.toString().split(`
|
|
15681
15807
|
`)) {
|
|
15682
|
-
|
|
15808
|
+
ts11.addSyntheticLeadingComment(statement, commentKind, line, comment.trailingNewline);
|
|
15683
15809
|
}
|
|
15684
15810
|
}
|
|
15685
15811
|
}
|
|
15686
15812
|
}
|
|
15687
15813
|
function getEntityTypeFromExpression(expression) {
|
|
15688
|
-
if (
|
|
15814
|
+
if (ts11.isIdentifier(expression)) {
|
|
15689
15815
|
return expression;
|
|
15690
15816
|
}
|
|
15691
|
-
if (
|
|
15817
|
+
if (ts11.isPropertyAccessExpression(expression)) {
|
|
15692
15818
|
const left = getEntityTypeFromExpression(expression.expression);
|
|
15693
|
-
if (!
|
|
15819
|
+
if (!ts11.isIdentifier(expression.name)) {
|
|
15694
15820
|
throw new Error(`Unsupported property access for type reference: ${expression.name.text}`);
|
|
15695
15821
|
}
|
|
15696
|
-
return
|
|
15822
|
+
return ts11.factory.createQualifiedName(left, expression.name);
|
|
15697
15823
|
}
|
|
15698
|
-
throw new Error(`Unsupported expression for type reference: ${
|
|
15824
|
+
throw new Error(`Unsupported expression for type reference: ${ts11.SyntaxKind[expression.kind]}`);
|
|
15699
15825
|
}
|
|
15700
15826
|
var init_typescript_ast_factory = __esm(() => {
|
|
15701
15827
|
init_ts_util();
|
|
@@ -15728,9 +15854,9 @@ __export(exports_fastHmrCompiler, {
|
|
|
15728
15854
|
primeComponentFingerprint: () => primeComponentFingerprint,
|
|
15729
15855
|
invalidateFingerprintCache: () => invalidateFingerprintCache
|
|
15730
15856
|
});
|
|
15731
|
-
import { existsSync as existsSync22, readFileSync as
|
|
15732
|
-
import { dirname as dirname16, extname as extname6, relative as
|
|
15733
|
-
import
|
|
15857
|
+
import { existsSync as existsSync22, readFileSync as readFileSync16, statSync as statSync2 } from "fs";
|
|
15858
|
+
import { dirname as dirname16, extname as extname6, relative as relative14, resolve as resolve23 } from "path";
|
|
15859
|
+
import ts12 from "typescript";
|
|
15734
15860
|
var fail = (reason, detail, location) => ({
|
|
15735
15861
|
ok: false,
|
|
15736
15862
|
reason,
|
|
@@ -15814,23 +15940,23 @@ var fail = (reason, detail, location) => ({
|
|
|
15814
15940
|
}
|
|
15815
15941
|
let sourceFile;
|
|
15816
15942
|
try {
|
|
15817
|
-
sourceFile =
|
|
15943
|
+
sourceFile = ts12.createSourceFile(componentFilePath, source, ts12.ScriptTarget.Latest, true, ts12.ScriptKind.TS);
|
|
15818
15944
|
} catch {
|
|
15819
15945
|
return;
|
|
15820
15946
|
}
|
|
15821
15947
|
for (const stmt of sourceFile.statements) {
|
|
15822
|
-
if (!
|
|
15948
|
+
if (!ts12.isClassDeclaration(stmt))
|
|
15823
15949
|
continue;
|
|
15824
15950
|
const className = stmt.name?.text;
|
|
15825
15951
|
if (!className)
|
|
15826
15952
|
continue;
|
|
15827
|
-
const decorators =
|
|
15953
|
+
const decorators = ts12.getDecorators(stmt) ?? [];
|
|
15828
15954
|
const decoratorName = (() => {
|
|
15829
15955
|
for (const d2 of decorators) {
|
|
15830
|
-
if (!
|
|
15956
|
+
if (!ts12.isCallExpression(d2.expression))
|
|
15831
15957
|
continue;
|
|
15832
15958
|
const expr = d2.expression.expression;
|
|
15833
|
-
if (!
|
|
15959
|
+
if (!ts12.isIdentifier(expr))
|
|
15834
15960
|
continue;
|
|
15835
15961
|
if (expr.text === "Component" || expr.text === "Directive" || expr.text === "Pipe" || expr.text === "Injectable") {
|
|
15836
15962
|
return expr.text;
|
|
@@ -15840,20 +15966,20 @@ var fail = (reason, detail, location) => ({
|
|
|
15840
15966
|
})();
|
|
15841
15967
|
if (!decoratorName)
|
|
15842
15968
|
continue;
|
|
15843
|
-
const projectRel =
|
|
15969
|
+
const projectRel = relative14(process.cwd(), componentFilePath).replace(/\\/g, "/");
|
|
15844
15970
|
const id = encodeURIComponent(`${projectRel}@${className}`);
|
|
15845
15971
|
if (decoratorName === "Component") {
|
|
15846
15972
|
const componentDecorator = decorators.find((d2) => {
|
|
15847
|
-
if (!
|
|
15973
|
+
if (!ts12.isCallExpression(d2.expression))
|
|
15848
15974
|
return false;
|
|
15849
15975
|
const expr = d2.expression.expression;
|
|
15850
|
-
return
|
|
15976
|
+
return ts12.isIdentifier(expr) && expr.text === "Component";
|
|
15851
15977
|
});
|
|
15852
15978
|
if (!componentDecorator)
|
|
15853
15979
|
continue;
|
|
15854
15980
|
const decoratorCall = componentDecorator.expression;
|
|
15855
15981
|
const args = decoratorCall.arguments[0];
|
|
15856
|
-
if (!args || !
|
|
15982
|
+
if (!args || !ts12.isObjectLiteralExpression(args))
|
|
15857
15983
|
continue;
|
|
15858
15984
|
const decoratorMeta = readDecoratorMeta(args);
|
|
15859
15985
|
const { inputs, outputs } = extractInputsAndOutputs(stmt, null);
|
|
@@ -15887,11 +16013,11 @@ var fail = (reason, detail, location) => ({
|
|
|
15887
16013
|
return false;
|
|
15888
16014
|
return true;
|
|
15889
16015
|
}, ENTITY_DECORATOR_NAMES, findEntityDecorator = (cls) => {
|
|
15890
|
-
for (const dec of
|
|
16016
|
+
for (const dec of ts12.getDecorators(cls) ?? []) {
|
|
15891
16017
|
const expr = dec.expression;
|
|
15892
|
-
if (!
|
|
16018
|
+
if (!ts12.isCallExpression(expr))
|
|
15893
16019
|
continue;
|
|
15894
|
-
if (!
|
|
16020
|
+
if (!ts12.isIdentifier(expr.expression))
|
|
15895
16021
|
continue;
|
|
15896
16022
|
if (ENTITY_DECORATOR_NAMES.has(expr.expression.text))
|
|
15897
16023
|
return dec;
|
|
@@ -15909,18 +16035,18 @@ var fail = (reason, detail, location) => ({
|
|
|
15909
16035
|
}
|
|
15910
16036
|
const ctorParamTypes = [];
|
|
15911
16037
|
for (const member of cls.members) {
|
|
15912
|
-
if (!
|
|
16038
|
+
if (!ts12.isConstructorDeclaration(member))
|
|
15913
16039
|
continue;
|
|
15914
16040
|
for (const param of member.parameters) {
|
|
15915
16041
|
const typeText = param.type ? param.type.getText() : "";
|
|
15916
|
-
const decorators =
|
|
16042
|
+
const decorators = ts12.getDecorators(param) ?? [];
|
|
15917
16043
|
const decoratorSig = decorators.length === 0 ? "" : decorators.map((d2) => {
|
|
15918
16044
|
const e = d2.expression;
|
|
15919
|
-
if (
|
|
16045
|
+
if (ts12.isCallExpression(e) && ts12.isIdentifier(e.expression)) {
|
|
15920
16046
|
const args = e.arguments.map((a) => a.getText()).join(",");
|
|
15921
16047
|
return `@${e.expression.text}(${args})`;
|
|
15922
16048
|
}
|
|
15923
|
-
if (
|
|
16049
|
+
if (ts12.isIdentifier(e))
|
|
15924
16050
|
return `@${e.text}`;
|
|
15925
16051
|
return "@<unknown>";
|
|
15926
16052
|
}).join("");
|
|
@@ -15942,23 +16068,23 @@ var fail = (reason, detail, location) => ({
|
|
|
15942
16068
|
const walk = (node) => {
|
|
15943
16069
|
if (found)
|
|
15944
16070
|
return;
|
|
15945
|
-
if (
|
|
16071
|
+
if (ts12.isClassDeclaration(node) && node.name?.text === className) {
|
|
15946
16072
|
found = node;
|
|
15947
16073
|
return;
|
|
15948
16074
|
}
|
|
15949
|
-
|
|
16075
|
+
ts12.forEachChild(node, walk);
|
|
15950
16076
|
};
|
|
15951
16077
|
walk(sourceFile);
|
|
15952
16078
|
return found;
|
|
15953
16079
|
}, getClassDecorators = (cls) => {
|
|
15954
|
-
const modifiers =
|
|
16080
|
+
const modifiers = ts12.getDecorators(cls) ?? [];
|
|
15955
16081
|
return [...modifiers];
|
|
15956
16082
|
}, findComponentDecorator = (cls) => {
|
|
15957
16083
|
for (const decorator of getClassDecorators(cls)) {
|
|
15958
16084
|
const expr = decorator.expression;
|
|
15959
|
-
if (
|
|
16085
|
+
if (ts12.isCallExpression(expr)) {
|
|
15960
16086
|
const fn2 = expr.expression;
|
|
15961
|
-
if (
|
|
16087
|
+
if (ts12.isIdentifier(fn2) && fn2.text === "Component") {
|
|
15962
16088
|
return decorator;
|
|
15963
16089
|
}
|
|
15964
16090
|
}
|
|
@@ -15966,15 +16092,15 @@ var fail = (reason, detail, location) => ({
|
|
|
15966
16092
|
return null;
|
|
15967
16093
|
}, getDecoratorArgsObject = (decorator) => {
|
|
15968
16094
|
const call = decorator.expression;
|
|
15969
|
-
if (!
|
|
16095
|
+
if (!ts12.isCallExpression(call))
|
|
15970
16096
|
return null;
|
|
15971
16097
|
const arg = call.arguments[0];
|
|
15972
|
-
if (!arg || !
|
|
16098
|
+
if (!arg || !ts12.isObjectLiteralExpression(arg))
|
|
15973
16099
|
return null;
|
|
15974
16100
|
return arg;
|
|
15975
16101
|
}, getProperty = (obj, name) => {
|
|
15976
16102
|
for (const prop of obj.properties) {
|
|
15977
|
-
if (
|
|
16103
|
+
if (ts12.isPropertyAssignment(prop) && (ts12.isIdentifier(prop.name) && prop.name.text === name || ts12.isStringLiteral(prop.name) && prop.name.text === name)) {
|
|
15978
16104
|
return prop.initializer;
|
|
15979
16105
|
}
|
|
15980
16106
|
}
|
|
@@ -15983,7 +16109,7 @@ var fail = (reason, detail, location) => ({
|
|
|
15983
16109
|
const expr = getProperty(obj, name);
|
|
15984
16110
|
if (!expr)
|
|
15985
16111
|
return null;
|
|
15986
|
-
if (
|
|
16112
|
+
if (ts12.isStringLiteral(expr) || ts12.isNoSubstitutionTemplateLiteral(expr)) {
|
|
15987
16113
|
return expr.text;
|
|
15988
16114
|
}
|
|
15989
16115
|
return null;
|
|
@@ -15991,22 +16117,22 @@ var fail = (reason, detail, location) => ({
|
|
|
15991
16117
|
const expr = getProperty(obj, name);
|
|
15992
16118
|
if (!expr)
|
|
15993
16119
|
return null;
|
|
15994
|
-
if (expr.kind ===
|
|
16120
|
+
if (expr.kind === ts12.SyntaxKind.TrueKeyword)
|
|
15995
16121
|
return true;
|
|
15996
|
-
if (expr.kind ===
|
|
16122
|
+
if (expr.kind === ts12.SyntaxKind.FalseKeyword)
|
|
15997
16123
|
return false;
|
|
15998
16124
|
return null;
|
|
15999
16125
|
}, isAngularDecoratorIdentifier = (name) => name === "Component" || name === "Directive" || name === "Pipe" || name === "Injectable", classHasAngularDecorator = (cls) => {
|
|
16000
|
-
for (const dec of
|
|
16126
|
+
for (const dec of ts12.getDecorators(cls) ?? []) {
|
|
16001
16127
|
const expr = dec.expression;
|
|
16002
|
-
if (
|
|
16128
|
+
if (ts12.isCallExpression(expr) && ts12.isIdentifier(expr.expression) && isAngularDecoratorIdentifier(expr.expression.text)) {
|
|
16003
16129
|
return true;
|
|
16004
16130
|
}
|
|
16005
16131
|
}
|
|
16006
16132
|
return false;
|
|
16007
16133
|
}, findClassInSourceFile = (sf, className) => {
|
|
16008
16134
|
for (const stmt of sf.statements) {
|
|
16009
|
-
if (
|
|
16135
|
+
if (ts12.isClassDeclaration(stmt) && stmt.name?.text === className) {
|
|
16010
16136
|
return stmt;
|
|
16011
16137
|
}
|
|
16012
16138
|
}
|
|
@@ -16016,15 +16142,15 @@ var fail = (reason, detail, location) => ({
|
|
|
16016
16142
|
if (sameFile)
|
|
16017
16143
|
return classHasAngularDecorator(sameFile);
|
|
16018
16144
|
for (const stmt of sourceFile.statements) {
|
|
16019
|
-
if (!
|
|
16145
|
+
if (!ts12.isImportDeclaration(stmt))
|
|
16020
16146
|
continue;
|
|
16021
|
-
if (!
|
|
16147
|
+
if (!ts12.isStringLiteral(stmt.moduleSpecifier))
|
|
16022
16148
|
continue;
|
|
16023
16149
|
const clause = stmt.importClause;
|
|
16024
16150
|
if (!clause || clause.isTypeOnly)
|
|
16025
16151
|
continue;
|
|
16026
16152
|
const named = clause.namedBindings;
|
|
16027
|
-
if (!named || !
|
|
16153
|
+
if (!named || !ts12.isNamedImports(named))
|
|
16028
16154
|
continue;
|
|
16029
16155
|
const found = named.elements.find((el) => el.name.text === parentClassName);
|
|
16030
16156
|
if (!found)
|
|
@@ -16045,11 +16171,11 @@ var fail = (reason, detail, location) => ({
|
|
|
16045
16171
|
continue;
|
|
16046
16172
|
let content;
|
|
16047
16173
|
try {
|
|
16048
|
-
content =
|
|
16174
|
+
content = readFileSync16(candidate, "utf-8");
|
|
16049
16175
|
} catch {
|
|
16050
16176
|
continue;
|
|
16051
16177
|
}
|
|
16052
|
-
const parentSf =
|
|
16178
|
+
const parentSf = ts12.createSourceFile(candidate, content, ts12.ScriptTarget.Latest, true);
|
|
16053
16179
|
const parentCls = findClassInSourceFile(parentSf, parentClassName);
|
|
16054
16180
|
if (!parentCls)
|
|
16055
16181
|
continue;
|
|
@@ -16061,11 +16187,11 @@ var fail = (reason, detail, location) => ({
|
|
|
16061
16187
|
}, inheritsDecoratedClass = (cls, sourceFile, componentDir, projectRoot) => {
|
|
16062
16188
|
const heritage = cls.heritageClauses ?? [];
|
|
16063
16189
|
for (const clause of heritage) {
|
|
16064
|
-
if (clause.token !==
|
|
16190
|
+
if (clause.token !== ts12.SyntaxKind.ExtendsKeyword)
|
|
16065
16191
|
continue;
|
|
16066
16192
|
for (const typeNode of clause.types) {
|
|
16067
16193
|
const expr = typeNode.expression;
|
|
16068
|
-
if (!
|
|
16194
|
+
if (!ts12.isIdentifier(expr)) {
|
|
16069
16195
|
return true;
|
|
16070
16196
|
}
|
|
16071
16197
|
if (parentHasAngularDecoratorAcrossFiles(expr.text, sourceFile, componentDir, projectRoot)) {
|
|
@@ -16076,18 +16202,18 @@ var fail = (reason, detail, location) => ({
|
|
|
16076
16202
|
return false;
|
|
16077
16203
|
}, CONTROL_CREATE_METHOD_NAME = "\u0275ngControlCreate", extractControlCreate = (cls) => {
|
|
16078
16204
|
for (const member of cls.members) {
|
|
16079
|
-
if (!
|
|
16205
|
+
if (!ts12.isMethodDeclaration(member))
|
|
16080
16206
|
continue;
|
|
16081
|
-
if (member.modifiers?.some((m) => m.kind ===
|
|
16207
|
+
if (member.modifiers?.some((m) => m.kind === ts12.SyntaxKind.StaticKeyword))
|
|
16082
16208
|
continue;
|
|
16083
16209
|
const name = member.name;
|
|
16084
16210
|
if (name === undefined)
|
|
16085
16211
|
continue;
|
|
16086
|
-
const nameText =
|
|
16212
|
+
const nameText = ts12.isIdentifier(name) ? name.text : name.getText();
|
|
16087
16213
|
if (nameText !== CONTROL_CREATE_METHOD_NAME)
|
|
16088
16214
|
continue;
|
|
16089
16215
|
const firstParam = member.parameters[0];
|
|
16090
|
-
if (firstParam === undefined || firstParam.type === undefined || !
|
|
16216
|
+
if (firstParam === undefined || firstParam.type === undefined || !ts12.isTypeReferenceNode(firstParam.type)) {
|
|
16091
16217
|
return { passThroughInput: null };
|
|
16092
16218
|
}
|
|
16093
16219
|
const typeArgs = firstParam.type.typeArguments;
|
|
@@ -16095,16 +16221,16 @@ var fail = (reason, detail, location) => ({
|
|
|
16095
16221
|
return { passThroughInput: null };
|
|
16096
16222
|
}
|
|
16097
16223
|
const arg = typeArgs[0];
|
|
16098
|
-
if (arg === undefined || !
|
|
16224
|
+
if (arg === undefined || !ts12.isLiteralTypeNode(arg) || !ts12.isStringLiteral(arg.literal)) {
|
|
16099
16225
|
return { passThroughInput: null };
|
|
16100
16226
|
}
|
|
16101
16227
|
return { passThroughInput: arg.literal.text };
|
|
16102
16228
|
}
|
|
16103
16229
|
return null;
|
|
16104
16230
|
}, resolveEnumPropertyAccess = (expr, enumName, values) => {
|
|
16105
|
-
if (!
|
|
16231
|
+
if (!ts12.isPropertyAccessExpression(expr))
|
|
16106
16232
|
return null;
|
|
16107
|
-
if (!
|
|
16233
|
+
if (!ts12.isIdentifier(expr.expression))
|
|
16108
16234
|
return null;
|
|
16109
16235
|
if (expr.expression.text !== enumName)
|
|
16110
16236
|
return null;
|
|
@@ -16123,21 +16249,21 @@ var fail = (reason, detail, location) => ({
|
|
|
16123
16249
|
const hostExpr = getProperty(args, "host");
|
|
16124
16250
|
const schemasExpr = getProperty(args, "schemas");
|
|
16125
16251
|
const styleUrls = [];
|
|
16126
|
-
if (styleUrlsExpr &&
|
|
16252
|
+
if (styleUrlsExpr && ts12.isArrayLiteralExpression(styleUrlsExpr)) {
|
|
16127
16253
|
for (const el of styleUrlsExpr.elements) {
|
|
16128
|
-
if (
|
|
16254
|
+
if (ts12.isStringLiteral(el))
|
|
16129
16255
|
styleUrls.push(el.text);
|
|
16130
16256
|
}
|
|
16131
16257
|
}
|
|
16132
16258
|
const styles = [];
|
|
16133
16259
|
if (stylesExpr) {
|
|
16134
|
-
if (
|
|
16260
|
+
if (ts12.isArrayLiteralExpression(stylesExpr)) {
|
|
16135
16261
|
for (const el of stylesExpr.elements) {
|
|
16136
|
-
if (
|
|
16262
|
+
if (ts12.isStringLiteral(el) || ts12.isNoSubstitutionTemplateLiteral(el)) {
|
|
16137
16263
|
styles.push(el.text);
|
|
16138
16264
|
}
|
|
16139
16265
|
}
|
|
16140
|
-
} else if (
|
|
16266
|
+
} else if (ts12.isStringLiteral(stylesExpr) || ts12.isNoSubstitutionTemplateLiteral(stylesExpr)) {
|
|
16141
16267
|
styles.push(stylesExpr.text);
|
|
16142
16268
|
}
|
|
16143
16269
|
}
|
|
@@ -16150,15 +16276,15 @@ var fail = (reason, detail, location) => ({
|
|
|
16150
16276
|
encapsulation,
|
|
16151
16277
|
hasProviders: getProperty(args, "providers") !== null,
|
|
16152
16278
|
hasViewProviders: getProperty(args, "viewProviders") !== null,
|
|
16153
|
-
importsExpr: importsExpr &&
|
|
16154
|
-
hostDirectivesExpr: hostDirectivesExpr &&
|
|
16155
|
-
animationsExpr: animationsExpr &&
|
|
16156
|
-
providersExpr: providersExpr &&
|
|
16157
|
-
viewProvidersExpr: viewProvidersExpr &&
|
|
16158
|
-
inputsArrayExpr: inputsArrayExpr &&
|
|
16159
|
-
outputsArrayExpr: outputsArrayExpr &&
|
|
16160
|
-
hostExpr: hostExpr &&
|
|
16161
|
-
schemasExpr: schemasExpr &&
|
|
16279
|
+
importsExpr: importsExpr && ts12.isArrayLiteralExpression(importsExpr) ? importsExpr : null,
|
|
16280
|
+
hostDirectivesExpr: hostDirectivesExpr && ts12.isArrayLiteralExpression(hostDirectivesExpr) ? hostDirectivesExpr : null,
|
|
16281
|
+
animationsExpr: animationsExpr && ts12.isArrayLiteralExpression(animationsExpr) ? animationsExpr : null,
|
|
16282
|
+
providersExpr: providersExpr && ts12.isArrayLiteralExpression(providersExpr) ? providersExpr : null,
|
|
16283
|
+
viewProvidersExpr: viewProvidersExpr && ts12.isArrayLiteralExpression(viewProvidersExpr) ? viewProvidersExpr : null,
|
|
16284
|
+
inputsArrayExpr: inputsArrayExpr && ts12.isArrayLiteralExpression(inputsArrayExpr) ? inputsArrayExpr : null,
|
|
16285
|
+
outputsArrayExpr: outputsArrayExpr && ts12.isArrayLiteralExpression(outputsArrayExpr) ? outputsArrayExpr : null,
|
|
16286
|
+
hostExpr: hostExpr && ts12.isObjectLiteralExpression(hostExpr) ? hostExpr : null,
|
|
16287
|
+
schemasExpr: schemasExpr && ts12.isArrayLiteralExpression(schemasExpr) ? schemasExpr : null,
|
|
16162
16288
|
preserveWhitespaces: getBooleanProperty(args, "preserveWhitespaces") ?? projectDefaults.preserveWhitespaces ?? false,
|
|
16163
16289
|
selector: getStringProperty(args, "selector"),
|
|
16164
16290
|
standalone: getBooleanProperty(args, "standalone") ?? true,
|
|
@@ -16169,13 +16295,13 @@ var fail = (reason, detail, location) => ({
|
|
|
16169
16295
|
templateUrl: getStringProperty(args, "templateUrl")
|
|
16170
16296
|
};
|
|
16171
16297
|
}, extractDecoratorInput = (prop, compiler) => {
|
|
16172
|
-
const decorators =
|
|
16298
|
+
const decorators = ts12.getDecorators(prop) ?? [];
|
|
16173
16299
|
for (const decorator of decorators) {
|
|
16174
16300
|
const expr = decorator.expression;
|
|
16175
|
-
if (!
|
|
16301
|
+
if (!ts12.isCallExpression(expr))
|
|
16176
16302
|
continue;
|
|
16177
16303
|
const fn2 = expr.expression;
|
|
16178
|
-
if (!
|
|
16304
|
+
if (!ts12.isIdentifier(fn2) || fn2.text !== "Input")
|
|
16179
16305
|
continue;
|
|
16180
16306
|
const classPropertyName = prop.name.getText();
|
|
16181
16307
|
let bindingPropertyName = classPropertyName;
|
|
@@ -16183,9 +16309,9 @@ var fail = (reason, detail, location) => ({
|
|
|
16183
16309
|
let transformFunction = null;
|
|
16184
16310
|
const arg = expr.arguments[0];
|
|
16185
16311
|
if (arg) {
|
|
16186
|
-
if (
|
|
16312
|
+
if (ts12.isStringLiteral(arg)) {
|
|
16187
16313
|
bindingPropertyName = arg.text;
|
|
16188
|
-
} else if (
|
|
16314
|
+
} else if (ts12.isObjectLiteralExpression(arg)) {
|
|
16189
16315
|
const aliasNode = getStringProperty(arg, "alias");
|
|
16190
16316
|
if (aliasNode !== null)
|
|
16191
16317
|
bindingPropertyName = aliasNode;
|
|
@@ -16209,11 +16335,11 @@ var fail = (reason, detail, location) => ({
|
|
|
16209
16335
|
}
|
|
16210
16336
|
return null;
|
|
16211
16337
|
}, isInputSignalCall = (init) => {
|
|
16212
|
-
if (
|
|
16338
|
+
if (ts12.isCallExpression(init)) {
|
|
16213
16339
|
const fn2 = init.expression;
|
|
16214
|
-
if (
|
|
16340
|
+
if (ts12.isIdentifier(fn2) && fn2.text === "input")
|
|
16215
16341
|
return true;
|
|
16216
|
-
if (
|
|
16342
|
+
if (ts12.isPropertyAccessExpression(fn2) && ts12.isIdentifier(fn2.expression) && fn2.expression.text === "input") {
|
|
16217
16343
|
return true;
|
|
16218
16344
|
}
|
|
16219
16345
|
}
|
|
@@ -16224,13 +16350,13 @@ var fail = (reason, detail, location) => ({
|
|
|
16224
16350
|
const classPropertyName = prop.name.getText();
|
|
16225
16351
|
const call = prop.initializer;
|
|
16226
16352
|
let required = false;
|
|
16227
|
-
if (
|
|
16353
|
+
if (ts12.isPropertyAccessExpression(call.expression) && ts12.isIdentifier(call.expression.name) && call.expression.name.text === "required") {
|
|
16228
16354
|
required = true;
|
|
16229
16355
|
}
|
|
16230
16356
|
let bindingPropertyName = classPropertyName;
|
|
16231
16357
|
let transformFunction = null;
|
|
16232
16358
|
const optsArg = call.arguments[required ? 0 : 1];
|
|
16233
|
-
if (optsArg &&
|
|
16359
|
+
if (optsArg && ts12.isObjectLiteralExpression(optsArg)) {
|
|
16234
16360
|
const aliasNode = getStringProperty(optsArg, "alias");
|
|
16235
16361
|
if (aliasNode !== null)
|
|
16236
16362
|
bindingPropertyName = aliasNode;
|
|
@@ -16250,28 +16376,28 @@ var fail = (reason, detail, location) => ({
|
|
|
16250
16376
|
}
|
|
16251
16377
|
};
|
|
16252
16378
|
}, extractDecoratorOutput = (prop) => {
|
|
16253
|
-
const decorators =
|
|
16379
|
+
const decorators = ts12.getDecorators(prop) ?? [];
|
|
16254
16380
|
for (const decorator of decorators) {
|
|
16255
16381
|
const expr = decorator.expression;
|
|
16256
|
-
if (!
|
|
16382
|
+
if (!ts12.isCallExpression(expr))
|
|
16257
16383
|
continue;
|
|
16258
16384
|
const fn2 = expr.expression;
|
|
16259
|
-
if (!
|
|
16385
|
+
if (!ts12.isIdentifier(fn2) || fn2.text !== "Output")
|
|
16260
16386
|
continue;
|
|
16261
16387
|
const classPropertyName = prop.name.getText();
|
|
16262
16388
|
let bindingName = classPropertyName;
|
|
16263
16389
|
const arg = expr.arguments[0];
|
|
16264
|
-
if (arg &&
|
|
16390
|
+
if (arg && ts12.isStringLiteral(arg))
|
|
16265
16391
|
bindingName = arg.text;
|
|
16266
16392
|
return { classPropertyName, bindingName };
|
|
16267
16393
|
}
|
|
16268
16394
|
return null;
|
|
16269
16395
|
}, isOutputSignalCall = (init) => {
|
|
16270
|
-
if (
|
|
16396
|
+
if (ts12.isCallExpression(init)) {
|
|
16271
16397
|
const fn2 = init.expression;
|
|
16272
|
-
if (
|
|
16398
|
+
if (ts12.isIdentifier(fn2) && fn2.text === "output")
|
|
16273
16399
|
return true;
|
|
16274
|
-
if (
|
|
16400
|
+
if (ts12.isPropertyAccessExpression(fn2) && ts12.isIdentifier(fn2.expression) && fn2.expression.text === "output") {
|
|
16275
16401
|
return true;
|
|
16276
16402
|
}
|
|
16277
16403
|
}
|
|
@@ -16283,7 +16409,7 @@ var fail = (reason, detail, location) => ({
|
|
|
16283
16409
|
const call = prop.initializer;
|
|
16284
16410
|
let bindingName = classPropertyName;
|
|
16285
16411
|
const optsArg = call.arguments[0];
|
|
16286
|
-
if (optsArg &&
|
|
16412
|
+
if (optsArg && ts12.isObjectLiteralExpression(optsArg)) {
|
|
16287
16413
|
const aliasNode = getStringProperty(optsArg, "alias");
|
|
16288
16414
|
if (aliasNode !== null)
|
|
16289
16415
|
bindingName = aliasNode;
|
|
@@ -16295,7 +16421,7 @@ var fail = (reason, detail, location) => ({
|
|
|
16295
16421
|
let hasDecoratorIO = false;
|
|
16296
16422
|
let hasSignalIO = false;
|
|
16297
16423
|
for (const member of cls.members) {
|
|
16298
|
-
if (!
|
|
16424
|
+
if (!ts12.isPropertyDeclaration(member))
|
|
16299
16425
|
continue;
|
|
16300
16426
|
const decoratorIn = extractDecoratorInput(member, compiler);
|
|
16301
16427
|
if (decoratorIn) {
|
|
@@ -16329,21 +16455,21 @@ var fail = (reason, detail, location) => ({
|
|
|
16329
16455
|
specialAttributes: {}
|
|
16330
16456
|
}), parseHostObjectInto = (host, args, hostExprNode, compiler) => {
|
|
16331
16457
|
const hostNode = getProperty(args, "host");
|
|
16332
|
-
if (!hostNode || !
|
|
16458
|
+
if (!hostNode || !ts12.isObjectLiteralExpression(hostNode)) {
|
|
16333
16459
|
if (!hostExprNode)
|
|
16334
16460
|
return;
|
|
16335
16461
|
}
|
|
16336
|
-
const obj = hostNode &&
|
|
16462
|
+
const obj = hostNode && ts12.isObjectLiteralExpression(hostNode) ? hostNode : hostExprNode;
|
|
16337
16463
|
if (!obj)
|
|
16338
16464
|
return;
|
|
16339
16465
|
for (const prop of obj.properties) {
|
|
16340
|
-
if (!
|
|
16466
|
+
if (!ts12.isPropertyAssignment(prop))
|
|
16341
16467
|
continue;
|
|
16342
16468
|
const keyNode = prop.name;
|
|
16343
16469
|
let key;
|
|
16344
|
-
if (
|
|
16470
|
+
if (ts12.isStringLiteral(keyNode) || ts12.isNoSubstitutionTemplateLiteral(keyNode)) {
|
|
16345
16471
|
key = keyNode.text;
|
|
16346
|
-
} else if (
|
|
16472
|
+
} else if (ts12.isIdentifier(keyNode)) {
|
|
16347
16473
|
key = keyNode.text;
|
|
16348
16474
|
} else {
|
|
16349
16475
|
continue;
|
|
@@ -16360,36 +16486,36 @@ var fail = (reason, detail, location) => ({
|
|
|
16360
16486
|
}
|
|
16361
16487
|
}, mergeMemberHostDecorators = (host, cls) => {
|
|
16362
16488
|
for (const member of cls.members) {
|
|
16363
|
-
if (!
|
|
16489
|
+
if (!ts12.canHaveDecorators(member))
|
|
16364
16490
|
continue;
|
|
16365
|
-
const decorators =
|
|
16491
|
+
const decorators = ts12.getDecorators(member) ?? [];
|
|
16366
16492
|
for (const dec of decorators) {
|
|
16367
16493
|
const expr = dec.expression;
|
|
16368
|
-
if (!
|
|
16494
|
+
if (!ts12.isCallExpression(expr))
|
|
16369
16495
|
continue;
|
|
16370
16496
|
const fn2 = expr.expression;
|
|
16371
|
-
if (!
|
|
16497
|
+
if (!ts12.isIdentifier(fn2))
|
|
16372
16498
|
continue;
|
|
16373
16499
|
if (fn2.text === "HostBinding") {
|
|
16374
|
-
if (!
|
|
16500
|
+
if (!ts12.isPropertyDeclaration(member) && !ts12.isGetAccessor(member))
|
|
16375
16501
|
continue;
|
|
16376
16502
|
const propertyName = member.name.text;
|
|
16377
16503
|
const target = expr.arguments[0];
|
|
16378
|
-
const key = target &&
|
|
16504
|
+
const key = target && ts12.isStringLiteral(target) ? target.text : propertyName;
|
|
16379
16505
|
host.properties[key] = propertyName;
|
|
16380
16506
|
} else if (fn2.text === "HostListener") {
|
|
16381
|
-
if (!
|
|
16507
|
+
if (!ts12.isMethodDeclaration(member))
|
|
16382
16508
|
continue;
|
|
16383
16509
|
const methodName = member.name.text;
|
|
16384
16510
|
const eventArg = expr.arguments[0];
|
|
16385
|
-
if (!eventArg || !
|
|
16511
|
+
if (!eventArg || !ts12.isStringLiteral(eventArg))
|
|
16386
16512
|
continue;
|
|
16387
16513
|
const event = eventArg.text;
|
|
16388
16514
|
const argsArg = expr.arguments[1];
|
|
16389
16515
|
let argsList = [];
|
|
16390
|
-
if (argsArg &&
|
|
16516
|
+
if (argsArg && ts12.isArrayLiteralExpression(argsArg)) {
|
|
16391
16517
|
for (const el of argsArg.elements) {
|
|
16392
|
-
if (
|
|
16518
|
+
if (ts12.isStringLiteral(el))
|
|
16393
16519
|
argsList.push(el.text);
|
|
16394
16520
|
}
|
|
16395
16521
|
}
|
|
@@ -16402,14 +16528,14 @@ var fail = (reason, detail, location) => ({
|
|
|
16402
16528
|
let descendants = true;
|
|
16403
16529
|
let emitDistinctChangesOnly = true;
|
|
16404
16530
|
const opts = args[1];
|
|
16405
|
-
if (opts &&
|
|
16531
|
+
if (opts && ts12.isObjectLiteralExpression(opts)) {
|
|
16406
16532
|
static_ = getBooleanProperty(opts, "static") ?? false;
|
|
16407
16533
|
descendants = getBooleanProperty(opts, "descendants") ?? true;
|
|
16408
16534
|
emitDistinctChangesOnly = getBooleanProperty(opts, "emitDistinctChangesOnly") ?? true;
|
|
16409
16535
|
}
|
|
16410
16536
|
return { static_, descendants, emitDistinctChangesOnly };
|
|
16411
16537
|
}, queryPredicateFromArg = (arg, compiler) => {
|
|
16412
|
-
if (
|
|
16538
|
+
if (ts12.isStringLiteral(arg)) {
|
|
16413
16539
|
return arg.text.split(",").map((s2) => s2.trim()).filter(Boolean);
|
|
16414
16540
|
}
|
|
16415
16541
|
return {
|
|
@@ -16420,15 +16546,15 @@ var fail = (reason, detail, location) => ({
|
|
|
16420
16546
|
const contentQueries = [];
|
|
16421
16547
|
const viewQueries = [];
|
|
16422
16548
|
for (const member of cls.members) {
|
|
16423
|
-
if (!
|
|
16549
|
+
if (!ts12.isPropertyDeclaration(member))
|
|
16424
16550
|
continue;
|
|
16425
|
-
const decorators =
|
|
16551
|
+
const decorators = ts12.getDecorators(member) ?? [];
|
|
16426
16552
|
for (const dec of decorators) {
|
|
16427
16553
|
const expr = dec.expression;
|
|
16428
|
-
if (!
|
|
16554
|
+
if (!ts12.isCallExpression(expr))
|
|
16429
16555
|
continue;
|
|
16430
16556
|
const fn2 = expr.expression;
|
|
16431
|
-
if (!
|
|
16557
|
+
if (!ts12.isIdentifier(fn2) || !QUERY_DECORATORS.has(fn2.text))
|
|
16432
16558
|
continue;
|
|
16433
16559
|
const propertyName = member.name.text;
|
|
16434
16560
|
const tokenArg = expr.arguments[0];
|
|
@@ -16440,7 +16566,7 @@ var fail = (reason, detail, location) => ({
|
|
|
16440
16566
|
const { static_, descendants, emitDistinctChangesOnly } = parseQueryDecoratorOptions(expr.arguments);
|
|
16441
16567
|
const opts = expr.arguments[1];
|
|
16442
16568
|
let read = null;
|
|
16443
|
-
if (opts &&
|
|
16569
|
+
if (opts && ts12.isObjectLiteralExpression(opts)) {
|
|
16444
16570
|
const readNode = getProperty(opts, "read");
|
|
16445
16571
|
if (readNode) {
|
|
16446
16572
|
read = new compiler.WrappedNodeExpr(readNode);
|
|
@@ -16468,15 +16594,15 @@ var fail = (reason, detail, location) => ({
|
|
|
16468
16594
|
const contentQueries = [];
|
|
16469
16595
|
const viewQueries = [];
|
|
16470
16596
|
for (const member of cls.members) {
|
|
16471
|
-
if (!
|
|
16597
|
+
if (!ts12.isPropertyDeclaration(member) || !member.initializer)
|
|
16472
16598
|
continue;
|
|
16473
16599
|
let init = member.initializer;
|
|
16474
|
-
if (!
|
|
16600
|
+
if (!ts12.isCallExpression(init))
|
|
16475
16601
|
continue;
|
|
16476
16602
|
let queryName;
|
|
16477
|
-
if (
|
|
16603
|
+
if (ts12.isIdentifier(init.expression)) {
|
|
16478
16604
|
queryName = init.expression.text;
|
|
16479
|
-
} else if (
|
|
16605
|
+
} else if (ts12.isPropertyAccessExpression(init.expression) && ts12.isIdentifier(init.expression.expression) && init.expression.name.text === "required") {
|
|
16480
16606
|
queryName = init.expression.expression.text;
|
|
16481
16607
|
} else {
|
|
16482
16608
|
continue;
|
|
@@ -16494,7 +16620,7 @@ var fail = (reason, detail, location) => ({
|
|
|
16494
16620
|
let descendants = true;
|
|
16495
16621
|
let read = null;
|
|
16496
16622
|
const opts = init.arguments[1];
|
|
16497
|
-
if (opts &&
|
|
16623
|
+
if (opts && ts12.isObjectLiteralExpression(opts)) {
|
|
16498
16624
|
descendants = getBooleanProperty(opts, "descendants") ?? true;
|
|
16499
16625
|
const readNode = getProperty(opts, "read");
|
|
16500
16626
|
if (readNode)
|
|
@@ -16520,13 +16646,13 @@ var fail = (reason, detail, location) => ({
|
|
|
16520
16646
|
const node = getProperty(args, "exportAs");
|
|
16521
16647
|
if (!node)
|
|
16522
16648
|
return null;
|
|
16523
|
-
if (
|
|
16649
|
+
if (ts12.isStringLiteral(node)) {
|
|
16524
16650
|
return node.text.split(",").map((s2) => s2.trim()).filter(Boolean);
|
|
16525
16651
|
}
|
|
16526
|
-
if (
|
|
16652
|
+
if (ts12.isArrayLiteralExpression(node)) {
|
|
16527
16653
|
const out = [];
|
|
16528
16654
|
for (const el of node.elements) {
|
|
16529
|
-
if (
|
|
16655
|
+
if (ts12.isStringLiteral(el))
|
|
16530
16656
|
out.push(el.text);
|
|
16531
16657
|
}
|
|
16532
16658
|
return out.length > 0 ? out : null;
|
|
@@ -16534,11 +16660,11 @@ var fail = (reason, detail, location) => ({
|
|
|
16534
16660
|
return null;
|
|
16535
16661
|
}, extractHostDirectives = (args, compiler) => {
|
|
16536
16662
|
const node = getProperty(args, "hostDirectives");
|
|
16537
|
-
if (!node || !
|
|
16663
|
+
if (!node || !ts12.isArrayLiteralExpression(node))
|
|
16538
16664
|
return null;
|
|
16539
16665
|
const out = [];
|
|
16540
16666
|
for (const el of node.elements) {
|
|
16541
|
-
if (
|
|
16667
|
+
if (ts12.isIdentifier(el)) {
|
|
16542
16668
|
out.push({
|
|
16543
16669
|
directive: {
|
|
16544
16670
|
value: new compiler.WrappedNodeExpr(el),
|
|
@@ -16550,7 +16676,7 @@ var fail = (reason, detail, location) => ({
|
|
|
16550
16676
|
});
|
|
16551
16677
|
continue;
|
|
16552
16678
|
}
|
|
16553
|
-
if (!
|
|
16679
|
+
if (!ts12.isObjectLiteralExpression(el))
|
|
16554
16680
|
continue;
|
|
16555
16681
|
const directiveNode = getProperty(el, "directive");
|
|
16556
16682
|
if (!directiveNode)
|
|
@@ -16558,11 +16684,11 @@ var fail = (reason, detail, location) => ({
|
|
|
16558
16684
|
const inputsNode = getProperty(el, "inputs");
|
|
16559
16685
|
const outputsNode = getProperty(el, "outputs");
|
|
16560
16686
|
const collectMap = (n) => {
|
|
16561
|
-
if (!n || !
|
|
16687
|
+
if (!n || !ts12.isArrayLiteralExpression(n))
|
|
16562
16688
|
return null;
|
|
16563
16689
|
const map = {};
|
|
16564
16690
|
for (const item of n.elements) {
|
|
16565
|
-
if (!
|
|
16691
|
+
if (!ts12.isStringLiteral(item))
|
|
16566
16692
|
continue;
|
|
16567
16693
|
const [name, alias] = item.text.split(":").map((s2) => s2.trim());
|
|
16568
16694
|
if (name)
|
|
@@ -16624,7 +16750,7 @@ var fail = (reason, detail, location) => ({
|
|
|
16624
16750
|
return cached.info;
|
|
16625
16751
|
let source;
|
|
16626
16752
|
try {
|
|
16627
|
-
source =
|
|
16753
|
+
source = readFileSync16(filePath, "utf-8");
|
|
16628
16754
|
} catch {
|
|
16629
16755
|
childComponentInfoCache.set(cacheKey2, {
|
|
16630
16756
|
info: null,
|
|
@@ -16632,10 +16758,10 @@ var fail = (reason, detail, location) => ({
|
|
|
16632
16758
|
});
|
|
16633
16759
|
return null;
|
|
16634
16760
|
}
|
|
16635
|
-
const sf =
|
|
16761
|
+
const sf = ts12.createSourceFile(filePath, source, ts12.ScriptTarget.Latest, true);
|
|
16636
16762
|
let info = null;
|
|
16637
16763
|
for (const stmt of sf.statements) {
|
|
16638
|
-
if (!
|
|
16764
|
+
if (!ts12.isClassDeclaration(stmt))
|
|
16639
16765
|
continue;
|
|
16640
16766
|
if (!stmt.name || stmt.name.text !== className)
|
|
16641
16767
|
continue;
|
|
@@ -16678,7 +16804,7 @@ var fail = (reason, detail, location) => ({
|
|
|
16678
16804
|
return cached.info;
|
|
16679
16805
|
let content;
|
|
16680
16806
|
try {
|
|
16681
|
-
content =
|
|
16807
|
+
content = readFileSync16(dtsPath, "utf-8");
|
|
16682
16808
|
} catch {
|
|
16683
16809
|
childComponentInfoCache.set(cacheKey2, {
|
|
16684
16810
|
info: null,
|
|
@@ -16770,9 +16896,9 @@ var fail = (reason, detail, location) => ({
|
|
|
16770
16896
|
}, buildClassToSpecMap = (sourceFile) => {
|
|
16771
16897
|
const result = new Map;
|
|
16772
16898
|
for (const stmt of sourceFile.statements) {
|
|
16773
|
-
if (!
|
|
16899
|
+
if (!ts12.isImportDeclaration(stmt))
|
|
16774
16900
|
continue;
|
|
16775
|
-
if (!
|
|
16901
|
+
if (!ts12.isStringLiteral(stmt.moduleSpecifier))
|
|
16776
16902
|
continue;
|
|
16777
16903
|
const spec = stmt.moduleSpecifier.text;
|
|
16778
16904
|
const clause = stmt.importClause;
|
|
@@ -16781,7 +16907,7 @@ var fail = (reason, detail, location) => ({
|
|
|
16781
16907
|
if (clause.name)
|
|
16782
16908
|
result.set(clause.name.text, spec);
|
|
16783
16909
|
const named = clause.namedBindings;
|
|
16784
|
-
if (named &&
|
|
16910
|
+
if (named && ts12.isNamedImports(named)) {
|
|
16785
16911
|
for (const el of named.elements) {
|
|
16786
16912
|
if (el.isTypeOnly)
|
|
16787
16913
|
continue;
|
|
@@ -16798,7 +16924,7 @@ var fail = (reason, detail, location) => ({
|
|
|
16798
16924
|
return null;
|
|
16799
16925
|
let content;
|
|
16800
16926
|
try {
|
|
16801
|
-
content =
|
|
16927
|
+
content = readFileSync16(startDtsPath, "utf-8");
|
|
16802
16928
|
} catch {
|
|
16803
16929
|
return null;
|
|
16804
16930
|
}
|
|
@@ -16894,7 +17020,7 @@ var fail = (reason, detail, location) => ({
|
|
|
16894
17020
|
return result;
|
|
16895
17021
|
const classToSpec = buildClassToSpecMap(sourceFile);
|
|
16896
17022
|
for (const el of importsExpr.elements) {
|
|
16897
|
-
if (!
|
|
17023
|
+
if (!ts12.isIdentifier(el))
|
|
16898
17024
|
continue;
|
|
16899
17025
|
const className = el.text;
|
|
16900
17026
|
const spec = classToSpec.get(className);
|
|
@@ -16913,35 +17039,35 @@ var fail = (reason, detail, location) => ({
|
|
|
16913
17039
|
}
|
|
16914
17040
|
return (h2 >>> 0).toString(36);
|
|
16915
17041
|
}, initializerShapeIsStructural = (node) => {
|
|
16916
|
-
if (
|
|
17042
|
+
if (ts12.isArrowFunction(node) || ts12.isFunctionExpression(node) || ts12.isCallExpression(node) || ts12.isNewExpression(node)) {
|
|
16917
17043
|
return true;
|
|
16918
17044
|
}
|
|
16919
|
-
if (
|
|
17045
|
+
if (ts12.isConditionalExpression(node)) {
|
|
16920
17046
|
return initializerShapeIsStructural(node.whenTrue) || initializerShapeIsStructural(node.whenFalse);
|
|
16921
17047
|
}
|
|
16922
|
-
if (
|
|
17048
|
+
if (ts12.isParenthesizedExpression(node)) {
|
|
16923
17049
|
return initializerShapeIsStructural(node.expression);
|
|
16924
17050
|
}
|
|
16925
|
-
if (
|
|
17051
|
+
if (ts12.isAsExpression(node) || ts12.isTypeAssertionExpression(node)) {
|
|
16926
17052
|
return initializerShapeIsStructural(node.expression);
|
|
16927
17053
|
}
|
|
16928
|
-
if (
|
|
17054
|
+
if (ts12.isNonNullExpression(node)) {
|
|
16929
17055
|
return initializerShapeIsStructural(node.expression);
|
|
16930
17056
|
}
|
|
16931
|
-
if (
|
|
17057
|
+
if (ts12.isObjectLiteralExpression(node)) {
|
|
16932
17058
|
for (const prop of node.properties) {
|
|
16933
|
-
if (
|
|
17059
|
+
if (ts12.isPropertyAssignment(prop) && initializerShapeIsStructural(prop.initializer)) {
|
|
16934
17060
|
return true;
|
|
16935
17061
|
}
|
|
16936
|
-
if (
|
|
17062
|
+
if (ts12.isShorthandPropertyAssignment(prop))
|
|
16937
17063
|
continue;
|
|
16938
|
-
if (
|
|
17064
|
+
if (ts12.isSpreadAssignment(prop) && initializerShapeIsStructural(prop.expression)) {
|
|
16939
17065
|
return true;
|
|
16940
17066
|
}
|
|
16941
17067
|
}
|
|
16942
17068
|
return false;
|
|
16943
17069
|
}
|
|
16944
|
-
if (
|
|
17070
|
+
if (ts12.isArrayLiteralExpression(node)) {
|
|
16945
17071
|
for (const el of node.elements) {
|
|
16946
17072
|
if (initializerShapeIsStructural(el))
|
|
16947
17073
|
return true;
|
|
@@ -16952,7 +17078,7 @@ var fail = (reason, detail, location) => ({
|
|
|
16952
17078
|
}, extractArrowFieldSig = (cls) => {
|
|
16953
17079
|
const entries = [];
|
|
16954
17080
|
for (const member of cls.members) {
|
|
16955
|
-
if (!
|
|
17081
|
+
if (!ts12.isPropertyDeclaration(member))
|
|
16956
17082
|
continue;
|
|
16957
17083
|
const init = member.initializer;
|
|
16958
17084
|
if (!init)
|
|
@@ -16962,12 +17088,12 @@ var fail = (reason, detail, location) => ({
|
|
|
16962
17088
|
const name = member.name.getText();
|
|
16963
17089
|
let bodyText;
|
|
16964
17090
|
try {
|
|
16965
|
-
const printer =
|
|
16966
|
-
newLine:
|
|
17091
|
+
const printer = ts12.createPrinter({
|
|
17092
|
+
newLine: ts12.NewLineKind.LineFeed,
|
|
16967
17093
|
omitTrailingSemicolon: true,
|
|
16968
17094
|
removeComments: true
|
|
16969
17095
|
});
|
|
16970
|
-
bodyText = printer.printNode(
|
|
17096
|
+
bodyText = printer.printNode(ts12.EmitHint.Unspecified, init, cls.getSourceFile());
|
|
16971
17097
|
} catch {
|
|
16972
17098
|
bodyText = init.getText();
|
|
16973
17099
|
}
|
|
@@ -16978,9 +17104,9 @@ var fail = (reason, detail, location) => ({
|
|
|
16978
17104
|
}, INPUT_OUTPUT_DECORATORS, extractMemberDecoratorSig = (cls) => {
|
|
16979
17105
|
const entries = [];
|
|
16980
17106
|
for (const member of cls.members) {
|
|
16981
|
-
if (!
|
|
17107
|
+
if (!ts12.canHaveDecorators(member))
|
|
16982
17108
|
continue;
|
|
16983
|
-
const decorators =
|
|
17109
|
+
const decorators = ts12.getDecorators(member) ?? [];
|
|
16984
17110
|
if (decorators.length === 0)
|
|
16985
17111
|
continue;
|
|
16986
17112
|
const memberName = member.name?.getText() ?? "<anon>";
|
|
@@ -16988,14 +17114,14 @@ var fail = (reason, detail, location) => ({
|
|
|
16988
17114
|
const expr = decorator.expression;
|
|
16989
17115
|
let decName = "<unknown>";
|
|
16990
17116
|
let argText = "";
|
|
16991
|
-
if (
|
|
16992
|
-
if (
|
|
17117
|
+
if (ts12.isCallExpression(expr)) {
|
|
17118
|
+
if (ts12.isIdentifier(expr.expression)) {
|
|
16993
17119
|
decName = expr.expression.text;
|
|
16994
17120
|
}
|
|
16995
17121
|
if (expr.arguments.length > 0) {
|
|
16996
17122
|
argText = expr.arguments.map((a) => a.getText()).join(",");
|
|
16997
17123
|
}
|
|
16998
|
-
} else if (
|
|
17124
|
+
} else if (ts12.isIdentifier(expr)) {
|
|
16999
17125
|
decName = expr.text;
|
|
17000
17126
|
}
|
|
17001
17127
|
if (INPUT_OUTPUT_DECORATORS.has(decName))
|
|
@@ -17016,22 +17142,22 @@ var fail = (reason, detail, location) => ({
|
|
|
17016
17142
|
return cached.hasProviders;
|
|
17017
17143
|
let source;
|
|
17018
17144
|
try {
|
|
17019
|
-
source =
|
|
17145
|
+
source = readFileSync16(filePath, "utf8");
|
|
17020
17146
|
} catch {
|
|
17021
17147
|
return true;
|
|
17022
17148
|
}
|
|
17023
|
-
const sf =
|
|
17149
|
+
const sf = ts12.createSourceFile(filePath, source, ts12.ScriptTarget.ES2022, true, ts12.ScriptKind.TS);
|
|
17024
17150
|
let hasProviders = false;
|
|
17025
17151
|
const visit = (node) => {
|
|
17026
17152
|
if (hasProviders)
|
|
17027
17153
|
return;
|
|
17028
|
-
if (
|
|
17029
|
-
for (const decorator of
|
|
17154
|
+
if (ts12.isClassDeclaration(node)) {
|
|
17155
|
+
for (const decorator of ts12.getDecorators(node) ?? []) {
|
|
17030
17156
|
const expr = decorator.expression;
|
|
17031
|
-
if (!
|
|
17157
|
+
if (!ts12.isCallExpression(expr))
|
|
17032
17158
|
continue;
|
|
17033
17159
|
const arg = expr.arguments[0];
|
|
17034
|
-
if (!arg || !
|
|
17160
|
+
if (!arg || !ts12.isObjectLiteralExpression(arg))
|
|
17035
17161
|
continue;
|
|
17036
17162
|
if (getProperty(arg, "providers") !== null) {
|
|
17037
17163
|
hasProviders = true;
|
|
@@ -17039,7 +17165,7 @@ var fail = (reason, detail, location) => ({
|
|
|
17039
17165
|
}
|
|
17040
17166
|
}
|
|
17041
17167
|
}
|
|
17042
|
-
|
|
17168
|
+
ts12.forEachChild(node, visit);
|
|
17043
17169
|
};
|
|
17044
17170
|
visit(sf);
|
|
17045
17171
|
providerProbeCache.set(filePath, {
|
|
@@ -17049,10 +17175,10 @@ var fail = (reason, detail, location) => ({
|
|
|
17049
17175
|
return hasProviders;
|
|
17050
17176
|
}, TS_EXTENSIONS, resolveImportSource = (identifierName, sourceFile, componentDir) => {
|
|
17051
17177
|
for (const stmt of sourceFile.statements) {
|
|
17052
|
-
if (!
|
|
17178
|
+
if (!ts12.isImportDeclaration(stmt))
|
|
17053
17179
|
continue;
|
|
17054
17180
|
const moduleSpec = stmt.moduleSpecifier;
|
|
17055
|
-
if (!
|
|
17181
|
+
if (!ts12.isStringLiteral(moduleSpec))
|
|
17056
17182
|
continue;
|
|
17057
17183
|
const spec = moduleSpec.text;
|
|
17058
17184
|
if (!spec.startsWith(".") && !spec.startsWith("/"))
|
|
@@ -17066,7 +17192,7 @@ var fail = (reason, detail, location) => ({
|
|
|
17066
17192
|
}
|
|
17067
17193
|
if (importClause.namedBindings) {
|
|
17068
17194
|
const nb = importClause.namedBindings;
|
|
17069
|
-
if (
|
|
17195
|
+
if (ts12.isNamespaceImport(nb)) {
|
|
17070
17196
|
if (nb.name.text === identifierName)
|
|
17071
17197
|
matches = true;
|
|
17072
17198
|
} else {
|
|
@@ -17096,7 +17222,7 @@ var fail = (reason, detail, location) => ({
|
|
|
17096
17222
|
return [];
|
|
17097
17223
|
const sig = [];
|
|
17098
17224
|
for (const entry of importsExpr.elements) {
|
|
17099
|
-
if (
|
|
17225
|
+
if (ts12.isIdentifier(entry)) {
|
|
17100
17226
|
const importPath = resolveImportSource(entry.text, sourceFile, componentDir);
|
|
17101
17227
|
if (importPath) {
|
|
17102
17228
|
if (fileHasModuleProviders(importPath)) {
|
|
@@ -17115,13 +17241,13 @@ var fail = (reason, detail, location) => ({
|
|
|
17115
17241
|
}, extractPropertyFieldNames = (cls) => {
|
|
17116
17242
|
const names = [];
|
|
17117
17243
|
for (const member of cls.members) {
|
|
17118
|
-
if (!
|
|
17244
|
+
if (!ts12.isPropertyDeclaration(member) && !ts12.isMethodDeclaration(member) && !ts12.isGetAccessorDeclaration(member) && !ts12.isSetAccessorDeclaration(member)) {
|
|
17119
17245
|
continue;
|
|
17120
17246
|
}
|
|
17121
17247
|
const name = member.name;
|
|
17122
17248
|
if (name === undefined)
|
|
17123
17249
|
continue;
|
|
17124
|
-
const text =
|
|
17250
|
+
const text = ts12.isIdentifier(name) ? name.text : ts12.isStringLiteral(name) || ts12.isNoSubstitutionTemplateLiteral(name) ? name.text : name.getText();
|
|
17125
17251
|
if (text.length > 0)
|
|
17126
17252
|
names.push(text);
|
|
17127
17253
|
}
|
|
@@ -17129,7 +17255,7 @@ var fail = (reason, detail, location) => ({
|
|
|
17129
17255
|
}, extractTopLevelImports = (sourceFile) => {
|
|
17130
17256
|
const names = new Set;
|
|
17131
17257
|
for (const stmt of sourceFile.statements) {
|
|
17132
|
-
if (!
|
|
17258
|
+
if (!ts12.isImportDeclaration(stmt))
|
|
17133
17259
|
continue;
|
|
17134
17260
|
const clause = stmt.importClause;
|
|
17135
17261
|
if (!clause)
|
|
@@ -17141,9 +17267,9 @@ var fail = (reason, detail, location) => ({
|
|
|
17141
17267
|
const bindings = clause.namedBindings;
|
|
17142
17268
|
if (!bindings)
|
|
17143
17269
|
continue;
|
|
17144
|
-
if (
|
|
17270
|
+
if (ts12.isNamespaceImport(bindings)) {
|
|
17145
17271
|
names.add(bindings.name.text);
|
|
17146
|
-
} else if (
|
|
17272
|
+
} else if (ts12.isNamedImports(bindings)) {
|
|
17147
17273
|
for (const el of bindings.elements) {
|
|
17148
17274
|
if (el.isTypeOnly)
|
|
17149
17275
|
continue;
|
|
@@ -17155,18 +17281,18 @@ var fail = (reason, detail, location) => ({
|
|
|
17155
17281
|
}, extractFingerprint = (cls, className, decoratorMeta, inputs, outputs, sourceFile, componentDir) => {
|
|
17156
17282
|
const ctorParamTypes = [];
|
|
17157
17283
|
for (const member of cls.members) {
|
|
17158
|
-
if (!
|
|
17284
|
+
if (!ts12.isConstructorDeclaration(member))
|
|
17159
17285
|
continue;
|
|
17160
17286
|
for (const param of member.parameters) {
|
|
17161
17287
|
const typeText = param.type ? param.type.getText() : "";
|
|
17162
|
-
const decorators =
|
|
17288
|
+
const decorators = ts12.getDecorators(param) ?? [];
|
|
17163
17289
|
const decoratorSig = decorators.length === 0 ? "" : decorators.map((d2) => {
|
|
17164
17290
|
const expr = d2.expression;
|
|
17165
|
-
if (
|
|
17291
|
+
if (ts12.isCallExpression(expr) && ts12.isIdentifier(expr.expression)) {
|
|
17166
17292
|
const args = expr.arguments.map((a) => a.getText()).join(",");
|
|
17167
17293
|
return `@${expr.expression.text}(${args})`;
|
|
17168
17294
|
}
|
|
17169
|
-
if (
|
|
17295
|
+
if (ts12.isIdentifier(expr)) {
|
|
17170
17296
|
return `@${expr.text}`;
|
|
17171
17297
|
}
|
|
17172
17298
|
return "@<unknown>";
|
|
@@ -17182,12 +17308,12 @@ var fail = (reason, detail, location) => ({
|
|
|
17182
17308
|
const providerImportSig = extractProviderImportSig(decoratorMeta.importsExpr, sourceFile, componentDir);
|
|
17183
17309
|
const topLevelImports = extractTopLevelImports(sourceFile);
|
|
17184
17310
|
const propertyFieldNames = extractPropertyFieldNames(cls);
|
|
17185
|
-
const printer =
|
|
17186
|
-
newLine:
|
|
17311
|
+
const printer = ts12.createPrinter({
|
|
17312
|
+
newLine: ts12.NewLineKind.LineFeed,
|
|
17187
17313
|
omitTrailingSemicolon: true,
|
|
17188
17314
|
removeComments: true
|
|
17189
17315
|
});
|
|
17190
|
-
const canonicalText = (node) => printer.printNode(
|
|
17316
|
+
const canonicalText = (node) => printer.printNode(ts12.EmitHint.Unspecified, node, sourceFile);
|
|
17191
17317
|
const importsArraySig = decoratorMeta.importsExpr ? djb2Hash(canonicalText(decoratorMeta.importsExpr)) : "";
|
|
17192
17318
|
const hostDirectivesSig = decoratorMeta.hostDirectivesExpr ? djb2Hash(canonicalText(decoratorMeta.hostDirectivesExpr)) : "";
|
|
17193
17319
|
const animationsArraySig = decoratorMeta.animationsExpr ? djb2Hash(canonicalText(decoratorMeta.animationsExpr)) : "";
|
|
@@ -17200,13 +17326,13 @@ var fail = (reason, detail, location) => ({
|
|
|
17200
17326
|
const PAGE_EXPORT_NAMES = new Set(["providers", "routes"]);
|
|
17201
17327
|
const pageExportEntries = [];
|
|
17202
17328
|
for (const stmt of sourceFile.statements) {
|
|
17203
|
-
if (!
|
|
17329
|
+
if (!ts12.isVariableStatement(stmt))
|
|
17204
17330
|
continue;
|
|
17205
|
-
const isExported = stmt.modifiers?.some((m) => m.kind ===
|
|
17331
|
+
const isExported = stmt.modifiers?.some((m) => m.kind === ts12.SyntaxKind.ExportKeyword);
|
|
17206
17332
|
if (!isExported)
|
|
17207
17333
|
continue;
|
|
17208
17334
|
for (const decl of stmt.declarationList.declarations) {
|
|
17209
|
-
if (!
|
|
17335
|
+
if (!ts12.isIdentifier(decl.name))
|
|
17210
17336
|
continue;
|
|
17211
17337
|
if (!PAGE_EXPORT_NAMES.has(decl.name.text))
|
|
17212
17338
|
continue;
|
|
@@ -17247,35 +17373,35 @@ var fail = (reason, detail, location) => ({
|
|
|
17247
17373
|
}, buildFreshClassMethodsBlock = (classNode, className) => {
|
|
17248
17374
|
const memberSources = [];
|
|
17249
17375
|
let hasStatic = false;
|
|
17250
|
-
const printer =
|
|
17376
|
+
const printer = ts12.createPrinter({ removeComments: true });
|
|
17251
17377
|
for (const member of classNode.members) {
|
|
17252
|
-
if (
|
|
17253
|
-
const modifiers = (
|
|
17254
|
-
const cleaned =
|
|
17255
|
-
memberSources.push(printer.printNode(
|
|
17378
|
+
if (ts12.isPropertyDeclaration(member)) {
|
|
17379
|
+
const modifiers = (ts12.getModifiers(member) ?? []).filter((m) => m.kind !== ts12.SyntaxKind.PrivateKeyword && m.kind !== ts12.SyntaxKind.PublicKeyword && m.kind !== ts12.SyntaxKind.ProtectedKeyword && m.kind !== ts12.SyntaxKind.ReadonlyKeyword && m.kind !== ts12.SyntaxKind.OverrideKeyword);
|
|
17380
|
+
const cleaned = ts12.factory.createPropertyDeclaration(modifiers, member.name, undefined, undefined, member.initializer);
|
|
17381
|
+
memberSources.push(printer.printNode(ts12.EmitHint.Unspecified, cleaned, classNode.getSourceFile()));
|
|
17256
17382
|
continue;
|
|
17257
17383
|
}
|
|
17258
|
-
if (
|
|
17259
|
-
const cleanedParams = member.parameters.map((param) =>
|
|
17260
|
-
const cleaned =
|
|
17261
|
-
memberSources.push(printer.printNode(
|
|
17384
|
+
if (ts12.isConstructorDeclaration(member)) {
|
|
17385
|
+
const cleanedParams = member.parameters.map((param) => ts12.factory.updateParameterDeclaration(param, (ts12.getModifiers(param) ?? []).filter((m) => m.kind !== ts12.SyntaxKind.PrivateKeyword && m.kind !== ts12.SyntaxKind.PublicKeyword && m.kind !== ts12.SyntaxKind.ProtectedKeyword && m.kind !== ts12.SyntaxKind.ReadonlyKeyword && m.kind !== ts12.SyntaxKind.OverrideKeyword), param.dotDotDotToken, param.name, param.questionToken, param.type, param.initializer));
|
|
17386
|
+
const cleaned = ts12.factory.createConstructorDeclaration([], cleanedParams, member.body);
|
|
17387
|
+
memberSources.push(printer.printNode(ts12.EmitHint.Unspecified, cleaned, classNode.getSourceFile()));
|
|
17262
17388
|
continue;
|
|
17263
17389
|
}
|
|
17264
|
-
if (
|
|
17265
|
-
const modifiers =
|
|
17266
|
-
const isStatic = modifiers.some((m) => m.kind ===
|
|
17390
|
+
if (ts12.isMethodDeclaration(member) || ts12.isGetAccessorDeclaration(member) || ts12.isSetAccessorDeclaration(member)) {
|
|
17391
|
+
const modifiers = ts12.getModifiers(member) ?? [];
|
|
17392
|
+
const isStatic = modifiers.some((m) => m.kind === ts12.SyntaxKind.StaticKeyword);
|
|
17267
17393
|
if (isStatic)
|
|
17268
17394
|
hasStatic = true;
|
|
17269
|
-
const cleanedParams = member.parameters.map((param) =>
|
|
17395
|
+
const cleanedParams = member.parameters.map((param) => ts12.factory.updateParameterDeclaration(param, ts12.getModifiers(param) ?? [], param.dotDotDotToken, param.name, param.questionToken, param.type, param.initializer));
|
|
17270
17396
|
let cleaned;
|
|
17271
|
-
if (
|
|
17272
|
-
cleaned =
|
|
17273
|
-
} else if (
|
|
17274
|
-
cleaned =
|
|
17397
|
+
if (ts12.isMethodDeclaration(member)) {
|
|
17398
|
+
cleaned = ts12.factory.createMethodDeclaration(modifiers, member.asteriskToken, member.name, member.questionToken, member.typeParameters, cleanedParams, member.type, member.body);
|
|
17399
|
+
} else if (ts12.isGetAccessorDeclaration(member)) {
|
|
17400
|
+
cleaned = ts12.factory.createGetAccessorDeclaration(modifiers, member.name, cleanedParams, member.type, member.body);
|
|
17275
17401
|
} else {
|
|
17276
|
-
cleaned =
|
|
17402
|
+
cleaned = ts12.factory.createSetAccessorDeclaration(modifiers, member.name, cleanedParams, member.body);
|
|
17277
17403
|
}
|
|
17278
|
-
const printed = printer.printNode(
|
|
17404
|
+
const printed = printer.printNode(ts12.EmitHint.Unspecified, cleaned, classNode.getSourceFile());
|
|
17279
17405
|
memberSources.push(printed);
|
|
17280
17406
|
}
|
|
17281
17407
|
}
|
|
@@ -17287,10 +17413,10 @@ ${memberSources.join(`
|
|
|
17287
17413
|
}`;
|
|
17288
17414
|
let transpiled;
|
|
17289
17415
|
try {
|
|
17290
|
-
transpiled =
|
|
17416
|
+
transpiled = ts12.transpileModule(wrappedSource, {
|
|
17291
17417
|
compilerOptions: {
|
|
17292
|
-
module:
|
|
17293
|
-
target:
|
|
17418
|
+
module: ts12.ModuleKind.ES2022,
|
|
17419
|
+
target: ts12.ScriptTarget.ES2022
|
|
17294
17420
|
},
|
|
17295
17421
|
reportDiagnostics: false
|
|
17296
17422
|
}).outputText;
|
|
@@ -17324,7 +17450,7 @@ ${transpiled}
|
|
|
17324
17450
|
return null;
|
|
17325
17451
|
const ext = extname6(abs).toLowerCase();
|
|
17326
17452
|
if (!STYLE_PREPROCESSED_EXT.has(ext) || ext === ".css") {
|
|
17327
|
-
return
|
|
17453
|
+
return readFileSync16(abs, "utf8");
|
|
17328
17454
|
}
|
|
17329
17455
|
try {
|
|
17330
17456
|
const { compileStyleFileIfNeededSync: compileStyleFileIfNeededSync2 } = (init_stylePreprocessor(), __toCommonJS(exports_stylePreprocessor));
|
|
@@ -17363,8 +17489,8 @@ ${block}
|
|
|
17363
17489
|
const opts = {};
|
|
17364
17490
|
if (existsSync22(tsconfigPath)) {
|
|
17365
17491
|
try {
|
|
17366
|
-
const text =
|
|
17367
|
-
const parsed =
|
|
17492
|
+
const text = readFileSync16(tsconfigPath, "utf8");
|
|
17493
|
+
const parsed = ts12.parseConfigFileTextToJson(tsconfigPath, text);
|
|
17368
17494
|
if (!parsed.error && parsed.config) {
|
|
17369
17495
|
const cfg = parsed.config;
|
|
17370
17496
|
const ang = cfg.angularCompilerOptions ?? {};
|
|
@@ -17397,15 +17523,15 @@ ${block}
|
|
|
17397
17523
|
} catch (err) {
|
|
17398
17524
|
return fail("unexpected-error", `import @angular/compiler: ${err}`);
|
|
17399
17525
|
}
|
|
17400
|
-
const tsSource =
|
|
17401
|
-
const sourceFile =
|
|
17526
|
+
const tsSource = readFileSync16(componentFilePath, "utf8");
|
|
17527
|
+
const sourceFile = ts12.createSourceFile(componentFilePath, tsSource, ts12.ScriptTarget.ES2022, true, ts12.ScriptKind.TS);
|
|
17402
17528
|
const classNode = findClassDeclaration(sourceFile, className);
|
|
17403
17529
|
if (!classNode) {
|
|
17404
17530
|
return fail("class-not-found", `${className} in ${componentFilePath}`);
|
|
17405
17531
|
}
|
|
17406
17532
|
const kind = params.kind ?? "component";
|
|
17407
17533
|
if (kind !== "component") {
|
|
17408
|
-
const entityId = encodeURIComponent(`${
|
|
17534
|
+
const entityId = encodeURIComponent(`${relative14(projectRoot, componentFilePath).replace(/\\/g, "/")}@${className}`);
|
|
17409
17535
|
const currentEntityFingerprint = extractEntityFingerprint(classNode, className, sourceFile);
|
|
17410
17536
|
const cachedEntityFingerprint = entityFingerprintCache.get(entityId);
|
|
17411
17537
|
if (cachedEntityFingerprint !== undefined && !entityFingerprintsEqual(cachedEntityFingerprint, currentEntityFingerprint)) {
|
|
@@ -17447,7 +17573,7 @@ ${block}
|
|
|
17447
17573
|
if (!existsSync22(tplAbs)) {
|
|
17448
17574
|
return fail("template-resource-not-found", `Template file not found: ${tplAbs}`, { file: componentFilePath });
|
|
17449
17575
|
}
|
|
17450
|
-
templateText =
|
|
17576
|
+
templateText = readFileSync16(tplAbs, "utf8");
|
|
17451
17577
|
templatePath = tplAbs;
|
|
17452
17578
|
} else {
|
|
17453
17579
|
return fail("unsupported-decorator-args", "missing template/templateUrl");
|
|
@@ -17489,7 +17615,7 @@ ${block}
|
|
|
17489
17615
|
return fail("class-not-found", "anonymous class");
|
|
17490
17616
|
const wrappedClass = new compiler.WrappedNodeExpr(className_);
|
|
17491
17617
|
const { inputs, outputs, hasDecoratorIO, hasSignalIO } = extractInputsAndOutputs(classNode, compiler);
|
|
17492
|
-
const projectRelPath =
|
|
17618
|
+
const projectRelPath = relative14(projectRoot, componentFilePath).replace(/\\/g, "/");
|
|
17493
17619
|
const fingerprintId = encodeURIComponent(`${projectRelPath}@${className}`);
|
|
17494
17620
|
const currentFingerprint = extractFingerprint(classNode, className, decoratorMeta, inputs, outputs, sourceFile, componentDir);
|
|
17495
17621
|
const cachedFingerprint = fingerprintCache.get(fingerprintId);
|
|
@@ -17518,7 +17644,7 @@ ${block}
|
|
|
17518
17644
|
viewQueries: advancedMetadata.viewQueries,
|
|
17519
17645
|
host: advancedMetadata.host,
|
|
17520
17646
|
lifecycle: {
|
|
17521
|
-
usesOnChanges: classNode.members.some((m) =>
|
|
17647
|
+
usesOnChanges: classNode.members.some((m) => ts12.isMethodDeclaration(m) && m.name !== undefined && ts12.isIdentifier(m.name) && m.name.text === "ngOnChanges")
|
|
17522
17648
|
},
|
|
17523
17649
|
inputs,
|
|
17524
17650
|
outputs,
|
|
@@ -17574,15 +17700,15 @@ ${block}
|
|
|
17574
17700
|
}
|
|
17575
17701
|
const importGenerator = createHmrImportGenerator(namespaceMap);
|
|
17576
17702
|
const tsFunctionDecl = translateStatement(sourceFile, callback, importGenerator);
|
|
17577
|
-
const exportedDecl =
|
|
17578
|
-
|
|
17579
|
-
|
|
17703
|
+
const exportedDecl = ts12.factory.updateFunctionDeclaration(tsFunctionDecl, [
|
|
17704
|
+
ts12.factory.createToken(ts12.SyntaxKind.ExportKeyword),
|
|
17705
|
+
ts12.factory.createToken(ts12.SyntaxKind.DefaultKeyword)
|
|
17580
17706
|
], tsFunctionDecl.asteriskToken, tsFunctionDecl.name, tsFunctionDecl.typeParameters, tsFunctionDecl.parameters, tsFunctionDecl.type, tsFunctionDecl.body);
|
|
17581
|
-
const printer =
|
|
17582
|
-
newLine:
|
|
17707
|
+
const printer = ts12.createPrinter({
|
|
17708
|
+
newLine: ts12.NewLineKind.LineFeed,
|
|
17583
17709
|
removeComments: false
|
|
17584
17710
|
});
|
|
17585
|
-
const fnText = printer.printNode(
|
|
17711
|
+
const fnText = printer.printNode(ts12.EmitHint.Unspecified, exportedDecl, sourceFile);
|
|
17586
17712
|
const provisionalMethodsBlock = buildFreshClassMethodsBlock(classNode, className) ?? "";
|
|
17587
17713
|
const referencedNames = new Set;
|
|
17588
17714
|
const identRe = /[A-Za-z_$][A-Za-z0-9_$]*/g;
|
|
@@ -17592,33 +17718,33 @@ ${block}
|
|
|
17592
17718
|
}
|
|
17593
17719
|
const sourceScopeNames = new Set;
|
|
17594
17720
|
for (const stmt of sourceFile.statements) {
|
|
17595
|
-
if (
|
|
17596
|
-
if (!
|
|
17721
|
+
if (ts12.isImportDeclaration(stmt)) {
|
|
17722
|
+
if (!ts12.isStringLiteral(stmt.moduleSpecifier))
|
|
17597
17723
|
continue;
|
|
17598
17724
|
const clause = stmt.importClause;
|
|
17599
17725
|
if (clause?.name)
|
|
17600
17726
|
sourceScopeNames.add(clause.name.text);
|
|
17601
|
-
if (clause?.namedBindings &&
|
|
17727
|
+
if (clause?.namedBindings && ts12.isNamedImports(clause.namedBindings)) {
|
|
17602
17728
|
for (const el of clause.namedBindings.elements) {
|
|
17603
17729
|
if (el.isTypeOnly)
|
|
17604
17730
|
continue;
|
|
17605
17731
|
sourceScopeNames.add(el.name.text);
|
|
17606
17732
|
}
|
|
17607
|
-
} else if (clause?.namedBindings &&
|
|
17733
|
+
} else if (clause?.namedBindings && ts12.isNamespaceImport(clause.namedBindings)) {
|
|
17608
17734
|
sourceScopeNames.add(clause.namedBindings.name.text);
|
|
17609
17735
|
}
|
|
17610
17736
|
continue;
|
|
17611
17737
|
}
|
|
17612
|
-
if (
|
|
17738
|
+
if (ts12.isVariableStatement(stmt) || stmt.kind === ts12.SyntaxKind.VariableStatement) {
|
|
17613
17739
|
const varStmt = stmt;
|
|
17614
17740
|
for (const decl of varStmt.declarationList.declarations) {
|
|
17615
|
-
if (
|
|
17741
|
+
if (ts12.isIdentifier(decl.name)) {
|
|
17616
17742
|
sourceScopeNames.add(decl.name.text);
|
|
17617
17743
|
}
|
|
17618
17744
|
}
|
|
17619
17745
|
continue;
|
|
17620
17746
|
}
|
|
17621
|
-
if (
|
|
17747
|
+
if (ts12.isFunctionDeclaration(stmt) || ts12.isClassDeclaration(stmt)) {
|
|
17622
17748
|
if (stmt.name)
|
|
17623
17749
|
sourceScopeNames.add(stmt.name.text);
|
|
17624
17750
|
}
|
|
@@ -17629,7 +17755,7 @@ ${block}
|
|
|
17629
17755
|
}
|
|
17630
17756
|
const allImportedNames = new Set;
|
|
17631
17757
|
for (const stmt of sourceFile.statements) {
|
|
17632
|
-
if (!
|
|
17758
|
+
if (!ts12.isImportDeclaration(stmt))
|
|
17633
17759
|
continue;
|
|
17634
17760
|
const clause = stmt.importClause;
|
|
17635
17761
|
if (!clause || clause.isTypeOnly)
|
|
@@ -17639,7 +17765,7 @@ ${block}
|
|
|
17639
17765
|
const bindings = clause.namedBindings;
|
|
17640
17766
|
if (!bindings)
|
|
17641
17767
|
continue;
|
|
17642
|
-
if (
|
|
17768
|
+
if (ts12.isNamespaceImport(bindings)) {
|
|
17643
17769
|
allImportedNames.add(bindings.name.text);
|
|
17644
17770
|
} else {
|
|
17645
17771
|
for (const el of bindings.elements) {
|
|
@@ -17651,10 +17777,10 @@ ${block}
|
|
|
17651
17777
|
}
|
|
17652
17778
|
const depsToDestructure = [...sourceScopeNames].filter((n) => referencedNames.has(n) || allImportedNames.has(n));
|
|
17653
17779
|
const tsSourceText = fnText;
|
|
17654
|
-
const transpiled =
|
|
17780
|
+
const transpiled = ts12.transpileModule(tsSourceText, {
|
|
17655
17781
|
compilerOptions: {
|
|
17656
|
-
module:
|
|
17657
|
-
target:
|
|
17782
|
+
module: ts12.ModuleKind.ES2022,
|
|
17783
|
+
target: ts12.ScriptTarget.ES2022
|
|
17658
17784
|
},
|
|
17659
17785
|
fileName: componentFilePath,
|
|
17660
17786
|
reportDiagnostics: false
|
|
@@ -18202,11 +18328,11 @@ __export(exports_compileEmber, {
|
|
|
18202
18328
|
compileEmberFile: () => compileEmberFile,
|
|
18203
18329
|
compileEmber: () => compileEmber,
|
|
18204
18330
|
clearEmberCompilerCache: () => clearEmberCompilerCache,
|
|
18205
|
-
basename: () =>
|
|
18331
|
+
basename: () => basename9
|
|
18206
18332
|
});
|
|
18207
18333
|
import { existsSync as existsSync23 } from "fs";
|
|
18208
18334
|
import { mkdir as mkdir6, rm as rm4 } from "fs/promises";
|
|
18209
|
-
import { basename as
|
|
18335
|
+
import { basename as basename9, dirname as dirname17, extname as extname7, join as join29, resolve as resolve24 } from "path";
|
|
18210
18336
|
var {build: bunBuild2, Transpiler: Transpiler4, write: write4, file: file3 } = globalThis.Bun;
|
|
18211
18337
|
var cachedPreprocessor = null, getPreprocessor = async () => {
|
|
18212
18338
|
if (cachedPreprocessor)
|
|
@@ -18325,7 +18451,7 @@ export const importSync = (specifier) => {
|
|
|
18325
18451
|
build.onResolve({ filter: /^@(?:ember|glimmer|simple-dom)\// }, (args) => {
|
|
18326
18452
|
if (standalonePackages.has(args.path))
|
|
18327
18453
|
return;
|
|
18328
|
-
const internal =
|
|
18454
|
+
const internal = join29(cwd, "node_modules/ember-source/dist/packages", args.path, "index.js");
|
|
18329
18455
|
if (existsSync23(internal))
|
|
18330
18456
|
return { path: internal };
|
|
18331
18457
|
return;
|
|
@@ -18372,17 +18498,17 @@ export default PageComponent;
|
|
|
18372
18498
|
preprocessed = rewriteTemplateEvalToScope(result.code);
|
|
18373
18499
|
}
|
|
18374
18500
|
const transpiled = transpiler5.transformSync(preprocessed);
|
|
18375
|
-
const baseName =
|
|
18376
|
-
const tmpDir =
|
|
18377
|
-
const serverDir =
|
|
18378
|
-
const clientDir =
|
|
18501
|
+
const baseName = basename9(resolvedEntry).replace(/\.(gjs|gts|ts|js)$/, "");
|
|
18502
|
+
const tmpDir = join29(compiledRoot, "_tmp");
|
|
18503
|
+
const serverDir = join29(compiledRoot, "server");
|
|
18504
|
+
const clientDir = join29(compiledRoot, "client");
|
|
18379
18505
|
await Promise.all([
|
|
18380
18506
|
mkdir6(tmpDir, { recursive: true }),
|
|
18381
18507
|
mkdir6(serverDir, { recursive: true }),
|
|
18382
18508
|
mkdir6(clientDir, { recursive: true })
|
|
18383
18509
|
]);
|
|
18384
|
-
const tmpPagePath = resolve24(
|
|
18385
|
-
const tmpHarnessPath = resolve24(
|
|
18510
|
+
const tmpPagePath = resolve24(join29(tmpDir, `${baseName}.module.js`));
|
|
18511
|
+
const tmpHarnessPath = resolve24(join29(tmpDir, `${baseName}.harness.js`));
|
|
18386
18512
|
await Promise.all([
|
|
18387
18513
|
write4(tmpPagePath, transpiled),
|
|
18388
18514
|
write4(tmpHarnessPath, generateServerHarness(tmpPagePath))
|
|
@@ -18390,7 +18516,7 @@ export default PageComponent;
|
|
|
18390
18516
|
const stagedSourceMap = new Map([
|
|
18391
18517
|
[tmpPagePath, resolvedEntry]
|
|
18392
18518
|
]);
|
|
18393
|
-
const serverPath =
|
|
18519
|
+
const serverPath = join29(serverDir, `${baseName}.js`);
|
|
18394
18520
|
const buildResult = await bunBuild2({
|
|
18395
18521
|
entrypoints: [tmpHarnessPath],
|
|
18396
18522
|
format: "esm",
|
|
@@ -18407,7 +18533,7 @@ export default PageComponent;
|
|
|
18407
18533
|
console.warn(`\u26A0\uFE0F Ember server build for ${baseName} had errors:`, buildResult.logs);
|
|
18408
18534
|
}
|
|
18409
18535
|
await rm4(tmpDir, { force: true, recursive: true });
|
|
18410
|
-
const clientPath =
|
|
18536
|
+
const clientPath = join29(clientDir, `${baseName}.js`);
|
|
18411
18537
|
await write4(clientPath, transpiled);
|
|
18412
18538
|
return { clientPath, serverPath };
|
|
18413
18539
|
}, compileEmber = async (entries, emberDir, cwd = process.cwd(), _hmr = false) => {
|
|
@@ -18435,7 +18561,7 @@ export default PageComponent;
|
|
|
18435
18561
|
preprocessed = rewriteTemplateEvalToScope(result.code);
|
|
18436
18562
|
}
|
|
18437
18563
|
return transpiler5.transformSync(preprocessed);
|
|
18438
|
-
}, clearEmberCompilerCache = () => {}, getEmberCompiledRoot = (_emberDir) => getFrameworkGeneratedDir("ember"), getEmberServerCompiledDir = (emberDir) =>
|
|
18564
|
+
}, clearEmberCompilerCache = () => {}, getEmberCompiledRoot = (_emberDir) => getFrameworkGeneratedDir("ember"), getEmberServerCompiledDir = (emberDir) => join29(getEmberCompiledRoot(emberDir), "server"), getEmberClientCompiledDir = (emberDir) => join29(getEmberCompiledRoot(emberDir), "client");
|
|
18439
18565
|
var init_compileEmber = __esm(() => {
|
|
18440
18566
|
init_generatedDir();
|
|
18441
18567
|
transpiler5 = new Transpiler4({
|
|
@@ -18457,7 +18583,7 @@ __export(exports_buildReactVendor, {
|
|
|
18457
18583
|
buildReactVendor: () => buildReactVendor
|
|
18458
18584
|
});
|
|
18459
18585
|
import { existsSync as existsSync24, mkdirSync as mkdirSync10 } from "fs";
|
|
18460
|
-
import { join as
|
|
18586
|
+
import { join as join30, resolve as resolve25 } from "path";
|
|
18461
18587
|
import { rm as rm5 } from "fs/promises";
|
|
18462
18588
|
var {build: bunBuild3 } = globalThis.Bun;
|
|
18463
18589
|
var resolveJsxDevRuntimeCompatPath = () => {
|
|
@@ -18511,14 +18637,14 @@ var resolveJsxDevRuntimeCompatPath = () => {
|
|
|
18511
18637
|
`)}
|
|
18512
18638
|
`;
|
|
18513
18639
|
}, buildReactVendor = async (buildDir) => {
|
|
18514
|
-
const vendorDir =
|
|
18640
|
+
const vendorDir = join30(buildDir, "react", "vendor");
|
|
18515
18641
|
mkdirSync10(vendorDir, { recursive: true });
|
|
18516
|
-
const tmpDir =
|
|
18642
|
+
const tmpDir = join30(buildDir, "_vendor_tmp");
|
|
18517
18643
|
mkdirSync10(tmpDir, { recursive: true });
|
|
18518
18644
|
const specifiers = resolveVendorSpecifiers();
|
|
18519
18645
|
const entrypoints = await Promise.all(specifiers.map(async (specifier) => {
|
|
18520
18646
|
const safeName = toSafeFileName(specifier);
|
|
18521
|
-
const entryPath =
|
|
18647
|
+
const entryPath = join30(tmpDir, `${safeName}.ts`);
|
|
18522
18648
|
const source = await generateEntrySource(specifier);
|
|
18523
18649
|
await Bun.write(entryPath, source);
|
|
18524
18650
|
return entryPath;
|
|
@@ -18583,7 +18709,7 @@ __export(exports_buildAngularVendor, {
|
|
|
18583
18709
|
buildAngularServerVendor: () => buildAngularServerVendor
|
|
18584
18710
|
});
|
|
18585
18711
|
import { mkdirSync as mkdirSync11 } from "fs";
|
|
18586
|
-
import { join as
|
|
18712
|
+
import { join as join31 } from "path";
|
|
18587
18713
|
import { rm as rm6 } from "fs/promises";
|
|
18588
18714
|
var {build: bunBuild4, Glob: Glob7 } = globalThis.Bun;
|
|
18589
18715
|
var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => jitMode ? [...REQUIRED_ANGULAR_SPECIFIERS_BASE, "@angular/compiler"] : REQUIRED_ANGULAR_SPECIFIERS_BASE, SERVER_ONLY_ANGULAR_SPECIFIERS, BUILD_ONLY_ANGULAR_SPECIFIER_PREFIXES, isBuildOnlyAngularSpecifier = (spec) => BUILD_ONLY_ANGULAR_SPECIFIER_PREFIXES.some((prefix) => spec === prefix || spec.startsWith(`${prefix}/`)), SCAN_SKIP_DIRS, isResolvable2 = (specifier) => {
|
|
@@ -18620,7 +18746,7 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
|
|
|
18620
18746
|
}
|
|
18621
18747
|
return { angular, transitiveRoots };
|
|
18622
18748
|
}, PARTIAL_DECL_MARKERS, containsPartialDeclarations = (source) => PARTIAL_DECL_MARKERS.some((marker) => source.includes(marker)), collectTransitiveAngularSpecs = async (roots, angularFound) => {
|
|
18623
|
-
const { readFileSync:
|
|
18749
|
+
const { readFileSync: readFileSync17 } = await import("fs");
|
|
18624
18750
|
const transpiler6 = new Bun.Transpiler({ loader: "js" });
|
|
18625
18751
|
const visited = new Set;
|
|
18626
18752
|
const frontier = [];
|
|
@@ -18641,7 +18767,7 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
|
|
|
18641
18767
|
}
|
|
18642
18768
|
let content;
|
|
18643
18769
|
try {
|
|
18644
|
-
content =
|
|
18770
|
+
content = readFileSync17(resolved, "utf-8");
|
|
18645
18771
|
} catch {
|
|
18646
18772
|
continue;
|
|
18647
18773
|
}
|
|
@@ -18680,14 +18806,14 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
|
|
|
18680
18806
|
await collectTransitiveAngularSpecs([...angular, ...transitiveRoots], angular);
|
|
18681
18807
|
return Array.from(angular).filter(isResolvable2);
|
|
18682
18808
|
}, buildAngularVendor = async (buildDir, directories = [], linkerJitMode = false, depVendorSpecifiers = []) => {
|
|
18683
|
-
const vendorDir =
|
|
18809
|
+
const vendorDir = join31(buildDir, "angular", "vendor");
|
|
18684
18810
|
mkdirSync11(vendorDir, { recursive: true });
|
|
18685
|
-
const tmpDir =
|
|
18811
|
+
const tmpDir = join31(buildDir, "_angular_vendor_tmp");
|
|
18686
18812
|
mkdirSync11(tmpDir, { recursive: true });
|
|
18687
18813
|
const specifiers = await resolveAngularSpecifiers(directories, linkerJitMode);
|
|
18688
18814
|
const entrypoints = await Promise.all(specifiers.map(async (specifier) => {
|
|
18689
18815
|
const safeName = toSafeFileName2(specifier);
|
|
18690
|
-
const entryPath =
|
|
18816
|
+
const entryPath = join31(tmpDir, `${safeName}.ts`);
|
|
18691
18817
|
await Bun.write(entryPath, await generateVendorEntrySource(specifier));
|
|
18692
18818
|
return entryPath;
|
|
18693
18819
|
}));
|
|
@@ -18718,9 +18844,9 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
|
|
|
18718
18844
|
const specifiers = await resolveAngularSpecifiers(directories, linkerJitMode);
|
|
18719
18845
|
return computeAngularVendorPaths(specifiers);
|
|
18720
18846
|
}, buildAngularServerVendor = async (buildDir, directories = [], linkerJitMode = false) => {
|
|
18721
|
-
const vendorDir =
|
|
18847
|
+
const vendorDir = join31(buildDir, "angular", "vendor", "server");
|
|
18722
18848
|
mkdirSync11(vendorDir, { recursive: true });
|
|
18723
|
-
const tmpDir =
|
|
18849
|
+
const tmpDir = join31(buildDir, "_angular_server_vendor_tmp");
|
|
18724
18850
|
mkdirSync11(tmpDir, { recursive: true });
|
|
18725
18851
|
const browserSpecs = await resolveAngularSpecifiers(directories, linkerJitMode);
|
|
18726
18852
|
const allSpecs = new Set(browserSpecs);
|
|
@@ -18731,7 +18857,7 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
|
|
|
18731
18857
|
const specifiers = Array.from(allSpecs);
|
|
18732
18858
|
const entrypoints = await Promise.all(specifiers.map(async (specifier) => {
|
|
18733
18859
|
const safeName = toSafeFileName2(specifier);
|
|
18734
|
-
const entryPath =
|
|
18860
|
+
const entryPath = join31(tmpDir, `${safeName}.ts`);
|
|
18735
18861
|
await Bun.write(entryPath, await generateVendorEntrySource(specifier));
|
|
18736
18862
|
return entryPath;
|
|
18737
18863
|
}));
|
|
@@ -18753,9 +18879,9 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
|
|
|
18753
18879
|
return specifiers;
|
|
18754
18880
|
}, computeAngularServerVendorPaths = (buildDir, specifiers) => {
|
|
18755
18881
|
const paths = {};
|
|
18756
|
-
const vendorDir =
|
|
18882
|
+
const vendorDir = join31(buildDir, "angular", "vendor", "server");
|
|
18757
18883
|
for (const specifier of specifiers) {
|
|
18758
|
-
paths[specifier] =
|
|
18884
|
+
paths[specifier] = join31(vendorDir, `${toSafeFileName2(specifier)}.js`);
|
|
18759
18885
|
}
|
|
18760
18886
|
return paths;
|
|
18761
18887
|
}, computeAngularServerVendorPathsAsync = async (buildDir, directories = [], linkerJitMode = true) => {
|
|
@@ -18811,17 +18937,17 @@ __export(exports_buildVueVendor, {
|
|
|
18811
18937
|
buildVueVendor: () => buildVueVendor
|
|
18812
18938
|
});
|
|
18813
18939
|
import { mkdirSync as mkdirSync12 } from "fs";
|
|
18814
|
-
import { join as
|
|
18940
|
+
import { join as join32 } from "path";
|
|
18815
18941
|
import { rm as rm7 } from "fs/promises";
|
|
18816
18942
|
var {build: bunBuild5 } = globalThis.Bun;
|
|
18817
18943
|
var vueSpecifiers, toSafeFileName3 = (specifier) => specifier.replace(/\//g, "_"), buildVueVendor = async (buildDir) => {
|
|
18818
|
-
const vendorDir =
|
|
18944
|
+
const vendorDir = join32(buildDir, "vue", "vendor");
|
|
18819
18945
|
mkdirSync12(vendorDir, { recursive: true });
|
|
18820
|
-
const tmpDir =
|
|
18946
|
+
const tmpDir = join32(buildDir, "_vue_vendor_tmp");
|
|
18821
18947
|
mkdirSync12(tmpDir, { recursive: true });
|
|
18822
18948
|
const entrypoints = await Promise.all(vueSpecifiers.map(async (specifier) => {
|
|
18823
18949
|
const safeName = toSafeFileName3(specifier);
|
|
18824
|
-
const entryPath =
|
|
18950
|
+
const entryPath = join32(tmpDir, `${safeName}.ts`);
|
|
18825
18951
|
await Bun.write(entryPath, `export * from '${specifier}';
|
|
18826
18952
|
`);
|
|
18827
18953
|
return entryPath;
|
|
@@ -18846,11 +18972,11 @@ var vueSpecifiers, toSafeFileName3 = (specifier) => specifier.replace(/\//g, "_"
|
|
|
18846
18972
|
console.warn("\u26A0\uFE0F Vue vendor build had errors:", result.logs);
|
|
18847
18973
|
return;
|
|
18848
18974
|
}
|
|
18849
|
-
const { readFileSync:
|
|
18850
|
-
const files =
|
|
18975
|
+
const { readFileSync: readFileSync17, writeFileSync: writeFileSync10, readdirSync: readdirSync4 } = await import("fs");
|
|
18976
|
+
const files = readdirSync4(vendorDir).filter((f2) => f2.endsWith(".js"));
|
|
18851
18977
|
for (const file4 of files) {
|
|
18852
|
-
const filePath =
|
|
18853
|
-
const content =
|
|
18978
|
+
const filePath = join32(vendorDir, file4);
|
|
18979
|
+
const content = readFileSync17(filePath, "utf-8");
|
|
18854
18980
|
if (!content.includes("__VUE_HMR_RUNTIME__"))
|
|
18855
18981
|
continue;
|
|
18856
18982
|
const patched = content.replace(/getGlobalThis\(\)\.__VUE_HMR_RUNTIME__\s*=\s*\{/, "getGlobalThis().__VUE_HMR_RUNTIME__ = getGlobalThis().__VUE_HMR_RUNTIME__ || {");
|
|
@@ -18876,7 +19002,7 @@ __export(exports_buildSvelteVendor, {
|
|
|
18876
19002
|
buildSvelteVendor: () => buildSvelteVendor
|
|
18877
19003
|
});
|
|
18878
19004
|
import { mkdirSync as mkdirSync13 } from "fs";
|
|
18879
|
-
import { join as
|
|
19005
|
+
import { join as join33 } from "path";
|
|
18880
19006
|
import { rm as rm8 } from "fs/promises";
|
|
18881
19007
|
var {build: bunBuild6 } = globalThis.Bun;
|
|
18882
19008
|
var svelteSpecifiers, isResolvable3 = (specifier) => {
|
|
@@ -18890,13 +19016,13 @@ var svelteSpecifiers, isResolvable3 = (specifier) => {
|
|
|
18890
19016
|
const specifiers = resolveVendorSpecifiers2();
|
|
18891
19017
|
if (specifiers.length === 0)
|
|
18892
19018
|
return;
|
|
18893
|
-
const vendorDir =
|
|
19019
|
+
const vendorDir = join33(buildDir, "svelte", "vendor");
|
|
18894
19020
|
mkdirSync13(vendorDir, { recursive: true });
|
|
18895
|
-
const tmpDir =
|
|
19021
|
+
const tmpDir = join33(buildDir, "_svelte_vendor_tmp");
|
|
18896
19022
|
mkdirSync13(tmpDir, { recursive: true });
|
|
18897
19023
|
const entrypoints = await Promise.all(specifiers.map(async (specifier) => {
|
|
18898
19024
|
const safeName = toSafeFileName4(specifier);
|
|
18899
|
-
const entryPath =
|
|
19025
|
+
const entryPath = join33(tmpDir, `${safeName}.ts`);
|
|
18900
19026
|
await Bun.write(entryPath, `export * from '${specifier}';
|
|
18901
19027
|
`);
|
|
18902
19028
|
return entryPath;
|
|
@@ -18946,7 +19072,7 @@ __export(exports_rewriteImportsPlugin, {
|
|
|
18946
19072
|
buildWithImportRewrite: () => buildWithImportRewrite
|
|
18947
19073
|
});
|
|
18948
19074
|
import { readdir as readdir3 } from "fs/promises";
|
|
18949
|
-
import { join as
|
|
19075
|
+
import { join as join34 } from "path";
|
|
18950
19076
|
var escapeRegex2 = (str) => str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), jsRewriteImports = (content, replacements) => {
|
|
18951
19077
|
let result = content;
|
|
18952
19078
|
for (const [specifier, webPath] of replacements) {
|
|
@@ -19075,7 +19201,7 @@ ${content}`;
|
|
|
19075
19201
|
const entries = await readdir3(dir);
|
|
19076
19202
|
for (const entry of entries) {
|
|
19077
19203
|
if (entry.endsWith(".js"))
|
|
19078
|
-
allFiles.push(
|
|
19204
|
+
allFiles.push(join34(dir, entry));
|
|
19079
19205
|
}
|
|
19080
19206
|
} catch {}
|
|
19081
19207
|
}
|
|
@@ -19119,12 +19245,12 @@ import {
|
|
|
19119
19245
|
cpSync,
|
|
19120
19246
|
existsSync as existsSync25,
|
|
19121
19247
|
mkdirSync as mkdirSync14,
|
|
19122
|
-
readFileSync as
|
|
19248
|
+
readFileSync as readFileSync17,
|
|
19123
19249
|
rmSync as rmSync2,
|
|
19124
19250
|
statSync as statSync3,
|
|
19125
19251
|
writeFileSync as writeFileSync10
|
|
19126
19252
|
} from "fs";
|
|
19127
|
-
import { basename as
|
|
19253
|
+
import { basename as basename10, dirname as dirname18, extname as extname8, join as join35, relative as relative15, resolve as resolve26 } from "path";
|
|
19128
19254
|
import { cwd, env as env2, exit } from "process";
|
|
19129
19255
|
var {build: bunBuild7, Glob: Glob8 } = globalThis.Bun;
|
|
19130
19256
|
var isDev, isBuildTraceEnabled = () => {
|
|
@@ -19202,8 +19328,8 @@ var isDev, isBuildTraceEnabled = () => {
|
|
|
19202
19328
|
mkdirSync14(htmxDestDir, { recursive: true });
|
|
19203
19329
|
const glob = new Glob8("htmx*.min.js");
|
|
19204
19330
|
for (const relPath of glob.scanSync({ cwd: htmxDir })) {
|
|
19205
|
-
const src =
|
|
19206
|
-
const dest =
|
|
19331
|
+
const src = join35(htmxDir, relPath);
|
|
19332
|
+
const dest = join35(htmxDestDir, "htmx.min.js");
|
|
19207
19333
|
copyFileSync2(src, dest);
|
|
19208
19334
|
return;
|
|
19209
19335
|
}
|
|
@@ -19231,7 +19357,7 @@ var isDev, isBuildTraceEnabled = () => {
|
|
|
19231
19357
|
globalThis.__absoluteVersion = pkg.version;
|
|
19232
19358
|
};
|
|
19233
19359
|
await resolveCandidate(candidates);
|
|
19234
|
-
},
|
|
19360
|
+
}, SKIP_DIRS4, addWorkerPathIfExists = (file4, relPath, workerPaths) => {
|
|
19235
19361
|
const absPath = resolve26(file4, "..", relPath);
|
|
19236
19362
|
try {
|
|
19237
19363
|
statSync3(absPath);
|
|
@@ -19247,7 +19373,7 @@ var isDev, isBuildTraceEnabled = () => {
|
|
|
19247
19373
|
addWorkerPathIfExists(file4, relPath, workerPaths);
|
|
19248
19374
|
}
|
|
19249
19375
|
}, collectWorkerPathsFromFile = (file4, patterns, workerPaths) => {
|
|
19250
|
-
const content =
|
|
19376
|
+
const content = readFileSync17(file4, "utf-8");
|
|
19251
19377
|
for (const pattern of patterns) {
|
|
19252
19378
|
collectWorkerPathsFromContent(content, pattern, file4, workerPaths);
|
|
19253
19379
|
}
|
|
@@ -19256,7 +19382,7 @@ var isDev, isBuildTraceEnabled = () => {
|
|
|
19256
19382
|
for await (const file4 of glob.scan({ absolute: true, cwd: dir })) {
|
|
19257
19383
|
const relToDir = file4.slice(dir.length + 1);
|
|
19258
19384
|
const [firstSegment] = relToDir.split("/");
|
|
19259
|
-
if (firstSegment &&
|
|
19385
|
+
if (firstSegment && SKIP_DIRS4.has(firstSegment))
|
|
19260
19386
|
continue;
|
|
19261
19387
|
collectWorkerPathsFromFile(file4, patterns, workerPaths);
|
|
19262
19388
|
}
|
|
@@ -19278,7 +19404,7 @@ var isDev, isBuildTraceEnabled = () => {
|
|
|
19278
19404
|
vuePagesPath
|
|
19279
19405
|
}) => {
|
|
19280
19406
|
const { readdirSync: readDir } = await import("fs");
|
|
19281
|
-
const devIndexDir =
|
|
19407
|
+
const devIndexDir = join35(buildPath, "_src_indexes");
|
|
19282
19408
|
mkdirSync14(devIndexDir, { recursive: true });
|
|
19283
19409
|
if (reactIndexesPath && reactPagesPath) {
|
|
19284
19410
|
copyReactDevIndexes(reactIndexesPath, reactPagesPath, devIndexDir, readDir);
|
|
@@ -19294,37 +19420,37 @@ var isDev, isBuildTraceEnabled = () => {
|
|
|
19294
19420
|
return;
|
|
19295
19421
|
}
|
|
19296
19422
|
const indexFiles = readDir(reactIndexesPath).filter((file4) => file4.endsWith(".tsx"));
|
|
19297
|
-
const pagesRel =
|
|
19423
|
+
const pagesRel = relative15(process.cwd(), resolve26(reactPagesPath)).replace(/\\/g, "/");
|
|
19298
19424
|
for (const file4 of indexFiles) {
|
|
19299
|
-
let content =
|
|
19425
|
+
let content = readFileSync17(join35(reactIndexesPath, file4), "utf-8");
|
|
19300
19426
|
content = content.replace(/from\s*['"]([^'"]*\/pages\/([^'"]+))['"]/g, (_match, _fullPath, componentName) => `from '/@src/${pagesRel}/${componentName}'`);
|
|
19301
|
-
writeFileSync10(
|
|
19427
|
+
writeFileSync10(join35(devIndexDir, file4), content);
|
|
19302
19428
|
}
|
|
19303
19429
|
}, copySvelteDevIndexes = (svelteDir, sveltePagesPath, svelteEntries, devIndexDir) => {
|
|
19304
|
-
const svelteIndexDir =
|
|
19430
|
+
const svelteIndexDir = join35(getFrameworkGeneratedDir("svelte"), "indexes");
|
|
19305
19431
|
const sveltePageEntries = svelteEntries.filter((file4) => resolve26(file4).startsWith(resolve26(sveltePagesPath)));
|
|
19306
19432
|
for (const entry of sveltePageEntries) {
|
|
19307
|
-
const name =
|
|
19308
|
-
const indexFile =
|
|
19433
|
+
const name = basename10(entry).replace(/\.svelte(\.(ts|js))?$/, "");
|
|
19434
|
+
const indexFile = join35(svelteIndexDir, "pages", `${name}.js`);
|
|
19309
19435
|
if (!existsSync25(indexFile))
|
|
19310
19436
|
continue;
|
|
19311
|
-
let content =
|
|
19312
|
-
const srcRel =
|
|
19437
|
+
let content = readFileSync17(indexFile, "utf-8");
|
|
19438
|
+
const srcRel = relative15(process.cwd(), resolve26(entry)).replace(/\\/g, "/");
|
|
19313
19439
|
content = content.replace(/import\s+Component\s+from\s+['"]([^'"]+)['"]/, `import Component from "/@src/${srcRel}"`);
|
|
19314
|
-
writeFileSync10(
|
|
19440
|
+
writeFileSync10(join35(devIndexDir, `${name}.svelte.js`), content);
|
|
19315
19441
|
}
|
|
19316
19442
|
}, copyVueDevIndexes = (vueDir, vuePagesPath, vueEntries, devIndexDir) => {
|
|
19317
|
-
const vueIndexDir =
|
|
19443
|
+
const vueIndexDir = join35(getFrameworkGeneratedDir("vue"), "indexes");
|
|
19318
19444
|
const vuePageEntries = vueEntries.filter((file4) => resolve26(file4).startsWith(resolve26(vuePagesPath)));
|
|
19319
19445
|
for (const entry of vuePageEntries) {
|
|
19320
|
-
const name =
|
|
19321
|
-
const indexFile =
|
|
19446
|
+
const name = basename10(entry, ".vue");
|
|
19447
|
+
const indexFile = join35(vueIndexDir, `${name}.js`);
|
|
19322
19448
|
if (!existsSync25(indexFile))
|
|
19323
19449
|
continue;
|
|
19324
|
-
let content =
|
|
19325
|
-
const srcRel =
|
|
19450
|
+
let content = readFileSync17(indexFile, "utf-8");
|
|
19451
|
+
const srcRel = relative15(process.cwd(), resolve26(entry)).replace(/\\/g, "/");
|
|
19326
19452
|
content = content.replace(/import\s+Comp(?:\s*,\s*\*\s+as\s+\w+)?\s+from\s+['"]([^'"]+)['"]/, (match) => match.replace(/from\s+['"][^'"]+['"]/, `from "/@src/${srcRel}"`));
|
|
19327
|
-
writeFileSync10(
|
|
19453
|
+
writeFileSync10(join35(devIndexDir, `${name}.vue.js`), content);
|
|
19328
19454
|
}
|
|
19329
19455
|
}, resolveVueRuntimeId = (content, firstUseName, outputPath, projectRoot) => {
|
|
19330
19456
|
const varIdx = content.indexOf(`var ${firstUseName} =`);
|
|
@@ -19372,7 +19498,7 @@ var isDev, isBuildTraceEnabled = () => {
|
|
|
19372
19498
|
}
|
|
19373
19499
|
return result;
|
|
19374
19500
|
}, VUE_HMR_RUNTIME, injectVueComposableTracking = (outputPath, projectRoot) => {
|
|
19375
|
-
let content =
|
|
19501
|
+
let content = readFileSync17(outputPath, "utf-8");
|
|
19376
19502
|
const usePattern = /^var\s+(use[A-Z]\w*)\s*=/gm;
|
|
19377
19503
|
const useNames = [];
|
|
19378
19504
|
let match;
|
|
@@ -19397,8 +19523,8 @@ ${content.slice(firstUseIdx)}`;
|
|
|
19397
19523
|
}, buildDevUrlFileMap = (urlReferencedFiles, projectRoot) => {
|
|
19398
19524
|
const urlFileMap = new Map;
|
|
19399
19525
|
for (const srcPath of urlReferencedFiles) {
|
|
19400
|
-
const rel =
|
|
19401
|
-
const name =
|
|
19526
|
+
const rel = relative15(projectRoot, srcPath).replace(/\\/g, "/");
|
|
19527
|
+
const name = basename10(srcPath);
|
|
19402
19528
|
const mtime = Math.round(statSync3(srcPath).mtimeMs);
|
|
19403
19529
|
const url = `/@src/${rel}?v=${mtime}`;
|
|
19404
19530
|
urlFileMap.set(name, url);
|
|
@@ -19408,11 +19534,11 @@ ${content.slice(firstUseIdx)}`;
|
|
|
19408
19534
|
}, buildProdUrlFileMap = (urlReferencedFiles, buildPath, nonReactClientOutputs) => {
|
|
19409
19535
|
const urlFileMap = new Map;
|
|
19410
19536
|
for (const srcPath of urlReferencedFiles) {
|
|
19411
|
-
const srcBase =
|
|
19412
|
-
const output = nonReactClientOutputs.find((artifact) =>
|
|
19537
|
+
const srcBase = basename10(srcPath).replace(/\.[^.]+$/, "");
|
|
19538
|
+
const output = nonReactClientOutputs.find((artifact) => basename10(artifact.path).startsWith(`${srcBase}.`));
|
|
19413
19539
|
if (!output)
|
|
19414
19540
|
continue;
|
|
19415
|
-
urlFileMap.set(
|
|
19541
|
+
urlFileMap.set(basename10(srcPath), `/${relative15(buildPath, output.path).replace(/\\/g, "/")}`);
|
|
19416
19542
|
}
|
|
19417
19543
|
return urlFileMap;
|
|
19418
19544
|
}, buildUrlFileMap = (urlReferencedFiles, hmr, projectRoot, buildPath, nonReactClientOutputs) => {
|
|
@@ -19422,10 +19548,10 @@ ${content.slice(firstUseIdx)}`;
|
|
|
19422
19548
|
}, rewriteUrlReferences = (outputPaths, urlFileMap) => {
|
|
19423
19549
|
const urlPattern = /new\s+URL\(\s*["'](\.\.?\/[^"']+)["']\s*,\s*import\.meta\.url\s*\)/g;
|
|
19424
19550
|
for (const outputPath of outputPaths) {
|
|
19425
|
-
let content =
|
|
19551
|
+
let content = readFileSync17(outputPath, "utf-8");
|
|
19426
19552
|
let changed = false;
|
|
19427
19553
|
content = content.replace(urlPattern, (_match, relPath) => {
|
|
19428
|
-
const targetName =
|
|
19554
|
+
const targetName = basename10(relPath);
|
|
19429
19555
|
const resolvedPath = urlFileMap.get(targetName);
|
|
19430
19556
|
if (!resolvedPath)
|
|
19431
19557
|
return _match;
|
|
@@ -19547,10 +19673,10 @@ ${content.slice(firstUseIdx)}`;
|
|
|
19547
19673
|
restoreTracePhase();
|
|
19548
19674
|
return;
|
|
19549
19675
|
}
|
|
19550
|
-
const traceDir =
|
|
19676
|
+
const traceDir = join35(buildPath2, ".absolute-trace");
|
|
19551
19677
|
const timestamp = new Date().toISOString().replace(/[:.]/g, "-");
|
|
19552
19678
|
mkdirSync14(traceDir, { recursive: true });
|
|
19553
|
-
writeFileSync10(
|
|
19679
|
+
writeFileSync10(join35(traceDir, `build-trace-${timestamp}.json`), JSON.stringify({
|
|
19554
19680
|
events: traceEvents,
|
|
19555
19681
|
frameworks: traceFrameworkNames,
|
|
19556
19682
|
generatedAt: new Date().toISOString(),
|
|
@@ -19581,15 +19707,15 @@ ${content.slice(firstUseIdx)}`;
|
|
|
19581
19707
|
const stylesPath = typeof stylesConfig === "string" ? stylesConfig : stylesConfig?.path;
|
|
19582
19708
|
const stylesIgnore = typeof stylesConfig === "object" ? stylesConfig.ignore : undefined;
|
|
19583
19709
|
const stylesDir = stylesPath && validateSafePath(stylesPath, projectRoot);
|
|
19584
|
-
const reactIndexesPath = reactDir &&
|
|
19585
|
-
const reactPagesPath = reactDir &&
|
|
19586
|
-
const htmlPagesPath = htmlDir &&
|
|
19587
|
-
const htmlScriptsPath = htmlDir &&
|
|
19588
|
-
const sveltePagesPath = svelteDir &&
|
|
19589
|
-
const vuePagesPath = vueDir &&
|
|
19590
|
-
const htmxPagesPath = htmxDir &&
|
|
19591
|
-
const angularPagesPath = angularDir &&
|
|
19592
|
-
const emberPagesPath = emberDir &&
|
|
19710
|
+
const reactIndexesPath = reactDir && join35(getFrameworkGeneratedDir("react"), "indexes");
|
|
19711
|
+
const reactPagesPath = reactDir && join35(reactDir, "pages");
|
|
19712
|
+
const htmlPagesPath = htmlDir && join35(htmlDir, "pages");
|
|
19713
|
+
const htmlScriptsPath = htmlDir && join35(htmlDir, "scripts");
|
|
19714
|
+
const sveltePagesPath = svelteDir && join35(svelteDir, "pages");
|
|
19715
|
+
const vuePagesPath = vueDir && join35(vueDir, "pages");
|
|
19716
|
+
const htmxPagesPath = htmxDir && join35(htmxDir, "pages");
|
|
19717
|
+
const angularPagesPath = angularDir && join35(angularDir, "pages");
|
|
19718
|
+
const emberPagesPath = emberDir && join35(emberDir, "pages");
|
|
19593
19719
|
const frontends = [
|
|
19594
19720
|
reactDir,
|
|
19595
19721
|
htmlDir,
|
|
@@ -19648,8 +19774,8 @@ ${content.slice(firstUseIdx)}`;
|
|
|
19648
19774
|
const [firstEntry] = serverDirMap;
|
|
19649
19775
|
if (!firstEntry)
|
|
19650
19776
|
throw new Error("Expected at least one server directory entry");
|
|
19651
|
-
serverRoot =
|
|
19652
|
-
serverOutDir =
|
|
19777
|
+
serverRoot = join35(firstEntry.dir, firstEntry.subdir);
|
|
19778
|
+
serverOutDir = join35(buildPath, basename10(firstEntry.dir));
|
|
19653
19779
|
} else if (serverDirMap.length > 1) {
|
|
19654
19780
|
serverRoot = commonAncestor(serverDirMap.map((entry) => entry.dir), projectRoot);
|
|
19655
19781
|
serverOutDir = buildPath;
|
|
@@ -19677,7 +19803,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
19677
19803
|
await tracePhase("react/index-generation", () => generateReactIndexFiles(reactPagesPath, reactIndexesPath, hmr));
|
|
19678
19804
|
}
|
|
19679
19805
|
if (assetsPath && (!isIncremental || normalizedIncrementalFiles?.some((f2) => f2.includes("/assets/")))) {
|
|
19680
|
-
await tracePhase("assets/copy", () => cpSync(assetsPath,
|
|
19806
|
+
await tracePhase("assets/copy", () => cpSync(assetsPath, join35(buildPath, "assets"), {
|
|
19681
19807
|
force: true,
|
|
19682
19808
|
recursive: true
|
|
19683
19809
|
}));
|
|
@@ -19787,11 +19913,11 @@ ${content.slice(firstUseIdx)}`;
|
|
|
19787
19913
|
}
|
|
19788
19914
|
}
|
|
19789
19915
|
if (htmlDefaults.error || htmlDefaults.notFound || htmlDefaults.loading || Object.keys(htmlPages).length > 0) {
|
|
19790
|
-
const htmlConventionsOutDir =
|
|
19916
|
+
const htmlConventionsOutDir = join35(buildPath, "conventions", "html");
|
|
19791
19917
|
mkdirSync14(htmlConventionsOutDir, { recursive: true });
|
|
19792
19918
|
const htmlPathRemap = new Map;
|
|
19793
19919
|
for (const sourcePath of htmlConventionSources) {
|
|
19794
|
-
const dest =
|
|
19920
|
+
const dest = join35(htmlConventionsOutDir, basename10(sourcePath));
|
|
19795
19921
|
cpSync(sourcePath, dest, { force: true });
|
|
19796
19922
|
htmlPathRemap.set(sourcePath, dest);
|
|
19797
19923
|
}
|
|
@@ -19833,8 +19959,8 @@ ${content.slice(firstUseIdx)}`;
|
|
|
19833
19959
|
const shouldIncludeHtmlAssets = !isIncremental || normalizedIncrementalFiles?.some((f2) => f2.includes("/html/") && (f2.endsWith(".html") || isStylePath(f2)));
|
|
19834
19960
|
const reactEntries = isIncremental && reactIndexesPath && reactPagesPath ? filterToIncrementalEntries(allReactEntries, (entry) => {
|
|
19835
19961
|
if (entry.startsWith(resolve26(reactIndexesPath))) {
|
|
19836
|
-
const pageName =
|
|
19837
|
-
return
|
|
19962
|
+
const pageName = basename10(entry, ".tsx");
|
|
19963
|
+
return join35(reactPagesPath, `${pageName}.tsx`);
|
|
19838
19964
|
}
|
|
19839
19965
|
return null;
|
|
19840
19966
|
}) : allReactEntries;
|
|
@@ -19867,10 +19993,10 @@ ${content.slice(firstUseIdx)}`;
|
|
|
19867
19993
|
const shouldCompileIslandSvelte = svelteDir && islandSvelteSources.length > 0;
|
|
19868
19994
|
const shouldCompileIslandVue = vueDir && islandVueSources.length > 0;
|
|
19869
19995
|
const shouldCompileIslandAngular = angularDir && islandAngularSources.length > 0;
|
|
19870
|
-
if (shouldCompileAngular) {
|
|
19996
|
+
if (shouldCompileAngular && angularDir) {
|
|
19871
19997
|
await tracePhase("scan/angular-handlers", async () => {
|
|
19872
19998
|
const { runAngularHandlerScan: runAngularHandlerScan2 } = await Promise.resolve().then(() => (init_runAngularHandlerScan(), exports_runAngularHandlerScan));
|
|
19873
|
-
runAngularHandlerScan2(projectRoot);
|
|
19999
|
+
runAngularHandlerScan2(projectRoot, angularDir);
|
|
19874
20000
|
});
|
|
19875
20001
|
}
|
|
19876
20002
|
const [
|
|
@@ -19900,14 +20026,14 @@ ${content.slice(firstUseIdx)}`;
|
|
|
19900
20026
|
try {
|
|
19901
20027
|
const { primeComponentFingerprint: primeComponentFingerprint2 } = await Promise.resolve().then(() => (init_fastHmrCompiler(), exports_fastHmrCompiler));
|
|
19902
20028
|
const { readdir: readdir4 } = await import("fs/promises");
|
|
19903
|
-
const { join:
|
|
20029
|
+
const { join: join36 } = await import("path");
|
|
19904
20030
|
const walk = async (dir) => {
|
|
19905
20031
|
const entries = await readdir4(dir, {
|
|
19906
20032
|
withFileTypes: true
|
|
19907
20033
|
});
|
|
19908
20034
|
const out = [];
|
|
19909
20035
|
for (const entry of entries) {
|
|
19910
|
-
const full =
|
|
20036
|
+
const full = join36(dir, entry.name);
|
|
19911
20037
|
if (entry.isDirectory()) {
|
|
19912
20038
|
out.push(...await walk(full));
|
|
19913
20039
|
} else if (entry.isFile() && entry.name.endsWith(".ts") && !entry.name.endsWith(".d.ts")) {
|
|
@@ -19972,7 +20098,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
19972
20098
|
const compileReactConventions = async () => {
|
|
19973
20099
|
if (reactConventionSources.length === 0)
|
|
19974
20100
|
return emptyStringArray;
|
|
19975
|
-
const destDir =
|
|
20101
|
+
const destDir = join35(buildPath, "conventions", "react");
|
|
19976
20102
|
rmSync2(destDir, { force: true, recursive: true });
|
|
19977
20103
|
mkdirSync14(destDir, { recursive: true });
|
|
19978
20104
|
const destPaths = [];
|
|
@@ -20016,7 +20142,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
20016
20142
|
angularConventionSources.length > 0 && angularDir ? tracePhase("compile/convention-angular", () => Promise.resolve().then(() => (init_compileAngular(), exports_compileAngular)).then((mod) => mod.compileAngular(angularConventionSources, angularDir, hmr, styleTransformConfig))) : { serverPaths: emptyStringArray }
|
|
20017
20143
|
]);
|
|
20018
20144
|
const bundleConventionFiles = async (framework, compiledPaths) => {
|
|
20019
|
-
const destDir =
|
|
20145
|
+
const destDir = join35(buildPath, "conventions", framework);
|
|
20020
20146
|
rmSync2(destDir, { force: true, recursive: true });
|
|
20021
20147
|
mkdirSync14(destDir, { recursive: true });
|
|
20022
20148
|
const destPaths = [];
|
|
@@ -20024,7 +20150,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
20024
20150
|
const compiledPath = compiledPaths[idx];
|
|
20025
20151
|
if (!compiledPath)
|
|
20026
20152
|
continue;
|
|
20027
|
-
const name =
|
|
20153
|
+
const name = basename10(compiledPath).replace(/\.[^.]+$/, "");
|
|
20028
20154
|
const result = await bunBuild7({
|
|
20029
20155
|
entrypoints: [compiledPath],
|
|
20030
20156
|
format: "esm",
|
|
@@ -20090,7 +20216,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
20090
20216
|
}
|
|
20091
20217
|
})) : {
|
|
20092
20218
|
entries: [],
|
|
20093
|
-
generatedRoot:
|
|
20219
|
+
generatedRoot: join35(buildPath, "_island_entries")
|
|
20094
20220
|
};
|
|
20095
20221
|
const islandClientEntryPoints = islandEntryResult.entries.map((entry) => entry.entryPath);
|
|
20096
20222
|
if (serverEntryPoints.length === 0 && reactClientEntryPoints.length === 0 && nonReactClientEntryPoints.length === 0 && islandClientEntryPoints.length === 0 && htmxDir === undefined && htmlDir === undefined) {
|
|
@@ -20126,7 +20252,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
20126
20252
|
return {};
|
|
20127
20253
|
}
|
|
20128
20254
|
if (hmr && reactIndexesPath && reactClientEntryPoints.length > 0) {
|
|
20129
|
-
const refreshEntry =
|
|
20255
|
+
const refreshEntry = join35(reactIndexesPath, "_refresh.tsx");
|
|
20130
20256
|
if (!reactClientEntryPoints.includes(refreshEntry))
|
|
20131
20257
|
reactClientEntryPoints.push(refreshEntry);
|
|
20132
20258
|
}
|
|
@@ -20228,19 +20354,19 @@ ${content.slice(firstUseIdx)}`;
|
|
|
20228
20354
|
throw: false
|
|
20229
20355
|
}, resolveBunBuildOverride(bunBuildConfig, "reactClient")) : undefined;
|
|
20230
20356
|
if (reactDir && reactClientEntryPoints.length > 0) {
|
|
20231
|
-
rmSync2(
|
|
20357
|
+
rmSync2(join35(buildPath, "react", "generated", "indexes"), {
|
|
20232
20358
|
force: true,
|
|
20233
20359
|
recursive: true
|
|
20234
20360
|
});
|
|
20235
20361
|
}
|
|
20236
20362
|
if (angularDir && angularClientPaths.length > 0) {
|
|
20237
|
-
rmSync2(
|
|
20363
|
+
rmSync2(join35(buildPath, "angular", "indexes"), {
|
|
20238
20364
|
force: true,
|
|
20239
20365
|
recursive: true
|
|
20240
20366
|
});
|
|
20241
20367
|
}
|
|
20242
20368
|
if (islandClientEntryPoints.length > 0) {
|
|
20243
|
-
rmSync2(
|
|
20369
|
+
rmSync2(join35(buildPath, "islands"), {
|
|
20244
20370
|
force: true,
|
|
20245
20371
|
recursive: true
|
|
20246
20372
|
});
|
|
@@ -20329,7 +20455,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
20329
20455
|
globalCssEntries.length > 0 ? tracePhase("bun/global-css", () => bunBuild7(mergeBunBuildConfig({
|
|
20330
20456
|
entrypoints: globalCssEntries,
|
|
20331
20457
|
naming: `[dir]/[name].[hash].[ext]`,
|
|
20332
|
-
outdir: stylesDir ?
|
|
20458
|
+
outdir: stylesDir ? join35(buildPath, basename10(stylesDir)) : buildPath,
|
|
20333
20459
|
plugins: [stylePreprocessorPlugin2],
|
|
20334
20460
|
root: stylesDir || clientRoot,
|
|
20335
20461
|
target: "browser",
|
|
@@ -20338,7 +20464,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
20338
20464
|
vueCssPaths.length > 0 ? tracePhase("bun/vue-css", () => bunBuild7(mergeBunBuildConfig({
|
|
20339
20465
|
entrypoints: vueCssPaths,
|
|
20340
20466
|
naming: `[name].[hash].[ext]`,
|
|
20341
|
-
outdir:
|
|
20467
|
+
outdir: join35(buildPath, assetsPath ? basename10(assetsPath) : "assets", "css"),
|
|
20342
20468
|
target: "browser",
|
|
20343
20469
|
throw: false
|
|
20344
20470
|
}, resolveBunBuildOverride(bunBuildConfig, "vueCss")))) : undefined
|
|
@@ -20415,7 +20541,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
20415
20541
|
const fileDir = dirname18(artifact.path);
|
|
20416
20542
|
const relativePaths = {};
|
|
20417
20543
|
for (const [specifier, absolute] of Object.entries(angularServerVendorPaths2)) {
|
|
20418
|
-
const rel =
|
|
20544
|
+
const rel = relative15(fileDir, absolute);
|
|
20419
20545
|
relativePaths[specifier] = rel.startsWith(".") ? rel : `./${rel}`;
|
|
20420
20546
|
}
|
|
20421
20547
|
return relativePaths;
|
|
@@ -20471,20 +20597,20 @@ ${content.slice(firstUseIdx)}`;
|
|
|
20471
20597
|
for (const artifact of serverOutputs) {
|
|
20472
20598
|
if (extname8(artifact.path) !== ".js")
|
|
20473
20599
|
continue;
|
|
20474
|
-
const fileWithHash =
|
|
20600
|
+
const fileWithHash = basename10(artifact.path);
|
|
20475
20601
|
const [baseName] = fileWithHash.split(`.${artifact.hash}.`);
|
|
20476
20602
|
if (!baseName)
|
|
20477
20603
|
continue;
|
|
20478
20604
|
manifest[toPascal(baseName)] = artifact.path;
|
|
20479
20605
|
}
|
|
20480
20606
|
for (const serverPath of emberServerPaths) {
|
|
20481
|
-
const fileBase =
|
|
20607
|
+
const fileBase = basename10(serverPath, ".js");
|
|
20482
20608
|
manifest[toPascal(fileBase)] = serverPath;
|
|
20483
20609
|
}
|
|
20484
20610
|
if (skipAngularClientBundle) {
|
|
20485
20611
|
for (const clientPath of angularClientPaths) {
|
|
20486
|
-
const fileBase =
|
|
20487
|
-
const relFromCwd =
|
|
20612
|
+
const fileBase = basename10(clientPath, ".js");
|
|
20613
|
+
const relFromCwd = relative15(projectRoot, clientPath).replace(/\\/g, "/");
|
|
20488
20614
|
manifest[`${toPascal(fileBase)}Index`] = `/@src/${relFromCwd}`;
|
|
20489
20615
|
}
|
|
20490
20616
|
}
|
|
@@ -20498,7 +20624,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
20498
20624
|
const injectHMRIntoHTMLFile = (filePath, framework) => {
|
|
20499
20625
|
if (!hmrClientBundle)
|
|
20500
20626
|
return;
|
|
20501
|
-
let html =
|
|
20627
|
+
let html = readFileSync17(filePath, "utf-8");
|
|
20502
20628
|
if (html.includes("data-hmr-client"))
|
|
20503
20629
|
return;
|
|
20504
20630
|
const tag = `<script>window.__HMR_FRAMEWORK__="${framework}";</script><script data-hmr-client>${hmrClientBundle}</script>`;
|
|
@@ -20509,7 +20635,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
20509
20635
|
const processHtmlPages = async () => {
|
|
20510
20636
|
if (!(htmlDir && htmlPagesPath))
|
|
20511
20637
|
return;
|
|
20512
|
-
const outputHtmlPages = isSingle ?
|
|
20638
|
+
const outputHtmlPages = isSingle ? join35(buildPath, "pages") : join35(buildPath, basename10(htmlDir), "pages");
|
|
20513
20639
|
mkdirSync14(outputHtmlPages, { recursive: true });
|
|
20514
20640
|
cpSync(htmlPagesPath, outputHtmlPages, {
|
|
20515
20641
|
force: true,
|
|
@@ -20524,7 +20650,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
20524
20650
|
for (const htmlFile of htmlPageFiles) {
|
|
20525
20651
|
if (hmr)
|
|
20526
20652
|
injectHMRIntoHTMLFile(htmlFile, "html");
|
|
20527
|
-
const fileName =
|
|
20653
|
+
const fileName = basename10(htmlFile, ".html");
|
|
20528
20654
|
if (manifest[fileName] && manifest[fileName] !== htmlFile) {
|
|
20529
20655
|
warnManifestKeyCollision(fileName, manifest[fileName], htmlFile);
|
|
20530
20656
|
}
|
|
@@ -20534,14 +20660,14 @@ ${content.slice(firstUseIdx)}`;
|
|
|
20534
20660
|
const processHtmxPages = async () => {
|
|
20535
20661
|
if (!(htmxDir && htmxPagesPath))
|
|
20536
20662
|
return;
|
|
20537
|
-
const outputHtmxPages = isSingle ?
|
|
20663
|
+
const outputHtmxPages = isSingle ? join35(buildPath, "pages") : join35(buildPath, basename10(htmxDir), "pages");
|
|
20538
20664
|
mkdirSync14(outputHtmxPages, { recursive: true });
|
|
20539
20665
|
cpSync(htmxPagesPath, outputHtmxPages, {
|
|
20540
20666
|
force: true,
|
|
20541
20667
|
recursive: true
|
|
20542
20668
|
});
|
|
20543
20669
|
if (shouldCopyHtmx) {
|
|
20544
|
-
const htmxDestDir = isSingle ? buildPath :
|
|
20670
|
+
const htmxDestDir = isSingle ? buildPath : join35(buildPath, basename10(htmxDir));
|
|
20545
20671
|
copyHtmxVendor(htmxDir, htmxDestDir);
|
|
20546
20672
|
}
|
|
20547
20673
|
if (shouldUpdateHtmxAssetPaths) {
|
|
@@ -20553,7 +20679,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
20553
20679
|
for (const htmxFile of htmxPageFiles) {
|
|
20554
20680
|
if (hmr)
|
|
20555
20681
|
injectHMRIntoHTMLFile(htmxFile, "htmx");
|
|
20556
|
-
const fileName =
|
|
20682
|
+
const fileName = basename10(htmxFile, ".html");
|
|
20557
20683
|
if (manifest[fileName] && manifest[fileName] !== htmxFile) {
|
|
20558
20684
|
warnManifestKeyCollision(fileName, manifest[fileName], htmxFile);
|
|
20559
20685
|
}
|
|
@@ -20606,9 +20732,9 @@ ${content.slice(firstUseIdx)}`;
|
|
|
20606
20732
|
writeBuildTrace(buildPath);
|
|
20607
20733
|
return { conventions: conventionsMap, manifest };
|
|
20608
20734
|
}
|
|
20609
|
-
writeFileSync10(
|
|
20735
|
+
writeFileSync10(join35(buildPath, "manifest.json"), JSON.stringify(manifest, null, "\t"));
|
|
20610
20736
|
if (Object.keys(conventionsMap).length > 0) {
|
|
20611
|
-
writeFileSync10(
|
|
20737
|
+
writeFileSync10(join35(buildPath, "conventions.json"), JSON.stringify(conventionsMap, null, "\t"));
|
|
20612
20738
|
}
|
|
20613
20739
|
writeBuildTrace(buildPath);
|
|
20614
20740
|
if (mode === "production") {
|
|
@@ -20671,7 +20797,7 @@ var init_build = __esm(() => {
|
|
|
20671
20797
|
init_logger();
|
|
20672
20798
|
init_validateSafePath();
|
|
20673
20799
|
isDev = env2.NODE_ENV === "development";
|
|
20674
|
-
|
|
20800
|
+
SKIP_DIRS4 = new Set([
|
|
20675
20801
|
"build",
|
|
20676
20802
|
"node_modules",
|
|
20677
20803
|
".absolutejs",
|
|
@@ -20730,7 +20856,7 @@ var init_build = __esm(() => {
|
|
|
20730
20856
|
|
|
20731
20857
|
// src/build/buildEmberVendor.ts
|
|
20732
20858
|
import { mkdirSync as mkdirSync15, existsSync as existsSync26 } from "fs";
|
|
20733
|
-
import { join as
|
|
20859
|
+
import { join as join36 } from "path";
|
|
20734
20860
|
import { rm as rm9 } from "fs/promises";
|
|
20735
20861
|
var {build: bunBuild8 } = globalThis.Bun;
|
|
20736
20862
|
var toSafeFileName5 = (specifier) => specifier.replace(/^@/, "").replace(/\//g, "_"), generateMacrosShim = () => `// Generated shim for @embroider/macros \u2014 provides minimal runtime
|
|
@@ -20782,7 +20908,7 @@ export const importSync = (specifier) => {
|
|
|
20782
20908
|
if (standaloneSpecifiers.has(specifier)) {
|
|
20783
20909
|
return { resolveTo: specifier, specifier };
|
|
20784
20910
|
}
|
|
20785
|
-
const emberInternalPath =
|
|
20911
|
+
const emberInternalPath = join36(cwd2, "node_modules/ember-source/dist/packages", specifier, "index.js");
|
|
20786
20912
|
if (!existsSync26(emberInternalPath)) {
|
|
20787
20913
|
throw new Error(`Ember vendor build: cannot find ${specifier} at ${emberInternalPath}. ` + `Is ember-source installed and at least 6.12?`);
|
|
20788
20914
|
}
|
|
@@ -20814,7 +20940,7 @@ export const importSync = (specifier) => {
|
|
|
20814
20940
|
if (standalonePackages.has(args.path)) {
|
|
20815
20941
|
return;
|
|
20816
20942
|
}
|
|
20817
|
-
const internal =
|
|
20943
|
+
const internal = join36(cwd2, "node_modules/ember-source/dist/packages", args.path, "index.js");
|
|
20818
20944
|
if (existsSync26(internal)) {
|
|
20819
20945
|
return { path: internal };
|
|
20820
20946
|
}
|
|
@@ -20822,16 +20948,16 @@ export const importSync = (specifier) => {
|
|
|
20822
20948
|
});
|
|
20823
20949
|
}
|
|
20824
20950
|
}), buildEmberVendor = async (buildDir, cwd2 = process.cwd()) => {
|
|
20825
|
-
const vendorDir =
|
|
20951
|
+
const vendorDir = join36(buildDir, "ember", "vendor");
|
|
20826
20952
|
mkdirSync15(vendorDir, { recursive: true });
|
|
20827
|
-
const tmpDir =
|
|
20953
|
+
const tmpDir = join36(buildDir, "_ember_vendor_tmp");
|
|
20828
20954
|
mkdirSync15(tmpDir, { recursive: true });
|
|
20829
|
-
const macrosShimPath =
|
|
20955
|
+
const macrosShimPath = join36(tmpDir, "embroider_macros_shim.js");
|
|
20830
20956
|
await Bun.write(macrosShimPath, generateMacrosShim());
|
|
20831
20957
|
const resolutions = REQUIRED_EMBER_SPECIFIERS.map((specifier) => resolveEmberSpecifier(specifier, cwd2));
|
|
20832
20958
|
const entrypoints = await Promise.all(resolutions.map(async (resolution) => {
|
|
20833
20959
|
const safeName = toSafeFileName5(resolution.specifier);
|
|
20834
|
-
const entryPath =
|
|
20960
|
+
const entryPath = join36(tmpDir, `${safeName}.js`);
|
|
20835
20961
|
const source = resolution.specifier === "@embroider/macros" ? `export * from ${JSON.stringify(macrosShimPath)};
|
|
20836
20962
|
` : generateVendorEntrySource2(resolution);
|
|
20837
20963
|
await Bun.write(entryPath, source);
|
|
@@ -20884,7 +21010,7 @@ __export(exports_dependencyGraph, {
|
|
|
20884
21010
|
buildInitialDependencyGraph: () => buildInitialDependencyGraph,
|
|
20885
21011
|
addFileToGraph: () => addFileToGraph
|
|
20886
21012
|
});
|
|
20887
|
-
import { existsSync as existsSync27, readFileSync as
|
|
21013
|
+
import { existsSync as existsSync27, readFileSync as readFileSync18 } from "fs";
|
|
20888
21014
|
var {Glob: Glob9 } = globalThis.Bun;
|
|
20889
21015
|
import { resolve as resolve27 } from "path";
|
|
20890
21016
|
var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath) => {
|
|
@@ -21055,15 +21181,15 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
21055
21181
|
const lowerPath = filePath.toLowerCase();
|
|
21056
21182
|
const isSvelteOrVue = lowerPath.endsWith(".svelte") || lowerPath.endsWith(".vue");
|
|
21057
21183
|
if (loader === "html") {
|
|
21058
|
-
const content =
|
|
21184
|
+
const content = readFileSync18(filePath, "utf-8");
|
|
21059
21185
|
return extractHtmlDependencies(filePath, content);
|
|
21060
21186
|
}
|
|
21061
21187
|
if (loader === "tsx" || loader === "js") {
|
|
21062
|
-
const content =
|
|
21188
|
+
const content = readFileSync18(filePath, "utf-8");
|
|
21063
21189
|
return extractJsDependencies(filePath, content, loader);
|
|
21064
21190
|
}
|
|
21065
21191
|
if (isSvelteOrVue) {
|
|
21066
|
-
const content =
|
|
21192
|
+
const content = readFileSync18(filePath, "utf-8");
|
|
21067
21193
|
return extractSvelteVueDependencies(filePath, content);
|
|
21068
21194
|
}
|
|
21069
21195
|
return [];
|
|
@@ -21206,7 +21332,7 @@ var init_clientManager = __esm(() => {
|
|
|
21206
21332
|
});
|
|
21207
21333
|
|
|
21208
21334
|
// src/dev/pathUtils.ts
|
|
21209
|
-
import { existsSync as existsSync28, readdirSync as
|
|
21335
|
+
import { existsSync as existsSync28, readdirSync as readdirSync4, readFileSync as readFileSync19 } from "fs";
|
|
21210
21336
|
import { dirname as dirname19, resolve as resolve29 } from "path";
|
|
21211
21337
|
var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
21212
21338
|
if (shouldIgnorePath(filePath, resolved)) {
|
|
@@ -21288,7 +21414,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
21288
21414
|
const walk = (dir) => {
|
|
21289
21415
|
let entries;
|
|
21290
21416
|
try {
|
|
21291
|
-
entries =
|
|
21417
|
+
entries = readdirSync4(dir, { withFileTypes: true });
|
|
21292
21418
|
} catch {
|
|
21293
21419
|
return;
|
|
21294
21420
|
}
|
|
@@ -21306,7 +21432,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
21306
21432
|
}
|
|
21307
21433
|
let source;
|
|
21308
21434
|
try {
|
|
21309
|
-
source =
|
|
21435
|
+
source = readFileSync19(full, "utf8");
|
|
21310
21436
|
} catch {
|
|
21311
21437
|
continue;
|
|
21312
21438
|
}
|
|
@@ -21384,8 +21510,8 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
21384
21510
|
roots.push(abs);
|
|
21385
21511
|
}
|
|
21386
21512
|
try {
|
|
21387
|
-
const { readdirSync:
|
|
21388
|
-
const entries =
|
|
21513
|
+
const { readdirSync: readdirSync5 } = __require("fs");
|
|
21514
|
+
const entries = readdirSync5(cwd2, { withFileTypes: true });
|
|
21389
21515
|
for (const entry of entries) {
|
|
21390
21516
|
if (!entry.isDirectory())
|
|
21391
21517
|
continue;
|
|
@@ -21465,8 +21591,8 @@ var init_pathUtils = __esm(() => {
|
|
|
21465
21591
|
|
|
21466
21592
|
// src/dev/fileWatcher.ts
|
|
21467
21593
|
import { watch } from "fs";
|
|
21468
|
-
import { existsSync as existsSync29, readdirSync as
|
|
21469
|
-
import { dirname as dirname20, join as
|
|
21594
|
+
import { existsSync as existsSync29, readdirSync as readdirSync5, statSync as statSync4 } from "fs";
|
|
21595
|
+
import { dirname as dirname20, join as join37, resolve as resolve30 } from "path";
|
|
21470
21596
|
var safeRemoveFromGraph = (graph, fullPath) => {
|
|
21471
21597
|
try {
|
|
21472
21598
|
removeFileFromGraph(graph, fullPath);
|
|
@@ -21491,7 +21617,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
21491
21617
|
const atomicRecoveryScan = (eventDir) => {
|
|
21492
21618
|
let entries;
|
|
21493
21619
|
try {
|
|
21494
|
-
entries =
|
|
21620
|
+
entries = readdirSync5(eventDir);
|
|
21495
21621
|
} catch {
|
|
21496
21622
|
return;
|
|
21497
21623
|
}
|
|
@@ -21499,7 +21625,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
21499
21625
|
for (const name of entries) {
|
|
21500
21626
|
if (shouldSkipFilename(name, isStylesDir))
|
|
21501
21627
|
continue;
|
|
21502
|
-
const child =
|
|
21628
|
+
const child = join37(eventDir, name).replace(/\\/g, "/");
|
|
21503
21629
|
let st2;
|
|
21504
21630
|
try {
|
|
21505
21631
|
st2 = statSync4(child);
|
|
@@ -21524,12 +21650,12 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
21524
21650
|
return;
|
|
21525
21651
|
if (shouldSkipFilename(filename, isStylesDir)) {
|
|
21526
21652
|
if (event === "rename") {
|
|
21527
|
-
const eventDir = dirname20(
|
|
21653
|
+
const eventDir = dirname20(join37(absolutePath, filename)).replace(/\\/g, "/");
|
|
21528
21654
|
atomicRecoveryScan(eventDir);
|
|
21529
21655
|
}
|
|
21530
21656
|
return;
|
|
21531
21657
|
}
|
|
21532
|
-
const fullPath =
|
|
21658
|
+
const fullPath = join37(absolutePath, filename).replace(/\\/g, "/");
|
|
21533
21659
|
if (shouldIgnorePath(fullPath, state.resolvedPaths)) {
|
|
21534
21660
|
return;
|
|
21535
21661
|
}
|
|
@@ -21681,7 +21807,7 @@ var init_assetStore = __esm(() => {
|
|
|
21681
21807
|
});
|
|
21682
21808
|
|
|
21683
21809
|
// src/islands/pageMetadata.ts
|
|
21684
|
-
import { readFileSync as
|
|
21810
|
+
import { readFileSync as readFileSync20 } from "fs";
|
|
21685
21811
|
import { dirname as dirname21, resolve as resolve32 } from "path";
|
|
21686
21812
|
var pagePatterns, getPageDirs = (config) => [
|
|
21687
21813
|
{ dir: config.angularDirectory, framework: "angular" },
|
|
@@ -21724,7 +21850,7 @@ var pagePatterns, getPageDirs = (config) => [
|
|
|
21724
21850
|
return;
|
|
21725
21851
|
const files = await scanEntryPoints(resolve32(entry.dir), pattern);
|
|
21726
21852
|
for (const filePath of files) {
|
|
21727
|
-
const source =
|
|
21853
|
+
const source = readFileSync20(filePath, "utf-8");
|
|
21728
21854
|
const islands = extractIslandUsagesFromSource(source);
|
|
21729
21855
|
pageMetadata.set(resolve32(filePath), {
|
|
21730
21856
|
islands: resolveIslandUsages(islands, islandSourceLookup),
|
|
@@ -21755,10 +21881,10 @@ var init_pageMetadata = __esm(() => {
|
|
|
21755
21881
|
});
|
|
21756
21882
|
|
|
21757
21883
|
// src/dev/fileHashTracker.ts
|
|
21758
|
-
import { readFileSync as
|
|
21884
|
+
import { readFileSync as readFileSync21 } from "fs";
|
|
21759
21885
|
var computeFileHash = (filePath) => {
|
|
21760
21886
|
try {
|
|
21761
|
-
const fileContent =
|
|
21887
|
+
const fileContent = readFileSync21(filePath);
|
|
21762
21888
|
return Number(Bun.hash(fileContent));
|
|
21763
21889
|
} catch {
|
|
21764
21890
|
return UNFOUND_INDEX;
|
|
@@ -21865,7 +21991,7 @@ var classifyComponent = (filePath) => {
|
|
|
21865
21991
|
var init_reactComponentClassifier = () => {};
|
|
21866
21992
|
|
|
21867
21993
|
// src/dev/moduleMapper.ts
|
|
21868
|
-
import { basename as
|
|
21994
|
+
import { basename as basename11, resolve as resolve34 } from "path";
|
|
21869
21995
|
var buildModulePaths = (moduleKeys, manifest) => {
|
|
21870
21996
|
const modulePaths = {};
|
|
21871
21997
|
moduleKeys.forEach((key) => {
|
|
@@ -21912,7 +22038,7 @@ var buildModulePaths = (moduleKeys, manifest) => {
|
|
|
21912
22038
|
return grouped;
|
|
21913
22039
|
}, mapSourceFileToManifestKeys = (sourceFile, framework, resolvedPaths) => {
|
|
21914
22040
|
const normalizedFile = resolve34(sourceFile);
|
|
21915
|
-
const fileName =
|
|
22041
|
+
const fileName = basename11(normalizedFile);
|
|
21916
22042
|
const baseName = fileName.replace(/\.(tsx?|jsx?|vue|svelte|css|html)$/, "");
|
|
21917
22043
|
const pascalName = toPascal(baseName);
|
|
21918
22044
|
const keys = [];
|
|
@@ -21972,15 +22098,15 @@ __export(exports_resolveOwningComponents, {
|
|
|
21972
22098
|
resolveDescendantsOfParent: () => resolveDescendantsOfParent,
|
|
21973
22099
|
invalidateResourceIndex: () => invalidateResourceIndex
|
|
21974
22100
|
});
|
|
21975
|
-
import { readdirSync as
|
|
21976
|
-
import { dirname as dirname22, extname as extname9, join as
|
|
21977
|
-
import
|
|
22101
|
+
import { readdirSync as readdirSync6, readFileSync as readFileSync22, statSync as statSync5 } from "fs";
|
|
22102
|
+
import { dirname as dirname22, extname as extname9, join as join38, resolve as resolve35 } from "path";
|
|
22103
|
+
import ts13 from "typescript";
|
|
21978
22104
|
var ENTITY_DECORATORS, isAngularSourceFile = (file4) => file4.endsWith(".ts") || file4.endsWith(".tsx"), walkAngularSourceFiles = (root) => {
|
|
21979
22105
|
const out = [];
|
|
21980
22106
|
const visit = (dir) => {
|
|
21981
22107
|
let entries;
|
|
21982
22108
|
try {
|
|
21983
|
-
entries =
|
|
22109
|
+
entries = readdirSync6(dir, { withFileTypes: true });
|
|
21984
22110
|
} catch {
|
|
21985
22111
|
return;
|
|
21986
22112
|
}
|
|
@@ -21988,7 +22114,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file4) => file4.endsWith(".ts") ||
|
|
|
21988
22114
|
if (entry.name.startsWith(".") || entry.name === "node_modules") {
|
|
21989
22115
|
continue;
|
|
21990
22116
|
}
|
|
21991
|
-
const full =
|
|
22117
|
+
const full = join38(dir, entry.name);
|
|
21992
22118
|
if (entry.isDirectory()) {
|
|
21993
22119
|
visit(full);
|
|
21994
22120
|
} else if (entry.isFile() && isAngularSourceFile(entry.name)) {
|
|
@@ -22000,13 +22126,13 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file4) => file4.endsWith(".ts") ||
|
|
|
22000
22126
|
return out;
|
|
22001
22127
|
}, getStringPropertyValue = (obj, name) => {
|
|
22002
22128
|
for (const prop of obj.properties) {
|
|
22003
|
-
if (!
|
|
22129
|
+
if (!ts13.isPropertyAssignment(prop))
|
|
22004
22130
|
continue;
|
|
22005
|
-
const propName =
|
|
22131
|
+
const propName = ts13.isIdentifier(prop.name) ? prop.name.text : ts13.isStringLiteral(prop.name) ? prop.name.text : null;
|
|
22006
22132
|
if (propName !== name)
|
|
22007
22133
|
continue;
|
|
22008
22134
|
const init = prop.initializer;
|
|
22009
|
-
if (
|
|
22135
|
+
if (ts13.isStringLiteral(init) || ts13.isNoSubstitutionTemplateLiteral(init)) {
|
|
22010
22136
|
return init.text;
|
|
22011
22137
|
}
|
|
22012
22138
|
}
|
|
@@ -22014,16 +22140,16 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file4) => file4.endsWith(".ts") ||
|
|
|
22014
22140
|
}, getStringArrayProperty = (obj, name) => {
|
|
22015
22141
|
const out = [];
|
|
22016
22142
|
for (const prop of obj.properties) {
|
|
22017
|
-
if (!
|
|
22143
|
+
if (!ts13.isPropertyAssignment(prop))
|
|
22018
22144
|
continue;
|
|
22019
|
-
const propName =
|
|
22145
|
+
const propName = ts13.isIdentifier(prop.name) ? prop.name.text : ts13.isStringLiteral(prop.name) ? prop.name.text : null;
|
|
22020
22146
|
if (propName !== name)
|
|
22021
22147
|
continue;
|
|
22022
22148
|
const init = prop.initializer;
|
|
22023
|
-
if (!
|
|
22149
|
+
if (!ts13.isArrayLiteralExpression(init))
|
|
22024
22150
|
continue;
|
|
22025
22151
|
for (const element of init.elements) {
|
|
22026
|
-
if (
|
|
22152
|
+
if (ts13.isStringLiteral(element) || ts13.isNoSubstitutionTemplateLiteral(element)) {
|
|
22027
22153
|
out.push(element.text);
|
|
22028
22154
|
}
|
|
22029
22155
|
}
|
|
@@ -22032,31 +22158,31 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file4) => file4.endsWith(".ts") ||
|
|
|
22032
22158
|
}, parseDecoratedClasses = (filePath) => {
|
|
22033
22159
|
let source;
|
|
22034
22160
|
try {
|
|
22035
|
-
source =
|
|
22161
|
+
source = readFileSync22(filePath, "utf8");
|
|
22036
22162
|
} catch {
|
|
22037
22163
|
return [];
|
|
22038
22164
|
}
|
|
22039
|
-
const sourceFile =
|
|
22165
|
+
const sourceFile = ts13.createSourceFile(filePath, source, ts13.ScriptTarget.ES2022, true, ts13.ScriptKind.TS);
|
|
22040
22166
|
const out = [];
|
|
22041
22167
|
const visit = (node) => {
|
|
22042
|
-
if (
|
|
22043
|
-
for (const decorator of
|
|
22168
|
+
if (ts13.isClassDeclaration(node) && node.name) {
|
|
22169
|
+
for (const decorator of ts13.getDecorators(node) ?? []) {
|
|
22044
22170
|
const expr = decorator.expression;
|
|
22045
|
-
if (!
|
|
22171
|
+
if (!ts13.isCallExpression(expr))
|
|
22046
22172
|
continue;
|
|
22047
22173
|
const fn2 = expr.expression;
|
|
22048
|
-
if (!
|
|
22174
|
+
if (!ts13.isIdentifier(fn2))
|
|
22049
22175
|
continue;
|
|
22050
22176
|
const kind = ENTITY_DECORATORS[fn2.text];
|
|
22051
22177
|
if (!kind)
|
|
22052
22178
|
continue;
|
|
22053
22179
|
let extendsName = null;
|
|
22054
22180
|
for (const heritage of node.heritageClauses ?? []) {
|
|
22055
|
-
if (heritage.token !==
|
|
22181
|
+
if (heritage.token !== ts13.SyntaxKind.ExtendsKeyword) {
|
|
22056
22182
|
continue;
|
|
22057
22183
|
}
|
|
22058
22184
|
const first = heritage.types[0];
|
|
22059
|
-
if (first &&
|
|
22185
|
+
if (first && ts13.isIdentifier(first.expression)) {
|
|
22060
22186
|
extendsName = first.expression.text;
|
|
22061
22187
|
}
|
|
22062
22188
|
break;
|
|
@@ -22069,7 +22195,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file4) => file4.endsWith(".ts") ||
|
|
|
22069
22195
|
extendsName
|
|
22070
22196
|
};
|
|
22071
22197
|
const arg = expr.arguments[0];
|
|
22072
|
-
if (arg &&
|
|
22198
|
+
if (arg && ts13.isObjectLiteralExpression(arg) && kind === "component") {
|
|
22073
22199
|
const tplUrl = getStringPropertyValue(arg, "templateUrl");
|
|
22074
22200
|
if (tplUrl)
|
|
22075
22201
|
entry.templateUrls.push(tplUrl);
|
|
@@ -22082,7 +22208,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file4) => file4.endsWith(".ts") ||
|
|
|
22082
22208
|
break;
|
|
22083
22209
|
}
|
|
22084
22210
|
}
|
|
22085
|
-
|
|
22211
|
+
ts13.forEachChild(node, visit);
|
|
22086
22212
|
};
|
|
22087
22213
|
visit(sourceFile);
|
|
22088
22214
|
return out;
|
|
@@ -22122,16 +22248,16 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file4) => file4.endsWith(".ts") ||
|
|
|
22122
22248
|
}, indexByRoot, resolveParentClassFile = (parentName, childFilePath, angularRoot) => {
|
|
22123
22249
|
let source;
|
|
22124
22250
|
try {
|
|
22125
|
-
source =
|
|
22251
|
+
source = readFileSync22(childFilePath, "utf8");
|
|
22126
22252
|
} catch {
|
|
22127
22253
|
return null;
|
|
22128
22254
|
}
|
|
22129
|
-
const sf =
|
|
22255
|
+
const sf = ts13.createSourceFile(childFilePath, source, ts13.ScriptTarget.ES2022, true, ts13.ScriptKind.TS);
|
|
22130
22256
|
const childDir = dirname22(childFilePath);
|
|
22131
22257
|
for (const stmt of sf.statements) {
|
|
22132
|
-
if (!
|
|
22258
|
+
if (!ts13.isImportDeclaration(stmt))
|
|
22133
22259
|
continue;
|
|
22134
|
-
if (!
|
|
22260
|
+
if (!ts13.isStringLiteral(stmt.moduleSpecifier))
|
|
22135
22261
|
continue;
|
|
22136
22262
|
const clause = stmt.importClause;
|
|
22137
22263
|
if (!clause || clause.isTypeOnly)
|
|
@@ -22139,7 +22265,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file4) => file4.endsWith(".ts") ||
|
|
|
22139
22265
|
let matchesName = false;
|
|
22140
22266
|
if (clause.name && clause.name.text === parentName)
|
|
22141
22267
|
matchesName = true;
|
|
22142
|
-
if (!matchesName && clause.namedBindings &&
|
|
22268
|
+
if (!matchesName && clause.namedBindings && ts13.isNamedImports(clause.namedBindings)) {
|
|
22143
22269
|
for (const el of clause.namedBindings.elements) {
|
|
22144
22270
|
if (el.isTypeOnly)
|
|
22145
22271
|
continue;
|
|
@@ -22489,8 +22615,8 @@ __export(exports_moduleServer, {
|
|
|
22489
22615
|
createModuleServer: () => createModuleServer,
|
|
22490
22616
|
SRC_URL_PREFIX: () => SRC_URL_PREFIX
|
|
22491
22617
|
});
|
|
22492
|
-
import { existsSync as existsSync30, readFileSync as
|
|
22493
|
-
import { basename as
|
|
22618
|
+
import { existsSync as existsSync30, readFileSync as readFileSync23, statSync as statSync6 } from "fs";
|
|
22619
|
+
import { basename as basename12, dirname as dirname23, extname as extname10, join as join39, resolve as resolve37, relative as relative16 } from "path";
|
|
22494
22620
|
var SRC_PREFIX = "/@src/", jsTranspiler2, tsTranspiler2, tsxTranspiler, TRANSPILABLE, ALL_EXPORTS_RE, STRING_CONTENTS_RE, preserveTypeExports = (originalSource, transpiled, valueExports) => {
|
|
22495
22621
|
const codeOnly = originalSource.replace(STRING_CONTENTS_RE, '""');
|
|
22496
22622
|
const allExports = [];
|
|
@@ -22538,11 +22664,11 @@ ${stubs}
|
|
|
22538
22664
|
}
|
|
22539
22665
|
}, resolveRelativeImport = (relPath, fileDir, projectRoot, extensions) => {
|
|
22540
22666
|
const absPath = resolve37(fileDir, relPath);
|
|
22541
|
-
const rel =
|
|
22667
|
+
const rel = relative16(projectRoot, absPath);
|
|
22542
22668
|
const extension = extname10(rel);
|
|
22543
22669
|
let srcPath = RESOLVED_MODULE_EXTENSIONS.has(extension) ? rel : resolveRelativeExtension(rel, projectRoot, extensions);
|
|
22544
22670
|
if (extname10(srcPath) === ".svelte") {
|
|
22545
|
-
srcPath =
|
|
22671
|
+
srcPath = relative16(projectRoot, resolveSvelteModulePath(resolve37(projectRoot, srcPath)));
|
|
22546
22672
|
}
|
|
22547
22673
|
return srcUrl(srcPath, projectRoot);
|
|
22548
22674
|
}, NODE_BUILTIN_RE, resolveAbsoluteSpecifier = (specifier, projectRoot) => {
|
|
@@ -22554,7 +22680,7 @@ ${stubs}
|
|
|
22554
22680
|
"import"
|
|
22555
22681
|
]);
|
|
22556
22682
|
if (fromExports)
|
|
22557
|
-
return
|
|
22683
|
+
return relative16(projectRoot, fromExports);
|
|
22558
22684
|
try {
|
|
22559
22685
|
const isScoped = specifier.startsWith("@");
|
|
22560
22686
|
const parts = specifier.split("/");
|
|
@@ -22562,19 +22688,19 @@ ${stubs}
|
|
|
22562
22688
|
const subpath = isScoped ? parts.slice(2).join("/") : parts.slice(1).join("/");
|
|
22563
22689
|
if (!subpath) {
|
|
22564
22690
|
const pkgDir = resolve37(projectRoot, "node_modules", packageName ?? "");
|
|
22565
|
-
const pkgJsonPath =
|
|
22691
|
+
const pkgJsonPath = join39(pkgDir, "package.json");
|
|
22566
22692
|
if (existsSync30(pkgJsonPath)) {
|
|
22567
|
-
const pkg = JSON.parse(
|
|
22693
|
+
const pkg = JSON.parse(readFileSync23(pkgJsonPath, "utf-8"));
|
|
22568
22694
|
const esmEntry = typeof pkg.module === "string" && pkg.module || typeof pkg.browser === "string" && pkg.browser;
|
|
22569
22695
|
if (esmEntry) {
|
|
22570
22696
|
const resolved = resolve37(pkgDir, esmEntry);
|
|
22571
22697
|
if (existsSync30(resolved))
|
|
22572
|
-
return
|
|
22698
|
+
return relative16(projectRoot, resolved);
|
|
22573
22699
|
}
|
|
22574
22700
|
}
|
|
22575
22701
|
}
|
|
22576
22702
|
} catch {}
|
|
22577
|
-
return
|
|
22703
|
+
return relative16(projectRoot, Bun.resolveSync(specifier, projectRoot));
|
|
22578
22704
|
} catch {
|
|
22579
22705
|
return;
|
|
22580
22706
|
}
|
|
@@ -22605,22 +22731,22 @@ ${stubs}
|
|
|
22605
22731
|
result = result.replace(/(import\s*["'])(\.\.?\/[^"']+)(["']\s*;?)/g, (_match, prefix, relPath, suffix) => `${prefix}${resolveRelativeImport(relPath, fileDir, projectRoot, SIDE_EFFECT_EXTENSIONS)}${suffix}`);
|
|
22606
22732
|
const rewriteAbsoluteToSrc = (_match, prefix, absPath, _ext, suffix) => {
|
|
22607
22733
|
if (absPath.startsWith(projectRoot)) {
|
|
22608
|
-
const rel2 =
|
|
22734
|
+
const rel2 = relative16(projectRoot, absPath).replace(/\\/g, "/");
|
|
22609
22735
|
return `${prefix}${srcUrl(rel2, projectRoot)}${suffix}`;
|
|
22610
22736
|
}
|
|
22611
|
-
const rel =
|
|
22737
|
+
const rel = relative16(projectRoot, absPath).replace(/\\/g, "/");
|
|
22612
22738
|
return `${prefix}${srcUrl(rel, projectRoot)}${suffix}`;
|
|
22613
22739
|
};
|
|
22614
22740
|
result = result.replace(/((?:from|import)\s*["'])(\/[^"']+\.(tsx?|jsx?|ts))(["'])/g, rewriteAbsoluteToSrc);
|
|
22615
22741
|
result = result.replace(/(import\s*\(\s*["'])(\/[^"']+\.(tsx?|jsx?|ts))(["']\s*\))/g, rewriteAbsoluteToSrc);
|
|
22616
22742
|
result = result.replace(/new\s+URL\(\s*["'](\.\.?\/[^"']+)["']\s*,\s*import\.meta\.url\s*\)/g, (_match, relPath) => {
|
|
22617
22743
|
const absPath = resolve37(fileDir, relPath);
|
|
22618
|
-
const rel =
|
|
22744
|
+
const rel = relative16(projectRoot, absPath);
|
|
22619
22745
|
return `new URL('${srcUrl(rel, projectRoot)}', import.meta.url)`;
|
|
22620
22746
|
});
|
|
22621
22747
|
result = result.replace(/import\.meta\.resolve\(\s*["'](\.\.?\/[^"']+)["']\s*\)/g, (_match, relPath) => {
|
|
22622
22748
|
const absPath = resolve37(fileDir, relPath);
|
|
22623
|
-
const rel =
|
|
22749
|
+
const rel = relative16(projectRoot, absPath);
|
|
22624
22750
|
return `'${srcUrl(rel, projectRoot)}'`;
|
|
22625
22751
|
});
|
|
22626
22752
|
return result;
|
|
@@ -22665,7 +22791,7 @@ ${code}`;
|
|
|
22665
22791
|
reactFastRefreshWarningEmitted = true;
|
|
22666
22792
|
logWarn("React HMR is blocked: this Bun build ignores " + "`reactFastRefresh` on Bun.Transpiler, so component state " + "cannot be preserved across edits. Tracking " + "https://github.com/oven-sh/bun/pull/28312 \u2014 if it still has " + "not merged, leave a \uD83D\uDC4D on the PR so the Bun team knows it " + "is blocking you. Until then, React edits trigger a full " + "reload instead of a fast refresh.");
|
|
22667
22793
|
}, transformReactFile = (filePath, projectRoot, rewriter) => {
|
|
22668
|
-
const raw =
|
|
22794
|
+
const raw = readFileSync23(filePath, "utf-8");
|
|
22669
22795
|
const valueExports = tsxTranspiler.scan(raw).exports;
|
|
22670
22796
|
let transpiled = reactTranspiler.transformSync(raw);
|
|
22671
22797
|
transpiled = preserveTypeExports(raw, transpiled, valueExports);
|
|
@@ -22676,12 +22802,12 @@ ${code}`;
|
|
|
22676
22802
|
transpiled = `var $RefreshReg$ = window.$RefreshReg$ || function(){};
|
|
22677
22803
|
` + `var $RefreshSig$ = window.$RefreshSig$ || function(){ return function(t){ return t; }; };
|
|
22678
22804
|
${transpiled}`;
|
|
22679
|
-
const relPath =
|
|
22805
|
+
const relPath = relative16(projectRoot, filePath).replace(/\\/g, "/");
|
|
22680
22806
|
transpiled = transpiled.replace(/\binput\.tsx:/g, `${relPath}:`);
|
|
22681
22807
|
transpiled += buildIslandMetadataExports(raw);
|
|
22682
22808
|
return rewriteImports(transpiled, filePath, projectRoot, rewriter);
|
|
22683
22809
|
}, transformPlainFile = (filePath, projectRoot, rewriter, vueDir) => {
|
|
22684
|
-
const raw =
|
|
22810
|
+
const raw = readFileSync23(filePath, "utf-8");
|
|
22685
22811
|
const ext = extname10(filePath);
|
|
22686
22812
|
const isTS = ext === ".ts" || ext === ".tsx";
|
|
22687
22813
|
const isTSX = ext === ".tsx" || ext === ".jsx";
|
|
@@ -22837,17 +22963,17 @@ ${code}`;
|
|
|
22837
22963
|
if (compiled.css?.code) {
|
|
22838
22964
|
const cssPath = `${filePath}.css`;
|
|
22839
22965
|
svelteExternalCss.set(cssPath, compiled.css.code);
|
|
22840
|
-
const cssUrl = srcUrl(
|
|
22966
|
+
const cssUrl = srcUrl(relative16(projectRoot, cssPath), projectRoot);
|
|
22841
22967
|
code = `import "${cssUrl}";
|
|
22842
22968
|
${code}`;
|
|
22843
22969
|
}
|
|
22844
|
-
const moduleUrl = `${SRC_PREFIX}${
|
|
22970
|
+
const moduleUrl = `${SRC_PREFIX}${relative16(projectRoot, filePath).replace(/\\/g, "/")}`;
|
|
22845
22971
|
code = code.replace(/if\s*\(import\.meta\.hot\)\s*\{/, `if (typeof window !== "undefined") {
|
|
22846
22972
|
` + ` if (!window.__SVELTE_HMR_ACCEPT__) window.__SVELTE_HMR_ACCEPT__ = {};
|
|
22847
22973
|
` + ` var __hmr_accept = function(cb) { window.__SVELTE_HMR_ACCEPT__[${JSON.stringify(moduleUrl)}] = cb; };`);
|
|
22848
22974
|
return code.replace(/import\.meta\.hot\.accept\(/g, "__hmr_accept(");
|
|
22849
22975
|
}, transformSvelteFile = async (filePath, projectRoot, rewriter, stylePreprocessors) => {
|
|
22850
|
-
const raw =
|
|
22976
|
+
const raw = readFileSync23(filePath, "utf-8");
|
|
22851
22977
|
if (!svelteCompiler) {
|
|
22852
22978
|
svelteCompiler = await import("svelte/compiler");
|
|
22853
22979
|
}
|
|
@@ -22909,12 +23035,12 @@ export default __script__;`;
|
|
|
22909
23035
|
return `${cssInjection}
|
|
22910
23036
|
${code}`;
|
|
22911
23037
|
}, transformVueFile = async (filePath, projectRoot, rewriter, vueDir, stylePreprocessors) => {
|
|
22912
|
-
const rawSource =
|
|
23038
|
+
const rawSource = readFileSync23(filePath, "utf-8");
|
|
22913
23039
|
const raw = addAutoRouterSetupApp(rawSource);
|
|
22914
23040
|
if (!vueCompiler) {
|
|
22915
23041
|
vueCompiler = await import("@vue/compiler-sfc");
|
|
22916
23042
|
}
|
|
22917
|
-
const fileName =
|
|
23043
|
+
const fileName = basename12(filePath, ".vue");
|
|
22918
23044
|
const componentId = fileName.toLowerCase();
|
|
22919
23045
|
const { descriptor } = vueCompiler.parse(raw, { filename: filePath });
|
|
22920
23046
|
const hasScript = descriptor.script || descriptor.scriptSetup;
|
|
@@ -22933,7 +23059,7 @@ ${code}`;
|
|
|
22933
23059
|
return rewriteImports(code, filePath, projectRoot, rewriter);
|
|
22934
23060
|
}, injectVueHmr = (code, filePath, projectRoot, vueDir) => {
|
|
22935
23061
|
const hmrBase = vueDir ? resolve37(vueDir) : projectRoot;
|
|
22936
|
-
const hmrId =
|
|
23062
|
+
const hmrId = relative16(hmrBase, filePath).replace(/\\/g, "/").replace(/\.vue$/, "");
|
|
22937
23063
|
let result = code.replace(/export\s+default\s+/, "var __hmr_comp__ = ");
|
|
22938
23064
|
result += [
|
|
22939
23065
|
"",
|
|
@@ -22964,7 +23090,7 @@ ${code}`;
|
|
|
22964
23090
|
}
|
|
22965
23091
|
});
|
|
22966
23092
|
}, handleCssRequest = (filePath) => {
|
|
22967
|
-
const raw =
|
|
23093
|
+
const raw = readFileSync23(filePath, "utf-8");
|
|
22968
23094
|
const escaped = raw.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$/g, "\\$");
|
|
22969
23095
|
return [
|
|
22970
23096
|
`const style = document.createElement('style');`,
|
|
@@ -23395,7 +23521,7 @@ __export(exports_hmrCompiler, {
|
|
|
23395
23521
|
getApplyMetadataModule: () => getApplyMetadataModule,
|
|
23396
23522
|
encodeHmrComponentId: () => encodeHmrComponentId
|
|
23397
23523
|
});
|
|
23398
|
-
import { dirname as dirname24, relative as
|
|
23524
|
+
import { dirname as dirname24, relative as relative17, resolve as resolve38 } from "path";
|
|
23399
23525
|
import { performance as performance2 } from "perf_hooks";
|
|
23400
23526
|
var getApplyMetadataModule = async (encodedId) => {
|
|
23401
23527
|
const decoded = decodeURIComponent(encodedId);
|
|
@@ -23405,7 +23531,7 @@ var getApplyMetadataModule = async (encodedId) => {
|
|
|
23405
23531
|
const filePathRel = decoded.slice(0, at2);
|
|
23406
23532
|
const className = decoded.slice(at2 + 1);
|
|
23407
23533
|
const componentFilePath = resolve38(process.cwd(), filePathRel);
|
|
23408
|
-
const projectRelPath =
|
|
23534
|
+
const projectRelPath = relative17(process.cwd(), componentFilePath).replace(/\\/g, "/");
|
|
23409
23535
|
const cacheKey2 = encodeURIComponent(`${projectRelPath}@${className}`);
|
|
23410
23536
|
const { takePendingModule: takePendingModule2 } = await Promise.resolve().then(() => (init_fastHmrCompiler(), exports_fastHmrCompiler));
|
|
23411
23537
|
const cached = takePendingModule2(cacheKey2);
|
|
@@ -23427,7 +23553,7 @@ var getApplyMetadataModule = async (encodedId) => {
|
|
|
23427
23553
|
}
|
|
23428
23554
|
return null;
|
|
23429
23555
|
}, encodeHmrComponentId = (absoluteFilePath, className) => {
|
|
23430
|
-
const projectRel =
|
|
23556
|
+
const projectRel = relative17(process.cwd(), absoluteFilePath).replace(/\\/g, "/");
|
|
23431
23557
|
return `${projectRel}@${className}`;
|
|
23432
23558
|
};
|
|
23433
23559
|
var init_hmrCompiler = __esm(() => {
|
|
@@ -23623,7 +23749,7 @@ var init_simpleHTMXHMR = () => {};
|
|
|
23623
23749
|
|
|
23624
23750
|
// src/dev/rebuildTrigger.ts
|
|
23625
23751
|
import { existsSync as existsSync31, rmSync as rmSync3 } from "fs";
|
|
23626
|
-
import { basename as
|
|
23752
|
+
import { basename as basename13, dirname as dirname25, join as join40, relative as relative18, resolve as resolve41, sep as sep4 } from "path";
|
|
23627
23753
|
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) => {
|
|
23628
23754
|
if (!config.tailwind)
|
|
23629
23755
|
return;
|
|
@@ -23740,8 +23866,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
23740
23866
|
const relJs = `${rel.slice(0, -ext[0].length)}.js`;
|
|
23741
23867
|
const generatedDir = getFrameworkGeneratedDir(framework, cwd2);
|
|
23742
23868
|
for (const candidate of [
|
|
23743
|
-
|
|
23744
|
-
`${
|
|
23869
|
+
join40(generatedDir, relJs),
|
|
23870
|
+
`${join40(generatedDir, relJs)}.map`
|
|
23745
23871
|
]) {
|
|
23746
23872
|
try {
|
|
23747
23873
|
rmSync3(candidate, { force: true });
|
|
@@ -23953,7 +24079,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
23953
24079
|
const webPath = urlPrefix ? `/${urlPrefix}/${relFromDir}` : `/${relFromDir}`;
|
|
23954
24080
|
state.assetStore.set(webPath, new Uint8Array(bytes));
|
|
23955
24081
|
state.fileHashes.set(absSource, currentHash);
|
|
23956
|
-
logHmrUpdate(
|
|
24082
|
+
logHmrUpdate(relative18(process.cwd(), filePath));
|
|
23957
24083
|
broadcastToClients(state, {
|
|
23958
24084
|
data: {
|
|
23959
24085
|
framework: urlPrefix || "public",
|
|
@@ -23971,7 +24097,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
23971
24097
|
return;
|
|
23972
24098
|
if (framework === "unknown") {
|
|
23973
24099
|
invalidate(resolve41(filePath));
|
|
23974
|
-
const relPath =
|
|
24100
|
+
const relPath = relative18(process.cwd(), filePath);
|
|
23975
24101
|
logHmrUpdate(relPath);
|
|
23976
24102
|
const angularDir = state.resolvedPaths.angularDir;
|
|
23977
24103
|
let hasAngularDependent = false;
|
|
@@ -24127,7 +24253,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24127
24253
|
if (serverDirs.length <= 1) {
|
|
24128
24254
|
const dir = getFrameworkGeneratedDir2(framework, projectRoot);
|
|
24129
24255
|
return {
|
|
24130
|
-
serverOutDir: resolve41(resolvedPaths.buildDir,
|
|
24256
|
+
serverOutDir: resolve41(resolvedPaths.buildDir, basename13(dir)),
|
|
24131
24257
|
serverRoot: resolve41(dir, "server")
|
|
24132
24258
|
};
|
|
24133
24259
|
}
|
|
@@ -24136,7 +24262,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24136
24262
|
serverRoot: commonAncestor2(serverDirs.map((entry) => entry.dir), projectRoot)
|
|
24137
24263
|
};
|
|
24138
24264
|
}, updateServerManifestEntry = (state, artifact) => {
|
|
24139
|
-
const fileWithHash =
|
|
24265
|
+
const fileWithHash = basename13(artifact.path);
|
|
24140
24266
|
const [baseName] = fileWithHash.split(`.${artifact.hash}.`);
|
|
24141
24267
|
if (!baseName) {
|
|
24142
24268
|
return;
|
|
@@ -24150,7 +24276,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24150
24276
|
const prefixByDir = new Map;
|
|
24151
24277
|
for (const artifact of freshOutputs) {
|
|
24152
24278
|
const dir = dirname25(artifact.path);
|
|
24153
|
-
const name =
|
|
24279
|
+
const name = basename13(artifact.path);
|
|
24154
24280
|
const [prefix] = name.split(".");
|
|
24155
24281
|
if (!prefix)
|
|
24156
24282
|
continue;
|
|
@@ -24562,7 +24688,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24562
24688
|
try {
|
|
24563
24689
|
const { invalidateModule: invalidateModule2 } = await Promise.resolve().then(() => (init_moduleServer(), exports_moduleServer));
|
|
24564
24690
|
for (const tsFile of tsFilesToRefresh) {
|
|
24565
|
-
const rel =
|
|
24691
|
+
const rel = relative18(angularDirAbs, tsFile).replace(/\\/g, "/").replace(/\.[tj]sx?$/, ".js");
|
|
24566
24692
|
const compiledFile = resolve41(compiledRoot, rel);
|
|
24567
24693
|
invalidateModule2(compiledFile);
|
|
24568
24694
|
}
|
|
@@ -24579,12 +24705,12 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24579
24705
|
try {
|
|
24580
24706
|
const { primeComponentFingerprint: primeComponentFingerprint2 } = await Promise.resolve().then(() => (init_fastHmrCompiler(), exports_fastHmrCompiler));
|
|
24581
24707
|
const { readdir: readdir5 } = await import("fs/promises");
|
|
24582
|
-
const { join:
|
|
24708
|
+
const { join: join41 } = await import("path");
|
|
24583
24709
|
const walk = async (dir) => {
|
|
24584
24710
|
const entries = await readdir5(dir, { withFileTypes: true });
|
|
24585
24711
|
const files = [];
|
|
24586
24712
|
for (const entry of entries) {
|
|
24587
|
-
const full =
|
|
24713
|
+
const full = join41(dir, entry.name);
|
|
24588
24714
|
if (entry.isDirectory()) {
|
|
24589
24715
|
files.push(...await walk(full));
|
|
24590
24716
|
} else if (entry.isFile() && entry.name.endsWith(".ts") && !entry.name.endsWith(".d.ts")) {
|
|
@@ -24612,7 +24738,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24612
24738
|
await rewriteImports3(ssrPaths, angServerVendorPaths);
|
|
24613
24739
|
}
|
|
24614
24740
|
serverPaths.forEach((serverPath, idx) => {
|
|
24615
|
-
const fileBase =
|
|
24741
|
+
const fileBase = basename13(serverPath, ".js");
|
|
24616
24742
|
const ssrPath = ssrPaths[idx] ?? serverPath;
|
|
24617
24743
|
state.manifest[toPascal(fileBase)] = resolve41(ssrPath);
|
|
24618
24744
|
});
|
|
@@ -24661,7 +24787,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24661
24787
|
}, getModuleUrl = async (pageFile) => {
|
|
24662
24788
|
const { invalidateModule: invalidateModule2, warmCache: warmCache2, SRC_URL_PREFIX: SRC_URL_PREFIX2 } = await Promise.resolve().then(() => (init_moduleServer(), exports_moduleServer));
|
|
24663
24789
|
invalidateModule2(pageFile);
|
|
24664
|
-
const rel =
|
|
24790
|
+
const rel = relative18(process.cwd(), pageFile).replace(/\\/g, "/");
|
|
24665
24791
|
const url = `${SRC_URL_PREFIX2}${rel}`;
|
|
24666
24792
|
warmCache2(url);
|
|
24667
24793
|
return url;
|
|
@@ -24692,7 +24818,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24692
24818
|
const pageModuleUrl = await getReactModuleUrl(broadcastTarget);
|
|
24693
24819
|
if (pageModuleUrl) {
|
|
24694
24820
|
const serverDuration = Date.now() - startTime;
|
|
24695
|
-
state.lastHmrPath =
|
|
24821
|
+
state.lastHmrPath = relative18(process.cwd(), primaryFile).replace(/\\/g, "/");
|
|
24696
24822
|
state.lastHmrFramework = "react";
|
|
24697
24823
|
broadcastToClients(state, {
|
|
24698
24824
|
data: {
|
|
@@ -24947,7 +25073,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24947
25073
|
const duration = Date.now() - startTime;
|
|
24948
25074
|
const broadcastFiles = svelteFiles.length > 0 ? svelteFiles : filesToRebuild;
|
|
24949
25075
|
broadcastFiles.forEach((sveltePagePath) => {
|
|
24950
|
-
const fileName =
|
|
25076
|
+
const fileName = basename13(sveltePagePath);
|
|
24951
25077
|
const baseName = fileName.replace(/\.svelte$/, "");
|
|
24952
25078
|
const pascalName = toPascal(baseName);
|
|
24953
25079
|
const cssKey = `${pascalName}CSS`;
|
|
@@ -25027,7 +25153,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
25027
25153
|
const { vueServerPaths, vueIndexPaths, vueClientPaths, vueCssPaths } = await compileVue2(vueFiles, vueDir, true, getStyleTransformConfig(state.config));
|
|
25028
25154
|
const serverEntries = [...vueServerPaths];
|
|
25029
25155
|
const clientEntries = [...vueIndexPaths, ...vueClientPaths];
|
|
25030
|
-
const cssOutDir =
|
|
25156
|
+
const cssOutDir = join40(buildDir, state.resolvedPaths.assetsDir ? basename13(state.resolvedPaths.assetsDir) : "assets", "css");
|
|
25031
25157
|
const { serverRoot, serverOutDir } = await computeServerOutPaths(state.resolvedPaths, "vue");
|
|
25032
25158
|
const [serverResult, clientResult, cssResult] = await Promise.all([
|
|
25033
25159
|
serverEntries.length > 0 ? bunBuild9({
|
|
@@ -25175,7 +25301,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
25175
25301
|
const { compileEmber: compileEmber2 } = await Promise.resolve().then(() => (init_compileEmber(), exports_compileEmber));
|
|
25176
25302
|
const { serverPaths } = await compileEmber2(allPageEntries, emberDir, process.cwd(), true);
|
|
25177
25303
|
for (const serverPath of serverPaths) {
|
|
25178
|
-
const fileBase =
|
|
25304
|
+
const fileBase = basename13(serverPath, ".js");
|
|
25179
25305
|
state.manifest[toPascal(fileBase)] = resolve41(serverPath);
|
|
25180
25306
|
}
|
|
25181
25307
|
const { invalidateEmberSsrCache: invalidateEmberSsrCache2 } = await Promise.resolve().then(() => (init_ember(), exports_ember));
|
|
@@ -25183,7 +25309,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
25183
25309
|
const duration = Date.now() - startTime;
|
|
25184
25310
|
const [primary] = emberFiles;
|
|
25185
25311
|
if (primary) {
|
|
25186
|
-
state.lastHmrPath =
|
|
25312
|
+
state.lastHmrPath = relative18(process.cwd(), primary).replace(/\\/g, "/");
|
|
25187
25313
|
state.lastHmrFramework = "ember";
|
|
25188
25314
|
logHmrUpdate(primary, "ember", duration);
|
|
25189
25315
|
}
|
|
@@ -25246,7 +25372,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
25246
25372
|
});
|
|
25247
25373
|
}
|
|
25248
25374
|
}, handleScriptUpdate = (state, scriptFile, manifest, framework, duration) => {
|
|
25249
|
-
const scriptBaseName =
|
|
25375
|
+
const scriptBaseName = basename13(scriptFile).replace(/\.(ts|js|tsx|jsx)$/, "");
|
|
25250
25376
|
const pascalName = toPascal(scriptBaseName);
|
|
25251
25377
|
const scriptPath = manifest[pascalName] || null;
|
|
25252
25378
|
if (!scriptPath) {
|
|
@@ -25325,7 +25451,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
25325
25451
|
if (isSingle) {
|
|
25326
25452
|
return resolve41(state.resolvedPaths.buildDir, "pages");
|
|
25327
25453
|
}
|
|
25328
|
-
const dirName = framework === "html" ?
|
|
25454
|
+
const dirName = framework === "html" ? basename13(config.htmlDirectory ?? "html") : basename13(config.htmxDirectory ?? "htmx");
|
|
25329
25455
|
return resolve41(state.resolvedPaths.buildDir, dirName, "pages");
|
|
25330
25456
|
}, processHtmlPageUpdate = async (state, pageFile, builtHtmlPagePath, manifest, duration) => {
|
|
25331
25457
|
try {
|
|
@@ -25364,7 +25490,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
25364
25490
|
const shouldRefreshAllPages = htmlPageFiles.length === 0 && shouldRefreshFromIslandChange;
|
|
25365
25491
|
const pageFilesToUpdate = shouldRefreshAllPages ? await scanEntryPoints(outputHtmlPages, "*.html") : htmlPageFiles;
|
|
25366
25492
|
await runSequentially(pageFilesToUpdate, async (pageFile) => {
|
|
25367
|
-
const htmlPageName =
|
|
25493
|
+
const htmlPageName = basename13(pageFile);
|
|
25368
25494
|
const builtHtmlPagePath = resolve41(outputHtmlPages, htmlPageName);
|
|
25369
25495
|
await processHtmlPageUpdate(state, pageFile, builtHtmlPagePath, manifest, duration);
|
|
25370
25496
|
});
|
|
@@ -25373,7 +25499,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
25373
25499
|
if (!cssFile) {
|
|
25374
25500
|
return;
|
|
25375
25501
|
}
|
|
25376
|
-
const cssBaseName =
|
|
25502
|
+
const cssBaseName = basename13(getStyleBaseName(cssFile));
|
|
25377
25503
|
const cssPascalName = toPascal(cssBaseName);
|
|
25378
25504
|
const cssKey = `${cssPascalName}CSS`;
|
|
25379
25505
|
const cssUrl = manifest[cssKey] || null;
|
|
@@ -25422,11 +25548,11 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
25422
25548
|
type: "vue-update"
|
|
25423
25549
|
});
|
|
25424
25550
|
}, broadcastVuePageChange = async (state, config, vuePagePath, manifest, duration) => {
|
|
25425
|
-
const fileName =
|
|
25551
|
+
const fileName = basename13(vuePagePath);
|
|
25426
25552
|
const baseName = fileName.replace(/\.vue$/, "");
|
|
25427
25553
|
const pascalName = toPascal(baseName);
|
|
25428
25554
|
const vueRoot = config.vueDirectory;
|
|
25429
|
-
const hmrId = vueRoot ?
|
|
25555
|
+
const hmrId = vueRoot ? relative18(vueRoot, vuePagePath).replace(/\\/g, "/").replace(/\.vue$/, "") : baseName;
|
|
25430
25556
|
const cssKey = `${pascalName}CSS`;
|
|
25431
25557
|
const cssUrl = manifest[cssKey] || null;
|
|
25432
25558
|
const { vueHmrMetadata: vueHmrMetadata2 } = await Promise.resolve().then(() => (init_compileVue(), exports_compileVue));
|
|
@@ -25468,7 +25594,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
25468
25594
|
if (!cssFile) {
|
|
25469
25595
|
return;
|
|
25470
25596
|
}
|
|
25471
|
-
const cssBaseName =
|
|
25597
|
+
const cssBaseName = basename13(getStyleBaseName(cssFile));
|
|
25472
25598
|
const cssPascalName = toPascal(cssBaseName);
|
|
25473
25599
|
const cssKey = `${cssPascalName}CSS`;
|
|
25474
25600
|
const cssUrl = manifest[cssKey] || null;
|
|
@@ -25486,7 +25612,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
25486
25612
|
});
|
|
25487
25613
|
}, broadcastSveltePageUpdate = (state, sveltePagePath, manifest, duration) => {
|
|
25488
25614
|
try {
|
|
25489
|
-
const fileName =
|
|
25615
|
+
const fileName = basename13(sveltePagePath);
|
|
25490
25616
|
const baseName = fileName.replace(/\.svelte$/, "");
|
|
25491
25617
|
const pascalName = toPascal(baseName);
|
|
25492
25618
|
const cssKey = `${pascalName}CSS`;
|
|
@@ -25534,7 +25660,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
25534
25660
|
if (!cssFile) {
|
|
25535
25661
|
return;
|
|
25536
25662
|
}
|
|
25537
|
-
const cssBaseName =
|
|
25663
|
+
const cssBaseName = basename13(getStyleBaseName(cssFile));
|
|
25538
25664
|
const cssPascalName = toPascal(cssBaseName);
|
|
25539
25665
|
const cssKey = `${cssPascalName}CSS`;
|
|
25540
25666
|
const cssUrl = manifest[cssKey] || null;
|
|
@@ -25614,7 +25740,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
25614
25740
|
const shouldRefreshAllPages = htmxPageFiles.length === 0 && shouldRefreshFromIslandChange;
|
|
25615
25741
|
const pageFilesToUpdate = shouldRefreshAllPages ? await scanEntryPoints(outputHtmxPages, "*.html") : htmxPageFiles;
|
|
25616
25742
|
await runSequentially(pageFilesToUpdate, async (htmxPageFile) => {
|
|
25617
|
-
const htmxPageName =
|
|
25743
|
+
const htmxPageName = basename13(htmxPageFile);
|
|
25618
25744
|
const builtHtmxPagePath = resolve41(outputHtmxPages, htmxPageName);
|
|
25619
25745
|
await processHtmxPageUpdate(state, htmxPageFile, builtHtmxPagePath, manifest, duration);
|
|
25620
25746
|
});
|
|
@@ -25724,7 +25850,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
25724
25850
|
html = html.slice(0, bodyClose.index) + hmrScript + html.slice(bodyClose.index);
|
|
25725
25851
|
writeFs(destPath, html);
|
|
25726
25852
|
}, processMarkupFileFastPath = async (state, sourceFile, outputDir, framework, startTime, updateAssetPaths2, handleUpdate, readFs, writeFs) => {
|
|
25727
|
-
const destPath = resolve41(outputDir,
|
|
25853
|
+
const destPath = resolve41(outputDir, basename13(sourceFile));
|
|
25728
25854
|
const hmrScript = extractHmrScript(destPath, readFs);
|
|
25729
25855
|
const source = await Bun.file(sourceFile).text();
|
|
25730
25856
|
await Bun.write(destPath, source);
|
|
@@ -26042,7 +26168,7 @@ __export(exports_buildDepVendor, {
|
|
|
26042
26168
|
buildDepVendor: () => buildDepVendor
|
|
26043
26169
|
});
|
|
26044
26170
|
import { mkdirSync as mkdirSync16 } from "fs";
|
|
26045
|
-
import { join as
|
|
26171
|
+
import { join as join41 } from "path";
|
|
26046
26172
|
import { rm as rm10 } from "fs/promises";
|
|
26047
26173
|
var {build: bunBuild9, Glob: Glob10 } = globalThis.Bun;
|
|
26048
26174
|
var toSafeFileName6 = (specifier) => {
|
|
@@ -26096,7 +26222,7 @@ var toSafeFileName6 = (specifier) => {
|
|
|
26096
26222
|
framework: Array.from(framework).filter(isResolvable4)
|
|
26097
26223
|
};
|
|
26098
26224
|
}, collectTransitiveImports = async (specs, alreadyVendored, alreadyScanned) => {
|
|
26099
|
-
const { readFileSync:
|
|
26225
|
+
const { readFileSync: readFileSync24 } = await import("fs");
|
|
26100
26226
|
const transpiler6 = new Bun.Transpiler({ loader: "js" });
|
|
26101
26227
|
const newSpecs = new Set;
|
|
26102
26228
|
for (const spec of specs) {
|
|
@@ -26111,7 +26237,7 @@ var toSafeFileName6 = (specifier) => {
|
|
|
26111
26237
|
}
|
|
26112
26238
|
let content;
|
|
26113
26239
|
try {
|
|
26114
|
-
content =
|
|
26240
|
+
content = readFileSync24(resolved, "utf-8");
|
|
26115
26241
|
} catch {
|
|
26116
26242
|
continue;
|
|
26117
26243
|
}
|
|
@@ -26153,7 +26279,7 @@ var toSafeFileName6 = (specifier) => {
|
|
|
26153
26279
|
}), buildDepVendorPass = async (specifiers, vendorDir, tmpDir) => {
|
|
26154
26280
|
const entries = await Promise.all(specifiers.map(async (specifier) => {
|
|
26155
26281
|
const safeName = toSafeFileName6(specifier);
|
|
26156
|
-
const entryPath =
|
|
26282
|
+
const entryPath = join41(tmpDir, `${safeName}.ts`);
|
|
26157
26283
|
await Bun.write(entryPath, await generateVendorEntrySource(specifier));
|
|
26158
26284
|
return { entryPath, specifier };
|
|
26159
26285
|
}));
|
|
@@ -26214,9 +26340,9 @@ var toSafeFileName6 = (specifier) => {
|
|
|
26214
26340
|
const { dep: initialSpecs, framework: frameworkRoots } = await scanBareImports(directories);
|
|
26215
26341
|
if (initialSpecs.length === 0 && frameworkRoots.length === 0)
|
|
26216
26342
|
return {};
|
|
26217
|
-
const vendorDir =
|
|
26343
|
+
const vendorDir = join41(buildDir, "vendor");
|
|
26218
26344
|
mkdirSync16(vendorDir, { recursive: true });
|
|
26219
|
-
const tmpDir =
|
|
26345
|
+
const tmpDir = join41(buildDir, "_dep_vendor_tmp");
|
|
26220
26346
|
mkdirSync16(tmpDir, { recursive: true });
|
|
26221
26347
|
const allSpecs = new Set(initialSpecs);
|
|
26222
26348
|
const alreadyScanned = new Set;
|
|
@@ -26728,5 +26854,5 @@ export {
|
|
|
26728
26854
|
build
|
|
26729
26855
|
};
|
|
26730
26856
|
|
|
26731
|
-
//# debugId=
|
|
26857
|
+
//# debugId=3A9DA44EB04713C964756E2164756E21
|
|
26732
26858
|
//# sourceMappingURL=build.js.map
|