Skip to content

Commit

Permalink
chore(package): require node 16.18.0
Browse files Browse the repository at this point in the history
  • Loading branch information
chemzqm committed Aug 31, 2023
1 parent 5ea8b52 commit 5385efd
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 14 deletions.
4 changes: 2 additions & 2 deletions autoload/coc/client.vim
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,8 @@ function! coc#client#check_version() abort
let ms = matchlist(output, 'v\(\d\+\).\(\d\+\).\(\d\+\)')
if empty(ms)
let msgs = ['Unable to get node version by "'.cmd.'" please install NodeJS from https://nodejs.org/en/download/']
elseif str2nr(ms[1]) < 14 || (str2nr(ms[1]) == 14 && str2nr(ms[2]) < 14)
let msgs = ['Current Node.js version '.trim(output).' < 14.14.0 ', 'Please upgrade your .js']
elseif str2nr(ms[1]) < 16 || (str2nr(ms[1]) == 16 && str2nr(ms[2]) < 18)
let msgs = ['Current Node.js version '.trim(output).' < 16.18.0 ', 'Please upgrade your Node.js']
endif
endif
if !empty(msgs)
Expand Down
4 changes: 2 additions & 2 deletions autoload/health/coc.vim
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ function! s:checkEnvironment() abort
if empty(ms)
let valid = 0
call health#report_error('Unable to detect version of node, make sure your node executable is http://nodejs.org/')
elseif str2nr(ms[1]) < 14 || (str2nr(ms[1]) == 14 && str2nr(ms[2]) < 14)
elseif str2nr(ms[1]) < 16 || (str2nr(ms[1]) == 16 && str2nr(ms[2]) < 18)
let valid = 0
call health#report_warn('Node.js version '.trim(output).' < 14.14.0, please upgrade node.js')
call health#report_warn('Node.js version '.trim(output).' < 16.18.0, please upgrade node.js')
endif
if valid
call health#report_ok('Environment check passed')
Expand Down
4 changes: 2 additions & 2 deletions doc/coc-api.txt
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ To manually create an extension, follow these step:
Recommended steps:

• Install types of NodeJS and coc.nvim by terminal command
`yarn install @types/node@14.14 coc.nvim` in extension folder.
`yarn install @types/node@16.18 coc.nvim` in extension folder.
• Bundle the javascript files when using multiple node dependencies by
esbuild to save the time of installation. A typical build script looks
like:
Expand All @@ -346,7 +346,7 @@ Recommended steps:
mainFields: ['module', 'main'],
external: ['coc.nvim'],
platform: 'node',
target: 'node14.14',
target: 'node16.18',
outfile: 'lib/index.js'
})
}
Expand Down
2 changes: 1 addition & 1 deletion doc/coc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ REQUIREMENTS *coc-requirements*

Neovim >= 0.4.0 or Vim >= 8.1.1719.

NodeJS https://nodejs.org/ >= 14.14.0.
NodeJS https://nodejs.org/ >= 16.18.0.

Yarn https://yarnpkg.com/ required to build coc.nvim from typescript source
code.
Expand Down
2 changes: 1 addition & 1 deletion esbuild.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ async function start() {
mainFields: ['module', 'main'],
platform: 'node',
treeShaking: true,
target: 'node14.14',
target: 'node16.18',
plugins: [entryPlugin],
banner: {
js: `"use strict";
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "LSP based intellisense engine for neovim & vim8.",
"main": "./build/index.js",
"engines": {
"node": ">=14.14.0"
"node": ">=16.18.0"
},
"type": "commonjs",
"scripts": {
Expand Down Expand Up @@ -73,7 +73,7 @@
"@types/marked": "^4.3.1",
"@types/minimatch": "^5.1.2",
"@types/mkdirp": "^1.0.1",
"@types/node": "14.14",
"@types/node": "16.18",
"@types/semver": "^7.5.1",
"@types/tar": "^4.0.5",
"@types/unidecode": "^0.1.1",
Expand Down
4 changes: 2 additions & 2 deletions plugin/coc.vim
Original file line number Diff line number Diff line change
Expand Up @@ -646,8 +646,8 @@ function! s:ShowInfo()
else
let output = trim(system(node . ' --version'))
let ms = matchlist(output, 'v\(\d\+\).\(\d\+\).\(\d\+\)')
if empty(ms) || str2nr(ms[1]) < 14 || (str2nr(ms[1]) == 14 && str2nr(ms[2]) < 14)
call add(lines, 'Error: Node version '.output.' < 14.14.0, please upgrade node.js')
if empty(ms) || str2nr(ms[1]) < 16 || (str2nr(ms[1]) == 16 && str2nr(ms[2]) < 18)
call add(lines, 'Error: Node version '.output.' < 16.18.0, please upgrade node.js')
endif
endif
" check bundle
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/list/mappings.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ describe('Default normal mappings', () => {
it('should insert command by :', async () => {
await manager.start(['--normal', 'location'])
await manager.session.ui.ready
await helper.wait(10)
await helper.wait(20)
await helper.listInput(':')
await nvim.eval('feedkeys("let g:x = 1\\<cr>", "in")')
let res = await nvim.getVar('x')
Expand Down
7 changes: 6 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1025,11 +1025,16 @@
dependencies:
"@types/node" "*"

"@types/node@*", "@types/node@14.14":
"@types/node@*":
version "14.14.45"
resolved "https://registry.yarnpkg.com/@types/node/-/node-14.14.45.tgz#ec2dfb5566ff814d061aef7e141575aedba245cf"
integrity sha512-DssMqTV9UnnoxDWu959sDLZzfvqCF0qDNRjaWeYSui9xkFe61kKo4l1TWNTQONpuXEm+gLMRvdlzvNHBamzmEw==

"@types/node@16.18":
version "16.18.46"
resolved "https://registry.yarnpkg.com/@types/node/-/node-16.18.46.tgz#9f2102d0ba74a318fcbe170cbff5463f119eab59"
integrity sha512-Mnq3O9Xz52exs3mlxMcQuA7/9VFe/dXcrgAyfjLkABIqxXKOgBRjyazTxUbjsxDa4BP7hhPliyjVTP9RDP14xg==

"@types/prettier@^2.1.5":
version "2.7.2"
resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.7.2.tgz#6c2324641cc4ba050a8c710b2b251b377581fbf0"
Expand Down

0 comments on commit 5385efd

Please sign in to comment.