File tree Expand file tree Collapse file tree 5 files changed +35
-25
lines changed Expand file tree Collapse file tree 5 files changed +35
-25
lines changed Original file line number Diff line number Diff line change @@ -411,7 +411,11 @@ jobs:
411411 with :
412412 path : ${{ env.CACHED_BUILD_PATHS }}
413413 key : ${{ env.BUILD_CACHE_KEY }}
414- - name : Run build tests
414+ - name : Run browser build tests
415415 run : |
416416 cd packages/browser
417417 yarn test:package
418+ - name : Run utils build tests
419+ run : |
420+ cd packages/utils
421+ yarn test:package
Original file line number Diff line number Diff line change 11* .js.map
22* .d.ts
33* .js
4+ ! test /package /build.js
45! .eslintrc.js
Original file line number Diff line number Diff line change 4545 "lint:prettier" : " prettier --check \" {src,test}/**/*.ts\" " ,
4646 "pack" : " npm pack" ,
4747 "test" : " jest" ,
48- "test:watch" : " jest --watch"
48+ "test:watch" : " jest --watch" ,
49+ "test:package" : " node test/package/build.js"
4950 },
5051 "volta" : {
5152 "extends" : " ../../package.json"
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ const fs = require ( 'fs' ) ;
2+ const path = require ( 'path' ) ;
3+
4+ const testStrings = [ `/// <reference types="node" />` ] ;
5+
6+ const paths = [ path . join ( './dist' ) , path . join ( './esm' ) ] ;
7+
8+ paths . forEach ( dir => {
9+ if ( ! fs . existsSync ( dir ) ) {
10+ // eslint-disable-next-line no-console
11+ console . error ( `${ dir } doesn't exist please build first` ) ;
12+ process . exit ( 1 ) ;
13+ }
14+ const files = fs . readdirSync ( dir ) ;
15+ files . forEach ( file => {
16+ if ( file . includes ( '.d.ts' ) ) {
17+ testStrings . forEach ( testString => {
18+ const filePath = path . join ( dir , file )
19+ if ( fs . readFileSync ( filePath , 'utf8' ) . includes ( testString ) ) {
20+ // eslint-disable-next-line no-console
21+ console . error ( `${ filePath } contains types` ) ;
22+ process . exit ( 1 ) ;
23+ }
24+ } ) ;
25+ }
26+ } ) ;
27+ } ) ;
You can’t perform that action at this time.
0 commit comments