@react-native-oh/react-native-harmony-cli 0.77.33 → 0.77.44
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/assetResolver.js +43 -74
- package/dist/autolinking/Autolinking.js +178 -179
- package/dist/codegen/core/CodegenError.js +3 -23
- package/dist/codegen/core/EventUtils.js +3 -3
- package/dist/codegen/core/TypeAnnotationToTS.js +24 -28
- package/dist/codegen/core/UberSchema.js +55 -97
- package/dist/codegen/generators/AppBuildTimeGlueCodeGenerator.js +28 -41
- package/dist/codegen/generators/ArkTSComponentCodeGeneratorArkTS.js +27 -34
- package/dist/codegen/generators/ArkTSComponentCodeGeneratorCAPI.js +25 -33
- package/dist/codegen/generators/CppComponentCodeGenerator.js +23 -28
- package/dist/codegen/generators/LibGlueCodeGenerator.js +26 -29
- package/dist/codegen/generators/NativeModuleCodeGenerator.js +25 -30
- package/dist/codegen/generators/SharedComponentCodeGenerator.js +15 -15
- package/dist/codegen/generators/UberGeneratorV1.js +24 -23
- package/dist/codegen/generators/UberGeneratorV2.js +34 -35
- package/dist/codegen/templates/BaseComponentInstanceHTemplate.js +50 -24
- package/dist/codegen/templates/BasePackageHTemplate.js +120 -21
- package/dist/codegen/templates/ComponentDescriptorHTemplate.js +54 -8
- package/dist/codegen/templates/ComponentJSIBinderHTemplate.js +75 -27
- package/dist/codegen/templates/ComponentUtilsTSTemplate.js +162 -29
- package/dist/codegen/templates/IndexTSTemplate.js +37 -17
- package/dist/codegen/templates/RNOHGeneratedPackageHTemplate.js +119 -24
- package/dist/codegen/templates/TurboModuleCppTemplate.js +38 -15
- package/dist/codegen/templates/TurboModuleHTemplate.js +32 -11
- package/dist/codegen/templates/TurboModuleSpecTSTemplate.js +52 -19
- package/dist/commands/bundle-harmony.js +118 -221
- package/dist/commands/clean-harmony.js +58 -63
- package/dist/commands/codegen-harmony.js +105 -165
- package/dist/commands/codegen-lib-harmony.js +76 -116
- package/dist/commands/init-harmony.js +151 -196
- package/dist/commands/init.js +537 -961
- package/dist/commands/link-harmony.js +35 -82
- package/dist/commands/run-harmony.js +372 -518
- package/dist/commands/verify-package-harmony.js +54 -117
- package/dist/core/AbsolutePath.js +33 -49
- package/dist/core/CodegenConfig.js +24 -22
- package/dist/core/DescriptiveError.js +18 -37
- package/dist/core/FileSystem.js +14 -18
- package/dist/core/OHPackageJSON5.js +17 -23
- package/dist/core/PackageJSON.js +26 -42
- package/dist/core/ProjectDependenciesManager.js +40 -92
- package/dist/core/ValidationError.js +2 -22
- package/dist/core/fs.js +10 -7
- package/dist/index.js +1 -1
- package/dist/init/templates/AppScopeAppJSON5Template.js +21 -8
- package/dist/init/templates/AppScopeStringVarTemplate.js +19 -8
- package/dist/init/templates/EntryIndexTemplate.js +56 -8
- package/dist/init/templates/EntryStringVarTemplate.js +27 -8
- package/dist/init/templates/HvigorConfigJson5Template.js +33 -8
- package/dist/init/templates/MetroConfigTemplate.js +38 -8
- package/dist/init/templates/OhPackageJson5Template.js +28 -8
- package/dist/init/templates/harmony/AppScope/app.json5 +10 -0
- package/dist/init/templates/harmony/AppScope/resources/base/element/string.json +8 -0
- package/dist/init/templates/harmony/AppScope/resources/base/media/app_icon.png +0 -0
- package/dist/init/templates/harmony/build-profile.json5 +36 -0
- package/dist/init/templates/harmony/codelinter.json +32 -0
- package/dist/init/templates/harmony/entry/build-profile.json5 +18 -0
- package/dist/init/templates/harmony/entry/gitignore +7 -0
- package/dist/init/templates/harmony/entry/hvigorfile.ts +13 -0
- package/dist/init/templates/harmony/entry/oh-package.json5 +9 -0
- package/dist/init/templates/harmony/entry/src/main/cpp/CMakeLists.txt +27 -0
- package/dist/init/templates/harmony/entry/src/main/cpp/PackageProvider.cpp +13 -0
- package/dist/init/templates/harmony/entry/src/main/cpp/gitignore +4 -0
- package/dist/init/templates/harmony/entry/src/main/ets/PackageProvider.ets +8 -0
- package/dist/init/templates/harmony/entry/src/main/ets/codegen/gitignore +2 -0
- package/dist/init/templates/harmony/entry/src/main/ets/entryability/EntryAbility.ets +11 -0
- package/dist/init/templates/harmony/entry/src/main/ets/gitignore +1 -0
- package/dist/init/templates/harmony/entry/src/main/ets/pages/.gitkeep +0 -0
- package/dist/init/templates/harmony/entry/src/main/ets/workers/RNOHWorker.ets +16 -0
- package/dist/init/templates/harmony/entry/src/main/module.json5 +65 -0
- package/dist/init/templates/harmony/entry/src/main/resources/base/element/color.json +8 -0
- package/dist/init/templates/harmony/entry/src/main/resources/base/element/string.json +16 -0
- package/dist/init/templates/harmony/entry/src/main/resources/base/media/background.png +0 -0
- package/dist/init/templates/harmony/entry/src/main/resources/base/media/foreground.png +0 -0
- package/dist/init/templates/harmony/entry/src/main/resources/base/media/layered_image.json +7 -0
- package/dist/init/templates/harmony/entry/src/main/resources/base/media/startIcon.png +0 -0
- package/dist/init/templates/harmony/entry/src/main/resources/base/profile/main_pages.json +5 -0
- package/dist/init/templates/harmony/entry/src/main/resources/gitignore +1 -0
- package/dist/init/templates/harmony/entry/src/ohosTest/ets/test/List.test.ets +2 -0
- package/dist/init/templates/harmony/entry/src/ohosTest/module.json5 +13 -0
- package/dist/init/templates/harmony/gitignore +16 -0
- package/dist/init/templates/harmony/hvigor/hvigor-config.json5 +22 -0
- package/dist/init/templates/harmony/hvigorfile.ts +7 -0
- package/dist/io/CliExecutor.js +46 -98
- package/dist/io/Logger.js +40 -46
- package/dist/io/RealFS.js +43 -100
- package/dist/io/TarGz.js +11 -8
- package/dist/io/__fixtures__.js +79 -141
- package/dist/io/fsUtils.js +13 -12
- package/dist/package-verifier/checks/HarmonyDirContainsOnlyHarsCheck.js +19 -47
- package/dist/package-verifier/checks/HarmonyDirExistsCheck.js +13 -41
- package/dist/package-verifier/checks/NpmAnAndOhPackageVersionsAreEqual.js +8 -38
- package/dist/package-verifier/checks/OhPackageNameFollowsNamingConventionCheck.js +22 -54
- package/dist/package-verifier/verify-package.js +56 -133
- package/dist/simulator/LaunchSimulator.js +224 -301
- package/harmony/rnoh-hvigor-plugin-0.77.44.tgz +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/0271b9dd +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/07ba0208 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/082dd09d +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/0a9e1b0b +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/0c3d528a +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/1014d3ff +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/1184678c +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/12621366 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/126d3e66 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/19262852 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/203fac53 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/237b660a +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/2528002d +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/2587d041 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/2893bd11 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/2af6ff9d +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/2bf31f33 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/333648cc +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/386f6df0 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/3b8c270e +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/3bcc34ba +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/444808bd +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/44a775e2 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/46da3ccd +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/51f80e35 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/5203a2ca +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/52795646 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/577f8208 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/5c2aafe7 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/5c69bcfe +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/62695b92 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/62698102 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/6411ab00 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/6569ba92 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/65e5133c +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/66029655 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/69e85d0d +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/6afcb99e +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/6de07367 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/72498307 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/7babd1de +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/7fe56d21 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/810cbd72 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/812386d2 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/8448897d +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/84ab0a41 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/853825e2 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/862ad93a +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/86b14da6 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/87f0fe62 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/88ee8f74 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/8c5237c9 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/8c725800 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/8e83cbe1 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/8f4085b9 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/931f0b2e +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/940c8f92 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/968191a3 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/970780c0 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/98bc4394 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/99a3b0b0 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/9c0ffa6b +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/9d9b42c2 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/a04266ef +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/a18f78c5 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/a642fb0e +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/a97edf40 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/aa672a20 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/ae25c61a +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/b2bebae6 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/ba492422 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/bd3e6c21 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/be9e564e +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/c342b18e +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/c3993e7e +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/c52ffd54 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/c7079ad4 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/c8eb01c1 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/caee5d30 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/cf039161 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/d0377c40 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/d262bc85 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/d287cb5c +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/d64bff57 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/d716a608 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/d751012b +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/e0873711 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/e1fcf77b +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/e8548d8a +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/eaedd71d +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/eca0019e +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/f7189953 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/f75cb201 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/f888164b +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/fdb9eb5a +0 -0
- package/package.json +5 -1
|
@@ -1,27 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
3
|
exports.CodegenError = void 0;
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
function CodegenError() {
|
|
23
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
24
|
-
}
|
|
25
|
-
return CodegenError;
|
|
26
|
-
}(core_1.DescriptiveError));
|
|
4
|
+
const core_1 = require("../../core");
|
|
5
|
+
class CodegenError extends core_1.DescriptiveError {
|
|
6
|
+
}
|
|
27
7
|
exports.CodegenError = CodegenError;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createEventNameFromEventHandlerName = createEventNameFromEventHandlerName;
|
|
4
|
-
|
|
4
|
+
const CodegenError_1 = require("./CodegenError");
|
|
5
5
|
function createEventNameFromEventHandlerName(eventHandlerName) {
|
|
6
|
-
|
|
6
|
+
const eventName = eventHandlerName.replace('on', '');
|
|
7
7
|
if (eventName.length === 0) {
|
|
8
8
|
throw new CodegenError_1.CodegenError({
|
|
9
|
-
whatHappened:
|
|
9
|
+
whatHappened: `Received invalid event handler name: ${eventHandlerName}`,
|
|
10
10
|
whatCanUserDo: [
|
|
11
11
|
'Change your event listener name to match naming convention "onEventName" e.g. "onPress"',
|
|
12
12
|
],
|
|
@@ -3,13 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.TypeAnnotationToTS = void 0;
|
|
4
4
|
exports.getStringifiedTSDefaultValueFromPropTypeAnnotation = getStringifiedTSDefaultValueFromPropTypeAnnotation;
|
|
5
5
|
exports.wrapWithQuotes = wrapWithQuotes;
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
if (aliasPrefix === void 0) { aliasPrefix = ''; }
|
|
6
|
+
class TypeAnnotationToTS {
|
|
7
|
+
constructor(aliasPrefix = '') {
|
|
9
8
|
this.aliasPrefix = aliasPrefix;
|
|
10
9
|
}
|
|
11
|
-
|
|
12
|
-
var _this = this;
|
|
10
|
+
convert(typeAnnotation) {
|
|
13
11
|
if (!typeAnnotation) {
|
|
14
12
|
return 'unknown';
|
|
15
13
|
}
|
|
@@ -52,7 +50,7 @@ var TypeAnnotationToTS = /** @class */ (function () {
|
|
|
52
50
|
}
|
|
53
51
|
case 'StringEnumTypeAnnotation':
|
|
54
52
|
return typeAnnotation.options
|
|
55
|
-
.map(
|
|
53
|
+
.map((option) => {
|
|
56
54
|
if (typeof option !== 'string') {
|
|
57
55
|
return option;
|
|
58
56
|
}
|
|
@@ -62,11 +60,11 @@ var TypeAnnotationToTS = /** @class */ (function () {
|
|
|
62
60
|
case 'StringTypeAnnotation':
|
|
63
61
|
return 'string';
|
|
64
62
|
case 'FunctionTypeAnnotation':
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
.map(
|
|
63
|
+
const { params, returnTypeAnnotation } = typeAnnotation;
|
|
64
|
+
const stringifiedArgs = params
|
|
65
|
+
.map((param) => `${param.name}: ${this.convert(param.typeAnnotation)}`)
|
|
68
66
|
.join(', ');
|
|
69
|
-
return
|
|
67
|
+
return `(${stringifiedArgs}) => ${this.convert(returnTypeAnnotation)}`;
|
|
70
68
|
case 'EnumDeclaration':
|
|
71
69
|
return typeAnnotation.name;
|
|
72
70
|
case 'GenericObjectTypeAnnotation':
|
|
@@ -78,20 +76,20 @@ var TypeAnnotationToTS = /** @class */ (function () {
|
|
|
78
76
|
case 'NumberTypeAnnotation':
|
|
79
77
|
return 'number';
|
|
80
78
|
case 'NullableTypeAnnotation':
|
|
81
|
-
return
|
|
79
|
+
return `null | ${this.convert(typeAnnotation.typeAnnotation)}`;
|
|
82
80
|
case 'ObjectTypeAnnotation':
|
|
83
81
|
return this.convertObjectTypeAnnotation(typeAnnotation);
|
|
84
82
|
case 'PromiseTypeAnnotation':
|
|
85
|
-
return
|
|
83
|
+
return `Promise<${this.convert(typeAnnotation.elementType)}>`;
|
|
86
84
|
case 'VoidTypeAnnotation':
|
|
87
85
|
return 'void';
|
|
88
86
|
case 'ArrayTypeAnnotation':
|
|
89
|
-
return
|
|
87
|
+
return `${this.convert(typeAnnotation.elementType)}[]`;
|
|
90
88
|
default:
|
|
91
89
|
return 'unknown';
|
|
92
90
|
}
|
|
93
|
-
}
|
|
94
|
-
|
|
91
|
+
}
|
|
92
|
+
convertUnionMemberAnnotation(memberAnnotation) {
|
|
95
93
|
switch (memberAnnotation) {
|
|
96
94
|
case 'NumberTypeAnnotation':
|
|
97
95
|
return 'number';
|
|
@@ -100,22 +98,20 @@ var TypeAnnotationToTS = /** @class */ (function () {
|
|
|
100
98
|
case 'StringTypeAnnotation':
|
|
101
99
|
return 'string';
|
|
102
100
|
}
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
return "".concat(prop.name).concat(maybeOptionalSymbol, ": ").concat(_this.convert(prop.typeAnnotation));
|
|
101
|
+
}
|
|
102
|
+
convertObjectTypeAnnotation(objectTypeAnnotation) {
|
|
103
|
+
const props = objectTypeAnnotation.properties
|
|
104
|
+
.map((prop) => {
|
|
105
|
+
const maybeOptionalSymbol = prop.optional ? '?' : '';
|
|
106
|
+
return `${prop.name}${maybeOptionalSymbol}: ${this.convert(prop.typeAnnotation)}`;
|
|
110
107
|
})
|
|
111
108
|
.join(', ');
|
|
112
109
|
if (props.length === 0) {
|
|
113
110
|
return '{}';
|
|
114
111
|
}
|
|
115
|
-
return
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
}());
|
|
112
|
+
return `{${props}}`;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
119
115
|
exports.TypeAnnotationToTS = TypeAnnotationToTS;
|
|
120
116
|
function getStringifiedTSDefaultValueFromPropTypeAnnotation(propTypeAnnotation) {
|
|
121
117
|
if ('default' in propTypeAnnotation && propTypeAnnotation.default !== null) {
|
|
@@ -128,9 +124,9 @@ function getStringifiedTSDefaultValueFromPropTypeAnnotation(propTypeAnnotation)
|
|
|
128
124
|
}
|
|
129
125
|
function wrapWithQuotes(str) {
|
|
130
126
|
if (str.includes("'")) {
|
|
131
|
-
return "
|
|
127
|
+
return `"${str}"`;
|
|
132
128
|
}
|
|
133
129
|
else {
|
|
134
|
-
return
|
|
130
|
+
return `'${str}'`;
|
|
135
131
|
}
|
|
136
132
|
}
|
|
@@ -8,53 +8,23 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
13
|
-
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
-
function step(op) {
|
|
16
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
-
switch (op[0]) {
|
|
21
|
-
case 0: case 1: t = op; break;
|
|
22
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
-
default:
|
|
26
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
-
if (t[2]) _.ops.pop();
|
|
31
|
-
_.trys.pop(); continue;
|
|
32
|
-
}
|
|
33
|
-
op = body.call(thisArg, _);
|
|
34
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
12
|
exports.UberSchema = void 0;
|
|
40
|
-
|
|
13
|
+
const core_1 = require("../../core");
|
|
41
14
|
// @ts-expect-error
|
|
42
|
-
|
|
43
|
-
|
|
15
|
+
const combine_js_to_schema_js_1 = require("@react-native/codegen/lib/cli/combine/combine-js-to-schema.js");
|
|
16
|
+
const CodegenError_1 = require("./CodegenError");
|
|
44
17
|
function createRawUberSchemaFromSpecFilePaths(projectSourceFilePaths) {
|
|
45
|
-
return (0, combine_js_to_schema_js_1.combineSchemas)(projectSourceFilePaths.map(
|
|
18
|
+
return (0, combine_js_to_schema_js_1.combineSchemas)(projectSourceFilePaths.map((p) => p.getValue()));
|
|
46
19
|
}
|
|
47
20
|
/**
|
|
48
21
|
* Contains component and turbo module (NativeModule) schemas. The "Uber" word is used here to highlight that SpecSchemas don't extend this class.
|
|
49
22
|
*/
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
this.schemaValue = schemaValue;
|
|
53
|
-
}
|
|
54
|
-
UberSchema.fromSpecFilePaths = function (specPaths) {
|
|
23
|
+
class UberSchema {
|
|
24
|
+
static fromSpecFilePaths(specPaths) {
|
|
55
25
|
return new UberSchema(createRawUberSchemaFromSpecFilePaths(specPaths));
|
|
56
|
-
}
|
|
57
|
-
|
|
26
|
+
}
|
|
27
|
+
static fromCodegenConfig(codegenConfig) {
|
|
58
28
|
try {
|
|
59
29
|
return new UberSchema(createRawUberSchemaFromSpecFilePaths(codegenConfig.getSpecFilePaths()));
|
|
60
30
|
}
|
|
@@ -63,76 +33,64 @@ var UberSchema = /** @class */ (function () {
|
|
|
63
33
|
throw new CodegenError_1.CodegenError({
|
|
64
34
|
whatHappened: "Couldn't create the schema",
|
|
65
35
|
whatCanUserDo: [
|
|
66
|
-
|
|
36
|
+
`There's probably at least one spec file defined in your project or in a third-party package that breaks some code generation restrictions. Please check the message below. If it's ambiguous, debug the problem with divide and conquer strategy.\n\n${err.message}`,
|
|
67
37
|
],
|
|
68
38
|
});
|
|
69
39
|
}
|
|
70
40
|
throw err;
|
|
71
41
|
}
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
var codegenConfigs = dependency.getCodegenConfigs();
|
|
91
|
-
for (var _i = 0, codegenConfigs_1 = codegenConfigs; _i < codegenConfigs_1.length; _i++) {
|
|
92
|
-
var codegenConfig = codegenConfigs_1[_i];
|
|
93
|
-
if (onShouldAcceptCodegenConfig_(codegenConfig.getVersion(), dependency.readPackageJSON().name)) {
|
|
94
|
-
acceptedCodegenConfigs.push(codegenConfig);
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
})];
|
|
98
|
-
case 1:
|
|
99
|
-
_a.sent();
|
|
100
|
-
try {
|
|
101
|
-
return [2 /*return*/, new UberSchema(createRawUberSchemaFromSpecFilePaths(acceptedCodegenConfigs.flatMap(function (codegenConfig) {
|
|
102
|
-
return codegenConfig.getSpecFilePaths();
|
|
103
|
-
})))];
|
|
104
|
-
}
|
|
105
|
-
catch (err) {
|
|
106
|
-
if (err instanceof Error) {
|
|
107
|
-
throw new CodegenError_1.CodegenError({
|
|
108
|
-
whatHappened: "Couldn't create the schema",
|
|
109
|
-
whatCanUserDo: [
|
|
110
|
-
"There's probably at least one spec file defined in your project or in a third-party package that breaks some code generation restrictions. Please check the message below. If it's ambiguous, debug the problem with divide and conquer strategy.\n\n".concat(err.message),
|
|
111
|
-
],
|
|
112
|
-
});
|
|
113
|
-
}
|
|
114
|
-
throw err;
|
|
115
|
-
}
|
|
116
|
-
return [2 /*return*/];
|
|
42
|
+
}
|
|
43
|
+
static fromProject(fs, projectRootPath, onShouldAcceptCodegenConfig) {
|
|
44
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
45
|
+
const onShouldAcceptCodegenConfig_ = onShouldAcceptCodegenConfig !== null && onShouldAcceptCodegenConfig !== void 0 ? onShouldAcceptCodegenConfig : ((x) => true);
|
|
46
|
+
const packageJSON = core_1.PackageJSON.fromProjectRootPath(fs, projectRootPath, projectRootPath);
|
|
47
|
+
const acceptedCodegenConfigs = [];
|
|
48
|
+
const appCodegenConfigs = packageJSON.getCodegenConfigs();
|
|
49
|
+
for (const codegenConfig of appCodegenConfigs) {
|
|
50
|
+
if (onShouldAcceptCodegenConfig_(codegenConfig.getVersion(), packageJSON.name)) {
|
|
51
|
+
acceptedCodegenConfigs.push(codegenConfig);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
yield new core_1.ProjectDependenciesManager(fs, projectRootPath).forEachAsync((dependency) => {
|
|
55
|
+
const codegenConfigs = dependency.getCodegenConfigs();
|
|
56
|
+
for (const codegenConfig of codegenConfigs) {
|
|
57
|
+
if (onShouldAcceptCodegenConfig_(codegenConfig.getVersion(), dependency.readPackageJSON().name)) {
|
|
58
|
+
acceptedCodegenConfigs.push(codegenConfig);
|
|
59
|
+
}
|
|
117
60
|
}
|
|
118
61
|
});
|
|
62
|
+
try {
|
|
63
|
+
return new UberSchema(createRawUberSchemaFromSpecFilePaths(acceptedCodegenConfigs.flatMap((codegenConfig) => codegenConfig.getSpecFilePaths())));
|
|
64
|
+
}
|
|
65
|
+
catch (err) {
|
|
66
|
+
if (err instanceof Error) {
|
|
67
|
+
throw new CodegenError_1.CodegenError({
|
|
68
|
+
whatHappened: "Couldn't create the schema",
|
|
69
|
+
whatCanUserDo: [
|
|
70
|
+
`There's probably at least one spec file defined in your project or in a third-party package that breaks some code generation restrictions. Please check the message below. If it's ambiguous, debug the problem with divide and conquer strategy.\n\n${err.message}`,
|
|
71
|
+
],
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
throw err;
|
|
75
|
+
}
|
|
119
76
|
});
|
|
120
|
-
}
|
|
121
|
-
|
|
77
|
+
}
|
|
78
|
+
constructor(schemaValue) {
|
|
79
|
+
this.schemaValue = schemaValue;
|
|
80
|
+
}
|
|
81
|
+
getValue() {
|
|
122
82
|
return this.schemaValue;
|
|
123
|
-
}
|
|
124
|
-
|
|
83
|
+
}
|
|
84
|
+
findAllSpecSchemasByType(schemaType) {
|
|
125
85
|
return Object.values(this.schemaValue.modules)
|
|
126
|
-
.filter(
|
|
127
|
-
.map(
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
return Object.entries(this.schemaValue.modules).reduce(
|
|
131
|
-
var moduleName = _a[0], moduleSchema = _a[1];
|
|
86
|
+
.filter((module) => module.type === schemaType)
|
|
87
|
+
.map((module) => module);
|
|
88
|
+
}
|
|
89
|
+
getSpecSchemaByFilenameMap() {
|
|
90
|
+
return Object.entries(this.schemaValue.modules).reduce((acc, [moduleName, moduleSchema]) => {
|
|
132
91
|
acc.set(moduleName, moduleSchema);
|
|
133
92
|
return acc;
|
|
134
93
|
}, new Map());
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
}());
|
|
94
|
+
}
|
|
95
|
+
}
|
|
138
96
|
exports.UberSchema = UberSchema;
|
|
@@ -1,64 +1,52 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
12
4
|
};
|
|
13
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
6
|
exports.AppBuildTimeGlueCodeGenerator = void 0;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
7
|
+
const case_1 = __importDefault(require("case"));
|
|
8
|
+
const templates_1 = require("../templates");
|
|
9
|
+
const BasePackageHTemplate_1 = require("../templates/BasePackageHTemplate");
|
|
18
10
|
/**
|
|
19
11
|
* Generates code based on UberGenerators results. If UberGenerators produce "leaves" (concrete turbo module or component classes),
|
|
20
12
|
* this class generates "branches" (barrel files like index.ts) and "trunks" (package file or files).
|
|
21
13
|
*/
|
|
22
|
-
|
|
23
|
-
|
|
14
|
+
class AppBuildTimeGlueCodeGenerator {
|
|
15
|
+
constructor(cppOutputPath, etsOutputPath, codegenNoticeLines) {
|
|
24
16
|
this.cppOutputPath = cppOutputPath;
|
|
25
17
|
this.etsOutputPath = etsOutputPath;
|
|
26
18
|
this.codegenNoticeLines = codegenNoticeLines;
|
|
27
19
|
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
var turboModules_indexTS = new templates_1.IndexTSTemplate(this.codegenNoticeLines);
|
|
35
|
-
var generated_indexETS = new templates_1.IndexTSTemplate(this.codegenNoticeLines);
|
|
20
|
+
generate({ v1, v2 }) {
|
|
21
|
+
const fileContentByPath = new Map();
|
|
22
|
+
const generatedPackageH_v1 = new templates_1.RNOHGeneratedPackageHTemplate();
|
|
23
|
+
const components_indexTS = new templates_1.IndexTSTemplate(this.codegenNoticeLines);
|
|
24
|
+
const turboModules_indexTS = new templates_1.IndexTSTemplate(this.codegenNoticeLines);
|
|
25
|
+
const generated_indexETS = new templates_1.IndexTSTemplate(this.codegenNoticeLines);
|
|
36
26
|
generated_indexETS.addReexport({ from: './ts' });
|
|
37
|
-
v1.components.forEach(
|
|
38
|
-
|
|
39
|
-
components_indexTS.addReexport({ from: "./".concat(name) });
|
|
27
|
+
v1.components.forEach(({ name, eventNames }) => {
|
|
28
|
+
components_indexTS.addReexport({ from: `./${name}` });
|
|
40
29
|
generatedPackageH_v1.addComponent({
|
|
41
|
-
name
|
|
30
|
+
name,
|
|
42
31
|
supportedEventNames: eventNames,
|
|
43
32
|
isArkTSComponent: true,
|
|
44
33
|
});
|
|
45
34
|
});
|
|
46
|
-
v1.turboModules.forEach(
|
|
47
|
-
turboModules_indexTS.addReexport({ from:
|
|
35
|
+
v1.turboModules.forEach((turboModule) => {
|
|
36
|
+
turboModules_indexTS.addReexport({ from: `./${turboModule.name}` });
|
|
48
37
|
generatedPackageH_v1.addTurboModule(turboModule);
|
|
49
38
|
});
|
|
50
|
-
v2.forEach(
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
generatedPackageH_v2.addComponent(__assign(__assign({}, component), { isArkTSComponent: false }));
|
|
39
|
+
v2.forEach(({ components, turboModules }, libraryName) => {
|
|
40
|
+
const basePackageClassName = `Base${case_1.default.pascal(libraryName)}Package`;
|
|
41
|
+
const generatedPackageH_v2 = new BasePackageHTemplate_1.BasePackageHTemplate(basePackageClassName, this.codegenNoticeLines);
|
|
42
|
+
components.forEach((component) => {
|
|
43
|
+
generatedPackageH_v2.addComponent(Object.assign(Object.assign({}, component), { isArkTSComponent: false }));
|
|
56
44
|
});
|
|
57
|
-
turboModules.forEach(
|
|
58
|
-
turboModules_indexTS.addReexport({ from:
|
|
45
|
+
turboModules.forEach((turboModule) => {
|
|
46
|
+
turboModules_indexTS.addReexport({ from: `./${turboModule.name}` });
|
|
59
47
|
generatedPackageH_v2.addTurboModule(turboModule);
|
|
60
48
|
});
|
|
61
|
-
fileContentByPath.set(
|
|
49
|
+
fileContentByPath.set(this.cppOutputPath.copyWithNewSegment(libraryName, 'RNOH', 'generated', `${basePackageClassName}.h`), generatedPackageH_v2.build());
|
|
62
50
|
});
|
|
63
51
|
fileContentByPath.set(this.cppOutputPath.copyWithNewSegment('RNOHGeneratedPackage.h'), generatedPackageH_v1.build());
|
|
64
52
|
fileContentByPath.set(this.etsOutputPath.copyWithNewSegment('ts.ts'), new templates_1.IndexTSTemplate(this.codegenNoticeLines)
|
|
@@ -69,7 +57,6 @@ var AppBuildTimeGlueCodeGenerator = /** @class */ (function () {
|
|
|
69
57
|
fileContentByPath.set(this.etsOutputPath.copyWithNewSegment('turboModules', 'ts.ts'), turboModules_indexTS.build());
|
|
70
58
|
fileContentByPath.set(this.etsOutputPath.copyWithNewSegment('index.ets'), generated_indexETS.build());
|
|
71
59
|
return fileContentByPath;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
}());
|
|
60
|
+
}
|
|
61
|
+
}
|
|
75
62
|
exports.AppBuildTimeGlueCodeGenerator = AppBuildTimeGlueCodeGenerator;
|
|
@@ -1,35 +1,33 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ArkTSComponentCodeGeneratorArkTS = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
const core_1 = require("../core");
|
|
5
|
+
const templates_1 = require("../templates");
|
|
6
|
+
class ArkTSComponentCodeGeneratorArkTS {
|
|
7
|
+
constructor(cppOutputPath, tsOutputPath, codegenNoticeLines, rnohImport) {
|
|
8
8
|
this.cppOutputPath = cppOutputPath;
|
|
9
9
|
this.tsOutputPath = tsOutputPath;
|
|
10
10
|
this.codegenNoticeLines = codegenNoticeLines;
|
|
11
11
|
this.rnohImport = rnohImport;
|
|
12
12
|
this.glueCodeDataItems = [];
|
|
13
13
|
}
|
|
14
|
-
|
|
14
|
+
getGlueCodeData() {
|
|
15
15
|
return this.glueCodeDataItems;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
var _this = this;
|
|
16
|
+
}
|
|
17
|
+
generate(schema) {
|
|
19
18
|
if (schema.type !== 'Component') {
|
|
20
19
|
throw new core_1.CodegenError({
|
|
21
|
-
whatHappened:
|
|
20
|
+
whatHappened: `ComponentCodeGenerator can't generate code for a module type: ${schema.type}`,
|
|
22
21
|
unexpected: true,
|
|
23
22
|
});
|
|
24
23
|
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
Object.entries(schema.components).map(
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
shape.props.forEach(function (prop) {
|
|
24
|
+
const typeAnnotationToTS = new core_1.TypeAnnotationToTS();
|
|
25
|
+
const result = new Map();
|
|
26
|
+
Object.entries(schema.components).map(([name, shape]) => {
|
|
27
|
+
const componentDescriptorHTemplate = new templates_1.ComponentDescriptorHTemplate(name);
|
|
28
|
+
const componentJSIBinderHTemplate = new templates_1.ComponentJSIBinderHTemplate(name, this.codegenNoticeLines);
|
|
29
|
+
const componentUtilsTSTemplate = new templates_1.ComponentUtilsTSTemplate(name, this.codegenNoticeLines, this.rnohImport);
|
|
30
|
+
shape.props.forEach((prop) => {
|
|
33
31
|
componentJSIBinderHTemplate.addProp({
|
|
34
32
|
name: prop.name,
|
|
35
33
|
isObject: prop.typeAnnotation.type === 'ObjectTypeAnnotation',
|
|
@@ -41,7 +39,7 @@ var ArkTSComponentCodeGeneratorArkTS = /** @class */ (function () {
|
|
|
41
39
|
isOptional: prop.optional,
|
|
42
40
|
});
|
|
43
41
|
});
|
|
44
|
-
shape.commands.forEach(
|
|
42
|
+
shape.commands.forEach((command) => {
|
|
45
43
|
componentJSIBinderHTemplate.addCommand({
|
|
46
44
|
name: command.name,
|
|
47
45
|
});
|
|
@@ -49,15 +47,13 @@ var ArkTSComponentCodeGeneratorArkTS = /** @class */ (function () {
|
|
|
49
47
|
name: command.name,
|
|
50
48
|
argsTSType: '[' +
|
|
51
49
|
command.typeAnnotation.params
|
|
52
|
-
.map(
|
|
53
|
-
|
|
54
|
-
(param.optional ? '?' : '');
|
|
55
|
-
})
|
|
50
|
+
.map((param) => typeAnnotationToTS.convert(param.typeAnnotation) +
|
|
51
|
+
(param.optional ? '?' : ''))
|
|
56
52
|
.join(', ') +
|
|
57
53
|
']',
|
|
58
54
|
});
|
|
59
55
|
});
|
|
60
|
-
shape.events.forEach(
|
|
56
|
+
shape.events.forEach((event) => {
|
|
61
57
|
componentUtilsTSTemplate.addEvent({
|
|
62
58
|
name: (0, core_1.createEventNameFromEventHandlerName)(event.name),
|
|
63
59
|
payloadTSType: event.typeAnnotation.argument
|
|
@@ -69,18 +65,15 @@ var ArkTSComponentCodeGeneratorArkTS = /** @class */ (function () {
|
|
|
69
65
|
eventHandlerName: event.name,
|
|
70
66
|
});
|
|
71
67
|
});
|
|
72
|
-
result.set(
|
|
73
|
-
result.set(
|
|
74
|
-
result.set(
|
|
75
|
-
|
|
76
|
-
name
|
|
77
|
-
eventNames: shape.events.map(
|
|
78
|
-
return (0, core_1.createEventNameFromEventHandlerName)(e.name);
|
|
79
|
-
}),
|
|
68
|
+
result.set(this.cppOutputPath.copyWithNewSegment(`${name}ComponentDescriptor.h`), componentDescriptorHTemplate.build());
|
|
69
|
+
result.set(this.cppOutputPath.copyWithNewSegment(`${name}JSIBinder.h`), componentJSIBinderHTemplate.build());
|
|
70
|
+
result.set(this.tsOutputPath.copyWithNewSegment(`${name}.ts`), componentUtilsTSTemplate.build());
|
|
71
|
+
this.glueCodeDataItems.push({
|
|
72
|
+
name,
|
|
73
|
+
eventNames: shape.events.map((e) => (0, core_1.createEventNameFromEventHandlerName)(e.name)),
|
|
80
74
|
});
|
|
81
75
|
});
|
|
82
76
|
return result;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
}());
|
|
77
|
+
}
|
|
78
|
+
}
|
|
86
79
|
exports.ArkTSComponentCodeGeneratorArkTS = ArkTSComponentCodeGeneratorArkTS;
|