@rnx-kit/cli 0.18.17 → 1.0.0
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/lib/clean.js +13 -9
- package/package.json +3 -3
package/lib/clean.js
CHANGED
|
@@ -51,12 +51,10 @@ async function rnxClean(_argv, { root = process.cwd() }, cliOptions) {
|
|
|
51
51
|
}
|
|
52
52
|
const isWindows = os.platform() === "win32";
|
|
53
53
|
const execute = (command, args, cwd = root, onError) => {
|
|
54
|
+
const stdio = ["ignore", "pipe", "pipe"];
|
|
55
|
+
const shell = command.endsWith(".bat") || command.endsWith(".cmd");
|
|
54
56
|
return new Promise((resolve, reject) => {
|
|
55
|
-
const process = (0, node_child_process_1.spawn)(command, args, {
|
|
56
|
-
cwd,
|
|
57
|
-
stdio: ["ignore", "pipe", "pipe"],
|
|
58
|
-
shell: command.endsWith(".bat") || command.endsWith(".cmd"),
|
|
59
|
-
});
|
|
57
|
+
const process = (0, node_child_process_1.spawn)(command, args, { cwd, stdio, shell });
|
|
60
58
|
process.on("error", (e) => {
|
|
61
59
|
const code = "code" in e ? e.code : "errno" in e ? e.errno : "1";
|
|
62
60
|
switch (code) {
|
|
@@ -197,11 +195,17 @@ async function rnxClean(_argv, { root = process.cwd() }, cliOptions) {
|
|
|
197
195
|
}
|
|
198
196
|
}
|
|
199
197
|
}
|
|
200
|
-
function cleanDir(path) {
|
|
201
|
-
if (
|
|
202
|
-
|
|
198
|
+
async function cleanDir(path, options = { maxRetries: 3, recursive: true }) {
|
|
199
|
+
if ((0, node_fs_1.existsSync)(path)) {
|
|
200
|
+
await fs.rm(path, options);
|
|
201
|
+
}
|
|
202
|
+
else if (path.includes("*")) {
|
|
203
|
+
const promises = [];
|
|
204
|
+
for await (const file of fs.glob(path)) {
|
|
205
|
+
promises.push(fs.rm(file, options));
|
|
206
|
+
}
|
|
207
|
+
await Promise.allSettled(promises);
|
|
203
208
|
}
|
|
204
|
-
return fs.rm(path, { maxRetries: 3, recursive: true });
|
|
205
209
|
}
|
|
206
210
|
function findPath(startPath, files) {
|
|
207
211
|
// TODO: Find project files via `@react-native-community/cli`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rnx-kit/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"description": "Command-line interface for working with kit packages in your repo",
|
|
5
5
|
"homepage": "https://github.com/microsoft/rnx-kit/tree/main/packages/cli#readme",
|
|
6
6
|
"license": "MIT",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"@rnx-kit/metro-plugin-duplicates-checker": "^3.0.0",
|
|
48
48
|
"@rnx-kit/metro-plugin-typescript": "^0.5.3",
|
|
49
49
|
"@rnx-kit/metro-serializer": "^2.0.0",
|
|
50
|
-
"@rnx-kit/metro-serializer-esbuild": "^0.
|
|
50
|
+
"@rnx-kit/metro-serializer-esbuild": "^0.3.0",
|
|
51
51
|
"@rnx-kit/metro-service": "^4.1.3",
|
|
52
52
|
"@rnx-kit/third-party-notices": "^2.0.0",
|
|
53
53
|
"@rnx-kit/tools-android": "^0.2.2",
|
|
@@ -93,7 +93,7 @@
|
|
|
93
93
|
"type-fest": "^4.0.0"
|
|
94
94
|
},
|
|
95
95
|
"engines": {
|
|
96
|
-
"node": ">=
|
|
96
|
+
"node": ">=22.11"
|
|
97
97
|
},
|
|
98
98
|
"jest": {
|
|
99
99
|
"preset": "@rnx-kit/jest-preset/private"
|