@reckona/mreact-compiler 0.0.81 → 0.0.82
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/README.md +15 -0
- package/dist/boundary-graph.d.ts +66 -0
- package/dist/boundary-graph.d.ts.map +1 -0
- package/dist/boundary-graph.js +568 -0
- package/dist/boundary-graph.js.map +1 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/internal.d.ts +5 -0
- package/dist/internal.d.ts.map +1 -1
- package/dist/internal.js +14 -1
- package/dist/internal.js.map +1 -1
- package/package.json +2 -2
- package/src/boundary-graph.ts +904 -0
- package/src/index.ts +16 -0
- package/src/internal.ts +25 -1
package/src/index.ts
CHANGED
|
@@ -18,6 +18,7 @@ export {
|
|
|
18
18
|
} from "./internal.js";
|
|
19
19
|
export type {
|
|
20
20
|
StaticExportReference,
|
|
21
|
+
StaticExportSpecifierReference,
|
|
21
22
|
FormActionExpressionReference,
|
|
22
23
|
FormActionReference,
|
|
23
24
|
StaticImportReference,
|
|
@@ -26,6 +27,21 @@ export type {
|
|
|
26
27
|
ClientRouteStaticImportReference,
|
|
27
28
|
TopLevelExportRenderInfo,
|
|
28
29
|
} from "./internal.js";
|
|
30
|
+
export { analyzeBoundaryGraph } from "./boundary-graph.js";
|
|
31
|
+
export type {
|
|
32
|
+
BoundaryClassification,
|
|
33
|
+
BoundaryGraphClientBoundary,
|
|
34
|
+
BoundaryGraphEntry,
|
|
35
|
+
BoundaryGraphEntryKind,
|
|
36
|
+
BoundaryGraphExport,
|
|
37
|
+
BoundaryGraphInput,
|
|
38
|
+
BoundaryGraphModule,
|
|
39
|
+
BoundaryGraphResult,
|
|
40
|
+
BoundaryGraphServerActionSite,
|
|
41
|
+
BoundaryGraphTraceEvent,
|
|
42
|
+
BoundaryGraphTraceKind,
|
|
43
|
+
BoundaryGraphTraceReason,
|
|
44
|
+
} from "./boundary-graph.js";
|
|
29
45
|
export { formatDiagnostic } from "./diagnostics.js";
|
|
30
46
|
export { transform } from "./transform.js";
|
|
31
47
|
export type {
|
package/src/internal.ts
CHANGED
|
@@ -48,9 +48,15 @@ export interface ClientRouteStaticImportReference extends StaticImportReference
|
|
|
48
48
|
export interface StaticExportReference {
|
|
49
49
|
exportedNames: string[];
|
|
50
50
|
exportAll: boolean;
|
|
51
|
+
specifiers: StaticExportSpecifierReference[];
|
|
51
52
|
source: string;
|
|
52
53
|
}
|
|
53
54
|
|
|
55
|
+
export interface StaticExportSpecifierReference {
|
|
56
|
+
exportedName: string;
|
|
57
|
+
localName: string;
|
|
58
|
+
}
|
|
59
|
+
|
|
54
60
|
export interface TopLevelExportRenderInfo {
|
|
55
61
|
calledComponentRoots: string[];
|
|
56
62
|
clientRuntime: boolean;
|
|
@@ -1179,7 +1185,7 @@ function staticExportReference(statement: Record<string, unknown>): StaticExport
|
|
|
1179
1185
|
const source = sourceValue(statement)[0];
|
|
1180
1186
|
return source === undefined
|
|
1181
1187
|
? []
|
|
1182
|
-
: [{ exportedNames: [], exportAll: true, source }];
|
|
1188
|
+
: [{ exportedNames: [], exportAll: true, specifiers: [], source }];
|
|
1183
1189
|
}
|
|
1184
1190
|
|
|
1185
1191
|
if (statement.type !== "ExportNamedDeclaration" || statement.exportKind === "type") {
|
|
@@ -1195,11 +1201,29 @@ function staticExportReference(statement: Record<string, unknown>): StaticExport
|
|
|
1195
1201
|
{
|
|
1196
1202
|
exportedNames: exportedNames(statement),
|
|
1197
1203
|
exportAll: false,
|
|
1204
|
+
specifiers: staticExportSpecifierReferences(statement),
|
|
1198
1205
|
source,
|
|
1199
1206
|
},
|
|
1200
1207
|
];
|
|
1201
1208
|
}
|
|
1202
1209
|
|
|
1210
|
+
function staticExportSpecifierReferences(
|
|
1211
|
+
statement: Record<string, unknown>,
|
|
1212
|
+
): StaticExportSpecifierReference[] {
|
|
1213
|
+
const specifiers = Array.isArray(statement.specifiers)
|
|
1214
|
+
? statement.specifiers.map(readObject)
|
|
1215
|
+
: [];
|
|
1216
|
+
|
|
1217
|
+
return specifiers.flatMap((specifier) => {
|
|
1218
|
+
const exportedName = exportedNameForSpecifier(specifier);
|
|
1219
|
+
const localName = localNameForExportSpecifier(specifier);
|
|
1220
|
+
|
|
1221
|
+
return exportedName === undefined || localName === undefined
|
|
1222
|
+
? []
|
|
1223
|
+
: [{ exportedName, localName }];
|
|
1224
|
+
});
|
|
1225
|
+
}
|
|
1226
|
+
|
|
1203
1227
|
function sourceValue(statement: Record<string, unknown>): string[] {
|
|
1204
1228
|
const source = readOptionalObject(statement.source);
|
|
1205
1229
|
const value = source?.value;
|