File tree Expand file tree Collapse file tree 4 files changed +19
-2
lines changed
Expand file tree Collapse file tree 4 files changed +19
-2
lines changed Original file line number Diff line number Diff line change 77 "test" : " cm-runtests" ,
88 "static" : " tsc --noEmit" ,
99 "testAll" : " yarn run static && yarn run test && cd dev/cm5 && yarn run buildAndTest" ,
10- "build" : " cm-buildhelper src/index.ts" ,
10+ "build" : " cm-buildhelper src/index.ts && node scripts/addVersion.cjs " ,
1111 "publish" : " yarn run build && npm publish" ,
1212 "prepare" : " yarn run build"
1313 },
Original file line number Diff line number Diff line change 1+ var fs = require ( "fs" )
2+ var json = fs . readFileSync ( __dirname + "/../package.json" , "utf-8" )
3+ var version = JSON . parse ( json ) . version
4+
5+ console . log ( version )
6+ function replace ( path ) {
7+ var value = fs . readFileSync ( path , "utf-8" )
8+ value = value . replace ( "<DEV>" , version ) ;
9+ fs . writeFileSync ( path , value , "utf-8" )
10+ }
11+
12+ replace ( __dirname + "/../dist/index.js" )
13+ replace ( __dirname + "/../dist/index.cjs" )
Original file line number Diff line number Diff line change @@ -184,7 +184,7 @@ export type vimOption = {
184184}
185185
186186
187- export type ExFn = ( ) => void ;
187+ export type ExFn = ( cm : CodeMirrorV , params : ExParams ) => void ;
188188
189189type allCommands = {
190190 keys : string ,
Original file line number Diff line number Diff line change @@ -6247,6 +6247,10 @@ export function initVim(CodeMirror) {
62476247
62486248 var exCommandDispatcher = new ExCommandDispatcher ( ) ;
62496249
6250+ vimApi . defineEx ( "version" , "ve" , ( cm ) => {
6251+ showConfirm ( cm , "Codemirror-vim version: <DEV>" ) ;
6252+ } ) ;
6253+
62506254/**
62516255 * @arg {CodeMirrorV} cm CodeMirror instance we are in.
62526256 * @arg {boolean} confirm Whether to confirm each replace.
You can’t perform that action at this time.
0 commit comments