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.
This commit is contained in:
@@ -19,9 +19,10 @@ export const defaultESLintIgnores = [
|
|||||||
'**/build/',
|
'**/build/',
|
||||||
'**/node_modules/',
|
'**/node_modules/',
|
||||||
'**/temp/',
|
'**/temp/',
|
||||||
'**/packages/*.spec.ts',
|
'packages/**/*.spec.ts',
|
||||||
'next-env.d.ts',
|
'next-env.d.ts',
|
||||||
'**/app',
|
'**/app',
|
||||||
|
'src/**/*.spec.ts',
|
||||||
]
|
]
|
||||||
|
|
||||||
/** @typedef {import('eslint').Linter.Config} Config */
|
/** @typedef {import('eslint').Linter.Config} Config */
|
||||||
@@ -29,10 +30,7 @@ export const defaultESLintIgnores = [
|
|||||||
export const rootParserOptions = {
|
export const rootParserOptions = {
|
||||||
sourceType: 'module',
|
sourceType: 'module',
|
||||||
ecmaVersion: 'latest',
|
ecmaVersion: 'latest',
|
||||||
projectService: {
|
projectService: true,
|
||||||
maximumDefaultProjectFileMatchCount_THIS_WILL_SLOW_DOWN_LINTING: 40,
|
|
||||||
allowDefaultProject: ['scripts/*.ts', '*.js', '*.mjs', '*.d.ts'],
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @type {Config[]} */
|
/** @type {Config[]} */
|
||||||
|
|||||||
@@ -355,6 +355,7 @@
|
|||||||
"@lexical/rich-text": "0.21.0",
|
"@lexical/rich-text": "0.21.0",
|
||||||
"@lexical/selection": "0.21.0",
|
"@lexical/selection": "0.21.0",
|
||||||
"@lexical/utils": "0.21.0",
|
"@lexical/utils": "0.21.0",
|
||||||
|
"@lexical/table": "0.21.0",
|
||||||
"@payloadcms/translations": "workspace:*",
|
"@payloadcms/translations": "workspace:*",
|
||||||
"@payloadcms/ui": "workspace:*",
|
"@payloadcms/ui": "workspace:*",
|
||||||
"@types/uuid": "10.0.0",
|
"@types/uuid": "10.0.0",
|
||||||
@@ -395,18 +396,7 @@
|
|||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"@faceless-ui/modal": "3.0.0-beta.2",
|
"@faceless-ui/modal": "3.0.0-beta.2",
|
||||||
"@faceless-ui/scroll-info": "2.0.0",
|
"@faceless-ui/scroll-info": "2.0.0",
|
||||||
"@lexical/headless": "0.21.0",
|
|
||||||
"@lexical/html": "0.21.0",
|
|
||||||
"@lexical/link": "0.21.0",
|
|
||||||
"@lexical/list": "0.21.0",
|
|
||||||
"@lexical/mark": "0.21.0",
|
|
||||||
"@lexical/react": "0.21.0",
|
|
||||||
"@lexical/rich-text": "0.21.0",
|
|
||||||
"@lexical/selection": "0.21.0",
|
|
||||||
"@lexical/table": "0.21.0",
|
|
||||||
"@lexical/utils": "0.21.0",
|
|
||||||
"@payloadcms/next": "workspace:*",
|
"@payloadcms/next": "workspace:*",
|
||||||
"lexical": "0.21.0",
|
|
||||||
"payload": "workspace:*",
|
"payload": "workspace:*",
|
||||||
"react": "^19.0.0 || ^19.0.0-rc-65a56d0e-20241020",
|
"react": "^19.0.0 || ^19.0.0-rc-65a56d0e-20241020",
|
||||||
"react-dom": "^19.0.0 || ^19.0.0-rc-65a56d0e-20241020"
|
"react-dom": "^19.0.0 || ^19.0.0-rc-65a56d0e-20241020"
|
||||||
|
|||||||
@@ -14,8 +14,5 @@ describe('Lexical dependency checker', () => {
|
|||||||
const packageJsonLexicalVersion = packageJson.dependencies['lexical']
|
const packageJsonLexicalVersion = packageJson.dependencies['lexical']
|
||||||
|
|
||||||
expect(packageJsonLexicalVersion).toBe(lexicalTargetVersion)
|
expect(packageJsonLexicalVersion).toBe(lexicalTargetVersion)
|
||||||
|
|
||||||
const packageJsonLexicalPeerDepVersion = packageJson.peerDependencies['lexical']
|
|
||||||
expect(packageJsonLexicalPeerDepVersion).toBe(lexicalTargetVersion)
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user