Skip to content

Commit

Permalink
test: add next test
Browse files Browse the repository at this point in the history
  • Loading branch information
czy88840616 committed Nov 30, 2024
1 parent 4594719 commit e4ce069
Show file tree
Hide file tree
Showing 89 changed files with 1,045 additions and 1,095 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"@types/node": "20.16.10",
"@vercel/ncc": "0.38.2",
"autocannon": "7.15.0",
"fs-extra": "11.2.0",
"jest": "29.7.0",
"lerna": "8.1.2",
"lerna-changelog": "2.2.0",
Expand All @@ -20,8 +21,7 @@
"typedoc": "^0.26.8",
"typescript": "5.3.3",
"why-is-node-running": "2.3.0",
"zx": "7.2.3",
"fs-extra": "11.2.0"
"zx": "8.2.2"
},
"scripts": {
"install_npm": "sh scripts/install_npm.sh",
Expand Down
2 changes: 1 addition & 1 deletion packages-resource/midway-test-component/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@
],
"license": "MIT",
"devDependencies": {
"@midwayjs/core": "^3.18.0"
"@midwayjs/core": "workspace:^"
}
}
2 changes: 1 addition & 1 deletion packages-resource/midway-test-inner-component/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@
],
"license": "MIT",
"devDependencies": {
"@midwayjs/core": "^3.18.0"
"@midwayjs/core": "workspace:^"
}
}
6 changes: 3 additions & 3 deletions packages-serverless/midway-fc-starter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
"main": "dist/index.js",
"typings": "index.d.ts",
"dependencies": {
"@midwayjs/async-hooks-context-manager": "^3.18.0",
"@midwayjs/faas": "^3.18.0",
"@midwayjs/async-hooks-context-manager": "workspace:^",
"@midwayjs/faas": "workspace:^",
"raw-body": "2.5.2"
},
"devDependencies": {
"@midwayjs/core": "^3.18.0"
"@midwayjs/core": "workspace:^"
},
"engines": {
"node": ">=12"
Expand Down
2 changes: 1 addition & 1 deletion packages/async-hooks-context-manager/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
],
"license": "MIT",
"devDependencies": {
"@midwayjs/core": "^3.18.0"
"@midwayjs/core": "workspace:^"
},
"author": "Harry Chen <czy88840616@gmail.com>",
"repository": {
Expand Down
4 changes: 2 additions & 2 deletions packages/axios/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
"index.d.ts"
],
"devDependencies": {
"@midwayjs/core": "^3.18.0",
"@midwayjs/mock": "^3.18.0",
"@midwayjs/core": "workspace:^",
"@midwayjs/mock": "workspace:^",
"nock": "13.5.5"
},
"dependencies": {
Expand Down
4 changes: 2 additions & 2 deletions packages/bootstrap/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@
],
"license": "MIT",
"dependencies": {
"@midwayjs/async-hooks-context-manager": "^3.18.0",
"@midwayjs/async-hooks-context-manager": "workspace:^",
"@midwayjs/event-bus": "1.10.0"
},
"devDependencies": {
"@midwayjs/core": "^3.18.0",
"@midwayjs/core": "workspace:^",
"@midwayjs/logger": "^3.0.0",
"request": "2.88.2",
"socket.io-client": "4.7.5"
Expand Down
8 changes: 4 additions & 4 deletions packages/bull-board/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@
],
"license": "MIT",
"devDependencies": {
"@midwayjs/core": "^3.18.0",
"@midwayjs/express": "^3.18.0",
"@midwayjs/koa": "^3.18.0",
"@midwayjs/mock": "^3.18.0"
"@midwayjs/core": "workspace:^",
"@midwayjs/express": "workspace:^",
"@midwayjs/koa": "workspace:^",
"@midwayjs/mock": "workspace:^"
},
"dependencies": {
"@bull-board/api": "5.21.5",
Expand Down
4 changes: 2 additions & 2 deletions packages/bull/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
],
"license": "MIT",
"devDependencies": {
"@midwayjs/core": "^3.18.0",
"@midwayjs/mock": "^3.18.0"
"@midwayjs/core": "workspace:^",
"@midwayjs/mock": "workspace:^"
},
"dependencies": {
"bull": "4.16.3"
Expand Down
14 changes: 7 additions & 7 deletions packages/busboy/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@
"file-type": "16.5.4"
},
"devDependencies": {
"@midwayjs/core": "^3.18.0",
"@midwayjs/express": "^3.18.0",
"@midwayjs/faas": "^3.18.0",
"@midwayjs/koa": "^3.18.0",
"@midwayjs/mock": "^3.18.0",
"@midwayjs/web": "^3.18.0",
"@midwayjs/fc-starter": "^3.18.0",
"@midwayjs/core": "workspace:^",
"@midwayjs/express": "workspace:^",
"@midwayjs/faas": "workspace:^",
"@midwayjs/koa": "workspace:^",
"@midwayjs/mock": "workspace:^",
"@midwayjs/web": "workspace:^",
"@midwayjs/fc-starter": "workspace:^",
"fs-extra": "11.2.0"
}
}
6 changes: 3 additions & 3 deletions packages/cache-manager/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@
"node": ">=12"
},
"devDependencies": {
"@midwayjs/core": "^3.18.0",
"@midwayjs/mock": "^3.18.0",
"@midwayjs/redis": "^3.18.0",
"@midwayjs/core": "workspace:^",
"@midwayjs/mock": "workspace:^",
"@midwayjs/redis": "workspace:^",
"cache-manager": "6.0.0",
"cache-manager-ioredis-yet": "2.1.2"
},
Expand Down
6 changes: 3 additions & 3 deletions packages/captcha/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
"svg-captcha": "1.4.0"
},
"devDependencies": {
"@midwayjs/core": "^3.18.0",
"@midwayjs/koa": "^3.18.0",
"@midwayjs/mock": "^3.18.0"
"@midwayjs/core": "workspace:^",
"@midwayjs/koa": "workspace:^",
"@midwayjs/mock": "workspace:^"
}
}
10 changes: 5 additions & 5 deletions packages/casbin-redis-adapter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@
"dist/**/*.d.ts"
],
"devDependencies": {
"@midwayjs/core": "^3.18.0",
"@midwayjs/koa": "^3.18.0",
"@midwayjs/mock": "^3.18.0",
"@midwayjs/core": "workspace:^",
"@midwayjs/koa": "workspace:^",
"@midwayjs/mock": "workspace:^",
"casbin": "5.30.0",
"ioredis": "5.4.1"
},
"dependencies": {
"@midwayjs/casbin": "^3.18.0",
"@midwayjs/redis": "^3.18.0"
"@midwayjs/casbin": "workspace:^",
"@midwayjs/redis": "workspace:^"
},
"keywords": [
"midway",
Expand Down
10 changes: 5 additions & 5 deletions packages/casbin-typeorm-adapter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@
"dist/**/*.d.ts"
],
"devDependencies": {
"@midwayjs/core": "^3.18.0",
"@midwayjs/koa": "^3.18.0",
"@midwayjs/mock": "^3.18.0",
"@midwayjs/core": "workspace:^",
"@midwayjs/koa": "workspace:^",
"@midwayjs/mock": "workspace:^",
"casbin": "5.30.0",
"sqlite3": "5.1.7",
"typeorm": "0.3.20"
},
"dependencies": {
"@midwayjs/casbin": "^3.18.0",
"@midwayjs/typeorm": "^3.18.0"
"@midwayjs/casbin": "workspace:^",
"@midwayjs/typeorm": "workspace:^"
},
"keywords": [
"midway",
Expand Down
6 changes: 3 additions & 3 deletions packages/casbin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
"index.d.ts"
],
"devDependencies": {
"@midwayjs/core": "^3.18.0",
"@midwayjs/koa": "^3.18.0",
"@midwayjs/mock": "^3.18.0"
"@midwayjs/core": "workspace:^",
"@midwayjs/koa": "workspace:^",
"@midwayjs/mock": "workspace:^"
},
"dependencies": {
"casbin": "5.30.0"
Expand Down
12 changes: 6 additions & 6 deletions packages/code-dye/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@
},
"license": "MIT",
"devDependencies": {
"@midwayjs/core": "^3.18.0",
"@midwayjs/express": "^3.18.0",
"@midwayjs/faas": "^3.18.0",
"@midwayjs/koa": "^3.18.0",
"@midwayjs/mock": "^3.18.0",
"@midwayjs/web": "^3.18.0"
"@midwayjs/core": "workspace:^",
"@midwayjs/express": "workspace:^",
"@midwayjs/faas": "workspace:^",
"@midwayjs/koa": "workspace:^",
"@midwayjs/mock": "workspace:^",
"@midwayjs/web": "workspace:^"
}
}
6 changes: 3 additions & 3 deletions packages/consul/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
"index.d.ts"
],
"devDependencies": {
"@midwayjs/core": "^3.18.0",
"@midwayjs/koa": "^3.18.0",
"@midwayjs/mock": "^3.18.0",
"@midwayjs/core": "workspace:^",
"@midwayjs/koa": "workspace:^",
"@midwayjs/mock": "workspace:^",
"@types/consul": "0.40.3",
"@types/sinon": "17.0.3",
"nock": "13.5.5"
Expand Down
3 changes: 2 additions & 1 deletion packages/core/src/functional/interface.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { ILifeCycle, InjectionConfigurationOptions } from '../../src';
import { InjectionConfigurationOptions } from '../decorator/common/configuration';
import { ILifeCycle } from '../interface';

export type FunctionalConfigurationOptions = InjectionConfigurationOptions & ILifeCycle;
5 changes: 5 additions & 0 deletions packages/core/src/util/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { safeParse, safeStringify } from './flatted';
import * as crypto from 'crypto';
import { Types } from './types';
import { pathToFileURL } from 'url';
import * as console from 'node:console';

const debug = debuglog('midway:debug');

Expand Down Expand Up @@ -67,6 +68,7 @@ export const loadModule = async (
enableCache?: boolean;
loadMode?: 'commonjs' | 'esm';
safeLoad?: boolean;
warnOnLoadError?: boolean;
} = {}
) => {
options.enableCache = options.enableCache ?? true;
Expand Down Expand Up @@ -114,6 +116,9 @@ export const loadModule = async (
if (!options.safeLoad) {
throw err;
} else {
if (options.warnOnLoadError && err.code !== 'MODULE_NOT_FOUND') {
console.warn(err);
}
debug(`[core]: SafeLoadModule Warning\n\n${err.message}\n`);
return undefined;
}
Expand Down
4 changes: 2 additions & 2 deletions packages/cos/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
"index.d.ts"
],
"devDependencies": {
"@midwayjs/core": "^3.18.0",
"@midwayjs/mock": "^3.18.0",
"@midwayjs/core": "workspace:^",
"@midwayjs/mock": "workspace:^",
"dotenv": "16.4.5"
},
"dependencies": {
Expand Down
4 changes: 2 additions & 2 deletions packages/cron/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"cron": "2.4.4"
},
"devDependencies": {
"@midwayjs/core": "^3.18.0",
"@midwayjs/mock": "^3.18.0"
"@midwayjs/core": "workspace:^",
"@midwayjs/mock": "workspace:^"
}
}
12 changes: 6 additions & 6 deletions packages/cross-domain/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@
"vary": "1.1.2"
},
"devDependencies": {
"@midwayjs/core": "^3.18.0",
"@midwayjs/express": "^3.18.0",
"@midwayjs/faas": "^3.18.0",
"@midwayjs/koa": "^3.18.0",
"@midwayjs/mock": "^3.18.0",
"@midwayjs/web": "^3.18.0"
"@midwayjs/core": "workspace:^",
"@midwayjs/express": "workspace:^",
"@midwayjs/faas": "workspace:^",
"@midwayjs/koa": "workspace:^",
"@midwayjs/mock": "workspace:^",
"@midwayjs/web": "workspace:^"
}
}
4 changes: 2 additions & 2 deletions packages/etcd/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
"index.d.ts"
],
"devDependencies": {
"@midwayjs/core": "^3.18.0",
"@midwayjs/mock": "^3.18.0"
"@midwayjs/core": "workspace:^",
"@midwayjs/mock": "workspace:^"
},
"dependencies": {
"etcd3": "1.1.2"
Expand Down
4 changes: 2 additions & 2 deletions packages/express-session/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
"index.d.ts"
],
"devDependencies": {
"@midwayjs/core": "^3.18.0",
"@midwayjs/mock": "^3.18.0",
"@midwayjs/core": "workspace:^",
"@midwayjs/mock": "workspace:^",
"@types/express-session": "1.18.0",
"memorystore": "1.6.7"
},
Expand Down
4 changes: 2 additions & 2 deletions packages/faas/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
"main": "dist/index.js",
"typings": "index.d.ts",
"dependencies": {
"@midwayjs/core": "^3.18.0",
"@midwayjs/core": "workspace:^",
"@midwayjs/serverless-http-parser": "^3.14.0",
"@midwayjs/simple-lock": "^1.1.4"
},
"devDependencies": {
"@midwayjs/cookies": "^1.0.2",
"@midwayjs/logger": "^3.0.0",
"@midwayjs/mock": "^3.18.0",
"@midwayjs/core": "workspace:^",
"mm": "3.4.0"
},
"engines": {
Expand Down
5 changes: 2 additions & 3 deletions packages/grpc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,12 @@
],
"license": "MIT",
"devDependencies": {
"@midwayjs/mock": "^3.18.0",
"@midwayjs/core": "workspace:^",
"fs-extra": "11.2.0"
},
"dependencies": {
"@grpc/grpc-js": "1.11.3",
"@grpc/proto-loader": "0.7.13",
"@midwayjs/core": "^3.18.0"
"@grpc/proto-loader": "0.7.13"
},
"engines": {
"node": ">=12"
Expand Down
12 changes: 6 additions & 6 deletions packages/http-proxy/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@
"axios": "1.7.7"
},
"devDependencies": {
"@midwayjs/core": "^3.18.0",
"@midwayjs/express": "^3.18.0",
"@midwayjs/faas": "^3.18.0",
"@midwayjs/koa": "^3.18.0",
"@midwayjs/mock": "^3.18.0",
"@midwayjs/web": "^3.18.0",
"@midwayjs/core": "workspace:^",
"@midwayjs/express": "workspace:^",
"@midwayjs/faas": "workspace:^",
"@midwayjs/koa": "workspace:^",
"@midwayjs/mock": "workspace:^",
"@midwayjs/web": "workspace:^",
"nock": "13.5.5"
}
}
Loading

0 comments on commit e4ce069

Please sign in to comment.