Skip to content

Commit 49ceb60

Browse files
author
hirsch88
committed
Fix the build command
1 parent 1d437e4 commit 49ceb60

File tree

7 files changed

+429
-53
lines changed

7 files changed

+429
-53
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ dist/
2828

2929
# Generated source-code #
3030
src/**/*.js
31+
src/**/*.js.map
3132
test/**/*.js
33+
test/**/*.js.map
3234
coverage/
3335
!test/preprocessor.js

.vscode/launch.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88
"type": "node",
99
"request": "launch",
1010
"name": "Debug",
11-
"program": "${workspaceRoot}/dist/app.js",
11+
"program": "${workspaceRoot}/src/app.js",
1212
"smartStep": true,
1313
"outFiles": [
14-
"../dist/**/*.js"
14+
"../src/**/*.js"
1515
],
1616
"protocol": "inspector",
1717
"preLaunchTask": "build",

.vscode/settings.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
{
22
"typescript.tsdk": "./node_modules/typescript/lib",
3-
"cSpell.enabled": true
3+
"cSpell.enabled": true,
4+
"files.exclude": {
5+
"src/**/*.js": true,
6+
"src/**/*.js.map": true,
7+
"test/**/*.js": true
8+
}
49
}

package.json

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,12 @@
1313
"test:black-box:pretty": "npm run test:black-box -- --verbose",
1414
"lint": "./node_modules/.bin/tslint -c ./tslint.json -p tsconfig.json 'src/**/*.ts' --format stylish",
1515
"transpile": "./node_modules/.bin/tsc",
16-
"clean:dist": "./node_modules/.bin/rimraf ./dist",
16+
"clean": "npm run clean:src && npm run clean:knex",
17+
"clean:src": "./node_modules/.bin/trash './src/**/*.js' './src/**/*.js.map'",
18+
"clean:knex": "./node_modules/.bin/trash knexfile.js knexfile.js.map",
1719
"copy:assets": "npm run copy:swagger && npm run copy:public",
18-
"copy:swagger": "./node_modules/.bin/copyup ./src/api/swagger.json ./dist",
19-
"copy:public": "./node_modules/.bin/copyup ./src/public/* ./dist",
20+
"copy:swagger": "./node_modules/.bin/copyup ./src/api/swagger.json ./dist/src",
21+
"copy:public": "./node_modules/.bin/copyup ./src/public/* ./dist/src",
2022
"db:migrate": "npm run banner migrate && ./node_modules/.bin/knex migrate:latest",
2123
"db:migrate:rollback": "npm run banner rollback && ./node_modules/.bin/knex migrate:rollback",
2224
"db:seed": "npm run banner seed && ./node_modules/.bin/knex seed:run",
@@ -27,7 +29,7 @@
2729
"setup": "yarn install && npm run db:migrate && npm run db:seed",
2830
"serve": "npm run banner serve && ./node_modules/.bin/nodemon --watch 'src/**/*.ts' --watch 'src/**/*.json' --watch '.env'",
2931
"test": "npm run banner test && NODE_ENV=test ./node_modules/.bin/jest ./test/unit",
30-
"build": "npm run banner build && npm run lint && npm run clean:dist && npm run transpile && npm run copy:assets",
32+
"build": "npm run banner build && npm run lint && npm run clean:src && npm run transpile && npm run clean:knex",
3133
"start": "node dist/app.js"
3234
},
3335
"repository": "git+ssh://git@github.com/w3tec/express-typescript-boilerplate.git",
@@ -60,7 +62,7 @@
6062
"dependencies": {
6163
"@types/bluebird": "^3.5.8",
6264
"@types/body-parser": "^1.16.4",
63-
"@types/bookshelf": "^0.9.1",
65+
"@types/bookshelf": "^0.9.3",
6466
"@types/chalk": "^0.4.31",
6567
"@types/commander": "^2.9.1",
6668
"@types/cors": "^2.8.1",
@@ -74,20 +76,20 @@
7476
"@types/jest": "^20.0.2",
7577
"@types/jsonwebtoken": "^7.2.1",
7678
"@types/knex": "0.0.52",
77-
"@types/lodash": "^4.14.66",
79+
"@types/lodash": "^4.14.67",
7880
"@types/mkdirp": "^0.3.29",
7981
"@types/morgan": "^1.7.32",
8082
"@types/pluralize": "^0.0.27",
8183
"@types/reflect-metadata": "0.0.5",
82-
"@types/request": "^0.0.44",
84+
"@types/request": "^0.0.45",
8385
"@types/request-promise": "^4.1.35",
8486
"@types/serve-favicon": "^2.2.28",
8587
"@types/winston": "^2.3.3",
8688
"body-parser": "^1.17.2",
8789
"bookshelf": "^0.10.3",
8890
"bookshelf-camelcase": "^1.1.4",
8991
"chalk": "^1.1.3",
90-
"class-validator": "^0.7.1",
92+
"class-validator": "^0.7.2",
9193
"commander": "^2.10.0",
9294
"compression": "^1.6.2",
9395
"copyfiles": "^1.2.0",
@@ -122,6 +124,7 @@
122124
"serve-favicon": "^2.4.3",
123125
"swagger-jsdoc": "^1.9.5",
124126
"swagger-ui-express": "^2.0.0",
127+
"trash-cli": "^1.4.0",
125128
"ts-jest": "^20.0.6",
126129
"ts-node": "^3.1.0",
127130
"tslint": "^5.4.3",

src/core/database/Factory.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@ export class Factory {
2626
this.blueprints = {};
2727
}
2828

29-
public define(ModelStatic: typeof bookshelf.Model, callback: (faker: Faker.FakerStatic, args: any[]) => any): void {
29+
public define(ModelStatic: any, callback: (faker: Faker.FakerStatic, args: any[]) => any): void {
3030
this.blueprints[this.getNameOfModel(ModelStatic)] = new BluePrint(ModelStatic, callback);
3131
}
3232

33-
public get(ModelStatic: typeof bookshelf.Model, ...args: any[]): ModelFactory {
33+
public get(ModelStatic: any, ...args: any[]): ModelFactory {
3434
return new ModelFactory(
3535
this.faker,
3636
this.blueprints[this.getNameOfModel(ModelStatic)],

tsconfig.json

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
"compilerOptions": {
33
"target": "es6",
44
"module": "commonjs",
5+
"pretty": true,
56
"sourceMap": true,
6-
"outDir": "dist",
77
"importHelpers": true,
88
"strict": true,
99
"noImplicitAny": false,
@@ -15,23 +15,26 @@
1515
"noImplicitReturns": true,
1616
"noFallthroughCasesInSwitch": true,
1717
"moduleResolution": "node",
18-
"baseUrl": "./",
18+
"baseUrl": ".",
1919
"paths": {
2020
"*": [
21-
"./node_modules/*",
22-
"./src/types/*"
21+
"node_modules/*",
22+
"src/types/*"
2323
]
2424
},
2525
"rootDirs": [],
2626
"typeRoots": [
27-
"./src/types"
27+
"src/types"
2828
],
2929
"types": [],
3030
"allowSyntheticDefaultImports": true,
3131
"experimentalDecorators": true,
3232
"emitDecoratorMetadata": true
3333
},
3434
"include": [
35-
"./src/**/*"
35+
"src/**/*"
36+
],
37+
"exclude": [
38+
"node_modules/*"
3639
]
3740
}

0 commit comments

Comments
 (0)