@react-native-oh/react-native-harmony-cli 0.0.36 → 0.0.40-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.
Files changed (87) hide show
  1. package/dist/autolinking/Autolinking.js +14 -11
  2. package/dist/codegen/generators/AppBuildTimeGlueCodeGenerator.js +2 -1
  3. package/dist/codegen/generators/LibGlueCodeGenerator.js +2 -2
  4. package/dist/codegen/generators/UberGeneratorV1.js +9 -2
  5. package/dist/codegen/generators/UberGeneratorV2.js +8 -1
  6. package/dist/codegen/templates/BasePackageHTemplate.js +12 -1
  7. package/dist/codegen/templates/RNOHGeneratedPackageHTemplate.js +12 -1
  8. package/dist/commands/codegen-harmony.js +16 -5
  9. package/dist/commands/run-harmony.js +49 -27
  10. package/dist/core/ProjectDependenciesManager.js +5 -7
  11. package/dist/simulator/LaunchSimulator.js +318 -0
  12. package/dist/simulator/index.js +23 -0
  13. package/harmony/rnoh-hvigor-plugin-0.3.0.tgz +0 -0
  14. package/package.json +13 -5
  15. package/.prettierrc +0 -6
  16. package/src/assetResolver.ts +0 -134
  17. package/src/autolinking/Autolinking.test.ts +0 -483
  18. package/src/autolinking/Autolinking.ts +0 -382
  19. package/src/autolinking/index.ts +0 -8
  20. package/src/codegen/core/CodeGenerator.ts +0 -16
  21. package/src/codegen/core/CodegenError.ts +0 -10
  22. package/src/codegen/core/EventUtils.ts +0 -23
  23. package/src/codegen/core/TypeAnnotationToTS.test.ts +0 -82
  24. package/src/codegen/core/TypeAnnotationToTS.ts +0 -195
  25. package/src/codegen/core/UberSchema.ts +0 -152
  26. package/src/codegen/core/index.ts +0 -12
  27. package/src/codegen/generators/AppBuildTimeGlueCodeGenerator.ts +0 -120
  28. package/src/codegen/generators/ArkTSComponentCodeGeneratorArkTS.ts +0 -128
  29. package/src/codegen/generators/ArkTSComponentCodeGeneratorCAPI.ts +0 -122
  30. package/src/codegen/generators/CppComponentCodeGenerator.ts +0 -95
  31. package/src/codegen/generators/LibGlueCodeGenerator.ts +0 -98
  32. package/src/codegen/generators/NativeModuleCodeGenerator.ts +0 -124
  33. package/src/codegen/generators/SharedComponentCodeGenerator.ts +0 -57
  34. package/src/codegen/generators/UberGeneratorV1.ts +0 -75
  35. package/src/codegen/generators/UberGeneratorV2.ts +0 -114
  36. package/src/codegen/generators/index.ts +0 -15
  37. package/src/codegen/index.ts +0 -9
  38. package/src/codegen/templates/BaseComponentInstanceHTemplate.ts +0 -128
  39. package/src/codegen/templates/BasePackageHTemplate.ts +0 -147
  40. package/src/codegen/templates/ComponentDescriptorHTemplate.ts +0 -63
  41. package/src/codegen/templates/ComponentJSIBinderHTemplate.ts +0 -121
  42. package/src/codegen/templates/ComponentUtilsTSTemplate.ts +0 -222
  43. package/src/codegen/templates/IndexTSTemplate.ts +0 -62
  44. package/src/codegen/templates/RNOHGeneratedPackageHTemplate.ts +0 -138
  45. package/src/codegen/templates/TurboModuleCppTemplate.ts +0 -61
  46. package/src/codegen/templates/TurboModuleHTemplate.ts +0 -42
  47. package/src/codegen/templates/TurboModuleSpecTSTemplate.ts +0 -101
  48. package/src/codegen/templates/index.ts +0 -16
  49. package/src/commands/bundle-harmony.ts +0 -134
  50. package/src/commands/codegen-harmony.ts +0 -297
  51. package/src/commands/codegen-lib-harmony.ts +0 -389
  52. package/src/commands/create-metro-host-constants.ts +0 -55
  53. package/src/commands/index.ts +0 -16
  54. package/src/commands/init.ts +0 -755
  55. package/src/commands/link-harmony.ts +0 -102
  56. package/src/commands/pack-harmony.ts +0 -128
  57. package/src/commands/run-harmony.ts +0 -478
  58. package/src/commands/types.ts +0 -21
  59. package/src/commands/unpack-harmony.ts +0 -238
  60. package/src/commands/verify-package-harmony.ts +0 -113
  61. package/src/core/AbsolutePath.ts +0 -66
  62. package/src/core/CodegenConfig.ts +0 -67
  63. package/src/core/DescriptiveError.ts +0 -68
  64. package/src/core/FileSystem.ts +0 -57
  65. package/src/core/OHPackageJSON5.ts +0 -30
  66. package/src/core/PackageJSON.ts +0 -104
  67. package/src/core/ProjectDependenciesManager.ts +0 -103
  68. package/src/core/ValidationError.ts +0 -8
  69. package/src/core/ValueObject.ts +0 -9
  70. package/src/core/fs.ts +0 -38
  71. package/src/core/index.ts +0 -17
  72. package/src/index.ts +0 -33
  73. package/src/io/CliExecutor.ts +0 -69
  74. package/src/io/Logger.ts +0 -112
  75. package/src/io/RealFS.ts +0 -62
  76. package/src/io/TarGz.ts +0 -33
  77. package/src/io/__fixtures__.ts +0 -139
  78. package/src/io/fsUtils.ts +0 -44
  79. package/src/io/index.ts +0 -11
  80. package/src/package-verifier/checks/HarmonyDirContainsOnlyHarsCheck.ts +0 -35
  81. package/src/package-verifier/checks/HarmonyDirExistsCheck.ts +0 -31
  82. package/src/package-verifier/checks/NpmAnAndOhPackageVersionsAreEqual.ts +0 -25
  83. package/src/package-verifier/checks/OhPackageNameFollowsNamingConventionCheck.ts +0 -54
  84. package/src/package-verifier/checks/index.ts +0 -11
  85. package/src/package-verifier/index.ts +0 -9
  86. package/src/package-verifier/types.ts +0 -19
  87. package/src/package-verifier/verify-package.ts +0 -123
@@ -1,55 +0,0 @@
1
- /**
2
- * Copyright (c) 2024-2025 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
- import { Command } from './types';
9
- import os from 'node:os';
10
- import fs from 'node:fs';
11
- import pathUtils from 'node:path';
12
-
13
- export const commandCreateMetroConstantsHarmony: Command = {
14
- name: 'create-metro-host-constants-harmony',
15
- description:
16
- 'Creates a Typescript file that exports constant with IP of the host machine. That IP is later used to connect to the Metro server from a physical device.',
17
- options: [
18
- {
19
- name: '--output <string>',
20
- description: 'Output file',
21
- default: './harmony/entry/src/main/ets/codegen/MetroHostConstants.ts',
22
- },
23
- ],
24
- func: async (argv, config, args: any) => {
25
- createMetroHostConstants(pathUtils.resolve(args.output));
26
- },
27
- };
28
-
29
- function createMetroHostConstants(outputPath: string): void {
30
- const networkInterfacesByName = os.networkInterfaces();
31
- const getIP = () => {
32
- for (let name of Object.keys(networkInterfacesByName)) {
33
- for (let net of networkInterfacesByName[name] ?? []) {
34
- // skip over non-ipv4 and internal (i.e. 127.0.0.1) addresses
35
- if (net.family === 'IPv4' && !net.internal) {
36
- return net.address;
37
- }
38
- }
39
- }
40
- return;
41
- };
42
- const ip = getIP();
43
- const tsCode = [
44
- '// This file is autogenerated. Do not modify it manually.',
45
- '',
46
- `export const METRO_SERVER_IP = '${ip}';\n`,
47
- ];
48
- fs.writeFile(outputPath, tsCode.join('\n'), (err) => {
49
- if (err) {
50
- console.error(`Error writing to ${outputPath}:`, err);
51
- } else {
52
- console.log(`Created file at ${outputPath}`);
53
- }
54
- });
55
- }
@@ -1,16 +0,0 @@
1
- /**
2
- * Copyright (c) 2024-2025 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
- export * from './bundle-harmony';
9
- export * from './pack-harmony';
10
- export * from './unpack-harmony';
11
- export * from './create-metro-host-constants';
12
- export * from './codegen-harmony';
13
- export * from './verify-package-harmony';
14
- export * from './codegen-lib-harmony';
15
- export * from './link-harmony';
16
- export * from './run-harmony';