Skip to content

Commit 4346d1a

Browse files
author
hirsch
committed
🐛 Fix npm start process
1 parent 5685239 commit 4346d1a

File tree

5 files changed

+25
-27
lines changed

5 files changed

+25
-27
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ yarn-error.log
1414
# OS generated files #
1515
.DS_Store
1616
Thumbs.db
17+
.tmp/
1718

1819
# Typing #
1920
typings/

commands/tsconfig.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import * as path from 'path';
44
import * as tsconfig from '../tsconfig.json';
55

66
const content: any = tsconfig;
7+
content.compilerOptions.outDir = '.tmp';
78
content.include = [
89
'src/**/*',
910
];

package-scripts.js

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* Windows: Please do not use trailing comma as windows will fail with token error
33
*/
44

5-
const { series, crossEnv, concurrent, rimraf, runInNewWindow } = require('nps-utils');
5+
const { series, rimraf, } = require('nps-utils');
66

77
module.exports = {
88
scripts: {
@@ -11,7 +11,7 @@ module.exports = {
1111
* Starts the builded app from the dist directory.
1212
*/
1313
start: {
14-
script: 'cross-env NODE_ENV=production node dist/src/app.js',
14+
script: 'cross-env NODE_ENV=production node dist/app.js',
1515
description: 'Starts the builded app',
1616
},
1717
/**
@@ -60,7 +60,9 @@ module.exports = {
6060
'nps lint',
6161
'nps clean.dist',
6262
'nps transpile',
63-
'nps copy'
63+
'nps copy',
64+
'nps copy.tmp',
65+
'nps clean.tmp',
6466
),
6567
description: 'Builds the app into the dist directory'
6668
},
@@ -92,6 +94,10 @@ module.exports = {
9294
dist: {
9395
script: rimraf('./dist'),
9496
hiddenFromHelp: true
97+
},
98+
tmp: {
99+
script: rimraf('./.tmp'),
100+
hiddenFromHelp: true
95101
}
96102
},
97103
/**
@@ -118,6 +124,13 @@ module.exports = {
118124
'./dist'
119125
),
120126
hiddenFromHelp: true
127+
},
128+
tmp: {
129+
script: copyDir(
130+
'./.tmp/src',
131+
'./dist'
132+
),
133+
hiddenFromHelp: true
121134
}
122135
},
123136
/**
@@ -274,7 +287,11 @@ function banner(name) {
274287
}
275288

276289
function copy(source, target) {
277-
return `copyfiles ${source} ${target}`;
290+
return `copyfiles --up 1 ${source} ${target}`;
291+
}
292+
293+
function copyDir(source, target) {
294+
return `ncp ${source} ${target}`;
278295
}
279296

280297
function run(path) {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@
6363
"nodemon": "^1.12.1",
6464
"nps": "^5.7.1",
6565
"nps-utils": "^1.5.0",
66-
"path": "^0.12.7",
6766
"pg": "^7.4.3",
6867
"reflect-metadata": "^0.1.10",
6968
"routing-controllers": "^0.7.6",
@@ -118,6 +117,7 @@
118117
"jest": "23.6.0",
119118
"mock-express-request": "^0.2.0",
120119
"mock-express-response": "^0.2.1",
120+
"ncp": "^2.0.0",
121121
"nock": "10.0.0",
122122
"sqlite3": "^4.0.0",
123123
"ts-jest": "23.10.1"

yarn.lock

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2269,10 +2269,6 @@ inherits@2, inherits@2.0.3, inherits@^2.0.1, inherits@~2.0.1, inherits@~2.0.3:
22692269
version "2.0.3"
22702270
resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de"
22712271

2272-
inherits@2.0.1:
2273-
version "2.0.1"
2274-
resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.1.tgz#b17d08d326b4423e568eff719f91b0b1cbdf69f1"
2275-
22762272
ini@^1.3.4, ini@~1.3.0:
22772273
version "1.3.5"
22782274
resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.5.tgz#eee25f56db1c9ec6085e0c22778083f596abf927"
@@ -3457,7 +3453,7 @@ natural-compare@^1.4.0:
34573453
version "1.4.0"
34583454
resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7"
34593455

3460-
ncp@2.0.0:
3456+
ncp@2.0.0, ncp@^2.0.0:
34613457
version "2.0.0"
34623458
resolved "http://registry.npmjs.org/ncp/-/ncp-2.0.0.tgz#195a21d6c46e361d2fb1281ba38b91e9df7bdbb3"
34633459

@@ -3935,13 +3931,6 @@ path@^0.11.14:
39353931
version "0.11.14"
39363932
resolved "https://registry.yarnpkg.com/path/-/path-0.11.14.tgz#cbc7569355cb3c83afeb4ace43ecff95231e5a7d"
39373933

3938-
path@^0.12.7:
3939-
version "0.12.7"
3940-
resolved "https://registry.yarnpkg.com/path/-/path-0.12.7.tgz#d4dc2a506c4ce2197eb481ebfcd5b36c0140b10f"
3941-
dependencies:
3942-
process "^0.11.1"
3943-
util "^0.10.3"
3944-
39453934
pathval@^1.0.0:
39463935
version "1.1.0"
39473936
resolved "https://registry.yarnpkg.com/pathval/-/pathval-1.1.0.tgz#b942e6d4bde653005ef6b71361def8727d0645e0"
@@ -4083,10 +4072,6 @@ process-nextick-args@~2.0.0:
40834072
version "2.0.0"
40844073
resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.0.tgz#a37d732f4271b4ab1ad070d35508e8290788ffaa"
40854074

4086-
process@^0.11.1:
4087-
version "0.11.10"
4088-
resolved "https://registry.yarnpkg.com/process/-/process-0.11.10.tgz#7332300e840161bda3e69a1d1d91a7d4bc16f182"
4089-
40904075
prompts@^0.1.9:
40914076
version "0.1.14"
40924077
resolved "https://registry.yarnpkg.com/prompts/-/prompts-0.1.14.tgz#a8e15c612c5c9ec8f8111847df3337c9cbd443b2"
@@ -5309,12 +5294,6 @@ util.promisify@^1.0.0:
53095294
define-properties "^1.1.2"
53105295
object.getownpropertydescriptors "^2.0.3"
53115296

5312-
util@^0.10.3:
5313-
version "0.10.3"
5314-
resolved "https://registry.yarnpkg.com/util/-/util-0.10.3.tgz#7afb1afe50805246489e3db7fe0ed379336ac0f9"
5315-
dependencies:
5316-
inherits "2.0.1"
5317-
53185297
utils-merge@1.0.1, utils-merge@^1.0.1:
53195298
version "1.0.1"
53205299
resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713"

0 commit comments

Comments
 (0)