@nx/react-native 17.3.0-beta.5 → 17.3.0-beta.6

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/react-native",
3
- "version": "17.3.0-beta.5",
3
+ "version": "17.3.0-beta.6",
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": [
@@ -32,18 +32,18 @@
32
32
  "ignore": "^5.0.4",
33
33
  "metro-config": "~0.76.8",
34
34
  "metro-resolver": "~0.76.8",
35
- "minimatch": "3.0.5",
35
+ "minimatch": "9.0.3",
36
36
  "node-fetch": "^2.6.7",
37
37
  "tsconfig-paths": "^4.1.2",
38
38
  "tslib": "^2.3.0",
39
- "@nx/detox": "17.3.0-beta.5",
40
- "@nx/devkit": "17.3.0-beta.5",
41
- "@nx/jest": "17.3.0-beta.5",
42
- "@nx/js": "17.3.0-beta.5",
43
- "@nx/eslint": "17.3.0-beta.5",
44
- "@nx/react": "17.3.0-beta.5",
45
- "@nx/workspace": "17.3.0-beta.5",
46
- "@nrwl/react-native": "17.3.0-beta.5"
39
+ "@nx/detox": "17.3.0-beta.6",
40
+ "@nx/devkit": "17.3.0-beta.6",
41
+ "@nx/jest": "17.3.0-beta.6",
42
+ "@nx/js": "17.3.0-beta.6",
43
+ "@nx/eslint": "17.3.0-beta.6",
44
+ "@nx/react": "17.3.0-beta.6",
45
+ "@nx/workspace": "17.3.0-beta.6",
46
+ "@nrwl/react-native": "17.3.0-beta.6"
47
47
  },
48
48
  "peerDependencies": {
49
49
  "react-native": ">= 0.72.0 < 0.73.0"
@@ -1,5 +1,5 @@
1
1
  import { GeneratorCallback, Tree } from '@nx/devkit';
2
2
  import { Schema } from './schema';
3
3
  export declare function reactNativeInitGenerator(host: Tree, schema: Schema): Promise<GeneratorCallback>;
4
- export declare function updateDependencies(host: Tree): GeneratorCallback;
4
+ export declare function updateDependencies(host: Tree, schema: Schema): GeneratorCallback;
5
5
  export default reactNativeInitGenerator;
@@ -12,7 +12,7 @@ async function reactNativeInitGenerator(host, schema) {
12
12
  const tasks = [];
13
13
  if (!schema.skipPackageJson) {
14
14
  tasks.push(moveDependency(host));
15
- tasks.push(updateDependencies(host));
15
+ tasks.push(updateDependencies(host, schema));
16
16
  }
17
17
  if (!schema.skipFormat) {
18
18
  await (0, devkit_1.formatFiles)(host);
@@ -20,7 +20,7 @@ async function reactNativeInitGenerator(host, schema) {
20
20
  return (0, devkit_1.runTasksInSerial)(...tasks);
21
21
  }
22
22
  exports.reactNativeInitGenerator = reactNativeInitGenerator;
23
- function updateDependencies(host) {
23
+ function updateDependencies(host, schema) {
24
24
  return (0, devkit_1.addDependenciesToPackageJson)(host, {
25
25
  react: versions_1.reactVersion,
26
26
  'react-dom': versions_1.reactDomVersion,
@@ -30,7 +30,7 @@ function updateDependencies(host) {
30
30
  '@react-native-community/cli': versions_1.reactNativeCommunityCli,
31
31
  '@react-native-community/cli-platform-android': versions_1.reactNativeCommunityCliAndroid,
32
32
  '@react-native-community/cli-platform-ios': versions_1.reactNativeCommunityCliIos,
33
- });
33
+ }, undefined, schema.keepExistingVersions);
34
34
  }
35
35
  exports.updateDependencies = updateDependencies;
36
36
  function moveDependency(host) {
@@ -1,4 +1,5 @@
1
1
  export interface Schema {
2
2
  skipFormat?: boolean;
3
3
  skipPackageJson?: boolean; //default is false
4
+ keepExistingVersions?: boolean; //default is false
4
5
  }
@@ -17,6 +17,12 @@
17
17
  "type": "boolean",
18
18
  "default": false,
19
19
  "x-priority": "internal"
20
+ },
21
+ "keepExistingVersions": {
22
+ "type": "boolean",
23
+ "x-priority": "internal",
24
+ "description": "Keep existing dependencies versions",
25
+ "default": false
20
26
  }
21
27
  },
22
28
  "required": []
@@ -5,7 +5,7 @@ const devkit_1 = require("@nx/devkit");
5
5
  const path_1 = require("path");
6
6
  const component_story_1 = require("../component-story/component-story");
7
7
  const stories_1 = require("@nx/react/src/generators/stories/stories");
8
- const minimatch = require("minimatch");
8
+ const minimatch_1 = require("minimatch");
9
9
  const versions_1 = require("../../utils/versions");
10
10
  async function createAllStories(tree, projectName, ignorePaths) {
11
11
  (0, devkit_1.ensurePackage)('@nx/storybook', versions_1.nxVersion);
@@ -16,7 +16,7 @@ async function createAllStories(tree, projectName, ignorePaths) {
16
16
  const projectPath = await (0, stories_1.projectRootPath)(tree, projectConfiguration);
17
17
  let componentPaths = [];
18
18
  (0, devkit_1.visitNotIgnoredFiles)(tree, projectPath, (path) => {
19
- if (ignorePaths?.some((pattern) => minimatch(path, pattern)))
19
+ if (ignorePaths?.some((pattern) => (0, minimatch_1.minimatch)(path, pattern)))
20
20
  return;
21
21
  if ((path.endsWith('.tsx') && !path.endsWith('.spec.tsx')) ||
22
22
  (path.endsWith('.js') && !path.endsWith('.spec.js')) ||