@react-native-oh/react-native-harmony-cli 0.0.36 → 0.77.18-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/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/harmony/rnoh-hvigor-plugin-0.77.18.tgz +0 -0
- 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
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"files": ["**/*.ts", "**/*.ets"],
|
|
3
|
+
"ignore": [
|
|
4
|
+
"**/ohosTest/**/*",
|
|
5
|
+
"**/node_modules/**/*",
|
|
6
|
+
"**/hvigorfile.ts",
|
|
7
|
+
"**/node_modules/**/*",
|
|
8
|
+
"**/oh_modules/**/*",
|
|
9
|
+
"**/build/**/*",
|
|
10
|
+
"**/.preview/**/*"
|
|
11
|
+
],
|
|
12
|
+
"plugins": ["@typescript-eslint"],
|
|
13
|
+
"ruleSet": [],
|
|
14
|
+
"rules": {
|
|
15
|
+
"@typescript-eslint/await-thenable": "warn",
|
|
16
|
+
"@typescript-eslint/consistent-type-imports": "warn",
|
|
17
|
+
"@typescript-eslint/explicit-function-return-type": "warn",
|
|
18
|
+
"@typescript-eslint/explicit-module-boundary-types": "warn",
|
|
19
|
+
"@typescript-eslint/no-dynamic-delete": "warn",
|
|
20
|
+
"@typescript-eslint/no-explicit-any": "warn",
|
|
21
|
+
"@typescript-eslint/no-for-in-array": "warn",
|
|
22
|
+
"@typescript-eslint/no-this-alias": "warn",
|
|
23
|
+
"@typescript-eslint/no-unnecessary-type-constraint": "warn",
|
|
24
|
+
"@typescript-eslint/no-unsafe-argument": "warn",
|
|
25
|
+
"@typescript-eslint/no-unsafe-assignment": "warn",
|
|
26
|
+
"@typescript-eslint/no-unsafe-call": "warn",
|
|
27
|
+
"@typescript-eslint/no-unsafe-member-access": "warn",
|
|
28
|
+
"@typescript-eslint/no-unsafe-return": "warn",
|
|
29
|
+
"@typescript-eslint/prefer-literal-enum-member": "warn"
|
|
30
|
+
},
|
|
31
|
+
"overrides": []
|
|
32
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"apiType": 'stageMode',
|
|
3
|
+
"buildOption": {
|
|
4
|
+
"externalNativeOptions": {
|
|
5
|
+
"path": "./src/main/cpp/CMakeLists.txt",
|
|
6
|
+
"arguments": "",
|
|
7
|
+
},
|
|
8
|
+
},
|
|
9
|
+
"targets": [
|
|
10
|
+
{
|
|
11
|
+
"name": "default",
|
|
12
|
+
"runtimeOS": "HarmonyOS"
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"name": "ohosTest",
|
|
16
|
+
}
|
|
17
|
+
]
|
|
18
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { hapTasks } from '@ohos/hvigor-ohos-plugin';
|
|
2
|
+
import { createRNOHModulePlugin } from '@rnoh/hvigor-plugin';
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
system: hapTasks,
|
|
6
|
+
plugins: [
|
|
7
|
+
createRNOHModulePlugin({
|
|
8
|
+
codegen: {
|
|
9
|
+
rnohModulePath: './oh_modules/@rnoh/react-native-openharmony',
|
|
10
|
+
},
|
|
11
|
+
}),
|
|
12
|
+
],
|
|
13
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
cmake_minimum_required(VERSION 3.11)
|
|
2
|
+
project(rnapp)
|
|
3
|
+
|
|
4
|
+
set(RNOH_APP_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
|
|
5
|
+
set(NODE_MODULES "${CMAKE_CURRENT_SOURCE_DIR}/../../../../../node_modules")
|
|
6
|
+
set(RNOH_CPP_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../../../oh_modules/@rnoh/react-native-openharmony/src/main/cpp")
|
|
7
|
+
set(RNOH_GENERATED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/generated")
|
|
8
|
+
set(LOG_VERBOSITY_LEVEL 1)
|
|
9
|
+
set(CMAKE_ASM_FLAGS "-Wno-error=unused-command-line-argument -Qunused-arguments")
|
|
10
|
+
set(CMAKE_CXX_FLAGS "-fstack-protector-strong -Wl,-z,relro,-z,now,-z,noexecstack -s -fPIE -pie")
|
|
11
|
+
set(WITH_HITRACE_SYSTRACE ON)
|
|
12
|
+
set(WITH_HITRACE_REACT_MARKER ON)
|
|
13
|
+
set(OH_MODULES_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../../../oh_modules") # required by 'autolink_libraries'
|
|
14
|
+
|
|
15
|
+
add_subdirectory("${RNOH_CPP_DIR}" ./rn)
|
|
16
|
+
|
|
17
|
+
include("${CMAKE_CURRENT_SOURCE_DIR}/autolinking.cmake")
|
|
18
|
+
|
|
19
|
+
file(GLOB GENERATED_CPP_FILES "${CMAKE_CURRENT_SOURCE_DIR}/generated/*.cpp") # this line is needed by codegen v1
|
|
20
|
+
add_library(rnoh_app SHARED
|
|
21
|
+
${GENERATED_CPP_FILES}
|
|
22
|
+
"./PackageProvider.cpp"
|
|
23
|
+
"${RNOH_CPP_DIR}/RNOHAppNapiBridge.cpp"
|
|
24
|
+
)
|
|
25
|
+
target_link_libraries(rnoh_app PUBLIC rnoh)
|
|
26
|
+
|
|
27
|
+
autolink_libraries(rnoh_app)
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
#include "RNOH/PackageProvider.h"
|
|
2
|
+
#include "RNOHPackagesFactory.h"
|
|
3
|
+
#include "generated/RNOHGeneratedPackage.h"
|
|
4
|
+
|
|
5
|
+
using namespace rnoh;
|
|
6
|
+
|
|
7
|
+
std::vector<std::shared_ptr<Package>> PackageProvider::getPackages(
|
|
8
|
+
Package::Context ctx) {
|
|
9
|
+
auto packages = createRNOHPackages(ctx); // <= autolinking
|
|
10
|
+
packages.push_back(std::make_shared<RNOHGeneratedPackage>(
|
|
11
|
+
ctx)); // generated by codegen-harmony v1 on app preBuilt stage)
|
|
12
|
+
return packages;
|
|
13
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { RNPackageContext, RNOHPackage } from '@rnoh/react-native-openharmony';
|
|
2
|
+
import { createRNOHPackages as createRNOHPackagesAutolinking } from "./RNOHPackagesFactory"
|
|
3
|
+
|
|
4
|
+
export function getRNOHPackages(ctx: RNPackageContext): RNOHPackage[] {
|
|
5
|
+
return [
|
|
6
|
+
...createRNOHPackagesAutolinking(ctx)
|
|
7
|
+
]
|
|
8
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import {RNAbility} from '@rnoh/react-native-openharmony';
|
|
2
|
+
|
|
3
|
+
export default class EntryAbility extends RNAbility {
|
|
4
|
+
override getPagePath() {
|
|
5
|
+
return 'pages/Index';
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
override getRNOHWorkerScriptUrl() {
|
|
9
|
+
return "entry/ets/workers/RNOHWorker.ets"
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/RNOHPackagesFactory.ets
|
|
File without changes
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Importing some ets files in the following way results in runtime errors e.g.
|
|
3
|
+
* import { setupRNOHWorker } from "@rnoh/react-native-openharmony"
|
|
4
|
+
*
|
|
5
|
+
* It looks like this is ArkTS problem and it may be fixed in the future.
|
|
6
|
+
* For the time being, use direct imports.
|
|
7
|
+
*/
|
|
8
|
+
import { setupRNOHWorker } from "@rnoh/react-native-openharmony/src/main/ets/setupRNOHWorker"
|
|
9
|
+
import { getRNOHPackages } from "../PackageProvider"
|
|
10
|
+
|
|
11
|
+
setupRNOHWorker({
|
|
12
|
+
createWorkerRNInstanceConfig: (_rnInstanceName) => {
|
|
13
|
+
return { thirdPartyPackagesFactory: getRNOHPackages }
|
|
14
|
+
}
|
|
15
|
+
})
|
|
16
|
+
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
{
|
|
2
|
+
"module": {
|
|
3
|
+
"name": "entry",
|
|
4
|
+
"type": "entry",
|
|
5
|
+
"description": "$string:module_desc",
|
|
6
|
+
"mainElement": "EntryAbility",
|
|
7
|
+
"deviceTypes": [
|
|
8
|
+
"default"
|
|
9
|
+
],
|
|
10
|
+
"deliveryWithInstall": true,
|
|
11
|
+
"installationFree": false,
|
|
12
|
+
"pages": "$profile:main_pages",
|
|
13
|
+
"requestPermissions": [
|
|
14
|
+
{
|
|
15
|
+
"name": "ohos.permission.INTERNET"
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"name": "ohos.permission.VIBRATE"
|
|
19
|
+
}
|
|
20
|
+
],
|
|
21
|
+
"metadata": [
|
|
22
|
+
{
|
|
23
|
+
"name": "OPTLazyForEach",
|
|
24
|
+
"value": "true",
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"name": "can_preview_text",
|
|
28
|
+
"value": "true",
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"name": "halfLeading",
|
|
32
|
+
"value": "true",
|
|
33
|
+
},
|
|
34
|
+
],
|
|
35
|
+
"abilities": [
|
|
36
|
+
{
|
|
37
|
+
"name": "EntryAbility",
|
|
38
|
+
"srcEntry": "./ets/entryability/EntryAbility.ets",
|
|
39
|
+
"description": "$string:EntryAbility_desc",
|
|
40
|
+
"icon": "$media:layered_image",
|
|
41
|
+
"label": "$string:EntryAbility_label",
|
|
42
|
+
"startWindowIcon": "$media:startIcon",
|
|
43
|
+
"startWindowBackground": "$color:start_window_background",
|
|
44
|
+
"visible": true,
|
|
45
|
+
"skills": [
|
|
46
|
+
{
|
|
47
|
+
"entities": [
|
|
48
|
+
"entity.system.home"
|
|
49
|
+
],
|
|
50
|
+
"actions": [
|
|
51
|
+
"action.system.home"
|
|
52
|
+
],
|
|
53
|
+
}
|
|
54
|
+
]
|
|
55
|
+
}
|
|
56
|
+
]
|
|
57
|
+
}
|
|
58
|
+
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
rawfile/assets
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
modelVersion: '5.0.0',
|
|
3
|
+
dependencies: {
|
|
4
|
+
// "@rnoh/hvigor-plugin": "../../node_modules/<RNOH_CLI>/harmony/rnoh-hvigor-plugin-X.X.X.tgz",
|
|
5
|
+
},
|
|
6
|
+
execution: {
|
|
7
|
+
// "analyze": "default", /* Define the build analyze mode. Value: [ "default" | "verbose" | false ]. Default: "default" */
|
|
8
|
+
// "daemon": true, /* Enable daemon compilation. Value: [ true | false ]. Default: true */
|
|
9
|
+
// "incremental": true, /* Enable incremental compilation. Value: [ true | false ]. Default: true */
|
|
10
|
+
// "parallel": true, /* Enable parallel compilation. Value: [ true | false ]. Default: true */
|
|
11
|
+
// "typeCheck": false, /* Enable typeCheck. Value: [ true | false ]. Default: false */
|
|
12
|
+
},
|
|
13
|
+
logging: {
|
|
14
|
+
// "level": "info" /* Define the log level. Value: [ "debug" | "info" | "warn" | "error" ]. Default: "info" */
|
|
15
|
+
},
|
|
16
|
+
debugging: {
|
|
17
|
+
// "stacktrace": false /* Disable stacktrace compilation. Value: [ true | false ]. Default: false */
|
|
18
|
+
},
|
|
19
|
+
nodeOptions: {
|
|
20
|
+
// "maxOldSpaceSize": 4096 /* Enable nodeOptions maxOldSpaceSize compilation. Unit M. Used for the daemon process */
|
|
21
|
+
},
|
|
22
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./MetroConfigTemplate"), exports);
|
|
18
|
+
__exportStar(require("./EntryStringVarTemplate"), exports);
|
|
19
|
+
__exportStar(require("./EntryIndexTemplate"), exports);
|
|
20
|
+
__exportStar(require("./OhPackageJson5Template"), exports);
|
|
21
|
+
__exportStar(require("./HvigorConfigJson5Template"), exports);
|
package/dist/io/CliExecutor.js
CHANGED
|
@@ -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) {
|
package/dist/io/Logger.js
CHANGED
|
@@ -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
|
};
|
package/dist/io/RealFS.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 __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) {
|
|
@@ -19,6 +13,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
19
13
|
};
|
|
20
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
15
|
exports.RealFS = void 0;
|
|
16
|
+
const core_1 = require("../core");
|
|
22
17
|
const FileSystem_1 = require("../core/FileSystem");
|
|
23
18
|
const node_fs_1 = __importDefault(require("node:fs"));
|
|
24
19
|
class RealFSDirent extends FileSystem_1.Dirent {
|
|
@@ -29,9 +24,15 @@ class RealFSDirent extends FileSystem_1.Dirent {
|
|
|
29
24
|
isDirectory() {
|
|
30
25
|
return this.nodeFSDirent.isDirectory();
|
|
31
26
|
}
|
|
27
|
+
isSymbolicLink() {
|
|
28
|
+
return this.nodeFSDirent.isSymbolicLink();
|
|
29
|
+
}
|
|
32
30
|
get name() {
|
|
33
31
|
return this.nodeFSDirent.name;
|
|
34
32
|
}
|
|
33
|
+
get path() {
|
|
34
|
+
return new core_1.AbsolutePath(this.nodeFSDirent.path).copyWithNewSegment(this.nodeFSDirent.name);
|
|
35
|
+
}
|
|
35
36
|
}
|
|
36
37
|
class RealFS extends FileSystem_1.FS {
|
|
37
38
|
existsSync(path) {
|
|
@@ -64,5 +65,8 @@ class RealFS extends FileSystem_1.FS {
|
|
|
64
65
|
})
|
|
65
66
|
.map((rawDirent) => new RealFSDirent(rawDirent));
|
|
66
67
|
}
|
|
68
|
+
renameSync(oldPath, newPath) {
|
|
69
|
+
node_fs_1.default.renameSync(oldPath.toString(), newPath.toString());
|
|
70
|
+
}
|
|
67
71
|
}
|
|
68
72
|
exports.RealFS = RealFS;
|
package/dist/io/TarGz.js
CHANGED
|
@@ -1,17 +1,11 @@
|
|
|
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
|
};
|
|
11
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
6
|
exports.unpackTarGz = unpackTarGz;
|
|
13
7
|
const node_fs_1 = __importDefault(require("node:fs"));
|
|
14
|
-
const
|
|
8
|
+
const node_zlib_1 = __importDefault(require("node:zlib"));
|
|
15
9
|
const tar_1 = __importDefault(require("tar"));
|
|
16
10
|
function unpackTarGz(archivePath, outputDirPath) {
|
|
17
11
|
if (!node_fs_1.default.existsSync(outputDirPath.getValue())) {
|
|
@@ -21,7 +15,7 @@ function unpackTarGz(archivePath, outputDirPath) {
|
|
|
21
15
|
const writeStream = tar_1.default.extract({
|
|
22
16
|
cwd: outputDirPath.getValue(),
|
|
23
17
|
});
|
|
24
|
-
readStream.pipe(
|
|
18
|
+
readStream.pipe(node_zlib_1.default.createGunzip()).pipe(writeStream);
|
|
25
19
|
return new Promise((resolve, reject) => {
|
|
26
20
|
writeStream.on('finish', () => {
|
|
27
21
|
resolve(undefined);
|
package/dist/io/__fixtures__.js
CHANGED
|
@@ -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) {
|
package/dist/io/fsUtils.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
|
};
|
package/dist/io/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);
|
|
@@ -24,3 +18,4 @@ __exportStar(require("./Logger"), exports);
|
|
|
24
18
|
__exportStar(require("./fsUtils"), exports);
|
|
25
19
|
__exportStar(require("./TarGz"), exports);
|
|
26
20
|
__exportStar(require("./RealFS"), exports);
|
|
21
|
+
__exportStar(require("./CliExecutor"), exports);
|
|
@@ -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) {
|
|
@@ -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) {
|
|
@@ -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) {
|
|
@@ -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) {
|
|
@@ -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);
|
|
@@ -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);
|
|
@@ -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 });
|
|
@@ -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 __asyncValues = (this && this.__asyncValues) || function (o) {
|
|
9
3
|
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
10
4
|
var m = o[Symbol.asyncIterator], i;
|
|
@@ -21,7 +15,7 @@ var __asyncDelegator = (this && this.__asyncDelegator) || function (o) {
|
|
|
21
15
|
var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {
|
|
22
16
|
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
23
17
|
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
|
24
|
-
return i =
|
|
18
|
+
return i = {}, verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;
|
|
25
19
|
function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }
|
|
26
20
|
function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }
|
|
27
21
|
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
|
|
Binary file
|
package/jest.config.js
CHANGED
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2024 Huawei Technologies Co., Ltd.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the MIT license found in the
|
|
5
|
-
* LICENSE-MIT file in the root directory of this source tree.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
1
|
/** @type {import('ts-jest').JestConfigWithTsJest} */
|
|
9
2
|
module.exports = {
|
|
10
3
|
preset: 'ts-jest',
|