File tree 4 files changed +64
-1
lines changed
benchmarks/typescript/auto-typed 4 files changed +64
-1
lines changed Original file line number Diff line number Diff line change
1
+ name : TypeScript Benchmark "auto-typed-mongoose"
2
+ on :
3
+ pull_request :
4
+ paths :
5
+ - " .github/workflows/benchmark.yml"
6
+ - " package.json"
7
+ - " types/**"
8
+ - " benchmarks/typescript/**"
9
+ push :
10
+ branches :
11
+ - master
12
+ paths :
13
+ - " .github/workflows/benchmark.yml"
14
+ - " package.json"
15
+ - " types/**"
16
+ - " benchmarks/typescript/**"
17
+ permissions :
18
+ contents : read
19
+
20
+ jobs :
21
+ typescript :
22
+ runs-on : ubuntu-20.04
23
+ name : Benchmark TypeScript Types
24
+ steps :
25
+ - uses : actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2
26
+ with :
27
+ fetch-depth : 0
28
+ - name : Setup node
29
+ uses : actions/setup-node@2fddd8803e2f5c9604345a0b591c3020ee971a93 # v3.4.1
30
+ with :
31
+ node-version : 16
32
+
33
+ - run : npm install
34
+
35
+ - run : npx ts-benchmark -p ./benchmarks/typescript/auto-typed -f 17/100000 18 29 32 -g -t --colors
36
+ env :
37
+ DB_URL : ${{ secrets.DB_URL }}
Original file line number Diff line number Diff line change
1
+ import { Schema , Model , model } from 'mongoose' ;
2
+
3
+ const schema = new Schema ( {
4
+ name : { type : String , required : true } ,
5
+ email : { type : String , required : true } ,
6
+ avatar : String
7
+ } ) ;
8
+
9
+ const UserModel = model ( 'User' , schema ) ;
Original file line number Diff line number Diff line change
1
+ {
2
+ "compilerOptions" : {
3
+ "allowSyntheticDefaultImports" : true ,
4
+ "baseUrl" : " ." ,
5
+ "paths" : {
6
+ "mongoose" : [" ../../../" ]
7
+ }
8
+ },
9
+ "esModuleInterop" : true ,
10
+ "outDir" : " typescript" ,
11
+ "strictNullChecks" : true ,
12
+ "include" : [
13
+ " ./*.ts" ,
14
+ " ../../../index.d.ts"
15
+ ]
16
+ }
Original file line number Diff line number Diff line change 99
99
"tdd" : " mocha ./test/*.test.js --inspect --watch --recursive --watch-files ./**/*.{js,ts}" ,
100
100
"test-coverage" : " nyc --reporter=html --reporter=text npm test" ,
101
101
"ts-benchmark" : " ts-benchmark -p ./benchmarks/typescript/simple -f 17/100000 18 29 32" ,
102
- "ts-benchmark-watch" : " ts-benchmark -p ./benchmarks/typescript/simple -w ./types -i -s -f 17/100000 18 29 32 -b master"
102
+ "ts-benchmark-watch" : " ts-benchmark -p ./benchmarks/typescript/simple -w ./types -i -s -f 17/100000 18 29 32 -b master" ,
103
+ "ts-benchmark-auto" : " ts-benchmark -p ./benchmarks/typescript/auto-typed -f 17/100000 18 29 32"
103
104
},
104
105
"main" : " ./index.js" ,
105
106
"types" : " ./types/index.d.ts" ,
You can’t perform that action at this time.
0 commit comments