@nx/react-native 19.0.0-beta.1 → 19.0.0-beta.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.
Files changed (2) hide show
  1. package/package.json +8 -8
  2. package/plugins/plugin.js +4 -17
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/react-native",
3
- "version": "19.0.0-beta.1",
3
+ "version": "19.0.0-beta.2",
4
4
  "private": false,
5
5
  "description": "The Nx Plugin for React Native contains generators for managing React Native applications and libraries within an Nx workspace. It provides: \n\n-Integration with libraries such as Jest, Detox, and Storybook.\n-Scaffolding for creating buildable libraries that can be published to npm.\n-Utilities for automatic workspace refactoring.",
6
6
  "keywords": [
@@ -36,13 +36,13 @@
36
36
  "node-fetch": "^2.6.7",
37
37
  "tsconfig-paths": "^4.1.2",
38
38
  "tslib": "^2.3.0",
39
- "@nx/devkit": "19.0.0-beta.1",
40
- "@nx/jest": "19.0.0-beta.1",
41
- "@nx/js": "19.0.0-beta.1",
42
- "@nx/eslint": "19.0.0-beta.1",
43
- "@nx/react": "19.0.0-beta.1",
44
- "@nx/workspace": "19.0.0-beta.1",
45
- "@nrwl/react-native": "19.0.0-beta.1"
39
+ "@nx/devkit": "19.0.0-beta.2",
40
+ "@nx/jest": "19.0.0-beta.2",
41
+ "@nx/js": "19.0.0-beta.2",
42
+ "@nx/eslint": "19.0.0-beta.2",
43
+ "@nx/react": "19.0.0-beta.2",
44
+ "@nx/workspace": "19.0.0-beta.2",
45
+ "@nrwl/react-native": "19.0.0-beta.2"
46
46
  },
47
47
  "executors": "./executors.json",
48
48
  "ng-update": {
package/plugins/plugin.js CHANGED
@@ -8,6 +8,7 @@ const get_named_inputs_1 = require("@nx/devkit/src/utils/get-named-inputs");
8
8
  const fs_1 = require("fs");
9
9
  const calculate_hash_for_create_nodes_1 = require("@nx/devkit/src/utils/calculate-hash-for-create-nodes");
10
10
  const cache_directory_1 = require("nx/src/utils/cache-directory");
11
+ const config_utils_1 = require("@nx/devkit/src/utils/config-utils");
11
12
  const cachePath = (0, path_1.join)(cache_directory_1.projectGraphCacheDirectory, 'react-native.hash');
12
13
  const targetsCache = (0, fs_1.existsSync)(cachePath) ? readTargetsCache() : {};
13
14
  const calculatedTargets = {};
@@ -24,7 +25,7 @@ const createDependencies = () => {
24
25
  exports.createDependencies = createDependencies;
25
26
  exports.createNodes = [
26
27
  '**/app.{json,config.js}',
27
- (configFilePath, options, context) => {
28
+ async (configFilePath, options, context) => {
28
29
  options = normalizeOptions(options);
29
30
  const projectRoot = (0, path_1.dirname)(configFilePath);
30
31
  // Do not create a project if package.json or project.json or metro.config.js isn't there.
@@ -33,7 +34,7 @@ exports.createNodes = [
33
34
  !siblingFiles.includes('metro.config.js')) {
34
35
  return {};
35
36
  }
36
- const appConfig = getAppConfig(configFilePath, context);
37
+ const appConfig = await getAppConfig(configFilePath, context);
37
38
  if (appConfig.expo) {
38
39
  return {};
39
40
  }
@@ -113,8 +114,7 @@ function buildReactNativeTargets(projectRoot, options, context) {
113
114
  }
114
115
  function getAppConfig(configFilePath, context) {
115
116
  const resolvedPath = (0, path_1.join)(context.workspaceRoot, configFilePath);
116
- let module = load(resolvedPath);
117
- return module.default ?? module;
117
+ return (0, config_utils_1.loadConfigFile)(resolvedPath);
118
118
  }
119
119
  function getInputs(namedInputs) {
120
120
  return [
@@ -134,19 +134,6 @@ function getOutputs(projectRoot, dir) {
134
134
  return `{workspaceRoot}/${projectRoot}/${dir}`;
135
135
  }
136
136
  }
137
- /**
138
- * Load the module after ensuring that the require cache is cleared.
139
- */
140
- function load(path) {
141
- // Clear cache if the path is in the cache
142
- if (require.cache[path]) {
143
- for (const k of Object.keys(require.cache)) {
144
- delete require.cache[k];
145
- }
146
- }
147
- // Then require
148
- return require(path);
149
- }
150
137
  function normalizeOptions(options) {
151
138
  options ??= {};
152
139
  options.startTargetName ??= 'start';