@rnx-kit/cli 0.10.0 → 0.11.2

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.
@@ -23,7 +23,7 @@
23
23
  <div class='clearfix'>
24
24
 
25
25
  <div class='fl pad1y space-right2'>
26
- <span class="strong">95.24% </span>
26
+ <span class="strong">95.23% </span>
27
27
  <span class="quiet">Statements</span>
28
28
  <span class='fraction'>20/21</span>
29
29
  </div>
@@ -44,7 +44,7 @@
44
44
 
45
45
 
46
46
  <div class='fl pad1y space-right2'>
47
- <span class="strong">95.24% </span>
47
+ <span class="strong">95.23% </span>
48
48
  <span class="quiet">Lines</span>
49
49
  <span class='fraction'>20/21</span>
50
50
  </div>
@@ -54,6 +54,12 @@
54
54
  <p class="quiet">
55
55
  Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
56
56
  </p>
57
+ <template id="filterTemplate">
58
+ <div class="quiet">
59
+ Filter:
60
+ <input oninput="onInput()" type="search" id="fileSearch">
61
+ </div>
62
+ </template>
57
63
  </div>
58
64
  <div class='status-line high'></div>
59
65
  <pre><table class="coverage">
@@ -360,10 +366,9 @@ export function getKitBundleConfigs(
360
366
  </div><!-- /wrapper -->
361
367
  <div class='footer quiet pad2 space-top1 center small'>
362
368
  Code coverage generated by
363
- <a href="https://istanbul.js.org/" target="_blank">istanbul</a>
364
- at Fri Jan 07 2022 09:01:02 GMT+0000 (Coordinated Universal Time)
369
+ <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
370
+ at Thu Apr 07 2022 12:18:30 GMT+0000 (Coordinated Universal Time)
365
371
  </div>
366
- </div>
367
372
  <script src="../../prettify.js"></script>
368
373
  <script>
369
374
  window.onload = function () {
@@ -54,6 +54,12 @@
54
54
  <p class="quiet">
55
55
  Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
56
56
  </p>
57
+ <template id="filterTemplate">
58
+ <div class="quiet">
59
+ Filter:
60
+ <input oninput="onInput()" type="search" id="fileSearch">
61
+ </div>
62
+ </template>
57
63
  </div>
58
64
  <div class='status-line medium'></div>
59
65
  <pre><table class="coverage">
@@ -278,7 +284,7 @@ export function createMetroBundleArgs({
278
284
  }
279
285
  &nbsp;
280
286
  // use an absolute path for the source map file
281
- <span class="missing-if-branch" title="else path not taken" >E</span>if (sourcemapOutput) {
287
+ if (sourcemapOutput) {
282
288
  sourcemapOutput = path.join(distPath, sourcemapOutput);
283
289
  }
284
290
  &nbsp;
@@ -336,10 +342,9 @@ export async function <span class="fstat-no" title="function not covered" >metro
336
342
  </div><!-- /wrapper -->
337
343
  <div class='footer quiet pad2 space-top1 center small'>
338
344
  Code coverage generated by
339
- <a href="https://istanbul.js.org/" target="_blank">istanbul</a>
340
- at Fri Jan 07 2022 09:01:02 GMT+0000 (Coordinated Universal Time)
345
+ <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
346
+ at Thu Apr 07 2022 12:18:30 GMT+0000 (Coordinated Universal Time)
341
347
  </div>
342
- </div>
343
348
  <script src="../../prettify.js"></script>
344
349
  <script>
345
350
  window.onload = function () {
@@ -54,6 +54,12 @@
54
54
  <p class="quiet">
55
55
  Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
56
56
  </p>
57
+ <template id="filterTemplate">
58
+ <div class="quiet">
59
+ Filter:
60
+ <input oninput="onInput()" type="search" id="fileSearch">
61
+ </div>
62
+ </template>
57
63
  </div>
58
64
  <div class='status-line high'></div>
59
65
  <pre><table class="coverage">
@@ -225,10 +231,9 @@ export function applyKitBundleConfigOverrides(
225
231
  </div><!-- /wrapper -->
226
232
  <div class='footer quiet pad2 space-top1 center small'>
227
233
  Code coverage generated by
228
- <a href="https://istanbul.js.org/" target="_blank">istanbul</a>
229
- at Fri Jan 07 2022 09:01:02 GMT+0000 (Coordinated Universal Time)
234
+ <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
235
+ at Thu Apr 07 2022 12:18:30 GMT+0000 (Coordinated Universal Time)
230
236
  </div>
231
- </div>
232
237
  <script src="../../prettify.js"></script>
233
238
  <script>
234
239
  window.onload = function () {
@@ -54,6 +54,12 @@
54
54
  <p class="quiet">
55
55
  Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
56
56
  </p>
57
+ <template id="filterTemplate">
58
+ <div class="quiet">
59
+ Filter:
60
+ <input oninput="onInput()" type="search" id="fileSearch">
61
+ </div>
62
+ </template>
57
63
  </div>
58
64
  <div class='status-line medium'></div>
59
65
  <div class="pad1">
@@ -94,10 +100,9 @@
94
100
  </div><!-- /wrapper -->
95
101
  <div class='footer quiet pad2 space-top1 center small'>
96
102
  Code coverage generated by
97
- <a href="https://istanbul.js.org/" target="_blank">istanbul</a>
98
- at Fri Jan 07 2022 09:01:02 GMT+0000 (Coordinated Universal Time)
103
+ <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
104
+ at Thu Apr 07 2022 12:18:30 GMT+0000 (Coordinated Universal Time)
99
105
  </div>
100
- </div>
101
106
  <script src="../prettify.js"></script>
102
107
  <script>
103
108
  window.onload = function () {
@@ -54,6 +54,12 @@
54
54
  <p class="quiet">
55
55
  Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
56
56
  </p>
57
+ <template id="filterTemplate">
58
+ <div class="quiet">
59
+ Filter:
60
+ <input oninput="onInput()" type="search" id="fileSearch">
61
+ </div>
62
+ </template>
57
63
  </div>
58
64
  <div class='status-line medium'></div>
59
65
  <pre><table class="coverage">
@@ -547,7 +553,7 @@ export function customizeMetroConfig(
547
553
  let hook = emptySerializerHook;
548
554
  <span class="missing-if-branch" title="if path not taken" >I</span>if (typeof typescriptValidation === "object") {
549
555
  <span class="cstat-no" title="statement not covered" > hook = createSerializerHook(typescriptValidation);</span>
550
- } else <span class="missing-if-branch" title="else path not taken" >E</span>if (typescriptValidation !== false) {
556
+ } else if (typescriptValidation !== false) {
551
557
  hook = createSerializerHook({});
552
558
  }
553
559
  metroConfig.serializer.experimentalSerializerHook = hook;
@@ -558,10 +564,9 @@ export function customizeMetroConfig(
558
564
  </div><!-- /wrapper -->
559
565
  <div class='footer quiet pad2 space-top1 center small'>
560
566
  Code coverage generated by
561
- <a href="https://istanbul.js.org/" target="_blank">istanbul</a>
562
- at Fri Jan 07 2022 09:01:02 GMT+0000 (Coordinated Universal Time)
567
+ <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
568
+ at Thu Apr 07 2022 12:18:30 GMT+0000 (Coordinated Universal Time)
563
569
  </div>
564
- </div>
565
570
  <script src="../prettify.js"></script>
566
571
  <script>
567
572
  window.onload = function () {
@@ -23,7 +23,7 @@
23
23
  <div class='clearfix'>
24
24
 
25
25
  <div class='fl pad1y space-right2'>
26
- <span class="strong">8.7% </span>
26
+ <span class="strong">8.69% </span>
27
27
  <span class="quiet">Statements</span>
28
28
  <span class='fraction'>4/46</span>
29
29
  </div>
@@ -54,6 +54,12 @@
54
54
  <p class="quiet">
55
55
  Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
56
56
  </p>
57
+ <template id="filterTemplate">
58
+ <div class="quiet">
59
+ Filter:
60
+ <input oninput="onInput()" type="search" id="fileSearch">
61
+ </div>
62
+ </template>
57
63
  </div>
58
64
  <div class='status-line low'></div>
59
65
  <div class="pad1">
@@ -74,10 +80,10 @@
74
80
  </thead>
75
81
  <tbody><tr>
76
82
  <td class="file low" data-value="project-cache.ts"><a href="project-cache.ts.html">project-cache.ts</a></td>
77
- <td data-value="8.7" class="pic low">
83
+ <td data-value="8.69" class="pic low">
78
84
  <div class="chart"><div class="cover-fill" style="width: 8%"></div><div class="cover-empty" style="width: 92%"></div></div>
79
85
  </td>
80
- <td data-value="8.7" class="pct low">8.7%</td>
86
+ <td data-value="8.69" class="pct low">8.69%</td>
81
87
  <td data-value="46" class="abs low">4/46</td>
82
88
  <td data-value="0" class="pct low">0%</td>
83
89
  <td data-value="14" class="abs low">0/14</td>
@@ -94,10 +100,9 @@
94
100
  </div><!-- /wrapper -->
95
101
  <div class='footer quiet pad2 space-top1 center small'>
96
102
  Code coverage generated by
97
- <a href="https://istanbul.js.org/" target="_blank">istanbul</a>
98
- at Fri Jan 07 2022 09:01:02 GMT+0000 (Coordinated Universal Time)
103
+ <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
104
+ at Thu Apr 07 2022 12:18:30 GMT+0000 (Coordinated Universal Time)
99
105
  </div>
100
- </div>
101
106
  <script src="../../prettify.js"></script>
102
107
  <script>
103
108
  window.onload = function () {
@@ -23,7 +23,7 @@
23
23
  <div class='clearfix'>
24
24
 
25
25
  <div class='fl pad1y space-right2'>
26
- <span class="strong">8.7% </span>
26
+ <span class="strong">8.69% </span>
27
27
  <span class="quiet">Statements</span>
28
28
  <span class='fraction'>4/46</span>
29
29
  </div>
@@ -54,6 +54,12 @@
54
54
  <p class="quiet">
55
55
  Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
56
56
  </p>
57
+ <template id="filterTemplate">
58
+ <div class="quiet">
59
+ Filter:
60
+ <input oninput="onInput()" type="search" id="fileSearch">
61
+ </div>
62
+ </template>
57
63
  </div>
58
64
  <div class='status-line low'></div>
59
65
  <pre><table class="coverage">
@@ -609,10 +615,9 @@ export function createProjectCache(
609
615
  </div><!-- /wrapper -->
610
616
  <div class='footer quiet pad2 space-top1 center small'>
611
617
  Code coverage generated by
612
- <a href="https://istanbul.js.org/" target="_blank">istanbul</a>
613
- at Fri Jan 07 2022 09:01:02 GMT+0000 (Coordinated Universal Time)
618
+ <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
619
+ at Thu Apr 07 2022 12:18:30 GMT+0000 (Coordinated Universal Time)
614
620
  </div>
615
- </div>
616
621
  <script src="../../prettify.js"></script>
617
622
  <script>
618
623
  window.onload = function () {
package/lib/clean.d.ts ADDED
@@ -0,0 +1,9 @@
1
+ import type { Config as CLIConfig } from "@react-native-community/cli-types";
2
+ declare type Args = {
3
+ include?: string;
4
+ projectRoot?: string;
5
+ verify?: boolean;
6
+ };
7
+ export declare function rnxClean(_argv: string[], _config: CLIConfig, cliOptions: Args): Promise<void>;
8
+ export {};
9
+ //# sourceMappingURL=clean.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"clean.d.ts","sourceRoot":"","sources":["../src/clean.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,IAAI,SAAS,EAAE,MAAM,mCAAmC,CAAC;AAQ7E,aAAK,IAAI,GAAG;IACV,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,CAAC;AAWF,wBAAsB,QAAQ,CAC5B,KAAK,EAAE,MAAM,EAAE,EACf,OAAO,EAAE,SAAS,EAClB,UAAU,EAAE,IAAI,GACf,OAAO,CAAC,IAAI,CAAC,CA4Hf"}
package/lib/clean.js ADDED
@@ -0,0 +1,177 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __importDefault = (this && this.__importDefault) || function (mod) {
12
+ return (mod && mod.__esModule) ? mod : { "default": mod };
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.rnxClean = void 0;
16
+ const child_process_1 = require("child_process");
17
+ const fs_1 = require("fs");
18
+ const promises_1 = __importDefault(require("fs/promises"));
19
+ const ora_1 = __importDefault(require("ora"));
20
+ const os_1 = __importDefault(require("os"));
21
+ const path_1 = __importDefault(require("path"));
22
+ function rnxClean(_argv, _config, cliOptions) {
23
+ var _a, _b, _c;
24
+ return __awaiter(this, void 0, void 0, function* () {
25
+ const projectRoot = (_a = cliOptions.projectRoot) !== null && _a !== void 0 ? _a : process.cwd();
26
+ if (!(0, fs_1.existsSync)(projectRoot)) {
27
+ throw new Error(`Invalid path provided! ${projectRoot}`);
28
+ }
29
+ const spinner = (0, ora_1.default)();
30
+ try {
31
+ require.resolve("@react-native-community/cli-clean");
32
+ spinner.warn("`rnx-clean` has been upstreamed to `@react-native-community/cli`. Please use `npx react-native clean` instead.");
33
+ }
34
+ catch (_) {
35
+ // Ignore
36
+ }
37
+ const npm = os_1.default.platform() === "win32" ? "npm.cmd" : "npm";
38
+ const yarn = os_1.default.platform() === "win32" ? "yarn.cmd" : "yarn";
39
+ const COMMANDS = {
40
+ android: [
41
+ {
42
+ label: "Clean Gradle cache",
43
+ action: () => {
44
+ const candidates = os_1.default.platform() === "win32"
45
+ ? ["android/gradlew.bat", "gradlew.bat"]
46
+ : ["android/gradlew", "gradlew"];
47
+ const gradlew = findPath(projectRoot, candidates);
48
+ if (gradlew) {
49
+ const script = path_1.default.basename(gradlew);
50
+ return execute(os_1.default.platform() === "win32" ? script : `./${script}`, ["clean"], path_1.default.dirname(gradlew));
51
+ }
52
+ else {
53
+ return Promise.resolve();
54
+ }
55
+ },
56
+ },
57
+ ],
58
+ cocoapods: [
59
+ {
60
+ label: "Clean CocoaPods cache",
61
+ action: () => execute("pod", ["cache", "clean", "--all"], projectRoot),
62
+ },
63
+ ],
64
+ metro: [
65
+ {
66
+ label: "Clean Metro cache",
67
+ action: () => cleanDir(`${os_1.default.tmpdir()}/metro-*`),
68
+ },
69
+ {
70
+ label: "Clean Haste cache",
71
+ action: () => cleanDir(`${os_1.default.tmpdir()}/haste-map-*`),
72
+ },
73
+ {
74
+ label: "Clean React Native cache",
75
+ action: () => cleanDir(`${os_1.default.tmpdir()}/react-*`),
76
+ },
77
+ ],
78
+ npm: [
79
+ {
80
+ label: "Remove node_modules",
81
+ action: () => cleanDir(`${projectRoot}/node_modules`),
82
+ },
83
+ ...(cliOptions.verify
84
+ ? [
85
+ {
86
+ label: "Verify npm cache",
87
+ action: () => execute(npm, ["cache", "verify"], projectRoot),
88
+ },
89
+ ]
90
+ : []),
91
+ ],
92
+ watchman: [
93
+ {
94
+ label: "Stop Watchman",
95
+ action: () => execute(os_1.default.platform() === "win32" ? "tskill" : "killall", ["watchman"], projectRoot),
96
+ },
97
+ {
98
+ label: "Delete Watchman cache",
99
+ action: () => execute("watchman", ["watch-del-all"], projectRoot),
100
+ },
101
+ ],
102
+ yarn: [
103
+ {
104
+ label: "Clean Yarn cache",
105
+ action: () => execute(yarn, ["cache", "clean"], projectRoot),
106
+ },
107
+ ],
108
+ };
109
+ const categories = (_c = (_b = cliOptions.include) === null || _b === void 0 ? void 0 : _b.split(",")) !== null && _c !== void 0 ? _c : [
110
+ "metro",
111
+ "npm",
112
+ "watchman",
113
+ "yarn",
114
+ ];
115
+ for (const category of categories) {
116
+ const commands = COMMANDS[category];
117
+ if (!commands) {
118
+ spinner.warn(`Unknown category: ${category}`);
119
+ return;
120
+ }
121
+ for (const { action, label } of commands) {
122
+ spinner.start(label);
123
+ yield action()
124
+ .then(() => {
125
+ spinner.succeed();
126
+ })
127
+ .catch((e) => {
128
+ spinner.fail(`${label} » ${e}`);
129
+ });
130
+ }
131
+ }
132
+ });
133
+ }
134
+ exports.rnxClean = rnxClean;
135
+ function cleanDir(path) {
136
+ if (!(0, fs_1.existsSync)(path)) {
137
+ return Promise.resolve();
138
+ }
139
+ return promises_1.default.rmdir(path, { maxRetries: 3, recursive: true });
140
+ }
141
+ function findPath(startPath, files) {
142
+ // TODO: Find project files via `@react-native-community/cli`
143
+ for (const file of files) {
144
+ const filename = path_1.default.resolve(startPath, file);
145
+ if ((0, fs_1.existsSync)(filename)) {
146
+ return filename;
147
+ }
148
+ }
149
+ return undefined;
150
+ }
151
+ function execute(command, args, cwd) {
152
+ return new Promise((resolve, reject) => {
153
+ const process = (0, child_process_1.spawn)(command, args, {
154
+ cwd,
155
+ stdio: ["inherit", null, null],
156
+ });
157
+ const stderr = [];
158
+ process.stderr.on("data", (data) => {
159
+ stderr.push(data);
160
+ });
161
+ process.on("close", (code, signal) => {
162
+ if (code === 0) {
163
+ resolve();
164
+ }
165
+ else if (stderr) {
166
+ reject(Buffer.concat(stderr).toString().trimEnd());
167
+ }
168
+ else if (signal) {
169
+ reject(`Failed with signal ${signal}`);
170
+ }
171
+ else {
172
+ reject(`Failed with exit code ${code}`);
173
+ }
174
+ });
175
+ });
176
+ }
177
+ //# sourceMappingURL=clean.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"clean.js","sourceRoot":"","sources":["../src/clean.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AACA,iDAAsC;AACtC,2BAA8C;AAC9C,2DAA6B;AAC7B,8CAAsB;AACtB,4CAAoB;AACpB,gDAAwB;AAiBxB,SAAsB,QAAQ,CAC5B,KAAe,EACf,OAAkB,EAClB,UAAgB;;;QAEhB,MAAM,WAAW,GAAG,MAAA,UAAU,CAAC,WAAW,mCAAI,OAAO,CAAC,GAAG,EAAE,CAAC;QAC5D,IAAI,CAAC,IAAA,eAAU,EAAC,WAAW,CAAC,EAAE;YAC5B,MAAM,IAAI,KAAK,CAAC,0BAA0B,WAAW,EAAE,CAAC,CAAC;SAC1D;QAED,MAAM,OAAO,GAAG,IAAA,aAAG,GAAE,CAAC;QACtB,IAAI;YACF,OAAO,CAAC,OAAO,CAAC,mCAAmC,CAAC,CAAC;YACrD,OAAO,CAAC,I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estCommand } from "./test";
5
5
  export { rnxWriteThirdPartyNotices } from "./write-third-party-notices";
6
6
  export { parseBoolean } from "./parsers";
7
+ export { rnxClean } from "./clean";
7
8
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACrC,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAC9D,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AACjD,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACrC,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAC9D,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AACjD,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC"}
package/lib/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.parseBoolean = exports.rnxWriteThirdPartyNotices = exports.rnxTestCommand = exports.rnxTest = exports.rnxStart = exports.rnxDepCheckCommand = exports.rnxDepCheck = exports.rnxBundle = void 0;
3
+ exports.rnxClean = exports.parseBoolean = exports.rnxWriteThirdPartyNotices = exports.rnxTestCommand = exports.rnxTest = exports.rnxStart = exports.rnxDepCheckCommand = exports.rnxDepCheck = exports.rnxBundle = void 0;
4
4
  var bundle_1 = require("./bundle");
5
5
  Object.defineProperty(exports, "rnxBundle", { enumerable: true, get: function () { return bundle_1.rnxBundle; } });
6
6
  var dep_check_1 = require("./dep-check");
@@ -15,4 +15,6 @@ var write_third_party_notices_1 = require("./write-third-party-notices");
15
15
  Object.defineProperty(exports, "rnxWriteThirdPartyNotices", { enumerable: true, get: function () { return write_third_party_notices_1.rnxWriteThirdPartyNotices; } });
16
16
  var parsers_1 = require("./parsers");
17
17
  Object.defineProperty(exports, "parseBoolean", { enumerable: true, get: function () { return parsers_1.parseBoolean; } });
18
+ var clean_1 = require("./clean");
19
+ Object.defineProperty(exports, "rnxClean", { enumerable: true, get: function () { return clean_1.rnxClean; } });
18
20
  //# sourceMappingURL=index.js.map
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,mCAAqC;AAA5B,mGAAA,SAAS,OAAA;AAClB,yCAA8D;AAArD,wGAAA,WAAW,OAAA;AAAE,+GAAA,kBAAkB,OAAA;AACxC,iCAAmC;AAA1B,iGAAA,QAAQ,OAAA;AACjB,+BAAiD;AAAxC,+FAAA,OAAO,OAAA;AAAE,sGAAA,cAAc,OAAA;AAChC,yEAAwE;AAA/D,sIAAA,yBAAyB,OAAA;AAClC,qCAAyC;AAAhC,uGAAA,YAAY,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,mCAAqC;AAA5B,mGAAA,SAAS,OAAA;AAClB,yCAA8D;AAArD,wGAAA,WAAW,OAAA;AAAE,+GAAA,kBAAkB,OAAA;AACxC,iCAAmC;AAA1B,iGAAA,QAAQ,OAAA;AACjB,+BAAiD;AAAxC,+FAAA,OAAO,OAAA;AAAE,sGAAA,cAAc,OAAA;AAChC,yEAAwE;AAA/D,sIAAA,yBAAyB,OAAA;AAClC,qCAAyC;AAAhC,uGAAA,YAAY,OAAA;AACrB,iCAAmC;AAA1B,iGAAA,QAAQ,OAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rnx-kit/cli",
3
- "version": "0.10.0",
3
+ "version": "0.11.2",
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",
6
6
  "license": "MIT",
@@ -21,7 +21,7 @@
21
21
  "dependencies": {
22
22
  "@rnx-kit/config": "^0.4.21",
23
23
  "@rnx-kit/console": "^1.0.11",
24
- "@rnx-kit/dep-check": "^1.9.5",
24
+ "@rnx-kit/dep-check": "^1.12.0",
25
25
  "@rnx-kit/metro-plugin-cyclic-dependencies-detector": "^1.0.21",
26
26
  "@rnx-kit/metro-plugin-duplicates-checker": "^1.2.15",
27
27
  "@rnx-kit/metro-serializer": "^1.0.11",
@@ -34,6 +34,7 @@
34
34
  "@rnx-kit/typescript-react-native-resolver": "^0.2.0",
35
35
  "@rnx-kit/typescript-service": "^1.5.3",
36
36
  "chalk": "^4.1.0",
37
+ "ora": "^5.4.1",
37
38
  "qrcode": "^1.5.0",
38
39
  "readline": "^1.3.0"
39
40
  },
@@ -57,6 +58,7 @@
57
58
  },
58
59
  "depcheck": {
59
60
  "ignoreMatches": [
61
+ "@react-native-community/cli-clean",
60
62
  "metro",
61
63
  "metro-config",
62
64
  "readline"
@@ -7,6 +7,7 @@ const {
7
7
  rnxDepCheckCommand,
8
8
  rnxTestCommand,
9
9
  rnxWriteThirdPartyNotices,
10
+ rnxClean,
10
11
  } = require("./lib/index");
11
12
 
12
13
  module.exports = {
@@ -228,5 +229,29 @@ module.exports = {
228
229
  },
229
230
  ],
230
231
  },
232
+ {
233
+ name: "rnx-clean",
234
+ func: rnxClean,
235
+ description: "Clears React Native project related caches",
236
+ options: [
237
+ {
238
+ name: "--include [android,cocoapods,metro,npm,watchman,yarn]",
239
+ description:
240
+ "Comma-separated flag of caches to clear, e.g. `npm,yarn`. When not specified, only non-platform specific caches are cleared.",
241
+ default: "metro,npm,watchman,yarn",
242
+ },
243
+ {
244
+ name: "--project-root <path>",
245
+ description: "Root path to your React Native project",
246
+ default: process.cwd(),
247
+ parse: (val) => path.resolve(val),
248
+ },
249
+ {
250
+ name: "--verify",
251
+ description: "Whether to verify the integrity of the cache",
252
+ default: false,
253
+ },
254
+ ],
255
+ },
231
256
  ],
232
257
  };