@nrwl/react-native 15.5.2 → 15.6.0-beta.0

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/CHANGELOG.md CHANGED
@@ -3,6 +3,6 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
- ## [15.5.2](https://github.com/nrwl/nx/compare/15.5.1...15.5.2) (2023-01-18)
6
+ # [15.6.0-beta.0](https://github.com/nrwl/nx/compare/15.5.1...15.6.0-beta.0) (2023-01-23)
7
7
 
8
8
  **Note:** Version bump only for package @nrwl/react-native
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nrwl/react-native",
3
- "version": "15.5.2",
3
+ "version": "15.6.0-beta.0",
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": [
@@ -25,13 +25,13 @@
25
25
  "main": "index.js",
26
26
  "types": "index.d.ts",
27
27
  "dependencies": {
28
- "@nrwl/detox": "15.5.2",
29
- "@nrwl/devkit": "15.5.2",
30
- "@nrwl/jest": "15.5.2",
31
- "@nrwl/js": "15.5.2",
32
- "@nrwl/linter": "15.5.2",
33
- "@nrwl/react": "15.5.2",
34
- "@nrwl/workspace": "15.5.2",
28
+ "@nrwl/detox": "15.6.0-beta.0",
29
+ "@nrwl/devkit": "15.6.0-beta.0",
30
+ "@nrwl/jest": "15.6.0-beta.0",
31
+ "@nrwl/js": "15.6.0-beta.0",
32
+ "@nrwl/linter": "15.6.0-beta.0",
33
+ "@nrwl/react": "15.6.0-beta.0",
34
+ "@nrwl/workspace": "15.6.0-beta.0",
35
35
  "chalk": "^4.1.0",
36
36
  "enhanced-resolve": "^5.8.3",
37
37
  "fs-extra": "^11.1.0",
@@ -53,5 +53,5 @@
53
53
  "publishConfig": {
54
54
  "access": "public"
55
55
  },
56
- "gitHead": "22d6519948033a60c7281fe4bb7e0a594d9fc5a6"
56
+ "gitHead": "077b55915b2da6b54f3f6a9f52b0681a1a350580"
57
57
  }
@@ -18,7 +18,8 @@
18
18
  "type": "string",
19
19
  "description": "Specify your app's build variant (e.g. `debug`, `release`).",
20
20
  "default": "debug",
21
- "examples": ["debug", "release"]
21
+ "examples": ["debug", "release"],
22
+ "x-priority": "important"
22
23
  },
23
24
  "appId": {
24
25
  "type": "string",
@@ -25,7 +25,8 @@
25
25
  "type": "string",
26
26
  "description": "Explicitly set the Xcode configuration to use.",
27
27
  "default": "Debug",
28
- "examples": ["Debug", "Release"]
28
+ "examples": ["Debug", "Release"],
29
+ "x-priority": "important"
29
30
  },
30
31
  "scheme": {
31
32
  "type": "string",
@@ -35,21 +36,25 @@
35
36
  "type": "string",
36
37
  "description": "Explicitly set simulator to use. Optionally include iOS version between parenthesis at the end to match an exact version: `iPhone X (12.1)`.",
37
38
  "default": "iPhone 13",
38
- "examples": ["iPhone 13", "iPhone X"]
39
+ "examples": ["iPhone 13", "iPhone X"],
40
+ "x-priority": "important"
39
41
  },
40
42
  "device": {
41
43
  "type": "string",
42
- "description": "Explicitly set device to use by name. The value is not required if you have a single device connected."
44
+ "description": "Explicitly set device to use by name. The value is not required if you have a single device connected.",
45
+ "x-priority": "important"
43
46
  },
44
47
  "install": {
45
48
  "type": "boolean",
46
49
  "description": "Runs `pod install` for native modules before building iOS app.",
47
- "default": true
50
+ "default": true,
51
+ "x-priority": "internal"
48
52
  },
49
53
  "sync": {
50
54
  "type": "boolean",
51
55
  "description": "Syncs npm dependencies to `package.json` (for React Native autolink). Always true when `--install` is used.",
52
- "default": true
56
+ "default": true,
57
+ "x-priority": "internal"
53
58
  },
54
59
  "port": {
55
60
  "type": "number",
@@ -6,11 +6,11 @@
6
6
  "description": "Create a React Application for Nx.",
7
7
  "examples": [
8
8
  {
9
- "command": "nx g app myapp --directory=nested",
9
+ "command": "nx g @nrwl/react-native:app myapp --directory=nested",
10
10
  "description": "Generate `apps/nested/myapp`"
11
11
  },
12
12
  {
13
- "command": "nx g app myapp --classComponent",
13
+ "command": "nx g @nrwl/react-native:app myapp --classComponent",
14
14
  "description": "Use class components instead of functional components"
15
15
  }
16
16
  ],
@@ -36,7 +36,8 @@
36
36
  "skipFormat": {
37
37
  "description": "Skip formatting files",
38
38
  "type": "boolean",
39
- "default": false
39
+ "default": false,
40
+ "x-priority": "internal"
40
41
  },
41
42
  "linter": {
42
43
  "description": "The tool to use for running lint checks.",
@@ -74,12 +75,14 @@
74
75
  "install": {
75
76
  "type": "boolean",
76
77
  "description": "Runs `pod install` for native modules before building iOS app.",
77
- "default": true
78
+ "default": true,
79
+ "x-priority": "internal"
78
80
  },
79
81
  "skipPackageJson": {
80
82
  "description": "Do not add dependencies to `package.json`.",
81
83
  "type": "boolean",
82
- "default": false
84
+ "default": false,
85
+ "x-priority": "internal"
83
86
  }
84
87
  },
85
88
  "required": []
@@ -7,11 +7,11 @@
7
7
  "type": "object",
8
8
  "examples": [
9
9
  {
10
- "command": "nx g component my-component --project=mylib",
10
+ "command": "nx g @nrwl/react-native:component my-component --project=mylib",
11
11
  "description": "Generate a component in the `mylib` library"
12
12
  },
13
13
  {
14
- "command": "nx g component my-component --project=mylib --classComponent",
14
+ "command": "nx g @nrwl/react-native:component my-component --project=mylib --classComponent",
15
15
  "description": "Generate a class component in the `mylib` library"
16
16
  }
17
17
  ],
@@ -46,7 +46,8 @@
46
46
  },
47
47
  "directory": {
48
48
  "type": "string",
49
- "description": "Create the component under this directory (can be nested)."
49
+ "description": "Create the component under this directory (can be nested).",
50
+ "x-priority": "important"
50
51
  },
51
52
  "flat": {
52
53
  "type": "boolean",
@@ -15,7 +15,8 @@
15
15
  "skipFormat": {
16
16
  "description": "Skip formatting files.",
17
17
  "type": "boolean",
18
- "default": false
18
+ "default": false,
19
+ "x-priority": "internal"
19
20
  },
20
21
  "e2eTestRunner": {
21
22
  "description": "Adds the specified E2E test runner.",
@@ -31,7 +32,8 @@
31
32
  "skipPackageJson": {
32
33
  "description": "Do not add dependencies to `package.json`.",
33
34
  "type": "boolean",
34
- "default": false
35
+ "default": false,
36
+ "x-priority": "internal"
35
37
  }
36
38
  },
37
39
  "required": []
@@ -16,7 +16,6 @@ export interface Schema {
16
16
  buildable?: boolean;
17
17
  importPath?: string;
18
18
  js?: boolean;
19
- globalCss?: boolean;
20
19
  strict?: boolean;
21
20
  setParserOptionsProject?: boolean;
22
21
  skipPackageJson?: boolean; //default is false
@@ -7,7 +7,7 @@
7
7
  "type": "object",
8
8
  "examples": [
9
9
  {
10
- "command": "nx g lib mylib --directory=myapp",
10
+ "command": "nx g @nrwl/react-native:lib mylib --directory=myapp",
11
11
  "description": "Generate `libs/myapp/mylib`"
12
12
  }
13
13
  ],
@@ -24,7 +24,9 @@
24
24
  },
25
25
  "directory": {
26
26
  "type": "string",
27
- "description": "A directory where the lib is placed."
27
+ "description": "A directory where the lib is placed.",
28
+ "alias": "dir",
29
+ "x-priority": "important"
28
30
  },
29
31
  "linter": {
30
32
  "description": "The tool to use for running lint checks.",
@@ -46,12 +48,14 @@
46
48
  "skipFormat": {
47
49
  "description": "Skip formatting files.",
48
50
  "type": "boolean",
49
- "default": false
51
+ "default": false,
52
+ "x-priority": "internal"
50
53
  },
51
54
  "skipTsConfig": {
52
55
  "type": "boolean",
53
56
  "default": false,
54
- "description": "Do not update `tsconfig.json` for development experience."
57
+ "description": "Do not update `tsconfig.json` for development experience.",
58
+ "x-priority": "internal"
55
59
  },
56
60
  "pascalCaseFiles": {
57
61
  "type": "boolean",
@@ -77,11 +81,6 @@
77
81
  "description": "Generate JavaScript files rather than TypeScript files.",
78
82
  "default": false
79
83
  },
80
- "globalCss": {
81
- "type": "boolean",
82
- "description": "When `true`, the stylesheet is generated using global CSS instead of CSS modules (e.g. file is `*.css` rather than `*.module.css`).",
83
- "default": false
84
- },
85
84
  "strict": {
86
85
  "type": "boolean",
87
86
  "description": "Whether to enable tsconfig strict mode or not.",
@@ -95,7 +94,8 @@
95
94
  "skipPackageJson": {
96
95
  "description": "Do not add dependencies to `package.json`.",
97
96
  "type": "boolean",
98
- "default": false
97
+ "default": false,
98
+ "x-priority": "internal"
99
99
  }
100
100
  },
101
101
  "required": ["name"]
@@ -1,9 +1,9 @@
1
1
  import { configure, getStorybookUI } from '@storybook/react-native';
2
2
 
3
- import { loadStories } from '../../../../.storybook/story-loader';
3
+ import { loadStories } from '<%= offsetFromRoot %>../.storybook/story-loader';
4
4
 
5
- configure(loadStories(), module, false);
5
+ configure(() => loadStories(), module);
6
6
 
7
- const StorybookUIRoot = getStorybookUI({});
7
+ const StorybookUIRoot = getStorybookUI();
8
8
 
9
- export default StorybookUIRoot;
9
+ export default StorybookUIRoot;
@@ -9,29 +9,28 @@ const chalk = require("chalk");
9
9
  * This function generate ./storybook under project root.
10
10
  */
11
11
  function createStorybookFiles(host, schema) {
12
- var _a;
12
+ var _a, _b;
13
13
  return tslib_1.__awaiter(this, void 0, void 0, function* () {
14
14
  const { root, projectType, targets, sourceRoot } = (0, devkit_1.readProjectConfiguration)(host, schema.name);
15
15
  // do not proceed if not a react native project
16
- if (((_a = targets === null || targets === void 0 ? void 0 : targets.start) === null || _a === void 0 ? void 0 : _a.executor) !== '@nrwl/react-native:start') {
16
+ if (((_a = targets === null || targets === void 0 ? void 0 : targets.start) === null || _a === void 0 ? void 0 : _a.executor) !== '@nrwl/react-native:start' &&
17
+ ((_b = targets === null || targets === void 0 ? void 0 : targets.start) === null || _b === void 0 ? void 0 : _b.executor) !== '@nrwl/expo:start') {
18
+ devkit_1.logger.error(`Unable to add storybook to ${schema.name}. It is not a Nx React Native / Expo project.`);
17
19
  return;
18
20
  }
19
21
  const storybookUIFileName = schema.js ? 'storybook.js' : 'storybook.ts';
20
22
  const storybookUIFilePath = (0, path_1.join)(root, `./${storybookUIFileName}`);
21
23
  if (host.exists(storybookUIFilePath)) {
22
- devkit_1.logger.warn(`${storybookUIFileName} file already exists for React Native ${projectType} ${schema.name}! Skipping generating this file.`);
24
+ devkit_1.logger.warn(`${storybookUIFileName} file already exists for ${projectType} ${schema.name}! Skipping generating this file.`);
23
25
  return;
24
26
  }
25
27
  if (projectType !== 'application') {
26
28
  devkit_1.logger.info(`${chalk.bold.cyan('info')} To see your Storybook stories on the device, you should start your mobile app for the <platform> of your choice (typically ios or android).`);
27
29
  }
28
- const projectDirectory = projectType === 'application' ? 'app' : 'lib';
29
- devkit_1.logger.debug(`Adding storybook file to React Native app ${projectDirectory}`);
30
30
  // copy files to app's .storybook folder
31
31
  (0, devkit_1.generateFiles)(host, (0, path_1.join)(__dirname, '../files/app'), (0, path_1.join)(root, 'src', 'storybook'), {
32
32
  tmpl: '',
33
33
  offsetFromRoot: (0, devkit_1.offsetFromRoot)(sourceRoot),
34
- projectType: projectDirectory,
35
34
  });
36
35
  // copy files to workspace root's .storybook folder
37
36
  (0, devkit_1.generateFiles)(host, (0, path_1.join)(__dirname, '../files/root'), (0, path_1.join)(root, (0, devkit_1.offsetFromRoot)(root), '.storybook'), {
@@ -1 +1 @@
1
- {"version":3,"file":"create-storybook-files.js","sourceRoot":"","sources":["../../../../../../../packages/react-native/src/generators/storybook-configuration/lib/create-storybook-files.ts"],"names":[],"mappings":";;;;AAAA,yCAOsB;AACtB,+BAA4B;AAC5B,+BAA+B;AAI/B;;GAEG;AACH,SAAsB,oBAAoB,CACxC,IAAU,EACV,MAAgC;;;QAEhC,MAAM,EAAE,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,UAAU,EAAE,GAAG,IAAA,iCAAwB,EACzE,IAAI,EACJ,MAAM,CAAC,IAAI,CACZ,CAAC;QAEF,+CAA+C;QAC/C,IAAI,CAAA,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,KAAK,0CAAE,QAAQ,MAAK,0BAA0B,EAAE;YAC3D,OAAO;SACR;QAED,MAAM,mBAAmB,GA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;;CACF;AA5DD,oDA4DC"}
1
+ {"version":3,"file":"create-storybook-files.js","sourceRoot":"","sources":["../../../../../../../packages/react-native/src/generators/storybook-configuration/lib/create-storybook-files.ts"],"names":[],"mappings":";;;;AAAA,yCAOsB;AACtB,+BAA4B;AAC5B,+BAA+B;AAI/B;;GAEG;AACH,SAAsB,oBAAoB,CACxC,IAAU,EACV,MAAgC;;;QAEhC,MAAM,EAAE,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,UAAU,EAAE,GAAG,IAAA,iCAAwB,EACzE,IAAI,EACJ,MAAM,CAAC,IAAI,CACZ,CAAC;QAEF,+CAA+C;QAC/C,IACE,CAAA,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,KAAK,0CAAE,QAAQ,MAAK,0BAA0B;YACvD,CAAA,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,KAAK,0CAAE,QAAQ,MAAK,kBAAkB,EAC/C;YACA,eAAM,CAAC,KAAK,CACV,8BAA8B,MAAM,CAAC,IAAI,+CAA+C,CACzF,CAAC;YACF,OAAO;SACR;QAED,MAAM,mBAAmB,GAAG,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,cAAc,CAAC;QACxE,MAAM,mBAAmB,GAAG,IAAA,WAAI,EAAC,IAAI,EAAE,KAAK,mBAAmB,EAAE,CAAC,CAAC;QAEnE,IAAI,IAAI,CAAC,MAAM,CAAC,mBAAmB,CAAC,EAAE;YACpC,eAAM,CAAC,IAAI,CACT,GAAG,mBAAmB,4BAA4B,WAAW,IAAI,MAAM,CAAC,IAAI,kCAAkC,CAC/G,CAAC;YACF,OAAO;SACR;QACD,IAAI,WAAW,KAAK,aAAa,EAAE;YACjC,eAAM,CAAC,IAAI,CACT,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAChB,MAAM,CACP,8IAA8I,CAChJ,CAAC;SACH;QAED,wCAAwC;QACxC,IAAA,sBAAa,EACX,IAAI,EACJ,IAAA,WAAI,EAAC,SAAS,EAAE,cAAc,CAAC,EAC/B,IAAA,WAAI,EAAC,IAAI,EAAE,KAAK,EAAE,WAAW,CAAC,EAC9B;YACE,IAAI,EAAE,EAAE;YACR,cAAc,EAAE,IAAA,uBAAc,EAAC,UAAU,CAAC;SAC3C,CACF,CAAC;QAEF,mDAAmD;QACnD,IAAA,sBAAa,EACX,IAAI,EACJ,IAAA,WAAI,EAAC,SAAS,EAAE,eAAe,CAAC,EAChC,IAAA,WAAI,EAAC,IAAI,EAAE,IAAA,uBAAc,EAAC,IAAI,CAAC,EAAE,YAAY,CAAC,EAC9C;YACE,IAAI,EAAE,EAAE;SACT,CACF,CAAC;QAEF,IAAI,MAAM,CAAC,EAAE,EAAE;YACb,IAAA,aAAI,EAAC,IAAI,CAAC,CAAC;SACZ;;CACF;AA7DD,oDA6DC"}
@@ -21,7 +21,8 @@
21
21
  "type": "boolean",
22
22
  "description": "Automatically generate *.stories.ts files for components declared in this project?",
23
23
  "x-prompt": "Automatically generate *.stories.ts files for components declared in this project?",
24
- "default": true
24
+ "default": true,
25
+ "x-priority": "important"
25
26
  },
26
27
  "js": {
27
28
  "type": "boolean",
@@ -33,7 +33,8 @@
33
33
  "install": {
34
34
  "type": "boolean",
35
35
  "description": "Runs `pod install` for native modules before building iOS app.",
36
- "default": true
36
+ "default": true,
37
+ "x-priority": "internal"
37
38
  }
38
39
  },
39
40
  "required": ["name"]