@react-native-windows/codegen 0.75.0 → 0.75.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 +13 -5
- package/lib-commonjs/Cli.js +11 -0
- package/lib-commonjs/Cli.js.map +1 -1
- package/lib-commonjs/generators/AliasManaging.d.ts +3 -3
- package/lib-commonjs/generators/AliasManaging.js.map +1 -1
- package/lib-commonjs/generators/GenerateComponentWindows.d.ts +13 -0
- package/lib-commonjs/generators/GenerateComponentWindows.js +337 -0
- package/lib-commonjs/generators/GenerateComponentWindows.js.map +1 -0
- package/lib-commonjs/generators/PropObjectTypes.d.ts +18 -0
- package/lib-commonjs/generators/PropObjectTypes.js +217 -0
- package/lib-commonjs/generators/PropObjectTypes.js.map +1 -0
- package/lib-commonjs/index.d.ts +3 -1
- package/lib-commonjs/index.js +16 -13
- package/lib-commonjs/index.js.map +1 -1
- package/package.json +1 -1
- package/src/Cli.ts +11 -0
- package/src/generators/AliasManaging.ts +12 -12
- package/src/generators/GenerateComponentWindows.ts +393 -0
- package/src/generators/PropObjectTypes.ts +233 -0
- package/src/index.ts +25 -2
package/src/index.ts
CHANGED
|
@@ -10,6 +10,7 @@ import fs from '@react-native-windows/fs';
|
|
|
10
10
|
import globby from 'globby';
|
|
11
11
|
import type {CppStringTypes} from './generators/GenerateNM2';
|
|
12
12
|
import {createNM2Generator} from './generators/GenerateNM2';
|
|
13
|
+
import {createComponentGenerator} from './generators/GenerateComponentWindows';
|
|
13
14
|
import {
|
|
14
15
|
generateTypeScript,
|
|
15
16
|
setOptionalTurboModule,
|
|
@@ -49,6 +50,8 @@ export interface SharedOptions {
|
|
|
49
50
|
modulesCxx: boolean;
|
|
50
51
|
modulesTypeScriptTypes: boolean;
|
|
51
52
|
modulesWindows: boolean;
|
|
53
|
+
componentsWindows: boolean,
|
|
54
|
+
internalComponents: boolean,
|
|
52
55
|
namespace: string;
|
|
53
56
|
outputDirectory: string;
|
|
54
57
|
cppStringType: CppStringTypes;
|
|
@@ -214,6 +217,8 @@ export function generate(
|
|
|
214
217
|
modulesCxx,
|
|
215
218
|
modulesTypeScriptTypes,
|
|
216
219
|
modulesWindows,
|
|
220
|
+
internalComponents,
|
|
221
|
+
componentsWindows,
|
|
217
222
|
namespace,
|
|
218
223
|
outputDirectory,
|
|
219
224
|
cppStringType,
|
|
@@ -320,6 +325,10 @@ export function generate(
|
|
|
320
325
|
)
|
|
321
326
|
) {
|
|
322
327
|
const componentGenerators = [
|
|
328
|
+
];
|
|
329
|
+
|
|
330
|
+
if (internalComponents) {
|
|
331
|
+
componentGenerators.push(
|
|
323
332
|
generatorComponentDescriptorH,
|
|
324
333
|
generatorEventEmitterCPP,
|
|
325
334
|
generatorEventEmitterH,
|
|
@@ -328,8 +337,18 @@ export function generate(
|
|
|
328
337
|
generatorShadowNodeCPP,
|
|
329
338
|
generatorShadowNodeH,
|
|
330
339
|
generatorStateCPP,
|
|
331
|
-
generatorStateH
|
|
332
|
-
|
|
340
|
+
generatorStateH
|
|
341
|
+
);
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
if (componentsWindows) {
|
|
345
|
+
const generateComponentWindows = createComponentGenerator({
|
|
346
|
+
namespace,
|
|
347
|
+
cppStringType,
|
|
348
|
+
});
|
|
349
|
+
|
|
350
|
+
componentGenerators.push(generateComponentWindows);
|
|
351
|
+
}
|
|
333
352
|
|
|
334
353
|
componentGenerators.forEach(generator => {
|
|
335
354
|
const generated: Map<string, string> = generator(
|
|
@@ -369,6 +388,8 @@ export function runCodeGen(options: CodeGenOptions): boolean {
|
|
|
369
388
|
modulesCxx,
|
|
370
389
|
modulesTypeScriptTypes,
|
|
371
390
|
modulesWindows,
|
|
391
|
+
componentsWindows,
|
|
392
|
+
internalComponents,
|
|
372
393
|
namespace,
|
|
373
394
|
outputDirectory,
|
|
374
395
|
cppStringType,
|
|
@@ -381,6 +402,8 @@ export function runCodeGen(options: CodeGenOptions): boolean {
|
|
|
381
402
|
modulesCxx,
|
|
382
403
|
modulesTypeScriptTypes,
|
|
383
404
|
modulesWindows,
|
|
405
|
+
componentsWindows,
|
|
406
|
+
internalComponents,
|
|
384
407
|
namespace,
|
|
385
408
|
outputDirectory,
|
|
386
409
|
cppStringType,
|