@absolutejs/absolute 0.19.0-beta.987 → 0.19.0-beta.988
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/angular/index.js.map +2 -2
- package/dist/angular/server.js.map +2 -2
- package/dist/build.js +841 -662
- package/dist/build.js.map +8 -7
- package/dist/index.js +874 -695
- package/dist/index.js.map +8 -7
- package/dist/src/build/compileVue.d.ts +1 -1
- package/dist/src/build/scanVueSsrOnlyPages.d.ts +6 -0
- package/dist/src/vue/pageHandler.d.ts +20 -10
- package/dist/vue/index.js +242 -102
- package/dist/vue/index.js.map +7 -4
- package/dist/vue/server.js +145 -5
- package/dist/vue/server.js.map +7 -4
- package/package.json +1 -1
package/dist/build.js
CHANGED
|
@@ -10757,6 +10757,10 @@ var init_updateAssetPaths = __esm(() => {
|
|
|
10757
10757
|
});
|
|
10758
10758
|
|
|
10759
10759
|
// src/dev/buildHMRClient.ts
|
|
10760
|
+
var exports_buildHMRClient = {};
|
|
10761
|
+
__export(exports_buildHMRClient, {
|
|
10762
|
+
buildHMRClient: () => buildHMRClient
|
|
10763
|
+
});
|
|
10760
10764
|
import { existsSync as existsSync16 } from "fs";
|
|
10761
10765
|
import { resolve as resolve12 } from "path";
|
|
10762
10766
|
var {build: bunBuild } = globalThis.Bun;
|
|
@@ -11556,11 +11560,15 @@ var validateSafePath = (targetPath, baseDirectory) => {
|
|
|
11556
11560
|
};
|
|
11557
11561
|
var init_validateSafePath = () => {};
|
|
11558
11562
|
|
|
11559
|
-
// src/build/
|
|
11563
|
+
// src/build/scanVueSsrOnlyPages.ts
|
|
11564
|
+
var exports_scanVueSsrOnlyPages = {};
|
|
11565
|
+
__export(exports_scanVueSsrOnlyPages, {
|
|
11566
|
+
scanVueSsrOnlyPages: () => scanVueSsrOnlyPages
|
|
11567
|
+
});
|
|
11560
11568
|
import { readdirSync as readdirSync2, readFileSync as readFileSync12 } from "fs";
|
|
11561
11569
|
import { join as join22 } from "path";
|
|
11562
11570
|
import ts6 from "typescript";
|
|
11563
|
-
var
|
|
11571
|
+
var SKIP_DIRS2, SOURCE_EXTENSIONS2, getScriptKind2 = (filePath) => {
|
|
11564
11572
|
if (filePath.endsWith(".tsx"))
|
|
11565
11573
|
return ts6.ScriptKind.TSX;
|
|
11566
11574
|
return ts6.ScriptKind.TS;
|
|
@@ -11598,26 +11606,173 @@ var ELYSIA_ROUTE_METHODS2, SKIP_DIRS2, SOURCE_EXTENSIONS2, getScriptKind2 = (fil
|
|
|
11598
11606
|
}
|
|
11599
11607
|
}
|
|
11600
11608
|
return out;
|
|
11609
|
+
}, fileMayContainVueHandler = (source) => source.includes("handleVuePageRequest"), isHandleVuePageRequestCallee = (expression) => {
|
|
11610
|
+
if (ts6.isIdentifier(expression)) {
|
|
11611
|
+
return expression.text === "handleVuePageRequest";
|
|
11612
|
+
}
|
|
11613
|
+
if (ts6.isPropertyAccessExpression(expression) && ts6.isIdentifier(expression.name)) {
|
|
11614
|
+
return expression.name.text === "handleVuePageRequest";
|
|
11615
|
+
}
|
|
11616
|
+
return false;
|
|
11617
|
+
}, getPropertyName = (name) => {
|
|
11618
|
+
if (ts6.isIdentifier(name) || ts6.isStringLiteral(name)) {
|
|
11619
|
+
return name.text;
|
|
11620
|
+
}
|
|
11621
|
+
return null;
|
|
11622
|
+
}, readStringLiteralValue = (node) => {
|
|
11623
|
+
if (ts6.isStringLiteral(node) || ts6.isNoSubstitutionTemplateLiteral(node)) {
|
|
11624
|
+
return node.text;
|
|
11625
|
+
}
|
|
11626
|
+
return null;
|
|
11627
|
+
}, isAssetCall = (node) => {
|
|
11628
|
+
if (!ts6.isCallExpression(node))
|
|
11629
|
+
return false;
|
|
11630
|
+
if (!ts6.isIdentifier(node.expression))
|
|
11631
|
+
return false;
|
|
11632
|
+
return node.expression.text === "asset";
|
|
11633
|
+
}, extractAssetLiteralKey = (call) => {
|
|
11634
|
+
if (call.arguments.length < 2)
|
|
11635
|
+
return null;
|
|
11636
|
+
const keyArg = call.arguments[1];
|
|
11637
|
+
if (!keyArg)
|
|
11638
|
+
return null;
|
|
11639
|
+
return readStringLiteralValue(keyArg);
|
|
11640
|
+
}, extractPagePathAssetKey = (initializer) => {
|
|
11641
|
+
if (!isAssetCall(initializer))
|
|
11642
|
+
return null;
|
|
11643
|
+
if (!ts6.isCallExpression(initializer))
|
|
11644
|
+
return null;
|
|
11645
|
+
return extractAssetLiteralKey(initializer);
|
|
11646
|
+
}, extractSsrOnlyPageName = (objectLiteral) => {
|
|
11647
|
+
let hasClientNone = false;
|
|
11648
|
+
let pageAssetKey = null;
|
|
11649
|
+
for (const property of objectLiteral.properties) {
|
|
11650
|
+
if (!ts6.isPropertyAssignment(property))
|
|
11651
|
+
continue;
|
|
11652
|
+
const name = getPropertyName(property.name);
|
|
11653
|
+
if (!name)
|
|
11654
|
+
continue;
|
|
11655
|
+
if (name === "client") {
|
|
11656
|
+
const value = readStringLiteralValue(property.initializer);
|
|
11657
|
+
if (value === "none")
|
|
11658
|
+
hasClientNone = true;
|
|
11659
|
+
continue;
|
|
11660
|
+
}
|
|
11661
|
+
if (name === "pagePath") {
|
|
11662
|
+
pageAssetKey = extractPagePathAssetKey(property.initializer);
|
|
11663
|
+
}
|
|
11664
|
+
}
|
|
11665
|
+
if (!hasClientNone)
|
|
11666
|
+
return null;
|
|
11667
|
+
return pageAssetKey;
|
|
11668
|
+
}, extractFromFile = (filePath, out) => {
|
|
11669
|
+
let source;
|
|
11670
|
+
try {
|
|
11671
|
+
source = readFileSync12(filePath, "utf-8");
|
|
11672
|
+
} catch {
|
|
11673
|
+
return;
|
|
11674
|
+
}
|
|
11675
|
+
if (!fileMayContainVueHandler(source))
|
|
11676
|
+
return;
|
|
11677
|
+
const sourceFile = ts6.createSourceFile(filePath, source, ts6.ScriptTarget.Latest, true, getScriptKind2(filePath));
|
|
11678
|
+
const visit = (node) => {
|
|
11679
|
+
if (ts6.isCallExpression(node) && isHandleVuePageRequestCallee(node.expression)) {
|
|
11680
|
+
const firstArg = node.arguments[0];
|
|
11681
|
+
if (firstArg && ts6.isObjectLiteralExpression(firstArg)) {
|
|
11682
|
+
const pageName = extractSsrOnlyPageName(firstArg);
|
|
11683
|
+
if (pageName)
|
|
11684
|
+
out.add(pageName);
|
|
11685
|
+
}
|
|
11686
|
+
}
|
|
11687
|
+
ts6.forEachChild(node, visit);
|
|
11688
|
+
};
|
|
11689
|
+
ts6.forEachChild(sourceFile, visit);
|
|
11690
|
+
}, scanVueSsrOnlyPages = (projectRoot) => {
|
|
11691
|
+
const files = collectSourceFiles2(projectRoot);
|
|
11692
|
+
const ssrOnlyPageNames = new Set;
|
|
11693
|
+
for (const file of files) {
|
|
11694
|
+
extractFromFile(file, ssrOnlyPageNames);
|
|
11695
|
+
}
|
|
11696
|
+
return ssrOnlyPageNames;
|
|
11697
|
+
};
|
|
11698
|
+
var init_scanVueSsrOnlyPages = __esm(() => {
|
|
11699
|
+
SKIP_DIRS2 = new Set([
|
|
11700
|
+
".absolutejs",
|
|
11701
|
+
".generated",
|
|
11702
|
+
".git",
|
|
11703
|
+
".next",
|
|
11704
|
+
".svelte-kit",
|
|
11705
|
+
".vercel",
|
|
11706
|
+
"build",
|
|
11707
|
+
"compiled",
|
|
11708
|
+
"dist",
|
|
11709
|
+
"node_modules"
|
|
11710
|
+
]);
|
|
11711
|
+
SOURCE_EXTENSIONS2 = new Set([".ts", ".tsx", ".mts", ".cts"]);
|
|
11712
|
+
});
|
|
11713
|
+
|
|
11714
|
+
// src/build/scanAngularHandlerCalls.ts
|
|
11715
|
+
import { readdirSync as readdirSync3, readFileSync as readFileSync13 } from "fs";
|
|
11716
|
+
import { join as join23 } from "path";
|
|
11717
|
+
import ts7 from "typescript";
|
|
11718
|
+
var ELYSIA_ROUTE_METHODS2, SKIP_DIRS3, SOURCE_EXTENSIONS3, getScriptKind3 = (filePath) => {
|
|
11719
|
+
if (filePath.endsWith(".tsx"))
|
|
11720
|
+
return ts7.ScriptKind.TSX;
|
|
11721
|
+
return ts7.ScriptKind.TS;
|
|
11722
|
+
}, hasSourceExtension3 = (filePath) => {
|
|
11723
|
+
const idx = filePath.lastIndexOf(".");
|
|
11724
|
+
if (idx === -1)
|
|
11725
|
+
return false;
|
|
11726
|
+
return SOURCE_EXTENSIONS3.has(filePath.slice(idx));
|
|
11727
|
+
}, collectSourceFiles3 = (root) => {
|
|
11728
|
+
const out = [];
|
|
11729
|
+
const stack = [root];
|
|
11730
|
+
while (stack.length > 0) {
|
|
11731
|
+
const dir = stack.pop();
|
|
11732
|
+
if (!dir)
|
|
11733
|
+
continue;
|
|
11734
|
+
let entries;
|
|
11735
|
+
try {
|
|
11736
|
+
entries = readdirSync3(dir, {
|
|
11737
|
+
encoding: "utf-8",
|
|
11738
|
+
withFileTypes: true
|
|
11739
|
+
});
|
|
11740
|
+
} catch {
|
|
11741
|
+
continue;
|
|
11742
|
+
}
|
|
11743
|
+
for (const entry of entries) {
|
|
11744
|
+
if (entry.isDirectory()) {
|
|
11745
|
+
if (SKIP_DIRS3.has(entry.name))
|
|
11746
|
+
continue;
|
|
11747
|
+
if (entry.name.startsWith("."))
|
|
11748
|
+
continue;
|
|
11749
|
+
stack.push(join23(dir, entry.name));
|
|
11750
|
+
} else if (entry.isFile() && hasSourceExtension3(entry.name)) {
|
|
11751
|
+
out.push(join23(dir, entry.name));
|
|
11752
|
+
}
|
|
11753
|
+
}
|
|
11754
|
+
}
|
|
11755
|
+
return out;
|
|
11601
11756
|
}, fileMayContainAngularHandler = (source) => source.includes("handleAngularPageRequest"), extractManifestKey = (pagePathValue) => {
|
|
11602
|
-
if (!
|
|
11757
|
+
if (!ts7.isCallExpression(pagePathValue))
|
|
11603
11758
|
return null;
|
|
11604
11759
|
const callee = pagePathValue.expression;
|
|
11605
|
-
if (!
|
|
11760
|
+
if (!ts7.isIdentifier(callee) || callee.text !== "asset")
|
|
11606
11761
|
return null;
|
|
11607
11762
|
const [, second] = pagePathValue.arguments;
|
|
11608
11763
|
if (!second)
|
|
11609
11764
|
return null;
|
|
11610
|
-
if (!
|
|
11765
|
+
if (!ts7.isStringLiteral(second))
|
|
11611
11766
|
return null;
|
|
11612
11767
|
return second.text;
|
|
11613
11768
|
}, findEnclosingMountPath = (node) => {
|
|
11614
11769
|
let cursor = node.parent;
|
|
11615
11770
|
while (cursor) {
|
|
11616
|
-
if (
|
|
11771
|
+
if (ts7.isCallExpression(cursor)) {
|
|
11617
11772
|
const callee = cursor.expression;
|
|
11618
|
-
if (
|
|
11773
|
+
if (ts7.isPropertyAccessExpression(callee) && ts7.isIdentifier(callee.name) && ELYSIA_ROUTE_METHODS2.has(callee.name.text)) {
|
|
11619
11774
|
const firstArg = cursor.arguments[0];
|
|
11620
|
-
if (firstArg &&
|
|
11775
|
+
if (firstArg && ts7.isStringLiteral(firstArg) && firstArg.text.startsWith("/")) {
|
|
11621
11776
|
return firstArg.text;
|
|
11622
11777
|
}
|
|
11623
11778
|
}
|
|
@@ -11628,33 +11783,33 @@ var ELYSIA_ROUTE_METHODS2, SKIP_DIRS2, SOURCE_EXTENSIONS2, getScriptKind2 = (fil
|
|
|
11628
11783
|
}, extractCallsFromFile = (filePath, out) => {
|
|
11629
11784
|
let source;
|
|
11630
11785
|
try {
|
|
11631
|
-
source =
|
|
11786
|
+
source = readFileSync13(filePath, "utf-8");
|
|
11632
11787
|
} catch {
|
|
11633
11788
|
return;
|
|
11634
11789
|
}
|
|
11635
11790
|
if (!fileMayContainAngularHandler(source))
|
|
11636
11791
|
return;
|
|
11637
|
-
const sf =
|
|
11792
|
+
const sf = ts7.createSourceFile(filePath, source, ts7.ScriptTarget.Latest, true, getScriptKind3(filePath));
|
|
11638
11793
|
const visit = (node) => {
|
|
11639
|
-
if (
|
|
11794
|
+
if (ts7.isCallExpression(node) && ts7.isIdentifier(node.expression) && node.expression.text === "handleAngularPageRequest") {
|
|
11640
11795
|
const [arg] = node.arguments;
|
|
11641
|
-
if (arg &&
|
|
11796
|
+
if (arg && ts7.isObjectLiteralExpression(arg)) {
|
|
11642
11797
|
let manifestKey = null;
|
|
11643
11798
|
for (const prop of arg.properties) {
|
|
11644
|
-
if (
|
|
11799
|
+
if (ts7.isPropertyAssignment(prop)) {
|
|
11645
11800
|
if (!prop.name)
|
|
11646
11801
|
continue;
|
|
11647
|
-
const name =
|
|
11802
|
+
const name = ts7.isIdentifier(prop.name) ? prop.name.text : ts7.isStringLiteral(prop.name) ? prop.name.text : null;
|
|
11648
11803
|
if (name === "pagePath") {
|
|
11649
11804
|
manifestKey = extractManifestKey(prop.initializer);
|
|
11650
11805
|
}
|
|
11651
|
-
} else if (
|
|
11806
|
+
} else if (ts7.isSpreadAssignment(prop)) {
|
|
11652
11807
|
if (manifestKey)
|
|
11653
11808
|
continue;
|
|
11654
11809
|
const spreadExpr = prop.expression;
|
|
11655
|
-
if (
|
|
11810
|
+
if (ts7.isCallExpression(spreadExpr) && spreadExpr.arguments.length > 0) {
|
|
11656
11811
|
const [firstArg] = spreadExpr.arguments;
|
|
11657
|
-
if (firstArg &&
|
|
11812
|
+
if (firstArg && ts7.isStringLiteral(firstArg)) {
|
|
11658
11813
|
manifestKey = firstArg.text;
|
|
11659
11814
|
}
|
|
11660
11815
|
}
|
|
@@ -11669,11 +11824,11 @@ var ELYSIA_ROUTE_METHODS2, SKIP_DIRS2, SOURCE_EXTENSIONS2, getScriptKind2 = (fil
|
|
|
11669
11824
|
}
|
|
11670
11825
|
}
|
|
11671
11826
|
}
|
|
11672
|
-
|
|
11827
|
+
ts7.forEachChild(node, visit);
|
|
11673
11828
|
};
|
|
11674
|
-
|
|
11829
|
+
ts7.forEachChild(sf, visit);
|
|
11675
11830
|
}, scanAngularHandlerCalls = (projectRoot) => {
|
|
11676
|
-
const files =
|
|
11831
|
+
const files = collectSourceFiles3(projectRoot);
|
|
11677
11832
|
const collected = [];
|
|
11678
11833
|
for (const file of files) {
|
|
11679
11834
|
extractCallsFromFile(file, collected);
|
|
@@ -11691,7 +11846,7 @@ var init_scanAngularHandlerCalls = __esm(() => {
|
|
|
11691
11846
|
"post",
|
|
11692
11847
|
"put"
|
|
11693
11848
|
]);
|
|
11694
|
-
|
|
11849
|
+
SKIP_DIRS3 = new Set([
|
|
11695
11850
|
".absolutejs",
|
|
11696
11851
|
".generated",
|
|
11697
11852
|
".git",
|
|
@@ -11703,20 +11858,20 @@ var init_scanAngularHandlerCalls = __esm(() => {
|
|
|
11703
11858
|
"dist",
|
|
11704
11859
|
"node_modules"
|
|
11705
11860
|
]);
|
|
11706
|
-
|
|
11861
|
+
SOURCE_EXTENSIONS3 = new Set([".ts", ".tsx", ".mts", ".cts"]);
|
|
11707
11862
|
});
|
|
11708
11863
|
|
|
11709
11864
|
// src/build/scanAngularPageRoutes.ts
|
|
11710
|
-
import { readdirSync as
|
|
11711
|
-
import { basename as basename5, join as
|
|
11712
|
-
import
|
|
11713
|
-
var
|
|
11865
|
+
import { readdirSync as readdirSync4, readFileSync as readFileSync14 } from "fs";
|
|
11866
|
+
import { basename as basename5, join as join24 } from "path";
|
|
11867
|
+
import ts8 from "typescript";
|
|
11868
|
+
var SOURCE_EXTENSIONS4, SKIP_DIRS4, hasSourceExtension4 = (filePath) => {
|
|
11714
11869
|
const idx = filePath.lastIndexOf(".");
|
|
11715
11870
|
if (idx === -1)
|
|
11716
11871
|
return false;
|
|
11717
|
-
return
|
|
11872
|
+
return SOURCE_EXTENSIONS4.has(filePath.slice(idx));
|
|
11718
11873
|
}, isPageFile = (filePath) => {
|
|
11719
|
-
if (!
|
|
11874
|
+
if (!hasSourceExtension4(filePath))
|
|
11720
11875
|
return false;
|
|
11721
11876
|
const base = basename5(filePath);
|
|
11722
11877
|
if (base.endsWith(".d.ts"))
|
|
@@ -11735,7 +11890,7 @@ var SOURCE_EXTENSIONS3, SKIP_DIRS3, hasSourceExtension3 = (filePath) => {
|
|
|
11735
11890
|
continue;
|
|
11736
11891
|
let entries;
|
|
11737
11892
|
try {
|
|
11738
|
-
entries =
|
|
11893
|
+
entries = readdirSync4(dir, {
|
|
11739
11894
|
encoding: "utf-8",
|
|
11740
11895
|
withFileTypes: true
|
|
11741
11896
|
});
|
|
@@ -11744,13 +11899,13 @@ var SOURCE_EXTENSIONS3, SKIP_DIRS3, hasSourceExtension3 = (filePath) => {
|
|
|
11744
11899
|
}
|
|
11745
11900
|
for (const entry of entries) {
|
|
11746
11901
|
if (entry.isDirectory()) {
|
|
11747
|
-
if (
|
|
11902
|
+
if (SKIP_DIRS4.has(entry.name))
|
|
11748
11903
|
continue;
|
|
11749
11904
|
if (entry.name.startsWith("."))
|
|
11750
11905
|
continue;
|
|
11751
|
-
stack.push(
|
|
11906
|
+
stack.push(join24(dir, entry.name));
|
|
11752
11907
|
} else if (entry.isFile() && isPageFile(entry.name)) {
|
|
11753
|
-
out.push(
|
|
11908
|
+
out.push(join24(dir, entry.name));
|
|
11754
11909
|
}
|
|
11755
11910
|
}
|
|
11756
11911
|
}
|
|
@@ -11758,15 +11913,15 @@ var SOURCE_EXTENSIONS3, SKIP_DIRS3, hasSourceExtension3 = (filePath) => {
|
|
|
11758
11913
|
}, hasTopLevelRoutesExport = (source, filePath) => {
|
|
11759
11914
|
if (!source.includes("routes"))
|
|
11760
11915
|
return false;
|
|
11761
|
-
const sf =
|
|
11916
|
+
const sf = ts8.createSourceFile(filePath, source, ts8.ScriptTarget.Latest, true, ts8.ScriptKind.TS);
|
|
11762
11917
|
for (const statement of sf.statements) {
|
|
11763
|
-
if (!
|
|
11918
|
+
if (!ts8.isVariableStatement(statement))
|
|
11764
11919
|
continue;
|
|
11765
|
-
const isExported = statement.modifiers?.some((modifier) => modifier.kind ===
|
|
11920
|
+
const isExported = statement.modifiers?.some((modifier) => modifier.kind === ts8.SyntaxKind.ExportKeyword);
|
|
11766
11921
|
if (!isExported)
|
|
11767
11922
|
continue;
|
|
11768
11923
|
for (const declaration of statement.declarationList.declarations) {
|
|
11769
|
-
if (!
|
|
11924
|
+
if (!ts8.isIdentifier(declaration.name))
|
|
11770
11925
|
continue;
|
|
11771
11926
|
if (declaration.name.text === "routes")
|
|
11772
11927
|
return true;
|
|
@@ -11779,7 +11934,7 @@ var SOURCE_EXTENSIONS3, SKIP_DIRS3, hasSourceExtension3 = (filePath) => {
|
|
|
11779
11934
|
for (const file of files) {
|
|
11780
11935
|
let source;
|
|
11781
11936
|
try {
|
|
11782
|
-
source =
|
|
11937
|
+
source = readFileSync14(file, "utf-8");
|
|
11783
11938
|
} catch {
|
|
11784
11939
|
continue;
|
|
11785
11940
|
}
|
|
@@ -11795,8 +11950,8 @@ var SOURCE_EXTENSIONS3, SKIP_DIRS3, hasSourceExtension3 = (filePath) => {
|
|
|
11795
11950
|
return out;
|
|
11796
11951
|
};
|
|
11797
11952
|
var init_scanAngularPageRoutes = __esm(() => {
|
|
11798
|
-
|
|
11799
|
-
|
|
11953
|
+
SOURCE_EXTENSIONS4 = new Set([".ts", ".tsx", ".mts", ".cts"]);
|
|
11954
|
+
SKIP_DIRS4 = new Set([
|
|
11800
11955
|
".absolutejs",
|
|
11801
11956
|
".generated",
|
|
11802
11957
|
".git",
|
|
@@ -11826,46 +11981,46 @@ var exports_parseAngularConfigImports = {};
|
|
|
11826
11981
|
__export(exports_parseAngularConfigImports, {
|
|
11827
11982
|
parseAngularProvidersImport: () => parseAngularProvidersImport
|
|
11828
11983
|
});
|
|
11829
|
-
import { existsSync as existsSync19, readFileSync as
|
|
11830
|
-
import { dirname as dirname11, isAbsolute as isAbsolute3, join as
|
|
11831
|
-
import
|
|
11984
|
+
import { existsSync as existsSync19, readFileSync as readFileSync15 } from "fs";
|
|
11985
|
+
import { dirname as dirname11, isAbsolute as isAbsolute3, join as join25 } from "path";
|
|
11986
|
+
import ts9 from "typescript";
|
|
11832
11987
|
var findDefineConfigCall = (sf) => {
|
|
11833
11988
|
let result = null;
|
|
11834
11989
|
const visit = (node) => {
|
|
11835
11990
|
if (result)
|
|
11836
11991
|
return;
|
|
11837
|
-
if (
|
|
11992
|
+
if (ts9.isCallExpression(node) && ts9.isIdentifier(node.expression) && node.expression.text === "defineConfig") {
|
|
11838
11993
|
const [arg] = node.arguments;
|
|
11839
|
-
if (arg &&
|
|
11994
|
+
if (arg && ts9.isObjectLiteralExpression(arg)) {
|
|
11840
11995
|
result = arg;
|
|
11841
11996
|
return;
|
|
11842
11997
|
}
|
|
11843
11998
|
}
|
|
11844
|
-
|
|
11999
|
+
ts9.forEachChild(node, visit);
|
|
11845
12000
|
};
|
|
11846
|
-
|
|
12001
|
+
ts9.forEachChild(sf, visit);
|
|
11847
12002
|
return result;
|
|
11848
12003
|
}, findPropertyInitializer = (object, name) => {
|
|
11849
12004
|
for (const prop of object.properties) {
|
|
11850
|
-
if (!
|
|
12005
|
+
if (!ts9.isPropertyAssignment(prop))
|
|
11851
12006
|
continue;
|
|
11852
12007
|
if (!prop.name)
|
|
11853
12008
|
continue;
|
|
11854
|
-
const key =
|
|
12009
|
+
const key = ts9.isIdentifier(prop.name) ? prop.name.text : ts9.isStringLiteral(prop.name) ? prop.name.text : null;
|
|
11855
12010
|
if (key === name)
|
|
11856
12011
|
return prop.initializer;
|
|
11857
12012
|
}
|
|
11858
12013
|
return null;
|
|
11859
12014
|
}, findImportForBinding = (sf, binding) => {
|
|
11860
12015
|
for (const statement of sf.statements) {
|
|
11861
|
-
if (!
|
|
12016
|
+
if (!ts9.isImportDeclaration(statement))
|
|
11862
12017
|
continue;
|
|
11863
|
-
if (!
|
|
12018
|
+
if (!ts9.isStringLiteral(statement.moduleSpecifier))
|
|
11864
12019
|
continue;
|
|
11865
12020
|
if (statement.importClause?.isTypeOnly)
|
|
11866
12021
|
continue;
|
|
11867
12022
|
const named = statement.importClause?.namedBindings;
|
|
11868
|
-
if (!named || !
|
|
12023
|
+
if (!named || !ts9.isNamedImports(named))
|
|
11869
12024
|
continue;
|
|
11870
12025
|
for (const element of named.elements) {
|
|
11871
12026
|
if (element.isTypeOnly)
|
|
@@ -11882,15 +12037,15 @@ var findDefineConfigCall = (sf) => {
|
|
|
11882
12037
|
}, resolveConfigPath = (projectRoot) => {
|
|
11883
12038
|
const envOverride = process.env.ABSOLUTE_CONFIG;
|
|
11884
12039
|
if (envOverride) {
|
|
11885
|
-
const resolved = isAbsolute3(envOverride) ? envOverride :
|
|
12040
|
+
const resolved = isAbsolute3(envOverride) ? envOverride : join25(projectRoot, envOverride);
|
|
11886
12041
|
if (existsSync19(resolved))
|
|
11887
12042
|
return resolved;
|
|
11888
12043
|
}
|
|
11889
12044
|
const candidates = [
|
|
11890
|
-
|
|
11891
|
-
|
|
11892
|
-
|
|
11893
|
-
|
|
12045
|
+
join25(projectRoot, "absolute.config.ts"),
|
|
12046
|
+
join25(projectRoot, "absolute.config.mts"),
|
|
12047
|
+
join25(projectRoot, "absolute.config.js"),
|
|
12048
|
+
join25(projectRoot, "absolute.config.mjs")
|
|
11894
12049
|
];
|
|
11895
12050
|
for (const candidate of candidates) {
|
|
11896
12051
|
if (existsSync19(candidate))
|
|
@@ -11901,29 +12056,29 @@ var findDefineConfigCall = (sf) => {
|
|
|
11901
12056
|
const configPath2 = resolveConfigPath(projectRoot);
|
|
11902
12057
|
if (!configPath2)
|
|
11903
12058
|
return null;
|
|
11904
|
-
const source =
|
|
12059
|
+
const source = readFileSync15(configPath2, "utf-8");
|
|
11905
12060
|
if (!source.includes("angular"))
|
|
11906
12061
|
return null;
|
|
11907
12062
|
if (!source.includes("providers"))
|
|
11908
12063
|
return null;
|
|
11909
|
-
const sf =
|
|
12064
|
+
const sf = ts9.createSourceFile(configPath2, source, ts9.ScriptTarget.Latest, true, ts9.ScriptKind.TS);
|
|
11910
12065
|
const configObject = findDefineConfigCall(sf);
|
|
11911
12066
|
if (!configObject)
|
|
11912
12067
|
return null;
|
|
11913
12068
|
const angularField = findPropertyInitializer(configObject, "angular");
|
|
11914
|
-
if (!angularField || !
|
|
12069
|
+
if (!angularField || !ts9.isObjectLiteralExpression(angularField))
|
|
11915
12070
|
return null;
|
|
11916
12071
|
const providersField = findPropertyInitializer(angularField, "providers");
|
|
11917
12072
|
if (!providersField)
|
|
11918
12073
|
return null;
|
|
11919
|
-
if (!
|
|
12074
|
+
if (!ts9.isIdentifier(providersField))
|
|
11920
12075
|
return null;
|
|
11921
12076
|
const binding = providersField.text;
|
|
11922
12077
|
const importInfo = findImportForBinding(sf, binding);
|
|
11923
12078
|
if (!importInfo)
|
|
11924
12079
|
return null;
|
|
11925
12080
|
const configDir2 = dirname11(configPath2);
|
|
11926
|
-
const absolutePath = importInfo.source.startsWith(".") ?
|
|
12081
|
+
const absolutePath = importInfo.source.startsWith(".") ? join25(configDir2, importInfo.source).replace(/\.[cm]?[tj]sx?$/, "") : isAbsolute3(importInfo.source) ? importInfo.source.replace(/\.[cm]?[tj]sx?$/, "") : importInfo.source;
|
|
11927
12082
|
return {
|
|
11928
12083
|
absolutePath,
|
|
11929
12084
|
bindingName: binding,
|
|
@@ -12075,7 +12230,7 @@ import { existsSync as existsSync20 } from "fs";
|
|
|
12075
12230
|
import { mkdir as mkdir4, stat as stat2 } from "fs/promises";
|
|
12076
12231
|
import {
|
|
12077
12232
|
dirname as dirname12,
|
|
12078
|
-
join as
|
|
12233
|
+
join as join26,
|
|
12079
12234
|
basename as basename6,
|
|
12080
12235
|
extname as extname5,
|
|
12081
12236
|
resolve as resolve19,
|
|
@@ -12134,14 +12289,14 @@ var resolveDevClientDir2 = () => {
|
|
|
12134
12289
|
`${basePath}.svelte`,
|
|
12135
12290
|
`${basePath}.svelte.ts`,
|
|
12136
12291
|
`${basePath}.svelte.js`,
|
|
12137
|
-
|
|
12138
|
-
|
|
12139
|
-
|
|
12140
|
-
|
|
12141
|
-
|
|
12142
|
-
|
|
12143
|
-
|
|
12144
|
-
|
|
12292
|
+
join26(basePath, "index.ts"),
|
|
12293
|
+
join26(basePath, "index.js"),
|
|
12294
|
+
join26(basePath, "index.mjs"),
|
|
12295
|
+
join26(basePath, "index.cjs"),
|
|
12296
|
+
join26(basePath, "index.json"),
|
|
12297
|
+
join26(basePath, "index.svelte"),
|
|
12298
|
+
join26(basePath, "index.svelte.ts"),
|
|
12299
|
+
join26(basePath, "index.svelte.js")
|
|
12145
12300
|
];
|
|
12146
12301
|
const checks = await Promise.all(candidates.map(exists));
|
|
12147
12302
|
return candidates.find((_2, index) => checks[index]) ?? null;
|
|
@@ -12180,9 +12335,9 @@ var resolveDevClientDir2 = () => {
|
|
|
12180
12335
|
}, compileSvelte = async (entryPoints, svelteRoot, cache = new Map, isDev = false, stylePreprocessors) => {
|
|
12181
12336
|
const { compile, compileModule, preprocess } = await import("svelte/compiler");
|
|
12182
12337
|
const generatedDir = getFrameworkGeneratedDir("svelte");
|
|
12183
|
-
const clientDir =
|
|
12184
|
-
const indexDir =
|
|
12185
|
-
const serverDir =
|
|
12338
|
+
const clientDir = join26(generatedDir, "client");
|
|
12339
|
+
const indexDir = join26(generatedDir, "indexes");
|
|
12340
|
+
const serverDir = join26(generatedDir, "server");
|
|
12186
12341
|
await Promise.all([clientDir, indexDir, serverDir].map((dir) => mkdir4(dir, { recursive: true })));
|
|
12187
12342
|
const dev = env.NODE_ENV !== "production";
|
|
12188
12343
|
const build = async (src) => {
|
|
@@ -12220,8 +12375,8 @@ var resolveDevClientDir2 = () => {
|
|
|
12220
12375
|
const childBuilt = await Promise.all(childSources.map((child) => build(child)));
|
|
12221
12376
|
const hasAwaitSlotFromChildren = childBuilt.some((child) => child.hasAwaitSlot);
|
|
12222
12377
|
const externalRewrites = new Map;
|
|
12223
|
-
const ssrOutputDir = dirname12(
|
|
12224
|
-
const clientOutputDir = dirname12(
|
|
12378
|
+
const ssrOutputDir = dirname12(join26(serverDir, relDir, `${baseName}.js`));
|
|
12379
|
+
const clientOutputDir = dirname12(join26(clientDir, relDir, `${baseName}.js`));
|
|
12225
12380
|
for (let idx = 0;idx < importPaths.length; idx++) {
|
|
12226
12381
|
const rawSpec = importPaths[idx];
|
|
12227
12382
|
if (!rawSpec)
|
|
@@ -12286,8 +12441,8 @@ var resolveDevClientDir2 = () => {
|
|
|
12286
12441
|
code += islandMetadataExports;
|
|
12287
12442
|
return { code, map: compiledJs.map };
|
|
12288
12443
|
};
|
|
12289
|
-
const ssrPath =
|
|
12290
|
-
const clientPath =
|
|
12444
|
+
const ssrPath = join26(serverDir, relDir, `${baseName}.js`);
|
|
12445
|
+
const clientPath = join26(clientDir, relDir, `${baseName}.js`);
|
|
12291
12446
|
await Promise.all([
|
|
12292
12447
|
mkdir4(dirname12(ssrPath), { recursive: true }),
|
|
12293
12448
|
mkdir4(dirname12(clientPath), { recursive: true })
|
|
@@ -12325,7 +12480,7 @@ var resolveDevClientDir2 = () => {
|
|
|
12325
12480
|
await Promise.all(roots.map(async ({ client, hasAwaitSlot }) => {
|
|
12326
12481
|
const relClientDir = dirname12(relative9(clientDir, client));
|
|
12327
12482
|
const name = basename6(client, extname5(client));
|
|
12328
|
-
const indexPath =
|
|
12483
|
+
const indexPath = join26(indexDir, relClientDir, `${name}.js`);
|
|
12329
12484
|
const importRaw = relative9(dirname12(indexPath), client).split(sep2).join("/");
|
|
12330
12485
|
const importPath = importRaw.startsWith(".") || importRaw.startsWith("/") ? importRaw : `./${importRaw}`;
|
|
12331
12486
|
const hmrImports = isDev ? `window.__HMR_FRAMEWORK__ = "svelte";
|
|
@@ -12404,7 +12559,7 @@ if (typeof window !== "undefined") {
|
|
|
12404
12559
|
svelteClientPaths: roots.map(({ client }) => client),
|
|
12405
12560
|
svelteIndexPaths: roots.map(({ client }) => {
|
|
12406
12561
|
const rel = dirname12(relative9(clientDir, client));
|
|
12407
|
-
return
|
|
12562
|
+
return join26(indexDir, rel, basename6(client));
|
|
12408
12563
|
}),
|
|
12409
12564
|
svelteServerPaths: roots.map(({ ssr }) => ssr)
|
|
12410
12565
|
};
|
|
@@ -12419,7 +12574,7 @@ var init_compileSvelte = __esm(() => {
|
|
|
12419
12574
|
init_lowerAwaitSlotSyntax();
|
|
12420
12575
|
init_renderToReadableStream();
|
|
12421
12576
|
devClientDir2 = resolveDevClientDir2();
|
|
12422
|
-
hmrClientPath3 =
|
|
12577
|
+
hmrClientPath3 = join26(devClientDir2, "hmrClient.ts").replace(/\\/g, "/");
|
|
12423
12578
|
persistentCache = new Map;
|
|
12424
12579
|
sourceHashCache = new Map;
|
|
12425
12580
|
transpiler3 = new Transpiler2({ loader: "ts", target: "browser" });
|
|
@@ -12434,7 +12589,7 @@ __export(exports_chainInlineSourcemaps, {
|
|
|
12434
12589
|
chainBundleInlineSourcemap: () => chainBundleInlineSourcemap,
|
|
12435
12590
|
buildLineRemap: () => buildLineRemap
|
|
12436
12591
|
});
|
|
12437
|
-
import { readFileSync as
|
|
12592
|
+
import { readFileSync as readFileSync16, writeFileSync as writeFileSync7 } from "fs";
|
|
12438
12593
|
var BASE64_CHARS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", BASE64_TO_INT, decodeVlq = (str, startPos) => {
|
|
12439
12594
|
let result = 0;
|
|
12440
12595
|
let shift = 0;
|
|
@@ -12725,7 +12880,7 @@ var BASE64_CHARS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz01234567
|
|
|
12725
12880
|
version: 3
|
|
12726
12881
|
};
|
|
12727
12882
|
}, chainBundleInlineSourcemap = (bundleFilePath) => {
|
|
12728
|
-
const text =
|
|
12883
|
+
const text = readFileSync16(bundleFilePath, "utf-8");
|
|
12729
12884
|
const outerMap = extractInlineMap(text);
|
|
12730
12885
|
if (!outerMap)
|
|
12731
12886
|
return;
|
|
@@ -12817,7 +12972,7 @@ import {
|
|
|
12817
12972
|
basename as basename7,
|
|
12818
12973
|
dirname as dirname13,
|
|
12819
12974
|
isAbsolute as isAbsolute4,
|
|
12820
|
-
join as
|
|
12975
|
+
join as join27,
|
|
12821
12976
|
relative as relative10,
|
|
12822
12977
|
resolve as resolve20
|
|
12823
12978
|
} from "path";
|
|
@@ -12995,7 +13150,7 @@ var resolveDevClientDir3 = () => {
|
|
|
12995
13150
|
];
|
|
12996
13151
|
let cssOutputPaths = [];
|
|
12997
13152
|
if (isEntryPoint && allCss.length) {
|
|
12998
|
-
const cssOutputFile =
|
|
13153
|
+
const cssOutputFile = join27(outputDirs.css, `${toKebab(fileBaseName)}-compiled.css`);
|
|
12999
13154
|
await mkdir5(dirname13(cssOutputFile), { recursive: true });
|
|
13000
13155
|
await write3(cssOutputFile, allCss.join(`
|
|
13001
13156
|
`));
|
|
@@ -13026,8 +13181,8 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
13026
13181
|
};
|
|
13027
13182
|
const clientCode = assembleModule(generateRenderFunction(false), "render", true) + islandMetadataExports;
|
|
13028
13183
|
const serverCode = assembleModule(generateRenderFunction(true), "ssrRender", false) + islandMetadataExports;
|
|
13029
|
-
const clientOutputPath =
|
|
13030
|
-
const serverOutputPath =
|
|
13184
|
+
const clientOutputPath = join27(outputDirs.client, `${relativeWithoutExtension}.js`);
|
|
13185
|
+
const serverOutputPath = join27(outputDirs.server, `${relativeWithoutExtension}.js`);
|
|
13031
13186
|
const relDir = dirname13(relativeFilePath);
|
|
13032
13187
|
const relDepth = relDir === "." ? 0 : relDir.split("/").length;
|
|
13033
13188
|
const adjustImports = (code) => code.replace(/(from\s+['"])(\.\.\/(?:\.\.\/)*)/g, (_2, prefix, dots) => {
|
|
@@ -13077,13 +13232,13 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
13077
13232
|
cacheMap.set(sourceFilePath, result);
|
|
13078
13233
|
persistentBuildCache.set(sourceFilePath, result);
|
|
13079
13234
|
return result;
|
|
13080
|
-
}, compileVue = async (entryPoints, vueRootDir, isDev = false, stylePreprocessors) => {
|
|
13235
|
+
}, compileVue = async (entryPoints, vueRootDir, isDev = false, stylePreprocessors, ssrOnlyEntries) => {
|
|
13081
13236
|
const compiler = await import("@vue/compiler-sfc");
|
|
13082
13237
|
const generatedDir = getFrameworkGeneratedDir("vue");
|
|
13083
|
-
const clientOutputDir =
|
|
13084
|
-
const indexOutputDir =
|
|
13085
|
-
const serverOutputDir =
|
|
13086
|
-
const cssOutputDir =
|
|
13238
|
+
const clientOutputDir = join27(generatedDir, "client");
|
|
13239
|
+
const indexOutputDir = join27(generatedDir, "indexes");
|
|
13240
|
+
const serverOutputDir = join27(generatedDir, "server");
|
|
13241
|
+
const cssOutputDir = join27(generatedDir, "compiled");
|
|
13087
13242
|
await Promise.all([
|
|
13088
13243
|
mkdir5(clientOutputDir, { recursive: true }),
|
|
13089
13244
|
mkdir5(indexOutputDir, { recursive: true }),
|
|
@@ -13093,15 +13248,24 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
13093
13248
|
const buildCache = new Map;
|
|
13094
13249
|
const allTsHelperPaths = new Set;
|
|
13095
13250
|
const compiledPages = await Promise.all(entryPoints.map(async (entryPath) => {
|
|
13096
|
-
const
|
|
13251
|
+
const resolvedEntryPath = resolve20(entryPath);
|
|
13252
|
+
const result = await compileVueFile(resolvedEntryPath, {
|
|
13097
13253
|
client: clientOutputDir,
|
|
13098
13254
|
css: cssOutputDir,
|
|
13099
13255
|
server: serverOutputDir
|
|
13100
13256
|
}, buildCache, true, vueRootDir, compiler, stylePreprocessors);
|
|
13101
13257
|
result.tsHelperPaths.forEach((path) => allTsHelperPaths.add(path));
|
|
13258
|
+
if (ssrOnlyEntries?.has(resolvedEntryPath)) {
|
|
13259
|
+
return {
|
|
13260
|
+
clientPath: null,
|
|
13261
|
+
cssPaths: result.cssPaths,
|
|
13262
|
+
indexPath: null,
|
|
13263
|
+
serverPath: result.serverPath
|
|
13264
|
+
};
|
|
13265
|
+
}
|
|
13102
13266
|
const entryBaseName = basename7(entryPath, ".vue");
|
|
13103
|
-
const indexOutputFile =
|
|
13104
|
-
const clientOutputFile =
|
|
13267
|
+
const indexOutputFile = join27(indexOutputDir, `${entryBaseName}.js`);
|
|
13268
|
+
const clientOutputFile = join27(clientOutputDir, relative10(vueRootDir, entryPath).replace(/\\/g, "/").replace(/\.vue$/, ".js"));
|
|
13105
13269
|
await mkdir5(dirname13(indexOutputFile), { recursive: true });
|
|
13106
13270
|
const vueHmrImports = isDev ? [
|
|
13107
13271
|
`window.__HMR_FRAMEWORK__ = "vue";`,
|
|
@@ -13254,18 +13418,19 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
13254
13418
|
const sourceCode = await file2(tsPath).text();
|
|
13255
13419
|
const transpiledCode = transpiler4.transformSync(sourceCode);
|
|
13256
13420
|
const relativeJsPath = relative10(vueRootDir, tsPath).replace(/\.ts$/, ".js");
|
|
13257
|
-
const outClientPath =
|
|
13258
|
-
const outServerPath =
|
|
13421
|
+
const outClientPath = join27(clientOutputDir, relativeJsPath);
|
|
13422
|
+
const outServerPath = join27(serverOutputDir, relativeJsPath);
|
|
13259
13423
|
await mkdir5(dirname13(outClientPath), { recursive: true });
|
|
13260
13424
|
await mkdir5(dirname13(outServerPath), { recursive: true });
|
|
13261
13425
|
await write3(outClientPath, transpiledCode);
|
|
13262
13426
|
await write3(outServerPath, transpiledCode);
|
|
13263
13427
|
}));
|
|
13428
|
+
const isString = (value) => value !== null;
|
|
13264
13429
|
return {
|
|
13265
13430
|
hmrMetadata: new Map(vueHmrMetadata),
|
|
13266
|
-
vueClientPaths: compiledPages.map((
|
|
13431
|
+
vueClientPaths: compiledPages.map((p2) => p2.clientPath).filter(isString),
|
|
13267
13432
|
vueCssPaths: compiledPages.flatMap((result) => result.cssPaths),
|
|
13268
|
-
vueIndexPaths: compiledPages.map((
|
|
13433
|
+
vueIndexPaths: compiledPages.map((p2) => p2.indexPath).filter(isString),
|
|
13269
13434
|
vueServerPaths: compiledPages.map((result) => result.serverPath)
|
|
13270
13435
|
};
|
|
13271
13436
|
};
|
|
@@ -13278,7 +13443,7 @@ var init_compileVue = __esm(() => {
|
|
|
13278
13443
|
init_vueAutoRouterTransform();
|
|
13279
13444
|
init_stylePreprocessor();
|
|
13280
13445
|
devClientDir3 = resolveDevClientDir3();
|
|
13281
|
-
hmrClientPath4 =
|
|
13446
|
+
hmrClientPath4 = join27(devClientDir3, "hmrClient.ts").replace(/\\/g, "/");
|
|
13282
13447
|
transpiler4 = new Transpiler3({ loader: "ts", target: "browser" });
|
|
13283
13448
|
scriptCache = new Map;
|
|
13284
13449
|
scriptSetupCache = new Map;
|
|
@@ -13759,17 +13924,17 @@ __export(exports_compileAngular, {
|
|
|
13759
13924
|
compileAngularFile: () => compileAngularFile,
|
|
13760
13925
|
compileAngular: () => compileAngular
|
|
13761
13926
|
});
|
|
13762
|
-
import { existsSync as existsSync22, readFileSync as
|
|
13763
|
-
import { join as
|
|
13927
|
+
import { existsSync as existsSync22, readFileSync as readFileSync17, promises as fs5 } from "fs";
|
|
13928
|
+
import { join as join28, basename as basename8, sep as sep3, dirname as dirname14, resolve as resolve21, relative as relative11 } from "path";
|
|
13764
13929
|
var {Glob: Glob6 } = globalThis.Bun;
|
|
13765
|
-
import
|
|
13930
|
+
import ts10 from "typescript";
|
|
13766
13931
|
var traceAngularPhase = async (name, fn2, metadata) => {
|
|
13767
13932
|
const tracePhase = globalThis.__absoluteBuildTracePhase;
|
|
13768
13933
|
return tracePhase ? tracePhase(`compile/angular/${name}`, fn2, metadata) : await fn2();
|
|
13769
13934
|
}, readTsconfigPathAliases = () => {
|
|
13770
13935
|
try {
|
|
13771
13936
|
const configPath2 = resolve21(process.cwd(), "tsconfig.json");
|
|
13772
|
-
const config =
|
|
13937
|
+
const config = ts10.readConfigFile(configPath2, ts10.sys.readFile).config;
|
|
13773
13938
|
const compilerOptions = config?.compilerOptions ?? {};
|
|
13774
13939
|
const baseUrl = resolve21(process.cwd(), compilerOptions.baseUrl ?? ".");
|
|
13775
13940
|
const aliases = Object.entries(compilerOptions.paths ?? {}).map(([pattern, replacements]) => ({ pattern, replacements }));
|
|
@@ -13803,10 +13968,10 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
13803
13968
|
`${candidate}.tsx`,
|
|
13804
13969
|
`${candidate}.js`,
|
|
13805
13970
|
`${candidate}.jsx`,
|
|
13806
|
-
|
|
13807
|
-
|
|
13808
|
-
|
|
13809
|
-
|
|
13971
|
+
join28(candidate, "index.ts"),
|
|
13972
|
+
join28(candidate, "index.tsx"),
|
|
13973
|
+
join28(candidate, "index.js"),
|
|
13974
|
+
join28(candidate, "index.jsx")
|
|
13810
13975
|
];
|
|
13811
13976
|
return candidates.find((file3) => existsSync22(file3));
|
|
13812
13977
|
}, createLegacyAngularAnimationUsageResolver = (rootDir) => {
|
|
@@ -13898,7 +14063,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
13898
14063
|
return resolve21(import.meta.dir, "./dev/client");
|
|
13899
14064
|
}, devClientDir4, hmrClientPath5, formatDiagnosticMessage = (diagnostic) => {
|
|
13900
14065
|
try {
|
|
13901
|
-
return
|
|
14066
|
+
return ts10.flattenDiagnosticMessageText(diagnostic.messageText, `
|
|
13902
14067
|
`);
|
|
13903
14068
|
} catch {
|
|
13904
14069
|
return String(diagnostic.messageText || "Unknown error");
|
|
@@ -13906,7 +14071,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
13906
14071
|
}, throwOnCompilationErrors = (diagnostics) => {
|
|
13907
14072
|
if (!diagnostics?.length)
|
|
13908
14073
|
return;
|
|
13909
|
-
const errors = diagnostics.filter((diag) => diag.category ===
|
|
14074
|
+
const errors = diagnostics.filter((diag) => diag.category === ts10.DiagnosticCategory.Error);
|
|
13910
14075
|
if (!errors.length)
|
|
13911
14076
|
return;
|
|
13912
14077
|
const fullMessage = errors.map(formatDiagnosticMessage).join(`
|
|
@@ -13948,22 +14113,22 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
13948
14113
|
}
|
|
13949
14114
|
return `${path}.js${query}`;
|
|
13950
14115
|
}, isRelativeModuleSpecifier = (specifier) => specifier.startsWith("./") || specifier.startsWith("../"), extractLocalImportSpecifiers = (source, fileName) => {
|
|
13951
|
-
const sourceFile =
|
|
14116
|
+
const sourceFile = ts10.createSourceFile(fileName, source, ts10.ScriptTarget.Latest, true, ts10.ScriptKind.TS);
|
|
13952
14117
|
const specifiers = [];
|
|
13953
14118
|
const addSpecifier = (node) => {
|
|
13954
|
-
if (!node || !
|
|
14119
|
+
if (!node || !ts10.isStringLiteralLike(node))
|
|
13955
14120
|
return;
|
|
13956
14121
|
const specifier = node.text;
|
|
13957
14122
|
if (isRelativeModuleSpecifier(specifier))
|
|
13958
14123
|
specifiers.push(specifier);
|
|
13959
14124
|
};
|
|
13960
14125
|
const visit = (node) => {
|
|
13961
|
-
if (
|
|
14126
|
+
if (ts10.isImportDeclaration(node) || ts10.isExportDeclaration(node)) {
|
|
13962
14127
|
addSpecifier(node.moduleSpecifier);
|
|
13963
|
-
} else if (
|
|
14128
|
+
} else if (ts10.isCallExpression(node) && node.expression.kind === ts10.SyntaxKind.ImportKeyword) {
|
|
13964
14129
|
addSpecifier(node.arguments[0]);
|
|
13965
14130
|
}
|
|
13966
|
-
|
|
14131
|
+
ts10.forEachChild(node, visit);
|
|
13967
14132
|
};
|
|
13968
14133
|
visit(sourceFile);
|
|
13969
14134
|
return specifiers;
|
|
@@ -13976,10 +14141,10 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
13976
14141
|
`${basePath}.tsx`,
|
|
13977
14142
|
`${basePath}.mts`,
|
|
13978
14143
|
`${basePath}.cts`,
|
|
13979
|
-
|
|
13980
|
-
|
|
13981
|
-
|
|
13982
|
-
|
|
14144
|
+
join28(basePath, "index.ts"),
|
|
14145
|
+
join28(basePath, "index.tsx"),
|
|
14146
|
+
join28(basePath, "index.mts"),
|
|
14147
|
+
join28(basePath, "index.cts")
|
|
13983
14148
|
];
|
|
13984
14149
|
return candidates.map((candidate) => resolve21(candidate)).find((candidate) => existsSync22(candidate) && !candidate.endsWith(".d.ts")) ?? null;
|
|
13985
14150
|
}, readFileForAotTransform = async (fileName, readFile6) => {
|
|
@@ -14005,15 +14170,15 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
14005
14170
|
const paths = [];
|
|
14006
14171
|
const templateUrlMatch = findUncommentedMatch(source, /templateUrl\s*:\s*['"]([^'"]+)['"]/);
|
|
14007
14172
|
if (templateUrlMatch?.[1])
|
|
14008
|
-
paths.push(
|
|
14173
|
+
paths.push(join28(fileDir, templateUrlMatch[1]));
|
|
14009
14174
|
const styleUrlMatch = findUncommentedMatch(source, /styleUrl\s*:\s*['"]([^'"]+)['"]/);
|
|
14010
14175
|
if (styleUrlMatch?.[1])
|
|
14011
|
-
paths.push(
|
|
14176
|
+
paths.push(join28(fileDir, styleUrlMatch[1]));
|
|
14012
14177
|
const styleUrlsMatch = findUncommentedMatch(source, /styleUrls\s*:\s*\[([^\]]+)\]/);
|
|
14013
14178
|
const urlMatches = styleUrlsMatch?.[1]?.match(/['"]([^'"]+)['"]/g);
|
|
14014
14179
|
if (urlMatches) {
|
|
14015
14180
|
for (const urlMatch of urlMatches) {
|
|
14016
|
-
paths.push(
|
|
14181
|
+
paths.push(join28(fileDir, urlMatch.replace(/['"]/g, "")));
|
|
14017
14182
|
}
|
|
14018
14183
|
}
|
|
14019
14184
|
return paths.map((path) => resolve21(path));
|
|
@@ -14047,7 +14212,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
14047
14212
|
safeStableStringify(stylePreprocessors ?? null)
|
|
14048
14213
|
].join("\x00");
|
|
14049
14214
|
const cacheKey2 = Bun.hash(cacheInput).toString(BASE_36_RADIX);
|
|
14050
|
-
return
|
|
14215
|
+
return join28(process.cwd(), ".absolutejs", "cache", "angular-resources", `${cacheKey2}.json`);
|
|
14051
14216
|
}, precomputeAotResourceTransforms = async (inputPaths, readFile6, stylePreprocessors) => {
|
|
14052
14217
|
const transformedSources = new Map;
|
|
14053
14218
|
const visited = new Set;
|
|
@@ -14093,10 +14258,10 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
14093
14258
|
return { stats, transformedSources };
|
|
14094
14259
|
}, compileAngularFiles = async (inputPaths, outDir, stylePreprocessors) => {
|
|
14095
14260
|
const islandMetadataByOutputPath = await traceAngularPhase("aot/island-metadata", () => new Map(inputPaths.map((inputPath) => {
|
|
14096
|
-
const outputPath = resolve21(
|
|
14261
|
+
const outputPath = resolve21(join28(outDir, relative11(process.cwd(), resolve21(inputPath)).replace(/\.[cm]?[tj]sx?$/, ".js")));
|
|
14097
14262
|
return [
|
|
14098
14263
|
outputPath,
|
|
14099
|
-
buildIslandMetadataExports(
|
|
14264
|
+
buildIslandMetadataExports(readFileSync17(inputPath, "utf-8"))
|
|
14100
14265
|
];
|
|
14101
14266
|
})), { entries: inputPaths.length });
|
|
14102
14267
|
await traceAngularPhase("aot/preload-compiler", () => import("@angular/compiler"));
|
|
@@ -14111,25 +14276,25 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
14111
14276
|
emitDecoratorMetadata: true,
|
|
14112
14277
|
esModuleInterop: true,
|
|
14113
14278
|
experimentalDecorators: true,
|
|
14114
|
-
module:
|
|
14115
|
-
moduleResolution:
|
|
14116
|
-
newLine:
|
|
14279
|
+
module: ts10.ModuleKind.ESNext,
|
|
14280
|
+
moduleResolution: ts10.ModuleResolutionKind.Bundler,
|
|
14281
|
+
newLine: ts10.NewLineKind.LineFeed,
|
|
14117
14282
|
noLib: false,
|
|
14118
14283
|
outDir,
|
|
14119
14284
|
skipLibCheck: true,
|
|
14120
|
-
target:
|
|
14285
|
+
target: ts10.ScriptTarget.ES2022,
|
|
14121
14286
|
...config.options
|
|
14122
14287
|
};
|
|
14123
|
-
options.target =
|
|
14288
|
+
options.target = ts10.ScriptTarget.ES2022;
|
|
14124
14289
|
options.experimentalDecorators = true;
|
|
14125
14290
|
options.emitDecoratorMetadata = true;
|
|
14126
|
-
options.newLine =
|
|
14291
|
+
options.newLine = ts10.NewLineKind.LineFeed;
|
|
14127
14292
|
options.outDir = outDir;
|
|
14128
14293
|
options.noEmit = false;
|
|
14129
14294
|
options.incremental = false;
|
|
14130
14295
|
options.tsBuildInfoFile = undefined;
|
|
14131
14296
|
options.rootDir = process.cwd();
|
|
14132
|
-
const host = await traceAngularPhase("aot/create-compiler-host", () =>
|
|
14297
|
+
const host = await traceAngularPhase("aot/create-compiler-host", () => ts10.createCompilerHost(options));
|
|
14133
14298
|
const originalGetDefaultLibLocation = host.getDefaultLibLocation;
|
|
14134
14299
|
host.getDefaultLibLocation = () => tsLibDir || (originalGetDefaultLibLocation ? originalGetDefaultLibLocation() : "");
|
|
14135
14300
|
const originalGetDefaultLibFileName = host.getDefaultLibFileName;
|
|
@@ -14140,7 +14305,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
14140
14305
|
const originalGetSourceFile = host.getSourceFile;
|
|
14141
14306
|
host.getSourceFile = (fileName, languageVersion, onError) => {
|
|
14142
14307
|
if (fileName.startsWith("lib.") && fileName.endsWith(".d.ts") && tsLibDir) {
|
|
14143
|
-
const resolvedPath =
|
|
14308
|
+
const resolvedPath = join28(tsLibDir, fileName);
|
|
14144
14309
|
return originalGetSourceFile?.call(host, resolvedPath, languageVersion, onError);
|
|
14145
14310
|
}
|
|
14146
14311
|
return originalGetSourceFile?.call(host, fileName, languageVersion, onError);
|
|
@@ -14175,7 +14340,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
14175
14340
|
host.getSourceFile = (fileName, languageVersion, onError) => {
|
|
14176
14341
|
const source = transformedSources.get(resolve21(fileName));
|
|
14177
14342
|
if (source) {
|
|
14178
|
-
return
|
|
14343
|
+
return ts10.createSourceFile(fileName, source, languageVersion, true);
|
|
14179
14344
|
}
|
|
14180
14345
|
return originalGetSourceFileForCompile?.call(host, fileName, languageVersion, onError);
|
|
14181
14346
|
};
|
|
@@ -14195,7 +14360,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
14195
14360
|
const entries = await traceAngularPhase("aot/postprocess-emitted-js", () => {
|
|
14196
14361
|
const rawEntries = Object.entries(emitted).filter(([fileName]) => fileName.endsWith(".js")).map(([fileName, content]) => ({
|
|
14197
14362
|
content,
|
|
14198
|
-
target:
|
|
14363
|
+
target: join28(outDir, fileName)
|
|
14199
14364
|
}));
|
|
14200
14365
|
const outputFiles = new Set(rawEntries.map(({ target }) => resolve21(target)));
|
|
14201
14366
|
return rawEntries.map(({ content, target }) => {
|
|
@@ -14372,7 +14537,7 @@ ${fields}
|
|
|
14372
14537
|
}, inlineTemplateAndLowerDefer = async (source, fileDir) => {
|
|
14373
14538
|
const templateUrlMatch = findUncommentedMatch(source, /templateUrl\s*:\s*['"]([^'"]+)['"]/);
|
|
14374
14539
|
if (templateUrlMatch?.[1]) {
|
|
14375
|
-
const templatePath =
|
|
14540
|
+
const templatePath = join28(fileDir, templateUrlMatch[1]);
|
|
14376
14541
|
if (!existsSync22(templatePath)) {
|
|
14377
14542
|
throw new Error(`Unable to inline Angular templateUrl "${templateUrlMatch[1]}": file not found at ${templatePath}`);
|
|
14378
14543
|
}
|
|
@@ -14403,11 +14568,11 @@ ${fields}
|
|
|
14403
14568
|
}, inlineTemplateAndLowerDeferSync = (source, fileDir) => {
|
|
14404
14569
|
const templateUrlMatch = findUncommentedMatch(source, /templateUrl\s*:\s*['"]([^'"]+)['"]/);
|
|
14405
14570
|
if (templateUrlMatch?.[1]) {
|
|
14406
|
-
const templatePath =
|
|
14571
|
+
const templatePath = join28(fileDir, templateUrlMatch[1]);
|
|
14407
14572
|
if (!existsSync22(templatePath)) {
|
|
14408
14573
|
throw new Error(`Unable to inline Angular templateUrl "${templateUrlMatch[1]}": file not found at ${templatePath}`);
|
|
14409
14574
|
}
|
|
14410
|
-
const templateRaw2 =
|
|
14575
|
+
const templateRaw2 = readFileSync17(templatePath, "utf-8");
|
|
14411
14576
|
const lowered2 = lowerAngularDeferSyntax(templateRaw2);
|
|
14412
14577
|
const escaped2 = escapeTemplateContent(lowered2.template);
|
|
14413
14578
|
const replacedSource2 = source.slice(0, templateUrlMatch.index) + `template: \`${escaped2}\`` + source.slice(templateUrlMatch.index + templateUrlMatch[0].length);
|
|
@@ -14440,7 +14605,7 @@ ${fields}
|
|
|
14440
14605
|
return source;
|
|
14441
14606
|
const stylePromises = urlMatches.map((urlMatch) => {
|
|
14442
14607
|
const styleUrl = urlMatch.replace(/['"]/g, "");
|
|
14443
|
-
return readAndEscapeFile(
|
|
14608
|
+
return readAndEscapeFile(join28(fileDir, styleUrl), stylePreprocessors);
|
|
14444
14609
|
});
|
|
14445
14610
|
const results = await Promise.all(stylePromises);
|
|
14446
14611
|
const inlinedStyles = results.filter(Boolean).map((escaped) => `\`${escaped}\``);
|
|
@@ -14451,7 +14616,7 @@ ${fields}
|
|
|
14451
14616
|
const styleUrlMatch = findUncommentedMatch(source, /styleUrl\s*:\s*['"]([^'"]+)['"]/);
|
|
14452
14617
|
if (!styleUrlMatch?.[1])
|
|
14453
14618
|
return source;
|
|
14454
|
-
const escaped = await readAndEscapeFile(
|
|
14619
|
+
const escaped = await readAndEscapeFile(join28(fileDir, styleUrlMatch[1]), stylePreprocessors);
|
|
14455
14620
|
if (!escaped)
|
|
14456
14621
|
return source;
|
|
14457
14622
|
return source.slice(0, styleUrlMatch.index) + `styles: [\`${escaped}\`]` + source.slice(styleUrlMatch.index + styleUrlMatch[0].length);
|
|
@@ -14487,10 +14652,10 @@ ${fields}
|
|
|
14487
14652
|
`${candidate}.js`,
|
|
14488
14653
|
`${candidate}.jsx`,
|
|
14489
14654
|
`${candidate}.json`,
|
|
14490
|
-
|
|
14491
|
-
|
|
14492
|
-
|
|
14493
|
-
|
|
14655
|
+
join28(candidate, "index.ts"),
|
|
14656
|
+
join28(candidate, "index.tsx"),
|
|
14657
|
+
join28(candidate, "index.js"),
|
|
14658
|
+
join28(candidate, "index.jsx")
|
|
14494
14659
|
];
|
|
14495
14660
|
return candidates.find((file3) => existsSync22(file3));
|
|
14496
14661
|
};
|
|
@@ -14517,10 +14682,10 @@ ${fields}
|
|
|
14517
14682
|
const inputDir = dirname14(sourcePath);
|
|
14518
14683
|
const fileBase = basename8(sourcePath).replace(/\.[cm]?[tj]sx?$/, ".js");
|
|
14519
14684
|
if (inputDir === outDir || inputDir.startsWith(`${outDir}${sep3}`)) {
|
|
14520
|
-
return
|
|
14685
|
+
return join28(inputDir, fileBase);
|
|
14521
14686
|
}
|
|
14522
14687
|
const relativeDir = inputDir.startsWith(baseDir) ? inputDir.substring(baseDir.length + 1) : inputDir;
|
|
14523
|
-
return
|
|
14688
|
+
return join28(outDir, relativeDir, fileBase);
|
|
14524
14689
|
};
|
|
14525
14690
|
const withCacheBuster = (specifier) => {
|
|
14526
14691
|
if (!cacheBuster)
|
|
@@ -14570,8 +14735,8 @@ ${fields}
|
|
|
14570
14735
|
if (resolved.endsWith(".json") && existsSync22(resolved)) {
|
|
14571
14736
|
const inputDir2 = dirname14(resolved);
|
|
14572
14737
|
const relativeDir2 = inputDir2.startsWith(baseDir) ? inputDir2.substring(baseDir.length + 1) : inputDir2;
|
|
14573
|
-
const targetDir2 =
|
|
14574
|
-
const targetPath2 =
|
|
14738
|
+
const targetDir2 = join28(outDir, relativeDir2);
|
|
14739
|
+
const targetPath2 = join28(targetDir2, basename8(resolved));
|
|
14575
14740
|
await fs5.mkdir(targetDir2, { recursive: true });
|
|
14576
14741
|
await fs5.copyFile(resolved, targetPath2);
|
|
14577
14742
|
allOutputs.push(targetPath2);
|
|
@@ -14649,7 +14814,7 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
14649
14814
|
return { clientPaths: [...emptyPaths], serverPaths: [...emptyPaths] };
|
|
14650
14815
|
}
|
|
14651
14816
|
const compiledRoot = compiledParent;
|
|
14652
|
-
const indexesDir =
|
|
14817
|
+
const indexesDir = join28(compiledParent, "indexes");
|
|
14653
14818
|
await traceAngularPhase("setup/create-indexes-dir", () => fs5.mkdir(indexesDir, { recursive: true }));
|
|
14654
14819
|
const aotOutputs = hmr ? [] : await traceAngularPhase("aot/compile-files", () => compileAngularFiles(entryPoints.map((entry) => resolve21(entry)), compiledRoot, stylePreprocessors), { entries: entryPoints.length });
|
|
14655
14820
|
if (!hmr) {
|
|
@@ -14663,9 +14828,9 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
14663
14828
|
absolute: false,
|
|
14664
14829
|
cwd: angularSrcDir
|
|
14665
14830
|
})) {
|
|
14666
|
-
const sourcePath =
|
|
14831
|
+
const sourcePath = join28(angularSrcDir, rel);
|
|
14667
14832
|
const cwdRel = relative11(cwd, sourcePath);
|
|
14668
|
-
const targetPath =
|
|
14833
|
+
const targetPath = join28(compiledRoot, cwdRel);
|
|
14669
14834
|
await fs5.mkdir(dirname14(targetPath), { recursive: true });
|
|
14670
14835
|
await fs5.copyFile(sourcePath, targetPath);
|
|
14671
14836
|
}
|
|
@@ -14682,9 +14847,9 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
14682
14847
|
const fileBase = basename8(resolvedEntry).replace(/\.[tj]s$/, "");
|
|
14683
14848
|
const jsName = `${fileBase}.js`;
|
|
14684
14849
|
const compiledFallbackPaths = [
|
|
14685
|
-
|
|
14686
|
-
|
|
14687
|
-
|
|
14850
|
+
join28(compiledRoot, relativeEntry),
|
|
14851
|
+
join28(compiledRoot, "pages", jsName),
|
|
14852
|
+
join28(compiledRoot, jsName)
|
|
14688
14853
|
].map((file3) => resolve21(file3));
|
|
14689
14854
|
const resolveRawServerFile = (candidatePaths) => {
|
|
14690
14855
|
const normalizedCandidates = [
|
|
@@ -14734,7 +14899,7 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
14734
14899
|
const providersHashInput = providersInjection ? (() => {
|
|
14735
14900
|
let providersSourceContent = "";
|
|
14736
14901
|
try {
|
|
14737
|
-
providersSourceContent =
|
|
14902
|
+
providersSourceContent = readFileSync17(providersInjection.appProvidersSource, "utf-8");
|
|
14738
14903
|
} catch {}
|
|
14739
14904
|
return JSON.stringify({
|
|
14740
14905
|
basePath: pageInjectionForHash?.basePath ?? null,
|
|
@@ -14744,7 +14909,7 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
14744
14909
|
})() : "no-providers";
|
|
14745
14910
|
const serverContentHash = `${Bun.hash(original).toString(BASE_36_RADIX)}.${Bun.hash(providersHashInput).toString(BASE_36_RADIX)}`;
|
|
14746
14911
|
const cachedWrapper = wrapperOutputCache.get(resolvedEntry);
|
|
14747
|
-
const clientFile =
|
|
14912
|
+
const clientFile = join28(indexesDir, jsName);
|
|
14748
14913
|
if (hmr && cachedWrapper && cachedWrapper.serverHash === serverContentHash && existsSync22(clientFile) && (usesLegacyAnimations || !original.includes("__ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__")) && (!usesLegacyAnimations || original.includes("__ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__"))) {
|
|
14749
14914
|
return {
|
|
14750
14915
|
clientPath: clientFile,
|
|
@@ -14776,7 +14941,7 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
14776
14941
|
const angularDirAbs = resolve21(outRoot);
|
|
14777
14942
|
const appSourceAbs = resolve21(providersInjection.appProvidersSource);
|
|
14778
14943
|
const rel = relative11(angularDirAbs, appSourceAbs).replace(/\\/g, "/");
|
|
14779
|
-
return
|
|
14944
|
+
return join28(compiledParent, rel).replace(/\.[cm]?[tj]sx?$/, ".js");
|
|
14780
14945
|
})();
|
|
14781
14946
|
const appProvidersSpec = (() => {
|
|
14782
14947
|
const rel = relative11(dirname14(rawServerFile), compiledAppProvidersPath).replace(/\\/g, "/");
|
|
@@ -14999,24 +15164,24 @@ var init_compileAngular = __esm(() => {
|
|
|
14999
15164
|
init_stylePreprocessor();
|
|
15000
15165
|
init_generatedDir();
|
|
15001
15166
|
devClientDir4 = resolveDevClientDir4();
|
|
15002
|
-
hmrClientPath5 =
|
|
15167
|
+
hmrClientPath5 = join28(devClientDir4, "hmrClient.ts").replace(/\\/g, "/");
|
|
15003
15168
|
jitContentCache = new Map;
|
|
15004
15169
|
wrapperOutputCache = new Map;
|
|
15005
15170
|
});
|
|
15006
15171
|
|
|
15007
15172
|
// src/dev/angular/hmrImportGenerator.ts
|
|
15008
|
-
import
|
|
15173
|
+
import ts11 from "typescript";
|
|
15009
15174
|
var createHmrImportGenerator = (namespaceMap) => ({
|
|
15010
15175
|
addImport(request) {
|
|
15011
15176
|
const ns = namespaceMap.get(request.exportModuleSpecifier);
|
|
15012
15177
|
if (!ns) {
|
|
15013
15178
|
throw new Error(`HMR import generator has no namespace mapping for ${request.exportModuleSpecifier}. ` + `Add it to namespaceDependencies before calling compileHmrUpdateCallback.`);
|
|
15014
15179
|
}
|
|
15015
|
-
const namespaceId =
|
|
15180
|
+
const namespaceId = ts11.factory.createIdentifier(ns);
|
|
15016
15181
|
if (request.exportSymbolName === null) {
|
|
15017
15182
|
return namespaceId;
|
|
15018
15183
|
}
|
|
15019
|
-
return
|
|
15184
|
+
return ts11.factory.createPropertyAccessExpression(namespaceId, ts11.factory.createIdentifier(request.exportSymbolName));
|
|
15020
15185
|
}
|
|
15021
15186
|
});
|
|
15022
15187
|
var init_hmrImportGenerator = () => {};
|
|
@@ -15389,13 +15554,13 @@ var init_translator = __esm(() => {
|
|
|
15389
15554
|
});
|
|
15390
15555
|
|
|
15391
15556
|
// src/dev/angular/vendor/translator/ts_util.ts
|
|
15392
|
-
import
|
|
15557
|
+
import ts12 from "typescript";
|
|
15393
15558
|
function tsNumericExpression(value) {
|
|
15394
15559
|
if (value < 0) {
|
|
15395
|
-
const operand =
|
|
15396
|
-
return
|
|
15560
|
+
const operand = ts12.factory.createNumericLiteral(Math.abs(value));
|
|
15561
|
+
return ts12.factory.createPrefixUnaryExpression(ts12.SyntaxKind.MinusToken, operand);
|
|
15397
15562
|
}
|
|
15398
|
-
return
|
|
15563
|
+
return ts12.factory.createNumericLiteral(value);
|
|
15399
15564
|
}
|
|
15400
15565
|
var init_ts_util = __esm(() => {
|
|
15401
15566
|
/*!
|
|
@@ -15408,142 +15573,142 @@ var init_ts_util = __esm(() => {
|
|
|
15408
15573
|
});
|
|
15409
15574
|
|
|
15410
15575
|
// src/dev/angular/vendor/translator/typescript_ast_factory.ts
|
|
15411
|
-
import
|
|
15576
|
+
import ts13 from "typescript";
|
|
15412
15577
|
|
|
15413
15578
|
class TypeScriptAstFactory {
|
|
15414
15579
|
annotateForClosureCompiler;
|
|
15415
15580
|
externalSourceFiles = new Map;
|
|
15416
15581
|
UNARY_OPERATORS = /* @__PURE__ */ (() => ({
|
|
15417
|
-
"+":
|
|
15418
|
-
"-":
|
|
15419
|
-
"!":
|
|
15582
|
+
"+": ts13.SyntaxKind.PlusToken,
|
|
15583
|
+
"-": ts13.SyntaxKind.MinusToken,
|
|
15584
|
+
"!": ts13.SyntaxKind.ExclamationToken
|
|
15420
15585
|
}))();
|
|
15421
15586
|
BINARY_OPERATORS = /* @__PURE__ */ (() => ({
|
|
15422
|
-
"&&":
|
|
15423
|
-
">":
|
|
15424
|
-
">=":
|
|
15425
|
-
"&":
|
|
15426
|
-
"|":
|
|
15427
|
-
"/":
|
|
15428
|
-
"==":
|
|
15429
|
-
"===":
|
|
15430
|
-
"<":
|
|
15431
|
-
"<=":
|
|
15432
|
-
"-":
|
|
15433
|
-
"%":
|
|
15434
|
-
"*":
|
|
15435
|
-
"**":
|
|
15436
|
-
"!=":
|
|
15437
|
-
"!==":
|
|
15438
|
-
"||":
|
|
15439
|
-
"+":
|
|
15440
|
-
"??":
|
|
15441
|
-
"=":
|
|
15442
|
-
"+=":
|
|
15443
|
-
"-=":
|
|
15444
|
-
"*=":
|
|
15445
|
-
"/=":
|
|
15446
|
-
"%=":
|
|
15447
|
-
"**=":
|
|
15448
|
-
"&&=":
|
|
15449
|
-
"||=":
|
|
15450
|
-
"??=":
|
|
15451
|
-
in:
|
|
15452
|
-
instanceof:
|
|
15587
|
+
"&&": ts13.SyntaxKind.AmpersandAmpersandToken,
|
|
15588
|
+
">": ts13.SyntaxKind.GreaterThanToken,
|
|
15589
|
+
">=": ts13.SyntaxKind.GreaterThanEqualsToken,
|
|
15590
|
+
"&": ts13.SyntaxKind.AmpersandToken,
|
|
15591
|
+
"|": ts13.SyntaxKind.BarToken,
|
|
15592
|
+
"/": ts13.SyntaxKind.SlashToken,
|
|
15593
|
+
"==": ts13.SyntaxKind.EqualsEqualsToken,
|
|
15594
|
+
"===": ts13.SyntaxKind.EqualsEqualsEqualsToken,
|
|
15595
|
+
"<": ts13.SyntaxKind.LessThanToken,
|
|
15596
|
+
"<=": ts13.SyntaxKind.LessThanEqualsToken,
|
|
15597
|
+
"-": ts13.SyntaxKind.MinusToken,
|
|
15598
|
+
"%": ts13.SyntaxKind.PercentToken,
|
|
15599
|
+
"*": ts13.SyntaxKind.AsteriskToken,
|
|
15600
|
+
"**": ts13.SyntaxKind.AsteriskAsteriskToken,
|
|
15601
|
+
"!=": ts13.SyntaxKind.ExclamationEqualsToken,
|
|
15602
|
+
"!==": ts13.SyntaxKind.ExclamationEqualsEqualsToken,
|
|
15603
|
+
"||": ts13.SyntaxKind.BarBarToken,
|
|
15604
|
+
"+": ts13.SyntaxKind.PlusToken,
|
|
15605
|
+
"??": ts13.SyntaxKind.QuestionQuestionToken,
|
|
15606
|
+
"=": ts13.SyntaxKind.EqualsToken,
|
|
15607
|
+
"+=": ts13.SyntaxKind.PlusEqualsToken,
|
|
15608
|
+
"-=": ts13.SyntaxKind.MinusEqualsToken,
|
|
15609
|
+
"*=": ts13.SyntaxKind.AsteriskEqualsToken,
|
|
15610
|
+
"/=": ts13.SyntaxKind.SlashEqualsToken,
|
|
15611
|
+
"%=": ts13.SyntaxKind.PercentEqualsToken,
|
|
15612
|
+
"**=": ts13.SyntaxKind.AsteriskAsteriskEqualsToken,
|
|
15613
|
+
"&&=": ts13.SyntaxKind.AmpersandAmpersandEqualsToken,
|
|
15614
|
+
"||=": ts13.SyntaxKind.BarBarEqualsToken,
|
|
15615
|
+
"??=": ts13.SyntaxKind.QuestionQuestionEqualsToken,
|
|
15616
|
+
in: ts13.SyntaxKind.InKeyword,
|
|
15617
|
+
instanceof: ts13.SyntaxKind.InstanceOfKeyword
|
|
15453
15618
|
}))();
|
|
15454
15619
|
VAR_TYPES = /* @__PURE__ */ (() => ({
|
|
15455
|
-
const:
|
|
15456
|
-
let:
|
|
15457
|
-
var:
|
|
15620
|
+
const: ts13.NodeFlags.Const,
|
|
15621
|
+
let: ts13.NodeFlags.Let,
|
|
15622
|
+
var: ts13.NodeFlags.None
|
|
15458
15623
|
}))();
|
|
15459
15624
|
constructor(annotateForClosureCompiler) {
|
|
15460
15625
|
this.annotateForClosureCompiler = annotateForClosureCompiler;
|
|
15461
15626
|
}
|
|
15462
15627
|
attachComments = attachComments;
|
|
15463
|
-
createArrayLiteral =
|
|
15628
|
+
createArrayLiteral = ts13.factory.createArrayLiteralExpression;
|
|
15464
15629
|
createAssignment(target, operator, value) {
|
|
15465
|
-
return
|
|
15630
|
+
return ts13.factory.createBinaryExpression(target, this.BINARY_OPERATORS[operator], value);
|
|
15466
15631
|
}
|
|
15467
15632
|
createBinaryExpression(leftOperand, operator, rightOperand) {
|
|
15468
|
-
return
|
|
15633
|
+
return ts13.factory.createBinaryExpression(leftOperand, this.BINARY_OPERATORS[operator], rightOperand);
|
|
15469
15634
|
}
|
|
15470
15635
|
createBlock(body) {
|
|
15471
|
-
return
|
|
15636
|
+
return ts13.factory.createBlock(body);
|
|
15472
15637
|
}
|
|
15473
15638
|
createCallExpression(callee, args, pure) {
|
|
15474
|
-
const call =
|
|
15639
|
+
const call = ts13.factory.createCallExpression(callee, undefined, args);
|
|
15475
15640
|
if (pure) {
|
|
15476
|
-
|
|
15641
|
+
ts13.addSyntheticLeadingComment(call, ts13.SyntaxKind.MultiLineCommentTrivia, this.annotateForClosureCompiler ? "* @pureOrBreakMyCode " /* CLOSURE */ : "@__PURE__" /* TERSER */, false);
|
|
15477
15642
|
}
|
|
15478
15643
|
return call;
|
|
15479
15644
|
}
|
|
15480
15645
|
createConditional(condition, whenTrue, whenFalse) {
|
|
15481
|
-
return
|
|
15646
|
+
return ts13.factory.createConditionalExpression(condition, undefined, whenTrue, undefined, whenFalse);
|
|
15482
15647
|
}
|
|
15483
|
-
createElementAccess =
|
|
15484
|
-
createExpressionStatement =
|
|
15648
|
+
createElementAccess = ts13.factory.createElementAccessExpression;
|
|
15649
|
+
createExpressionStatement = ts13.factory.createExpressionStatement;
|
|
15485
15650
|
createDynamicImport(url) {
|
|
15486
|
-
return
|
|
15487
|
-
typeof url === "string" ?
|
|
15651
|
+
return ts13.factory.createCallExpression(ts13.factory.createToken(ts13.SyntaxKind.ImportKeyword), undefined, [
|
|
15652
|
+
typeof url === "string" ? ts13.factory.createStringLiteral(url) : url
|
|
15488
15653
|
]);
|
|
15489
15654
|
}
|
|
15490
15655
|
createFunctionDeclaration(functionName, parameters, body) {
|
|
15491
|
-
if (!
|
|
15492
|
-
throw new Error(`Invalid syntax, expected a block, but got ${
|
|
15656
|
+
if (!ts13.isBlock(body)) {
|
|
15657
|
+
throw new Error(`Invalid syntax, expected a block, but got ${ts13.SyntaxKind[body.kind]}.`);
|
|
15493
15658
|
}
|
|
15494
|
-
return
|
|
15659
|
+
return ts13.factory.createFunctionDeclaration(undefined, undefined, functionName, undefined, parameters.map((param) => this.createParameter(param)), undefined, body);
|
|
15495
15660
|
}
|
|
15496
15661
|
createFunctionExpression(functionName, parameters, body) {
|
|
15497
|
-
if (!
|
|
15498
|
-
throw new Error(`Invalid syntax, expected a block, but got ${
|
|
15662
|
+
if (!ts13.isBlock(body)) {
|
|
15663
|
+
throw new Error(`Invalid syntax, expected a block, but got ${ts13.SyntaxKind[body.kind]}.`);
|
|
15499
15664
|
}
|
|
15500
|
-
return
|
|
15665
|
+
return ts13.factory.createFunctionExpression(undefined, undefined, functionName ?? undefined, undefined, parameters.map((param) => this.createParameter(param)), undefined, body);
|
|
15501
15666
|
}
|
|
15502
15667
|
createArrowFunctionExpression(parameters, body) {
|
|
15503
|
-
if (
|
|
15504
|
-
throw new Error(`Invalid syntax, expected a block, but got ${
|
|
15668
|
+
if (ts13.isStatement(body) && !ts13.isBlock(body)) {
|
|
15669
|
+
throw new Error(`Invalid syntax, expected a block, but got ${ts13.SyntaxKind[body.kind]}.`);
|
|
15505
15670
|
}
|
|
15506
|
-
return
|
|
15671
|
+
return ts13.factory.createArrowFunction(undefined, undefined, parameters.map((param) => this.createParameter(param)), undefined, undefined, body);
|
|
15507
15672
|
}
|
|
15508
15673
|
createParameter(param) {
|
|
15509
|
-
return
|
|
15674
|
+
return ts13.factory.createParameterDeclaration(undefined, undefined, param.name, undefined, param.type ?? undefined);
|
|
15510
15675
|
}
|
|
15511
|
-
createIdentifier =
|
|
15676
|
+
createIdentifier = ts13.factory.createIdentifier;
|
|
15512
15677
|
createIfStatement(condition, thenStatement, elseStatement) {
|
|
15513
|
-
return
|
|
15678
|
+
return ts13.factory.createIfStatement(condition, thenStatement, elseStatement ?? undefined);
|
|
15514
15679
|
}
|
|
15515
15680
|
createLiteral(value) {
|
|
15516
15681
|
if (value === undefined) {
|
|
15517
|
-
return
|
|
15682
|
+
return ts13.factory.createIdentifier("undefined");
|
|
15518
15683
|
} else if (value === null) {
|
|
15519
|
-
return
|
|
15684
|
+
return ts13.factory.createNull();
|
|
15520
15685
|
} else if (typeof value === "boolean") {
|
|
15521
|
-
return value ?
|
|
15686
|
+
return value ? ts13.factory.createTrue() : ts13.factory.createFalse();
|
|
15522
15687
|
} else if (typeof value === "number") {
|
|
15523
15688
|
return tsNumericExpression(value);
|
|
15524
15689
|
} else {
|
|
15525
|
-
return
|
|
15690
|
+
return ts13.factory.createStringLiteral(value);
|
|
15526
15691
|
}
|
|
15527
15692
|
}
|
|
15528
15693
|
createNewExpression(expression, args) {
|
|
15529
|
-
return
|
|
15694
|
+
return ts13.factory.createNewExpression(expression, undefined, args);
|
|
15530
15695
|
}
|
|
15531
15696
|
createObjectLiteral(properties) {
|
|
15532
|
-
return
|
|
15697
|
+
return ts13.factory.createObjectLiteralExpression(properties.map((prop) => {
|
|
15533
15698
|
if (prop.kind === "spread") {
|
|
15534
|
-
return
|
|
15699
|
+
return ts13.factory.createSpreadAssignment(prop.expression);
|
|
15535
15700
|
}
|
|
15536
|
-
return
|
|
15701
|
+
return ts13.factory.createPropertyAssignment(prop.quoted ? ts13.factory.createStringLiteral(prop.propertyName) : ts13.factory.createIdentifier(prop.propertyName), prop.value);
|
|
15537
15702
|
}));
|
|
15538
15703
|
}
|
|
15539
|
-
createParenthesizedExpression =
|
|
15540
|
-
createPropertyAccess =
|
|
15541
|
-
createSpreadElement =
|
|
15704
|
+
createParenthesizedExpression = ts13.factory.createParenthesizedExpression;
|
|
15705
|
+
createPropertyAccess = ts13.factory.createPropertyAccessExpression;
|
|
15706
|
+
createSpreadElement = ts13.factory.createSpreadElement;
|
|
15542
15707
|
createReturnStatement(expression) {
|
|
15543
|
-
return
|
|
15708
|
+
return ts13.factory.createReturnStatement(expression ?? undefined);
|
|
15544
15709
|
}
|
|
15545
15710
|
createTaggedTemplate(tag, template) {
|
|
15546
|
-
return
|
|
15711
|
+
return ts13.factory.createTaggedTemplateExpression(tag, undefined, this.createTemplateLiteral(template));
|
|
15547
15712
|
}
|
|
15548
15713
|
createTemplateLiteral(template) {
|
|
15549
15714
|
let templateLiteral;
|
|
@@ -15553,7 +15718,7 @@ class TypeScriptAstFactory {
|
|
|
15553
15718
|
throw new Error("createTemplateLiteral: template has no elements");
|
|
15554
15719
|
}
|
|
15555
15720
|
if (length === 1) {
|
|
15556
|
-
templateLiteral =
|
|
15721
|
+
templateLiteral = ts13.factory.createNoSubstitutionTemplateLiteral(head.cooked, head.raw);
|
|
15557
15722
|
} else {
|
|
15558
15723
|
const spans = [];
|
|
15559
15724
|
for (let i = 1;i < length - 1; i++) {
|
|
@@ -15567,7 +15732,7 @@ class TypeScriptAstFactory {
|
|
|
15567
15732
|
if (range !== null) {
|
|
15568
15733
|
this.setSourceMapRange(middle, range);
|
|
15569
15734
|
}
|
|
15570
|
-
spans.push(
|
|
15735
|
+
spans.push(ts13.factory.createTemplateSpan(expression, middle));
|
|
15571
15736
|
}
|
|
15572
15737
|
const resolvedExpression = template.expressions[length - 2];
|
|
15573
15738
|
const templatePart = template.elements[length - 1];
|
|
@@ -15578,27 +15743,27 @@ class TypeScriptAstFactory {
|
|
|
15578
15743
|
if (templatePart.range !== null) {
|
|
15579
15744
|
this.setSourceMapRange(templateTail, templatePart.range);
|
|
15580
15745
|
}
|
|
15581
|
-
spans.push(
|
|
15582
|
-
templateLiteral =
|
|
15746
|
+
spans.push(ts13.factory.createTemplateSpan(resolvedExpression, templateTail));
|
|
15747
|
+
templateLiteral = ts13.factory.createTemplateExpression(ts13.factory.createTemplateHead(head.cooked, head.raw), spans);
|
|
15583
15748
|
}
|
|
15584
15749
|
if (head.range !== null) {
|
|
15585
15750
|
this.setSourceMapRange(templateLiteral, head.range);
|
|
15586
15751
|
}
|
|
15587
15752
|
return templateLiteral;
|
|
15588
15753
|
}
|
|
15589
|
-
createThrowStatement =
|
|
15590
|
-
createTypeOfExpression =
|
|
15591
|
-
createVoidExpression =
|
|
15754
|
+
createThrowStatement = ts13.factory.createThrowStatement;
|
|
15755
|
+
createTypeOfExpression = ts13.factory.createTypeOfExpression;
|
|
15756
|
+
createVoidExpression = ts13.factory.createVoidExpression;
|
|
15592
15757
|
createUnaryExpression(operator, operand) {
|
|
15593
|
-
return
|
|
15758
|
+
return ts13.factory.createPrefixUnaryExpression(this.UNARY_OPERATORS[operator], operand);
|
|
15594
15759
|
}
|
|
15595
15760
|
createVariableDeclaration(variableName, initializer, variableType, type) {
|
|
15596
|
-
return
|
|
15597
|
-
|
|
15761
|
+
return ts13.factory.createVariableStatement(undefined, ts13.factory.createVariableDeclarationList([
|
|
15762
|
+
ts13.factory.createVariableDeclaration(variableName, undefined, type ?? undefined, initializer ?? undefined)
|
|
15598
15763
|
], this.VAR_TYPES[variableType]));
|
|
15599
15764
|
}
|
|
15600
15765
|
createRegularExpressionLiteral(body, flags) {
|
|
15601
|
-
return
|
|
15766
|
+
return ts13.factory.createRegularExpressionLiteral(`/${body}/${flags ?? ""}`);
|
|
15602
15767
|
}
|
|
15603
15768
|
setSourceMapRange(node, sourceMapRange) {
|
|
15604
15769
|
if (sourceMapRange === null) {
|
|
@@ -15606,10 +15771,10 @@ class TypeScriptAstFactory {
|
|
|
15606
15771
|
}
|
|
15607
15772
|
const url = sourceMapRange.url;
|
|
15608
15773
|
if (!this.externalSourceFiles.has(url)) {
|
|
15609
|
-
this.externalSourceFiles.set(url,
|
|
15774
|
+
this.externalSourceFiles.set(url, ts13.createSourceMapSource(url, sourceMapRange.content, (pos) => pos));
|
|
15610
15775
|
}
|
|
15611
15776
|
const source = this.externalSourceFiles.get(url);
|
|
15612
|
-
|
|
15777
|
+
ts13.setSourceMapRange(node, {
|
|
15613
15778
|
pos: sourceMapRange.start.offset,
|
|
15614
15779
|
end: sourceMapRange.end.offset,
|
|
15615
15780
|
source
|
|
@@ -15619,77 +15784,77 @@ class TypeScriptAstFactory {
|
|
|
15619
15784
|
createBuiltInType(type) {
|
|
15620
15785
|
switch (type) {
|
|
15621
15786
|
case "any":
|
|
15622
|
-
return
|
|
15787
|
+
return ts13.factory.createKeywordTypeNode(ts13.SyntaxKind.AnyKeyword);
|
|
15623
15788
|
case "boolean":
|
|
15624
|
-
return
|
|
15789
|
+
return ts13.factory.createKeywordTypeNode(ts13.SyntaxKind.BooleanKeyword);
|
|
15625
15790
|
case "number":
|
|
15626
|
-
return
|
|
15791
|
+
return ts13.factory.createKeywordTypeNode(ts13.SyntaxKind.NumberKeyword);
|
|
15627
15792
|
case "string":
|
|
15628
|
-
return
|
|
15793
|
+
return ts13.factory.createKeywordTypeNode(ts13.SyntaxKind.StringKeyword);
|
|
15629
15794
|
case "function":
|
|
15630
|
-
return
|
|
15795
|
+
return ts13.factory.createTypeReferenceNode(ts13.factory.createIdentifier("Function"));
|
|
15631
15796
|
case "never":
|
|
15632
|
-
return
|
|
15797
|
+
return ts13.factory.createKeywordTypeNode(ts13.SyntaxKind.NeverKeyword);
|
|
15633
15798
|
case "unknown":
|
|
15634
|
-
return
|
|
15799
|
+
return ts13.factory.createKeywordTypeNode(ts13.SyntaxKind.UnknownKeyword);
|
|
15635
15800
|
}
|
|
15636
15801
|
}
|
|
15637
15802
|
createExpressionType(expression, typeParams) {
|
|
15638
15803
|
const typeName = getEntityTypeFromExpression(expression);
|
|
15639
|
-
return
|
|
15804
|
+
return ts13.factory.createTypeReferenceNode(typeName, typeParams ?? undefined);
|
|
15640
15805
|
}
|
|
15641
15806
|
createArrayType(elementType) {
|
|
15642
|
-
return
|
|
15807
|
+
return ts13.factory.createArrayTypeNode(elementType);
|
|
15643
15808
|
}
|
|
15644
15809
|
createMapType(valueType) {
|
|
15645
|
-
return
|
|
15646
|
-
|
|
15647
|
-
|
|
15810
|
+
return ts13.factory.createTypeLiteralNode([
|
|
15811
|
+
ts13.factory.createIndexSignature(undefined, [
|
|
15812
|
+
ts13.factory.createParameterDeclaration(undefined, undefined, "key", undefined, ts13.factory.createKeywordTypeNode(ts13.SyntaxKind.StringKeyword))
|
|
15648
15813
|
], valueType)
|
|
15649
15814
|
]);
|
|
15650
15815
|
}
|
|
15651
15816
|
transplantType(type) {
|
|
15652
|
-
if (typeof type.kind === "number" && typeof type.getSourceFile === "function" &&
|
|
15817
|
+
if (typeof type.kind === "number" && typeof type.getSourceFile === "function" && ts13.isTypeNode(type)) {
|
|
15653
15818
|
return type;
|
|
15654
15819
|
}
|
|
15655
15820
|
throw new Error("Attempting to transplant a type node from a non-TypeScript AST: " + type);
|
|
15656
15821
|
}
|
|
15657
15822
|
}
|
|
15658
15823
|
function createTemplateMiddle(cooked, raw) {
|
|
15659
|
-
const node =
|
|
15660
|
-
node.kind =
|
|
15824
|
+
const node = ts13.factory.createTemplateHead(cooked, raw);
|
|
15825
|
+
node.kind = ts13.SyntaxKind.TemplateMiddle;
|
|
15661
15826
|
return node;
|
|
15662
15827
|
}
|
|
15663
15828
|
function createTemplateTail(cooked, raw) {
|
|
15664
|
-
const node =
|
|
15665
|
-
node.kind =
|
|
15829
|
+
const node = ts13.factory.createTemplateHead(cooked, raw);
|
|
15830
|
+
node.kind = ts13.SyntaxKind.TemplateTail;
|
|
15666
15831
|
return node;
|
|
15667
15832
|
}
|
|
15668
15833
|
function attachComments(statement, leadingComments) {
|
|
15669
15834
|
for (const comment of leadingComments) {
|
|
15670
|
-
const commentKind = comment.multiline ?
|
|
15835
|
+
const commentKind = comment.multiline ? ts13.SyntaxKind.MultiLineCommentTrivia : ts13.SyntaxKind.SingleLineCommentTrivia;
|
|
15671
15836
|
if (comment.multiline) {
|
|
15672
|
-
|
|
15837
|
+
ts13.addSyntheticLeadingComment(statement, commentKind, comment.toString(), comment.trailingNewline);
|
|
15673
15838
|
} else {
|
|
15674
15839
|
for (const line of comment.toString().split(`
|
|
15675
15840
|
`)) {
|
|
15676
|
-
|
|
15841
|
+
ts13.addSyntheticLeadingComment(statement, commentKind, line, comment.trailingNewline);
|
|
15677
15842
|
}
|
|
15678
15843
|
}
|
|
15679
15844
|
}
|
|
15680
15845
|
}
|
|
15681
15846
|
function getEntityTypeFromExpression(expression) {
|
|
15682
|
-
if (
|
|
15847
|
+
if (ts13.isIdentifier(expression)) {
|
|
15683
15848
|
return expression;
|
|
15684
15849
|
}
|
|
15685
|
-
if (
|
|
15850
|
+
if (ts13.isPropertyAccessExpression(expression)) {
|
|
15686
15851
|
const left = getEntityTypeFromExpression(expression.expression);
|
|
15687
|
-
if (!
|
|
15852
|
+
if (!ts13.isIdentifier(expression.name)) {
|
|
15688
15853
|
throw new Error(`Unsupported property access for type reference: ${expression.name.text}`);
|
|
15689
15854
|
}
|
|
15690
|
-
return
|
|
15855
|
+
return ts13.factory.createQualifiedName(left, expression.name);
|
|
15691
15856
|
}
|
|
15692
|
-
throw new Error(`Unsupported expression for type reference: ${
|
|
15857
|
+
throw new Error(`Unsupported expression for type reference: ${ts13.SyntaxKind[expression.kind]}`);
|
|
15693
15858
|
}
|
|
15694
15859
|
var init_typescript_ast_factory = __esm(() => {
|
|
15695
15860
|
init_ts_util();
|
|
@@ -15722,9 +15887,9 @@ __export(exports_fastHmrCompiler, {
|
|
|
15722
15887
|
primeComponentFingerprint: () => primeComponentFingerprint,
|
|
15723
15888
|
invalidateFingerprintCache: () => invalidateFingerprintCache
|
|
15724
15889
|
});
|
|
15725
|
-
import { existsSync as existsSync23, readFileSync as
|
|
15890
|
+
import { existsSync as existsSync23, readFileSync as readFileSync18, statSync as statSync2 } from "fs";
|
|
15726
15891
|
import { dirname as dirname15, extname as extname6, relative as relative12, resolve as resolve22 } from "path";
|
|
15727
|
-
import
|
|
15892
|
+
import ts14 from "typescript";
|
|
15728
15893
|
var fail = (reason, detail, location) => ({
|
|
15729
15894
|
ok: false,
|
|
15730
15895
|
reason,
|
|
@@ -15808,23 +15973,23 @@ var fail = (reason, detail, location) => ({
|
|
|
15808
15973
|
}
|
|
15809
15974
|
let sourceFile;
|
|
15810
15975
|
try {
|
|
15811
|
-
sourceFile =
|
|
15976
|
+
sourceFile = ts14.createSourceFile(componentFilePath, source, ts14.ScriptTarget.Latest, true, ts14.ScriptKind.TS);
|
|
15812
15977
|
} catch {
|
|
15813
15978
|
return;
|
|
15814
15979
|
}
|
|
15815
15980
|
for (const stmt of sourceFile.statements) {
|
|
15816
|
-
if (!
|
|
15981
|
+
if (!ts14.isClassDeclaration(stmt))
|
|
15817
15982
|
continue;
|
|
15818
15983
|
const className = stmt.name?.text;
|
|
15819
15984
|
if (!className)
|
|
15820
15985
|
continue;
|
|
15821
|
-
const decorators =
|
|
15986
|
+
const decorators = ts14.getDecorators(stmt) ?? [];
|
|
15822
15987
|
const decoratorName = (() => {
|
|
15823
15988
|
for (const d2 of decorators) {
|
|
15824
|
-
if (!
|
|
15989
|
+
if (!ts14.isCallExpression(d2.expression))
|
|
15825
15990
|
continue;
|
|
15826
15991
|
const expr = d2.expression.expression;
|
|
15827
|
-
if (!
|
|
15992
|
+
if (!ts14.isIdentifier(expr))
|
|
15828
15993
|
continue;
|
|
15829
15994
|
if (expr.text === "Component" || expr.text === "Directive" || expr.text === "Pipe" || expr.text === "Injectable") {
|
|
15830
15995
|
return expr.text;
|
|
@@ -15838,16 +16003,16 @@ var fail = (reason, detail, location) => ({
|
|
|
15838
16003
|
const id = encodeURIComponent(`${projectRel}@${className}`);
|
|
15839
16004
|
if (decoratorName === "Component") {
|
|
15840
16005
|
const componentDecorator = decorators.find((d2) => {
|
|
15841
|
-
if (!
|
|
16006
|
+
if (!ts14.isCallExpression(d2.expression))
|
|
15842
16007
|
return false;
|
|
15843
16008
|
const expr = d2.expression.expression;
|
|
15844
|
-
return
|
|
16009
|
+
return ts14.isIdentifier(expr) && expr.text === "Component";
|
|
15845
16010
|
});
|
|
15846
16011
|
if (!componentDecorator)
|
|
15847
16012
|
continue;
|
|
15848
16013
|
const decoratorCall = componentDecorator.expression;
|
|
15849
16014
|
const args = decoratorCall.arguments[0];
|
|
15850
|
-
if (!args || !
|
|
16015
|
+
if (!args || !ts14.isObjectLiteralExpression(args))
|
|
15851
16016
|
continue;
|
|
15852
16017
|
const decoratorMeta = readDecoratorMeta(args);
|
|
15853
16018
|
const { inputs, outputs } = extractInputsAndOutputs(stmt, null);
|
|
@@ -15881,11 +16046,11 @@ var fail = (reason, detail, location) => ({
|
|
|
15881
16046
|
return false;
|
|
15882
16047
|
return true;
|
|
15883
16048
|
}, ENTITY_DECORATOR_NAMES, findEntityDecorator = (cls) => {
|
|
15884
|
-
for (const dec of
|
|
16049
|
+
for (const dec of ts14.getDecorators(cls) ?? []) {
|
|
15885
16050
|
const expr = dec.expression;
|
|
15886
|
-
if (!
|
|
16051
|
+
if (!ts14.isCallExpression(expr))
|
|
15887
16052
|
continue;
|
|
15888
|
-
if (!
|
|
16053
|
+
if (!ts14.isIdentifier(expr.expression))
|
|
15889
16054
|
continue;
|
|
15890
16055
|
if (ENTITY_DECORATOR_NAMES.has(expr.expression.text))
|
|
15891
16056
|
return dec;
|
|
@@ -15903,18 +16068,18 @@ var fail = (reason, detail, location) => ({
|
|
|
15903
16068
|
}
|
|
15904
16069
|
const ctorParamTypes = [];
|
|
15905
16070
|
for (const member of cls.members) {
|
|
15906
|
-
if (!
|
|
16071
|
+
if (!ts14.isConstructorDeclaration(member))
|
|
15907
16072
|
continue;
|
|
15908
16073
|
for (const param of member.parameters) {
|
|
15909
16074
|
const typeText = param.type ? param.type.getText() : "";
|
|
15910
|
-
const decorators =
|
|
16075
|
+
const decorators = ts14.getDecorators(param) ?? [];
|
|
15911
16076
|
const decoratorSig = decorators.length === 0 ? "" : decorators.map((d2) => {
|
|
15912
16077
|
const e = d2.expression;
|
|
15913
|
-
if (
|
|
16078
|
+
if (ts14.isCallExpression(e) && ts14.isIdentifier(e.expression)) {
|
|
15914
16079
|
const args = e.arguments.map((a) => a.getText()).join(",");
|
|
15915
16080
|
return `@${e.expression.text}(${args})`;
|
|
15916
16081
|
}
|
|
15917
|
-
if (
|
|
16082
|
+
if (ts14.isIdentifier(e))
|
|
15918
16083
|
return `@${e.text}`;
|
|
15919
16084
|
return "@<unknown>";
|
|
15920
16085
|
}).join("");
|
|
@@ -15936,23 +16101,23 @@ var fail = (reason, detail, location) => ({
|
|
|
15936
16101
|
const walk = (node) => {
|
|
15937
16102
|
if (found)
|
|
15938
16103
|
return;
|
|
15939
|
-
if (
|
|
16104
|
+
if (ts14.isClassDeclaration(node) && node.name?.text === className) {
|
|
15940
16105
|
found = node;
|
|
15941
16106
|
return;
|
|
15942
16107
|
}
|
|
15943
|
-
|
|
16108
|
+
ts14.forEachChild(node, walk);
|
|
15944
16109
|
};
|
|
15945
16110
|
walk(sourceFile);
|
|
15946
16111
|
return found;
|
|
15947
16112
|
}, getClassDecorators = (cls) => {
|
|
15948
|
-
const modifiers =
|
|
16113
|
+
const modifiers = ts14.getDecorators(cls) ?? [];
|
|
15949
16114
|
return [...modifiers];
|
|
15950
16115
|
}, findComponentDecorator = (cls) => {
|
|
15951
16116
|
for (const decorator of getClassDecorators(cls)) {
|
|
15952
16117
|
const expr = decorator.expression;
|
|
15953
|
-
if (
|
|
16118
|
+
if (ts14.isCallExpression(expr)) {
|
|
15954
16119
|
const fn2 = expr.expression;
|
|
15955
|
-
if (
|
|
16120
|
+
if (ts14.isIdentifier(fn2) && fn2.text === "Component") {
|
|
15956
16121
|
return decorator;
|
|
15957
16122
|
}
|
|
15958
16123
|
}
|
|
@@ -15960,15 +16125,15 @@ var fail = (reason, detail, location) => ({
|
|
|
15960
16125
|
return null;
|
|
15961
16126
|
}, getDecoratorArgsObject = (decorator) => {
|
|
15962
16127
|
const call = decorator.expression;
|
|
15963
|
-
if (!
|
|
16128
|
+
if (!ts14.isCallExpression(call))
|
|
15964
16129
|
return null;
|
|
15965
16130
|
const arg = call.arguments[0];
|
|
15966
|
-
if (!arg || !
|
|
16131
|
+
if (!arg || !ts14.isObjectLiteralExpression(arg))
|
|
15967
16132
|
return null;
|
|
15968
16133
|
return arg;
|
|
15969
16134
|
}, getProperty = (obj, name) => {
|
|
15970
16135
|
for (const prop of obj.properties) {
|
|
15971
|
-
if (
|
|
16136
|
+
if (ts14.isPropertyAssignment(prop) && (ts14.isIdentifier(prop.name) && prop.name.text === name || ts14.isStringLiteral(prop.name) && prop.name.text === name)) {
|
|
15972
16137
|
return prop.initializer;
|
|
15973
16138
|
}
|
|
15974
16139
|
}
|
|
@@ -15977,7 +16142,7 @@ var fail = (reason, detail, location) => ({
|
|
|
15977
16142
|
const expr = getProperty(obj, name);
|
|
15978
16143
|
if (!expr)
|
|
15979
16144
|
return null;
|
|
15980
|
-
if (
|
|
16145
|
+
if (ts14.isStringLiteral(expr) || ts14.isNoSubstitutionTemplateLiteral(expr)) {
|
|
15981
16146
|
return expr.text;
|
|
15982
16147
|
}
|
|
15983
16148
|
return null;
|
|
@@ -15985,22 +16150,22 @@ var fail = (reason, detail, location) => ({
|
|
|
15985
16150
|
const expr = getProperty(obj, name);
|
|
15986
16151
|
if (!expr)
|
|
15987
16152
|
return null;
|
|
15988
|
-
if (expr.kind ===
|
|
16153
|
+
if (expr.kind === ts14.SyntaxKind.TrueKeyword)
|
|
15989
16154
|
return true;
|
|
15990
|
-
if (expr.kind ===
|
|
16155
|
+
if (expr.kind === ts14.SyntaxKind.FalseKeyword)
|
|
15991
16156
|
return false;
|
|
15992
16157
|
return null;
|
|
15993
16158
|
}, isAngularDecoratorIdentifier = (name) => name === "Component" || name === "Directive" || name === "Pipe" || name === "Injectable", classHasAngularDecorator = (cls) => {
|
|
15994
|
-
for (const dec of
|
|
16159
|
+
for (const dec of ts14.getDecorators(cls) ?? []) {
|
|
15995
16160
|
const expr = dec.expression;
|
|
15996
|
-
if (
|
|
16161
|
+
if (ts14.isCallExpression(expr) && ts14.isIdentifier(expr.expression) && isAngularDecoratorIdentifier(expr.expression.text)) {
|
|
15997
16162
|
return true;
|
|
15998
16163
|
}
|
|
15999
16164
|
}
|
|
16000
16165
|
return false;
|
|
16001
16166
|
}, findClassInSourceFile = (sf, className) => {
|
|
16002
16167
|
for (const stmt of sf.statements) {
|
|
16003
|
-
if (
|
|
16168
|
+
if (ts14.isClassDeclaration(stmt) && stmt.name?.text === className) {
|
|
16004
16169
|
return stmt;
|
|
16005
16170
|
}
|
|
16006
16171
|
}
|
|
@@ -16010,15 +16175,15 @@ var fail = (reason, detail, location) => ({
|
|
|
16010
16175
|
if (sameFile)
|
|
16011
16176
|
return classHasAngularDecorator(sameFile);
|
|
16012
16177
|
for (const stmt of sourceFile.statements) {
|
|
16013
|
-
if (!
|
|
16178
|
+
if (!ts14.isImportDeclaration(stmt))
|
|
16014
16179
|
continue;
|
|
16015
|
-
if (!
|
|
16180
|
+
if (!ts14.isStringLiteral(stmt.moduleSpecifier))
|
|
16016
16181
|
continue;
|
|
16017
16182
|
const clause = stmt.importClause;
|
|
16018
16183
|
if (!clause || clause.isTypeOnly)
|
|
16019
16184
|
continue;
|
|
16020
16185
|
const named = clause.namedBindings;
|
|
16021
|
-
if (!named || !
|
|
16186
|
+
if (!named || !ts14.isNamedImports(named))
|
|
16022
16187
|
continue;
|
|
16023
16188
|
const found = named.elements.find((el) => el.name.text === parentClassName);
|
|
16024
16189
|
if (!found)
|
|
@@ -16039,11 +16204,11 @@ var fail = (reason, detail, location) => ({
|
|
|
16039
16204
|
continue;
|
|
16040
16205
|
let content;
|
|
16041
16206
|
try {
|
|
16042
|
-
content =
|
|
16207
|
+
content = readFileSync18(candidate, "utf-8");
|
|
16043
16208
|
} catch {
|
|
16044
16209
|
continue;
|
|
16045
16210
|
}
|
|
16046
|
-
const parentSf =
|
|
16211
|
+
const parentSf = ts14.createSourceFile(candidate, content, ts14.ScriptTarget.Latest, true);
|
|
16047
16212
|
const parentCls = findClassInSourceFile(parentSf, parentClassName);
|
|
16048
16213
|
if (!parentCls)
|
|
16049
16214
|
continue;
|
|
@@ -16055,11 +16220,11 @@ var fail = (reason, detail, location) => ({
|
|
|
16055
16220
|
}, inheritsDecoratedClass = (cls, sourceFile, componentDir, projectRoot) => {
|
|
16056
16221
|
const heritage = cls.heritageClauses ?? [];
|
|
16057
16222
|
for (const clause of heritage) {
|
|
16058
|
-
if (clause.token !==
|
|
16223
|
+
if (clause.token !== ts14.SyntaxKind.ExtendsKeyword)
|
|
16059
16224
|
continue;
|
|
16060
16225
|
for (const typeNode of clause.types) {
|
|
16061
16226
|
const expr = typeNode.expression;
|
|
16062
|
-
if (!
|
|
16227
|
+
if (!ts14.isIdentifier(expr)) {
|
|
16063
16228
|
return true;
|
|
16064
16229
|
}
|
|
16065
16230
|
if (parentHasAngularDecoratorAcrossFiles(expr.text, sourceFile, componentDir, projectRoot)) {
|
|
@@ -16070,18 +16235,18 @@ var fail = (reason, detail, location) => ({
|
|
|
16070
16235
|
return false;
|
|
16071
16236
|
}, CONTROL_CREATE_METHOD_NAME = "\u0275ngControlCreate", extractControlCreate = (cls) => {
|
|
16072
16237
|
for (const member of cls.members) {
|
|
16073
|
-
if (!
|
|
16238
|
+
if (!ts14.isMethodDeclaration(member))
|
|
16074
16239
|
continue;
|
|
16075
|
-
if (member.modifiers?.some((m) => m.kind ===
|
|
16240
|
+
if (member.modifiers?.some((m) => m.kind === ts14.SyntaxKind.StaticKeyword))
|
|
16076
16241
|
continue;
|
|
16077
16242
|
const name = member.name;
|
|
16078
16243
|
if (name === undefined)
|
|
16079
16244
|
continue;
|
|
16080
|
-
const nameText =
|
|
16245
|
+
const nameText = ts14.isIdentifier(name) ? name.text : name.getText();
|
|
16081
16246
|
if (nameText !== CONTROL_CREATE_METHOD_NAME)
|
|
16082
16247
|
continue;
|
|
16083
16248
|
const firstParam = member.parameters[0];
|
|
16084
|
-
if (firstParam === undefined || firstParam.type === undefined || !
|
|
16249
|
+
if (firstParam === undefined || firstParam.type === undefined || !ts14.isTypeReferenceNode(firstParam.type)) {
|
|
16085
16250
|
return { passThroughInput: null };
|
|
16086
16251
|
}
|
|
16087
16252
|
const typeArgs = firstParam.type.typeArguments;
|
|
@@ -16089,16 +16254,16 @@ var fail = (reason, detail, location) => ({
|
|
|
16089
16254
|
return { passThroughInput: null };
|
|
16090
16255
|
}
|
|
16091
16256
|
const arg = typeArgs[0];
|
|
16092
|
-
if (arg === undefined || !
|
|
16257
|
+
if (arg === undefined || !ts14.isLiteralTypeNode(arg) || !ts14.isStringLiteral(arg.literal)) {
|
|
16093
16258
|
return { passThroughInput: null };
|
|
16094
16259
|
}
|
|
16095
16260
|
return { passThroughInput: arg.literal.text };
|
|
16096
16261
|
}
|
|
16097
16262
|
return null;
|
|
16098
16263
|
}, resolveEnumPropertyAccess = (expr, enumName, values) => {
|
|
16099
|
-
if (!
|
|
16264
|
+
if (!ts14.isPropertyAccessExpression(expr))
|
|
16100
16265
|
return null;
|
|
16101
|
-
if (!
|
|
16266
|
+
if (!ts14.isIdentifier(expr.expression))
|
|
16102
16267
|
return null;
|
|
16103
16268
|
if (expr.expression.text !== enumName)
|
|
16104
16269
|
return null;
|
|
@@ -16117,21 +16282,21 @@ var fail = (reason, detail, location) => ({
|
|
|
16117
16282
|
const hostExpr = getProperty(args, "host");
|
|
16118
16283
|
const schemasExpr = getProperty(args, "schemas");
|
|
16119
16284
|
const styleUrls = [];
|
|
16120
|
-
if (styleUrlsExpr &&
|
|
16285
|
+
if (styleUrlsExpr && ts14.isArrayLiteralExpression(styleUrlsExpr)) {
|
|
16121
16286
|
for (const el of styleUrlsExpr.elements) {
|
|
16122
|
-
if (
|
|
16287
|
+
if (ts14.isStringLiteral(el))
|
|
16123
16288
|
styleUrls.push(el.text);
|
|
16124
16289
|
}
|
|
16125
16290
|
}
|
|
16126
16291
|
const styles = [];
|
|
16127
16292
|
if (stylesExpr) {
|
|
16128
|
-
if (
|
|
16293
|
+
if (ts14.isArrayLiteralExpression(stylesExpr)) {
|
|
16129
16294
|
for (const el of stylesExpr.elements) {
|
|
16130
|
-
if (
|
|
16295
|
+
if (ts14.isStringLiteral(el) || ts14.isNoSubstitutionTemplateLiteral(el)) {
|
|
16131
16296
|
styles.push(el.text);
|
|
16132
16297
|
}
|
|
16133
16298
|
}
|
|
16134
|
-
} else if (
|
|
16299
|
+
} else if (ts14.isStringLiteral(stylesExpr) || ts14.isNoSubstitutionTemplateLiteral(stylesExpr)) {
|
|
16135
16300
|
styles.push(stylesExpr.text);
|
|
16136
16301
|
}
|
|
16137
16302
|
}
|
|
@@ -16144,15 +16309,15 @@ var fail = (reason, detail, location) => ({
|
|
|
16144
16309
|
encapsulation,
|
|
16145
16310
|
hasProviders: getProperty(args, "providers") !== null,
|
|
16146
16311
|
hasViewProviders: getProperty(args, "viewProviders") !== null,
|
|
16147
|
-
importsExpr: importsExpr &&
|
|
16148
|
-
hostDirectivesExpr: hostDirectivesExpr &&
|
|
16149
|
-
animationsExpr: animationsExpr &&
|
|
16150
|
-
providersExpr: providersExpr &&
|
|
16151
|
-
viewProvidersExpr: viewProvidersExpr &&
|
|
16152
|
-
inputsArrayExpr: inputsArrayExpr &&
|
|
16153
|
-
outputsArrayExpr: outputsArrayExpr &&
|
|
16154
|
-
hostExpr: hostExpr &&
|
|
16155
|
-
schemasExpr: schemasExpr &&
|
|
16312
|
+
importsExpr: importsExpr && ts14.isArrayLiteralExpression(importsExpr) ? importsExpr : null,
|
|
16313
|
+
hostDirectivesExpr: hostDirectivesExpr && ts14.isArrayLiteralExpression(hostDirectivesExpr) ? hostDirectivesExpr : null,
|
|
16314
|
+
animationsExpr: animationsExpr && ts14.isArrayLiteralExpression(animationsExpr) ? animationsExpr : null,
|
|
16315
|
+
providersExpr: providersExpr && ts14.isArrayLiteralExpression(providersExpr) ? providersExpr : null,
|
|
16316
|
+
viewProvidersExpr: viewProvidersExpr && ts14.isArrayLiteralExpression(viewProvidersExpr) ? viewProvidersExpr : null,
|
|
16317
|
+
inputsArrayExpr: inputsArrayExpr && ts14.isArrayLiteralExpression(inputsArrayExpr) ? inputsArrayExpr : null,
|
|
16318
|
+
outputsArrayExpr: outputsArrayExpr && ts14.isArrayLiteralExpression(outputsArrayExpr) ? outputsArrayExpr : null,
|
|
16319
|
+
hostExpr: hostExpr && ts14.isObjectLiteralExpression(hostExpr) ? hostExpr : null,
|
|
16320
|
+
schemasExpr: schemasExpr && ts14.isArrayLiteralExpression(schemasExpr) ? schemasExpr : null,
|
|
16156
16321
|
preserveWhitespaces: getBooleanProperty(args, "preserveWhitespaces") ?? projectDefaults.preserveWhitespaces ?? false,
|
|
16157
16322
|
selector: getStringProperty(args, "selector"),
|
|
16158
16323
|
standalone: getBooleanProperty(args, "standalone") ?? true,
|
|
@@ -16163,13 +16328,13 @@ var fail = (reason, detail, location) => ({
|
|
|
16163
16328
|
templateUrl: getStringProperty(args, "templateUrl")
|
|
16164
16329
|
};
|
|
16165
16330
|
}, extractDecoratorInput = (prop, compiler) => {
|
|
16166
|
-
const decorators =
|
|
16331
|
+
const decorators = ts14.getDecorators(prop) ?? [];
|
|
16167
16332
|
for (const decorator of decorators) {
|
|
16168
16333
|
const expr = decorator.expression;
|
|
16169
|
-
if (!
|
|
16334
|
+
if (!ts14.isCallExpression(expr))
|
|
16170
16335
|
continue;
|
|
16171
16336
|
const fn2 = expr.expression;
|
|
16172
|
-
if (!
|
|
16337
|
+
if (!ts14.isIdentifier(fn2) || fn2.text !== "Input")
|
|
16173
16338
|
continue;
|
|
16174
16339
|
const classPropertyName = prop.name.getText();
|
|
16175
16340
|
let bindingPropertyName = classPropertyName;
|
|
@@ -16177,9 +16342,9 @@ var fail = (reason, detail, location) => ({
|
|
|
16177
16342
|
let transformFunction = null;
|
|
16178
16343
|
const arg = expr.arguments[0];
|
|
16179
16344
|
if (arg) {
|
|
16180
|
-
if (
|
|
16345
|
+
if (ts14.isStringLiteral(arg)) {
|
|
16181
16346
|
bindingPropertyName = arg.text;
|
|
16182
|
-
} else if (
|
|
16347
|
+
} else if (ts14.isObjectLiteralExpression(arg)) {
|
|
16183
16348
|
const aliasNode = getStringProperty(arg, "alias");
|
|
16184
16349
|
if (aliasNode !== null)
|
|
16185
16350
|
bindingPropertyName = aliasNode;
|
|
@@ -16203,11 +16368,11 @@ var fail = (reason, detail, location) => ({
|
|
|
16203
16368
|
}
|
|
16204
16369
|
return null;
|
|
16205
16370
|
}, isInputSignalCall = (init) => {
|
|
16206
|
-
if (
|
|
16371
|
+
if (ts14.isCallExpression(init)) {
|
|
16207
16372
|
const fn2 = init.expression;
|
|
16208
|
-
if (
|
|
16373
|
+
if (ts14.isIdentifier(fn2) && fn2.text === "input")
|
|
16209
16374
|
return true;
|
|
16210
|
-
if (
|
|
16375
|
+
if (ts14.isPropertyAccessExpression(fn2) && ts14.isIdentifier(fn2.expression) && fn2.expression.text === "input") {
|
|
16211
16376
|
return true;
|
|
16212
16377
|
}
|
|
16213
16378
|
}
|
|
@@ -16218,13 +16383,13 @@ var fail = (reason, detail, location) => ({
|
|
|
16218
16383
|
const classPropertyName = prop.name.getText();
|
|
16219
16384
|
const call = prop.initializer;
|
|
16220
16385
|
let required = false;
|
|
16221
|
-
if (
|
|
16386
|
+
if (ts14.isPropertyAccessExpression(call.expression) && ts14.isIdentifier(call.expression.name) && call.expression.name.text === "required") {
|
|
16222
16387
|
required = true;
|
|
16223
16388
|
}
|
|
16224
16389
|
let bindingPropertyName = classPropertyName;
|
|
16225
16390
|
let transformFunction = null;
|
|
16226
16391
|
const optsArg = call.arguments[required ? 0 : 1];
|
|
16227
|
-
if (optsArg &&
|
|
16392
|
+
if (optsArg && ts14.isObjectLiteralExpression(optsArg)) {
|
|
16228
16393
|
const aliasNode = getStringProperty(optsArg, "alias");
|
|
16229
16394
|
if (aliasNode !== null)
|
|
16230
16395
|
bindingPropertyName = aliasNode;
|
|
@@ -16244,28 +16409,28 @@ var fail = (reason, detail, location) => ({
|
|
|
16244
16409
|
}
|
|
16245
16410
|
};
|
|
16246
16411
|
}, extractDecoratorOutput = (prop) => {
|
|
16247
|
-
const decorators =
|
|
16412
|
+
const decorators = ts14.getDecorators(prop) ?? [];
|
|
16248
16413
|
for (const decorator of decorators) {
|
|
16249
16414
|
const expr = decorator.expression;
|
|
16250
|
-
if (!
|
|
16415
|
+
if (!ts14.isCallExpression(expr))
|
|
16251
16416
|
continue;
|
|
16252
16417
|
const fn2 = expr.expression;
|
|
16253
|
-
if (!
|
|
16418
|
+
if (!ts14.isIdentifier(fn2) || fn2.text !== "Output")
|
|
16254
16419
|
continue;
|
|
16255
16420
|
const classPropertyName = prop.name.getText();
|
|
16256
16421
|
let bindingName = classPropertyName;
|
|
16257
16422
|
const arg = expr.arguments[0];
|
|
16258
|
-
if (arg &&
|
|
16423
|
+
if (arg && ts14.isStringLiteral(arg))
|
|
16259
16424
|
bindingName = arg.text;
|
|
16260
16425
|
return { classPropertyName, bindingName };
|
|
16261
16426
|
}
|
|
16262
16427
|
return null;
|
|
16263
16428
|
}, isOutputSignalCall = (init) => {
|
|
16264
|
-
if (
|
|
16429
|
+
if (ts14.isCallExpression(init)) {
|
|
16265
16430
|
const fn2 = init.expression;
|
|
16266
|
-
if (
|
|
16431
|
+
if (ts14.isIdentifier(fn2) && fn2.text === "output")
|
|
16267
16432
|
return true;
|
|
16268
|
-
if (
|
|
16433
|
+
if (ts14.isPropertyAccessExpression(fn2) && ts14.isIdentifier(fn2.expression) && fn2.expression.text === "output") {
|
|
16269
16434
|
return true;
|
|
16270
16435
|
}
|
|
16271
16436
|
}
|
|
@@ -16277,7 +16442,7 @@ var fail = (reason, detail, location) => ({
|
|
|
16277
16442
|
const call = prop.initializer;
|
|
16278
16443
|
let bindingName = classPropertyName;
|
|
16279
16444
|
const optsArg = call.arguments[0];
|
|
16280
|
-
if (optsArg &&
|
|
16445
|
+
if (optsArg && ts14.isObjectLiteralExpression(optsArg)) {
|
|
16281
16446
|
const aliasNode = getStringProperty(optsArg, "alias");
|
|
16282
16447
|
if (aliasNode !== null)
|
|
16283
16448
|
bindingName = aliasNode;
|
|
@@ -16289,7 +16454,7 @@ var fail = (reason, detail, location) => ({
|
|
|
16289
16454
|
let hasDecoratorIO = false;
|
|
16290
16455
|
let hasSignalIO = false;
|
|
16291
16456
|
for (const member of cls.members) {
|
|
16292
|
-
if (!
|
|
16457
|
+
if (!ts14.isPropertyDeclaration(member))
|
|
16293
16458
|
continue;
|
|
16294
16459
|
const decoratorIn = extractDecoratorInput(member, compiler);
|
|
16295
16460
|
if (decoratorIn) {
|
|
@@ -16323,21 +16488,21 @@ var fail = (reason, detail, location) => ({
|
|
|
16323
16488
|
specialAttributes: {}
|
|
16324
16489
|
}), parseHostObjectInto = (host, args, hostExprNode, compiler) => {
|
|
16325
16490
|
const hostNode = getProperty(args, "host");
|
|
16326
|
-
if (!hostNode || !
|
|
16491
|
+
if (!hostNode || !ts14.isObjectLiteralExpression(hostNode)) {
|
|
16327
16492
|
if (!hostExprNode)
|
|
16328
16493
|
return;
|
|
16329
16494
|
}
|
|
16330
|
-
const obj = hostNode &&
|
|
16495
|
+
const obj = hostNode && ts14.isObjectLiteralExpression(hostNode) ? hostNode : hostExprNode;
|
|
16331
16496
|
if (!obj)
|
|
16332
16497
|
return;
|
|
16333
16498
|
for (const prop of obj.properties) {
|
|
16334
|
-
if (!
|
|
16499
|
+
if (!ts14.isPropertyAssignment(prop))
|
|
16335
16500
|
continue;
|
|
16336
16501
|
const keyNode = prop.name;
|
|
16337
16502
|
let key;
|
|
16338
|
-
if (
|
|
16503
|
+
if (ts14.isStringLiteral(keyNode) || ts14.isNoSubstitutionTemplateLiteral(keyNode)) {
|
|
16339
16504
|
key = keyNode.text;
|
|
16340
|
-
} else if (
|
|
16505
|
+
} else if (ts14.isIdentifier(keyNode)) {
|
|
16341
16506
|
key = keyNode.text;
|
|
16342
16507
|
} else {
|
|
16343
16508
|
continue;
|
|
@@ -16354,36 +16519,36 @@ var fail = (reason, detail, location) => ({
|
|
|
16354
16519
|
}
|
|
16355
16520
|
}, mergeMemberHostDecorators = (host, cls) => {
|
|
16356
16521
|
for (const member of cls.members) {
|
|
16357
|
-
if (!
|
|
16522
|
+
if (!ts14.canHaveDecorators(member))
|
|
16358
16523
|
continue;
|
|
16359
|
-
const decorators =
|
|
16524
|
+
const decorators = ts14.getDecorators(member) ?? [];
|
|
16360
16525
|
for (const dec of decorators) {
|
|
16361
16526
|
const expr = dec.expression;
|
|
16362
|
-
if (!
|
|
16527
|
+
if (!ts14.isCallExpression(expr))
|
|
16363
16528
|
continue;
|
|
16364
16529
|
const fn2 = expr.expression;
|
|
16365
|
-
if (!
|
|
16530
|
+
if (!ts14.isIdentifier(fn2))
|
|
16366
16531
|
continue;
|
|
16367
16532
|
if (fn2.text === "HostBinding") {
|
|
16368
|
-
if (!
|
|
16533
|
+
if (!ts14.isPropertyDeclaration(member) && !ts14.isGetAccessor(member))
|
|
16369
16534
|
continue;
|
|
16370
16535
|
const propertyName = member.name.text;
|
|
16371
16536
|
const target = expr.arguments[0];
|
|
16372
|
-
const key = target &&
|
|
16537
|
+
const key = target && ts14.isStringLiteral(target) ? target.text : propertyName;
|
|
16373
16538
|
host.properties[key] = propertyName;
|
|
16374
16539
|
} else if (fn2.text === "HostListener") {
|
|
16375
|
-
if (!
|
|
16540
|
+
if (!ts14.isMethodDeclaration(member))
|
|
16376
16541
|
continue;
|
|
16377
16542
|
const methodName = member.name.text;
|
|
16378
16543
|
const eventArg = expr.arguments[0];
|
|
16379
|
-
if (!eventArg || !
|
|
16544
|
+
if (!eventArg || !ts14.isStringLiteral(eventArg))
|
|
16380
16545
|
continue;
|
|
16381
16546
|
const event = eventArg.text;
|
|
16382
16547
|
const argsArg = expr.arguments[1];
|
|
16383
16548
|
let argsList = [];
|
|
16384
|
-
if (argsArg &&
|
|
16549
|
+
if (argsArg && ts14.isArrayLiteralExpression(argsArg)) {
|
|
16385
16550
|
for (const el of argsArg.elements) {
|
|
16386
|
-
if (
|
|
16551
|
+
if (ts14.isStringLiteral(el))
|
|
16387
16552
|
argsList.push(el.text);
|
|
16388
16553
|
}
|
|
16389
16554
|
}
|
|
@@ -16396,14 +16561,14 @@ var fail = (reason, detail, location) => ({
|
|
|
16396
16561
|
let descendants = true;
|
|
16397
16562
|
let emitDistinctChangesOnly = true;
|
|
16398
16563
|
const opts = args[1];
|
|
16399
|
-
if (opts &&
|
|
16564
|
+
if (opts && ts14.isObjectLiteralExpression(opts)) {
|
|
16400
16565
|
static_ = getBooleanProperty(opts, "static") ?? false;
|
|
16401
16566
|
descendants = getBooleanProperty(opts, "descendants") ?? true;
|
|
16402
16567
|
emitDistinctChangesOnly = getBooleanProperty(opts, "emitDistinctChangesOnly") ?? true;
|
|
16403
16568
|
}
|
|
16404
16569
|
return { static_, descendants, emitDistinctChangesOnly };
|
|
16405
16570
|
}, queryPredicateFromArg = (arg, compiler) => {
|
|
16406
|
-
if (
|
|
16571
|
+
if (ts14.isStringLiteral(arg)) {
|
|
16407
16572
|
return arg.text.split(",").map((s2) => s2.trim()).filter(Boolean);
|
|
16408
16573
|
}
|
|
16409
16574
|
return {
|
|
@@ -16414,15 +16579,15 @@ var fail = (reason, detail, location) => ({
|
|
|
16414
16579
|
const contentQueries = [];
|
|
16415
16580
|
const viewQueries = [];
|
|
16416
16581
|
for (const member of cls.members) {
|
|
16417
|
-
if (!
|
|
16582
|
+
if (!ts14.isPropertyDeclaration(member))
|
|
16418
16583
|
continue;
|
|
16419
|
-
const decorators =
|
|
16584
|
+
const decorators = ts14.getDecorators(member) ?? [];
|
|
16420
16585
|
for (const dec of decorators) {
|
|
16421
16586
|
const expr = dec.expression;
|
|
16422
|
-
if (!
|
|
16587
|
+
if (!ts14.isCallExpression(expr))
|
|
16423
16588
|
continue;
|
|
16424
16589
|
const fn2 = expr.expression;
|
|
16425
|
-
if (!
|
|
16590
|
+
if (!ts14.isIdentifier(fn2) || !QUERY_DECORATORS.has(fn2.text))
|
|
16426
16591
|
continue;
|
|
16427
16592
|
const propertyName = member.name.text;
|
|
16428
16593
|
const tokenArg = expr.arguments[0];
|
|
@@ -16434,7 +16599,7 @@ var fail = (reason, detail, location) => ({
|
|
|
16434
16599
|
const { static_, descendants, emitDistinctChangesOnly } = parseQueryDecoratorOptions(expr.arguments);
|
|
16435
16600
|
const opts = expr.arguments[1];
|
|
16436
16601
|
let read = null;
|
|
16437
|
-
if (opts &&
|
|
16602
|
+
if (opts && ts14.isObjectLiteralExpression(opts)) {
|
|
16438
16603
|
const readNode = getProperty(opts, "read");
|
|
16439
16604
|
if (readNode) {
|
|
16440
16605
|
read = new compiler.WrappedNodeExpr(readNode);
|
|
@@ -16462,15 +16627,15 @@ var fail = (reason, detail, location) => ({
|
|
|
16462
16627
|
const contentQueries = [];
|
|
16463
16628
|
const viewQueries = [];
|
|
16464
16629
|
for (const member of cls.members) {
|
|
16465
|
-
if (!
|
|
16630
|
+
if (!ts14.isPropertyDeclaration(member) || !member.initializer)
|
|
16466
16631
|
continue;
|
|
16467
16632
|
let init = member.initializer;
|
|
16468
|
-
if (!
|
|
16633
|
+
if (!ts14.isCallExpression(init))
|
|
16469
16634
|
continue;
|
|
16470
16635
|
let queryName;
|
|
16471
|
-
if (
|
|
16636
|
+
if (ts14.isIdentifier(init.expression)) {
|
|
16472
16637
|
queryName = init.expression.text;
|
|
16473
|
-
} else if (
|
|
16638
|
+
} else if (ts14.isPropertyAccessExpression(init.expression) && ts14.isIdentifier(init.expression.expression) && init.expression.name.text === "required") {
|
|
16474
16639
|
queryName = init.expression.expression.text;
|
|
16475
16640
|
} else {
|
|
16476
16641
|
continue;
|
|
@@ -16488,7 +16653,7 @@ var fail = (reason, detail, location) => ({
|
|
|
16488
16653
|
let descendants = true;
|
|
16489
16654
|
let read = null;
|
|
16490
16655
|
const opts = init.arguments[1];
|
|
16491
|
-
if (opts &&
|
|
16656
|
+
if (opts && ts14.isObjectLiteralExpression(opts)) {
|
|
16492
16657
|
descendants = getBooleanProperty(opts, "descendants") ?? true;
|
|
16493
16658
|
const readNode = getProperty(opts, "read");
|
|
16494
16659
|
if (readNode)
|
|
@@ -16514,13 +16679,13 @@ var fail = (reason, detail, location) => ({
|
|
|
16514
16679
|
const node = getProperty(args, "exportAs");
|
|
16515
16680
|
if (!node)
|
|
16516
16681
|
return null;
|
|
16517
|
-
if (
|
|
16682
|
+
if (ts14.isStringLiteral(node)) {
|
|
16518
16683
|
return node.text.split(",").map((s2) => s2.trim()).filter(Boolean);
|
|
16519
16684
|
}
|
|
16520
|
-
if (
|
|
16685
|
+
if (ts14.isArrayLiteralExpression(node)) {
|
|
16521
16686
|
const out = [];
|
|
16522
16687
|
for (const el of node.elements) {
|
|
16523
|
-
if (
|
|
16688
|
+
if (ts14.isStringLiteral(el))
|
|
16524
16689
|
out.push(el.text);
|
|
16525
16690
|
}
|
|
16526
16691
|
return out.length > 0 ? out : null;
|
|
@@ -16528,11 +16693,11 @@ var fail = (reason, detail, location) => ({
|
|
|
16528
16693
|
return null;
|
|
16529
16694
|
}, extractHostDirectives = (args, compiler) => {
|
|
16530
16695
|
const node = getProperty(args, "hostDirectives");
|
|
16531
|
-
if (!node || !
|
|
16696
|
+
if (!node || !ts14.isArrayLiteralExpression(node))
|
|
16532
16697
|
return null;
|
|
16533
16698
|
const out = [];
|
|
16534
16699
|
for (const el of node.elements) {
|
|
16535
|
-
if (
|
|
16700
|
+
if (ts14.isIdentifier(el)) {
|
|
16536
16701
|
out.push({
|
|
16537
16702
|
directive: {
|
|
16538
16703
|
value: new compiler.WrappedNodeExpr(el),
|
|
@@ -16544,7 +16709,7 @@ var fail = (reason, detail, location) => ({
|
|
|
16544
16709
|
});
|
|
16545
16710
|
continue;
|
|
16546
16711
|
}
|
|
16547
|
-
if (!
|
|
16712
|
+
if (!ts14.isObjectLiteralExpression(el))
|
|
16548
16713
|
continue;
|
|
16549
16714
|
const directiveNode = getProperty(el, "directive");
|
|
16550
16715
|
if (!directiveNode)
|
|
@@ -16552,11 +16717,11 @@ var fail = (reason, detail, location) => ({
|
|
|
16552
16717
|
const inputsNode = getProperty(el, "inputs");
|
|
16553
16718
|
const outputsNode = getProperty(el, "outputs");
|
|
16554
16719
|
const collectMap = (n) => {
|
|
16555
|
-
if (!n || !
|
|
16720
|
+
if (!n || !ts14.isArrayLiteralExpression(n))
|
|
16556
16721
|
return null;
|
|
16557
16722
|
const map = {};
|
|
16558
16723
|
for (const item of n.elements) {
|
|
16559
|
-
if (!
|
|
16724
|
+
if (!ts14.isStringLiteral(item))
|
|
16560
16725
|
continue;
|
|
16561
16726
|
const [name, alias] = item.text.split(":").map((s2) => s2.trim());
|
|
16562
16727
|
if (name)
|
|
@@ -16618,7 +16783,7 @@ var fail = (reason, detail, location) => ({
|
|
|
16618
16783
|
return cached.info;
|
|
16619
16784
|
let source;
|
|
16620
16785
|
try {
|
|
16621
|
-
source =
|
|
16786
|
+
source = readFileSync18(filePath, "utf-8");
|
|
16622
16787
|
} catch {
|
|
16623
16788
|
childComponentInfoCache.set(cacheKey2, {
|
|
16624
16789
|
info: null,
|
|
@@ -16626,10 +16791,10 @@ var fail = (reason, detail, location) => ({
|
|
|
16626
16791
|
});
|
|
16627
16792
|
return null;
|
|
16628
16793
|
}
|
|
16629
|
-
const sf =
|
|
16794
|
+
const sf = ts14.createSourceFile(filePath, source, ts14.ScriptTarget.Latest, true);
|
|
16630
16795
|
let info = null;
|
|
16631
16796
|
for (const stmt of sf.statements) {
|
|
16632
|
-
if (!
|
|
16797
|
+
if (!ts14.isClassDeclaration(stmt))
|
|
16633
16798
|
continue;
|
|
16634
16799
|
if (!stmt.name || stmt.name.text !== className)
|
|
16635
16800
|
continue;
|
|
@@ -16672,7 +16837,7 @@ var fail = (reason, detail, location) => ({
|
|
|
16672
16837
|
return cached.info;
|
|
16673
16838
|
let content;
|
|
16674
16839
|
try {
|
|
16675
|
-
content =
|
|
16840
|
+
content = readFileSync18(dtsPath, "utf-8");
|
|
16676
16841
|
} catch {
|
|
16677
16842
|
childComponentInfoCache.set(cacheKey2, {
|
|
16678
16843
|
info: null,
|
|
@@ -16764,9 +16929,9 @@ var fail = (reason, detail, location) => ({
|
|
|
16764
16929
|
}, buildClassToSpecMap = (sourceFile) => {
|
|
16765
16930
|
const result = new Map;
|
|
16766
16931
|
for (const stmt of sourceFile.statements) {
|
|
16767
|
-
if (!
|
|
16932
|
+
if (!ts14.isImportDeclaration(stmt))
|
|
16768
16933
|
continue;
|
|
16769
|
-
if (!
|
|
16934
|
+
if (!ts14.isStringLiteral(stmt.moduleSpecifier))
|
|
16770
16935
|
continue;
|
|
16771
16936
|
const spec = stmt.moduleSpecifier.text;
|
|
16772
16937
|
const clause = stmt.importClause;
|
|
@@ -16775,7 +16940,7 @@ var fail = (reason, detail, location) => ({
|
|
|
16775
16940
|
if (clause.name)
|
|
16776
16941
|
result.set(clause.name.text, spec);
|
|
16777
16942
|
const named = clause.namedBindings;
|
|
16778
|
-
if (named &&
|
|
16943
|
+
if (named && ts14.isNamedImports(named)) {
|
|
16779
16944
|
for (const el of named.elements) {
|
|
16780
16945
|
if (el.isTypeOnly)
|
|
16781
16946
|
continue;
|
|
@@ -16792,7 +16957,7 @@ var fail = (reason, detail, location) => ({
|
|
|
16792
16957
|
return null;
|
|
16793
16958
|
let content;
|
|
16794
16959
|
try {
|
|
16795
|
-
content =
|
|
16960
|
+
content = readFileSync18(startDtsPath, "utf-8");
|
|
16796
16961
|
} catch {
|
|
16797
16962
|
return null;
|
|
16798
16963
|
}
|
|
@@ -16888,7 +17053,7 @@ var fail = (reason, detail, location) => ({
|
|
|
16888
17053
|
return result;
|
|
16889
17054
|
const classToSpec = buildClassToSpecMap(sourceFile);
|
|
16890
17055
|
for (const el of importsExpr.elements) {
|
|
16891
|
-
if (!
|
|
17056
|
+
if (!ts14.isIdentifier(el))
|
|
16892
17057
|
continue;
|
|
16893
17058
|
const className = el.text;
|
|
16894
17059
|
const spec = classToSpec.get(className);
|
|
@@ -16907,35 +17072,35 @@ var fail = (reason, detail, location) => ({
|
|
|
16907
17072
|
}
|
|
16908
17073
|
return (h2 >>> 0).toString(36);
|
|
16909
17074
|
}, initializerShapeIsStructural = (node) => {
|
|
16910
|
-
if (
|
|
17075
|
+
if (ts14.isArrowFunction(node) || ts14.isFunctionExpression(node) || ts14.isCallExpression(node) || ts14.isNewExpression(node)) {
|
|
16911
17076
|
return true;
|
|
16912
17077
|
}
|
|
16913
|
-
if (
|
|
17078
|
+
if (ts14.isConditionalExpression(node)) {
|
|
16914
17079
|
return initializerShapeIsStructural(node.whenTrue) || initializerShapeIsStructural(node.whenFalse);
|
|
16915
17080
|
}
|
|
16916
|
-
if (
|
|
17081
|
+
if (ts14.isParenthesizedExpression(node)) {
|
|
16917
17082
|
return initializerShapeIsStructural(node.expression);
|
|
16918
17083
|
}
|
|
16919
|
-
if (
|
|
17084
|
+
if (ts14.isAsExpression(node) || ts14.isTypeAssertionExpression(node)) {
|
|
16920
17085
|
return initializerShapeIsStructural(node.expression);
|
|
16921
17086
|
}
|
|
16922
|
-
if (
|
|
17087
|
+
if (ts14.isNonNullExpression(node)) {
|
|
16923
17088
|
return initializerShapeIsStructural(node.expression);
|
|
16924
17089
|
}
|
|
16925
|
-
if (
|
|
17090
|
+
if (ts14.isObjectLiteralExpression(node)) {
|
|
16926
17091
|
for (const prop of node.properties) {
|
|
16927
|
-
if (
|
|
17092
|
+
if (ts14.isPropertyAssignment(prop) && initializerShapeIsStructural(prop.initializer)) {
|
|
16928
17093
|
return true;
|
|
16929
17094
|
}
|
|
16930
|
-
if (
|
|
17095
|
+
if (ts14.isShorthandPropertyAssignment(prop))
|
|
16931
17096
|
continue;
|
|
16932
|
-
if (
|
|
17097
|
+
if (ts14.isSpreadAssignment(prop) && initializerShapeIsStructural(prop.expression)) {
|
|
16933
17098
|
return true;
|
|
16934
17099
|
}
|
|
16935
17100
|
}
|
|
16936
17101
|
return false;
|
|
16937
17102
|
}
|
|
16938
|
-
if (
|
|
17103
|
+
if (ts14.isArrayLiteralExpression(node)) {
|
|
16939
17104
|
for (const el of node.elements) {
|
|
16940
17105
|
if (initializerShapeIsStructural(el))
|
|
16941
17106
|
return true;
|
|
@@ -16946,7 +17111,7 @@ var fail = (reason, detail, location) => ({
|
|
|
16946
17111
|
}, extractArrowFieldSig = (cls) => {
|
|
16947
17112
|
const entries = [];
|
|
16948
17113
|
for (const member of cls.members) {
|
|
16949
|
-
if (!
|
|
17114
|
+
if (!ts14.isPropertyDeclaration(member))
|
|
16950
17115
|
continue;
|
|
16951
17116
|
const init = member.initializer;
|
|
16952
17117
|
if (!init)
|
|
@@ -16956,12 +17121,12 @@ var fail = (reason, detail, location) => ({
|
|
|
16956
17121
|
const name = member.name.getText();
|
|
16957
17122
|
let bodyText;
|
|
16958
17123
|
try {
|
|
16959
|
-
const printer =
|
|
16960
|
-
newLine:
|
|
17124
|
+
const printer = ts14.createPrinter({
|
|
17125
|
+
newLine: ts14.NewLineKind.LineFeed,
|
|
16961
17126
|
omitTrailingSemicolon: true,
|
|
16962
17127
|
removeComments: true
|
|
16963
17128
|
});
|
|
16964
|
-
bodyText = printer.printNode(
|
|
17129
|
+
bodyText = printer.printNode(ts14.EmitHint.Unspecified, init, cls.getSourceFile());
|
|
16965
17130
|
} catch {
|
|
16966
17131
|
bodyText = init.getText();
|
|
16967
17132
|
}
|
|
@@ -16972,9 +17137,9 @@ var fail = (reason, detail, location) => ({
|
|
|
16972
17137
|
}, INPUT_OUTPUT_DECORATORS, extractMemberDecoratorSig = (cls) => {
|
|
16973
17138
|
const entries = [];
|
|
16974
17139
|
for (const member of cls.members) {
|
|
16975
|
-
if (!
|
|
17140
|
+
if (!ts14.canHaveDecorators(member))
|
|
16976
17141
|
continue;
|
|
16977
|
-
const decorators =
|
|
17142
|
+
const decorators = ts14.getDecorators(member) ?? [];
|
|
16978
17143
|
if (decorators.length === 0)
|
|
16979
17144
|
continue;
|
|
16980
17145
|
const memberName = member.name?.getText() ?? "<anon>";
|
|
@@ -16982,14 +17147,14 @@ var fail = (reason, detail, location) => ({
|
|
|
16982
17147
|
const expr = decorator.expression;
|
|
16983
17148
|
let decName = "<unknown>";
|
|
16984
17149
|
let argText = "";
|
|
16985
|
-
if (
|
|
16986
|
-
if (
|
|
17150
|
+
if (ts14.isCallExpression(expr)) {
|
|
17151
|
+
if (ts14.isIdentifier(expr.expression)) {
|
|
16987
17152
|
decName = expr.expression.text;
|
|
16988
17153
|
}
|
|
16989
17154
|
if (expr.arguments.length > 0) {
|
|
16990
17155
|
argText = expr.arguments.map((a) => a.getText()).join(",");
|
|
16991
17156
|
}
|
|
16992
|
-
} else if (
|
|
17157
|
+
} else if (ts14.isIdentifier(expr)) {
|
|
16993
17158
|
decName = expr.text;
|
|
16994
17159
|
}
|
|
16995
17160
|
if (INPUT_OUTPUT_DECORATORS.has(decName))
|
|
@@ -17010,22 +17175,22 @@ var fail = (reason, detail, location) => ({
|
|
|
17010
17175
|
return cached.hasProviders;
|
|
17011
17176
|
let source;
|
|
17012
17177
|
try {
|
|
17013
|
-
source =
|
|
17178
|
+
source = readFileSync18(filePath, "utf8");
|
|
17014
17179
|
} catch {
|
|
17015
17180
|
return true;
|
|
17016
17181
|
}
|
|
17017
|
-
const sf =
|
|
17182
|
+
const sf = ts14.createSourceFile(filePath, source, ts14.ScriptTarget.ES2022, true, ts14.ScriptKind.TS);
|
|
17018
17183
|
let hasProviders = false;
|
|
17019
17184
|
const visit = (node) => {
|
|
17020
17185
|
if (hasProviders)
|
|
17021
17186
|
return;
|
|
17022
|
-
if (
|
|
17023
|
-
for (const decorator of
|
|
17187
|
+
if (ts14.isClassDeclaration(node)) {
|
|
17188
|
+
for (const decorator of ts14.getDecorators(node) ?? []) {
|
|
17024
17189
|
const expr = decorator.expression;
|
|
17025
|
-
if (!
|
|
17190
|
+
if (!ts14.isCallExpression(expr))
|
|
17026
17191
|
continue;
|
|
17027
17192
|
const arg = expr.arguments[0];
|
|
17028
|
-
if (!arg || !
|
|
17193
|
+
if (!arg || !ts14.isObjectLiteralExpression(arg))
|
|
17029
17194
|
continue;
|
|
17030
17195
|
if (getProperty(arg, "providers") !== null) {
|
|
17031
17196
|
hasProviders = true;
|
|
@@ -17033,7 +17198,7 @@ var fail = (reason, detail, location) => ({
|
|
|
17033
17198
|
}
|
|
17034
17199
|
}
|
|
17035
17200
|
}
|
|
17036
|
-
|
|
17201
|
+
ts14.forEachChild(node, visit);
|
|
17037
17202
|
};
|
|
17038
17203
|
visit(sf);
|
|
17039
17204
|
providerProbeCache.set(filePath, {
|
|
@@ -17043,10 +17208,10 @@ var fail = (reason, detail, location) => ({
|
|
|
17043
17208
|
return hasProviders;
|
|
17044
17209
|
}, TS_EXTENSIONS, resolveImportSource = (identifierName, sourceFile, componentDir) => {
|
|
17045
17210
|
for (const stmt of sourceFile.statements) {
|
|
17046
|
-
if (!
|
|
17211
|
+
if (!ts14.isImportDeclaration(stmt))
|
|
17047
17212
|
continue;
|
|
17048
17213
|
const moduleSpec = stmt.moduleSpecifier;
|
|
17049
|
-
if (!
|
|
17214
|
+
if (!ts14.isStringLiteral(moduleSpec))
|
|
17050
17215
|
continue;
|
|
17051
17216
|
const spec = moduleSpec.text;
|
|
17052
17217
|
if (!spec.startsWith(".") && !spec.startsWith("/"))
|
|
@@ -17060,7 +17225,7 @@ var fail = (reason, detail, location) => ({
|
|
|
17060
17225
|
}
|
|
17061
17226
|
if (importClause.namedBindings) {
|
|
17062
17227
|
const nb = importClause.namedBindings;
|
|
17063
|
-
if (
|
|
17228
|
+
if (ts14.isNamespaceImport(nb)) {
|
|
17064
17229
|
if (nb.name.text === identifierName)
|
|
17065
17230
|
matches = true;
|
|
17066
17231
|
} else {
|
|
@@ -17090,7 +17255,7 @@ var fail = (reason, detail, location) => ({
|
|
|
17090
17255
|
return [];
|
|
17091
17256
|
const sig = [];
|
|
17092
17257
|
for (const entry of importsExpr.elements) {
|
|
17093
|
-
if (
|
|
17258
|
+
if (ts14.isIdentifier(entry)) {
|
|
17094
17259
|
const importPath = resolveImportSource(entry.text, sourceFile, componentDir);
|
|
17095
17260
|
if (importPath) {
|
|
17096
17261
|
if (fileHasModuleProviders(importPath)) {
|
|
@@ -17109,13 +17274,13 @@ var fail = (reason, detail, location) => ({
|
|
|
17109
17274
|
}, extractPropertyFieldNames = (cls) => {
|
|
17110
17275
|
const names = [];
|
|
17111
17276
|
for (const member of cls.members) {
|
|
17112
|
-
if (!
|
|
17277
|
+
if (!ts14.isPropertyDeclaration(member) && !ts14.isMethodDeclaration(member) && !ts14.isGetAccessorDeclaration(member) && !ts14.isSetAccessorDeclaration(member)) {
|
|
17113
17278
|
continue;
|
|
17114
17279
|
}
|
|
17115
17280
|
const name = member.name;
|
|
17116
17281
|
if (name === undefined)
|
|
17117
17282
|
continue;
|
|
17118
|
-
const text =
|
|
17283
|
+
const text = ts14.isIdentifier(name) ? name.text : ts14.isStringLiteral(name) || ts14.isNoSubstitutionTemplateLiteral(name) ? name.text : name.getText();
|
|
17119
17284
|
if (text.length > 0)
|
|
17120
17285
|
names.push(text);
|
|
17121
17286
|
}
|
|
@@ -17123,7 +17288,7 @@ var fail = (reason, detail, location) => ({
|
|
|
17123
17288
|
}, extractTopLevelImports = (sourceFile) => {
|
|
17124
17289
|
const names = new Set;
|
|
17125
17290
|
for (const stmt of sourceFile.statements) {
|
|
17126
|
-
if (!
|
|
17291
|
+
if (!ts14.isImportDeclaration(stmt))
|
|
17127
17292
|
continue;
|
|
17128
17293
|
const clause = stmt.importClause;
|
|
17129
17294
|
if (!clause)
|
|
@@ -17135,9 +17300,9 @@ var fail = (reason, detail, location) => ({
|
|
|
17135
17300
|
const bindings = clause.namedBindings;
|
|
17136
17301
|
if (!bindings)
|
|
17137
17302
|
continue;
|
|
17138
|
-
if (
|
|
17303
|
+
if (ts14.isNamespaceImport(bindings)) {
|
|
17139
17304
|
names.add(bindings.name.text);
|
|
17140
|
-
} else if (
|
|
17305
|
+
} else if (ts14.isNamedImports(bindings)) {
|
|
17141
17306
|
for (const el of bindings.elements) {
|
|
17142
17307
|
if (el.isTypeOnly)
|
|
17143
17308
|
continue;
|
|
@@ -17149,18 +17314,18 @@ var fail = (reason, detail, location) => ({
|
|
|
17149
17314
|
}, extractFingerprint = (cls, className, decoratorMeta, inputs, outputs, sourceFile, componentDir) => {
|
|
17150
17315
|
const ctorParamTypes = [];
|
|
17151
17316
|
for (const member of cls.members) {
|
|
17152
|
-
if (!
|
|
17317
|
+
if (!ts14.isConstructorDeclaration(member))
|
|
17153
17318
|
continue;
|
|
17154
17319
|
for (const param of member.parameters) {
|
|
17155
17320
|
const typeText = param.type ? param.type.getText() : "";
|
|
17156
|
-
const decorators =
|
|
17321
|
+
const decorators = ts14.getDecorators(param) ?? [];
|
|
17157
17322
|
const decoratorSig = decorators.length === 0 ? "" : decorators.map((d2) => {
|
|
17158
17323
|
const expr = d2.expression;
|
|
17159
|
-
if (
|
|
17324
|
+
if (ts14.isCallExpression(expr) && ts14.isIdentifier(expr.expression)) {
|
|
17160
17325
|
const args = expr.arguments.map((a) => a.getText()).join(",");
|
|
17161
17326
|
return `@${expr.expression.text}(${args})`;
|
|
17162
17327
|
}
|
|
17163
|
-
if (
|
|
17328
|
+
if (ts14.isIdentifier(expr)) {
|
|
17164
17329
|
return `@${expr.text}`;
|
|
17165
17330
|
}
|
|
17166
17331
|
return "@<unknown>";
|
|
@@ -17176,12 +17341,12 @@ var fail = (reason, detail, location) => ({
|
|
|
17176
17341
|
const providerImportSig = extractProviderImportSig(decoratorMeta.importsExpr, sourceFile, componentDir);
|
|
17177
17342
|
const topLevelImports = extractTopLevelImports(sourceFile);
|
|
17178
17343
|
const propertyFieldNames = extractPropertyFieldNames(cls);
|
|
17179
|
-
const printer =
|
|
17180
|
-
newLine:
|
|
17344
|
+
const printer = ts14.createPrinter({
|
|
17345
|
+
newLine: ts14.NewLineKind.LineFeed,
|
|
17181
17346
|
omitTrailingSemicolon: true,
|
|
17182
17347
|
removeComments: true
|
|
17183
17348
|
});
|
|
17184
|
-
const canonicalText = (node) => printer.printNode(
|
|
17349
|
+
const canonicalText = (node) => printer.printNode(ts14.EmitHint.Unspecified, node, sourceFile);
|
|
17185
17350
|
const importsArraySig = decoratorMeta.importsExpr ? djb2Hash(canonicalText(decoratorMeta.importsExpr)) : "";
|
|
17186
17351
|
const hostDirectivesSig = decoratorMeta.hostDirectivesExpr ? djb2Hash(canonicalText(decoratorMeta.hostDirectivesExpr)) : "";
|
|
17187
17352
|
const animationsArraySig = decoratorMeta.animationsExpr ? djb2Hash(canonicalText(decoratorMeta.animationsExpr)) : "";
|
|
@@ -17194,13 +17359,13 @@ var fail = (reason, detail, location) => ({
|
|
|
17194
17359
|
const PAGE_EXPORT_NAMES = new Set(["providers", "routes"]);
|
|
17195
17360
|
const pageExportEntries = [];
|
|
17196
17361
|
for (const stmt of sourceFile.statements) {
|
|
17197
|
-
if (!
|
|
17362
|
+
if (!ts14.isVariableStatement(stmt))
|
|
17198
17363
|
continue;
|
|
17199
|
-
const isExported = stmt.modifiers?.some((m) => m.kind ===
|
|
17364
|
+
const isExported = stmt.modifiers?.some((m) => m.kind === ts14.SyntaxKind.ExportKeyword);
|
|
17200
17365
|
if (!isExported)
|
|
17201
17366
|
continue;
|
|
17202
17367
|
for (const decl of stmt.declarationList.declarations) {
|
|
17203
|
-
if (!
|
|
17368
|
+
if (!ts14.isIdentifier(decl.name))
|
|
17204
17369
|
continue;
|
|
17205
17370
|
if (!PAGE_EXPORT_NAMES.has(decl.name.text))
|
|
17206
17371
|
continue;
|
|
@@ -17241,35 +17406,35 @@ var fail = (reason, detail, location) => ({
|
|
|
17241
17406
|
}, buildFreshClassMethodsBlock = (classNode, className) => {
|
|
17242
17407
|
const memberSources = [];
|
|
17243
17408
|
let hasStatic = false;
|
|
17244
|
-
const printer =
|
|
17409
|
+
const printer = ts14.createPrinter({ removeComments: true });
|
|
17245
17410
|
for (const member of classNode.members) {
|
|
17246
|
-
if (
|
|
17247
|
-
const modifiers = (
|
|
17248
|
-
const cleaned =
|
|
17249
|
-
memberSources.push(printer.printNode(
|
|
17411
|
+
if (ts14.isPropertyDeclaration(member)) {
|
|
17412
|
+
const modifiers = (ts14.getModifiers(member) ?? []).filter((m) => m.kind !== ts14.SyntaxKind.PrivateKeyword && m.kind !== ts14.SyntaxKind.PublicKeyword && m.kind !== ts14.SyntaxKind.ProtectedKeyword && m.kind !== ts14.SyntaxKind.ReadonlyKeyword && m.kind !== ts14.SyntaxKind.OverrideKeyword);
|
|
17413
|
+
const cleaned = ts14.factory.createPropertyDeclaration(modifiers, member.name, undefined, undefined, member.initializer);
|
|
17414
|
+
memberSources.push(printer.printNode(ts14.EmitHint.Unspecified, cleaned, classNode.getSourceFile()));
|
|
17250
17415
|
continue;
|
|
17251
17416
|
}
|
|
17252
|
-
if (
|
|
17253
|
-
const cleanedParams = member.parameters.map((param) =>
|
|
17254
|
-
const cleaned =
|
|
17255
|
-
memberSources.push(printer.printNode(
|
|
17417
|
+
if (ts14.isConstructorDeclaration(member)) {
|
|
17418
|
+
const cleanedParams = member.parameters.map((param) => ts14.factory.updateParameterDeclaration(param, (ts14.getModifiers(param) ?? []).filter((m) => m.kind !== ts14.SyntaxKind.PrivateKeyword && m.kind !== ts14.SyntaxKind.PublicKeyword && m.kind !== ts14.SyntaxKind.ProtectedKeyword && m.kind !== ts14.SyntaxKind.ReadonlyKeyword && m.kind !== ts14.SyntaxKind.OverrideKeyword), param.dotDotDotToken, param.name, param.questionToken, param.type, param.initializer));
|
|
17419
|
+
const cleaned = ts14.factory.createConstructorDeclaration([], cleanedParams, member.body);
|
|
17420
|
+
memberSources.push(printer.printNode(ts14.EmitHint.Unspecified, cleaned, classNode.getSourceFile()));
|
|
17256
17421
|
continue;
|
|
17257
17422
|
}
|
|
17258
|
-
if (
|
|
17259
|
-
const modifiers =
|
|
17260
|
-
const isStatic = modifiers.some((m) => m.kind ===
|
|
17423
|
+
if (ts14.isMethodDeclaration(member) || ts14.isGetAccessorDeclaration(member) || ts14.isSetAccessorDeclaration(member)) {
|
|
17424
|
+
const modifiers = ts14.getModifiers(member) ?? [];
|
|
17425
|
+
const isStatic = modifiers.some((m) => m.kind === ts14.SyntaxKind.StaticKeyword);
|
|
17261
17426
|
if (isStatic)
|
|
17262
17427
|
hasStatic = true;
|
|
17263
|
-
const cleanedParams = member.parameters.map((param) =>
|
|
17428
|
+
const cleanedParams = member.parameters.map((param) => ts14.factory.updateParameterDeclaration(param, ts14.getModifiers(param) ?? [], param.dotDotDotToken, param.name, param.questionToken, param.type, param.initializer));
|
|
17264
17429
|
let cleaned;
|
|
17265
|
-
if (
|
|
17266
|
-
cleaned =
|
|
17267
|
-
} else if (
|
|
17268
|
-
cleaned =
|
|
17430
|
+
if (ts14.isMethodDeclaration(member)) {
|
|
17431
|
+
cleaned = ts14.factory.createMethodDeclaration(modifiers, member.asteriskToken, member.name, member.questionToken, member.typeParameters, cleanedParams, member.type, member.body);
|
|
17432
|
+
} else if (ts14.isGetAccessorDeclaration(member)) {
|
|
17433
|
+
cleaned = ts14.factory.createGetAccessorDeclaration(modifiers, member.name, cleanedParams, member.type, member.body);
|
|
17269
17434
|
} else {
|
|
17270
|
-
cleaned =
|
|
17435
|
+
cleaned = ts14.factory.createSetAccessorDeclaration(modifiers, member.name, cleanedParams, member.body);
|
|
17271
17436
|
}
|
|
17272
|
-
const printed = printer.printNode(
|
|
17437
|
+
const printed = printer.printNode(ts14.EmitHint.Unspecified, cleaned, classNode.getSourceFile());
|
|
17273
17438
|
memberSources.push(printed);
|
|
17274
17439
|
}
|
|
17275
17440
|
}
|
|
@@ -17281,10 +17446,10 @@ ${memberSources.join(`
|
|
|
17281
17446
|
}`;
|
|
17282
17447
|
let transpiled;
|
|
17283
17448
|
try {
|
|
17284
|
-
transpiled =
|
|
17449
|
+
transpiled = ts14.transpileModule(wrappedSource, {
|
|
17285
17450
|
compilerOptions: {
|
|
17286
|
-
module:
|
|
17287
|
-
target:
|
|
17451
|
+
module: ts14.ModuleKind.ES2022,
|
|
17452
|
+
target: ts14.ScriptTarget.ES2022
|
|
17288
17453
|
},
|
|
17289
17454
|
reportDiagnostics: false
|
|
17290
17455
|
}).outputText;
|
|
@@ -17318,7 +17483,7 @@ ${transpiled}
|
|
|
17318
17483
|
return null;
|
|
17319
17484
|
const ext = extname6(abs).toLowerCase();
|
|
17320
17485
|
if (!STYLE_PREPROCESSED_EXT.has(ext) || ext === ".css") {
|
|
17321
|
-
return
|
|
17486
|
+
return readFileSync18(abs, "utf8");
|
|
17322
17487
|
}
|
|
17323
17488
|
try {
|
|
17324
17489
|
const { compileStyleFileIfNeededSync: compileStyleFileIfNeededSync2 } = (init_stylePreprocessor(), __toCommonJS(exports_stylePreprocessor));
|
|
@@ -17357,8 +17522,8 @@ ${block}
|
|
|
17357
17522
|
const opts = {};
|
|
17358
17523
|
if (existsSync23(tsconfigPath)) {
|
|
17359
17524
|
try {
|
|
17360
|
-
const text =
|
|
17361
|
-
const parsed =
|
|
17525
|
+
const text = readFileSync18(tsconfigPath, "utf8");
|
|
17526
|
+
const parsed = ts14.parseConfigFileTextToJson(tsconfigPath, text);
|
|
17362
17527
|
if (!parsed.error && parsed.config) {
|
|
17363
17528
|
const cfg = parsed.config;
|
|
17364
17529
|
const ang = cfg.angularCompilerOptions ?? {};
|
|
@@ -17391,8 +17556,8 @@ ${block}
|
|
|
17391
17556
|
} catch (err) {
|
|
17392
17557
|
return fail("unexpected-error", `import @angular/compiler: ${err}`);
|
|
17393
17558
|
}
|
|
17394
|
-
const tsSource =
|
|
17395
|
-
const sourceFile =
|
|
17559
|
+
const tsSource = readFileSync18(componentFilePath, "utf8");
|
|
17560
|
+
const sourceFile = ts14.createSourceFile(componentFilePath, tsSource, ts14.ScriptTarget.ES2022, true, ts14.ScriptKind.TS);
|
|
17396
17561
|
const classNode = findClassDeclaration(sourceFile, className);
|
|
17397
17562
|
if (!classNode) {
|
|
17398
17563
|
return fail("class-not-found", `${className} in ${componentFilePath}`);
|
|
@@ -17441,7 +17606,7 @@ ${block}
|
|
|
17441
17606
|
if (!existsSync23(tplAbs)) {
|
|
17442
17607
|
return fail("template-resource-not-found", `Template file not found: ${tplAbs}`, { file: componentFilePath });
|
|
17443
17608
|
}
|
|
17444
|
-
templateText =
|
|
17609
|
+
templateText = readFileSync18(tplAbs, "utf8");
|
|
17445
17610
|
templatePath = tplAbs;
|
|
17446
17611
|
} else {
|
|
17447
17612
|
return fail("unsupported-decorator-args", "missing template/templateUrl");
|
|
@@ -17512,7 +17677,7 @@ ${block}
|
|
|
17512
17677
|
viewQueries: advancedMetadata.viewQueries,
|
|
17513
17678
|
host: advancedMetadata.host,
|
|
17514
17679
|
lifecycle: {
|
|
17515
|
-
usesOnChanges: classNode.members.some((m) =>
|
|
17680
|
+
usesOnChanges: classNode.members.some((m) => ts14.isMethodDeclaration(m) && m.name !== undefined && ts14.isIdentifier(m.name) && m.name.text === "ngOnChanges")
|
|
17516
17681
|
},
|
|
17517
17682
|
inputs,
|
|
17518
17683
|
outputs,
|
|
@@ -17568,15 +17733,15 @@ ${block}
|
|
|
17568
17733
|
}
|
|
17569
17734
|
const importGenerator = createHmrImportGenerator(namespaceMap);
|
|
17570
17735
|
const tsFunctionDecl = translateStatement(sourceFile, callback, importGenerator);
|
|
17571
|
-
const exportedDecl =
|
|
17572
|
-
|
|
17573
|
-
|
|
17736
|
+
const exportedDecl = ts14.factory.updateFunctionDeclaration(tsFunctionDecl, [
|
|
17737
|
+
ts14.factory.createToken(ts14.SyntaxKind.ExportKeyword),
|
|
17738
|
+
ts14.factory.createToken(ts14.SyntaxKind.DefaultKeyword)
|
|
17574
17739
|
], tsFunctionDecl.asteriskToken, tsFunctionDecl.name, tsFunctionDecl.typeParameters, tsFunctionDecl.parameters, tsFunctionDecl.type, tsFunctionDecl.body);
|
|
17575
|
-
const printer =
|
|
17576
|
-
newLine:
|
|
17740
|
+
const printer = ts14.createPrinter({
|
|
17741
|
+
newLine: ts14.NewLineKind.LineFeed,
|
|
17577
17742
|
removeComments: false
|
|
17578
17743
|
});
|
|
17579
|
-
const fnText = printer.printNode(
|
|
17744
|
+
const fnText = printer.printNode(ts14.EmitHint.Unspecified, exportedDecl, sourceFile);
|
|
17580
17745
|
const provisionalMethodsBlock = buildFreshClassMethodsBlock(classNode, className) ?? "";
|
|
17581
17746
|
const referencedNames = new Set;
|
|
17582
17747
|
const identRe = /[A-Za-z_$][A-Za-z0-9_$]*/g;
|
|
@@ -17586,33 +17751,33 @@ ${block}
|
|
|
17586
17751
|
}
|
|
17587
17752
|
const sourceScopeNames = new Set;
|
|
17588
17753
|
for (const stmt of sourceFile.statements) {
|
|
17589
|
-
if (
|
|
17590
|
-
if (!
|
|
17754
|
+
if (ts14.isImportDeclaration(stmt)) {
|
|
17755
|
+
if (!ts14.isStringLiteral(stmt.moduleSpecifier))
|
|
17591
17756
|
continue;
|
|
17592
17757
|
const clause = stmt.importClause;
|
|
17593
17758
|
if (clause?.name)
|
|
17594
17759
|
sourceScopeNames.add(clause.name.text);
|
|
17595
|
-
if (clause?.namedBindings &&
|
|
17760
|
+
if (clause?.namedBindings && ts14.isNamedImports(clause.namedBindings)) {
|
|
17596
17761
|
for (const el of clause.namedBindings.elements) {
|
|
17597
17762
|
if (el.isTypeOnly)
|
|
17598
17763
|
continue;
|
|
17599
17764
|
sourceScopeNames.add(el.name.text);
|
|
17600
17765
|
}
|
|
17601
|
-
} else if (clause?.namedBindings &&
|
|
17766
|
+
} else if (clause?.namedBindings && ts14.isNamespaceImport(clause.namedBindings)) {
|
|
17602
17767
|
sourceScopeNames.add(clause.namedBindings.name.text);
|
|
17603
17768
|
}
|
|
17604
17769
|
continue;
|
|
17605
17770
|
}
|
|
17606
|
-
if (
|
|
17771
|
+
if (ts14.isVariableStatement(stmt) || stmt.kind === ts14.SyntaxKind.VariableStatement) {
|
|
17607
17772
|
const varStmt = stmt;
|
|
17608
17773
|
for (const decl of varStmt.declarationList.declarations) {
|
|
17609
|
-
if (
|
|
17774
|
+
if (ts14.isIdentifier(decl.name)) {
|
|
17610
17775
|
sourceScopeNames.add(decl.name.text);
|
|
17611
17776
|
}
|
|
17612
17777
|
}
|
|
17613
17778
|
continue;
|
|
17614
17779
|
}
|
|
17615
|
-
if (
|
|
17780
|
+
if (ts14.isFunctionDeclaration(stmt) || ts14.isClassDeclaration(stmt)) {
|
|
17616
17781
|
if (stmt.name)
|
|
17617
17782
|
sourceScopeNames.add(stmt.name.text);
|
|
17618
17783
|
}
|
|
@@ -17623,7 +17788,7 @@ ${block}
|
|
|
17623
17788
|
}
|
|
17624
17789
|
const allImportedNames = new Set;
|
|
17625
17790
|
for (const stmt of sourceFile.statements) {
|
|
17626
|
-
if (!
|
|
17791
|
+
if (!ts14.isImportDeclaration(stmt))
|
|
17627
17792
|
continue;
|
|
17628
17793
|
const clause = stmt.importClause;
|
|
17629
17794
|
if (!clause || clause.isTypeOnly)
|
|
@@ -17633,7 +17798,7 @@ ${block}
|
|
|
17633
17798
|
const bindings = clause.namedBindings;
|
|
17634
17799
|
if (!bindings)
|
|
17635
17800
|
continue;
|
|
17636
|
-
if (
|
|
17801
|
+
if (ts14.isNamespaceImport(bindings)) {
|
|
17637
17802
|
allImportedNames.add(bindings.name.text);
|
|
17638
17803
|
} else {
|
|
17639
17804
|
for (const el of bindings.elements) {
|
|
@@ -17645,10 +17810,10 @@ ${block}
|
|
|
17645
17810
|
}
|
|
17646
17811
|
const depsToDestructure = [...sourceScopeNames].filter((n) => referencedNames.has(n) || allImportedNames.has(n));
|
|
17647
17812
|
const tsSourceText = fnText;
|
|
17648
|
-
const transpiled =
|
|
17813
|
+
const transpiled = ts14.transpileModule(tsSourceText, {
|
|
17649
17814
|
compilerOptions: {
|
|
17650
|
-
module:
|
|
17651
|
-
target:
|
|
17815
|
+
module: ts14.ModuleKind.ES2022,
|
|
17816
|
+
target: ts14.ScriptTarget.ES2022
|
|
17652
17817
|
},
|
|
17653
17818
|
fileName: componentFilePath,
|
|
17654
17819
|
reportDiagnostics: false
|
|
@@ -18200,7 +18365,7 @@ __export(exports_compileEmber, {
|
|
|
18200
18365
|
});
|
|
18201
18366
|
import { existsSync as existsSync24 } from "fs";
|
|
18202
18367
|
import { mkdir as mkdir6, rm as rm4 } from "fs/promises";
|
|
18203
|
-
import { basename as basename9, dirname as dirname16, extname as extname7, join as
|
|
18368
|
+
import { basename as basename9, dirname as dirname16, extname as extname7, join as join29, resolve as resolve23 } from "path";
|
|
18204
18369
|
var {build: bunBuild2, Transpiler: Transpiler4, write: write4, file: file3 } = globalThis.Bun;
|
|
18205
18370
|
var cachedPreprocessor = null, getPreprocessor = async () => {
|
|
18206
18371
|
if (cachedPreprocessor)
|
|
@@ -18319,7 +18484,7 @@ export const importSync = (specifier) => {
|
|
|
18319
18484
|
build.onResolve({ filter: /^@(?:ember|glimmer|simple-dom)\// }, (args) => {
|
|
18320
18485
|
if (standalonePackages.has(args.path))
|
|
18321
18486
|
return;
|
|
18322
|
-
const internal =
|
|
18487
|
+
const internal = join29(cwd, "node_modules/ember-source/dist/packages", args.path, "index.js");
|
|
18323
18488
|
if (existsSync24(internal))
|
|
18324
18489
|
return { path: internal };
|
|
18325
18490
|
return;
|
|
@@ -18367,16 +18532,16 @@ export default PageComponent;
|
|
|
18367
18532
|
}
|
|
18368
18533
|
const transpiled = transpiler5.transformSync(preprocessed);
|
|
18369
18534
|
const baseName = basename9(resolvedEntry).replace(/\.(gjs|gts|ts|js)$/, "");
|
|
18370
|
-
const tmpDir =
|
|
18371
|
-
const serverDir =
|
|
18372
|
-
const clientDir =
|
|
18535
|
+
const tmpDir = join29(compiledRoot, "_tmp");
|
|
18536
|
+
const serverDir = join29(compiledRoot, "server");
|
|
18537
|
+
const clientDir = join29(compiledRoot, "client");
|
|
18373
18538
|
await Promise.all([
|
|
18374
18539
|
mkdir6(tmpDir, { recursive: true }),
|
|
18375
18540
|
mkdir6(serverDir, { recursive: true }),
|
|
18376
18541
|
mkdir6(clientDir, { recursive: true })
|
|
18377
18542
|
]);
|
|
18378
|
-
const tmpPagePath = resolve23(
|
|
18379
|
-
const tmpHarnessPath = resolve23(
|
|
18543
|
+
const tmpPagePath = resolve23(join29(tmpDir, `${baseName}.module.js`));
|
|
18544
|
+
const tmpHarnessPath = resolve23(join29(tmpDir, `${baseName}.harness.js`));
|
|
18380
18545
|
await Promise.all([
|
|
18381
18546
|
write4(tmpPagePath, transpiled),
|
|
18382
18547
|
write4(tmpHarnessPath, generateServerHarness(tmpPagePath))
|
|
@@ -18384,7 +18549,7 @@ export default PageComponent;
|
|
|
18384
18549
|
const stagedSourceMap = new Map([
|
|
18385
18550
|
[tmpPagePath, resolvedEntry]
|
|
18386
18551
|
]);
|
|
18387
|
-
const serverPath =
|
|
18552
|
+
const serverPath = join29(serverDir, `${baseName}.js`);
|
|
18388
18553
|
const buildResult = await bunBuild2({
|
|
18389
18554
|
entrypoints: [tmpHarnessPath],
|
|
18390
18555
|
format: "esm",
|
|
@@ -18401,7 +18566,7 @@ export default PageComponent;
|
|
|
18401
18566
|
console.warn(`\u26A0\uFE0F Ember server build for ${baseName} had errors:`, buildResult.logs);
|
|
18402
18567
|
}
|
|
18403
18568
|
await rm4(tmpDir, { force: true, recursive: true });
|
|
18404
|
-
const clientPath =
|
|
18569
|
+
const clientPath = join29(clientDir, `${baseName}.js`);
|
|
18405
18570
|
await write4(clientPath, transpiled);
|
|
18406
18571
|
return { clientPath, serverPath };
|
|
18407
18572
|
}, compileEmber = async (entries, emberDir, cwd = process.cwd(), _hmr = false) => {
|
|
@@ -18429,7 +18594,7 @@ export default PageComponent;
|
|
|
18429
18594
|
preprocessed = rewriteTemplateEvalToScope(result.code);
|
|
18430
18595
|
}
|
|
18431
18596
|
return transpiler5.transformSync(preprocessed);
|
|
18432
|
-
}, clearEmberCompilerCache = () => {}, getEmberCompiledRoot = (_emberDir) => getFrameworkGeneratedDir("ember"), getEmberServerCompiledDir = (emberDir) =>
|
|
18597
|
+
}, clearEmberCompilerCache = () => {}, getEmberCompiledRoot = (_emberDir) => getFrameworkGeneratedDir("ember"), getEmberServerCompiledDir = (emberDir) => join29(getEmberCompiledRoot(emberDir), "server"), getEmberClientCompiledDir = (emberDir) => join29(getEmberCompiledRoot(emberDir), "client");
|
|
18433
18598
|
var init_compileEmber = __esm(() => {
|
|
18434
18599
|
init_generatedDir();
|
|
18435
18600
|
transpiler5 = new Transpiler4({
|
|
@@ -18451,7 +18616,7 @@ __export(exports_buildReactVendor, {
|
|
|
18451
18616
|
buildReactVendor: () => buildReactVendor
|
|
18452
18617
|
});
|
|
18453
18618
|
import { existsSync as existsSync25, mkdirSync as mkdirSync8 } from "fs";
|
|
18454
|
-
import { join as
|
|
18619
|
+
import { join as join30, resolve as resolve24 } from "path";
|
|
18455
18620
|
import { rm as rm5 } from "fs/promises";
|
|
18456
18621
|
var {build: bunBuild3 } = globalThis.Bun;
|
|
18457
18622
|
var resolveJsxDevRuntimeCompatPath = () => {
|
|
@@ -18505,14 +18670,14 @@ var resolveJsxDevRuntimeCompatPath = () => {
|
|
|
18505
18670
|
`)}
|
|
18506
18671
|
`;
|
|
18507
18672
|
}, buildReactVendor = async (buildDir) => {
|
|
18508
|
-
const vendorDir =
|
|
18673
|
+
const vendorDir = join30(buildDir, "react", "vendor");
|
|
18509
18674
|
mkdirSync8(vendorDir, { recursive: true });
|
|
18510
|
-
const tmpDir =
|
|
18675
|
+
const tmpDir = join30(buildDir, "_vendor_tmp");
|
|
18511
18676
|
mkdirSync8(tmpDir, { recursive: true });
|
|
18512
18677
|
const specifiers = resolveVendorSpecifiers();
|
|
18513
18678
|
const entrypoints = await Promise.all(specifiers.map(async (specifier) => {
|
|
18514
18679
|
const safeName = toSafeFileName(specifier);
|
|
18515
|
-
const entryPath =
|
|
18680
|
+
const entryPath = join30(tmpDir, `${safeName}.ts`);
|
|
18516
18681
|
const source = await generateEntrySource(specifier);
|
|
18517
18682
|
await Bun.write(entryPath, source);
|
|
18518
18683
|
return entryPath;
|
|
@@ -18577,7 +18742,7 @@ __export(exports_buildAngularVendor, {
|
|
|
18577
18742
|
buildAngularServerVendor: () => buildAngularServerVendor
|
|
18578
18743
|
});
|
|
18579
18744
|
import { mkdirSync as mkdirSync9 } from "fs";
|
|
18580
|
-
import { join as
|
|
18745
|
+
import { join as join31 } from "path";
|
|
18581
18746
|
import { rm as rm6 } from "fs/promises";
|
|
18582
18747
|
var {build: bunBuild4, Glob: Glob7 } = globalThis.Bun;
|
|
18583
18748
|
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) => {
|
|
@@ -18614,7 +18779,7 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
|
|
|
18614
18779
|
}
|
|
18615
18780
|
return { angular, transitiveRoots };
|
|
18616
18781
|
}, PARTIAL_DECL_MARKERS, containsPartialDeclarations = (source) => PARTIAL_DECL_MARKERS.some((marker) => source.includes(marker)), collectTransitiveAngularSpecs = async (roots, angularFound) => {
|
|
18617
|
-
const { readFileSync:
|
|
18782
|
+
const { readFileSync: readFileSync19 } = await import("fs");
|
|
18618
18783
|
const transpiler6 = new Bun.Transpiler({ loader: "js" });
|
|
18619
18784
|
const visited = new Set;
|
|
18620
18785
|
const frontier = [];
|
|
@@ -18635,7 +18800,7 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
|
|
|
18635
18800
|
}
|
|
18636
18801
|
let content;
|
|
18637
18802
|
try {
|
|
18638
|
-
content =
|
|
18803
|
+
content = readFileSync19(resolved, "utf-8");
|
|
18639
18804
|
} catch {
|
|
18640
18805
|
continue;
|
|
18641
18806
|
}
|
|
@@ -18674,14 +18839,14 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
|
|
|
18674
18839
|
await collectTransitiveAngularSpecs([...angular, ...transitiveRoots], angular);
|
|
18675
18840
|
return Array.from(angular).filter(isResolvable2);
|
|
18676
18841
|
}, buildAngularVendor = async (buildDir, directories = [], linkerJitMode = false, depVendorSpecifiers = []) => {
|
|
18677
|
-
const vendorDir =
|
|
18842
|
+
const vendorDir = join31(buildDir, "angular", "vendor");
|
|
18678
18843
|
mkdirSync9(vendorDir, { recursive: true });
|
|
18679
|
-
const tmpDir =
|
|
18844
|
+
const tmpDir = join31(buildDir, "_angular_vendor_tmp");
|
|
18680
18845
|
mkdirSync9(tmpDir, { recursive: true });
|
|
18681
18846
|
const specifiers = await resolveAngularSpecifiers(directories, linkerJitMode);
|
|
18682
18847
|
const entrypoints = await Promise.all(specifiers.map(async (specifier) => {
|
|
18683
18848
|
const safeName = toSafeFileName2(specifier);
|
|
18684
|
-
const entryPath =
|
|
18849
|
+
const entryPath = join31(tmpDir, `${safeName}.ts`);
|
|
18685
18850
|
await Bun.write(entryPath, await generateVendorEntrySource(specifier));
|
|
18686
18851
|
return entryPath;
|
|
18687
18852
|
}));
|
|
@@ -18712,9 +18877,9 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
|
|
|
18712
18877
|
const specifiers = await resolveAngularSpecifiers(directories, linkerJitMode);
|
|
18713
18878
|
return computeAngularVendorPaths(specifiers);
|
|
18714
18879
|
}, buildAngularServerVendor = async (buildDir, directories = [], linkerJitMode = false) => {
|
|
18715
|
-
const vendorDir =
|
|
18880
|
+
const vendorDir = join31(buildDir, "angular", "vendor", "server");
|
|
18716
18881
|
mkdirSync9(vendorDir, { recursive: true });
|
|
18717
|
-
const tmpDir =
|
|
18882
|
+
const tmpDir = join31(buildDir, "_angular_server_vendor_tmp");
|
|
18718
18883
|
mkdirSync9(tmpDir, { recursive: true });
|
|
18719
18884
|
const browserSpecs = await resolveAngularSpecifiers(directories, linkerJitMode);
|
|
18720
18885
|
const allSpecs = new Set(browserSpecs);
|
|
@@ -18725,7 +18890,7 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
|
|
|
18725
18890
|
const specifiers = Array.from(allSpecs);
|
|
18726
18891
|
const entrypoints = await Promise.all(specifiers.map(async (specifier) => {
|
|
18727
18892
|
const safeName = toSafeFileName2(specifier);
|
|
18728
|
-
const entryPath =
|
|
18893
|
+
const entryPath = join31(tmpDir, `${safeName}.ts`);
|
|
18729
18894
|
await Bun.write(entryPath, await generateVendorEntrySource(specifier));
|
|
18730
18895
|
return entryPath;
|
|
18731
18896
|
}));
|
|
@@ -18747,9 +18912,9 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
|
|
|
18747
18912
|
return specifiers;
|
|
18748
18913
|
}, computeAngularServerVendorPaths = (buildDir, specifiers) => {
|
|
18749
18914
|
const paths = {};
|
|
18750
|
-
const vendorDir =
|
|
18915
|
+
const vendorDir = join31(buildDir, "angular", "vendor", "server");
|
|
18751
18916
|
for (const specifier of specifiers) {
|
|
18752
|
-
paths[specifier] =
|
|
18917
|
+
paths[specifier] = join31(vendorDir, `${toSafeFileName2(specifier)}.js`);
|
|
18753
18918
|
}
|
|
18754
18919
|
return paths;
|
|
18755
18920
|
}, computeAngularServerVendorPathsAsync = async (buildDir, directories = [], linkerJitMode = true) => {
|
|
@@ -18805,17 +18970,17 @@ __export(exports_buildVueVendor, {
|
|
|
18805
18970
|
buildVueVendor: () => buildVueVendor
|
|
18806
18971
|
});
|
|
18807
18972
|
import { mkdirSync as mkdirSync10 } from "fs";
|
|
18808
|
-
import { join as
|
|
18973
|
+
import { join as join32 } from "path";
|
|
18809
18974
|
import { rm as rm7 } from "fs/promises";
|
|
18810
18975
|
var {build: bunBuild5 } = globalThis.Bun;
|
|
18811
18976
|
var vueSpecifiers, toSafeFileName3 = (specifier) => specifier.replace(/\//g, "_"), buildVueVendor = async (buildDir) => {
|
|
18812
|
-
const vendorDir =
|
|
18977
|
+
const vendorDir = join32(buildDir, "vue", "vendor");
|
|
18813
18978
|
mkdirSync10(vendorDir, { recursive: true });
|
|
18814
|
-
const tmpDir =
|
|
18979
|
+
const tmpDir = join32(buildDir, "_vue_vendor_tmp");
|
|
18815
18980
|
mkdirSync10(tmpDir, { recursive: true });
|
|
18816
18981
|
const entrypoints = await Promise.all(vueSpecifiers.map(async (specifier) => {
|
|
18817
18982
|
const safeName = toSafeFileName3(specifier);
|
|
18818
|
-
const entryPath =
|
|
18983
|
+
const entryPath = join32(tmpDir, `${safeName}.ts`);
|
|
18819
18984
|
await Bun.write(entryPath, `export * from '${specifier}';
|
|
18820
18985
|
`);
|
|
18821
18986
|
return entryPath;
|
|
@@ -18840,11 +19005,11 @@ var vueSpecifiers, toSafeFileName3 = (specifier) => specifier.replace(/\//g, "_"
|
|
|
18840
19005
|
console.warn("\u26A0\uFE0F Vue vendor build had errors:", result.logs);
|
|
18841
19006
|
return;
|
|
18842
19007
|
}
|
|
18843
|
-
const { readFileSync:
|
|
18844
|
-
const files =
|
|
19008
|
+
const { readFileSync: readFileSync19, writeFileSync: writeFileSync8, readdirSync: readdirSync5 } = await import("fs");
|
|
19009
|
+
const files = readdirSync5(vendorDir).filter((f2) => f2.endsWith(".js"));
|
|
18845
19010
|
for (const file4 of files) {
|
|
18846
|
-
const filePath =
|
|
18847
|
-
const content =
|
|
19011
|
+
const filePath = join32(vendorDir, file4);
|
|
19012
|
+
const content = readFileSync19(filePath, "utf-8");
|
|
18848
19013
|
if (!content.includes("__VUE_HMR_RUNTIME__"))
|
|
18849
19014
|
continue;
|
|
18850
19015
|
const patched = content.replace(/getGlobalThis\(\)\.__VUE_HMR_RUNTIME__\s*=\s*\{/, "getGlobalThis().__VUE_HMR_RUNTIME__ = getGlobalThis().__VUE_HMR_RUNTIME__ || {");
|
|
@@ -18870,7 +19035,7 @@ __export(exports_buildSvelteVendor, {
|
|
|
18870
19035
|
buildSvelteVendor: () => buildSvelteVendor
|
|
18871
19036
|
});
|
|
18872
19037
|
import { mkdirSync as mkdirSync11 } from "fs";
|
|
18873
|
-
import { join as
|
|
19038
|
+
import { join as join33 } from "path";
|
|
18874
19039
|
import { rm as rm8 } from "fs/promises";
|
|
18875
19040
|
var {build: bunBuild6 } = globalThis.Bun;
|
|
18876
19041
|
var svelteSpecifiers, isResolvable3 = (specifier) => {
|
|
@@ -18884,13 +19049,13 @@ var svelteSpecifiers, isResolvable3 = (specifier) => {
|
|
|
18884
19049
|
const specifiers = resolveVendorSpecifiers2();
|
|
18885
19050
|
if (specifiers.length === 0)
|
|
18886
19051
|
return;
|
|
18887
|
-
const vendorDir =
|
|
19052
|
+
const vendorDir = join33(buildDir, "svelte", "vendor");
|
|
18888
19053
|
mkdirSync11(vendorDir, { recursive: true });
|
|
18889
|
-
const tmpDir =
|
|
19054
|
+
const tmpDir = join33(buildDir, "_svelte_vendor_tmp");
|
|
18890
19055
|
mkdirSync11(tmpDir, { recursive: true });
|
|
18891
19056
|
const entrypoints = await Promise.all(specifiers.map(async (specifier) => {
|
|
18892
19057
|
const safeName = toSafeFileName4(specifier);
|
|
18893
|
-
const entryPath =
|
|
19058
|
+
const entryPath = join33(tmpDir, `${safeName}.ts`);
|
|
18894
19059
|
await Bun.write(entryPath, `export * from '${specifier}';
|
|
18895
19060
|
`);
|
|
18896
19061
|
return entryPath;
|
|
@@ -18940,7 +19105,7 @@ __export(exports_rewriteImportsPlugin, {
|
|
|
18940
19105
|
buildWithImportRewrite: () => buildWithImportRewrite
|
|
18941
19106
|
});
|
|
18942
19107
|
import { readdir as readdir3 } from "fs/promises";
|
|
18943
|
-
import { join as
|
|
19108
|
+
import { join as join34 } from "path";
|
|
18944
19109
|
var escapeRegex2 = (str) => str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), jsRewriteImports = (content, replacements) => {
|
|
18945
19110
|
let result = content;
|
|
18946
19111
|
for (const [specifier, webPath] of replacements) {
|
|
@@ -19069,7 +19234,7 @@ ${content}`;
|
|
|
19069
19234
|
const entries = await readdir3(dir);
|
|
19070
19235
|
for (const entry of entries) {
|
|
19071
19236
|
if (entry.endsWith(".js"))
|
|
19072
|
-
allFiles.push(
|
|
19237
|
+
allFiles.push(join34(dir, entry));
|
|
19073
19238
|
}
|
|
19074
19239
|
} catch {}
|
|
19075
19240
|
}
|
|
@@ -19113,12 +19278,12 @@ import {
|
|
|
19113
19278
|
cpSync,
|
|
19114
19279
|
existsSync as existsSync26,
|
|
19115
19280
|
mkdirSync as mkdirSync12,
|
|
19116
|
-
readFileSync as
|
|
19281
|
+
readFileSync as readFileSync19,
|
|
19117
19282
|
rmSync as rmSync2,
|
|
19118
19283
|
statSync as statSync3,
|
|
19119
19284
|
writeFileSync as writeFileSync8
|
|
19120
19285
|
} from "fs";
|
|
19121
|
-
import { basename as basename10, dirname as dirname17, extname as extname8, join as
|
|
19286
|
+
import { basename as basename10, dirname as dirname17, extname as extname8, join as join35, relative as relative13, resolve as resolve25 } from "path";
|
|
19122
19287
|
import { cwd, env as env2, exit } from "process";
|
|
19123
19288
|
var {build: bunBuild7, Glob: Glob8 } = globalThis.Bun;
|
|
19124
19289
|
var isDev, isBuildTraceEnabled = () => {
|
|
@@ -19196,8 +19361,8 @@ var isDev, isBuildTraceEnabled = () => {
|
|
|
19196
19361
|
mkdirSync12(htmxDestDir, { recursive: true });
|
|
19197
19362
|
const glob = new Glob8("htmx*.min.js");
|
|
19198
19363
|
for (const relPath of glob.scanSync({ cwd: htmxDir })) {
|
|
19199
|
-
const src =
|
|
19200
|
-
const dest =
|
|
19364
|
+
const src = join35(htmxDir, relPath);
|
|
19365
|
+
const dest = join35(htmxDestDir, "htmx.min.js");
|
|
19201
19366
|
copyFileSync2(src, dest);
|
|
19202
19367
|
return;
|
|
19203
19368
|
}
|
|
@@ -19225,7 +19390,7 @@ var isDev, isBuildTraceEnabled = () => {
|
|
|
19225
19390
|
globalThis.__absoluteVersion = pkg.version;
|
|
19226
19391
|
};
|
|
19227
19392
|
await resolveCandidate(candidates);
|
|
19228
|
-
},
|
|
19393
|
+
}, SKIP_DIRS5, addWorkerPathIfExists = (file4, relPath, workerPaths) => {
|
|
19229
19394
|
const absPath = resolve25(file4, "..", relPath);
|
|
19230
19395
|
try {
|
|
19231
19396
|
statSync3(absPath);
|
|
@@ -19241,7 +19406,7 @@ var isDev, isBuildTraceEnabled = () => {
|
|
|
19241
19406
|
addWorkerPathIfExists(file4, relPath, workerPaths);
|
|
19242
19407
|
}
|
|
19243
19408
|
}, collectWorkerPathsFromFile = (file4, patterns, workerPaths) => {
|
|
19244
|
-
const content =
|
|
19409
|
+
const content = readFileSync19(file4, "utf-8");
|
|
19245
19410
|
for (const pattern of patterns) {
|
|
19246
19411
|
collectWorkerPathsFromContent(content, pattern, file4, workerPaths);
|
|
19247
19412
|
}
|
|
@@ -19250,7 +19415,7 @@ var isDev, isBuildTraceEnabled = () => {
|
|
|
19250
19415
|
for await (const file4 of glob.scan({ absolute: true, cwd: dir })) {
|
|
19251
19416
|
const relToDir = file4.slice(dir.length + 1);
|
|
19252
19417
|
const [firstSegment] = relToDir.split("/");
|
|
19253
|
-
if (firstSegment &&
|
|
19418
|
+
if (firstSegment && SKIP_DIRS5.has(firstSegment))
|
|
19254
19419
|
continue;
|
|
19255
19420
|
collectWorkerPathsFromFile(file4, patterns, workerPaths);
|
|
19256
19421
|
}
|
|
@@ -19272,7 +19437,7 @@ var isDev, isBuildTraceEnabled = () => {
|
|
|
19272
19437
|
vuePagesPath
|
|
19273
19438
|
}) => {
|
|
19274
19439
|
const { readdirSync: readDir } = await import("fs");
|
|
19275
|
-
const devIndexDir =
|
|
19440
|
+
const devIndexDir = join35(buildPath, "_src_indexes");
|
|
19276
19441
|
mkdirSync12(devIndexDir, { recursive: true });
|
|
19277
19442
|
if (reactIndexesPath && reactPagesPath) {
|
|
19278
19443
|
copyReactDevIndexes(reactIndexesPath, reactPagesPath, devIndexDir, readDir);
|
|
@@ -19290,35 +19455,35 @@ var isDev, isBuildTraceEnabled = () => {
|
|
|
19290
19455
|
const indexFiles = readDir(reactIndexesPath).filter((file4) => file4.endsWith(".tsx"));
|
|
19291
19456
|
const pagesRel = relative13(process.cwd(), resolve25(reactPagesPath)).replace(/\\/g, "/");
|
|
19292
19457
|
for (const file4 of indexFiles) {
|
|
19293
|
-
let content =
|
|
19458
|
+
let content = readFileSync19(join35(reactIndexesPath, file4), "utf-8");
|
|
19294
19459
|
content = content.replace(/from\s*['"]([^'"]*\/pages\/([^'"]+))['"]/g, (_match, _fullPath, componentName) => `from '/@src/${pagesRel}/${componentName}'`);
|
|
19295
|
-
writeFileSync8(
|
|
19460
|
+
writeFileSync8(join35(devIndexDir, file4), content);
|
|
19296
19461
|
}
|
|
19297
19462
|
}, copySvelteDevIndexes = (svelteDir, sveltePagesPath, svelteEntries, devIndexDir) => {
|
|
19298
|
-
const svelteIndexDir =
|
|
19463
|
+
const svelteIndexDir = join35(getFrameworkGeneratedDir("svelte"), "indexes");
|
|
19299
19464
|
const sveltePageEntries = svelteEntries.filter((file4) => resolve25(file4).startsWith(resolve25(sveltePagesPath)));
|
|
19300
19465
|
for (const entry of sveltePageEntries) {
|
|
19301
19466
|
const name = basename10(entry).replace(/\.svelte(\.(ts|js))?$/, "");
|
|
19302
|
-
const indexFile =
|
|
19467
|
+
const indexFile = join35(svelteIndexDir, "pages", `${name}.js`);
|
|
19303
19468
|
if (!existsSync26(indexFile))
|
|
19304
19469
|
continue;
|
|
19305
|
-
let content =
|
|
19470
|
+
let content = readFileSync19(indexFile, "utf-8");
|
|
19306
19471
|
const srcRel = relative13(process.cwd(), resolve25(entry)).replace(/\\/g, "/");
|
|
19307
19472
|
content = content.replace(/import\s+Component\s+from\s+['"]([^'"]+)['"]/, `import Component from "/@src/${srcRel}"`);
|
|
19308
|
-
writeFileSync8(
|
|
19473
|
+
writeFileSync8(join35(devIndexDir, `${name}.svelte.js`), content);
|
|
19309
19474
|
}
|
|
19310
19475
|
}, copyVueDevIndexes = (vueDir, vuePagesPath, vueEntries, devIndexDir) => {
|
|
19311
|
-
const vueIndexDir =
|
|
19476
|
+
const vueIndexDir = join35(getFrameworkGeneratedDir("vue"), "indexes");
|
|
19312
19477
|
const vuePageEntries = vueEntries.filter((file4) => resolve25(file4).startsWith(resolve25(vuePagesPath)));
|
|
19313
19478
|
for (const entry of vuePageEntries) {
|
|
19314
19479
|
const name = basename10(entry, ".vue");
|
|
19315
|
-
const indexFile =
|
|
19480
|
+
const indexFile = join35(vueIndexDir, `${name}.js`);
|
|
19316
19481
|
if (!existsSync26(indexFile))
|
|
19317
19482
|
continue;
|
|
19318
|
-
let content =
|
|
19483
|
+
let content = readFileSync19(indexFile, "utf-8");
|
|
19319
19484
|
const srcRel = relative13(process.cwd(), resolve25(entry)).replace(/\\/g, "/");
|
|
19320
19485
|
content = content.replace(/import\s+Comp(?:\s*,\s*\*\s+as\s+\w+)?\s+from\s+['"]([^'"]+)['"]/, (match) => match.replace(/from\s+['"][^'"]+['"]/, `from "/@src/${srcRel}"`));
|
|
19321
|
-
writeFileSync8(
|
|
19486
|
+
writeFileSync8(join35(devIndexDir, `${name}.vue.js`), content);
|
|
19322
19487
|
}
|
|
19323
19488
|
}, resolveVueRuntimeId = (content, firstUseName, outputPath, projectRoot) => {
|
|
19324
19489
|
const varIdx = content.indexOf(`var ${firstUseName} =`);
|
|
@@ -19366,7 +19531,7 @@ var isDev, isBuildTraceEnabled = () => {
|
|
|
19366
19531
|
}
|
|
19367
19532
|
return result;
|
|
19368
19533
|
}, VUE_HMR_RUNTIME, injectVueComposableTracking = (outputPath, projectRoot) => {
|
|
19369
|
-
let content =
|
|
19534
|
+
let content = readFileSync19(outputPath, "utf-8");
|
|
19370
19535
|
const usePattern = /^var\s+(use[A-Z]\w*)\s*=/gm;
|
|
19371
19536
|
const useNames = [];
|
|
19372
19537
|
let match;
|
|
@@ -19416,7 +19581,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
19416
19581
|
}, rewriteUrlReferences = (outputPaths, urlFileMap) => {
|
|
19417
19582
|
const urlPattern = /new\s+URL\(\s*["'](\.\.?\/[^"']+)["']\s*,\s*import\.meta\.url\s*\)/g;
|
|
19418
19583
|
for (const outputPath of outputPaths) {
|
|
19419
|
-
let content =
|
|
19584
|
+
let content = readFileSync19(outputPath, "utf-8");
|
|
19420
19585
|
let changed = false;
|
|
19421
19586
|
content = content.replace(urlPattern, (_match, relPath) => {
|
|
19422
19587
|
const targetName = basename10(relPath);
|
|
@@ -19541,10 +19706,10 @@ ${content.slice(firstUseIdx)}`;
|
|
|
19541
19706
|
restoreTracePhase();
|
|
19542
19707
|
return;
|
|
19543
19708
|
}
|
|
19544
|
-
const traceDir =
|
|
19709
|
+
const traceDir = join35(buildPath2, ".absolute-trace");
|
|
19545
19710
|
const timestamp = new Date().toISOString().replace(/[:.]/g, "-");
|
|
19546
19711
|
mkdirSync12(traceDir, { recursive: true });
|
|
19547
|
-
writeFileSync8(
|
|
19712
|
+
writeFileSync8(join35(traceDir, `build-trace-${timestamp}.json`), JSON.stringify({
|
|
19548
19713
|
events: traceEvents,
|
|
19549
19714
|
frameworks: traceFrameworkNames,
|
|
19550
19715
|
generatedAt: new Date().toISOString(),
|
|
@@ -19575,15 +19740,15 @@ ${content.slice(firstUseIdx)}`;
|
|
|
19575
19740
|
const stylesPath = typeof stylesConfig === "string" ? stylesConfig : stylesConfig?.path;
|
|
19576
19741
|
const stylesIgnore = typeof stylesConfig === "object" ? stylesConfig.ignore : undefined;
|
|
19577
19742
|
const stylesDir = stylesPath && validateSafePath(stylesPath, projectRoot);
|
|
19578
|
-
const reactIndexesPath = reactDir &&
|
|
19579
|
-
const reactPagesPath = reactDir &&
|
|
19580
|
-
const htmlPagesPath = htmlDir &&
|
|
19581
|
-
const htmlScriptsPath = htmlDir &&
|
|
19582
|
-
const sveltePagesPath = svelteDir &&
|
|
19583
|
-
const vuePagesPath = vueDir &&
|
|
19584
|
-
const htmxPagesPath = htmxDir &&
|
|
19585
|
-
const angularPagesPath = angularDir &&
|
|
19586
|
-
const emberPagesPath = emberDir &&
|
|
19743
|
+
const reactIndexesPath = reactDir && join35(getFrameworkGeneratedDir("react"), "indexes");
|
|
19744
|
+
const reactPagesPath = reactDir && join35(reactDir, "pages");
|
|
19745
|
+
const htmlPagesPath = htmlDir && join35(htmlDir, "pages");
|
|
19746
|
+
const htmlScriptsPath = htmlDir && join35(htmlDir, "scripts");
|
|
19747
|
+
const sveltePagesPath = svelteDir && join35(svelteDir, "pages");
|
|
19748
|
+
const vuePagesPath = vueDir && join35(vueDir, "pages");
|
|
19749
|
+
const htmxPagesPath = htmxDir && join35(htmxDir, "pages");
|
|
19750
|
+
const angularPagesPath = angularDir && join35(angularDir, "pages");
|
|
19751
|
+
const emberPagesPath = emberDir && join35(emberDir, "pages");
|
|
19587
19752
|
const frontends = [
|
|
19588
19753
|
reactDir,
|
|
19589
19754
|
htmlDir,
|
|
@@ -19642,8 +19807,8 @@ ${content.slice(firstUseIdx)}`;
|
|
|
19642
19807
|
const [firstEntry] = serverDirMap;
|
|
19643
19808
|
if (!firstEntry)
|
|
19644
19809
|
throw new Error("Expected at least one server directory entry");
|
|
19645
|
-
serverRoot =
|
|
19646
|
-
serverOutDir =
|
|
19810
|
+
serverRoot = join35(firstEntry.dir, firstEntry.subdir);
|
|
19811
|
+
serverOutDir = join35(buildPath, basename10(firstEntry.dir));
|
|
19647
19812
|
} else if (serverDirMap.length > 1) {
|
|
19648
19813
|
serverRoot = commonAncestor(serverDirMap.map((entry) => entry.dir), projectRoot);
|
|
19649
19814
|
serverOutDir = buildPath;
|
|
@@ -19671,7 +19836,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
19671
19836
|
await tracePhase("react/index-generation", () => generateReactIndexFiles(reactPagesPath, reactIndexesPath, hmr));
|
|
19672
19837
|
}
|
|
19673
19838
|
if (assetsPath && (!isIncremental || normalizedIncrementalFiles?.some((f2) => f2.includes("/assets/")))) {
|
|
19674
|
-
await tracePhase("assets/copy", () => cpSync(assetsPath,
|
|
19839
|
+
await tracePhase("assets/copy", () => cpSync(assetsPath, join35(buildPath, "assets"), {
|
|
19675
19840
|
force: true,
|
|
19676
19841
|
recursive: true
|
|
19677
19842
|
}));
|
|
@@ -19781,11 +19946,11 @@ ${content.slice(firstUseIdx)}`;
|
|
|
19781
19946
|
}
|
|
19782
19947
|
}
|
|
19783
19948
|
if (htmlDefaults.error || htmlDefaults.notFound || htmlDefaults.loading || Object.keys(htmlPages).length > 0) {
|
|
19784
|
-
const htmlConventionsOutDir =
|
|
19949
|
+
const htmlConventionsOutDir = join35(buildPath, "conventions", "html");
|
|
19785
19950
|
mkdirSync12(htmlConventionsOutDir, { recursive: true });
|
|
19786
19951
|
const htmlPathRemap = new Map;
|
|
19787
19952
|
for (const sourcePath of htmlConventionSources) {
|
|
19788
|
-
const dest =
|
|
19953
|
+
const dest = join35(htmlConventionsOutDir, basename10(sourcePath));
|
|
19789
19954
|
cpSync(sourcePath, dest, { force: true });
|
|
19790
19955
|
htmlPathRemap.set(sourcePath, dest);
|
|
19791
19956
|
}
|
|
@@ -19828,7 +19993,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
19828
19993
|
const reactEntries = isIncremental && reactIndexesPath && reactPagesPath ? filterToIncrementalEntries(allReactEntries, (entry) => {
|
|
19829
19994
|
if (entry.startsWith(resolve25(reactIndexesPath))) {
|
|
19830
19995
|
const pageName = basename10(entry, ".tsx");
|
|
19831
|
-
return
|
|
19996
|
+
return join35(reactPagesPath, `${pageName}.tsx`);
|
|
19832
19997
|
}
|
|
19833
19998
|
return null;
|
|
19834
19999
|
}) : allReactEntries;
|
|
@@ -19851,6 +20016,20 @@ ${content.slice(firstUseIdx)}`;
|
|
|
19851
20016
|
const shouldCompileSvelte = svelteDir && svelteEntries.length > 0;
|
|
19852
20017
|
const shouldCompileVue = vueDir && vueEntries.length > 0;
|
|
19853
20018
|
const shouldCompileAngular = angularDir && angularEntries.length > 0;
|
|
20019
|
+
const ssrOnlyVueEntries = shouldCompileVue ? await tracePhase("scan/vue-ssr-only", async () => {
|
|
20020
|
+
const { scanVueSsrOnlyPages: scanVueSsrOnlyPages2 } = await Promise.resolve().then(() => (init_scanVueSsrOnlyPages(), exports_scanVueSsrOnlyPages));
|
|
20021
|
+
const ssrOnlyPageNames = scanVueSsrOnlyPages2(projectRoot);
|
|
20022
|
+
if (ssrOnlyPageNames.size === 0)
|
|
20023
|
+
return new Set;
|
|
20024
|
+
const resolved = new Set;
|
|
20025
|
+
for (const entry of vueEntries) {
|
|
20026
|
+
const name = basename10(entry, ".vue");
|
|
20027
|
+
if (ssrOnlyPageNames.has(name)) {
|
|
20028
|
+
resolved.add(resolve25(entry));
|
|
20029
|
+
}
|
|
20030
|
+
}
|
|
20031
|
+
return resolved;
|
|
20032
|
+
}) : new Set;
|
|
19854
20033
|
const shouldCompileEmber = emberDir && emberEntries.length > 0;
|
|
19855
20034
|
const emptyStringArray = [];
|
|
19856
20035
|
const islandBuildInfo = islandRegistryPath ? await tracePhase("islands/registry", () => loadIslandRegistryBuildInfo(islandRegistryPath)) : null;
|
|
@@ -19913,7 +20092,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
19913
20092
|
svelteIndexPaths: [...emptyStringArray],
|
|
19914
20093
|
svelteServerPaths: [...emptyStringArray]
|
|
19915
20094
|
},
|
|
19916
|
-
shouldCompileVue ? tracePhase("compile/vue", () => Promise.resolve().then(() => (init_compileVue(), exports_compileVue)).then((mod) => mod.compileVue(vueEntries, vueDir, hmr, styleTransformConfig))) : {
|
|
20095
|
+
shouldCompileVue ? tracePhase("compile/vue", () => Promise.resolve().then(() => (init_compileVue(), exports_compileVue)).then((mod) => mod.compileVue(vueEntries, vueDir, hmr, styleTransformConfig, ssrOnlyVueEntries))) : {
|
|
19917
20096
|
vueClientPaths: [...emptyStringArray],
|
|
19918
20097
|
vueCssPaths: [...emptyStringArray],
|
|
19919
20098
|
vueIndexPaths: [...emptyStringArray],
|
|
@@ -19931,14 +20110,14 @@ ${content.slice(firstUseIdx)}`;
|
|
|
19931
20110
|
try {
|
|
19932
20111
|
const { primeComponentFingerprint: primeComponentFingerprint2 } = await Promise.resolve().then(() => (init_fastHmrCompiler(), exports_fastHmrCompiler));
|
|
19933
20112
|
const { readdir: readdir4 } = await import("fs/promises");
|
|
19934
|
-
const { join:
|
|
20113
|
+
const { join: join36 } = await import("path");
|
|
19935
20114
|
const walk = async (dir) => {
|
|
19936
20115
|
const entries = await readdir4(dir, {
|
|
19937
20116
|
withFileTypes: true
|
|
19938
20117
|
});
|
|
19939
20118
|
const out = [];
|
|
19940
20119
|
for (const entry of entries) {
|
|
19941
|
-
const full =
|
|
20120
|
+
const full = join36(dir, entry.name);
|
|
19942
20121
|
if (entry.isDirectory()) {
|
|
19943
20122
|
out.push(...await walk(full));
|
|
19944
20123
|
} else if (entry.isFile() && entry.name.endsWith(".ts") && !entry.name.endsWith(".d.ts")) {
|
|
@@ -20003,7 +20182,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
20003
20182
|
const compileReactConventions = async () => {
|
|
20004
20183
|
if (reactConventionSources.length === 0)
|
|
20005
20184
|
return emptyStringArray;
|
|
20006
|
-
const destDir =
|
|
20185
|
+
const destDir = join35(buildPath, "conventions", "react");
|
|
20007
20186
|
rmSync2(destDir, { force: true, recursive: true });
|
|
20008
20187
|
mkdirSync12(destDir, { recursive: true });
|
|
20009
20188
|
const destPaths = [];
|
|
@@ -20047,7 +20226,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
20047
20226
|
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 }
|
|
20048
20227
|
]);
|
|
20049
20228
|
const bundleConventionFiles = async (framework, compiledPaths) => {
|
|
20050
|
-
const destDir =
|
|
20229
|
+
const destDir = join35(buildPath, "conventions", framework);
|
|
20051
20230
|
rmSync2(destDir, { force: true, recursive: true });
|
|
20052
20231
|
mkdirSync12(destDir, { recursive: true });
|
|
20053
20232
|
const destPaths = [];
|
|
@@ -20121,7 +20300,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
20121
20300
|
}
|
|
20122
20301
|
})) : {
|
|
20123
20302
|
entries: [],
|
|
20124
|
-
generatedRoot:
|
|
20303
|
+
generatedRoot: join35(buildPath, "_island_entries")
|
|
20125
20304
|
};
|
|
20126
20305
|
const islandClientEntryPoints = islandEntryResult.entries.map((entry) => entry.entryPath);
|
|
20127
20306
|
if (serverEntryPoints.length === 0 && reactClientEntryPoints.length === 0 && nonReactClientEntryPoints.length === 0 && islandClientEntryPoints.length === 0 && htmxDir === undefined && htmlDir === undefined) {
|
|
@@ -20157,7 +20336,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
20157
20336
|
return {};
|
|
20158
20337
|
}
|
|
20159
20338
|
if (hmr && reactIndexesPath && reactClientEntryPoints.length > 0) {
|
|
20160
|
-
const refreshEntry =
|
|
20339
|
+
const refreshEntry = join35(reactIndexesPath, "_refresh.tsx");
|
|
20161
20340
|
if (!reactClientEntryPoints.includes(refreshEntry))
|
|
20162
20341
|
reactClientEntryPoints.push(refreshEntry);
|
|
20163
20342
|
}
|
|
@@ -20259,19 +20438,19 @@ ${content.slice(firstUseIdx)}`;
|
|
|
20259
20438
|
throw: false
|
|
20260
20439
|
}, resolveBunBuildOverride(bunBuildConfig, "reactClient")) : undefined;
|
|
20261
20440
|
if (reactDir && reactClientEntryPoints.length > 0) {
|
|
20262
|
-
rmSync2(
|
|
20441
|
+
rmSync2(join35(buildPath, "react", "generated", "indexes"), {
|
|
20263
20442
|
force: true,
|
|
20264
20443
|
recursive: true
|
|
20265
20444
|
});
|
|
20266
20445
|
}
|
|
20267
20446
|
if (angularDir && angularClientPaths.length > 0) {
|
|
20268
|
-
rmSync2(
|
|
20447
|
+
rmSync2(join35(buildPath, "angular", "indexes"), {
|
|
20269
20448
|
force: true,
|
|
20270
20449
|
recursive: true
|
|
20271
20450
|
});
|
|
20272
20451
|
}
|
|
20273
20452
|
if (islandClientEntryPoints.length > 0) {
|
|
20274
|
-
rmSync2(
|
|
20453
|
+
rmSync2(join35(buildPath, "islands"), {
|
|
20275
20454
|
force: true,
|
|
20276
20455
|
recursive: true
|
|
20277
20456
|
});
|
|
@@ -20360,7 +20539,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
20360
20539
|
globalCssEntries.length > 0 ? tracePhase("bun/global-css", () => bunBuild7(mergeBunBuildConfig({
|
|
20361
20540
|
entrypoints: globalCssEntries,
|
|
20362
20541
|
naming: `[dir]/[name].[hash].[ext]`,
|
|
20363
|
-
outdir: stylesDir ?
|
|
20542
|
+
outdir: stylesDir ? join35(buildPath, basename10(stylesDir)) : buildPath,
|
|
20364
20543
|
plugins: [stylePreprocessorPlugin2],
|
|
20365
20544
|
root: stylesDir || clientRoot,
|
|
20366
20545
|
target: "browser",
|
|
@@ -20369,7 +20548,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
20369
20548
|
vueCssPaths.length > 0 ? tracePhase("bun/vue-css", () => bunBuild7(mergeBunBuildConfig({
|
|
20370
20549
|
entrypoints: vueCssPaths,
|
|
20371
20550
|
naming: `[name].[hash].[ext]`,
|
|
20372
|
-
outdir:
|
|
20551
|
+
outdir: join35(buildPath, assetsPath ? basename10(assetsPath) : "assets", "css"),
|
|
20373
20552
|
target: "browser",
|
|
20374
20553
|
throw: false
|
|
20375
20554
|
}, resolveBunBuildOverride(bunBuildConfig, "vueCss")))) : undefined
|
|
@@ -20529,7 +20708,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
20529
20708
|
const injectHMRIntoHTMLFile = (filePath, framework) => {
|
|
20530
20709
|
if (!hmrClientBundle)
|
|
20531
20710
|
return;
|
|
20532
|
-
let html =
|
|
20711
|
+
let html = readFileSync19(filePath, "utf-8");
|
|
20533
20712
|
if (html.includes("data-hmr-client"))
|
|
20534
20713
|
return;
|
|
20535
20714
|
const tag = `<script>window.__HMR_FRAMEWORK__="${framework}";</script><script data-hmr-client>${hmrClientBundle}</script>`;
|
|
@@ -20540,7 +20719,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
20540
20719
|
const processHtmlPages = async () => {
|
|
20541
20720
|
if (!(htmlDir && htmlPagesPath))
|
|
20542
20721
|
return;
|
|
20543
|
-
const outputHtmlPages = isSingle ?
|
|
20722
|
+
const outputHtmlPages = isSingle ? join35(buildPath, "pages") : join35(buildPath, basename10(htmlDir), "pages");
|
|
20544
20723
|
mkdirSync12(outputHtmlPages, { recursive: true });
|
|
20545
20724
|
cpSync(htmlPagesPath, outputHtmlPages, {
|
|
20546
20725
|
force: true,
|
|
@@ -20565,14 +20744,14 @@ ${content.slice(firstUseIdx)}`;
|
|
|
20565
20744
|
const processHtmxPages = async () => {
|
|
20566
20745
|
if (!(htmxDir && htmxPagesPath))
|
|
20567
20746
|
return;
|
|
20568
|
-
const outputHtmxPages = isSingle ?
|
|
20747
|
+
const outputHtmxPages = isSingle ? join35(buildPath, "pages") : join35(buildPath, basename10(htmxDir), "pages");
|
|
20569
20748
|
mkdirSync12(outputHtmxPages, { recursive: true });
|
|
20570
20749
|
cpSync(htmxPagesPath, outputHtmxPages, {
|
|
20571
20750
|
force: true,
|
|
20572
20751
|
recursive: true
|
|
20573
20752
|
});
|
|
20574
20753
|
if (shouldCopyHtmx) {
|
|
20575
|
-
const htmxDestDir = isSingle ? buildPath :
|
|
20754
|
+
const htmxDestDir = isSingle ? buildPath : join35(buildPath, basename10(htmxDir));
|
|
20576
20755
|
copyHtmxVendor(htmxDir, htmxDestDir);
|
|
20577
20756
|
}
|
|
20578
20757
|
if (shouldUpdateHtmxAssetPaths) {
|
|
@@ -20637,9 +20816,9 @@ ${content.slice(firstUseIdx)}`;
|
|
|
20637
20816
|
writeBuildTrace(buildPath);
|
|
20638
20817
|
return { conventions: conventionsMap, manifest };
|
|
20639
20818
|
}
|
|
20640
|
-
writeFileSync8(
|
|
20819
|
+
writeFileSync8(join35(buildPath, "manifest.json"), JSON.stringify(manifest, null, "\t"));
|
|
20641
20820
|
if (Object.keys(conventionsMap).length > 0) {
|
|
20642
|
-
writeFileSync8(
|
|
20821
|
+
writeFileSync8(join35(buildPath, "conventions.json"), JSON.stringify(conventionsMap, null, "\t"));
|
|
20643
20822
|
}
|
|
20644
20823
|
writeBuildTrace(buildPath);
|
|
20645
20824
|
if (mode === "production") {
|
|
@@ -20702,7 +20881,7 @@ var init_build = __esm(() => {
|
|
|
20702
20881
|
init_logger();
|
|
20703
20882
|
init_validateSafePath();
|
|
20704
20883
|
isDev = env2.NODE_ENV === "development";
|
|
20705
|
-
|
|
20884
|
+
SKIP_DIRS5 = new Set([
|
|
20706
20885
|
"build",
|
|
20707
20886
|
"node_modules",
|
|
20708
20887
|
".absolutejs",
|
|
@@ -20761,7 +20940,7 @@ var init_build = __esm(() => {
|
|
|
20761
20940
|
|
|
20762
20941
|
// src/build/buildEmberVendor.ts
|
|
20763
20942
|
import { mkdirSync as mkdirSync13, existsSync as existsSync27 } from "fs";
|
|
20764
|
-
import { join as
|
|
20943
|
+
import { join as join36 } from "path";
|
|
20765
20944
|
import { rm as rm9 } from "fs/promises";
|
|
20766
20945
|
var {build: bunBuild8 } = globalThis.Bun;
|
|
20767
20946
|
var toSafeFileName5 = (specifier) => specifier.replace(/^@/, "").replace(/\//g, "_"), generateMacrosShim = () => `// Generated shim for @embroider/macros \u2014 provides minimal runtime
|
|
@@ -20813,7 +20992,7 @@ export const importSync = (specifier) => {
|
|
|
20813
20992
|
if (standaloneSpecifiers.has(specifier)) {
|
|
20814
20993
|
return { resolveTo: specifier, specifier };
|
|
20815
20994
|
}
|
|
20816
|
-
const emberInternalPath =
|
|
20995
|
+
const emberInternalPath = join36(cwd2, "node_modules/ember-source/dist/packages", specifier, "index.js");
|
|
20817
20996
|
if (!existsSync27(emberInternalPath)) {
|
|
20818
20997
|
throw new Error(`Ember vendor build: cannot find ${specifier} at ${emberInternalPath}. ` + `Is ember-source installed and at least 6.12?`);
|
|
20819
20998
|
}
|
|
@@ -20845,7 +21024,7 @@ export const importSync = (specifier) => {
|
|
|
20845
21024
|
if (standalonePackages.has(args.path)) {
|
|
20846
21025
|
return;
|
|
20847
21026
|
}
|
|
20848
|
-
const internal =
|
|
21027
|
+
const internal = join36(cwd2, "node_modules/ember-source/dist/packages", args.path, "index.js");
|
|
20849
21028
|
if (existsSync27(internal)) {
|
|
20850
21029
|
return { path: internal };
|
|
20851
21030
|
}
|
|
@@ -20853,16 +21032,16 @@ export const importSync = (specifier) => {
|
|
|
20853
21032
|
});
|
|
20854
21033
|
}
|
|
20855
21034
|
}), buildEmberVendor = async (buildDir, cwd2 = process.cwd()) => {
|
|
20856
|
-
const vendorDir =
|
|
21035
|
+
const vendorDir = join36(buildDir, "ember", "vendor");
|
|
20857
21036
|
mkdirSync13(vendorDir, { recursive: true });
|
|
20858
|
-
const tmpDir =
|
|
21037
|
+
const tmpDir = join36(buildDir, "_ember_vendor_tmp");
|
|
20859
21038
|
mkdirSync13(tmpDir, { recursive: true });
|
|
20860
|
-
const macrosShimPath =
|
|
21039
|
+
const macrosShimPath = join36(tmpDir, "embroider_macros_shim.js");
|
|
20861
21040
|
await Bun.write(macrosShimPath, generateMacrosShim());
|
|
20862
21041
|
const resolutions = REQUIRED_EMBER_SPECIFIERS.map((specifier) => resolveEmberSpecifier(specifier, cwd2));
|
|
20863
21042
|
const entrypoints = await Promise.all(resolutions.map(async (resolution) => {
|
|
20864
21043
|
const safeName = toSafeFileName5(resolution.specifier);
|
|
20865
|
-
const entryPath =
|
|
21044
|
+
const entryPath = join36(tmpDir, `${safeName}.js`);
|
|
20866
21045
|
const source = resolution.specifier === "@embroider/macros" ? `export * from ${JSON.stringify(macrosShimPath)};
|
|
20867
21046
|
` : generateVendorEntrySource2(resolution);
|
|
20868
21047
|
await Bun.write(entryPath, source);
|
|
@@ -20915,7 +21094,7 @@ __export(exports_dependencyGraph, {
|
|
|
20915
21094
|
buildInitialDependencyGraph: () => buildInitialDependencyGraph,
|
|
20916
21095
|
addFileToGraph: () => addFileToGraph
|
|
20917
21096
|
});
|
|
20918
|
-
import { existsSync as existsSync28, readFileSync as
|
|
21097
|
+
import { existsSync as existsSync28, readFileSync as readFileSync20 } from "fs";
|
|
20919
21098
|
var {Glob: Glob9 } = globalThis.Bun;
|
|
20920
21099
|
import { resolve as resolve26 } from "path";
|
|
20921
21100
|
var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath) => {
|
|
@@ -21086,15 +21265,15 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
21086
21265
|
const lowerPath = filePath.toLowerCase();
|
|
21087
21266
|
const isSvelteOrVue = lowerPath.endsWith(".svelte") || lowerPath.endsWith(".vue");
|
|
21088
21267
|
if (loader === "html") {
|
|
21089
|
-
const content =
|
|
21268
|
+
const content = readFileSync20(filePath, "utf-8");
|
|
21090
21269
|
return extractHtmlDependencies(filePath, content);
|
|
21091
21270
|
}
|
|
21092
21271
|
if (loader === "tsx" || loader === "js") {
|
|
21093
|
-
const content =
|
|
21272
|
+
const content = readFileSync20(filePath, "utf-8");
|
|
21094
21273
|
return extractJsDependencies(filePath, content, loader);
|
|
21095
21274
|
}
|
|
21096
21275
|
if (isSvelteOrVue) {
|
|
21097
|
-
const content =
|
|
21276
|
+
const content = readFileSync20(filePath, "utf-8");
|
|
21098
21277
|
return extractSvelteVueDependencies(filePath, content);
|
|
21099
21278
|
}
|
|
21100
21279
|
return [];
|
|
@@ -21237,7 +21416,7 @@ var init_clientManager = __esm(() => {
|
|
|
21237
21416
|
});
|
|
21238
21417
|
|
|
21239
21418
|
// src/dev/pathUtils.ts
|
|
21240
|
-
import { existsSync as existsSync29, readdirSync as
|
|
21419
|
+
import { existsSync as existsSync29, readdirSync as readdirSync5, readFileSync as readFileSync21 } from "fs";
|
|
21241
21420
|
import { dirname as dirname18, resolve as resolve28 } from "path";
|
|
21242
21421
|
var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
21243
21422
|
if (shouldIgnorePath(filePath, resolved)) {
|
|
@@ -21319,7 +21498,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
21319
21498
|
const walk = (dir) => {
|
|
21320
21499
|
let entries;
|
|
21321
21500
|
try {
|
|
21322
|
-
entries =
|
|
21501
|
+
entries = readdirSync5(dir, { withFileTypes: true });
|
|
21323
21502
|
} catch {
|
|
21324
21503
|
return;
|
|
21325
21504
|
}
|
|
@@ -21337,7 +21516,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
21337
21516
|
}
|
|
21338
21517
|
let source;
|
|
21339
21518
|
try {
|
|
21340
|
-
source =
|
|
21519
|
+
source = readFileSync21(full, "utf8");
|
|
21341
21520
|
} catch {
|
|
21342
21521
|
continue;
|
|
21343
21522
|
}
|
|
@@ -21415,8 +21594,8 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
21415
21594
|
roots.push(abs);
|
|
21416
21595
|
}
|
|
21417
21596
|
try {
|
|
21418
|
-
const { readdirSync:
|
|
21419
|
-
const entries =
|
|
21597
|
+
const { readdirSync: readdirSync6 } = __require("fs");
|
|
21598
|
+
const entries = readdirSync6(cwd2, { withFileTypes: true });
|
|
21420
21599
|
for (const entry of entries) {
|
|
21421
21600
|
if (!entry.isDirectory())
|
|
21422
21601
|
continue;
|
|
@@ -21496,8 +21675,8 @@ var init_pathUtils = __esm(() => {
|
|
|
21496
21675
|
|
|
21497
21676
|
// src/dev/fileWatcher.ts
|
|
21498
21677
|
import { watch } from "fs";
|
|
21499
|
-
import { existsSync as existsSync30, readdirSync as
|
|
21500
|
-
import { dirname as dirname19, join as
|
|
21678
|
+
import { existsSync as existsSync30, readdirSync as readdirSync6, statSync as statSync4 } from "fs";
|
|
21679
|
+
import { dirname as dirname19, join as join37, resolve as resolve29 } from "path";
|
|
21501
21680
|
var safeRemoveFromGraph = (graph, fullPath) => {
|
|
21502
21681
|
try {
|
|
21503
21682
|
removeFileFromGraph(graph, fullPath);
|
|
@@ -21522,7 +21701,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
21522
21701
|
const atomicRecoveryScan = (eventDir) => {
|
|
21523
21702
|
let entries;
|
|
21524
21703
|
try {
|
|
21525
|
-
entries =
|
|
21704
|
+
entries = readdirSync6(eventDir);
|
|
21526
21705
|
} catch {
|
|
21527
21706
|
return;
|
|
21528
21707
|
}
|
|
@@ -21530,7 +21709,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
21530
21709
|
for (const name of entries) {
|
|
21531
21710
|
if (shouldSkipFilename(name, isStylesDir))
|
|
21532
21711
|
continue;
|
|
21533
|
-
const child =
|
|
21712
|
+
const child = join37(eventDir, name).replace(/\\/g, "/");
|
|
21534
21713
|
let st2;
|
|
21535
21714
|
try {
|
|
21536
21715
|
st2 = statSync4(child);
|
|
@@ -21555,12 +21734,12 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
21555
21734
|
return;
|
|
21556
21735
|
if (shouldSkipFilename(filename, isStylesDir)) {
|
|
21557
21736
|
if (event === "rename") {
|
|
21558
|
-
const eventDir = dirname19(
|
|
21737
|
+
const eventDir = dirname19(join37(absolutePath, filename)).replace(/\\/g, "/");
|
|
21559
21738
|
atomicRecoveryScan(eventDir);
|
|
21560
21739
|
}
|
|
21561
21740
|
return;
|
|
21562
21741
|
}
|
|
21563
|
-
const fullPath =
|
|
21742
|
+
const fullPath = join37(absolutePath, filename).replace(/\\/g, "/");
|
|
21564
21743
|
if (shouldIgnorePath(fullPath, state.resolvedPaths)) {
|
|
21565
21744
|
return;
|
|
21566
21745
|
}
|
|
@@ -21712,7 +21891,7 @@ var init_assetStore = __esm(() => {
|
|
|
21712
21891
|
});
|
|
21713
21892
|
|
|
21714
21893
|
// src/islands/pageMetadata.ts
|
|
21715
|
-
import { readFileSync as
|
|
21894
|
+
import { readFileSync as readFileSync22 } from "fs";
|
|
21716
21895
|
import { dirname as dirname20, resolve as resolve31 } from "path";
|
|
21717
21896
|
var pagePatterns, getPageDirs = (config) => [
|
|
21718
21897
|
{ dir: config.angularDirectory, framework: "angular" },
|
|
@@ -21755,7 +21934,7 @@ var pagePatterns, getPageDirs = (config) => [
|
|
|
21755
21934
|
return;
|
|
21756
21935
|
const files = await scanEntryPoints(resolve31(entry.dir), pattern);
|
|
21757
21936
|
for (const filePath of files) {
|
|
21758
|
-
const source =
|
|
21937
|
+
const source = readFileSync22(filePath, "utf-8");
|
|
21759
21938
|
const islands = extractIslandUsagesFromSource(source);
|
|
21760
21939
|
pageMetadata.set(resolve31(filePath), {
|
|
21761
21940
|
islands: resolveIslandUsages(islands, islandSourceLookup),
|
|
@@ -21786,10 +21965,10 @@ var init_pageMetadata = __esm(() => {
|
|
|
21786
21965
|
});
|
|
21787
21966
|
|
|
21788
21967
|
// src/dev/fileHashTracker.ts
|
|
21789
|
-
import { readFileSync as
|
|
21968
|
+
import { readFileSync as readFileSync23 } from "fs";
|
|
21790
21969
|
var computeFileHash = (filePath) => {
|
|
21791
21970
|
try {
|
|
21792
|
-
const fileContent =
|
|
21971
|
+
const fileContent = readFileSync23(filePath);
|
|
21793
21972
|
return Number(Bun.hash(fileContent));
|
|
21794
21973
|
} catch {
|
|
21795
21974
|
return UNFOUND_INDEX;
|
|
@@ -22003,15 +22182,15 @@ __export(exports_resolveOwningComponents, {
|
|
|
22003
22182
|
resolveDescendantsOfParent: () => resolveDescendantsOfParent,
|
|
22004
22183
|
invalidateResourceIndex: () => invalidateResourceIndex
|
|
22005
22184
|
});
|
|
22006
|
-
import { readdirSync as
|
|
22007
|
-
import { dirname as dirname21, extname as extname9, join as
|
|
22008
|
-
import
|
|
22185
|
+
import { readdirSync as readdirSync7, readFileSync as readFileSync24, statSync as statSync5 } from "fs";
|
|
22186
|
+
import { dirname as dirname21, extname as extname9, join as join38, resolve as resolve34 } from "path";
|
|
22187
|
+
import ts15 from "typescript";
|
|
22009
22188
|
var ENTITY_DECORATORS, isAngularSourceFile = (file4) => file4.endsWith(".ts") || file4.endsWith(".tsx"), walkAngularSourceFiles = (root) => {
|
|
22010
22189
|
const out = [];
|
|
22011
22190
|
const visit = (dir) => {
|
|
22012
22191
|
let entries;
|
|
22013
22192
|
try {
|
|
22014
|
-
entries =
|
|
22193
|
+
entries = readdirSync7(dir, { withFileTypes: true });
|
|
22015
22194
|
} catch {
|
|
22016
22195
|
return;
|
|
22017
22196
|
}
|
|
@@ -22019,7 +22198,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file4) => file4.endsWith(".ts") ||
|
|
|
22019
22198
|
if (entry.name.startsWith(".") || entry.name === "node_modules") {
|
|
22020
22199
|
continue;
|
|
22021
22200
|
}
|
|
22022
|
-
const full =
|
|
22201
|
+
const full = join38(dir, entry.name);
|
|
22023
22202
|
if (entry.isDirectory()) {
|
|
22024
22203
|
visit(full);
|
|
22025
22204
|
} else if (entry.isFile() && isAngularSourceFile(entry.name)) {
|
|
@@ -22031,13 +22210,13 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file4) => file4.endsWith(".ts") ||
|
|
|
22031
22210
|
return out;
|
|
22032
22211
|
}, getStringPropertyValue = (obj, name) => {
|
|
22033
22212
|
for (const prop of obj.properties) {
|
|
22034
|
-
if (!
|
|
22213
|
+
if (!ts15.isPropertyAssignment(prop))
|
|
22035
22214
|
continue;
|
|
22036
|
-
const propName =
|
|
22215
|
+
const propName = ts15.isIdentifier(prop.name) ? prop.name.text : ts15.isStringLiteral(prop.name) ? prop.name.text : null;
|
|
22037
22216
|
if (propName !== name)
|
|
22038
22217
|
continue;
|
|
22039
22218
|
const init = prop.initializer;
|
|
22040
|
-
if (
|
|
22219
|
+
if (ts15.isStringLiteral(init) || ts15.isNoSubstitutionTemplateLiteral(init)) {
|
|
22041
22220
|
return init.text;
|
|
22042
22221
|
}
|
|
22043
22222
|
}
|
|
@@ -22045,16 +22224,16 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file4) => file4.endsWith(".ts") ||
|
|
|
22045
22224
|
}, getStringArrayProperty = (obj, name) => {
|
|
22046
22225
|
const out = [];
|
|
22047
22226
|
for (const prop of obj.properties) {
|
|
22048
|
-
if (!
|
|
22227
|
+
if (!ts15.isPropertyAssignment(prop))
|
|
22049
22228
|
continue;
|
|
22050
|
-
const propName =
|
|
22229
|
+
const propName = ts15.isIdentifier(prop.name) ? prop.name.text : ts15.isStringLiteral(prop.name) ? prop.name.text : null;
|
|
22051
22230
|
if (propName !== name)
|
|
22052
22231
|
continue;
|
|
22053
22232
|
const init = prop.initializer;
|
|
22054
|
-
if (!
|
|
22233
|
+
if (!ts15.isArrayLiteralExpression(init))
|
|
22055
22234
|
continue;
|
|
22056
22235
|
for (const element of init.elements) {
|
|
22057
|
-
if (
|
|
22236
|
+
if (ts15.isStringLiteral(element) || ts15.isNoSubstitutionTemplateLiteral(element)) {
|
|
22058
22237
|
out.push(element.text);
|
|
22059
22238
|
}
|
|
22060
22239
|
}
|
|
@@ -22063,31 +22242,31 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file4) => file4.endsWith(".ts") ||
|
|
|
22063
22242
|
}, parseDecoratedClasses = (filePath) => {
|
|
22064
22243
|
let source;
|
|
22065
22244
|
try {
|
|
22066
|
-
source =
|
|
22245
|
+
source = readFileSync24(filePath, "utf8");
|
|
22067
22246
|
} catch {
|
|
22068
22247
|
return [];
|
|
22069
22248
|
}
|
|
22070
|
-
const sourceFile =
|
|
22249
|
+
const sourceFile = ts15.createSourceFile(filePath, source, ts15.ScriptTarget.ES2022, true, ts15.ScriptKind.TS);
|
|
22071
22250
|
const out = [];
|
|
22072
22251
|
const visit = (node) => {
|
|
22073
|
-
if (
|
|
22074
|
-
for (const decorator of
|
|
22252
|
+
if (ts15.isClassDeclaration(node) && node.name) {
|
|
22253
|
+
for (const decorator of ts15.getDecorators(node) ?? []) {
|
|
22075
22254
|
const expr = decorator.expression;
|
|
22076
|
-
if (!
|
|
22255
|
+
if (!ts15.isCallExpression(expr))
|
|
22077
22256
|
continue;
|
|
22078
22257
|
const fn2 = expr.expression;
|
|
22079
|
-
if (!
|
|
22258
|
+
if (!ts15.isIdentifier(fn2))
|
|
22080
22259
|
continue;
|
|
22081
22260
|
const kind = ENTITY_DECORATORS[fn2.text];
|
|
22082
22261
|
if (!kind)
|
|
22083
22262
|
continue;
|
|
22084
22263
|
let extendsName = null;
|
|
22085
22264
|
for (const heritage of node.heritageClauses ?? []) {
|
|
22086
|
-
if (heritage.token !==
|
|
22265
|
+
if (heritage.token !== ts15.SyntaxKind.ExtendsKeyword) {
|
|
22087
22266
|
continue;
|
|
22088
22267
|
}
|
|
22089
22268
|
const first = heritage.types[0];
|
|
22090
|
-
if (first &&
|
|
22269
|
+
if (first && ts15.isIdentifier(first.expression)) {
|
|
22091
22270
|
extendsName = first.expression.text;
|
|
22092
22271
|
}
|
|
22093
22272
|
break;
|
|
@@ -22100,7 +22279,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file4) => file4.endsWith(".ts") ||
|
|
|
22100
22279
|
extendsName
|
|
22101
22280
|
};
|
|
22102
22281
|
const arg = expr.arguments[0];
|
|
22103
|
-
if (arg &&
|
|
22282
|
+
if (arg && ts15.isObjectLiteralExpression(arg) && kind === "component") {
|
|
22104
22283
|
const tplUrl = getStringPropertyValue(arg, "templateUrl");
|
|
22105
22284
|
if (tplUrl)
|
|
22106
22285
|
entry.templateUrls.push(tplUrl);
|
|
@@ -22113,7 +22292,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file4) => file4.endsWith(".ts") ||
|
|
|
22113
22292
|
break;
|
|
22114
22293
|
}
|
|
22115
22294
|
}
|
|
22116
|
-
|
|
22295
|
+
ts15.forEachChild(node, visit);
|
|
22117
22296
|
};
|
|
22118
22297
|
visit(sourceFile);
|
|
22119
22298
|
return out;
|
|
@@ -22153,16 +22332,16 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file4) => file4.endsWith(".ts") ||
|
|
|
22153
22332
|
}, indexByRoot, resolveParentClassFile = (parentName, childFilePath, angularRoot) => {
|
|
22154
22333
|
let source;
|
|
22155
22334
|
try {
|
|
22156
|
-
source =
|
|
22335
|
+
source = readFileSync24(childFilePath, "utf8");
|
|
22157
22336
|
} catch {
|
|
22158
22337
|
return null;
|
|
22159
22338
|
}
|
|
22160
|
-
const sf =
|
|
22339
|
+
const sf = ts15.createSourceFile(childFilePath, source, ts15.ScriptTarget.ES2022, true, ts15.ScriptKind.TS);
|
|
22161
22340
|
const childDir = dirname21(childFilePath);
|
|
22162
22341
|
for (const stmt of sf.statements) {
|
|
22163
|
-
if (!
|
|
22342
|
+
if (!ts15.isImportDeclaration(stmt))
|
|
22164
22343
|
continue;
|
|
22165
|
-
if (!
|
|
22344
|
+
if (!ts15.isStringLiteral(stmt.moduleSpecifier))
|
|
22166
22345
|
continue;
|
|
22167
22346
|
const clause = stmt.importClause;
|
|
22168
22347
|
if (!clause || clause.isTypeOnly)
|
|
@@ -22170,7 +22349,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file4) => file4.endsWith(".ts") ||
|
|
|
22170
22349
|
let matchesName = false;
|
|
22171
22350
|
if (clause.name && clause.name.text === parentName)
|
|
22172
22351
|
matchesName = true;
|
|
22173
|
-
if (!matchesName && clause.namedBindings &&
|
|
22352
|
+
if (!matchesName && clause.namedBindings && ts15.isNamedImports(clause.namedBindings)) {
|
|
22174
22353
|
for (const el of clause.namedBindings.elements) {
|
|
22175
22354
|
if (el.isTypeOnly)
|
|
22176
22355
|
continue;
|
|
@@ -22520,8 +22699,8 @@ __export(exports_moduleServer, {
|
|
|
22520
22699
|
createModuleServer: () => createModuleServer,
|
|
22521
22700
|
SRC_URL_PREFIX: () => SRC_URL_PREFIX
|
|
22522
22701
|
});
|
|
22523
|
-
import { existsSync as existsSync31, readFileSync as
|
|
22524
|
-
import { basename as basename12, dirname as dirname22, extname as extname10, join as
|
|
22702
|
+
import { existsSync as existsSync31, readFileSync as readFileSync25, statSync as statSync6 } from "fs";
|
|
22703
|
+
import { basename as basename12, dirname as dirname22, extname as extname10, join as join39, resolve as resolve36, relative as relative14 } from "path";
|
|
22525
22704
|
var SRC_PREFIX = "/@src/", jsTranspiler2, tsTranspiler2, tsxTranspiler, TRANSPILABLE, ALL_EXPORTS_RE, STRING_CONTENTS_RE, preserveTypeExports = (originalSource, transpiled, valueExports) => {
|
|
22526
22705
|
const codeOnly = originalSource.replace(STRING_CONTENTS_RE, '""');
|
|
22527
22706
|
const allExports = [];
|
|
@@ -22593,9 +22772,9 @@ ${stubs}
|
|
|
22593
22772
|
const subpath = isScoped ? parts.slice(2).join("/") : parts.slice(1).join("/");
|
|
22594
22773
|
if (!subpath) {
|
|
22595
22774
|
const pkgDir = resolve36(projectRoot, "node_modules", packageName ?? "");
|
|
22596
|
-
const pkgJsonPath =
|
|
22775
|
+
const pkgJsonPath = join39(pkgDir, "package.json");
|
|
22597
22776
|
if (existsSync31(pkgJsonPath)) {
|
|
22598
|
-
const pkg = JSON.parse(
|
|
22777
|
+
const pkg = JSON.parse(readFileSync25(pkgJsonPath, "utf-8"));
|
|
22599
22778
|
const esmEntry = typeof pkg.module === "string" && pkg.module || typeof pkg.browser === "string" && pkg.browser;
|
|
22600
22779
|
if (esmEntry) {
|
|
22601
22780
|
const resolved = resolve36(pkgDir, esmEntry);
|
|
@@ -22696,7 +22875,7 @@ ${code}`;
|
|
|
22696
22875
|
reactFastRefreshWarningEmitted = true;
|
|
22697
22876
|
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.");
|
|
22698
22877
|
}, transformReactFile = (filePath, projectRoot, rewriter) => {
|
|
22699
|
-
const raw =
|
|
22878
|
+
const raw = readFileSync25(filePath, "utf-8");
|
|
22700
22879
|
const valueExports = tsxTranspiler.scan(raw).exports;
|
|
22701
22880
|
let transpiled = reactTranspiler.transformSync(raw);
|
|
22702
22881
|
transpiled = preserveTypeExports(raw, transpiled, valueExports);
|
|
@@ -22712,7 +22891,7 @@ ${transpiled}`;
|
|
|
22712
22891
|
transpiled += buildIslandMetadataExports(raw);
|
|
22713
22892
|
return rewriteImports(transpiled, filePath, projectRoot, rewriter);
|
|
22714
22893
|
}, transformPlainFile = (filePath, projectRoot, rewriter, vueDir) => {
|
|
22715
|
-
const raw =
|
|
22894
|
+
const raw = readFileSync25(filePath, "utf-8");
|
|
22716
22895
|
const ext = extname10(filePath);
|
|
22717
22896
|
const isTS = ext === ".ts" || ext === ".tsx";
|
|
22718
22897
|
const isTSX = ext === ".tsx" || ext === ".jsx";
|
|
@@ -22878,7 +23057,7 @@ ${code}`;
|
|
|
22878
23057
|
` + ` var __hmr_accept = function(cb) { window.__SVELTE_HMR_ACCEPT__[${JSON.stringify(moduleUrl)}] = cb; };`);
|
|
22879
23058
|
return code.replace(/import\.meta\.hot\.accept\(/g, "__hmr_accept(");
|
|
22880
23059
|
}, transformSvelteFile = async (filePath, projectRoot, rewriter, stylePreprocessors) => {
|
|
22881
|
-
const raw =
|
|
23060
|
+
const raw = readFileSync25(filePath, "utf-8");
|
|
22882
23061
|
if (!svelteCompiler) {
|
|
22883
23062
|
svelteCompiler = await import("svelte/compiler");
|
|
22884
23063
|
}
|
|
@@ -22940,7 +23119,7 @@ export default __script__;`;
|
|
|
22940
23119
|
return `${cssInjection}
|
|
22941
23120
|
${code}`;
|
|
22942
23121
|
}, transformVueFile = async (filePath, projectRoot, rewriter, vueDir, stylePreprocessors) => {
|
|
22943
|
-
const rawSource =
|
|
23122
|
+
const rawSource = readFileSync25(filePath, "utf-8");
|
|
22944
23123
|
const raw = addAutoRouterSetupApp(rawSource);
|
|
22945
23124
|
if (!vueCompiler) {
|
|
22946
23125
|
vueCompiler = await import("@vue/compiler-sfc");
|
|
@@ -22995,7 +23174,7 @@ ${code}`;
|
|
|
22995
23174
|
}
|
|
22996
23175
|
});
|
|
22997
23176
|
}, handleCssRequest = (filePath) => {
|
|
22998
|
-
const raw =
|
|
23177
|
+
const raw = readFileSync25(filePath, "utf-8");
|
|
22999
23178
|
const escaped = raw.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$/g, "\\$");
|
|
23000
23179
|
return [
|
|
23001
23180
|
`const style = document.createElement('style');`,
|
|
@@ -23654,7 +23833,7 @@ var init_simpleHTMXHMR = () => {};
|
|
|
23654
23833
|
|
|
23655
23834
|
// src/dev/rebuildTrigger.ts
|
|
23656
23835
|
import { existsSync as existsSync32, rmSync as rmSync3 } from "fs";
|
|
23657
|
-
import { basename as basename13, dirname as dirname24, join as
|
|
23836
|
+
import { basename as basename13, dirname as dirname24, join as join40, relative as relative16, resolve as resolve40, sep as sep4 } from "path";
|
|
23658
23837
|
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) => {
|
|
23659
23838
|
if (!config.tailwind)
|
|
23660
23839
|
return;
|
|
@@ -23771,8 +23950,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
23771
23950
|
const relJs = `${rel.slice(0, -ext[0].length)}.js`;
|
|
23772
23951
|
const generatedDir = getFrameworkGeneratedDir(framework, cwd2);
|
|
23773
23952
|
for (const candidate of [
|
|
23774
|
-
|
|
23775
|
-
`${
|
|
23953
|
+
join40(generatedDir, relJs),
|
|
23954
|
+
`${join40(generatedDir, relJs)}.map`
|
|
23776
23955
|
]) {
|
|
23777
23956
|
try {
|
|
23778
23957
|
rmSync3(candidate, { force: true });
|
|
@@ -24634,12 +24813,12 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24634
24813
|
try {
|
|
24635
24814
|
const { primeComponentFingerprint: primeComponentFingerprint2 } = await Promise.resolve().then(() => (init_fastHmrCompiler(), exports_fastHmrCompiler));
|
|
24636
24815
|
const { readdir: readdir5 } = await import("fs/promises");
|
|
24637
|
-
const { join:
|
|
24816
|
+
const { join: join41 } = await import("path");
|
|
24638
24817
|
const walk = async (dir) => {
|
|
24639
24818
|
const entries = await readdir5(dir, { withFileTypes: true });
|
|
24640
24819
|
const files = [];
|
|
24641
24820
|
for (const entry of entries) {
|
|
24642
|
-
const full =
|
|
24821
|
+
const full = join41(dir, entry.name);
|
|
24643
24822
|
if (entry.isDirectory()) {
|
|
24644
24823
|
files.push(...await walk(full));
|
|
24645
24824
|
} else if (entry.isFile() && entry.name.endsWith(".ts") && !entry.name.endsWith(".d.ts")) {
|
|
@@ -24692,9 +24871,9 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24692
24871
|
const editedProvidersChain = providersImport && angularFiles.some((file4) => resolve40(file4) === resolve40(providersImport.absolutePath) || resolve40(file4).startsWith(`${resolve40(angularDir)}/`));
|
|
24693
24872
|
const pageEntries = editedProvidersChain && initialPageEntries.length === 0 ? (() => {
|
|
24694
24873
|
const allPages = [];
|
|
24695
|
-
const { readdirSync:
|
|
24874
|
+
const { readdirSync: readdirSync8 } = __require("fs");
|
|
24696
24875
|
const walk = (dir) => {
|
|
24697
|
-
for (const entry of
|
|
24876
|
+
for (const entry of readdirSync8(dir, {
|
|
24698
24877
|
withFileTypes: true
|
|
24699
24878
|
})) {
|
|
24700
24879
|
const full = resolve40(dir, entry.name);
|
|
@@ -25105,7 +25284,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
25105
25284
|
const { vueServerPaths, vueIndexPaths, vueClientPaths, vueCssPaths } = await compileVue2(vueFiles, vueDir, true, getStyleTransformConfig(state.config));
|
|
25106
25285
|
const serverEntries = [...vueServerPaths];
|
|
25107
25286
|
const clientEntries = [...vueIndexPaths, ...vueClientPaths];
|
|
25108
|
-
const cssOutDir =
|
|
25287
|
+
const cssOutDir = join40(buildDir, state.resolvedPaths.assetsDir ? basename13(state.resolvedPaths.assetsDir) : "assets", "css");
|
|
25109
25288
|
const { serverRoot, serverOutDir } = await computeServerOutPaths(state.resolvedPaths, "vue");
|
|
25110
25289
|
const [serverResult, clientResult, cssResult] = await Promise.all([
|
|
25111
25290
|
serverEntries.length > 0 ? bunBuild9({
|
|
@@ -26120,7 +26299,7 @@ __export(exports_buildDepVendor, {
|
|
|
26120
26299
|
buildDepVendor: () => buildDepVendor
|
|
26121
26300
|
});
|
|
26122
26301
|
import { mkdirSync as mkdirSync14 } from "fs";
|
|
26123
|
-
import { join as
|
|
26302
|
+
import { join as join41 } from "path";
|
|
26124
26303
|
import { rm as rm10 } from "fs/promises";
|
|
26125
26304
|
var {build: bunBuild9, Glob: Glob10 } = globalThis.Bun;
|
|
26126
26305
|
var toSafeFileName6 = (specifier) => {
|
|
@@ -26174,7 +26353,7 @@ var toSafeFileName6 = (specifier) => {
|
|
|
26174
26353
|
framework: Array.from(framework).filter(isResolvable4)
|
|
26175
26354
|
};
|
|
26176
26355
|
}, collectTransitiveImports = async (specs, alreadyVendored, alreadyScanned) => {
|
|
26177
|
-
const { readFileSync:
|
|
26356
|
+
const { readFileSync: readFileSync26 } = await import("fs");
|
|
26178
26357
|
const transpiler6 = new Bun.Transpiler({ loader: "js" });
|
|
26179
26358
|
const newSpecs = new Set;
|
|
26180
26359
|
for (const spec of specs) {
|
|
@@ -26189,7 +26368,7 @@ var toSafeFileName6 = (specifier) => {
|
|
|
26189
26368
|
}
|
|
26190
26369
|
let content;
|
|
26191
26370
|
try {
|
|
26192
|
-
content =
|
|
26371
|
+
content = readFileSync26(resolved, "utf-8");
|
|
26193
26372
|
} catch {
|
|
26194
26373
|
continue;
|
|
26195
26374
|
}
|
|
@@ -26231,7 +26410,7 @@ var toSafeFileName6 = (specifier) => {
|
|
|
26231
26410
|
}), buildDepVendorPass = async (specifiers, vendorDir, tmpDir) => {
|
|
26232
26411
|
const entries = await Promise.all(specifiers.map(async (specifier) => {
|
|
26233
26412
|
const safeName = toSafeFileName6(specifier);
|
|
26234
|
-
const entryPath =
|
|
26413
|
+
const entryPath = join41(tmpDir, `${safeName}.ts`);
|
|
26235
26414
|
await Bun.write(entryPath, await generateVendorEntrySource(specifier));
|
|
26236
26415
|
return { entryPath, specifier };
|
|
26237
26416
|
}));
|
|
@@ -26292,9 +26471,9 @@ var toSafeFileName6 = (specifier) => {
|
|
|
26292
26471
|
const { dep: initialSpecs, framework: frameworkRoots } = await scanBareImports(directories);
|
|
26293
26472
|
if (initialSpecs.length === 0 && frameworkRoots.length === 0)
|
|
26294
26473
|
return {};
|
|
26295
|
-
const vendorDir =
|
|
26474
|
+
const vendorDir = join41(buildDir, "vendor");
|
|
26296
26475
|
mkdirSync14(vendorDir, { recursive: true });
|
|
26297
|
-
const tmpDir =
|
|
26476
|
+
const tmpDir = join41(buildDir, "_dep_vendor_tmp");
|
|
26298
26477
|
mkdirSync14(tmpDir, { recursive: true });
|
|
26299
26478
|
const allSpecs = new Set(initialSpecs);
|
|
26300
26479
|
const alreadyScanned = new Set;
|
|
@@ -26806,5 +26985,5 @@ export {
|
|
|
26806
26985
|
build
|
|
26807
26986
|
};
|
|
26808
26987
|
|
|
26809
|
-
//# debugId=
|
|
26988
|
+
//# debugId=71A611117C6D2CDE64756E2164756E21
|
|
26810
26989
|
//# sourceMappingURL=build.js.map
|