@@ -5,59 +5,59 @@ import { readFileSync } from 'fs'
5
5
// Clean
6
6
// -------------------------------------------------------------------------------
7
7
export async function clean ( ) {
8
- await folder ( 'target' ) . delete ( )
8
+ await folder ( 'target' ) . delete ( )
9
9
}
10
10
// -------------------------------------------------------------------------------
11
11
// Format
12
12
// -------------------------------------------------------------------------------
13
13
export async function format ( ) {
14
- await shell ( 'prettier --no-semi --single-quote --print-width 240 --trailing-comma all --write src test example/index.ts benchmark' )
14
+ await shell ( 'prettier --no-semi --single-quote --print-width 240 --trailing-comma all --write src test example/index.ts benchmark' )
15
15
}
16
16
// -------------------------------------------------------------------------------
17
17
// Start
18
18
// -------------------------------------------------------------------------------
19
19
export async function start ( example = 'index' ) {
20
- await shell ( `hammer run example/${ example } .ts --dist target/example/${ example } ` )
20
+ await shell ( `hammer run example/${ example } .ts --dist target/example/${ example } ` )
21
21
}
22
22
// -------------------------------------------------------------------------------
23
23
// Benchmark
24
24
// -------------------------------------------------------------------------------
25
25
export async function benchmark ( ) {
26
- await compression ( )
27
- await measurement ( )
26
+ await compression ( )
27
+ await measurement ( )
28
28
}
29
29
// -------------------------------------------------------------------------------
30
30
// Test
31
31
// -------------------------------------------------------------------------------
32
32
export async function test_static ( ) {
33
- await shell ( `tsc -p test/static/tsconfig.json --noEmit --strict` )
33
+ await shell ( `tsc -p test/static/tsconfig.json --noEmit --strict` )
34
34
}
35
- export async function test_runtime ( filter ) {
36
- await shell ( `hammer build ./test/runtime/index.ts --dist target/test/runtime --platform node` )
37
- await shell ( `mocha target/test/runtime/index.js -g "${ filter } "` )
35
+ export async function test_runtime ( filter = '' ) {
36
+ await shell ( `hammer build ./test/runtime/index.ts --dist target/test/runtime --platform node` )
37
+ await shell ( `mocha target/test/runtime/index.js -g "${ filter } "` )
38
38
}
39
39
export async function test ( filter = '' ) {
40
- await test_static ( )
41
- await test_runtime ( filter )
40
+ await test_static ( )
41
+ await test_runtime ( filter )
42
42
}
43
43
// -------------------------------------------------------------------------------
44
44
// Build
45
45
// -------------------------------------------------------------------------------
46
46
export async function build ( target = 'target/build' ) {
47
- await test ( )
48
- await folder ( target ) . delete ( )
49
- await shell ( `tsc -p ./src/tsconfig.json --outDir ${ target } ` )
50
- await folder ( target ) . add ( 'package.json' )
51
- await folder ( target ) . add ( 'readme.md' )
52
- await folder ( target ) . add ( 'license' )
53
- await shell ( `cd ${ target } && npm pack` )
47
+ await test ( )
48
+ await folder ( target ) . delete ( )
49
+ await shell ( `tsc -p ./src/tsconfig.json --outDir ${ target } ` )
50
+ await folder ( target ) . add ( 'package.json' )
51
+ await folder ( target ) . add ( 'readme.md' )
52
+ await folder ( target ) . add ( 'license' )
53
+ await shell ( `cd ${ target } && npm pack` )
54
54
}
55
55
// -------------------------------------------------------------
56
56
// Publish
57
57
// -------------------------------------------------------------
58
58
export async function publish ( otp , target = 'target/build' ) {
59
- const { version } = JSON . parse ( readFileSync ( 'package.json' , 'utf8' ) )
60
- await shell ( `cd ${ target } && npm publish sinclair-typebox-${ version } .tgz --access=public --otp ${ otp } ` )
61
- await shell ( `git tag ${ version } ` )
62
- await shell ( `git push origin ${ version } ` )
59
+ const { version } = JSON . parse ( readFileSync ( 'package.json' , 'utf8' ) )
60
+ await shell ( `cd ${ target } && npm publish sinclair-typebox-${ version } .tgz --access=public --otp ${ otp } ` )
61
+ await shell ( `git tag ${ version } ` )
62
+ await shell ( `git push origin ${ version } ` )
63
63
}
0 commit comments