Skip to content

Commit

Permalink
去掉bluebird依赖
Browse files Browse the repository at this point in the history
  • Loading branch information
mybios committed Sep 1, 2024
1 parent 6c566e5 commit d0acb73
Show file tree
Hide file tree
Showing 13 changed files with 6 additions and 115 deletions.
2 changes: 0 additions & 2 deletions examples/simple-example/game-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@
"node": ">=12.9.0"
},
"dependencies": {
"@types/bluebird": "^3.5.19",
"@types/node": "^16.3.3",
"bluebird": "^3.5.1",
"pinus": "^1.7.1-old-socket.io",
"pinus-base-plugin": "^1.7.1-old-socket.io",
"reflect-metadata": "^0.2.2",
Expand Down
16 changes: 1 addition & 15 deletions examples/simple-example/game-server/preload.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import {Promise} from 'bluebird';
// 支持注解
// 支持注解
import 'reflect-metadata';
import { pinus } from 'pinus';

Expand All @@ -9,19 +8,6 @@ import { pinus } from 'pinus';
* 捕获全局错误
*/
export function preload() {
// 使用bluebird输出完整的promise调用链
((global as any).Promise as any) = (Promise as any);
// 开启长堆栈
Promise.config({
// Enable warnings
warnings: true,
// Enable long stack traces
longStackTraces: true,
// Enable cancellation
cancellation: true,
// Enable monitoring
monitoring: true
});

// 自动解析ts的sourcemap
require('source-map-support').install({
Expand Down
2 changes: 0 additions & 2 deletions examples/ssl-connector/game-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@
"node": ">=12.9.0"
},
"dependencies": {
"@types/bluebird": "^3.5.19",
"@types/node": "^14",
"bluebird": "^3.5.1",
"pinus": "^1.7.1-old-socket.io",
"pinus-base-plugin": "^1.7.1-old-socket.io",
"reflect-metadata": "^0.2.2",
Expand Down
16 changes: 1 addition & 15 deletions examples/ssl-connector/game-server/preload.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import {Promise} from 'bluebird';
// 支持注解
// 支持注解
import 'reflect-metadata';
import { pinus } from 'pinus';

Expand All @@ -9,19 +8,6 @@ import { pinus } from 'pinus';
* 捕获全局错误
*/
export function preload() {
// 使用bluebird输出完整的promise调用链
((global as any).Promise as any) = (Promise as any);
// 开启长堆栈
Promise.config({
// Enable warnings
warnings: true,
// Enable long stack traces
longStackTraces: true,
// Enable cancellation
cancellation: true,
// Enable monitoring
monitoring: true
});

// 自动解析ts的sourcemap
require('source-map-support').install({
Expand Down
2 changes: 0 additions & 2 deletions examples/websocket-chat-ts-run/game-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,8 @@
"dependencies": {
"@nestjs/common": "^9.0.11",
"@nestjs/core": "^9.0.11",
"@types/bluebird": "^3.5.19",
"@types/crc": "^3.4.0",
"@types/node": "^16.3.3",
"bluebird": "^3.5.1",
"crc": "^4.3.2",
"pinus": "^1.7.1-old-socket.io",
"pinus-robot": "^1.7.1-old-socket.io",
Expand Down
15 changes: 1 addition & 14 deletions examples/websocket-chat-ts-run/game-server/preload.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Promise } from 'bluebird';

// 支持注解
import 'reflect-metadata';
import { pinus } from 'pinus';
Expand All @@ -9,19 +9,6 @@ import { pinus } from 'pinus';
* 捕获全局错误
*/
export function preload() {
// 使用bluebird输出完整的promise调用链
((global as any).Promise as any) = (Promise as any);
// 开启长堆栈
Promise.config({
// Enable warnings
warnings: true,
// Enable long stack traces
longStackTraces: true,
// Enable cancellation
cancellation: true,
// Enable monitoring
monitoring: true
});

// 自动解析ts的sourcemap
require('source-map-support').install({
Expand Down
2 changes: 0 additions & 2 deletions examples/websocket-chat/game-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,8 @@
"node": ">=12.9.0"
},
"dependencies": {
"@types/bluebird": "^3.5.19",
"@types/crc": "^3.4.0",
"@types/node": "^16.3.3",
"bluebird": "^3.5.1",
"crc": "^4.3.2",
"pinus": "^1.7.1-old-socket.io",
"pinus-robot": "^1.7.1-old-socket.io",
Expand Down
15 changes: 1 addition & 14 deletions examples/websocket-chat/game-server/preload.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {Promise} from 'bluebird';

// 支持注解
import 'reflect-metadata';
import { pinus } from 'pinus';
Expand All @@ -9,19 +9,6 @@ import { pinus } from 'pinus';
* 捕获全局错误
*/
export function preload() {
// 使用bluebird输出完整的promise调用链
((global as any).Promise as any) = (Promise as any);
// 开启长堆栈
Promise.config({
// Enable warnings
warnings: true,
// Enable long stack traces
longStackTraces: true,
// Enable cancellation
cancellation: true,
// Enable monitoring
monitoring: true
});

// 自动解析ts的sourcemap
require('source-map-support').install({
Expand Down
15 changes: 0 additions & 15 deletions packages/pinus-rpc/sample/bench_client.ts
Original file line number Diff line number Diff line change
@@ -1,23 +1,8 @@
// import * as bluebird from "bluebird"

import {preload} from './preload';
preload();


// // 使用bluebird输出完整的promise调用链
// global.Promise = bluebird.Promise;
// // 开启长堆栈
// bluebird.config({
// // Enable warnings
// warnings: false,
// // Enable long stack traces
// longStackTraces: false,
// // Enable cancellation
// cancellation: false,
// // Enable monitoring
// monitoring: false
// });


import { RpcClient, RpcMsg, RouteContext, RouteServers } from '../index';
import { configure } from 'pinus-logger';
Expand Down
16 changes: 1 addition & 15 deletions packages/pinus-rpc/sample/preload.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import {Promise} from 'bluebird';
// 支持注解
// 支持注解
import 'reflect-metadata';

/**
Expand All @@ -8,19 +7,6 @@ import 'reflect-metadata';
* 捕获全局错误
*/
export function preload() {
// 使用bluebird输出完整的promise调用链
((global as any).Promise as any) = (Promise as any);
// 开启长堆栈
Promise.config({
// Enable warnings
warnings: true,
// Enable long stack traces
longStackTraces: true,
// Enable cancellation
cancellation: true,
// Enable monitoring
monitoring: true
});

// 自动解析ts的sourcemap
require('source-map-support').install({
Expand Down
2 changes: 0 additions & 2 deletions packages/pinus/template/game-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@
},
"dependencies":{
"@types/node": "^16.3.3",
"@types/bluebird": "^3.5.19",
"pinus":"#",
"bluebird": "^3.5.1",
"source-map-support": "^0.5.0",
"reflect-metadata": "^0.1.13"
},
Expand Down
16 changes: 1 addition & 15 deletions packages/pinus/template/game-server/preload.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Promise } from 'bluebird';
// 支持注解
// 支持注解
import 'reflect-metadata';
import { pinus } from 'pinus';

Expand All @@ -9,19 +8,6 @@ import { pinus } from 'pinus';
* 捕获全局错误
*/
export function preload() {
// 使用bluebird输出完整的promise调用链
((global as any).Promise as any) = (Promise as any);
// 开启长堆栈
Promise.config({
// Enable warnings
warnings: true,
// Enable long stack traces
longStackTraces: true,
// Enable cancellation
cancellation: true,
// Enable monitoring
monitoring: true
});

// 自动解析ts的sourcemap
require('source-map-support').install({
Expand Down
2 changes: 0 additions & 2 deletions plugins/base-gate/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,13 @@
"node": ">=12.9.0"
},
"dependencies": {
"bluebird": "^3.5.1",
"crc": "^4.3.2",
"pinus": "^1.7.1-old-socket.io",
"pinus-robot-plugin": "^1.7.1-old-socket.io",
"reflect-metadata": "^0.2.2",
"source-map-support": "^0.5.0"
},
"devDependencies": {
"@types/bluebird": "^3.5.19",
"@types/crc": "^3.4.0",
"@types/node": "^12.20.41",
"tslint": "6.1.3",
Expand Down

0 comments on commit d0acb73

Please sign in to comment.