mirror of
https://github.com/nestjs/nest.git
synced 2026-02-21 23:11:44 +00:00
build(@nestjs) add copy README gulp script
This commit is contained in:
@@ -47,9 +47,13 @@ Nest is an MIT-licensed open source project. It can grow thanks to the sponsors
|
||||
|
||||
<a href="https://valor-software.com/"><img src="https://docs.nestjs.com/assets/sponsors/valor-software.png" width="300" /></a>
|
||||
|
||||
#### Silver Sponsor
|
||||
|
||||
<a href="https://neoteric.eu/"><img src="https://nestjs.com/img/neoteric-cut.png" width="130" /></a>
|
||||
|
||||
#### Sponsors
|
||||
|
||||
<a href="https://scal.io"><img src="https://nestjs.com/img/scalio-logo.svg" width="120" /></a> <a href="https://www.swingdev.io"><img src="https://nestjs.com/img/swingdev-logo.svg#1" width="120" /></a> <a href="http://angularity.io"><img src="http://angularity.io/media/logo.svg" height="32" /></a> <a href="http://gojob.com"><img src="https://gojob.com/w/wp-content/uploads/2017/02/cropped-Logo-web-home.png" height="44" /></a>
|
||||
<a href="https://scal.io"><img src="https://nestjs.com/img/scalio-logo.svg" width="120" /></a> <a href="https://www.swingdev.io"><img src="https://nestjs.com/img/swingdev-logo.svg#1" width="120" /></a> <a href="http://angularity.io"><img src="http://angularity.io/media/logo.svg" height="32" /></a> <a href="http://gojob.com"><img src="https://gojob.com/w/wp-content/uploads/2017/02/cropped-Logo-web-home.png" height="44" /> <a href="https://keycdn.com"><img src="https://nestjs.com/img/keycdn.svg" height="37" /></a> <a href="https://hostpresto.com"><img src="https://nestjs.com/img/hostpresto.png" height="32" /></a>
|
||||
|
||||
## Backers
|
||||
|
||||
|
||||
11
gulpfile.js
11
gulpfile.js
@@ -31,6 +31,17 @@ gulp.task('copy:ts', function() {
|
||||
return gulp.packages(['packages/**/*.ts']).pipe(gulp.dest('./bundle'));
|
||||
});
|
||||
|
||||
|
||||
gulp.task('copy-docs', function() {
|
||||
return gulp.src('Readme.md').pipe(
|
||||
gulp.dest('bundle/common'),
|
||||
gulp.dest('bundle/core'),
|
||||
gulp.dest('bundle/microservices'),
|
||||
gulp.dest('bundle/websockets'),
|
||||
gulp.dest('bundle/testing'),
|
||||
);
|
||||
});
|
||||
|
||||
gulp.task('clean:bundle', function() {
|
||||
return gulp
|
||||
.packages(['bundle/**/*.js.map', 'bundle/**/*.ts', '!bundle/**/*.d.ts'], { read: false })
|
||||
|
||||
5464
package-lock.json
generated
5464
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
10
package.json
10
package.json
@@ -11,10 +11,11 @@
|
||||
"format": "prettier **/**/*.ts --ignore-path ./.prettierignore --write && git status",
|
||||
"build": "gulp build && gulp move",
|
||||
"build:lib": "gulp build --dist bundle",
|
||||
"prepublish": "npm run build:lib",
|
||||
"prepublish:rc": "npm run build:lib",
|
||||
"prepublish:next": "npm run build:lib",
|
||||
"prepublish:beta": "npm run build:lib",
|
||||
"copy-docs": "gulp copy-docs",
|
||||
"prepublish": "npm run build:lib && npm run copy-docs",
|
||||
"prepublish:rc": "npm run build:lib && npm run copy-docs",
|
||||
"prepublish:next": "npm run build:lib && npm run copy-docs",
|
||||
"prepublish:beta": "npm run build:lib && npm run copy-docs",
|
||||
"publish": "./node_modules/.bin/lerna publish --exact -m \"chore(@nestjs) publish %s release\"",
|
||||
"publish:rc": "./node_modules/.bin/lerna publish --npm-tag=rc -m \"chore(@nestjs) publish %s release\"",
|
||||
"publish:next": "./node_modules/.bin/lerna publish --npm-tag=next --skip-git -m \"chore(@nestjs) publish %s release\"",
|
||||
@@ -44,6 +45,7 @@
|
||||
"deprecate": "^1.0.0",
|
||||
"engine.io-client": "^3.1.1",
|
||||
"express": "^4.16.2",
|
||||
"fast-json-stringify": "^1.5.4",
|
||||
"fast-safe-stringify": "^1.2.0",
|
||||
"fastify": "^1.1.1",
|
||||
"fastify-formbody": "^2.0.0",
|
||||
|
||||
@@ -1,23 +1,11 @@
|
||||
import 'reflect-metadata';
|
||||
import iterate from 'iterare';
|
||||
import { Controller } from '@nestjs/common/interfaces/controllers/controller.interface';
|
||||
import { ExceptionsHandler } from '../exceptions/exceptions-handler';
|
||||
import {
|
||||
EXCEPTION_FILTERS_METADATA,
|
||||
FILTER_CATCH_EXCEPTIONS,
|
||||
} from '@nestjs/common/constants';
|
||||
import {
|
||||
isEmpty,
|
||||
isFunction,
|
||||
isUndefined,
|
||||
} from '@nestjs/common/utils/shared.utils';
|
||||
import { Type } from '@nestjs/common/interfaces/index';
|
||||
import { ExceptionFilterMetadata } from '@nestjs/common/interfaces/exceptions/exception-filter-metadata.interface';
|
||||
import { FILTER_CATCH_EXCEPTIONS } from '@nestjs/common/constants';
|
||||
import { ExceptionFilter } from '@nestjs/common/interfaces/exceptions/exception-filter.interface';
|
||||
import { RouterProxyCallback } from './../router/router-proxy';
|
||||
import { ContextCreator } from './../helpers/context-creator';
|
||||
import { ApplicationConfig } from './../application-config';
|
||||
import { Type } from '@nestjs/common/interfaces/index';
|
||||
import { isEmpty, isFunction, isUndefined } from '@nestjs/common/utils/shared.utils';
|
||||
import iterate from 'iterare';
|
||||
import 'reflect-metadata';
|
||||
import { NestContainer } from '../injector/container';
|
||||
import { ContextCreator } from './../helpers/context-creator';
|
||||
|
||||
export class BaseExceptionFilterContext extends ContextCreator {
|
||||
protected moduleContext: string;
|
||||
@@ -45,7 +33,7 @@ export class BaseExceptionFilterContext extends ContextCreator {
|
||||
}
|
||||
|
||||
public getFilterInstance(filter: Function | ExceptionFilter) {
|
||||
const isObject = !!(filter as ExceptionFilter).catch;
|
||||
const isObject = (filter as ExceptionFilter).catch;
|
||||
if (isObject) {
|
||||
return filter;
|
||||
}
|
||||
|
||||
@@ -1,18 +1,13 @@
|
||||
import 'reflect-metadata';
|
||||
import { Controller } from '@nestjs/common/interfaces';
|
||||
import { DynamicModule } from '@nestjs/common';
|
||||
import { GLOBAL_MODULE_METADATA } from '@nestjs/common/constants';
|
||||
import { Type } from '@nestjs/common/interfaces/type.interface';
|
||||
import { SHARED_MODULE_METADATA } from '@nestjs/common/constants';
|
||||
import { isUndefined } from '@nestjs/common/utils/shared.utils';
|
||||
import { Module } from './module';
|
||||
import 'reflect-metadata';
|
||||
import { UnknownModuleException } from '../errors/exceptions/unknown-module.exception';
|
||||
import { ModuleTokenFactory } from './module-token-factory';
|
||||
import { InvalidModuleException } from './../errors/exceptions/invalid-module.exception';
|
||||
import { DynamicModule } from '@nestjs/common';
|
||||
import { ModulesContainer } from './modules-container';
|
||||
import { NestApplicationContext } from './../nest-application-context';
|
||||
import { ApplicationConfig } from './../application-config';
|
||||
import { InvalidModuleException } from './../errors/exceptions/invalid-module.exception';
|
||||
import { ModuleCompiler } from './compiler';
|
||||
import { Module } from './module';
|
||||
import { ModulesContainer } from './modules-container';
|
||||
|
||||
export class NestContainer {
|
||||
private readonly globalModules = new Set<Module>();
|
||||
@@ -103,8 +98,6 @@ export class NestContainer {
|
||||
|
||||
const scope = [].concat(module.scope, parent);
|
||||
const {
|
||||
type,
|
||||
dynamicMetadata,
|
||||
token: relatedModuleToken,
|
||||
} = this.moduleCompiler.compile(relatedModule, scope);
|
||||
const related = this.modules.get(relatedModuleToken);
|
||||
|
||||
@@ -278,7 +278,7 @@ export class Injector {
|
||||
const { relatedModules, exports } = module;
|
||||
return this.flatMap(
|
||||
[...relatedModules.values()]
|
||||
.filter(related => !!related)
|
||||
.filter(related => related)
|
||||
.filter(related => {
|
||||
const { metatype } = related;
|
||||
return exports.has(metatype.name);
|
||||
|
||||
@@ -290,7 +290,7 @@ export class Module {
|
||||
const relatedModules = [...this._relatedModules.values()];
|
||||
const modulesTokens = relatedModules
|
||||
.map(({ metatype }) => metatype)
|
||||
.filter(metatype => !!metatype)
|
||||
.filter(metatype => metatype)
|
||||
.map(({ name }) => name);
|
||||
|
||||
if (modulesTokens.indexOf(token) < 0) {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { WebSocketAdapter } from '@nestjs/common';
|
||||
import { isFunction } from '@nestjs/common/utils/shared.utils';
|
||||
import { Server } from 'http';
|
||||
import { Observable, fromEvent } from 'rxjs';
|
||||
import { fromEvent, Observable } from 'rxjs';
|
||||
import { filter, mergeMap } from 'rxjs/operators';
|
||||
import * as io from 'socket.io';
|
||||
import { CONNECTION_EVENT, DISCONNECT_EVENT } from '../constants';
|
||||
@@ -49,7 +49,7 @@ export class IoAdapter implements WebSocketAdapter {
|
||||
fromEvent(client, message)
|
||||
.pipe(
|
||||
mergeMap(data => transform(callback(data))),
|
||||
filter(result => !!result && result.event),
|
||||
filter(result => result && result.event),
|
||||
)
|
||||
.subscribe(({ event, data }) => client.emit(event, data)),
|
||||
);
|
||||
|
||||
@@ -2,7 +2,7 @@ import { Logger, WebSocketAdapter } from '@nestjs/common';
|
||||
import { loadPackage } from '@nestjs/common/utils/load-package.util';
|
||||
import { isFunction } from '@nestjs/common/utils/shared.utils';
|
||||
import { Server } from 'http';
|
||||
import { EMPTY as empty, Observable, fromEvent } from 'rxjs';
|
||||
import { EMPTY as empty, fromEvent, Observable } from 'rxjs';
|
||||
import { filter, mergeMap } from 'rxjs/operators';
|
||||
import { CLOSE_EVENT, CONNECTION_EVENT, ERROR_EVENT } from '../constants';
|
||||
import { MessageMappingProperties } from '../gateway-metadata-explorer';
|
||||
@@ -54,7 +54,7 @@ export class WsAdapter implements WebSocketAdapter {
|
||||
fromEvent(client, 'message')
|
||||
.pipe(
|
||||
mergeMap(data => this.bindMessageHandler(data, handlers, transform)),
|
||||
filter(result => !!result),
|
||||
filter(result => result),
|
||||
)
|
||||
.subscribe(response => client.send(JSON.stringify(response)));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user