Skip to content

Commit

Permalink
fix(rspack): ensure generated app is picked up by crystal (#29048)
Browse files Browse the repository at this point in the history
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->
Current projects are added to excludes of rspack plugin.
Init is also not detecting rspack workspaces

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Ensure excludes is not being set up when generating new apps as they are
resilient to project graph creation now.
Init should detect projects correctly


## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
  • Loading branch information
Coly010 authored Nov 22, 2024
1 parent 840d935 commit 007c0c8
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 35 deletions.
1 change: 1 addition & 0 deletions packages/nx/src/command-line/init/init-v2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ const npmPackageToPluginMap: Record<string, `@nx/${string}`> = {
vite: '@nx/vite',
vitest: '@nx/vite',
webpack: '@nx/webpack',
'@rspack/core': '@nx/rspack',
rollup: '@nx/rollup',
// Testing tools
jest: '@nx/jest',
Expand Down
3 changes: 0 additions & 3 deletions packages/react/src/generators/application/application.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ import { logShowProjectCommand } from '@nx/devkit/src/utils/log-show-project-com
import { setupTailwindGenerator } from '../setup-tailwind/setup-tailwind';
import { useFlatConfig } from '@nx/eslint/src/utils/flat-config';
import { assertNotUsingTsSolutionSetup } from '@nx/js/src/utils/typescript/ts-solution-setup';
import { addProjectRootToRspackPluginExcludesIfExists } from './lib/add-project-root-to-rspack-plugin-excludes';

async function addLinting(host: Tree, options: NormalizedSchema) {
const tasks: GeneratorCallback[] = [];
Expand Down Expand Up @@ -237,8 +236,6 @@ export async function applicationGeneratorInternal(
},
false
);
} else if (options.bundler === 'rspack') {
addProjectRootToRspackPluginExcludesIfExists(host, options.appProjectRoot);
}

if (options.bundler !== 'vite' && options.unitTestRunner === 'vitest') {
Expand Down
2 changes: 2 additions & 0 deletions packages/react/src/generators/application/lib/add-e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { webStaticServeGenerator } from '@nx/web';
import { nxVersion } from '../../../utils/versions';
import { hasWebpackPlugin } from '../../../utils/has-webpack-plugin';
import { hasVitePlugin } from '../../../utils/has-vite-plugin';
import { hasRspackPlugin } from '../../../utils/has-rspack-plugin';
import { NormalizedSchema } from '../schema';
import { findPluginForConfigFile } from '@nx/devkit/src/utils/find-plugin-for-config-file';
import { addE2eCiTargetDefaults } from '@nx/devkit/src/generators/target-defaults-utils';
Expand All @@ -22,6 +23,7 @@ export async function addE2e(
): Promise<GeneratorCallback> {
const hasNxBuildPlugin =
(options.bundler === 'webpack' && hasWebpackPlugin(tree)) ||
(options.bundler === 'rspack' && hasRspackPlugin(tree)) ||
(options.bundler === 'vite' && hasVitePlugin(tree));

let e2eWebServerInfo: E2EWebServerDetails = {
Expand Down

This file was deleted.

0 comments on commit 007c0c8

Please sign in to comment.