From b2155119cc9e27648debcfc62e65255eb93dc60b Mon Sep 17 00:00:00 2001 From: Thomas Dekiere Date: Wed, 26 Jun 2024 10:40:45 +0200 Subject: [PATCH] fix(remix): don't add @remix-run/eslint-config dependency to new remix apps (#26568) ## Current Behavior When a new remix app is generated with @nx/remix, it can't be installed due to peer dependencies that are introduced by @remix-run/eslint-config. This dependency though is not used in the nx workspace and has also been removed from the official create-remix method. ## Expected Behavior Running `npm install` should not throw errors after a remix application was added to the nx workspace. ## Related Issue(s) Fixes #26540 (cherry picked from commit 1e41672e6afbe0749a6172eb72b73d15286f6692) --- e2e/remix/src/nx-remix.test.ts | 27 ++++++++++++++++--- .../files/integrated/package.json__tmpl__ | 1 - .../generators/utils/update-dependencies.ts | 1 - 3 files changed, 23 insertions(+), 6 deletions(-) diff --git a/e2e/remix/src/nx-remix.test.ts b/e2e/remix/src/nx-remix.test.ts index 89995097113df..8b3d670ac247c 100644 --- a/e2e/remix/src/nx-remix.test.ts +++ b/e2e/remix/src/nx-remix.test.ts @@ -8,15 +8,34 @@ import { uniq, updateFile, runCommandAsync, - listFiles, } from '@nx/e2e/utils'; describe('Remix E2E Tests', () => { - describe('--integrated', () => { - let proj: string; + describe('--integrated (npm)', () => { + beforeAll(() => { + newProject({ + packages: ['@nx/remix', '@nx/react'], + packageManager: 'npm', + }); + }); + afterAll(() => { + killPorts(); + cleanupProject(); + }); + + it('should not cause peer dependency conflicts', async () => { + const plugin = uniq('remix'); + runCLI( + `generate @nx/remix:app ${plugin} --projectNameAndRootFormat=as-provided` + ); + + await runCommandAsync('npm install'); + }, 120000); + }); + describe('--integrated (yarn)', () => { beforeAll(() => { - proj = newProject({ packages: ['@nx/remix', '@nx/react'] }); + newProject({ packages: ['@nx/remix', '@nx/react'] }); }); afterAll(() => { diff --git a/packages/remix/src/generators/application/files/integrated/package.json__tmpl__ b/packages/remix/src/generators/application/files/integrated/package.json__tmpl__ index fb01011bd7179..8b3736be1414c 100644 --- a/packages/remix/src/generators/application/files/integrated/package.json__tmpl__ +++ b/packages/remix/src/generators/application/files/integrated/package.json__tmpl__ @@ -15,7 +15,6 @@ }, "devDependencies": { "@remix-run/dev": "<%= remixVersion %>", - "@remix-run/eslint-config": "<%= remixVersion %>", "@types/react": "<%= typesReactVersion %>", "@types/react-dom": "<%= typesReactDomVersion %>", "eslint": "<%= eslintVersion %>", diff --git a/packages/remix/src/generators/utils/update-dependencies.ts b/packages/remix/src/generators/utils/update-dependencies.ts index ab7c08cccaa49..3ca39271b3864 100644 --- a/packages/remix/src/generators/utils/update-dependencies.ts +++ b/packages/remix/src/generators/utils/update-dependencies.ts @@ -21,7 +21,6 @@ export function updateDependencies(tree: Tree) { 'react-dom': reactDomVersion, }, { - '@remix-run/eslint-config': remixVersion, '@types/react': typesReactVersion, '@types/react-dom': typesReactDomVersion, eslint: eslintVersion,