kea-typegen 1.2.1 → 1.4.1
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 +75 -32
- package/dist/package.json +18 -17
- package/dist/src/__tests__/e2e/actions.js +4 -4
- package/dist/src/__tests__/e2e/actions.js.map +1 -1
- package/dist/src/__tests__/e2e/connect.js +6 -6
- package/dist/src/__tests__/e2e/connect.js.map +1 -1
- package/dist/src/__tests__/e2e/loaders.js +3 -3
- package/dist/src/__tests__/e2e/loaders.js.map +1 -1
- package/dist/src/__tests__/e2e/reducers.js +4 -4
- package/dist/src/__tests__/e2e/reducers.js.map +1 -1
- package/dist/src/__tests__/e2e/selectors.js +3 -3
- package/dist/src/__tests__/e2e/selectors.js.map +1 -1
- package/dist/src/__tests__/utils.js +7 -7
- package/dist/src/__tests__/utils.js.map +1 -1
- package/dist/src/cli/typegen.js +35 -9
- package/dist/src/cli/typegen.js.map +1 -1
- package/dist/src/print/print.d.ts +5 -5
- package/dist/src/print/print.js +70 -44
- package/dist/src/print/print.js.map +1 -1
- package/dist/src/print/printActionCreators.d.ts +1 -2
- package/dist/src/print/printActionCreators.js +7 -7
- package/dist/src/print/printActionCreators.js.map +1 -1
- package/dist/src/print/printActionKeys.d.ts +1 -2
- package/dist/src/print/printActionKeys.js +4 -4
- package/dist/src/print/printActionKeys.js.map +1 -1
- package/dist/src/print/printActionTypes.d.ts +1 -2
- package/dist/src/print/printActionTypes.js +4 -4
- package/dist/src/print/printActionTypes.js.map +1 -1
- package/dist/src/print/printActions.d.ts +1 -2
- package/dist/src/print/printActions.js +4 -4
- package/dist/src/print/printActions.js.map +1 -1
- package/dist/src/print/printConstants.d.ts +1 -2
- package/dist/src/print/printConstants.js +2 -2
- package/dist/src/print/printConstants.js.map +1 -1
- package/dist/src/print/printDefaults.d.ts +1 -2
- package/dist/src/print/printDefaults.js +3 -3
- package/dist/src/print/printDefaults.js.map +1 -1
- package/dist/src/print/printEvents.d.ts +1 -2
- package/dist/src/print/printEvents.js +3 -3
- package/dist/src/print/printEvents.js.map +1 -1
- package/dist/src/print/printInternalExtraInput.d.ts +1 -2
- package/dist/src/print/printInternalExtraInput.js +8 -8
- package/dist/src/print/printInternalExtraInput.js.map +1 -1
- package/dist/src/print/printInternalReducerActions.d.ts +1 -2
- package/dist/src/print/printInternalReducerActions.js +3 -4
- package/dist/src/print/printInternalReducerActions.js.map +1 -1
- package/dist/src/print/printInternalSelectorTypes.d.ts +1 -2
- package/dist/src/print/printInternalSelectorTypes.js +3 -3
- package/dist/src/print/printInternalSelectorTypes.js.map +1 -1
- package/dist/src/print/printKey.d.ts +1 -2
- package/dist/src/print/printKey.js +2 -2
- package/dist/src/print/printKey.js.map +1 -1
- package/dist/src/print/printListeners.d.ts +1 -2
- package/dist/src/print/printListeners.js +9 -9
- package/dist/src/print/printListeners.js.map +1 -1
- package/dist/src/print/printProps.d.ts +1 -2
- package/dist/src/print/printProps.js +6 -5
- package/dist/src/print/printProps.js.map +1 -1
- package/dist/src/print/printReducer.d.ts +1 -2
- package/dist/src/print/printReducer.js +6 -6
- package/dist/src/print/printReducer.js.map +1 -1
- package/dist/src/print/printReducerOptions.d.ts +1 -2
- package/dist/src/print/printReducerOptions.js +3 -3
- package/dist/src/print/printReducerOptions.js.map +1 -1
- package/dist/src/print/printReducers.d.ts +1 -2
- package/dist/src/print/printReducers.js +7 -7
- package/dist/src/print/printReducers.js.map +1 -1
- package/dist/src/print/printSelector.d.ts +1 -2
- package/dist/src/print/printSelector.js +4 -4
- package/dist/src/print/printSelector.js.map +1 -1
- package/dist/src/print/printSelectors.d.ts +1 -2
- package/dist/src/print/printSelectors.js +6 -6
- package/dist/src/print/printSelectors.js.map +1 -1
- package/dist/src/print/printSharedListeners.d.ts +1 -2
- package/dist/src/print/printSharedListeners.js +11 -11
- package/dist/src/print/printSharedListeners.js.map +1 -1
- package/dist/src/print/printValues.d.ts +1 -2
- package/dist/src/print/printValues.js +3 -3
- package/dist/src/print/printValues.js.map +1 -1
- package/dist/src/typegen.js +5 -5
- package/dist/src/typegen.js.map +1 -1
- package/dist/src/types.d.ts +6 -0
- package/dist/src/utils.js +21 -18
- package/dist/src/utils.js.map +1 -1
- package/dist/src/visit/__tests__/visit.js +2 -2
- package/dist/src/visit/__tests__/visit.js.map +1 -1
- package/dist/src/visit/visit.js +22 -14
- package/dist/src/visit/visit.js.map +1 -1
- package/dist/src/visit/visitActions.d.ts +2 -2
- package/dist/src/visit/visitActions.js +13 -11
- package/dist/src/visit/visitActions.js.map +1 -1
- package/dist/src/visit/visitConnect.js +4 -4
- package/dist/src/visit/visitConnect.js.map +1 -1
- package/dist/src/visit/visitDefaults.js +1 -1
- package/dist/src/visit/visitDefaults.js.map +1 -1
- package/dist/src/visit/visitKey.js +2 -2
- package/dist/src/visit/visitKey.js.map +1 -1
- package/dist/src/visit/visitListeners.js +5 -5
- package/dist/src/visit/visitListeners.js.map +1 -1
- package/dist/src/visit/visitLoaders.d.ts +2 -2
- package/dist/src/visit/visitLoaders.js +27 -29
- package/dist/src/visit/visitLoaders.js.map +1 -1
- package/dist/src/visit/visitProps.js +1 -1
- package/dist/src/visit/visitProps.js.map +1 -1
- package/dist/src/visit/visitReducers.js +4 -4
- package/dist/src/visit/visitReducers.js.map +1 -1
- package/dist/src/visit/visitSelectors.js +8 -8
- package/dist/src/visit/visitSelectors.js.map +1 -1
- package/dist/src/visit/visitSharedListeners.js +5 -5
- package/dist/src/visit/visitSharedListeners.js.map +1 -1
- package/dist/src/visit/visitWindowValues.js +1 -1
- package/dist/src/visit/visitWindowValues.js.map +1 -1
- package/dist/src/write/write.d.ts +4 -0
- package/dist/src/{import/writeLogicTypeImports.js → write/write.js} +56 -11
- package/dist/src/write/write.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/form-plugin/lib/form-plugin/src/typegen.js +16 -15
- package/form-plugin/lib/src/types.d.ts +4 -1
- package/form-plugin/package.json +1 -1
- package/form-plugin/src/typegen.ts +25 -25
- package/form-plugin/tsconfig.json +0 -1
- package/form-plugin/yarn.lock +10 -10
- package/package.json +18 -17
- package/samples/.kearc +3 -0
- package/samples/autoImportLogic.ts +12 -3
- package/samples/autoImportLogicType.ts +7 -2
- package/samples/complexLogic.ts +4 -3
- package/samples/donotimport.ts +1 -0
- package/samples/githubConnectLogic.ts +1 -0
- package/samples/githubImportLogic.ts +1 -0
- package/samples/githubLogic.ts +1 -0
- package/samples/loadersLogic.ts +1 -0
- package/samples/loadersLogicType.ts +9 -9
- package/samples/logicType.ts +4 -4
- package/samples/pluginLogic.ts +2 -0
- package/samples/propsLogic.ts +1 -0
- package/samples/propsLogicType.ts +9 -9
- package/samples/windowValuesLogic.ts +1 -0
- package/src/__tests__/e2e/__snapshots__/loaders.ts.snap +10 -10
- package/src/__tests__/utils.ts +5 -5
- package/src/cli/typegen.ts +33 -7
- package/src/print/print.ts +97 -37
- package/src/print/printActionCreators.ts +12 -15
- package/src/print/printActionKeys.ts +5 -6
- package/src/print/printActionTypes.ts +6 -7
- package/src/print/printActions.ts +6 -13
- package/src/print/printConstants.ts +5 -6
- package/src/print/printDefaults.ts +5 -6
- package/src/print/printEvents.ts +8 -6
- package/src/print/printInternalExtraInput.ts +12 -13
- package/src/print/printInternalReducerActions.ts +5 -12
- package/src/print/printInternalSelectorTypes.ts +7 -8
- package/src/print/printKey.ts +2 -2
- package/src/print/printListeners.ts +16 -17
- package/src/print/printProps.ts +7 -7
- package/src/print/printReducer.ts +14 -15
- package/src/print/printReducerOptions.ts +4 -5
- package/src/print/printReducers.ts +13 -14
- package/src/print/printSelector.ts +8 -9
- package/src/print/printSelectors.ts +12 -13
- package/src/print/printSharedListeners.ts +20 -21
- package/src/print/printValues.ts +5 -6
- package/src/typegen.ts +4 -4
- package/src/types.ts +11 -1
- package/src/utils.ts +17 -17
- package/src/visit/visit.ts +11 -3
- package/src/visit/visitActions.ts +12 -10
- package/src/visit/visitListeners.ts +8 -8
- package/src/visit/visitLoaders.ts +49 -45
- package/src/visit/visitReducers.ts +1 -1
- package/src/visit/visitSelectors.ts +3 -3
- package/src/visit/visitSharedListeners.ts +8 -10
- package/src/{import/writeLogicTypeImports.ts → write/write.ts} +115 -16
- package/dist/src/import/writeLogicTypeImports.d.ts +0 -3
- package/dist/src/import/writeLogicTypeImports.js.map +0 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { ParsedLogic } from '../types'
|
|
2
|
-
import
|
|
2
|
+
import { factory, isFunctionLike, isPropertyAssignment, PropertyAssignment, SyntaxKind, Type } from 'typescript'
|
|
3
3
|
import { NodeBuilderFlags } from 'typescript'
|
|
4
4
|
import { cloneNode } from '@wessberg/ts-clone-node'
|
|
5
5
|
import { gatherImports } from '../utils'
|
|
6
6
|
|
|
7
|
-
export function visitActions(type:
|
|
7
|
+
export function visitActions(type: Type, inputProperty: PropertyAssignment, parsedLogic: ParsedLogic) {
|
|
8
8
|
const { checker } = parsedLogic
|
|
9
9
|
const properties = checker.getPropertiesOfType(type)
|
|
10
10
|
|
|
@@ -15,24 +15,26 @@ export function visitActions(type: ts.Type, inputProperty: ts.PropertyAssignment
|
|
|
15
15
|
let returnTypeNode
|
|
16
16
|
let parameters
|
|
17
17
|
|
|
18
|
-
if (!
|
|
18
|
+
if (!isPropertyAssignment(property.valueDeclaration)) {
|
|
19
19
|
continue
|
|
20
20
|
}
|
|
21
21
|
const { initializer } = property.valueDeclaration
|
|
22
22
|
|
|
23
|
-
if (
|
|
23
|
+
if (isFunctionLike(initializer)) {
|
|
24
24
|
// action is a function action: () => ({ ... })
|
|
25
25
|
parameters = initializer.parameters.map((param) => {
|
|
26
26
|
if (param.type) {
|
|
27
27
|
gatherImports(param.type, checker, parsedLogic)
|
|
28
28
|
}
|
|
29
|
-
return
|
|
29
|
+
return factory.createParameterDeclaration(
|
|
30
30
|
undefined,
|
|
31
31
|
undefined,
|
|
32
32
|
undefined,
|
|
33
|
-
|
|
34
|
-
param.initializer || param.questionToken
|
|
35
|
-
|
|
33
|
+
factory.createIdentifier(param.name.getText()),
|
|
34
|
+
param.initializer || param.questionToken
|
|
35
|
+
? factory.createToken(SyntaxKind.QuestionToken)
|
|
36
|
+
: undefined,
|
|
37
|
+
param.type ? cloneNode(param.type) : factory.createKeywordTypeNode(SyntaxKind.AnyKeyword),
|
|
36
38
|
undefined,
|
|
37
39
|
)
|
|
38
40
|
})
|
|
@@ -58,8 +60,8 @@ export function visitActions(type: ts.Type, inputProperty: ts.PropertyAssignment
|
|
|
58
60
|
// action is a value (action: true)
|
|
59
61
|
const typeNode = checker.typeToTypeNode(type, undefined, undefined)
|
|
60
62
|
gatherImports(typeNode, checker, parsedLogic)
|
|
61
|
-
returnTypeNode =
|
|
62
|
-
|
|
63
|
+
returnTypeNode = factory.createTypeLiteralNode([
|
|
64
|
+
factory.createPropertySignature(undefined, factory.createIdentifier('value'), undefined, typeNode),
|
|
63
65
|
])
|
|
64
66
|
}
|
|
65
67
|
parsedLogic.actions.push({ name, parameters, returnTypeNode })
|
|
@@ -47,20 +47,20 @@ export function visitListeners(type: ts.Type, inputProperty: ts.PropertyAssignme
|
|
|
47
47
|
parsedLogic.listeners.push({
|
|
48
48
|
name: action.name,
|
|
49
49
|
payload: action.returnTypeNode,
|
|
50
|
-
action: ts.createTypeLiteralNode([
|
|
51
|
-
ts.createPropertySignature(
|
|
50
|
+
action: ts.factory.createTypeLiteralNode([
|
|
51
|
+
ts.factory.createPropertySignature(
|
|
52
52
|
undefined,
|
|
53
|
-
ts.createIdentifier('type'),
|
|
54
|
-
undefined,
|
|
55
|
-
ts.createLiteralTypeNode(ts.createStringLiteral(getActionType(action.name))),
|
|
53
|
+
ts.factory.createIdentifier('type'),
|
|
56
54
|
undefined,
|
|
55
|
+
ts.factory.createLiteralTypeNode(
|
|
56
|
+
ts.factory.createStringLiteral(getActionType(action.name)),
|
|
57
|
+
),
|
|
57
58
|
),
|
|
58
|
-
ts.createPropertySignature(
|
|
59
|
+
ts.factory.createPropertySignature(
|
|
59
60
|
undefined,
|
|
60
|
-
ts.createIdentifier('payload'),
|
|
61
|
+
ts.factory.createIdentifier('payload'),
|
|
61
62
|
undefined,
|
|
62
63
|
action.returnTypeNode,
|
|
63
|
-
undefined,
|
|
64
64
|
),
|
|
65
65
|
]),
|
|
66
66
|
})
|
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
import { ParsedLogic } from '../types'
|
|
2
|
-
import
|
|
2
|
+
import {
|
|
3
|
+
factory,
|
|
4
|
+
isArrayLiteralExpression,
|
|
5
|
+
isFunctionLike,
|
|
6
|
+
isObjectLiteralExpression,
|
|
7
|
+
isTypeReferenceNode,
|
|
8
|
+
PropertyAssignment,
|
|
9
|
+
SyntaxKind,
|
|
10
|
+
Type,
|
|
11
|
+
TypeNode,
|
|
12
|
+
} from 'typescript'
|
|
3
13
|
import {
|
|
4
14
|
gatherImports,
|
|
5
15
|
getParameterDeclaration,
|
|
@@ -9,22 +19,22 @@ import {
|
|
|
9
19
|
} from '../utils'
|
|
10
20
|
import { NodeBuilderFlags } from 'typescript'
|
|
11
21
|
|
|
12
|
-
export function visitLoaders(type:
|
|
22
|
+
export function visitLoaders(type: Type, inputProperty: PropertyAssignment, parsedLogic: ParsedLogic) {
|
|
13
23
|
const { checker } = parsedLogic
|
|
14
24
|
|
|
15
25
|
for (const property of type.getProperties()) {
|
|
16
26
|
const loaderName = property.getName()
|
|
17
|
-
const value = (property.valueDeclaration as
|
|
27
|
+
const value = (property.valueDeclaration as PropertyAssignment).initializer
|
|
18
28
|
|
|
19
29
|
let defaultValue
|
|
20
30
|
let objectLiteral
|
|
21
|
-
if (
|
|
31
|
+
if (isArrayLiteralExpression(value)) {
|
|
22
32
|
defaultValue = value.elements[0]
|
|
23
33
|
objectLiteral = value.elements[1]
|
|
24
|
-
} else if (
|
|
34
|
+
} else if (isObjectLiteralExpression(value)) {
|
|
25
35
|
defaultValue = (value.properties.find(
|
|
26
36
|
(property) => checker.getSymbolAtLocation(property.name)?.getName() === '__default',
|
|
27
|
-
) as
|
|
37
|
+
) as PropertyAssignment)?.initializer
|
|
28
38
|
objectLiteral = value
|
|
29
39
|
}
|
|
30
40
|
|
|
@@ -35,18 +45,18 @@ export function visitLoaders(type: ts.Type, inputProperty: ts.PropertyAssignment
|
|
|
35
45
|
parsedLogic.reducers.push({ name: loaderName, typeNode: defaultValueTypeNode })
|
|
36
46
|
parsedLogic.reducers.push({
|
|
37
47
|
name: `${loaderName}Loading`,
|
|
38
|
-
typeNode:
|
|
48
|
+
typeNode: factory.createKeywordTypeNode(SyntaxKind.BooleanKeyword),
|
|
39
49
|
})
|
|
40
50
|
|
|
41
51
|
if (objectLiteral) {
|
|
42
|
-
;(objectLiteral.properties || []).forEach((property:
|
|
52
|
+
;(objectLiteral.properties || []).forEach((property: PropertyAssignment) => {
|
|
43
53
|
const loaderActionName = checker.getSymbolAtLocation(property.name)?.getName()
|
|
44
54
|
if (loaderActionName === '__default') {
|
|
45
55
|
return
|
|
46
56
|
}
|
|
47
57
|
|
|
48
58
|
const func = property.initializer
|
|
49
|
-
if (!
|
|
59
|
+
if (!isFunctionLike(func)) {
|
|
50
60
|
return
|
|
51
61
|
}
|
|
52
62
|
|
|
@@ -54,14 +64,14 @@ export function visitLoaders(type: ts.Type, inputProperty: ts.PropertyAssignment
|
|
|
54
64
|
const parameters = param ? [getParameterDeclaration(param)] : []
|
|
55
65
|
|
|
56
66
|
if (!parsedLogic.actions.find(({ name }) => name === `${loaderActionName}`)) {
|
|
57
|
-
const returnTypeNode = param?.type ||
|
|
67
|
+
const returnTypeNode = param?.type || factory.createKeywordTypeNode(SyntaxKind.AnyKeyword)
|
|
58
68
|
gatherImports(param, checker, parsedLogic)
|
|
59
69
|
|
|
60
70
|
parsedLogic.actions.push({ name: `${loaderActionName}`, parameters, returnTypeNode })
|
|
61
71
|
}
|
|
62
72
|
|
|
63
73
|
if (!parsedLogic.actions.find(({ name }) => name === `${loaderActionName}Success`)) {
|
|
64
|
-
let returnTypeNode:
|
|
74
|
+
let returnTypeNode: TypeNode
|
|
65
75
|
if (func) {
|
|
66
76
|
const funcType = checker.getTypeAtLocation(func)
|
|
67
77
|
const signature = funcType?.getCallSignatures()[0]
|
|
@@ -82,11 +92,11 @@ export function visitLoaders(type: ts.Type, inputProperty: ts.PropertyAssignment
|
|
|
82
92
|
}
|
|
83
93
|
|
|
84
94
|
if (!returnTypeNode) {
|
|
85
|
-
returnTypeNode = defaultValueTypeNode ||
|
|
95
|
+
returnTypeNode = defaultValueTypeNode || factory.createKeywordTypeNode(SyntaxKind.AnyKeyword)
|
|
86
96
|
}
|
|
87
97
|
|
|
88
98
|
if (
|
|
89
|
-
|
|
99
|
+
isTypeReferenceNode(returnTypeNode) &&
|
|
90
100
|
(returnTypeNode.typeName as any)?.escapedText === 'Promise'
|
|
91
101
|
) {
|
|
92
102
|
returnTypeNode = returnTypeNode.typeArguments?.[0]
|
|
@@ -95,41 +105,37 @@ export function visitLoaders(type: ts.Type, inputProperty: ts.PropertyAssignment
|
|
|
95
105
|
gatherImports(returnTypeNode, checker, parsedLogic)
|
|
96
106
|
|
|
97
107
|
const successParameters = [
|
|
98
|
-
|
|
108
|
+
factory.createParameterDeclaration(
|
|
99
109
|
undefined,
|
|
100
110
|
undefined,
|
|
101
111
|
undefined,
|
|
102
|
-
|
|
112
|
+
factory.createIdentifier(loaderName),
|
|
103
113
|
undefined,
|
|
104
114
|
returnTypeNode,
|
|
105
115
|
undefined,
|
|
106
116
|
),
|
|
107
|
-
|
|
108
|
-
undefined,
|
|
117
|
+
factory.createParameterDeclaration(
|
|
109
118
|
undefined,
|
|
110
119
|
undefined,
|
|
111
|
-
ts.createIdentifier('payload'),
|
|
112
120
|
undefined,
|
|
121
|
+
factory.createIdentifier('payload'),
|
|
122
|
+
factory.createToken(SyntaxKind.QuestionToken),
|
|
113
123
|
parsedLogic.actions.find((a) => a.name === loaderActionName)?.returnTypeNode,
|
|
114
124
|
undefined,
|
|
115
125
|
),
|
|
116
126
|
]
|
|
117
|
-
const successReturnTypeNode =
|
|
118
|
-
|
|
127
|
+
const successReturnTypeNode = factory.createTypeLiteralNode([
|
|
128
|
+
factory.createPropertySignature(
|
|
119
129
|
undefined,
|
|
120
|
-
|
|
130
|
+
factory.createIdentifier(loaderName),
|
|
121
131
|
undefined,
|
|
122
132
|
returnTypeNode,
|
|
123
|
-
undefined,
|
|
124
133
|
),
|
|
125
|
-
|
|
134
|
+
factory.createPropertySignature(
|
|
126
135
|
undefined,
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
? ts.createToken(ts.SyntaxKind.QuestionToken)
|
|
130
|
-
: undefined,
|
|
136
|
+
factory.createIdentifier('payload'),
|
|
137
|
+
factory.createToken(SyntaxKind.QuestionToken),
|
|
131
138
|
parsedLogic.actions.find((a) => a.name === loaderActionName)?.returnTypeNode,
|
|
132
|
-
undefined,
|
|
133
139
|
),
|
|
134
140
|
])
|
|
135
141
|
parsedLogic.actions.push({
|
|
@@ -141,39 +147,37 @@ export function visitLoaders(type: ts.Type, inputProperty: ts.PropertyAssignment
|
|
|
141
147
|
|
|
142
148
|
if (!parsedLogic.actions.find(({ name }) => name === `${loaderActionName}Failure`)) {
|
|
143
149
|
const failureParameters = [
|
|
144
|
-
|
|
150
|
+
factory.createParameterDeclaration(
|
|
145
151
|
undefined,
|
|
146
152
|
undefined,
|
|
147
153
|
undefined,
|
|
148
|
-
|
|
154
|
+
factory.createIdentifier('error'),
|
|
149
155
|
undefined,
|
|
150
|
-
|
|
156
|
+
factory.createKeywordTypeNode(SyntaxKind.StringKeyword),
|
|
151
157
|
undefined,
|
|
152
158
|
),
|
|
153
|
-
|
|
159
|
+
factory.createParameterDeclaration(
|
|
154
160
|
undefined,
|
|
155
161
|
undefined,
|
|
156
162
|
undefined,
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
163
|
+
factory.createIdentifier('errorObject'),
|
|
164
|
+
factory.createToken(SyntaxKind.QuestionToken),
|
|
165
|
+
factory.createKeywordTypeNode(SyntaxKind.AnyKeyword),
|
|
160
166
|
undefined,
|
|
161
167
|
),
|
|
162
168
|
]
|
|
163
|
-
const failureReturnTypeNode =
|
|
164
|
-
|
|
165
|
-
undefined,
|
|
166
|
-
ts.createIdentifier('error'),
|
|
169
|
+
const failureReturnTypeNode = factory.createTypeLiteralNode([
|
|
170
|
+
factory.createPropertySignature(
|
|
167
171
|
undefined,
|
|
168
|
-
|
|
172
|
+
factory.createIdentifier('error'),
|
|
169
173
|
undefined,
|
|
174
|
+
factory.createKeywordTypeNode(SyntaxKind.StringKeyword),
|
|
170
175
|
),
|
|
171
|
-
|
|
172
|
-
undefined,
|
|
173
|
-
ts.createIdentifier('errorObject'),
|
|
174
|
-
ts.createToken(ts.SyntaxKind.QuestionToken),
|
|
175
|
-
ts.createKeywordTypeNode(ts.SyntaxKind.AnyKeyword),
|
|
176
|
+
factory.createPropertySignature(
|
|
176
177
|
undefined,
|
|
178
|
+
factory.createIdentifier('errorObject'),
|
|
179
|
+
factory.createToken(SyntaxKind.QuestionToken),
|
|
180
|
+
factory.createKeywordTypeNode(SyntaxKind.AnyKeyword),
|
|
177
181
|
),
|
|
178
182
|
])
|
|
179
183
|
|
|
@@ -34,7 +34,7 @@ export function visitReducers(type: ts.Type, inputProperty: ts.PropertyAssignmen
|
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
} else if (ts.isObjectLiteralExpression(value)) {
|
|
37
|
-
typeNode = ts.createKeywordTypeNode(ts.SyntaxKind.AnyKeyword)
|
|
37
|
+
typeNode = ts.factory.createKeywordTypeNode(ts.SyntaxKind.AnyKeyword)
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
parsedLogic.reducers.push({ name, typeNode, reducerOptions })
|
|
@@ -34,7 +34,7 @@ export function visitSelectors(type: ts.Type, inputProperty: ts.PropertyAssignme
|
|
|
34
34
|
|
|
35
35
|
if (selectorInputTypeNode && ts.isTupleTypeNode(selectorInputTypeNode)) {
|
|
36
36
|
let takenNames: Record<string, number> = {}
|
|
37
|
-
functionTypes = (selectorInputTypeNode.elements || ts.createNodeArray([]))
|
|
37
|
+
functionTypes = (selectorInputTypeNode.elements || ts.factory.createNodeArray([]))
|
|
38
38
|
.filter((e) => ts.isTypeNode(e))
|
|
39
39
|
.map((selectorTypeNode, index) => {
|
|
40
40
|
let name = functionNames[index] || 'arg'
|
|
@@ -49,7 +49,7 @@ export function visitSelectors(type: ts.Type, inputProperty: ts.PropertyAssignme
|
|
|
49
49
|
name,
|
|
50
50
|
type: ts.isFunctionTypeNode(selectorTypeNode)
|
|
51
51
|
? cloneNode(selectorTypeNode.type)
|
|
52
|
-
: ts.createKeywordTypeNode(ts.SyntaxKind.AnyKeyword),
|
|
52
|
+
: ts.factory.createKeywordTypeNode(ts.SyntaxKind.AnyKeyword),
|
|
53
53
|
}
|
|
54
54
|
})
|
|
55
55
|
}
|
|
@@ -67,7 +67,7 @@ export function visitSelectors(type: ts.Type, inputProperty: ts.PropertyAssignme
|
|
|
67
67
|
typeNode = checker.typeToTypeNode(type, undefined, NodeBuilderFlags.NoTruncation)
|
|
68
68
|
gatherImports(typeNode, checker, parsedLogic)
|
|
69
69
|
} else {
|
|
70
|
-
typeNode = ts.createKeywordTypeNode(ts.SyntaxKind.AnyKeyword)
|
|
70
|
+
typeNode = ts.factory.createKeywordTypeNode(ts.SyntaxKind.AnyKeyword)
|
|
71
71
|
}
|
|
72
72
|
|
|
73
73
|
parsedLogic.selectors.push({
|
|
@@ -23,21 +23,19 @@ export function visitSharedListeners(type: ts.Type, inputProperty: ts.PropertyAs
|
|
|
23
23
|
parsedLogic.sharedListeners.push({
|
|
24
24
|
name,
|
|
25
25
|
payload: typeNode,
|
|
26
|
-
action: ts.createTypeLiteralNode([
|
|
27
|
-
ts.createPropertySignature(
|
|
26
|
+
action: ts.factory.createTypeLiteralNode([
|
|
27
|
+
ts.factory.createPropertySignature(
|
|
28
28
|
undefined,
|
|
29
|
-
ts.createIdentifier('type'),
|
|
30
|
-
undefined,
|
|
31
|
-
ts.createKeywordTypeNode(ts.SyntaxKind.StringKeyword),
|
|
29
|
+
ts.factory.createIdentifier('type'),
|
|
32
30
|
undefined,
|
|
31
|
+
ts.factory.createKeywordTypeNode(ts.SyntaxKind.StringKeyword),
|
|
33
32
|
),
|
|
34
|
-
ts.createPropertySignature(
|
|
35
|
-
undefined,
|
|
36
|
-
ts.createIdentifier('payload'),
|
|
33
|
+
ts.factory.createPropertySignature(
|
|
37
34
|
undefined,
|
|
38
|
-
|
|
39
|
-
// ts.createKeywordTypeNode(ts.SyntaxKind.AnyKeyword),
|
|
35
|
+
ts.factory.createIdentifier('payload'),
|
|
40
36
|
undefined,
|
|
37
|
+
typeNode || ts.factory.createKeywordTypeNode(ts.SyntaxKind.AnyKeyword),
|
|
38
|
+
// ts.factory.createKeywordTypeNode(SyntaxKind.AnyKeyword),
|
|
41
39
|
),
|
|
42
40
|
]),
|
|
43
41
|
})
|
|
@@ -5,10 +5,14 @@ import * as fs from 'fs'
|
|
|
5
5
|
import { runThroughPrettier } from '../print/print'
|
|
6
6
|
import * as diff from 'diff'
|
|
7
7
|
import * as path from 'path'
|
|
8
|
+
import { factory, SyntaxKind } from 'typescript'
|
|
8
9
|
|
|
10
|
+
// NOTE:
|
|
9
11
|
// This is an unfortunate workaround. The TS compiler strips all
|
|
10
|
-
// whitespace. This uses "jsdiff" to add
|
|
11
|
-
//
|
|
12
|
+
// whitespace AND COMMENTS. This uses "jsdiff" to add back the whitespace,
|
|
13
|
+
// but not the comments.
|
|
14
|
+
//
|
|
15
|
+
// This should be rewritten to babel!
|
|
12
16
|
// https://github.com/microsoft/TypeScript/issues/843#issuecomment-555932858
|
|
13
17
|
function addBackNewlines(oldText: string, newText: string) {
|
|
14
18
|
const patch = diff.parsePatch(diff.createPatch('file', oldText, newText, '', ''))
|
|
@@ -31,7 +35,7 @@ function addBackNewlines(oldText: string, newText: string) {
|
|
|
31
35
|
return diff.applyPatch(oldText, patch)
|
|
32
36
|
}
|
|
33
37
|
|
|
34
|
-
export function
|
|
38
|
+
export function writeTypeImports(
|
|
35
39
|
appOptions: AppOptions,
|
|
36
40
|
program: ts.Program,
|
|
37
41
|
filename: string,
|
|
@@ -52,18 +56,19 @@ export function writeLogicTypeImports(
|
|
|
52
56
|
importLocation = `./${importLocation}`
|
|
53
57
|
}
|
|
54
58
|
const createImportDeclaration = () =>
|
|
55
|
-
|
|
59
|
+
factory.createImportDeclaration(
|
|
56
60
|
undefined,
|
|
57
61
|
undefined,
|
|
58
|
-
|
|
62
|
+
factory.createImportClause(
|
|
63
|
+
true,
|
|
59
64
|
undefined,
|
|
60
|
-
|
|
65
|
+
factory.createNamedImports(
|
|
61
66
|
allParsedLogics.map((l) =>
|
|
62
|
-
|
|
67
|
+
factory.createImportSpecifier(undefined, undefined, factory.createIdentifier(l.logicTypeName)),
|
|
63
68
|
),
|
|
64
69
|
),
|
|
65
70
|
),
|
|
66
|
-
|
|
71
|
+
factory.createStringLiteral(importLocation),
|
|
67
72
|
)
|
|
68
73
|
|
|
69
74
|
const transformer = <T extends ts.Node>(context: ts.TransformationContext) => {
|
|
@@ -77,15 +82,20 @@ export function writeLogicTypeImports(
|
|
|
77
82
|
parsedLogicMapByNode.has(node.expression)
|
|
78
83
|
) {
|
|
79
84
|
const { logicTypeName, typeReferencesInLogicInput } = parsedLogicMapByNode.get(node.expression)
|
|
80
|
-
return
|
|
85
|
+
return factory.createCallExpression(
|
|
81
86
|
node.expression,
|
|
82
87
|
[
|
|
83
|
-
|
|
84
|
-
|
|
88
|
+
factory.createTypeReferenceNode(
|
|
89
|
+
factory.createIdentifier(logicTypeName),
|
|
85
90
|
typeReferencesInLogicInput.size > 0
|
|
86
|
-
? [...typeReferencesInLogicInput.values()]
|
|
87
|
-
|
|
88
|
-
|
|
91
|
+
? [...typeReferencesInLogicInput.values()]
|
|
92
|
+
.sort()
|
|
93
|
+
.map((type) =>
|
|
94
|
+
factory.createTypeReferenceNode(
|
|
95
|
+
factory.createIdentifier(type),
|
|
96
|
+
undefined,
|
|
97
|
+
),
|
|
98
|
+
)
|
|
89
99
|
: undefined,
|
|
90
100
|
),
|
|
91
101
|
],
|
|
@@ -149,6 +159,97 @@ export function writeLogicTypeImports(
|
|
|
149
159
|
}
|
|
150
160
|
}
|
|
151
161
|
|
|
162
|
+
writeFile(sourceFile, transformer, filename)
|
|
163
|
+
|
|
164
|
+
log(`🔥 Import added: ${path.relative(process.cwd(), filename)}`)
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
export function writePaths(appOptions: AppOptions, program: ts.Program, filename: string, parsedLogics: ParsedLogic[]) {
|
|
168
|
+
const { log } = appOptions
|
|
169
|
+
const sourceFile = program.getSourceFile(filename)
|
|
170
|
+
const checker = program.getTypeChecker()
|
|
171
|
+
|
|
172
|
+
const parsedLogicMapByNode = new Map<ts.Node, ParsedLogic>()
|
|
173
|
+
for (const parsedLogic of parsedLogics) {
|
|
174
|
+
parsedLogicMapByNode.set(parsedLogic.node, parsedLogic)
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
const transformer = <T extends ts.Node>(context: ts.TransformationContext) => {
|
|
178
|
+
return (rootNode: T) => {
|
|
179
|
+
function visit(node: ts.Node): ts.Node {
|
|
180
|
+
node = ts.visitEachChild(node, visit, context)
|
|
181
|
+
if (
|
|
182
|
+
ts.isCallExpression(node) &&
|
|
183
|
+
isKeaCall(node.expression, checker) &&
|
|
184
|
+
parsedLogicMapByNode.has(node.expression)
|
|
185
|
+
) {
|
|
186
|
+
const { path, hasKeyInLogic } = parsedLogicMapByNode.get(node.expression)
|
|
187
|
+
return factory.createCallExpression(
|
|
188
|
+
node.expression,
|
|
189
|
+
node.typeArguments,
|
|
190
|
+
node.arguments.map((argument, i) =>
|
|
191
|
+
i === 0 && ts.isObjectLiteralExpression(argument)
|
|
192
|
+
? factory.createObjectLiteralExpression(
|
|
193
|
+
[
|
|
194
|
+
hasKeyInLogic
|
|
195
|
+
? factory.createPropertyAssignment(
|
|
196
|
+
factory.createIdentifier('path'),
|
|
197
|
+
factory.createArrowFunction(
|
|
198
|
+
undefined,
|
|
199
|
+
undefined,
|
|
200
|
+
[
|
|
201
|
+
factory.createParameterDeclaration(
|
|
202
|
+
undefined,
|
|
203
|
+
undefined,
|
|
204
|
+
undefined,
|
|
205
|
+
factory.createIdentifier('key'),
|
|
206
|
+
undefined,
|
|
207
|
+
undefined,
|
|
208
|
+
undefined,
|
|
209
|
+
),
|
|
210
|
+
],
|
|
211
|
+
undefined,
|
|
212
|
+
factory.createToken(SyntaxKind.EqualsGreaterThanToken),
|
|
213
|
+
factory.createArrayLiteralExpression(
|
|
214
|
+
[
|
|
215
|
+
...path.map((str) => factory.createStringLiteral(str)),
|
|
216
|
+
factory.createIdentifier('key'),
|
|
217
|
+
],
|
|
218
|
+
false,
|
|
219
|
+
),
|
|
220
|
+
),
|
|
221
|
+
)
|
|
222
|
+
: factory.createPropertyAssignment(
|
|
223
|
+
factory.createIdentifier('path'),
|
|
224
|
+
factory.createArrayLiteralExpression(
|
|
225
|
+
path.map((str) => factory.createStringLiteral(str)),
|
|
226
|
+
false,
|
|
227
|
+
),
|
|
228
|
+
),
|
|
229
|
+
...argument.properties,
|
|
230
|
+
],
|
|
231
|
+
true,
|
|
232
|
+
)
|
|
233
|
+
: argument,
|
|
234
|
+
),
|
|
235
|
+
)
|
|
236
|
+
}
|
|
237
|
+
return node
|
|
238
|
+
}
|
|
239
|
+
return ts.visitNode(rootNode, visit)
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
writeFile(sourceFile, transformer, filename)
|
|
244
|
+
|
|
245
|
+
log(`🔥 Path added: ${path.relative(process.cwd(), filename)}`)
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
function writeFile<T>(
|
|
249
|
+
sourceFile: ts.SourceFile,
|
|
250
|
+
transformer: <T extends ts.Node>(context: ts.TransformationContext) => (rootNode: T) => T,
|
|
251
|
+
filename: string,
|
|
252
|
+
) {
|
|
152
253
|
const printer: ts.Printer = ts.createPrinter()
|
|
153
254
|
const result: ts.TransformationResult<ts.SourceFile> = ts.transform<ts.SourceFile>(sourceFile, [transformer])
|
|
154
255
|
|
|
@@ -161,6 +262,4 @@ export function writeLogicTypeImports(
|
|
|
161
262
|
const newestText = addBackNewlines(oldText, newText)
|
|
162
263
|
|
|
163
264
|
fs.writeFileSync(filename, newestText)
|
|
164
|
-
|
|
165
|
-
log(`🔥 Import added: ${path.relative(process.cwd(), filename)}`)
|
|
166
265
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"writeLogicTypeImports.js","sourceRoot":"","sources":["../../../src/import/writeLogicTypeImports.ts"],"names":[],"mappings":";;;AACA,iCAAgC;AAChC,oCAAoC;AACpC,yBAAwB;AACxB,0CAAmD;AACnD,6BAA4B;AAC5B,6BAA4B;AAM5B,SAAS,eAAe,CAAC,OAAe,EAAE,OAAe;IACrD,MAAM,KAAK,GAAG,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,CAAA;IACjF,MAAM,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAA;IAC5B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE;QACnC,IAAI,UAAU,GAAG,CAAC,CAAA;QAClB,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,CAAA;QACrB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;YACjC,IAAI,IAAI,KAAK,GAAG,EAAE;gBACd,UAAU,EAAE,CAAA;gBACZ,OAAO,GAAG,CAAA;aACb;YACD,OAAO,IAAI,CAAA;QACf,CAAC,CAAC,CAAA;QACF,IAAI,CAAC,QAAQ,IAAI,UAAU,CAAA;QAC3B,KAAK,IAAI,CAAC,GAAG,CAAC,GAAG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