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) 930 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = update; const devkit_1 = require("@nx/devkit"); /** * There was a typo in @nx/react-native/plugin, where "upgradeTargetName" was "upgradeTargetname" */ async function update(tree) { const nxJson = (0, devkit_1.readNxJson)(tree); if (!nxJson.plugins) return; let updated = false; for (const plugin of nxJson.plugins) { if (typeof plugin === 'string') continue; if (plugin.plugin !== '@nx/react-native/plugin') continue; if (plugin.options['upgradeTargetname']) { plugin.options['upgradeTargetName'] = plugin.options['upgradeTargetname']; delete plugin.options['upgradeTargetname']; updated = true; } } if (updated) (0, devkit_1.updateNxJson)(tree, nxJson); await (0, devkit_1.formatFiles)(tree); }