@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.
- package/dist/assetResolver.js +74 -43
- package/dist/autolinking/Autolinking.js +179 -178
- package/dist/codegen/core/CodegenError.js +23 -3
- package/dist/codegen/core/EventUtils.js +3 -3
- package/dist/codegen/core/TypeAnnotationToTS.js +28 -24
- package/dist/codegen/core/UberSchema.js +97 -55
- package/dist/codegen/generators/AppBuildTimeGlueCodeGenerator.js +41 -28
- package/dist/codegen/generators/ArkTSComponentCodeGeneratorArkTS.js +34 -27
- package/dist/codegen/generators/ArkTSComponentCodeGeneratorCAPI.js +33 -25
- package/dist/codegen/generators/CppComponentCodeGenerator.js +28 -23
- package/dist/codegen/generators/LibGlueCodeGenerator.js +29 -26
- package/dist/codegen/generators/NativeModuleCodeGenerator.js +30 -25
- package/dist/codegen/generators/SharedComponentCodeGenerator.js +15 -15
- package/dist/codegen/generators/UberGeneratorV1.js +24 -18
- package/dist/codegen/generators/UberGeneratorV2.js +36 -28
- package/dist/codegen/templates/BaseComponentInstanceHTemplate.js +24 -50
- package/dist/codegen/templates/BasePackageHTemplate.js +21 -120
- package/dist/codegen/templates/ComponentDescriptorHTemplate.js +8 -54
- package/dist/codegen/templates/ComponentJSIBinderHTemplate.js +27 -75
- package/dist/codegen/templates/ComponentUtilsTSTemplate.js +29 -162
- package/dist/codegen/templates/IndexTSTemplate.js +17 -37
- package/dist/codegen/templates/RNOHGeneratedPackageHTemplate.js +24 -119
- package/dist/codegen/templates/TurboModuleCppTemplate.js +15 -38
- package/dist/codegen/templates/TurboModuleHTemplate.js +11 -32
- package/dist/codegen/templates/TurboModuleSpecTSTemplate.js +19 -52
- package/dist/commands/bundle-harmony.js +221 -118
- package/dist/commands/clean-harmony.js +63 -58
- package/dist/commands/codegen-harmony.js +175 -104
- package/dist/commands/codegen-lib-harmony.js +116 -76
- package/dist/commands/init-harmony.js +196 -151
- package/dist/commands/init.js +961 -537
- package/dist/commands/link-harmony.js +82 -35
- package/dist/commands/run-harmony.js +520 -352
- package/dist/commands/verify-package-harmony.js +117 -54
- package/dist/core/AbsolutePath.js +49 -33
- package/dist/core/CodegenConfig.js +22 -24
- package/dist/core/DescriptiveError.js +37 -18
- package/dist/core/FileSystem.js +18 -14
- package/dist/core/OHPackageJSON5.js +23 -17
- package/dist/core/PackageJSON.js +42 -26
- package/dist/core/ProjectDependenciesManager.js +92 -40
- package/dist/core/ValidationError.js +22 -2
- package/dist/core/fs.js +7 -10
- package/dist/index.js +1 -1
- package/dist/init/templates/AppScopeAppJSON5Template.js +8 -21
- package/dist/init/templates/AppScopeStringVarTemplate.js +8 -19
- package/dist/init/templates/EntryIndexTemplate.js +8 -56
- package/dist/init/templates/EntryStringVarTemplate.js +8 -27
- package/dist/init/templates/HvigorConfigJson5Template.js +8 -33
- package/dist/init/templates/MetroConfigTemplate.js +8 -38
- package/dist/init/templates/OhPackageJson5Template.js +8 -28
- package/dist/io/CliExecutor.js +98 -46
- package/dist/io/Logger.js +46 -40
- package/dist/io/RealFS.js +100 -43
- package/dist/io/TarGz.js +8 -11
- package/dist/io/__fixtures__.js +141 -79
- package/dist/io/fsUtils.js +12 -13
- package/dist/package-verifier/checks/HarmonyDirContainsOnlyHarsCheck.js +47 -19
- package/dist/package-verifier/checks/HarmonyDirExistsCheck.js +41 -13
- package/dist/package-verifier/checks/NpmAnAndOhPackageVersionsAreEqual.js +38 -8
- package/dist/package-verifier/checks/OhPackageNameFollowsNamingConventionCheck.js +54 -22
- package/dist/package-verifier/verify-package.js +133 -56
- package/dist/simulator/LaunchSimulator.js +395 -0
- package/dist/simulator/index.js +23 -0
- package/package.json +2 -11
- package/scripts/sync-hvigor.js +27 -0
- package/src/autolinking/Autolinking.ts +1 -1
- package/src/codegen/generators/UberGeneratorV1.ts +7 -2
- package/src/codegen/generators/UberGeneratorV2.ts +6 -1
- package/src/commands/codegen-harmony.ts +17 -7
- package/src/commands/run-harmony.ts +67 -41
- package/src/init/templates/harmony/entry/src/main/module.json5 +7 -0
- package/src/simulator/LaunchSimulator.ts +359 -0
- package/src/simulator/index.ts +8 -0
- package/dist/init/templates/harmony/AppScope/app.json5 +0 -10
- package/dist/init/templates/harmony/AppScope/resources/base/element/string.json +0 -8
- package/dist/init/templates/harmony/AppScope/resources/base/media/app_icon.png +0 -0
- package/dist/init/templates/harmony/build-profile.json5 +0 -36
- package/dist/init/templates/harmony/codelinter.json +0 -32
- package/dist/init/templates/harmony/entry/build-profile.json5 +0 -18
- package/dist/init/templates/harmony/entry/gitignore +0 -7
- package/dist/init/templates/harmony/entry/hvigorfile.ts +0 -13
- package/dist/init/templates/harmony/entry/oh-package.json5 +0 -9
- package/dist/init/templates/harmony/entry/src/main/cpp/CMakeLists.txt +0 -27
- package/dist/init/templates/harmony/entry/src/main/cpp/PackageProvider.cpp +0 -13
- package/dist/init/templates/harmony/entry/src/main/cpp/gitignore +0 -4
- package/dist/init/templates/harmony/entry/src/main/ets/PackageProvider.ets +0 -8
- package/dist/init/templates/harmony/entry/src/main/ets/codegen/gitignore +0 -2
- package/dist/init/templates/harmony/entry/src/main/ets/entryability/EntryAbility.ets +0 -11
- package/dist/init/templates/harmony/entry/src/main/ets/gitignore +0 -1
- 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 +0 -16
- package/dist/init/templates/harmony/entry/src/main/module.json5 +0 -58
- package/dist/init/templates/harmony/entry/src/main/resources/base/element/color.json +0 -8
- package/dist/init/templates/harmony/entry/src/main/resources/base/element/string.json +0 -16
- 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 +0 -7
- 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 +0 -5
- package/dist/init/templates/harmony/entry/src/main/resources/gitignore +0 -1
- package/dist/init/templates/harmony/entry/src/ohosTest/ets/test/List.test.ets +0 -2
- package/dist/init/templates/harmony/entry/src/ohosTest/module.json5 +0 -13
- package/dist/init/templates/harmony/gitignore +0 -16
- package/dist/init/templates/harmony/hvigor/hvigor-config.json5 +0 -22
- package/dist/init/templates/harmony/hvigorfile.ts +0 -7
package/dist/io/__fixtures__.js
CHANGED
|
@@ -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
|
|
12
|
-
|
|
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
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
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
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
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
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
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
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
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
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
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;
|
package/dist/io/fsUtils.js
CHANGED
|
@@ -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
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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
|
-
|
|
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
|
|
12
|
-
|
|
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
|
-
|
|
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: ()
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
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
|
|
12
|
-
|
|
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
|
-
|
|
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: ()
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
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: ()
|
|
17
|
-
return
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
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
|
-
|
|
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: ()
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
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
|
-
|
|
73
|
+
var _a = packageName.split('/'), part1 = _a[0], part2 = _a[1];
|
|
42
74
|
return {
|
|
43
75
|
organizationName: part1.replace('@', ''),
|
|
44
76
|
unscopedName: part2,
|