File tree Expand file tree Collapse file tree 3 files changed +34
-0
lines changed Expand file tree Collapse file tree 3 files changed +34
-0
lines changed Original file line number Diff line number Diff line change 43
43
- name : Lint
44
44
run : npm run lint
45
45
46
+ - name : Check types
47
+ run : npm run check:types
48
+
46
49
- name : Security audit
47
50
run : npm audit --production
48
51
Original file line number Diff line number Diff line change 26
26
"build:client" : " rimraf ./client/* && babel client-src/ --out-dir client/ --ignore \" client-src/webpack.config.js\" --ignore \" client-src/modules\" && webpack --config client-src/webpack.config.js" ,
27
27
"build:types" : " rimraf ./types/* && tsc --declaration --emitDeclarationOnly --outDir types && node ./scripts/extend-webpack-types.js && prettier \" types/**/*.ts\" --write && prettier \" types/**/*.ts\" --write" ,
28
28
"build" : " npm-run-all -p \" build:**\" " ,
29
+ "check:types" : " node ./scripts/check-types.js" ,
29
30
"test:only" : " jest" ,
30
31
"test:coverage" : " npm run test:only -- --coverage" ,
31
32
"test:watch" : " npm run test:coverage --watch" ,
Original file line number Diff line number Diff line change
1
+ "use strict" ;
2
+
3
+ // eslint-disable-next-line import/no-extraneous-dependencies
4
+ const { sync } = require ( "execa" ) ;
5
+
6
+ try {
7
+ sync ( "npm run build:types" , [ ] , {
8
+ cwd : __dirname ,
9
+ reject : false ,
10
+ shell : true ,
11
+ } ) ;
12
+
13
+ const { stdout } = sync ( "git status --porcelain" , [ ] , {
14
+ shell : true ,
15
+ } ) ;
16
+
17
+ if ( ! stdout . trim ( ) . includes ( "types/" ) ) {
18
+ // eslint-disable-next-line no-console
19
+ console . log ( "types are up-to-date." ) ;
20
+ process . exit ( 0 ) ;
21
+ } else {
22
+ // eslint-disable-next-line no-console
23
+ console . log ( `Please update types by running "npm run build:types"` ) ;
24
+ process . exit ( 2 ) ;
25
+ }
26
+ } catch ( error ) {
27
+ // eslint-disable-next-line no-console
28
+ console . error ( error ) ;
29
+ process . exit ( 2 ) ;
30
+ }
You can’t perform that action at this time.
0 commit comments