@nrwl/react-native 14.6.5 → 14.7.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.
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
- ## [14.6.5](https://github.com/nrwl/nx/compare/14.6.4...14.6.5) (2022-09-06)
6
+ # [14.7.0-beta.2](https://github.com/nrwl/nx/compare/14.6.5...14.7.0-beta.2) (2022-09-08)
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": "14.6.5",
3
+ "version": "14.7.0-beta.2",
4
4
  "description": "React Native brings React's declarative UI framework to iOS and Android. With React Native, you use native UI controls and have full access to the native platform.\n\nThe Nx Plugin for React Native contains generators for managing React Native applications and libraries within an Nx workspace. It provides:\n\n\n- Integration with libraries such as Jest, Detox, and Storybook.\n\n- Scaffolding for creating buildable libraries that can be published to npm.\n\n- Utilities for automatic workspace refactoring.",
5
5
  "keywords": [
6
6
  "Monorepo",
@@ -24,13 +24,13 @@
24
24
  "main": "index.js",
25
25
  "types": "index.d.ts",
26
26
  "dependencies": {
27
- "@nrwl/detox": "14.6.5",
28
- "@nrwl/devkit": "14.6.5",
29
- "@nrwl/jest": "14.6.5",
30
- "@nrwl/linter": "14.6.5",
31
- "@nrwl/react": "14.6.5",
32
- "@nrwl/storybook": "14.6.5",
33
- "@nrwl/workspace": "14.6.5",
27
+ "@nrwl/detox": "14.7.0-beta.2",
28
+ "@nrwl/devkit": "14.7.0-beta.2",
29
+ "@nrwl/jest": "14.7.0-beta.2",
30
+ "@nrwl/linter": "14.7.0-beta.2",
31
+ "@nrwl/react": "14.7.0-beta.2",
32
+ "@nrwl/storybook": "14.7.0-beta.2",
33
+ "@nrwl/workspace": "14.7.0-beta.2",
34
34
  "chalk": "^4.1.0",
35
35
  "enhanced-resolve": "^5.8.3",
36
36
  "fs-extra": "^10.1.0",
@@ -50,5 +50,5 @@
50
50
  },
51
51
  "schematics": "./generators.json",
52
52
  "typings": "./index.d.ts",
53
- "gitHead": "abd7dc12fd6f40e2b9a315aaa1792a316b026130"
53
+ "gitHead": "caec117288560cc7bbaae7a545f332e6dcfc0119"
54
54
  }
@@ -1,4 +1,4 @@
1
- import { logger } from '@nrwl/devkit';
1
+ import { NxJsonConfiguration } from '@nrwl/devkit';
2
2
  import { Tree, readJson, updateJson } from '@nrwl/devkit';
3
3
  import { createTreeWithEmptyV1Workspace } from '@nrwl/devkit/testing';
4
4
  import { reactNativeInitGenerator } from './init';
@@ -38,11 +38,23 @@ describe('init', () => {
38
38
 
39
39
  describe('babel config', () => {
40
40
  it('should create babel config if not present', async () => {
41
+ updateJson<NxJsonConfiguration>(tree, 'nx.json', (json) => {
42
+ json.namedInputs = {
43
+ sharedGlobals: ['{workspaceRoot}/exiting-file.json'],
44
+ };
45
+ return json;
46
+ });
47
+
41
48
  await reactNativeInitGenerator(tree, {
42
49
  unitTestRunner: 'none',
43
50
  e2eTestRunner: 'none',
44
51
  });
52
+
45
53
  expect(tree.exists('babel.config.json')).toBe(true);
54
+ const sharedGloabls = readJson<NxJsonConfiguration>(tree, 'nx.json')
55
+ .namedInputs.sharedGlobals;
56
+ expect(sharedGloabls).toContain('{workspaceRoot}/exiting-file.json');
57
+ expect(sharedGloabls).toContain('{workspaceRoot}/babel.config.json');
46
58
  });
47
59
 
48
60
  it('should not overwrite existing babel config', async () => {
@@ -3,12 +3,18 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.initRootBabelConfig = void 0;
4
4
  const devkit_1 = require("@nrwl/devkit");
5
5
  function initRootBabelConfig(tree) {
6
+ var _a;
6
7
  if (tree.exists('/babel.config.json') || tree.exists('/babel.config.js')) {
7
8
  return;
8
9
  }
9
10
  (0, devkit_1.writeJson)(tree, '/babel.config.json', {
10
11
  babelrcRoots: ['*'], // Make sure .babelrc files other than root can be loaded in a monorepo
11
12
  });
13
+ const workspaceConfiguration = (0, devkit_1.readWorkspaceConfiguration)(tree);
14
+ if ((_a = workspaceConfiguration.namedInputs) === null || _a === void 0 ? void 0 : _a.sharedGlobals) {
15
+ workspaceConfiguration.namedInputs.sharedGlobals.push('{workspaceRoot}/babel.config.json');
16
+ }
17
+ (0, devkit_1.updateWorkspaceConfiguration)(tree, workspaceConfiguration);
12
18
  }
13
19
  exports.initRootBabelConfig = initRootBabelConfig;
14
20
  //# sourceMappingURL=init-root-babel-config.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"init-root-babel-config.js","sourceRoot":"","sources":["../../../../../../../packages/react-native/src/generators/init/lib/init-root-babel-config.ts"],"names":[],"mappings":";;;AAAA,yCAA+C;AAE/C,SAAgB,mBAAmB,CAAC,IAAU;IAC5C,IAAI,IAAI,CAAC,MAAM,CAAC,oBAAoB,CAAC,IAAI,IAAI,CAAC,MAAM,CAAC,kBAAkB,CAAC,EAAE;QACxE,OAAO;KACR;IAED,IAAA,kBAAS,EAAC,IAAI,EAAE,oBAAoB,EAAE;QACpC,YAAY,EAAE,CAAC,GAAG,CAAC,EAAE,uEAAuE;KAC7F,CAAC,CAAC;AACL,CAAC;AARD,kDAQC"}
1
+ {"version":3,"file":"init-root-babel-config.js","sourceRoot":"","sources":["../../../../../../../packages/react-native/src/generators/init/lib/init-root-babel-config.ts"],"names":[],"mappings":";;;AAAA,yCAKsB;AAEtB,SAAgB,mBAAmB,CAAC,IAAU;;IAC5C,IAAI,IAAI,CAAC,MAAM,CAAC,oBAAoB,CAAC,IAAI,IAAI,CAAC,MAAM,CAAC,kBAAkB,CAAC,EAAE;QACxE,OAAO;KACR;IAED,IAAA,kBAAS,EAAC,IAAI,EAAE,oBAAoB,EAAE;QACpC,YAAY,EAAE,CAAC,GAAG,CAAC,EAAE,uEAAuE;KAC7F,CAAC,CAAC;IAEH,MAAM,sBAAsB,GAAG,IAAA,mCAA0B,EAAC,IAAI,CAAC,CAAC;IAEhE,IAAI,MAAA,sBAAsB,CAAC,WAAW,0CAAE,aAAa,EAAE;QACrD,sBAAsB,CAAC,WAAW,CAAC,aAAa,CAAC,IAAI,CACnD,mCAAmC,CACpC,CAAC;KACH;IACD,IAAA,qCAA4B,EAAC,IAAI,EAAE,sBAAsB,CAAC,CAAC;AAC7D,CAAC;AAjBD,kDAiBC"}