Skip to content

Commit

Permalink
build(nestjs) update bundle, add opencollective
Browse files Browse the repository at this point in the history
  • Loading branch information
kamilmysliwiec committed Sep 2, 2018
1 parent b6fe9b0 commit b348920
Show file tree
Hide file tree
Showing 33 changed files with 287 additions and 250 deletions.
2 changes: 1 addition & 1 deletion bundle/common/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nestjs/common",
"version": "5.3.0",
"version": "5.3.1-oc3",
"description": "Nest - modern, fast, powerful node.js web framework (@common)",
"author": "Kamil Mysliwiec",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion bundle/core/nest-application.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ class NestApplication extends nest_application_context_1.NestApplicationContext
.forEach(parserKey => this.httpAdapter.use(parserMiddleware[parserKey]));
}
isMiddlewareApplied(httpAdapter, name) {
const app = this.httpAdapter.getInstance();
const app = httpAdapter.getInstance();
return (!!app._router &&
!!app._router.stack &&
shared_utils_1.isFunction(app._router.stack.filter) &&
Expand Down
13 changes: 10 additions & 3 deletions bundle/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nestjs/core",
"version": "5.3.0",
"version": "5.3.1-oc3",
"description": "Nest - modern, fast, powerful node.js web framework (@core)",
"author": "Kamil Mysliwiec",
"license": "MIT",
Expand All @@ -9,17 +9,24 @@
"url": "https://github.com/nestjs/nest"
},
"scripts": {
"postinstall": "opencollective postinstall"
"postinstall": "opencollective"
},
"collective": {
"type": "opencollective",
"url": "https://opencollective.com/nest",
"donation": {
"text": "Become a partner:"
}
},
"dependencies": {
"@nuxtjs/opencollective": "0.1.0",
"body-parser": "1.18.3",
"cors": "2.8.4",
"express": "4.16.3",
"generate-safe-id": "1.0.2",
"iterare": "0.0.8",
"object-hash": "1.3.0",
"optional": "0.1.4",
"opencollective": "1.0.3",
"path-to-regexp": "2.2.1"
},
"peerDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion bundle/microservices/client/client-grpc.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export declare class ClientGrpcProxy extends ClientProxy implements ClientGrpc {
private readonly logger;
private readonly url;
private grpcClient;
constructor(options: ClientOptions);
constructor(options: ClientOptions['options']);
getService<T extends {}>(name: string): T;
createServiceMethod(client: any, methodName: string): (...args) => Observable<any>;
createStreamServiceMethod(client: any, methodName: string): (...args) => Observable<any>;
Expand Down
2 changes: 1 addition & 1 deletion bundle/microservices/client/client-grpc.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class ClientGrpcProxy extends client_proxy_1.ClientProxy {
this.grpcClient = this.createClient();
}
getService(name) {
const { options } = this.options;
const options = this.options;
if (!this.grpcClient[name]) {
throw new invalid_grpc_service_exception_1.InvalidGrpcServiceException();
}
Expand Down
2 changes: 1 addition & 1 deletion bundle/microservices/client/client-mqtt.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export declare class ClientMqtt extends ClientProxy {
private readonly logger;
private readonly url;
private mqttClient;
constructor(options: ClientOptions);
constructor(options: ClientOptions['options']);
getAckPatternName(pattern: string): string;
getResPatternName(pattern: string): string;
close(): void;
Expand Down
2 changes: 1 addition & 1 deletion bundle/microservices/client/client-mqtt.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class ClientMqtt extends client_proxy_1.ClientProxy {
return this.connect$(this.mqttClient).toPromise();
}
createClient() {
return mqttPackage.connect(this.url, this.options.options);
return mqttPackage.connect(this.url, this.options);
}
handleError(client) {
client.addListener(constants_1.ERROR_EVENT, err => err.code !== constants_2.ECONNREFUSED && this.logger.error(err));
Expand Down
2 changes: 1 addition & 1 deletion bundle/microservices/client/client-nats.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export declare class ClientNats extends ClientProxy {
private readonly logger;
private readonly url;
private natsClient;
constructor(options: ClientOptions);
constructor(options: ClientOptions['options']);
close(): void;
connect(): Promise<any>;
createClient(): Promise<Client>;
Expand Down
2 changes: 1 addition & 1 deletion bundle/microservices/client/client-nats.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class ClientNats extends client_proxy_1.ClientProxy {
return this.connect$(this.natsClient).toPromise();
}
createClient() {
const options = this.options.options || {};
const options = this.options || {};
return natsPackage.connect(Object.assign({}, options, { url: this.url, json: true }));
}
handleError(client) {
Expand Down
4 changes: 2 additions & 2 deletions bundle/microservices/client/client-proxy-factory.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ClientOptions } from '../interfaces/client-metadata.interface';
import { ClientProxy } from './client-proxy';
import { Closeable } from '../interfaces/closeable.interface';
import { ClientProxy } from './client-proxy';
export declare class ClientProxyFactory {
static create(options: ClientOptions): ClientProxy & Closeable;
static create(clientOptions: ClientOptions): ClientProxy & Closeable;
}
12 changes: 6 additions & 6 deletions bundle/microservices/client/client-proxy-factory.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const client_tcp_1 = require("./client-tcp");
const client_redis_1 = require("./client-redis");
const transport_enum_1 = require("../enums/transport.enum");
const client_nats_1 = require("./client-nats");
const client_mqtt_1 = require("./client-mqtt");
const client_grpc_1 = require("./client-grpc");
const client_mqtt_1 = require("./client-mqtt");
const client_nats_1 = require("./client-nats");
const client_redis_1 = require("./client-redis");
const client_tcp_1 = require("./client-tcp");
class ClientProxyFactory {
static create(options) {
const { transport } = options;
static create(clientOptions) {
const { transport, options } = clientOptions;
switch (transport) {
case transport_enum_1.Transport.REDIS:
return new client_redis_1.ClientRedis(options);
Expand Down
2 changes: 1 addition & 1 deletion bundle/microservices/client/client-proxy.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ export declare abstract class ClientProxy {
protected connect$(instance: any, errorEvent?: string, connectEvent?: string): Observable<any>;
protected getOptionsProp<T extends {
options?;
}>(obj: ClientOptions, prop: keyof T['options'], defaultValue?: any): any;
}>(obj: ClientOptions['options'], prop: keyof T['options'], defaultValue?: any): any;
protected normalizePattern<T = any>(pattern: T): string;
}
4 changes: 2 additions & 2 deletions bundle/microservices/client/client-proxy.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const random_string_generator_util_1 = require("@nestjs/common/utils/random-string-generator.util");
const shared_utils_1 = require("@nestjs/common/utils/shared.utils");
const rxjs_1 = require("rxjs");
const operators_1 = require("rxjs/operators");
const constants_1 = require("../constants");
const invalid_message_exception_1 = require("../exceptions/errors/invalid-message.exception");
const random_string_generator_util_1 = require("@nestjs/common/utils/random-string-generator.util");
class ClientProxy {
send(pattern, data) {
if (shared_utils_1.isNil(pattern) || shared_utils_1.isNil(data)) {
Expand Down Expand Up @@ -39,7 +39,7 @@ class ClientProxy {
return rxjs_1.merge(error$, connect$).pipe(operators_1.take(1));
}
getOptionsProp(obj, prop, defaultValue = undefined) {
return obj && obj.options ? obj.options[prop] : defaultValue;
return obj ? obj[prop] : defaultValue;
}
normalizePattern(pattern) {
return pattern && shared_utils_1.isString(pattern) ? pattern : JSON.stringify(pattern);
Expand Down
2 changes: 1 addition & 1 deletion bundle/microservices/client/client-redis.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export declare class ClientRedis extends ClientProxy {
private pubClient;
private subClient;
private isExplicitlyTerminated;
constructor(options: ClientOptions);
constructor(options: ClientOptions['options']);
getAckPatternName(pattern: string): string;
getResPatternName(pattern: string): string;
close(): void;
Expand Down
2 changes: 1 addition & 1 deletion bundle/microservices/client/client-tcp.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export declare class ClientTCP extends ClientProxy {
private readonly host;
private isConnected;
private socket;
constructor(options: ClientOptions);
constructor(options: ClientOptions['options']);
connect(): Promise<any>;
handleResponse(callback: (packet: WritePacket) => any, buffer: WritePacket): void;
createSocket(): JsonSocket;
Expand Down
2 changes: 1 addition & 1 deletion bundle/microservices/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nestjs/microservices",
"version": "5.3.0",
"version": "5.3.1-oc3",
"description": "Nest - modern, fast, powerful node.js web framework (@microservices)",
"author": "Kamil Mysliwiec",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion bundle/microservices/server/server-factory.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { CustomTransportStrategy, MicroserviceOptions } from '../interfaces';
import { Server } from './server';
export declare class ServerFactory {
static create(options: MicroserviceOptions): Server & CustomTransportStrategy;
static create(microserviceOptions: MicroserviceOptions): Server & CustomTransportStrategy;
}
4 changes: 2 additions & 2 deletions bundle/microservices/server/server-factory.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ const server_nats_1 = require("./server-nats");
const server_redis_1 = require("./server-redis");
const server_tcp_1 = require("./server-tcp");
class ServerFactory {
static create(options) {
const { transport } = options;
static create(microserviceOptions) {
const { transport, options } = microserviceOptions;
switch (transport) {
case transport_enum_1.Transport.REDIS:
return new server_redis_1.ServerRedis(options);
Expand Down
2 changes: 1 addition & 1 deletion bundle/microservices/server/server-grpc.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export declare class ServerGrpc extends Server implements CustomTransportStrateg
private readonly options;
private readonly url;
private grpcClient;
constructor(options: MicroserviceOptions);
constructor(options: MicroserviceOptions['options']);
listen(callback: () => void): Promise<void>;
start(callback?: () => void): Promise<void>;
bindEvents(): Promise<void>;
Expand Down
4 changes: 3 additions & 1 deletion bundle/microservices/server/server-grpc.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,9 @@ class ServerGrpc extends server_1.Server {
return async (call, callback) => {
const handler = methodHandler(call.request, call.metadata);
const result$ = this.transformToObservable(await handler);
await result$.pipe(operators_1.takeUntil(rxjs_1.fromEvent(call, constants_1.CANCEL_EVENT))).forEach(data => call.write(data));
await result$
.pipe(operators_1.takeUntil(rxjs_1.fromEvent(call, constants_1.CANCEL_EVENT)))
.forEach(data => call.write(data));
call.end();
};
}
Expand Down
2 changes: 1 addition & 1 deletion bundle/microservices/server/server-mqtt.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export declare class ServerMqtt extends Server implements CustomTransportStrateg
private readonly options;
private readonly url;
private mqttClient;
constructor(options: MicroserviceOptions);
constructor(options: MicroserviceOptions['options']);
listen(callback: () => void): Promise<void>;
start(callback?: () => void): void;
bindEvents(mqttClient: MqttClient): void;
Expand Down
2 changes: 1 addition & 1 deletion bundle/microservices/server/server-mqtt.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class ServerMqtt extends server_1.Server {
this.mqttClient && this.mqttClient.end();
}
createMqttClient() {
return mqttPackage.connect(this.url, this.options.options);
return mqttPackage.connect(this.url, this.options);
}
getMessageHandler(pub) {
return async (channel, buffer) => await this.handleMessage(channel, buffer, pub);
Expand Down
2 changes: 1 addition & 1 deletion bundle/microservices/server/server-nats.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export declare class ServerNats extends Server implements CustomTransportStrateg
private readonly options;
private readonly url;
private natsClient;
constructor(options: MicroserviceOptions);
constructor(options: MicroserviceOptions['options']);
listen(callback: () => void): void;
start(callback?: () => void): void;
bindEvents(client: Client): void;
Expand Down
2 changes: 1 addition & 1 deletion bundle/microservices/server/server-nats.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class ServerNats extends server_1.Server {
this.natsClient = null;
}
createNatsClient() {
const options = this.options.options || {};
const options = this.options || {};
return natsPackage.connect(Object.assign({}, options, { url: this.url, json: true }));
}
getMessageHandler(channel, client) {
Expand Down
2 changes: 1 addition & 1 deletion bundle/microservices/server/server-redis.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export declare class ServerRedis extends Server implements CustomTransportStrate
private subClient;
private pubClient;
private isExplicitlyTerminated;
constructor(options: MicroserviceOptions);
constructor(options: MicroserviceOptions['options']);
listen(callback: () => void): void;
start(callback?: () => void): void;
bindEvents(subClient: RedisClient, pubClient: RedisClient): void;
Expand Down
2 changes: 1 addition & 1 deletion bundle/microservices/server/server-tcp.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export declare class ServerTCP extends Server implements CustomTransportStrategy
private server;
private isExplicitlyTerminated;
private retryAttemptsCount;
constructor(options: MicroserviceOptions);
constructor(options: MicroserviceOptions['options']);
listen(callback: () => void): void;
close(): void;
bindHandler(socket: any): void;
Expand Down
2 changes: 1 addition & 1 deletion bundle/microservices/server/server.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export declare abstract class Server {
transformToObservable<T = any>(resultOrDeffered: any): Observable<T>;
getOptionsProp<T extends {
options?;
}>(obj: MicroserviceOptions, prop: keyof T['options'], defaultValue?: any): any;
}>(obj: MicroserviceOptions['options'], prop: keyof T['options'], defaultValue?: any): any;
protected handleError(error: string): void;
protected loadPackage(name: string, ctx: string): any;
}
2 changes: 1 addition & 1 deletion bundle/microservices/server/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class Server {
return resultOrDeffered;
}
getOptionsProp(obj, prop, defaultValue = undefined) {
return obj && obj.options ? obj.options[prop] : defaultValue;
return obj ? obj[prop] : defaultValue;
}
handleError(error) {
this.logger.error(error);
Expand Down
2 changes: 1 addition & 1 deletion bundle/testing/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nestjs/testing",
"version": "5.3.0",
"version": "5.3.1-oc3",
"description": "Nest - modern, fast, powerful node.js web framework (@testing)",
"author": "Kamil Mysliwiec",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion bundle/websockets/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nestjs/websockets",
"version": "5.3.0",
"version": "5.3.1-oc3",
"description": "Nest - modern, fast, powerful node.js web framework (@websockets)",
"author": "Kamil Mysliwiec",
"license": "MIT",
Expand Down
4 changes: 1 addition & 3 deletions lerna.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
{
"lerna": "2.4.0",
"packages": [
"bundle/*"
],
"packages": ["bundle/*"],
"version": "5.3.0"
}
Loading

0 comments on commit b348920

Please sign in to comment.