fix(richtext-lexical): dependency checker suggesting incorrect version (#7888)
Fixes this: https://discord.com/channels/967097582721572934/1278031296970625190/1278031652089757818
This commit is contained in:
@@ -19,7 +19,8 @@ export type DependencyCheckerArgs = {
|
||||
* Name of the dependency group to be displayed in the error message
|
||||
*/
|
||||
name: string
|
||||
targetVersionDependency: string
|
||||
targetVersion?: string
|
||||
targetVersionDependency?: string
|
||||
}[]
|
||||
/**
|
||||
* Dependency package names keyed to their required versions. Supports >= (greater or equal than version) as a prefix, or no prefix for the exact version
|
||||
@@ -51,9 +52,9 @@ export async function checkDependencies({
|
||||
}
|
||||
}
|
||||
if (Object.keys(foundVersions).length > 1) {
|
||||
const targetVersion = resolvedDependencies.resolved.get(
|
||||
dependencyGroup.targetVersionDependency,
|
||||
)?.version
|
||||
const targetVersion =
|
||||
dependencyGroup.targetVersion ??
|
||||
resolvedDependencies.resolved.get(dependencyGroup.targetVersionDependency)?.version
|
||||
if (targetVersion) {
|
||||
const formattedVersionsWithPackageNameString = Object.entries(foundVersions)
|
||||
.filter(([version]) => version !== targetVersion)
|
||||
|
||||
@@ -62,7 +62,7 @@ export function lexicalEditor(props?: LexicalEditorProps): LexicalRichTextAdapte
|
||||
'@lexical/selection',
|
||||
'@lexical/utils',
|
||||
],
|
||||
targetVersionDependency: 'lexical',
|
||||
targetVersion: '0.17.0',
|
||||
},
|
||||
],
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user