@react-native-oh/react-native-harmony-cli 0.0.30 → 0.0.37
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 +105 -10
- package/dist/autolinking/Autolinking.js +9 -11
- package/dist/codegen/core/EventUtils.js +5 -8
- package/dist/codegen/core/TypeAnnotationToTS.js +3 -3
- package/dist/codegen/core/UberSchema.js +7 -11
- package/dist/codegen/generators/AppBuildTimeGlueCodeGenerator.js +2 -1
- package/dist/codegen/generators/ArkTSComponentCodeGeneratorArkTS.js +3 -0
- package/dist/codegen/generators/ArkTSComponentCodeGeneratorCAPI.js +3 -0
- package/dist/codegen/generators/CppComponentCodeGenerator.js +3 -0
- package/dist/codegen/generators/LibGlueCodeGenerator.js +2 -2
- package/dist/codegen/templates/BasePackageHTemplate.js +12 -1
- package/dist/codegen/templates/ComponentJSIBinderHTemplate.js +15 -0
- package/dist/codegen/templates/RNOHGeneratedPackageHTemplate.js +12 -1
- package/dist/commands/bundle-harmony.js +4 -67
- package/dist/commands/codegen-harmony.js +13 -17
- package/dist/commands/codegen-lib-harmony.js +10 -14
- package/dist/commands/create-metro-host-constants.js +1 -1
- package/dist/commands/index.js +2 -1
- package/dist/commands/init.js +703 -0
- package/dist/commands/link-harmony.js +1 -1
- package/dist/commands/pack-harmony.js +1 -1
- package/dist/commands/run-harmony.js +462 -0
- package/dist/commands/types.js +8 -0
- package/dist/commands/unpack-harmony.js +2 -4
- package/dist/commands/verify-package-harmony.js +2 -2
- package/dist/core/CodegenConfig.js +4 -6
- package/dist/core/DescriptiveError.js +8 -4
- package/dist/core/PackageJSON.js +4 -7
- package/dist/core/fs.js +4 -5
- package/dist/index.js +2 -1
- package/dist/io/CliExecutor.js +57 -24
- package/dist/io/Logger.js +72 -42
- package/dist/io/TarGz.js +1 -2
- package/dist/io/__fixtures__.js +9 -3
- package/dist/io/fsUtils.js +1 -2
- package/dist/package-verifier/checks/HarmonyDirContainsOnlyHarsCheck.js +1 -2
- package/dist/package-verifier/checks/HarmonyDirExistsCheck.js +1 -2
- package/dist/package-verifier/checks/NpmAnAndOhPackageVersionsAreEqual.js +1 -2
- package/dist/package-verifier/checks/OhPackageNameFollowsNamingConventionCheck.js +1 -2
- package/dist/package-verifier/verify-package.js +7 -10
- package/dist/simulator/LaunchSimulator.js +311 -0
- package/dist/simulator/index.js +23 -0
- package/package.json +13 -6
- package/src/assetResolver.ts +117 -11
- package/src/autolinking/Autolinking.ts +10 -12
- package/src/codegen/core/EventUtils.ts +4 -6
- package/src/codegen/core/UberSchema.ts +7 -11
- package/src/codegen/generators/AppBuildTimeGlueCodeGenerator.ts +5 -1
- package/src/codegen/generators/ArkTSComponentCodeGeneratorArkTS.ts +3 -0
- package/src/codegen/generators/ArkTSComponentCodeGeneratorCAPI.ts +3 -0
- package/src/codegen/generators/CppComponentCodeGenerator.ts +3 -0
- package/src/codegen/generators/LibGlueCodeGenerator.ts +2 -2
- package/src/codegen/templates/BasePackageHTemplate.ts +13 -1
- package/src/codegen/templates/ComponentJSIBinderHTemplate.ts +24 -1
- package/src/codegen/templates/RNOHGeneratedPackageHTemplate.ts +13 -1
- package/src/commands/bundle-harmony.ts +6 -81
- package/src/commands/codegen-harmony.ts +14 -19
- package/src/commands/codegen-lib-harmony.ts +11 -16
- package/src/commands/create-metro-host-constants.ts +2 -2
- package/src/commands/index.ts +2 -1
- package/src/commands/init.ts +755 -0
- package/src/commands/link-harmony.ts +2 -2
- package/src/commands/pack-harmony.ts +2 -2
- package/src/commands/run-harmony.ts +506 -0
- package/src/commands/types.ts +21 -0
- package/src/commands/unpack-harmony.ts +3 -5
- package/src/commands/verify-package-harmony.ts +3 -3
- package/src/core/CodegenConfig.ts +4 -6
- package/src/core/DescriptiveError.ts +9 -9
- package/src/core/PackageJSON.ts +5 -8
- package/src/core/fs.ts +2 -2
- package/src/index.ts +5 -3
- package/src/io/CliExecutor.ts +56 -34
- package/src/io/Logger.ts +78 -45
- package/src/io/__fixtures__.ts +15 -11
- package/src/package-verifier/verify-package.ts +5 -7
- package/src/simulator/LaunchSimulator.ts +352 -0
- package/src/simulator/index.ts +8 -0
package/dist/io/CliExecutor.js
CHANGED
|
@@ -1,35 +1,68 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/**
|
|
3
|
-
* Copyright (c) 2024 Huawei Technologies Co., Ltd.
|
|
3
|
+
* Copyright (c) 2024-2025 Huawei Technologies Co., Ltd.
|
|
4
4
|
*
|
|
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 __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
9
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
10
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
11
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
12
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
13
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
14
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
15
|
+
});
|
|
16
|
+
};
|
|
8
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.CliExecutor = void 0;
|
|
18
|
+
exports.RealCliExecutor = exports.CliExecutor = void 0;
|
|
19
|
+
const node_child_process_1 = require("node:child_process");
|
|
10
20
|
class CliExecutor {
|
|
11
|
-
stringifyCliArgs(args) {
|
|
12
|
-
return Object.entries(args)
|
|
13
|
-
.filter(([_, value]) => {
|
|
14
|
-
if (typeof value === 'boolean') {
|
|
15
|
-
return value;
|
|
16
|
-
}
|
|
17
|
-
return value !== undefined && value !== null;
|
|
18
|
-
})
|
|
19
|
-
.map(([key, value]) => {
|
|
20
|
-
const formattedKey = toKebabCase(key);
|
|
21
|
-
if (typeof value === 'boolean') {
|
|
22
|
-
return `--${formattedKey}`;
|
|
23
|
-
}
|
|
24
|
-
return `--${formattedKey} ${value}`;
|
|
25
|
-
})
|
|
26
|
-
.join(' ');
|
|
27
|
-
}
|
|
28
21
|
}
|
|
29
22
|
exports.CliExecutor = CliExecutor;
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
23
|
+
class RealCliExecutor extends CliExecutor {
|
|
24
|
+
run(command, options) {
|
|
25
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
26
|
+
return new Promise((resolve, reject) => {
|
|
27
|
+
var _a, _b;
|
|
28
|
+
let commandWithArgs = command;
|
|
29
|
+
let argStrings = [];
|
|
30
|
+
if (options === null || options === void 0 ? void 0 : options.args) {
|
|
31
|
+
argStrings = options.args;
|
|
32
|
+
commandWithArgs += ' ' + argStrings.join(' ');
|
|
33
|
+
}
|
|
34
|
+
(_a = options === null || options === void 0 ? void 0 : options.onArgsStringified) === null || _a === void 0 ? void 0 : _a.call(options, commandWithArgs);
|
|
35
|
+
const process = (0, node_child_process_1.spawn)(command, argStrings, {
|
|
36
|
+
cwd: (_b = options === null || options === void 0 ? void 0 : options.cwd) === null || _b === void 0 ? void 0 : _b.toString(),
|
|
37
|
+
shell: (options === null || options === void 0 ? void 0 : options.shell) ? true : false,
|
|
38
|
+
});
|
|
39
|
+
let stdout = '';
|
|
40
|
+
let stderr = '';
|
|
41
|
+
process.stdout.on('data', (data) => {
|
|
42
|
+
var _a;
|
|
43
|
+
const output = data.toString();
|
|
44
|
+
stdout += output;
|
|
45
|
+
(_a = options === null || options === void 0 ? void 0 : options.onStdout) === null || _a === void 0 ? void 0 : _a.call(options, output);
|
|
46
|
+
});
|
|
47
|
+
process.stderr.on('data', (data) => {
|
|
48
|
+
var _a;
|
|
49
|
+
const output = data.toString();
|
|
50
|
+
stderr += output;
|
|
51
|
+
(_a = options === null || options === void 0 ? void 0 : options.onStderr) === null || _a === void 0 ? void 0 : _a.call(options, output);
|
|
52
|
+
});
|
|
53
|
+
process.on('error', (error) => {
|
|
54
|
+
reject(error);
|
|
55
|
+
});
|
|
56
|
+
process.on('close', (code) => {
|
|
57
|
+
if (code === 0) {
|
|
58
|
+
resolve(stdout);
|
|
59
|
+
}
|
|
60
|
+
else {
|
|
61
|
+
reject(new Error(`Command failed with code ${code}\nStderr: ${stderr}`));
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
});
|
|
65
|
+
});
|
|
66
|
+
}
|
|
35
67
|
}
|
|
68
|
+
exports.RealCliExecutor = RealCliExecutor;
|
package/dist/io/Logger.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/**
|
|
3
|
-
* Copyright (c) 2024 Huawei Technologies Co., Ltd.
|
|
3
|
+
* Copyright (c) 2024-2025 Huawei Technologies Co., Ltd.
|
|
4
4
|
*
|
|
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.
|
|
@@ -11,24 +11,56 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.Logger = void 0;
|
|
13
13
|
const chalk_1 = __importDefault(require("chalk"));
|
|
14
|
+
const cli_tools_1 = require("@react-native-community/cli-tools");
|
|
15
|
+
const node_process_1 = __importDefault(require("node:process"));
|
|
14
16
|
class Logger {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
17
|
+
constructor() {
|
|
18
|
+
this.loader = (0, cli_tools_1.getLoader)({
|
|
19
|
+
interval: node_process_1.default.stdout.isTTY ? undefined : 0,
|
|
20
|
+
});
|
|
21
|
+
this.logger = cli_tools_1.logger;
|
|
22
|
+
this.isLoaderActive = false;
|
|
23
|
+
}
|
|
24
|
+
start(prepareMsg) {
|
|
25
|
+
this.loader.start(prepareMsg(chalk_1.default));
|
|
26
|
+
this.isLoaderActive = true;
|
|
27
|
+
return (options) => {
|
|
28
|
+
this.isLoaderActive = false;
|
|
29
|
+
if (options === null || options === void 0 ? void 0 : options.persist) {
|
|
30
|
+
console.log({ loader: this.loader });
|
|
31
|
+
this.loader.stopAndPersist();
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
this.loader.stop();
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
info(prepareMsg) {
|
|
39
|
+
const info = (msg) => {
|
|
40
|
+
this.isLoaderActive ? this.loader.info(msg) : this.logger.info(msg);
|
|
41
|
+
};
|
|
42
|
+
info(prepareMsg(chalk_1.default));
|
|
43
|
+
}
|
|
44
|
+
succeed(prepareMsg) {
|
|
45
|
+
const succeed = (msg) => this.isLoaderActive ? this.loader.succeed(msg) : this.logger.success(msg);
|
|
46
|
+
succeed(prepareMsg(chalk_1.default));
|
|
23
47
|
}
|
|
24
48
|
warn(prepareMsg) {
|
|
25
|
-
|
|
49
|
+
const warn = (msg) => this.isLoaderActive ? this.loader.warn(msg) : this.logger.warn(msg);
|
|
50
|
+
warn(prepareMsg(chalk_1.default));
|
|
26
51
|
}
|
|
27
52
|
debug(prepareMsg) {
|
|
28
|
-
|
|
53
|
+
if (this.isLoaderActive) {
|
|
54
|
+
clearLine(node_process_1.default.stdout);
|
|
55
|
+
moveCursor(node_process_1.default.stdout, 0);
|
|
56
|
+
console.debug(prepareMsg(chalk_1.default));
|
|
57
|
+
this.loader.render();
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
console.debug(prepareMsg(chalk_1.default));
|
|
61
|
+
}
|
|
29
62
|
}
|
|
30
63
|
descriptiveError(error) {
|
|
31
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
32
64
|
const lines = [];
|
|
33
65
|
if (error.isUnexpected() && error.stack) {
|
|
34
66
|
lines.push('');
|
|
@@ -42,39 +74,37 @@ class Logger {
|
|
|
42
74
|
details.split('\n').forEach((line) => lines.push(line));
|
|
43
75
|
}
|
|
44
76
|
lines.push('');
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
77
|
+
lines.push(`${error.getMessage()}`);
|
|
78
|
+
const suggestions = error.getSuggestions();
|
|
79
|
+
if (suggestions.length > 0) {
|
|
80
|
+
lines.push('');
|
|
81
|
+
lines.push(chalk_1.default.bold(`Suggestions`));
|
|
82
|
+
suggestions.forEach((suggestion) => {
|
|
83
|
+
lines.push('• ' + suggestion);
|
|
84
|
+
});
|
|
48
85
|
}
|
|
49
|
-
|
|
50
|
-
|
|
86
|
+
if (this.isLoaderActive) {
|
|
87
|
+
this.loader.fail(lines.join('\n').trim());
|
|
51
88
|
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
if (suggestionsByRole) {
|
|
55
|
-
if (((_b = (_a = suggestionsByRole.default) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0) > 0) {
|
|
56
|
-
lines.push('');
|
|
57
|
-
lines.push(chalk_1.default.bold(`Suggestions`));
|
|
58
|
-
(_c = suggestionsByRole.default) === null || _c === void 0 ? void 0 : _c.forEach((suggestion) => {
|
|
59
|
-
lines.push(suggestion);
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
if (((_e = (_d = suggestionsByRole.rnAppDeveloper) === null || _d === void 0 ? void 0 : _d.length) !== null && _e !== void 0 ? _e : 0) > 0) {
|
|
63
|
-
lines.push('');
|
|
64
|
-
lines.push(chalk_1.default.bold(`Suggestions for RN App developers`));
|
|
65
|
-
(_f = suggestionsByRole.rnAppDeveloper) === null || _f === void 0 ? void 0 : _f.forEach((suggestion) => {
|
|
66
|
-
lines.push(suggestion);
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
if ((_h = (_g = suggestionsByRole.rnPackageDeveloper) === null || _g === void 0 ? void 0 : _g.length) !== null && _h !== void 0 ? _h : 0) {
|
|
70
|
-
lines.push('');
|
|
71
|
-
lines.push(chalk_1.default.bold(`Suggestions for RN package developers`));
|
|
72
|
-
(_j = suggestionsByRole.rnPackageDeveloper) === null || _j === void 0 ? void 0 : _j.forEach((suggestion) => {
|
|
73
|
-
lines.push(suggestion);
|
|
74
|
-
});
|
|
75
|
-
}
|
|
89
|
+
else {
|
|
90
|
+
this.logger.error(lines.join('\n').trim());
|
|
76
91
|
}
|
|
77
|
-
console.error(lines.join('\n'));
|
|
78
92
|
}
|
|
79
93
|
}
|
|
80
94
|
exports.Logger = Logger;
|
|
95
|
+
const clearLine = (stream) => {
|
|
96
|
+
if (stream.clearLine) {
|
|
97
|
+
stream.clearLine(0);
|
|
98
|
+
}
|
|
99
|
+
else {
|
|
100
|
+
node_process_1.default.stdout.write('\r' + ' '.repeat(node_process_1.default.stdout.columns || 80) + '\r');
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
const moveCursor = (stream, x) => {
|
|
104
|
+
if (stream.cursorTo) {
|
|
105
|
+
stream.cursorTo(x);
|
|
106
|
+
}
|
|
107
|
+
else {
|
|
108
|
+
node_process_1.default.stdout.write('\r');
|
|
109
|
+
}
|
|
110
|
+
};
|
package/dist/io/TarGz.js
CHANGED
|
@@ -9,7 +9,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
9
9
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.unpackTarGz =
|
|
12
|
+
exports.unpackTarGz = unpackTarGz;
|
|
13
13
|
const node_fs_1 = __importDefault(require("node:fs"));
|
|
14
14
|
const zlib_1 = __importDefault(require("zlib"));
|
|
15
15
|
const tar_1 = __importDefault(require("tar"));
|
|
@@ -31,4 +31,3 @@ function unpackTarGz(archivePath, outputDirPath) {
|
|
|
31
31
|
});
|
|
32
32
|
});
|
|
33
33
|
}
|
|
34
|
-
exports.unpackTarGz = unpackTarGz;
|
package/dist/io/__fixtures__.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/**
|
|
3
|
-
* Copyright (c) 2024 Huawei Technologies Co., Ltd.
|
|
3
|
+
* Copyright (c) 2024-2025 Huawei Technologies Co., Ltd.
|
|
4
4
|
*
|
|
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.
|
|
@@ -31,10 +31,10 @@ class FakeCliExecutor extends CliExecutor_1.CliExecutor {
|
|
|
31
31
|
this.onRun = onRun;
|
|
32
32
|
this.commands = [];
|
|
33
33
|
}
|
|
34
|
-
run(command, options
|
|
34
|
+
run(command, options) {
|
|
35
35
|
let commandWithArgs = command;
|
|
36
36
|
if (options.args) {
|
|
37
|
-
commandWithArgs += ' '
|
|
37
|
+
commandWithArgs += options.args.join(' ');
|
|
38
38
|
}
|
|
39
39
|
this.commands.push(commandWithArgs);
|
|
40
40
|
return this.onRun(commandWithArgs);
|
|
@@ -52,9 +52,15 @@ class MemFSDirent extends core_1.Dirent {
|
|
|
52
52
|
isDirectory() {
|
|
53
53
|
return this.rawDirent.isDirectory();
|
|
54
54
|
}
|
|
55
|
+
isSymbolicLink() {
|
|
56
|
+
return false;
|
|
57
|
+
}
|
|
55
58
|
get name() {
|
|
56
59
|
return this.rawDirent.name.toString();
|
|
57
60
|
}
|
|
61
|
+
get path() {
|
|
62
|
+
return new core_1.AbsolutePath(this.rawDirent.path).copyWithNewSegment(this.rawDirent.name.toString());
|
|
63
|
+
}
|
|
58
64
|
}
|
|
59
65
|
class MemFS extends core_1.FS {
|
|
60
66
|
constructor(initialFileStructure) {
|
package/dist/io/fsUtils.js
CHANGED
|
@@ -9,7 +9,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
9
9
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.findFilePathsWithExtensions =
|
|
12
|
+
exports.findFilePathsWithExtensions = findFilePathsWithExtensions;
|
|
13
13
|
const node_path_1 = __importDefault(require("node:path"));
|
|
14
14
|
const Dirent_1 = __importDefault(require("memfs/lib/Dirent"));
|
|
15
15
|
const node_fs_1 = __importDefault(require("node:fs"));
|
|
@@ -34,4 +34,3 @@ function findFilePathsWithExtensions(dirPath, fileExtensions, options = {}) {
|
|
|
34
34
|
}
|
|
35
35
|
return results;
|
|
36
36
|
}
|
|
37
|
-
exports.findFilePathsWithExtensions = findFilePathsWithExtensions;
|
|
@@ -18,7 +18,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
18
18
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
19
19
|
};
|
|
20
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
-
exports.createHarmonyDirContainsOnlyHarsCheck =
|
|
21
|
+
exports.createHarmonyDirContainsOnlyHarsCheck = createHarmonyDirContainsOnlyHarsCheck;
|
|
22
22
|
const node_fs_1 = __importDefault(require("node:fs"));
|
|
23
23
|
function createHarmonyDirContainsOnlyHarsCheck(npmPackagePath, hasNpmPackageNativeCode) {
|
|
24
24
|
return {
|
|
@@ -41,4 +41,3 @@ function createHarmonyDirContainsOnlyHarsCheck(npmPackagePath, hasNpmPackageNati
|
|
|
41
41
|
}),
|
|
42
42
|
};
|
|
43
43
|
}
|
|
44
|
-
exports.createHarmonyDirContainsOnlyHarsCheck = createHarmonyDirContainsOnlyHarsCheck;
|
|
@@ -18,7 +18,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
18
18
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
19
19
|
};
|
|
20
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
-
exports.createHarmonyDirExistsCheck =
|
|
21
|
+
exports.createHarmonyDirExistsCheck = createHarmonyDirExistsCheck;
|
|
22
22
|
const node_fs_1 = __importDefault(require("node:fs"));
|
|
23
23
|
function createHarmonyDirExistsCheck(packagePath, hasNativeCode) {
|
|
24
24
|
return {
|
|
@@ -35,4 +35,3 @@ function createHarmonyDirExistsCheck(packagePath, hasNativeCode) {
|
|
|
35
35
|
}),
|
|
36
36
|
};
|
|
37
37
|
}
|
|
38
|
-
exports.createHarmonyDirExistsCheck = createHarmonyDirExistsCheck;
|
|
@@ -15,7 +15,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
15
15
|
});
|
|
16
16
|
};
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.createNpmAndOhPackageVersionsAreEqualCheck =
|
|
18
|
+
exports.createNpmAndOhPackageVersionsAreEqualCheck = createNpmAndOhPackageVersionsAreEqualCheck;
|
|
19
19
|
function createNpmAndOhPackageVersionsAreEqualCheck(npmPackageVersion, ohPackageVersion) {
|
|
20
20
|
return {
|
|
21
21
|
checkIf: 'npm_and_oh_package_versions_are_equal',
|
|
@@ -29,4 +29,3 @@ function createNpmAndOhPackageVersionsAreEqualCheck(npmPackageVersion, ohPackage
|
|
|
29
29
|
}),
|
|
30
30
|
};
|
|
31
31
|
}
|
|
32
|
-
exports.createNpmAndOhPackageVersionsAreEqualCheck = createNpmAndOhPackageVersionsAreEqualCheck;
|
|
@@ -15,7 +15,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
15
15
|
});
|
|
16
16
|
};
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.createOhPackageNameFollowsNamingConventionCheck =
|
|
18
|
+
exports.createOhPackageNameFollowsNamingConventionCheck = createOhPackageNameFollowsNamingConventionCheck;
|
|
19
19
|
function createOhPackageNameFollowsNamingConventionCheck(npmPackageName, ohPackageName) {
|
|
20
20
|
const npmPackageNameInfo = getPackageNameInfo(npmPackageName);
|
|
21
21
|
return {
|
|
@@ -42,7 +42,6 @@ function createOhPackageNameFollowsNamingConventionCheck(npmPackageName, ohPacka
|
|
|
42
42
|
}),
|
|
43
43
|
};
|
|
44
44
|
}
|
|
45
|
-
exports.createOhPackageNameFollowsNamingConventionCheck = createOhPackageNameFollowsNamingConventionCheck;
|
|
46
45
|
function getPackageNameInfo(packageName) {
|
|
47
46
|
if (packageName.startsWith('@') && packageName.includes('/')) {
|
|
48
47
|
const [part1, part2] = packageName.split('/');
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/**
|
|
3
|
-
* Copyright (c) 2024 Huawei Technologies Co., Ltd.
|
|
3
|
+
* Copyright (c) 2024-2025 Huawei Technologies Co., Ltd.
|
|
4
4
|
*
|
|
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.
|
|
@@ -21,7 +21,7 @@ var __asyncDelegator = (this && this.__asyncDelegator) || function (o) {
|
|
|
21
21
|
var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {
|
|
22
22
|
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
23
23
|
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
|
24
|
-
return i =
|
|
24
|
+
return i = Object.create((typeof AsyncIterator === "function" ? AsyncIterator : Object).prototype), verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;
|
|
25
25
|
function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }
|
|
26
26
|
function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }
|
|
27
27
|
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
|
|
@@ -34,7 +34,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
34
34
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
35
35
|
};
|
|
36
36
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
-
exports.verifyRNOHPackage =
|
|
37
|
+
exports.verifyRNOHPackage = verifyRNOHPackage;
|
|
38
38
|
const node_fs_1 = __importDefault(require("node:fs"));
|
|
39
39
|
const tmp_1 = __importDefault(require("tmp"));
|
|
40
40
|
const core_1 = require("../core");
|
|
@@ -53,12 +53,10 @@ function verifyRNOHPackage(_a) {
|
|
|
53
53
|
if (!harPath) {
|
|
54
54
|
throw new core_1.DescriptiveError({
|
|
55
55
|
whatHappened: 'Attempted to verify har but no har was found',
|
|
56
|
-
whatCanUserDo:
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
],
|
|
61
|
-
},
|
|
56
|
+
whatCanUserDo: [
|
|
57
|
+
'Run this command without --no-harmony-code flag.',
|
|
58
|
+
'Create har files by running DevEco Studio > Build > Make Module (MODULE_NAME). The har file can be later found in MODULE_NAME/build/default/outputs/default/MODULE_NAME.har. Copy that file to the PACKAGE_ROOT/harmony directory.',
|
|
59
|
+
],
|
|
62
60
|
});
|
|
63
61
|
}
|
|
64
62
|
const tmpDirPath = new core_1.AbsolutePath(tmp_1.default.dirSync().name);
|
|
@@ -76,7 +74,6 @@ function verifyRNOHPackage(_a) {
|
|
|
76
74
|
}
|
|
77
75
|
});
|
|
78
76
|
}
|
|
79
|
-
exports.verifyRNOHPackage = verifyRNOHPackage;
|
|
80
77
|
function runChecks(checks, checkNamesToSkip) {
|
|
81
78
|
return __asyncGenerator(this, arguments, function* runChecks_1() {
|
|
82
79
|
for (const { checkIf, run } of checks) {
|