Skip to content

Commit 9f61b10

Browse files
author
hirsch88
committed
Merge branch 'feature/build_task' into develop
# Conflicts: # package.json # yarn.lock
2 parents 49ceb60 + 8d0985a commit 9f61b10

File tree

4 files changed

+48
-406
lines changed

4 files changed

+48
-406
lines changed

knexfile.ts renamed to knexfile.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import * as dotenv from 'dotenv';
2-
dotenv.config();
1+
require('dotenv').config();
32

43
/**
54
* This is the database configuration for the migrations and

package.json

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44
"description": "A delightful way to building a RESTful API with NodeJs & TypeScript",
55
"main": "src/app.ts",
66
"scripts": {
7-
"banner": "./node_modules/.bin/ts-node --fast ./src/console/lib/banner.ts",
7+
"banner": "npm run ts-node:fast -- ./src/console/lib/banner.ts",
8+
"ts-node": "./node_modules/.bin/ts-node",
9+
"ts-node:fast": "./node_modules/.bin/ts-node -F",
810
"pretest": "./node_modules/.bin/tslint -c ./tslint.json -t stylish './test/unit/**/*.ts'",
911
"test:pretty": "npm run test -- --verbose",
1012
"test:coverage": "npm run test -- --coverage",
@@ -17,19 +19,19 @@
1719
"clean:src": "./node_modules/.bin/trash './src/**/*.js' './src/**/*.js.map'",
1820
"clean:knex": "./node_modules/.bin/trash knexfile.js knexfile.js.map",
1921
"copy:assets": "npm run copy:swagger && npm run copy:public",
20-
"copy:swagger": "./node_modules/.bin/copyup ./src/api/swagger.json ./dist/src",
21-
"copy:public": "./node_modules/.bin/copyup ./src/public/* ./dist/src",
22-
"db:migrate": "npm run banner migrate && ./node_modules/.bin/knex migrate:latest",
23-
"db:migrate:rollback": "npm run banner rollback && ./node_modules/.bin/knex migrate:rollback",
24-
"db:seed": "npm run banner seed && ./node_modules/.bin/knex seed:run",
22+
"copy:swagger": "./node_modules/.bin/copyup ./src/api/swagger.json ./dist",
23+
"copy:public": "./node_modules/.bin/copyup ./src/public/* ./dist",
24+
"db:migrate": "npm run banner migrate && npm run ts-node:fast -- ./node_modules/.bin/knex migrate:latest",
25+
"db:migrate:rollback": "npm run banner rollback && npm run ts-node:fast -- ./node_modules/.bin/knex migrate:rollback",
26+
"db:seed": "npm run banner seed && npm run ts-node:fast -- ./node_modules/.bin/knex seed:run",
2527
"db:reset": "npm run console db:reset",
26-
"console": "./node_modules/.bin/ts-node --fast ./src/console/commander.ts",
27-
"console:dev": "./node_modules/.bin/ts-node ./src/console/commander.ts",
28-
"console:help": "./node_modules/.bin/ts-node --fast ./src/console/commander.ts --help",
29-
"setup": "yarn install && npm run db:migrate && npm run db:seed",
28+
"console": "npm run ts-node:fast -- ./src/console/commander.ts",
29+
"console:dev": "npm run ts-node -- ./src/console/commander.ts",
30+
"console:help": "npm run ts-node:fast -- ./src/console/commander.ts --help",
31+
"setup": "npm run banner setup && yarn install && npm run db:migrate && npm run db:seed",
3032
"serve": "npm run banner serve && ./node_modules/.bin/nodemon --watch 'src/**/*.ts' --watch 'src/**/*.json' --watch '.env'",
3133
"test": "npm run banner test && NODE_ENV=test ./node_modules/.bin/jest ./test/unit",
32-
"build": "npm run banner build && npm run lint && npm run clean:src && npm run transpile && npm run clean:knex",
34+
"build": "npm run banner build && npm run lint && npm run clean:dist && npm run transpile && npm run copy:assets",
3335
"start": "node dist/app.js"
3436
},
3537
"repository": "git+ssh://git@github.com/w3tec/express-typescript-boilerplate.git",

src/types/knexfile.d.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
declare module '*knexfile' {
2+
let knexfile: any;
3+
export default knexfile;
4+
}

0 commit comments

Comments
 (0)