@rnx-kit/cli 0.14.1 → 0.14.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.
- package/CHANGELOG.md +7 -0
- package/coverage/clover.xml +2 -2
- package/coverage/lcov-report/index.html +1 -1
- package/coverage/lcov-report/src/bundle/index.html +1 -1
- package/coverage/lcov-report/src/bundle/kit-config.ts.html +1 -1
- package/coverage/lcov-report/src/bundle/metro.ts.html +1 -1
- package/coverage/lcov-report/src/bundle/overrides.ts.html +1 -1
- package/coverage/lcov-report/src/bundler-plugin-defaults.ts.html +1 -1
- package/coverage/lcov-report/src/copy-assets.ts.html +1 -1
- package/coverage/lcov-report/src/index.html +1 -1
- package/coverage/lcov-report/src/metro-config.ts.html +1 -1
- package/coverage/lcov-report/src/typescript/index.html +1 -1
- package/coverage/lcov-report/src/typescript/project-cache.ts.html +1 -1
- package/lib/bundle/kit-config.js +6 -1
- package/lib/bundle/kit-config.js.map +1 -1
- package/lib/bundle/metro.js +15 -23
- package/lib/bundle/metro.js.map +1 -1
- package/lib/bundle.js +8 -19
- package/lib/bundle.js.map +1 -1
- package/lib/clean.js +106 -117
- package/lib/clean.js.map +1 -1
- package/lib/copy-assets.js +194 -210
- package/lib/copy-assets.js.map +1 -1
- package/lib/dep-check.js +12 -7
- package/lib/dep-check.js.map +1 -1
- package/lib/serve/kit-config.js +6 -1
- package/lib/serve/kit-config.js.map +1 -1
- package/lib/start.d.ts.map +1 -1
- package/lib/start.js +147 -152
- package/lib/start.js.map +1 -1
- package/package.json +4 -3
- package/src/start.ts +15 -14
package/CHANGELOG.md
CHANGED
package/coverage/clover.xml
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<coverage generated="
|
|
3
|
-
<project timestamp="
|
|
2
|
+
<coverage generated="1659687625445" clover="3.2.0">
|
|
3
|
+
<project timestamp="1659687625445" name="All files">
|
|
4
4
|
<metrics statements="283" coveredstatements="139" conditionals="169" coveredconditionals="81" methods="45" coveredmethods="24" elements="497" coveredelements="244" complexity="0" loc="283" ncloc="283" packages="3" files="7" classes="7"/>
|
|
5
5
|
<package name="src">
|
|
6
6
|
<metrics statements="209" coveredstatements="110" conditionals="131" coveredconditionals="61" methods="29" coveredmethods="17"/>
|
|
@@ -131,7 +131,7 @@
|
|
|
131
131
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
132
132
|
Code coverage generated by
|
|
133
133
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
134
|
-
at
|
|
134
|
+
at Fri Aug 05 2022 08:20:25 GMT+0000 (Coordinated Universal Time)
|
|
135
135
|
</div>
|
|
136
136
|
<script src="prettify.js"></script>
|
|
137
137
|
<script>
|
|
@@ -131,7 +131,7 @@
|
|
|
131
131
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
132
132
|
Code coverage generated by
|
|
133
133
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
134
|
-
at
|
|
134
|
+
at Fri Aug 05 2022 08:20:25 GMT+0000 (Coordinated Universal Time)
|
|
135
135
|
</div>
|
|
136
136
|
<script src="../../prettify.js"></script>
|
|
137
137
|
<script>
|
|
@@ -313,7 +313,7 @@ export function getCliPlatformBundleConfigs(
|
|
|
313
313
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
314
314
|
Code coverage generated by
|
|
315
315
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
316
|
-
at
|
|
316
|
+
at Fri Aug 05 2022 08:20:25 GMT+0000 (Coordinated Universal Time)
|
|
317
317
|
</div>
|
|
318
318
|
<script src="../../prettify.js"></script>
|
|
319
319
|
<script>
|
|
@@ -220,7 +220,7 @@ export async function metroBundle(
|
|
|
220
220
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
221
221
|
Code coverage generated by
|
|
222
222
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
223
|
-
at
|
|
223
|
+
at Fri Aug 05 2022 08:20:25 GMT+0000 (Coordinated Universal Time)
|
|
224
224
|
</div>
|
|
225
225
|
<script src="../../prettify.js"></script>
|
|
226
226
|
<script>
|
|
@@ -202,7 +202,7 @@ export function applyBundleConfigOverrides(
|
|
|
202
202
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
203
203
|
Code coverage generated by
|
|
204
204
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
205
|
-
at
|
|
205
|
+
at Fri Aug 05 2022 08:20:25 GMT+0000 (Coordinated Universal Time)
|
|
206
206
|
</div>
|
|
207
207
|
<script src="../../prettify.js"></script>
|
|
208
208
|
<script>
|
|
@@ -100,7 +100,7 @@ export function getDefaultBundlerPlugins(): Required<BundlerPlugins> {
|
|
|
100
100
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
101
101
|
Code coverage generated by
|
|
102
102
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
103
|
-
at
|
|
103
|
+
at Fri Aug 05 2022 08:20:25 GMT+0000 (Coordinated Universal Time)
|
|
104
104
|
</div>
|
|
105
105
|
<script src="../prettify.js"></script>
|
|
106
106
|
<script>
|
|
@@ -1765,7 +1765,7 @@ export const rnxCopyAssetsCommand = {
|
|
|
1765
1765
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
1766
1766
|
Code coverage generated by
|
|
1767
1767
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
1768
|
-
at
|
|
1768
|
+
at Fri Aug 05 2022 08:20:25 GMT+0000 (Coordinated Universal Time)
|
|
1769
1769
|
</div>
|
|
1770
1770
|
<script src="../prettify.js"></script>
|
|
1771
1771
|
<script>
|
|
@@ -131,7 +131,7 @@
|
|
|
131
131
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
132
132
|
Code coverage generated by
|
|
133
133
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
134
|
-
at
|
|
134
|
+
at Fri Aug 05 2022 08:20:25 GMT+0000 (Coordinated Universal Time)
|
|
135
135
|
</div>
|
|
136
136
|
<script src="../prettify.js"></script>
|
|
137
137
|
<script>
|
|
@@ -601,7 +601,7 @@ export function customizeMetroConfig(
|
|
|
601
601
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
602
602
|
Code coverage generated by
|
|
603
603
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
604
|
-
at
|
|
604
|
+
at Fri Aug 05 2022 08:20:25 GMT+0000 (Coordinated Universal Time)
|
|
605
605
|
</div>
|
|
606
606
|
<script src="../prettify.js"></script>
|
|
607
607
|
<script>
|
|
@@ -101,7 +101,7 @@
|
|
|
101
101
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
102
102
|
Code coverage generated by
|
|
103
103
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
104
|
-
at
|
|
104
|
+
at Fri Aug 05 2022 08:20:25 GMT+0000 (Coordinated Universal Time)
|
|
105
105
|
</div>
|
|
106
106
|
<script src="../../prettify.js"></script>
|
|
107
107
|
<script>
|
|
@@ -697,7 +697,7 @@ export function createProjectCache(
|
|
|
697
697
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
698
698
|
Code coverage generated by
|
|
699
699
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
700
|
-
at
|
|
700
|
+
at Fri Aug 05 2022 08:20:25 GMT+0000 (Coordinated Universal Time)
|
|
701
701
|
</div>
|
|
702
702
|
<script src="../../prettify.js"></script>
|
|
703
703
|
<script>
|
package/lib/bundle/kit-config.js
CHANGED
|
@@ -49,7 +49,12 @@ function getCliPlatformBundleConfigs(id, overridePlatform) {
|
|
|
49
49
|
return platforms.map((platform) => {
|
|
50
50
|
const platformBundleConfig = (0, config_1.getPlatformBundleConfig)(bundleConfig, platform);
|
|
51
51
|
// apply defaults to fill in any required props that are missing
|
|
52
|
-
return
|
|
52
|
+
return {
|
|
53
|
+
...(0, bundler_plugin_defaults_1.getDefaultBundlerPlugins)(),
|
|
54
|
+
...getDefaultBundleParameters(platform),
|
|
55
|
+
...platformBundleConfig,
|
|
56
|
+
platform,
|
|
57
|
+
};
|
|
53
58
|
});
|
|
54
59
|
}
|
|
55
60
|
exports.getCliPlatformBundleConfigs = getCliPlatformBundleConfigs;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kit-config.js","sourceRoot":"","sources":["../../src/bundle/kit-config.ts"],"names":[],"mappings":";;;AAAA,4CAIyB;AAGzB,wEAAsE;AAEtE;;;;;;GAMG;AACH,SAAgB,kBAAkB,CAChC,gBAA+B,EAC/B,eAAgC;IAEhC,IAAI,gBAAgB,EAAE;QACpB,OAAO,CAAC,gBAAgB,CAAC,CAAC;KAC3B;IACD,IAAI,eAAe,IAAI,eAAe,CAAC,MAAM,GAAG,CAAC,EAAE;QACjD,OAAO,eAAe,CAAC;KACxB;IACD,MAAM,IAAI,KAAK,CACb,6IAA6I,CAC9I,CAAC;AACJ,CAAC;AAbD,gDAaC;AAED,SAAS,0BAA0B,CAAC,QAAgB;IAClD,MAAM,SAAS,GACb,QAAQ,KAAK,KAAK,IAAI,QAAQ,KAAK,OAAO,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,QAAQ,CAAC;IAErE,OAAO;QACL,SAAS,EAAE,UAAU;QACrB,YAAY,EAAE,SAAS,QAAQ,IAAI,SAAS,EAAE;QAC9C,wBAAwB,EAAE,KAAK;KAChC,CAAC;AACJ,CAAC;AAED;;;;;;;;;;GAUG;AACH,SAAgB,2BAA2B,CACzC,EAAW,EACX,gBAA+B;IAE/B,MAAM,SAAS,GAAG,IAAA,qBAAY,GAAE,CAAC;IACjC,MAAM,iBAAiB,GAAG,SAAS;QACjC,CAAC,CAAC,IAAA,wBAAe,EAA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B,GAAG,SAAS;QACjC,CAAC,CAAC,IAAA,wBAAe,EAAC,SAAS,EAAE,EAAE,CAAC;QAChC,CAAC,CAAC,SAAS,CAAC;IACd,MAAM,YAAY,GAAG,iBAAiB,aAAjB,iBAAiB,cAAjB,iBAAiB,GAAI,EAAE,CAAC;IAE7C,MAAM,SAAS,GAAG,kBAAkB,CAAC,gBAAgB,EAAE,YAAY,CAAC,OAAO,CAAC,CAAC;IAE7E,OAAO,SAAS,CAAC,GAAG,CAA0B,CAAC,QAAQ,EAAE,EAAE;QACzD,MAAM,oBAAoB,GAAG,IAAA,gCAAuB,EAClD,YAAY,EACZ,QAAQ,CACT,CAAC;QAEF,gEAAgE;QAEhE,OAAO;YACL,GAAG,IAAA,kDAAwB,GAAE;YAC7B,GAAG,0BAA0B,CAAC,QAAQ,CAAC;YACvC,GAAG,oBAAoB;YACvB,QAAQ;SACT,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC;AA3BD,kEA2BC"}
|
package/lib/bundle/metro.js
CHANGED
|
@@ -1,13 +1,4 @@
|
|
|
1
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
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
4
|
};
|
|
@@ -29,20 +20,21 @@ const metro_config_1 = require("../metro-config");
|
|
|
29
20
|
* When `false`, warnings are disabled and the bundle is minified by default.
|
|
30
21
|
* @param minify Optionally choose whether or not the bundle is minified. When not set, minification is controlled by the `dev` property.
|
|
31
22
|
*/
|
|
32
|
-
function metroBundle(metroConfig, bundleConfig, dev, minify) {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
23
|
+
async function metroBundle(metroConfig, bundleConfig, dev, minify) {
|
|
24
|
+
(0, console_1.info)(`Bundling ${bundleConfig.platform}...`);
|
|
25
|
+
(0, metro_config_1.customizeMetroConfig)(metroConfig, bundleConfig.detectCyclicDependencies, bundleConfig.detectDuplicateDependencies, bundleConfig.typescriptValidation, bundleConfig.treeShake);
|
|
26
|
+
const metroBundleArgs = {
|
|
27
|
+
...bundleConfig,
|
|
28
|
+
dev,
|
|
29
|
+
minify,
|
|
30
|
+
};
|
|
31
|
+
// ensure all output directories exist
|
|
32
|
+
(0, fs_1.createDirectory)(path_1.default.dirname(metroBundleArgs.bundleOutput));
|
|
33
|
+
metroBundleArgs.sourcemapOutput &&
|
|
34
|
+
(0, fs_1.createDirectory)(path_1.default.dirname(metroBundleArgs.sourcemapOutput));
|
|
35
|
+
metroBundleArgs.assetsDest && (0, fs_1.createDirectory)(metroBundleArgs.assetsDest);
|
|
36
|
+
// create the bundle
|
|
37
|
+
await (0, metro_service_1.bundle)(metroBundleArgs, metroConfig);
|
|
46
38
|
}
|
|
47
39
|
exports.metroBundle = metroBundle;
|
|
48
40
|
//# sourceMappingURL=metro.js.map
|
package/lib/bundle/metro.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"metro.js","sourceRoot":"","sources":["../../src/bundle/metro.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"metro.js","sourceRoot":"","sources":["../../src/bundle/metro.ts"],"names":[],"mappings":";;;;;;AAAA,8CAAwC;AACxC,0DAA+E;AAC/E,+CAAyD;AAEzD,gDAAwB;AACxB,kDAAuD;AAGvD;;;;;;;;;;GAUG;AACI,KAAK,UAAU,WAAW,CAC/B,WAAoB,EACpB,YAAqC,EACrC,GAAY,EACZ,MAAgB;IAEhB,IAAA,cAAI,EAAC,YAAY,YAAY,CAAC,QAAQ,KAAK,CAAC,CAAC;IAE7C,IAAA,mCAAoB,EAClB,WAAW,EACX,YAAY,CAAC,wBAAwB,EACrC,YAAY,CAAC,2BAA2B,EACxC,YAAY,CAAC,oBAAoB,EACjC,YAAY,CAAC,SAAS,CACvB,CAAC;IAEF,MAAM,eAAe,GAAoB;QACvC,GAAG,YAAY;QACf,GAAG;QACH,MAAM;KACP,CAAC;IAEF,sCAAsC;IACtC,IAAA,oBAAe,EAAC,cAAI,CAAC,OAAO,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC,CAAC;IAC5D,eAAe,CAAC,eAAe;QAC7B,IAAA,oBAAe,EAAC,cAAI,CAAC,OAAO,CAAC,eAAe,CAAC,eAAe,CAAC,CAAC,CAAC;IACjE,eAAe,CAAC,UAAU,IAAI,IAAA,oBAAe,EAAC,eAAe,CAAC,UAAU,CAAC,CAAC;IAE1E,oBAAoB;IACpB,MAAM,IAAA,sBAAM,EAAC,eAAe,EAAE,WAAW,CAAC,CAAC;AAC7C,CAAC;AA9BD,kCA8BC"}
|
package/lib/bundle.js
CHANGED
|
@@ -1,29 +1,18 @@
|
|
|
1
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
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
3
|
exports.rnxBundle = void 0;
|
|
13
4
|
const metro_service_1 = require("@rnx-kit/metro-service");
|
|
14
5
|
const kit_config_1 = require("./bundle/kit-config");
|
|
15
6
|
const metro_1 = require("./bundle/metro");
|
|
16
7
|
const overrides_1 = require("./bundle/overrides");
|
|
17
|
-
function rnxBundle(_argv, cliConfig, cliOptions) {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
return Promise.resolve();
|
|
26
|
-
});
|
|
8
|
+
async function rnxBundle(_argv, cliConfig, cliOptions) {
|
|
9
|
+
const metroConfig = await (0, metro_service_1.loadMetroConfig)(cliConfig, cliOptions);
|
|
10
|
+
const bundleConfigs = (0, kit_config_1.getCliPlatformBundleConfigs)(cliOptions.id, cliOptions.platform);
|
|
11
|
+
(0, overrides_1.applyBundleConfigOverrides)(cliOptions, bundleConfigs);
|
|
12
|
+
for (const bundleConfig of bundleConfigs) {
|
|
13
|
+
await (0, metro_1.metroBundle)(metroConfig, bundleConfig, cliOptions.dev, cliOptions.minify);
|
|
14
|
+
}
|
|
15
|
+
return Promise.resolve();
|
|
27
16
|
}
|
|
28
17
|
exports.rnxBundle = rnxBundle;
|
|
29
18
|
//# sourceMappingURL=bundle.js.map
|
package/lib/bundle.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bundle.js","sourceRoot":"","sources":["../src/bundle.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"bundle.js","sourceRoot":"","sources":["../src/bundle.ts"],"names":[],"mappings":";;;AAEA,0DAAqE;AAErE,oDAAkE;AAClE,0CAA6C;AAC7C,kDAAgE;AAqBzD,KAAK,UAAU,SAAS,CAC7B,KAAoB,EACpB,SAAoB,EACpB,UAA4B;IAE5B,MAAM,WAAW,GAAG,MAAM,IAAA,+BAAe,EAAC,SAAS,EAAE,UAAU,CAAC,CAAC;IAEjE,MAAM,aAAa,GAAG,IAAA,wCAA2B,EAC/C,UAAU,CAAC,EAAE,EACb,UAAU,CAAC,QAAQ,CACpB,CAAC;IAEF,IAAA,sCAA0B,EAAC,UAAU,EAAE,aAAa,CAAC,CAAC;IAEtD,KAAK,MAAM,YAAY,IAAI,aAAa,EAAE;QACxC,MAAM,IAAA,mBAAW,EACf,WAAW,EACX,YAAY,EACZ,UAAU,CAAC,GAAG,EACd,UAAU,CAAC,MAAM,CAClB,CAAC;KACH;IAED,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;AAC3B,CAAC;AAxBD,8BAwBC"}
|
package/lib/clean.js
CHANGED
|
@@ -22,15 +22,6 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
22
22
|
__setModuleDefault(result, mod);
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
28
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
29
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
30
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
31
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
32
|
-
});
|
|
33
|
-
};
|
|
34
25
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
35
26
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
36
27
|
};
|
|
@@ -41,117 +32,115 @@ const fs = __importStar(require("fs-extra"));
|
|
|
41
32
|
const ora_1 = __importDefault(require("ora"));
|
|
42
33
|
const os = __importStar(require("os"));
|
|
43
34
|
const path = __importStar(require("path"));
|
|
44
|
-
function rnxClean(_argv, _config, cliOptions) {
|
|
35
|
+
async function rnxClean(_argv, _config, cliOptions) {
|
|
45
36
|
var _a, _b, _c;
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
}
|
|
77
|
-
},
|
|
78
|
-
},
|
|
79
|
-
],
|
|
80
|
-
cocoapods: [
|
|
81
|
-
{
|
|
82
|
-
label: "Clean CocoaPods cache",
|
|
83
|
-
action: () => execute("pod", ["cache", "clean", "--all"], projectRoot),
|
|
84
|
-
},
|
|
85
|
-
],
|
|
86
|
-
metro: [
|
|
87
|
-
{
|
|
88
|
-
label: "Clean Metro cache",
|
|
89
|
-
action: () => cleanDir(`${os.tmpdir()}/metro-*`),
|
|
90
|
-
},
|
|
91
|
-
{
|
|
92
|
-
label: "Clean Haste cache",
|
|
93
|
-
action: () => cleanDir(`${os.tmpdir()}/haste-map-*`),
|
|
94
|
-
},
|
|
95
|
-
{
|
|
96
|
-
label: "Clean React Native cache",
|
|
97
|
-
action: () => cleanDir(`${os.tmpdir()}/react-*`),
|
|
98
|
-
},
|
|
99
|
-
],
|
|
100
|
-
npm: [
|
|
101
|
-
{
|
|
102
|
-
label: "Remove node_modules",
|
|
103
|
-
action: () => cleanDir(`${projectRoot}/node_modules`),
|
|
104
|
-
},
|
|
105
|
-
...(cliOptions.verify
|
|
106
|
-
? [
|
|
107
|
-
{
|
|
108
|
-
label: "Verify npm cache",
|
|
109
|
-
action: () => execute(npm, ["cache", "verify"], projectRoot),
|
|
110
|
-
},
|
|
111
|
-
]
|
|
112
|
-
: []),
|
|
113
|
-
],
|
|
114
|
-
watchman: [
|
|
115
|
-
{
|
|
116
|
-
label: "Stop Watchman",
|
|
117
|
-
action: () => execute(os.platform() === "win32" ? "tskill" : "killall", ["watchman"], projectRoot),
|
|
118
|
-
},
|
|
119
|
-
{
|
|
120
|
-
label: "Delete Watchman cache",
|
|
121
|
-
action: () => execute("watchman", ["watch-del-all"], projectRoot),
|
|
122
|
-
},
|
|
123
|
-
],
|
|
124
|
-
yarn: [
|
|
125
|
-
{
|
|
126
|
-
label: "Clean Yarn cache",
|
|
127
|
-
action: () => execute(yarn, ["cache", "clean"], projectRoot),
|
|
37
|
+
const projectRoot = (_a = cliOptions.projectRoot) !== null && _a !== void 0 ? _a : process.cwd();
|
|
38
|
+
if (!fs.existsSync(projectRoot)) {
|
|
39
|
+
throw new Error(`Invalid path provided! ${projectRoot}`);
|
|
40
|
+
}
|
|
41
|
+
const spinner = (0, ora_1.default)();
|
|
42
|
+
try {
|
|
43
|
+
require.resolve("@react-native-community/cli-clean");
|
|
44
|
+
spinner.warn("`rnx-clean` has been upstreamed to `@react-native-community/cli`. Please use `npx react-native clean` instead.");
|
|
45
|
+
}
|
|
46
|
+
catch (_) {
|
|
47
|
+
// Ignore
|
|
48
|
+
}
|
|
49
|
+
const npm = os.platform() === "win32" ? "npm.cmd" : "npm";
|
|
50
|
+
const yarn = os.platform() === "win32" ? "yarn.cmd" : "yarn";
|
|
51
|
+
const COMMANDS = {
|
|
52
|
+
android: [
|
|
53
|
+
{
|
|
54
|
+
label: "Clean Gradle cache",
|
|
55
|
+
action: () => {
|
|
56
|
+
const candidates = os.platform() === "win32"
|
|
57
|
+
? ["android/gradlew.bat", "gradlew.bat"]
|
|
58
|
+
: ["android/gradlew", "gradlew"];
|
|
59
|
+
const gradlew = findPath(projectRoot, candidates);
|
|
60
|
+
if (gradlew) {
|
|
61
|
+
const script = path.basename(gradlew);
|
|
62
|
+
return execute(os.platform() === "win32" ? script : `./${script}`, ["clean"], path.dirname(gradlew));
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
return Promise.resolve();
|
|
66
|
+
}
|
|
128
67
|
},
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
]
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
})
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
68
|
+
},
|
|
69
|
+
],
|
|
70
|
+
cocoapods: [
|
|
71
|
+
{
|
|
72
|
+
label: "Clean CocoaPods cache",
|
|
73
|
+
action: () => execute("pod", ["cache", "clean", "--all"], projectRoot),
|
|
74
|
+
},
|
|
75
|
+
],
|
|
76
|
+
metro: [
|
|
77
|
+
{
|
|
78
|
+
label: "Clean Metro cache",
|
|
79
|
+
action: () => cleanDir(`${os.tmpdir()}/metro-*`),
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
label: "Clean Haste cache",
|
|
83
|
+
action: () => cleanDir(`${os.tmpdir()}/haste-map-*`),
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
label: "Clean React Native cache",
|
|
87
|
+
action: () => cleanDir(`${os.tmpdir()}/react-*`),
|
|
88
|
+
},
|
|
89
|
+
],
|
|
90
|
+
npm: [
|
|
91
|
+
{
|
|
92
|
+
label: "Remove node_modules",
|
|
93
|
+
action: () => cleanDir(`${projectRoot}/node_modules`),
|
|
94
|
+
},
|
|
95
|
+
...(cliOptions.verify
|
|
96
|
+
? [
|
|
97
|
+
{
|
|
98
|
+
label: "Verify npm cache",
|
|
99
|
+
action: () => execute(npm, ["cache", "verify"], projectRoot),
|
|
100
|
+
},
|
|
101
|
+
]
|
|
102
|
+
: []),
|
|
103
|
+
],
|
|
104
|
+
watchman: [
|
|
105
|
+
{
|
|
106
|
+
label: "Stop Watchman",
|
|
107
|
+
action: () => execute(os.platform() === "win32" ? "tskill" : "killall", ["watchman"], projectRoot),
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
label: "Delete Watchman cache",
|
|
111
|
+
action: () => execute("watchman", ["watch-del-all"], projectRoot),
|
|
112
|
+
},
|
|
113
|
+
],
|
|
114
|
+
yarn: [
|
|
115
|
+
{
|
|
116
|
+
label: "Clean Yarn cache",
|
|
117
|
+
action: () => execute(yarn, ["cache", "clean"], projectRoot),
|
|
118
|
+
},
|
|
119
|
+
],
|
|
120
|
+
};
|
|
121
|
+
const categories = (_c = (_b = cliOptions.include) === null || _b === void 0 ? void 0 : _b.split(",")) !== null && _c !== void 0 ? _c : [
|
|
122
|
+
"metro",
|
|
123
|
+
"npm",
|
|
124
|
+
"watchman",
|
|
125
|
+
"yarn",
|
|
126
|
+
];
|
|
127
|
+
for (const category of categories) {
|
|
128
|
+
const commands = COMMANDS[category];
|
|
129
|
+
if (!commands) {
|
|
130
|
+
spinner.warn(`Unknown category: ${category}`);
|
|
131
|
+
return;
|
|
153
132
|
}
|
|
154
|
-
|
|
133
|
+
for (const { action, label } of commands) {
|
|
134
|
+
spinner.start(label);
|
|
135
|
+
await action()
|
|
136
|
+
.then(() => {
|
|
137
|
+
spinner.succeed();
|
|
138
|
+
})
|
|
139
|
+
.catch((e) => {
|
|
140
|
+
spinner.fail(`${label} » ${e}`);
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
}
|
|
155
144
|
}
|
|
156
145
|
exports.rnxClean = rnxClean;
|
|
157
146
|
function cleanDir(path) {
|
package/lib/clean.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clean.js","sourceRoot":"","sources":["../src/clean.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"clean.js","sourceRoot":"","sources":["../src/clean.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,iDAAsC;AACtC,6CAA+B;AAC/B,8CAAsB;AACtB,uCAAyB;AACzB,2CAA6B;AAiBtB,KAAK,UAAU,QAAQ,CAC5B,KAAe,EACf,OAAkB,EAClB,UAAgB;;IAEhB,MAAM,WAAW,GAAG,MAAA,UAAU,CAAC,WAAW,mCAAI,OAAO,CAAC,GAAG,EAAE,CAAC;IAC5D,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,WAAW,CAAC,EAAE;QAC/B,MAAM,IAAI,KAAK,CAAC,0BAA0B,WAAW,EAAE,CAAC,CAAC;KAC1D;IAED,MAAM,OAAO,GAAG,IAAA,aAAG,GAAE,CAAC;IACtB,IAAI;QACF,OAAO,CAAC,OAAO,CAAC,mCAAmC,CAAC,CAAC;QACrD,OAAO,CAAC,IAAI,CACV,gHAAgH,CACjH,CAAC;KACH;IAAC,OAAO,CAAC,EAAE;QACV,SAAS;KACV;IAED,MAAM,GAAG,GAAG,EAAE,CAAC,QAAQ,EAAE,KAAK,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC;IAC1D,MAAM,IAAI,GAAG,EAAE,CAAC,QAAQ,EAAE,KAAK,OAAO,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC;IAE7D,MAAM,QAAQ,GAAe;QAC3B,OAAO,EAAE;YACP;gBACE,KAAK,EAAE,oBAAoB;gBAC3B,MAAM,EAAE,GAAG,EAAE;oBACX,MAAM,UAAU,GACd,EAAE,CAAC,QAAQ,EAAE,KAAK,OAAO;wBACvB,CAAC,CAAC,CAAC,qBAAqB,EAAE,aAAa,CAAC;wBACxC,CAAC,CAAC,CAAC,iBAAiB,EAAE,SAAS,CAAC,CAAC;oBACrC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