kea-typegen 3.4.0 → 3.4.2
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/CHANGELOG.md +8 -2
- package/dist/package.json +23 -20
- package/dist/src/cli/typegen.js.map +1 -1
- package/dist/src/print/print.js +6 -5
- package/dist/src/print/print.js.map +1 -1
- package/dist/src/print/printActionCreators.js +2 -1
- package/dist/src/print/printActionCreators.js.map +1 -1
- package/dist/src/print/printActionKeys.js +2 -1
- package/dist/src/print/printActionKeys.js.map +1 -1
- package/dist/src/print/printActionTypes.js +2 -1
- package/dist/src/print/printActionTypes.js.map +1 -1
- package/dist/src/print/printActions.js +2 -1
- package/dist/src/print/printActions.js.map +1 -1
- package/dist/src/print/printAsyncActions.js +2 -1
- package/dist/src/print/printAsyncActions.js.map +1 -1
- package/dist/src/print/printDefaults.js +2 -1
- package/dist/src/print/printDefaults.js.map +1 -1
- package/dist/src/print/printEvents.js +2 -1
- package/dist/src/print/printEvents.js.map +1 -1
- package/dist/src/print/printInternalExtraInput.js +2 -1
- package/dist/src/print/printInternalExtraInput.js.map +1 -1
- package/dist/src/print/printInternalReducerActions.js +2 -1
- package/dist/src/print/printInternalReducerActions.js.map +1 -1
- package/dist/src/print/printInternalSelectorTypes.js +2 -1
- package/dist/src/print/printInternalSelectorTypes.js.map +1 -1
- package/dist/src/print/printKey.js +2 -1
- package/dist/src/print/printKey.js.map +1 -1
- package/dist/src/print/printListeners.js +2 -1
- package/dist/src/print/printListeners.js.map +1 -1
- package/dist/src/print/printProps.js +2 -1
- package/dist/src/print/printProps.js.map +1 -1
- package/dist/src/print/printReducer.js +2 -1
- package/dist/src/print/printReducer.js.map +1 -1
- package/dist/src/print/printReducers.js +2 -1
- package/dist/src/print/printReducers.js.map +1 -1
- package/dist/src/print/printSelector.js +2 -1
- package/dist/src/print/printSelector.js.map +1 -1
- package/dist/src/print/printSelectors.js +2 -1
- package/dist/src/print/printSelectors.js.map +1 -1
- package/dist/src/print/printSharedListeners.js +2 -1
- package/dist/src/print/printSharedListeners.js.map +1 -1
- package/dist/src/print/printValues.js +2 -1
- package/dist/src/print/printValues.js.map +1 -1
- package/dist/src/typegen.js +2 -1
- package/dist/src/typegen.js.map +1 -1
- package/dist/src/utils.js +21 -21
- package/dist/src/utils.js.map +1 -1
- package/dist/src/visit/visit.js +9 -6
- package/dist/src/visit/visit.js.map +1 -1
- package/dist/src/visit/visitActions.js +2 -1
- package/dist/src/visit/visitActions.js.map +1 -1
- package/dist/src/visit/visitConnect.js +2 -1
- package/dist/src/visit/visitConnect.js.map +1 -1
- package/dist/src/visit/visitDefaults.js +2 -1
- package/dist/src/visit/visitDefaults.js.map +1 -1
- package/dist/src/visit/visitEvents.js +2 -1
- package/dist/src/visit/visitEvents.js.map +1 -1
- package/dist/src/visit/visitKey.js +4 -2
- package/dist/src/visit/visitKey.js.map +1 -1
- package/dist/src/visit/visitListeners.js +2 -1
- package/dist/src/visit/visitListeners.js.map +1 -1
- package/dist/src/visit/visitLoaders.js +2 -1
- package/dist/src/visit/visitLoaders.js.map +1 -1
- package/dist/src/visit/visitPath.js +2 -1
- package/dist/src/visit/visitPath.js.map +1 -1
- package/dist/src/visit/visitProps.js +2 -1
- package/dist/src/visit/visitProps.js.map +1 -1
- package/dist/src/visit/visitReducers.js +2 -1
- package/dist/src/visit/visitReducers.js.map +1 -1
- package/dist/src/visit/visitSelectors.js +2 -1
- package/dist/src/visit/visitSelectors.js.map +1 -1
- package/dist/src/visit/visitSharedListeners.js +4 -2
- package/dist/src/visit/visitSharedListeners.js.map +1 -1
- package/dist/src/visit/visitWindowValues.js +4 -2
- package/dist/src/visit/visitWindowValues.js.map +1 -1
- package/dist/src/write/convertToBuilders.js +8 -2
- package/dist/src/write/convertToBuilders.js.map +1 -1
- package/dist/src/write/utils.js +5 -5
- package/dist/src/write/utils.js.map +1 -1
- package/dist/src/write/writePaths.js +2 -1
- package/dist/src/write/writePaths.js.map +1 -1
- package/dist/src/write/writeTypeImports.js +2 -1
- package/dist/src/write/writeTypeImports.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/form-plugin/lib/form-plugin/src/typegen.js +7 -17
- package/form-plugin/yarn.lock +661 -696
- package/package.json +23 -20
- package/samples/builderLogic.ts +56 -1
- package/samples/builderLogicType.ts +1334 -1
- package/samples/complexLogic.ts +20 -0
- package/samples/complexLogicType.ts +67 -10
- package/samples/inline-plugin/typegen.ts +9 -8
- package/samples/pluginLogic.ts +1 -1
- package/samples/pluginLogicType.ts +6 -6
- package/samples/typed-builder/typedForm.typegen.ts +1 -1
- package/src/utils.ts +1 -1
- package/src/visit/visit.ts +5 -3
- package/src/visit/visitKey.ts +2 -2
- package/src/visit/visitSharedListeners.ts +2 -2
- package/src/visit/visitWindowValues.ts +2 -2
- package/src/write/convertToBuilders.ts +10 -8
package/samples/complexLogic.ts
CHANGED
|
@@ -34,6 +34,26 @@ export type DashboardItemType = {
|
|
|
34
34
|
key17: string
|
|
35
35
|
key18: string
|
|
36
36
|
key19: string
|
|
37
|
+
key20: string
|
|
38
|
+
key21: string
|
|
39
|
+
key22: string
|
|
40
|
+
key23: string
|
|
41
|
+
key24: string
|
|
42
|
+
key25: string
|
|
43
|
+
key26: string
|
|
44
|
+
key27: string
|
|
45
|
+
key28: string
|
|
46
|
+
key29: string
|
|
47
|
+
key30: string
|
|
48
|
+
key31: string
|
|
49
|
+
key32: string
|
|
50
|
+
key33: string
|
|
51
|
+
key34: string
|
|
52
|
+
key35: string
|
|
53
|
+
key36: string
|
|
54
|
+
key37: string
|
|
55
|
+
key38: string
|
|
56
|
+
key39: string
|
|
37
57
|
}
|
|
38
58
|
function newAction(element: HTMLElement | null): Partial<ActionType> {
|
|
39
59
|
return {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Generated by kea-typegen on
|
|
1
|
+
// Generated by kea-typegen on Fri, 13 Jun 2025 10:53:30 GMT. DO NOT EDIT THIS FILE MANUALLY.
|
|
2
2
|
|
|
3
3
|
import type { Logic } from 'kea'
|
|
4
4
|
|
|
@@ -101,7 +101,27 @@ export interface complexLogicType extends Logic {
|
|
|
101
101
|
key18: string
|
|
102
102
|
key19: string
|
|
103
103
|
key2: string
|
|
104
|
+
key20: string
|
|
105
|
+
key21: string
|
|
106
|
+
key22: string
|
|
107
|
+
key23: string
|
|
108
|
+
key24: string
|
|
109
|
+
key25: string
|
|
110
|
+
key26: string
|
|
111
|
+
key27: string
|
|
112
|
+
key28: string
|
|
113
|
+
key29: string
|
|
104
114
|
key3: string
|
|
115
|
+
key30: string
|
|
116
|
+
key31: string
|
|
117
|
+
key32: string
|
|
118
|
+
key33: string
|
|
119
|
+
key34: string
|
|
120
|
+
key35: string
|
|
121
|
+
key36: string
|
|
122
|
+
key37: string
|
|
123
|
+
key38: string
|
|
124
|
+
key39: string
|
|
105
125
|
key4: string
|
|
106
126
|
key5: string
|
|
107
127
|
key6: string
|
|
@@ -269,7 +289,27 @@ export interface complexLogicType extends Logic {
|
|
|
269
289
|
key18: string
|
|
270
290
|
key19: string
|
|
271
291
|
key2: string
|
|
292
|
+
key20: string
|
|
293
|
+
key21: string
|
|
294
|
+
key22: string
|
|
295
|
+
key23: string
|
|
296
|
+
key24: string
|
|
297
|
+
key25: string
|
|
298
|
+
key26: string
|
|
299
|
+
key27: string
|
|
300
|
+
key28: string
|
|
301
|
+
key29: string
|
|
272
302
|
key3: string
|
|
303
|
+
key30: string
|
|
304
|
+
key31: string
|
|
305
|
+
key32: string
|
|
306
|
+
key33: string
|
|
307
|
+
key34: string
|
|
308
|
+
key35: string
|
|
309
|
+
key36: string
|
|
310
|
+
key37: string
|
|
311
|
+
key38: string
|
|
312
|
+
key39: string
|
|
273
313
|
key4: string
|
|
274
314
|
key5: string
|
|
275
315
|
key6: string
|
|
@@ -305,7 +345,27 @@ export interface complexLogicType extends Logic {
|
|
|
305
345
|
key18: string
|
|
306
346
|
key19: string
|
|
307
347
|
key2: string
|
|
348
|
+
key20: string
|
|
349
|
+
key21: string
|
|
350
|
+
key22: string
|
|
351
|
+
key23: string
|
|
352
|
+
key24: string
|
|
353
|
+
key25: string
|
|
354
|
+
key26: string
|
|
355
|
+
key27: string
|
|
356
|
+
key28: string
|
|
357
|
+
key29: string
|
|
308
358
|
key3: string
|
|
359
|
+
key30: string
|
|
360
|
+
key31: string
|
|
361
|
+
key32: string
|
|
362
|
+
key33: string
|
|
363
|
+
key34: string
|
|
364
|
+
key35: string
|
|
365
|
+
key36: string
|
|
366
|
+
key37: string
|
|
367
|
+
key38: string
|
|
368
|
+
key39: string
|
|
309
369
|
key4: string
|
|
310
370
|
key5: string
|
|
311
371
|
key6: string
|
|
@@ -317,17 +377,14 @@ export interface complexLogicType extends Logic {
|
|
|
317
377
|
_isKea: true
|
|
318
378
|
_isKeaWithKey: false
|
|
319
379
|
__keaTypeGenInternalSelectorTypes: {
|
|
320
|
-
selectedAction: (
|
|
321
|
-
|
|
322
|
-
newActionForElement: HTMLElement | null,
|
|
323
|
-
) => ActionType | null
|
|
324
|
-
initialValuesForForm: (selectedAction: ActionType | null) => ActionForm
|
|
380
|
+
selectedAction: (selectedActionId: number | 'new', newActionForElement: HTMLElement) => ActionType | null
|
|
381
|
+
initialValuesForForm: (selectedAction: ActionType) => ActionForm
|
|
325
382
|
selectedEditedAction: (
|
|
326
|
-
selectedAction: ActionType
|
|
383
|
+
selectedAction: ActionType,
|
|
327
384
|
initialValuesForForm: ActionForm,
|
|
328
|
-
form: FormInstance
|
|
329
|
-
editingFields: AntdFieldData[]
|
|
330
|
-
inspectingElement: number
|
|
385
|
+
form: FormInstance,
|
|
386
|
+
editingFields: AntdFieldData[],
|
|
387
|
+
inspectingElement: number,
|
|
331
388
|
counter: number,
|
|
332
389
|
) => ActionForm
|
|
333
390
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Plugin } from '../../src/types'
|
|
2
2
|
import * as ts from 'typescript'
|
|
3
|
+
import { factory } from 'typescript'
|
|
3
4
|
|
|
4
5
|
export default {
|
|
5
6
|
visitKeaProperty({ name, parsedLogic, type }) {
|
|
@@ -10,12 +11,12 @@ export default {
|
|
|
10
11
|
parsedLogic.actions.push({
|
|
11
12
|
name: 'inlineAction',
|
|
12
13
|
parameters: [],
|
|
13
|
-
returnTypeNode:
|
|
14
|
-
|
|
14
|
+
returnTypeNode: factory.createTypeLiteralNode([
|
|
15
|
+
factory.createPropertySignature(
|
|
15
16
|
undefined,
|
|
16
|
-
|
|
17
|
+
factory.createIdentifier('value'),
|
|
17
18
|
undefined,
|
|
18
|
-
|
|
19
|
+
factory.createKeywordTypeNode(ts.SyntaxKind.BooleanKeyword),
|
|
19
20
|
),
|
|
20
21
|
]),
|
|
21
22
|
})
|
|
@@ -23,12 +24,12 @@ export default {
|
|
|
23
24
|
// add reducer "form" to parsedLogic
|
|
24
25
|
parsedLogic.reducers.push({
|
|
25
26
|
name: 'inlineReducer',
|
|
26
|
-
typeNode:
|
|
27
|
-
|
|
27
|
+
typeNode: factory.createTypeLiteralNode([
|
|
28
|
+
factory.createPropertySignature(
|
|
28
29
|
undefined,
|
|
29
|
-
|
|
30
|
+
factory.createIdentifier('asd'),
|
|
30
31
|
undefined,
|
|
31
|
-
|
|
32
|
+
factory.createKeywordTypeNode(ts.SyntaxKind.BooleanKeyword),
|
|
32
33
|
),
|
|
33
34
|
]),
|
|
34
35
|
})
|
package/samples/pluginLogic.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Generated by kea-typegen on
|
|
1
|
+
// Generated by kea-typegen on Thu, 19 Jun 2025 09:28:06 GMT. DO NOT EDIT THIS FILE MANUALLY.
|
|
2
2
|
|
|
3
3
|
import type { Logic, NotReallyHereButImportedBecausePlugin } from 'kea'
|
|
4
4
|
|
|
@@ -136,17 +136,17 @@ export interface pluginLogicType extends Logic {
|
|
|
136
136
|
export interface anotherPluginLogicType extends Logic {
|
|
137
137
|
actionCreators: {
|
|
138
138
|
submitForm: () => {
|
|
139
|
-
type: 'submit form (
|
|
139
|
+
type: 'submit form (anotherPluginLogic)'
|
|
140
140
|
payload: {
|
|
141
141
|
value: boolean
|
|
142
142
|
}
|
|
143
143
|
}
|
|
144
144
|
}
|
|
145
145
|
actionKeys: {
|
|
146
|
-
'submit form (
|
|
146
|
+
'submit form (anotherPluginLogic)': 'submitForm'
|
|
147
147
|
}
|
|
148
148
|
actionTypes: {
|
|
149
|
-
submitForm: 'submit form (
|
|
149
|
+
submitForm: 'submit form (anotherPluginLogic)'
|
|
150
150
|
}
|
|
151
151
|
actions: {
|
|
152
152
|
submitForm: () => void
|
|
@@ -163,8 +163,8 @@ export interface anotherPluginLogicType extends Logic {
|
|
|
163
163
|
events: {}
|
|
164
164
|
key: undefined
|
|
165
165
|
listeners: {}
|
|
166
|
-
path: ['
|
|
167
|
-
pathString: '
|
|
166
|
+
path: ['anotherPluginLogic']
|
|
167
|
+
pathString: 'anotherPluginLogic'
|
|
168
168
|
props: Record<string, unknown>
|
|
169
169
|
reducer: (
|
|
170
170
|
state: any,
|
package/src/utils.ts
CHANGED
|
@@ -70,7 +70,7 @@ export function getTypeNodeForNode(node: ts.Node, checker: ts.TypeChecker): ts.T
|
|
|
70
70
|
} else if (ts.isArrayLiteralExpression(node) && node.elements.length === 0) {
|
|
71
71
|
typeNode = factory.createArrayTypeNode(factory.createKeywordTypeNode(SyntaxKind.AnyKeyword))
|
|
72
72
|
} else {
|
|
73
|
-
typeNode = checker.typeToTypeNode(checker.getTypeAtLocation(node), undefined,
|
|
73
|
+
typeNode = checker.typeToTypeNode(checker.getTypeAtLocation(node), undefined, NodeBuilderFlags.NoTruncation)
|
|
74
74
|
}
|
|
75
75
|
} else {
|
|
76
76
|
typeNode = factory.createKeywordTypeNode(SyntaxKind.AnyKeyword)
|
package/src/visit/visit.ts
CHANGED
|
@@ -25,6 +25,7 @@ import { visitEvents } from './visitEvents'
|
|
|
25
25
|
import { visitDefaults } from './visitDefaults'
|
|
26
26
|
import { visitSharedListeners } from './visitSharedListeners'
|
|
27
27
|
import { cloneNode } from 'ts-clone-node'
|
|
28
|
+
import {NodeBuilderFlags} from "typescript";
|
|
28
29
|
|
|
29
30
|
const visitFunctions = {
|
|
30
31
|
actions: visitActions,
|
|
@@ -34,6 +35,7 @@ const visitFunctions = {
|
|
|
34
35
|
key: visitKey,
|
|
35
36
|
listeners: visitListeners,
|
|
36
37
|
loaders: visitLoaders,
|
|
38
|
+
lazyLoaders: visitLoaders,
|
|
37
39
|
path: visitPath,
|
|
38
40
|
props: visitProps,
|
|
39
41
|
reducers: visitReducers,
|
|
@@ -259,7 +261,7 @@ export function visitKeaCalls(
|
|
|
259
261
|
}
|
|
260
262
|
const name = symbol.getName()
|
|
261
263
|
const type = checker.getTypeOfSymbolAtLocation(symbol, symbol.valueDeclaration)
|
|
262
|
-
const typeNode = type ? checker.typeToTypeNode(type, undefined,
|
|
264
|
+
const typeNode = type ? checker.typeToTypeNode(type, undefined, NodeBuilderFlags.NoTruncation) : null
|
|
263
265
|
calls.push({ name, type, typeNode, expression: inputProperty.initializer, typeBuilders: [] })
|
|
264
266
|
}
|
|
265
267
|
} else if (ts.isArrayLiteralExpression(input)) {
|
|
@@ -271,7 +273,7 @@ export function visitKeaCalls(
|
|
|
271
273
|
const builderName = callExpression.expression.getText()
|
|
272
274
|
const argument = callExpression.arguments[0]
|
|
273
275
|
const type = checker.getTypeAtLocation(argument)
|
|
274
|
-
const typeNode = type ? checker.typeToTypeNode(type, undefined,
|
|
276
|
+
const typeNode = type ? checker.typeToTypeNode(type, undefined, NodeBuilderFlags.NoTruncation) : null
|
|
275
277
|
|
|
276
278
|
const identifier = callExpression.expression
|
|
277
279
|
const symbol = checker.getSymbolAtLocation(identifier)
|
|
@@ -363,7 +365,7 @@ export function visitKeaCalls(
|
|
|
363
365
|
|
|
364
366
|
if (typeNode && ts.isFunctionTypeNode(typeNode)) {
|
|
365
367
|
type = type.getCallSignatures()[0].getReturnType()
|
|
366
|
-
typeNode = type ? checker.typeToTypeNode(type, undefined,
|
|
368
|
+
typeNode = type ? checker.typeToTypeNode(type, undefined, NodeBuilderFlags.NoTruncation) : null
|
|
367
369
|
}
|
|
368
370
|
|
|
369
371
|
visitFunctions[name]?.(parsedLogic, type, expression)
|
package/src/visit/visitKey.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { ParsedLogic } from '../types'
|
|
2
2
|
import { cloneNodeSorted, gatherImports } from '../utils'
|
|
3
|
-
import {
|
|
3
|
+
import {Expression, NodeBuilderFlags, Type} from 'typescript'
|
|
4
4
|
|
|
5
5
|
export function visitKey(parsedLogic: ParsedLogic, type: Type, expression: Expression) {
|
|
6
6
|
const { checker } = parsedLogic
|
|
7
|
-
const typeNode = checker.typeToTypeNode(type, undefined,
|
|
7
|
+
const typeNode = checker.typeToTypeNode(type, undefined, NodeBuilderFlags.NoTruncation)
|
|
8
8
|
gatherImports(typeNode, checker, parsedLogic)
|
|
9
9
|
|
|
10
10
|
parsedLogic.keyType = cloneNodeSorted(typeNode)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ParsedLogic } from '../types'
|
|
2
2
|
import * as ts from 'typescript'
|
|
3
3
|
import { cloneNodeSorted, gatherImports } from '../utils'
|
|
4
|
-
import {
|
|
4
|
+
import {Expression, NodeBuilderFlags, Type} from 'typescript'
|
|
5
5
|
|
|
6
6
|
export function visitSharedListeners(parsedLogic: ParsedLogic, type: Type, expression: Expression) {
|
|
7
7
|
const { checker } = parsedLogic
|
|
@@ -15,7 +15,7 @@ export function visitSharedListeners(parsedLogic: ParsedLogic, type: Type, expre
|
|
|
15
15
|
const firstParameter = value.parameters[0]
|
|
16
16
|
if (firstParameter) {
|
|
17
17
|
typeNode = cloneNodeSorted(
|
|
18
|
-
checker.typeToTypeNode(checker.getTypeAtLocation(firstParameter), undefined,
|
|
18
|
+
checker.typeToTypeNode(checker.getTypeAtLocation(firstParameter), undefined, NodeBuilderFlags.NoTruncation),
|
|
19
19
|
)
|
|
20
20
|
gatherImports(typeNode, checker, parsedLogic)
|
|
21
21
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ParsedLogic } from '../types'
|
|
2
2
|
import * as ts from 'typescript'
|
|
3
3
|
import { gatherImports } from '../utils'
|
|
4
|
-
import {
|
|
4
|
+
import {Expression, NodeBuilderFlags, Type} from 'typescript'
|
|
5
5
|
|
|
6
6
|
export function visitWindowValues(parsedLogic: ParsedLogic, type: Type, expression: Expression) {
|
|
7
7
|
const { checker } = parsedLogic
|
|
@@ -14,7 +14,7 @@ export function visitWindowValues(parsedLogic: ParsedLogic, type: Type, expressi
|
|
|
14
14
|
if (value && ts.isFunctionLike(value)) {
|
|
15
15
|
const type = checker.getTypeOfSymbolAtLocation(property, value)
|
|
16
16
|
const signature = type.getCallSignatures()[0]
|
|
17
|
-
const typeNode = checker.typeToTypeNode(signature.getReturnType(), undefined,
|
|
17
|
+
const typeNode = checker.typeToTypeNode(signature.getReturnType(), undefined, NodeBuilderFlags.NoTruncation)
|
|
18
18
|
gatherImports(typeNode, checker, parsedLogic)
|
|
19
19
|
|
|
20
20
|
parsedLogic.reducers.push({ name, typeNode })
|
|
@@ -69,7 +69,7 @@ export function convertToBuilders(
|
|
|
69
69
|
const arg = stmt.arguments[0]
|
|
70
70
|
|
|
71
71
|
if (t.ObjectExpression.check(arg)) {
|
|
72
|
-
const propertiesMap
|
|
72
|
+
const propertiesMap = Object.fromEntries(
|
|
73
73
|
arg.properties
|
|
74
74
|
.map((p) => [t.ObjectProperty.check(p) && t.Identifier.check(p.key) ? p.key.name : null, p])
|
|
75
75
|
.filter(([key]) => key !== null),
|
|
@@ -84,7 +84,7 @@ export function convertToBuilders(
|
|
|
84
84
|
const renameTo =
|
|
85
85
|
Array.isArray(importFromOrArray) && importFromOrArray.length > 1 ? importFromOrArray[1] : key
|
|
86
86
|
|
|
87
|
-
newEntries.push(b.callExpression(b.identifier(renameTo), [propertiesMap[key].value
|
|
87
|
+
newEntries.push(b.callExpression(b.identifier(renameTo), [propertiesMap[key].value]))
|
|
88
88
|
neededImports[importFrom] ??= []
|
|
89
89
|
if (!neededImports[importFrom].find(([l]) => l === renameTo)) {
|
|
90
90
|
neededImports[importFrom].push([renameTo, renameTo])
|
|
@@ -95,14 +95,16 @@ export function convertToBuilders(
|
|
|
95
95
|
const unsupported = propertyKeys.filter((p) => !supportedProperties[p])
|
|
96
96
|
if (unsupported.length > 0) {
|
|
97
97
|
console.warn(
|
|
98
|
-
`❗ Logic "${parsedLogic.logicName}",
|
|
98
|
+
`❗ Logic "${parsedLogic.logicName}", converted unsupported keys (${unsupported.join(
|
|
99
|
+
', ',
|
|
100
|
+
)}) to builders without imports`,
|
|
99
101
|
)
|
|
100
102
|
}
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
103
|
+
for (const key of unsupported) {
|
|
104
|
+
if (propertiesMap[key] && t.ObjectProperty.check(propertiesMap[key])) {
|
|
105
|
+
newEntries.push(b.callExpression(b.identifier(key), [propertiesMap[key].value]))
|
|
106
|
+
}
|
|
107
|
+
}
|
|
106
108
|
|
|
107
109
|
stmt.arguments[0] = b.arrayExpression(newEntries)
|
|
108
110
|
}
|