@react-native-oh/react-native-harmony-cli 0.77.18 → 0.77.33

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