File tree Expand file tree Collapse file tree 2 files changed +24
-1
lines changed
packages/richtext-lexical/src Expand file tree Collapse file tree 2 files changed +24
-1
lines changed Original file line number Diff line number Diff line change
1
+ import { jest } from '@jest/globals'
2
+ import { lexicalTargetVersion } from './index'
3
+ import { fileURLToPath } from 'url'
4
+ import path from 'path'
5
+ import fs from 'fs/promises'
6
+
7
+ const filename = fileURLToPath ( import . meta. url )
8
+ const dirname = path . dirname ( filename )
9
+
10
+ describe ( 'Lexical dependency checker' , ( ) => {
11
+ it ( 'ensure lexical version installed in package.json matches dependency checker version' , async ( ) => {
12
+ const packageJsonString = await fs . readFile ( path . resolve ( dirname , '../package.json' ) , 'utf-8' )
13
+ const packageJson = JSON . parse ( packageJsonString )
14
+ const packageJsonLexicalVersion = packageJson . dependencies [ 'lexical' ]
15
+
16
+ expect ( packageJsonLexicalVersion ) . toBe ( lexicalTargetVersion )
17
+
18
+ const packageJsonLexicalPeerDepVersion = packageJson . peerDependencies [ 'lexical' ]
19
+ expect ( packageJsonLexicalPeerDepVersion ) . toBe ( lexicalTargetVersion )
20
+ } )
21
+ } )
Original file line number Diff line number Diff line change @@ -32,6 +32,8 @@ import { richTextValidateHOC } from './validate/index.js'
32
32
33
33
let checkedDependencies = false
34
34
35
+ export const lexicalTargetVersion = '0.21.0'
36
+
35
37
export function lexicalEditor ( props ?: LexicalEditorProps ) : LexicalRichTextAdapterProvider {
36
38
if (
37
39
process . env . NODE_ENV !== 'production' &&
@@ -54,7 +56,7 @@ export function lexicalEditor(props?: LexicalEditorProps): LexicalRichTextAdapte
54
56
'@lexical/selection' ,
55
57
'@lexical/utils' ,
56
58
] ,
57
- targetVersion : '0.21.0' ,
59
+ targetVersion : lexicalTargetVersion ,
58
60
} ,
59
61
] ,
60
62
} )
You can’t perform that action at this time.
0 commit comments