Skip to content

Commit

Permalink
feat(react): update app generators for remix, next, expo, rn
Browse files Browse the repository at this point in the history
  • Loading branch information
jaysoo committed Nov 12, 2024
1 parent ca4a294 commit a2e9734
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 20 deletions.
3 changes: 3 additions & 0 deletions packages/expo/src/generators/application/application.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ export async function expoApplicationGeneratorInternal(
const jsInitTask = await jsInitGenerator(host, {
...schema,
skipFormat: true,
addTsPlugin:
process.env.NX_ADD_PLUGINS !== 'false' &&
process.env.NX_ADD_TS_PLUGIN !== 'false',
});

tasks.push(jsInitTask);
Expand Down
3 changes: 0 additions & 3 deletions packages/expo/src/generators/init/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import {
Tree,
} from '@nx/devkit';
import { addPluginV1 } from '@nx/devkit/src/utils/add-plugin';
import { assertNotUsingTsSolutionSetup } from '@nx/js/src/utils/typescript/ts-solution-setup';
import { createNodes } from '../../../plugins/plugin';
import {
expoCliVersion,
Expand All @@ -28,8 +27,6 @@ export function expoInitGenerator(tree: Tree, schema: Schema) {
}

export async function expoInitGeneratorInternal(host: Tree, schema: Schema) {
assertNotUsingTsSolutionSetup(host, 'expo', 'init');

const nxJson = readNxJson(host);
const addPluginDefault =
process.env.NX_ADD_PLUGINS !== 'false' &&
Expand Down
3 changes: 3 additions & 0 deletions packages/next/src/generators/application/application.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ export async function applicationGeneratorInternal(host: Tree, schema: Schema) {
js: options.js,
skipPackageJson: options.skipPackageJson,
skipFormat: true,
addTsPlugin:
process.env.NX_ADD_PLUGINS !== 'false' &&
process.env.NX_ADD_TS_PLUGIN !== 'false',
});
tasks.push(jsInitTask);

Expand Down
3 changes: 0 additions & 3 deletions packages/next/src/generators/init/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import {
createProjectGraphAsync,
} from '@nx/devkit';
import { addPlugin } from '@nx/devkit/src/utils/add-plugin';
import { assertNotUsingTsSolutionSetup } from '@nx/js/src/utils/typescript/ts-solution-setup';
import { reactDomVersion, reactVersion } from '@nx/react/src/utils/versions';
import { addGitIgnoreEntry } from '../../utils/add-gitignore-entry';
import { nextVersion, nxVersion } from '../../utils/versions';
Expand Down Expand Up @@ -46,8 +45,6 @@ export async function nextInitGeneratorInternal(
host: Tree,
schema: InitSchema
) {
assertNotUsingTsSolutionSetup(host, 'next', 'init');

const nxJson = readNxJson(host);
const addPluginDefault =
process.env.NX_ADD_PLUGINS !== 'false' &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ export async function reactNativeApplicationGeneratorInternal(
const jsInitTask = await jsInitGenerator(host, {
...schema,
skipFormat: true,
addTsPlugin:
process.env.NX_ADD_PLUGINS !== 'false' &&
process.env.NX_ADD_TS_PLUGIN !== 'false',
});
tasks.push(jsInitTask);
const initTask = await initGenerator(host, { ...options, skipFormat: true });
Expand Down
3 changes: 0 additions & 3 deletions packages/react-native/src/generators/init/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import {
Tree,
} from '@nx/devkit';
import { addPluginV1 } from '@nx/devkit/src/utils/add-plugin';
import { assertNotUsingTsSolutionSetup } from '@nx/js/src/utils/typescript/ts-solution-setup';
import { createNodes } from '../../../plugins/plugin';
import {
nxVersion,
Expand All @@ -31,8 +30,6 @@ export async function reactNativeInitGeneratorInternal(
host: Tree,
schema: Schema
) {
assertNotUsingTsSolutionSetup(host, 'react-native', 'init');

addGitIgnoreEntry(host);

const nxJson = readNxJson(host);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,12 @@ export async function remixApplicationGeneratorInternal(
skipFormat: true,
addPlugin: true,
}),
await jsInitGenerator(tree, { skipFormat: true }),
await jsInitGenerator(tree, {
skipFormat: true,
addTsPlugin:
process.env.NX_ADD_PLUGINS !== 'false' &&
process.env.NX_ADD_TS_PLUGIN !== 'false',
}),
];

addProjectConfiguration(tree, options.projectName, {
Expand Down
14 changes: 4 additions & 10 deletions packages/remix/src/generators/init/init.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
import {
type Tree,
addDependenciesToPackageJson,
createProjectGraphAsync,
formatFiles,
GeneratorCallback,
readNxJson,
addDependenciesToPackageJson,
runTasksInSerial,
createProjectGraphAsync,
type Tree,
} from '@nx/devkit';
import {
addPlugin,
generateCombinations,
} from '@nx/devkit/src/utils/add-plugin';
import { assertNotUsingTsSolutionSetup } from '@nx/js/src/utils/typescript/ts-solution-setup';
import { addPlugin } from '@nx/devkit/src/utils/add-plugin';
import { createNodesV2 } from '../../plugins/plugin';
import { nxVersion, remixVersion } from '../../utils/versions';
import { type Schema } from './schema';
Expand All @@ -21,8 +17,6 @@ export function remixInitGenerator(tree: Tree, options: Schema) {
}

export async function remixInitGeneratorInternal(tree: Tree, options: Schema) {
assertNotUsingTsSolutionSetup(tree, 'remix', 'init');

const tasks: GeneratorCallback[] = [];

if (!options.skipPackageJson) {
Expand Down

0 comments on commit a2e9734

Please sign in to comment.