@nx/react-native 0.0.0-pr-28229-afe192c → 0.0.0-pr-28453-54fa63c

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/migrations.json CHANGED
@@ -1,35 +1,5 @@
1
1
  {
2
2
  "generators": {
3
- "update-16-0-0-add-nx-packages": {
4
- "cli": "nx",
5
- "version": "16.0.0-beta.1",
6
- "description": "Replace @nrwl/react-native with @nx/react-native",
7
- "implementation": "./src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages"
8
- },
9
- "update-16-1-0-upgrade-storybook-6-5": {
10
- "cli": "nx",
11
- "version": "16.1.0-beta.0",
12
- "description": "Upgrade @storybook/react-native to 6.5",
13
- "implementation": "./src/migrations/update-16-1-0/upgrade-storybook-6-5"
14
- },
15
- "update-16-6-0-add-dependsOn": {
16
- "cli": "nx",
17
- "version": "16.6.0-beta.0",
18
- "description": "Add dependsOn like ensure-symlink or sync-deps to targets",
19
- "implementation": "./src/migrations/update-16-6-0/add-depends-on"
20
- },
21
- "update-16-6-0-update-metro-config": {
22
- "cli": "nx",
23
- "version": "16.6.0-beta.0",
24
- "description": "Update metro.config.js to use the new metro config format",
25
- "implementation": "./src/migrations/update-16-6-0/update-metro-config"
26
- },
27
- "update-16-9-0-remove-types-react-native": {
28
- "cli": "nx",
29
- "version": "16.9.0-beta.1",
30
- "description": "Remove @types/react-native from package.json",
31
- "implementation": "./src/migrations/update-16-9-0/remove-types-react-native"
32
- },
33
3
  "update-18-0-0-add-web-configuration": {
34
4
  "cli": "nx",
35
5
  "version": "18.0.0-beta.0",
@@ -74,189 +44,6 @@
74
44
  }
75
45
  },
76
46
  "packageJsonUpdates": {
77
- "16.0.0": {
78
- "version": "16.0.0-beta.0",
79
- "packages": {
80
- "@react-native-community/cli": {
81
- "version": "10.2.2",
82
- "alwaysAddToPackageJson": false
83
- },
84
- "react-native": {
85
- "version": "0.71.7",
86
- "alwaysAddToPackageJson": false
87
- },
88
- "@types/react-native": {
89
- "version": "0.71.6",
90
- "alwaysAddToPackageJson": false
91
- },
92
- "@testing-library/react-native": {
93
- "version": "12.0.1",
94
- "alwaysAddToPackageJson": false
95
- },
96
- "react-native-svg": {
97
- "version": "13.9.0",
98
- "alwaysAddToPackageJson": false
99
- }
100
- }
101
- },
102
- "16.0.2": {
103
- "version": "16.0.2-beta.0",
104
- "packages": {
105
- "@react-native-async-storage/async-storage": {
106
- "version": "1.18.1",
107
- "alwaysAddToPackageJson": false
108
- },
109
- "react-native-safe-area-context": {
110
- "version": "4.5.1",
111
- "alwaysAddToPackageJson": false
112
- }
113
- }
114
- },
115
- "16.1.5": {
116
- "version": "16.1.5-beta.0",
117
- "packages": {
118
- "react-native": {
119
- "version": "0.71.8",
120
- "alwaysAddToPackageJson": false
121
- },
122
- "@types/react-native": {
123
- "version": "0.71.7",
124
- "alwaysAddToPackageJson": false
125
- },
126
- "@testing-library/react-native": {
127
- "version": "12.1.2",
128
- "alwaysAddToPackageJson": false
129
- },
130
- "react-native-safe-area-context": {
131
- "version": "4.5.2",
132
- "alwaysAddToPackageJson": false
133
- }
134
- }
135
- },
136
- "16.4.0": {
137
- "version": "16.4.0-beta.5",
138
- "packages": {
139
- "react-native": {
140
- "version": "0.71.10",
141
- "alwaysAddToPackageJson": false
142
- },
143
- "@react-native-async-storage/async-storage": {
144
- "version": "1.18.2",
145
- "alwaysAddToPackageJson": false
146
- },
147
- "react-native-safe-area-context": {
148
- "version": "4.5.3",
149
- "alwaysAddToPackageJson": false
150
- }
151
- }
152
- },
153
- "16.6.0": {
154
- "version": "16.6.0-beta.0",
155
- "packages": {
156
- "react-native": {
157
- "version": "0.72.3",
158
- "alwaysAddToPackageJson": false
159
- },
160
- "@types/react-native": {
161
- "version": "0.72.2",
162
- "alwaysAddToPackageJson": false
163
- },
164
- "metro": {
165
- "version": "0.76.7",
166
- "alwaysAddToPackageJson": false
167
- },
168
- "metro-resolver": {
169
- "version": "0.76.7",
170
- "alwaysAddToPackageJson": false
171
- },
172
- "metro-config": {
173
- "version": "0.76.7",
174
- "alwaysAddToPackageJson": false
175
- },
176
- "metro-react-native-babel-preset": {
177
- "version": "0.76.7",
178
- "alwaysAddToPackageJson": false
179
- },
180
- "metro-babel-register": {
181
- "version": "0.76.7",
182
- "alwaysAddToPackageJson": false
183
- },
184
- "metro-react-native-babel-transformer": {
185
- "version": "0.76.7",
186
- "alwaysAddToPackageJson": false
187
- },
188
- "@react-native/metro-config": {
189
- "version": "^0.72.9",
190
- "alwaysAddToPackageJson": false,
191
- "addToPackageJson": "devDependencies"
192
- },
193
- "@react-native-community/cli": {
194
- "version": "11.3.5",
195
- "alwaysAddToPackageJson": false
196
- },
197
- "@react-native-community/cli-platform-android": {
198
- "version": "11.3.5",
199
- "alwaysAddToPackageJson": false
200
- },
201
- "@react-native-community/cli-platform-ios": {
202
- "version": "11.3.5",
203
- "alwaysAddToPackageJson": false
204
- },
205
- "@babel/runtime": {
206
- "version": "7.22.6",
207
- "alwaysAddToPackageJson": false
208
- },
209
- "@react-native-async-storage/async-storage": {
210
- "version": "1.19.0",
211
- "alwaysAddToPackageJson": false
212
- },
213
- "react-native-safe-area-context": {
214
- "version": "4.7.1",
215
- "alwaysAddToPackageJson": false
216
- }
217
- }
218
- },
219
- "16.9.0": {
220
- "version": "16.9.0-beta.1",
221
- "packages": {
222
- "react-native": {
223
- "version": "0.72.4",
224
- "alwaysAddToPackageJson": false
225
- },
226
- "@react-native/metro-config": {
227
- "version": "^0.72.11",
228
- "alwaysAddToPackageJson": false
229
- },
230
- "@react-native-community/cli": {
231
- "version": "11.3.6",
232
- "alwaysAddToPackageJson": false
233
- },
234
- "@react-native-community/cli-platform-android": {
235
- "version": "11.3.6",
236
- "alwaysAddToPackageJson": false
237
- },
238
- "@react-native-community/cli-platform-ios": {
239
- "version": "11.3.6",
240
- "alwaysAddToPackageJson": false
241
- },
242
- "@testing-library/react-native": {
243
- "version": "~12.3.0",
244
- "alwaysAddToPackageJson": false
245
- },
246
- "@testing-library/jest-native": {
247
- "version": "~5.4.3",
248
- "alwaysAddToPackageJson": false
249
- },
250
- "@react-native-async-storage/async-storage": {
251
- "version": "~1.19.3",
252
- "alwaysAddToPackageJson": false
253
- },
254
- "react-native-safe-area-context": {
255
- "version": "~4.7.2",
256
- "alwaysAddToPackageJson": false
257
- }
258
- }
259
- },
260
47
  "17.1.0": {
261
48
  "version": "17.1.0-beta.1",
262
49
  "packages": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/react-native",
3
- "version": "0.0.0-pr-28229-afe192c",
3
+ "version": "0.0.0-pr-28453-54fa63c",
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-28229-afe192c",
40
- "@nx/jest": "0.0.0-pr-28229-afe192c",
41
- "@nx/js": "0.0.0-pr-28229-afe192c",
42
- "@nx/eslint": "0.0.0-pr-28229-afe192c",
43
- "@nx/react": "0.0.0-pr-28229-afe192c",
44
- "@nx/workspace": "0.0.0-pr-28229-afe192c"
39
+ "@nx/devkit": "0.0.0-pr-28453-54fa63c",
40
+ "@nx/jest": "0.0.0-pr-28453-54fa63c",
41
+ "@nx/js": "0.0.0-pr-28453-54fa63c",
42
+ "@nx/eslint": "0.0.0-pr-28453-54fa63c",
43
+ "@nx/react": "0.0.0-pr-28453-54fa63c",
44
+ "@nx/workspace": "0.0.0-pr-28453-54fa63c"
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");
@@ -24,6 +25,7 @@ async function reactNativeApplicationGenerator(host, schema) {
24
25
  });
25
26
  }
26
27
  async function reactNativeApplicationGeneratorInternal(host, schema) {
28
+ (0, ts_solution_setup_1.assertNotUsingTsSolutionSetup)(host, 'react-native', 'application');
27
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, {
@@ -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' &&
@@ -11,6 +11,7 @@ const versions_1 = require("../../utils/versions");
11
11
  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
+ const ts_solution_setup_1 = require("@nx/js/src/utils/typescript/ts-solution-setup");
14
15
  async function reactNativeLibraryGenerator(host, schema) {
15
16
  return await reactNativeLibraryGeneratorInternal(host, {
16
17
  addPlugin: false,
@@ -18,6 +19,7 @@ async function reactNativeLibraryGenerator(host, schema) {
18
19
  });
19
20
  }
20
21
  async function reactNativeLibraryGeneratorInternal(host, schema) {
22
+ (0, ts_solution_setup_1.assertNotUsingTsSolutionSetup)(host, 'react-native', 'library');
21
23
  const options = await (0, normalize_options_1.normalizeOptions)(host, schema);
22
24
  if (options.publishable === true && !schema.importPath) {
23
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)`);
@@ -1,2 +0,0 @@
1
- import { Tree } from '@nx/devkit';
2
- export default function replacePackage(tree: Tree): Promise<void>;
@@ -1,9 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = replacePackage;
4
- const devkit_1 = require("@nx/devkit");
5
- const replace_package_1 = require("@nx/devkit/src/utils/replace-package");
6
- async function replacePackage(tree) {
7
- await (0, replace_package_1.replaceNrwlPackageWithNxPackage)(tree, '@nrwl/react-native', '@nx/react-native');
8
- await (0, devkit_1.formatFiles)(tree);
9
- }
@@ -1,6 +0,0 @@
1
- import { Tree } from '@nx/devkit';
2
- /**
3
- * This migration is to upgrade storybook to 6.5.
4
- * - remove react-native-storybook-loader
5
- */
6
- export default function update(tree: Tree): void;
@@ -1,21 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = update;
4
- const devkit_1 = require("@nx/devkit");
5
- /**
6
- * This migration is to upgrade storybook to 6.5.
7
- * - remove react-native-storybook-loader
8
- */
9
- function update(tree) {
10
- if (tree.exists('package.json')) {
11
- (0, devkit_1.updateJson)(tree, 'package.json', (packageJson) => {
12
- if (packageJson.dependencies?.['react-native-storybook-loader']) {
13
- delete packageJson.dependencies['react-native-storybook-loader'];
14
- }
15
- if (packageJson.devDependencies?.['react-native-storybook-loader']) {
16
- delete packageJson.devDependencies['react-native-storybook-loader'];
17
- }
18
- return packageJson;
19
- });
20
- }
21
- }
@@ -1,6 +0,0 @@
1
- import { Tree } from '@nx/devkit';
2
- /**
3
- * This migration adds dependsOn to project.json.
4
- *
5
- */
6
- export default function update(tree: Tree): Promise<void>;
@@ -1,63 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = update;
4
- const devkit_1 = require("@nx/devkit");
5
- /**
6
- * This migration adds dependsOn to project.json.
7
- *
8
- */
9
- async function update(tree) {
10
- const projects = (0, devkit_1.getProjects)(tree);
11
- for (const [name, config] of projects.entries()) {
12
- if (config.targets?.['start']?.executor === '@nx/react-native:start') {
13
- config.targets['start'].dependsOn = [
14
- 'ensure-symlink',
15
- 'sync-deps',
16
- 'pod-install',
17
- ];
18
- if (config.targets?.['run-ios']?.executor === '@nx/react-native:run-ios') {
19
- config.targets['run-ios'].dependsOn = [
20
- 'ensure-symlink',
21
- 'sync-deps',
22
- 'pod-install',
23
- ];
24
- }
25
- if (config.targets?.['bundle-ios']?.executor === '@nx/react-native:bundle') {
26
- config.targets['bundle-ios'].dependsOn = ['ensure-symlink'];
27
- }
28
- if (config.targets?.['run-android']?.executor ===
29
- '@nx/react-native:run-android') {
30
- config.targets['run-android'].dependsOn ??= [
31
- 'ensure-symlink',
32
- 'sync-deps',
33
- ];
34
- }
35
- if (config.targets?.['build-android']?.executor ===
36
- '@nx/react-native:build-android') {
37
- config.targets['build-android'].dependsOn = [
38
- 'ensure-symlink',
39
- 'sync-deps',
40
- ];
41
- }
42
- if (config.targets?.['build-ios']?.executor === '@nx/react-native:build-ios') {
43
- config.targets['build-ios'].dependsOn ??= [
44
- 'ensure-symlink',
45
- 'sync-deps',
46
- 'pod-install',
47
- ];
48
- }
49
- if (config.targets?.['pod-instal']?.executor ===
50
- '@nx/react-native:pod-install') {
51
- config.targets['pod-install'].dependsOn ??= [
52
- 'ensure-symlink',
53
- 'sync-deps',
54
- ];
55
- }
56
- if (config.targets?.['bundle-android']?.executor ===
57
- '@nx/react-native:bundle') {
58
- config.targets['bundle-android'].dependsOn ??= ['ensure-symlink'];
59
- }
60
- (0, devkit_1.updateProjectConfiguration)(tree, name, config);
61
- }
62
- }
63
- }
@@ -1,6 +0,0 @@
1
- import { Tree } from '@nx/devkit';
2
- /**
3
- * This migration updates metro.config.js to export config as a default.
4
- *
5
- */
6
- export default function update(tree: Tree): Promise<void>;
@@ -1,63 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = update;
4
- const devkit_1 = require("@nx/devkit");
5
- const path_1 = require("path");
6
- /**
7
- * This migration updates metro.config.js to export config as a default.
8
- *
9
- */
10
- async function update(tree) {
11
- const projects = (0, devkit_1.getProjects)(tree);
12
- for (const [_, config] of projects.entries()) {
13
- if (config.targets?.['start']?.executor === '@nx/react-native:start') {
14
- if (tree.exists((0, path_1.join)(config.root, 'metro.config.js'))) {
15
- const oldConfig = tree
16
- .read((0, path_1.join)(config.root, 'metro.config.js'))
17
- .toString();
18
- tree.write((0, path_1.join)(config.root, 'metro-v71.config.js'), oldConfigComment + oldConfig);
19
- tree.write((0, path_1.join)(config.root, 'metro.config.js'), content);
20
- }
21
- }
22
- }
23
- }
24
- const oldConfigComment = `/**
25
- * Old custom configuration for React Native v0.71.
26
- * From @react-native/metro-config 0.72.1, it is no longer necessary to use a config function to access the complete default config.
27
- * Please port your custom configuration to metro.config.js.
28
- * Please see https://reactnative.dev/docs/metro to learn about configuration.
29
- */
30
- `;
31
- const content = `
32
- const { withNxMetro } = require('@nx/react-native');
33
- const { getDefaultConfig, mergeConfig } = require('@react-native/metro-config');
34
-
35
- const defaultConfig = getDefaultConfig(__dirname);
36
- const { assetExts, sourceExts } = defaultConfig.resolver;
37
-
38
- /**
39
- * Metro configuration
40
- * https://facebook.github.io/metro/docs/configuration
41
- *
42
- * @type {import('metro-config').MetroConfig}
43
- */
44
- const customConfig = {
45
- transformer: {
46
- babelTransformerPath: require.resolve('react-native-svg-transformer'),
47
- },
48
- resolver: {
49
- assetExts: assetExts.filter((ext) => ext !== 'svg'),
50
- sourceExts: [...sourceExts, 'cjs', 'mjs', 'svg'],
51
- },
52
- };
53
-
54
- module.exports = withNxMetro(mergeConfig(defaultConfig, customConfig), {
55
- // Change this to true to see debugging info.
56
- // Useful if you have issues resolving modules
57
- debug: false,
58
- // all the file extensions used for imports other than 'ts', 'tsx', 'js', 'jsx', 'json'
59
- extensions: [],
60
- // Specify folders to watch, in addition to Nx defaults (workspace libraries and node_modules)
61
- watchFolders: [],
62
- });
63
- `;
@@ -1,7 +0,0 @@
1
- import { Tree } from '@nx/devkit';
2
- /**
3
- * Remove @types/react-native package since it is no longer required. It would be a part of react native package.
4
- * @param tree
5
- * @returns
6
- */
7
- export default function update(tree: Tree): Promise<void>;
@@ -1,13 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = update;
4
- const devkit_1 = require("@nx/devkit");
5
- /**
6
- * Remove @types/react-native package since it is no longer required. It would be a part of react native package.
7
- * @param tree
8
- * @returns
9
- */
10
- async function update(tree) {
11
- (0, devkit_1.removeDependenciesFromPackageJson)(tree, [], ['@types/react-native']);
12
- await (0, devkit_1.formatFiles)(tree);
13
- }