@rnx-kit/cli 0.16.29 → 0.16.30

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.
Files changed (52) hide show
  1. package/lib/align-deps.js +5 -5
  2. package/lib/bundle/cliOptions.d.ts +2 -2
  3. package/lib/bundle/cliOptions.js +27 -27
  4. package/lib/bundle/hermes.d.ts +2 -1
  5. package/lib/bundle/hermes.js +4 -10
  6. package/lib/bundle/metro.js +5 -8
  7. package/lib/bundle.d.ts +3 -3
  8. package/lib/bundle.js +4 -4
  9. package/lib/clean.d.ts +2 -2
  10. package/lib/clean.js +42 -62
  11. package/lib/helpers/externals.d.ts +4 -0
  12. package/lib/{serve/external.js → helpers/externals.js} +10 -8
  13. package/lib/helpers/filesystem.d.ts +3 -0
  14. package/lib/helpers/filesystem.js +31 -0
  15. package/lib/{metro-config.js → helpers/metro-config.js} +1 -1
  16. package/lib/{parsers.d.ts → helpers/parsers.d.ts} +1 -1
  17. package/lib/{parsers.js → helpers/parsers.js} +16 -14
  18. package/lib/index.d.ts +12 -13
  19. package/lib/index.js +1 -5
  20. package/lib/ram-bundle.d.ts +4 -4
  21. package/lib/ram-bundle.js +2 -2
  22. package/lib/start.d.ts +1 -1
  23. package/lib/start.js +33 -33
  24. package/lib/test.d.ts +2 -1
  25. package/lib/test.js +1 -1
  26. package/lib/write-third-party-notices.js +13 -13
  27. package/package.json +6 -8
  28. package/lib/serve/external.d.ts +0 -7
  29. package/src/align-deps.ts +0 -82
  30. package/src/bundle/cliOptions.ts +0 -82
  31. package/src/bundle/defaultPlugins.ts +0 -16
  32. package/src/bundle/hermes.ts +0 -114
  33. package/src/bundle/kit-config.ts +0 -81
  34. package/src/bundle/metro.ts +0 -66
  35. package/src/bundle/overrides.ts +0 -51
  36. package/src/bundle/types.ts +0 -41
  37. package/src/bundle.ts +0 -69
  38. package/src/clean.ts +0 -223
  39. package/src/copy-assets.ts +0 -545
  40. package/src/index.ts +0 -34
  41. package/src/metro-config.ts +0 -208
  42. package/src/parsers.ts +0 -44
  43. package/src/ram-bundle.ts +0 -78
  44. package/src/serve/external.ts +0 -62
  45. package/src/serve/help.ts +0 -59
  46. package/src/serve/keyboard.ts +0 -76
  47. package/src/serve/kit-config.ts +0 -47
  48. package/src/serve/types.ts +0 -87
  49. package/src/start.ts +0 -316
  50. package/src/test.ts +0 -137
  51. package/src/write-third-party-notices.ts +0 -85
  52. /package/lib/{metro-config.d.ts → helpers/metro-config.d.ts} +0 -0
package/lib/index.d.ts CHANGED
@@ -25,11 +25,11 @@ export declare const reactNativeConfig: {
25
25
  name: string;
26
26
  description: string;
27
27
  default: boolean;
28
- parse: typeof import("./parsers").asBoolean;
28
+ parse: typeof import("./helpers/parsers").asBoolean;
29
29
  } | {
30
30
  name: string;
31
31
  description: string;
32
- parse: typeof import("./parsers").asBoolean;
32
+ parse: typeof import("./helpers/parsers").asBoolean;
33
33
  default?: undefined;
34
34
  } | {
35
35
  name: string;
@@ -39,12 +39,12 @@ export declare const reactNativeConfig: {
39
39
  } | {
40
40
  name: string;
41
41
  description: string;
42
- parse: typeof import("./parsers").asNumber;
42
+ parse: typeof import("./helpers/parsers").asNumber;
43
43
  default?: undefined;
44
44
  } | {
45
45
  name: string;
46
46
  description: string;
47
- parse: typeof import("./parsers").parseTransformProfile;
47
+ parse: typeof import("./helpers/parsers").asTransformProfile;
48
48
  default?: undefined;
49
49
  })[];
50
50
  } | {
@@ -60,7 +60,7 @@ export declare const reactNativeConfig: {
60
60
  name: string;
61
61
  description: string;
62
62
  default: string;
63
- parse: typeof import("./parsers").asResolvedPath;
63
+ parse: typeof import("./helpers/parsers").asResolvedPath;
64
64
  } | {
65
65
  name: string;
66
66
  description: string;
@@ -105,11 +105,11 @@ export declare const reactNativeConfig: {
105
105
  name: string;
106
106
  description: string;
107
107
  default: boolean;
108
- parse: typeof import("./parsers").asBoolean;
108
+ parse: typeof import("./helpers/parsers").asBoolean;
109
109
  } | {
110
110
  name: string;
111
111
  description: string;
112
- parse: typeof import("./parsers").asBoolean;
112
+ parse: typeof import("./helpers/parsers").asBoolean;
113
113
  default?: undefined;
114
114
  } | {
115
115
  name: string;
@@ -119,12 +119,12 @@ export declare const reactNativeConfig: {
119
119
  } | {
120
120
  name: string;
121
121
  description: string;
122
- parse: typeof import("./parsers").asNumber;
122
+ parse: typeof import("./helpers/parsers").asNumber;
123
123
  default?: undefined;
124
124
  } | {
125
125
  name: string;
126
126
  description: string;
127
- parse: typeof import("./parsers").parseTransformProfile;
127
+ parse: typeof import("./helpers/parsers").asTransformProfile;
128
128
  default?: undefined;
129
129
  })[];
130
130
  } | {
@@ -134,7 +134,7 @@ export declare const reactNativeConfig: {
134
134
  options: ({
135
135
  name: string;
136
136
  description: string;
137
- parse: typeof import("./parsers").asNumber;
137
+ parse: typeof import("./helpers/parsers").asNumber;
138
138
  default: number;
139
139
  } | {
140
140
  name: string;
@@ -144,7 +144,7 @@ export declare const reactNativeConfig: {
144
144
  } | {
145
145
  name: string;
146
146
  description: string;
147
- parse: typeof import("./parsers").asResolvedPath;
147
+ parse: typeof import("./helpers/parsers").asResolvedPath;
148
148
  default?: undefined;
149
149
  } | {
150
150
  name: string;
@@ -154,7 +154,7 @@ export declare const reactNativeConfig: {
154
154
  } | {
155
155
  name: string;
156
156
  description: string;
157
- parse: typeof import("./parsers").asNumber;
157
+ parse: typeof import("./helpers/parsers").asNumber;
158
158
  default?: undefined;
159
159
  } | {
160
160
  name: string;
@@ -191,7 +191,6 @@ export { rnxAlignDeps, rnxAlignDepsCommand } from "./align-deps";
191
191
  export { rnxBundle, rnxBundleCommand } from "./bundle";
192
192
  export { rnxClean, rnxCleanCommand } from "./clean";
193
193
  export { copyProjectAssets, rnxCopyAssetsCommand } from "./copy-assets";
194
- export { asBoolean, asNumber, parseTransformProfile } from "./parsers";
195
194
  export { rnxRamBundle, rnxRamBundleCommand } from "./ram-bundle";
196
195
  export { rnxStart, rnxStartCommand } from "./start";
197
196
  export { rnxTest, rnxTestCommand } from "./test";
package/lib/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.rnxWriteThirdPartyNoticesCommand = exports.rnxWriteThirdPartyNotices = exports.rnxTestCommand = exports.rnxTest = exports.rnxStartCommand = exports.rnxStart = exports.rnxRamBundleCommand = exports.rnxRamBundle = exports.parseTransformProfile = exports.asNumber = exports.asBoolean = exports.rnxCopyAssetsCommand = exports.copyProjectAssets = exports.rnxCleanCommand = exports.rnxClean = exports.rnxBundleCommand = exports.rnxBundle = exports.rnxAlignDepsCommand = exports.rnxAlignDeps = exports.reactNativeConfig = void 0;
3
+ exports.rnxWriteThirdPartyNoticesCommand = exports.rnxWriteThirdPartyNotices = exports.rnxTestCommand = exports.rnxTest = exports.rnxStartCommand = exports.rnxStart = exports.rnxRamBundleCommand = exports.rnxRamBundle = exports.rnxCopyAssetsCommand = exports.copyProjectAssets = exports.rnxCleanCommand = exports.rnxClean = exports.rnxBundleCommand = exports.rnxBundle = exports.rnxAlignDepsCommand = exports.rnxAlignDeps = exports.reactNativeConfig = void 0;
4
4
  const align_deps_1 = require("./align-deps");
5
5
  const bundle_1 = require("./bundle");
6
6
  const clean_1 = require("./clean");
@@ -33,10 +33,6 @@ Object.defineProperty(exports, "rnxCleanCommand", { enumerable: true, get: funct
33
33
  var copy_assets_2 = require("./copy-assets");
34
34
  Object.defineProperty(exports, "copyProjectAssets", { enumerable: true, get: function () { return copy_assets_2.copyProjectAssets; } });
35
35
  Object.defineProperty(exports, "rnxCopyAssetsCommand", { enumerable: true, get: function () { return copy_assets_2.rnxCopyAssetsCommand; } });
36
- var parsers_1 = require("./parsers");
37
- Object.defineProperty(exports, "asBoolean", { enumerable: true, get: function () { return parsers_1.asBoolean; } });
38
- Object.defineProperty(exports, "asNumber", { enumerable: true, get: function () { return parsers_1.asNumber; } });
39
- Object.defineProperty(exports, "parseTransformProfile", { enumerable: true, get: function () { return parsers_1.parseTransformProfile; } });
40
36
  var ram_bundle_2 = require("./ram-bundle");
41
37
  Object.defineProperty(exports, "rnxRamBundle", { enumerable: true, get: function () { return ram_bundle_2.rnxRamBundle; } });
42
38
  Object.defineProperty(exports, "rnxRamBundleCommand", { enumerable: true, get: function () { return ram_bundle_2.rnxRamBundleCommand; } });
@@ -22,11 +22,11 @@ export declare const rnxRamBundleCommand: {
22
22
  name: string;
23
23
  description: string;
24
24
  default: boolean;
25
- parse: typeof import("./parsers").asBoolean;
25
+ parse: typeof import("./helpers/parsers").asBoolean;
26
26
  } | {
27
27
  name: string;
28
28
  description: string;
29
- parse: typeof import("./parsers").asBoolean;
29
+ parse: typeof import("./helpers/parsers").asBoolean;
30
30
  default?: undefined;
31
31
  } | {
32
32
  name: string;
@@ -36,12 +36,12 @@ export declare const rnxRamBundleCommand: {
36
36
  } | {
37
37
  name: string;
38
38
  description: string;
39
- parse: typeof import("./parsers").asNumber;
39
+ parse: typeof import("./helpers/parsers").asNumber;
40
40
  default?: undefined;
41
41
  } | {
42
42
  name: string;
43
43
  description: string;
44
- parse: typeof import("./parsers").parseTransformProfile;
44
+ parse: typeof import("./helpers/parsers").asTransformProfile;
45
45
  default?: undefined;
46
46
  })[];
47
47
  };
package/lib/ram-bundle.js CHANGED
@@ -34,13 +34,13 @@ async function rnxRamBundle(_argv, cliConfig, cliOptions) {
34
34
  }
35
35
  exports.rnxRamBundleCommand = {
36
36
  name: "rnx-ram-bundle",
37
- description: "Bundle your rnx-kit package in the RAM bundle format for offline use. See https://aka.ms/rnx-kit.",
37
+ description: "[Deprecated] Bundle your JavaScript in the RAM bundle format for offline use",
38
38
  func: rnxRamBundle,
39
39
  options: [
40
40
  ...cliOptions_1.commonBundleCommandOptions,
41
41
  {
42
42
  name: "--indexed-ram-bundle",
43
- description: 'Force the "Indexed RAM" bundle file format, even when targeting Android.',
43
+ description: 'Force the "Indexed RAM" bundle file format, even when targeting Android',
44
44
  },
45
45
  ],
46
46
  };
package/lib/start.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import type { Config } from "@react-native-community/cli-types";
2
- import { asNumber, asResolvedPath } from "./parsers";
2
+ import { asNumber, asResolvedPath } from "./helpers/parsers";
3
3
  import type { StartCommandArgs } from "./serve/types";
4
4
  export declare function rnxStart(_argv: string[], ctx: Config, args: StartCommandArgs): Promise<void>;
5
5
  export declare const rnxStartCommand: {
package/lib/start.js CHANGED
@@ -28,9 +28,9 @@ exports.rnxStart = rnxStart;
28
28
  const logger = __importStar(require("@rnx-kit/console"));
29
29
  const metro_service_1 = require("@rnx-kit/metro-service");
30
30
  const path = __importStar(require("path"));
31
- const metro_config_1 = require("./metro-config");
32
- const parsers_1 = require("./parsers");
33
- const external_1 = require("./serve/external");
31
+ const externals_1 = require("./helpers/externals");
32
+ const metro_config_1 = require("./helpers/metro-config");
33
+ const parsers_1 = require("./helpers/parsers");
34
34
  const help_1 = require("./serve/help");
35
35
  const keyboard_1 = require("./serve/keyboard");
36
36
  const kit_config_1 = require("./serve/kit-config");
@@ -40,7 +40,7 @@ function hasAttachToServerFunction(devServer) {
40
40
  async function rnxStart(_argv, ctx, args) {
41
41
  var _a;
42
42
  const serverConfig = (0, kit_config_1.getKitServerConfig)(args);
43
- const { createDevServerMiddleware, indexPageMiddleware } = (0, external_1.requireExternal)("@react-native-community/cli-server-api");
43
+ const { createDevServerMiddleware, indexPageMiddleware } = (0, externals_1.requireExternal)("@react-native-community/cli-server-api", ctx.root, ctx.reactNativePath);
44
44
  // interactive mode requires raw access to stdin
45
45
  let interactive = args.interactive;
46
46
  if (interactive) {
@@ -90,7 +90,7 @@ async function rnxStart(_argv, ctx, args) {
90
90
  const coreDevMiddleware = (() => {
91
91
  try {
92
92
  // https://github.com/facebook/react-native/blob/7888338295476f4d4f00733309e54b8d22318e1e/packages/community-cli-plugin/src/commands/start/runServer.js#L115
93
- const { createDevMiddleware } = (0, external_1.requireExternal)("@react-native/dev-middleware");
93
+ const { createDevMiddleware } = (0, externals_1.requireExternal)("@react-native/dev-middleware", ctx.root, ctx.reactNativePath);
94
94
  return createDevMiddleware({
95
95
  projectRoot,
96
96
  serverBaseUrl: devServerUrl,
@@ -189,76 +189,76 @@ async function rnxStart(_argv, ctx, args) {
189
189
  exports.rnxStartCommand = {
190
190
  name: "rnx-start",
191
191
  func: rnxStart,
192
- description: "Start a bundle-server to host your react-native experience during development",
192
+ description: "Start a React Native development server",
193
193
  options: [
194
194
  {
195
- name: "--port [number]",
196
- description: "Host port to use when listening for incoming server requests.",
195
+ name: "--port <number>",
196
+ description: "Host port to use when listening for incoming server requests",
197
197
  parse: parsers_1.asNumber,
198
198
  default: 8081,
199
199
  },
200
200
  {
201
- name: "--host [string]",
202
- description: "Host name or address to bind when listening for incoming server requests. When not given, requests from all addresses are accepted.",
201
+ name: "--host <string>",
202
+ description: "Host name or address to bind when listening for incoming server requests; when not specified, requests from all addresses are accepted",
203
203
  default: "",
204
204
  },
205
205
  {
206
- name: "--projectRoot [path]",
207
- description: "Path to the root of your react-native project. The bundle server uses this root path to resolve all web requests.",
206
+ name: "--project-root <path>",
207
+ description: "Path to the root of your react-native project; the bundle server uses this path to resolve all web requests",
208
208
  parse: parsers_1.asResolvedPath,
209
209
  },
210
210
  {
211
- name: "--watchFolders [paths]",
212
- description: "Additional folders which will be added to the file-watch list. Comma-separated. By default, Metro watches all project files.",
211
+ name: "--watch-folders <paths>",
212
+ description: "Additional folders which will be added to the watched files list, comma-separated; by default, Metro watches all project files",
213
213
  parse: (val) => (0, parsers_1.asStringArray)(val).map(parsers_1.asResolvedPath),
214
214
  },
215
215
  {
216
- name: "--assetPlugins [list]",
217
- description: "Additional asset plugins to be used by the Metro Babel transformer. Comma-separated list containing plugin module names or absolute paths to plugin packages.",
216
+ name: "--asset-plugins <list>",
217
+ description: "Additional asset plugins to be used by Metro's Babel transformer; comma-separated list containing plugin module names or absolute paths to plugin packages",
218
218
  parse: parsers_1.asStringArray,
219
219
  },
220
220
  {
221
- name: "--sourceExts [list]",
222
- description: "Additional source-file extensions to include when generating bundles. Comma-separated list, excluding the leading dot.",
221
+ name: "--source-exts <list>",
222
+ description: "Additional source file extensions to include when generating bundles; comma-separated list, excluding the leading dot",
223
223
  parse: parsers_1.asStringArray,
224
224
  },
225
225
  {
226
- name: "--max-workers [number]",
227
- description: "Specifies the maximum number of parallel worker threads to use for transforming files. This defaults to the number of cores available on your machine.",
226
+ name: "--max-workers <number>",
227
+ description: "Specifies the maximum number of parallel worker threads to use for transforming files; defaults to the number of cores available on your machine",
228
228
  parse: parsers_1.asNumber,
229
229
  },
230
230
  {
231
231
  name: "--reset-cache",
232
- description: "Reset the Metro cache.",
232
+ description: "Reset the Metro cache",
233
233
  },
234
234
  {
235
- name: "--custom-log-reporter-path [string]",
236
- description: "Path to a JavaScript file which exports a Metro 'TerminalReporter' function. This replaces the default reporter, which writes all messages to the Metro console.",
235
+ name: "--custom-log-reporter-path <string>",
236
+ description: "Path to a JavaScript file which exports a Metro 'TerminalReporter' function; replaces the default reporter that writes all messages to the Metro console",
237
237
  },
238
238
  {
239
239
  name: "--https",
240
- description: "Use a secure (https) web server. When not specified, an insecure (http) web server is used.",
240
+ description: "Use a secure (https) web server; when not specified, an insecure (http) web server is used",
241
241
  },
242
242
  {
243
- name: "--key [path]",
244
- description: "Path to a custom SSL private key file to use for secure (https) communication.",
243
+ name: "--key <path>",
244
+ description: "Path to a custom SSL private key file to use for secure (https) communication",
245
245
  },
246
246
  {
247
- name: "--cert [path]",
248
- description: "Path to a custom SSL certificate file to use for secure (https) communication.",
247
+ name: "--cert <path>",
248
+ description: "Path to a custom SSL certificate file to use for secure (https) communication",
249
249
  },
250
250
  {
251
- name: "--config [string]",
252
- description: "Path to the Metro configuration file.",
251
+ name: "--config <string>",
252
+ description: "Path to the Metro configuration file",
253
253
  parse: parsers_1.asResolvedPath,
254
254
  },
255
255
  {
256
256
  name: "--no-interactive",
257
- description: "Disables interactive mode.",
257
+ description: "Disables interactive mode",
258
258
  },
259
259
  {
260
- name: "--id [string]",
261
- description: "Specify which bundle configuration to use if server configuration is missing.",
260
+ name: "--id <string>",
261
+ description: "Specify which bundle configuration to use if server configuration is missing",
262
262
  },
263
263
  ],
264
264
  };
package/lib/test.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import type { Config as CLIConfig } from "@react-native-community/cli-types";
2
+ import type { AllPlatforms } from "@rnx-kit/tools-react-native/platform";
2
3
  type Args = {
3
- platform: "android" | "ios" | "macos" | "windows" | "win32";
4
+ platform: AllPlatforms;
4
5
  };
5
6
  type Options = {
6
7
  name: string;
package/lib/test.js CHANGED
@@ -101,7 +101,7 @@ exports.rnxTestCommand = {
101
101
  func: rnxTest,
102
102
  options: [
103
103
  {
104
- name: "--platform [android|ios|macos|windows|win32]",
104
+ name: "--platform <android|ios|macos|windows|win32>",
105
105
  description: "Platform to target",
106
106
  parse: platform_1.parsePlatform,
107
107
  },
@@ -23,36 +23,36 @@ exports.rnxWriteThirdPartyNoticesCommand = {
23
23
  options: [
24
24
  {
25
25
  name: "--root-path <path>",
26
- description: "The root of the repo. This is the starting point for finding each module in the source map dependency graph.",
26
+ description: "The root of the repo the starting point for finding each module in the source map dependency graph",
27
27
  },
28
28
  {
29
29
  name: "--source-map-file <file>",
30
- description: "The source map file associated with the package's entry file. This source map eventually leads to all package dependencies and their licenses.",
30
+ description: "The source map file associated with the package's entry file this source map eventually leads to all package dependencies and their licenses",
31
31
  },
32
32
  {
33
33
  name: "--json",
34
- description: "Format the 3rd-party notice file as JSON instead of text.",
34
+ description: "Format the 3rd-party notice file as JSON instead of text",
35
35
  default: false,
36
36
  },
37
37
  {
38
- name: "--output-file [file]",
39
- description: "The path to use when writing the 3rd-party notice file.",
38
+ name: "--output-file <file>",
39
+ description: "The path to use when writing the 3rd-party notice file",
40
40
  },
41
41
  {
42
- name: "--ignore-scopes [string]",
43
- description: "Comma-separated list of `npm` scopes to ignore when traversing the source map dependency graph.",
42
+ name: "--ignore-scopes <string>",
43
+ description: "Comma-separated list of npm scopes to ignore when traversing the source map dependency graph",
44
44
  },
45
45
  {
46
- name: "--ignore-modules [string]",
47
- description: "Comma-separated list of modules to ignore when traversing the source map dependency graph.",
46
+ name: "--ignore-modules <string>",
47
+ description: "Comma-separated list of modules to ignore when traversing the source map dependency graph",
48
48
  },
49
49
  {
50
- name: "--preamble-text [string]",
51
- description: "A string to prepend to the start of the 3rd-party notice.",
50
+ name: "--preamble-text <string>",
51
+ description: "A string to prepend to the start of the 3rd-party notice",
52
52
  },
53
53
  {
54
- name: "--additional-text [path]",
55
- description: "A string to append to the end of the 3rd-party notice.",
54
+ name: "--additional-text <string>",
55
+ description: "A string to append to the end of the 3rd-party notice",
56
56
  },
57
57
  ],
58
58
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rnx-kit/cli",
3
- "version": "0.16.29",
3
+ "version": "0.16.30",
4
4
  "description": "Command-line interface for working with kit packages in your repo",
5
5
  "homepage": "https://github.com/microsoft/rnx-kit/tree/main/packages/cli#readme",
6
6
  "license": "MIT",
@@ -11,8 +11,7 @@
11
11
  "files": [
12
12
  "lib/**/*.d.ts",
13
13
  "lib/**/*.js",
14
- "react-native.config.js",
15
- "src"
14
+ "react-native.config.js"
16
15
  ],
17
16
  "main": "lib/index.js",
18
17
  "types": "lib/index.d.ts",
@@ -21,8 +20,8 @@
21
20
  "types": "./lib/index.d.ts",
22
21
  "default": "./lib/index.js"
23
22
  },
24
- "./package.json": "./package.json",
25
- "./react-native.config.js": "./react-native.config.js"
23
+ "./react-native.config.js": "./react-native.config.js",
24
+ "./package.json": "./package.json"
26
25
  },
27
26
  "repository": {
28
27
  "type": "git",
@@ -44,12 +43,12 @@
44
43
  "@rnx-kit/metro-plugin-duplicates-checker": "^2.1.1",
45
44
  "@rnx-kit/metro-plugin-typescript": "^0.4.4",
46
45
  "@rnx-kit/metro-serializer": "^1.0.14",
47
- "@rnx-kit/metro-serializer-esbuild": "^0.1.31",
46
+ "@rnx-kit/metro-serializer-esbuild": "^0.1.36",
48
47
  "@rnx-kit/metro-service": "^3.1.6",
49
48
  "@rnx-kit/third-party-notices": "^1.3.4",
50
49
  "@rnx-kit/tools-language": "^2.0.0",
51
50
  "@rnx-kit/tools-node": "^2.1.1",
52
- "@rnx-kit/tools-react-native": "^1.3.5",
51
+ "@rnx-kit/tools-react-native": "^1.4.0",
53
52
  "fs-extra": "^10.0.0",
54
53
  "node-fetch": "^2.6.7",
55
54
  "ora": "^5.4.1",
@@ -71,7 +70,6 @@
71
70
  "devDependencies": {
72
71
  "@babel/core": "^7.20.0",
73
72
  "@babel/preset-env": "^7.20.0",
74
- "@react-native-community/cli-clean": "^12.3.0",
75
73
  "@react-native-community/cli-types": "^12.3.0",
76
74
  "@rnx-kit/eslint-config": "*",
77
75
  "@rnx-kit/jest-preset": "*",
@@ -1,7 +0,0 @@
1
- import type { CliServerApi, CoreDevMiddleware } from "./types";
2
- type CliClean = typeof import("@react-native-community/cli-clean");
3
- export declare function requireExternal(module: "@react-native-community/cli-clean"): CliClean;
4
- export declare function requireExternal(module: "@react-native-community/cli-server-api"): CliServerApi;
5
- export declare function requireExternal(module: "@react-native/dev-middleware"): CoreDevMiddleware;
6
- export {};
7
- //# sourceMappingURL=external.d.ts.map
package/src/align-deps.ts DELETED
@@ -1,82 +0,0 @@
1
- import type { Config as CLIConfig } from "@react-native-community/cli-types";
2
- import { cli, cliOptions } from "@rnx-kit/align-deps";
3
- import { pickValues } from "@rnx-kit/tools-language/properties";
4
-
5
- type CLIArgs = Record<string, string | number | boolean | undefined>;
6
-
7
- const optionsMap: Partial<Record<keyof typeof cliOptions, string>> = {
8
- "exclude-packages": "excludePackages",
9
- init: "init",
10
- presets: "presets",
11
- requirements: "requirements",
12
- "set-version": "setVersion",
13
- };
14
-
15
- export function rnxAlignDeps(
16
- _argv: string[],
17
- _config: CLIConfig,
18
- args: CLIArgs
19
- ): void {
20
- cli({
21
- ...pickValues(args, Object.values(optionsMap), Object.keys(optionsMap)),
22
- "diff-mode": args.diffMode?.toString(),
23
- loose: Boolean(args.loose),
24
- "migrate-config": Boolean(args.migrateConfig),
25
- "no-unmanaged": Boolean(args.noUnmanaged),
26
- verbose: Boolean(args.verbose),
27
- write: Boolean(args.write),
28
- });
29
- }
30
-
31
- export const rnxAlignDepsCommand = {
32
- name: "rnx-align-deps",
33
- description:
34
- "Manage dependencies within a repository and across many repositories",
35
- func: rnxAlignDeps,
36
- options: [
37
- {
38
- name: `--diff-mode [${cliOptions["diff-mode"].choices.join("|")}]`,
39
- description: cliOptions["diff-mode"].description,
40
- },
41
- {
42
- name: "--exclude-packages [packages]",
43
- description: cliOptions["exclude-packages"].description,
44
- },
45
- {
46
- name: `--init [${cliOptions.init.choices?.join("|")}]`,
47
- description: cliOptions.init.description,
48
- },
49
- {
50
- name: "--loose",
51
- description: cliOptions.loose.description,
52
- },
53
- {
54
- name: "--migrate-config",
55
- description: cliOptions["migrate-config"].description,
56
- },
57
- {
58
- name: "--no-unmanaged",
59
- description: cliOptions["no-unmanaged"].description,
60
- },
61
- {
62
- name: "--presets [presets]",
63
- description: cliOptions.presets.description,
64
- },
65
- {
66
- name: "--requirements [requirements]",
67
- description: cliOptions.requirements.description,
68
- },
69
- {
70
- name: "--set-version [versions]",
71
- description: cliOptions["set-version"].description,
72
- },
73
- {
74
- name: "--verbose",
75
- description: cliOptions.verbose.description,
76
- },
77
- {
78
- name: "--write",
79
- description: cliOptions.write.description,
80
- },
81
- ],
82
- };
@@ -1,82 +0,0 @@
1
- import { parsePlatform } from "@rnx-kit/tools-react-native/platform";
2
- import { asBoolean, asNumber, parseTransformProfile } from "../parsers";
3
-
4
- export const commonBundleCommandOptions = [
5
- {
6
- name: "--id [id]",
7
- description:
8
- "Target bundle definition. This is only needed when the rnx-kit configuration has multiple bundle definitions.",
9
- },
10
- {
11
- name: "--entry-file [path]",
12
- description:
13
- "Path to the root JavaScript or TypeScript file, either absolute or relative to the package.",
14
- },
15
- {
16
- name: "--platform [ios|android|windows|win32|macos]",
17
- description:
18
- "Target platform. When not given, all platforms in the rnx-kit configuration are bundled.",
19
- parse: parsePlatform,
20
- },
21
- {
22
- name: "--dev [boolean]",
23
- description: "If false, warnings are disabled and the bundle is minified.",
24
- default: true,
25
- parse: asBoolean,
26
- },
27
- {
28
- name: "--minify [boolean]",
29
- description:
30
- "Controls whether or not the bundle is minified. Disabling minification is useful for test builds.",
31
- parse: asBoolean,
32
- },
33
- {
34
- name: "--bundle-output [string]",
35
- description:
36
- "Path to the output bundle file, either absolute or relative to the package.",
37
- },
38
- {
39
- name: "--bundle-encoding [utf8|utf16le|ascii]",
40
- description: "Character encoding to use when writing the bundle file.",
41
- default: "utf8",
42
- },
43
- {
44
- name: "--max-workers [number]",
45
- description:
46
- "Specifies the maximum number of parallel worker threads to use for transforming files. This defaults to the number of cores available on your machine.",
47
- parse: asNumber,
48
- },
49
- {
50
- name: "--sourcemap-output [string]",
51
- description:
52
- "Path where the bundle source map is written, either absolute or relative to the package.",
53
- },
54
- {
55
- name: "--sourcemap-sources-root [string]",
56
- description:
57
- "Path to use when relativizing file entries in the bundle source map.",
58
- },
59
- {
60
- name: "--sourcemap-use-absolute-path",
61
- description: "Report SourceMapURL using its full path",
62
- },
63
- {
64
- name: "--assets-dest [path]",
65
- description:
66
- "Path where bundle assets like images are written, either absolute or relative to the package. If not given, assets are ignored.",
67
- },
68
- {
69
- name: "--unstable-transform-profile [string]",
70
- description:
71
- "Experimental, transform JS for a specific JS engine. Currently supported: hermes, hermes-canary, default",
72
- parse: parseTransformProfile,
73
- },
74
- {
75
- name: "--reset-cache",
76
- description: "Reset the Metro cache.",
77
- },
78
- {
79
- name: "--config [string]",
80
- description: "Path to the Metro configuration file.",
81
- },
82
- ];
@@ -1,16 +0,0 @@
1
- import type { BundleParameters } from "@rnx-kit/config";
2
-
3
- type DefaultPlugins = Pick<Required<BundleParameters>, "plugins" | "treeShake">;
4
-
5
- const defaultPlugins: DefaultPlugins = {
6
- plugins: [
7
- "@rnx-kit/metro-plugin-cyclic-dependencies-detector",
8
- "@rnx-kit/metro-plugin-duplicates-checker",
9
- "@rnx-kit/metro-plugin-typescript",
10
- ],
11
- treeShake: false,
12
- };
13
-
14
- export function getDefaultBundlerPlugins(): DefaultPlugins {
15
- return defaultPlugins;
16
- }