Skip to content

Commit 2056e9b

Browse files
authored
fix(richtext-lexical): reliably install exact lexical version by removing it from peerDeps (#11122)
This will hopefully allow pnpm to reliably install the correct lexical version, as lexical is now solely part of our `dependencies`. Currently, pnpm completely disregards lexical version bumps until the user deletes both the lockfile and their `node_modules` folder. The downside of this is that pnpm will no longer throw a warning if payload is installed in a project with a mismatching lexical version. However, noone read that warning anyways, and our runtime dependency checker is more reliable.
1 parent 44be433 commit 2056e9b

File tree

3 files changed

+4
-19
lines changed

3 files changed

+4
-19
lines changed

eslint.config.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,18 @@ export const defaultESLintIgnores = [
1919
'**/build/',
2020
'**/node_modules/',
2121
'**/temp/',
22-
'**/packages/*.spec.ts',
22+
'packages/**/*.spec.ts',
2323
'next-env.d.ts',
2424
'**/app',
25+
'src/**/*.spec.ts',
2526
]
2627

2728
/** @typedef {import('eslint').Linter.Config} Config */
2829

2930
export const rootParserOptions = {
3031
sourceType: 'module',
3132
ecmaVersion: 'latest',
32-
projectService: {
33-
maximumDefaultProjectFileMatchCount_THIS_WILL_SLOW_DOWN_LINTING: 40,
34-
allowDefaultProject: ['scripts/*.ts', '*.js', '*.mjs', '*.d.ts'],
35-
},
33+
projectService: true,
3634
}
3735

3836
/** @type {Config[]} */

packages/richtext-lexical/package.json

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,7 @@
355355
"@lexical/rich-text": "0.21.0",
356356
"@lexical/selection": "0.21.0",
357357
"@lexical/utils": "0.21.0",
358+
"@lexical/table": "0.21.0",
358359
"@payloadcms/translations": "workspace:*",
359360
"@payloadcms/ui": "workspace:*",
360361
"@types/uuid": "10.0.0",
@@ -395,18 +396,7 @@
395396
"peerDependencies": {
396397
"@faceless-ui/modal": "3.0.0-beta.2",
397398
"@faceless-ui/scroll-info": "2.0.0",
398-
"@lexical/headless": "0.21.0",
399-
"@lexical/html": "0.21.0",
400-
"@lexical/link": "0.21.0",
401-
"@lexical/list": "0.21.0",
402-
"@lexical/mark": "0.21.0",
403-
"@lexical/react": "0.21.0",
404-
"@lexical/rich-text": "0.21.0",
405-
"@lexical/selection": "0.21.0",
406-
"@lexical/table": "0.21.0",
407-
"@lexical/utils": "0.21.0",
408399
"@payloadcms/next": "workspace:*",
409-
"lexical": "0.21.0",
410400
"payload": "workspace:*",
411401
"react": "^19.0.0 || ^19.0.0-rc-65a56d0e-20241020",
412402
"react-dom": "^19.0.0 || ^19.0.0-rc-65a56d0e-20241020"

packages/richtext-lexical/src/dependencyChecker.spec.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,5 @@ describe('Lexical dependency checker', () => {
1414
const packageJsonLexicalVersion = packageJson.dependencies['lexical']
1515

1616
expect(packageJsonLexicalVersion).toBe(lexicalTargetVersion)
17-
18-
const packageJsonLexicalPeerDepVersion = packageJson.peerDependencies['lexical']
19-
expect(packageJsonLexicalPeerDepVersion).toBe(lexicalTargetVersion)
2017
})
2118
})

0 commit comments

Comments
 (0)