File tree Expand file tree Collapse file tree 6 files changed +68
-885
lines changed Expand file tree Collapse file tree 6 files changed +68
-885
lines changed Original file line number Diff line number Diff line change 1
1
#! /bin/sh
2
2
. " $( dirname " $0 " ) /_/husky.sh"
3
3
4
- npm run lint- fix
5
- git add .
4
+ # eslint fix if lint fail then abort commit
5
+ npm run lint || (npm run lint-fix && exit 1)
Original file line number Diff line number Diff line change 10
10
" conceallevel" ,
11
11
" cursorcolumn" ,
12
12
" cursorline" ,
13
+ " esbuild" ,
13
14
" foldcolumn" ,
14
15
" getlog" ,
15
16
" outchannel" ,
17
+ " outfile" ,
16
18
" pubspec" ,
17
19
" regist" ,
18
20
" relativenumber" ,
19
21
" signcolumn" ,
22
+ " sourcemap" ,
20
23
" winhighlight"
21
24
]
22
25
}
Original file line number Diff line number Diff line change
1
+ /* eslint-disable @typescript-eslint/no-var-requires */
2
+ async function start ( watch ) {
3
+ await require ( 'esbuild' ) . build ( {
4
+ entryPoints : [ 'src/index.ts' ] ,
5
+ bundle : true ,
6
+ watch,
7
+ minify : process . env . NODE_ENV === 'production' ,
8
+ sourcemap : process . env . NODE_ENV === 'development' ,
9
+ define : { } ,
10
+ mainFields : [ 'module' , 'main' ] ,
11
+ external : [ 'coc.nvim' ] ,
12
+ platform : 'node' ,
13
+ // keep same node version which coc.nvim support
14
+ target : 'node10.12' ,
15
+ outfile : 'out/index.js' ,
16
+ plugins : [ ] ,
17
+ } ) ;
18
+ }
19
+
20
+ let watch = false ;
21
+
22
+ if ( process . argv . length > 2 && process . argv [ 2 ] === '--watch' ) {
23
+ console . log ( 'watching...' ) ;
24
+ watch = {
25
+ onRebuild ( error ) {
26
+ if ( error ) {
27
+ console . error ( 'watch build failed:' , error ) ;
28
+ } else {
29
+ console . log ( 'watch build succeeded' ) ;
30
+ }
31
+ } ,
32
+ } ;
33
+ }
34
+
35
+ start ( watch )
36
+ . then ( ( ) => {
37
+ console . log ( 'build succeeded' ) ;
38
+ } )
39
+ . catch ( ( ) => {
40
+ console . error ( 'build failed' ) ;
41
+ } ) ;
Original file line number Diff line number Diff line change 16
16
},
17
17
"scripts" : {
18
18
"clean" : " rm -rf ./out" ,
19
- "watch" : " webpack --watch" ,
20
- "build" : " webpack " ,
19
+ "watch" : " NODE_ENV=development node esbuild.js --watch" ,
20
+ "build" : " NODE_ENV=production node esbuild.js " ,
21
21
"lint" : " eslint src" ,
22
22
"lint-fix" : " eslint --fix src" ,
23
23
"prepare" : " husky install && npm run clean && npm run build"
217
217
]
218
218
},
219
219
"devDependencies" : {
220
- "@types/node" : " ^14.14.31 " ,
220
+ "@types/node" : " ^10.12.0 " ,
221
221
"@typescript-eslint/eslint-plugin" : " ^4.16.1" ,
222
222
"@typescript-eslint/parser" : " ^4.16.1" ,
223
223
"coc.nvim" : " ^0.0.80" ,
224
224
"colors" : " ^1.4.0" ,
225
+ "esbuild" : " ^0.9.0" ,
225
226
"eslint" : " ^7.21.0" ,
226
227
"eslint-config-prettier" : " ^8.1.0" ,
227
228
"eslint-plugin-prettier" : " ^3.3.1" ,
228
229
"fast-glob" : " ^3.2.5" ,
229
230
"husky" : " ^5.1.3" ,
230
231
"prettier" : " ^2.2.1" ,
231
- "ts-loader" : " ^8.0.17" ,
232
232
"typescript" : " ^4.2.2" ,
233
233
"vscode-languageserver-protocol" : " ^3.16.0" ,
234
- "webpack" : " ^5.24.2" ,
235
- "webpack-cli" : " ^4.5.0" ,
236
234
"which" : " ^2.0.2"
237
235
}
238
236
}
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments