Skip to content

Commit

Permalink
build: update gulp/package.json scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
kamilmysliwiec committed Oct 17, 2018
1 parent 72616cc commit 84aa4de
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 42 deletions.
16 changes: 8 additions & 8 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const packages = {
const modules = Object.keys(packages);
const source = 'packages';
const distId = process.argv.indexOf('--dist');
const dist = distId < 0 ? 'node_modules/@nestjs' : process.argv[distId + 1];
const dist = distId < 0 ? source : process.argv[distId + 1];

gulp.task('default', function() {
modules.forEach(module => {
Expand All @@ -30,23 +30,23 @@ gulp.task('default', function() {
gulp.task('copy-misc', function() {
return gulp
.src(['Readme.md', 'LICENSE', '.npmignore'])
.pipe(gulp.dest('packages/common'))
.pipe(gulp.dest('packages/core'))
.pipe(gulp.dest('packages/microservices'))
.pipe(gulp.dest('packages/websockets'))
.pipe(gulp.dest('packages/testing'));
.pipe(gulp.dest(`${source}/common`))
.pipe(gulp.dest(`${source}/core`))
.pipe(gulp.dest(`${source}/microservices`))
.pipe(gulp.dest(`${source}/websockets`))
.pipe(gulp.dest(`${source}/testing`));
});

gulp.task('clean:output', function() {
return gulp
.src(['packages/**/*.js', 'packages/**/*.d.ts'], {
.src([`${source}/**/*.js`, `${source}/**/*.d.ts`], {
read: false,
})
.pipe(clean());
});

gulp.task('clean:dirs', function(done) {
deleteEmpty.sync('packages/');
deleteEmpty.sync(`${source}/`);
done();
});

Expand Down
55 changes: 26 additions & 29 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,30 @@
"scripts": {
"coverage": "nyc report --reporter=text-lcov | coveralls",
"precommit": "lint-staged",
"test": "nyc --require ts-node/register mocha packages/**/*.spec.ts --reporter spec --require 'node_modules/reflect-metadata/Reflect.js'",
"integration-test": "mocha integration/**/*.spec.ts --reporter spec --require ts-node/register --require 'node_modules/reflect-metadata/Reflect.js'",
"lint": "tslint -p tsconfig.json -c tslint.json \"packages/**/*.ts\" -e \"*.spec.ts\"",
"format": "prettier **/**/*.ts --ignore-path ./.prettierignore --write && git status",
"test":
"nyc --require ts-node/register mocha packages/**/*.spec.ts --reporter spec --require 'node_modules/reflect-metadata/Reflect.js'",
"integration-test":
"mocha integration/**/*.spec.ts --reporter spec --require ts-node/register --require 'node_modules/reflect-metadata/Reflect.js'",
"lint":
"tslint -p tsconfig.json -c tslint.json \"packages/**/*.ts\" -e \"*.spec.ts\"",
"format":
"prettier **/**/*.ts --ignore-path ./.prettierignore --write && git status",
"clean": "gulp clean:bundle",
"build": "gulp build && gulp move",
"build:lib": "npm run clean && gulp build --dist packages",
"build": "npm run clean && gulp build",
"build:dev": "gulp build --dist node_modules/@nestjs && gulp move",
"postinstall": "opencollective",
"copy-misc": "gulp copy-misc",
"prepare:npm": "npm run build:lib && npm run copy-misc",
"publish": "npm run prepare:npm && ./node_modules/.bin/lerna publish --exact -m \"chore(@nestjs) publish %s release\"",
"publish:rc": "npm run prepare:npm && ./node_modules/.bin/lerna publish --npm-tag=rc -m \"chore(@nestjs) publish %s release\"",
"publish:next": "npm run prepare:npm && ./node_modules/.bin/lerna publish --npm-tag=next --skip-git -m \"chore(@nestjs) publish %s release\"",
"publish:beta": "npm run prepare:npm && ./node_modules/.bin/lerna publish --npm-tag=beta -m \"chore(@nestjs) publish %s release\"",
"publish:test": "npm run prepare:npm && ./node_modules/.bin/lerna publish --npm-tag=test --skip-git -m \"chore(@nestjs) publish %s release\""
"prepare": "npm run build:lib && npm run copy-misc",
"publish":
"npm run prepare && ./node_modules/.bin/lerna publish --exact -m \"chore(@nestjs) publish %s release\"",
"publish:rc":
"npm run prepare && ./node_modules/.bin/lerna publish --npm-tag=rc -m \"chore(@nestjs) publish %s release\"",
"publish:next":
"npm run prepare && ./node_modules/.bin/lerna publish --npm-tag=next --skip-git -m \"chore(@nestjs) publish %s release\"",
"publish:beta":
"npm run prepare && ./node_modules/.bin/lerna publish --npm-tag=beta -m \"chore(@nestjs) publish %s release\"",
"publish:test":
"npm run prepare && ./node_modules/.bin/lerna publish --npm-tag=test --skip-git -m \"chore(@nestjs) publish %s release\""
},
"engines": {
"node": ">= 8.9.0"
Expand Down Expand Up @@ -129,9 +138,7 @@
}
},
"nyc": {
"include": [
"packages/**/*.ts"
],
"include": ["packages/**/*.ts"],
"exclude": [
"node_modules/",
"packages/**/*.spec.ts",
Expand All @@ -150,23 +157,13 @@
"packages/common/serializer/**/*",
"packages/common/services/logger.service.ts"
],
"extension": [
".ts"
],
"require": [
"ts-node/register"
],
"reporter": [
"text-summary",
"html"
],
"extension": [".ts"],
"require": ["ts-node/register"],
"reporter": ["text-summary", "html"],
"sourceMap": true,
"instrument": true
},
"lint-staged": {
"packages/**/*.{ts,json}": [
"npm run format",
"git add"
]
"packages/**/*.{ts,json}": ["npm run format", "git add"]
}
}
1 change: 0 additions & 1 deletion packages/common/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"extends": "./../tsconfig.base.json",
"compilerOptions": {
"rootDir": "./",
"baseUrl": "./"
},
"include": ["*.ts", "**/*.ts"]
Expand Down
1 change: 0 additions & 1 deletion packages/core/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"extends": "./../tsconfig.base.json",
"compilerOptions": {
"rootDir": "./",
"baseUrl": "./"
},
"include": ["*.ts", "**/*.ts"]
Expand Down
1 change: 0 additions & 1 deletion packages/microservices/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"extends": "./../tsconfig.base.json",
"compilerOptions": {
"rootDir": "./",
"baseUrl": "./"
},
"include": ["*.ts", "**/*.ts"]
Expand Down
1 change: 0 additions & 1 deletion packages/testing/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"extends": "./../tsconfig.base.json",
"compilerOptions": {
"rootDir": "./",
"baseUrl": "./"
},
"include": ["*.ts", "**/*.ts"]
Expand Down
1 change: 0 additions & 1 deletion packages/websockets/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"extends": "./../tsconfig.base.json",
"compilerOptions": {
"rootDir": "./",
"baseUrl": "./"
},
"include": ["*.ts", "**/*.ts"]
Expand Down

0 comments on commit 84aa4de

Please sign in to comment.