@nx/react-native 0.0.0-pr-28834-93bb8ce → 0.0.0-pr-28808-0f14212

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": "0.0.0-pr-28834-93bb8ce",
3
+ "version": "0.0.0-pr-28808-0f14212",
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,12 +36,12 @@
36
36
  "node-fetch": "^2.6.7",
37
37
  "tsconfig-paths": "^4.1.2",
38
38
  "tslib": "^2.3.0",
39
- "@nx/devkit": "0.0.0-pr-28834-93bb8ce",
40
- "@nx/jest": "0.0.0-pr-28834-93bb8ce",
41
- "@nx/js": "0.0.0-pr-28834-93bb8ce",
42
- "@nx/eslint": "0.0.0-pr-28834-93bb8ce",
43
- "@nx/react": "0.0.0-pr-28834-93bb8ce",
44
- "@nx/workspace": "0.0.0-pr-28834-93bb8ce"
39
+ "@nx/devkit": "0.0.0-pr-28808-0f14212",
40
+ "@nx/jest": "0.0.0-pr-28808-0f14212",
41
+ "@nx/js": "0.0.0-pr-28808-0f14212",
42
+ "@nx/eslint": "0.0.0-pr-28808-0f14212",
43
+ "@nx/react": "0.0.0-pr-28808-0f14212",
44
+ "@nx/workspace": "0.0.0-pr-28808-0f14212"
45
45
  },
46
46
  "executors": "./executors.json",
47
47
  "ng-update": {
@@ -5,7 +5,6 @@ exports.reactNativeApplicationGeneratorInternal = reactNativeApplicationGenerato
5
5
  const devkit_1 = require("@nx/devkit");
6
6
  const js_1 = require("@nx/js");
7
7
  const log_show_project_command_1 = require("@nx/devkit/src/utils/log-show-project-command");
8
- const ts_solution_setup_1 = require("@nx/js/src/utils/typescript/ts-solution-setup");
9
8
  const add_linting_1 = require("../../utils/add-linting");
10
9
  const add_jest_1 = require("../../utils/add-jest");
11
10
  const chmod_android_gradle_files_1 = require("../../utils/chmod-android-gradle-files");
@@ -18,6 +17,7 @@ const create_application_files_1 = require("./lib/create-application-files");
18
17
  const add_e2e_1 = require("./lib/add-e2e");
19
18
  const ensure_dependencies_1 = require("../../utils/ensure-dependencies");
20
19
  const sync_deps_impl_1 = require("../../executors/sync-deps/sync-deps.impl");
20
+ const ts_solution_setup_1 = require("@nx/js/src/utils/typescript/ts-solution-setup");
21
21
  async function reactNativeApplicationGenerator(host, schema) {
22
22
  return await reactNativeApplicationGeneratorInternal(host, {
23
23
  addPlugin: false,
@@ -25,14 +25,15 @@ async function reactNativeApplicationGenerator(host, schema) {
25
25
  });
26
26
  }
27
27
  async function reactNativeApplicationGeneratorInternal(host, schema) {
28
- (0, ts_solution_setup_1.assertNotUsingTsSolutionSetup)(host, 'react-native', 'application');
29
- const options = await (0, normalize_options_1.normalizeOptions)(host, schema);
30
28
  const tasks = [];
31
29
  const jsInitTask = await (0, js_1.initGenerator)(host, {
32
30
  ...schema,
33
31
  skipFormat: true,
32
+ addTsPlugin: process.env.NX_ADD_PLUGINS !== 'false' &&
33
+ process.env.NX_ADD_TS_PLUGIN !== 'false',
34
34
  });
35
35
  tasks.push(jsInitTask);
36
+ const options = await (0, normalize_options_1.normalizeOptions)(host, schema);
36
37
  const initTask = await (0, init_1.default)(host, { ...options, skipFormat: true });
37
38
  tasks.push(initTask);
38
39
  if (!options.skipPackageJson) {
@@ -76,6 +77,12 @@ async function reactNativeApplicationGeneratorInternal(host, schema) {
76
77
  ],
77
78
  });
78
79
  }
80
+ (0, ts_solution_setup_1.updateTsconfigFiles)(host, options.appProjectRoot, 'tsconfig.app.json', {
81
+ jsx: 'react-jsx',
82
+ module: 'esnext',
83
+ moduleResolution: 'bundler',
84
+ noUnusedLocals: false,
85
+ });
79
86
  if (!options.skipFormat) {
80
87
  await (0, devkit_1.formatFiles)(host);
81
88
  }
@@ -2,6 +2,8 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.addProject = addProject;
4
4
  const devkit_1 = require("@nx/devkit");
5
+ const ts_solution_setup_1 = require("@nx/js/src/utils/typescript/ts-solution-setup");
6
+ const get_import_path_1 = require("@nx/js/src/utils/get-import-path");
5
7
  function addProject(host, options) {
6
8
  const nxJson = (0, devkit_1.readNxJson)(host);
7
9
  const hasPlugin = nxJson.plugins?.some((p) => typeof p === 'string'
@@ -14,9 +16,21 @@ function addProject(host, options) {
14
16
  targets: hasPlugin ? {} : getTargets(options),
15
17
  tags: options.parsedTags,
16
18
  };
17
- (0, devkit_1.addProjectConfiguration)(host, options.projectName, {
18
- ...project,
19
- });
19
+ if ((0, ts_solution_setup_1.isUsingTsSolutionSetup)(host)) {
20
+ (0, devkit_1.writeJson)(host, (0, devkit_1.joinPathFragments)(options.appProjectRoot, 'package.json'), {
21
+ name: (0, get_import_path_1.getImportPath)(host, options.name),
22
+ version: '0.0.1',
23
+ private: true,
24
+ nx: {
25
+ name: options.name,
26
+ },
27
+ });
28
+ }
29
+ else {
30
+ (0, devkit_1.addProjectConfiguration)(host, options.projectName, {
31
+ ...project,
32
+ });
33
+ }
20
34
  }
21
35
  function getTargets(options) {
22
36
  const architect = {};
@@ -5,7 +5,6 @@ exports.reactNativeInitGeneratorInternal = reactNativeInitGeneratorInternal;
5
5
  exports.updateDependencies = updateDependencies;
6
6
  const devkit_1 = require("@nx/devkit");
7
7
  const add_plugin_1 = require("@nx/devkit/src/utils/add-plugin");
8
- const ts_solution_setup_1 = require("@nx/js/src/utils/typescript/ts-solution-setup");
9
8
  const plugin_1 = require("../../../plugins/plugin");
10
9
  const versions_1 = require("../../utils/versions");
11
10
  const add_git_ignore_entry_1 = require("./lib/add-git-ignore-entry");
@@ -16,7 +15,6 @@ function reactNativeInitGenerator(host, schema) {
16
15
  });
17
16
  }
18
17
  async function reactNativeInitGeneratorInternal(host, schema) {
19
- (0, ts_solution_setup_1.assertNotUsingTsSolutionSetup)(host, 'react-native', 'init');
20
18
  (0, add_git_ignore_entry_1.addGitIgnoreEntry)(host);
21
19
  const nxJson = (0, devkit_1.readNxJson)(host);
22
20
  const addPluginDefault = process.env.NX_ADD_PLUGINS !== 'false' &&