@rnx-kit/cli 0.9.54 → 0.9.55
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 +5 -3
- package/coverage/clover.xml +110 -71
- package/coverage/coverage-final.json +3 -2
- package/coverage/lcov-report/index.html +43 -28
- package/coverage/lcov-report/src/bundle/index.html +15 -15
- package/coverage/lcov-report/src/bundle/kit-config.ts.html +1 -1
- package/coverage/lcov-report/src/bundle/metro.ts.html +15 -78
- package/coverage/lcov-report/src/bundle/overrides.ts.html +1 -1
- package/coverage/lcov-report/src/index.html +21 -21
- package/coverage/lcov-report/src/metro-config.ts.html +105 -129
- package/coverage/lcov-report/src/typescript/index.html +111 -0
- package/coverage/lcov-report/src/typescript/project-cache.ts.html +539 -0
- package/coverage/lcov.info +198 -126
- package/lib/bundle/metro.d.ts +1 -2
- package/lib/bundle/metro.d.ts.map +1 -1
- package/lib/bundle/metro.js +5 -17
- package/lib/bundle/metro.js.map +1 -1
- package/lib/bundle.d.ts.map +1 -1
- package/lib/bundle.js +1 -3
- package/lib/bundle.js.map +1 -1
- package/lib/metro-config.d.ts +3 -3
- package/lib/metro-config.d.ts.map +1 -1
- package/lib/metro-config.js +56 -67
- package/lib/metro-config.js.map +1 -1
- package/lib/start.d.ts.map +1 -1
- package/lib/start.js +6 -17
- package/lib/start.js.map +1 -1
- package/lib/types.d.ts +3 -4
- package/lib/types.d.ts.map +1 -1
- package/lib/typescript/project-cache.d.ts +38 -0
- package/lib/typescript/project-cache.d.ts.map +1 -0
- package/lib/typescript/project-cache.js +101 -0
- package/lib/typescript/project-cache.js.map +1 -0
- package/package.json +1 -1
- package/src/bundle/metro.ts +6 -27
- package/src/bundle.ts +1 -4
- package/src/metro-config.ts +73 -81
- package/src/start.ts +7 -26
- package/src/types.ts +3 -5
- package/src/typescript/project-cache.ts +153 -0
- package/CHANGELOG.json +0 -3289
package/coverage/lcov.info
CHANGED
|
@@ -1,113 +1,109 @@
|
|
|
1
1
|
TN:
|
|
2
2
|
SF:src/metro-config.ts
|
|
3
|
-
FN:
|
|
4
|
-
FN:
|
|
5
|
-
FN:
|
|
6
|
-
FN:
|
|
7
|
-
FN:
|
|
8
|
-
FN:
|
|
9
|
-
FN:
|
|
10
|
-
FN:
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
FNDA:
|
|
3
|
+
FN:33,createSerializerHook
|
|
4
|
+
FN:37,(anonymous_1)
|
|
5
|
+
FN:39,(anonymous_2)
|
|
6
|
+
FN:53,(anonymous_3)
|
|
7
|
+
FN:58,(anonymous_4)
|
|
8
|
+
FN:67,(anonymous_5)
|
|
9
|
+
FN:72,(anonymous_6)
|
|
10
|
+
FN:80,(anonymous_7)
|
|
11
|
+
FN:96,(anonymous_8)
|
|
12
|
+
FN:109,customizeMetroConfig
|
|
13
|
+
FNF:10
|
|
14
|
+
FNH:2
|
|
15
|
+
FNDA:6,createSerializerHook
|
|
16
|
+
FNDA:0,(anonymous_1)
|
|
17
|
+
FNDA:0,(anonymous_2)
|
|
16
18
|
FNDA:0,(anonymous_3)
|
|
17
19
|
FNDA:0,(anonymous_4)
|
|
18
20
|
FNDA:0,(anonymous_5)
|
|
19
21
|
FNDA:0,(anonymous_6)
|
|
22
|
+
FNDA:0,(anonymous_7)
|
|
23
|
+
FNDA:0,(anonymous_8)
|
|
20
24
|
FNDA:6,customizeMetroConfig
|
|
21
|
-
DA:
|
|
22
|
-
DA:
|
|
23
|
-
DA:
|
|
24
|
-
DA:
|
|
25
|
-
DA:34,0
|
|
26
|
-
DA:39,0
|
|
25
|
+
DA:34,6
|
|
26
|
+
DA:36,6
|
|
27
|
+
DA:37,6
|
|
28
|
+
DA:39,6
|
|
27
29
|
DA:40,0
|
|
30
|
+
DA:41,0
|
|
28
31
|
DA:42,0
|
|
29
|
-
DA:43,0
|
|
30
|
-
DA:44,0
|
|
31
|
-
DA:45,0
|
|
32
32
|
DA:46,0
|
|
33
|
-
DA:47,0
|
|
34
|
-
DA:48,0
|
|
35
33
|
DA:51,0
|
|
36
34
|
DA:53,0
|
|
37
35
|
DA:56,0
|
|
38
|
-
DA:57,0
|
|
39
36
|
DA:58,0
|
|
40
|
-
DA:
|
|
37
|
+
DA:61,0
|
|
38
|
+
DA:66,0
|
|
39
|
+
DA:67,0
|
|
40
|
+
DA:68,0
|
|
41
|
+
DA:69,0
|
|
41
42
|
DA:70,0
|
|
42
|
-
DA:
|
|
43
|
+
DA:72,0
|
|
43
44
|
DA:73,0
|
|
45
|
+
DA:74,0
|
|
44
46
|
DA:75,0
|
|
45
|
-
DA:78,0
|
|
46
47
|
DA:79,0
|
|
47
48
|
DA:80,0
|
|
48
49
|
DA:81,0
|
|
49
50
|
DA:82,0
|
|
50
|
-
DA:
|
|
51
|
-
DA:
|
|
52
|
-
DA:
|
|
53
|
-
DA:
|
|
54
|
-
DA:
|
|
55
|
-
DA:
|
|
56
|
-
DA:
|
|
57
|
-
DA:
|
|
58
|
-
DA:
|
|
59
|
-
DA:
|
|
60
|
-
DA:
|
|
51
|
+
DA:86,0
|
|
52
|
+
DA:88,0
|
|
53
|
+
DA:93,6
|
|
54
|
+
DA:96,2
|
|
55
|
+
DA:118,6
|
|
56
|
+
DA:120,6
|
|
57
|
+
DA:121,6
|
|
58
|
+
DA:122,1
|
|
59
|
+
DA:123,5
|
|
60
|
+
DA:124,2
|
|
61
|
+
DA:126,6
|
|
62
|
+
DA:127,1
|
|
63
|
+
DA:128,5
|
|
64
|
+
DA:129,2
|
|
61
65
|
DA:132,6
|
|
62
|
-
DA:133,
|
|
66
|
+
DA:133,1
|
|
63
67
|
DA:134,1
|
|
64
68
|
DA:135,5
|
|
65
|
-
DA:
|
|
66
|
-
DA:
|
|
67
|
-
DA:
|
|
68
|
-
DA:
|
|
69
|
-
DA:
|
|
70
|
-
DA:
|
|
71
|
-
DA:
|
|
72
|
-
DA:
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
BRDA:
|
|
80
|
-
BRDA:
|
|
81
|
-
BRDA:
|
|
82
|
-
BRDA:
|
|
83
|
-
BRDA:
|
|
84
|
-
BRDA:
|
|
85
|
-
BRDA:
|
|
86
|
-
BRDA:
|
|
87
|
-
BRDA:
|
|
88
|
-
BRDA:
|
|
89
|
-
BRDA:
|
|
90
|
-
BRDA:
|
|
91
|
-
BRDA:
|
|
92
|
-
BRDA:
|
|
93
|
-
BRDA:
|
|
94
|
-
BRDA:
|
|
95
|
-
BRDA:
|
|
96
|
-
BRDA:
|
|
97
|
-
BRDA:
|
|
98
|
-
BRDA:
|
|
99
|
-
BRDA:
|
|
100
|
-
BRDA:
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
BRDA:144,12,0,1
|
|
104
|
-
BRDA:144,12,1,5
|
|
105
|
-
BRDA:147,13,0,4
|
|
106
|
-
BRDA:147,13,1,1
|
|
107
|
-
BRDA:165,14,0,0
|
|
108
|
-
BRDA:165,14,1,6
|
|
109
|
-
BRF:30
|
|
110
|
-
BRH:13
|
|
69
|
+
DA:146,4
|
|
70
|
+
DA:150,1
|
|
71
|
+
DA:153,6
|
|
72
|
+
DA:154,6
|
|
73
|
+
DA:155,0
|
|
74
|
+
DA:156,6
|
|
75
|
+
DA:157,6
|
|
76
|
+
DA:159,6
|
|
77
|
+
LF:52
|
|
78
|
+
LH:27
|
|
79
|
+
BRDA:41,0,0,0
|
|
80
|
+
BRDA:41,0,1,0
|
|
81
|
+
BRDA:42,1,0,0
|
|
82
|
+
BRDA:42,1,1,0
|
|
83
|
+
BRDA:81,2,0,0
|
|
84
|
+
BRDA:81,2,1,0
|
|
85
|
+
BRDA:86,3,0,0
|
|
86
|
+
BRDA:86,3,1,0
|
|
87
|
+
BRDA:86,4,0,0
|
|
88
|
+
BRDA:86,4,1,0
|
|
89
|
+
BRDA:121,5,0,1
|
|
90
|
+
BRDA:121,5,1,5
|
|
91
|
+
BRDA:123,6,0,2
|
|
92
|
+
BRDA:123,6,1,3
|
|
93
|
+
BRDA:126,7,0,1
|
|
94
|
+
BRDA:126,7,1,5
|
|
95
|
+
BRDA:128,8,0,2
|
|
96
|
+
BRDA:128,8,1,3
|
|
97
|
+
BRDA:132,9,0,1
|
|
98
|
+
BRDA:132,9,1,5
|
|
99
|
+
BRDA:135,10,0,4
|
|
100
|
+
BRDA:135,10,1,1
|
|
101
|
+
BRDA:154,11,0,0
|
|
102
|
+
BRDA:154,11,1,6
|
|
103
|
+
BRDA:156,12,0,6
|
|
104
|
+
BRDA:156,12,1,0
|
|
105
|
+
BRF:26
|
|
106
|
+
BRH:14
|
|
111
107
|
end_of_record
|
|
112
108
|
TN:
|
|
113
109
|
SF:src/bundle/kit-config.ts
|
|
@@ -165,53 +161,47 @@ BRH:15
|
|
|
165
161
|
end_of_record
|
|
166
162
|
TN:
|
|
167
163
|
SF:src/bundle/metro.ts
|
|
168
|
-
FN:
|
|
169
|
-
FN:
|
|
164
|
+
FN:16,createMetroBundleArgs
|
|
165
|
+
FN:64,metroBundle
|
|
170
166
|
FNF:2
|
|
171
167
|
FNH:1
|
|
172
168
|
FNDA:15,createMetroBundleArgs
|
|
173
169
|
FNDA:0,metroBundle
|
|
170
|
+
DA:30,15
|
|
171
|
+
DA:31,15
|
|
174
172
|
DA:32,15
|
|
175
|
-
DA:
|
|
176
|
-
DA:
|
|
177
|
-
DA:
|
|
178
|
-
DA:
|
|
179
|
-
DA:
|
|
180
|
-
DA:
|
|
181
|
-
DA:
|
|
182
|
-
DA:
|
|
183
|
-
DA:
|
|
184
|
-
DA:
|
|
185
|
-
DA:
|
|
186
|
-
DA:80,0
|
|
173
|
+
DA:35,15
|
|
174
|
+
DA:36,14
|
|
175
|
+
DA:40,15
|
|
176
|
+
DA:41,15
|
|
177
|
+
DA:44,15
|
|
178
|
+
DA:68,0
|
|
179
|
+
DA:70,0
|
|
180
|
+
DA:73,0
|
|
181
|
+
DA:81,0
|
|
182
|
+
DA:84,0
|
|
183
|
+
DA:85,0
|
|
187
184
|
DA:87,0
|
|
188
|
-
DA:
|
|
189
|
-
|
|
190
|
-
DA:105,0
|
|
191
|
-
DA:106,0
|
|
192
|
-
DA:108,0
|
|
193
|
-
DA:111,0
|
|
194
|
-
LF:20
|
|
185
|
+
DA:90,0
|
|
186
|
+
LF:16
|
|
195
187
|
LH:8
|
|
196
|
-
BRDA:
|
|
197
|
-
BRDA:
|
|
198
|
-
BRDA:
|
|
199
|
-
BRDA:
|
|
200
|
-
BRDA:
|
|
201
|
-
BRDA:
|
|
202
|
-
BRDA:
|
|
203
|
-
BRDA:
|
|
204
|
-
BRDA:
|
|
205
|
-
BRDA:
|
|
206
|
-
BRDA:
|
|
207
|
-
BRDA:
|
|
208
|
-
BRDA:
|
|
209
|
-
BRDA:
|
|
210
|
-
BRDA:
|
|
211
|
-
BRDA:
|
|
212
|
-
|
|
213
|
-
BRDA:108,8,1,0
|
|
214
|
-
BRF:18
|
|
188
|
+
BRDA:30,0,0,12
|
|
189
|
+
BRDA:30,0,1,3
|
|
190
|
+
BRDA:30,1,0,15
|
|
191
|
+
BRDA:30,1,1,4
|
|
192
|
+
BRDA:35,2,0,14
|
|
193
|
+
BRDA:35,2,1,1
|
|
194
|
+
BRDA:36,3,0,14
|
|
195
|
+
BRDA:36,3,1,1
|
|
196
|
+
BRDA:40,4,0,15
|
|
197
|
+
BRDA:40,4,1,0
|
|
198
|
+
BRDA:77,5,0,0
|
|
199
|
+
BRDA:77,5,1,0
|
|
200
|
+
BRDA:85,6,0,0
|
|
201
|
+
BRDA:85,6,1,0
|
|
202
|
+
BRDA:87,7,0,0
|
|
203
|
+
BRDA:87,7,1,0
|
|
204
|
+
BRF:16
|
|
215
205
|
BRH:9
|
|
216
206
|
end_of_record
|
|
217
207
|
TN:
|
|
@@ -231,3 +221,85 @@ BRDA:49,0,1,1
|
|
|
231
221
|
BRF:2
|
|
232
222
|
BRH:2
|
|
233
223
|
end_of_record
|
|
224
|
+
TN:
|
|
225
|
+
SF:src/typescript/project-cache.ts
|
|
226
|
+
FN:51,createProjectCache
|
|
227
|
+
FN:60,findProjectRoot
|
|
228
|
+
FN:79,readTSConfig
|
|
229
|
+
FN:87,(anonymous_3)
|
|
230
|
+
FN:94,createProject
|
|
231
|
+
FN:100,(anonymous_5)
|
|
232
|
+
FN:128,getProject
|
|
233
|
+
FN:139,clearPlatform
|
|
234
|
+
FN:140,(anonymous_8)
|
|
235
|
+
FNF:9
|
|
236
|
+
FNH:1
|
|
237
|
+
FNDA:6,createProjectCache
|
|
238
|
+
FNDA:0,findProjectRoot
|
|
239
|
+
FNDA:0,readTSConfig
|
|
240
|
+
FNDA:0,(anonymous_3)
|
|
241
|
+
FNDA:0,createProject
|
|
242
|
+
FNDA:0,(anonymous_5)
|
|
243
|
+
FNDA:0,getProject
|
|
244
|
+
FNDA:0,clearPlatform
|
|
245
|
+
FNDA:0,(anonymous_8)
|
|
246
|
+
DA:54,6
|
|
247
|
+
DA:55,6
|
|
248
|
+
DA:58,6
|
|
249
|
+
DA:62,0
|
|
250
|
+
DA:63,0
|
|
251
|
+
DA:64,0
|
|
252
|
+
DA:69,0
|
|
253
|
+
DA:70,0
|
|
254
|
+
DA:71,0
|
|
255
|
+
DA:76,0
|
|
256
|
+
DA:80,0
|
|
257
|
+
DA:82,0
|
|
258
|
+
DA:83,0
|
|
259
|
+
DA:84,0
|
|
260
|
+
DA:85,0
|
|
261
|
+
DA:86,0
|
|
262
|
+
DA:87,0
|
|
263
|
+
DA:88,0
|
|
264
|
+
DA:91,0
|
|
265
|
+
DA:96,0
|
|
266
|
+
DA:100,0
|
|
267
|
+
DA:101,0
|
|
268
|
+
DA:102,0
|
|
269
|
+
DA:103,0
|
|
270
|
+
DA:104,0
|
|
271
|
+
DA:105,0
|
|
272
|
+
DA:115,0
|
|
273
|
+
DA:123,0
|
|
274
|
+
DA:125,0
|
|
275
|
+
DA:129,0
|
|
276
|
+
DA:130,0
|
|
277
|
+
DA:131,0
|
|
278
|
+
DA:133,0
|
|
279
|
+
DA:134,0
|
|
280
|
+
DA:136,0
|
|
281
|
+
DA:140,0
|
|
282
|
+
DA:141,0
|
|
283
|
+
DA:142,0
|
|
284
|
+
DA:143,0
|
|
285
|
+
DA:144,0
|
|
286
|
+
DA:149,6
|
|
287
|
+
LF:41
|
|
288
|
+
LH:4
|
|
289
|
+
BRDA:63,0,0,0
|
|
290
|
+
BRDA:63,0,1,0
|
|
291
|
+
BRDA:70,1,0,0
|
|
292
|
+
BRDA:70,1,1,0
|
|
293
|
+
BRDA:83,2,0,0
|
|
294
|
+
BRDA:83,2,1,0
|
|
295
|
+
BRDA:85,3,0,0
|
|
296
|
+
BRDA:85,3,1,0
|
|
297
|
+
BRDA:130,4,0,0
|
|
298
|
+
BRDA:130,4,1,0
|
|
299
|
+
BRDA:133,5,0,0
|
|
300
|
+
BRDA:133,5,1,0
|
|
301
|
+
BRDA:142,6,0,0
|
|
302
|
+
BRDA:142,6,1,0
|
|
303
|
+
BRF:14
|
|
304
|
+
BRH:0
|
|
305
|
+
end_of_record
|
package/lib/bundle/metro.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { BundleArgs as MetroBundleArgs } from "@rnx-kit/metro-service";
|
|
2
|
-
import { Service } from "@rnx-kit/typescript-service";
|
|
3
2
|
import type { ConfigT } from "metro-config";
|
|
4
3
|
import type { BundleConfig } from "./types";
|
|
5
4
|
/**
|
|
@@ -16,5 +15,5 @@ export declare function createMetroBundleArgs({ entryPath: entryFile, distPath,
|
|
|
16
15
|
* @param metroConfig Metro configuration
|
|
17
16
|
* @param bundleConfig Bundle configuration
|
|
18
17
|
*/
|
|
19
|
-
export declare function metroBundle(
|
|
18
|
+
export declare function metroBundle(metroConfig: ConfigT, bundleConfig: BundleConfig): Promise<void>;
|
|
20
19
|
//# sourceMappingURL=metro.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"metro.d.ts","sourceRoot":"","sources":["../../src/bundle/metro.ts"],"names":[],"mappings":"AACA,OAAO,EAAU,UAAU,IAAI,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAE/E,OAAO,
|
|
1
|
+
{"version":3,"file":"metro.d.ts","sourceRoot":"","sources":["../../src/bundle/metro.ts"],"names":[],"mappings":"AACA,OAAO,EAAU,UAAU,IAAI,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAE/E,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAG5C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAG5C;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,EACpC,SAAS,EAAE,SAAS,EACpB,QAAQ,EACR,UAAU,EAAE,UAAU,EACtB,YAAY,EACZ,cAAc,EACd,aAAa,EAAE,eAAe,EAC9B,uBAAuB,EAAE,oBAAoB,EAC7C,QAAQ,EACR,GAAG,EACH,MAAM,GACP,EAAE,YAAY,GAAG,eAAe,CA4BhC;AAED;;;;;;GAMG;AACH,wBAAsB,WAAW,CAC/B,WAAW,EAAE,OAAO,EACpB,YAAY,EAAE,YAAY,GACzB,OAAO,CAAC,IAAI,CAAC,CAwBf"}
|
package/lib/bundle/metro.js
CHANGED
|
@@ -16,8 +16,6 @@ exports.metroBundle = exports.createMetroBundleArgs = void 0;
|
|
|
16
16
|
const console_1 = require("@rnx-kit/console");
|
|
17
17
|
const metro_service_1 = require("@rnx-kit/metro-service");
|
|
18
18
|
const fs_1 = require("@rnx-kit/tools-node/fs");
|
|
19
|
-
const typescript_service_1 = require("@rnx-kit/typescript-service");
|
|
20
|
-
const chalk_1 = __importDefault(require("chalk"));
|
|
21
19
|
const path_1 = __importDefault(require("path"));
|
|
22
20
|
const metro_config_1 = require("../metro-config");
|
|
23
21
|
/**
|
|
@@ -59,23 +57,13 @@ exports.createMetroBundleArgs = createMetroBundleArgs;
|
|
|
59
57
|
* @param metroConfig Metro configuration
|
|
60
58
|
* @param bundleConfig Bundle configuration
|
|
61
59
|
*/
|
|
62
|
-
function metroBundle(
|
|
60
|
+
function metroBundle(metroConfig, bundleConfig) {
|
|
63
61
|
return __awaiter(this, void 0, void 0, function* () {
|
|
64
62
|
(0, console_1.info)(`Bundling ${bundleConfig.platform}...`);
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
(0, console_1.warn)(chalk_1.default.yellow("skipping TypeScript validation -- cannot find tsconfig.json for entry file %o"), bundleConfig.entryPath);
|
|
70
|
-
}
|
|
71
|
-
else {
|
|
72
|
-
tsprojectInfo = {
|
|
73
|
-
service: tsservice,
|
|
74
|
-
configFileName,
|
|
75
|
-
};
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
(0, metro_config_1.customizeMetroConfig)(metroConfig, bundleConfig.detectCyclicDependencies, bundleConfig.detectDuplicateDependencies, tsprojectInfo, bundleConfig.experimental_treeShake);
|
|
63
|
+
const typescriptValidationOptions = {
|
|
64
|
+
throwOnError: true,
|
|
65
|
+
};
|
|
66
|
+
(0, metro_config_1.customizeMetroConfig)(metroConfig, bundleConfig.detectCyclicDependencies, bundleConfig.detectDuplicateDependencies, bundleConfig.typescriptValidation ? typescriptValidationOptions : false, bundleConfig.experimental_treeShake);
|
|
79
67
|
const metroBundleArgs = createMetroBundleArgs(bundleConfig);
|
|
80
68
|
// ensure all output directories exist
|
|
81
69
|
(0, fs_1.createDirectory)(path_1.default.dirname(metroBundleArgs.bundleOutput));
|
package/lib/bundle/metro.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"metro.js","sourceRoot":"","sources":["../../src/bundle/metro.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,
|
|
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;AAIvD;;;;;GAKG;AACH,SAAgB,qBAAqB,CAAC,EACpC,SAAS,EAAE,SAAS,EACpB,QAAQ,EACR,UAAU,EAAE,UAAU,EACtB,YAAY,EACZ,cAAc,EACd,aAAa,EAAE,eAAe,EAC9B,uBAAuB,EAAE,oBAAoB,EAC7C,QAAQ,EACR,GAAG,EACH,MAAM,GACO;IACb,6CAA6C;IAC7C,MAAM,eAAe,GACnB,QAAQ,KAAK,KAAK,IAAI,QAAQ,KAAK,OAAO,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,QAAQ,CAAC;IACrE,MAAM,UAAU,GAAG,GAAG,YAAY,IAAI,QAAQ,IAAI,eAAe,EAAE,CAAC;IACpE,MAAM,UAAU,GAAG,cAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;IAEnD,0CAA0C;IAC1C,IAAI,GAAG,EAAE;QACP,eAAe,GAAG,eAAe,aAAf,eAAe,cAAf,eAAe,GAAI,UAAU,GAAG,MAAM,CAAC;KAC1D;IAED,gDAAgD;IAChD,IAAI,eAAe,EAAE;QACnB,eAAe,GAAG,cAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,eAAe,CAAC,CAAC;KACxD;IAED,OAAO;QACL,UAAU;QACV,SAAS;QACT,MAAM;QACN,QAAQ;QACR,GAAG;QACH,YAAY,EAAE,UAAU;QACxB,cAAc;QACd,eAAe;QACf,oBAAoB;KACrB,CAAC;AACJ,CAAC;AAvCD,sDAuCC;AAED;;;;;;GAMG;AACH,SAAsB,WAAW,CAC/B,WAAoB,EACpB,YAA0B;;QAE1B,IAAA,cAAI,EAAC,YAAY,YAAY,CAAC,QAAQ,KAAK,CAAC,CAAC;QAE7C,MAAM,2BAA2B,GAAgC;YAC/D,YAAY,EAAE,IAAI;SACnB,CAAC;QACF,IAAA,mCAAoB,EAClB,WAAW,EACX,YAAY,CAAC,wBAAwB,EACrC,YAAY,CAAC,2BAA2B,EACxC,YAAY,CAAC,oBAAoB,CAAC,CAAC,CAAC,2BAA2B,CAAC,CAAC,CAAC,KAAK,EACvE,YAAY,CAAC,sBAAsB,CACpC,CAAC;QAEF,MAAM,eAAe,GAAG,qBAAqB,CAAC,YAAY,CAAC,CAAC;QAE5D,sCAAsC;QACtC,IAAA,oBAAe,EAAC,cAAI,CAAC,OAAO,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC,CAAC;QAC5D,eAAe,CAAC,eAAe;YAC7B,IAAA,oBAAe,EAAC,cAAI,CAAC,OAAO,CAAC,eAAe,CAAC,eAAe,CAAC,CAAC,CAAC;QACjE,eAAe,CAAC,UAAU,IAAI,IAAA,oBAAe,EAAC,eAAe,CAAC,UAAU,CAAC,CAAC;QAE1E,oBAAoB;QACpB,MAAM,IAAA,sBAAM,EAAC,eAAe,EAAE,WAAW,CAAC,CAAC;IAC7C,CAAC;CAAA;AA3BD,kCA2BC"}
|
package/lib/bundle.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bundle.d.ts","sourceRoot":"","sources":["../src/bundle.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,IAAI,SAAS,EAAE,MAAM,mCAAmC,CAAC;AAC7E,OAAO,EAAE,UAAU,EAAmB,MAAM,wBAAwB,CAAC;AAErE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sCAAsC,CAAC;
|
|
1
|
+
{"version":3,"file":"bundle.d.ts","sourceRoot":"","sources":["../src/bundle.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,IAAI,SAAS,EAAE,MAAM,mCAAmC,CAAC;AAC7E,OAAO,EAAE,UAAU,EAAmB,MAAM,wBAAwB,CAAC;AAErE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sCAAsC,CAAC;AAMzE,oBAAY,gBAAgB,GAAG;IAC7B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,QAAQ,CAAC,EAAE,YAAY,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,cAAc,CAAC,EAAE,UAAU,CAAC,gBAAgB,CAAC,CAAC;IAC9C,GAAG,EAAE,OAAO,CAAC;IACb,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,wBAAsB,SAAS,CAC7B,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,EACpB,SAAS,EAAE,SAAS,EACpB,UAAU,EAAE,gBAAgB,GAC3B,OAAO,CAAC,IAAI,CAAC,CA0Bf"}
|
package/lib/bundle.js
CHANGED
|
@@ -12,7 +12,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.rnxBundle = void 0;
|
|
13
13
|
const metro_service_1 = require("@rnx-kit/metro-service");
|
|
14
14
|
const properties_1 = require("@rnx-kit/tools-language/properties");
|
|
15
|
-
const typescript_service_1 = require("@rnx-kit/typescript-service");
|
|
16
15
|
const kit_config_1 = require("./bundle/kit-config");
|
|
17
16
|
const metro_1 = require("./bundle/metro");
|
|
18
17
|
const overrides_1 = require("./bundle/overrides");
|
|
@@ -28,9 +27,8 @@ function rnxBundle(_argv, cliConfig, cliOptions) {
|
|
|
28
27
|
dev: cliOptions.dev,
|
|
29
28
|
minify: cliOptions.minify,
|
|
30
29
|
});
|
|
31
|
-
const tsservice = new typescript_service_1.Service();
|
|
32
30
|
for (const bundleConfig of bundleConfigs) {
|
|
33
|
-
yield (0, metro_1.metroBundle)(
|
|
31
|
+
yield (0, metro_1.metroBundle)(metroConfig, bundleConfig);
|
|
34
32
|
}
|
|
35
33
|
return Promise.resolve();
|
|
36
34
|
});
|
package/lib/bundle.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bundle.js","sourceRoot":"","sources":["../src/bundle.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,0DAAqE;AACrE,mEAAuE;AAEvE,
|
|
1
|
+
{"version":3,"file":"bundle.js","sourceRoot":"","sources":["../src/bundle.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,0DAAqE;AACrE,mEAAuE;AAEvE,oDAA0D;AAC1D,0CAA6C;AAC7C,kDAAmE;AAqBnE,SAAsB,SAAS,CAC7B,KAAoB,EACpB,SAAoB,EACpB,UAA4B;;QAE5B,MAAM,WAAW,GAAG,MAAM,IAAA,+BAAe,EAAC,SAAS,EAAE,UAAU,CAAC,CAAC;QAEjE,MAAM,gBAAgB,GAAG,IAAA,gCAAmB,EAC1C,UAAU,CAAC,EAAE,EACb,UAAU,CAAC,QAAQ,CACpB,CAAC;QACF,IAAI,CAAC,gBAAgB,EAAE;YACrB,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;SAC1B;QAED,IAAA,yCAA6B,EAAC,UAAU,EAAE,gBAAgB,CAAC,CAAC;QAE5D,MAAM,aAAa,GAAG,IAAA,8BAAiB,EACrC,gBAAgB,EAChB;YACE,GAAG,EAAE,UAAU,CAAC,GAAG;YACnB,MAAM,EAAE,UAAU,CAAC,MAAM;SAC1B,CACF,CAAC;QAEF,KAAK,MAAM,YAAY,IAAI,aAAa,EAAE;YACxC,MAAM,IAAA,mBAAW,EAAC,WAAW,EAAE,YAAY,CAAC,CAAC;SAC9C;QAED,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;IAC3B,CAAC;CAAA;AA9BD,8BA8BC"}
|
package/lib/metro-config.d.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { PluginOptions as CyclicDetectorOptions } from "@rnx-kit/metro-plugin-cyclic-dependencies-detector";
|
|
2
2
|
import { Options as DuplicateDetectorOptions } from "@rnx-kit/metro-plugin-duplicates-checker";
|
|
3
|
+
import type { TypeScriptValidationOptions } from "./types";
|
|
3
4
|
import type { InputConfigT } from "metro-config";
|
|
4
|
-
import type { TSProjectInfo } from "./types";
|
|
5
5
|
/**
|
|
6
6
|
* Customize the Metro configuration.
|
|
7
7
|
*
|
|
8
8
|
* @param metroConfigReadonly Metro configuration
|
|
9
9
|
* @param detectCyclicDependencies When true, cyclic dependency checking is enabled with a default set of options. Otherwise the object allows for fine-grained control over the detection process.
|
|
10
10
|
* @param detectDuplicateDependencies When true, duplicate dependency checking is enabled with a default set of options. Otherwise, the object allows for fine-grained control over the detection process.
|
|
11
|
-
* @param
|
|
11
|
+
* @param typescriptValidation When true, TypeScript type-checking is enabled with a default set of options. Otherwise, the object allows for fine-grained control over the type-checking process.
|
|
12
12
|
* @param experimental_treeShake When true, experimental tree-shaking is enabled.
|
|
13
13
|
*/
|
|
14
|
-
export declare function customizeMetroConfig(metroConfigReadonly: InputConfigT, detectCyclicDependencies: boolean | CyclicDetectorOptions, detectDuplicateDependencies: boolean | DuplicateDetectorOptions,
|
|
14
|
+
export declare function customizeMetroConfig(metroConfigReadonly: InputConfigT, detectCyclicDependencies: boolean | CyclicDetectorOptions, detectDuplicateDependencies: boolean | DuplicateDetectorOptions, typescriptValidation: boolean | TypeScriptValidationOptions, experimental_treeShake: boolean): void;
|
|
15
15
|
//# sourceMappingURL=metro-config.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"metro-config.d.ts","sourceRoot":"","sources":["../src/metro-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,aAAa,IAAI,qBAAqB,EACvC,MAAM,oDAAoD,CAAC;AAC5D,OAAO,EAEL,OAAO,IAAI,wBAAwB,EACpC,MAAM,0CAA0C,CAAC;
|
|
1
|
+
{"version":3,"file":"metro-config.d.ts","sourceRoot":"","sources":["../src/metro-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,aAAa,IAAI,qBAAqB,EACvC,MAAM,oDAAoD,CAAC;AAC5D,OAAO,EAEL,OAAO,IAAI,wBAAwB,EACpC,MAAM,0CAA0C,CAAC;AAUlD,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,SAAS,CAAC;AAG3D,OAAO,KAAK,EAAE,YAAY,EAAqB,MAAM,cAAc,CAAC;AA+EpE;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAClC,mBAAmB,EAAE,YAAY,EACjC,wBAAwB,EAAE,OAAO,GAAG,qBAAqB,EACzD,2BAA2B,EAAE,OAAO,GAAG,wBAAwB,EAC/D,oBAAoB,EAAE,OAAO,GAAG,2BAA2B,EAC3D,sBAAsB,EAAE,OAAO,GAC9B,IAAI,CA6CN"}
|
package/lib/metro-config.js
CHANGED
|
@@ -5,74 +5,58 @@ const metro_plugin_cyclic_dependencies_detector_1 = require("@rnx-kit/metro-plug
|
|
|
5
5
|
const metro_plugin_duplicates_checker_1 = require("@rnx-kit/metro-plugin-duplicates-checker");
|
|
6
6
|
const metro_serializer_1 = require("@rnx-kit/metro-serializer");
|
|
7
7
|
const metro_serializer_esbuild_1 = require("@rnx-kit/metro-serializer-esbuild");
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
function
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
const cmdLine = (0, typescript_service_1.readConfigFile)(configFileName);
|
|
24
|
-
if (!cmdLine) {
|
|
25
|
-
throw new Error(`Failed to load '${configFileName}'`);
|
|
26
|
-
}
|
|
27
|
-
else if (cmdLine.errors.length > 0) {
|
|
28
|
-
const writer = (0, typescript_service_1.createDiagnosticWriter)();
|
|
29
|
-
cmdLine.errors.forEach((e) => writer.print(e));
|
|
30
|
-
throw new Error(`Failed to load '${configFileName}'`);
|
|
31
|
-
}
|
|
32
|
-
const enhanceLanguageServiceHost = (host) => {
|
|
33
|
-
const platformExtensionNames = platform === "windows" || platform === "win32"
|
|
34
|
-
? ["win", "native"]
|
|
35
|
-
: ["native"];
|
|
36
|
-
const disableReactNativePackageSubstitution = true;
|
|
37
|
-
const traceReactNativeModuleResolutionErrors = false;
|
|
38
|
-
const traceResolutionLog = undefined;
|
|
39
|
-
(0, typescript_react_native_resolver_1.changeHostToUseReactNativeResolver)({
|
|
40
|
-
host,
|
|
41
|
-
options: cmdLine.options,
|
|
42
|
-
platform,
|
|
43
|
-
platformExtensionNames,
|
|
44
|
-
disableReactNativePackageSubstitution,
|
|
45
|
-
traceReactNativeModuleResolutionErrors,
|
|
46
|
-
traceResolutionLog,
|
|
47
|
-
});
|
|
48
|
-
};
|
|
49
|
-
tsproject = service.openProject(cmdLine, enhanceLanguageServiceHost);
|
|
50
|
-
tsproject.removeAllFiles();
|
|
51
|
-
tsprojectByPlatform.set(platform, tsproject);
|
|
52
|
-
}
|
|
53
|
-
return tsproject;
|
|
54
|
-
}
|
|
8
|
+
const project_cache_1 = require("./typescript/project-cache");
|
|
9
|
+
/**
|
|
10
|
+
* Create a hook function to be registered with Metro during serialization.
|
|
11
|
+
* Each serialization pass runs the hook which type-checks each added/updated
|
|
12
|
+
* source file.
|
|
13
|
+
*
|
|
14
|
+
* Source file in node_modules (external packages) are ignored.
|
|
15
|
+
*
|
|
16
|
+
* @param options TypeScript validation options
|
|
17
|
+
* @returns Hook function
|
|
18
|
+
*/
|
|
19
|
+
function createSerializerHook(options) {
|
|
20
|
+
const projectCache = (0, project_cache_1.createProjectCache)(options.print);
|
|
21
|
+
const patternNodeModules = /[/\\]node_modules[/\\]/;
|
|
22
|
+
const excludeNodeModules = (p) => !patternNodeModules.test(p);
|
|
55
23
|
const hook = (graph, delta) => {
|
|
56
24
|
const platform = graph.transformOptions.platform;
|
|
57
25
|
if (platform) {
|
|
58
26
|
if (delta.reset) {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
// added to the project file list. Updated files have their cached
|
|
64
|
-
// snapshot cleared, causing the file to be reloaded. Deleted files
|
|
65
|
-
// are removed from the project file list.
|
|
66
|
-
for (const module of delta.added.values()) {
|
|
67
|
-
tsproject.setFile(module.path);
|
|
27
|
+
// Metro is signaling that all cached data for this Graph should be
|
|
28
|
+
// thrown out. Each Graph is scoped to one platform, so discard all
|
|
29
|
+
// of that platform's projects.
|
|
30
|
+
projectCache.clearPlatform(platform);
|
|
68
31
|
}
|
|
69
|
-
|
|
70
|
-
|
|
32
|
+
// Filter adds, updates, and deletes coming from Metro. Do not look at
|
|
33
|
+
// anything in an external package (e.g. under node_modules).
|
|
34
|
+
const adds = Array.from(delta.added.values(), (module) => module.path).filter(excludeNodeModules);
|
|
35
|
+
const updates = Array.from(delta.modified.values(), (module) => module.path).filter(excludeNodeModules);
|
|
36
|
+
const deletes = Array.from(delta.deleted.values()).filter(excludeNodeModules);
|
|
37
|
+
// Map each file to a TypeScript project, and apply its delta operation.
|
|
38
|
+
const tsprojectsToValidate = new Set();
|
|
39
|
+
adds.concat(updates).forEach((sourceFile) => {
|
|
40
|
+
const tsproject = projectCache.getProject(sourceFile, platform);
|
|
41
|
+
tsproject.setFile(sourceFile);
|
|
42
|
+
tsprojectsToValidate.add(tsproject);
|
|
43
|
+
});
|
|
44
|
+
deletes.forEach((sourceFile) => {
|
|
45
|
+
const tsproject = projectCache.getProject(sourceFile, platform);
|
|
46
|
+
tsproject.removeFile(sourceFile);
|
|
47
|
+
tsprojectsToValidate.add(tsproject);
|
|
48
|
+
});
|
|
49
|
+
// Validate all projects which changed, printing all type errors.
|
|
50
|
+
let isValid = true;
|
|
51
|
+
tsprojectsToValidate.forEach((p) => {
|
|
52
|
+
if (!p.validate()) {
|
|
53
|
+
isValid = false;
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
if (!isValid && options.throwOnError) {
|
|
57
|
+
// Type-checking failed. Fail the Metro operation (bundling or serving).
|
|
58
|
+
throw new Error("Type validation failed");
|
|
71
59
|
}
|
|
72
|
-
for (const module of delta.deleted.values()) {
|
|
73
|
-
tsproject.removeFile(module);
|
|
74
|
-
}
|
|
75
|
-
tsproject.validate();
|
|
76
60
|
}
|
|
77
61
|
};
|
|
78
62
|
return hook;
|
|
@@ -86,10 +70,10 @@ const emptySerializerHook = (_graph, _delta) => {
|
|
|
86
70
|
* @param metroConfigReadonly Metro configuration
|
|
87
71
|
* @param detectCyclicDependencies When true, cyclic dependency checking is enabled with a default set of options. Otherwise the object allows for fine-grained control over the detection process.
|
|
88
72
|
* @param detectDuplicateDependencies When true, duplicate dependency checking is enabled with a default set of options. Otherwise, the object allows for fine-grained control over the detection process.
|
|
89
|
-
* @param
|
|
73
|
+
* @param typescriptValidation When true, TypeScript type-checking is enabled with a default set of options. Otherwise, the object allows for fine-grained control over the type-checking process.
|
|
90
74
|
* @param experimental_treeShake When true, experimental tree-shaking is enabled.
|
|
91
75
|
*/
|
|
92
|
-
function customizeMetroConfig(metroConfigReadonly, detectCyclicDependencies, detectDuplicateDependencies,
|
|
76
|
+
function customizeMetroConfig(metroConfigReadonly, detectCyclicDependencies, detectDuplicateDependencies, typescriptValidation, experimental_treeShake) {
|
|
93
77
|
// We will be making changes to the Metro configuration. Coerce from a
|
|
94
78
|
// type with readonly props to a type where the props are writeable.
|
|
95
79
|
const metroConfig = metroConfigReadonly;
|
|
@@ -126,9 +110,14 @@ function customizeMetroConfig(metroConfigReadonly, detectCyclicDependencies, det
|
|
|
126
110
|
else {
|
|
127
111
|
delete metroConfig.serializer.customSerializer;
|
|
128
112
|
}
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
113
|
+
let hook = emptySerializerHook;
|
|
114
|
+
if (typeof typescriptValidation === "object") {
|
|
115
|
+
hook = createSerializerHook(typescriptValidation);
|
|
116
|
+
}
|
|
117
|
+
else if (typescriptValidation !== false) {
|
|
118
|
+
hook = createSerializerHook({});
|
|
119
|
+
}
|
|
120
|
+
metroConfig.serializer.experimentalSerializerHook = hook;
|
|
132
121
|
}
|
|
133
122
|
exports.customizeMetroConfig = customizeMetroConfig;
|
|
134
123
|
//# sourceMappingURL=metro-config.js.map
|