@react-native-oh/react-native-harmony-cli 0.0.30 → 0.0.37
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 +105 -10
- package/dist/autolinking/Autolinking.js +9 -11
- package/dist/codegen/core/EventUtils.js +5 -8
- package/dist/codegen/core/TypeAnnotationToTS.js +3 -3
- package/dist/codegen/core/UberSchema.js +7 -11
- package/dist/codegen/generators/AppBuildTimeGlueCodeGenerator.js +2 -1
- package/dist/codegen/generators/ArkTSComponentCodeGeneratorArkTS.js +3 -0
- package/dist/codegen/generators/ArkTSComponentCodeGeneratorCAPI.js +3 -0
- package/dist/codegen/generators/CppComponentCodeGenerator.js +3 -0
- package/dist/codegen/generators/LibGlueCodeGenerator.js +2 -2
- package/dist/codegen/templates/BasePackageHTemplate.js +12 -1
- package/dist/codegen/templates/ComponentJSIBinderHTemplate.js +15 -0
- package/dist/codegen/templates/RNOHGeneratedPackageHTemplate.js +12 -1
- package/dist/commands/bundle-harmony.js +4 -67
- package/dist/commands/codegen-harmony.js +13 -17
- package/dist/commands/codegen-lib-harmony.js +10 -14
- package/dist/commands/create-metro-host-constants.js +1 -1
- package/dist/commands/index.js +2 -1
- package/dist/commands/init.js +703 -0
- package/dist/commands/link-harmony.js +1 -1
- package/dist/commands/pack-harmony.js +1 -1
- package/dist/commands/run-harmony.js +462 -0
- package/dist/commands/types.js +8 -0
- package/dist/commands/unpack-harmony.js +2 -4
- package/dist/commands/verify-package-harmony.js +2 -2
- package/dist/core/CodegenConfig.js +4 -6
- package/dist/core/DescriptiveError.js +8 -4
- package/dist/core/PackageJSON.js +4 -7
- package/dist/core/fs.js +4 -5
- package/dist/index.js +2 -1
- package/dist/io/CliExecutor.js +57 -24
- package/dist/io/Logger.js +72 -42
- package/dist/io/TarGz.js +1 -2
- package/dist/io/__fixtures__.js +9 -3
- package/dist/io/fsUtils.js +1 -2
- package/dist/package-verifier/checks/HarmonyDirContainsOnlyHarsCheck.js +1 -2
- package/dist/package-verifier/checks/HarmonyDirExistsCheck.js +1 -2
- package/dist/package-verifier/checks/NpmAnAndOhPackageVersionsAreEqual.js +1 -2
- package/dist/package-verifier/checks/OhPackageNameFollowsNamingConventionCheck.js +1 -2
- package/dist/package-verifier/verify-package.js +7 -10
- package/dist/simulator/LaunchSimulator.js +311 -0
- package/dist/simulator/index.js +23 -0
- package/package.json +13 -6
- package/src/assetResolver.ts +117 -11
- package/src/autolinking/Autolinking.ts +10 -12
- package/src/codegen/core/EventUtils.ts +4 -6
- package/src/codegen/core/UberSchema.ts +7 -11
- package/src/codegen/generators/AppBuildTimeGlueCodeGenerator.ts +5 -1
- package/src/codegen/generators/ArkTSComponentCodeGeneratorArkTS.ts +3 -0
- package/src/codegen/generators/ArkTSComponentCodeGeneratorCAPI.ts +3 -0
- package/src/codegen/generators/CppComponentCodeGenerator.ts +3 -0
- package/src/codegen/generators/LibGlueCodeGenerator.ts +2 -2
- package/src/codegen/templates/BasePackageHTemplate.ts +13 -1
- package/src/codegen/templates/ComponentJSIBinderHTemplate.ts +24 -1
- package/src/codegen/templates/RNOHGeneratedPackageHTemplate.ts +13 -1
- package/src/commands/bundle-harmony.ts +6 -81
- package/src/commands/codegen-harmony.ts +14 -19
- package/src/commands/codegen-lib-harmony.ts +11 -16
- package/src/commands/create-metro-host-constants.ts +2 -2
- package/src/commands/index.ts +2 -1
- package/src/commands/init.ts +755 -0
- package/src/commands/link-harmony.ts +2 -2
- package/src/commands/pack-harmony.ts +2 -2
- package/src/commands/run-harmony.ts +506 -0
- package/src/commands/types.ts +21 -0
- package/src/commands/unpack-harmony.ts +3 -5
- package/src/commands/verify-package-harmony.ts +3 -3
- package/src/core/CodegenConfig.ts +4 -6
- package/src/core/DescriptiveError.ts +9 -9
- package/src/core/PackageJSON.ts +5 -8
- package/src/core/fs.ts +2 -2
- package/src/index.ts +5 -3
- package/src/io/CliExecutor.ts +56 -34
- package/src/io/Logger.ts +78 -45
- package/src/io/__fixtures__.ts +15 -11
- package/src/package-verifier/verify-package.ts +5 -7
- package/src/simulator/LaunchSimulator.ts +352 -0
- package/src/simulator/index.ts +8 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/**
|
|
3
|
-
* Copyright (c) 2024 Huawei Technologies Co., Ltd.
|
|
3
|
+
* Copyright (c) 2024-2025 Huawei Technologies Co., Ltd.
|
|
4
4
|
*
|
|
5
5
|
* This source code is licensed under the MIT license found in the
|
|
6
6
|
* LICENSE-MIT file in the root directory of this source tree.
|
|
@@ -107,19 +107,19 @@ function validateRawArgs(rawArgs) {
|
|
|
107
107
|
if (!rawArgs.npmPackageName) {
|
|
108
108
|
throw new core_1.DescriptiveError({
|
|
109
109
|
whatHappened: '--npm-package-name is required',
|
|
110
|
-
whatCanUserDo:
|
|
110
|
+
whatCanUserDo: ['Please specify --npm-package-name'],
|
|
111
111
|
});
|
|
112
112
|
}
|
|
113
113
|
if (!rawArgs.cppOutputPath) {
|
|
114
114
|
throw new core_1.DescriptiveError({
|
|
115
115
|
whatHappened: '--cpp-output-path is required',
|
|
116
|
-
whatCanUserDo:
|
|
116
|
+
whatCanUserDo: ['Please specify --cpp-output-path'],
|
|
117
117
|
});
|
|
118
118
|
}
|
|
119
119
|
if (!rawArgs.etsOutputPath) {
|
|
120
120
|
throw new core_1.DescriptiveError({
|
|
121
121
|
whatHappened: '--ets-output-path is required',
|
|
122
|
-
whatCanUserDo:
|
|
122
|
+
whatCanUserDo: ['Please specify --ets-output-path'],
|
|
123
123
|
});
|
|
124
124
|
}
|
|
125
125
|
return {
|
|
@@ -138,9 +138,7 @@ function specPathsToSpecFilePaths(specPaths) {
|
|
|
138
138
|
if (!node_fs_1.default.existsSync(specPath.getValue())) {
|
|
139
139
|
throw new core_1.DescriptiveError({
|
|
140
140
|
whatHappened: `No such file or directory: ${specPath.getValue()}`,
|
|
141
|
-
whatCanUserDo:
|
|
142
|
-
default: [`Are you sure provided specPath exists?`],
|
|
143
|
-
},
|
|
141
|
+
whatCanUserDo: [`Are you sure provided specPath exists?`],
|
|
144
142
|
});
|
|
145
143
|
}
|
|
146
144
|
if (node_fs_1.default.lstatSync(specPath.getValue()).isDirectory()) {
|
|
@@ -237,12 +235,10 @@ function prepareDirectory(path, enableSafetyCheck) {
|
|
|
237
235
|
if (enableSafetyCheck && !path.getValue().startsWith(process.cwd())) {
|
|
238
236
|
throw new core_1.DescriptiveError({
|
|
239
237
|
whatHappened: `Tried to remove files in ${path.getValue()}\nand that path is outside current working directory`,
|
|
240
|
-
whatCanUserDo:
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
],
|
|
245
|
-
},
|
|
238
|
+
whatCanUserDo: [
|
|
239
|
+
'Run this command with --no-safety-check flag',
|
|
240
|
+
'Run codegen from different location',
|
|
241
|
+
],
|
|
246
242
|
});
|
|
247
243
|
}
|
|
248
244
|
(0, core_1.maybeRemoveFilesInDirectory)(path);
|
|
@@ -254,6 +250,6 @@ function logCodegenResult(logger, fileContentByPath, rootPath) {
|
|
|
254
250
|
logger.info((styles) => styles.gray(`• ${pathStr}`));
|
|
255
251
|
});
|
|
256
252
|
logger.info(() => '');
|
|
257
|
-
logger.info((styles) => `Generated ${styles.green(styles.bold(fileContentByPath.size))} file(s)
|
|
253
|
+
logger.info((styles) => `Generated ${styles.green(styles.bold(fileContentByPath.size))} file(s)`);
|
|
258
254
|
logger.info(() => '');
|
|
259
255
|
}
|
package/dist/commands/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/**
|
|
3
|
-
* Copyright (c) 2024 Huawei Technologies Co., Ltd.
|
|
3
|
+
* Copyright (c) 2024-2025 Huawei Technologies Co., Ltd.
|
|
4
4
|
*
|
|
5
5
|
* This source code is licensed under the MIT license found in the
|
|
6
6
|
* LICENSE-MIT file in the root directory of this source tree.
|
|
@@ -28,3 +28,4 @@ __exportStar(require("./codegen-harmony"), exports);
|
|
|
28
28
|
__exportStar(require("./verify-package-harmony"), exports);
|
|
29
29
|
__exportStar(require("./codegen-lib-harmony"), exports);
|
|
30
30
|
__exportStar(require("./link-harmony"), exports);
|
|
31
|
+
__exportStar(require("./run-harmony"), exports);
|