@@ -6,121 +6,83 @@ const { series, crossEnv, concurrent, rimraf, runInNewWindow } = require('nps-ut
66
77module . exports = {
88 scripts : {
9- default : {
10- script : 'nps start'
11- } ,
9+ default : 'nps start' ,
1210 /**
1311 * Starts the builded app from the dist directory
1412 */
15- start : {
16- script : 'node dist/app.js'
17- } ,
13+ start : 'node dist/app.js' ,
1814 /**
1915 * Serves the current app and watches for changes to restart it
2016 */
21- serve : {
22- script : series (
23- 'nps banner.serve' ,
24- 'nodemon --watch src --watch .env'
25- )
26- } ,
17+ serve : series (
18+ 'nps banner.serve' ,
19+ 'nodemon --watch src --watch .env'
20+ ) ,
2721 /**
2822 * Setup's the development environment and the database
2923 */
30- setup : {
31- script : series (
32- 'yarn install' ,
33- 'nps db.migrate' ,
34- 'nps db.seed'
35- )
36- } ,
24+ setup : series (
25+ 'yarn install' ,
26+ 'nps db.migrate' ,
27+ 'nps db.seed'
28+ ) ,
3729 /**
3830 * Builds the app into the dist directory
3931 */
40- build : {
41- script : series (
42- 'nps banner.build' ,
43- 'nps lint' ,
44- 'nps clean.dist' ,
45- 'nps transpile' ,
46- 'nps copy'
47- )
48- } ,
32+ build : series (
33+ 'nps banner.build' ,
34+ 'nps lint' ,
35+ 'nps clean.dist' ,
36+ 'nps transpile' ,
37+ 'nps copy'
38+ ) ,
4939 /**
5040 * Database scripts
5141 */
5242 db : {
53- migrate : {
54- script : series (
55- 'nps banner.migrate' ,
56- 'nps db.config' ,
57- runFast ( './node_modules/typeorm/cli.js migrations:run' )
58- )
59- } ,
60- revert : {
61- script : series (
62- 'nps banner.revert' ,
63- 'nps db.config' ,
64- runFast ( './node_modules/typeorm/cli.js migrations:revert' )
65- )
66- } ,
67- seed : {
68- script : series (
69- 'nps banner.seed' ,
70- 'nps db.config' ,
71- runFast ( './src/lib/seeds/' )
72- )
73- } ,
74- config : {
75- script : runFast ( './src/lib/ormconfig.ts' )
76- } ,
77- drop : {
78- script : runFast ( './node_modules/typeorm/cli.js schema:drop' )
79- }
43+ migrate : series (
44+ 'nps banner.migrate' ,
45+ 'nps db.config' ,
46+ runFast ( './node_modules/typeorm/cli.js migrations:run' )
47+ ) ,
48+ revert : series (
49+ 'nps banner.revert' ,
50+ 'nps db.config' ,
51+ runFast ( './node_modules/typeorm/cli.js migrations:revert' )
52+ ) ,
53+ seed : series (
54+ 'nps banner.seed' ,
55+ 'nps db.config' ,
56+ runFast ( './src/lib/seeds/' )
57+ ) ,
58+ config : runFast ( './src/lib/ormconfig.ts' ) ,
59+ drop : runFast ( './node_modules/typeorm/cli.js schema:drop' )
8060 } ,
8161 /**
8262 * These run various kinds of tests. Default is unit.
8363 */
8464 test : {
8565 default : 'nps test.unit' ,
8666 unit : {
87- default : {
88- script : series (
89- 'nps banner.test' ,
90- 'nps test.unit.pretest' ,
91- 'nps test.unit.run'
92- )
93- } ,
94- pretest : {
95- script : 'tslint -c ./tslint.json -t stylish ./test/unit/**/*.ts'
96- } ,
97- run : {
98- script : 'cross-env NODE_ENV=test jest --testPathPattern=unit'
99- } ,
100- verbose : {
101- script : 'nps "test --verbose"'
102- } ,
103- coverage : {
104- script : 'nps "test --coverage"'
105- }
67+ default : series (
68+ 'nps banner.test' ,
69+ 'nps test.unit.pretest' ,
70+ 'nps test.unit.run'
71+ ) ,
72+ pretest : 'tslint -c ./tslint.json -t stylish ./test/unit/**/*.ts' ,
73+ run : 'cross-env NODE_ENV=test jest --testPathPattern=unit' ,
74+ verbose : 'nps "test --verbose"' ,
75+ coverage : 'nps "test --coverage"'
10676 } ,
10777 integration : {
108- default : {
109- script : series (
110- 'nps banner.test' ,
111- 'nps test.integration.pretest' ,
112- 'nps test.integration.run'
113- )
114- } ,
115- pretest : {
116- script : 'tslint -c ./tslint.json -t stylish ./test/integration/**/*.ts'
117- } ,
118- verbose : {
119- script : 'nps "test.integration --verbose"'
120- } ,
121- run : {
122- script : 'cross-env NODE_ENV=test jest --testPathPattern=integration -i'
123- } ,
78+ default : series (
79+ 'nps banner.test' ,
80+ 'nps test.integration.pretest' ,
81+ 'nps test.integration.run'
82+ ) ,
83+ pretest : 'tslint -c ./tslint.json -t stylish ./test/integration/**/*.ts' ,
84+ verbose : 'nps "test.integration --verbose"' ,
85+ run : 'cross-env NODE_ENV=test jest --testPathPattern=integration -i' ,
12486 } ,
12587 e2e : {
12688 default : {
@@ -146,51 +108,37 @@ module.exports = {
146108 /**
147109 * Runs TSLint over your project
148110 */
149- lint : {
150- script : `tslint -c ./tslint.json -p tsconfig.json src/**/*.ts --format stylish`
151- } ,
111+ lint : `tslint -c ./tslint.json -p tsconfig.json src/**/*.ts --format stylish` ,
152112 /**
153113 * Transpile your app into javascript
154114 */
155- transpile : {
156- script : `tsc`
157- } ,
115+ transpile : `tsc` ,
158116 /**
159117 * Clean files and folders
160118 */
161119 clean : {
162- default : {
163- script : series (
164- `nps banner.clean` ,
165- `nps clean.dist`
166- )
167- } ,
168- dist : {
169- script : rimraf ( './dist' )
170- }
120+ default : series (
121+ `nps banner.clean` ,
122+ `nps clean.dist`
123+ ) ,
124+ dist : rimraf ( './dist' )
171125 } ,
172126 /**
173127 * Copies static files to the build folder
174128 */
175129 copy : {
176- default : {
177- script : series (
178- `nps copy.swagger` ,
179- `nps copy.public`
180- )
181- } ,
182- swagger : {
183- script : copy (
184- './src/api/swagger.json' ,
185- './dist'
186- )
187- } ,
188- public : {
189- script : copy (
190- './src/public/*' ,
191- './dist'
192- )
193- }
130+ default : series (
131+ `nps copy.swagger` ,
132+ `nps copy.public`
133+ ) ,
134+ swagger : copy (
135+ './src/api/swagger.json' ,
136+ './dist'
137+ ) ,
138+ public : copy (
139+ './src/public/*' ,
140+ './dist'
141+ )
194142 } ,
195143 /**
196144 * This creates pretty banner to the terminal
0 commit comments