@react-native-oh/react-native-harmony-cli 0.0.36 → 0.77.18
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/LICENSE +21 -0
- package/README.md +4 -4
- package/dist/autolinking/Autolinking.js +13 -16
- package/dist/autolinking/index.js +0 -6
- package/dist/codegen/core/CodeGenerator.js +0 -6
- package/dist/codegen/core/CodegenError.js +0 -6
- package/dist/codegen/core/EventUtils.js +0 -6
- package/dist/codegen/core/TypeAnnotationToTS.js +0 -6
- package/dist/codegen/core/UberSchema.js +2 -11
- package/dist/codegen/core/index.js +0 -6
- package/dist/codegen/generators/AppBuildTimeGlueCodeGenerator.js +2 -7
- package/dist/codegen/generators/ArkTSComponentCodeGeneratorArkTS.js +0 -6
- package/dist/codegen/generators/ArkTSComponentCodeGeneratorCAPI.js +0 -6
- package/dist/codegen/generators/CppComponentCodeGenerator.js +0 -6
- package/dist/codegen/generators/LibGlueCodeGenerator.js +2 -8
- package/dist/codegen/generators/NativeModuleCodeGenerator.js +1 -7
- package/dist/codegen/generators/SharedComponentCodeGenerator.js +0 -6
- package/dist/codegen/generators/UberGeneratorV1.js +0 -6
- package/dist/codegen/generators/UberGeneratorV2.js +0 -6
- package/dist/codegen/generators/index.js +0 -6
- package/dist/codegen/index.js +0 -6
- package/dist/codegen/templates/BaseComponentInstanceHTemplate.js +0 -6
- package/dist/codegen/templates/BasePackageHTemplate.js +12 -7
- package/dist/codegen/templates/ComponentDescriptorHTemplate.js +1 -6
- package/dist/codegen/templates/ComponentJSIBinderHTemplate.js +0 -6
- package/dist/codegen/templates/ComponentUtilsTSTemplate.js +0 -6
- package/dist/codegen/templates/IndexTSTemplate.js +0 -6
- package/dist/codegen/templates/RNOHGeneratedPackageHTemplate.js +12 -7
- package/dist/codegen/templates/TurboModuleCppTemplate.js +0 -6
- package/dist/codegen/templates/TurboModuleHTemplate.js +0 -6
- package/dist/codegen/templates/TurboModuleSpecTSTemplate.js +0 -6
- package/dist/codegen/templates/index.js +0 -6
- package/dist/commands/bundle-harmony.js +131 -36
- package/dist/commands/clean-harmony.js +84 -0
- package/dist/commands/codegen-harmony.js +0 -6
- package/dist/commands/codegen-lib-harmony.js +6 -12
- package/dist/commands/index.js +2 -9
- package/dist/commands/init-harmony.js +226 -0
- package/dist/commands/init.js +0 -0
- package/dist/commands/link-harmony.js +12 -16
- package/dist/commands/types.js +0 -6
- package/dist/commands/verify-package-harmony.js +6 -10
- package/dist/core/AbsolutePath.js +3 -6
- package/dist/core/CodegenConfig.js +0 -6
- package/dist/core/DescriptiveError.js +0 -6
- package/dist/core/FileSystem.js +0 -6
- package/dist/core/OHPackageJSON5.js +0 -6
- package/dist/core/ProjectDependenciesManager.js +6 -14
- package/dist/core/ValidationError.js +0 -6
- package/dist/core/ValueObject.js +0 -6
- package/dist/core/fs.js +13 -6
- package/dist/core/index.js +0 -6
- package/dist/index.js +2 -9
- package/dist/init/templates/AppScopeAppJSON5Template.js +30 -0
- package/dist/init/templates/AppScopeStringVarTemplate.js +28 -0
- package/dist/init/templates/EntryIndexTemplate.js +65 -0
- package/dist/init/templates/EntryStringVarTemplate.js +38 -0
- package/dist/init/templates/HvigorConfigJson5Template.js +44 -0
- package/dist/init/templates/MetroConfigTemplate.js +47 -0
- package/dist/init/templates/OhPackageJson5Template.js +37 -0
- 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 +58 -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/init/templates/index.js +21 -0
- package/dist/io/CliExecutor.js +0 -6
- package/dist/io/Logger.js +0 -6
- package/dist/io/RealFS.js +10 -6
- package/dist/io/TarGz.js +2 -8
- package/dist/io/__fixtures__.js +0 -6
- package/dist/io/fsUtils.js +0 -6
- package/dist/io/index.js +1 -6
- package/dist/package-verifier/checks/HarmonyDirContainsOnlyHarsCheck.js +0 -6
- package/dist/package-verifier/checks/HarmonyDirExistsCheck.js +0 -6
- package/dist/package-verifier/checks/NpmAnAndOhPackageVersionsAreEqual.js +0 -6
- package/dist/package-verifier/checks/OhPackageNameFollowsNamingConventionCheck.js +0 -6
- package/dist/package-verifier/checks/index.js +0 -6
- package/dist/package-verifier/index.js +0 -6
- package/dist/package-verifier/types.js +0 -6
- package/dist/package-verifier/verify-package.js +1 -7
- package/jest.config.js +0 -7
- package/package.json +15 -18
- package/react-native.config.js +0 -7
- package/scripts/copy-template.js +18 -0
- package/src/autolinking/Autolinking.test.ts +54 -18
- package/src/autolinking/Autolinking.ts +23 -20
- package/src/autolinking/index.ts +1 -8
- package/src/codegen/core/CodeGenerator.ts +0 -7
- package/src/codegen/core/CodegenError.ts +0 -7
- package/src/codegen/core/EventUtils.ts +0 -7
- package/src/codegen/core/TypeAnnotationToTS.test.ts +0 -7
- package/src/codegen/core/TypeAnnotationToTS.ts +3 -8
- package/src/codegen/core/UberSchema.ts +3 -12
- package/src/codegen/core/index.ts +0 -7
- package/src/codegen/generators/AppBuildTimeGlueCodeGenerator.ts +5 -8
- package/src/codegen/generators/ArkTSComponentCodeGeneratorArkTS.ts +0 -7
- package/src/codegen/generators/ArkTSComponentCodeGeneratorCAPI.ts +0 -7
- package/src/codegen/generators/CppComponentCodeGenerator.ts +0 -7
- package/src/codegen/generators/LibGlueCodeGenerator.ts +2 -9
- package/src/codegen/generators/NativeModuleCodeGenerator.ts +1 -8
- package/src/codegen/generators/SharedComponentCodeGenerator.ts +0 -7
- package/src/codegen/generators/UberGeneratorV1.ts +0 -7
- package/src/codegen/generators/UberGeneratorV2.ts +0 -7
- package/src/codegen/generators/index.ts +0 -7
- package/src/codegen/index.ts +0 -7
- package/src/codegen/templates/BaseComponentInstanceHTemplate.ts +0 -7
- package/src/codegen/templates/BasePackageHTemplate.ts +13 -8
- package/src/codegen/templates/ComponentDescriptorHTemplate.ts +1 -7
- package/src/codegen/templates/ComponentJSIBinderHTemplate.ts +0 -7
- package/src/codegen/templates/ComponentUtilsTSTemplate.ts +0 -7
- package/src/codegen/templates/IndexTSTemplate.ts +0 -7
- package/src/codegen/templates/RNOHGeneratedPackageHTemplate.ts +13 -8
- package/src/codegen/templates/TurboModuleCppTemplate.ts +0 -7
- package/src/codegen/templates/TurboModuleHTemplate.ts +0 -7
- package/src/codegen/templates/TurboModuleSpecTSTemplate.ts +0 -7
- package/src/codegen/templates/index.ts +0 -7
- package/src/commands/bundle-harmony.ts +174 -39
- package/src/commands/clean-harmony.ts +54 -0
- package/src/commands/codegen-harmony.ts +0 -7
- package/src/commands/codegen-lib-harmony.ts +6 -13
- package/src/commands/index.ts +2 -10
- package/src/commands/init-harmony.ts +299 -0
- package/src/commands/link-harmony.ts +13 -18
- package/src/commands/types.ts +0 -7
- package/src/commands/verify-package-harmony.ts +7 -10
- package/src/core/AbsolutePath.ts +4 -7
- package/src/core/CodegenConfig.ts +0 -7
- package/src/core/DescriptiveError.ts +0 -7
- package/src/core/FileSystem.ts +5 -8
- package/src/core/OHPackageJSON5.ts +0 -7
- package/src/core/PackageJSON.ts +0 -6
- package/src/core/ProjectDependenciesManager.ts +14 -22
- package/src/core/ValidationError.ts +0 -7
- package/src/core/ValueObject.ts +0 -7
- package/src/core/fs.ts +13 -7
- package/src/core/index.ts +0 -7
- package/src/index.ts +4 -13
- package/src/init/templates/AppScopeAppJSON5Template.ts +24 -0
- package/src/init/templates/AppScopeStringVarTemplate.ts +22 -0
- package/src/init/templates/EntryIndexTemplate.ts +59 -0
- package/src/init/templates/EntryStringVarTemplate.ts +31 -0
- package/src/init/templates/HvigorConfigJson5Template.ts +40 -0
- package/src/init/templates/MetroConfigTemplate.ts +41 -0
- package/src/init/templates/OhPackageJson5Template.ts +31 -0
- package/src/init/templates/harmony/AppScope/app.json5 +10 -0
- package/src/init/templates/harmony/AppScope/resources/base/element/string.json +8 -0
- package/src/init/templates/harmony/AppScope/resources/base/media/app_icon.png +0 -0
- package/src/init/templates/harmony/build-profile.json5 +36 -0
- package/src/init/templates/harmony/codelinter.json +32 -0
- package/src/init/templates/harmony/entry/build-profile.json5 +18 -0
- package/src/init/templates/harmony/entry/gitignore +7 -0
- package/src/init/templates/harmony/entry/hvigorfile.ts +13 -0
- package/src/init/templates/harmony/entry/oh-package.json5 +9 -0
- package/src/init/templates/harmony/entry/src/main/cpp/CMakeLists.txt +27 -0
- package/src/init/templates/harmony/entry/src/main/cpp/PackageProvider.cpp +13 -0
- package/src/init/templates/harmony/entry/src/main/cpp/gitignore +4 -0
- package/src/init/templates/harmony/entry/src/main/ets/PackageProvider.ets +8 -0
- package/src/init/templates/harmony/entry/src/main/ets/codegen/gitignore +2 -0
- package/src/init/templates/harmony/entry/src/main/ets/entryability/EntryAbility.ets +11 -0
- package/src/init/templates/harmony/entry/src/main/ets/gitignore +1 -0
- package/src/init/templates/harmony/entry/src/main/ets/pages/.gitkeep +0 -0
- package/src/init/templates/harmony/entry/src/main/ets/workers/RNOHWorker.ets +16 -0
- package/src/init/templates/harmony/entry/src/main/module.json5 +58 -0
- package/src/init/templates/harmony/entry/src/main/resources/base/element/color.json +8 -0
- package/src/init/templates/harmony/entry/src/main/resources/base/element/string.json +16 -0
- package/src/init/templates/harmony/entry/src/main/resources/base/media/background.png +0 -0
- package/src/init/templates/harmony/entry/src/main/resources/base/media/foreground.png +0 -0
- package/src/init/templates/harmony/entry/src/main/resources/base/media/layered_image.json +7 -0
- package/src/init/templates/harmony/entry/src/main/resources/base/media/startIcon.png +0 -0
- package/src/init/templates/harmony/entry/src/main/resources/base/profile/main_pages.json +5 -0
- package/src/init/templates/harmony/entry/src/main/resources/gitignore +1 -0
- package/src/init/templates/harmony/entry/src/ohosTest/ets/test/List.test.ets +2 -0
- package/src/init/templates/harmony/entry/src/ohosTest/module.json5 +13 -0
- package/src/init/templates/harmony/gitignore +16 -0
- package/src/init/templates/harmony/hvigor/hvigor-config.json5 +22 -0
- package/src/init/templates/harmony/hvigorfile.ts +7 -0
- package/src/init/templates/index.ts +5 -0
- package/src/io/CliExecutor.ts +1 -8
- package/src/io/Logger.ts +0 -7
- package/src/io/RealFS.ts +15 -8
- package/src/io/TarGz.ts +1 -8
- package/src/io/__fixtures__.ts +1 -8
- package/src/io/fsUtils.ts +1 -7
- package/src/io/index.ts +1 -7
- package/src/package-verifier/checks/HarmonyDirContainsOnlyHarsCheck.ts +0 -7
- package/src/package-verifier/checks/HarmonyDirExistsCheck.ts +0 -7
- package/src/package-verifier/checks/NpmAnAndOhPackageVersionsAreEqual.ts +0 -7
- package/src/package-verifier/checks/OhPackageNameFollowsNamingConventionCheck.ts +0 -7
- package/src/package-verifier/checks/index.ts +0 -7
- package/src/package-verifier/index.ts +0 -7
- package/src/package-verifier/types.ts +0 -7
- package/src/package-verifier/verify-package.ts +0 -7
- package/tsconfig.build.json +2 -5
- package/tsconfig.json +4 -0
- package/dist/commands/create-metro-host-constants.js +0 -67
- package/dist/commands/pack-harmony.js +0 -106
- package/dist/commands/unpack-harmony.js +0 -189
- package/src/commands/create-metro-host-constants.ts +0 -55
- package/src/commands/pack-harmony.ts +0 -128
- package/src/commands/unpack-harmony.ts +0 -238
|
@@ -1,10 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Copyright (c) 2024-2025 Huawei Technologies Co., Ltd.
|
|
4
|
-
*
|
|
5
|
-
* This source code is licensed under the MIT license found in the
|
|
6
|
-
* LICENSE-MIT file in the root directory of this source tree.
|
|
7
|
-
*/
|
|
8
2
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
9
3
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
10
4
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -55,12 +49,14 @@ exports.commandLinkHarmony = {
|
|
|
55
49
|
default: './oh-package.json5',
|
|
56
50
|
},
|
|
57
51
|
{
|
|
58
|
-
name: '--exclude-npm-packages [string]',
|
|
59
|
-
description: "Lists npm package names to be excluded from the autolinking process
|
|
52
|
+
name: '--exclude-npm-packages [string...]',
|
|
53
|
+
description: "Lists npm package names to be excluded from the autolinking process. By default every library is included. Can't be used with --included-npm-packages.",
|
|
54
|
+
parse: (val, prev) => (prev ? [...prev, val] : [val]),
|
|
60
55
|
},
|
|
61
56
|
{
|
|
62
|
-
name: '--include-npm-packages [string]',
|
|
63
|
-
description: "Lists npm package names to be included from the autolinking process
|
|
57
|
+
name: '--include-npm-packages [string...]',
|
|
58
|
+
description: "Lists npm package names to be included from the autolinking process. By default every library is included. Can't be used with --excluded-npm-packages.",
|
|
59
|
+
parse: (val, prev) => (prev ? [...prev, val] : [val]),
|
|
64
60
|
},
|
|
65
61
|
],
|
|
66
62
|
func: (_argv, _config, rawArgs) => __awaiter(void 0, void 0, void 0, function* () {
|
|
@@ -76,12 +72,12 @@ exports.commandLinkHarmony = {
|
|
|
76
72
|
cppRNOHPackagesFactoryPathRelativeToHarmony: rawArgs.cppRnohPackagesFactoryPathRelativeToHarmony,
|
|
77
73
|
etsRNOHPackagesFactoryPathRelativeToHarmony: rawArgs.etsRnohPackagesFactoryPathRelativeToHarmony,
|
|
78
74
|
ohPackagePathRelativeToHarmony: rawArgs.ohPackagePathRelativeToHarmony,
|
|
79
|
-
excludedNpmPackageNames: new Set(rawArgs.excludeNpmPackages
|
|
80
|
-
?
|
|
81
|
-
:
|
|
82
|
-
includedNpmPackageNames: new Set(rawArgs.includeNpmPackages
|
|
83
|
-
?
|
|
84
|
-
:
|
|
75
|
+
excludedNpmPackageNames: new Set(((_a = rawArgs.excludeNpmPackages) === null || _a === void 0 ? void 0 : _a.length) === 1
|
|
76
|
+
? rawArgs.excludeNpmPackages[0].split(';')
|
|
77
|
+
: rawArgs.excludeNpmPackages),
|
|
78
|
+
includedNpmPackageNames: new Set(((_b = rawArgs.includeNpmPackages) === null || _b === void 0 ? void 0 : _b.length) === 1
|
|
79
|
+
? rawArgs.includeNpmPackages[0].split(';')
|
|
80
|
+
: rawArgs.includeNpmPackages),
|
|
85
81
|
});
|
|
86
82
|
const result = autolinking.evaluate(config);
|
|
87
83
|
autolinking.saveAndLogOutput(result);
|
package/dist/commands/types.js
CHANGED
|
@@ -1,8 +1,2 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Copyright (c) 2025 Huawei Technologies Co., Ltd.
|
|
4
|
-
*
|
|
5
|
-
* This source code is licensed under the MIT license found in the
|
|
6
|
-
* LICENSE file in the root directory of this source tree.
|
|
7
|
-
*/
|
|
8
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -1,10 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Copyright (c) 2024-2025 Huawei Technologies Co., Ltd.
|
|
4
|
-
*
|
|
5
|
-
* This source code is licensed under the MIT license found in the
|
|
6
|
-
* LICENSE-MIT file in the root directory of this source tree.
|
|
7
|
-
*/
|
|
8
2
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
9
3
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
10
4
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -44,8 +38,9 @@ exports.commandVerifyPackageHarmony = {
|
|
|
44
38
|
description: 'Disable har verification',
|
|
45
39
|
},
|
|
46
40
|
{
|
|
47
|
-
name: '--skip-checks <string
|
|
48
|
-
description: 'Disable certain checks by their names
|
|
41
|
+
name: '--skip-checks <string...>',
|
|
42
|
+
description: 'Disable certain checks by their names',
|
|
43
|
+
parse: (val, prev) => (prev ? [...prev, val] : [val]),
|
|
49
44
|
},
|
|
50
45
|
],
|
|
51
46
|
func: (argv, config, rawArgs) => __awaiter(void 0, void 0, void 0, function* () {
|
|
@@ -98,7 +93,6 @@ exports.commandVerifyPackageHarmony = {
|
|
|
98
93
|
}),
|
|
99
94
|
};
|
|
100
95
|
function validateArgs(args) {
|
|
101
|
-
var _a;
|
|
102
96
|
if (!args.packagePath) {
|
|
103
97
|
throw new core_1.DescriptiveError({
|
|
104
98
|
whatHappened: 'package-path is undefined',
|
|
@@ -108,7 +102,9 @@ function validateArgs(args) {
|
|
|
108
102
|
return {
|
|
109
103
|
packagePath: new core_1.AbsolutePath(args.packagePath),
|
|
110
104
|
hasHarmonyCode: args.harmonyCode,
|
|
111
|
-
checkNamesToSkip:
|
|
105
|
+
checkNamesToSkip: args.skipChecks.length === 1
|
|
106
|
+
? args.skipChecks[0].split(';')
|
|
107
|
+
: args.skipChecks,
|
|
112
108
|
};
|
|
113
109
|
}
|
|
114
110
|
function logCheckResult(loader, checkResult) {
|
|
@@ -1,10 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Copyright (c) 2024 Huawei Technologies Co., Ltd.
|
|
4
|
-
*
|
|
5
|
-
* This source code is licensed under the MIT license found in the
|
|
6
|
-
* LICENSE-MIT file in the root directory of this source tree.
|
|
7
|
-
*/
|
|
8
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
9
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
10
4
|
};
|
|
@@ -35,6 +29,9 @@ class AbsolutePath {
|
|
|
35
29
|
}
|
|
36
30
|
return null;
|
|
37
31
|
}
|
|
32
|
+
getBasename() {
|
|
33
|
+
return node_path_1.default.basename(this.value);
|
|
34
|
+
}
|
|
38
35
|
getDirectoryPath() {
|
|
39
36
|
const dirPath = node_path_1.default.extname(this.value)
|
|
40
37
|
? node_path_1.default.dirname(this.value)
|
|
@@ -1,10 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Copyright (c) 2024-2025 Huawei Technologies Co., Ltd.
|
|
4
|
-
*
|
|
5
|
-
* This source code is licensed under the MIT license found in the
|
|
6
|
-
* LICENSE-MIT file in the root directory of this source tree.
|
|
7
|
-
*/
|
|
8
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
9
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
10
4
|
};
|
|
@@ -1,10 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Copyright (c) 2024-2025 Huawei Technologies Co., Ltd.
|
|
4
|
-
*
|
|
5
|
-
* This source code is licensed under the MIT license found in the
|
|
6
|
-
* LICENSE-MIT file in the root directory of this source tree.
|
|
7
|
-
*/
|
|
8
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
3
|
exports.DescriptiveError = void 0;
|
|
10
4
|
class DescriptiveError extends Error {
|
package/dist/core/FileSystem.js
CHANGED
|
@@ -1,10 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Copyright (c) 2024 Huawei Technologies Co., Ltd.
|
|
4
|
-
*
|
|
5
|
-
* This source code is licensed under the MIT license found in the
|
|
6
|
-
* LICENSE-MIT file in the root directory of this source tree.
|
|
7
|
-
*/
|
|
8
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
9
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
10
4
|
};
|
|
@@ -1,10 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Copyright (c) 2024 Huawei Technologies Co., Ltd.
|
|
4
|
-
*
|
|
5
|
-
* This source code is licensed under the MIT license found in the
|
|
6
|
-
* LICENSE-MIT file in the root directory of this source tree.
|
|
7
|
-
*/
|
|
8
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
9
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
10
4
|
};
|
|
@@ -1,10 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Copyright (c) 2024 Huawei Technologies Co., Ltd.
|
|
4
|
-
*
|
|
5
|
-
* This source code is licensed under the MIT license found in the
|
|
6
|
-
* LICENSE-MIT file in the root directory of this source tree.
|
|
7
|
-
*/
|
|
8
2
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
9
3
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
10
4
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -29,16 +23,14 @@ class ProjectDependency {
|
|
|
29
23
|
getCodegenConfigs() {
|
|
30
24
|
return this.readPackageJSON().getCodegenConfigs();
|
|
31
25
|
}
|
|
32
|
-
|
|
26
|
+
getHarFilePaths() {
|
|
33
27
|
const packageHarmonyPath = this.packageRootPath.copyWithNewSegment('harmony');
|
|
34
|
-
if (
|
|
35
|
-
return
|
|
28
|
+
if (this.fs.existsSync(packageHarmonyPath)) {
|
|
29
|
+
return this.fs.findFilePathsWithExtensions(packageHarmonyPath, ['har']);
|
|
36
30
|
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
return null;
|
|
31
|
+
else {
|
|
32
|
+
return this.fs.findFilePathsWithExtensions(this.packageRootPath, ['har']);
|
|
40
33
|
}
|
|
41
|
-
return harFilePaths[0];
|
|
42
34
|
}
|
|
43
35
|
readPackageJSON() {
|
|
44
36
|
return PackageJSON_1.PackageJSON.fromProjectRootPath(this.fs, this.packageRootPath, this.projectRootPath);
|
|
@@ -61,7 +53,7 @@ class ProjectDependenciesManager {
|
|
|
61
53
|
return;
|
|
62
54
|
}
|
|
63
55
|
for (let dirent of this.fs.readDirentsSync(directoryPath)) {
|
|
64
|
-
if (dirent.isDirectory()) {
|
|
56
|
+
if (dirent.isDirectory() || dirent.isSymbolicLink()) {
|
|
65
57
|
if (dirent.name.startsWith('.')) {
|
|
66
58
|
continue;
|
|
67
59
|
}
|
|
@@ -1,10 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Copyright (c) 2024 Huawei Technologies Co., Ltd.
|
|
4
|
-
*
|
|
5
|
-
* This source code is licensed under the MIT license found in the
|
|
6
|
-
* LICENSE-MIT file in the root directory of this source tree.
|
|
7
|
-
*/
|
|
8
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
3
|
exports.ValidationError = void 0;
|
|
10
4
|
class ValidationError extends Error {
|
package/dist/core/ValueObject.js
CHANGED
|
@@ -1,8 +1,2 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Copyright (c) 2024 Huawei Technologies Co., Ltd.
|
|
4
|
-
*
|
|
5
|
-
* This source code is licensed under the MIT license found in the
|
|
6
|
-
* LICENSE-MIT file in the root directory of this source tree.
|
|
7
|
-
*/
|
|
8
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
package/dist/core/fs.js
CHANGED
|
@@ -1,16 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Copyright (c) 2024-2025 Huawei Technologies Co., Ltd.
|
|
4
|
-
*
|
|
5
|
-
* This source code is licensed under the MIT license found in the
|
|
6
|
-
* LICENSE-MIT file in the root directory of this source tree.
|
|
7
|
-
*/
|
|
8
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
9
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
10
4
|
};
|
|
11
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
6
|
exports.maybeMakeDirectories = maybeMakeDirectories;
|
|
13
7
|
exports.maybeRemoveFilesInDirectory = maybeRemoveFilesInDirectory;
|
|
8
|
+
exports.maybeReadFile = maybeReadFile;
|
|
14
9
|
const node_fs_1 = __importDefault(require("node:fs"));
|
|
15
10
|
const DescriptiveError_1 = require("./DescriptiveError");
|
|
16
11
|
function maybeMakeDirectories(path) {
|
|
@@ -39,3 +34,15 @@ function maybeRemoveFilesInDirectory(path) {
|
|
|
39
34
|
}
|
|
40
35
|
});
|
|
41
36
|
}
|
|
37
|
+
function maybeReadFile(path) {
|
|
38
|
+
if (!node_fs_1.default.existsSync(path.getValue())) {
|
|
39
|
+
return null;
|
|
40
|
+
}
|
|
41
|
+
if (!node_fs_1.default.lstatSync(path.getValue()).isFile()) {
|
|
42
|
+
throw new DescriptiveError_1.DescriptiveError({
|
|
43
|
+
whatHappened: "Tried to read a path that doesn't point to a file",
|
|
44
|
+
whatCanUserDo: [`Verify path: ${path.getValue()}`],
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
return node_fs_1.default.readFileSync(path.getValue(), 'utf-8');
|
|
48
|
+
}
|
package/dist/core/index.js
CHANGED
|
@@ -1,10 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Copyright (c) 2024 Huawei Technologies Co., Ltd.
|
|
4
|
-
*
|
|
5
|
-
* This source code is licensed under the MIT license found in the
|
|
6
|
-
* LICENSE-MIT file in the root directory of this source tree.
|
|
7
|
-
*/
|
|
8
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
9
3
|
if (k2 === undefined) k2 = k;
|
|
10
4
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
package/dist/index.js
CHANGED
|
@@ -1,23 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Copyright (c) 2024-2025 Huawei Technologies Co., Ltd.
|
|
4
|
-
*
|
|
5
|
-
* This source code is licensed under the MIT license found in the
|
|
6
|
-
* LICENSE-MIT file in the root directory of this source tree.
|
|
7
|
-
*/
|
|
8
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
3
|
exports.config = void 0;
|
|
10
4
|
const commands_1 = require("./commands");
|
|
11
5
|
exports.config = {
|
|
12
6
|
commands: [
|
|
13
7
|
commands_1.commandBundleHarmony,
|
|
14
|
-
commands_1.commandPackHarmony,
|
|
15
|
-
commands_1.commandUnpackHarmony,
|
|
16
|
-
commands_1.commandCreateMetroConstantsHarmony,
|
|
17
8
|
commands_1.commandCodegenHarmony,
|
|
18
9
|
commands_1.commandVerifyPackageHarmony,
|
|
19
10
|
commands_1.commandCodegenLibHarmony,
|
|
20
11
|
commands_1.commandLinkHarmony,
|
|
21
12
|
commands_1.commandRunHarmony,
|
|
13
|
+
commands_1.commandInitHarmony,
|
|
14
|
+
commands_1.commandCleanHarmony
|
|
22
15
|
],
|
|
23
16
|
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.AppScopeAppJSON5Template = void 0;
|
|
7
|
+
const mustache_1 = __importDefault(require("mustache"));
|
|
8
|
+
const TEMPLATE = `
|
|
9
|
+
{
|
|
10
|
+
"app": {
|
|
11
|
+
"bundleName": "{{bundleName}}",
|
|
12
|
+
"vendor": "example",
|
|
13
|
+
"versionCode": 1000000,
|
|
14
|
+
"versionName": "1.0.0",
|
|
15
|
+
"icon": "$media:app_icon",
|
|
16
|
+
"label": "$string:app_name",
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
`;
|
|
20
|
+
class AppScopeAppJSON5Template {
|
|
21
|
+
constructor(bundleName) {
|
|
22
|
+
this.bundleName = bundleName;
|
|
23
|
+
}
|
|
24
|
+
build() {
|
|
25
|
+
return mustache_1.default.render(TEMPLATE.trimStart(), {
|
|
26
|
+
bundleName: this.bundleName,
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
exports.AppScopeAppJSON5Template = AppScopeAppJSON5Template;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.AppScopeStringVarTemplate = void 0;
|
|
7
|
+
const mustache_1 = __importDefault(require("mustache"));
|
|
8
|
+
const TEMPLATE = `
|
|
9
|
+
{
|
|
10
|
+
"string": [
|
|
11
|
+
{
|
|
12
|
+
"name": "app_name",
|
|
13
|
+
"value": "{{name}}"
|
|
14
|
+
}
|
|
15
|
+
]
|
|
16
|
+
}
|
|
17
|
+
`;
|
|
18
|
+
class AppScopeStringVarTemplate {
|
|
19
|
+
constructor(name) {
|
|
20
|
+
this.name = name;
|
|
21
|
+
}
|
|
22
|
+
build() {
|
|
23
|
+
return mustache_1.default.render(TEMPLATE.trimStart(), {
|
|
24
|
+
name: this.name,
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
exports.AppScopeStringVarTemplate = AppScopeStringVarTemplate;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.EntryIndexTemplate = void 0;
|
|
7
|
+
const mustache_1 = __importDefault(require("mustache"));
|
|
8
|
+
const TEMPLATE = `
|
|
9
|
+
import {
|
|
10
|
+
AnyJSBundleProvider,
|
|
11
|
+
MetroJSBundleProvider,
|
|
12
|
+
RNApp,
|
|
13
|
+
RNOHErrorDialog,
|
|
14
|
+
ResourceJSBundleProvider,
|
|
15
|
+
RNOHCoreContext
|
|
16
|
+
} from '@rnoh/react-native-openharmony';
|
|
17
|
+
import { getRNOHPackages } from '../PackageProvider';
|
|
18
|
+
|
|
19
|
+
@Entry
|
|
20
|
+
@Component
|
|
21
|
+
struct Index {
|
|
22
|
+
@StorageLink('RNOHCoreContext') private rnohCoreContext: RNOHCoreContext | undefined = undefined
|
|
23
|
+
|
|
24
|
+
build() {
|
|
25
|
+
Column() {
|
|
26
|
+
if (this.rnohCoreContext) {
|
|
27
|
+
if (this.rnohCoreContext?.isDebugModeEnabled) {
|
|
28
|
+
RNOHErrorDialog({ ctx: this.rnohCoreContext })
|
|
29
|
+
}
|
|
30
|
+
RNApp({
|
|
31
|
+
rnInstanceConfig: {
|
|
32
|
+
name: "{{name}}",
|
|
33
|
+
createRNPackages: getRNOHPackages,
|
|
34
|
+
fontResourceByFontFamily: {},
|
|
35
|
+
enableDebugger: this.rnohCoreContext?.isDebugModeEnabled,
|
|
36
|
+
},
|
|
37
|
+
appKey: "{{name}}",
|
|
38
|
+
jsBundleProvider: this.rnohCoreContext?.isDebugModeEnabled ?
|
|
39
|
+
new AnyJSBundleProvider([
|
|
40
|
+
new MetroJSBundleProvider(),
|
|
41
|
+
new ResourceJSBundleProvider(this.rnohCoreContext.uiAbilityContext.resourceManager, 'hermes_bundle.hbc'),
|
|
42
|
+
]) :
|
|
43
|
+
/**
|
|
44
|
+
* NOTE: The HBC format is recommended for Hermes in a production environment. HBC provides better performance and loading times.
|
|
45
|
+
*/
|
|
46
|
+
new ResourceJSBundleProvider(this.rnohCoreContext.uiAbilityContext.resourceManager, 'hermes_bundle.hbc'),
|
|
47
|
+
})
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
.height('100%')
|
|
51
|
+
.width('100%')
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
`;
|
|
55
|
+
class EntryIndexTemplate {
|
|
56
|
+
constructor(name) {
|
|
57
|
+
this.name = name;
|
|
58
|
+
}
|
|
59
|
+
build() {
|
|
60
|
+
return mustache_1.default.render(TEMPLATE.trimStart(), {
|
|
61
|
+
name: this.name,
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
exports.EntryIndexTemplate = EntryIndexTemplate;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.EntryStringVarTemplate = void 0;
|
|
7
|
+
const mustache_1 = __importDefault(require("mustache"));
|
|
8
|
+
const TEMPLATE = `
|
|
9
|
+
{
|
|
10
|
+
"string": [
|
|
11
|
+
{
|
|
12
|
+
"name": "module_desc",
|
|
13
|
+
"value": "{{description}}"
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"name": "EntryAbility_desc",
|
|
17
|
+
"value": "{{description}}"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"name": "EntryAbility_label",
|
|
21
|
+
"value": "{{name}}"
|
|
22
|
+
}
|
|
23
|
+
]
|
|
24
|
+
}
|
|
25
|
+
`;
|
|
26
|
+
class EntryStringVarTemplate {
|
|
27
|
+
constructor(name, description) {
|
|
28
|
+
this.name = name;
|
|
29
|
+
this.description = description;
|
|
30
|
+
}
|
|
31
|
+
build() {
|
|
32
|
+
return mustache_1.default.render(TEMPLATE.trimStart(), {
|
|
33
|
+
name: this.name,
|
|
34
|
+
description: this.description,
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
exports.EntryStringVarTemplate = EntryStringVarTemplate;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.HvigorConfigJson5Template = void 0;
|
|
7
|
+
const mustache_1 = __importDefault(require("mustache"));
|
|
8
|
+
const TEMPLATE = `
|
|
9
|
+
{
|
|
10
|
+
"modelVersion": "5.0.0",
|
|
11
|
+
"dependencies": {
|
|
12
|
+
"@rnoh/hvigor-plugin": "../../node_modules/{{{rnohCliNpmPackageName}}}/harmony/{{{rnohHvigorPluginFilename}}}", // <PROJECT_ROOT>/node_modules/<RNOH_CLI>/harmony/rnoh-hvigor-plugin-X.X.X.tgz
|
|
13
|
+
},
|
|
14
|
+
"execution": {
|
|
15
|
+
// "analyze": "default", /* Define the build analyze mode. Value: [ "default" | "verbose" | false ]. Default: "default" */
|
|
16
|
+
// "daemon": true, /* Enable daemon compilation. Value: [ true | false ]. Default: true */
|
|
17
|
+
// "incremental": true, /* Enable incremental compilation. Value: [ true | false ]. Default: true */
|
|
18
|
+
// "parallel": true, /* Enable parallel compilation. Value: [ true | false ]. Default: true */
|
|
19
|
+
// "typeCheck": false, /* Enable typeCheck. Value: [ true | false ]. Default: false */
|
|
20
|
+
},
|
|
21
|
+
"logging": {
|
|
22
|
+
// "level": "info" /* Define the log level. Value: [ "debug" | "info" | "warn" | "error" ]. Default: "info" */
|
|
23
|
+
},
|
|
24
|
+
"debugging": {
|
|
25
|
+
// "stacktrace": false /* Disable stacktrace compilation. Value: [ true | false ]. Default: false */
|
|
26
|
+
},
|
|
27
|
+
"nodeOptions": {
|
|
28
|
+
// "maxOldSpaceSize": 4096 /* Enable nodeOptions maxOldSpaceSize compilation. Unit M. Used for the daemon process */
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
`;
|
|
32
|
+
class HvigorConfigJson5Template {
|
|
33
|
+
constructor(rnohCliNpmPackageName, rnohHvigorPluginFilename) {
|
|
34
|
+
this.rnohCliNpmPackageName = rnohCliNpmPackageName;
|
|
35
|
+
this.rnohHvigorPluginFilename = rnohHvigorPluginFilename;
|
|
36
|
+
}
|
|
37
|
+
build() {
|
|
38
|
+
return mustache_1.default.render(TEMPLATE.trimStart(), {
|
|
39
|
+
rnohCliNpmPackageName: this.rnohCliNpmPackageName,
|
|
40
|
+
rnohHvigorPluginFilename: this.rnohHvigorPluginFilename,
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
exports.HvigorConfigJson5Template = HvigorConfigJson5Template;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.MetroConfigTemplate = void 0;
|
|
7
|
+
const mustache_1 = __importDefault(require("mustache"));
|
|
8
|
+
const TEMPLATE = `
|
|
9
|
+
const {mergeConfig, getDefaultConfig} = require('@react-native/metro-config');
|
|
10
|
+
const {
|
|
11
|
+
createHarmonyMetroConfig,
|
|
12
|
+
} = require('{{{reactNativeHarmonyPackageName}}}/metro.config');
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* @type {import("metro-config").MetroConfig}
|
|
16
|
+
*/
|
|
17
|
+
const config = {
|
|
18
|
+
transformer: {
|
|
19
|
+
getTransformOptions: async () => ({
|
|
20
|
+
transform: {
|
|
21
|
+
experimentalImportSupport: false,
|
|
22
|
+
inlineRequires: true,
|
|
23
|
+
},
|
|
24
|
+
}),
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
module.exports = mergeConfig(
|
|
29
|
+
getDefaultConfig(__dirname),
|
|
30
|
+
createHarmonyMetroConfig({
|
|
31
|
+
reactNativeHarmonyPackageName: '{{{reactNativeHarmonyPackageName}}}',
|
|
32
|
+
}),
|
|
33
|
+
config,
|
|
34
|
+
);
|
|
35
|
+
|
|
36
|
+
`;
|
|
37
|
+
class MetroConfigTemplate {
|
|
38
|
+
constructor(reactNativeHarmonyPackageName) {
|
|
39
|
+
this.reactNativeHarmonyPackageName = reactNativeHarmonyPackageName;
|
|
40
|
+
}
|
|
41
|
+
build() {
|
|
42
|
+
return mustache_1.default.render(TEMPLATE.trimStart(), {
|
|
43
|
+
reactNativeHarmonyPackageName: this.reactNativeHarmonyPackageName,
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
exports.MetroConfigTemplate = MetroConfigTemplate;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.OhPackageJson5Template = void 0;
|
|
7
|
+
const mustache_1 = __importDefault(require("mustache"));
|
|
8
|
+
const TEMPLATE = `
|
|
9
|
+
{
|
|
10
|
+
name: "example-name",
|
|
11
|
+
description: "example description",
|
|
12
|
+
version: "1.0.0",
|
|
13
|
+
modelVersion: "5.0.0",
|
|
14
|
+
license: "ISC",
|
|
15
|
+
repository: {},
|
|
16
|
+
dependencies: {
|
|
17
|
+
"@rnoh/react-native-openharmony": "file:../node_modules/{{{rnohNpmPackageName}}}/react_native_openharmony.har",
|
|
18
|
+
},
|
|
19
|
+
devDependencies: {
|
|
20
|
+
"@ohos/hypium": "1.0.6",
|
|
21
|
+
},
|
|
22
|
+
overrides: {
|
|
23
|
+
"@rnoh/react-native-openharmony": "file:../node_modules/{{{rnohNpmPackageName}}}/react_native_openharmony.har",
|
|
24
|
+
},
|
|
25
|
+
}
|
|
26
|
+
`;
|
|
27
|
+
class OhPackageJson5Template {
|
|
28
|
+
constructor(rnohNpmPackageName) {
|
|
29
|
+
this.rnohNpmPackageName = rnohNpmPackageName;
|
|
30
|
+
}
|
|
31
|
+
build() {
|
|
32
|
+
return mustache_1.default.render(TEMPLATE.trimStart(), {
|
|
33
|
+
rnohNpmPackageName: this.rnohNpmPackageName,
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
exports.OhPackageJson5Template = OhPackageJson5Template;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
app: {
|
|
3
|
+
products: [
|
|
4
|
+
{
|
|
5
|
+
name: 'default',
|
|
6
|
+
signingConfig: 'default',
|
|
7
|
+
compatibleSdkVersion: '5.0.0(12)',
|
|
8
|
+
runtimeOS: 'HarmonyOS',
|
|
9
|
+
buildOption: {
|
|
10
|
+
nativeCompiler: 'BiSheng'
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
],
|
|
14
|
+
buildModeSet: [
|
|
15
|
+
{
|
|
16
|
+
name: 'debug',
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
name: 'release',
|
|
20
|
+
},
|
|
21
|
+
],
|
|
22
|
+
signingConfigs: [],
|
|
23
|
+
},
|
|
24
|
+
modules: [
|
|
25
|
+
{
|
|
26
|
+
name: 'entry',
|
|
27
|
+
srcPath: './entry',
|
|
28
|
+
targets: [
|
|
29
|
+
{
|
|
30
|
+
name: 'default',
|
|
31
|
+
applyToProducts: ['default'],
|
|
32
|
+
},
|
|
33
|
+
],
|
|
34
|
+
},
|
|
35
|
+
],
|
|
36
|
+
}
|