This PR adds `convert-to-inferred` generators to convert React Native an Expo apps using executors to use the corresponding inference plugins. Also: 1. Fixes casing for `@nx/react-native/plugin` so it is correctly set as `upgradeTargetName` not `upgradeTargetname` 2. Migration for the above fix for existing projects
25 lines
696 B
TypeScript
25 lines
696 B
TypeScript
import { names } from '@nx/devkit';
|
|
import type { Tree } from '@nx/devkit';
|
|
import type { AggregatedLog } from '@nx/devkit/src/generators/plugin-migrations/aggregate-log-util';
|
|
|
|
export function processGenericOptions(
|
|
_tree: Tree,
|
|
options: any,
|
|
_projectName: string,
|
|
_projectRoot: string,
|
|
_migrationLogs: AggregatedLog
|
|
) {
|
|
const args = options.args ?? [];
|
|
for (const key of Object.keys(options)) {
|
|
if (key === 'args') continue;
|
|
let value = options[key];
|
|
if (typeof value === 'boolean') {
|
|
if (value) args.push(`--${names(key).fileName}`);
|
|
} else {
|
|
args.push(`--${names(key).fileName}=${value}`);
|
|
}
|
|
delete options[key];
|
|
}
|
|
options.args = args;
|
|
}
|