UNPKG

@nx/react-native

Version:

The Nx Plugin for React Native contains generators for managing React Native applications and libraries within an Nx workspace. It provides: -Integration with libraries such as Jest, Detox, and Storybook. -Scaffolding for creating buildable libraries th

28 lines (27 loc) 1.17 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = update; const devkit_1 = require("@nx/devkit"); const path_1 = require("path"); /** * Remove deprecated dependencies from the root and app package.json. */ function update(tree) { const projects = (0, devkit_1.getProjects)(tree); for (const [_, config] of projects.entries()) { const appPackageJsonPath = (0, path_1.join)(config.root, 'package.json'); if (!tree.exists(appPackageJsonPath)) { continue; } (0, devkit_1.removeDependenciesFromPackageJson)(tree, ['@testing-library/jest-native', 'jest-react-native'], ['@testing-library/jest-native', 'jest-react-native']); (0, devkit_1.updateJson)(tree, appPackageJsonPath, (packageJson) => { if (packageJson.dependencies?.['@testing-library/jest-native']) { delete packageJson.dependencies['@testing-library/jest-native']; } if (packageJson.dependencies?.['jest-react-native']) { delete packageJson.dependencies['jest-react-native']; } return packageJson; }); } }