@react-native/codegen 0.72.5 → 0.73.0-nightly-20230605-5062553c6

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.
Files changed (72) hide show
  1. package/README.md +2 -2
  2. package/lib/CodegenSchema.d.ts +15 -4
  3. package/lib/CodegenSchema.js.flow +33 -21
  4. package/lib/generators/components/CppHelpers.js +39 -2
  5. package/lib/generators/components/CppHelpers.js.flow +54 -5
  6. package/lib/generators/components/GenerateEventEmitterCpp.js +238 -55
  7. package/lib/generators/components/GenerateEventEmitterCpp.js.flow +233 -55
  8. package/lib/generators/components/GenerateEventEmitterH.js +77 -28
  9. package/lib/generators/components/GenerateEventEmitterH.js.flow +87 -32
  10. package/lib/generators/components/GeneratePropsH.js +1 -2
  11. package/lib/generators/components/GeneratePropsH.js.flow +1 -2
  12. package/lib/generators/components/GeneratePropsJavaPojo/PojoCollector.js +0 -1
  13. package/lib/generators/components/GeneratePropsJavaPojo/PojoCollector.js.flow +3 -5
  14. package/lib/generators/components/GenerateThirdPartyFabricComponentsProviderH.js +4 -0
  15. package/lib/generators/components/GenerateThirdPartyFabricComponentsProviderH.js.flow +4 -0
  16. package/lib/generators/components/GenerateThirdPartyFabricComponentsProviderObjCpp.js +2 -0
  17. package/lib/generators/components/GenerateThirdPartyFabricComponentsProviderObjCpp.js.flow +2 -0
  18. package/lib/generators/components/__test_fixtures__/fixtures.js +114 -1
  19. package/lib/generators/components/__test_fixtures__/fixtures.js.flow +114 -1
  20. package/lib/generators/modules/GenerateModuleCpp.js +3 -3
  21. package/lib/generators/modules/GenerateModuleCpp.js.flow +3 -3
  22. package/lib/generators/modules/GenerateModuleJavaSpec.js +1 -2
  23. package/lib/generators/modules/GenerateModuleJavaSpec.js.flow +1 -2
  24. package/lib/parsers/error-utils.js +44 -0
  25. package/lib/parsers/error-utils.js.flow +59 -0
  26. package/lib/parsers/flow/components/__test_fixtures__/fixtures.js +51 -0
  27. package/lib/parsers/flow/components/__test_fixtures__/fixtures.js.flow +51 -0
  28. package/lib/parsers/flow/components/componentsUtils.js +12 -19
  29. package/lib/parsers/flow/components/componentsUtils.js.flow +16 -27
  30. package/lib/parsers/flow/components/events.js +157 -83
  31. package/lib/parsers/flow/components/events.js.flow +158 -82
  32. package/lib/parsers/flow/components/index.js +10 -129
  33. package/lib/parsers/flow/components/index.js.flow +10 -150
  34. package/lib/parsers/flow/modules/index.js +39 -49
  35. package/lib/parsers/flow/modules/index.js.flow +22 -31
  36. package/lib/parsers/flow/parser.d.ts +9 -2
  37. package/lib/parsers/flow/parser.js +177 -16
  38. package/lib/parsers/flow/parser.js.flow +220 -6
  39. package/lib/parsers/flow/utils.js +0 -63
  40. package/lib/parsers/flow/utils.js.flow +1 -77
  41. package/lib/parsers/parser.js.flow +143 -1
  42. package/lib/parsers/parserMock.js +175 -2
  43. package/lib/parsers/parserMock.js.flow +227 -2
  44. package/lib/parsers/parsers-commons.js +169 -9
  45. package/lib/parsers/parsers-commons.js.flow +233 -12
  46. package/lib/parsers/parsers-primitives.js +94 -35
  47. package/lib/parsers/parsers-primitives.js.flow +124 -35
  48. package/lib/parsers/typescript/components/__test_fixtures__/fixtures.js +51 -0
  49. package/lib/parsers/typescript/components/__test_fixtures__/fixtures.js.flow +51 -0
  50. package/lib/parsers/typescript/components/componentsUtils.js +44 -46
  51. package/lib/parsers/typescript/components/componentsUtils.js.flow +44 -51
  52. package/lib/parsers/typescript/components/events.js +142 -72
  53. package/lib/parsers/typescript/components/events.js.flow +149 -73
  54. package/lib/parsers/typescript/components/extends.js +2 -49
  55. package/lib/parsers/typescript/components/extends.js.flow +1 -55
  56. package/lib/parsers/typescript/components/index.js +11 -134
  57. package/lib/parsers/typescript/components/index.js.flow +11 -156
  58. package/lib/parsers/typescript/modules/index.js +43 -51
  59. package/lib/parsers/typescript/modules/index.js.flow +25 -32
  60. package/lib/parsers/typescript/parser.d.ts +9 -2
  61. package/lib/parsers/typescript/parser.js +224 -7
  62. package/lib/parsers/typescript/parser.js.flow +262 -6
  63. package/lib/parsers/utils.js.flow +6 -0
  64. package/package.json +16 -5
  65. package/lib/parsers/flow/components/extends.js +0 -52
  66. package/lib/parsers/flow/components/extends.js.flow +0 -66
  67. package/lib/parsers/flow/components/props.js +0 -47
  68. package/lib/parsers/flow/components/props.js.flow +0 -60
  69. package/lib/parsers/typescript/components/props.js +0 -39
  70. package/lib/parsers/typescript/components/props.js.flow +0 -48
  71. package/lib/parsers/typescript/utils.js +0 -90
  72. package/lib/parsers/typescript/utils.js.flow +0 -104
@@ -15,6 +15,21 @@ import type {
15
15
  NamedShape,
16
16
  EventTypeAnnotation,
17
17
  } from '../../../CodegenSchema.js';
18
+ import type {Parser} from '../../parser';
19
+
20
+ const {
21
+ throwIfEventHasNoName,
22
+ throwIfBubblingTypeIsNull,
23
+ throwIfArgumentPropsAreNull,
24
+ } = require('../../error-utils');
25
+ const {getEventArgument} = require('../../parsers-commons');
26
+ const {
27
+ emitBoolProp,
28
+ emitDoubleProp,
29
+ emitFloatProp,
30
+ emitStringProp,
31
+ emitInt32Prop,
32
+ } = require('../../parsers-primitives');
18
33
 
19
34
  function getPropertyType(
20
35
  /* $FlowFixMe[missing-local-annot] The type annotation(s) required by Flow's
@@ -22,84 +37,146 @@ function getPropertyType(
22
37
  name,
23
38
  optional: boolean,
24
39
  typeAnnotation: $FlowFixMe,
40
+ parser: Parser,
25
41
  ): NamedShape<EventTypeAnnotation> {
26
- const type =
27
- typeAnnotation.type === 'GenericTypeAnnotation'
28
- ? typeAnnotation.id.name
29
- : typeAnnotation.type;
42
+ const type = extractTypeFromTypeAnnotation(typeAnnotation);
30
43
 
31
44
  switch (type) {
32
45
  case 'BooleanTypeAnnotation':
46
+ return emitBoolProp(name, optional);
47
+ case 'StringTypeAnnotation':
48
+ return emitStringProp(name, optional);
49
+ case 'Int32':
50
+ return emitInt32Prop(name, optional);
51
+ case 'Double':
52
+ return emitDoubleProp(name, optional);
53
+ case 'Float':
54
+ return emitFloatProp(name, optional);
55
+ case '$ReadOnly':
56
+ return getPropertyType(
57
+ name,
58
+ optional,
59
+ typeAnnotation.typeParameters.params[0],
60
+ parser,
61
+ );
62
+ case 'ObjectTypeAnnotation':
33
63
  return {
34
64
  name,
35
65
  optional,
36
66
  typeAnnotation: {
37
- type: 'BooleanTypeAnnotation',
67
+ type: 'ObjectTypeAnnotation',
68
+ properties: typeAnnotation.properties.map(member =>
69
+ buildPropertiesForEvent(member, parser),
70
+ ),
38
71
  },
39
72
  };
40
- case 'StringTypeAnnotation':
73
+ case 'UnionTypeAnnotation':
41
74
  return {
42
75
  name,
43
76
  optional,
44
77
  typeAnnotation: {
45
- type: 'StringTypeAnnotation',
78
+ type: 'StringEnumTypeAnnotation',
79
+ options: typeAnnotation.types.map(option => option.value),
46
80
  },
47
81
  };
48
- case 'Int32':
82
+ case 'UnsafeMixed':
49
83
  return {
50
84
  name,
51
85
  optional,
52
86
  typeAnnotation: {
53
- type: 'Int32TypeAnnotation',
87
+ type: 'MixedTypeAnnotation',
54
88
  },
55
89
  };
56
- case 'Double':
90
+ case 'ArrayTypeAnnotation':
91
+ case '$ReadOnlyArray':
57
92
  return {
58
93
  name,
59
94
  optional,
60
- typeAnnotation: {
61
- type: 'DoubleTypeAnnotation',
62
- },
95
+ typeAnnotation: extractArrayElementType(typeAnnotation, name, parser),
63
96
  };
97
+ default:
98
+ throw new Error(`Unable to determine event type for "${name}": ${type}`);
99
+ }
100
+ }
101
+
102
+ function extractArrayElementType(
103
+ typeAnnotation: $FlowFixMe,
104
+ name: string,
105
+ parser: Parser,
106
+ ): EventTypeAnnotation {
107
+ const type = extractTypeFromTypeAnnotation(typeAnnotation);
108
+
109
+ switch (type) {
110
+ case 'BooleanTypeAnnotation':
111
+ return {type: 'BooleanTypeAnnotation'};
112
+ case 'StringTypeAnnotation':
113
+ return {type: 'StringTypeAnnotation'};
114
+ case 'Int32':
115
+ return {type: 'Int32TypeAnnotation'};
64
116
  case 'Float':
117
+ return {type: 'FloatTypeAnnotation'};
118
+ case 'NumberTypeAnnotation':
119
+ case 'Double':
65
120
  return {
66
- name,
67
- optional,
68
- typeAnnotation: {
69
- type: 'FloatTypeAnnotation',
70
- },
121
+ type: 'DoubleTypeAnnotation',
71
122
  };
72
- case '$ReadOnly':
73
- return getPropertyType(
74
- name,
75
- optional,
76
- typeAnnotation.typeParameters.params[0],
77
- );
123
+ case 'UnionTypeAnnotation':
124
+ return {
125
+ type: 'StringEnumTypeAnnotation',
126
+ options: typeAnnotation.types.map(option => option.value),
127
+ };
128
+ case 'UnsafeMixed':
129
+ return {type: 'MixedTypeAnnotation'};
78
130
  case 'ObjectTypeAnnotation':
79
131
  return {
80
- name,
81
- optional,
82
- typeAnnotation: {
83
- type: 'ObjectTypeAnnotation',
84
- properties: typeAnnotation.properties.map(buildPropertiesForEvent),
85
- },
132
+ type: 'ObjectTypeAnnotation',
133
+ properties: typeAnnotation.properties.map(member =>
134
+ buildPropertiesForEvent(member, parser),
135
+ ),
86
136
  };
87
- case 'UnionTypeAnnotation':
137
+ case 'ArrayTypeAnnotation':
88
138
  return {
89
- name,
90
- optional,
91
- typeAnnotation: {
92
- type: 'StringEnumTypeAnnotation',
93
- options: typeAnnotation.types.map(option => option.value),
94
- },
139
+ type: 'ArrayTypeAnnotation',
140
+ elementType: extractArrayElementType(
141
+ typeAnnotation.elementType,
142
+ name,
143
+ parser,
144
+ ),
145
+ };
146
+ case '$ReadOnlyArray':
147
+ const genericParams = typeAnnotation.typeParameters.params;
148
+ if (genericParams.length !== 1) {
149
+ throw new Error(
150
+ `Events only supports arrays with 1 Generic type. Found ${
151
+ genericParams.length
152
+ } types:\n${prettify(genericParams)}`,
153
+ );
154
+ }
155
+ return {
156
+ type: 'ArrayTypeAnnotation',
157
+ elementType: extractArrayElementType(genericParams[0], name, parser),
95
158
  };
96
159
  default:
97
- (type: empty);
98
- throw new Error(`Unable to determine event type for "${name}": ${type}`);
160
+ throw new Error(
161
+ `Unrecognized ${type} for Array ${name} in events.\n${prettify(
162
+ typeAnnotation,
163
+ )}`,
164
+ );
99
165
  }
100
166
  }
101
167
 
168
+ function prettify(jsonObject: $FlowFixMe): string {
169
+ return JSON.stringify(jsonObject, null, 2);
170
+ }
171
+
172
+ function extractTypeFromTypeAnnotation(typeAnnotation: $FlowFixMe): string {
173
+ return typeAnnotation.type === 'GenericTypeAnnotation'
174
+ ? typeAnnotation.id.name
175
+ : typeAnnotation.type;
176
+ }
177
+
102
178
  function findEventArgumentsAndType(
179
+ parser: Parser,
103
180
  typeAnnotation: $FlowFixMe,
104
181
  types: TypeMap,
105
182
  bubblingType: void | 'direct' | 'bubble',
@@ -109,9 +186,7 @@ function findEventArgumentsAndType(
109
186
  bubblingType: ?('direct' | 'bubble'),
110
187
  paperTopLevelNameDeprecated: ?$FlowFixMe,
111
188
  } {
112
- if (!typeAnnotation.id) {
113
- throw new Error("typeAnnotation of event doesn't have a name");
114
- }
189
+ throwIfEventHasNoName(typeAnnotation, parser);
115
190
  const name = typeAnnotation.id.name;
116
191
  if (name === '$ReadOnly') {
117
192
  return {
@@ -127,7 +202,7 @@ function findEventArgumentsAndType(
127
202
  : null;
128
203
  if (
129
204
  typeAnnotation.typeParameters.params[0].type ===
130
- 'NullLiteralTypeAnnotation'
205
+ parser.nullLiteralTypeAnnotation
131
206
  ) {
132
207
  return {
133
208
  argumentProps: [],
@@ -136,6 +211,7 @@ function findEventArgumentsAndType(
136
211
  };
137
212
  }
138
213
  return findEventArgumentsAndType(
214
+ parser,
139
215
  typeAnnotation.typeParameters.params[0],
140
216
  types,
141
217
  eventType,
@@ -143,6 +219,7 @@ function findEventArgumentsAndType(
143
219
  );
144
220
  } else if (types[name]) {
145
221
  return findEventArgumentsAndType(
222
+ parser,
146
223
  types[name].right,
147
224
  types,
148
225
  bubblingType,
@@ -157,32 +234,26 @@ function findEventArgumentsAndType(
157
234
  }
158
235
  }
159
236
 
160
- /* $FlowFixMe[missing-local-annot] The type annotation(s) required by Flow's
161
- * LTI update could not be added via codemod */
162
- function buildPropertiesForEvent(property): NamedShape<EventTypeAnnotation> {
237
+ function buildPropertiesForEvent(
238
+ /* $FlowFixMe[missing-local-annot] The type annotation(s) required by Flow's
239
+ * LTI update could not be added via codemod */
240
+ property,
241
+ parser: Parser,
242
+ ): NamedShape<EventTypeAnnotation> {
163
243
  const name = property.key.name;
164
- const optional =
165
- property.value.type === 'NullableTypeAnnotation' || property.optional;
244
+ const optional = parser.isOptionalProperty(property);
166
245
  let typeAnnotation =
167
246
  property.value.type === 'NullableTypeAnnotation'
168
247
  ? property.value.typeAnnotation
169
248
  : property.value;
170
249
 
171
- return getPropertyType(name, optional, typeAnnotation);
172
- }
173
-
174
- /* $FlowFixMe[missing-local-annot] The type annotation(s) required by Flow's
175
- * LTI update could not be added via codemod */
176
- function getEventArgument(argumentProps, name: $FlowFixMe) {
177
- return {
178
- type: 'ObjectTypeAnnotation',
179
- properties: argumentProps.map(buildPropertiesForEvent),
180
- };
250
+ return getPropertyType(name, optional, typeAnnotation, parser);
181
251
  }
182
252
 
183
253
  function buildEventSchema(
184
254
  types: TypeMap,
185
255
  property: EventTypeAST,
256
+ parser: Parser,
186
257
  ): ?EventTypeShape {
187
258
  const name = property.key.name;
188
259
  const optional =
@@ -202,40 +273,44 @@ function buildEventSchema(
202
273
  }
203
274
 
204
275
  const {argumentProps, bubblingType, paperTopLevelNameDeprecated} =
205
- findEventArgumentsAndType(typeAnnotation, types);
276
+ findEventArgumentsAndType(parser, typeAnnotation, types);
206
277
 
207
- if (bubblingType && argumentProps) {
208
- if (paperTopLevelNameDeprecated != null) {
209
- return {
210
- name,
211
- optional,
212
- bubblingType,
213
- paperTopLevelNameDeprecated,
214
- typeAnnotation: {
215
- type: 'EventTypeAnnotation',
216
- argument: getEventArgument(argumentProps, name),
217
- },
218
- };
219
- }
278
+ const nonNullableArgumentProps = throwIfArgumentPropsAreNull(
279
+ argumentProps,
280
+ name,
281
+ );
282
+ const nonNullableBubblingType = throwIfBubblingTypeIsNull(bubblingType, name);
220
283
 
284
+ if (paperTopLevelNameDeprecated != null) {
221
285
  return {
222
286
  name,
223
287
  optional,
224
- bubblingType,
288
+ bubblingType: nonNullableBubblingType,
289
+ paperTopLevelNameDeprecated,
225
290
  typeAnnotation: {
226
291
  type: 'EventTypeAnnotation',
227
- argument: getEventArgument(argumentProps, name),
292
+ argument: getEventArgument(
293
+ nonNullableArgumentProps,
294
+ buildPropertiesForEvent,
295
+ parser,
296
+ ),
228
297
  },
229
298
  };
230
299
  }
231
300
 
232
- if (argumentProps === null) {
233
- throw new Error(`Unable to determine event arguments for "${name}"`);
234
- }
235
-
236
- if (bubblingType === null) {
237
- throw new Error(`Unable to determine event arguments for "${name}"`);
238
- }
301
+ return {
302
+ name,
303
+ optional,
304
+ bubblingType: nonNullableBubblingType,
305
+ typeAnnotation: {
306
+ type: 'EventTypeAnnotation',
307
+ argument: getEventArgument(
308
+ nonNullableArgumentProps,
309
+ buildPropertiesForEvent,
310
+ parser,
311
+ ),
312
+ },
313
+ };
239
314
  }
240
315
 
241
316
  // $FlowFixMe[unclear-type] there's no flowtype for ASTs
@@ -250,10 +325,11 @@ type TypeMap = {
250
325
  function getEvents(
251
326
  eventTypeAST: $ReadOnlyArray<EventTypeAST>,
252
327
  types: TypeMap,
328
+ parser: Parser,
253
329
  ): $ReadOnlyArray<EventTypeShape> {
254
330
  return eventTypeAST
255
331
  .filter(property => property.type === 'ObjectTypeProperty')
256
- .map(property => buildEventSchema(types, property))
332
+ .map(property => buildEventSchema(types, property, parser))
257
333
  .filter(Boolean);
258
334
  }
259
335
 
@@ -14,144 +14,25 @@ const _require = require('./commands'),
14
14
  getCommands = _require.getCommands;
15
15
  const _require2 = require('./events'),
16
16
  getEvents = _require2.getEvents;
17
- const _require3 = require('./extends'),
18
- getExtendsProps = _require3.getExtendsProps,
19
- removeKnownExtends = _require3.removeKnownExtends;
20
- const _require4 = require('./props'),
21
- getProps = _require4.getProps;
22
- const _require5 = require('./componentsUtils.js'),
23
- getProperties = _require5.getProperties;
24
- const _require6 = require('../../error-utils'),
25
- throwIfMoreThanOneCodegenNativecommands =
26
- _require6.throwIfMoreThanOneCodegenNativecommands;
27
- const _require7 = require('../../parsers-commons'),
28
- createComponentConfig = _require7.createComponentConfig,
29
- findNativeComponentType = _require7.findNativeComponentType,
30
- getCommandOptions = _require7.getCommandOptions,
31
- getOptions = _require7.getOptions;
32
-
33
- // $FlowFixMe[signature-verification-failure] there's no flowtype for AST
34
- function findComponentConfig(ast, parser) {
35
- const foundConfigs = [];
36
- const defaultExports = ast.body.filter(
37
- node => node.type === 'ExportDefaultDeclaration',
38
- );
39
- defaultExports.forEach(statement => {
40
- findNativeComponentType(statement, foundConfigs, parser);
41
- });
42
- if (foundConfigs.length === 0) {
43
- throw new Error('Could not find component config for native component');
44
- }
45
- if (foundConfigs.length > 1) {
46
- throw new Error('Only one component is supported per file');
47
- }
48
- const foundConfig = foundConfigs[0];
49
- const namedExports = ast.body.filter(
50
- node => node.type === 'ExportNamedDeclaration',
51
- );
52
- const commandsTypeNames = namedExports
53
- .map(statement => {
54
- let callExpression;
55
- let calleeName;
56
- try {
57
- callExpression = statement.declaration.declarations[0].init;
58
- calleeName = callExpression.callee.name;
59
- } catch (e) {
60
- return;
61
- }
62
- if (calleeName !== 'codegenNativeCommands') {
63
- return;
64
- }
65
-
66
- // const statement.declaration.declarations[0].init
67
- if (callExpression.arguments.length !== 1) {
68
- throw new Error(
69
- 'codegenNativeCommands must be passed options including the supported commands',
70
- );
71
- }
72
- const typeArgumentParam = callExpression.typeArguments.params[0];
73
- if (typeArgumentParam.type !== 'GenericTypeAnnotation') {
74
- throw new Error(
75
- "codegenNativeCommands doesn't support inline definitions. Specify a file local type alias",
76
- );
77
- }
78
- return {
79
- commandTypeName: typeArgumentParam.id.name,
80
- commandOptionsExpression: callExpression.arguments[0],
81
- };
82
- })
83
- .filter(Boolean);
84
- throwIfMoreThanOneCodegenNativecommands(commandsTypeNames);
85
- return createComponentConfig(foundConfig, commandsTypeNames);
86
- }
87
- function getCommandProperties(
88
- /* $FlowFixMe[missing-local-annot] The type annotation(s) required by Flow's
89
- * LTI update could not be added via codemod */
90
- commandTypeName,
91
- types,
92
- commandOptions,
93
- ) {
94
- if (commandTypeName == null) {
95
- return [];
96
- }
97
- const typeAlias = types[commandTypeName];
98
- if (typeAlias.type !== 'InterfaceDeclaration') {
99
- throw new Error(
100
- `The type argument for codegenNativeCommands must be an interface, received ${typeAlias.type}`,
101
- );
102
- }
103
- let properties;
104
- try {
105
- properties = typeAlias.body.properties;
106
- } catch (e) {
107
- throw new Error(
108
- `Failed to find type definition for "${commandTypeName}", please check that you have a valid codegen flow file`,
109
- );
110
- }
111
- const flowPropertyNames = properties
112
- .map(property => property && property.key && property.key.name)
113
- .filter(Boolean);
114
- if (commandOptions == null || commandOptions.supportedCommands == null) {
115
- throw new Error(
116
- 'codegenNativeCommands must be given an options object with supportedCommands array',
117
- );
118
- }
119
- if (
120
- commandOptions.supportedCommands.length !== flowPropertyNames.length ||
121
- !commandOptions.supportedCommands.every(supportedCommand =>
122
- flowPropertyNames.includes(supportedCommand),
123
- )
124
- ) {
125
- throw new Error(
126
- `codegenNativeCommands expected the same supportedCommands specified in the ${commandTypeName} interface: ${flowPropertyNames.join(
127
- ', ',
128
- )}`,
129
- );
130
- }
131
- return properties;
132
- }
17
+ const _require3 = require('../../parsers-commons'),
18
+ getOptions = _require3.getOptions,
19
+ findComponentConfig = _require3.findComponentConfig,
20
+ getCommandProperties = _require3.getCommandProperties;
133
21
 
134
22
  // $FlowFixMe[signature-verification-failure] there's no flowtype for AST
135
23
  function buildComponentSchema(ast, parser) {
136
24
  const _findComponentConfig = findComponentConfig(ast, parser),
137
25
  componentName = _findComponentConfig.componentName,
138
26
  propsTypeName = _findComponentConfig.propsTypeName,
139
- commandTypeName = _findComponentConfig.commandTypeName,
140
- commandOptionsExpression = _findComponentConfig.commandOptionsExpression,
141
27
  optionsExpression = _findComponentConfig.optionsExpression;
142
28
  const types = parser.getTypes(ast);
143
- const propProperties = getProperties(propsTypeName, types);
144
- const commandOptions = getCommandOptions(commandOptionsExpression);
145
- const commandProperties = getCommandProperties(
146
- commandTypeName,
147
- types,
148
- commandOptions,
149
- );
150
- const extendsProps = getExtendsProps(propProperties, types);
29
+ const propProperties = parser.getProperties(propsTypeName, types);
30
+ const commandProperties = getCommandProperties(ast, parser);
31
+ const _parser$getProps = parser.getProps(propProperties, types),
32
+ extendsProps = _parser$getProps.extendsProps,
33
+ props = _parser$getProps.props;
151
34
  const options = getOptions(optionsExpression);
152
- const nonExtendsProps = removeKnownExtends(propProperties, types);
153
- const props = getProps(nonExtendsProps, types);
154
- const events = getEvents(propProperties, types);
35
+ const events = getEvents(propProperties, types, parser);
155
36
  const commands = getCommands(commandProperties, types);
156
37
  return {
157
38
  filename: componentName,