@nx/react-native 19.1.0-beta.3 → 19.1.0-beta.4

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 +11 -11
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/react-native",
3
- "version": "19.1.0-beta.3",
3
+ "version": "19.1.0-beta.4",
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": [
@@ -37,13 +37,13 @@
37
37
  "node-fetch": "^2.6.7",
38
38
  "tsconfig-paths": "^4.1.2",
39
39
  "tslib": "^2.3.0",
40
- "@nx/devkit": "19.1.0-beta.3",
41
- "@nx/jest": "19.1.0-beta.3",
42
- "@nx/js": "19.1.0-beta.3",
43
- "@nx/eslint": "19.1.0-beta.3",
44
- "@nx/react": "19.1.0-beta.3",
45
- "@nx/workspace": "19.1.0-beta.3",
46
- "@nrwl/react-native": "19.1.0-beta.3"
40
+ "@nx/devkit": "19.1.0-beta.4",
41
+ "@nx/jest": "19.1.0-beta.4",
42
+ "@nx/js": "19.1.0-beta.4",
43
+ "@nx/eslint": "19.1.0-beta.4",
44
+ "@nx/react": "19.1.0-beta.4",
45
+ "@nx/workspace": "19.1.0-beta.4",
46
+ "@nrwl/react-native": "19.1.0-beta.4"
47
47
  },
48
48
  "executors": "./executors.json",
49
49
  "ng-update": {
package/plugins/plugin.js CHANGED
@@ -10,16 +10,19 @@ const calculate_hash_for_create_nodes_1 = require("@nx/devkit/src/utils/calculat
10
10
  const cache_directory_1 = require("nx/src/utils/cache-directory");
11
11
  const config_utils_1 = require("@nx/devkit/src/utils/config-utils");
12
12
  const cachePath = (0, path_1.join)(cache_directory_1.projectGraphCacheDirectory, 'react-native.hash');
13
- const targetsCache = (0, fs_1.existsSync)(cachePath) ? readTargetsCache() : {};
14
- const calculatedTargets = {};
13
+ const targetsCache = readTargetsCache();
15
14
  function readTargetsCache() {
16
- return (0, devkit_1.readJsonFile)(cachePath);
15
+ return (0, fs_1.existsSync)(cachePath) ? (0, devkit_1.readJsonFile)(cachePath) : {};
17
16
  }
18
- function writeTargetsToCache(targets) {
19
- (0, devkit_1.writeJsonFile)(cachePath, targets);
17
+ function writeTargetsToCache() {
18
+ const oldCache = readTargetsCache();
19
+ (0, devkit_1.writeJsonFile)(cachePath, {
20
+ ...oldCache,
21
+ ...targetsCache,
22
+ });
20
23
  }
21
24
  const createDependencies = () => {
22
- writeTargetsToCache(calculatedTargets);
25
+ writeTargetsToCache();
23
26
  return [];
24
27
  };
25
28
  exports.createDependencies = createDependencies;
@@ -41,14 +44,11 @@ exports.createNodes = [
41
44
  const hash = (0, calculate_hash_for_create_nodes_1.calculateHashForCreateNodes)(projectRoot, options, context, [
42
45
  (0, js_1.getLockFileName)((0, devkit_1.detectPackageManager)(context.workspaceRoot)),
43
46
  ]);
44
- const targets = targetsCache[hash]
45
- ? targetsCache[hash]
46
- : buildReactNativeTargets(projectRoot, options, context);
47
- calculatedTargets[hash] = targets;
47
+ targetsCache[hash] ??= buildReactNativeTargets(projectRoot, options, context);
48
48
  return {
49
49
  projects: {
50
50
  [projectRoot]: {
51
- targets,
51
+ targets: targetsCache[hash],
52
52
  },
53
53
  },
54
54
  };