@nx/react-native 21.0.0-beta.8 → 21.0.0-beta.9
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 +0 -126
- package/package.json +7 -7
- package/project.json +2 -5
- package/src/migrations/update-18-0-0/add-upgrade-target.d.ts +0 -6
- package/src/migrations/update-18-0-0/add-upgrade-target.js +0 -31
- package/src/migrations/update-18-0-0/add-web-configuration.d.ts +0 -8
- package/src/migrations/update-18-0-0/add-web-configuration.js +0 -33
- package/src/migrations/update-18-0-0/change-storybook-targets.d.ts +0 -5
- package/src/migrations/update-18-0-0/change-storybook-targets.js +0 -57
- package/src/migrations/update-18-0-0/remove-block-list.d.ts +0 -6
- package/src/migrations/update-18-0-0/remove-block-list.js +0 -28
- package/src/migrations/update-18-0-0/remove-metro.d.ts +0 -14
- package/src/migrations/update-18-0-0/remove-metro.js +0 -29
- package/src/migrations/update-18-0-0/remove-symlink-target.d.ts +0 -6
- package/src/migrations/update-18-0-0/remove-symlink-target.js +0 -30
package/migrations.json
CHANGED
|
@@ -1,41 +1,5 @@
|
|
|
1
1
|
{
|
|
2
2
|
"generators": {
|
|
3
|
-
"update-18-0-0-add-web-configuration": {
|
|
4
|
-
"cli": "nx",
|
|
5
|
-
"version": "18.0.0-beta.0",
|
|
6
|
-
"description": "Add web configuration to react native projects",
|
|
7
|
-
"implementation": "./src/migrations/update-18-0-0/add-web-configuration"
|
|
8
|
-
},
|
|
9
|
-
"update-18-0-0-change-storybook-targets": {
|
|
10
|
-
"cli": "nx",
|
|
11
|
-
"version": "18.0.0-beta.0",
|
|
12
|
-
"description": "Upgrade react native storybook target to use web",
|
|
13
|
-
"implementation": "./src/migrations/update-18-0-0/change-storybook-targets"
|
|
14
|
-
},
|
|
15
|
-
"update-18-0-0-remove-block-list": {
|
|
16
|
-
"cli": "nx",
|
|
17
|
-
"version": "18.0.0-beta.0",
|
|
18
|
-
"description": "Remove blockList in metro.config.js.",
|
|
19
|
-
"implementation": "./src/migrations/update-18-0-0/remove-block-list"
|
|
20
|
-
},
|
|
21
|
-
"update-18-0-0-remove-metro": {
|
|
22
|
-
"cli": "nx",
|
|
23
|
-
"version": "18.0.0-beta.0",
|
|
24
|
-
"description": "Remove metro-* and @react-native-community/cli-* from package.json devDependencies",
|
|
25
|
-
"implementation": "./src/migrations/update-18-0-0/remove-metro"
|
|
26
|
-
},
|
|
27
|
-
"update-18-0-0-remove-symlink-target": {
|
|
28
|
-
"cli": "nx",
|
|
29
|
-
"version": "18.0.0-beta.0",
|
|
30
|
-
"description": "Remove ensure-symlink target",
|
|
31
|
-
"implementation": "./src/migrations/update-18-0-0/remove-symlink-target"
|
|
32
|
-
},
|
|
33
|
-
"update-18-0-0-add-upgrade-target": {
|
|
34
|
-
"cli": "nx",
|
|
35
|
-
"version": "18.0.0-beta.0",
|
|
36
|
-
"description": "Add upgrade target to react native projects",
|
|
37
|
-
"implementation": "./src/migrations/update-18-0-0/add-upgrade-target"
|
|
38
|
-
},
|
|
39
3
|
"update-19-6-0-rename-upgrade-target-name": {
|
|
40
4
|
"cli": "nx",
|
|
41
5
|
"version": "19.6.0-beta.1",
|
|
@@ -44,96 +8,6 @@
|
|
|
44
8
|
}
|
|
45
9
|
},
|
|
46
10
|
"packageJsonUpdates": {
|
|
47
|
-
"17.1.0": {
|
|
48
|
-
"version": "17.1.0-beta.1",
|
|
49
|
-
"packages": {
|
|
50
|
-
"react-native": {
|
|
51
|
-
"version": "0.72.6",
|
|
52
|
-
"alwaysAddToPackageJson": false
|
|
53
|
-
},
|
|
54
|
-
"metro": {
|
|
55
|
-
"version": "0.76.8",
|
|
56
|
-
"alwaysAddToPackageJson": false
|
|
57
|
-
},
|
|
58
|
-
"metro-resolver": {
|
|
59
|
-
"version": "0.76.8",
|
|
60
|
-
"alwaysAddToPackageJson": false
|
|
61
|
-
},
|
|
62
|
-
"metro-config": {
|
|
63
|
-
"version": "0.76.8",
|
|
64
|
-
"alwaysAddToPackageJson": false
|
|
65
|
-
},
|
|
66
|
-
"metro-react-native-babel-preset": {
|
|
67
|
-
"version": "0.76.8",
|
|
68
|
-
"alwaysAddToPackageJson": false
|
|
69
|
-
},
|
|
70
|
-
"metro-babel-register": {
|
|
71
|
-
"version": "0.76.8",
|
|
72
|
-
"alwaysAddToPackageJson": false
|
|
73
|
-
},
|
|
74
|
-
"metro-react-native-babel-transformer": {
|
|
75
|
-
"version": "0.76.7",
|
|
76
|
-
"alwaysAddToPackageJson": false
|
|
77
|
-
},
|
|
78
|
-
"@react-native-community/cli": {
|
|
79
|
-
"version": "11.3.7",
|
|
80
|
-
"alwaysAddToPackageJson": false
|
|
81
|
-
},
|
|
82
|
-
"@react-native-community/cli-platform-android": {
|
|
83
|
-
"version": "11.3.7",
|
|
84
|
-
"alwaysAddToPackageJson": false
|
|
85
|
-
},
|
|
86
|
-
"@react-native-community/cli-platform-ios": {
|
|
87
|
-
"version": "11.3.7",
|
|
88
|
-
"alwaysAddToPackageJson": false
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
},
|
|
92
|
-
"17.3.0": {
|
|
93
|
-
"version": "17.3.0-beta.3",
|
|
94
|
-
"packages": {
|
|
95
|
-
"@types/node": {
|
|
96
|
-
"version": "18.16.9"
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
},
|
|
100
|
-
"18.0.0": {
|
|
101
|
-
"version": "18.0.0-beta.0",
|
|
102
|
-
"packages": {
|
|
103
|
-
"react-native": {
|
|
104
|
-
"version": "0.73.2",
|
|
105
|
-
"alwaysAddToPackageJson": false
|
|
106
|
-
},
|
|
107
|
-
"@react-native/babel-preset": {
|
|
108
|
-
"version": "^0.73.18",
|
|
109
|
-
"addToPackageJson": "devDependencies"
|
|
110
|
-
},
|
|
111
|
-
"@react-native/metro-config": {
|
|
112
|
-
"version": "^0.73.2",
|
|
113
|
-
"addToPackageJson": "devDependencies"
|
|
114
|
-
},
|
|
115
|
-
"@types/react": {
|
|
116
|
-
"version": "~18.2.45",
|
|
117
|
-
"alwaysAddToPackageJson": false
|
|
118
|
-
},
|
|
119
|
-
"@testing-library/react-native": {
|
|
120
|
-
"version": "~12.4.2",
|
|
121
|
-
"alwaysAddToPackageJson": false
|
|
122
|
-
},
|
|
123
|
-
"react-native-svg-transformer": {
|
|
124
|
-
"version": "1.2.0",
|
|
125
|
-
"alwaysAddToPackageJson": false
|
|
126
|
-
},
|
|
127
|
-
"react-native-svg": {
|
|
128
|
-
"version": "14.1.0",
|
|
129
|
-
"alwaysAddToPackageJson": false
|
|
130
|
-
},
|
|
131
|
-
"@react-native-community/cli-platform-android": {
|
|
132
|
-
"version": "12.3.0",
|
|
133
|
-
"alwaysAddToPackageJson": false
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
},
|
|
137
11
|
"19.0.0": {
|
|
138
12
|
"version": "19.0.0-beta.7",
|
|
139
13
|
"packages": {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/react-native",
|
|
3
|
-
"version": "21.0.0-beta.
|
|
3
|
+
"version": "21.0.0-beta.9",
|
|
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": [
|
|
@@ -35,12 +35,12 @@
|
|
|
35
35
|
"picocolors": "^1.1.0",
|
|
36
36
|
"tsconfig-paths": "^4.1.2",
|
|
37
37
|
"tslib": "^2.3.0",
|
|
38
|
-
"@nx/devkit": "21.0.0-beta.
|
|
39
|
-
"@nx/jest": "21.0.0-beta.
|
|
40
|
-
"@nx/js": "21.0.0-beta.
|
|
41
|
-
"@nx/eslint": "21.0.0-beta.
|
|
42
|
-
"@nx/react": "21.0.0-beta.
|
|
43
|
-
"@nx/workspace": "21.0.0-beta.
|
|
38
|
+
"@nx/devkit": "21.0.0-beta.9",
|
|
39
|
+
"@nx/jest": "21.0.0-beta.9",
|
|
40
|
+
"@nx/js": "21.0.0-beta.9",
|
|
41
|
+
"@nx/eslint": "21.0.0-beta.9",
|
|
42
|
+
"@nx/react": "21.0.0-beta.9",
|
|
43
|
+
"@nx/workspace": "21.0.0-beta.9"
|
|
44
44
|
},
|
|
45
45
|
"executors": "./executors.json",
|
|
46
46
|
"ng-update": {
|
package/project.json
CHANGED
|
@@ -39,11 +39,8 @@
|
|
|
39
39
|
}
|
|
40
40
|
},
|
|
41
41
|
"build": {
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"options": {
|
|
45
|
-
"command": "node ./scripts/copy-readme.js react-native"
|
|
46
|
-
}
|
|
42
|
+
"outputs": ["{workspaceRoot}/build/packages/react-native/README.md"],
|
|
43
|
+
"command": "node ./scripts/copy-readme.js react-native"
|
|
47
44
|
}
|
|
48
45
|
}
|
|
49
46
|
}
|
|
@@ -1,31 +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
|
-
* Add target upgrade for react native apps
|
|
7
|
-
* Remove pod-install from dependsOn for all targets, it does pod-install when creating the app
|
|
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
|
-
if (!config.targets['upgrade']) {
|
|
14
|
-
config.targets.upgrade = {
|
|
15
|
-
executor: '@nx/react-native:upgrade',
|
|
16
|
-
options: {},
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
if (config.targets?.['pod-install']?.executor ===
|
|
20
|
-
'@nx/react-native:pod-install') {
|
|
21
|
-
for (const targetName in config.targets) {
|
|
22
|
-
if (config.targets[targetName]?.dependsOn?.length) {
|
|
23
|
-
config.targets[targetName].dependsOn = config.targets[targetName].dependsOn.filter((dependsOn) => dependsOn !== 'pod-install');
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
(0, devkit_1.updateProjectConfiguration)(tree, name, config);
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
await (0, devkit_1.formatFiles)(tree);
|
|
31
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { GeneratorCallback, Tree } from '@nx/devkit';
|
|
2
|
-
/**
|
|
3
|
-
* Add web configuration to react native projects
|
|
4
|
-
* - delete the current serve target which is just a pass-through to start target
|
|
5
|
-
* - rename the babel.config.json to to babel-v72.config.json
|
|
6
|
-
* - add web confiugration, it will add .babelrc.js
|
|
7
|
-
*/
|
|
8
|
-
export default function update(tree: Tree): Promise<GeneratorCallback>;
|
|
@@ -1,33 +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 web_configuration_1 = require("../../generators/web-configuration/web-configuration");
|
|
6
|
-
/**
|
|
7
|
-
* Add web configuration to react native projects
|
|
8
|
-
* - delete the current serve target which is just a pass-through to start target
|
|
9
|
-
* - rename the babel.config.json to to babel-v72.config.json
|
|
10
|
-
* - add web confiugration, it will add .babelrc.js
|
|
11
|
-
*/
|
|
12
|
-
async function update(tree) {
|
|
13
|
-
const projects = (0, devkit_1.getProjects)(tree);
|
|
14
|
-
const tasks = [];
|
|
15
|
-
for (const [projectName, config] of projects.entries()) {
|
|
16
|
-
if (config.targets?.['start']?.executor === '@nx/react-native:start') {
|
|
17
|
-
if (config.targets['serve'] &&
|
|
18
|
-
config.targets['serve'].executor === 'nx:run-commands' &&
|
|
19
|
-
config.targets['serve'].options?.command?.startsWith('nx start')) {
|
|
20
|
-
delete config.targets['serve'];
|
|
21
|
-
(0, devkit_1.updateProjectConfiguration)(tree, projectName, config);
|
|
22
|
-
}
|
|
23
|
-
if (tree.exists((0, devkit_1.joinPathFragments)(config.root, 'babel.config.json'))) {
|
|
24
|
-
tree.rename((0, devkit_1.joinPathFragments)(config.root, 'babel.config.json'), (0, devkit_1.joinPathFragments)(config.root, 'babel-v72.config.json'));
|
|
25
|
-
}
|
|
26
|
-
tasks.push(await (0, web_configuration_1.default)(tree, {
|
|
27
|
-
project: config.name,
|
|
28
|
-
bundler: 'webpack',
|
|
29
|
-
}));
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
return (0, devkit_1.runTasksInSerial)(...tasks);
|
|
33
|
-
}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.default = changeStorybookTargets;
|
|
4
|
-
const devkit_1 = require("@nx/devkit");
|
|
5
|
-
const output_1 = require("nx/src/utils/output");
|
|
6
|
-
const migrate_7_1 = require("@nx/storybook/src/generators/migrate-7/migrate-7");
|
|
7
|
-
const utilities_1 = require("@nx/storybook/src/utils/utilities");
|
|
8
|
-
const configuration_1 = require("@nx/react/src/generators/storybook-configuration/configuration");
|
|
9
|
-
/**
|
|
10
|
-
* Upgrade react native storybook target to use web
|
|
11
|
-
*/
|
|
12
|
-
async function changeStorybookTargets(tree) {
|
|
13
|
-
const tasks = [];
|
|
14
|
-
// update the storybook target
|
|
15
|
-
const projects = (0, devkit_1.getProjects)(tree);
|
|
16
|
-
let hasStorybookTarget = false;
|
|
17
|
-
for (const [projectName, config] of projects.entries()) {
|
|
18
|
-
if (config.targets?.['storybook']?.executor === '@nx/react-native:storybook') {
|
|
19
|
-
hasStorybookTarget = true;
|
|
20
|
-
delete config.targets['storybook'];
|
|
21
|
-
(0, devkit_1.updateProjectConfiguration)(tree, projectName, config);
|
|
22
|
-
tasks.push(await (0, configuration_1.default)(tree, {
|
|
23
|
-
project: projectName,
|
|
24
|
-
}));
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* This just checks if Storybook is installed in the workspace.
|
|
29
|
-
* The thing here is that during the previous step of the migration,
|
|
30
|
-
* during packageJsonUpdates, Nx has already set Storybook
|
|
31
|
-
* to version 7, if Storybook exists in the workspace.
|
|
32
|
-
* So, it makes no sense here to check if the version is
|
|
33
|
-
* 7, because it will always be.
|
|
34
|
-
*/
|
|
35
|
-
const storybookVersion = (0, utilities_1.storybookMajorVersion)();
|
|
36
|
-
if (!hasStorybookTarget || !storybookVersion) {
|
|
37
|
-
return;
|
|
38
|
-
}
|
|
39
|
-
output_1.output.log({
|
|
40
|
-
title: 'Migrating Storybook to v7',
|
|
41
|
-
bodyLines: [
|
|
42
|
-
`🚀 This migration will update your Storybook configuration to v7.`,
|
|
43
|
-
`It will call the @nx/storybook:migrate-7 generator for you.`,
|
|
44
|
-
`You can read more about the migration and how this generator works here:`,
|
|
45
|
-
`https://nx.dev/nx-api/storybook/generators/migrate-7`,
|
|
46
|
-
],
|
|
47
|
-
});
|
|
48
|
-
tasks.push(await (0, migrate_7_1.default)(tree, { autoAcceptAllPrompts: true }));
|
|
49
|
-
tasks.push((0, devkit_1.removeDependenciesFromPackageJson)(tree, [], [
|
|
50
|
-
'@storybook/react-native',
|
|
51
|
-
'@storybook/addon-ondevice-actions',
|
|
52
|
-
'@storybook/addon-ondevice-backgrounds',
|
|
53
|
-
'@storybook/addon-ondevice-controls',
|
|
54
|
-
'@storybook/addon-ondevice-notes',
|
|
55
|
-
]));
|
|
56
|
-
return (0, devkit_1.runTasksInSerial)(...tasks);
|
|
57
|
-
}
|
|
@@ -1,28 +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 removes blockList in metro.config.js.
|
|
7
|
-
* It is now excluding dist folder in watchFolders in withNxMetro.
|
|
8
|
-
*/
|
|
9
|
-
async function update(tree) {
|
|
10
|
-
const projects = (0, devkit_1.getProjects)(tree);
|
|
11
|
-
for (const [_, config] of projects.entries()) {
|
|
12
|
-
if (config.targets?.['start']?.executor === '@nx/react-native:start') {
|
|
13
|
-
if (tree.exists((0, devkit_1.joinPathFragments)(config.root, 'metro.config.js'))) {
|
|
14
|
-
let content = tree
|
|
15
|
-
.read((0, devkit_1.joinPathFragments)(config.root, 'metro.config.js'))
|
|
16
|
-
.toString();
|
|
17
|
-
content = content.replace(/blockList: exclusionList(.+?(?=\n))/, '');
|
|
18
|
-
content = content.replace('// unstable_enableSymlinks: true,', '');
|
|
19
|
-
content = content.replace('// unstable_enablePackageExports: true,', '');
|
|
20
|
-
content = content.replace('unstable_enableSymlinks: true,', '');
|
|
21
|
-
content = content.replace('unstable_enablePackageExports: true,', '');
|
|
22
|
-
content = content.replace(`const exclusionList = require('metro-config/src/defaults/exclusionList');`, '');
|
|
23
|
-
tree.write((0, devkit_1.joinPathFragments)(config.root, 'metro.config.js'), content);
|
|
24
|
-
await (0, devkit_1.formatFiles)(tree);
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { Tree } from '@nx/devkit';
|
|
2
|
-
/**
|
|
3
|
-
* Remove metro-* package since it is no longer explicity required in package.json.
|
|
4
|
-
* react-native has dependency of @react-native/community-cli-plugin
|
|
5
|
-
* @react-native/community-cli-plugin has dependency of metro
|
|
6
|
-
*
|
|
7
|
-
* Also remove @react-native-community/cli-* since it is a dependency of react-native.
|
|
8
|
-
* (excpet reactNativeCommunityCliPlatformAndroidVersion because android files refer it by path)
|
|
9
|
-
*
|
|
10
|
-
* https://react-native-community.github.io/upgrade-helper/?from=0.72.6&to=0.73.1#RnDiffApp-package.json
|
|
11
|
-
* @param tree
|
|
12
|
-
* @returns
|
|
13
|
-
*/
|
|
14
|
-
export default function update(tree: Tree): Promise<void>;
|
|
@@ -1,29 +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 metro-* package since it is no longer explicity required in package.json.
|
|
7
|
-
* react-native has dependency of @react-native/community-cli-plugin
|
|
8
|
-
* @react-native/community-cli-plugin has dependency of metro
|
|
9
|
-
*
|
|
10
|
-
* Also remove @react-native-community/cli-* since it is a dependency of react-native.
|
|
11
|
-
* (excpet reactNativeCommunityCliPlatformAndroidVersion because android files refer it by path)
|
|
12
|
-
*
|
|
13
|
-
* https://react-native-community.github.io/upgrade-helper/?from=0.72.6&to=0.73.1#RnDiffApp-package.json
|
|
14
|
-
* @param tree
|
|
15
|
-
* @returns
|
|
16
|
-
*/
|
|
17
|
-
async function update(tree) {
|
|
18
|
-
(0, devkit_1.removeDependenciesFromPackageJson)(tree, [], [
|
|
19
|
-
'metro',
|
|
20
|
-
'metro-resolver',
|
|
21
|
-
'metro-config',
|
|
22
|
-
'metro-react-native-babel-preset',
|
|
23
|
-
'metro-babel-register',
|
|
24
|
-
'metro-react-native-babel-transformer',
|
|
25
|
-
'@react-native-community/cli',
|
|
26
|
-
'@react-native-community/cli-platform-ios',
|
|
27
|
-
]);
|
|
28
|
-
await (0, devkit_1.formatFiles)(tree);
|
|
29
|
-
}
|
|
@@ -1,30 +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 node_fs_1 = require("node:fs");
|
|
6
|
-
/**
|
|
7
|
-
* Remove ensure-symlink target.
|
|
8
|
-
* It is going to be supported by react-native version 0.73 by default.
|
|
9
|
-
*/
|
|
10
|
-
async function update(tree) {
|
|
11
|
-
const projects = (0, devkit_1.getProjects)(tree);
|
|
12
|
-
for (const [projectName, config] of projects.entries()) {
|
|
13
|
-
if (config.targets?.['ensure-symlink']?.executor ===
|
|
14
|
-
'@nx/react-native:ensure-symlink') {
|
|
15
|
-
removeTargets(config.targets, 'ensure-symlink');
|
|
16
|
-
(0, devkit_1.updateProjectConfiguration)(tree, projectName, config);
|
|
17
|
-
(0, node_fs_1.rmSync)(`${config.root}/node_modules`, { recursive: true, force: true });
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
function removeTargets(targets, targetNameToRemove) {
|
|
22
|
-
for (const targetName in targets) {
|
|
23
|
-
if (targetName === targetNameToRemove) {
|
|
24
|
-
delete targets[targetName];
|
|
25
|
-
}
|
|
26
|
-
if (targets[targetName]?.dependsOn?.length) {
|
|
27
|
-
targets[targetName].dependsOn = targets[targetName].dependsOn.filter((dependsOn) => dependsOn !== targetNameToRemove);
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
}
|