@react-native/community-cli-plugin 0.74.0-nightly-20231128-528f97152 → 0.74.0-nightly-20231129-c8db60c7a

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.
@@ -25,7 +25,7 @@ function _interopRequireDefault(obj) {
25
25
  /**
26
26
  * Get the config options to override based on RN CLI inputs.
27
27
  */
28
- function getOverrideConfig(ctx) {
28
+ function getOverrideConfig(ctx, config) {
29
29
  const outOfTreePlatforms = Object.keys(ctx.platforms).filter(
30
30
  (platform) => ctx.platforms[platform].npmPackageName
31
31
  );
@@ -38,7 +38,8 @@ function getOverrideConfig(ctx) {
38
38
  outOfTreePlatforms.reduce((result, platform) => {
39
39
  result[platform] = ctx.platforms[platform].npmPackageName;
40
40
  return result;
41
- }, {})
41
+ }, {}),
42
+ config.resolver?.resolveRequest
42
43
  );
43
44
  }
44
45
  return {
@@ -73,7 +74,6 @@ function getOverrideConfig(ctx) {
73
74
  * dynamic user options in `ctx`.
74
75
  */
75
76
  async function loadMetroConfig(ctx, options = {}) {
76
- const overrideConfig = getOverrideConfig(ctx);
77
77
  const cwd = ctx.root;
78
78
  const projectConfig = await (0, _metroConfig.resolveConfig)(
79
79
  options.config,
@@ -97,11 +97,10 @@ This warning will be removed in future (https://github.com/facebook/metro/issues
97
97
  _cliTools.logger.warn(line);
98
98
  }
99
99
  }
100
- return (0, _metroConfig.mergeConfig)(
101
- await (0, _metroConfig.loadConfig)({
102
- cwd,
103
- ...options,
104
- }),
105
- overrideConfig
106
- );
100
+ const config = await (0, _metroConfig.loadConfig)({
101
+ cwd,
102
+ ...options,
103
+ });
104
+ const overrideConfig = getOverrideConfig(ctx, config);
105
+ return (0, _metroConfig.mergeConfig)(config, overrideConfig);
107
106
  }
@@ -29,7 +29,7 @@ exports.reactNativePlatformResolver = reactNativePlatformResolver;
29
29
  * macos: 'react-native-macos'
30
30
  * }
31
31
  */
32
- function reactNativePlatformResolver(platformImplementations) {
32
+ function reactNativePlatformResolver(platformImplementations, customResolver) {
33
33
  return (context, moduleName, platform) => {
34
34
  let modifiedModuleName = moduleName;
35
35
  if (platform != null && platformImplementations[platform]) {
@@ -41,6 +41,9 @@ function reactNativePlatformResolver(platformImplementations) {
41
41
  }/${modifiedModuleName.slice("react-native/".length)}`;
42
42
  }
43
43
  }
44
+ if (customResolver) {
45
+ return customResolver(context, modifiedModuleName, platform);
46
+ }
44
47
  return context.resolveRequest(context, modifiedModuleName, platform);
45
48
  };
46
49
  }
@@ -25,6 +25,9 @@ import type { CustomResolver } from "metro-resolver";
25
25
  * macos: 'react-native-macos'
26
26
  * }
27
27
  */
28
- declare export function reactNativePlatformResolver(platformImplementations: {
29
- [platform: string]: string,
30
- }): CustomResolver;
28
+ declare export function reactNativePlatformResolver(
29
+ platformImplementations: {
30
+ [platform: string]: string,
31
+ },
32
+ customResolver: ?CustomResolver
33
+ ): CustomResolver;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-native/community-cli-plugin",
3
- "version": "0.74.0-nightly-20231128-528f97152",
3
+ "version": "0.74.0-nightly-20231129-c8db60c7a",
4
4
  "description": "Core CLI commands for React Native",
5
5
  "keywords": [
6
6
  "react-native",
@@ -22,10 +22,10 @@
22
22
  "dist"
23
23
  ],
24
24
  "dependencies": {
25
- "@react-native/dev-middleware": "0.74.0-nightly-20231128-528f97152",
25
+ "@react-native/dev-middleware": "0.74.0-nightly-20231129-c8db60c7a",
26
26
  "@react-native-community/cli-server-api": "12.0.0",
27
27
  "@react-native-community/cli-tools": "12.0.0",
28
- "@react-native/metro-babel-transformer": "0.74.0-nightly-20231128-528f97152",
28
+ "@react-native/metro-babel-transformer": "0.74.0-nightly-20231129-c8db60c7a",
29
29
  "chalk": "^4.0.0",
30
30
  "execa": "^5.1.1",
31
31
  "metro": "^0.80.0",