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.
style(@nestjs) run prettier, update code style
- Loading branch information
1 parent
2a1cb06
commit 2aa4bb9
Showing
248 changed files
with
2,592 additions
and
1,712 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 |
---|---|---|
|
@@ -24,5 +24,6 @@ yarn-error.log | |
|
||
# tests | ||
/test | ||
/integration | ||
/coverage | ||
/.nyc_output |
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
2 changes: 1 addition & 1 deletion
2
examples/12-graphql-apollo/src/subscriptions/subscription.constants.ts
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 +1 @@ | ||
export const SUBSCRIPTION_SERVER = 'SUBSCRIPTION_SERVER'; | ||
export const SUBSCRIPTION_SERVER = 'SUBSCRIPTION_SERVER'; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,101 +1,97 @@ | ||
const fs = require('fs'); | ||
const path = require('path'); | ||
const gulp = require('gulp'); | ||
const ts = require('gulp-typescript'); | ||
const gulpSequence = require('gulp-sequence'); | ||
const sourcemaps = require('gulp-sourcemaps'); | ||
const clean = require('gulp-clean'); | ||
|
||
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] | ||
); | ||
}); | ||
modules.forEach(module => { | ||
gulp.watch( | ||
[`${source}/${module}/**/*.ts`, `${source}/${module}/*.ts`], | ||
[module], | ||
); | ||
}); | ||
}); | ||
|
||
gulp.task('copy:ts', function(){ | ||
return gulp.src(['src/**/*.ts']) | ||
.pipe(gulp.dest('./lib')); | ||
gulp.task('copy:ts', function() { | ||
return gulp.src(['src/**/*.ts']).pipe(gulp.dest('./lib')); | ||
}); | ||
|
||
gulp.task('clean:lib', function(){ | ||
return gulp.src([ | ||
'lib/**/*.js.map', | ||
'lib/**/*.ts', | ||
'!lib/**/*.d.ts' | ||
], {read: false}) | ||
.pipe(clean()); | ||
gulp.task('clean:lib', function() { | ||
return gulp | ||
.src(['lib/**/*.js.map', 'lib/**/*.ts', '!lib/**/*.d.ts'], { read: false }) | ||
.pipe(clean()); | ||
}); | ||
|
||
modules.forEach(module => { | ||
gulp.task(module, () => { | ||
return packages[module] | ||
.src() | ||
.pipe(packages[module]()) | ||
.pipe(gulp.dest(`${dist}/${module}`)); | ||
}); | ||
gulp.task(module, () => { | ||
return packages[module] | ||
.src() | ||
.pipe(packages[module]()) | ||
.pipe(gulp.dest(`${dist}/${module}`)); | ||
}); | ||
}); | ||
|
||
modules.forEach(module => { | ||
gulp.task(module + ':dev', () => { | ||
return packages[module] | ||
.src() | ||
.pipe(sourcemaps.init()) | ||
.pipe(packages[module]()) | ||
.pipe(sourcemaps.mapSources(sourcePath => './' + sourcePath.split('/').pop())) | ||
.pipe(sourcemaps.write('.')) | ||
.pipe(gulp.dest(`${dist}/${module}`)); | ||
}); | ||
gulp.task(module + ':dev', () => { | ||
return packages[module] | ||
.src() | ||
.pipe(sourcemaps.init()) | ||
.pipe(packages[module]()) | ||
.pipe( | ||
sourcemaps.mapSources(sourcePath => './' + sourcePath.split('/').pop()), | ||
) | ||
.pipe(sourcemaps.write('.')) | ||
.pipe(gulp.dest(`${dist}/${module}`)); | ||
}); | ||
}); | ||
|
||
gulp.task('build', function(cb) { | ||
gulpSequence('common', modules.filter((module) => module !== 'common'), cb); | ||
gulpSequence('common', modules.filter(module => module !== 'common'), cb); | ||
}); | ||
|
||
gulp.task('build:dev', function(cb) { | ||
gulpSequence( | ||
'common:dev', | ||
modules.filter((module) => module !== 'common').map((module) => module + ':dev'), | ||
'copy:ts', | ||
cb); | ||
gulpSequence( | ||
'common:dev', | ||
modules | ||
.filter(module => module !== 'common') | ||
.map(module => module + ':dev'), | ||
'copy:ts', | ||
cb, | ||
); | ||
}); | ||
|
||
function getFolders(dir) { | ||
return fs.readdirSync(dir).filter(function(file) { | ||
return fs.statSync(path.join(dir, file)).isDirectory(); | ||
}); | ||
} | ||
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') | ||
).pipe( | ||
gulp.dest('examples/11-swagger/node_modules/@nestjs') | ||
).pipe( | ||
gulp.dest('examples/12-graphql-apollo/node_modules/@nestjs') | ||
).pipe( | ||
gulp.dest('examples/15-mvc/node_modules/@nestjs') | ||
); | ||
const getDirs = (base) => getFolders(base) | ||
.map((path) => `${base}/${path}`); | ||
|
||
const examplesDirs = getDirs('examples'); | ||
const integrationDirs = getDirs('integration'); | ||
const directories = examplesDirs.concat(integrationDirs); | ||
|
||
let stream = gulp | ||
.src(['node_modules/@nestjs/**/*']); | ||
|
||
directories.forEach((dir) => { | ||
stream = stream.pipe(gulp.dest(dir + '/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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,24 @@ | ||
export declare const metadata: { | ||
MODULES: string; | ||
IMPORTS: string; | ||
COMPONENTS: string; | ||
CONTROLLERS: string; | ||
EXPORTS: string; | ||
MODULES: string; | ||
IMPORTS: string; | ||
COMPONENTS: string; | ||
CONTROLLERS: string; | ||
EXPORTS: string; | ||
}; | ||
export declare const SHARED_MODULE_METADATA = "__sharedModule__"; | ||
export declare const GLOBAL_MODULE_METADATA = "__globalModule__"; | ||
export declare const PATH_METADATA = "path"; | ||
export declare const PARAMTYPES_METADATA = "design:paramtypes"; | ||
export declare const SELF_DECLARED_DEPS_METADATA = "self:paramtypes"; | ||
export declare const METHOD_METADATA = "method"; | ||
export declare const ROUTE_ARGS_METADATA = "__routeArguments__"; | ||
export declare const CUSTOM_ROUTE_AGRS_METADATA = "__customRouteArgs__"; | ||
export declare const EXCEPTION_FILTERS_METADATA = "__exceptionFilters__"; | ||
export declare const FILTER_CATCH_EXCEPTIONS = "__filterCatchExceptions__"; | ||
export declare const PIPES_METADATA = "__pipes__"; | ||
export declare const GUARDS_METADATA = "__guards__"; | ||
export declare const RENDER_METADATA = "__renderTemplate__"; | ||
export declare const INTERCEPTORS_METADATA = "__interceptors__"; | ||
export declare const HTTP_CODE_METADATA = "__httpCode__"; | ||
export declare const GATEWAY_MIDDLEWARES = "__gatewayMiddlewares"; | ||
export declare const MODULE_PATH = "__module_path__"; | ||
export declare const SHARED_MODULE_METADATA = '__sharedModule__'; | ||
export declare const GLOBAL_MODULE_METADATA = '__globalModule__'; | ||
export declare const PATH_METADATA = 'path'; | ||
export declare const PARAMTYPES_METADATA = 'design:paramtypes'; | ||
export declare const SELF_DECLARED_DEPS_METADATA = 'self:paramtypes'; | ||
export declare const METHOD_METADATA = 'method'; | ||
export declare const ROUTE_ARGS_METADATA = '__routeArguments__'; | ||
export declare const CUSTOM_ROUTE_AGRS_METADATA = '__customRouteArgs__'; | ||
export declare const EXCEPTION_FILTERS_METADATA = '__exceptionFilters__'; | ||
export declare const FILTER_CATCH_EXCEPTIONS = '__filterCatchExceptions__'; | ||
export declare const PIPES_METADATA = '__pipes__'; | ||
export declare const GUARDS_METADATA = '__guards__'; | ||
export declare const RENDER_METADATA = '__renderTemplate__'; | ||
export declare const INTERCEPTORS_METADATA = '__interceptors__'; | ||
export declare const HTTP_CODE_METADATA = '__httpCode__'; | ||
export declare const GATEWAY_MIDDLEWARES = '__gatewayMiddlewares'; | ||
export declare const MODULE_PATH = '__module_path__'; |
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
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
2 changes: 1 addition & 1 deletion
2
lib/common/decorators/modules/exceptions/invalid-module-config.exception.d.ts
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,3 +1,3 @@ | ||
export declare class InvalidModuleConfigException extends Error { | ||
constructor(property: string); | ||
constructor(property: string); | ||
} |
Oops, something went wrong.