forked from nestjs/nest
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
73ae76d
commit ac1303e
Showing
9 changed files
with
108 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,59 @@ | ||
const gulp = require('gulp'); | ||
const ts = require('gulp-typescript'); | ||
const gulpSequence = require('gulp-sequence') | ||
const gulpSequence = require('gulp-sequence'); | ||
|
||
const packages = { | ||
common: ts.createProject('src/common/tsconfig.json'), | ||
core: ts.createProject('src/core/tsconfig.json'), | ||
microservices: ts.createProject('src/microservices/tsconfig.json'), | ||
websockets: ts.createProject('src/websockets/tsconfig.json'), | ||
testing: ts.createProject('src/testing/tsconfig.json') | ||
common: ts.createProject('src/common/tsconfig.json'), | ||
core: ts.createProject('src/core/tsconfig.json'), | ||
microservices: ts.createProject('src/microservices/tsconfig.json'), | ||
websockets: ts.createProject('src/websockets/tsconfig.json'), | ||
testing: ts.createProject('src/testing/tsconfig.json'), | ||
}; | ||
const modules = Object.keys(packages); | ||
const source = 'src'; | ||
const distId = process.argv.indexOf('--dist'); | ||
const dist = distId < 0 ? 'node_modules/@nestjs' : process.argv[distId + 1]; | ||
|
||
gulp.task('default', function () { | ||
modules.forEach((module) => { | ||
gulp.watch([`${source}/${module}/**/*.ts`, `${source}/${module}/*.ts`], [module]); | ||
}); | ||
gulp.task('default', function() { | ||
modules.forEach(module => { | ||
gulp.watch( | ||
[`${source}/${module}/**/*.ts`, `${source}/${module}/*.ts`], | ||
[module] | ||
); | ||
}); | ||
}); | ||
|
||
modules.forEach((module) => { | ||
gulp.task(module, () => { | ||
return packages[module].src() | ||
.pipe(packages[module]()) | ||
.pipe(gulp.dest(`${dist}/${module}`)); | ||
}); | ||
modules.forEach(module => { | ||
gulp.task(module, () => { | ||
return packages[module] | ||
.src() | ||
.pipe(packages[module]()) | ||
.pipe(gulp.dest(`${dist}/${module}`)); | ||
}); | ||
}); | ||
|
||
gulp.task('build', function (cb) { | ||
gulpSequence(modules, cb); | ||
gulp.task('build', function(cb) { | ||
gulpSequence(modules, cb); | ||
}); | ||
|
||
|
||
gulp.task('move', function() { | ||
gulp.src(['node_modules/@nestjs/**/*']).pipe( | ||
gulp.dest('examples/01-cats-app/node_modules/@nestjs') | ||
).pipe( | ||
gulp.dest('examples/02-gateways/node_modules/@nestjs') | ||
).pipe( | ||
gulp.dest('examples/03-microservices/node_modules/@nestjs') | ||
).pipe( | ||
gulp.dest('examples/04-injector/node_modules/@nestjs') | ||
).pipe( | ||
gulp.dest('examples/05-sql-typeorm/node_modules/@nestjs') | ||
).pipe( | ||
gulp.dest('examples/06-mongoose/node_modules/@nestjs') | ||
).pipe( | ||
gulp.dest('examples/07-sequelize/node_modules/@nestjs') | ||
).pipe( | ||
gulp.dest('examples/08-passport/node_modules/@nestjs') | ||
).pipe( | ||
gulp.dest('examples/09-babel-example/node_modules/@nestjs') | ||
); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.