@nx/react-native 0.0.0-pr-28808-8717441 → 0.0.0-pr-29047-57d3073

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-28808-8717441",
3
+ "version": "0.0.0-pr-29047-57d3073",
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-28808-8717441",
40
- "@nx/jest": "0.0.0-pr-28808-8717441",
41
- "@nx/js": "0.0.0-pr-28808-8717441",
42
- "@nx/eslint": "0.0.0-pr-28808-8717441",
43
- "@nx/react": "0.0.0-pr-28808-8717441",
44
- "@nx/workspace": "0.0.0-pr-28808-8717441"
39
+ "@nx/devkit": "0.0.0-pr-29047-57d3073",
40
+ "@nx/jest": "0.0.0-pr-29047-57d3073",
41
+ "@nx/js": "0.0.0-pr-29047-57d3073",
42
+ "@nx/eslint": "0.0.0-pr-29047-57d3073",
43
+ "@nx/react": "0.0.0-pr-29047-57d3073",
44
+ "@nx/workspace": "0.0.0-pr-29047-57d3073"
45
45
  },
46
46
  "executors": "./executors.json",
47
47
  "ng-update": {
@@ -5,6 +5,7 @@ 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");
8
9
  const add_linting_1 = require("../../utils/add-linting");
9
10
  const add_jest_1 = require("../../utils/add-jest");
10
11
  const chmod_android_gradle_files_1 = require("../../utils/chmod-android-gradle-files");
@@ -17,7 +18,6 @@ const create_application_files_1 = require("./lib/create-application-files");
17
18
  const add_e2e_1 = require("./lib/add-e2e");
18
19
  const ensure_dependencies_1 = require("../../utils/ensure-dependencies");
19
20
  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,15 +25,14 @@ 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);
28
30
  const tasks = [];
29
31
  const jsInitTask = await (0, js_1.initGenerator)(host, {
30
32
  ...schema,
31
33
  skipFormat: true,
32
- addTsPlugin: schema.useTsSolution,
33
- formatter: schema.formatter,
34
34
  });
35
35
  tasks.push(jsInitTask);
36
- const options = await (0, normalize_options_1.normalizeOptions)(host, schema);
37
36
  const initTask = await (0, init_1.default)(host, { ...options, skipFormat: true });
38
37
  tasks.push(initTask);
39
38
  if (!options.skipPackageJson) {
@@ -77,15 +76,6 @@ async function reactNativeApplicationGeneratorInternal(host, schema) {
77
76
  ],
78
77
  });
79
78
  }
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
- lib: ['dom'],
86
- }, options.linter === 'eslint'
87
- ? ['eslint.config.js', 'eslint.config.cjs', 'eslint.config.mjs']
88
- : undefined);
89
79
  if (!options.skipFormat) {
90
80
  await (0, devkit_1.formatFiles)(host);
91
81
  }
@@ -2,8 +2,6 @@
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");
7
5
  function addProject(host, options) {
8
6
  const nxJson = (0, devkit_1.readNxJson)(host);
9
7
  const hasPlugin = nxJson.plugins?.some((p) => typeof p === 'string'
@@ -16,24 +14,9 @@ function addProject(host, options) {
16
14
  targets: hasPlugin ? {} : getTargets(options),
17
15
  tags: options.parsedTags,
18
16
  };
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
- projectType: 'application',
27
- targets: hasPlugin ? {} : getTargets(options),
28
- tags: options.parsedTags?.length ? options.parsedTags : undefined,
29
- },
30
- });
31
- }
32
- else {
33
- (0, devkit_1.addProjectConfiguration)(host, options.projectName, {
34
- ...project,
35
- });
36
- }
17
+ (0, devkit_1.addProjectConfiguration)(host, options.projectName, {
18
+ ...project,
19
+ });
37
20
  }
38
21
  function getTargets(options) {
39
22
  const architect = {};
@@ -16,9 +16,6 @@ export interface Schema {
16
16
  bundler: 'webpack' | 'vite'; // default is webpack
17
17
  install: boolean; // default is true
18
18
  skipPackageJson?: boolean; //default is false
19
- // Internal options
20
19
  addPlugin?: boolean;
21
20
  nxCloudToken?: string;
22
- useTsSolution?: boolean;
23
- formatter?: 'prettier' | 'none';
24
21
  }
@@ -44,15 +44,13 @@
44
44
  "description": "The tool to use for running lint checks.",
45
45
  "type": "string",
46
46
  "enum": ["eslint", "none"],
47
- "default": "eslint",
48
- "x-priority": "important"
47
+ "default": "eslint"
49
48
  },
50
49
  "unitTestRunner": {
51
50
  "type": "string",
52
51
  "enum": ["jest", "none"],
53
52
  "description": "Test runner to use for unit tests",
54
- "default": "jest",
55
- "x-priority": "important"
53
+ "default": "jest"
56
54
  },
57
55
  "tags": {
58
56
  "type": "string",
@@ -73,8 +71,7 @@
73
71
  "description": "Adds the specified e2e test runner.",
74
72
  "type": "string",
75
73
  "enum": ["playwright", "cypress", "detox", "none"],
76
- "default": "none",
77
- "x-priority": "important"
74
+ "default": "playwright"
78
75
  },
79
76
  "install": {
80
77
  "type": "boolean",
@@ -5,6 +5,7 @@ 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");
8
9
  const plugin_1 = require("../../../plugins/plugin");
9
10
  const versions_1 = require("../../utils/versions");
10
11
  const add_git_ignore_entry_1 = require("./lib/add-git-ignore-entry");
@@ -15,6 +16,7 @@ function reactNativeInitGenerator(host, schema) {
15
16
  });
16
17
  }
17
18
  async function reactNativeInitGeneratorInternal(host, schema) {
19
+ (0, ts_solution_setup_1.assertNotUsingTsSolutionSetup)(host, 'react-native', 'init');
18
20
  (0, add_git_ignore_entry_1.addGitIgnoreEntry)(host);
19
21
  const nxJson = (0, devkit_1.readNxJson)(host);
20
22
  const addPluginDefault = process.env.NX_ADD_PLUGINS !== 'false' &&
@@ -12,7 +12,6 @@ const normalize_options_1 = require("./lib/normalize-options");
12
12
  const ensure_dependencies_1 = require("../../utils/ensure-dependencies");
13
13
  const log_show_project_command_1 = require("@nx/devkit/src/utils/log-show-project-command");
14
14
  const ts_solution_setup_1 = require("@nx/js/src/utils/typescript/ts-solution-setup");
15
- const get_import_path_1 = require("@nx/js/src/utils/get-import-path");
16
15
  async function reactNativeLibraryGenerator(host, schema) {
17
16
  return await reactNativeLibraryGeneratorInternal(host, {
18
17
  addPlugin: false,
@@ -20,16 +19,17 @@ async function reactNativeLibraryGenerator(host, schema) {
20
19
  });
21
20
  }
22
21
  async function reactNativeLibraryGeneratorInternal(host, schema) {
22
+ (0, ts_solution_setup_1.assertNotUsingTsSolutionSetup)(host, 'react-native', 'library');
23
+ const options = await (0, normalize_options_1.normalizeOptions)(host, schema);
24
+ if (options.publishable === true && !schema.importPath) {
25
+ throw new Error(`For publishable libs you have to provide a proper "--importPath" which needs to be a valid npm package name (e.g. my-awesome-lib or @myorg/my-lib)`);
26
+ }
23
27
  const tasks = [];
24
28
  const jsInitTask = await (0, js_1.initGenerator)(host, {
25
29
  ...schema,
26
30
  skipFormat: true,
27
31
  });
28
32
  tasks.push(jsInitTask);
29
- const options = await (0, normalize_options_1.normalizeOptions)(host, schema);
30
- if (options.publishable === true && !schema.importPath) {
31
- throw new Error(`For publishable libs you have to provide a proper "--importPath" which needs to be a valid npm package name (e.g. my-awesome-lib or @myorg/my-lib)`);
32
- }
33
33
  const initTask = await (0, init_1.default)(host, { ...options, skipFormat: true });
34
34
  tasks.push(initTask);
35
35
  if (!options.skipPackageJson) {
@@ -58,13 +58,6 @@ async function reactNativeLibraryGeneratorInternal(host, schema) {
58
58
  (0, devkit_1.joinPathFragments)(options.projectRoot, './src', 'index.' + (options.js ? 'js' : 'ts')),
59
59
  ]);
60
60
  }
61
- (0, ts_solution_setup_1.updateTsconfigFiles)(host, options.projectRoot, 'tsconfig.lib.json', {
62
- jsx: 'react-jsx',
63
- module: 'esnext',
64
- moduleResolution: 'bundler',
65
- }, options.linter === 'eslint'
66
- ? ['eslint.config.js', 'eslint.config.cjs', 'eslint.config.mjs']
67
- : undefined);
68
61
  if (!options.skipFormat) {
69
62
  await (0, devkit_1.formatFiles)(host);
70
63
  }
@@ -81,18 +74,7 @@ async function addProject(host, options) {
81
74
  tags: options.parsedTags,
82
75
  targets: {},
83
76
  };
84
- if ((0, ts_solution_setup_1.isUsingTsSolutionSetup)(host)) {
85
- (0, devkit_1.writeJson)(host, (0, devkit_1.joinPathFragments)(options.projectRoot, 'package.json'), {
86
- name: (0, get_import_path_1.getImportPath)(host, options.name),
87
- version: '0.0.1',
88
- nx: {
89
- name: options.name,
90
- },
91
- });
92
- }
93
- else {
94
- (0, devkit_1.addProjectConfiguration)(host, options.name, project);
95
- }
77
+ (0, devkit_1.addProjectConfiguration)(host, options.name, project);
96
78
  if (!options.publishable && !options.buildable) {
97
79
  return () => { };
98
80
  }
@@ -32,16 +32,13 @@
32
32
  "description": "The tool to use for running lint checks.",
33
33
  "type": "string",
34
34
  "enum": ["eslint", "none"],
35
- "default": "eslint",
36
- "x-prompt": "Which linter would you like to use?",
37
- "x-priority": "important"
35
+ "default": "eslint"
38
36
  },
39
37
  "unitTestRunner": {
40
38
  "type": "string",
41
39
  "enum": ["jest", "none"],
42
40
  "description": "Test runner to use for unit tests.",
43
- "default": "jest",
44
- "x-priority": "important"
41
+ "default": "jest"
45
42
  },
46
43
  "tags": {
47
44
  "type": "string",
@@ -40,11 +40,6 @@ async function webConfigurationGenerator(tree, options) {
40
40
  : null,
41
41
  });
42
42
  }
43
- if (!options.skipPackageJson) {
44
- tasks.push((0, devkit_1.addDependenciesToPackageJson)(tree, {}, {
45
- '@types/react-dom': versions_1.typesReactDomVersion,
46
- }));
47
- }
48
43
  if (!options.skipFormat) {
49
44
  await (0, devkit_1.formatFiles)(tree);
50
45
  }
@@ -64,7 +59,6 @@ async function addBundlerConfiguration(tree, normalizedSchema) {
64
59
  project: normalizedSchema.project,
65
60
  newProject: true,
66
61
  includeVitest: false,
67
- projectType: 'application',
68
62
  compiler: 'babel',
69
63
  skipFormat: true,
70
64
  });
@@ -9,7 +9,6 @@ export declare const reactVersion = "18.2.0";
9
9
  export declare const reactDomVersion = "18.2.0";
10
10
  export declare const reactTestRendererVersion = "18.2.0";
11
11
  export declare const typesReactVersion = "~18.2.45";
12
- export declare const typesReactDomVersion = "18.3.0";
13
12
  export declare const testingLibraryReactNativeVersion = "~12.5.0";
14
13
  export declare const testingLibraryJestNativeVersion = "~5.4.3";
15
14
  export declare const jestReactNativeVersion = "18.0.0";
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.babelRuntimeVersion = exports.reactNativeSvgVersion = exports.reactNativeSvgTransformerVersion = exports.jestReactNativeVersion = exports.testingLibraryJestNativeVersion = exports.testingLibraryReactNativeVersion = exports.typesReactDomVersion = exports.typesReactVersion = exports.reactTestRendererVersion = exports.reactDomVersion = exports.reactVersion = exports.reactNativeWebVersion = exports.reactNativeMetroConfigVersion = exports.reactNativeBabelPresetVersion = exports.reactNativeCommunityCliPlatformAndroidVersion = exports.typesNodeVersion = exports.reactNativeVersion = exports.nxVersion = void 0;
3
+ exports.babelRuntimeVersion = exports.reactNativeSvgVersion = exports.reactNativeSvgTransformerVersion = exports.jestReactNativeVersion = exports.testingLibraryJestNativeVersion = exports.testingLibraryReactNativeVersion = exports.typesReactVersion = exports.reactTestRendererVersion = exports.reactDomVersion = exports.reactVersion = exports.reactNativeWebVersion = exports.reactNativeMetroConfigVersion = exports.reactNativeBabelPresetVersion = exports.reactNativeCommunityCliPlatformAndroidVersion = exports.typesNodeVersion = exports.reactNativeVersion = exports.nxVersion = void 0;
4
4
  exports.nxVersion = require('../../package.json').version;
5
5
  exports.reactNativeVersion = '0.74.1';
6
6
  exports.typesNodeVersion = '18.16.9';
@@ -12,7 +12,6 @@ exports.reactVersion = '18.2.0';
12
12
  exports.reactDomVersion = '18.2.0';
13
13
  exports.reactTestRendererVersion = '18.2.0';
14
14
  exports.typesReactVersion = '~18.2.45';
15
- exports.typesReactDomVersion = '18.3.0';
16
15
  exports.testingLibraryReactNativeVersion = '~12.5.0';
17
16
  exports.testingLibraryJestNativeVersion = '~5.4.3';
18
17
  exports.jestReactNativeVersion = '18.0.0';