sinwan-compiler 0.3.1 → 1.0.0

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/analyze.d.ts CHANGED
@@ -6,7 +6,7 @@
6
6
  * modules. The result is written to a JSON metadata file consumed by the
7
7
  * per-file transform.
8
8
  */
9
- import * as t from "@babel/types";
9
+ import * as t from "./ast/types";
10
10
  import { type ReactiveScope, type CallSite } from "./reactive-wrap";
11
11
  export type ImportInfo = {
12
12
  source: string;
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Print ESTree ASTs with esrap.
3
+ */
4
+ import type { Node } from "./node";
5
+ export interface GenerateOptions {
6
+ sourceMaps?: boolean | "inline" | "both";
7
+ sourceFileName?: string;
8
+ compact?: boolean;
9
+ comments?: boolean;
10
+ }
11
+ export interface GenerateResult {
12
+ code: string;
13
+ map: object | null;
14
+ }
15
+ export declare function generate(ast: Node, options?: GenerateOptions, _code?: string): GenerateResult;
16
+ export default generate;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Oxc/ESTree AST facade for sinwan-compiler.
3
+ */
4
+ export { parse, type ParseOptions } from "./parse";
5
+ export { generate, type GenerateOptions, type GenerateResult, } from "./generate";
6
+ export { traverse, Path, Scope, Binding, singlePath, type NodePath, type TraverseOptions, } from "./traverse";
7
+ export * as t from "./types";
8
+ export type { Node, Expression, Function, Identifier, Literal, Program, File, LVal, } from "./node";
@@ -0,0 +1,147 @@
1
+ /**
2
+ * Shared AST node type — oxc/ESTree plain objects.
3
+ */
4
+ export type Comment = {
5
+ type: string;
6
+ value: string;
7
+ };
8
+ export type SourceLocation = {
9
+ start: {
10
+ line: number;
11
+ column: number;
12
+ };
13
+ end: {
14
+ line: number;
15
+ column: number;
16
+ };
17
+ };
18
+ /**
19
+ * Mutable ESTree node. Named fields are the properties compiler passes read;
20
+ * the index signature lets Path replace arbitrary child keys.
21
+ */
22
+ export type Node = {
23
+ type: string;
24
+ start?: number | null;
25
+ end?: number | null;
26
+ loc?: SourceLocation | null;
27
+ leadingComments?: Comment[] | null;
28
+ trailingComments?: Comment[] | null;
29
+ name?: string | Node;
30
+ value?: string | number | boolean | null | bigint | Node | {
31
+ raw?: string;
32
+ cooked?: string | null;
33
+ };
34
+ raw?: string;
35
+ optional?: boolean;
36
+ computed?: boolean;
37
+ shorthand?: boolean;
38
+ expression?: boolean | Node;
39
+ async?: boolean;
40
+ generator?: boolean;
41
+ kind?: string;
42
+ operator?: string;
43
+ prefix?: boolean;
44
+ method?: boolean;
45
+ id?: Node | null;
46
+ init?: Node | null;
47
+ body?: Node | Node[];
48
+ params?: Node[];
49
+ arguments?: Node[];
50
+ callee?: Node;
51
+ object?: Node;
52
+ property?: Node;
53
+ properties?: Node[];
54
+ elements?: (Node | null)[];
55
+ declarations?: Node[];
56
+ declaration?: Node | null;
57
+ specifiers?: Node[];
58
+ source?: Node | null;
59
+ imported?: Node;
60
+ exported?: Node;
61
+ local?: Node;
62
+ key?: Node;
63
+ left?: Node;
64
+ right?: Node;
65
+ argument?: Node | null;
66
+ test?: Node;
67
+ consequent?: Node;
68
+ alternate?: Node | null;
69
+ openingElement?: Node;
70
+ closingElement?: Node | null;
71
+ children?: Node[];
72
+ attributes?: Node[];
73
+ program?: Program;
74
+ comments?: Comment[] | null;
75
+ sourceType?: "module" | "script";
76
+ exportKind?: string;
77
+ importKind?: string;
78
+ typeAnnotation?: Node | null;
79
+ returnType?: Node | null;
80
+ typeParameters?: Node | null;
81
+ superClass?: Node | null;
82
+ quasis?: Node[];
83
+ expressions?: Node[];
84
+ regex?: {
85
+ pattern: string;
86
+ flags: string;
87
+ };
88
+ bigint?: string;
89
+ selfClosing?: boolean;
90
+ namespace?: Node;
91
+ objectType?: Node;
92
+ param?: Node | null;
93
+ label?: Node | null;
94
+ update?: Node | null;
95
+ definite?: boolean;
96
+ override?: boolean;
97
+ readonly?: boolean;
98
+ declare?: boolean;
99
+ static?: boolean;
100
+ accessibility?: string | null;
101
+ implements?: Node[];
102
+ mixins?: Node[];
103
+ decorators?: Node[];
104
+ typeArguments?: Node | null;
105
+ typeName?: Node;
106
+ types?: Node[];
107
+ elementTypes?: Node[];
108
+ members?: Node[];
109
+ openingFragment?: Node;
110
+ closingFragment?: Node;
111
+ [key: string]: unknown;
112
+ };
113
+ export type Program = Node & {
114
+ type: "Program";
115
+ body: Node[];
116
+ sourceType: "module" | "script";
117
+ };
118
+ export type File = Node & {
119
+ type: "File";
120
+ program: Program;
121
+ comments: Comment[] | null;
122
+ };
123
+ export type Expression = Node;
124
+ export type Statement = Node;
125
+ export type LVal = Node;
126
+ export type Function = Node & {
127
+ params: Node[];
128
+ body: Node;
129
+ generator?: boolean;
130
+ async?: boolean;
131
+ id?: Node | null;
132
+ };
133
+ export type Identifier = Node & {
134
+ type: "Identifier";
135
+ name: string;
136
+ };
137
+ export type Literal = Node & {
138
+ type: "Literal";
139
+ value: string | number | boolean | null | bigint;
140
+ raw?: string;
141
+ regex?: {
142
+ pattern: string;
143
+ flags: string;
144
+ };
145
+ bigint?: string;
146
+ };
147
+ export declare function isAstNode(value: unknown): value is Node;
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Parse TS/TSX with oxc-parser (ESTree) and attach comments onto nodes.
3
+ */
4
+ import { type File, type Program } from "./node";
5
+ export interface ParseOptions {
6
+ sourceType?: "module" | "script" | "unambiguous";
7
+ plugins?: unknown[];
8
+ sourceFilename?: string;
9
+ allowReturnOutsideFunction?: boolean;
10
+ errorRecovery?: boolean;
11
+ }
12
+ /**
13
+ * Normalize oxc's program object into our mutable Program node.
14
+ */
15
+ export declare function asProgram(parsed: unknown): Program;
16
+ /**
17
+ * Parse source into a File wrapper `{ type: "File", program }`.
18
+ */
19
+ export declare function parse(code: string, options?: ParseOptions): File;
@@ -0,0 +1,116 @@
1
+ /**
2
+ * Mutable ESTree path + scope for oxc ASTs.
3
+ */
4
+ import type { Node } from "./node";
5
+ import * as t from "./types";
6
+ export type VisitorFn = (path: Path) => void;
7
+ export type Visitors = Record<string, VisitorFn | {
8
+ enter?: VisitorFn;
9
+ exit?: VisitorFn;
10
+ }>;
11
+ export declare class Binding {
12
+ identifier: t.Identifier;
13
+ path: Path;
14
+ kind: string;
15
+ constant: boolean;
16
+ referenced: boolean;
17
+ referencePaths: Path[];
18
+ constantViolations: Path[];
19
+ constructor(identifier: t.Identifier, path: Path, kind: string);
20
+ }
21
+ export declare class Scope {
22
+ path: Path;
23
+ parent: Scope | null;
24
+ bindings: Map<string, Binding>;
25
+ constructor(path: Path, parent?: Scope | null);
26
+ getBinding(name: string): Binding | undefined;
27
+ register(name: string, binding: Binding): void;
28
+ crawl(): void;
29
+ }
30
+ export declare function singlePath(path: Path | Path[]): Path;
31
+ export declare class Path {
32
+ node: Node;
33
+ parent: Node | null;
34
+ parentPath: Path | null;
35
+ key: string | number | null;
36
+ container: Node | Node[] | null;
37
+ listKey: string | null;
38
+ scope: Scope;
39
+ _skip: boolean;
40
+ _stop: boolean;
41
+ _removed: boolean;
42
+ _hubEmpty: boolean;
43
+ constructor(node: Node, parent: Node | null, parentPath: Path | null, key: string | number | null, container: Node | Node[] | null, listKey: string | null, scope?: Scope);
44
+ skip(): void;
45
+ stop(): void;
46
+ get shouldSkip(): boolean;
47
+ get shouldStop(): boolean;
48
+ /** Resolve dotted path like `declaration.declarations.0` or `arguments`. */
49
+ get(dotPath: string): Path | Path[];
50
+ getFunctionParent(): Path | null;
51
+ findParent(pred: (p: Path) => boolean): Path | null;
52
+ replaceWith(replacement: Node): void;
53
+ replaceWithMultiple(nodes: Node[]): void;
54
+ traverse(visitors: Visitors): void;
55
+ isReferencedIdentifier(): this is Path & {
56
+ node: t.Identifier;
57
+ };
58
+ isFunction(): boolean;
59
+ isIdentifier(opts?: {
60
+ name?: string;
61
+ }): boolean;
62
+ isLiteral(): boolean;
63
+ isCallExpression(): boolean;
64
+ isOptionalCallExpression(): boolean;
65
+ isMemberExpression(): boolean;
66
+ isOptionalMemberExpression(): boolean;
67
+ isObjectProperty(opts?: {
68
+ shorthand?: boolean;
69
+ }): boolean;
70
+ isObjectExpression(): boolean;
71
+ isParenthesizedExpression(): boolean;
72
+ isIfStatement(): boolean;
73
+ isObjectPattern(): boolean;
74
+ isArrayExpression(): boolean;
75
+ isArrayPattern(): boolean;
76
+ isVariableDeclarator(): boolean;
77
+ isVariableDeclaration(opts?: {
78
+ kind?: string;
79
+ }): boolean;
80
+ isImportSpecifier(): boolean;
81
+ isImportDefaultSpecifier(): boolean;
82
+ isImportDeclaration(): boolean;
83
+ isJSXElement(): boolean;
84
+ isJSXFragment(): boolean;
85
+ isJSXExpressionContainer(): boolean;
86
+ isJSXAttribute(): boolean;
87
+ isBlockStatement(): boolean;
88
+ isArrowFunctionExpression(): boolean;
89
+ isFunctionExpression(): boolean;
90
+ isFunctionDeclaration(): boolean;
91
+ isSpreadElement(): boolean;
92
+ isTemplateLiteral(): boolean;
93
+ isTemplateElement(): boolean;
94
+ isBinaryExpression(): boolean;
95
+ isLogicalExpression(): boolean;
96
+ isConditionalExpression(): boolean;
97
+ isUnaryExpression(opts?: {
98
+ operator?: string;
99
+ }): boolean;
100
+ isUpdateExpression(): boolean;
101
+ isAssignmentExpression(): boolean;
102
+ isForInStatement(): boolean;
103
+ isForOfStatement(): boolean;
104
+ isTSType(): boolean;
105
+ isTSAsExpression(): boolean;
106
+ isTSTypeAssertion(): boolean;
107
+ isTSNonNullExpression(): boolean;
108
+ isTSSatisfiesExpression(): boolean;
109
+ isProgram(): boolean;
110
+ assertExpression(): void;
111
+ }
112
+ export type NodePath<N extends Node = Node> = Path & {
113
+ node: N;
114
+ };
115
+ export type TraverseOptions = Visitors;
116
+ export declare function traverse(ast: Node, visitors: Visitors): void;
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Re-export path traversal for compiler passes.
3
+ */
4
+ export { traverse, Path, Scope, Binding, singlePath, type NodePath, type Visitors, type TraverseOptions, } from "./path";
@@ -0,0 +1,267 @@
1
+ /**
2
+ * ESTree node builders and type guards for oxc ASTs.
3
+ */
4
+ import type { Expression, Function, Identifier, Literal, Node } from "./node";
5
+ export declare function identifier(name: string): Identifier;
6
+ export declare function stringLiteral(value: string): Literal;
7
+ export declare function numericLiteral(value: number): Literal;
8
+ export declare function booleanLiteral(value: boolean): Literal;
9
+ export declare function nullLiteral(): Literal;
10
+ export declare function callExpression(callee: Expression, args: Expression[]): CallExpression;
11
+ export declare function memberExpression(object: Expression, property: Expression, computed?: boolean): Node;
12
+ export declare function arrowFunctionExpression(params: Node[], body: Node, expression?: boolean): Function & {
13
+ type: "ArrowFunctionExpression";
14
+ };
15
+ export declare function functionExpression(id: Identifier | Node | null, params: Node[], body: Node, generator?: boolean, async?: boolean): Function;
16
+ export declare function functionDeclaration(id: Identifier | Node | null, params: Node[], body: Node, generator?: boolean, async?: boolean): Function;
17
+ export declare function variableDeclarator(id: Node, init?: Expression | null): Node;
18
+ export declare function variableDeclaration(kind: "const" | "let" | "var", declarations: Node[]): VariableDeclaration;
19
+ export declare function arrayExpression(elements: (Expression | null)[]): Node;
20
+ export declare function objectExpression(properties: Node[]): Node;
21
+ export declare function objectProperty(key: Node, value: Node, computed?: boolean, shorthand?: boolean): Node;
22
+ export declare function objectPattern(properties: Node[]): ObjectPattern;
23
+ export declare function restElement(argument: Node): Node;
24
+ export declare function arrayPattern(elements: (Node | null)[]): Node;
25
+ export declare function assignmentPattern(left: Node, right: Expression): Node;
26
+ export declare function importSpecifier(local: Identifier, imported: Identifier): Node;
27
+ export declare function importDeclaration(specifiers: Node[], source: Literal): ImportDeclaration;
28
+ export declare function exportNamedDeclaration(declaration: Node | null, specifiers?: Node[]): Node;
29
+ export declare function exportDefaultDeclaration(declaration: Node): Node;
30
+ export declare function jsxExpressionContainer(expression: Expression): Node;
31
+ export declare function blockStatement(body: Node[]): Node & {
32
+ type: "BlockStatement";
33
+ body: Node[];
34
+ };
35
+ export declare function returnStatement(argument?: Expression | null): Node;
36
+ export declare function binaryExpression(operator: string, left: Expression, right: Expression): Node;
37
+ export declare function conditionalExpression(test: Expression, consequent: Expression, alternate: Expression): Node;
38
+ export declare function unaryExpression(operator: string, argument: Expression, prefix?: boolean): Node;
39
+ export declare function tsNonNullExpression(expression: Expression): Node;
40
+ export declare function tsAsExpression(expression: Expression, typeAnnotation: Node): Node;
41
+ export declare function tsTypeAssertion(expression: Expression, typeAnnotation: Node): Node;
42
+ export declare function isNode(n: unknown): n is Node;
43
+ export declare function isIdentifier(n: unknown, opts?: {
44
+ name?: string;
45
+ }): n is Identifier;
46
+ export declare function isLiteral(n: unknown): n is Literal;
47
+ export declare function isStringLiteral(n: unknown, opts?: {
48
+ value?: string;
49
+ }): n is Literal & {
50
+ value: string;
51
+ };
52
+ export declare function isNumericLiteral(n: unknown): n is Literal;
53
+ export declare function isBooleanLiteral(n: unknown): n is Literal;
54
+ export declare function isNullLiteral(n: unknown): n is Literal;
55
+ export declare function isTemplateLiteral(n: unknown): n is Node & {
56
+ type: "TemplateLiteral";
57
+ expressions: Node[];
58
+ quasis: Node[];
59
+ };
60
+ export declare function templateElementRaw(n: Node | undefined | null): string;
61
+ export declare function isCallExpression(n: unknown): n is Node & {
62
+ type: "CallExpression";
63
+ callee: Node;
64
+ arguments: Node[];
65
+ };
66
+ export declare function isOptionalCallExpression(n: unknown): boolean;
67
+ export declare function isMemberExpression(n: unknown): n is Node & {
68
+ type: "MemberExpression";
69
+ object: Node;
70
+ property: Node;
71
+ computed?: boolean;
72
+ optional?: boolean;
73
+ };
74
+ export declare function isOptionalMemberExpression(n: unknown): n is Node & {
75
+ type: string;
76
+ object: Node;
77
+ property: Node;
78
+ computed?: boolean;
79
+ optional?: boolean;
80
+ };
81
+ export declare function isChainExpression(n: unknown): boolean;
82
+ /** Unwrap ChainExpression to the inner member/call expression. */
83
+ export declare function unwrapChain(n: Node): Node;
84
+ export declare function isParenthesizedExpression(n: unknown): boolean;
85
+ /**
86
+ * Strip ParenthesizedExpression wrappers. Oxc preserves them by default;
87
+ * Babel typically does not.
88
+ */
89
+ export declare function unwrapParens(n: Node): Node;
90
+ /** Unwrap parens and ChainExpression so CallExpression fields are accessible. */
91
+ export declare function unwrapCall(n: Node): Node;
92
+ export declare function isObjectExpression(n: unknown): n is Node & {
93
+ type: "ObjectExpression";
94
+ properties: Node[];
95
+ };
96
+ export declare function isObjectProperty(n: unknown): n is Node & {
97
+ type: "Property" | "ObjectProperty";
98
+ key: Node;
99
+ value: Node;
100
+ computed?: boolean;
101
+ shorthand?: boolean;
102
+ };
103
+ export declare function isObjectPattern(n: unknown): n is Node & {
104
+ type: "ObjectPattern";
105
+ properties: Node[];
106
+ };
107
+ export declare function isArrayPattern(n: unknown): n is Node & {
108
+ type: "ArrayPattern";
109
+ elements: (Node | null)[];
110
+ };
111
+ export declare function isRestElement(n: unknown): n is Node & {
112
+ type: "RestElement";
113
+ argument: Node;
114
+ };
115
+ export declare function isSpreadElement(n: unknown): n is Node & {
116
+ type: "SpreadElement";
117
+ argument: Node;
118
+ };
119
+ export declare function isAssignmentPattern(n: unknown): n is Node & {
120
+ type: "AssignmentPattern";
121
+ left: Node;
122
+ right: Node;
123
+ };
124
+ export declare function isBlockStatement(n: unknown): n is Node & {
125
+ type: "BlockStatement";
126
+ body: Node[];
127
+ };
128
+ export declare function isVariableDeclaration(n: unknown, opts?: {
129
+ kind?: string;
130
+ }): n is Node & {
131
+ type: "VariableDeclaration";
132
+ kind: string;
133
+ declarations: Node[];
134
+ };
135
+ export declare function isVariableDeclarator(n: unknown): n is Node & {
136
+ type: "VariableDeclarator";
137
+ id: Node;
138
+ init?: Node | null;
139
+ };
140
+ export declare function isFunctionDeclaration(n: unknown): n is Function;
141
+ export declare function isFunctionExpression(n: unknown): n is Function;
142
+ export declare function isArrowFunctionExpression(n: unknown): n is Function;
143
+ export declare function isFunction(n: unknown): n is Function;
144
+ export declare function isImportDeclaration(n: unknown): n is Node & {
145
+ type: "ImportDeclaration";
146
+ specifiers: Node[];
147
+ source: Literal;
148
+ };
149
+ export declare function isImportSpecifier(n: unknown): n is Node & {
150
+ type: "ImportSpecifier";
151
+ local: Identifier;
152
+ imported: Node;
153
+ };
154
+ export declare function isImportDefaultSpecifier(n: unknown): n is Node & {
155
+ type: "ImportDefaultSpecifier";
156
+ local: Identifier;
157
+ };
158
+ export declare function isImportNamespaceSpecifier(n: unknown): n is Node & {
159
+ type: "ImportNamespaceSpecifier";
160
+ local: Identifier;
161
+ };
162
+ export declare function isExportSpecifier(n: unknown): boolean;
163
+ export declare function isClassDeclaration(n: unknown): boolean;
164
+ export declare function isJSXElement(n: unknown): n is Node & {
165
+ type: "JSXElement";
166
+ openingElement: Node;
167
+ children: Node[];
168
+ };
169
+ export declare function isJSXFragment(n: unknown): boolean;
170
+ export declare function isJSXIdentifier(n: unknown): n is Node & {
171
+ type: "JSXIdentifier";
172
+ name: string;
173
+ };
174
+ export declare function isJSXOpeningElement(n: unknown): n is Node & {
175
+ type: "JSXOpeningElement";
176
+ name: Node;
177
+ attributes: Node[];
178
+ };
179
+ export declare function isJSXMemberExpression(n: unknown): n is Node & {
180
+ type: "JSXMemberExpression";
181
+ object: Node;
182
+ property: Node;
183
+ };
184
+ export declare function isJSXAttribute(n: unknown): n is Node & {
185
+ type: "JSXAttribute";
186
+ name: Node;
187
+ value?: Node | null;
188
+ };
189
+ export declare function isJSXSpreadAttribute(n: unknown): boolean;
190
+ export declare function isJSXExpressionContainer(n: unknown): n is Node & {
191
+ type: "JSXExpressionContainer";
192
+ expression: Node;
193
+ };
194
+ export declare function isJSXEmptyExpression(n: unknown): boolean;
195
+ export declare function isTSNonNullExpression(n: unknown): n is Node & {
196
+ type: "TSNonNullExpression";
197
+ expression: Node;
198
+ };
199
+ export declare function isTSAsExpression(n: unknown): boolean;
200
+ export declare function isTSTypeAssertion(n: unknown): boolean;
201
+ export declare function isTSSatisfiesExpression(n: unknown): boolean;
202
+ export declare function isTSTypeAnnotation(n: unknown): boolean;
203
+ export declare function isExpression(n: unknown): n is Expression;
204
+ export declare function importedBindingName(n: Node | undefined | null): string | null;
205
+ export declare function moduleSourceValue(n: Node | undefined | null): string | null;
206
+ export declare function assertExpression(n: unknown): asserts n is Expression;
207
+ /** Type-only aliases used as `t.Function` etc. in annotations. */
208
+ export type { Node, Expression, Function, Identifier, Literal, Program, File, LVal, } from "./node";
209
+ export type MemberExpression = Node;
210
+ export type OptionalMemberExpression = Node;
211
+ export type CallExpression = Node & {
212
+ type: "CallExpression";
213
+ callee: Node;
214
+ arguments: Node[];
215
+ };
216
+ export type OptionalCallExpression = Node;
217
+ export type ArrowFunctionExpression = Function & {
218
+ type: "ArrowFunctionExpression";
219
+ };
220
+ export type FunctionExpression = Function;
221
+ export type FunctionDeclaration = Function;
222
+ export type ObjectPattern = Node & {
223
+ type: "ObjectPattern";
224
+ properties: Node[];
225
+ };
226
+ export type ObjectExpression = Node & {
227
+ type: "ObjectExpression";
228
+ properties: Node[];
229
+ };
230
+ export type VariableDeclarator = Node;
231
+ export type VariableDeclaration = Node & {
232
+ type: "VariableDeclaration";
233
+ kind: string;
234
+ declarations: Node[];
235
+ };
236
+ export type ExportNamedDeclaration = Node & {
237
+ type: "ExportNamedDeclaration";
238
+ declaration?: Node | null;
239
+ specifiers: Node[];
240
+ };
241
+ export type ImportDeclaration = Node & {
242
+ type: "ImportDeclaration";
243
+ specifiers: Node[];
244
+ source: Literal;
245
+ };
246
+ export type JSXElement = Node & {
247
+ type: "JSXElement";
248
+ openingElement: Node;
249
+ children: Node[];
250
+ };
251
+ export type JSXAttribute = Node;
252
+ export type JSXOpeningElement = Node & {
253
+ type: "JSXOpeningElement";
254
+ name: Node;
255
+ attributes: Node[];
256
+ };
257
+ export type JSXIdentifier = Node & {
258
+ type: "JSXIdentifier";
259
+ name: string;
260
+ };
261
+ export type JSXMemberExpression = Node;
262
+ export type JSXSpreadAttribute = Node;
263
+ export type BlockStatement = Node & {
264
+ type: "BlockStatement";
265
+ body: Node[];
266
+ };
267
+ export type StringLiteral = Literal;
package/dist/auto-cc.d.ts CHANGED
@@ -26,7 +26,7 @@
26
26
  * `sinwan` / `sinwan/component`, an `import { cc } from "sinwan/component"` is
27
27
  * prepended so the subsequent reactive-wrap pass detects the components.
28
28
  */
29
- import * as t from "@babel/types";
29
+ import * as t from "./ast/types";
30
30
  /**
31
31
  * Mutates the AST, wrapping exported component-like functions with `cc(...)`.
32
32
  * Returns `true` if any wrapping was performed.