@react-native-oh/react-native-harmony-cli 0.0.40 → 0.0.41

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.
Files changed (64) hide show
  1. package/README.md +11 -11
  2. package/dist/assetResolver.js +43 -74
  3. package/dist/autolinking/Autolinking.js +178 -179
  4. package/dist/codegen/core/CodegenError.js +3 -23
  5. package/dist/codegen/core/EventUtils.js +3 -3
  6. package/dist/codegen/core/TypeAnnotationToTS.js +24 -28
  7. package/dist/codegen/core/UberSchema.js +57 -96
  8. package/dist/codegen/generators/AppBuildTimeGlueCodeGenerator.js +28 -41
  9. package/dist/codegen/generators/ArkTSComponentCodeGeneratorArkTS.js +27 -34
  10. package/dist/codegen/generators/ArkTSComponentCodeGeneratorCAPI.js +25 -33
  11. package/dist/codegen/generators/CppComponentCodeGenerator.js +23 -28
  12. package/dist/codegen/generators/LibGlueCodeGenerator.js +26 -29
  13. package/dist/codegen/generators/NativeModuleCodeGenerator.js +25 -30
  14. package/dist/codegen/generators/SharedComponentCodeGenerator.js +15 -15
  15. package/dist/codegen/generators/UberGeneratorV1.js +24 -23
  16. package/dist/codegen/generators/UberGeneratorV2.js +34 -35
  17. package/dist/codegen/templates/BaseComponentInstanceHTemplate.js +50 -24
  18. package/dist/codegen/templates/BasePackageHTemplate.js +120 -21
  19. package/dist/codegen/templates/ComponentDescriptorHTemplate.js +53 -8
  20. package/dist/codegen/templates/ComponentJSIBinderHTemplate.js +75 -27
  21. package/dist/codegen/templates/ComponentUtilsTSTemplate.js +162 -29
  22. package/dist/codegen/templates/IndexTSTemplate.js +37 -17
  23. package/dist/codegen/templates/RNOHGeneratedPackageHTemplate.js +119 -24
  24. package/dist/codegen/templates/TurboModuleCppTemplate.js +38 -15
  25. package/dist/codegen/templates/TurboModuleHTemplate.js +32 -11
  26. package/dist/codegen/templates/TurboModuleSpecTSTemplate.js +52 -19
  27. package/dist/commands/bundle-harmony.js +53 -138
  28. package/dist/commands/codegen-harmony.js +105 -165
  29. package/dist/commands/codegen-lib-harmony.js +76 -116
  30. package/dist/commands/create-metro-host-constants.js +18 -47
  31. package/dist/commands/init.js +537 -961
  32. package/dist/commands/link-harmony.js +33 -71
  33. package/dist/commands/pack-harmony.js +47 -108
  34. package/dist/commands/run-harmony.js +372 -518
  35. package/dist/commands/unpack-harmony.js +105 -198
  36. package/dist/commands/verify-package-harmony.js +54 -108
  37. package/dist/core/AbsolutePath.js +31 -47
  38. package/dist/core/CodegenConfig.js +24 -22
  39. package/dist/core/DescriptiveError.js +18 -37
  40. package/dist/core/FileSystem.js +14 -18
  41. package/dist/core/OHPackageJSON5.js +17 -23
  42. package/dist/core/PackageJSON.js +26 -42
  43. package/dist/core/ProjectDependenciesManager.js +40 -92
  44. package/dist/core/ValidationError.js +2 -22
  45. package/dist/core/fs.js +9 -6
  46. package/dist/index.js +1 -1
  47. package/dist/io/CliExecutor.js +46 -98
  48. package/dist/io/Logger.js +40 -46
  49. package/dist/io/RealFS.js +35 -88
  50. package/dist/io/TarGz.js +11 -8
  51. package/dist/io/__fixtures__.js +79 -141
  52. package/dist/io/fsUtils.js +13 -12
  53. package/dist/package-verifier/checks/HarmonyDirContainsOnlyHarsCheck.js +19 -47
  54. package/dist/package-verifier/checks/HarmonyDirExistsCheck.js +13 -41
  55. package/dist/package-verifier/checks/NpmAnAndOhPackageVersionsAreEqual.js +8 -38
  56. package/dist/package-verifier/checks/OhPackageNameFollowsNamingConventionCheck.js +22 -54
  57. package/dist/package-verifier/verify-package.js +55 -132
  58. package/dist/simulator/LaunchSimulator.js +224 -301
  59. package/harmony/rnoh-hvigor-plugin-0.3.0.tgz +0 -0
  60. package/jest.config.js +12 -12
  61. package/package.json +78 -78
  62. package/react-native.config.js +17 -17
  63. package/tsconfig.build.json +6 -6
  64. package/tsconfig.json +2 -2
package/package.json CHANGED
@@ -1,78 +1,78 @@
1
- {
2
- "name": "@react-native-oh/react-native-harmony-cli",
3
- "version": "0.0.40",
4
- "description": "",
5
- "publishConfig": {
6
- "registry": "https://registry.npmjs.org/",
7
- "access": "public"
8
- },
9
- "scripts": {
10
- "build": "tsc --outDir dist -p tsconfig.build.json",
11
- "prepack": "npm run build && npm run _recreate-hvigor-plugin",
12
- "_recreate-hvigor-plugin": "cd ../react-native-harmony-hvigor-plugin && npm i && npm run deploy && cd ../react-native-harmony-cli",
13
- "verify": "tsc --noEmit && npm run test",
14
- "test": "npm run build && jest",
15
- "test:codegen": "jest ./src/codegen/.* && npm run build && jest tests/codegen.*",
16
- "rn": "npm run build && react-native",
17
- "prepublishOnly": "npm run verify"
18
- },
19
- "bin": {
20
- "rnoh-cli": "dist/commands/init.js"
21
- },
22
- "keywords": [],
23
- "author": "",
24
- "license": "MIT",
25
- "peerDependencies": {
26
- "metro": "*"
27
- },
28
- "main": "dist/index.js",
29
- "files": [
30
- "./*.js",
31
- "./*.json",
32
- "./dist/*",
33
- "./harmony/*",
34
- "./README.md"
35
- ],
36
- "devDependencies": {
37
- "@react-native-community/cli": "^15.0.0",
38
- "@react-native-community/cli-types": "^11.3.0",
39
- "@types/adm-zip": "^0.5.5",
40
- "@types/fs-extra": "^11.0.1",
41
- "@types/jest": "^29.5.1",
42
- "@types/jszip": "^3.4.1",
43
- "@types/mustache": "^4.2.5",
44
- "@types/tar": "^6.1.5",
45
- "@types/tmp": "^0.2.3",
46
- "directory-tree": "^3.5.1",
47
- "execa": "npm:@esm2cjs/execa@^6.1.1-cjs.1",
48
- "jest": "^29.5.0",
49
- "react-native": "^0.72.0",
50
- "ts-jest": "^29.1.0",
51
- "ts-node": "^10.9.1",
52
- "typescript": "^5.0.4"
53
- },
54
- "dependencies": {
55
- "@react-native-community/cli-tools": "^13.6.5",
56
- "@react-native/codegen": "0.74.0",
57
- "@tsconfig/recommended": "^1.0.2",
58
- "adm-zip": "^0.5.12",
59
- "case": "^1.6.3",
60
- "chalk": "^4",
61
- "commander": "^14.0.0",
62
- "fs-extra": "^11.1.1",
63
- "glob": "^10.2.6",
64
- "ignore": "^5.2.4",
65
- "inquirer": "^12.7.0",
66
- "json5": "^2.2.3",
67
- "memfs": "4.12.0",
68
- "mustache": "^4.2.0",
69
- "tar": "^6.1.15",
70
- "tmp": "^0.2.1",
71
- "metro": "0.82.5"
72
- },
73
- "homepage": "https://gitcode.com/openharmony-sig/ohos_react_native",
74
- "repository": {
75
- "type": "gitcode",
76
- "url": "https://gitcode.com/openharmony-sig/ohos_react_native"
77
- }
78
- }
1
+ {
2
+ "name": "@react-native-oh/react-native-harmony-cli",
3
+ "version": "0.0.41",
4
+ "description": "",
5
+ "publishConfig": {
6
+ "registry": "https://registry.npmjs.org/",
7
+ "access": "public"
8
+ },
9
+ "scripts": {
10
+ "build": "tsc --outDir dist -p tsconfig.build.json",
11
+ "prepack": "npm run build && npm run _recreate-hvigor-plugin",
12
+ "_recreate-hvigor-plugin": "cd ../react-native-harmony-hvigor-plugin && npm i && npm run deploy && cd ../react-native-harmony-cli",
13
+ "verify": "tsc --noEmit && npm run test",
14
+ "test": "npm run build && jest",
15
+ "test:codegen": "jest ./src/codegen/.* && npm run build && jest tests/codegen.*",
16
+ "rn": "npm run build && react-native",
17
+ "prepublishOnly": "npm run verify"
18
+ },
19
+ "bin": {
20
+ "rnoh-cli": "dist/commands/init.js"
21
+ },
22
+ "keywords": [],
23
+ "author": "",
24
+ "license": "MIT",
25
+ "peerDependencies": {
26
+ "metro": "*"
27
+ },
28
+ "main": "dist/index.js",
29
+ "files": [
30
+ "./*.js",
31
+ "./*.json",
32
+ "./dist/*",
33
+ "./harmony/*",
34
+ "./README.md"
35
+ ],
36
+ "devDependencies": {
37
+ "@react-native-community/cli": "^15.0.0",
38
+ "@react-native-community/cli-types": "^11.3.0",
39
+ "@types/adm-zip": "^0.5.5",
40
+ "@types/fs-extra": "^11.0.1",
41
+ "@types/jest": "^29.5.1",
42
+ "@types/jszip": "^3.4.1",
43
+ "@types/mustache": "^4.2.5",
44
+ "@types/tar": "^6.1.5",
45
+ "@types/tmp": "^0.2.3",
46
+ "directory-tree": "^3.5.1",
47
+ "execa": "npm:@esm2cjs/execa@^6.1.1-cjs.1",
48
+ "jest": "^29.5.0",
49
+ "react-native": "^0.72.0",
50
+ "ts-jest": "^29.1.0",
51
+ "ts-node": "^10.9.1",
52
+ "typescript": "^5.0.4"
53
+ },
54
+ "dependencies": {
55
+ "@react-native-community/cli-tools": "^13.6.5",
56
+ "@react-native/codegen": "0.74.0",
57
+ "@tsconfig/recommended": "^1.0.2",
58
+ "adm-zip": "^0.5.12",
59
+ "case": "^1.6.3",
60
+ "chalk": "^4",
61
+ "commander": "^14.0.0",
62
+ "fs-extra": "^11.1.1",
63
+ "glob": "^10.2.6",
64
+ "ignore": "^5.2.4",
65
+ "inquirer": "^12.7.0",
66
+ "json5": "^2.2.3",
67
+ "memfs": "4.12.0",
68
+ "mustache": "^4.2.0",
69
+ "tar": "^6.1.15",
70
+ "tmp": "^0.2.1",
71
+ "metro": "0.82.5"
72
+ },
73
+ "homepage": "https://gitcode.com/openharmony-sig/ohos_react_native",
74
+ "repository": {
75
+ "type": "gitcode",
76
+ "url": "https://gitcode.com/openharmony-sig/ohos_react_native"
77
+ }
78
+ }
@@ -1,17 +1,17 @@
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
- const { config: harmonyConfig } = require('./dist');
9
-
10
- /**
11
- * @type {import("@react-native-community/cli-types").Config}
12
- */
13
- const config = {
14
- commands: harmonyConfig.commands,
15
- };
16
-
17
- module.exports = config;
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
+ const { config: harmonyConfig } = require('./dist');
9
+
10
+ /**
11
+ * @type {import("@react-native-community/cli-types").Config}
12
+ */
13
+ const config = {
14
+ commands: harmonyConfig.commands,
15
+ };
16
+
17
+ module.exports = config;
@@ -1,7 +1,7 @@
1
- {
2
- "extends": "./tsconfig.json",
3
- "exclude": [
4
- "tests",
5
- "**/*.test.ts",
6
- ]
1
+ {
2
+ "extends": "./tsconfig.json",
3
+ "exclude": [
4
+ "tests",
5
+ "**/*.test.ts",
6
+ ]
7
7
  }
package/tsconfig.json CHANGED
@@ -1,3 +1,3 @@
1
- {
2
- "extends": "@tsconfig/recommended/tsconfig.json",
1
+ {
2
+ "extends": "@tsconfig/recommended/tsconfig.json",
3
3
  }