@rnx-kit/cli 0.14.4 → 0.14.5
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 +9 -0
- package/README.md +18 -19
- package/coverage/clover.xml +72 -71
- package/coverage/coverage-final.json +5 -5
- package/coverage/lcov-report/index.html +18 -18
- package/coverage/lcov-report/src/{bundler-plugin-defaults.ts.html → bundle/defaultPlugins.ts.html} +10 -10
- package/coverage/lcov-report/src/bundle/index.html +23 -8
- package/coverage/lcov-report/src/bundle/kit-config.ts.html +3 -3
- package/coverage/lcov-report/src/bundle/metro.ts.html +13 -22
- package/coverage/lcov-report/src/bundle/overrides.ts.html +51 -33
- package/coverage/lcov-report/src/copy-assets.ts.html +1 -1
- package/coverage/lcov-report/src/index.html +7 -22
- package/coverage/lcov-report/src/metro-config.ts.html +20 -35
- package/coverage/lcov-report/src/typescript/index.html +1 -1
- package/coverage/lcov-report/src/typescript/project-cache.ts.html +3 -3
- package/coverage/lcov.info +121 -119
- package/lib/bundle/cliOptions.d.ts +39 -0
- package/lib/bundle/cliOptions.d.ts.map +1 -0
- package/lib/bundle/cliOptions.js +75 -0
- package/lib/bundle/cliOptions.js.map +1 -0
- package/lib/{bundler-plugin-defaults.d.ts → bundle/defaultPlugins.d.ts} +1 -1
- package/lib/bundle/defaultPlugins.d.ts.map +1 -0
- package/lib/{bundler-plugin-defaults.js → bundle/defaultPlugins.js} +1 -1
- package/lib/bundle/defaultPlugins.js.map +1 -0
- package/lib/bundle/kit-config.d.ts +1 -1
- package/lib/bundle/kit-config.d.ts.map +1 -1
- package/lib/bundle/kit-config.js +3 -3
- package/lib/bundle/kit-config.js.map +1 -1
- package/lib/bundle/metro.d.ts +3 -1
- package/lib/bundle/metro.d.ts.map +1 -1
- package/lib/bundle/metro.js +29 -8
- package/lib/bundle/metro.js.map +1 -1
- package/lib/bundle/overrides.d.ts +5 -14
- package/lib/bundle/overrides.d.ts.map +1 -1
- package/lib/bundle/overrides.js +14 -13
- package/lib/bundle/overrides.js.map +1 -1
- package/lib/bundle/types.d.ts +18 -0
- package/lib/bundle/types.d.ts.map +1 -1
- package/lib/bundle.d.ts +45 -19
- package/lib/bundle.d.ts.map +1 -1
- package/lib/bundle.js +20 -3
- package/lib/bundle.js.map +1 -1
- package/lib/index.d.ts +4 -3
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +10 -6
- package/lib/index.js.map +1 -1
- package/lib/metro-config.d.ts +3 -8
- package/lib/metro-config.d.ts.map +1 -1
- package/lib/metro-config.js +2 -5
- package/lib/metro-config.js.map +1 -1
- package/lib/ram-bundle.d.ts +49 -0
- package/lib/ram-bundle.d.ts.map +1 -0
- package/lib/ram-bundle.js +47 -0
- package/lib/ram-bundle.js.map +1 -0
- package/lib/serve/kit-config.js +2 -2
- package/lib/serve/kit-config.js.map +1 -1
- package/lib/start.d.ts.map +1 -1
- package/lib/start.js +28 -5
- package/lib/start.js.map +1 -1
- package/lib/typescript/project-cache.js +28 -5
- package/lib/typescript/project-cache.js.map +1 -1
- package/package.json +3 -3
- package/react-native.config.js +4 -96
- package/src/bundle/cliOptions.ts +82 -0
- package/src/{bundler-plugin-defaults.ts → bundle/defaultPlugins.ts} +0 -0
- package/src/bundle/kit-config.ts +2 -2
- package/src/bundle/metro.ts +8 -11
- package/src/bundle/overrides.ts +31 -25
- package/src/bundle/types.ts +19 -0
- package/src/bundle.ts +29 -23
- package/src/index.ts +4 -3
- package/src/metro-config.ts +18 -23
- package/src/ram-bundle.ts +78 -0
- package/src/serve/kit-config.ts +1 -1
- package/src/start.ts +5 -12
- package/src/typescript/project-cache.ts +2 -2
- package/test/bundle/overrides.test.ts +25 -14
- package/test/metro-config.test.ts +33 -45
- package/lib/bundler-plugin-defaults.d.ts.map +0 -1
- package/lib/bundler-plugin-defaults.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# Change Log - @rnx-kit/cli
|
|
2
2
|
|
|
3
|
+
## 0.14.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- d7150595: Add support for "Random Access Module" bundle format
|
|
8
|
+
- Updated dependencies [d7150595]
|
|
9
|
+
- @rnx-kit/config@0.5.2
|
|
10
|
+
- @rnx-kit/metro-service@3.0.2
|
|
11
|
+
|
|
3
12
|
## 0.14.4
|
|
4
13
|
|
|
5
14
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -87,23 +87,23 @@ dependencies.
|
|
|
87
87
|
|
|
88
88
|
### Command-Line Overrides
|
|
89
89
|
|
|
90
|
-
| Override
|
|
91
|
-
|
|
|
92
|
-
| --id [id]
|
|
93
|
-
| --entry-file [file]
|
|
94
|
-
| --platform [`ios`
|
|
95
|
-
| --dev [boolean]
|
|
96
|
-
| --minify [boolean]
|
|
97
|
-
| --bundle-output [path]
|
|
98
|
-
| --bundle-encoding [`utf8`
|
|
99
|
-
| --max-workers [number]
|
|
100
|
-
| --sourcemap-output [string]
|
|
101
|
-
| --sourcemap-sources-root [string]
|
|
102
|
-
| --assets-dest [path]
|
|
103
|
-
| --tree-shake [boolean]
|
|
104
|
-
| --reset-cache
|
|
105
|
-
| --config [string]
|
|
106
|
-
| -h, --help
|
|
90
|
+
| Override | Description |
|
|
91
|
+
| ------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
92
|
+
| --id [id] | Target bundle definition. This is only needed when the rnx-kit configuration has multiple bundle definitions. |
|
|
93
|
+
| --entry-file [file] | Path to the root JavaScript or TypeScript file, either absolute or relative to the package. |
|
|
94
|
+
| --platform [`ios` \| `android` \| `windows` \| `win32` \| `macos`] | Target platform. When not given, all platforms in the rnx-kit configuration are bundled. |
|
|
95
|
+
| --dev [boolean] | If false, warnings are disabled and the bundle is minified (default: true). |
|
|
96
|
+
| --minify [boolean] | Controls whether or not the bundle is minified. Disabling minification is useful for test builds. |
|
|
97
|
+
| --bundle-output [path] | Path to the output bundle file, either absolute or relative to the package. |
|
|
98
|
+
| --bundle-encoding [`utf8` \| `utf16le` \| `ascii`] | [Character encoding](https://nodejs.org/api/buffer.html#buffer_buffers_and_character_encodings) to use when writing the bundle file. |
|
|
99
|
+
| --max-workers [number] | Specifies the maximum number of parallel worker threads to use for transforming files. This defaults to the number of cores available on your machine. |
|
|
100
|
+
| --sourcemap-output [string] | Path where the bundle source map is written, either absolute or relative to the package. |
|
|
101
|
+
| --sourcemap-sources-root [string] | Path to use when relativizing file entries in the bundle source map. |
|
|
102
|
+
| --assets-dest [path] | Path where bundle assets like images are written, either absolute or relative to the package. If not given, assets are ignored. |
|
|
103
|
+
| --tree-shake [boolean] | Enable tree shaking to remove unused code and reduce the bundle size. |
|
|
104
|
+
| --reset-cache | Reset the Metro cache. |
|
|
105
|
+
| --config [string] | Path to the Metro configuration file. |
|
|
106
|
+
| -h, --help | Show usage information. |
|
|
107
107
|
|
|
108
108
|
## Start a Bundle Server
|
|
109
109
|
|
|
@@ -139,8 +139,7 @@ yarn react-native rnx-start --host localhost --port 8812
|
|
|
139
139
|
"ignoredModules": ["react-is"],
|
|
140
140
|
"throwOnError": false
|
|
141
141
|
},
|
|
142
|
-
"typescriptValidation": true
|
|
143
|
-
"treeShake": true
|
|
142
|
+
"typescriptValidation": true
|
|
144
143
|
}
|
|
145
144
|
}
|
|
146
145
|
}
|
package/coverage/clover.xml
CHANGED
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<coverage generated="
|
|
3
|
-
<project timestamp="
|
|
4
|
-
<metrics statements="
|
|
2
|
+
<coverage generated="1663570521627" clover="3.2.0">
|
|
3
|
+
<project timestamp="1663570521627" name="All files">
|
|
4
|
+
<metrics statements="284" coveredstatements="140" conditionals="170" coveredconditionals="82" methods="45" coveredmethods="24" elements="499" coveredelements="246" complexity="0" loc="284" ncloc="284" packages="3" files="7" classes="7"/>
|
|
5
5
|
<package name="src">
|
|
6
|
-
<metrics statements="
|
|
7
|
-
<file name="bundler-plugin-defaults.ts" path="/home/runner/work/rnx-kit/rnx-kit/packages/cli/src/bundler-plugin-defaults.ts">
|
|
8
|
-
<metrics statements="1" coveredstatements="1" conditionals="0" coveredconditionals="0" methods="1" coveredmethods="1"/>
|
|
9
|
-
<line num="4" count="10" type="stmt"/>
|
|
10
|
-
</file>
|
|
6
|
+
<metrics statements="208" coveredstatements="109" conditionals="131" coveredconditionals="61" methods="28" coveredmethods="16"/>
|
|
11
7
|
<file name="copy-assets.ts" path="/home/runner/work/rnx-kit/rnx-kit/packages/cli/src/copy-assets.ts">
|
|
12
8
|
<metrics statements="151" coveredstatements="82" conditionals="99" coveredconditionals="46" methods="18" coveredmethods="14"/>
|
|
13
9
|
<line num="60" count="2" type="stmt"/>
|
|
@@ -164,67 +160,71 @@
|
|
|
164
160
|
</file>
|
|
165
161
|
<file name="metro-config.ts" path="/home/runner/work/rnx-kit/rnx-kit/packages/cli/src/metro-config.ts">
|
|
166
162
|
<metrics statements="57" coveredstatements="27" conditionals="32" coveredconditionals="15" methods="10" coveredmethods="2"/>
|
|
167
|
-
<line num="
|
|
168
|
-
<line num="
|
|
169
|
-
<line num="
|
|
170
|
-
<line num="
|
|
171
|
-
<line num="
|
|
172
|
-
<line num="
|
|
173
|
-
<line num="
|
|
174
|
-
<line num="
|
|
175
|
-
<line num="
|
|
176
|
-
<line num="
|
|
177
|
-
<line num="
|
|
178
|
-
<line num="
|
|
179
|
-
<line num="
|
|
180
|
-
<line num="
|
|
163
|
+
<line num="34" count="9" type="stmt"/>
|
|
164
|
+
<line num="36" count="9" type="stmt"/>
|
|
165
|
+
<line num="37" count="9" type="stmt"/>
|
|
166
|
+
<line num="39" count="9" type="stmt"/>
|
|
167
|
+
<line num="40" count="0" type="stmt"/>
|
|
168
|
+
<line num="41" count="0" type="cond" truecount="0" falsecount="2"/>
|
|
169
|
+
<line num="42" count="0" type="cond" truecount="0" falsecount="2"/>
|
|
170
|
+
<line num="46" count="0" type="stmt"/>
|
|
171
|
+
<line num="51" count="0" type="stmt"/>
|
|
172
|
+
<line num="53" count="0" type="stmt"/>
|
|
173
|
+
<line num="56" count="0" type="stmt"/>
|
|
174
|
+
<line num="58" count="0" type="stmt"/>
|
|
175
|
+
<line num="61" count="0" type="stmt"/>
|
|
176
|
+
<line num="67" count="0" type="stmt"/>
|
|
177
|
+
<line num="68" count="0" type="stmt"/>
|
|
178
|
+
<line num="69" count="0" type="stmt"/>
|
|
179
|
+
<line num="70" count="0" type="cond" truecount="0" falsecount="2"/>
|
|
181
180
|
<line num="72" count="0" type="stmt"/>
|
|
182
|
-
<line num="73" count="0" type="
|
|
183
|
-
<line num="74" count="0" type="
|
|
184
|
-
<line num="
|
|
185
|
-
<line num="77" count="0" type="cond" truecount="0" falsecount="2"/>
|
|
186
|
-
<line num="78" count="0" type="stmt"/>
|
|
181
|
+
<line num="73" count="0" type="cond" truecount="0" falsecount="2"/>
|
|
182
|
+
<line num="74" count="0" type="stmt"/>
|
|
183
|
+
<line num="75" count="0" type="stmt"/>
|
|
187
184
|
<line num="79" count="0" type="stmt"/>
|
|
185
|
+
<line num="80" count="0" type="stmt"/>
|
|
186
|
+
<line num="81" count="0" type="cond" truecount="0" falsecount="2"/>
|
|
188
187
|
<line num="83" count="0" type="stmt"/>
|
|
189
188
|
<line num="84" count="0" type="stmt"/>
|
|
190
|
-
<line num="85" count="0" type="
|
|
191
|
-
<line num="
|
|
192
|
-
<line num="
|
|
193
|
-
<line num="
|
|
194
|
-
<line num="
|
|
195
|
-
<line num="
|
|
196
|
-
<line num="
|
|
197
|
-
<line num="
|
|
198
|
-
<line num="
|
|
199
|
-
<line num="
|
|
200
|
-
<line num="
|
|
201
|
-
<line num="
|
|
202
|
-
<line num="
|
|
203
|
-
<line num="
|
|
189
|
+
<line num="85" count="0" type="stmt"/>
|
|
190
|
+
<line num="90" count="0" type="stmt"/>
|
|
191
|
+
<line num="91" count="0" type="stmt"/>
|
|
192
|
+
<line num="92" count="0" type="cond" truecount="0" falsecount="2"/>
|
|
193
|
+
<line num="93" count="0" type="stmt"/>
|
|
194
|
+
<line num="97" count="0" type="cond" truecount="0" falsecount="4"/>
|
|
195
|
+
<line num="99" count="0" type="stmt"/>
|
|
196
|
+
<line num="104" count="9" type="stmt"/>
|
|
197
|
+
<line num="107" count="2" type="stmt"/>
|
|
198
|
+
<line num="130" count="10" type="stmt"/>
|
|
199
|
+
<line num="132" count="10" type="stmt"/>
|
|
200
|
+
<line num="133" count="10" type="cond" truecount="2" falsecount="0"/>
|
|
201
|
+
<line num="134" count="1" type="stmt"/>
|
|
202
|
+
<line num="135" count="9" type="cond" truecount="2" falsecount="0"/>
|
|
203
|
+
<line num="136" count="5" type="stmt"/>
|
|
204
204
|
<line num="138" count="10" type="cond" truecount="2" falsecount="0"/>
|
|
205
205
|
<line num="139" count="1" type="stmt"/>
|
|
206
206
|
<line num="140" count="9" type="cond" truecount="2" falsecount="0"/>
|
|
207
207
|
<line num="141" count="5" type="stmt"/>
|
|
208
|
-
<line num="
|
|
209
|
-
<line num="
|
|
210
|
-
<line num="
|
|
211
|
-
<line num="
|
|
212
|
-
<line num="
|
|
213
|
-
<line num="
|
|
214
|
-
<line num="
|
|
215
|
-
<line num="
|
|
216
|
-
<line num="
|
|
217
|
-
<line num="
|
|
218
|
-
<line num="
|
|
219
|
-
<line num="171" count="10" type="
|
|
220
|
-
<line num="172" count="0" type="stmt"/>
|
|
221
|
-
<line num="173" count="10" type="cond" truecount="2" falsecount="0"/>
|
|
222
|
-
<line num="174" count="9" type="stmt"/>
|
|
223
|
-
<line num="176" count="10" type="stmt"/>
|
|
208
|
+
<line num="144" count="10" type="cond" truecount="2" falsecount="0"/>
|
|
209
|
+
<line num="145" count="4" type="stmt"/>
|
|
210
|
+
<line num="146" count="4" type="stmt"/>
|
|
211
|
+
<line num="147" count="6" type="cond" truecount="2" falsecount="0"/>
|
|
212
|
+
<line num="158" count="4" type="stmt"/>
|
|
213
|
+
<line num="162" count="2" type="stmt"/>
|
|
214
|
+
<line num="165" count="10" type="stmt"/>
|
|
215
|
+
<line num="166" count="10" type="cond" truecount="1" falsecount="1"/>
|
|
216
|
+
<line num="167" count="0" type="stmt"/>
|
|
217
|
+
<line num="168" count="10" type="cond" truecount="2" falsecount="0"/>
|
|
218
|
+
<line num="169" count="9" type="stmt"/>
|
|
219
|
+
<line num="171" count="10" type="stmt"/>
|
|
224
220
|
</file>
|
|
225
221
|
</package>
|
|
226
222
|
<package name="src.bundle">
|
|
227
|
-
<metrics statements="
|
|
223
|
+
<metrics statements="27" coveredstatements="27" conditionals="21" coveredconditionals="21" methods="7" coveredmethods="7"/>
|
|
224
|
+
<file name="defaultPlugins.ts" path="/home/runner/work/rnx-kit/rnx-kit/packages/cli/src/bundle/defaultPlugins.ts">
|
|
225
|
+
<metrics statements="1" coveredstatements="1" conditionals="0" coveredconditionals="0" methods="1" coveredmethods="1"/>
|
|
226
|
+
<line num="4" count="10" type="stmt"/>
|
|
227
|
+
</file>
|
|
228
228
|
<file name="kit-config.ts" path="/home/runner/work/rnx-kit/rnx-kit/packages/cli/src/bundle/kit-config.ts">
|
|
229
229
|
<metrics statements="14" coveredstatements="14" conditionals="14" coveredconditionals="14" methods="4" coveredmethods="4"/>
|
|
230
230
|
<line num="21" count="10" type="cond" truecount="2" falsecount="0"/>
|
|
@@ -243,21 +243,22 @@
|
|
|
243
243
|
<line num="74" count="10" type="stmt"/>
|
|
244
244
|
</file>
|
|
245
245
|
<file name="metro.ts" path="/home/runner/work/rnx-kit/rnx-kit/packages/cli/src/bundle/metro.ts">
|
|
246
|
-
<metrics statements="7" coveredstatements="7" conditionals="
|
|
247
|
-
<line num="
|
|
248
|
-
<line num="
|
|
249
|
-
<line num="
|
|
250
|
-
<line num="
|
|
251
|
-
<line num="
|
|
252
|
-
<line num="
|
|
253
|
-
<line num="
|
|
246
|
+
<metrics statements="7" coveredstatements="7" conditionals="5" coveredconditionals="5" methods="1" coveredmethods="1"/>
|
|
247
|
+
<line num="29" count="4" type="stmt"/>
|
|
248
|
+
<line num="31" count="4" type="stmt"/>
|
|
249
|
+
<line num="33" count="4" type="stmt"/>
|
|
250
|
+
<line num="40" count="4" type="stmt"/>
|
|
251
|
+
<line num="41" count="4" type="cond" truecount="2" falsecount="0"/>
|
|
252
|
+
<line num="43" count="4" type="cond" truecount="2" falsecount="0"/>
|
|
253
|
+
<line num="46" count="4" type="stmt"/>
|
|
254
254
|
</file>
|
|
255
255
|
<file name="overrides.ts" path="/home/runner/work/rnx-kit/rnx-kit/packages/cli/src/bundle/overrides.ts">
|
|
256
|
-
<metrics statements="
|
|
257
|
-
<line num="
|
|
258
|
-
<line num="
|
|
259
|
-
<line num="
|
|
260
|
-
<line num="
|
|
256
|
+
<metrics statements="5" coveredstatements="5" conditionals="2" coveredconditionals="2" methods="1" coveredmethods="1"/>
|
|
257
|
+
<line num="21" count="1" type="stmt"/>
|
|
258
|
+
<line num="44" count="10" type="stmt"/>
|
|
259
|
+
<line num="45" count="10" type="cond" truecount="2" falsecount="0"/>
|
|
260
|
+
<line num="46" count="9" type="stmt"/>
|
|
261
|
+
<line num="47" count="9" type="stmt"/>
|
|
261
262
|
</file>
|
|
262
263
|
</package>
|
|
263
264
|
<package name="src.typescript">
|