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

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 (137) hide show
  1. package/README.md +11 -11
  2. package/dist/assetResolver.js +74 -43
  3. package/dist/autolinking/Autolinking.js +183 -179
  4. package/dist/codegen/core/CodegenError.js +23 -3
  5. package/dist/codegen/core/EventUtils.js +3 -3
  6. package/dist/codegen/core/TypeAnnotationToTS.js +28 -24
  7. package/dist/codegen/core/UberSchema.js +96 -57
  8. package/dist/codegen/generators/AppBuildTimeGlueCodeGenerator.js +42 -28
  9. package/dist/codegen/generators/ArkTSComponentCodeGeneratorArkTS.js +34 -27
  10. package/dist/codegen/generators/ArkTSComponentCodeGeneratorCAPI.js +33 -25
  11. package/dist/codegen/generators/CppComponentCodeGenerator.js +28 -23
  12. package/dist/codegen/generators/LibGlueCodeGenerator.js +29 -26
  13. package/dist/codegen/generators/NativeModuleCodeGenerator.js +30 -25
  14. package/dist/codegen/generators/SharedComponentCodeGenerator.js +15 -15
  15. package/dist/codegen/generators/UberGeneratorV1.js +24 -18
  16. package/dist/codegen/generators/UberGeneratorV2.js +36 -28
  17. package/dist/codegen/templates/BaseComponentInstanceHTemplate.js +24 -50
  18. package/dist/codegen/templates/BasePackageHTemplate.js +21 -109
  19. package/dist/codegen/templates/ComponentDescriptorHTemplate.js +8 -53
  20. package/dist/codegen/templates/ComponentJSIBinderHTemplate.js +27 -75
  21. package/dist/codegen/templates/ComponentUtilsTSTemplate.js +29 -162
  22. package/dist/codegen/templates/IndexTSTemplate.js +17 -37
  23. package/dist/codegen/templates/RNOHGeneratedPackageHTemplate.js +24 -108
  24. package/dist/codegen/templates/TurboModuleCppTemplate.js +15 -38
  25. package/dist/codegen/templates/TurboModuleHTemplate.js +11 -32
  26. package/dist/codegen/templates/TurboModuleSpecTSTemplate.js +19 -52
  27. package/dist/commands/bundle-harmony.js +138 -53
  28. package/dist/commands/codegen-harmony.js +175 -104
  29. package/dist/commands/codegen-lib-harmony.js +116 -76
  30. package/dist/commands/create-metro-host-constants.js +47 -18
  31. package/dist/commands/init.js +961 -537
  32. package/dist/commands/link-harmony.js +71 -33
  33. package/dist/commands/pack-harmony.js +108 -47
  34. package/dist/commands/run-harmony.js +520 -352
  35. package/dist/commands/unpack-harmony.js +198 -105
  36. package/dist/commands/verify-package-harmony.js +108 -54
  37. package/dist/core/AbsolutePath.js +47 -31
  38. package/dist/core/CodegenConfig.js +22 -24
  39. package/dist/core/DescriptiveError.js +37 -18
  40. package/dist/core/FileSystem.js +18 -14
  41. package/dist/core/OHPackageJSON5.js +23 -17
  42. package/dist/core/PackageJSON.js +42 -26
  43. package/dist/core/ProjectDependenciesManager.js +96 -46
  44. package/dist/core/ValidationError.js +22 -2
  45. package/dist/core/fs.js +6 -9
  46. package/dist/index.js +1 -1
  47. package/dist/io/CliExecutor.js +98 -46
  48. package/dist/io/Logger.js +46 -40
  49. package/dist/io/RealFS.js +88 -35
  50. package/dist/io/TarGz.js +8 -11
  51. package/dist/io/__fixtures__.js +141 -79
  52. package/dist/io/fsUtils.js +12 -13
  53. package/dist/package-verifier/checks/HarmonyDirContainsOnlyHarsCheck.js +47 -19
  54. package/dist/package-verifier/checks/HarmonyDirExistsCheck.js +41 -13
  55. package/dist/package-verifier/checks/NpmAnAndOhPackageVersionsAreEqual.js +38 -8
  56. package/dist/package-verifier/checks/OhPackageNameFollowsNamingConventionCheck.js +54 -22
  57. package/dist/package-verifier/verify-package.js +132 -55
  58. package/dist/simulator/LaunchSimulator.js +395 -0
  59. package/dist/simulator/index.js +23 -0
  60. package/jest.config.js +12 -12
  61. package/package.json +78 -70
  62. package/react-native.config.js +17 -17
  63. package/tsconfig.build.json +6 -6
  64. package/tsconfig.json +2 -2
  65. package/.prettierrc +0 -6
  66. package/src/assetResolver.ts +0 -134
  67. package/src/autolinking/Autolinking.test.ts +0 -483
  68. package/src/autolinking/Autolinking.ts +0 -382
  69. package/src/autolinking/index.ts +0 -8
  70. package/src/codegen/core/CodeGenerator.ts +0 -16
  71. package/src/codegen/core/CodegenError.ts +0 -10
  72. package/src/codegen/core/EventUtils.ts +0 -23
  73. package/src/codegen/core/TypeAnnotationToTS.test.ts +0 -82
  74. package/src/codegen/core/TypeAnnotationToTS.ts +0 -195
  75. package/src/codegen/core/UberSchema.ts +0 -152
  76. package/src/codegen/core/index.ts +0 -12
  77. package/src/codegen/generators/AppBuildTimeGlueCodeGenerator.ts +0 -120
  78. package/src/codegen/generators/ArkTSComponentCodeGeneratorArkTS.ts +0 -128
  79. package/src/codegen/generators/ArkTSComponentCodeGeneratorCAPI.ts +0 -122
  80. package/src/codegen/generators/CppComponentCodeGenerator.ts +0 -95
  81. package/src/codegen/generators/LibGlueCodeGenerator.ts +0 -98
  82. package/src/codegen/generators/NativeModuleCodeGenerator.ts +0 -124
  83. package/src/codegen/generators/SharedComponentCodeGenerator.ts +0 -57
  84. package/src/codegen/generators/UberGeneratorV1.ts +0 -75
  85. package/src/codegen/generators/UberGeneratorV2.ts +0 -114
  86. package/src/codegen/generators/index.ts +0 -15
  87. package/src/codegen/index.ts +0 -9
  88. package/src/codegen/templates/BaseComponentInstanceHTemplate.ts +0 -128
  89. package/src/codegen/templates/BasePackageHTemplate.ts +0 -147
  90. package/src/codegen/templates/ComponentDescriptorHTemplate.ts +0 -63
  91. package/src/codegen/templates/ComponentJSIBinderHTemplate.ts +0 -121
  92. package/src/codegen/templates/ComponentUtilsTSTemplate.ts +0 -222
  93. package/src/codegen/templates/IndexTSTemplate.ts +0 -62
  94. package/src/codegen/templates/RNOHGeneratedPackageHTemplate.ts +0 -138
  95. package/src/codegen/templates/TurboModuleCppTemplate.ts +0 -61
  96. package/src/codegen/templates/TurboModuleHTemplate.ts +0 -42
  97. package/src/codegen/templates/TurboModuleSpecTSTemplate.ts +0 -101
  98. package/src/codegen/templates/index.ts +0 -16
  99. package/src/commands/bundle-harmony.ts +0 -134
  100. package/src/commands/codegen-harmony.ts +0 -297
  101. package/src/commands/codegen-lib-harmony.ts +0 -389
  102. package/src/commands/create-metro-host-constants.ts +0 -55
  103. package/src/commands/index.ts +0 -16
  104. package/src/commands/init.ts +0 -755
  105. package/src/commands/link-harmony.ts +0 -102
  106. package/src/commands/pack-harmony.ts +0 -128
  107. package/src/commands/run-harmony.ts +0 -478
  108. package/src/commands/types.ts +0 -21
  109. package/src/commands/unpack-harmony.ts +0 -238
  110. package/src/commands/verify-package-harmony.ts +0 -113
  111. package/src/core/AbsolutePath.ts +0 -66
  112. package/src/core/CodegenConfig.ts +0 -67
  113. package/src/core/DescriptiveError.ts +0 -68
  114. package/src/core/FileSystem.ts +0 -57
  115. package/src/core/OHPackageJSON5.ts +0 -30
  116. package/src/core/PackageJSON.ts +0 -104
  117. package/src/core/ProjectDependenciesManager.ts +0 -103
  118. package/src/core/ValidationError.ts +0 -8
  119. package/src/core/ValueObject.ts +0 -9
  120. package/src/core/fs.ts +0 -38
  121. package/src/core/index.ts +0 -17
  122. package/src/index.ts +0 -33
  123. package/src/io/CliExecutor.ts +0 -69
  124. package/src/io/Logger.ts +0 -112
  125. package/src/io/RealFS.ts +0 -62
  126. package/src/io/TarGz.ts +0 -33
  127. package/src/io/__fixtures__.ts +0 -139
  128. package/src/io/fsUtils.ts +0 -44
  129. package/src/io/index.ts +0 -11
  130. package/src/package-verifier/checks/HarmonyDirContainsOnlyHarsCheck.ts +0 -35
  131. package/src/package-verifier/checks/HarmonyDirExistsCheck.ts +0 -31
  132. package/src/package-verifier/checks/NpmAnAndOhPackageVersionsAreEqual.ts +0 -25
  133. package/src/package-verifier/checks/OhPackageNameFollowsNamingConventionCheck.ts +0 -54
  134. package/src/package-verifier/checks/index.ts +0 -11
  135. package/src/package-verifier/index.ts +0 -9
  136. package/src/package-verifier/types.ts +0 -19
  137. package/src/package-verifier/verify-package.ts +0 -123
@@ -5,6 +5,21 @@
5
5
  * This source code is licensed under the MIT license found in the
6
6
  * LICENSE-MIT file in the root directory of this source tree.
7
7
  */
8
+ var __extends = (this && this.__extends) || (function () {
9
+ var extendStatics = function (d, b) {
10
+ extendStatics = Object.setPrototypeOf ||
11
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
12
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
13
+ return extendStatics(d, b);
14
+ };
15
+ return function (d, b) {
16
+ if (typeof b !== "function" && b !== null)
17
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
18
+ extendStatics(d, b);
19
+ function __() { this.constructor = d; }
20
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
21
+ };
22
+ })();
8
23
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
9
24
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
10
25
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -14,120 +29,167 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
14
29
  step((generator = generator.apply(thisArg, _arguments || [])).next());
15
30
  });
16
31
  };
17
- var __importDefault = (this && this.__importDefault) || function (mod) {
18
- return (mod && mod.__esModule) ? mod : { "default": mod };
32
+ var __generator = (this && this.__generator) || function (thisArg, body) {
33
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
34
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
35
+ function verb(n) { return function (v) { return step([n, v]); }; }
36
+ function step(op) {
37
+ if (f) throw new TypeError("Generator is already executing.");
38
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
39
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
40
+ if (y = 0, t) op = [op[0] & 2, t.value];
41
+ switch (op[0]) {
42
+ case 0: case 1: t = op; break;
43
+ case 4: _.label++; return { value: op[1], done: false };
44
+ case 5: _.label++; y = op[1]; op = [0]; continue;
45
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
46
+ default:
47
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
48
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
49
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
50
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
51
+ if (t[2]) _.ops.pop();
52
+ _.trys.pop(); continue;
53
+ }
54
+ op = body.call(thisArg, _);
55
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
56
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
57
+ }
19
58
  };
20
59
  Object.defineProperty(exports, "__esModule", { value: true });
21
60
  exports.MockedLogger = exports.MemFS = exports.FakeCliExecutor = void 0;
22
- const core_1 = require("../core");
23
- const CliExecutor_1 = require("./CliExecutor");
24
- const memfs_1 = require("memfs");
25
- const Dirent_1 = __importDefault(require("memfs/lib/Dirent"));
26
- const Logger_1 = require("./Logger");
27
- const chalk_1 = __importDefault(require("chalk"));
28
- class FakeCliExecutor extends CliExecutor_1.CliExecutor {
29
- constructor(onRun) {
30
- super();
31
- this.onRun = onRun;
32
- this.commands = [];
33
- }
34
- run(command, options) {
35
- let commandWithArgs = command;
61
+ var core_1 = require("../core");
62
+ var CliExecutor_1 = require("./CliExecutor");
63
+ var memfs_1 = require("memfs");
64
+ var Dirent_1 = require("memfs/lib/Dirent");
65
+ var Logger_1 = require("./Logger");
66
+ var chalk_1 = require("chalk");
67
+ var FakeCliExecutor = /** @class */ (function (_super) {
68
+ __extends(FakeCliExecutor, _super);
69
+ function FakeCliExecutor(onRun) {
70
+ var _this = _super.call(this) || this;
71
+ _this.onRun = onRun;
72
+ _this.commands = [];
73
+ return _this;
74
+ }
75
+ FakeCliExecutor.prototype.run = function (command, options) {
76
+ var commandWithArgs = command;
36
77
  if (options.args) {
37
78
  commandWithArgs += options.args.join(' ');
38
79
  }
39
80
  this.commands.push(commandWithArgs);
40
81
  return this.onRun(commandWithArgs);
41
- }
42
- getCommands() {
82
+ };
83
+ FakeCliExecutor.prototype.getCommands = function () {
43
84
  return this.commands;
44
- }
45
- }
85
+ };
86
+ return FakeCliExecutor;
87
+ }(CliExecutor_1.CliExecutor));
46
88
  exports.FakeCliExecutor = FakeCliExecutor;
47
- class MemFSDirent extends core_1.Dirent {
48
- constructor(rawDirent) {
49
- super();
50
- this.rawDirent = rawDirent;
51
- }
52
- isDirectory() {
89
+ var MemFSDirent = /** @class */ (function (_super) {
90
+ __extends(MemFSDirent, _super);
91
+ function MemFSDirent(rawDirent) {
92
+ var _this = _super.call(this) || this;
93
+ _this.rawDirent = rawDirent;
94
+ return _this;
95
+ }
96
+ MemFSDirent.prototype.isDirectory = function () {
53
97
  return this.rawDirent.isDirectory();
54
- }
55
- isSymbolicLink() {
98
+ };
99
+ MemFSDirent.prototype.isSymbolicLink = function () {
56
100
  return false;
57
- }
58
- get name() {
59
- return this.rawDirent.name.toString();
60
- }
61
- get path() {
62
- return new core_1.AbsolutePath(this.rawDirent.path).copyWithNewSegment(this.rawDirent.name.toString());
63
- }
64
- }
65
- class MemFS extends core_1.FS {
66
- constructor(initialFileStructure) {
67
- super();
68
- this.fs = (0, memfs_1.memfs)(initialFileStructure, './').fs;
69
- }
70
- existsSync(path) {
101
+ };
102
+ Object.defineProperty(MemFSDirent.prototype, "name", {
103
+ get: function () {
104
+ return this.rawDirent.name.toString();
105
+ },
106
+ enumerable: false,
107
+ configurable: true
108
+ });
109
+ Object.defineProperty(MemFSDirent.prototype, "path", {
110
+ get: function () {
111
+ return new core_1.AbsolutePath(this.rawDirent.path).copyWithNewSegment(this.rawDirent.name.toString());
112
+ },
113
+ enumerable: false,
114
+ configurable: true
115
+ });
116
+ return MemFSDirent;
117
+ }(core_1.Dirent));
118
+ var MemFS = /** @class */ (function (_super) {
119
+ __extends(MemFS, _super);
120
+ function MemFS(initialFileStructure) {
121
+ var _this = _super.call(this) || this;
122
+ _this.fs = (0, memfs_1.memfs)(initialFileStructure, './').fs;
123
+ return _this;
124
+ }
125
+ MemFS.prototype.existsSync = function (path) {
71
126
  return this.fs.existsSync(path.toString());
72
- }
73
- readTextSync(path) {
127
+ };
128
+ MemFS.prototype.readTextSync = function (path) {
74
129
  return this.fs.readFileSync(path.toString()).toString();
75
- }
76
- readText(path) {
77
- return __awaiter(this, void 0, void 0, function* () {
78
- return new Promise((resolve, reject) => {
79
- this.fs.readFile(path.toString(), {}, (err, data) => {
80
- var _a;
81
- if (err) {
82
- reject(err);
83
- return;
84
- }
85
- resolve((_a = data === null || data === void 0 ? void 0 : data.toString()) !== null && _a !== void 0 ? _a : '');
86
- });
130
+ };
131
+ MemFS.prototype.readText = function (path) {
132
+ return __awaiter(this, void 0, void 0, function () {
133
+ var _this = this;
134
+ return __generator(this, function (_a) {
135
+ return [2 /*return*/, new Promise(function (resolve, reject) {
136
+ _this.fs.readFile(path.toString(), {}, function (err, data) {
137
+ var _a;
138
+ if (err) {
139
+ reject(err);
140
+ return;
141
+ }
142
+ resolve((_a = data === null || data === void 0 ? void 0 : data.toString()) !== null && _a !== void 0 ? _a : '');
143
+ });
144
+ })];
87
145
  });
88
146
  });
89
- }
90
- writeTextSync(path, data) {
147
+ };
148
+ MemFS.prototype.writeTextSync = function (path, data) {
91
149
  return this.fs.writeFileSync(path.toString(), data);
92
- }
93
- readDirentsSync(path, options) {
150
+ };
151
+ MemFS.prototype.readDirentsSync = function (path, options) {
94
152
  return this.fs
95
153
  .readdirSync(path.toString(), {
96
154
  withFileTypes: true,
97
155
  recursive: options === null || options === void 0 ? void 0 : options.recursive,
98
156
  })
99
- .flatMap((dataOutOrDirent) => {
157
+ .flatMap(function (dataOutOrDirent) {
100
158
  if (!(dataOutOrDirent instanceof Dirent_1.default)) {
101
159
  return [];
102
160
  }
103
161
  return [new MemFSDirent(dataOutOrDirent)];
104
162
  });
105
- }
106
- }
163
+ };
164
+ return MemFS;
165
+ }(core_1.FS));
107
166
  exports.MemFS = MemFS;
108
- class MockedLogger extends Logger_1.Logger {
109
- constructor() {
110
- super(...arguments);
111
- this.logs = [];
112
- }
113
- debug(prepareMsg) {
167
+ var MockedLogger = /** @class */ (function (_super) {
168
+ __extends(MockedLogger, _super);
169
+ function MockedLogger() {
170
+ var _this = _super !== null && _super.apply(this, arguments) || this;
171
+ _this.logs = [];
172
+ return _this;
173
+ }
174
+ MockedLogger.prototype.debug = function (prepareMsg) {
114
175
  chalk_1.default.level = 0;
115
176
  this.logs.push({ type: 'debug', msg: prepareMsg(chalk_1.default) });
116
- }
117
- info(prepareMsg, options) {
177
+ };
178
+ MockedLogger.prototype.info = function (prepareMsg, options) {
118
179
  chalk_1.default.level = 0;
119
180
  this.logs.push({ type: 'info', msg: prepareMsg(chalk_1.default) });
120
- }
121
- warn(prepareMsg) {
181
+ };
182
+ MockedLogger.prototype.warn = function (prepareMsg) {
122
183
  chalk_1.default.level = 0;
123
184
  this.logs.push({ type: 'warn', msg: prepareMsg(chalk_1.default) });
124
- }
125
- descriptiveError(error) {
185
+ };
186
+ MockedLogger.prototype.descriptiveError = function (error) {
126
187
  chalk_1.default.level = 0;
127
188
  this.logs.push({ type: 'error', msg: error.getMessage() });
128
- }
129
- getLogs() {
189
+ };
190
+ MockedLogger.prototype.getLogs = function () {
130
191
  return this.logs;
131
- }
132
- }
192
+ };
193
+ return MockedLogger;
194
+ }(Logger_1.Logger));
133
195
  exports.MockedLogger = MockedLogger;
@@ -5,26 +5,25 @@
5
5
  * This source code is licensed under the MIT license found in the
6
6
  * LICENSE-MIT file in the root directory of this source tree.
7
7
  */
8
- var __importDefault = (this && this.__importDefault) || function (mod) {
9
- return (mod && mod.__esModule) ? mod : { "default": mod };
10
- };
11
8
  Object.defineProperty(exports, "__esModule", { value: true });
12
9
  exports.findFilePathsWithExtensions = findFilePathsWithExtensions;
13
- const node_path_1 = __importDefault(require("node:path"));
14
- const Dirent_1 = __importDefault(require("memfs/lib/Dirent"));
15
- const node_fs_1 = __importDefault(require("node:fs"));
16
- const node_fs_2 = require("node:fs");
17
- function findFilePathsWithExtensions(dirPath, fileExtensions, options = {}) {
10
+ var node_path_1 = require("node:path");
11
+ var Dirent_1 = require("memfs/lib/Dirent");
12
+ var node_fs_1 = require("node:fs");
13
+ var node_fs_2 = require("node:fs");
14
+ function findFilePathsWithExtensions(dirPath, fileExtensions, options) {
18
15
  var _a;
19
- const fs = ((_a = options === null || options === void 0 ? void 0 : options.fs) !== null && _a !== void 0 ? _a : node_fs_1.default);
20
- let results = [];
21
- const files = fs.readdirSync(dirPath.getValue(), { withFileTypes: true });
22
- for (const file of files) {
16
+ if (options === void 0) { options = {}; }
17
+ var fs = ((_a = options === null || options === void 0 ? void 0 : options.fs) !== null && _a !== void 0 ? _a : node_fs_1.default);
18
+ var results = [];
19
+ var files = fs.readdirSync(dirPath.getValue(), { withFileTypes: true });
20
+ for (var _i = 0, files_1 = files; _i < files_1.length; _i++) {
21
+ var file = files_1[_i];
23
22
  if (!(file instanceof node_fs_2.Dirent) &&
24
23
  !(file instanceof Dirent_1.default)) {
25
24
  continue;
26
25
  }
27
- const path = dirPath.copyWithNewSegment(file.name.toString());
26
+ var path = dirPath.copyWithNewSegment(file.name.toString());
28
27
  if (fs.lstatSync(path.toString()).isDirectory()) {
29
28
  results = results.concat(findFilePathsWithExtensions(path, fileExtensions, options));
30
29
  }
@@ -14,30 +14,58 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
14
14
  step((generator = generator.apply(thisArg, _arguments || [])).next());
15
15
  });
16
16
  };
17
- var __importDefault = (this && this.__importDefault) || function (mod) {
18
- return (mod && mod.__esModule) ? mod : { "default": mod };
17
+ var __generator = (this && this.__generator) || function (thisArg, body) {
18
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
19
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
20
+ function verb(n) { return function (v) { return step([n, v]); }; }
21
+ function step(op) {
22
+ if (f) throw new TypeError("Generator is already executing.");
23
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
24
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
25
+ if (y = 0, t) op = [op[0] & 2, t.value];
26
+ switch (op[0]) {
27
+ case 0: case 1: t = op; break;
28
+ case 4: _.label++; return { value: op[1], done: false };
29
+ case 5: _.label++; y = op[1]; op = [0]; continue;
30
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
31
+ default:
32
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
33
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
34
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
35
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
36
+ if (t[2]) _.ops.pop();
37
+ _.trys.pop(); continue;
38
+ }
39
+ op = body.call(thisArg, _);
40
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
41
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
42
+ }
19
43
  };
20
44
  Object.defineProperty(exports, "__esModule", { value: true });
21
45
  exports.createHarmonyDirContainsOnlyHarsCheck = createHarmonyDirContainsOnlyHarsCheck;
22
- const node_fs_1 = __importDefault(require("node:fs"));
46
+ var node_fs_1 = require("node:fs");
23
47
  function createHarmonyDirContainsOnlyHarsCheck(npmPackagePath, hasNpmPackageNativeCode) {
48
+ var _this = this;
24
49
  return {
25
50
  checkIf: 'harmony_directory_contains_only_one_har_file',
26
- run: () => __awaiter(this, void 0, void 0, function* () {
27
- if (!hasNpmPackageNativeCode) {
28
- return 'skip';
29
- }
30
- const harmonyPath = npmPackagePath
31
- .copyWithNewSegment('harmony')
32
- .getValue();
33
- const fileOrDirNames = node_fs_1.default.readdirSync(harmonyPath);
34
- if (fileOrDirNames.length !== 1) {
35
- return { status: 'fail', message: JSON.stringify(fileOrDirNames) };
36
- }
37
- if (!fileOrDirNames[0].endsWith('.har')) {
38
- return 'fail';
39
- }
40
- return 'pass';
41
- }),
51
+ run: function () { return __awaiter(_this, void 0, void 0, function () {
52
+ var harmonyPath, fileOrDirNames;
53
+ return __generator(this, function (_a) {
54
+ if (!hasNpmPackageNativeCode) {
55
+ return [2 /*return*/, 'skip'];
56
+ }
57
+ harmonyPath = npmPackagePath
58
+ .copyWithNewSegment('harmony')
59
+ .getValue();
60
+ fileOrDirNames = node_fs_1.default.readdirSync(harmonyPath);
61
+ if (fileOrDirNames.length !== 1) {
62
+ return [2 /*return*/, { status: 'fail', message: JSON.stringify(fileOrDirNames) }];
63
+ }
64
+ if (!fileOrDirNames[0].endsWith('.har')) {
65
+ return [2 /*return*/, 'fail'];
66
+ }
67
+ return [2 /*return*/, 'pass'];
68
+ });
69
+ }); },
42
70
  };
43
71
  }
@@ -14,24 +14,52 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
14
14
  step((generator = generator.apply(thisArg, _arguments || [])).next());
15
15
  });
16
16
  };
17
- var __importDefault = (this && this.__importDefault) || function (mod) {
18
- return (mod && mod.__esModule) ? mod : { "default": mod };
17
+ var __generator = (this && this.__generator) || function (thisArg, body) {
18
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
19
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
20
+ function verb(n) { return function (v) { return step([n, v]); }; }
21
+ function step(op) {
22
+ if (f) throw new TypeError("Generator is already executing.");
23
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
24
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
25
+ if (y = 0, t) op = [op[0] & 2, t.value];
26
+ switch (op[0]) {
27
+ case 0: case 1: t = op; break;
28
+ case 4: _.label++; return { value: op[1], done: false };
29
+ case 5: _.label++; y = op[1]; op = [0]; continue;
30
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
31
+ default:
32
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
33
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
34
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
35
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
36
+ if (t[2]) _.ops.pop();
37
+ _.trys.pop(); continue;
38
+ }
39
+ op = body.call(thisArg, _);
40
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
41
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
42
+ }
19
43
  };
20
44
  Object.defineProperty(exports, "__esModule", { value: true });
21
45
  exports.createHarmonyDirExistsCheck = createHarmonyDirExistsCheck;
22
- const node_fs_1 = __importDefault(require("node:fs"));
46
+ var node_fs_1 = require("node:fs");
23
47
  function createHarmonyDirExistsCheck(packagePath, hasNativeCode) {
48
+ var _this = this;
24
49
  return {
25
50
  checkIf: 'package_has_harmony_dir',
26
- run: () => __awaiter(this, void 0, void 0, function* () {
27
- const harmonyDirExist = node_fs_1.default.existsSync(packagePath.copyWithNewSegment('harmony').getValue());
28
- if (!hasNativeCode) {
29
- return 'skip';
30
- }
31
- if (!harmonyDirExist) {
32
- return 'fail';
33
- }
34
- return 'pass';
35
- }),
51
+ run: function () { return __awaiter(_this, void 0, void 0, function () {
52
+ var harmonyDirExist;
53
+ return __generator(this, function (_a) {
54
+ harmonyDirExist = node_fs_1.default.existsSync(packagePath.copyWithNewSegment('harmony').getValue());
55
+ if (!hasNativeCode) {
56
+ return [2 /*return*/, 'skip'];
57
+ }
58
+ if (!harmonyDirExist) {
59
+ return [2 /*return*/, 'fail'];
60
+ }
61
+ return [2 /*return*/, 'pass'];
62
+ });
63
+ }); },
36
64
  };
37
65
  }
@@ -14,18 +14,48 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
14
14
  step((generator = generator.apply(thisArg, _arguments || [])).next());
15
15
  });
16
16
  };
17
+ var __generator = (this && this.__generator) || function (thisArg, body) {
18
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
19
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
20
+ function verb(n) { return function (v) { return step([n, v]); }; }
21
+ function step(op) {
22
+ if (f) throw new TypeError("Generator is already executing.");
23
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
24
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
25
+ if (y = 0, t) op = [op[0] & 2, t.value];
26
+ switch (op[0]) {
27
+ case 0: case 1: t = op; break;
28
+ case 4: _.label++; return { value: op[1], done: false };
29
+ case 5: _.label++; y = op[1]; op = [0]; continue;
30
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
31
+ default:
32
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
33
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
34
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
35
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
36
+ if (t[2]) _.ops.pop();
37
+ _.trys.pop(); continue;
38
+ }
39
+ op = body.call(thisArg, _);
40
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
41
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
42
+ }
43
+ };
17
44
  Object.defineProperty(exports, "__esModule", { value: true });
18
45
  exports.createNpmAndOhPackageVersionsAreEqualCheck = createNpmAndOhPackageVersionsAreEqualCheck;
19
46
  function createNpmAndOhPackageVersionsAreEqualCheck(npmPackageVersion, ohPackageVersion) {
47
+ var _this = this;
20
48
  return {
21
49
  checkIf: 'npm_and_oh_package_versions_are_equal',
22
- run: () => __awaiter(this, void 0, void 0, function* () {
23
- return npmPackageVersion === ohPackageVersion
24
- ? 'pass'
25
- : {
26
- status: 'fail',
27
- message: `expected OH package version (${ohPackageVersion}) to match NPM version (${npmPackageVersion})`,
28
- };
29
- }),
50
+ run: function () { return __awaiter(_this, void 0, void 0, function () {
51
+ return __generator(this, function (_a) {
52
+ return [2 /*return*/, npmPackageVersion === ohPackageVersion
53
+ ? 'pass'
54
+ : {
55
+ status: 'fail',
56
+ message: "expected OH package version (".concat(ohPackageVersion, ") to match NPM version (").concat(npmPackageVersion, ")"),
57
+ }];
58
+ });
59
+ }); },
30
60
  };
31
61
  }
@@ -14,37 +14,69 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
14
14
  step((generator = generator.apply(thisArg, _arguments || [])).next());
15
15
  });
16
16
  };
17
+ var __generator = (this && this.__generator) || function (thisArg, body) {
18
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
19
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
20
+ function verb(n) { return function (v) { return step([n, v]); }; }
21
+ function step(op) {
22
+ if (f) throw new TypeError("Generator is already executing.");
23
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
24
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
25
+ if (y = 0, t) op = [op[0] & 2, t.value];
26
+ switch (op[0]) {
27
+ case 0: case 1: t = op; break;
28
+ case 4: _.label++; return { value: op[1], done: false };
29
+ case 5: _.label++; y = op[1]; op = [0]; continue;
30
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
31
+ default:
32
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
33
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
34
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
35
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
36
+ if (t[2]) _.ops.pop();
37
+ _.trys.pop(); continue;
38
+ }
39
+ op = body.call(thisArg, _);
40
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
41
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
42
+ }
43
+ };
17
44
  Object.defineProperty(exports, "__esModule", { value: true });
18
45
  exports.createOhPackageNameFollowsNamingConventionCheck = createOhPackageNameFollowsNamingConventionCheck;
19
46
  function createOhPackageNameFollowsNamingConventionCheck(npmPackageName, ohPackageName) {
20
- const npmPackageNameInfo = getPackageNameInfo(npmPackageName);
47
+ var _this = this;
48
+ var npmPackageNameInfo = getPackageNameInfo(npmPackageName);
21
49
  return {
22
50
  checkIf: 'oh_package_name_is_derived_from_npm_package_name',
23
- run: () => __awaiter(this, void 0, void 0, function* () {
24
- if (npmPackageNameInfo.organizationName) {
25
- const expectedOHPackageName = `@rnoh/${npmPackageNameInfo.organizationName}--${npmPackageNameInfo.unscopedName}`;
26
- return expectedOHPackageName === ohPackageName
27
- ? 'pass'
28
- : {
29
- status: 'fail',
30
- message: `expected '${expectedOHPackageName}', got: ${ohPackageName}`,
31
- };
32
- }
33
- else {
34
- const expectedOHPackageName = `@rnoh/${npmPackageNameInfo.unscopedName}`;
35
- return expectedOHPackageName === ohPackageName
36
- ? 'pass'
37
- : {
38
- status: 'fail',
39
- message: `expected '${expectedOHPackageName}', got: ${ohPackageName}`,
40
- };
41
- }
42
- }),
51
+ run: function () { return __awaiter(_this, void 0, void 0, function () {
52
+ var expectedOHPackageName, expectedOHPackageName;
53
+ return __generator(this, function (_a) {
54
+ if (npmPackageNameInfo.organizationName) {
55
+ expectedOHPackageName = "@rnoh/".concat(npmPackageNameInfo.organizationName, "--").concat(npmPackageNameInfo.unscopedName);
56
+ return [2 /*return*/, expectedOHPackageName === ohPackageName
57
+ ? 'pass'
58
+ : {
59
+ status: 'fail',
60
+ message: "expected '".concat(expectedOHPackageName, "', got: ").concat(ohPackageName),
61
+ }];
62
+ }
63
+ else {
64
+ expectedOHPackageName = "@rnoh/".concat(npmPackageNameInfo.unscopedName);
65
+ return [2 /*return*/, expectedOHPackageName === ohPackageName
66
+ ? 'pass'
67
+ : {
68
+ status: 'fail',
69
+ message: "expected '".concat(expectedOHPackageName, "', got: ").concat(ohPackageName),
70
+ }];
71
+ }
72
+ return [2 /*return*/];
73
+ });
74
+ }); },
43
75
  };
44
76
  }
45
77
  function getPackageNameInfo(packageName) {
46
78
  if (packageName.startsWith('@') && packageName.includes('/')) {
47
- const [part1, part2] = packageName.split('/');
79
+ var _a = packageName.split('/'), part1 = _a[0], part2 = _a[1];
48
80
  return {
49
81
  organizationName: part1.replace('@', ''),
50
82
  unscopedName: part2,