diff --git a/.gitignore b/.gitignore index 772788faca99..8ef31117b6b6 100644 --- a/.gitignore +++ b/.gitignore @@ -26,3 +26,5 @@ site/changelog **/test/*.txt .audit packages/**/test/tmp +.swc +.result diff --git a/.run/All Tests in nextjs.run.xml b/.run/All Tests in nextjs.run.xml new file mode 100644 index 000000000000..1c954532f201 --- /dev/null +++ b/.run/All Tests in nextjs.run.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/package.json b/package.json index 8268503a757a..c76318968e95 100644 --- a/package.json +++ b/package.json @@ -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", @@ -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", diff --git a/packages-resource/midway-test-component/package.json b/packages-resource/midway-test-component/package.json index 997b95ef5736..1c32206a2109 100644 --- a/packages-resource/midway-test-component/package.json +++ b/packages-resource/midway-test-component/package.json @@ -16,6 +16,6 @@ ], "license": "MIT", "devDependencies": { - "@midwayjs/core": "^3.18.0" + "@midwayjs/core": "workspace:^" } } diff --git a/packages-resource/midway-test-inner-component/package.json b/packages-resource/midway-test-inner-component/package.json index ecbc272c59ce..0c22122385b5 100644 --- a/packages-resource/midway-test-inner-component/package.json +++ b/packages-resource/midway-test-inner-component/package.json @@ -16,6 +16,6 @@ ], "license": "MIT", "devDependencies": { - "@midwayjs/core": "^3.18.0" + "@midwayjs/core": "workspace:^" } } diff --git a/packages-serverless/midway-fc-starter/package.json b/packages-serverless/midway-fc-starter/package.json index 768a304abeb7..fac1b764b196 100644 --- a/packages-serverless/midway-fc-starter/package.json +++ b/packages-serverless/midway-fc-starter/package.json @@ -4,12 +4,11 @@ "main": "dist/index.js", "typings": "index.d.ts", "dependencies": { - "@midwayjs/async-hooks-context-manager": "^3.18.0", - "@midwayjs/faas": "^3.18.0", + "@midwayjs/faas": "workspace:^", "raw-body": "2.5.2" }, "devDependencies": { - "@midwayjs/core": "^3.18.0" + "@midwayjs/core": "workspace:^" }, "engines": { "node": ">=12" diff --git a/packages-serverless/midway-fc-starter/src/index.ts b/packages-serverless/midway-fc-starter/src/index.ts index 84f46b976982..1ba6b06199d0 100644 --- a/packages-serverless/midway-fc-starter/src/index.ts +++ b/packages-serverless/midway-fc-starter/src/index.ts @@ -5,7 +5,6 @@ import { } from '@midwayjs/faas'; import * as getRawBody from 'raw-body'; import { IncomingMessage } from 'http'; -import { createContextManager } from '@midwayjs/async-hooks-context-manager'; import { mockContext } from './mock'; import { InitializeContext } from './interface'; @@ -74,7 +73,6 @@ export class BootstrapStarter extends AbstractBootstrapStarter { applicationAdapter, }, }, - asyncContextManager: createContextManager(), ...this.options, }); diff --git a/packages-serverless/midway-fc-starter/test/fixtures/base-app/src/configuration.ts b/packages-serverless/midway-fc-starter/test/fixtures/base-app/src/configuration.ts index bf0c05808cb1..4cfa0d3097b6 100644 --- a/packages-serverless/midway-fc-starter/test/fixtures/base-app/src/configuration.ts +++ b/packages-serverless/midway-fc-starter/test/fixtures/base-app/src/configuration.ts @@ -1,8 +1,9 @@ -import { Configuration } from '@midwayjs/core'; +import { CommonJSFileDetector, Configuration } from '@midwayjs/core'; import * as faas from '@midwayjs/faas'; @Configuration({ imports: [faas], + detector: new CommonJSFileDetector(), }) export class MainConfiguration { } diff --git a/packages/async-hooks-context-manager/CHANGELOG.md b/packages/async-hooks-context-manager/CHANGELOG.md deleted file mode 100644 index 0ca5b75113b2..000000000000 --- a/packages/async-hooks-context-manager/CHANGELOG.md +++ /dev/null @@ -1,88 +0,0 @@ -# Change Log - -All notable changes to this project will be documented in this file. -See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. - -# [3.7.0](https://github.com/midwayjs/midway/compare/v3.6.1...v3.7.0) (2022-10-29) - -**Note:** Version bump only for package @midwayjs/async-hooks-context-manager - -# [3.6.0](https://github.com/midwayjs/midway/compare/v3.5.3...v3.6.0) (2022-10-10) - -### Features - -- add guard ([#2345](https://github.com/midwayjs/midway/issues/2345)) ([1b952a1](https://github.com/midwayjs/midway/commit/1b952a1b09adbb88ff3cff9a2974eb1e37ce53a5)) - -## [3.5.3](https://github.com/midwayjs/midway/compare/v3.5.2...v3.5.3) (2022-09-25) - -**Note:** Version bump only for package @midwayjs/async-hooks-context-manager - -## [3.5.1](https://github.com/midwayjs/midway/compare/v3.5.0...v3.5.1) (2022-09-06) - -**Note:** Version bump only for package @midwayjs/async-hooks-context-manager - -# [3.5.0](https://github.com/midwayjs/midway/compare/v3.4.13...v3.5.0) (2022-08-29) - -**Note:** Version bump only for package @midwayjs/async-hooks-context-manager - -## [3.4.13](https://github.com/midwayjs/midway/compare/v3.4.12...v3.4.13) (2022-08-24) - -**Note:** Version bump only for package @midwayjs/async-hooks-context-manager - -## [3.4.12](https://github.com/midwayjs/midway/compare/v3.4.11...v3.4.12) (2022-08-20) - -**Note:** Version bump only for package @midwayjs/async-hooks-context-manager - -## [3.4.11](https://github.com/midwayjs/midway/compare/v3.4.10...v3.4.11) (2022-08-16) - -**Note:** Version bump only for package @midwayjs/async-hooks-context-manager - -## [3.4.10](https://github.com/midwayjs/midway/compare/v3.4.9...v3.4.10) (2022-08-12) - -**Note:** Version bump only for package @midwayjs/async-hooks-context-manager - -## [3.4.9](https://github.com/midwayjs/midway/compare/v3.4.8...v3.4.9) (2022-08-10) - -**Note:** Version bump only for package @midwayjs/async-hooks-context-manager - -## [3.4.7](https://github.com/midwayjs/midway/compare/v3.4.6...v3.4.7) (2022-08-01) - -**Note:** Version bump only for package @midwayjs/async-hooks-context-manager - -## [3.4.6](https://github.com/midwayjs/midway/compare/v3.4.5...v3.4.6) (2022-07-31) - -**Note:** Version bump only for package @midwayjs/async-hooks-context-manager - -## [3.4.4](https://github.com/midwayjs/midway/compare/v3.4.3...v3.4.4) (2022-07-25) - -**Note:** Version bump only for package @midwayjs/async-hooks-context-manager - -## [3.4.3](https://github.com/midwayjs/midway/compare/v3.4.2...v3.4.3) (2022-07-21) - -**Note:** Version bump only for package @midwayjs/async-hooks-context-manager - -## [3.4.1](https://github.com/midwayjs/midway/compare/v3.4.0...v3.4.1) (2022-07-20) - -**Note:** Version bump only for package @midwayjs/async-hooks-context-manager - -# [3.4.0](https://github.com/midwayjs/midway/compare/v3.4.0-beta.12...v3.4.0) (2022-07-20) - -**Note:** Version bump only for package @midwayjs/async-hooks-context-manager - -# [3.4.0-beta.12](https://github.com/midwayjs/midway/compare/v3.4.0-beta.11...v3.4.0-beta.12) (2022-07-20) - -**Note:** Version bump only for package @midwayjs/async-hooks-context-manager - -# [3.4.0-beta.11](https://github.com/midwayjs/midway/compare/v3.4.0-beta.10...v3.4.0-beta.11) (2022-07-19) - -**Note:** Version bump only for package @midwayjs/async-hooks-context-manager - -# [3.4.0-beta.10](https://github.com/midwayjs/midway/compare/v3.4.0-beta.9...v3.4.0-beta.10) (2022-07-18) - -**Note:** Version bump only for package @midwayjs/async-hooks-context-manager - -# [3.4.0-beta.9](https://github.com/midwayjs/midway/compare/v3.4.0-beta.8...v3.4.0-beta.9) (2022-07-14) - -### Features - -- add context manager with middleware ([#2116](https://github.com/midwayjs/midway/issues/2116)) ([99ba506](https://github.com/midwayjs/midway/commit/99ba506b82b1061af26bf333892ae90b654a7b31)) diff --git a/packages/async-hooks-context-manager/package.json b/packages/async-hooks-context-manager/package.json deleted file mode 100644 index e96f17ba435f..000000000000 --- a/packages/async-hooks-context-manager/package.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "name": "@midwayjs/async-hooks-context-manager", - "version": "3.18.0", - "description": "midway async hooks context manager", - "main": "dist/index.js", - "typings": "dist/index.d.ts", - "scripts": { - "build": "tsc", - "test": "node -r ts-node/register ../../node_modules/jest/bin/jest.js --runInBand", - "cov": "node -r ts-node/register ../../node_modules/jest/bin/jest.js --runInBand --coverage --forceExit" - }, - "keywords": [ - "midway", - "async", - "context manager" - ], - "files": [ - "dist/**/*.js", - "dist/**/*.d.ts" - ], - "license": "MIT", - "devDependencies": { - "@midwayjs/core": "^3.18.0" - }, - "author": "Harry Chen ", - "repository": { - "type": "git", - "url": "https://github.com/midwayjs/midway.git" - }, - "engines": { - "node": ">=12.17.0" - }, - "gitHead": "a603d2348d6141f8f723901498f03a162a037708" -} diff --git a/packages/async-hooks-context-manager/src/asyncHooksContextManager.ts b/packages/async-hooks-context-manager/src/asyncHooksContextManager.ts deleted file mode 100644 index 8929ece3eb66..000000000000 --- a/packages/async-hooks-context-manager/src/asyncHooksContextManager.ts +++ /dev/null @@ -1,157 +0,0 @@ -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { - AsyncContext, - ASYNC_ROOT_CONTEXT, - AsyncContextManager, -} from '@midwayjs/core'; -import * as asyncHooks from 'async_hooks'; - -export class AsyncHooksContextManager implements AsyncContextManager { - private _asyncHook: asyncHooks.AsyncHook; - private _contexts: Map = new Map(); - private _stack: Array = []; - - constructor() { - this._asyncHook = asyncHooks.createHook({ - init: this._init.bind(this), - before: this._before.bind(this), - after: this._after.bind(this), - destroy: this._destroy.bind(this), - promiseResolve: this._destroy.bind(this), - }); - } - - active(): AsyncContext { - return this._stack[this._stack.length - 1] ?? ASYNC_ROOT_CONTEXT; - } - - with ReturnType>( - context: AsyncContext, - fn: F, - thisArg?: ThisParameterType, - ...args: A - ): ReturnType { - this._enterContext(context); - try { - return fn.call(thisArg!, ...args); - } finally { - this._exitContext(); - } - } - - enable(): this { - this._asyncHook.enable(); - return this; - } - - disable(): this { - this._asyncHook.disable(); - this._contexts.clear(); - this._stack = []; - return this; - } - - /** - * Init hook will be called when userland create a async context, setting the - * context as the current one if it exist. - * @param uid id of the async context - * @param type the resource type - */ - private _init(uid: number, type: string) { - // ignore TIMERWRAP as they combine timers with same timeout which can lead to - // false context propagation. TIMERWRAP has been removed in node 11 - // every timer has it's own `Timeout` resource anyway which is used to propagete - // context. - if (type === 'TIMERWRAP') return; - - const context = this._stack[this._stack.length - 1]; - if (context !== undefined) { - this._contexts.set(uid, context); - } - } - - /** - * Destroy hook will be called when a given context is no longer used so we can - * remove its attached context. - * @param uid uid of the async context - */ - private _destroy(uid: number) { - this._contexts.delete(uid); - } - - /** - * Before hook is called just before executing a async context. - * @param uid uid of the async context - */ - private _before(uid: number) { - const context = this._contexts.get(uid); - if (context !== undefined) { - this._enterContext(context); - } - } - - /** - * After hook is called just after completing the execution of a async context. - */ - private _after() { - this._exitContext(); - } - - /** - * Set the given context as active - */ - private _enterContext(context: AsyncContext) { - this._stack.push(context); - } - - /** - * Remove the context at the root of the stack - */ - private _exitContext() { - this._stack.pop(); - } - - /** - * Binds a the certain context or the active one to the target function and then returns the target - * @param context A context (span) to be bind to target - * @param target a function. When target or one of its callbacks is called, - * the provided context will be used as the active context for the duration of the call. - */ - bind(context: AsyncContext, target: T): T { - if (typeof target === 'function') { - // eslint-disable-next-line @typescript-eslint/no-this-alias - const manager = this; - const contextWrapper = function (this: never, ...args: unknown[]) { - return manager.with(context, () => target.apply(this, args)); - }; - Object.defineProperty(contextWrapper, 'length', { - enumerable: false, - configurable: true, - writable: false, - value: target.length, - }); - /** - * It isn't possible to tell Typescript that contextWrapper is the same as T - * so we forced to cast as any here. - */ - // eslint-disable-next-line @typescript-eslint/no-explicit-any - return contextWrapper as any; - } - return target; - } -} diff --git a/packages/async-hooks-context-manager/src/asyncLocalStorageContextManager.ts b/packages/async-hooks-context-manager/src/asyncLocalStorageContextManager.ts deleted file mode 100644 index 1d9e448ea572..000000000000 --- a/packages/async-hooks-context-manager/src/asyncLocalStorageContextManager.ts +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { - AsyncContext, - ASYNC_ROOT_CONTEXT, - AsyncContextManager, -} from '@midwayjs/core'; -import { AsyncLocalStorage } from 'async_hooks'; - -export class AsyncLocalStorageContextManager implements AsyncContextManager { - private _asyncLocalStorage: AsyncLocalStorage; - - constructor() { - this._asyncLocalStorage = new AsyncLocalStorage(); - } - - active(): AsyncContext { - return this._asyncLocalStorage.getStore() ?? ASYNC_ROOT_CONTEXT; - } - - with ReturnType>( - context: AsyncContext, - fn: F, - thisArg?: ThisParameterType, - ...args: A - ): ReturnType { - const cb = thisArg == null ? fn : fn.bind(thisArg); - return this._asyncLocalStorage.run(context, cb as never, ...args); - } - - enable(): this { - return this; - } - - disable(): this { - this._asyncLocalStorage.disable(); - return this; - } - - /** - * Binds a the certain context or the active one to the target function and then returns the target - * @param context A context (span) to be bind to target - * @param target a function. When target or one of its callbacks is called, - * the provided context will be used as the active context for the duration of the call. - */ - bind(context: AsyncContext, target: T): T { - if (typeof target === 'function') { - // eslint-disable-next-line @typescript-eslint/no-this-alias - const manager = this; - const contextWrapper = function (this: never, ...args: unknown[]) { - return manager.with(context, () => target.apply(this, args)); - }; - Object.defineProperty(contextWrapper, 'length', { - enumerable: false, - configurable: true, - writable: false, - value: target.length, - }); - /** - * It isn't possible to tell Typescript that contextWrapper is the same as T - * so we forced to cast as any here. - */ - // eslint-disable-next-line @typescript-eslint/no-explicit-any - return contextWrapper as any; - } - return target; - } -} diff --git a/packages/async-hooks-context-manager/src/index.ts b/packages/async-hooks-context-manager/src/index.ts deleted file mode 100644 index 1198880d4f42..000000000000 --- a/packages/async-hooks-context-manager/src/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './asyncHooksContextManager'; -export * from './asyncLocalStorageContextManager'; -export { isSemverGreaterThanOrEqualTo, createContextManager } from './util'; diff --git a/packages/async-hooks-context-manager/src/util.ts b/packages/async-hooks-context-manager/src/util.ts deleted file mode 100644 index e2fd1ac05ed8..000000000000 --- a/packages/async-hooks-context-manager/src/util.ts +++ /dev/null @@ -1,41 +0,0 @@ -import { AsyncLocalStorageContextManager } from './asyncLocalStorageContextManager'; -import { AsyncHooksContextManager } from './asyncHooksContextManager'; - -const semver = - /^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z-]+(?:\.[\da-z-]+)*))?(?:\+[\da-z-]+(?:\.[\da-z-]+)*)?)?)?$/i; - -// 判断 semver 大于等于 v14.8.0 -export function isSemverGreaterThanOrEqualTo( - currentVersion: string, - targetVersion: string -) { - const v = semver.exec(currentVersion); - const t = semver.exec(targetVersion); - if (v && t) { - if (v[1] === t[1] && v[2] === t[2] && v[3] === t[3] && v[4] === t[4]) { - return true; - } - - return ( - gteString(v[1], t[1]) || - (v[1] === t[1] && gteString(v[2], t[2])) || - (v[1] === t[1] && v[2] === t[2] && gteString(v[3], t[3])) || - (v[1] === t[1] && v[2] === t[2] && v[3] === t[3] && gteString(v[4], t[4])) - ); - } - return false; -} - -function gteString(v1: string, v2: string): boolean { - // compare string with parseInt - const v1Int = parseInt(v1, 10); - const v2Int = parseInt(v2, 10); - return v1Int > v2Int; -} - -export function createContextManager() { - const ContextManager = isSemverGreaterThanOrEqualTo(process.version, '14.8.0') - ? AsyncLocalStorageContextManager - : AsyncHooksContextManager; - return new ContextManager(); -} diff --git a/packages/async-hooks-context-manager/test/asyncHooksContextManager.test.ts b/packages/async-hooks-context-manager/test/asyncHooksContextManager.test.ts deleted file mode 100644 index 9e619b238519..000000000000 --- a/packages/async-hooks-context-manager/test/asyncHooksContextManager.test.ts +++ /dev/null @@ -1,366 +0,0 @@ -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import * as assert from 'assert'; -import { - AsyncHooksContextManager, -} from '../src'; -import { ASYNC_ROOT_CONTEXT } from '@midwayjs/core'; - -/** Get a key to uniquely identify a context value */ -function createContextKey(description: string) { - // The specification states that for the same input, multiple calls should - // return different keys. Due to the nature of the JS dependency management - // system, this creates problems where multiple versions of some package - // could hold different keys for the same property. - // - // Therefore, we use Symbol.for which returns the same key for the same input. - return Symbol.for(description); -} - -describe('AsyncHooksContextManager.test.ts', () => { - let contextManager: AsyncHooksContextManager; - const key1 = createContextKey('test key 1'); - let otherContextManager: AsyncHooksContextManager; - - beforeEach(() => { - contextManager = new AsyncHooksContextManager(); - contextManager.enable(); - }); - - afterEach(() => { - contextManager.disable(); - otherContextManager?.disable(); - }); - - describe('.enable()', () => { - it('should work', () => { - assert.doesNotThrow(() => { - contextManager = new AsyncHooksContextManager(); - assert.ok( - contextManager.enable() === contextManager, - 'should return this' - ); - }); - }); - }); - - describe('.disable()', () => { - it('should work', () => { - assert.doesNotThrow(() => { - assert.ok( - contextManager.disable() === contextManager, - 'should return this' - ); - }); - contextManager.enable(); - }); - }); - - describe('.with()', () => { - it('should run the callback (null as target)', done => { - contextManager.with(ASYNC_ROOT_CONTEXT, done); - }); - - it('should run the callback (object as target)', done => { - const test = ASYNC_ROOT_CONTEXT.setValue(key1, 1); - contextManager.with(test, () => { - assert.strictEqual( - contextManager.active(), - test, - 'should have context' - ); - return done(); - }); - }); - - it('should run the callback (when disabled)', done => { - contextManager.disable(); - contextManager.with(ASYNC_ROOT_CONTEXT, () => { - contextManager.enable(); - return done(); - }); - }); - - it('should rethrow errors', done => { - assert.throws(() => { - contextManager.with(ASYNC_ROOT_CONTEXT, () => { - throw new Error('This should be rethrown'); - }); - }); - return done(); - }); - - it('should forward this, arguments and return value', () => { - function fnWithThis(this: string, a: string, b: number): string { - assert.strictEqual(this, 'that'); - assert.strictEqual(arguments.length, 2); - assert.strictEqual(a, 'one'); - assert.strictEqual(b, 2); - return 'done'; - } - - const res = contextManager.with( - ASYNC_ROOT_CONTEXT, - fnWithThis, - 'that', - 'one', - 2 - ); - assert.strictEqual(res, 'done'); - - assert.strictEqual( - contextManager.with(ASYNC_ROOT_CONTEXT, () => 3.14), - 3.14 - ); - }); - - it('should finally restore an old context', done => { - const ctx1 = ASYNC_ROOT_CONTEXT.setValue(key1, 'ctx1'); - const ctx2 = ASYNC_ROOT_CONTEXT.setValue(key1, 'ctx2'); - contextManager.with(ctx1, () => { - assert.strictEqual(contextManager.active(), ctx1); - contextManager.with(ctx2, () => { - assert.strictEqual(contextManager.active(), ctx2); - }); - assert.strictEqual(contextManager.active(), ctx1); - return done(); - }); - }); - - it('should finally restore an old context', done => { - const ctx1 = ASYNC_ROOT_CONTEXT.setValue(key1, 'ctx1'); - contextManager.with(ctx1, () => { - assert.strictEqual(contextManager.active(), ctx1); - setTimeout(() => { - assert.strictEqual(contextManager.active(), ctx1); - return done(); - }); - }); - }); - - it('async function called from nested "with" sync function should return nested context', done => { - const scope1 = '1' as any; - const scope2 = '2' as any; - - const asyncFuncCalledDownstreamFromSync = async () => { - await (async () => {})(); - assert.strictEqual(contextManager.active(), scope2); - return done(); - }; - - contextManager.with(scope1, () => { - assert.strictEqual(contextManager.active(), scope1); - contextManager.with(scope2, () => - asyncFuncCalledDownstreamFromSync() - ); - assert.strictEqual(contextManager.active(), scope1); - }); - assert.strictEqual(contextManager.active(), ASYNC_ROOT_CONTEXT); - }); - - it('should not loose the context', done => { - const scope1 = '1' as any; - - contextManager.with(scope1, async () => { - assert.strictEqual(contextManager.active(), scope1); - await new Promise(resolve => setTimeout(resolve, 100)); - assert.strictEqual(contextManager.active(), scope1); - return done(); - }); - assert.strictEqual(contextManager.active(), ASYNC_ROOT_CONTEXT); - }); - - it('should correctly restore context using async/await', async () => { - const scope1 = '1' as any; - const scope2 = '2' as any; - const scope3 = '3' as any; - const scope4 = '4' as any; - - await contextManager.with(scope1, async () => { - assert.strictEqual(contextManager.active(), scope1); - await contextManager.with(scope2, async () => { - assert.strictEqual(contextManager.active(), scope2); - await contextManager.with(scope3, async () => { - assert.strictEqual(contextManager.active(), scope3); - await contextManager.with(scope4, async () => { - assert.strictEqual(contextManager.active(), scope4); - }); - assert.strictEqual(contextManager.active(), scope3); - }); - assert.strictEqual(contextManager.active(), scope2); - }); - assert.strictEqual(contextManager.active(), scope1); - }); - assert.strictEqual(contextManager.active(), ASYNC_ROOT_CONTEXT); - }); - - it('should works with multiple concurrent operations', done => { - const scope1 = '1' as any; - const scope2 = '2' as any; - const scope3 = '3' as any; - const scope4 = '4' as any; - let scope4Called = false; - - contextManager.with(scope1, async () => { - assert.strictEqual(contextManager.active(), scope1); - setTimeout(async () => { - await contextManager.with(scope3, async () => { - assert.strictEqual(contextManager.active(), scope3); - }); - assert.strictEqual(contextManager.active(), scope1); - assert.strictEqual(scope4Called, true); - return done(); - }, 100); - assert.strictEqual(contextManager.active(), scope1); - }); - assert.strictEqual(contextManager.active(), ASYNC_ROOT_CONTEXT); - contextManager.with(scope2, async () => { - assert.strictEqual(contextManager.active(), scope2); - setTimeout(() => { - contextManager.with(scope4, async () => { - assert.strictEqual(contextManager.active(), scope4); - scope4Called = true; - }); - assert.strictEqual(contextManager.active(), scope2); - }, 20); - assert.strictEqual(contextManager.active(), scope2); - }); - assert.strictEqual(contextManager.active(), ASYNC_ROOT_CONTEXT); - }); - - it('should work with timers using the same timeout', done => { - let cnt = 3; - function countDown() { - cnt--; - if (cnt === 0) done(); - if (cnt < 0) throw new Error('too many calls to countDown()'); - } - - const time1 = 2; - const time2 = time1 + 1; - const rootCtx = contextManager.active(); - const innerCtx = rootCtx.setValue(Symbol('test'), 23); - contextManager.with(innerCtx, () => { - setTimeout(() => { - assert.strictEqual(contextManager.active(), innerCtx); - countDown(); - }, time1); - }); - setTimeout(() => { - assert.strictEqual(contextManager.active(), rootCtx); - countDown(); - }, time1); - setTimeout(() => { - assert.strictEqual(contextManager.active(), rootCtx); - countDown(); - }, time2); - }); - - it('should not influence other instances', () => { - otherContextManager = new AsyncHooksContextManager(); - otherContextManager.enable(); - - const context = ASYNC_ROOT_CONTEXT.setValue(key1, 2); - const otherContext = ASYNC_ROOT_CONTEXT.setValue(key1, 3); - contextManager.with(context, () => { - assert.strictEqual(contextManager.active(), context); - assert.strictEqual(otherContextManager.active(), ASYNC_ROOT_CONTEXT); - otherContextManager.with(otherContext, () => { - assert.strictEqual(contextManager.active(), context); - assert.strictEqual(otherContextManager.active(), otherContext); - }); - }); - }); - }); - - describe('.bind(function)', () => { - it('should return the same target (when enabled)', () => { - const test = { a: 1 }; - assert.deepStrictEqual(contextManager.bind(ASYNC_ROOT_CONTEXT, test), test); - }); - - it('should return the same target (when disabled)', () => { - contextManager.disable(); - const test = { a: 1 }; - assert.deepStrictEqual(contextManager.bind(ASYNC_ROOT_CONTEXT, test), test); - contextManager.enable(); - }); - - it('should return current context (when enabled)', done => { - const context = ASYNC_ROOT_CONTEXT.setValue(key1, 1); - const fn = contextManager.bind(context, () => { - assert.strictEqual( - contextManager.active(), - context, - 'should have context' - ); - return done(); - }); - fn(); - }); - - /** - * Even if asynchooks is disabled, the context propagation will - * still works but it might be lost after any async op. - */ - it('should return current context (when disabled)', done => { - contextManager.disable(); - const context = ASYNC_ROOT_CONTEXT.setValue(key1, 1); - const fn = contextManager.bind(context, () => { - assert.strictEqual( - contextManager.active(), - context, - 'should have context' - ); - return done(); - }); - fn(); - }); - - it('should fail to return current context with async op', done => { - const context = ASYNC_ROOT_CONTEXT.setValue(key1, 1); - const fn = contextManager.bind(context, () => { - assert.strictEqual(contextManager.active(), context); - setTimeout(() => { - assert.strictEqual( - contextManager.active(), - context, - 'should have no context' - ); - return done(); - }, 100); - }); - fn(); - }); - - it('should not influence other instances', () => { - otherContextManager = new AsyncHooksContextManager(); - otherContextManager.enable(); - - const context = ASYNC_ROOT_CONTEXT.setValue(key1, 2); - const otherContext = ASYNC_ROOT_CONTEXT.setValue(key1, 3); - const fn = otherContextManager.bind( - otherContext, - contextManager.bind(context, () => { - assert.strictEqual(contextManager.active(), context); - assert.strictEqual(otherContextManager.active(), otherContext); - }) - ); - fn(); - }); - }); -}); diff --git a/packages/async-hooks-context-manager/test/util.test.ts b/packages/async-hooks-context-manager/test/util.test.ts deleted file mode 100644 index 1b93117ee25a..000000000000 --- a/packages/async-hooks-context-manager/test/util.test.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { isSemverGreaterThanOrEqualTo } from '../src/util'; - -describe('util.test.ts', function () { - it('should test gte v14.8.0', function () { - expect(isSemverGreaterThanOrEqualTo('v16.0.0', '14.8.0')).toBeTruthy(); - expect(isSemverGreaterThanOrEqualTo('v14.17.0', '14.8.0')).toBeTruthy(); - expect(isSemverGreaterThanOrEqualTo('v14.8.0', '14.8.0')).toBeTruthy(); - expect(isSemverGreaterThanOrEqualTo('v15.2.0', '14.8.0')).toBeTruthy(); - expect(isSemverGreaterThanOrEqualTo('v18.0.6', '14.8.0')).toBeTruthy(); - - expect(isSemverGreaterThanOrEqualTo('v12', '14.8.0')).toBeFalsy(); - expect(isSemverGreaterThanOrEqualTo('v12.10.0', '14.8.0')).toBeFalsy(); - expect(isSemverGreaterThanOrEqualTo('v13.8.0', '14.8.0')).toBeFalsy(); - expect(isSemverGreaterThanOrEqualTo('v14.7.0', '14.8.0')).toBeFalsy(); - }); -}); diff --git a/packages/async-hooks-context-manager/typedoc.json b/packages/async-hooks-context-manager/typedoc.json deleted file mode 100644 index f593f276c273..000000000000 --- a/packages/async-hooks-context-manager/typedoc.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "extends": ["../../typedoc.base.json"], - "entryPoints": ["src/index.ts"] -} diff --git a/packages/axios/package.json b/packages/axios/package.json index f00fe4d70aa5..4421d6d17b88 100644 --- a/packages/axios/package.json +++ b/packages/axios/package.json @@ -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": { diff --git a/packages/bootstrap/package.json b/packages/bootstrap/package.json index 8c7a53afb31f..00d9ccb617b3 100644 --- a/packages/bootstrap/package.json +++ b/packages/bootstrap/package.json @@ -21,11 +21,10 @@ ], "license": "MIT", "dependencies": { - "@midwayjs/async-hooks-context-manager": "^3.18.0", "@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" diff --git a/packages/bootstrap/src/bootstrap.ts b/packages/bootstrap/src/bootstrap.ts index 8ed6ee6a5f20..b1512569ac7f 100644 --- a/packages/bootstrap/src/bootstrap.ts +++ b/packages/bootstrap/src/bootstrap.ts @@ -11,7 +11,6 @@ import { } from '@midwayjs/core'; import { join } from 'path'; import { ILogger, LoggerFactory, loggers } from '@midwayjs/logger'; -import { createContextManager } from '@midwayjs/async-hooks-context-manager'; import { ChildProcessEventBus, ThreadEventBus, @@ -60,7 +59,6 @@ export class BootstrapStarter { } this.applicationContext = await initializeGlobalApplicationContext({ - asyncContextManager: createContextManager(), loggerFactory: loggers, ...this.globalOptions, }); diff --git a/packages/bootstrap/test/fixtures/cluster-app/src/configuration.ts b/packages/bootstrap/test/fixtures/cluster-app/src/configuration.ts index c7d5e30be38a..49c80f54b4df 100644 --- a/packages/bootstrap/test/fixtures/cluster-app/src/configuration.ts +++ b/packages/bootstrap/test/fixtures/cluster-app/src/configuration.ts @@ -1,4 +1,4 @@ -import { ALL, MainApp, Config, Configuration, Inject } from '@midwayjs/core'; +import { MainApp, Configuration, Inject, CommonJSFileDetector, AllConfig } from '@midwayjs/core'; import { join } from 'path'; import * as assert from 'assert'; import { RemoteConfigService } from './service/remoteConfigService'; @@ -11,6 +11,7 @@ import * as SocketIO from '../../../../../socketio'; importConfigs: [ join(__dirname, './config') ], + detector: new CommonJSFileDetector(), imports: [ Web, SocketIO, @@ -18,7 +19,7 @@ import * as SocketIO from '../../../../../socketio'; ] }) export class AutoConfiguration implements ILifeCycle { - @Config(ALL) + @AllConfig() prepareConfig; @Inject() diff --git a/packages/bootstrap/test/fixtures/mix-app/src/configuration.ts b/packages/bootstrap/test/fixtures/mix-app/src/configuration.ts index 99a7ee401b2a..5763b749338a 100644 --- a/packages/bootstrap/test/fixtures/mix-app/src/configuration.ts +++ b/packages/bootstrap/test/fixtures/mix-app/src/configuration.ts @@ -1,4 +1,4 @@ -import { ALL, MainApp, Config, Configuration, Inject } from '@midwayjs/core'; +import { MainApp, Configuration, Inject, CommonJSFileDetector, AllConfig } from '@midwayjs/core'; import { join } from 'path'; import * as assert from 'assert'; import { RemoteConfigService } from './service/remoteConfigService'; @@ -10,13 +10,14 @@ import * as SocketIO from '../../../../../socketio'; importConfigs: [ join(__dirname, './config') ], + detector: new CommonJSFileDetector(), imports: [ Web, SocketIO, ] }) export class AutoConfiguration implements ILifeCycle { - @Config(ALL) + @AllConfig() prepareConfig; @Inject() diff --git a/packages/bull-board/package.json b/packages/bull-board/package.json index dea9e9318718..de079ec659fc 100644 --- a/packages/bull-board/package.json +++ b/packages/bull-board/package.json @@ -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", diff --git a/packages/bull-board/test/index.test.ts b/packages/bull-board/test/index.test.ts index 478eb9cdf99a..01f82b02e524 100644 --- a/packages/bull-board/test/index.test.ts +++ b/packages/bull-board/test/index.test.ts @@ -1,10 +1,10 @@ -import { createApp, close, createHttpRequest, createLightApp } from '@midwayjs/mock'; +import { createLegacyApp, close, createHttpRequest, createLightApp } from '@midwayjs/mock'; import { join } from 'path'; import * as bullboard from '../src'; describe(`/test/index.test.ts`, () => { it('test ui in koa', async () => { - const app = await createApp(join(__dirname, 'fixtures', 'base-app-koa')); + const app = await createLegacyApp(join(__dirname, 'fixtures', 'base-app-koa')); // page let result = await createHttpRequest(app).get('/ui'); @@ -29,7 +29,7 @@ describe(`/test/index.test.ts`, () => { }); it('test ui in express', async () => { - const app = await createApp(join(__dirname, 'fixtures', 'base-app-express')); + const app = await createLegacyApp(join(__dirname, 'fixtures', 'base-app-express')); // page let result = await createHttpRequest(app).get('/bull-board'); diff --git a/packages/bull/package.json b/packages/bull/package.json index b1b74a64502e..ea5db6d800c3 100644 --- a/packages/bull/package.json +++ b/packages/bull/package.json @@ -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" diff --git a/packages/bull/test/index.test.ts b/packages/bull/test/index.test.ts index 24274b0ff5b6..3abe538966b9 100644 --- a/packages/bull/test/index.test.ts +++ b/packages/bull/test/index.test.ts @@ -1,4 +1,4 @@ -import { createApp, close } from '@midwayjs/mock'; +import { createLegacyApp, close } from '@midwayjs/mock'; import { join } from 'path'; import { sleep } from '@midwayjs/core'; import * as bull from '../src'; @@ -6,7 +6,7 @@ import { readFileSync } from 'fs'; describe(`/test/index.test.ts`, () => { it('test auto repeat processor', async () => { - const app = await createApp(join(__dirname, 'fixtures', 'base-app'), {}, bull); + const app = await createLegacyApp(join(__dirname, 'fixtures', 'base-app')); await sleep(5 * 1000); let res = app.getAttr(`task`); @@ -31,7 +31,7 @@ describe(`/test/index.test.ts`, () => { }); it('test processor with redis', async () => { - const app = await createApp(join(__dirname, 'fixtures', 'base-app-redis'), {}, bull); + const app = await createLegacyApp(join(__dirname, 'fixtures', 'base-app-redis')); await sleep(5 * 1000); @@ -41,7 +41,7 @@ describe(`/test/index.test.ts`, () => { }); it('should test throw error when create service', async () => { - const app = await createApp(join(__dirname, 'fixtures', 'base-app-error-out-of-job'), {}, bull); + const app = await createLegacyApp(join(__dirname, 'fixtures', 'base-app-error-out-of-job')); await sleep(5 * 1000); expect(readFileSync(join(__dirname, 'fixtures', 'base-app-error-out-of-job', 'logs', 'ali-demo', 'midway-bull.log'), 'utf8').includes('MidwayDefinitionNotFoundError')).toBeTruthy(); await close(app); @@ -53,7 +53,7 @@ describe(`/test/index.test.ts`, () => { // it('should throw error when start with duplicate task', async () => { // let error; // try { -// await createApp( +// await createLegacyApp( // join(__dirname, 'fixtures', 'base-app-duplicate-task'), // {}, // TaskModule @@ -67,7 +67,7 @@ describe(`/test/index.test.ts`, () => { // it('should throw error when start with duplicate local task', async () => { // let error; // try { -// await createApp( +// await createLegacyApp( // join(__dirname, 'fixtures', 'base-app-duplicate-local-task'), // {}, // TaskModule diff --git a/packages/busboy/package.json b/packages/busboy/package.json index 5ec42cf797ff..17127e3dc826 100644 --- a/packages/busboy/package.json +++ b/packages/busboy/package.json @@ -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" } } diff --git a/packages/busboy/test/clean.test.ts b/packages/busboy/test/clean.test.ts index 5ba711378b76..08ba84312407 100644 --- a/packages/busboy/test/clean.test.ts +++ b/packages/busboy/test/clean.test.ts @@ -1,4 +1,4 @@ -import { createHttpRequest, close, createFunctionApp } from '@midwayjs/mock'; +import { createHttpRequest, close, createLegacyFunctionApp } from '@midwayjs/mock'; import { join } from 'path'; import { existsSync, statSync } from 'fs'; import { sleep } from '@midwayjs/core'; @@ -9,7 +9,7 @@ describe('test/clean.test.ts', function () { it('upload file auto clean', async () => { const appDir = join(__dirname, 'fixtures/clean'); const imagePath = join(__dirname, 'fixtures/1.jpg'); - const app = await createFunctionApp(appDir, {}); + const app = await createLegacyFunctionApp(appDir, {}); const request = await createHttpRequest(app); const stat = statSync(imagePath); const response = await request.post('/upload') diff --git a/packages/busboy/test/express.test.ts b/packages/busboy/test/express.test.ts index ba12ee894f90..3cbc7965c707 100644 --- a/packages/busboy/test/express.test.ts +++ b/packages/busboy/test/express.test.ts @@ -1,4 +1,4 @@ -import { createHttpRequest, close, createApp } from '@midwayjs/mock'; +import { createHttpRequest, close, createLegacyApp } from '@midwayjs/mock'; import { join } from 'path'; import * as assert from 'assert'; import { statSync } from 'fs'; @@ -8,7 +8,7 @@ describe('test/express.test.ts', function () { let app; beforeAll(async () => { const appDir = join(__dirname, 'fixtures/express-stream'); - app = await createApp(appDir); + app = await createLegacyApp(appDir); }); afterAll(async () => { @@ -50,7 +50,7 @@ describe('test/express.test.ts', function () { let app; beforeAll(async () => { const appDir = join(__dirname, 'fixtures/express-file'); - app = await createApp(appDir); + app = await createLegacyApp(appDir); }); afterAll(async () => { diff --git a/packages/busboy/test/faas.test.ts b/packages/busboy/test/faas.test.ts index 781722f342ce..b570e6621d65 100644 --- a/packages/busboy/test/faas.test.ts +++ b/packages/busboy/test/faas.test.ts @@ -1,4 +1,4 @@ -import { createHttpRequest, close, createFunctionApp } from '@midwayjs/mock'; +import { createHttpRequest, close, createLegacyFunctionApp } from '@midwayjs/mock'; import { join } from 'path'; import * as assert from 'assert'; import { existsSync, statSync } from 'fs'; @@ -8,7 +8,7 @@ describe('test/faas.test.ts', function () { let app; beforeAll(async () => { const appDir = join(__dirname, 'fixtures/faas'); - app = await createFunctionApp(appDir, {}); + app = await createLegacyFunctionApp(appDir, {}); }) afterAll(async () => { diff --git a/packages/busboy/test/koa.test.ts b/packages/busboy/test/koa.test.ts index 1a4249b7e177..de824d6696c0 100644 --- a/packages/busboy/test/koa.test.ts +++ b/packages/busboy/test/koa.test.ts @@ -1,4 +1,4 @@ -import { createHttpRequest, close, createApp, createLightApp } from "@midwayjs/mock"; +import { createHttpRequest, close, createLegacyApp, createLightApp } from "@midwayjs/mock"; import { join } from 'path'; import { createWriteStream, existsSync, statSync } from "fs"; import * as koa from '@midwayjs/koa'; @@ -15,7 +15,7 @@ describe('test/koa.test.ts', function () { let app; beforeAll(async () => { const appDir = join(__dirname, 'fixtures/koa-stream'); - app = await createApp(appDir); + app = await createLegacyApp(appDir); }); afterAll(async () => { @@ -71,7 +71,7 @@ describe('test/koa.test.ts', function () { let app; beforeAll(async () => { const appDir = join(__dirname, 'fixtures/koa-file'); - app = await createApp(appDir); + app = await createLegacyApp(appDir); }); afterAll(async () => { @@ -127,7 +127,7 @@ describe('test/koa.test.ts', function () { let app; beforeAll(async () => { const appDir = join(__dirname, 'fixtures/koa-file-mime'); - app = await createApp(appDir); + app = await createLegacyApp(appDir); }); afterAll(async () => { @@ -178,7 +178,7 @@ describe('test/koa.test.ts', function () { describe('test null set', function () { it('upload test ext set null', async () => { const appDir = join(__dirname, 'fixtures/koa-ext-null'); - const app = await createApp(appDir); + const app = await createLegacyApp(appDir); const filePath = join(__dirname, 'fixtures/1.test'); const request = createHttpRequest(app); await request.post('/upload') @@ -195,7 +195,7 @@ describe('test/koa.test.ts', function () { let app; beforeAll(async () => { const appDir = join(__dirname, 'fixtures/koa-function-whitelist'); - app = await createApp(appDir); + app = await createLegacyApp(appDir); }); afterAll(async () => { @@ -276,8 +276,8 @@ describe('test/koa.test.ts', function () { imports: [ koa, busboy, - HomeController ], + preloadModules: [HomeController], globalConfig: { keys: '123', busboy: {} @@ -338,8 +338,8 @@ describe('test/koa.test.ts', function () { imports: [ koa, busboy, - HomeController ], + preloadModules: [HomeController], globalConfig: { keys: '123', busboy: {} @@ -404,8 +404,8 @@ describe('test/koa.test.ts', function () { imports: [ koa, busboy, - HomeController ], + preloadModules: [HomeController], globalConfig: { keys: '123', busboy: {} @@ -461,8 +461,8 @@ describe('test/koa.test.ts', function () { imports: [ koa, busboy, - HomeController ], + preloadModules: [HomeController], globalConfig: { keys: '123', busboy: {} @@ -547,8 +547,8 @@ describe('test/koa.test.ts', function () { imports: [ koa, busboy, - HomeController ], + preloadModules: [HomeController], globalConfig: { keys: "123", busboy: {} @@ -604,8 +604,8 @@ describe('test/koa.test.ts', function () { imports: [ koa, busboy, - HomeController ], + preloadModules: [HomeController], globalConfig: { keys: '123', busboy: { diff --git a/packages/busboy/test/web.test.ts b/packages/busboy/test/web.test.ts index 90f8d417a398..6e64a0e9584f 100644 --- a/packages/busboy/test/web.test.ts +++ b/packages/busboy/test/web.test.ts @@ -1,4 +1,4 @@ -import { createHttpRequest, close, createApp } from '@midwayjs/mock'; +import { createHttpRequest, close, createLegacyApp } from '@midwayjs/mock'; import { join } from 'path'; import * as assert from 'assert'; import { statSync } from 'fs'; @@ -9,7 +9,7 @@ describe('test/web.test.ts', function () { let app; beforeAll(async () => { const appDir = join(__dirname, 'fixtures/web-stream'); - app = await createApp(appDir); + app = await createLegacyApp(appDir); }); afterAll(async () => { @@ -49,7 +49,7 @@ describe('test/web.test.ts', function () { let app; beforeAll(async () => { const appDir = join(__dirname, 'fixtures/web-file'); - app = await createApp(appDir); + app = await createLegacyApp(appDir); }); afterAll(async () => { diff --git a/packages/cache-manager/package.json b/packages/cache-manager/package.json index 8e1d1430ef41..1e582579a07c 100644 --- a/packages/cache-manager/package.json +++ b/packages/cache-manager/package.json @@ -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" }, diff --git a/packages/cache-manager/test/index.test.ts b/packages/cache-manager/test/index.test.ts index 8d1b933f7fd5..b3effcb417d5 100644 --- a/packages/cache-manager/test/index.test.ts +++ b/packages/cache-manager/test/index.test.ts @@ -1,6 +1,6 @@ import * as path from 'path'; import * as assert from 'assert'; -import { createLightApp, close } from '@midwayjs/mock'; +import { createLegacyLightApp as createLightApp, close } from '@midwayjs/mock'; import { createCache } from 'cache-manager'; import { sleep } from '@midwayjs/core'; diff --git a/packages/captcha/package.json b/packages/captcha/package.json index dc7fc27f11d0..ec8f654638f3 100644 --- a/packages/captcha/package.json +++ b/packages/captcha/package.json @@ -22,14 +22,14 @@ }, "license": "MIT", "dependencies": { - "@midwayjs/cache-manager": "^3.18.1", + "@midwayjs/cache-manager": "workspace:^", "mini-svg-data-uri": "1.4.4", "nanoid": "3.3.7", "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:^" } } diff --git a/packages/captcha/test/index.test.ts b/packages/captcha/test/index.test.ts index a31d72ef7e44..a4743eedb65d 100644 --- a/packages/captcha/test/index.test.ts +++ b/packages/captcha/test/index.test.ts @@ -1,4 +1,4 @@ -import { createHttpRequest, close, createApp, createLightApp } from '@midwayjs/mock'; +import { createHttpRequest, close, createLegacyApp, createLightApp } from '@midwayjs/mock'; import { join } from 'path'; import * as assert from 'assert'; import * as captcha from '../src'; @@ -8,7 +8,7 @@ describe('test/index.test.ts', function () { let app; beforeAll(async () => { const appDir = join(__dirname, 'fixtures/koa'); - app = await createApp(appDir); + app = await createLegacyApp(appDir); }); afterAll(async () => { diff --git a/packages/casbin-redis-adapter/package.json b/packages/casbin-redis-adapter/package.json index b2eb7df3e197..d36fde019391 100644 --- a/packages/casbin-redis-adapter/package.json +++ b/packages/casbin-redis-adapter/package.json @@ -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", diff --git a/packages/casbin-redis-adapter/test/index.test.ts b/packages/casbin-redis-adapter/test/index.test.ts index 8a29f191309a..266065f772b4 100644 --- a/packages/casbin-redis-adapter/test/index.test.ts +++ b/packages/casbin-redis-adapter/test/index.test.ts @@ -1,9 +1,10 @@ -import { createApp, createHttpRequest, close } from '@midwayjs/mock'; +import { createLegacyApp, createHttpRequest, close } from '@midwayjs/mock'; import { IMidwayApplication, sleep } from '@midwayjs/core'; +import { join } from 'path'; describe('/test/index.test.ts', () => { it('should test read from redis', async () => { - const app = await createApp('base-app') as IMidwayApplication; + const app = await createLegacyApp(join(__dirname, 'fixtures/base-app')) as IMidwayApplication; const response = await createHttpRequest(app).get('/?username=bob'); expect(response.status).toEqual(403); diff --git a/packages/casbin-typeorm-adapter/package.json b/packages/casbin-typeorm-adapter/package.json index c2f46ec0bba3..8b54e2b442f0 100644 --- a/packages/casbin-typeorm-adapter/package.json +++ b/packages/casbin-typeorm-adapter/package.json @@ -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", diff --git a/packages/casbin-typeorm-adapter/test/index.test.ts b/packages/casbin-typeorm-adapter/test/index.test.ts index 963995d772e9..081b31c5b3e3 100644 --- a/packages/casbin-typeorm-adapter/test/index.test.ts +++ b/packages/casbin-typeorm-adapter/test/index.test.ts @@ -1,9 +1,10 @@ -import { createApp, createHttpRequest } from '@midwayjs/mock'; +import { createLegacyApp, createHttpRequest } from '@midwayjs/mock'; import { IMidwayApplication } from '@midwayjs/core'; +import { join } from 'path'; describe('/test/index.test.ts', () => { it('should test read from typeorm', async () => { - const app = await createApp('base-app') as IMidwayApplication; + const app = await createLegacyApp(join(__dirname, 'fixtures/base-app')) as IMidwayApplication; const response = await createHttpRequest(app).get('/?username=bob'); expect(response.status).toEqual(403); diff --git a/packages/casbin/package.json b/packages/casbin/package.json index e925ac4e4bca..1a4dcd7f21c7 100644 --- a/packages/casbin/package.json +++ b/packages/casbin/package.json @@ -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" diff --git a/packages/casbin/test/index.test.ts b/packages/casbin/test/index.test.ts index 9fc726b97f6d..f2843d65ecdc 100644 --- a/packages/casbin/test/index.test.ts +++ b/packages/casbin/test/index.test.ts @@ -1,17 +1,17 @@ -import { createApp, createHttpRequest } from '@midwayjs/mock'; +import { createLegacyApp, createHttpRequest } from '@midwayjs/mock'; import { CasbinEnforcerService } from '../src'; import { IMidwayApplication } from '@midwayjs/core'; describe('/test/index.test.ts', () => { it('should test casbin api', async () => { - const app = await createApp('base-app') as IMidwayApplication; + const app = await createLegacyApp('base-app') as IMidwayApplication; const enforcerService = await app.getApplicationContext().getAsync(CasbinEnforcerService); const policy = await enforcerService.getPolicy(); expect(policy).toMatchSnapshot(); }); it('should test decorator', async () => { - const app = await createApp('base-app-decorator') as IMidwayApplication; + const app = await createLegacyApp('base-app-decorator') as IMidwayApplication; const response = await createHttpRequest(app).get('/?username=bob'); expect(response.status).toEqual(403); diff --git a/packages/code-dye/package.json b/packages/code-dye/package.json index 2855201c8f56..0a103d1fc0ee 100644 --- a/packages/code-dye/package.json +++ b/packages/code-dye/package.json @@ -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:^" } } diff --git a/packages/code-dye/test/koa.test.ts b/packages/code-dye/test/koa.test.ts index 5de92dd62caa..56d4ca5e003f 100644 --- a/packages/code-dye/test/koa.test.ts +++ b/packages/code-dye/test/koa.test.ts @@ -1,4 +1,4 @@ -import { createHttpRequest, close, createApp } from '@midwayjs/mock'; +import { createHttpRequest, close, createLegacyApp } from '@midwayjs/mock'; import { join } from 'path'; import * as assert from 'assert'; describe('test/koa.test.ts', function () { @@ -6,7 +6,7 @@ describe('test/koa.test.ts', function () { beforeAll(async () => { const appDir = join(__dirname, 'fixtures/koa'); try { - app = await createApp(appDir); + app = await createLegacyApp(appDir); } catch (e) { console.log('e', e); } diff --git a/packages/consul/package.json b/packages/consul/package.json index 5ce107142383..a98b8bada3c4 100644 --- a/packages/consul/package.json +++ b/packages/consul/package.json @@ -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" diff --git a/packages/consul/test/index.test.ts b/packages/consul/test/index.test.ts index 1dbeac4a01c1..8f02d9e4c67e 100644 --- a/packages/consul/test/index.test.ts +++ b/packages/consul/test/index.test.ts @@ -1,4 +1,4 @@ -import {close, createApp, createHttpRequest} from '@midwayjs/mock'; +import {close, createLegacyApp, createHttpRequest} from '@midwayjs/mock'; import {IMidwayApplication} from '@midwayjs/core'; import {IConsulBalancer} from '../src'; import { mockConsulAPI } from './mock'; @@ -15,9 +15,9 @@ describe('/test/feature.test.ts', () => { beforeAll(async () => { // 如果使用真实的 server (consul agent --dev) 测试打开下面一行 // 同时记得修改配置中的 consul.provide.host 参数 - // app = await createApp('base-app', {}, '@midwayjs/koa'); + // app = await createLegacyApp('base-app', {}, '@midwayjs/koa'); mockConsulAPI(); - app = await createApp(join(__dirname, 'fixtures', 'base-app'), {}); + app = await createLegacyApp(join(__dirname, 'fixtures', 'base-app'), {}); }); afterAll(async () => { diff --git a/packages/core/package.json b/packages/core/package.json index d4e763df2d7c..32b33afc1b4f 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -31,7 +31,6 @@ }, "dependencies": { "@midwayjs/glob": "^1.0.2", - "class-transformer": "0.5.1", "picomatch": "2.3.1", "reflect-metadata": "0.2.2" }, @@ -43,5 +42,23 @@ "engines": { "node": ">=16" }, - "gitHead": "a603d2348d6141f8f723901498f03a162a037708" + "madge": { + "detectiveOptions": { + "ts": { + "skipTypeImports": true + } + } + }, + "exports": { + ".": { + "import": "./dist/index.js", + "require": "./dist/index.js", + "types": "./dist/index.d.ts" + }, + "./functional": { + "import": "./dist/functional/index.js", + "require": "./dist/functional/index.js", + "types": "./dist/functional/index.d.ts" + } + } } diff --git a/packages/core/src/common/asyncContextManager.ts b/packages/core/src/common/asyncContextManager.ts index 7eabab671f6d..78566dd718e2 100644 --- a/packages/core/src/common/asyncContextManager.ts +++ b/packages/core/src/common/asyncContextManager.ts @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +import { AsyncLocalStorage } from 'async_hooks'; export interface AsyncContext { /** @@ -162,3 +163,63 @@ export class NoopContextManager implements AsyncContextManager { return this; } } + +export class AsyncLocalStorageContextManager implements AsyncContextManager { + private _asyncLocalStorage: AsyncLocalStorage; + + constructor() { + this._asyncLocalStorage = new AsyncLocalStorage(); + } + + active(): AsyncContext { + return this._asyncLocalStorage.getStore() ?? ASYNC_ROOT_CONTEXT; + } + + with ReturnType>( + context: AsyncContext, + fn: F, + thisArg?: ThisParameterType, + ...args: A + ): ReturnType { + const cb = thisArg == null ? fn : fn.bind(thisArg); + return this._asyncLocalStorage.run(context, cb as never, ...args); + } + + enable(): this { + return this; + } + + disable(): this { + this._asyncLocalStorage.disable(); + return this; + } + + /** + * Binds a the certain context or the active one to the target function and then returns the target + * @param context A context (span) to be bind to target + * @param target a function. When target or one of its callbacks is called, + * the provided context will be used as the active context for the duration of the call. + */ + bind(context: AsyncContext, target: T): T { + if (typeof target === 'function') { + // eslint-disable-next-line @typescript-eslint/no-this-alias + const manager = this; + const contextWrapper = function (this: never, ...args: unknown[]) { + return manager.with(context, () => target.apply(this, args)); + }; + Object.defineProperty(contextWrapper, 'length', { + enumerable: false, + configurable: true, + writable: false, + value: target.length, + }); + /** + * It isn't possible to tell Typescript that contextWrapper is the same as T + * so we forced to cast as any here. + */ + // eslint-disable-next-line @typescript-eslint/no-explicit-any + return contextWrapper as any; + } + return target; + } +} diff --git a/packages/core/src/common/fileDetector.ts b/packages/core/src/common/fileDetector.ts index 4159d0e53aa7..22e2fbf8081c 100644 --- a/packages/core/src/common/fileDetector.ts +++ b/packages/core/src/common/fileDetector.ts @@ -1,6 +1,6 @@ import { IFileDetector, - IMidwayContainer, + IMidwayGlobalContainer, IObjectDefinition, } from '../interface'; import { Types } from '../util/types'; @@ -9,20 +9,21 @@ import { MidwayDuplicateClassNameError } from '../error'; import { DEFAULT_PATTERN, IGNORE_PATTERN } from '../constants'; import { loadModule } from '../util'; import { DecoratorManager } from '../decorator'; +import { debuglog } from 'util'; +const debug = debuglog('midway:debug'); export abstract class AbstractFileDetector implements IFileDetector { options: T; - extraDetectorOptions: T; constructor(options?: T) { this.options = options; - this.extraDetectorOptions = {} as T; } - abstract run(container: IMidwayContainer): void | Promise; + abstract run( + container: IMidwayGlobalContainer, + namespace: string + ): Promise; - setExtraDetectorOptions(detectorOptions: T) { - this.extraDetectorOptions = detectorOptions; - } + abstract runSync(container: IMidwayGlobalContainer, namespace: string): void; } const DEFAULT_GLOB_PATTERN = ['**/**.tsx'].concat(DEFAULT_PATTERN); @@ -46,20 +47,19 @@ export class CommonJSFileDetector extends AbstractFileDetector<{ loadDir?: string | string[]; pattern?: string | string[]; ignore?: string | string[]; - namespace?: string; conflictCheck?: boolean; }> { private duplicateModuleCheckSet = new Map(); - run(container) { + async run(container: IMidwayGlobalContainer, namespace: string) { if (this.getType() === 'commonjs') { - return this.loadSync(container); + return this.loadSync(container, namespace); } else { - return this.loadAsync(container); + return this.loadAsync(container, namespace); } } - loadSync(container) { + loadSync(container: IMidwayGlobalContainer, namespace: string) { this.options = this.options || {}; const loadDirs = [].concat( this.options.loadDir ?? container.get('baseDir') @@ -67,24 +67,18 @@ export class CommonJSFileDetector extends AbstractFileDetector<{ for (const dir of loadDirs) { const fileResults = run( - DEFAULT_GLOB_PATTERN.concat(this.options.pattern || []).concat( - this.extraDetectorOptions.pattern || [] - ), + DEFAULT_GLOB_PATTERN.concat(this.options.pattern || []), { cwd: dir, - ignore: DEFAULT_IGNORE_PATTERN.concat( - this.options.ignore || [] - ).concat(this.extraDetectorOptions.ignore || []), + ignore: DEFAULT_IGNORE_PATTERN.concat(this.options.ignore || []), } ); + debug(`[core]: load file from ${dir}, files: ${fileResults}`); + // 检查重复模块 const checkDuplicatedHandler = (module, options?: IObjectDefinition) => { - if ( - (this.options.conflictCheck || - this.extraDetectorOptions.conflictCheck) && - Types.isClass(module) - ) { + if (this.options.conflictCheck && Types.isClass(module)) { const name = DecoratorManager.getProviderName(module); if (name) { if (this.duplicateModuleCheckSet.has(name)) { @@ -104,7 +98,7 @@ export class CommonJSFileDetector extends AbstractFileDetector<{ const exports = require(file); // add module to set container.bindClass(exports, { - namespace: this.options.namespace, + namespace, srcPath: file, createFrom: 'file', bindHook: checkDuplicatedHandler, @@ -116,7 +110,7 @@ export class CommonJSFileDetector extends AbstractFileDetector<{ this.duplicateModuleCheckSet.clear(); } - async loadAsync(container) { + async loadAsync(container: IMidwayGlobalContainer, namespace: string) { this.options = this.options || {}; const loadDirs = [].concat( this.options.loadDir ?? container.get('baseDir') @@ -124,24 +118,18 @@ export class CommonJSFileDetector extends AbstractFileDetector<{ for (const dir of loadDirs) { const fileResults = run( - DEFAULT_GLOB_PATTERN.concat(this.options.pattern || []).concat( - this.extraDetectorOptions.pattern || [] - ), + DEFAULT_GLOB_PATTERN.concat(this.options.pattern || []), { cwd: dir, - ignore: DEFAULT_IGNORE_PATTERN.concat( - this.options.ignore || [] - ).concat(this.extraDetectorOptions.ignore || []), + ignore: DEFAULT_IGNORE_PATTERN.concat(this.options.ignore || []), } ); + debug(`[core]: load file from ${dir}, files: ${fileResults}`); + // 检查重复模块 const checkDuplicatedHandler = (module, options?: IObjectDefinition) => { - if ( - (this.options.conflictCheck || - this.extraDetectorOptions.conflictCheck) && - Types.isClass(module) - ) { + if (this.options.conflictCheck && Types.isClass(module)) { const name = DecoratorManager.getProviderName(module); if (name) { if (this.duplicateModuleCheckSet.has(name)) { @@ -163,7 +151,7 @@ export class CommonJSFileDetector extends AbstractFileDetector<{ }); // add module to set container.bindClass(exports, { - namespace: this.options.namespace, + namespace, srcPath: file, createFrom: 'file', bindHook: checkDuplicatedHandler, @@ -178,6 +166,12 @@ export class CommonJSFileDetector extends AbstractFileDetector<{ getType(): 'commonjs' | 'module' { return 'commonjs'; } + + runSync(container: IMidwayGlobalContainer, namespace: string): void { + if (this.getType() === 'commonjs') { + return this.loadSync(container, namespace); + } + } } /** @@ -193,7 +187,11 @@ export class CustomModuleDetector extends AbstractFileDetector<{ modules?: any[]; namespace?: string; }> { - async run(container) { + async run(container: IMidwayGlobalContainer) { + this.runSync(container, this.options.namespace); + } + + runSync(container: IMidwayGlobalContainer, namespace: string): void { for (const module of this.options.modules) { container.bindClass(module, { namespace: this.options.namespace, diff --git a/packages/core/src/config/config.default.ts b/packages/core/src/config/config.default.ts index 8ee5b4df1194..78c225146733 100644 --- a/packages/core/src/config/config.default.ts +++ b/packages/core/src/config/config.default.ts @@ -8,7 +8,7 @@ export default (appInfo: MidwayAppInfo): MidwayCoreDefaultConfig => { healthCheckTimeout: 1000, }, asyncContextManager: { - enable: false, + enable: true, }, midwayLogger: { default: { diff --git a/packages/core/src/context/componentLoader.ts b/packages/core/src/context/componentLoader.ts new file mode 100644 index 000000000000..2e2aa0606898 --- /dev/null +++ b/packages/core/src/context/componentLoader.ts @@ -0,0 +1,241 @@ +import { + CONFIGURATION_KEY, + CONFIGURATION_OBJECT_KEY, + DecoratorManager, + MAIN_MODULE_KEY, +} from '../decorator'; +import { + IComponentInfo, + IMidwayGlobalContainer, + InjectionConfigurationOptions, +} from '../interface'; +import { MetadataManager } from '../decorator/metadataManager'; +import { MidwayConfigService } from '../service/configService'; +import { MidwayEnvironmentService } from '../service/environmentService'; +import * as util from 'util'; +import { isConfigurationExport } from '../util'; + +const debug = util.debuglog('midway:debug'); + +export class ComponentConfigurationLoader { + private loadedMap = new WeakMap(); + private namespaceList = []; + constructor(readonly container: IMidwayGlobalContainer) {} + + public async load(module) { + let namespace = MAIN_MODULE_KEY; + // 可能导出多个 + const configurationExports = this.getConfigurationExport(module); + if (!configurationExports.length) return; + // 多个的情况,数据交给第一个保存 + for (let i = 0; i < configurationExports.length; i++) { + const configurationExport = configurationExports[i]; + + if (this.loadedMap.get(configurationExport)) { + // 已经加载过就跳过循环 + continue; + } + + let configurationOptions: InjectionConfigurationOptions; + // 函数式写法 + if ( + MetadataManager.hasOwnMetadata( + CONFIGURATION_OBJECT_KEY, + configurationExport + ) + ) { + // 函数式写法 + configurationOptions = MetadataManager.getOwnMetadata( + CONFIGURATION_OBJECT_KEY, + configurationExport + ); + } else { + // 普通类写法 + configurationOptions = MetadataManager.getOwnMetadata( + CONFIGURATION_KEY, + configurationExport + ); + } + // 已加载标记,防止死循环 + this.loadedMap.set(configurationExport, true); + + if (configurationOptions) { + if (configurationOptions.namespace !== undefined) { + namespace = configurationOptions.namespace; + this.namespaceList.push(namespace); + } + debug(`[core]: load configuration in namespace="${namespace}"`); + this.addImports(configurationOptions.imports); + this.addImportObjects(configurationOptions.importObjects); + this.addImportConfigs(configurationOptions.importConfigs); + this.addImportConfigFilter(configurationOptions.importConfigFilter); + + if (configurationOptions.detector) { + await configurationOptions.detector.run(this.container, namespace); + } + + DecoratorManager.saveModule(CONFIGURATION_KEY, { + target: configurationExport, + namespace, + }); + } + } + + // bind module + this.container.bindClass(module, { + namespace, + }); + } + + public loadSync(module) { + let namespace = MAIN_MODULE_KEY; + // 可能导出多个 + const configurationExports = this.getConfigurationExport(module); + if (!configurationExports.length) return; + // 多个的情况,数据交给第一个保存 + for (let i = 0; i < configurationExports.length; i++) { + const configurationExport = configurationExports[i]; + + if (this.loadedMap.get(configurationExport)) { + // 已经加载过就跳过循环 + continue; + } + + let configurationOptions: InjectionConfigurationOptions; + // 函数式写法 + if ( + MetadataManager.hasOwnMetadata( + CONFIGURATION_OBJECT_KEY, + configurationExport + ) + ) { + // 函数式写法 + configurationOptions = MetadataManager.getOwnMetadata( + CONFIGURATION_OBJECT_KEY, + configurationExport + ); + } else { + // 普通类写法 + configurationOptions = MetadataManager.getOwnMetadata( + CONFIGURATION_KEY, + configurationExport + ); + } + + // 已加载标记,防止死循环 + this.loadedMap.set(configurationExport, true); + + if (configurationOptions) { + if (configurationOptions.namespace !== undefined) { + namespace = configurationOptions.namespace; + this.namespaceList.push(namespace); + } + debug(`[core]: load configuration in namespace="${namespace}"`); + this.addImports(configurationOptions.imports); + this.addImportObjects(configurationOptions.importObjects); + this.addImportConfigs(configurationOptions.importConfigs); + this.addImportConfigFilter(configurationOptions.importConfigFilter); + + if (configurationOptions.detector) { + configurationOptions.detector.runSync(this.container, namespace); + } + + DecoratorManager.saveModule(CONFIGURATION_KEY, { + target: configurationExport, + namespace, + }); + } + } + + // bind module + this.container.bindClass(module, { + namespace, + }); + } + + private addImportConfigs( + importConfigs: + | Array<{ [environmentName: string]: Record }> + | Record + ) { + if (importConfigs) { + if (Array.isArray(importConfigs)) { + this.container.get(MidwayConfigService).add(importConfigs); + } else { + this.container.get(MidwayConfigService).addObject(importConfigs); + } + } + } + + private addImportConfigFilter( + importConfigFilter: (config: Record) => Record + ) { + if (importConfigFilter) { + this.container.get(MidwayConfigService).addFilter(importConfigFilter); + } + } + + private addImports(imports: any[] = []) { + // 处理 imports + for (let importPackage of imports) { + if (!importPackage) continue; + if (typeof importPackage === 'string') { + importPackage = require(importPackage); + } + if ('Configuration' in importPackage) { + // component is object + this.load(importPackage); + } else if ('component' in importPackage) { + if ((importPackage as IComponentInfo)?.enabledEnvironment) { + if ( + (importPackage as IComponentInfo)?.enabledEnvironment?.includes( + this.container + .get(MidwayEnvironmentService) + .getCurrentEnvironment() + ) + ) { + this.load((importPackage as IComponentInfo).component); + } + } else { + this.load((importPackage as IComponentInfo).component); + } + } else { + this.load(importPackage); + } + } + } + + /** + * 注册 importObjects + * @param objs configuration 中的 importObjects + */ + private addImportObjects(objs: any) { + if (objs) { + const keys = Object.keys(objs); + for (const key of keys) { + if (typeof objs[key] !== undefined) { + this.container.registerObject(key, objs[key]); + } + } + } + } + + private getConfigurationExport(exports): any[] { + const mods = []; + if (isConfigurationExport(exports)) { + mods.push(exports); + } else { + for (const m in exports) { + const module = exports[m]; + if (isConfigurationExport(module)) { + mods.push(module); + } + } + } + return mods; + } + + public getNamespaceList() { + return this.namespaceList; + } +} diff --git a/packages/core/src/context/container.ts b/packages/core/src/context/container.ts index a8b49724fc78..a59fa7c8def7 100644 --- a/packages/core/src/context/container.ts +++ b/packages/core/src/context/container.ts @@ -1,22 +1,16 @@ import { - CONFIGURATION_KEY, DecoratorManager, - IComponentInfo, - InjectionConfigurationOptions, - MAIN_MODULE_KEY, OBJECT_DEFINITION_KEY, PROPERTY_INJECT_KEY, CUSTOM_PROPERTY_INJECT_KEY, SCOPE_KEY, CONSTRUCTOR_INJECT_KEY, } from '../decorator'; -import { FunctionalConfiguration } from '../functional/configuration'; import * as util from 'util'; import { ObjectDefinitionRegistry } from './definitionRegistry'; import { ClassType, ConstructorInjectMetadata, - IFileDetector, IIdentifierRelationShip, IMidwayContainer, IMidwayGlobalContainer, @@ -36,8 +30,6 @@ import { import { ObjectDefinition } from '../definitions/objectDefinition'; import { FunctionDefinition } from '../definitions/functionDefinition'; import { ManagedResolverFactory } from './managedResolverFactory'; -import { MidwayEnvironmentService } from '../service/environmentService'; -import { MidwayConfigService } from '../service/configService'; import { EventEmitter } from 'events'; import { Types } from '../util/types'; import { Utils } from '../util'; @@ -47,198 +39,20 @@ const debug = util.debuglog('midway:debug'); const debugBind = util.debuglog('midway:bind'); const debugSpaceLength = 9; -class ContainerConfiguration { - private loadedMap = new WeakMap(); - private namespaceList = []; - private configurationOptionsList: Array = []; - constructor(readonly container: IMidwayGlobalContainer) {} - - load(module) { - let namespace = MAIN_MODULE_KEY; - // 可能导出多个 - const configurationExports = this.getConfigurationExport(module); - if (!configurationExports.length) return; - // 多个的情况,数据交给第一个保存 - for (let i = 0; i < configurationExports.length; i++) { - const configurationExport = configurationExports[i]; - - if (this.loadedMap.get(configurationExport)) { - // 已经加载过就跳过循环 - continue; - } - - let configurationOptions: InjectionConfigurationOptions; - if (configurationExport instanceof FunctionalConfiguration) { - // 函数式写法 - configurationOptions = configurationExport.getConfigurationOptions(); - } else { - // 普通类写法 - configurationOptions = MetadataManager.getOwnMetadata( - CONFIGURATION_KEY, - configurationExport - ); - } - - // 已加载标记,防止死循环 - this.loadedMap.set(configurationExport, true); - - if (configurationOptions) { - if (configurationOptions.namespace !== undefined) { - namespace = configurationOptions.namespace; - this.namespaceList.push(namespace); - } - this.configurationOptionsList.push(configurationOptions); - debug(`[core]: load configuration in namespace="${namespace}"`); - this.addImports(configurationOptions.imports); - this.addImportObjects(configurationOptions.importObjects); - this.addImportConfigs(configurationOptions.importConfigs); - this.addImportConfigFilter(configurationOptions.importConfigFilter); - this.bindConfigurationClass(configurationExport, namespace); - } - } - - // bind module - this.container.bindClass(module, { - namespace, - }); - } - - addImportConfigs( - importConfigs: - | Array<{ [environmentName: string]: Record }> - | Record - ) { - if (importConfigs) { - if (Array.isArray(importConfigs)) { - this.container.get(MidwayConfigService).add(importConfigs); - } else { - this.container.get(MidwayConfigService).addObject(importConfigs); - } - } - } - - addImportConfigFilter( - importConfigFilter: (config: Record) => Record - ) { - if (importConfigFilter) { - this.container.get(MidwayConfigService).addFilter(importConfigFilter); - } - } - - addImports(imports: any[] = []) { - // 处理 imports - for (let importPackage of imports) { - if (!importPackage) continue; - if (typeof importPackage === 'string') { - importPackage = require(importPackage); - } - if ('Configuration' in importPackage) { - // component is object - this.load(importPackage); - } else if ('component' in importPackage) { - if ((importPackage as IComponentInfo)?.enabledEnvironment) { - if ( - (importPackage as IComponentInfo)?.enabledEnvironment?.includes( - this.container - .get(MidwayEnvironmentService) - .getCurrentEnvironment() - ) - ) { - this.load((importPackage as IComponentInfo).component); - } - } else { - this.load((importPackage as IComponentInfo).component); - } - } else { - this.load(importPackage); - } - } - } - - /** - * 注册 importObjects - * @param objs configuration 中的 importObjects - */ - addImportObjects(objs: any) { - if (objs) { - const keys = Object.keys(objs); - for (const key of keys) { - if (typeof objs[key] !== undefined) { - this.container.registerObject(key, objs[key]); - } - } - } - } - - bindConfigurationClass(clzz, namespace) { - if (clzz instanceof FunctionalConfiguration) { - // 函数式写法不需要绑定到容器 - } else { - // 普通类写法 - DecoratorManager.saveProviderId(undefined, clzz); - const id = DecoratorManager.getProviderUUId(clzz); - this.container.bind(id, clzz, { - namespace: namespace, - scope: ScopeEnum.Singleton, - }); - } - - // configuration 手动绑定去重 - const configurationMods = DecoratorManager.listModule(CONFIGURATION_KEY); - const exists = configurationMods.find(mod => { - return mod.target === clzz; - }); - if (!exists) { - DecoratorManager.saveModule(CONFIGURATION_KEY, { - target: clzz, - namespace: namespace, - }); - } - } - - private getConfigurationExport(exports): any[] { - const mods = []; - if ( - Types.isClass(exports) || - Types.isFunction(exports) || - exports instanceof FunctionalConfiguration - ) { - mods.push(exports); - } else { - for (const m in exports) { - const module = exports[m]; - if ( - Types.isClass(module) || - Types.isFunction(module) || - module instanceof FunctionalConfiguration - ) { - mods.push(module); - } - } - } - return mods; - } - - public getNamespaceList() { - return this.namespaceList; - } - - public getConfigurationOptionsList() { - return this.configurationOptionsList; - } -} - export class MidwayContainer implements IMidwayGlobalContainer { private _resolverFactory: ManagedResolverFactory = null; private _registry: IObjectDefinitionRegistry = null; private _identifierMapping = null; - private moduleMap = null; private _objectCreateEventTarget: EventEmitter; // 仅仅用于兼容 requestContainer 的 ctx protected ctx = SINGLETON_CONTAINER_CTX; - private fileDetector: IFileDetector | false | undefined; private attrMap: Map = new Map(); - private _namespaceSet: Set = null; + private namespaceSet: Set = new Set(); + private _id = Utils.generateRandomId(); + + get id() { + return this._id; + } constructor() { // 防止直接从applicationContext.getAsync or get对象实例时依赖当前上下文信息出错 @@ -271,52 +85,8 @@ export class MidwayContainer implements IMidwayGlobalContainer { return this._identifierMapping; } - get namespaceSet(): Set { - if (!this._namespaceSet) { - this._namespaceSet = new Set(); - } - return this._namespaceSet; - } - - load(module) { - if (!Array.isArray(module)) { - module = [module]; - } - // load configuration - const configuration = new ContainerConfiguration(this); - - for (const mod of module) { - if (mod) { - configuration.load(mod); - } - } - for (const ns of configuration.getNamespaceList()) { - this.namespaceSet.add(ns); - debug(`[core]: load configuration in namespace="${ns}" complete`); - } - - const configurationOptionsList = - configuration.getConfigurationOptionsList() ?? []; - - // find user code configuration it's without namespace - const userCodeConfiguration = - configurationOptionsList.find(options => !options.namespace) ?? {}; - - this.fileDetector = userCodeConfiguration.detector ?? this.fileDetector; - - if (this.fileDetector) { - this.fileDetector.setExtraDetectorOptions({ - conflictCheck: userCodeConfiguration.conflictCheck, - ...userCodeConfiguration.detectorOptions, - }); - } - } - - protected loadDefinitions(): void | Promise { - // load project file - if (this.fileDetector) { - return this.fileDetector.run(this); - } + public addNamespace(ns: string) { + this.namespaceSet.add(ns); } bindClass(exports, options?: Partial) { @@ -520,10 +290,6 @@ export class MidwayContainer implements IMidwayGlobalContainer { } } - setFileDetector(fileDetector: IFileDetector) { - this.fileDetector = fileDetector; - } - public setAttr(key: string, value) { this.attrMap.set(key, value); } @@ -552,9 +318,9 @@ export class MidwayContainer implements IMidwayGlobalContainer { this.attrMap.clear(); } - ready() { - return this.loadDefinitions(); - } + // ready() { + // return this.loadDefinitions(); + // } get(identifier: ClassType | string, args?: any[]): T { return this.getManagedResolverFactory().create(identifier, args, this); @@ -639,21 +405,6 @@ export class MidwayContainer implements IMidwayGlobalContainer { this.objectCreateEventTarget.on(ObjectLifeCycleEvent.BEFORE_DESTROY, fn); } - saveModule(key, module) { - if (!this.moduleMap.has(key)) { - this.moduleMap.set(key, new Set()); - } - this.moduleMap.get(key).add(module); - } - - listModule(key: string) { - return Array.from(this.moduleMap.get(key) || {}); - } - - transformModule(moduleMap: Map>) { - this.moduleMap = new Map(moduleMap); - } - hasNamespace(ns: string) { return this.namespaceSet.has(ns); } diff --git a/packages/core/src/decorator/common/autoload.ts b/packages/core/src/decorator/common/autoload.ts index 4635181d2e38..bccc7271a1f1 100644 --- a/packages/core/src/decorator/common/autoload.ts +++ b/packages/core/src/decorator/common/autoload.ts @@ -3,7 +3,7 @@ import { Provide } from './provide'; export function Autoload() { return function (target) { - DecoratorManager.savePreloadModule(target); + DecoratorManager.savePreStartModule(target); Provide()(target); }; } diff --git a/packages/core/src/decorator/common/configuration.ts b/packages/core/src/decorator/common/configuration.ts index 8374abd6061b..eec87678642e 100644 --- a/packages/core/src/decorator/common/configuration.ts +++ b/packages/core/src/decorator/common/configuration.ts @@ -1,35 +1,14 @@ -import { CONFIGURATION_KEY } from '../'; -import { IFileDetector } from '../../interface'; +import { CONFIGURATION_KEY, MAIN_MODULE_KEY, Provide, Scope } from '../'; import { MetadataManager } from '../metadataManager'; - -export interface IComponentInfo { - component: any; - enabledEnvironment?: string[]; -} - -export interface ResolveFilter { - pattern: string | RegExp; - filter: (module, filter, bindModule) => any; - ignoreRequire?: boolean; -} - -export interface InjectionConfigurationOptions { - imports?: Array; - importObjects?: Record; - importConfigs?: - | Array<{ [environmentName: string]: Record }> - | Record; - importConfigFilter?: (config: Record) => Record; - namespace?: string; - detector?: IFileDetector | false; - detectorOptions?: Record; - conflictCheck?: boolean; -} +import { InjectionConfigurationOptions, ScopeEnum } from '../../interface'; export function Configuration( options: InjectionConfigurationOptions = {} ): ClassDecorator { return (target: any) => { + options.namespace = options.namespace ?? MAIN_MODULE_KEY; MetadataManager.defineMetadata(CONFIGURATION_KEY, options, target); + Scope(ScopeEnum.Singleton)(target); + Provide()(target); }; } diff --git a/packages/core/src/decorator/common/framework.ts b/packages/core/src/decorator/common/framework.ts index 1bf1513f0322..40369adc1c2f 100644 --- a/packages/core/src/decorator/common/framework.ts +++ b/packages/core/src/decorator/common/framework.ts @@ -9,6 +9,7 @@ import { APPLICATION_CONTEXT_KEY, MAIN_APPLICATION_KEY, DecoratorManager, + ALL_VALUE_KEY, } from '../'; import { ScopeEnum } from '../../interface'; @@ -34,16 +35,32 @@ export function Plugin(identifier?: string): PropertyDecorator { }); } +/** + * @deprecated Use @AllConfig() instead + * @since 2.0.0 + */ +export function Config(): PropertyDecorator; /** * Config decorator, use to get config * @since 2.0.0 */ +export function Config(identifier: string): PropertyDecorator; export function Config(identifier?: string): PropertyDecorator { return DecoratorManager.createCustomPropertyDecorator(CONFIG_KEY, { identifier, }); } +/** + * Config decorator, use to get all config + * @since 4.0.0 + */ +export function AllConfig(): PropertyDecorator { + return DecoratorManager.createCustomPropertyDecorator(CONFIG_KEY, { + identifier: ALL_VALUE_KEY, + }); +} + /** * @deprecated Use @MainApp() instead */ diff --git a/packages/core/src/decorator/constant.ts b/packages/core/src/decorator/constant.ts index 2964485459b3..23b9bf590ac9 100644 --- a/packages/core/src/decorator/constant.ts +++ b/packages/core/src/decorator/constant.ts @@ -3,6 +3,7 @@ export const ALL_VALUE_KEY = 'common:all_value_key'; // common export const SCHEDULE_KEY = 'common:schedule'; export const CONFIGURATION_KEY = 'common:configuration'; +export const CONFIGURATION_OBJECT_KEY = 'common:configuration_object'; export const FRAMEWORK_KEY = 'common:framework'; export const ASPECT_KEY = 'common:aspect'; export const CATCH_KEY = 'common:catch'; @@ -10,7 +11,7 @@ export const MATCH_KEY = 'common:match'; export const GUARD_KEY = 'common:guard'; export const MOCK_KEY = 'common:mock'; export const FACTORY_SERVICE_CLIENT_KEY = 'common:service_factory:client'; -export const PRELOAD_MODULE_KEY = 'common:preload_module'; +export const PRE_START_MODULE_KEY = 'common:pre_start_module'; export const OBJECT_DEFINITION_KEY = 'common:object_definition'; // for @Provide export const PROVIDE_KEY = 'common:provide'; diff --git a/packages/core/src/decorator/decoratorManager.ts b/packages/core/src/decorator/decoratorManager.ts index a92bdb85c29b..7504cd4ed02b 100644 --- a/packages/core/src/decorator/decoratorManager.ts +++ b/packages/core/src/decorator/decoratorManager.ts @@ -1,6 +1,5 @@ import { ClassType, - IModuleStore, MethodDecoratorOptions, ObjectIdentifier, ParamDecoratorOptions, @@ -11,7 +10,7 @@ import { CUSTOM_METHOD_INJECT_KEY, CUSTOM_PARAM_INJECT_KEY, CUSTOM_PROPERTY_INJECT_KEY, - PRELOAD_MODULE_KEY, + PRE_START_MODULE_KEY, PROVIDE_KEY, } from './constant'; import { camelCase } from '../util/camelCase'; @@ -29,16 +28,12 @@ const debug = require('util').debuglog('midway:core'); * @since 3.0.0 */ export class DecoratorManager { - private static container: IModuleStore; private static moduleStore: Map> = new Map(); public static saveModule(key: ObjectIdentifier, module) { if (isClass(module)) { this.saveProviderId(undefined, module); } - if (this.container) { - return this.container.saveModule(key, module); - } if (!this.moduleStore.has(key)) { this.moduleStore.set(key, new Set()); } @@ -49,12 +44,7 @@ export class DecoratorManager { key: ObjectIdentifier, filter?: (module) => boolean ): any[] { - let modules: any[]; - if (this.container) { - modules = this.container.listModule(key); - } else { - modules = [...(this.moduleStore.get(key) || [])]; - } + const modules = [...(this.moduleStore.get(key) || [])]; if (filter) { return modules.filter(filter); } else { @@ -62,12 +52,12 @@ export class DecoratorManager { } } - public static savePreloadModule(module) { - this.saveModule(PRELOAD_MODULE_KEY, module); + public static savePreStartModule(module) { + this.saveModule(PRE_START_MODULE_KEY, module); } - public static listPreloadModule(): any[] { - return this.listModule(PRELOAD_MODULE_KEY); + public static listPreStartModule(): any[] { + return this.listModule(PRE_START_MODULE_KEY); } public static resetModule(key) { @@ -78,15 +68,6 @@ export class DecoratorManager { this.moduleStore.clear(); } - public static bindContainer(container: IModuleStore) { - this.container = container; - this.container.transformModule(this.moduleStore); - } - - public static clearBindContainer() { - this.container = null; - } - public static saveProviderId( identifier: ObjectIdentifier, target: ClassType diff --git a/packages/core/src/decorator/metadataManager.ts b/packages/core/src/decorator/metadataManager.ts index e059e75fab0d..0d52c5925e8e 100644 --- a/packages/core/src/decorator/metadataManager.ts +++ b/packages/core/src/decorator/metadataManager.ts @@ -32,6 +32,7 @@ export class MetadataManager { protected static readonly isClassSymbol = Symbol.for( 'midway.metadata.isClass' ); + public static ObjectType = ObjectType; /** * A symbol that represents an empty value */ @@ -652,4 +653,18 @@ export class MetadataManager { return ret === ObjectType.Instance ? target.constructor : target; } + + public static ensureTargetType(target: any, type: ObjectType): void { + // eslint-disable-next-line no-prototype-builtins + const ret: ObjectType = target.hasOwnProperty(this.isClassSymbol) + ? target[this.isClassSymbol] + : undefined; + if (!ret) { + Object.defineProperty(target, this.isClassSymbol, { + value: type, + enumerable: false, + configurable: false, + }); + } + } } diff --git a/packages/core/src/functional/configuration.ts b/packages/core/src/functional/configuration.ts index c8585c17b018..3e980619da7f 100644 --- a/packages/core/src/functional/configuration.ts +++ b/packages/core/src/functional/configuration.ts @@ -1,82 +1,75 @@ -import { IMidwayApplication, IMidwayContainer } from '../interface'; -import { InjectionConfigurationOptions } from '../decorator'; +import { + ILifeCycle, + IMidwayApplication, + IMidwayContainer, + ObjectBeforeCreatedOptions, + ObjectBeforeDestroyOptions, + ObjectCreatedOptions, + ObjectInitOptions, + FunctionalConfigurationOptions, +} from '../interface'; +import { CONFIGURATION_OBJECT_KEY } from '../decorator'; +import { MetadataManager } from '../decorator/metadataManager'; -export class FunctionalConfiguration { - private readyHandler; - private stopHandler; - private configLoadHandler; - private serverReadyHandler; - private options: InjectionConfigurationOptions; +export class FunctionalConfiguration implements ILifeCycle { + constructor(protected options: FunctionalConfigurationOptions) {} - constructor(options: InjectionConfigurationOptions) { - this.options = options; - this.readyHandler = () => {}; - this.stopHandler = () => {}; - this.configLoadHandler = () => {}; - this.serverReadyHandler = () => {}; + async onConfigLoad( + container: IMidwayContainer, + mainApp: IMidwayApplication + ): Promise { + return this.options?.onConfigLoad?.(container, mainApp); } - onConfigLoad( - configLoadHandler: - | ((container: IMidwayContainer, app: IMidwayApplication) => any) - | IMidwayContainer, - app?: IMidwayApplication - ) { - if (typeof configLoadHandler === 'function') { - this.configLoadHandler = configLoadHandler; - } else { - return this.configLoadHandler(configLoadHandler, app); - } - return this; + async onReady(container: IMidwayContainer, mainApp: IMidwayApplication) { + return this.options?.onReady?.(container, mainApp); } - onReady( - readyHandler: - | ((container: IMidwayContainer, app: IMidwayApplication) => void) - | IMidwayContainer, - app?: IMidwayApplication + async onServerReady( + container: IMidwayContainer, + mainApp: IMidwayApplication ) { - if (typeof readyHandler === 'function') { - this.readyHandler = readyHandler; - } else { - return this.readyHandler(readyHandler, app); - } - return this; + return this.options?.onServerReady?.(container, mainApp); } - onServerReady( - serverReadyHandler: - | ((container: IMidwayContainer, app: IMidwayApplication) => void) - | IMidwayContainer, - app?: IMidwayApplication - ) { - if (typeof serverReadyHandler === 'function') { - this.serverReadyHandler = serverReadyHandler; - } else { - return this.serverReadyHandler(serverReadyHandler, app); - } - return this; + async onHealthCheck(container: IMidwayContainer) { + return this.options?.onHealthCheck?.(container); } - onStop( - stopHandler: - | ((container: IMidwayContainer, app: IMidwayApplication) => void) - | IMidwayContainer, - app?: IMidwayApplication - ) { - if (typeof stopHandler === 'function') { - this.stopHandler = stopHandler; - } else { - return this.stopHandler(stopHandler, app); - } - return this; + async onStop(container: IMidwayContainer, mainApp: IMidwayApplication) { + return this.options?.onStop?.(container, mainApp); + } + + // object lifecycle + onBeforeObjectCreated(Clzz: any, options: ObjectBeforeCreatedOptions): void { + return this.options?.onBeforeObjectCreated?.(Clzz, options); + } + + onObjectCreated(ins: T, options: ObjectCreatedOptions): void { + return this.options?.onObjectCreated?.(ins, options); + } + + onObjectInit(ins: T, options: ObjectInitOptions): void { + return this.options?.onObjectInit?.(ins, options); } - getConfigurationOptions() { - return this.options; + onBeforeObjectDestroy(ins: T, options: ObjectBeforeDestroyOptions): void { + return this.options?.onBeforeObjectDestroy?.(ins, options); } } -export const createConfiguration = (options: InjectionConfigurationOptions) => { - return new FunctionalConfiguration(options); +export const defineConfiguration = ( + options: FunctionalConfigurationOptions +) => { + const configuration = new FunctionalConfiguration(options); + MetadataManager.ensureTargetType( + configuration, + MetadataManager.ObjectType.Object + ); + MetadataManager.defineMetadata( + CONFIGURATION_OBJECT_KEY, + options, + configuration + ); + return configuration; }; diff --git a/packages/core/src/functional/hooks.ts b/packages/core/src/functional/hooks.ts new file mode 100644 index 000000000000..cbf86ae091bd --- /dev/null +++ b/packages/core/src/functional/hooks.ts @@ -0,0 +1,79 @@ +import { + getCurrentAsyncContextManager, + getCurrentMainApp, +} from '../util/contextUtil'; +import { ASYNC_CONTEXT_KEY } from '../constants'; +import { MidwayApplicationManager } from '../common/applicationManager'; +import { + ClassType, + ILogger, + IMidwayApplication, + IMidwayContainer, + MidwayConfig, +} from '../interface'; +import { MidwayConfigService } from '../service/configService'; + +export function useContext(): T | undefined { + const ctx = getCurrentAsyncContextManager() + .active() + .getValue(ASYNC_CONTEXT_KEY); + return ctx as T; +} + +export function useLogger(loggerName?: string): ILogger { + const ctx = useContext(); + if (ctx) { + if (loggerName) { + return ctx.logger.getLogger(loggerName); + } + return ctx.logger; + } else { + return useMainApp().getLogger(loggerName); + } +} + +export function usePlugin(key: string): any { + const ctx = useContext(); + return ctx ? ctx.app[key] || ctx[key] : useMainApp()[key]; +} + +export async function useInject( + identifier: ClassType | string, + args?: any[] +): Promise { + const ctx = useContext(); + const requestContext: IMidwayContainer = ctx + ? ctx['requestContext'] + : useMainApp().getApplicationContext(); + return requestContext.getAsync(identifier, args); +} + +export function useInjectSync( + identifier: ClassType | string, + args?: any[] +): T { + ``; + const ctx = useContext(); + const requestContext: IMidwayContainer = ctx + ? ctx['requestContext'] + : useMainApp().getApplicationContext(); + return requestContext.get(identifier, args); +} + +export function useConfig(key?: string): MidwayConfig { + return useMainApp() + .getApplicationContext() + .get(MidwayConfigService) + .getConfiguration(key); +} + +export function useApp(appName: string): IMidwayApplication { + const applicationManager = useMainApp() + .getApplicationContext() + .get(MidwayApplicationManager); + return applicationManager.getApplication(appName); +} + +export function useMainApp(): IMidwayApplication { + return getCurrentMainApp(); +} diff --git a/packages/core/src/functional/index.ts b/packages/core/src/functional/index.ts new file mode 100644 index 000000000000..e61ac4fbd3c8 --- /dev/null +++ b/packages/core/src/functional/index.ts @@ -0,0 +1,2 @@ +export { defineConfiguration, FunctionalConfiguration } from './configuration'; +export * from './hooks'; diff --git a/packages/core/src/index.ts b/packages/core/src/index.ts index b1ba72314526..036fbc8136e4 100644 --- a/packages/core/src/index.ts +++ b/packages/core/src/index.ts @@ -4,10 +4,6 @@ export { MidwayRequestContainer } from './context/requestContainer'; export { BaseFramework } from './baseFramework'; export * from './context/providerWrapper'; export * from './constants'; -export { - createConfiguration, - FunctionalConfiguration, -} from './functional/configuration'; export { MidwayConfigService } from './service/configService'; export { MidwayEnvironmentService } from './service/environmentService'; export { MidwayInformationService } from './service/informationService'; diff --git a/packages/core/src/interface.ts b/packages/core/src/interface.ts index 6d4ab3a8c663..cf78076873bc 100644 --- a/packages/core/src/interface.ts +++ b/packages/core/src/interface.ts @@ -1,7 +1,8 @@ import type { AsyncContextManager } from './common/asyncContextManager'; import type { LoggerFactory } from './common/loggerFactory'; -import { ManagedResolverFactory } from './context/managedResolverFactory'; +import type { ManagedResolverFactory } from './context/managedResolverFactory'; import type { EventEmitter } from 'events'; +import type { FunctionalConfiguration } from './functional'; export type ClassType = new (...args: any[]) => T; @@ -328,12 +329,6 @@ export interface IMethodAspect { around?(joinPoint: JoinPoint): any; } -export interface IModuleStore { - listModule(key: ObjectIdentifier); - saveModule(key: ObjectIdentifier, module: any); - transformModule?(moduleMap: Map>); -} - export interface TSDesignType { name: string; originDesign: OriginType; @@ -690,11 +685,12 @@ export interface IIdentifierRelationShip { getRelation(id: ObjectIdentifier): string; } -export interface IMidwayGlobalContainer extends IMidwayContainer, WithFn, IModuleStore { +export interface IMidwayGlobalContainer extends IMidwayContainer, WithFn { identifierMapping: IIdentifierRelationShip; objectCreateEventTarget: EventEmitter; - load(module: any | any[]): void; + // load(module: any | any[]): void; getNamespaceList(): string[]; + addNamespace(namespace: string): void; bind(target: T, options?: Partial): void; bind( identifier: ObjectIdentifier, @@ -702,8 +698,8 @@ export interface IMidwayGlobalContainer extends IMidwayContainer, WithFn ): void; bindClass(exports, options?: Partial): void; - setFileDetector(fileDetector: IFileDetector): void; - ready(): void | Promise; + // setFileDetector(fileDetector: IFileDetector): void; + // ready(): void | Promise; stop(): Promise; getManagedResolverFactory(): ManagedResolverFactory; } @@ -743,8 +739,8 @@ export interface IMidwayContainer extends IObjectFactory { } export interface IFileDetector { - run(container: IMidwayContainer, fileDetectorOptions?: Record): void | Promise; - setExtraDetectorOptions(detectorOptions: Record): void; + run(container: IMidwayGlobalContainer, namespace: string): Promise; + runSync(container: IMidwayGlobalContainer, namespace: string): void; } export interface IConfigService { @@ -1044,12 +1040,7 @@ export interface IMidwayBootstrapOptions { preloadModules?: any[]; imports?: any | any[]; moduleLoadType?: ModuleLoadType; - moduleDetector?: IFileDetector | false; logger?: boolean | ILogger; - /** - * @deprecated please set it from '@Configuration' decorator - */ - ignore?: string[]; globalConfig?: | Array<{ [environmentName: string]: Record }> | Record; @@ -1188,3 +1179,25 @@ export interface ServerSendEventStreamOptions { closeEvent?: string; tpl?: (data: ServerSendEventMessage, ctx: CTX) => ServerSendEventMessage; } + +export interface IComponentInfo { + component: { Configuration: ClassType } | FunctionalConfiguration; + enabledEnvironment?: string[]; +} + +export interface InjectionConfigurationOptions { + imports?: Array< + | IComponentInfo + | { Configuration: ClassType } + | FunctionalConfiguration + >; + importObjects?: Record; + importConfigs?: + | Array<{ [environmentName: string]: Record }> + | Record; + importConfigFilter?: (config: Record) => Record; + namespace?: string; + detector?: IFileDetector | false; +} + +export type FunctionalConfigurationOptions = InjectionConfigurationOptions & ILifeCycle; diff --git a/packages/core/src/legacy/decorator.ts b/packages/core/src/legacy/decorator.ts index 1d4274d14103..29014fa6d7c1 100644 --- a/packages/core/src/legacy/decorator.ts +++ b/packages/core/src/legacy/decorator.ts @@ -350,19 +350,19 @@ export function getPropertyMetadata( * save preload module by target * @param target * @since 2.0.0 - * @deprecated Use DecoratorManager.savePreloadModule instead + * @deprecated Use DecoratorManager.savePreStartModule instead */ export function savePreloadModule(target) { - return DecoratorManager.savePreloadModule(target); + return DecoratorManager.savePreStartModule(target); } /** * list preload module * @since 2.0.0 - * @deprecated Use DecoratorManager.listPreloadModule instead + * @deprecated Use DecoratorManager.listPreStartModule instead */ export function listPreloadModule(): any[] { - return DecoratorManager.listPreloadModule(); + return DecoratorManager.listPreStartModule(); } /** @@ -376,22 +376,6 @@ export function saveModule(decoratorNameKey: ObjectIdentifier, target) { return DecoratorManager.saveModule(decoratorNameKey, target); } -/** - * @since 3.0.0 - * @deprecated Use DecoratorManager.bindContainer instead - */ -export function bindContainer(container) { - return DecoratorManager.bindContainer(container); -} -/** - * Clear the container which is bound by bindContainer - * @since 3.0.0 - * @deprecated Use DecoratorManager.clearBindContainer instead - */ -export function clearBindContainer() { - return DecoratorManager.clearBindContainer(); -} - /** * list module from decorator key * @param decoratorNameKey diff --git a/packages/core/src/service/decoratorService.ts b/packages/core/src/service/decoratorService.ts index b950b96cd06e..02516f587f02 100644 --- a/packages/core/src/service/decoratorService.ts +++ b/packages/core/src/service/decoratorService.ts @@ -45,11 +45,14 @@ export class MidwayDecoratorService { protected init() { // add custom method decorator listener this.applicationContext.onBeforeBind(Clzz => { + debug(`[core]: Bind class ${Clzz.name} in decorator service`); + // find custom method decorator metadata, include method decorator information array const methodDecoratorMetadataList: MethodDecoratorMetaData[] = MetadataManager.getMetadata(CUSTOM_METHOD_INJECT_KEY, Clzz); if (methodDecoratorMetadataList) { + debug(`[core]: Find method decorator metadata in ${Clzz.name}`); // loop it, save this order for decorator run for (const meta of methodDecoratorMetadataList) { const { propertyName, key, metadata, options } = meta; @@ -84,6 +87,7 @@ export class MidwayDecoratorService { }>(CUSTOM_PARAM_INJECT_KEY, Clzz); if (parameterDecoratorMetadata) { + debug(`[core]: Find parameter decorator metadata in ${Clzz.name}`); // loop it, save this order for decorator run for (const methodName of Object.keys(parameterDecoratorMetadata)) { // add aspect implementation first diff --git a/packages/core/src/service/frameworkService.ts b/packages/core/src/service/frameworkService.ts index de5fabd7553b..6533f976b6d6 100644 --- a/packages/core/src/service/frameworkService.ts +++ b/packages/core/src/service/frameworkService.ts @@ -215,8 +215,8 @@ export class MidwayFrameworkService { */ const namespaceList = this.applicationContext.getNamespaceList(); for (const namespace of namespaceList) { - const framework = this.applicationManager.getApplication(namespace); - if (framework) { + const frameworkApp = this.applicationManager.getApplication(namespace); + if (frameworkApp) { mainNs = namespace; break; } @@ -237,6 +237,10 @@ export class MidwayFrameworkService { return this.mainFramework?.getApplication(); } + public setMainApp(namespace: string) { + this.mainFramework = this.applicationManager.getFramework(namespace); + } + public getMainFramework() { return this.mainFramework; } diff --git a/packages/core/src/service/lifeCycleService.ts b/packages/core/src/service/lifeCycleService.ts index 65bb21b46f9b..0e903d573030 100644 --- a/packages/core/src/service/lifeCycleService.ts +++ b/packages/core/src/service/lifeCycleService.ts @@ -1,18 +1,19 @@ import { ILifeCycle, IMidwayContainer, ScopeEnum } from '../interface'; import { CONFIGURATION_KEY, + CONFIGURATION_OBJECT_KEY, DecoratorManager, Init, Inject, Provide, Scope, } from '../decorator'; -import { FunctionalConfiguration } from '../functional/configuration'; import { MidwayFrameworkService } from './frameworkService'; import { MidwayConfigService } from './configService'; import { debuglog } from 'util'; import { MidwayMockService } from './mockService'; import { MidwayHealthService } from './healthService'; +import { MetadataManager } from '../decorator/metadataManager'; const debug = debuglog('midway:debug'); @Provide() @@ -53,7 +54,9 @@ export class MidwayLifeCycleService { debug(`[core]: Found Configuration length = ${cycles.length}`); for (const cycle of cycles) { - if (cycle.target instanceof FunctionalConfiguration) { + if ( + MetadataManager.hasOwnMetadata(CONFIGURATION_OBJECT_KEY, cycle.target) + ) { // 函数式写法 cycle.instance = cycle.target; } else { @@ -121,20 +124,10 @@ export class MidwayLifeCycleService { public async stop() { await this.mockService.runSimulatorTearDown(); // stop lifecycle - const cycles = DecoratorManager.listModule(CONFIGURATION_KEY) || []; - - for (const cycle of cycles.reverse()) { - let inst; - if (cycle.target instanceof FunctionalConfiguration) { - // 函数式写法 - inst = cycle.target; - } else { - inst = await this.applicationContext.getAsync(cycle.target); - } - - await this.runContainerLifeCycle(inst, 'onStop'); - } - + await this.runContainerLifeCycle( + this.lifecycleInstanceList.reverse(), + 'onStop' + ); // stop framework await this.frameworkService.stopFramework(); } diff --git a/packages/core/src/setup.ts b/packages/core/src/setup.ts index 4793ed7a1e88..24c0d0cd3345 100644 --- a/packages/core/src/setup.ts +++ b/packages/core/src/setup.ts @@ -13,21 +13,17 @@ import { MidwayApplicationManager, MidwayMockService, MidwayWebRouterService, - ESModuleFileDetector, - CommonJSFileDetector, - loadModule, - safeRequire, - isTypeScriptEnvironment, MidwayPriorityManager, DecoratorManager, - IModuleStore, IMidwayGlobalContainer, } from './'; import defaultConfig from './config/config.default'; import * as util from 'util'; import { MidwayServerlessFunctionService } from './service/slsFunctionService'; -import { join } from 'path'; import { MidwayHealthService } from './service/healthService'; +import { ComponentConfigurationLoader } from './context/componentLoader'; +import { findProjectEntryFile, findProjectEntryFileSync } from './util'; +import { AsyncLocalStorageContextManager } from './common/asyncContextManager'; const debug = util.debuglog('midway:debug'); let stepIdx = 1; @@ -82,12 +78,12 @@ export async function initializeGlobalApplicationContext( applicationContext, ]); - printStepDebugInfo('Init preload modules'); + printStepDebugInfo('Init pre-start modules'); - // some preload module init - const modules = DecoratorManager.listPreloadModule(); + // some pre-start module init + const modules = DecoratorManager.listPreStartModule(); for (const module of modules) { - // preload init context + // pre-start init context await applicationContext.getAsync(module); } @@ -109,7 +105,6 @@ export async function destroyGlobalApplicationContext( await lifecycleService.stop(); // stop container await applicationContext.stop(); - DecoratorManager.clearBindContainer(); loggerFactory.close(); global['MIDWAY_APPLICATION_CONTEXT'] = undefined; global['MIDWAY_MAIN_FRAMEWORK'] = undefined; @@ -135,9 +130,6 @@ export async function prepareGlobalApplicationContextAsync( // new container const applicationContext = globalOptions.applicationContext ?? new MidwayContainer(); - // bind container to decoratorManager - debug('[core]: delegate module map from decoratorManager'); - DecoratorManager.bindContainer(applicationContext); global['MIDWAY_APPLICATION_CONTEXT'] = applicationContext; @@ -145,54 +137,25 @@ export async function prepareGlobalApplicationContextAsync( applicationContext.registerObject('baseDir', baseDir); applicationContext.registerObject('appDir', appDir); - debug('[core]: set default file detector'); + if (!globalOptions.asyncContextManager) { + globalOptions.asyncContextManager = new AsyncLocalStorageContextManager(); + } + + debug('[core]: set default module load type and entry file'); if (!globalOptions.moduleLoadType) { globalOptions.moduleLoadType = 'commonjs'; } - // set module detector - if (globalOptions.moduleDetector !== false) { - debug('[core]: set module load type = %s', globalOptions.moduleLoadType); - - // set default entry file - if (!globalOptions.imports) { - globalOptions.imports = [ - await loadModule( - join( - baseDir, - `configuration${isTypeScriptEnvironment() ? '.ts' : '.js'}` - ), - { - loadMode: globalOptions.moduleLoadType, - safeLoad: true, - } - ), - ]; - } - if (globalOptions.moduleDetector === undefined) { - if (globalOptions.moduleLoadType === 'esm') { - applicationContext.setFileDetector( - new ESModuleFileDetector({ - loadDir: baseDir, - ignore: globalOptions.ignore ?? [], - }) - ); - globalOptions.moduleLoadType = 'esm'; - } else { - applicationContext.setFileDetector( - new CommonJSFileDetector({ - loadDir: baseDir, - ignore: globalOptions.ignore ?? [], - }) - ); - } - } - } + // set entry file + globalOptions.imports = [ + ...(globalOptions.imports ?? []), + await findProjectEntryFile(appDir, baseDir, globalOptions.moduleLoadType), + ]; - printStepDebugInfo('Binding inner service'); + printStepDebugInfo('Binding built-in service'); - // bind inner service + // bind built-in service applicationContext.bindClass(MidwayEnvironmentService); applicationContext.bindClass(MidwayInformationService); applicationContext.bindClass(MidwayAspectService); @@ -209,15 +172,6 @@ export async function prepareGlobalApplicationContextAsync( applicationContext.bindClass(MidwayHealthService); applicationContext.bindClass(MidwayPriorityManager); - printStepDebugInfo('Binding preload module'); - - // bind preload module - if (globalOptions.preloadModules && globalOptions.preloadModules.length) { - for (const preloadModule of globalOptions.preloadModules) { - applicationContext.bindClass(preloadModule); - } - } - printStepDebugInfo( 'Init MidwayConfigService, MidwayAspectService and MidwayDecoratorService' ); @@ -240,18 +194,35 @@ export async function prepareGlobalApplicationContextAsync( // init decorator service applicationContext.get(MidwayDecoratorService, [applicationContext]); + printStepDebugInfo('Binding preload module'); + + // bind preload module + if (globalOptions.preloadModules && globalOptions.preloadModules.length) { + for (const preloadModule of globalOptions.preloadModules) { + applicationContext.bindClass(preloadModule); + } + } + printStepDebugInfo( 'Load imports(component) and user code configuration module' ); - applicationContext.load( - [].concat(globalOptions.imports).concat(globalOptions.configurationModule) + // load configuration + const componentConfigurationLoader = new ComponentConfigurationLoader( + applicationContext ); + const importModules = [...(globalOptions.imports ?? [])]; - printStepDebugInfo('Run applicationContext ready method'); + for (const mod of importModules) { + if (mod) { + await componentConfigurationLoader.load(mod); + } + } - // bind user code module - await applicationContext.ready(); + for (const ns of componentConfigurationLoader.getNamespaceList()) { + applicationContext.addNamespace(ns); + debug(`[core]: load configuration in namespace="${ns}" complete`); + } if (globalOptions.globalConfig) { if (Array.isArray(globalOptions.globalConfig)) { @@ -289,9 +260,6 @@ export function prepareGlobalApplicationContext( // new container const applicationContext = globalOptions.applicationContext ?? new MidwayContainer(); - // bind container to decoratorManager - debug('[core]: delegate module map from decoratorManager'); - DecoratorManager.bindContainer(applicationContext as IModuleStore); global['MIDWAY_APPLICATION_CONTEXT'] = applicationContext; @@ -299,27 +267,25 @@ export function prepareGlobalApplicationContext( applicationContext.registerObject('baseDir', baseDir); applicationContext.registerObject('appDir', appDir); - printStepDebugInfo('Ready module detector'); + if (!globalOptions.asyncContextManager) { + globalOptions.asyncContextManager = new AsyncLocalStorageContextManager(); + } + + debug('[core]: set default module load type and entry file'); if (!globalOptions.moduleLoadType) { globalOptions.moduleLoadType = 'commonjs'; } - if (globalOptions.moduleDetector !== false) { - if (globalOptions.moduleDetector === undefined) { - applicationContext.setFileDetector( - new CommonJSFileDetector({ - ignore: globalOptions.ignore ?? [], - }) - ); - } else if (globalOptions.moduleDetector) { - applicationContext.setFileDetector(globalOptions.moduleDetector); - } - } + // set entry file + globalOptions.imports = [ + ...(globalOptions.imports ?? []), + findProjectEntryFileSync(appDir, baseDir), + ]; - printStepDebugInfo('Binding inner service'); + printStepDebugInfo('Binding built-in service'); - // bind inner service + // bind built-in service applicationContext.bindClass(MidwayEnvironmentService); applicationContext.bindClass(MidwayInformationService); applicationContext.bindClass(MidwayAspectService); @@ -336,15 +302,6 @@ export function prepareGlobalApplicationContext( applicationContext.bindClass(MidwayHealthService); applicationContext.bindClass(MidwayPriorityManager); - printStepDebugInfo('Binding preload module'); - - // bind preload module - if (globalOptions.preloadModules && globalOptions.preloadModules.length) { - for (const preloadModule of globalOptions.preloadModules) { - applicationContext.bindClass(preloadModule); - } - } - printStepDebugInfo( 'Init MidwayConfigService, MidwayAspectService and MidwayDecoratorService' ); @@ -367,24 +324,35 @@ export function prepareGlobalApplicationContext( // init decorator service applicationContext.get(MidwayDecoratorService, [applicationContext]); + printStepDebugInfo('Binding preload module'); + + // bind preload module + if (globalOptions.preloadModules && globalOptions.preloadModules.length) { + for (const preloadModule of globalOptions.preloadModules) { + applicationContext.bindClass(preloadModule); + } + } + printStepDebugInfo( 'Load imports(component) and user code configuration module' ); - if (!globalOptions.imports) { - globalOptions.imports = [ - safeRequire(join(globalOptions.baseDir, 'configuration')), - ]; - } - - applicationContext.load( - [].concat(globalOptions.imports).concat(globalOptions.configurationModule) + // load configuration + const componentConfigurationLoader = new ComponentConfigurationLoader( + applicationContext ); + const importModules = [...(globalOptions.imports ?? [])]; - printStepDebugInfo('Run applicationContext ready method'); + for (const mod of importModules) { + if (mod) { + componentConfigurationLoader.loadSync(mod); + } + } - // bind user code module - applicationContext.ready(); + for (const ns of componentConfigurationLoader.getNamespaceList()) { + applicationContext.addNamespace(ns); + debug(`[core]: load configuration in namespace="${ns}" complete`); + } if (globalOptions.globalConfig) { if (Array.isArray(globalOptions.globalConfig)) { diff --git a/packages/core/src/util/httpclient.ts b/packages/core/src/util/httpclient.ts index adec6f44222e..8a978ac3ed6d 100644 --- a/packages/core/src/util/httpclient.ts +++ b/packages/core/src/util/httpclient.ts @@ -1,6 +1,6 @@ -import http = require('http'); -import https = require('https'); -import url = require('url'); +import * as http from 'http'; +import * as https from 'https'; +import * as url from 'url'; import { debuglog } from 'util'; import { MidwayUtilHttpClientTimeoutError } from '../error'; diff --git a/packages/core/src/util/index.ts b/packages/core/src/util/index.ts index 46bab243b488..90ca15665b2b 100644 --- a/packages/core/src/util/index.ts +++ b/packages/core/src/util/index.ts @@ -1,7 +1,6 @@ -import { dirname, resolve, sep, posix } from 'path'; +import { dirname, resolve, sep, posix, join } from 'path'; import { readFileSync } from 'fs'; import { debuglog } from 'util'; -import * as transformer from 'class-transformer'; import { PathToRegexpUtil } from './pathToRegexp'; import { MidwayCodeInvokeTimeoutError, MidwayCommonError } from '../error'; import { FunctionMiddleware, IgnoreMatcher } from '../interface'; @@ -11,6 +10,9 @@ import { safeParse, safeStringify } from './flatted'; import * as crypto from 'crypto'; import { Types } from './types'; import { pathToFileURL } from 'url'; +import { normalizePath } from './pathFileUtil'; +import { MetadataManager } from '../decorator/metadataManager'; +import { CONFIGURATION_KEY, CONFIGURATION_OBJECT_KEY } from '../decorator'; const debug = debuglog('midway:debug'); @@ -67,6 +69,7 @@ export const loadModule = async ( enableCache?: boolean; loadMode?: 'commonjs' | 'esm'; safeLoad?: boolean; + warnOnLoadError?: boolean; } = {} ) => { options.enableCache = options.enableCache ?? true; @@ -114,6 +117,51 @@ 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; + } + } +}; + +/** + * load module sync, and it must be commonjs mode + * @param p + * @param options + */ +export const loadModuleSync = ( + p: string, + options: { + enableCache?: boolean; + safeLoad?: boolean; + warnOnLoadError?: boolean; + } = {} +) => { + options.enableCache = options.enableCache ?? true; + options.safeLoad = options.safeLoad ?? false; + + if (p.startsWith(`.${sep}`) || p.startsWith(`..${sep}`)) { + p = resolve(dirname(module.parent.filename), p); + } + + try { + if (options.enableCache) { + return require(p); + } else { + const content = readFileSync(p, { + encoding: 'utf-8', + }); + return JSON.parse(content); + } + } catch (err) { + 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; } @@ -315,16 +363,7 @@ export const transformRequestObjectByType = (originValue: any, targetType?) => { } return Boolean(originValue); default: - if (originValue instanceof targetType) { - return originValue; - } else { - const transformToInstance = - transformer['plainToClass'] || transformer['plainToInstance']; - return transformToInstance( - targetType, - originValue - ) as typeof originValue; - } + return originValue; } }; @@ -630,6 +669,141 @@ export async function createPromiseTimeoutInvokeChain(options: { } } +function getFileNameWithSuffix(fileName: string) { + return isTypeScriptEnvironment() ? `${fileName}.ts` : `${fileName}.js`; +} + +export function isConfigurationExport(exports): boolean { + return ( + (Types.isClass(exports) && + MetadataManager.hasOwnMetadata(CONFIGURATION_KEY, exports)) || + (Types.isObject(exports) && + MetadataManager.hasOwnMetadata(CONFIGURATION_OBJECT_KEY, exports)) + ); +} + +export async function findProjectEntryFile( + appDir: string, + baseDir: string, + loadMode: 'commonjs' | 'esm' +) { + /** + * 查找常用文件中的 midway 入口,入口文件包括 Configuration 对象或者 defineConfiguration 函数 + */ + async function containsConfiguration(filePath: string) { + // 加载文件 + const content = await loadModule(filePath, { + safeLoad: true, + loadMode, + warnOnLoadError: true, + }); + + if (content && isConfigurationExport(content)) { + debug(`[core]: find configuration file ${filePath}`); + return content; + } else { + for (const m in content) { + const module = content[m]; + if (isConfigurationExport(module)) { + debug(`[core]: find configuration file ${filePath}`); + return content; + } + } + } + } + + // 1. 找 src/configuration.ts 或 src/configuration.js + const configurationFile = await containsConfiguration( + join(baseDir, getFileNameWithSuffix('configuration')) + ); + + if (configurationFile) { + return configurationFile; + } + + // 2. 找 src/index.ts 或 src/index.js + const indexFile = await containsConfiguration( + join(baseDir, getFileNameWithSuffix('index')) + ); + if (indexFile) { + return indexFile; + } + + // 3. 找 package.json 中的 main 字段 + if (appDir) { + const pkgJSON = await loadModule(join(appDir, 'package.json'), { + safeLoad: true, + enableCache: false, + }); + if (pkgJSON?.['main']) { + const configuration = await containsConfiguration( + normalizePath(appDir, pkgJSON['main']) + ); + if (configuration) { + return configuration; + } + } + } +} + +export function findProjectEntryFileSync(appDir: string, baseDir: string) { + /** + * 查找常用文件中的 midway 入口,入口文件包括 Configuration 对象或者 defineConfiguration 函数 + */ + function containsConfiguration(filePath: string) { + // 加载文件 + const content = loadModuleSync(filePath, { + safeLoad: true, + warnOnLoadError: true, + }); + if (content && isConfigurationExport(content)) { + debug(`[core]: find configuration file ${filePath}`); + return content; + } else { + for (const m in content) { + const module = content[m]; + if (isConfigurationExport(module)) { + debug(`[core]: find configuration file ${filePath}`); + return content; + } + } + } + } + + // 1. 找 src/configuration.ts 或 src/configuration.js + const configurationFile = containsConfiguration( + join(baseDir, getFileNameWithSuffix('configuration')) + ); + + if (configurationFile) { + return configurationFile; + } + + // 2. 找 src/index.ts 或 src/index.js + const indexFile = containsConfiguration( + join(baseDir, getFileNameWithSuffix('index')) + ); + if (indexFile) { + return indexFile; + } + + if (appDir) { + // 3. 找 package.json 中的 main 字段 + const pkgJSON = loadModuleSync(join(appDir, 'package.json'), { + safeLoad: true, + enableCache: false, + }); + if (pkgJSON?.['main']) { + const configuration = containsConfiguration( + normalizePath(appDir, pkgJSON['main']) + ); + if (configuration) { + return configuration; + } + } + } +} + export const Utils = { sleep, getParamNames, diff --git a/packages/core/src/util/pathFileUtil.ts b/packages/core/src/util/pathFileUtil.ts index 2aaa338e3b45..d6ef55711b2a 100644 --- a/packages/core/src/util/pathFileUtil.ts +++ b/packages/core/src/util/pathFileUtil.ts @@ -1,4 +1,4 @@ -import { extname } from 'path'; +import { extname, isAbsolute, resolve } from 'path'; import { readFileSync } from 'fs'; export function isPath(p): boolean { @@ -25,11 +25,25 @@ export function getFileContentSync(filePath: any, encoding?: BufferEncoding) { : filePath; } -export const PathFileUtil = { - isPath, - isPathEqual, - getFileContentSync, -}; +/** + * Normalize path, if p is absolute path, return p, otherwise join p with baseDir + * + * @example + * ```ts + * normalizePath('/a/b', 'c') => '/a/b/c' + * normalizePath('/a/b', '/c') => '/c' + * ``` + * + * @param baseDir + * @param p + */ +export function normalizePath(baseDir, p) { + if (isAbsolute(p)) { + return p; + } else { + return resolve(baseDir, p); + } +} export function getModuleRequirePathList(moduleName: string): string[] { const moduleNameList = [moduleName, moduleName.replace(/\//g, '_')]; @@ -57,3 +71,9 @@ export function getModuleRequirePathList(moduleName: string): string[] { moduleNameMap = undefined; return modulePathList; } + +export const PathFileUtil = { + isPath, + isPathEqual, + getFileContentSync, +}; diff --git a/packages/core/test/baseFramework.test.ts b/packages/core/test/baseFramework.test.ts index a9351479d0e6..72a6b16c2693 100644 --- a/packages/core/test/baseFramework.test.ts +++ b/packages/core/test/baseFramework.test.ts @@ -397,6 +397,7 @@ describe('/test/baseFramework.test.ts', () => { './fixtures/app-with-functional-component/src' )); expect(framework.getConfiguration('a')).toEqual(1); + expect(framework.getApplicationContext().getNamespaceList()).toEqual(['hooks', 'empty']); await framework.stop(); @@ -570,7 +571,7 @@ describe('/test/baseFramework.test.ts', () => { )); const applicationContext: any = framework.getApplicationContext(); - await applicationContext.getAsync('userService'); + await applicationContext.getAsync('userService2'); expect(framework.getApplication().getAttr('total')).toEqual(10); }); @@ -717,8 +718,10 @@ describe('/test/baseFramework.test.ts', () => { it('should test throw framework sequence error', async () => { const applicationContext = await createFramework(path.join( __dirname, - './fixtures/app-with-multi-framework-sequence-error/src' - )); + './fixtures/app-with-multi-framework-sequence-error/src', + ), undefined, undefined, { + defaultDetector: false, + }); const midwayFrameworkService = applicationContext.get(MidwayFrameworkService); diff --git a/packages/async-hooks-context-manager/test/asyncLocalStorageContextManager.test.ts b/packages/core/test/common/asyncContextManager.test.ts similarity index 99% rename from packages/async-hooks-context-manager/test/asyncLocalStorageContextManager.test.ts rename to packages/core/test/common/asyncContextManager.test.ts index eac3d2bc5e9e..98cf56bf3260 100644 --- a/packages/async-hooks-context-manager/test/asyncLocalStorageContextManager.test.ts +++ b/packages/core/test/common/asyncContextManager.test.ts @@ -15,10 +15,8 @@ */ import * as assert from 'assert'; -import { - AsyncLocalStorageContextManager, -} from '../src'; -import { ASYNC_ROOT_CONTEXT } from '@midwayjs/core'; +import { ASYNC_ROOT_CONTEXT, AsyncLocalStorageContextManager } from '../../src/common/asyncContextManager'; + /** Get a key to uniquely identify a context value */ function createContextKey(description: string) { diff --git a/packages/core/test/common/detector.test.ts b/packages/core/test/common/detector.test.ts index b44a3c63652d..1c954ea9a6ec 100644 --- a/packages/core/test/common/detector.test.ts +++ b/packages/core/test/common/detector.test.ts @@ -7,11 +7,10 @@ describe('test/common/detector.test.ts', function () { loadDir: join(__dirname, './glob_dir'), pattern: '', ignore: '', - namespace: 'test', conflictCheck: true, }); const container = new MidwayContainer(); - await detector.run(container); + await detector.run(container, 'test'); }); it('should test file detector with conflict', async () => { @@ -19,16 +18,13 @@ describe('test/common/detector.test.ts', function () { loadDir: join(__dirname, './glob_dir_conflict'), pattern: '', ignore: '', - namespace: 'test', - }); - detector.setExtraDetectorOptions({ conflictCheck: true, }); const container = new MidwayContainer(); let err; try { - await detector.run(container); + await detector.run(container, 'test'); } catch (e) { err = e; } diff --git a/packages/core/test/context/applicationContext.test.ts b/packages/core/test/context/applicationContext.test.ts index d75ab5a2e935..ae20e8749a34 100644 --- a/packages/core/test/context/applicationContext.test.ts +++ b/packages/core/test/context/applicationContext.test.ts @@ -79,8 +79,6 @@ describe('/test/context/applicationContext.test.ts', () => { app.registry.registerDefinition(definition.id, definition); app.registry.registerDefinition(definition1.id, definition1); - await app.ready(); - const d: any = await app.getAsync('hello2'); expect(d).toBeDefined() expect(d.aa).toEqual(123); diff --git a/packages/core/test/context/componentLoader.test.ts b/packages/core/test/context/componentLoader.test.ts new file mode 100644 index 000000000000..0906696e0c88 --- /dev/null +++ b/packages/core/test/context/componentLoader.test.ts @@ -0,0 +1,155 @@ +import { ComponentConfigurationLoader } from '../../src/context/componentLoader'; +import { + MidwayContainer, + Configuration, + MidwayConfigService, + MidwayInformationService, + MidwayEnvironmentService, + Provide, + CustomModuleDetector +} from '../../src'; +import { defineConfiguration } from '../../src/functional'; + +describe('ComponentConfigurationLoader.test.ts', () => { + + it('should load configuration with namespace', async () => { + @Configuration({ + namespace: 'test' + }) + class TestConfiguration {} + + const container = new MidwayContainer(); + const loader = new ComponentConfigurationLoader(container); + + await loader.load(TestConfiguration) + expect(loader.getNamespaceList()).toContain('test'); + }); + + it('should load functional configuration', async () => { + const config = defineConfiguration({ + namespace: 'test' + }); + const container = new MidwayContainer(); + const loader = new ComponentConfigurationLoader(container); + await loader.load(config) + expect(loader.getNamespaceList()).toContain('test'); + }); + + it('should load configuration multi-level', async () => { + @Configuration({ + namespace: 'test' + }) + class TestConfiguration {} + + @Configuration({ + namespace: 'test2', + imports: [{ Configuration: TestConfiguration }] + }) + class TestConfiguration2 {} + + const container = new MidwayContainer(); + const loader = new ComponentConfigurationLoader(container); + await loader.load(TestConfiguration2); + expect(loader.getNamespaceList()).toContain('test'); + expect(loader.getNamespaceList()).toContain('test2'); + }); + + it('should load configuration with importConfigs', async () => { + @Configuration({ + namespace: 'test', + importConfigs: [{ default: { a: 1 } }] + }) + class TestConfiguration {} + + const container = new MidwayContainer(); + container.bind(MidwayConfigService); + container.bind(MidwayInformationService); + container.bind(MidwayEnvironmentService); + container.registerObject('appDir', './'); + container.registerObject('baseDir', './'); + + const configService = await container.getAsync(MidwayConfigService); + const loader = new ComponentConfigurationLoader(container); + await loader.load(TestConfiguration); + + configService.load(); + + expect(configService.getConfiguration('a')).toEqual(1); + }); + + it('should load configuration with importConfigFilter', async () => { + @Configuration({ + namespace: 'test', + importConfigFilter: (config) => { + config.a = 2; + return config; + }, + importConfigs: [{ default: { a: 1 } }] + }) + class TestConfiguration {} + + const container = new MidwayContainer(); + container.bind(MidwayConfigService); + container.bind(MidwayInformationService); + container.bind(MidwayEnvironmentService); + container.registerObject('appDir', './'); + container.registerObject('baseDir', './'); + + const configService = await container.getAsync(MidwayConfigService); + const loader = new ComponentConfigurationLoader(container); + await loader.load(TestConfiguration); + + configService.load(); + + expect(configService.getConfiguration('a')).toEqual(2); + }); + + it('should load configuration with importObjects', async () => { + @Configuration({ + namespace: 'test', + importObjects: { a: 1 } + }) + class TestConfiguration {} + + const container = new MidwayContainer(); + const loader = new ComponentConfigurationLoader(container); + await loader.load(TestConfiguration); + + expect(container.get('a')).toEqual(1); + }); + + it('should load configuration with imports', async () => { + @Configuration({ + namespace: 'test', + imports: [{ Configuration: TestConfiguration }] + }) + class TestConfiguration {} + + const container = new MidwayContainer(); + const loader = new ComponentConfigurationLoader(container); + await loader.load(TestConfiguration); + + expect(loader.getNamespaceList()).toContain('test'); + }); + + it('should load configuration with detector', async () => { + @Provide() + class Test { + a = 1; + } + + @Configuration({ + namespace: 'test', + detector: new CustomModuleDetector({ + modules: [Test] + }), + }) + class TestConfiguration {} + + const container = new MidwayContainer(); + const loader = new ComponentConfigurationLoader(container); + await loader.load(TestConfiguration); + + expect(container.get(Test).a).toEqual(1); + }); +}); diff --git a/packages/core/test/context/midwayContainer.test.ts b/packages/core/test/context/midwayContainer.test.ts index 35c0a2679790..47b0257f1aa5 100644 --- a/packages/core/test/context/midwayContainer.test.ts +++ b/packages/core/test/context/midwayContainer.test.ts @@ -24,10 +24,13 @@ import { MidwayApplicationManager, sleep, Init, + Configuration, } from '../../src'; import { App } from '../fixtures/ts-app-inject/app'; import { TestCons } from '../fixtures/ts-app-inject/test'; import * as assert from 'assert'; +import { ComponentConfigurationLoader } from '../../src/context/componentLoader'; +import { defineConfiguration } from '../../src/functional'; function buildLoadDir(arr, baseDir) { return arr.map(dir => { @@ -46,17 +49,25 @@ describe('/test/context/midwayContainer.test.ts', () => { it('should create new loader', async () => { const container = new MidwayContainer(); - container.setFileDetector(new CommonJSFileDetector({ - loadDir: buildLoadDir(['app', 'lib', '../test_other'], path.join(__dirname, '../fixtures/base-app/src')), - })); - await container.ready(); + const loader = new ComponentConfigurationLoader(container) + + await loader.load(defineConfiguration({ + detector: new CommonJSFileDetector({ + loadDir: buildLoadDir(['app', 'lib', '../test_other'], path.join(__dirname, '../fixtures/base-app/src')), + conflictCheck: true + }) + })) + assert.ok(typeof (await container.getAsync('testOther'))); }); it('should load ts file and use config, plugin decorator', async () => { const container = new MidwayContainer(); - container.setFileDetector(new CommonJSFileDetector({ - loadDir: path.join(__dirname, '../fixtures/base-app-decorator/src') + const loader = new ComponentConfigurationLoader(container) + await loader.load(defineConfiguration({ + detector: new CommonJSFileDetector({ + loadDir: path.join(__dirname, '../fixtures/base-app-decorator/src') + }), })); container.bind(MidwayFrameworkService); @@ -91,7 +102,6 @@ describe('/test/context/midwayContainer.test.ts', () => { frameworkService.registerPropertyHandler(LOGGER_KEY, (key, meta) => { return console; }); - await container.ready(); const appCtx = container; const baseService: any = await appCtx.getAsync('baseService'); assert.ok(baseService.config === 'hello'); @@ -109,10 +119,16 @@ describe('/test/context/midwayContainer.test.ts', () => { }); it('should load ts file and bindapp success', async () => { + @Configuration({ + detector: new CommonJSFileDetector({ + loadDir: path.join(__dirname, '../fixtures/base-app-forbindapp/src') + }), + }) + class MainConfiguration {} + const container = new MidwayContainer(); - container.setFileDetector(new CommonJSFileDetector({ - loadDir: path.join(__dirname, '../fixtures/base-app-forbindapp/src') - })); + const loader = new ComponentConfigurationLoader(container); + await loader.load(MainConfiguration); const tt: any = { getBaseDir() { @@ -152,7 +168,6 @@ describe('/test/context/midwayContainer.test.ts', () => { frameworkService.registerPropertyHandler(LOGGER_KEY, (key, target) => { return console; }); - await container.ready(); const appCtx = container; const baseService: any = await appCtx.getAsync('baseService'); assert.ok(baseService.config === 'hello'); @@ -162,10 +177,17 @@ describe('/test/context/midwayContainer.test.ts', () => { }); it('load ts file support constructor inject', async () => { + @Configuration({ + detector: new CommonJSFileDetector({ + loadDir: path.join(__dirname, '../fixtures/base-app-constructor/src'), + }), + }) + class MainConfiguration {} + const container = new MidwayContainer(); - container.setFileDetector(new CommonJSFileDetector({ - loadDir: path.join(__dirname, '../fixtures/base-app-constructor/src'), - })); + const loader = new ComponentConfigurationLoader(container); + await loader.load(MainConfiguration); + container.bind(MidwayFrameworkService); container.bind(MidwayConfigService); container.bind(MidwayLoggerService); @@ -192,8 +214,6 @@ describe('/test/context/midwayContainer.test.ts', () => { return console; }); - await container.ready(); - const context = { logger: console }; const requestCtx = new MidwayRequestContainer( context, @@ -207,10 +227,17 @@ describe('/test/context/midwayContainer.test.ts', () => { }); it('should auto load function file and inject by function name', async () => { + @Configuration({ + detector: new CommonJSFileDetector({ + loadDir: path.join(__dirname, '../fixtures/base-app-function/src'), + }), + }) + class MainConfiguration {} + const container = new MidwayContainer(); - container.setFileDetector(new CommonJSFileDetector({ - loadDir: path.join(__dirname, '../fixtures/base-app-function/src'), - })); + const loader = new ComponentConfigurationLoader(container); + await loader.load(MainConfiguration); + container.bind(MidwayFrameworkService); container.bind(MidwayConfigService); container.bind(MidwayLoggerService); @@ -236,9 +263,6 @@ describe('/test/context/midwayContainer.test.ts', () => { frameworkService.registerPropertyHandler(LOGGER_KEY, key => { return console; }); - - await container.ready(); - const context = { logger: console }; const requestCtx = new MidwayRequestContainer( context, @@ -249,12 +273,16 @@ describe('/test/context/midwayContainer.test.ts', () => { }); it('should scan app dir and inject automatic', async () => { - const container = new MidwayContainer(); - container.setFileDetector(new CommonJSFileDetector({ - loadDir: path.join(__dirname, '../fixtures/ts-app-inject') - })); + @Configuration({ + detector: new CommonJSFileDetector({ + loadDir: path.join(__dirname, '../fixtures/ts-app-inject'), + }), + }) + class MainConfiguration {} - await container.ready(); + const container = new MidwayContainer(); + const loader = new ComponentConfigurationLoader(container); + await loader.load(MainConfiguration); const tt = container.get('testCons'); expect(tt.ts).toBeGreaterThan(0); diff --git a/packages/core/test/decorator/common/configuration.test.ts b/packages/core/test/decorator/common/configuration.test.ts index 081433843846..4bc54f3b3f3a 100644 --- a/packages/core/test/decorator/common/configuration.test.ts +++ b/packages/core/test/decorator/common/configuration.test.ts @@ -3,11 +3,8 @@ import { Configuration, getClassMetadata, CONFIGURATION_KEY } from '../../../src @Configuration({ importConfigs: ['./config.default'], importObjects: { aa: { bb: 1 } }, - imports: ['./nodes'], + imports: [], namespace: 'hello', - detectorOptions: { - a: 1 - } }) class Test {} @@ -20,14 +17,13 @@ describe('/test/annotation/configuration.test.ts', () => { expect(meta).toStrictEqual({ importConfigs: ['./config.default'], importObjects: { aa: { bb: 1 } }, - imports: ['./nodes'], + imports: [], namespace: 'hello', - detectorOptions: { - a: 1 - }, }); const metaone = getClassMetadata(CONFIGURATION_KEY, TestOne); - expect(metaone).toStrictEqual({}); + expect(metaone).toStrictEqual({ + "namespace": "__main__" + }); }); }); diff --git a/packages/core/test/decorator/decoratorManager.test.ts b/packages/core/test/decorator/decoratorManager.test.ts index 7115a85ad80a..fca8a43d5764 100644 --- a/packages/core/test/decorator/decoratorManager.test.ts +++ b/packages/core/test/decorator/decoratorManager.test.ts @@ -1,8 +1,7 @@ import { DecoratorManager, Provide, - MidwayContainer, - PRELOAD_MODULE_KEY, + PRE_START_MODULE_KEY, MetadataManager, CUSTOM_PARAM_INJECT_KEY, CUSTOM_METHOD_INJECT_KEY, @@ -16,12 +15,12 @@ describe('/test/decoratorManager.test.ts', () => { it('should save and list preload module', () => { class TestClass {} - DecoratorManager.savePreloadModule(TestClass); - let modules = DecoratorManager.listPreloadModule(); + DecoratorManager.savePreStartModule(TestClass); + let modules = DecoratorManager.listPreStartModule(); expect(modules).toContain(TestClass); - DecoratorManager.resetModule(PRELOAD_MODULE_KEY); - modules = DecoratorManager.listPreloadModule(); + DecoratorManager.resetModule(PRE_START_MODULE_KEY); + modules = DecoratorManager.listPreStartModule(); expect(modules).toHaveLength(0); }); @@ -35,13 +34,6 @@ describe('/test/decoratorManager.test.ts', () => { expect(nothings).toHaveLength(0); }); - it('should bind and clear container', () => { - const mockContainer = new MidwayContainer(); - DecoratorManager.bindContainer(mockContainer); - DecoratorManager.clearBindContainer(); - expect(DecoratorManager['container']).toBeNull(); - }); - it('should save and get provider id', () => { class TestClass {} DecoratorManager.saveProviderId('testId', TestClass); diff --git a/packages/core/test/decorator/framework/__snapshots__/config.test.ts.snap b/packages/core/test/decorator/framework/__snapshots__/config.test.ts.snap index 34ef965db1bb..971d64f809a3 100644 --- a/packages/core/test/decorator/framework/__snapshots__/config.test.ts.snap +++ b/packages/core/test/decorator/framework/__snapshots__/config.test.ts.snap @@ -2,6 +2,18 @@ exports[`/test/framework/config.test.ts config decorator should be ok 1`] = ` { + "allConfig": [ + { + "key": "config", + "metadata": { + "identifier": "common:all_value_key", + }, + "options": { + "impl": true, + }, + "propertyName": "allConfig", + }, + ], "bbb": [ { "key": "config", diff --git a/packages/core/test/decorator/framework/config.test.ts b/packages/core/test/decorator/framework/config.test.ts index 22c3e6770f07..01575aeed762 100644 --- a/packages/core/test/decorator/framework/config.test.ts +++ b/packages/core/test/decorator/framework/config.test.ts @@ -1,4 +1,5 @@ import { + AllConfig, Config, INJECT_CUSTOM_PROPERTY, MetadataManager @@ -10,6 +11,9 @@ class Test { @Config('bbb') bbb: any; + + @AllConfig() + allConfig: any; } describe('/test/framework/config.test.ts', () => { diff --git a/packages/core/test/feature.test.ts b/packages/core/test/feature.test.ts index af94a36fa10a..7dcea544a7e5 100644 --- a/packages/core/test/feature.test.ts +++ b/packages/core/test/feature.test.ts @@ -24,7 +24,9 @@ describe('/test/feature.test.ts', () => { const framework = await createLightFramework(join( __dirname, './fixtures/app-with-configuration-detector/src' - )); + ), {}, { + defaultDetector: false, + }); const b = framework.getApplicationContext().get('controllerB'); expect(b).toBeDefined(); @@ -44,6 +46,17 @@ describe('/test/feature.test.ts', () => { expect(process.env.RUN_READY_FLAG).toEqual('b'); await framework.stop(); expect(process.env.RUN_STOP_FLAG).toEqual('a'); + + process.env.RUN_READY_FLAG = ''; + process.env.RUN_STOP_FLAG = ''; + const framework2 = await createLightFramework(join( + __dirname, + './fixtures/base-app-configuration-stop-reverse/src' + )); + + expect(process.env.RUN_READY_FLAG).toEqual('b'); + await framework2.stop(); + expect(process.env.RUN_STOP_FLAG).toEqual('a'); }); it('should test health check service', async () => { diff --git a/packages/core/test/fixtures/app-with-configuration-detector/src/configuration.ts b/packages/core/test/fixtures/app-with-configuration-detector/src/configuration.ts index 3b9b83c3b70f..d6b7cce95c81 100644 --- a/packages/core/test/fixtures/app-with-configuration-detector/src/configuration.ts +++ b/packages/core/test/fixtures/app-with-configuration-detector/src/configuration.ts @@ -1,8 +1,8 @@ -import { Configuration } from '../../../../src'; +import { CommonJSFileDetector, Configuration } from '../../../../src'; @Configuration({ - detectorOptions: { + detector: new CommonJSFileDetector({ ignore: ['**/testing/**'] - } + }), }) export class AutoConfiguration {} diff --git a/packages/core/test/fixtures/app-with-conflict/base-app-decorator/src/configuration.ts b/packages/core/test/fixtures/app-with-conflict/base-app-decorator/src/configuration.ts index 757c7a89c7a9..cbf9becfdb4c 100644 --- a/packages/core/test/fixtures/app-with-conflict/base-app-decorator/src/configuration.ts +++ b/packages/core/test/fixtures/app-with-conflict/base-app-decorator/src/configuration.ts @@ -1,12 +1,10 @@ import { ILifeCycle, Configuration } from '../../../../../src'; -@Configuration({ - conflictCheck: true, -}) -class AutoConfiguraion implements ILifeCycle { +@Configuration() +class MainConfiguration implements ILifeCycle { async onReady() { console.log('------auto configuration ready now'); } } -module.exports = AutoConfiguraion; +module.exports = MainConfiguration; diff --git a/packages/core/test/fixtures/app-with-functional-component/src/components/hooks/src/index.ts b/packages/core/test/fixtures/app-with-functional-component/src/components/hooks/src/index.ts index 087edd60748b..675b8c51c7d7 100644 --- a/packages/core/test/fixtures/app-with-functional-component/src/components/hooks/src/index.ts +++ b/packages/core/test/fixtures/app-with-functional-component/src/components/hooks/src/index.ts @@ -1,9 +1,12 @@ import { - createConfiguration, Provide, Inject + Provide, + Inject, + CustomModuleDetector, } from '../../../../../../../src'; +import { defineConfiguration } from '../../../../../../../src/functional'; @Provide() -export class FunctionContainer { +class FunctionContainer { @Inject() ctx; @@ -12,17 +15,15 @@ export class FunctionContainer { } } -export const createHooks = (hooksOptions) => { - - const configuration = createConfiguration({ - namespace: 'hooks', - }).onReady(async () => { +export default defineConfiguration({ + detector: new CustomModuleDetector({ + modules: [FunctionContainer], + }), + namespace: 'hooks', + async onReady() { console.log('on ready in hooks'); - }).onStop(async () => { + }, + async onStop() { console.log('on ready in hooks'); - }); - - return { - Configuration: configuration, } -} +}); diff --git a/packages/core/test/fixtures/app-with-functional-component/src/configuration.ts b/packages/core/test/fixtures/app-with-functional-component/src/configuration.ts index 3b0de97d2cb7..17117a1693fb 100644 --- a/packages/core/test/fixtures/app-with-functional-component/src/configuration.ts +++ b/packages/core/test/fixtures/app-with-functional-component/src/configuration.ts @@ -1,22 +1,20 @@ -import { createConfiguration, sleep } from '../../../../src' -import { createHooks } from './components/hooks'; +import { sleep } from '../../../../src'; +import createHooks from './components/hooks'; +import { defineConfiguration } from '../../../../src/functional'; + +export default defineConfiguration({ + imports: [createHooks], + async onReady() { + console.log('on ready in hooks'); + }, + async onStop() { + console.log('on ready in hooks'); + }, + async onConfigLoad() { + await sleep(50); + return { + a: 1 + } + }, +}); -export default createConfiguration({ - imports: [ - createHooks({ - routes: [{ - loadDir: 'lambda', - prefix: '/api' - }], - }) - ] -}).onReady(async (container, app) => { - console.log('on ready', app); -}).onStop(async (container, app) => { - console.log('on stop', app); -}).onConfigLoad(async () => { - await sleep(50); - return { - a: 1 - } -}) diff --git a/packages/core/test/fixtures/app-with-multi-framework-sequence-error/src/configuration.ts b/packages/core/test/fixtures/app-with-multi-framework-sequence-error/src/configuration.ts index e2cf0fe6684f..3345a323e386 100644 --- a/packages/core/test/fixtures/app-with-multi-framework-sequence-error/src/configuration.ts +++ b/packages/core/test/fixtures/app-with-multi-framework-sequence-error/src/configuration.ts @@ -5,10 +5,18 @@ import * as a from './a'; @Configuration({ imports: [ - c, - a, - b - ] + { + Configuration: c.Configuration, + }, + { + Configuration: a.Configuration, + AFramework: a.AFramework + } as any, + { + Configuration: b.Configuration, + BFramework: b.BFramework + } + ], }) export class MainConfiguration { } diff --git a/packages/core/test/fixtures/base-app-object-lifecycle/src/home.ts b/packages/core/test/fixtures/base-app-object-lifecycle/src/home.ts index a28a28d57d71..2f5d1c259214 100644 --- a/packages/core/test/fixtures/base-app-object-lifecycle/src/home.ts +++ b/packages/core/test/fixtures/base-app-object-lifecycle/src/home.ts @@ -2,7 +2,7 @@ import { Init, Provide, Scope, ScopeEnum } from '../../../../src'; @Provide() @Scope(ScopeEnum.Singleton) -export class UserService { +export class UserService2 { idx = 0; diff --git a/packages/core/test/functional/configuration.test.ts b/packages/core/test/functional/configuration.test.ts index ceb0089d7f41..2da5c6d8c345 100644 --- a/packages/core/test/functional/configuration.test.ts +++ b/packages/core/test/functional/configuration.test.ts @@ -1,29 +1,51 @@ -import { createConfiguration } from '../../src'; +import { defineConfiguration } from '../../src/functional'; +import { + CustomModuleDetector, + MidwayConfigService, + MidwayContainer, + MidwayEnvironmentService, + MidwayInformationService, + Provide +} from '../../src'; +import { ComponentConfigurationLoader } from '../../src/context/componentLoader'; describe('test/functional/configuration.test.ts', function () { - it('should test create functional configuration', function () { - const options = { + it('should test create functional configuration', async () => { + @Provide() + class Test { + async hello() { + return 'hello'; + } + } + + const configuration = defineConfiguration({ imports: [], importConfigs: {}, importObjects: {}, - }; - - const configuration = createConfiguration(options); + detector: new CustomModuleDetector({ + modules: [ + Test, + ] + }), + onConfigLoad: async () => {}, + onReady: async () => {}, + onServerReady: async () => {}, + onStop: async () => {}, + namespace: 'hello', + }); - // set - configuration.onConfigLoad(() => {}); - configuration.onReady(() => {}); - configuration.onServerReady(() => {}); - configuration.onStop(() => {}); + const container = new MidwayContainer(); + container.bind(MidwayConfigService); + container.bind(MidwayEnvironmentService); + container.bind(MidwayInformationService); + container.registerObject('appDir', __dirname); + container.registerObject('baseDir', __dirname); - // run - const app = {a: 1} as any; - const container = {} as any; - configuration.onConfigLoad(container, app); - configuration.onReady(container, app); - configuration.onServerReady(container, app); - configuration.onStop(container, app); + const loader = new ComponentConfigurationLoader(container); + await loader.load(configuration); - expect(configuration.getConfigurationOptions()).toEqual(options); + expect(loader.getNamespaceList()).toEqual(['hello']); + const test = await container.getAsync(Test); + expect(await test.hello()).toEqual('hello'); }); }); diff --git a/packages/core/test/legacy/decorator.test.ts b/packages/core/test/legacy/decorator.test.ts index 364ab96e4aa2..d95a8af03261 100644 --- a/packages/core/test/legacy/decorator.test.ts +++ b/packages/core/test/legacy/decorator.test.ts @@ -13,8 +13,6 @@ import { savePreloadModule, listPreloadModule, saveModule, - bindContainer, - clearBindContainer, listModule, resetModule, clearAllModule, @@ -32,10 +30,9 @@ import { getPropertyInject, saveObjectDefinition, getObjectDefinition, - MidwayContainer, Get, DecoratorManager, - PRELOAD_MODULE_KEY, + PRE_START_MODULE_KEY, Init, Inject } from '../../src'; @@ -149,13 +146,6 @@ describe('legacy/decorator.test.ts', () => { expect(result).toContain(TestClass); }); - it('should bind and clear container', () => { - const mockContainer = new MidwayContainer(); - bindContainer(mockContainer); - clearBindContainer(); - expect(global['MIDWAY_GLOBAL_DECORATOR_MANAGER'].container).toBeNull(); - }); - it('should reset and clear all modules', () => { class TestClass { testProperty: string; @@ -413,7 +403,7 @@ describe('legacy/decorator.test.ts', () => { let modules = listPreloadModule(); expect(modules.length).toBe(1); - resetModule(PRELOAD_MODULE_KEY); + resetModule(PRE_START_MODULE_KEY); modules = listPreloadModule(); expect(modules.length).toBe(0); }); diff --git a/packages/core/test/service/webRouterService.test.ts b/packages/core/test/service/webRouterService.test.ts index 4a4deb501e52..51843c154a89 100644 --- a/packages/core/test/service/webRouterService.test.ts +++ b/packages/core/test/service/webRouterService.test.ts @@ -1,6 +1,7 @@ import { createLightFramework } from '../util'; import * as path from 'path'; -import { MidwayContainer, MidwayWebRouterService, bindContainer, clearAllModule } from '../../src'; +import { MidwayWebRouterService, clearAllModule } from '../../src'; +import { join } from 'path'; describe('/test/service/webRouterService.test.ts', function () { @@ -36,7 +37,7 @@ describe('/test/service/webRouterService.test.ts', function () { url: '/abc/dddd/*', requestMethod: 'GET', }); - + let routeInfo = await collector.getMatchedRouterInfo('/api', 'get'); expect(routeInfo).toBeUndefined(); @@ -166,11 +167,8 @@ describe('/test/service/webRouterService.test.ts', function () { it('should test global prefix', async () => { clearAllModule(); - const container = new MidwayContainer(); - bindContainer(container); - container.bindClass(MidwayWebRouterService); - container.bindClass(require('../util/fixtures/home')); - const collector = await container.getAsync(MidwayWebRouterService, [{ globalPrefix: 'api'}]); + const framework = await createLightFramework(join(__dirname, '../util/fixtures/home')) + const collector = await framework.getApplicationContext().getAsync(MidwayWebRouterService, [{ globalPrefix: 'api'}]); const list = await collector.getRoutePriorityList(); expect(list.length).toEqual(3); expect(list[0].prefix).toEqual('/api/test'); @@ -183,11 +181,8 @@ describe('/test/service/webRouterService.test.ts', function () { it('should test global prefix with router ignore', async () => { clearAllModule(); - const container = new MidwayContainer(); - bindContainer(container); - container.bindClass(MidwayWebRouterService); - container.bindClass(require('../util/fixtures/prefix-normal')); - const collector = await container.getAsync(MidwayWebRouterService, [{ globalPrefix: 'api'}]); + const framework = await createLightFramework(join(__dirname, '../util/fixtures/home-prefix')) + const collector = await framework.getApplicationContext().getAsync(MidwayWebRouterService, [{ globalPrefix: 'api'}]); const list = await collector.getRoutePriorityList(); expect(list.length).toEqual(2); }); diff --git a/packages/core/test/setup.test.ts b/packages/core/test/setup.test.ts index 704ab8292f9d..9d3927475cd0 100644 --- a/packages/core/test/setup.test.ts +++ b/packages/core/test/setup.test.ts @@ -19,7 +19,7 @@ describe('/test/setup.test.ts', () => { ); const container = await initializeGlobalApplicationContext({ baseDir, - configurationModule: [require(join(baseDir, 'configuration'))] + imports: [require(join(baseDir, 'configuration'))] }); const configService = await container.getAsync(MidwayConfigService); @@ -158,7 +158,7 @@ describe('/test/setup.test.ts', () => { ); const container = await initializeGlobalApplicationContext({ baseDir, - configurationModule: [require(join(baseDir, 'configuration')), { + imports: [require(join(baseDir, 'configuration')), { Configuration: EmptyConfiguration, EmptyFramework, }] diff --git a/packages/core/test/util.ts b/packages/core/test/util.ts index eaecdedb125a..8e64ec7fb5c0 100644 --- a/packages/core/test/util.ts +++ b/packages/core/test/util.ts @@ -8,13 +8,16 @@ import { safeRequire, MidwayContainer, Configuration, - CONFIGURATION_KEY, Framework, Inject, sleep, IMidwayContainer, loadModule, DefaultConsoleLoggerFactory, + CommonJSFileDetector, + MAIN_MODULE_KEY, + DecoratorManager, + CONFIGURATION_KEY } from '../src'; import { join } from 'path'; import * as http from 'http'; @@ -62,7 +65,40 @@ function deepEqual(x, y) { ) : (x === y); } -export async function createLightFramework(baseDir: string = '', bootstrapOptions: IMidwayBootstrapOptions = {}): Promise> { +function hackDecoratorManager() { + if (!DecoratorManager['_mocked']) { + DecoratorManager['_listModule'] = DecoratorManager.listModule; + DecoratorManager['_saveModule'] = DecoratorManager.saveModule; + DecoratorManager.saveModule = (key, target) => { + if (key === CONFIGURATION_KEY) { + // 防止重复,测试的时候 configuration 会被重复 save + const modules = DecoratorManager['_listModule'](key); + if (modules.some((module: any) => module.target === target.target)) { + return; + } else { + DecoratorManager['_bindModuleMap'].set(target.target, true); + DecoratorManager['_saveModule'](key, target); + } + } else { + DecoratorManager['_saveModule'](key, target); + } + } + DecoratorManager.listModule = key => { + const modules = DecoratorManager['_listModule'](key); + return modules.filter((module: any) => { + if (key === CONFIGURATION_KEY) { + return DecoratorManager['_bindModuleMap'].has(module.target); + } + return DecoratorManager['_bindModuleMap'].has(module); + }); + }; + DecoratorManager['_mocked'] = true; + } +} + +export async function createLightFramework(baseDir: string = '', bootstrapOptions: IMidwayBootstrapOptions = {}, extraOptions: { + defaultDetector?: boolean; +} = {}): Promise> { /** * 一个全量的空框架 */ @@ -94,9 +130,18 @@ export async function createLightFramework(baseDir: string = '', bootstrapOption } } - @Configuration({ - namespace: 'empty' - }) + const conf = { + namespace: 'empty', + detector: new CommonJSFileDetector({ + conflictCheck: true, + }), + }; + + if (extraOptions.defaultDetector === false) { + delete conf.detector; + } + + @Configuration(conf) class EmptyConfiguration { @Inject() @@ -120,6 +165,7 @@ export async function createLightFramework(baseDir: string = '', bootstrapOption const loadMode = pkgJSON?.type === 'module' ? 'esm' : 'commonjs'; // set default entry file + const appDir = baseDir; if (baseDir) { imports.unshift( await loadModule(join(baseDir, 'configuration.ts'), { @@ -135,22 +181,12 @@ export async function createLightFramework(baseDir: string = '', bootstrapOption container.onBeforeBind(target => { bindModuleMap.set(target, true); }); - - const originMethod = container.listModule; - - container.listModule = key => { - const modules = originMethod.call(container, key); - if (key === CONFIGURATION_KEY) { - return modules; - } - - return modules.filter((module: any) => { - return bindModuleMap.has(module); - }); - }; + DecoratorManager['_bindModuleMap'] = bindModuleMap; + hackDecoratorManager(); await initializeGlobalApplicationContext({ baseDir, + appDir, imports, applicationContext: container, loggerFactory: new DefaultConsoleLoggerFactory(), @@ -161,26 +197,29 @@ export async function createLightFramework(baseDir: string = '', bootstrapOption return container.getAsync(EmptyFramework as any); } -export async function createFramework(baseDir: string = '', globalConfig: any = {}, loggerFactory?): Promise { +export async function createFramework(baseDir: string = '', globalConfig: any = {}, loggerFactory?, extraOptions: { + defaultDetector?: boolean; +} = {}): Promise { const container = new MidwayContainer(); + const bindModuleMap: WeakMap = new WeakMap(); // 这里设置是因为在 midway 单测中会不断的复用装饰器元信息,又不能清理缓存,所以在这里做一些过滤 container.onBeforeBind(target => { bindModuleMap.set(target, true); }); - const originMethod = container.listModule; + DecoratorManager['_bindModuleMap'] = bindModuleMap; + hackDecoratorManager(); + + container.registerObject('baseDir', baseDir); - container.listModule = key => { - const modules = originMethod.call(container, key); - if (key === CONFIGURATION_KEY) { - return modules; - } - return modules.filter((module: any) => { - return bindModuleMap.has(module); + if (extraOptions.defaultDetector !== false) { + const detector = new CommonJSFileDetector({ + conflictCheck: true, }); - }; + await detector.run(container, MAIN_MODULE_KEY); + } return initializeGlobalApplicationContext({ baseDir, @@ -190,6 +229,7 @@ export async function createFramework(baseDir: string = '', globalConfig: any = applicationContext: container, globalConfig, loggerFactory, + }); } diff --git a/packages/core/test/util/fixtures/home-prefix/src/configuration.ts b/packages/core/test/util/fixtures/home-prefix/src/configuration.ts new file mode 100644 index 000000000000..2c61d1360e7c --- /dev/null +++ b/packages/core/test/util/fixtures/home-prefix/src/configuration.ts @@ -0,0 +1,8 @@ +import { defineConfiguration } from '../../../../../src/functional'; + +export default defineConfiguration({ + namespace: 'home-prefix', + async onReady() { + console.log('home configuration onReady'); + } +}); diff --git a/packages/core/test/util/fixtures/prefix-normal.ts b/packages/core/test/util/fixtures/home-prefix/src/prefix-normal.ts similarity index 77% rename from packages/core/test/util/fixtures/prefix-normal.ts rename to packages/core/test/util/fixtures/home-prefix/src/prefix-normal.ts index 77474520c7e8..0d95368013f2 100644 --- a/packages/core/test/util/fixtures/prefix-normal.ts +++ b/packages/core/test/util/fixtures/home-prefix/src/prefix-normal.ts @@ -1,4 +1,4 @@ -import { Controller, Get } from '../../../src'; +import { Controller, Get } from '../../../../../src'; @Controller('/') export class IndexController { diff --git a/packages/core/test/util/fixtures/home/src/configuration.ts b/packages/core/test/util/fixtures/home/src/configuration.ts new file mode 100644 index 000000000000..27a57d64a0d0 --- /dev/null +++ b/packages/core/test/util/fixtures/home/src/configuration.ts @@ -0,0 +1,8 @@ +import { defineConfiguration } from '../../../../../src/functional'; + +export default defineConfiguration({ + namespace: 'home', + async onReady() { + console.log('home configuration onReady'); + } +}); diff --git a/packages/core/test/util/fixtures/home.ts b/packages/core/test/util/fixtures/home/src/home.ts similarity index 93% rename from packages/core/test/util/fixtures/home.ts rename to packages/core/test/util/fixtures/home/src/home.ts index 9a14b032cf76..b1289d928d77 100644 --- a/packages/core/test/util/fixtures/home.ts +++ b/packages/core/test/util/fixtures/home/src/home.ts @@ -1,7 +1,7 @@ import { Controller, Get, -} from '../../../src'; +} from '../../../../../src'; // /api/ + /bbc @Controller('/', {}) diff --git a/packages/core/test/util/util.test.ts b/packages/core/test/util/util.test.ts index bc34335867bd..5a3e9d83c57f 100644 --- a/packages/core/test/util/util.test.ts +++ b/packages/core/test/util/util.test.ts @@ -186,21 +186,6 @@ describe('/test/pathFileUtil.test.ts', () => { // special expect(transformRequestObjectByType('0', Boolean)).toEqual(false); expect(transformRequestObjectByType('false', Boolean)).toEqual(false); - - class A { - a: number; - b: number; - invoke() { - return this.a + this.b; - } - } - - const result: A = transformRequestObjectByType({ - a: 1, - b: 2 - }, A); - expect(result instanceof A).toBeTruthy(); - expect(result.invoke()).toEqual(3); }); it('should test object property writable', function () { diff --git a/packages/cos/package.json b/packages/cos/package.json index ad640030d299..faa802eedab0 100644 --- a/packages/cos/package.json +++ b/packages/cos/package.json @@ -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": { diff --git a/packages/cron/package.json b/packages/cron/package.json index b1cb8e77e373..5993b00686e5 100644 --- a/packages/cron/package.json +++ b/packages/cron/package.json @@ -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:^" } } diff --git a/packages/cron/test/index.test.ts b/packages/cron/test/index.test.ts index a36c42e71f3c..0ca40df45fc0 100644 --- a/packages/cron/test/index.test.ts +++ b/packages/cron/test/index.test.ts @@ -1,11 +1,13 @@ -import { createApp, close } from '@midwayjs/mock'; +import { createLegacyApp, close } from '@midwayjs/mock'; import { join } from 'path'; import { sleep } from '@midwayjs/core'; import * as cron from '../src'; describe(`/test/index.test.ts`, () => { it('test job with decorator and start', async () => { - const app = await createApp(join(__dirname, 'fixtures', 'base-app'), {}, cron); + const app = await createLegacyApp(join(__dirname, 'fixtures', 'base-app'), { + imports: [cron], + }); await sleep(5 * 1000); let res = app.getAttr(`task`); expect(res).toEqual(1); @@ -13,7 +15,9 @@ describe(`/test/index.test.ts`, () => { }); it('test job throw error and running next', async () => { - const app = await createApp(join(__dirname, 'fixtures', 'base-app-err'), {}, cron); + const app = await createLegacyApp(join(__dirname, 'fixtures', 'base-app-err'), { + imports: [cron], + }); await sleep(5 * 1000); await close(app); }); diff --git a/packages/cross-domain/package.json b/packages/cross-domain/package.json index 9adaad4569d6..69d3a4d12e4c 100644 --- a/packages/cross-domain/package.json +++ b/packages/cross-domain/package.json @@ -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:^" } } diff --git a/packages/cross-domain/test/express.test.ts b/packages/cross-domain/test/express.test.ts index c4259d0835f3..2f138702445a 100644 --- a/packages/cross-domain/test/express.test.ts +++ b/packages/cross-domain/test/express.test.ts @@ -1,11 +1,11 @@ -import { createHttpRequest, close, createApp } from '@midwayjs/mock'; +import { createHttpRequest, close, createLegacyApp } from '@midwayjs/mock'; import { join } from 'path'; import * as assert from 'assert'; describe('test/express.test.ts', function () { let app; beforeAll(async () => { const appDir = join(__dirname, 'fixtures/express'); - app = await createApp(appDir); + app = await createLegacyApp(appDir); }); afterAll(async () => { diff --git a/packages/cross-domain/test/faas.test.ts b/packages/cross-domain/test/faas.test.ts index 16f815e7bf5d..c50e9845874e 100644 --- a/packages/cross-domain/test/faas.test.ts +++ b/packages/cross-domain/test/faas.test.ts @@ -1,4 +1,4 @@ -import { createHttpRequest, close, createFunctionApp } from '@midwayjs/mock'; +import { createHttpRequest, close, createLegacyFunctionApp } from '@midwayjs/mock'; import { join } from 'path'; import { BootstrapStarter } from '../../../packages-serverless/midway-fc-starter/src'; import * as assert from 'assert'; @@ -7,7 +7,7 @@ describe('test/faas.test.ts', function () { beforeAll(async () => { const appDir = join(__dirname, 'fixtures/faas'); try { - app = await createFunctionApp(appDir, {starter: new BootstrapStarter()}); + app = await createLegacyFunctionApp(appDir, {starter: new BootstrapStarter()}); } catch (e) { console.log("e", e); } diff --git a/packages/cross-domain/test/koa.test.ts b/packages/cross-domain/test/koa.test.ts index d6e389b9e6cb..e5b7f0801e9f 100644 --- a/packages/cross-domain/test/koa.test.ts +++ b/packages/cross-domain/test/koa.test.ts @@ -1,4 +1,4 @@ -import { createHttpRequest, close, createApp } from '@midwayjs/mock'; +import { createHttpRequest, close, createLegacyApp } from '@midwayjs/mock'; import { join } from 'path'; import * as assert from 'assert'; describe('test/koa.test.ts', function () { @@ -6,7 +6,7 @@ describe('test/koa.test.ts', function () { beforeAll(async () => { const appDir = join(__dirname, 'fixtures/koa'); try { - app = await createApp(appDir); + app = await createLegacyApp(appDir); } catch (e) { console.log("e", e); } diff --git a/packages/etcd/package.json b/packages/etcd/package.json index 830ad553b996..23f3a3689cd8 100644 --- a/packages/etcd/package.json +++ b/packages/etcd/package.json @@ -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" diff --git a/packages/express-session/package.json b/packages/express-session/package.json index 46b69ac1f2e9..0e991804067e 100644 --- a/packages/express-session/package.json +++ b/packages/express-session/package.json @@ -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" }, diff --git a/packages/express-session/test/index.test.ts b/packages/express-session/test/index.test.ts index d42765689488..e139581f6c8e 100644 --- a/packages/express-session/test/index.test.ts +++ b/packages/express-session/test/index.test.ts @@ -1,4 +1,4 @@ -import { createApp, createHttpRequest, close } from '@midwayjs/mock'; +import { createLegacyApp, createHttpRequest, close } from '@midwayjs/mock'; import { join } from 'path'; import * as assert from 'assert'; import * as session from '../src'; @@ -7,7 +7,7 @@ import { Store } from 'express-session'; describe('test/index.test.ts', function () { it('should test sessionStore', async () => { - const app = await createApp(join(__dirname, 'fixtures/memory-session')); + const app = await createLegacyApp(join(__dirname, 'fixtures/memory-session')); const request = createHttpRequest(app); await request.get('/set?foo=bar') @@ -22,7 +22,7 @@ describe('test/index.test.ts', function () { let app; let request; beforeAll(async () => { - app = await createApp(join(__dirname, 'fixtures/cookie-session')); + app = await createLegacyApp(join(__dirname, 'fixtures/cookie-session')); request = createHttpRequest(app); }) @@ -99,7 +99,7 @@ describe('test/index.test.ts', function () { }) it('should test sameSite=none', async () => { - const app = await createApp(join(__dirname, 'fixtures/samesite-none-session')); + const app = await createLegacyApp(join(__dirname, 'fixtures/samesite-none-session')); const request = createHttpRequest(app); await request.get('/set?foo=bar') diff --git a/packages/faas/package.json b/packages/faas/package.json index 6e7ba469351b..3ccefcf674b0 100644 --- a/packages/faas/package.json +++ b/packages/faas/package.json @@ -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/mock": "workspace:^", "mm": "3.4.0" }, "engines": { diff --git a/packages/faas/src/framework.ts b/packages/faas/src/framework.ts index 7f044d757014..fcb03abc05b5 100644 --- a/packages/faas/src/framework.ts +++ b/packages/faas/src/framework.ts @@ -35,7 +35,9 @@ import { HTTPResponse, } from '@midwayjs/serverless-http-parser'; import * as http from 'http'; -import { types } from 'util'; +import { types, debuglog } from 'util'; + +const debug = debuglog('midway:debug'); const { isAnyArrayBuffer, isUint8Array } = types; const LOCK_KEY = '_faas_starter_start_key'; @@ -180,7 +182,13 @@ export class MidwayFaaSFramework extends BaseFramework< ); const functionList = await this.serverlessFunctionService.getFunctionList(); + + debug(`[faas]: load ${functionList.length} function list`); + for (const funcInfo of functionList) { + debug( + `[faas]: load function ${funcInfo.funcHandlerName}, router = ${funcInfo.fullUrl}` + ); // store handler this.funMappingStore.set(funcInfo.funcHandlerName, funcInfo); } @@ -286,7 +294,7 @@ export class MidwayFaaSFramework extends BaseFramework< )(context.path); context.req.pathParameters = matchRes['params'] || {}; } else { - // options request pass throuth to middleware + // options request pass through to middleware if (context.method?.toLowerCase() === 'options') { funOptions = { url: context.path, diff --git a/packages/faas/src/starter.ts b/packages/faas/src/starter.ts index c922c141e8b7..53991f1cbcf1 100644 --- a/packages/faas/src/starter.ts +++ b/packages/faas/src/starter.ts @@ -43,6 +43,10 @@ export abstract class AbstractBootstrapStarter { this.startedExports = this.onStart(); } if (this.startedExports) { + if (options) { + // 单测时这里要再覆盖一次,不然外面的 options 传不进来 + this.options = Object.assign(this.options, options); + } this.startedExports['getStarter'] = () => { return this; }; diff --git a/packages/faas/test/new.test.ts b/packages/faas/test/new.test.ts index cc340ee109b9..6cde17edc9f9 100644 --- a/packages/faas/test/new.test.ts +++ b/packages/faas/test/new.test.ts @@ -1,10 +1,10 @@ import * as assert from 'assert'; import * as mm from 'mm'; import { createNewStarter, closeApp } from './utils'; -import { createFunctionApp, createHttpRequest } from '@midwayjs/mock'; +import { createLegacyFunctionApp, createHttpRequest } from '@midwayjs/mock'; import { Framework } from '../src'; import { join } from 'path'; -import { BootstrapStarter } from '../../../packages-serverless/midway-fc-starter/src'; +import { BootstrapStarter } from '@midwayjs/fc-starter'; describe('test/new.test.ts', () => { @@ -224,7 +224,7 @@ describe('test/new.test.ts', () => { it('should test new test method', async () => { mm(process.env, 'MIDWAY_SERVERLESS_FUNCTION_NAME', 'aaa'); mm(process.env, 'MIDWAY_SERVERLESS_SERVICE_NAME', 'bbb'); - const app = await createFunctionApp(join(__dirname, 'fixtures/base-app-event-middleware'), { + const app = await createLegacyFunctionApp(join(__dirname, 'fixtures/base-app-event-middleware'), { starter: new BootstrapStarter(), globalConfig: { faas: { diff --git a/packages/faas/test/utils.ts b/packages/faas/test/utils.ts index 0baf75b2fa6a..eafffde59d76 100644 --- a/packages/faas/test/utils.ts +++ b/packages/faas/test/utils.ts @@ -1,14 +1,14 @@ -import { Framework, Application } from '../src'; +import { Framework, Application, AbstractBootstrapStarter, IFaaSConfigurationOptions } from '../src'; import * as FaaS from '../src'; import { join } from 'path'; -import { close, create, createFunctionApp } from '../../mock/src'; -import { BootstrapStarter } from '../../../packages-serverless/midway-fc-starter/src'; +import { close, createLegacyApp, createLegacyFunctionApp } from '@midwayjs/mock'; +import { wrapAsync } from '@midwayjs/core'; const originReady = FaaS.Configuration.prototype.init; let isProxy = false; let currentOptions; -export async function creatStarter(name, options = {}): Promise { +export async function creatStarter(name, options: any = {}): Promise { currentOptions = options; if (!isProxy) { FaaS.Configuration.prototype.init = async function () { @@ -19,12 +19,220 @@ export async function creatStarter(name, options = {}): Promise { isProxy = true; } - return await create(join(__dirname, 'fixtures/legacy', name), options, FaaS); + options.imports = [ + ...options.imports ?? [], + FaaS + ] + + const app = await createLegacyApp(join(__dirname, 'fixtures/legacy', name), options); + return app.getFramework(); +} + +class BootstrapStarter extends AbstractBootstrapStarter { + onStart() { + const exports = {}; + + exports[this.options.initializeMethodName || 'initializer'] = wrapAsync( + async context => { + await this.onInit(context, exports); + } + ); + + if (this.options.handlerName) { + exports[this.options.handlerName.split('.')[1]] = wrapAsync( + this.onRequest.bind(this) + ); + } + + if (this.options.aggregationHandlerName) { + exports[this.options.aggregationHandlerName.split('.')[1]] = wrapAsync( + this.onRequest.bind(this) + ); + } + + return exports; + } + + async onInit( + context, + exports + ) { + const applicationAdapter = { + getFunctionName() { + return context.function.name; + }, + getFunctionServiceName() { + return context.service.name; + }, + } as IFaaSConfigurationOptions; + + await this.initFramework({ + globalConfig: { + faas: { + applicationAdapter, + }, + }, + ...this.options, + }); + + const handlerWrapper = wrapAsync(this.onRequest.bind(this)); + + for (const handlerName of this.framework.getAllHandlerNames()) { + exports[handlerName.split('.')[1]] = handlerWrapper; + } + } + + async onRequest(event, context, oldContext) { + const isHTTPMode = + event.constructor.name === 'IncomingMessage' || + event.constructor.name === 'EventEmitter'; + + const isApiGateway = + event && + event.headers && + 'queryParameters' in event && + 'httpMethod' in event; + + if (isHTTPMode) { + if (!oldContext.logger?.info) { + oldContext.logger = console; + } + } else { + if (!context.logger?.info) { + context.logger = console; + } + } + + let handlerName = oldContext?.function.handler || context.function.handler; + + // 聚合部署的情况 + if (this.options.aggregationHandlerName) { + if (this.options.handlerNameMapping) { + [handlerName, event, context, oldContext] = + this.options.handlerNameMapping( + handlerName, + event, + context, + oldContext + ); + } + } + + let ctx; + if (isHTTPMode) { + (event as any).getOriginContext = () => { + return oldContext; + }; + ctx = await this.framework.wrapHttpRequest(event); + } else if (isApiGateway) { + ctx = await this.framework.wrapHttpRequest(event, context); + } else { + if (Buffer.isBuffer(event)) { + event = event.toString('utf8'); + try { + event = JSON.parse(event); + } catch (_err) { + /** ignore */ + } + } + // format context + ctx = { + originEvent: event, + originContext: context, + logger: context.logger, + }; + } + + try { + const result = await this.framework.invokeTriggerFunction( + ctx, + handlerName, + { + isHttpFunction: isHTTPMode || isApiGateway, + } + ); + if (isHTTPMode || isApiGateway) { + const { isBase64Encoded, statusCode, headers, body } = result; + + if (isApiGateway) { + const newHeader = {}; + for (const key in headers) { + // The length after base64 is wrong. + if (!['content-length'].includes(key)) { + if ('set-cookie' === key && !isHTTPMode) { + // unsupport multiple cookie when use apiGateway + newHeader[key] = headers[key][0]; + if (headers[key].length > 1) { + ctx.logger.warn( + '[fc-starter]: unsupport multiple cookie when use apiGateway' + ); + } + } else { + newHeader[key] = headers[key]; + } + } + } + return { + isBase64Encoded, + statusCode, + headers: newHeader, + body, + }; + } else { + const res = context; + if (res.headersSent) { + return; + } + + if (res.setHeader) { + for (const key in headers) { + res.setHeader(key, headers[key]); + } + } + + if (res.statusCode !== statusCode) { + if ((res as any).setStatusCode) { + (res as any).setStatusCode(statusCode); + } + + if (res.statusCode) { + res.statusCode = statusCode; + } + } + + if ((res as any).send) { + // http trigger only support `Buffer` or a `string` or a `stream.Readable` + (res as any).send(body); + } + } + } else { + return result; + } + } catch (err) { + ctx.logger.error(err); + const res = context; + if (res.setHeader) { + res.setHeader('content-type', 'text/plain'); + } + if (res.send) { + res.setStatusCode(err.status ?? 500); + res.send('Internal Server Error'); + } + return { + isBase64Encoded: false, + statusCode: err.status ?? 500, + headers: {}, + body: 'Internal Server Error', + }; + } + } + + async onClose() {} } export async function createNewStarter(name, options = {}): Promise { const basePath = join(__dirname, 'fixtures', name); - const app = await createFunctionApp(basePath, Object.assign({ + const app = await createLegacyFunctionApp(basePath, Object.assign({ starter: new BootstrapStarter(), imports: [ require('../src'), diff --git a/packages/grpc/package.json b/packages/grpc/package.json index 76b55fb9dabd..35c2ac059c43 100644 --- a/packages/grpc/package.json +++ b/packages/grpc/package.json @@ -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" diff --git a/packages/grpc/test/utils.ts b/packages/grpc/test/utils.ts index 992d7a285d16..51788fb3a7f9 100644 --- a/packages/grpc/test/utils.ts +++ b/packages/grpc/test/utils.ts @@ -1,7 +1,7 @@ import { Framework, IMidwayGRPCApplication, IMidwayGRPFrameworkOptions } from '../src'; import * as grpc from '../src'; import { join } from 'path'; -import { close, createApp } from '@midwayjs/mock'; +import { close, createLegacyApp } from '@midwayjs/mock'; /** * create a gRPC server @@ -9,7 +9,12 @@ import { close, createApp } from '@midwayjs/mock'; * @param options */ export async function createServer(name: string, options?: IMidwayGRPFrameworkOptions): Promise { - return createApp(join(__dirname, 'fixtures', name), options, grpc); + return createLegacyApp(join(__dirname, 'fixtures', name), { + imports: [ + grpc, + ], + ...options, + }); } export async function closeApp(app) { diff --git a/packages/http-proxy/package.json b/packages/http-proxy/package.json index ee8c0d50b166..1604afdd7f71 100644 --- a/packages/http-proxy/package.json +++ b/packages/http-proxy/package.json @@ -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" } } diff --git a/packages/http-proxy/test/express.test.ts b/packages/http-proxy/test/express.test.ts index e1be5f98e918..4a8031e11d40 100644 --- a/packages/http-proxy/test/express.test.ts +++ b/packages/http-proxy/test/express.test.ts @@ -1,4 +1,4 @@ -import { createApp, createHttpRequest, close } from '@midwayjs/mock'; +import { createLegacyApp, createHttpRequest, close } from '@midwayjs/mock'; import { join } from 'path'; import * as assert from 'assert'; import * as nock from 'nock'; @@ -41,7 +41,7 @@ describe('test/express.test.ts', function () { }, {'content-type': 'application/json'}); const appDir = join(__dirname, 'fixtures/express'); - app = await createApp(appDir); + app = await createLegacyApp(appDir); }) afterAll(async () => { diff --git a/packages/http-proxy/test/faas.test.ts b/packages/http-proxy/test/faas.test.ts index e501dcc7c1df..440ff0d94e5c 100644 --- a/packages/http-proxy/test/faas.test.ts +++ b/packages/http-proxy/test/faas.test.ts @@ -1,4 +1,4 @@ -import { createHttpRequest, close, createFunctionApp } from '@midwayjs/mock'; +import { createHttpRequest, close, createLegacyFunctionApp } from '@midwayjs/mock'; import { join } from 'path'; import * as nock from 'nock'; @@ -40,7 +40,7 @@ describe('test/faas.test.ts', function () { }, {'content-type': 'application/json'}); const appDir = join(__dirname, 'fixtures/faas'); - app = await createFunctionApp(appDir, {}); + app = await createLegacyFunctionApp(appDir, {}); }) afterAll(async () => { diff --git a/packages/http-proxy/test/koa.test.ts b/packages/http-proxy/test/koa.test.ts index da74ded08e66..96197ec219b4 100644 --- a/packages/http-proxy/test/koa.test.ts +++ b/packages/http-proxy/test/koa.test.ts @@ -1,4 +1,4 @@ -import { createApp, createHttpRequest, close } from '@midwayjs/mock'; +import { createLegacyApp, createHttpRequest, close } from '@midwayjs/mock'; import { join } from 'path'; import * as assert from 'assert'; import * as nock from 'nock'; @@ -42,7 +42,7 @@ describe('test/koa.test.ts', function () { return body; }, {'content-type': 'application/json'}); const appDir = join(__dirname, 'fixtures/koa'); - app = await createApp(appDir); + app = await createLegacyApp(appDir); }) afterAll(async () => { diff --git a/packages/http-proxy/test/web.test.ts b/packages/http-proxy/test/web.test.ts index c62360cfffa5..ee367341494e 100644 --- a/packages/http-proxy/test/web.test.ts +++ b/packages/http-proxy/test/web.test.ts @@ -1,4 +1,4 @@ -import { createApp, createHttpRequest, close } from '@midwayjs/mock'; +import { createLegacyApp, createHttpRequest, close } from '@midwayjs/mock'; import { join } from 'path'; import * as assert from 'assert'; import * as nock from 'nock'; @@ -39,7 +39,7 @@ describe('test/web.test.ts', function () { return body; }, {'content-type': 'application/json'}); const appDir = join(__dirname, 'fixtures/web'); - app = await createApp(appDir); + app = await createLegacyApp(appDir); }) afterAll(async () => { diff --git a/packages/i18n/package.json b/packages/i18n/package.json index c2ed6d712e64..178af7c4fe2a 100644 --- a/packages/i18n/package.json +++ b/packages/i18n/package.json @@ -13,10 +13,10 @@ "picomatch": "2.3.1" }, "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:^" }, "keywords": [ "midway", diff --git a/packages/i18n/test/index.test.ts b/packages/i18n/test/index.test.ts index e32fc65b63e8..872033b1bb1c 100644 --- a/packages/i18n/test/index.test.ts +++ b/packages/i18n/test/index.test.ts @@ -1,5 +1,5 @@ import { MidwayI18nService } from '../src'; -import { createLightApp, close, createHttpRequest, createApp } from '@midwayjs/mock'; +import { createLightApp, close, createHttpRequest, createLegacyApp } from '@midwayjs/mock'; import { join } from 'path'; import { formatWithArray, formatWithObject } from '../src/utils'; import * as i18n from '../src'; @@ -206,7 +206,7 @@ describe('test/index.test.ts', () => { describe('i18n in koa', function () { it('should test with request by query', async () => { - const app = await createApp(join( + const app = await createLegacyApp(join( __dirname, './fixtures/base-app-koa-query-locale' )); @@ -222,7 +222,7 @@ describe('test/index.test.ts', () => { }); it('should test with request by header', async () => { - const app = await createApp(join( + const app = await createLegacyApp(join( __dirname, './fixtures/base-app-koa-header-locale' )); @@ -238,7 +238,7 @@ describe('test/index.test.ts', () => { }); it('should test with request by cookie', async () => { - const app = await createApp(join( + const app = await createLegacyApp(join( __dirname, './fixtures/base-app-koa-cookie-locale' )); @@ -266,7 +266,7 @@ describe('test/index.test.ts', () => { }); it('should test with request by cookie and manual', async () => { - const app = await createApp(join( + const app = await createLegacyApp(join( __dirname, './fixtures/base-app-koa-cookie-locale-manual' )); @@ -283,7 +283,7 @@ describe('test/index.test.ts', () => { }); it('should test close resolver', async () => { - const app = await createApp(join( + const app = await createLegacyApp(join( __dirname, './fixtures/base-app-koa-close-resolver' )); @@ -300,7 +300,7 @@ describe('test/index.test.ts', () => { }); it('should test with request ctx.locals', async () => { - const app = await createApp(join( + const app = await createLegacyApp(join( __dirname, './fixtures/base-app-koa-ctx-locals' )); @@ -318,7 +318,7 @@ describe('test/index.test.ts', () => { describe('i18n in express', function () { it('should test with request by query', async () => { - const app = await createApp(join( + const app = await createLegacyApp(join( __dirname, './fixtures/base-app-express-query-locale' )); @@ -334,7 +334,7 @@ describe('test/index.test.ts', () => { }); it('should test with request by header', async () => { - const app = await createApp(join( + const app = await createLegacyApp(join( __dirname, './fixtures/base-app-express-header-locale' )); @@ -350,7 +350,7 @@ describe('test/index.test.ts', () => { }); it('should test with request by cookie', async () => { - const app = await createApp(join( + const app = await createLegacyApp(join( __dirname, './fixtures/base-app-express-cookie-locale' )); @@ -378,7 +378,7 @@ describe('test/index.test.ts', () => { }); it('should test close resolver', async () => { - const app = await createApp(join( + const app = await createLegacyApp(join( __dirname, './fixtures/base-app-express-close-resolver' )); @@ -395,7 +395,7 @@ describe('test/index.test.ts', () => { }); it('should test with request by cookie and manual', async () => { - const app = await createApp(join( + const app = await createLegacyApp(join( __dirname, './fixtures/base-app-express-cookie-locale-manual' )); @@ -412,7 +412,7 @@ describe('test/index.test.ts', () => { }); it('should test with request req.locals', async () => { - const app = await createApp(join( + const app = await createLegacyApp(join( __dirname, './fixtures/base-app-express-req-locals' )); diff --git a/packages/info/package.json b/packages/info/package.json index c76470688c3a..e0fcef1dc7f7 100644 --- a/packages/info/package.json +++ b/packages/info/package.json @@ -13,10 +13,10 @@ "picomatch": "2.3.1" }, "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:^" }, "keywords": [ "midway" diff --git a/packages/info/test/__snapshots__/index.test.ts.snap b/packages/info/test/__snapshots__/index.test.ts.snap index c23f0c3471c3..8efea5c6fd36 100644 --- a/packages/info/test/__snapshots__/index.test.ts.snap +++ b/packages/info/test/__snapshots__/index.test.ts.snap @@ -3,7 +3,7 @@ exports[`test/index.test.ts should test get config and filter secret 1`] = ` { "info": { - "asyncContextManager": "{"enable":false}", + "asyncContextManager": "{"enable":true}", "core": "{"healthCheckTimeout":1000}", "cos": "{"default":{"SecretId":"df******af","SecretKey":"te******vc","SecurityToken":"fj*********af"}}", "debug": "{"recordConfigMergeOrder":true}", diff --git a/packages/info/test/index.test.ts b/packages/info/test/index.test.ts index d7ba05d239ca..0ea03409e73c 100644 --- a/packages/info/test/index.test.ts +++ b/packages/info/test/index.test.ts @@ -1,4 +1,4 @@ -import { close, createApp, createHttpRequest, createLightApp } from '@midwayjs/mock'; +import { close, createLegacyApp, createHttpRequest, createLightApp } from '@midwayjs/mock'; import { InfoService } from '../src'; import { join } from 'path'; import * as info from '../src'; @@ -17,7 +17,7 @@ describe('test/index.test.ts', () => { }); it('test koa middleware', async () => { - const app = await createApp(join(__dirname, './fixtures/web-koa')); + const app = await createLegacyApp(join(__dirname, './fixtures/web-koa')); const result = await createHttpRequest(app).get('/_test_route'); expect(result.type).toEqual('text/html'); expect(result.text).toMatch('xxx'); @@ -25,7 +25,7 @@ describe('test/index.test.ts', () => { }); it('test express middleware', async () => { - const app = await createApp(join(__dirname, './fixtures/web-express')); + const app = await createLegacyApp(join(__dirname, './fixtures/web-express')); const result = await createHttpRequest(app).get('/_info'); expect(result.type).toEqual('text/html'); expect(result.text).toMatch('Midway Info'); diff --git a/packages/jwt/package.json b/packages/jwt/package.json index 2addaf99af39..6851c25d5ecd 100644 --- a/packages/jwt/package.json +++ b/packages/jwt/package.json @@ -25,11 +25,11 @@ "author": "Nawbc", "license": "MIT", "devDependencies": { - "@midwayjs/core": "^3.18.0", - "@midwayjs/express": "^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/koa": "workspace:^", + "@midwayjs/mock": "workspace:^", + "@midwayjs/web": "workspace:^" }, "dependencies": { "@types/jsonwebtoken": "9.0.7", diff --git a/packages/kafka/package.json b/packages/kafka/package.json index 02178d5bd337..ab35793cd359 100644 --- a/packages/kafka/package.json +++ b/packages/kafka/package.json @@ -33,8 +33,8 @@ }, "homepage": "https://github.com/midwayjs/midway#readme", "devDependencies": { - "@midwayjs/core": "^3.18.0", - "@midwayjs/mock": "^3.18.0" + "@midwayjs/core": "workspace:^", + "@midwayjs/mock": "workspace:^" }, "dependencies": { "kafkajs": "2.2.4" diff --git a/packages/kafka/test/utils.ts b/packages/kafka/test/utils.ts index d4525f806932..a0e3eb992f38 100644 --- a/packages/kafka/test/utils.ts +++ b/packages/kafka/test/utils.ts @@ -1,7 +1,7 @@ import { Framework, IMidwayKafkaApplication } from '../src'; import * as kafka from '../src'; import { join } from 'path'; -import { close, createApp } from '@midwayjs/mock'; +import { close, createLegacyApp } from '@midwayjs/mock'; /** * create a kafka app @@ -9,7 +9,9 @@ import { close, createApp } from '@midwayjs/mock'; * @param options */ export async function creatApp(name: string, options?: any): Promise { - return createApp(join(__dirname, 'fixtures', name), options, kafka); + return createLegacyApp(join(__dirname, 'fixtures', name), Object.assign({ + imports: [kafka] + }, options)); } export async function closeApp(app) { diff --git a/packages/leoric/package.json b/packages/leoric/package.json index c08329e09e27..d9415e0048f7 100644 --- a/packages/leoric/package.json +++ b/packages/leoric/package.json @@ -21,9 +21,9 @@ "leoric": "2.12.3" }, "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:^", "sqlite3": "5.1.7" }, "scripts": { diff --git a/packages/leoric/test/fixtures/basic/src/configuration.ts b/packages/leoric/test/fixtures/basic/src/configuration.ts index e18796a25afc..a1d5deb6be2b 100644 --- a/packages/leoric/test/fixtures/basic/src/configuration.ts +++ b/packages/leoric/test/fixtures/basic/src/configuration.ts @@ -6,7 +6,6 @@ const { InjectDataSource } = leoric; @Configuration({ imports: [leoric], - conflictCheck: true, importConfigs: [path.join(__dirname, 'config')], }) export class ContainerLifeCycle { diff --git a/packages/leoric/test/fixtures/logger/src/configuration.ts b/packages/leoric/test/fixtures/logger/src/configuration.ts index f3c7b443ffc3..2052ee8366e5 100644 --- a/packages/leoric/test/fixtures/logger/src/configuration.ts +++ b/packages/leoric/test/fixtures/logger/src/configuration.ts @@ -7,7 +7,6 @@ const { InjectDataSource } = leoric; @Configuration({ imports: [koa, leoric], - conflictCheck: true, importConfigs: [path.join(__dirname, 'config')], }) export class ContainerLifeCycle { diff --git a/packages/leoric/test/index.test.ts b/packages/leoric/test/index.test.ts index 065555503973..8b276d47cc09 100644 --- a/packages/leoric/test/index.test.ts +++ b/packages/leoric/test/index.test.ts @@ -1,4 +1,4 @@ -import { close, createLightApp } from '@midwayjs/mock'; +import { close, createLegacyLightApp } from '@midwayjs/mock'; import { join } from 'path'; import { existsSync, unlinkSync } from 'fs'; import { UserService } from './fixtures/basic/src/service/user'; @@ -15,7 +15,7 @@ describe('test/index.test.ts', () => { beforeAll(async () => { cleanFile(join(__dirname, 'fixtures/basic', 'database.sqlite')); - app = await createLightApp(join(__dirname, 'fixtures', 'basic')); + app = await createLegacyLightApp(join(__dirname, 'fixtures', 'basic')); }); afterAll(async () => { diff --git a/packages/leoric/test/logger.test.ts b/packages/leoric/test/logger.test.ts index 7f425f6569bb..e09a1b85287b 100644 --- a/packages/leoric/test/logger.test.ts +++ b/packages/leoric/test/logger.test.ts @@ -1,4 +1,4 @@ -import { close, createHttpRequest, createApp } from '@midwayjs/mock'; +import { close, createHttpRequest, createLegacyApp } from '@midwayjs/mock'; import { join } from 'path'; import { existsSync, unlinkSync } from 'fs'; import { IMidwayApplication } from '@midwayjs/core'; @@ -17,7 +17,7 @@ describe('test/logger.test.ts', () => { beforeAll(async () => { cleanFile(join(__dirname, 'fixtures/logger', 'database.sqlite')); - app = await createApp(join(__dirname, 'fixtures', 'logger')); + app = await createLegacyApp(join(__dirname, 'fixtures', 'logger')); userService = await app .getApplicationContext() .getAsync(UserService); diff --git a/packages/mikro/package.json b/packages/mikro/package.json index dfcca3e06283..b3b5845521f7 100644 --- a/packages/mikro/package.json +++ b/packages/mikro/package.json @@ -9,9 +9,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:^", "@mikro-orm/core": "6.3.10", "@mikro-orm/entity-generator": "6.3.10", "@mikro-orm/sqlite": "6.3.10" diff --git a/packages/mikro/test/fixtures/multi-enitymanager/src/components/m1/src/controller/m1.controller.ts b/packages/mikro/test/fixtures/multi-enitymanager/src/components/m1/src/controller/m1.controller.ts index 4387915819c9..a83be4ce79c9 100644 --- a/packages/mikro/test/fixtures/multi-enitymanager/src/components/m1/src/controller/m1.controller.ts +++ b/packages/mikro/test/fixtures/multi-enitymanager/src/components/m1/src/controller/m1.controller.ts @@ -7,7 +7,7 @@ import { EntityManager } from '@mikro-orm/core'; import { User } from '../entity/user.entity'; import { EntityRepository } from '@mikro-orm/sqlite'; @Controller('/m1') -export class HomeController { +export class HomeController1 { @InjectEntityManager('default1') em: EntityManager; diff --git a/packages/mikro/test/index.test.ts b/packages/mikro/test/index.test.ts index 2c7f435b8603..1febdd3b1636 100644 --- a/packages/mikro/test/index.test.ts +++ b/packages/mikro/test/index.test.ts @@ -2,52 +2,46 @@ import { join } from 'path'; import { existsSync, unlinkSync } from 'fs'; import { close, - createApp, - createLightApp, + createLegacyApp, + createLegacyLightApp as createLightApp, createHttpRequest, } from '@midwayjs/mock'; import { IMidwayApplication } from '@midwayjs/core'; describe('/test/index.test.ts', () => { - if (/v12/.test(process.version)) { - it('should ignore mikro test', () => { - console.log('not support current node version'); - }); - } else { - it('should test base entity', async () => { - cleanFile(join(__dirname, 'fixtures/base-fn-origin', 'test.sqlite')); - - const app: IMidwayApplication = await createLightApp( - join(__dirname, 'fixtures/base-fn-origin'), - {} - ); - const result = app.getAttr('result'); - - expect(result.includes('b1')).toBeTruthy(); - - await close(app); - }); - - it('test multi entity manager in different component', async () => { - cleanFile(join(__dirname, 'fixtures/multi-enitymanager', 'test.sqlite')); - cleanFile(join(__dirname, 'fixtures/multi-enitymanager', 'test1.sqlite')); - - const app: IMidwayApplication = await createApp( - join(__dirname, 'fixtures/multi-enitymanager'), - {} - ); - let result = await createHttpRequest(app).get('/m1').expect(200); - expect(result.text).toEqual('[]'); - - result = await createHttpRequest(app).get('/m1/withEntity').expect(200); - expect(result.text).toEqual('[]'); - - result = await createHttpRequest(app).get('/').expect(200); - expect(result.text).toEqual('[[],[]]'); - - await close(app); - }); - } + it('should test base entity', async () => { + cleanFile(join(__dirname, 'fixtures/base-fn-origin', 'test.sqlite')); + + const app: IMidwayApplication = await createLightApp( + join(__dirname, 'fixtures/base-fn-origin'), + {} + ); + const result = app.getAttr('result'); + + expect(result.includes('b1')).toBeTruthy(); + + await close(app); + }); + + it('test multi entity manager in different component', async () => { + cleanFile(join(__dirname, 'fixtures/multi-enitymanager', 'test.sqlite')); + cleanFile(join(__dirname, 'fixtures/multi-enitymanager', 'test1.sqlite')); + + const app: IMidwayApplication = await createLegacyApp( + join(__dirname, 'fixtures/multi-enitymanager'), + {} + ); + let result = await createHttpRequest(app).get('/m1').expect(200); + expect(result.text).toEqual('[]'); + + result = await createHttpRequest(app).get('/m1/withEntity').expect(200); + expect(result.text).toEqual('[]'); + + result = await createHttpRequest(app).get('/').expect(200); + expect(result.text).toEqual('[[],[]]'); + + await close(app); + }); }); function cleanFile(file) { diff --git a/packages/mock/package.json b/packages/mock/package.json index 1f61dafab422..498840e12251 100644 --- a/packages/mock/package.json +++ b/packages/mock/package.json @@ -29,7 +29,7 @@ }, "license": "MIT", "devDependencies": { - "@midwayjs/core": "^3.18.0", + "@midwayjs/core": "workspace:^", "@midwayjs/logger": "^3.0.0", "@types/amqplib": "0.10.5", "amqplib": "0.10.4", @@ -39,7 +39,6 @@ "ws": "8.18.0" }, "dependencies": { - "@midwayjs/async-hooks-context-manager": "^3.18.0", "@types/superagent": "4.1.14", "@types/supertest": "2.0.16", "js-yaml": "4.1.0", diff --git a/packages/mock/src/creator.ts b/packages/mock/src/creator.ts index 4d1e5bb11c67..60274dd45c65 100644 --- a/packages/mock/src/creator.ts +++ b/packages/mock/src/creator.ts @@ -41,7 +41,6 @@ import * as http from 'http'; import * as https from 'https'; import * as yaml from 'js-yaml'; import * as getRawBody from 'raw-body'; -import { createContextManager } from '@midwayjs/async-hooks-context-manager'; const debug = debuglog('midway:debug'); @@ -61,33 +60,52 @@ function getFileNameWithSuffix(fileName: string) { function createMockWrapApplicationContext() { const container = new MidwayContainer(); + debug(`[mock]: Create mock MidwayContainer, id=${container.id}.`); const bindModuleMap: WeakMap = new WeakMap(); - // 这里设置是因为在 midway 单测中会不断的复用装饰器元信息,又不能清理缓存,所以在这里做一些过滤 + container.onBeforeBind(target => { bindModuleMap.set(target, true); }); + DecoratorManager['_bindModuleMap'] = bindModuleMap; - const originMethod = container.listModule; - - container.listModule = key => { - const modules = originMethod.call(container, key); - if (key === CONFIGURATION_KEY) { - return modules; - } - - return modules.filter((module: any) => { - if (bindModuleMap.has(module)) { - return true; + // 这里设置是因为在 midway 单测中会不断的复用装饰器元信息,又不能清理缓存,所以在这里做一些过滤 + if (!DecoratorManager['_mocked']) { + DecoratorManager['_listModule'] = DecoratorManager.listModule; + DecoratorManager['_saveModule'] = DecoratorManager.saveModule; + DecoratorManager.saveModule = (key, target) => { + if (key === CONFIGURATION_KEY) { + // 防止重复,测试的时候 configuration 会被重复 save + const modules = DecoratorManager['_listModule'](key); + if (modules.some((module: any) => module.target === target.target)) { + return; + } else { + DecoratorManager['_bindModuleMap'].set(target.target, true); + DecoratorManager['_saveModule'](key, target); + } } else { - debug( - '[mock] Filter "%o" module without binding when list module %s.', - module.name ?? module, - key - ); - return false; + DecoratorManager['_saveModule'](key, target); } - }); - }; + }; + DecoratorManager.listModule = key => { + const modules = DecoratorManager['_listModule'](key); + return modules.filter((module: any) => { + if (key === CONFIGURATION_KEY) { + return DecoratorManager['_bindModuleMap'].has(module.target); + } + if (DecoratorManager['_bindModuleMap'].has(module)) { + return true; + } else { + debug( + '[mock]: Filter "%o" module without binding when list module %s.', + module.name ?? module, + key + ); + return false; + } + }); + }; + DecoratorManager['_mocked'] = true; + } return container; } @@ -95,8 +113,7 @@ export async function create< T extends IMidwayFramework >( appDir: string | MockAppConfigurationOptions, - options: MockAppConfigurationOptions = {}, - customFramework?: { new (...args): T } | ComponentModule + options: MockAppConfigurationOptions = {} ): Promise { process.env.MIDWAY_TS_MODE = process.env.MIDWAY_TS_MODE ?? 'true'; @@ -183,18 +200,6 @@ export async function create< ); } - if (!options.imports && customFramework) { - options.imports = await transformFrameworkToConfiguration( - customFramework, - options.moduleLoadType - ); - } - - if (customFramework?.['Configuration']) { - options.imports = customFramework; - customFramework = customFramework['Framework']; - } - if (options.ssl) { const sslConfig = { koa: { @@ -219,35 +224,19 @@ export async function create< await initializeGlobalApplicationContext({ ...options, appDir, - asyncContextManager: createContextManager(), loggerFactory: loggers, - imports: [].concat(options.imports).concat( - options.baseDir - ? await loadModule( - join(options.baseDir, getFileNameWithSuffix('configuration')), - { - safeLoad: true, - loadMode: options.moduleLoadType, - } - ) - : [] - ), }); - if (customFramework) { - return container.getAsync(customFramework as any); + const frameworkService = await container.getAsync(MidwayFrameworkService); + const mainFramework = frameworkService.getMainFramework() as T; + if (mainFramework) { + return mainFramework; } else { - const frameworkService = await container.getAsync(MidwayFrameworkService); - const mainFramework = frameworkService.getMainFramework() as T; - if (mainFramework) { - return mainFramework; - } else { - throw new Error( - `Can not get main framework, please check your ${getFileNameWithSuffix( - 'configuration' - )}.` - ); - } + throw new Error( + `Can not get main framework, please check your ${getFileNameWithSuffix( + 'configuration' + )}.` + ); } } catch (err) { // catch for jest beforeAll can't throw error @@ -261,11 +250,10 @@ export async function create< export async function createApp< T extends IMidwayFramework >( - baseDir: string = process.cwd(), - options?: MockAppConfigurationOptions, - customFramework?: { new (...args): T } | ComponentModule + baseDir: string | MockAppConfigurationOptions, + options?: MockAppConfigurationOptions ): Promise> { - const framework: T = await create(baseDir, options, customFramework); + const framework: T = await create(baseDir, options); return framework.getApplication(); } @@ -384,7 +372,6 @@ export async function createFunctionApp< options.moduleLoadType = pkgJSON?.type === 'module' ? 'esm' : 'commonjs'; - options = options || ({} as any); if (options.baseDir) { await loadModule( join(`${options.baseDir}`, getFileNameWithSuffix('interface')), @@ -682,7 +669,7 @@ export async function createLightApp( options.moduleLoadType = pkgJSON?.type === 'module' ? 'esm' : 'commonjs'; } - return createApp(baseDirOrOptions as string, { + const app = await createApp(baseDirOrOptions as string, { ...options, imports: [ await transformFrameworkToConfiguration( @@ -691,6 +678,22 @@ export async function createLightApp( ), ].concat(options?.imports), }); + + const applicationManager = app + .getApplicationContext() + .get(MidwayApplicationManager); + const apps = applicationManager.getApplications(); + if (apps.length === 1) { + return app; + } else { + // 如果有多个 app,则重置 main app + const frameworkService = app + .getApplicationContext() + .get(MidwayFrameworkService); + // 这里调整是因为 createLightApp 会自动加一个 framework + frameworkService.setMainApp(apps[0].getNamespace()); + return frameworkService.getMainApp(); + } } export async function createBootstrap( diff --git a/packages/mock/src/index.ts b/packages/mock/src/index.ts index 8861cf81a0f8..eef04a4beb42 100644 --- a/packages/mock/src/index.ts +++ b/packages/mock/src/index.ts @@ -6,6 +6,7 @@ export { createLightApp, createBootstrap, } from './creator'; +export * from './legacy'; export * from './client/index'; export { transformFrameworkToConfiguration, processArgsParser } from './utils'; export * from './mock'; diff --git a/packages/mock/src/legacy.ts b/packages/mock/src/legacy.ts new file mode 100644 index 000000000000..a6cebeb81bfd --- /dev/null +++ b/packages/mock/src/legacy.ts @@ -0,0 +1,56 @@ +import { createApp, createFunctionApp, createLightApp } from './creator'; +import { CommonJSFileDetector, IMidwayFramework } from '@midwayjs/core'; +import { defineConfiguration } from '@midwayjs/core/functional'; + +export async function createLegacyApp< + T extends IMidwayFramework +>( + ...args: Parameters +): Promise> { + const appDir = typeof args[0] === 'string' ? args[0] : (args[0] ?? {}).appDir; + const options = (typeof args[0] === 'string' ? args[1] : args[0]) ?? {}; + options.imports = [ + ...(options.imports ?? []), + defineConfiguration({ + namespace: 'legacy', + detector: new CommonJSFileDetector({ + conflictCheck: true, + }), + }), + ]; + return createApp(appDir, options); +} + +export async function createLegacyFunctionApp< + T extends IMidwayFramework +>( + ...args: Parameters +): Promise> { + const appDir = typeof args[0] === 'string' ? args[0] : (args[0] ?? {}).appDir; + const options = (typeof args[0] === 'string' ? args[1] : args[0]) ?? {}; + options.imports = [ + ...(options.imports ?? []), + defineConfiguration({ + namespace: 'legacy', + detector: new CommonJSFileDetector({ + conflictCheck: true, + }), + }), + ]; + return createFunctionApp(appDir, options); +} + +export async function createLegacyLightApp(...args) { + const appDir = typeof args[0] === 'string' ? args[0] : (args[0] ?? {}).appDir; + const options = (typeof args[0] === 'string' ? args[1] : args[0]) ?? {}; + options.imports = [ + ...(options.imports ?? []), + defineConfiguration({ + namespace: 'legacy', + detector: new CommonJSFileDetector({ + conflictCheck: true, + }), + }), + ]; + return createLightApp(appDir, options); +} diff --git a/packages/mock/src/utils.ts b/packages/mock/src/utils.ts index 4398722ecc33..3ee890200a14 100644 --- a/packages/mock/src/utils.ts +++ b/packages/mock/src/utils.ts @@ -67,7 +67,9 @@ export async function transformFrameworkToConfiguration< assert.ok(CustomFramework, `can't found custom framework ${Framework}`); - @Configuration() + @Configuration({ + namespace: new Framework().getFrameworkName(), + }) class CustomConfiguration { async onServerReady(container: IMidwayContainer) { const customFramework = (await container.getAsync( diff --git a/packages/mock/test/fixtures/base-faas-without-yaml/src/configuration.ts b/packages/mock/test/fixtures/base-faas-without-yaml/src/configuration.ts index a4f1cd050d74..5f8d13e6c800 100644 --- a/packages/mock/test/fixtures/base-faas-without-yaml/src/configuration.ts +++ b/packages/mock/test/fixtures/base-faas-without-yaml/src/configuration.ts @@ -1,7 +1,8 @@ -import { Configuration } from '@midwayjs/core'; +import { CommonJSFileDetector, Configuration } from '@midwayjs/core'; import * as faas from '../../../../../faas'; @Configuration({ - imports: [faas] + imports: [faas], + detector: new CommonJSFileDetector(), }) export class ContainerConfiguration { async onReady() { diff --git a/packages/mock/test/new.test.ts b/packages/mock/test/new.test.ts index 2ccffd17bbe7..dfa06f7d66bb 100644 --- a/packages/mock/test/new.test.ts +++ b/packages/mock/test/new.test.ts @@ -1,106 +1,126 @@ import { close, - createApp, - createLightApp, createHttpRequest, - createFunctionApp, - mockContext, - mockHeader, - mockSession, + // mockContext, + // mockHeader, + // mockSession, mockProperty, mockClassProperty, - restoreAllMocks + // restoreAllMocks, + createLegacyLightApp, + createFunctionApp } from '../src'; -import * as Web from '../../web/src'; -import * as Koa from '../../web-koa/src'; -import * as faas from '../../faas/src'; +// import * as Web from '@midwayjs/web'; +// import * as Koa from '@midwayjs/koa'; +// import * as faas from '@midwayjs/faas'; import { join } from 'path'; -import { existsSync } from 'fs'; +// import { existsSync } from 'fs'; import { MidwayContainer, MidwayMockService } from '@midwayjs/core'; -import { BootstrapStarter } from '../../../packages-serverless/midway-fc-starter/src'; +// import { BootstrapStarter } from '@midwayjs/fc-starter'; import { createBootstrap } from '../src/creator'; +// import { createLegacyApp, createLegacyFunctionApp } from '../src/legacy'; describe('/test/new.test.ts', () => { - it('should test create app with framework and with new mode', async () => { - const app = await createApp(join(__dirname, 'fixtures/base-app-egg'), { - imports: [ - Web - ] + // it('should test create app with framework and with new mode', async () => { + // const app = await createLegacyApp(join(__dirname, 'fixtures/base-app-egg'), { + // imports: [ + // Web + // ] + // }); + // const result = await createHttpRequest(app).get('/').query({ name: 'harry' }); + // expect(result.status).toBe(200); + // expect(result.text).toBe('hello world, harry'); + // await close(app, { cleanLogsDir: true, cleanTempDir: true }); + // expect(existsSync(join(__dirname, 'fixtures/base-app-decorator/logs'))).toBeFalsy(); + // expect(existsSync(join(__dirname, 'fixtures/base-app-decorator/run'))).toBeFalsy(); + // }); + + // it('should test create koa app with new mode with mock', async () => { + // const app = await createLegacyApp(join(__dirname, 'fixtures/base-app-koa'), { + // cleanLogsDir: true, + // globalConfig: { + // keys: '123' + // }, + // imports: [ + // Koa + // ] + // }); + // const result = await createHttpRequest(app).get('/').query({ name: 'harry' }); + // expect(result.status).toBe(200); + // expect(result.text).toBe('hello world, harry'); + + // mockContext(app, 'abc', 'ddd'); + // mockHeader(app, 'x-bbb', 'midway'); + // mockSession(app, 'ccc', 'ddd'); + // const result1 = await createHttpRequest(app).get('/mock'); + // expect(result1.status).toBe(200); + // expect(result1.body).toEqual({ + // 'abc': 'ddd', + // 'header': 'midway', + // 'session': 'ddd' + // }); + + // mockProperty(app, 'ccc', 'bbb'); + // expect(app['ccc']).toEqual('bbb'); + + // class BBB { + // invoke() { + // return 'hello'; + // } + // } + + // mockClassProperty(BBB, 'invoke', 'midway'); + // expect(new BBB().invoke).toEqual('midway'); + + // restoreAllMocks(); + // expect(new BBB().invoke()).toEqual('hello'); + + // await close(app, { sleep: 200 }); + // }); + + // it('should test with createLegacyFunctionApp with new mode', async () => { + // const app = await createLegacyFunctionApp(join(__dirname, 'fixtures/base-faas'), { + // imports: [ + // faas + // ], + // starter: new BootstrapStarter() + // }); + // const instance = await app.getServerlessInstance('eventService') as any; + // const result = await instance.handleEvent(); + + // expect(result).toEqual('hello world'); + // await close(app, { cleanLogsDir: true, cleanTempDir: true }); + // }); + + it('should test with entry file', async () => { + const bootstrap = await createBootstrap(join(__dirname, 'fixtures/base-app-bootstrap', 'bootstrap.js'), { + bootstrapMode: 'app' }); - const result = await createHttpRequest(app).get('/').query({ name: 'harry' }); - expect(result.status).toBe(200); - expect(result.text).toBe('hello world, harry'); - await close(app, { cleanLogsDir: true, cleanTempDir: true }); - expect(existsSync(join(__dirname, 'fixtures/base-app-decorator/logs'))).toBeFalsy(); - expect(existsSync(join(__dirname, 'fixtures/base-app-decorator/run'))).toBeFalsy(); - }); + const app = bootstrap.getApp('koa'); - it('should test create koa app with new mode with mock', async () => { - const app = await createApp(join(__dirname, 'fixtures/base-app-koa'), { - cleanLogsDir: true, - globalConfig: { - keys: '123' - } - }, Koa); const result = await createHttpRequest(app).get('/').query({ name: 'harry' }); expect(result.status).toBe(200); expect(result.text).toBe('hello world, harry'); - - mockContext(app, 'abc', 'ddd'); - mockHeader(app, 'x-bbb', 'midway'); - mockSession(app, 'ccc', 'ddd'); - const result1 = await createHttpRequest(app).get('/mock'); - expect(result1.status).toBe(200); - expect(result1.body).toEqual({ - 'abc': 'ddd', - 'header': 'midway', - 'session': 'ddd' - }); - - mockProperty(app, 'ccc', 'bbb'); - expect(app['ccc']).toEqual('bbb'); - - class BBB { - invoke() { - return 'hello'; - } - } - mockClassProperty(BBB, 'invoke', 'midway'); - expect(new BBB().invoke).toEqual('midway'); - - restoreAllMocks(); - expect(new BBB().invoke()).toEqual('hello'); - - await close(app, { sleep: 200}); - }); - - it('should test with createFunctionApp with new mode', async () => { - const app = await createFunctionApp(join(__dirname, 'fixtures/base-faas'), { - imports: [ - faas - ], - starter: new BootstrapStarter(), + console.log('start close'); + await bootstrap.close({ + sleep: 2000 }); - const instance = await app.getServerlessInstance('eventService') as any; - const result = await instance.handleEvent(); - - expect(result).toEqual('hello world'); - await close(app, { cleanLogsDir: true, cleanTempDir: true }); + console.log('close complete'); }); it('should test createLightApp', async () => { - const app = await createLightApp(join(__dirname, 'fixtures/base-app-light')); + const app = await createLegacyLightApp(join(__dirname, 'fixtures/base-app-light')); expect(app).toBeDefined(); await close(app); }); it('should test repeat load', async () => { - const app1 = await createLightApp(join(__dirname, 'fixtures/base-app-replace-load/app1')); + const app1 = await createLegacyLightApp(join(__dirname, 'fixtures/base-app-replace-load/app1')); const homeController1 = await app1.getApplicationContext().getAsync('homeController') as any; expect(await homeController1.index()).toEqual('hello world 1111'); await close(app1); - const app2 = await createLightApp(join(__dirname, 'fixtures/base-app-replace-load/app2')); + const app2 = await createLegacyLightApp(join(__dirname, 'fixtures/base-app-replace-load/app2')); const homeController2 = await app2.getApplicationContext().getAsync('homeController') as any; expect(await homeController2.index()).toEqual('hello world 2222'); await close(app2); @@ -112,6 +132,7 @@ describe('/test/new.test.ts', () => { return 'hello'; } } + mockClassProperty(BBB, 'invoke', 'midway'); const b = new BBB(); @@ -124,22 +145,6 @@ describe('/test/new.test.ts', () => { expect(b['ccc']).toEqual('ab'); }); - it('should test with entry file', async () => { - const bootstrap = await createBootstrap(join(__dirname, 'fixtures/base-app-bootstrap', 'bootstrap.js'), { - bootstrapMode: 'app', - }); - const app = bootstrap.getApp('koa'); - - const result = await createHttpRequest(app).get('/').query({ name: 'harry' }); - expect(result.status).toBe(200); - expect(result.text).toBe('hello world, harry'); - console.log('start close'); - await bootstrap.close({ - sleep: 2000 - }); - console.log('close complete'); - }); - it('should test entry file with faas v3', async () => { const app = await createFunctionApp(join(__dirname, 'fixtures/base-faas-without-yaml'), { entryFile: 'index.js' diff --git a/packages/mongoose/package.json b/packages/mongoose/package.json index 5bcdb7ffa798..1aeb97a2e638 100644 --- a/packages/mongoose/package.json +++ b/packages/mongoose/package.json @@ -22,8 +22,8 @@ }, "license": "MIT", "devDependencies": { - "@midwayjs/core": "^3.18.0", - "@midwayjs/mock": "^3.18.0", + "@midwayjs/core": "workspace:^", + "@midwayjs/mock": "workspace:^", "mongoose": "8.6.3" } } diff --git a/packages/mongoose/scripts/start.sh b/packages/mongoose/scripts/start.sh new file mode 100755 index 000000000000..76096ae8c359 --- /dev/null +++ b/packages/mongoose/scripts/start.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +#docker pull mongo +docker run -d --name mongodb -p 27017:27017 mongo diff --git a/packages/mqtt/package.json b/packages/mqtt/package.json index 3885856d44f3..8fd72a3f4afb 100644 --- a/packages/mqtt/package.json +++ b/packages/mqtt/package.json @@ -23,8 +23,8 @@ ], "license": "MIT", "devDependencies": { - "@midwayjs/core": "^3.18.0", - "@midwayjs/mock": "^3.18.0" + "@midwayjs/core": "workspace:^", + "@midwayjs/mock": "workspace:^" }, "dependencies": { "mqtt": "5.10.0" diff --git a/packages/mqtt/test/index.test.ts b/packages/mqtt/test/index.test.ts index c99527528ec8..d9993bfd5cbd 100644 --- a/packages/mqtt/test/index.test.ts +++ b/packages/mqtt/test/index.test.ts @@ -1,4 +1,4 @@ -import { close, createApp, createLightApp } from '@midwayjs/mock'; +import { close, createLegacyApp, createLightApp } from '@midwayjs/mock'; import { IMidwayApplication, Provide, Scope, ScopeEnum, sleep } from '@midwayjs/core'; import { Framework, IMqttSubscriber, Mqtt, MqttProducerFactory } from '../src'; import { join } from 'path'; @@ -11,7 +11,7 @@ describe('/test/index.test.ts', () => { it('should test subscribe topic and send message', async () => { // create app and got data - const app = await createApp(join(__dirname, 'fixtures', 'base-app')); + const app = await createLegacyApp(join(__dirname, 'fixtures', 'base-app')); await sleep(); expect(app.getAttr('subscribe')).toBe(true); await close(app); @@ -19,7 +19,7 @@ describe('/test/index.test.ts', () => { it('should test subscribe with no pub and sub', async () => { // create app and got data - const app = await createApp(join(__dirname, 'fixtures', 'base-app-no-pub-sub')); + const app = await createLegacyApp(join(__dirname, 'fixtures', 'base-app-no-pub-sub')); await sleep(); await close(app); }); diff --git a/packages/nextjs/.eslintrc.json b/packages/nextjs/.eslintrc.json new file mode 100644 index 000000000000..2b400db2e4a4 --- /dev/null +++ b/packages/nextjs/.eslintrc.json @@ -0,0 +1,4 @@ +{ + "extends": "../../.eslintrc.json", + "ignorePatterns": ["inject.js"] +} diff --git a/packages/async-hooks-context-manager/README.md b/packages/nextjs/README.md similarity index 53% rename from packages/async-hooks-context-manager/README.md rename to packages/nextjs/README.md index e8d858103efe..c6158ce1ff41 100644 --- a/packages/async-hooks-context-manager/README.md +++ b/packages/nextjs/README.md @@ -1,4 +1,6 @@ -# midway-async-hooks-context-manager +# midwayjs nextjs module + +[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/midwayjs/midway/pulls) this is a sub package for midway. diff --git a/packages/nextjs/index.d.ts b/packages/nextjs/index.d.ts new file mode 100644 index 000000000000..ab653bfe6573 --- /dev/null +++ b/packages/nextjs/index.d.ts @@ -0,0 +1,8 @@ +import { NextServerOptions } from 'next/dist/server/next'; +export * from './dist/index'; + +declare module '@midwayjs/core/dist/interface' { + interface MidwayConfig { + next?: NextServerOptions; + } +} diff --git a/packages/nextjs/inject.js b/packages/nextjs/inject.js new file mode 100644 index 000000000000..05310d9e45b3 --- /dev/null +++ b/packages/nextjs/inject.js @@ -0,0 +1,31 @@ +// hack-start-server.js +const path = require('path'); +const startServerModule = require('next/dist/server/lib/start-server'); +const originalStartServer = startServerModule.startServer; +const { Bootstrap } = require('@midwayjs/bootstrap'); + +// create a new startServer function +const newStartServer = async function (options) { + // init midway + Bootstrap.configure({ + baseDir: path.resolve(__dirname, './dist/service'), + }); + await Bootstrap.run(); + + // call the original startServer function + return originalStartServer(options); +}; + +// use Proxy to intercept the access to startServerModule +const proxy = new Proxy(startServerModule, { + get(target, prop, receiver) { + if (prop === 'startServer') { + return newStartServer; + } + return Reflect.get(target, prop, receiver); + }, +}); + +// replace the module in require.cache +const modulePath = require.resolve('next/dist/server/lib/start-server'); +require.cache[modulePath].exports = proxy; diff --git a/packages/async-hooks-context-manager/jest.config.js b/packages/nextjs/jest.config.js similarity index 79% rename from packages/async-hooks-context-manager/jest.config.js rename to packages/nextjs/jest.config.js index 784df0fb05b0..32f109dad85a 100644 --- a/packages/async-hooks-context-manager/jest.config.js +++ b/packages/nextjs/jest.config.js @@ -3,6 +3,6 @@ module.exports = { testEnvironment: 'node', testPathIgnorePatterns: ['/test/fixtures'], coveragePathIgnorePatterns: ['/test/', '/dist/'], - setupFilesAfterEnv: ['./jest.setup.js'], + setupFilesAfterEnv: ['./hack.js', './jest.setup.js'], coverageProvider: 'v8', }; diff --git a/packages/async-hooks-context-manager/jest.setup.js b/packages/nextjs/jest.setup.js similarity index 60% rename from packages/async-hooks-context-manager/jest.setup.js rename to packages/nextjs/jest.setup.js index 53c7930592d0..7d4534462ee6 100644 --- a/packages/async-hooks-context-manager/jest.setup.js +++ b/packages/nextjs/jest.setup.js @@ -1,2 +1,2 @@ process.env.MIDWAY_TS_MODE = 'true'; -jest.setTimeout(30000); +jest.setTimeout(60000); diff --git a/packages/nextjs/package.json b/packages/nextjs/package.json new file mode 100644 index 000000000000..67fd6c8d0dc5 --- /dev/null +++ b/packages/nextjs/package.json @@ -0,0 +1,47 @@ +{ + "name": "@midwayjs/nextjs", + "description": "midway nextjs component", + "version": "3.18.0", + "main": "dist/index.js", + "typings": "index.d.ts", + "files": [ + "dist/**/*.js", + "dist/**/*.d.ts", + "index.d.ts", + "inject.js" + ], + "devDependencies": { + "@midwayjs/core": "workspace:^", + "@midwayjs/mock": "workspace:^", + "@midwayjs/koa": "workspace:^", + "@types/react": "^18.3.12", + "babel-loader": "^9.2.1", + "next": "~15.0.3", + "null-loader": "^4.0.1", + "react": "^18", + "react-dom": "^18" + }, + "keywords": [ + "midway", + "nextjs", + "ssr" + ], + "author": "czy88840616 ", + "license": "MIT", + "scripts": { + "build": "tsc", + "test:prepare": "zx ./test/prepare.mjs", + "test": "npm run test:prepare && node ../../node_modules/jest/bin/jest.js --runInBand --runInBand", + "cov:server": "npm run test:prepare && node ../../node_modules/jest/bin/jest.js --runInBand --coverage --forceExit", + "no-cache-test": "node -r hack.js ../../node_modules/jest/bin/jest.js --runInBand --no-cache", + "ci": "npm run test", + "lint": "mwts check" + }, + "engines": { + "node": ">=12" + }, + "repository": { + "type": "git", + "url": "https://github.com/midwayjs/midway.git" + } +} diff --git a/packages/nextjs/src/configuration.ts b/packages/nextjs/src/configuration.ts new file mode 100644 index 000000000000..b4dffb53a947 --- /dev/null +++ b/packages/nextjs/src/configuration.ts @@ -0,0 +1,22 @@ +import { + Configuration, + Inject, + MidwayApplicationManager, +} from '@midwayjs/core'; +import { NextJSMiddleware } from './middleware'; + +@Configuration({ + namespace: 'nextjs', +}) +export class NextJSConfiguration { + @Inject() + applicationManager: MidwayApplicationManager; + + async onReady() { + this.applicationManager + .getApplications(['koa', 'faas', 'express', 'egg']) + .forEach(app => { + app.useMiddleware(NextJSMiddleware); + }); + } +} diff --git a/packages/nextjs/src/index.ts b/packages/nextjs/src/index.ts new file mode 100644 index 000000000000..f147eeb34632 --- /dev/null +++ b/packages/nextjs/src/index.ts @@ -0,0 +1,2 @@ +export { NextJSConfiguration as Configuration } from './configuration'; +export * from './middleware'; diff --git a/packages/nextjs/src/middleware.ts b/packages/nextjs/src/middleware.ts new file mode 100644 index 000000000000..65fae6ca68a8 --- /dev/null +++ b/packages/nextjs/src/middleware.ts @@ -0,0 +1,76 @@ +import { + Middleware, + IMiddleware, + NextFunction, + Context, + MidwayEnvironmentService, + Inject, + Init, + MidwayWebRouterService, + IMidwayApplication, + MidwayServerlessFunctionService, + Config, +} from '@midwayjs/core'; +import next from 'next'; +// eslint-disable-next-line node/no-deprecated-api +import { parse } from 'url'; + +@Middleware() +export class NextJSMiddleware implements IMiddleware { + @Inject() + env: MidwayEnvironmentService; + protected handle; + protected webRouterService: + | MidwayWebRouterService + | MidwayServerlessFunctionService; + + @Config('next') + protected nextConfig; + + @Inject() + appDir: string; + + @Init() + async init() { + const app = next({ + dev: this.env.isDevelopmentEnvironment(), + dir: this.appDir, + ...this.nextConfig, + }); + this.handle = app.getRequestHandler(); + await app.prepare(); + } + resolve(app: IMidwayApplication) { + if (app.getNamespace() === 'faas') { + this.webRouterService = app + .getApplicationContext() + .get(MidwayServerlessFunctionService); + } else { + this.webRouterService = app + .getApplicationContext() + .get(MidwayWebRouterService); + } + const nextHandler = async (req, res) => { + const parsedUrl = parse(req.url, true); + await this.handle(req, res, parsedUrl); + }; + + return async (ctx: Context, next: NextFunction) => { + const routeInfo = await this.webRouterService.getMatchedRouterInfo( + ctx['path'], + ctx['method'] + ); + if (routeInfo) { + return await next(); + } else { + // 给个默认值 + ctx['res'].statusCode = 200; + await nextHandler(ctx['req'] || ctx, ctx['res']); + } + }; + } + + static getName(): string { + return 'nextjs'; + } +} diff --git a/packages/nextjs/test-utils.js b/packages/nextjs/test-utils.js new file mode 100644 index 000000000000..1151ea44f149 --- /dev/null +++ b/packages/nextjs/test-utils.js @@ -0,0 +1,142 @@ +const http = require('http'); +const glob = require('glob'); +const path = require('path'); +const fs = require('fs'); +const { apiResolver } = (() => { + try { + // Moved here in v13.5 - ref: https://github.com/vercel/next.js/pull/56096 + return require('next/dist/server/api-utils/node/api-resolver'); + } catch (err) { + // Previously lived here + return require('next/dist/server/api-utils/node'); + } +})(); +const { default: loadConfig } = require('next/dist/server/config'); +const { inspect } = require('node:util'); +const { PHASE_TEST } = require('next/constants'); + +const rootPath = path.resolve('.').replace(/\\/g, '/'); + +let pageExtensions = ['ts', 'js']; +if (fs.existsSync(`${rootPath}/next.config.js`)) { + try { + const { pageExtensions: configExtensions } = loadConfig( + PHASE_TEST, + rootPath + ); + if (configExtensions) { + pageExtensions = configExtensions; + } + } catch (error) { + console.warn( + 'could not load pageExtensions config from next, using .ts and .js as default' + ); + } +} + +const nextPagesDirectory = fs.existsSync(`${rootPath}/pages`) + ? `${rootPath}/pages` + : `${rootPath}/src/pages`; + +const handlers = glob + .sync(`${nextPagesDirectory}/api/**/*.+(ts|js)`) + .filter(handler => !handler.includes('.test') && !handler.includes('.spec')); + +const mapping = {}; +handlers.forEach(handler => { + // still got the .js + const handlerName = handler.slice(nextPagesDirectory.length, -3); + const handlerFunction = require(`${nextPagesDirectory}/${handlerName}`); + + let key = handlerName; + for (const ext of pageExtensions) { + if (handler.endsWith(ext)) { + key = handler.slice(nextPagesDirectory.length, -ext.length - 1); + key = key.endsWith('/index') ? key.slice(0, -6) : key; + break; + } + } + mapping[key] = handlerFunction; +}); + +const getDynamicRoute = (routes, url) => { + const urlSplit = url.split('/'); + + for (const route of routes) { + const routeParams = {}; + const routeSplit = route.split('/'); + + if (routeSplit.length !== urlSplit.length) { + continue; + } + + for (let index = 0; index < routeSplit.length; index++) { + const routePath = routeSplit[index]; + const urlPath = urlSplit[index]; + + if (routePath.startsWith('[') && routePath.endsWith(']')) { + // if its a dynamic sub-path extend the route params + routeParams[routePath.substring(1, routePath.length - 1)] = urlPath; + } else if (routePath !== urlPath) { + break; // if the path does not match, check a new route + } + + if (index === routeSplit.length - 1) { + return { + route, + routeParams, + }; + } + } + } +}; + +const getHandler = url => { + const handler = mapping[url]; + + if (handler) { + return { handler }; + } + + const routes = Object.keys(mapping); + const dynamicRoutes = routes.filter( + route => route.includes('[') && route.includes(']') + ); + dynamicRoutes.sort((a, b) => b.length - a.length); // Most specific routes take precedence + + const { route, routeParams } = getDynamicRoute(dynamicRoutes, url); + + return { + handler: mapping[route], + routeParams, + }; +}; + +const requestHandler = (request, response) => { + try { + const [url, queryParams] = request.url.split('?'); + const params = new URLSearchParams(queryParams); + const query = Object.fromEntries(params); + const { handler, routeParams } = getHandler(url); + + return apiResolver( + Object.assign(request, { connection: { remoteAddress: '127.0.0.1' } }), + response, + { ...query, ...routeParams }, + handler, + undefined, + true + ); + } catch (err) { + const message = `Error handling request in nextjs-http-supertest: ${inspect( + err + )}`; + console.error(message); + response.writeHead(500, { 'content-type': 'application/json' }); + response.end(JSON.stringify({ message })); + } +}; + +const server = http.createServer(requestHandler); + +module.exports = server; diff --git a/packages/nextjs/test/fixtures/base-app/.gitignore b/packages/nextjs/test/fixtures/base-app/.gitignore new file mode 100644 index 000000000000..d32cc78b89fc --- /dev/null +++ b/packages/nextjs/test/fixtures/base-app/.gitignore @@ -0,0 +1,40 @@ +# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. + +# dependencies +/node_modules +/.pnp +.pnp.* +.yarn/* +!.yarn/patches +!.yarn/plugins +!.yarn/releases +!.yarn/versions + +# testing +/coverage + +# next.js +/.next/ +/out/ + +# production +/build + +# misc +.DS_Store +*.pem + +# debug +npm-debug.log* +yarn-debug.log* +yarn-error.log* + +# env files (can opt-in for committing if needed) +.env* + +# vercel +.vercel + +# typescript +*.tsbuildinfo +next-env.d.ts diff --git a/packages/nextjs/test/fixtures/base-app/README.md b/packages/nextjs/test/fixtures/base-app/README.md new file mode 100644 index 000000000000..e215bc4ccf13 --- /dev/null +++ b/packages/nextjs/test/fixtures/base-app/README.md @@ -0,0 +1,36 @@ +This is a [Next.js](https://nextjs.org) project bootstrapped with [`create-next-app`](https://nextjs.org/docs/app/api-reference/cli/create-next-app). + +## Getting Started + +First, run the development server: + +```bash +npm run dev +# or +yarn dev +# or +pnpm dev +# or +bun dev +``` + +Open [http://localhost:3000](http://localhost:3000) with your browser to see the result. + +You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file. + +This project uses [`next/font`](https://nextjs.org/docs/app/building-your-application/optimizing/fonts) to automatically optimize and load [Geist](https://vercel.com/font), a new font family for Vercel. + +## Learn More + +To learn more about Next.js, take a look at the following resources: + +- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API. +- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial. + +You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js) - your feedback and contributions are welcome! + +## Deploy on Vercel + +The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js. + +Check out our [Next.js deployment documentation](https://nextjs.org/docs/app/building-your-application/deploying) for more details. diff --git a/packages/nextjs/test/fixtures/base-app/bootstrap.js b/packages/nextjs/test/fixtures/base-app/bootstrap.js new file mode 100644 index 000000000000..9c096c2a82c8 --- /dev/null +++ b/packages/nextjs/test/fixtures/base-app/bootstrap.js @@ -0,0 +1,2 @@ +const { Bootstrap } = require('@midwayjs/bootstrap'); +Bootstrap.run(); diff --git a/packages/nextjs/test/fixtures/base-app/next.config.ts b/packages/nextjs/test/fixtures/base-app/next.config.ts new file mode 100644 index 000000000000..89263ecedcc3 --- /dev/null +++ b/packages/nextjs/test/fixtures/base-app/next.config.ts @@ -0,0 +1,27 @@ +import type { NextConfig } from "next"; + +const nextConfig: NextConfig = { + /* config options here */ + eslint: { + ignoreDuringBuilds: true, + }, + typescript: { + ignoreBuildErrors: true, + }, + webpack: (config, { isServer }) => { + if (isServer) { + const externals = [ + '@midwayjs/core', + '@midwayjs/core/functional', + ]; + + config.externals = [ + ...externals, + ...(Array.isArray(config.externals) ? config.externals : []), + ]; + } + return config; + }, +}; + +export default nextConfig; diff --git a/packages/nextjs/test/fixtures/base-app/package.json b/packages/nextjs/test/fixtures/base-app/package.json new file mode 100644 index 000000000000..7d459b93439e --- /dev/null +++ b/packages/nextjs/test/fixtures/base-app/package.json @@ -0,0 +1,22 @@ +{ + "name": "base-app", + "version": "0.1.0", + "private": true, + "scripts": { + "dev": "next dev", + "build": "next build", + "start": "next start", + "lint": "next lint" + }, + "dependencies": { + "react": "19.0.0-rc-66855b96-20241106", + "react-dom": "19.0.0-rc-66855b96-20241106", + "next": "15.0.3" + }, + "devDependencies": { + "typescript": "^5", + "@types/node": "^20", + "@types/react": "^18", + "@types/react-dom": "^18" + } +} diff --git a/packages/nextjs/test/fixtures/base-app/public/file.svg b/packages/nextjs/test/fixtures/base-app/public/file.svg new file mode 100644 index 000000000000..004145cddf3f --- /dev/null +++ b/packages/nextjs/test/fixtures/base-app/public/file.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/packages/nextjs/test/fixtures/base-app/public/globe.svg b/packages/nextjs/test/fixtures/base-app/public/globe.svg new file mode 100644 index 000000000000..567f17b0d7c7 --- /dev/null +++ b/packages/nextjs/test/fixtures/base-app/public/globe.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/packages/nextjs/test/fixtures/base-app/public/next.svg b/packages/nextjs/test/fixtures/base-app/public/next.svg new file mode 100644 index 000000000000..5174b28c565c --- /dev/null +++ b/packages/nextjs/test/fixtures/base-app/public/next.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/packages/nextjs/test/fixtures/base-app/public/vercel.svg b/packages/nextjs/test/fixtures/base-app/public/vercel.svg new file mode 100644 index 000000000000..77053960334e --- /dev/null +++ b/packages/nextjs/test/fixtures/base-app/public/vercel.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/packages/nextjs/test/fixtures/base-app/public/window.svg b/packages/nextjs/test/fixtures/base-app/public/window.svg new file mode 100644 index 000000000000..b2b2a44f6ebc --- /dev/null +++ b/packages/nextjs/test/fixtures/base-app/public/window.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/packages/nextjs/test/fixtures/base-app/src/app/favicon.ico b/packages/nextjs/test/fixtures/base-app/src/app/favicon.ico new file mode 100644 index 000000000000..718d6fea4835 Binary files /dev/null and b/packages/nextjs/test/fixtures/base-app/src/app/favicon.ico differ diff --git a/packages/nextjs/test/fixtures/base-app/src/app/layout.tsx b/packages/nextjs/test/fixtures/base-app/src/app/layout.tsx new file mode 100644 index 000000000000..4fafd86b4877 --- /dev/null +++ b/packages/nextjs/test/fixtures/base-app/src/app/layout.tsx @@ -0,0 +1,20 @@ +import type { Metadata } from "next"; + +export const metadata: Metadata = { + title: "Create Next App", + description: "Generated by create next app", +}; + +export default function RootLayout({ + children, +}: Readonly<{ + children: React.ReactNode; +}>) { + return ( + + + {children} + + + ); +} diff --git a/packages/nextjs/test/fixtures/base-app/src/app/page.tsx b/packages/nextjs/test/fixtures/base-app/src/app/page.tsx new file mode 100644 index 000000000000..4831c6f65762 --- /dev/null +++ b/packages/nextjs/test/fixtures/base-app/src/app/page.tsx @@ -0,0 +1,11 @@ +import { useInject } from '@midwayjs/core/functional'; +export const dynamic = 'force-dynamic' + +export default async function Home() { + const result = (await useInject<{ hello(): Promise }>('test')).hello(); + return ( +
+

{result}

+
+ ); +} diff --git a/packages/nextjs/test/fixtures/base-app/src/index.ts b/packages/nextjs/test/fixtures/base-app/src/index.ts new file mode 100644 index 000000000000..af1044223393 --- /dev/null +++ b/packages/nextjs/test/fixtures/base-app/src/index.ts @@ -0,0 +1,37 @@ +import { CustomModuleDetector, Provide } from '@midwayjs/core'; +import { defineConfiguration, useMainApp } from '@midwayjs/core/functional'; +import * as Next from '../../../../src'; +import * as Koa from '@midwayjs/koa'; +import assert from 'node:assert'; + +@Provide() +class Test { + async hello() { + return 'Hello World'; + } +} + +export default defineConfiguration({ + importConfigs: [ + { + default: { + koa: { + keys: ['test'], + port: 3000, + }, + next: { + dev: false, + } + }, + } + ], + imports: [Koa, Next], + detector: new CustomModuleDetector({ + modules: [ + Test, + ] + }), + onReady: async (container) => { + assert(useMainApp()); + }, +}); diff --git a/packages/nextjs/test/fixtures/base-app/tsconfig.json b/packages/nextjs/test/fixtures/base-app/tsconfig.json new file mode 100644 index 000000000000..b547d7029847 --- /dev/null +++ b/packages/nextjs/test/fixtures/base-app/tsconfig.json @@ -0,0 +1,29 @@ +{ + "compilerOptions": { + "target": "ES2017", + "lib": ["dom", "dom.iterable", "esnext"], + "allowJs": true, + "skipLibCheck": true, + "strict": true, + "noEmit": true, + "esModuleInterop": true, + "emitDecoratorMetadata": true, + "experimentalDecorators": true, + "module": "esnext", + "moduleResolution": "bundler", + "resolveJsonModule": true, + "isolatedModules": true, + "jsx": "preserve", + "incremental": true, + "plugins": [ + { + "name": "next" + } + ], + "paths": { + "@/*": ["./src/*"] + } + }, + "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"], + "exclude": ["node_modules"] +} diff --git a/packages/nextjs/test/fixtures/base-app/tsconfig.midway.json b/packages/nextjs/test/fixtures/base-app/tsconfig.midway.json new file mode 100644 index 000000000000..10b572e23d4f --- /dev/null +++ b/packages/nextjs/test/fixtures/base-app/tsconfig.midway.json @@ -0,0 +1,25 @@ +{ + "compileOnSave": true, + "compilerOptions": { + "target": "ES2020", + "module": "Node16", + "moduleResolution": "node16", + "esModuleInterop": true, + "experimentalDecorators": true, + "emitDecoratorMetadata": true, + "inlineSourceMap": true, + "inlineSources": true, + "noImplicitThis": false, + "noUnusedLocals": true, + "stripInternal": true, + "skipLibCheck": true, + "pretty": true, + "declaration": true, + "forceConsistentCasingInFileNames": true, + "outDir": "dist", + "rootDir": "src" + }, + "include": [ + "src/index.ts" + ] +} \ No newline at end of file diff --git a/packages/nextjs/test/index.test.ts b/packages/nextjs/test/index.test.ts new file mode 100644 index 000000000000..8b809f79ae4f --- /dev/null +++ b/packages/nextjs/test/index.test.ts @@ -0,0 +1,14 @@ +import { createApp, createHttpRequest, close } from '@midwayjs/mock'; +import { join } from 'path'; + +describe('index.test.ts', () => { + it('should work with koa and nextjs page router', async () => { + const app = await createApp(join(__dirname, 'fixtures', 'base-app')); + const result = await createHttpRequest(app).get('/'); + expect(result.headers['content-type']).toMatch(/text\/html/); + expect(result.text).toMatch(/Hello World/); + expect(result.status).toBe(200); + + await close(app); + }); +}); diff --git a/packages/nextjs/test/prepare.mjs b/packages/nextjs/test/prepare.mjs new file mode 100644 index 000000000000..82d969f9ba42 --- /dev/null +++ b/packages/nextjs/test/prepare.mjs @@ -0,0 +1,11 @@ +#!/usr/bin/env zx + +// 排除 .next 目录,只查找实际的项目目录 +const fixtures = await $`find test/fixtures -type f -name package.json -not -path "*/\.*/*"`.text() + +for (const fixture of fixtures.split('\n').filter(Boolean)) { + // 获取 package.json 所在目录 + const dir = path.dirname(fixture) + cd(dir) + await $`pnpm run build`.verbose() +} diff --git a/packages/async-hooks-context-manager/tsconfig.json b/packages/nextjs/tsconfig.json similarity index 64% rename from packages/async-hooks-context-manager/tsconfig.json rename to packages/nextjs/tsconfig.json index 324fe88c9b14..f4b1e21aefb3 100644 --- a/packages/async-hooks-context-manager/tsconfig.json +++ b/packages/nextjs/tsconfig.json @@ -3,9 +3,11 @@ "compileOnSave": true, "compilerOptions": { "rootDir": "src", - "outDir": "dist" + "outDir": "dist", + "esModuleInterop": true }, "include": [ "./src/**/*.ts" - ] + ], + "noImplicitThis": false } diff --git a/packages/oss/package.json b/packages/oss/package.json index fcf36d96613f..d43e085c3996 100644 --- a/packages/oss/package.json +++ b/packages/oss/package.json @@ -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": { diff --git a/packages/otel/package.json b/packages/otel/package.json index 0ee416ab4b92..9e8b1dbc89c1 100644 --- a/packages/otel/package.json +++ b/packages/otel/package.json @@ -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:^", "@opentelemetry/sdk-node": "0.53.0", "@opentelemetry/sdk-trace-base": "1.26.0", "@opentelemetry/sdk-trace-node": "1.26.0" diff --git a/packages/otel/test/index.test.ts b/packages/otel/test/index.test.ts index 9f6c7e4d81c4..5944cacfa647 100644 --- a/packages/otel/test/index.test.ts +++ b/packages/otel/test/index.test.ts @@ -1,7 +1,7 @@ import { SimpleSpanProcessor, InMemorySpanExporter} from '@opentelemetry/sdk-trace-base'; import { NodeTracerProvider } from '@opentelemetry/sdk-trace-node'; import { join } from 'path'; -import { createApp, close, createHttpRequest } from '@midwayjs/mock'; +import { createLegacyApp, close, createHttpRequest } from '@midwayjs/mock'; import { UserService } from './fixtures/base-app/src/user.service'; describe('/test/index.test.ts', () => { @@ -12,7 +12,7 @@ describe('/test/index.test.ts', () => { provider.addSpanProcessor(new SimpleSpanProcessor(inMemorySpanExporter)); provider.register(); - let app = await createApp(join(__dirname, './fixtures/base-app')); + let app = await createLegacyApp(join(__dirname, './fixtures/base-app')); const userService = await app.getApplicationContext().getAsync(UserService); const data = await userService.invoke(); expect(data).toEqual({ diff --git a/packages/passport/package.json b/packages/passport/package.json index 487ca2c0283b..c089ae7127bf 100644 --- a/packages/passport/package.json +++ b/packages/passport/package.json @@ -22,12 +22,12 @@ "author": "Nawbc", "license": "MIT", "devDependencies": { - "@midwayjs/core": "^3.18.0", - "@midwayjs/express": "^3.18.0", - "@midwayjs/jwt": "^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/jwt": "workspace:^", + "@midwayjs/koa": "workspace:^", + "@midwayjs/mock": "workspace:^", + "@midwayjs/web": "workspace:^", "@types/passport-local": "1.0.38", "express-session": "1.18.0", "passport-http-bearer": "1.0.1", diff --git a/packages/passport/test/fixtures/passport-express-fail/src/configuration.ts b/packages/passport/test/fixtures/passport-express-fail/src/configuration.ts index 2cda842a59d8..dd21f41958b9 100644 --- a/packages/passport/test/fixtures/passport-express-fail/src/configuration.ts +++ b/packages/passport/test/fixtures/passport-express-fail/src/configuration.ts @@ -30,7 +30,6 @@ export class AuthMiddleware extends PassportMiddleware(MyStrategy) { express, require('../../../../src') ], - conflictCheck: true, importConfigs: [path.join(__dirname, 'config')], }) export class ContainerLifeCycle { diff --git a/packages/passport/test/fixtures/passport-express-jwt/src/configuration.ts b/packages/passport/test/fixtures/passport-express-jwt/src/configuration.ts index 4cf37745ee24..3ea458ad68b8 100644 --- a/packages/passport/test/fixtures/passport-express-jwt/src/configuration.ts +++ b/packages/passport/test/fixtures/passport-express-jwt/src/configuration.ts @@ -7,7 +7,6 @@ import * as express from '@midwayjs/express'; @Configuration({ imports: [express, passport, jwt], - conflictCheck: true, importConfigs: [path.join(__dirname, './config')], }) export class ContainerLifeCycle { diff --git a/packages/passport/test/fixtures/passport-express-session/src/configuration.ts b/packages/passport/test/fixtures/passport-express-session/src/configuration.ts index 7d789cf98f40..2de16a749aef 100644 --- a/packages/passport/test/fixtures/passport-express-session/src/configuration.ts +++ b/packages/passport/test/fixtures/passport-express-session/src/configuration.ts @@ -42,7 +42,6 @@ export class AuthMiddleware extends PassportMiddleware(CustomStrategy) { express, require('../../../../src') ], - conflictCheck: true, importConfigs: [path.join(__dirname, 'config')], }) export class ContainerLifeCycle { diff --git a/packages/passport/test/fixtures/passport-express/src/configuration.ts b/packages/passport/test/fixtures/passport-express/src/configuration.ts index 98bd9e24ef34..ab569183e1d2 100644 --- a/packages/passport/test/fixtures/passport-express/src/configuration.ts +++ b/packages/passport/test/fixtures/passport-express/src/configuration.ts @@ -31,7 +31,6 @@ export class AuthMiddleware extends PassportMiddleware(MyStrategy) { express, require('../../../../src') ], - conflictCheck: true, importConfigs: [path.join(__dirname, 'config')], }) export class ContainerLifeCycle { diff --git a/packages/passport/test/fixtures/passport-koa-bearer-fail/src/configuration.ts b/packages/passport/test/fixtures/passport-koa-bearer-fail/src/configuration.ts index f85e7f831e17..003b060d2758 100644 --- a/packages/passport/test/fixtures/passport-koa-bearer-fail/src/configuration.ts +++ b/packages/passport/test/fixtures/passport-koa-bearer-fail/src/configuration.ts @@ -33,7 +33,6 @@ export class AuthMiddleware extends PassportMiddleware(BearerStrategy) { @Configuration({ imports: [koa, require('../../../../src')], - conflictCheck: true, importConfigs: [path.join(__dirname, 'config')], }) export class ContainerLifeCycle { diff --git a/packages/passport/test/fixtures/passport-koa-fail/src/configuration.ts b/packages/passport/test/fixtures/passport-koa-fail/src/configuration.ts index 64e81c582b8a..890f1d6d813f 100644 --- a/packages/passport/test/fixtures/passport-koa-fail/src/configuration.ts +++ b/packages/passport/test/fixtures/passport-koa-fail/src/configuration.ts @@ -35,7 +35,6 @@ export class AuthMiddleware extends PassportMiddleware(CustomStrategy) { @Configuration({ imports: [koa, require('../../../../src')], - conflictCheck: true, importConfigs: [path.join(__dirname, 'config')], }) export class ContainerLifeCycle { diff --git a/packages/passport/test/fixtures/passport-koa-jwt-global/src/configuration.ts b/packages/passport/test/fixtures/passport-koa-jwt-global/src/configuration.ts index 6cffa0cbfc02..29b426307daf 100644 --- a/packages/passport/test/fixtures/passport-koa-jwt-global/src/configuration.ts +++ b/packages/passport/test/fixtures/passport-koa-jwt-global/src/configuration.ts @@ -7,7 +7,6 @@ import { JwtPassportMiddleware } from './jwt.middleware'; @Configuration({ imports: [koa, passport, jwt], - conflictCheck: true, importConfigs: [path.join(__dirname, './config')], }) export class ContainerLifeCycle { diff --git a/packages/passport/test/fixtures/passport-koa-jwt/src/configuration.ts b/packages/passport/test/fixtures/passport-koa-jwt/src/configuration.ts index 942c9538a84f..39bac5433efb 100644 --- a/packages/passport/test/fixtures/passport-koa-jwt/src/configuration.ts +++ b/packages/passport/test/fixtures/passport-koa-jwt/src/configuration.ts @@ -6,7 +6,6 @@ import * as koa from '@midwayjs/koa'; @Configuration({ imports: [koa, passport, jwt], - conflictCheck: true, importConfigs: [path.join(__dirname, './config')], }) export class ContainerLifeCycle {} diff --git a/packages/passport/test/fixtures/passport-koa-openid/src/configuration.ts b/packages/passport/test/fixtures/passport-koa-openid/src/configuration.ts index e9cafc295126..5aa3ad5d3dff 100644 --- a/packages/passport/test/fixtures/passport-koa-openid/src/configuration.ts +++ b/packages/passport/test/fixtures/passport-koa-openid/src/configuration.ts @@ -39,7 +39,6 @@ export class AuthMiddleware extends PassportMiddleware(CRCCStrategy) { @Configuration({ imports: [koa, require('../../../../src')], - conflictCheck: true, importConfigs: [path.join(__dirname, 'config')], }) export class ContainerLifeCycle { diff --git a/packages/passport/test/fixtures/passport-koa-session/src/configuration.ts b/packages/passport/test/fixtures/passport-koa-session/src/configuration.ts index df191e0c3a11..3eab1d22e7f5 100644 --- a/packages/passport/test/fixtures/passport-koa-session/src/configuration.ts +++ b/packages/passport/test/fixtures/passport-koa-session/src/configuration.ts @@ -49,7 +49,6 @@ export class AuthMiddleware extends PassportMiddleware(CustomStrategy) { @Configuration({ imports: [koa, require('../../../../src')], - conflictCheck: true, importConfigs: [path.join(__dirname, 'config')], }) export class ContainerLifeCycle { diff --git a/packages/passport/test/fixtures/passport-web/src/configuration.ts b/packages/passport/test/fixtures/passport-web/src/configuration.ts index 5d486c85ff23..f56ec5108ba8 100644 --- a/packages/passport/test/fixtures/passport-web/src/configuration.ts +++ b/packages/passport/test/fixtures/passport-web/src/configuration.ts @@ -6,7 +6,6 @@ import { AuthMiddleware } from './local.middleware'; @Configuration({ imports: [egg, passport], - conflictCheck: true, importConfigs: [path.join(__dirname, 'config')], }) export class ContainerLifeCycle { diff --git a/packages/passport/test/index.test.ts b/packages/passport/test/index.test.ts index f73c573ed902..40896721e494 100644 --- a/packages/passport/test/index.test.ts +++ b/packages/passport/test/index.test.ts @@ -1,10 +1,10 @@ -import { createApp, close, createHttpRequest } from '@midwayjs/mock'; +import { createLegacyApp, close, createHttpRequest } from '@midwayjs/mock'; import { join } from 'path'; describe('/test/index.test.ts', () => { describe('Express passport', () => { it('basic local auth', async () => { - const app = await createApp( + const app = await createLegacyApp( join(__dirname, 'fixtures', 'passport-express'), {}, ); @@ -27,7 +27,7 @@ describe('/test/index.test.ts', () => { }); it('should test passport all fail', async () => { - const app = await createApp( + const app = await createLegacyApp( join(__dirname, 'fixtures', 'passport-express-fail'), {}, ); @@ -41,7 +41,7 @@ describe('/test/index.test.ts', () => { }); it('passport with session', async () => { - const app = await createApp( + const app = await createLegacyApp( join(__dirname, 'fixtures', 'passport-express-session'), {}, ); @@ -74,7 +74,7 @@ describe('/test/index.test.ts', () => { it('jwt passport with express', async () => { let token; - const app = await createApp( + const app = await createLegacyApp( join(__dirname, 'fixtures', 'passport-express-jwt'), {}, ); @@ -96,7 +96,7 @@ describe('/test/index.test.ts', () => { describe('Egg passport', () => { it('test passport with egg', async () => { - const app = await createApp( + const app = await createLegacyApp( join(__dirname, 'fixtures', 'passport-web'), {}, ); @@ -129,7 +129,7 @@ describe('/test/index.test.ts', () => { describe('koa passport', () => { it('should start koa app and session with passport', async () => { - const app = await createApp( + const app = await createLegacyApp( join(__dirname, 'fixtures', 'passport-koa-session'), {}, ); @@ -160,7 +160,7 @@ describe('/test/index.test.ts', () => { }); it('should test passport all fail', async () => { - const app = await createApp( + const app = await createLegacyApp( join(__dirname, 'fixtures', 'passport-koa-fail'), {}, ); @@ -174,7 +174,7 @@ describe('/test/index.test.ts', () => { }); it('should test passport all fail - http-bearer', async () => { - const app = await createApp( + const app = await createLegacyApp( join(__dirname, 'fixtures', 'passport-koa-bearer-fail'), {}, ); @@ -190,7 +190,7 @@ describe('/test/index.test.ts', () => { it('jwt passport with koa', async () => { let token; - const app = await createApp( + const app = await createLegacyApp( join(__dirname, 'fixtures', 'passport-koa-jwt'), {}, ); @@ -211,7 +211,7 @@ describe('/test/index.test.ts', () => { it('jwt passport with koa and global middleware', async () => { let token; - const app = await createApp( + const app = await createLegacyApp( join(__dirname, 'fixtures', 'passport-koa-jwt-global'), {}, ); @@ -231,7 +231,7 @@ describe('/test/index.test.ts', () => { }); it('should test with open id', async () => { - const app = await createApp( + const app = await createLegacyApp( join(__dirname, 'fixtures', 'passport-koa-openid'), {}, ); diff --git a/packages/processAgent/package.json b/packages/processAgent/package.json index e37827facc69..92427efc9957 100644 --- a/packages/processAgent/package.json +++ b/packages/processAgent/package.json @@ -25,9 +25,9 @@ }, "license": "MIT", "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:^", "koa-bodyparser": "4.4.1" }, "dependencies": { diff --git a/packages/processAgent/test/fixtures/primary-demo/src/configuration.ts b/packages/processAgent/test/fixtures/primary-demo/src/configuration.ts index eab11fcfe7dc..7bfe7439c7a0 100644 --- a/packages/processAgent/test/fixtures/primary-demo/src/configuration.ts +++ b/packages/processAgent/test/fixtures/primary-demo/src/configuration.ts @@ -5,7 +5,6 @@ import * as primary from '../../../../src' @Configuration({ imports: [primary], - conflictCheck: true, importConfigs: [ { default: { diff --git a/packages/processAgent/test/index.test.ts b/packages/processAgent/test/index.test.ts index 830d055432eb..2c7bc7fceff9 100644 --- a/packages/processAgent/test/index.test.ts +++ b/packages/processAgent/test/index.test.ts @@ -1,12 +1,14 @@ -import { createApp, close } from '@midwayjs/mock'; -import { Framework } from '@midwayjs/koa'; +import { createLegacyApp, close } from '@midwayjs/mock'; +import * as koa from '@midwayjs/koa'; import { join } from 'path'; describe('/test/index.test.ts', () => { let app = null; beforeAll(async () => { - app = await createApp(join(__dirname, 'fixtures', 'primary-demo'), {}, Framework); + app = await createLegacyApp(join(__dirname, 'fixtures', 'primary-demo'), { + imports: [koa], + }); }); afterAll(async () => { diff --git a/packages/prometheus-socket-io/package.json b/packages/prometheus-socket-io/package.json index 8fcc37e48c79..e8dae2e87b89 100644 --- a/packages/prometheus-socket-io/package.json +++ b/packages/prometheus-socket-io/package.json @@ -22,12 +22,12 @@ ], "license": "MIT", "devDependencies": { - "@midwayjs/core": "^3.18.0", - "@midwayjs/koa": "^3.18.0", - "@midwayjs/mock": "^3.18.0", - "@midwayjs/prometheus": "^3.18.0", - "@midwayjs/socketio": "^3.18.0", - "@midwayjs/web": "^3.18.0", + "@midwayjs/core": "workspace:^", + "@midwayjs/koa": "workspace:^", + "@midwayjs/mock": "workspace:^", + "@midwayjs/prometheus": "workspace:^", + "@midwayjs/socketio": "workspace:^", + "@midwayjs/web": "workspace:^", "egg": "^2.28.0" }, "engines": { diff --git a/packages/prometheus-socket-io/test/fixtures/test-prometheus-socket-io/src/configuration.ts b/packages/prometheus-socket-io/test/fixtures/test-prometheus-socket-io/src/configuration.ts index ab017714d486..7d140391ed7e 100644 --- a/packages/prometheus-socket-io/test/fixtures/test-prometheus-socket-io/src/configuration.ts +++ b/packages/prometheus-socket-io/test/fixtures/test-prometheus-socket-io/src/configuration.ts @@ -15,7 +15,6 @@ import * as SocketIO from '@midwayjs/socketio'; prometheusSocketIO ], importConfigs: [join(__dirname, './config')], - conflictCheck: true, }) export class ContainerLifeCycle implements ILifeCycle { @App('socketIO') diff --git a/packages/prometheus-socket-io/test/index.test.ts b/packages/prometheus-socket-io/test/index.test.ts index 740acb7b5a7b..4e07e88a0b50 100644 --- a/packages/prometheus-socket-io/test/index.test.ts +++ b/packages/prometheus-socket-io/test/index.test.ts @@ -1,10 +1,10 @@ -import { createApp, createHttpRequest, close } from '@midwayjs/mock'; +import { createLegacyApp, createHttpRequest, close } from '@midwayjs/mock'; import { join } from 'path'; describe('/test/index.test.ts', () => { it('should get metrics', async() => { - const app = await createApp(join(__dirname, './fixtures/test-prometheus-socket-io')); + const app = await createLegacyApp(join(__dirname, './fixtures/test-prometheus-socket-io')); const result = await createHttpRequest(app) .get('/metrics'); diff --git a/packages/prometheus/package.json b/packages/prometheus/package.json index 268be66af9b4..5d60803a3ca9 100644 --- a/packages/prometheus/package.json +++ b/packages/prometheus/package.json @@ -23,9 +23,9 @@ ], "license": "MIT", "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/request": "2.48.12" }, "dependencies": { diff --git a/packages/prometheus/test/index.test.ts b/packages/prometheus/test/index.test.ts index 9166e3f9610c..353c6a77eace 100644 --- a/packages/prometheus/test/index.test.ts +++ b/packages/prometheus/test/index.test.ts @@ -1,12 +1,14 @@ -import { createApp, close, createHttpRequest } from '@midwayjs/mock'; -import { Framework } from '@midwayjs/koa'; +import { createLegacyApp, close, createHttpRequest } from '@midwayjs/mock'; +import * as koa from '@midwayjs/koa'; import { join } from 'path'; describe('/test/index.test.ts', () => { let app = null; beforeAll(async () => { - app = await createApp(join(__dirname, 'fixtures', 'base-app'), {}, Framework); + app = await createLegacyApp(join(__dirname, 'fixtures', 'base-app'), { + imports: [koa], + }); }); afterAll(async () => { diff --git a/packages/rabbitmq/package.json b/packages/rabbitmq/package.json index ea781991e200..9c0f2d782eed 100644 --- a/packages/rabbitmq/package.json +++ b/packages/rabbitmq/package.json @@ -24,13 +24,13 @@ ], "license": "MIT", "devDependencies": { - "@midwayjs/mock": "^3.18.0", + "@midwayjs/core": "workspace:^", "@types/amqplib": "0.10.5", "amqplib": "0.10.4", "fs-extra": "11.2.0" }, "dependencies": { - "@midwayjs/core": "^3.18.0", + "@midwayjs/core": "workspace:^", "amqp-connection-manager": "4.1.14" }, "peerDependencies": { diff --git a/packages/rabbitmq/scripts/start.sh b/packages/rabbitmq/scripts/start.sh new file mode 100755 index 000000000000..4f999d1f3878 --- /dev/null +++ b/packages/rabbitmq/scripts/start.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +#docker pull rabbitmq:management +docker run -d --name rabbitmq -p 5672:5672 rabbitmq diff --git a/packages/rabbitmq/test/utils.ts b/packages/rabbitmq/test/utils.ts index de0ca1a2f6bb..13562d1b5c4c 100644 --- a/packages/rabbitmq/test/utils.ts +++ b/packages/rabbitmq/test/utils.ts @@ -1,7 +1,7 @@ import { Framework, IMidwayRabbitMQApplication, IMidwayRabbitMQConfigurationOptions } from '../src'; import * as rabbitmq from '../src'; import { join } from 'path'; -import { close, createApp } from '@midwayjs/mock'; +import { close, createLegacyApp } from '@midwayjs/mock'; /** * create a rabbitMQ app @@ -9,7 +9,9 @@ import { close, createApp } from '@midwayjs/mock'; * @param options */ export async function creatApp(name: string, options?: IMidwayRabbitMQConfigurationOptions): Promise { - return createApp(join(__dirname, 'fixtures', name), options, rabbitmq); + return createLegacyApp(join(__dirname, 'fixtures', name), Object.assign({ + imports: [rabbitmq] + }, options)); } export async function closeApp(app) { diff --git a/packages/redis/package.json b/packages/redis/package.json index c1d56a0e78b8..924f750b92e7 100644 --- a/packages/redis/package.json +++ b/packages/redis/package.json @@ -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": { "ioredis": "5.4.1" diff --git a/packages/security/package.json b/packages/security/package.json index a392080fc787..8eab38bd8d0a 100644 --- a/packages/security/package.json +++ b/packages/security/package.json @@ -30,11 +30,11 @@ "xss": "1.0.15" }, "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:^" } } diff --git a/packages/security/test/base.test.ts b/packages/security/test/base.test.ts index 2eb2b8cc06ef..e990e2754064 100644 --- a/packages/security/test/base.test.ts +++ b/packages/security/test/base.test.ts @@ -1,5 +1,5 @@ -import { close, createApp, createFunctionApp, createHttpRequest } from '@midwayjs/mock'; +import { close, createLegacyApp, createLegacyFunctionApp, createHttpRequest } from '@midwayjs/mock'; import { join } from 'path'; import * as assert from 'assert'; import { readFileSync, copy, writeFile, remove } from 'fs-extra'; @@ -45,7 +45,7 @@ describe(`test/${type}.test.ts`, function () { await remove(join(appDir, 'f.yml')); await writeFile(configuration, csrfConfigurationCode.replace(/\$\{\s*framework\s*\}/g, `@midwayjs/koa`)); await writeFile(config, readFileSync(config, 'utf-8') + `\nexport const security = {};`); - app = await createApp(appDir); + app = await createLegacyApp(appDir); }); afterAll(async () => { @@ -78,7 +78,7 @@ describe(`test/${type}.test.ts`, function () { await remove(join(appDir, 'f.yml')); await writeFile(configuration, csrfConfigurationCode.replace(/\$\{\s*framework\s*\}/g, `@midwayjs/web`)); await writeFile(config, readFileSync(config, 'utf-8') + `\nexport const security = {};`); - app = await createApp(appDir); + app = await createLegacyApp(appDir); }); afterAll(async () => { @@ -111,7 +111,7 @@ describe(`test/${type}.test.ts`, function () { await remove(join(appDir, 'f.yml')); await writeFile(configuration, csrfConfigurationCode.replace(/\$\{\s*framework\s*\}/g, `@midwayjs/express`)); await writeFile(config, readFileSync(config, 'utf-8') + `\nexport const security = {};`); - app = await createApp(appDir); + app = await createLegacyApp(appDir); }); afterAll(async () => { @@ -142,7 +142,7 @@ describe(`test/${type}.test.ts`, function () { await copy(csrfBase, appDir); await writeFile(configuration, csrfConfigurationCode.replace(/\$\{\s*framework\s*\}/g, `@midwayjs/faas`)); await writeFile(config, readFileSync(config, 'utf-8') + `\nexport const security = {};`); - app = await createFunctionApp(appDir, {}); + app = await createLegacyFunctionApp(appDir, {}); }); afterAll(async () => { diff --git a/packages/security/test/csp.test.ts b/packages/security/test/csp.test.ts index 72c1abb7a4c9..a292c9413bb1 100644 --- a/packages/security/test/csp.test.ts +++ b/packages/security/test/csp.test.ts @@ -1,5 +1,5 @@ -import { close, createApp, createFunctionApp, createHttpRequest } from '@midwayjs/mock'; +import { close, createLegacyApp, createLegacyFunctionApp, createHttpRequest } from '@midwayjs/mock'; import { join } from 'path'; import { readFileSync, copy, writeFile, remove } from 'fs-extra'; import { existsSync } from 'fs'; @@ -40,7 +40,7 @@ describe(`test/${type}.test.ts`, function () { await remove(join(appDir, 'f.yml')); await writeFile(configuration, csrfConfigurationCode.replace(/\$\{\s*framework\s*\}/g, `@midwayjs/koa`)); await writeFile(config, readFileSync(config, 'utf-8') + `\nexport const security = { csp: ${cspConfig}};`); - app = await createApp(appDir); + app = await createLegacyApp(appDir); }); afterAll(async () => { @@ -64,7 +64,7 @@ describe(`test/${type}.test.ts`, function () { await remove(join(appDir, 'f.yml')); await writeFile(configuration, csrfConfigurationCode.replace(/\$\{\s*framework\s*\}/g, `@midwayjs/web`)); await writeFile(config, readFileSync(config, 'utf-8') + `\nexport const security = {csp: ${cspConfig}};`); - app = await createApp(appDir); + app = await createLegacyApp(appDir); }); afterAll(async () => { @@ -90,7 +90,7 @@ describe(`test/${type}.test.ts`, function () { await remove(join(appDir, 'f.yml')); await writeFile(configuration, csrfConfigurationCode.replace(/\$\{\s*framework\s*\}/g, `@midwayjs/express`)); await writeFile(config, readFileSync(config, 'utf-8') + `\nexport const security = {csp: ${cspConfig}};`); - app = await createApp(appDir); + app = await createLegacyApp(appDir); }); afterAll(async () => { @@ -113,7 +113,7 @@ describe(`test/${type}.test.ts`, function () { await copy(csrfBase, appDir); await writeFile(configuration, csrfConfigurationCode.replace(/\$\{\s*framework\s*\}/g, `@midwayjs/faas`)); await writeFile(config, readFileSync(config, 'utf-8') + `\nexport const security = {csp: ${cspConfig}};`); - app = await createFunctionApp(appDir, {}); + app = await createLegacyFunctionApp(appDir, {}); }); afterAll(async () => { diff --git a/packages/security/test/csrf.test.ts b/packages/security/test/csrf.test.ts index 99887b733382..f1380c4f4c0a 100644 --- a/packages/security/test/csrf.test.ts +++ b/packages/security/test/csrf.test.ts @@ -1,5 +1,5 @@ -import { createHttpRequest, close, createApp, createFunctionApp } from '@midwayjs/mock'; +import { createHttpRequest, close, createLegacyApp, createLegacyFunctionApp } from '@midwayjs/mock'; import { join } from 'path'; import * as assert from 'assert'; import { readFileSync, copy, writeFile, remove } from 'fs-extra'; @@ -134,7 +134,7 @@ describe('test/csrf.test.ts', function () { await copy(csrfBase, appDir); await remove(join(appDir, 'f.yml')); await writeFile(configuration, csrfConfigurationCode.replace(/\$\{\s*framework\s*\}/g, `@midwayjs/koa`)); - app = await createApp(appDir); + app = await createLegacyApp(appDir); }); afterAll(async () => { @@ -169,7 +169,7 @@ describe('test/csrf.test.ts', function () { await copy(csrfBase, appDir); await remove(join(appDir, 'f.yml')); await writeFile(configuration, csrfConfigurationCode.replace(/\$\{\s*framework\s*\}/g, `@midwayjs/web`)); - app = await createApp(appDir); + app = await createLegacyApp(appDir); }); afterAll(async () => { @@ -203,7 +203,7 @@ describe('test/csrf.test.ts', function () { await copy(csrfBase, appDir); await remove(join(appDir, 'f.yml')); await writeFile(configuration, csrfConfigurationCode.replace(/\$\{\s*framework\s*\}/g, `@midwayjs/express`)); - app = await createApp(appDir); + app = await createLegacyApp(appDir); }); afterAll(async () => { @@ -236,7 +236,7 @@ describe('test/csrf.test.ts', function () { } await copy(csrfBase, appDir); await writeFile(configuration, csrfConfigurationCode.replace(/\$\{\s*framework\s*\}/g, `@midwayjs/faas`)); - app = await createFunctionApp(appDir, {}); + app = await createLegacyFunctionApp(appDir, {}); }); afterAll(async () => { @@ -272,7 +272,7 @@ describe('test/csrf.test.ts', function () { await copy(csrfBase, appDir); await writeFile(configuration, csrfConfigurationCode.replace(/\$\{\s*framework\s*\}/g, `@midwayjs/faas`)); await writeFile(config, readFileSync(config, 'utf-8') + `\nexport const security = { csrf: {type: 'all', refererWhiteList: ['.midwayjs.org']}};`); - app = await createFunctionApp(appDir, {}); + app = await createLegacyFunctionApp(appDir, {}); }); afterAll(async () => { @@ -301,7 +301,7 @@ describe('test/csrf.test.ts', function () { await remove(join(appDir, 'f.yml')); await writeFile(configuration, csrfConfigurationCode.replace(/\$\{\s*framework\s*\}/g, `@midwayjs/koa`)); await writeFile(config, readFileSync(config, 'utf-8') + `\nexport const security = { csrf: {type: 'all', refererWhiteList: ['.midwayjs.org']}};`); - app = await createApp(appDir); + app = await createLegacyApp(appDir); }); afterAll(async () => { @@ -330,7 +330,7 @@ describe('test/csrf.test.ts', function () { await remove(join(appDir, 'f.yml')); await writeFile(configuration, csrfConfigurationCode.replace(/\$\{\s*framework\s*\}/g, `@midwayjs/express`)); await writeFile(config, readFileSync(config, 'utf-8') + `\nexport const security = { csrf: {type: 'all', refererWhiteList: ['.midwayjs.org']}};`); - app = await createApp(appDir); + app = await createLegacyApp(appDir); }); afterAll(async () => { @@ -359,7 +359,7 @@ describe('test/csrf.test.ts', function () { await remove(join(appDir, 'f.yml')); await writeFile(configuration, csrfConfigurationCode.replace(/\$\{\s*framework\s*\}/g, `@midwayjs/web`)); await writeFile(config, readFileSync(config, 'utf-8') + `\nexport const security = { csrf: {type: 'all', refererWhiteList: ['.midwayjs.org']}};`); - app = await createApp(appDir); + app = await createLegacyApp(appDir); }); afterAll(async () => { @@ -389,7 +389,7 @@ describe('test/csrf.test.ts', function () { await remove(join(appDir, 'f.yml')); await writeFile(configuration, csrfConfigurationCode.replace(/\$\{\s*framework\s*\}/g, `@midwayjs/express`)); await writeFile(config, readFileSync(config, 'utf-8') + `\nexport const security = { csrf: {useSession: true}};`); - app = await createApp(appDir); + app = await createLegacyApp(appDir); }); afterAll(async () => { @@ -414,7 +414,7 @@ describe('test/csrf.test.ts', function () { await remove(join(appDir, 'f.yml')); await writeFile(configuration, csrfConfigurationCode.replace(/\$\{\s*framework\s*\}/g, `@midwayjs/koa`)); await writeFile(config, readFileSync(config, 'utf-8') + `\nexport const security = { csrf: {useSession: true}};`); - app = await createApp(appDir); + app = await createLegacyApp(appDir); }); afterAll(async () => { @@ -439,7 +439,7 @@ describe('test/csrf.test.ts', function () { await remove(join(appDir, 'f.yml')); await writeFile(configuration, csrfConfigurationCode.replace(/\$\{\s*framework\s*\}/g, `@midwayjs/web`)); await writeFile(config, readFileSync(config, 'utf-8') + `\nexport const security = { csrf: {useSession: true}};`); - app = await createApp(appDir); + app = await createLegacyApp(appDir); }); afterAll(async () => { diff --git a/packages/security/test/helper.test.ts b/packages/security/test/helper.test.ts index df5b30211d30..05414e0f6926 100644 --- a/packages/security/test/helper.test.ts +++ b/packages/security/test/helper.test.ts @@ -1,10 +1,10 @@ -import { createApp, createHttpRequest } from '@midwayjs/mock'; +import { createLegacyApp, createHttpRequest } from '@midwayjs/mock'; import { join } from 'path'; describe('test/helper.test.ts', () => { it('should test helper', async () => { const appDir = join(__dirname, `fixtures/helper`); - const app = await createApp(appDir); + const app = await createLegacyApp(appDir); const htmlResult = await createHttpRequest(app).get('/html'); expect(htmlResult.text).toEqual('<script>alert(1)</script>'); diff --git a/packages/security/test/hsts.test.ts b/packages/security/test/hsts.test.ts index 31c5722359ff..4ffb0f6e8f72 100644 --- a/packages/security/test/hsts.test.ts +++ b/packages/security/test/hsts.test.ts @@ -1,5 +1,5 @@ -import { close, createApp, createFunctionApp, createHttpRequest } from '@midwayjs/mock'; +import { close, createLegacyApp, createLegacyFunctionApp, createHttpRequest } from '@midwayjs/mock'; import { join } from 'path'; import { readFileSync, copy, writeFile, remove } from 'fs-extra'; import { existsSync } from 'fs'; @@ -36,7 +36,7 @@ describe(`test/${type}.test.ts`, function () { await remove(join(appDir, 'f.yml')); await writeFile(configuration, csrfConfigurationCode.replace(/\$\{\s*framework\s*\}/g, `@midwayjs/koa`)); await writeFile(config, readFileSync(config, 'utf-8') + `\nexport const security = { hsts: { enable: true }};`); - app = await createApp(appDir); + app = await createLegacyApp(appDir); }); afterAll(async () => { @@ -61,7 +61,7 @@ describe(`test/${type}.test.ts`, function () { await remove(join(appDir, 'f.yml')); await writeFile(configuration, csrfConfigurationCode.replace(/\$\{\s*framework\s*\}/g, `@midwayjs/web`)); await writeFile(config, readFileSync(config, 'utf-8') + `\nexport const security = {hsts: { enable: true }};`); - app = await createApp(appDir); + app = await createLegacyApp(appDir); }); afterAll(async () => { @@ -87,7 +87,7 @@ describe(`test/${type}.test.ts`, function () { await remove(join(appDir, 'f.yml')); await writeFile(configuration, csrfConfigurationCode.replace(/\$\{\s*framework\s*\}/g, `@midwayjs/express`)); await writeFile(config, readFileSync(config, 'utf-8') + `\nexport const security = {hsts: { enable: true }};`); - app = await createApp(appDir); + app = await createLegacyApp(appDir); }); afterAll(async () => { @@ -110,7 +110,7 @@ describe(`test/${type}.test.ts`, function () { await copy(csrfBase, appDir); await writeFile(configuration, csrfConfigurationCode.replace(/\$\{\s*framework\s*\}/g, `@midwayjs/faas`)); await writeFile(config, readFileSync(config, 'utf-8') + `\nexport const security = {hsts: { enable: true }};`); - app = await createFunctionApp(appDir, {}); + app = await createLegacyFunctionApp(appDir, {}); }); afterAll(async () => { @@ -136,7 +136,7 @@ describe(`test/${type}.test.ts`, function () { await remove(join(appDir, 'f.yml')); await writeFile(configuration, csrfConfigurationCode.replace(/\$\{\s*framework\s*\}/g, `@midwayjs/koa`)); await writeFile(config, readFileSync(config, 'utf-8') + `\nexport const security = { hsts: { enable: true, includeSubdomains: true }};`); - app = await createApp(appDir); + app = await createLegacyApp(appDir); }); afterAll(async () => { @@ -161,7 +161,7 @@ describe(`test/${type}.test.ts`, function () { await remove(join(appDir, 'f.yml')); await writeFile(configuration, csrfConfigurationCode.replace(/\$\{\s*framework\s*\}/g, `@midwayjs/web`)); await writeFile(config, readFileSync(config, 'utf-8') + `\nexport const security = {hsts: { enable: true, includeSubdomains: true }};`); - app = await createApp(appDir); + app = await createLegacyApp(appDir); }); afterAll(async () => { @@ -187,7 +187,7 @@ describe(`test/${type}.test.ts`, function () { await remove(join(appDir, 'f.yml')); await writeFile(configuration, csrfConfigurationCode.replace(/\$\{\s*framework\s*\}/g, `@midwayjs/express`)); await writeFile(config, readFileSync(config, 'utf-8') + `\nexport const security = {hsts: { enable: true, includeSubdomains: true }};`); - app = await createApp(appDir); + app = await createLegacyApp(appDir); }); afterAll(async () => { @@ -210,7 +210,7 @@ describe(`test/${type}.test.ts`, function () { await copy(csrfBase, appDir); await writeFile(configuration, csrfConfigurationCode.replace(/\$\{\s*framework\s*\}/g, `@midwayjs/faas`)); await writeFile(config, readFileSync(config, 'utf-8') + `\nexport const security = {hsts: { enable: true, includeSubdomains: true }};`); - app = await createFunctionApp(appDir, {}); + app = await createLegacyFunctionApp(appDir, {}); }); afterAll(async () => { diff --git a/packages/security/test/noopen.test.ts b/packages/security/test/noopen.test.ts index dcff8edfe57b..44f39ad2d974 100644 --- a/packages/security/test/noopen.test.ts +++ b/packages/security/test/noopen.test.ts @@ -1,5 +1,5 @@ -import { close, createApp, createFunctionApp, createHttpRequest } from '@midwayjs/mock'; +import { close, createLegacyApp, createLegacyFunctionApp, createHttpRequest } from '@midwayjs/mock'; import { join } from 'path'; import { readFileSync, copy, writeFile, remove } from 'fs-extra'; import { existsSync } from 'fs'; @@ -31,7 +31,7 @@ describe(`test/${type}.test.ts`, function () { await remove(join(appDir, 'f.yml')); await writeFile(configuration, csrfConfigurationCode.replace(/\$\{\s*framework\s*\}/g, `@midwayjs/koa`)); await writeFile(config, readFileSync(config, 'utf-8') + `\nexport const security = { noopen: { enable: true }};`); - app = await createApp(appDir); + app = await createLegacyApp(appDir); }); afterAll(async () => { @@ -56,7 +56,7 @@ describe(`test/${type}.test.ts`, function () { await remove(join(appDir, 'f.yml')); await writeFile(configuration, csrfConfigurationCode.replace(/\$\{\s*framework\s*\}/g, `@midwayjs/web`)); await writeFile(config, readFileSync(config, 'utf-8') + `\nexport const security = {noopen: { enable: true }};`); - app = await createApp(appDir); + app = await createLegacyApp(appDir); }); afterAll(async () => { @@ -82,7 +82,7 @@ describe(`test/${type}.test.ts`, function () { await remove(join(appDir, 'f.yml')); await writeFile(configuration, csrfConfigurationCode.replace(/\$\{\s*framework\s*\}/g, `@midwayjs/express`)); await writeFile(config, readFileSync(config, 'utf-8') + `\nexport const security = {noopen: { enable: true }};`); - app = await createApp(appDir); + app = await createLegacyApp(appDir); }); afterAll(async () => { @@ -105,7 +105,7 @@ describe(`test/${type}.test.ts`, function () { await copy(csrfBase, appDir); await writeFile(configuration, csrfConfigurationCode.replace(/\$\{\s*framework\s*\}/g, `@midwayjs/faas`)); await writeFile(config, readFileSync(config, 'utf-8') + `\nexport const security = {noopen: { enable: true }};`); - app = await createFunctionApp(appDir, {}); + app = await createLegacyFunctionApp(appDir, {}); }); afterAll(async () => { diff --git a/packages/security/test/nosniff.test.ts b/packages/security/test/nosniff.test.ts index 9809ca49dfed..16935f3bc3cf 100644 --- a/packages/security/test/nosniff.test.ts +++ b/packages/security/test/nosniff.test.ts @@ -1,5 +1,5 @@ -import { close, createApp, createFunctionApp, createHttpRequest } from '@midwayjs/mock'; +import { close, createLegacyApp, createLegacyFunctionApp, createHttpRequest } from '@midwayjs/mock'; import { join } from 'path'; import * as assert from 'assert'; import { readFileSync, copy, writeFile, remove } from 'fs-extra'; @@ -38,7 +38,7 @@ describe(`test/${type}.test.ts`, function () { await remove(join(appDir, 'f.yml')); await writeFile(configuration, csrfConfigurationCode.replace(/\$\{\s*framework\s*\}/g, `@midwayjs/koa`)); await writeFile(config, readFileSync(config, 'utf-8') + `\nexport const security = { nosniff: { enable: true }};`); - app = await createApp(appDir); + app = await createLegacyApp(appDir); }); afterAll(async () => { @@ -67,7 +67,7 @@ describe(`test/${type}.test.ts`, function () { await remove(join(appDir, 'f.yml')); await writeFile(configuration, csrfConfigurationCode.replace(/\$\{\s*framework\s*\}/g, `@midwayjs/web`)); await writeFile(config, readFileSync(config, 'utf-8') + `\nexport const security = {nosniff: { enable: true }};`); - app = await createApp(appDir); + app = await createLegacyApp(appDir); }); afterAll(async () => { @@ -97,7 +97,7 @@ describe(`test/${type}.test.ts`, function () { await remove(join(appDir, 'f.yml')); await writeFile(configuration, csrfConfigurationCode.replace(/\$\{\s*framework\s*\}/g, `@midwayjs/express`)); await writeFile(config, readFileSync(config, 'utf-8') + `\nexport const security = {nosniff: { enable: true }};`); - app = await createApp(appDir); + app = await createLegacyApp(appDir); }); afterAll(async () => { @@ -124,7 +124,7 @@ describe(`test/${type}.test.ts`, function () { await copy(csrfBase, appDir); await writeFile(configuration, csrfConfigurationCode.replace(/\$\{\s*framework\s*\}/g, `@midwayjs/faas`)); await writeFile(config, readFileSync(config, 'utf-8') + `\nexport const security = {nosniff: { enable: true }};`); - app = await createFunctionApp(appDir, {}); + app = await createLegacyFunctionApp(appDir, {}); }); afterAll(async () => { diff --git a/packages/security/test/xframe.test.ts b/packages/security/test/xframe.test.ts index 612b76b51caf..aea88ca82fbd 100644 --- a/packages/security/test/xframe.test.ts +++ b/packages/security/test/xframe.test.ts @@ -1,5 +1,5 @@ -import { close, createApp, createFunctionApp, createHttpRequest } from '@midwayjs/mock'; +import { close, createLegacyApp, createLegacyFunctionApp, createHttpRequest } from '@midwayjs/mock'; import { join } from 'path'; import { readFileSync, copy, writeFile, remove } from 'fs-extra'; import { existsSync } from 'fs'; @@ -29,7 +29,7 @@ describe(`test/${type}.test.ts`, function () { await copy(csrfBase, appDir); await remove(join(appDir, 'f.yml')); await writeFile(configuration, csrfConfigurationCode.replace(/\$\{\s*framework\s*\}/g, `@midwayjs/koa`)); - app = await createApp(appDir); + app = await createLegacyApp(appDir); }); afterAll(async () => { @@ -52,7 +52,7 @@ describe(`test/${type}.test.ts`, function () { await copy(csrfBase, appDir); await remove(join(appDir, 'f.yml')); await writeFile(configuration, csrfConfigurationCode.replace(/\$\{\s*framework\s*\}/g, `@midwayjs/web`)); - app = await createApp(appDir); + app = await createLegacyApp(appDir); }); afterAll(async () => { @@ -76,7 +76,7 @@ describe(`test/${type}.test.ts`, function () { await copy(csrfBase, appDir); await remove(join(appDir, 'f.yml')); await writeFile(configuration, csrfConfigurationCode.replace(/\$\{\s*framework\s*\}/g, `@midwayjs/express`)); - app = await createApp(appDir); + app = await createLegacyApp(appDir); }); afterAll(async () => { @@ -97,7 +97,7 @@ describe(`test/${type}.test.ts`, function () { } await copy(csrfBase, appDir); await writeFile(configuration, csrfConfigurationCode.replace(/\$\{\s*framework\s*\}/g, `@midwayjs/faas`)); - app = await createFunctionApp(appDir, {}); + app = await createLegacyFunctionApp(appDir, {}); }); afterAll(async () => { diff --git a/packages/security/test/xss.test.ts b/packages/security/test/xss.test.ts index e1edc0312463..7dffed830e01 100644 --- a/packages/security/test/xss.test.ts +++ b/packages/security/test/xss.test.ts @@ -1,5 +1,5 @@ -import { close, createApp, createFunctionApp, createHttpRequest } from '@midwayjs/mock'; +import { close, createLegacyApp, createLegacyFunctionApp, createHttpRequest } from '@midwayjs/mock'; import { join } from 'path'; import { readFileSync, copy, writeFile, remove } from 'fs-extra'; import { existsSync } from 'fs'; @@ -29,7 +29,7 @@ describe(`test/${type}.test.ts`, function () { await copy(csrfBase, appDir); await remove(join(appDir, 'f.yml')); await writeFile(configuration, csrfConfigurationCode.replace(/\$\{\s*framework\s*\}/g, `@midwayjs/koa`)); - app = await createApp(appDir); + app = await createLegacyApp(appDir); }); afterAll(async () => { @@ -52,7 +52,7 @@ describe(`test/${type}.test.ts`, function () { await copy(csrfBase, appDir); await remove(join(appDir, 'f.yml')); await writeFile(configuration, csrfConfigurationCode.replace(/\$\{\s*framework\s*\}/g, `@midwayjs/web`)); - app = await createApp(appDir); + app = await createLegacyApp(appDir); }); afterAll(async () => { @@ -76,7 +76,7 @@ describe(`test/${type}.test.ts`, function () { await copy(csrfBase, appDir); await remove(join(appDir, 'f.yml')); await writeFile(configuration, csrfConfigurationCode.replace(/\$\{\s*framework\s*\}/g, `@midwayjs/express`)); - app = await createApp(appDir); + app = await createLegacyApp(appDir); }); afterAll(async () => { @@ -97,7 +97,7 @@ describe(`test/${type}.test.ts`, function () { } await copy(csrfBase, appDir); await writeFile(configuration, csrfConfigurationCode.replace(/\$\{\s*framework\s*\}/g, `@midwayjs/faas`)); - app = await createFunctionApp(appDir, {}); + app = await createLegacyFunctionApp(appDir, {}); }); afterAll(async () => { diff --git a/packages/sequelize/package.json b/packages/sequelize/package.json index 4e80b85b4fdf..24ae1143e47f 100644 --- a/packages/sequelize/package.json +++ b/packages/sequelize/package.json @@ -9,9 +9,8 @@ "index.d.ts" ], "devDependencies": { - "@midwayjs/core": "^3.18.0", - "@midwayjs/koa": "^3.18.0", - "@midwayjs/mock": "^3.18.0", + "@midwayjs/core": "workspace:^", + "@midwayjs/mock": "workspace:^", "sequelize": "6.37.3", "sequelize-typescript": "2.1.6", "sqlite3": "5.1.7" @@ -22,8 +21,8 @@ "sequelize" ], "author": { - "name": "stone-jin", - "email": "1520006273@qq.com" + "name": "czy88840616", + "email": "czy88840616@gmail.com" }, "license": "MIT", "scripts": { diff --git a/packages/sequelize/src/configuration.ts b/packages/sequelize/src/configuration.ts index 4bcb9bed759f..7013c6ef7d50 100644 --- a/packages/sequelize/src/configuration.ts +++ b/packages/sequelize/src/configuration.ts @@ -21,17 +21,6 @@ import { Model } from 'sequelize-typescript'; }, }, ], - importConfigFilter: config => { - if (config['sequelize'] && config['sequelize']['options']) { - config['sequelize'].options.sync = config['sequelize'].sync || false; - const legacyDataSourceConfig = config['sequelize'].options; - delete config['sequelize']['options']; - config['sequelize'].dataSource = { - default: legacyDataSourceConfig, - }; - } - return config; - }, }) export class SequelizeConfiguration { @Config('sequelize') diff --git a/packages/sequelize/src/dataSourceManager.ts b/packages/sequelize/src/dataSourceManager.ts index 3996fcd71551..062ea38907a6 100644 --- a/packages/sequelize/src/dataSourceManager.ts +++ b/packages/sequelize/src/dataSourceManager.ts @@ -8,7 +8,6 @@ import { ScopeEnum, DataSourceManager, ILogger, - DecoratorManager, } from '@midwayjs/core'; import { Sequelize } from 'sequelize-typescript'; @@ -43,10 +42,6 @@ export class SequelizeDataSourceManager extends DataSourceManager { client.addModels(entities); } - // 兼容老写法,但是这里可能有问题,会添加到所有的数据源之中 - const listEntities = DecoratorManager.listModule('sequelize:core'); - client.addModels(listEntities); - const isConnected = await this.checkConnected(client); if (isConnected && config.sync) { diff --git a/packages/sequelize/src/decorator.ts b/packages/sequelize/src/decorator.ts index 29e1689f9827..5ad3a8ad0478 100644 --- a/packages/sequelize/src/decorator.ts +++ b/packages/sequelize/src/decorator.ts @@ -1,37 +1,5 @@ import { DecoratorManager } from '@midwayjs/core'; -import { - setModelName, - addOptions, - Model, - TableOptions, -} from 'sequelize-typescript'; - -/** - * @deprecated Use MetadataManager.attachMetadata instead - * @param options - * @constructor - */ -export function BaseTable( - options: TableOptions -): any; -export function BaseTable(target: any): void; -export function BaseTable(arg?: any) { - if (typeof arg === 'function') { - DecoratorManager.saveModule('sequelize:core', arg); - annotate(arg); - } else { - const options = Object.assign({}, arg); - return target => { - DecoratorManager.saveModule('sequelize:core', target); - annotate(target, options); - }; - } -} - -function annotate(target, options: any = {}) { - setModelName(target.prototype, options.modelName || target.name); - addOptions(target.prototype, options); -} +import { Model } from 'sequelize-typescript'; export const ENTITY_MODEL_KEY = 'sequelize:entity_model_key'; export const DATA_SOURCE_KEY = 'sequelize:data_source_key'; diff --git a/packages/sequelize/src/index.ts b/packages/sequelize/src/index.ts index 8326d610a488..f481ad777388 100644 --- a/packages/sequelize/src/index.ts +++ b/packages/sequelize/src/index.ts @@ -1,4 +1,4 @@ export { SequelizeConfiguration as Configuration } from './configuration'; -export { BaseTable, InjectRepository, InjectDataSource } from './decorator'; +export { InjectRepository, InjectDataSource } from './decorator'; export * from './interface'; export * from './dataSourceManager'; diff --git a/packages/sequelize/src/interface.ts b/packages/sequelize/src/interface.ts index 746a7f7d567a..37c669f386a5 100644 --- a/packages/sequelize/src/interface.ts +++ b/packages/sequelize/src/interface.ts @@ -1,8 +1,4 @@ import { DataSourceManagerConfigOption } from '@midwayjs/core'; import { SequelizeOptions } from 'sequelize-typescript'; -import { SyncOptions } from 'sequelize'; -export type SequelizeConfigOptions = DataSourceManagerConfigOption; +export type SequelizeConfigOptions = DataSourceManagerConfigOption; diff --git a/packages/sequelize/test/fixtures/sequelize-demo/package.json b/packages/sequelize/test/fixtures/sequelize-demo/package.json deleted file mode 100644 index 621cdc6a4174..000000000000 --- a/packages/sequelize/test/fixtures/sequelize-demo/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "name": "ali-demo" -} diff --git a/packages/sequelize/test/fixtures/sequelize-demo/src/config/config.default.ts b/packages/sequelize/test/fixtures/sequelize-demo/src/config/config.default.ts deleted file mode 100644 index a85c6b356b3b..000000000000 --- a/packages/sequelize/test/fixtures/sequelize-demo/src/config/config.default.ts +++ /dev/null @@ -1,13 +0,0 @@ -import * as path from 'path'; - -export const sequelize = { - options: { - dialect: 'sqlite', - storage: path.join(__dirname, '../../', 'database.sqlite') - }, - sync: true -} - -export const koa = { - keys: ['123'] -} diff --git a/packages/sequelize/test/fixtures/sequelize-demo/src/configuration.ts b/packages/sequelize/test/fixtures/sequelize-demo/src/configuration.ts deleted file mode 100644 index 603a7aaaa1b3..000000000000 --- a/packages/sequelize/test/fixtures/sequelize-demo/src/configuration.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { Configuration } from '@midwayjs/core'; -import * as sequelize from '../../../../src'; -import * as path from 'path' - -@Configuration({ - imports: [sequelize], - conflictCheck: true, - importConfigs: [path.join(__dirname, 'config')] -}) -export class ContainerLifeCycle { -} diff --git a/packages/sequelize/test/fixtures/sequelize-demo/src/model/hello.ts b/packages/sequelize/test/fixtures/sequelize-demo/src/model/hello.ts deleted file mode 100644 index fe13a07e558f..000000000000 --- a/packages/sequelize/test/fixtures/sequelize-demo/src/model/hello.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { Column, Model } from 'sequelize-typescript'; -import { BaseTable } from '../../../../../src'; - -@BaseTable({ - tableName: 'hello' -}) -export default class HelloModel extends Model { - @Column({ - comment: '名字' - }) - name: string; -} diff --git a/packages/sequelize/test/fixtures/sequelize-demo/src/model/user.ts b/packages/sequelize/test/fixtures/sequelize-demo/src/model/user.ts deleted file mode 100644 index e00c16d27b1d..000000000000 --- a/packages/sequelize/test/fixtures/sequelize-demo/src/model/user.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { Column, Model } from 'sequelize-typescript'; -import { BaseTable } from '../../../../../src'; - -@BaseTable -export default class UserModel extends Model { - @Column({ - comment: '名字' - }) - name: string; -} diff --git a/packages/sequelize/test/fixtures/sequelize-demo/src/service/user.ts b/packages/sequelize/test/fixtures/sequelize-demo/src/service/user.ts deleted file mode 100644 index 969e30cdce6b..000000000000 --- a/packages/sequelize/test/fixtures/sequelize-demo/src/service/user.ts +++ /dev/null @@ -1,32 +0,0 @@ -import { Provide } from '@midwayjs/core'; -import HelloModel from '../model/hello'; -import UserModel from '../model/user'; - -@Provide() -export class UserService{ - - async list(){ - let result = await UserModel.findAll(); - return result; - } - - async listHello(){ - let result = await HelloModel.findAll(); - return result; - } - - async add(){ - let result = await UserModel.create({ - name: '123' - }) - return result; - } - - async delete(){ - await UserModel.destroy({ - where: { - name: '123' - } - }) - } -} diff --git a/packages/sequelize/test/fixtures/sequelize-new/src/configuration.ts b/packages/sequelize/test/fixtures/sequelize-new/src/configuration.ts index e20d708a9768..78c6112e309a 100644 --- a/packages/sequelize/test/fixtures/sequelize-new/src/configuration.ts +++ b/packages/sequelize/test/fixtures/sequelize-new/src/configuration.ts @@ -6,7 +6,6 @@ import { Sequelize } from 'sequelize-typescript'; @Configuration({ imports: [sequelize], - conflictCheck: true, importConfigs: [path.join(__dirname, 'config')] }) export class ContainerLifeCycle { diff --git a/packages/sequelize/test/index.test.ts b/packages/sequelize/test/index.test.ts index 13290035f54d..596c1bf353c3 100644 --- a/packages/sequelize/test/index.test.ts +++ b/packages/sequelize/test/index.test.ts @@ -1,5 +1,4 @@ -import { createApp, close, createLightApp } from '@midwayjs/mock'; -import { Framework, IMidwayKoaApplication } from '@midwayjs/koa'; +import { close, createLightApp, createLegacyLightApp } from '@midwayjs/mock'; import { join } from 'path'; import { existsSync, unlinkSync } from 'fs'; import { UserService } from './fixtures/sequelize-new/src/service/user'; @@ -13,13 +12,12 @@ function cleanFile(file) { describe('/test/index.test.ts', () => { describe('test sequelize with new decorator', () => { - let app: IMidwayKoaApplication; + let app; beforeAll(async () => { cleanFile(join(__dirname, 'fixtures/sequelize-new', 'database.sqlite')); - app = await createApp( + app = await createLegacyLightApp( join(__dirname, 'fixtures', 'sequelize-new'), {}, - Framework ); }); diff --git a/packages/sequelize/test/legacy.test.ts b/packages/sequelize/test/legacy.test.ts deleted file mode 100644 index 71edea5a41d9..000000000000 --- a/packages/sequelize/test/legacy.test.ts +++ /dev/null @@ -1,54 +0,0 @@ -import { createApp, close } from '@midwayjs/mock'; -import { Framework, IMidwayKoaApplication } from '@midwayjs/koa'; -import { join } from 'path'; -import { UserService } from './fixtures/sequelize-demo/src/service/user'; -import { existsSync, unlinkSync } from 'fs'; - -function cleanFile(file) { - if (existsSync(file)) { - unlinkSync(file); - } -} - -describe('/test/legacy.test.ts', () => { - let app: IMidwayKoaApplication; - beforeAll(async () => { - cleanFile(join(__dirname, 'fixtures/sequelize-demo', 'database.sqlite')); - app = await createApp( - join(__dirname, 'fixtures', 'sequelize-demo'), - {}, - Framework - ); - }); - - afterAll(async () => { - await close(app); - }); - it('list user service ', async () => { - const userService: UserService = await app - .getApplicationContext() - .getAsync(UserService); - const result = await userService.list(); - expect(result.length).toBe(0); - }); - - it('list hello service ', async () => { - const userService: UserService = await app - .getApplicationContext() - .getAsync(UserService); - const result = await userService.listHello(); - expect(result.length).toBe(0); - }); - - it('add and delete', async () => { - const userService: UserService = await app - .getApplicationContext() - .getAsync(UserService); - await userService.add(); - let result = await userService.list(); - expect(result.length).toBe(1); - await userService.delete(); - result = await userService.list(); - expect(result.length).toBe(0); - }); -}); diff --git a/packages/session/package.json b/packages/session/package.json index 2fa72313829d..c108b5453910 100644 --- a/packages/session/package.json +++ b/packages/session/package.json @@ -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": { "@midwayjs/cookies": "^1.0.2" diff --git a/packages/session/test/index.test.ts b/packages/session/test/index.test.ts index a665371eaa72..acbd37e71806 100644 --- a/packages/session/test/index.test.ts +++ b/packages/session/test/index.test.ts @@ -1,28 +1,16 @@ -import { createApp, createHttpRequest, close } from '@midwayjs/mock'; +import { createLegacyApp, createHttpRequest, close } from '@midwayjs/mock'; import { sleep } from '@midwayjs/core'; import { join } from 'path'; import * as assert from 'assert'; describe('test/index.test.ts', function () { - it('should test sessionStore', async () => { - const app = await createApp(join(__dirname, 'fixtures/memory-session')); - const request = createHttpRequest(app); - - await request.get('/set?foo=bar') - .expect(200) - .expect({ foo: 'bar' }) - .expect('set-cookie', /MW_SESS=.*?;/); - - await close(app); - }); - describe('should test cookie session', () => { let app; let request; beforeAll(async () => { - app = await createApp(join(__dirname, 'fixtures/cookie-session')); + app = await createLegacyApp(join(__dirname, 'fixtures/cookie-session')); request = createHttpRequest(app); }) @@ -143,7 +131,7 @@ describe('test/index.test.ts', function () { }) it('should test sameSite=none', async () => { - const app = await createApp(join(__dirname, 'fixtures/samesite-none-session')); + const app = await createLegacyApp(join(__dirname, 'fixtures/samesite-none-session')); const request = createHttpRequest(app); await request.get('/set?foo=bar') @@ -159,8 +147,8 @@ describe('test/index.test.ts', function () { await close(app); }); - it('should change the session key, but not content', async () => { - const app = await createApp(join(__dirname, 'fixtures/change-session-key')); + it.only('should change the session key, but not content', async () => { + const app = await createLegacyApp(join(__dirname, 'fixtures/change-session-key')); const request = createHttpRequest(app); let koaSession = null; await request.get('/') @@ -181,4 +169,17 @@ describe('test/index.test.ts', function () { await close(app); }); + + it.only('should test sessionStore', async () => { + const app = await createLegacyApp(join(__dirname, 'fixtures/memory-session')); + const request = createHttpRequest(app); + + await request.get('/set?foo=bar') + .expect(200) + .expect({ foo: 'bar' }) + .expect('set-cookie', /MW_SESS=.*?;/); + + await close(app); + }); + }); diff --git a/packages/socketio/package.json b/packages/socketio/package.json index 3b55b9d073c8..42ca9fbf326b 100644 --- a/packages/socketio/package.json +++ b/packages/socketio/package.json @@ -24,12 +24,11 @@ ], "license": "MIT", "devDependencies": { - "@midwayjs/mock": "^3.18.0", + "@midwayjs/core": "workspace:^", "fs-extra": "11.2.0", "socket.io-client": "4.7.5" }, "dependencies": { - "@midwayjs/core": "^3.18.0", "socket.io": "4.7.5" }, "author": "Harry Chen ", diff --git a/packages/socketio/src/interface.ts b/packages/socketio/src/interface.ts index 43d14f98b97d..b567e1d93dc5 100644 --- a/packages/socketio/src/interface.ts +++ b/packages/socketio/src/interface.ts @@ -27,9 +27,3 @@ export type Context = IMidwayContext; export type NextFunction = BaseNextFunction; - -declare module '@midwayjs/core/dist/interface' { - interface MidwayConfig { - socketIO?: IMidwaySocketIOOptions; - } -} diff --git a/packages/socketio/test/utils.ts b/packages/socketio/test/utils.ts index 49131c76f628..0cd6538173d7 100644 --- a/packages/socketio/test/utils.ts +++ b/packages/socketio/test/utils.ts @@ -1,7 +1,7 @@ import { Framework, Application, IMidwaySocketIOOptions } from '../src'; import * as socketIO from '../src'; import { join } from 'path'; -import { close, createApp } from '@midwayjs/mock'; +import { close, createLegacyApp } from '@midwayjs/mock'; /** * create a socket.io app @@ -9,7 +9,12 @@ import { close, createApp } from '@midwayjs/mock'; * @param options */ export async function createServer(name: string, options: IMidwaySocketIOOptions = {}): Promise { - return createApp(join(__dirname, 'fixtures', name), options, socketIO); + return createLegacyApp(join(__dirname, 'fixtures', name), { + imports: [ + socketIO, + ], + ...options, + }); } export async function closeApp(app) { diff --git a/packages/static-file/package.json b/packages/static-file/package.json index 3a7bc3a0417a..01ec7e0f5849 100644 --- a/packages/static-file/package.json +++ b/packages/static-file/package.json @@ -15,10 +15,10 @@ "ylru": "1.4.0" }, "devDependencies": { - "@midwayjs/core": "^3.18.0", - "@midwayjs/faas": "^3.18.0", - "@midwayjs/koa": "^3.18.0", - "@midwayjs/mock": "^3.18.0" + "@midwayjs/core": "workspace:^", + "@midwayjs/faas": "workspace:^", + "@midwayjs/koa": "workspace:^", + "@midwayjs/mock": "workspace:^" }, "keywords": [ "midway", diff --git a/packages/static-file/test/index.test.ts b/packages/static-file/test/index.test.ts index 51d41972716c..6f1f1b7f326c 100644 --- a/packages/static-file/test/index.test.ts +++ b/packages/static-file/test/index.test.ts @@ -1,10 +1,10 @@ -import { close, createApp, createFunctionApp, createHttpRequest } from '@midwayjs/mock'; +import { close, createLegacyApp, createLegacyFunctionApp, createHttpRequest } from '@midwayjs/mock'; import { join } from 'path'; import { Framework } from '@midwayjs/faas'; describe('test/index.test.ts', () => { it('serve with dirs with same prefix', async () => { - const app = await createApp(join(__dirname, './fixtures/koa-with-dirs')); + const app = await createLegacyApp(join(__dirname, './fixtures/koa-with-dirs')); const result = await createHttpRequest(app).get('/foo.js'); expect(result.text).toMatch('console'); @@ -14,7 +14,7 @@ describe('test/index.test.ts', () => { }); it('serve with dirs with different prefix', async () => { - const app = await createApp(join(__dirname, './fixtures/koa-with-different-dirs')); + const app = await createLegacyApp(join(__dirname, './fixtures/koa-with-different-dirs')); const result = await createHttpRequest(app).get('/foo.js'); expect(result.text).toMatch('console'); @@ -30,7 +30,7 @@ describe('test/index.test.ts', () => { it('should test faas use static', async () => { const appDir = join(__dirname, 'fixtures/faas-with-dirs'); - const app = await createFunctionApp(appDir); + const app = await createLegacyFunctionApp(appDir); const result = await createHttpRequest(app).get('/foo.js'); expect(result.text).toMatch('console'); await close(app); diff --git a/packages/swagger/package.json b/packages/swagger/package.json index 8af8fce41139..c0730a4f5c0a 100644 --- a/packages/swagger/package.json +++ b/packages/swagger/package.json @@ -10,10 +10,10 @@ "index.html" ], "devDependencies": { - "@midwayjs/core": "^3.18.0", - "@midwayjs/koa": "^3.18.0", - "@midwayjs/mock": "^3.18.0", - "@midwayjs/validate": "^3.18.0", + "@midwayjs/core": "workspace:^", + "@midwayjs/koa": "workspace:^", + "@midwayjs/mock": "workspace:^", + "@midwayjs/validate": "workspace:^", "swagger-ui-dist": "5.17.14" }, "author": "Kurten Chan ", diff --git a/packages/swagger/test/index.test.ts b/packages/swagger/test/index.test.ts index 29f34176f7bd..75c72d61b1d1 100644 --- a/packages/swagger/test/index.test.ts +++ b/packages/swagger/test/index.test.ts @@ -1,4 +1,4 @@ -import { close, createApp, createHttpRequest } from '@midwayjs/mock'; +import { close, createLegacyApp, createHttpRequest } from '@midwayjs/mock'; import * as koa from '@midwayjs/koa'; import { join } from 'path'; @@ -7,7 +7,7 @@ describe('/test/index.test.ts', () => { let app; beforeAll(async () => { try { - app = await createApp( + app = await createLegacyApp( join(__dirname, 'fixtures/cats'), { globalConfig: { @@ -18,8 +18,8 @@ describe('/test/index.test.ts', () => { }, }, }, + imports: [koa], }, - koa ); } catch (e) { console.log(e); @@ -89,7 +89,7 @@ describe('/test/index.test.ts', () => { }); it('should fix issue1976', async () => { - const app = await createApp(join(__dirname, 'fixtures/issue1976'), {}); + const app = await createLegacyApp(join(__dirname, 'fixtures/issue1976'), {}); const result = await createHttpRequest(app).get('/swagger-ui/index.json'); expect(result.type).toEqual('application/json'); const body = result.body; @@ -103,7 +103,7 @@ describe('/test/index.test.ts', () => { }); it('should fix issue2603', async () => { - const app = await createApp(join(__dirname, 'fixtures/issue2603'), {}); + const app = await createLegacyApp(join(__dirname, 'fixtures/issue2603'), {}); const result = await createHttpRequest(app).get('/swagger-ui/index.json'); expect(result.type).toEqual('application/json'); const body = result.body; diff --git a/packages/tablestore/package.json b/packages/tablestore/package.json index 2274d747aeac..ebb0df921951 100644 --- a/packages/tablestore/package.json +++ b/packages/tablestore/package.json @@ -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": { "int64-buffer": "1.0.1", diff --git a/packages/tags/package.json b/packages/tags/package.json index 10cbd1625511..87ef01b5b44d 100644 --- a/packages/tags/package.json +++ b/packages/tags/package.json @@ -22,12 +22,12 @@ }, "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:^", "mysql2": "^3.0.0" } } diff --git a/packages/tenant/package.json b/packages/tenant/package.json index 86a9d462cd2a..9529429d3bcc 100644 --- a/packages/tenant/package.json +++ b/packages/tenant/package.json @@ -10,8 +10,8 @@ "index.d.ts" ], "devDependencies": { - "@midwayjs/core": "^3.18.0", - "@midwayjs/mock": "^3.18.0" + "@midwayjs/core": "workspace:^", + "@midwayjs/mock": "workspace:^" }, "keywords": [ "midway", diff --git a/packages/typegoose/package.json b/packages/typegoose/package.json index 054b6a831860..ae36a6b88db7 100644 --- a/packages/typegoose/package.json +++ b/packages/typegoose/package.json @@ -22,11 +22,11 @@ }, "license": "MIT", "dependencies": { - "@midwayjs/mongoose": "^3.18.0" + "@midwayjs/mongoose": "workspace:^" }, "devDependencies": { - "@midwayjs/core": "^3.18.0", - "@midwayjs/mock": "^3.18.0", + "@midwayjs/core": "workspace:^", + "@midwayjs/mock": "workspace:^", "@typegoose/typegoose": "12.8.0", "mongoose": "8.7.0" } diff --git a/packages/typegoose/scripts/start.sh b/packages/typegoose/scripts/start.sh new file mode 100755 index 000000000000..76096ae8c359 --- /dev/null +++ b/packages/typegoose/scripts/start.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +#docker pull mongo +docker run -d --name mongodb -p 27017:27017 mongo diff --git a/packages/typegoose/test/index.test.ts b/packages/typegoose/test/index.test.ts index feb18e5c916b..1017a4245379 100644 --- a/packages/typegoose/test/index.test.ts +++ b/packages/typegoose/test/index.test.ts @@ -1,9 +1,9 @@ -import { close, createLightApp } from '@midwayjs/mock'; +import { close, createLegacyLightApp } from '@midwayjs/mock'; import { join } from 'path'; describe('/test/index.test.ts', () => { it('should connect mongodb with new decorator', async () => { - let app = await createLightApp(join(__dirname, 'fixtures', 'base-app-decorator'), {}); + let app = await createLegacyLightApp(join(__dirname, 'fixtures', 'base-app-decorator')); await close(app); }); }); diff --git a/packages/typegoose/test/util.ts b/packages/typegoose/test/util.ts deleted file mode 100644 index 9f6fabcfceeb..000000000000 --- a/packages/typegoose/test/util.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { MongoMemoryServer } from 'mongodb-memory-server'; - -let instance; - -export async function createMongoServer() { - if (!process.env.MONGO_URI) { - instance = new MongoMemoryServer(); - const uri = await instance.getUri(); - (global as any).__MONGOINSTANCE = instance; - process.env.MONGO_URI = uri.slice(0, uri.lastIndexOf('/')); - } -} - -export async function closeMongoServer() { - await instance.stop(); -} diff --git a/packages/typeorm/package.json b/packages/typeorm/package.json index fd07165acc66..124ce58f2974 100644 --- a/packages/typeorm/package.json +++ b/packages/typeorm/package.json @@ -13,8 +13,8 @@ "index.d.ts" ], "devDependencies": { - "@midwayjs/core": "^3.18.0", - "@midwayjs/mock": "^3.18.0", + "@midwayjs/core": "workspace:^", + "@midwayjs/mock": "workspace:^", "sqlite3": "5.1.7", "typeorm": "0.3.20" }, diff --git a/packages/typeorm/test/index.test.ts b/packages/typeorm/test/index.test.ts index 87fd9dc7e8f1..58aa729ef36f 100644 --- a/packages/typeorm/test/index.test.ts +++ b/packages/typeorm/test/index.test.ts @@ -1,13 +1,13 @@ import { join } from 'path'; import { existsSync, unlinkSync } from 'fs'; -import { close, createLightApp } from '@midwayjs/mock'; +import { close, createLegacyLightApp } from '@midwayjs/mock'; import { IMidwayApplication } from '@midwayjs/core'; describe('/test/index.test.ts', () => { it('should test base entity', async () => { cleanFile(join(__dirname, 'fixtures/base-fn-origin', 'default.sqlite')); - const app: IMidwayApplication = await createLightApp(join(__dirname, 'fixtures/base-fn-origin'), {}); + const app: IMidwayApplication = await createLegacyLightApp(join(__dirname, 'fixtures/base-fn-origin'), {}); const result = app.getAttr('result'); expect(result.includes('hello world')).toBeTruthy(); diff --git a/packages/upload/package.json b/packages/upload/package.json index d5952a721a40..5057dee4f089 100644 --- a/packages/upload/package.json +++ b/packages/upload/package.json @@ -26,11 +26,11 @@ "raw-body": "2.5.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:^" } } diff --git a/packages/upload/test/clean.test.ts b/packages/upload/test/clean.test.ts index 86c12c367186..46cdd5175e33 100644 --- a/packages/upload/test/clean.test.ts +++ b/packages/upload/test/clean.test.ts @@ -1,4 +1,4 @@ -import { createHttpRequest, close, createFunctionApp } from '@midwayjs/mock'; +import { createHttpRequest, close, createLegacyFunctionApp } from '@midwayjs/mock'; import { join } from 'path'; import * as assert from 'assert'; import { existsSync, statSync } from 'fs'; @@ -9,7 +9,7 @@ describe('test/clan.test.ts', function () { it('upload file auto clean', async () => { const appDir = join(__dirname, 'fixtures/clean'); const imagePath = join(__dirname, 'fixtures/1.jpg'); - const app = await createFunctionApp(appDir, {}); + const app = await createLegacyFunctionApp(appDir, {}); const request = await createHttpRequest(app); const stat = statSync(imagePath); await request.post('/upload') diff --git a/packages/upload/test/express.test.ts b/packages/upload/test/express.test.ts index ab92c19bb4c6..bae1b30075c2 100644 --- a/packages/upload/test/express.test.ts +++ b/packages/upload/test/express.test.ts @@ -1,4 +1,4 @@ -import { createHttpRequest, close, createApp } from '@midwayjs/mock'; +import { createHttpRequest, close, createLegacyApp } from '@midwayjs/mock'; import { join } from 'path'; import * as assert from 'assert'; import { statSync } from 'fs'; @@ -8,7 +8,7 @@ describe('test/express.test.ts', function () { let app; beforeAll(async () => { const appDir = join(__dirname, 'fixtures/express-stream'); - app = await createApp(appDir); + app = await createLegacyApp(appDir); }); afterAll(async () => { @@ -50,7 +50,7 @@ describe('test/express.test.ts', function () { let app; beforeAll(async () => { const appDir = join(__dirname, 'fixtures/express-file'); - app = await createApp(appDir); + app = await createLegacyApp(appDir); }); afterAll(async () => { diff --git a/packages/upload/test/faas.test.ts b/packages/upload/test/faas.test.ts index 67c1e3c6924d..f613313a8994 100644 --- a/packages/upload/test/faas.test.ts +++ b/packages/upload/test/faas.test.ts @@ -1,4 +1,4 @@ -import { createHttpRequest, close, createFunctionApp } from '@midwayjs/mock'; +import { createHttpRequest, close, createLegacyFunctionApp } from '@midwayjs/mock'; import { join } from 'path'; import * as assert from 'assert'; import { existsSync, statSync } from 'fs'; @@ -7,7 +7,7 @@ describe('test/faas.test.ts', function () { let app; beforeAll(async () => { const appDir = join(__dirname, 'fixtures/faas'); - app = await createFunctionApp(appDir, {}); + app = await createLegacyFunctionApp(appDir, {}); }) afterAll(async () => { diff --git a/packages/upload/test/koa.test.ts b/packages/upload/test/koa.test.ts index 04b9f189faec..5dbd61ce748e 100644 --- a/packages/upload/test/koa.test.ts +++ b/packages/upload/test/koa.test.ts @@ -1,4 +1,4 @@ -import { createHttpRequest, close, createApp } from '@midwayjs/mock'; +import { createHttpRequest, close, createLegacyApp } from '@midwayjs/mock'; import { join } from 'path'; import * as assert from 'assert'; import { statSync } from 'fs'; @@ -9,7 +9,7 @@ describe('test/koa.test.ts', function () { let app; beforeAll(async () => { const appDir = join(__dirname, 'fixtures/koa-stream'); - app = await createApp(appDir); + app = await createLegacyApp(appDir); }); afterAll(async () => { @@ -66,7 +66,7 @@ describe('test/koa.test.ts', function () { let app; beforeAll(async () => { const appDir = join(__dirname, 'fixtures/koa-file'); - app = await createApp(appDir); + app = await createLegacyApp(appDir); }); afterAll(async () => { @@ -123,7 +123,7 @@ describe('test/koa.test.ts', function () { let app; beforeAll(async () => { const appDir = join(__dirname, 'fixtures/koa-file-mime'); - app = await createApp(appDir); + app = await createLegacyApp(appDir); }); afterAll(async () => { @@ -174,7 +174,7 @@ describe('test/koa.test.ts', function () { describe('test null set', function () { it('upload test ext set null', async () => { const appDir = join(__dirname, 'fixtures/koa-ext-null'); - const app = await createApp(appDir); + const app = await createLegacyApp(appDir); const filePath = join(__dirname, 'fixtures/1.test'); const request = await createHttpRequest(app); await request.post('/upload') @@ -191,7 +191,7 @@ describe('test/koa.test.ts', function () { let app; beforeAll(async () => { const appDir = join(__dirname, 'fixtures/koa-function-whitelist'); - app = await createApp(appDir); + app = await createLegacyApp(appDir); }); afterAll(async () => { @@ -219,7 +219,7 @@ describe('test/koa.test.ts', function () { let app; beforeAll(async () => { const appDir = join(__dirname, 'fixtures/koa-function-duplicate-fields'); - app = await createApp(appDir); + app = await createLegacyApp(appDir); }); afterAll(async () => { diff --git a/packages/upload/test/web.test.ts b/packages/upload/test/web.test.ts index 692fc1bfdc75..85372333df4e 100644 --- a/packages/upload/test/web.test.ts +++ b/packages/upload/test/web.test.ts @@ -1,4 +1,4 @@ -import { createHttpRequest, close, createApp } from '@midwayjs/mock'; +import { createHttpRequest, close, createLegacyApp } from '@midwayjs/mock'; import { join } from 'path'; import * as assert from 'assert'; import { statSync } from 'fs'; @@ -9,7 +9,7 @@ describe('test/web.test.ts', function () { let app; beforeAll(async () => { const appDir = join(__dirname, 'fixtures/web-stream'); - app = await createApp(appDir); + app = await createLegacyApp(appDir); }); afterAll(async () => { @@ -49,7 +49,7 @@ describe('test/web.test.ts', function () { let app; beforeAll(async () => { const appDir = join(__dirname, 'fixtures/web-file'); - app = await createApp(appDir); + app = await createLegacyApp(appDir); }); afterAll(async () => { diff --git a/packages/validate/package.json b/packages/validate/package.json index 84cc37298805..2e8156c647ed 100644 --- a/packages/validate/package.json +++ b/packages/validate/package.json @@ -23,13 +23,13 @@ }, "license": "MIT", "dependencies": { - "@midwayjs/i18n": "^3.18.0", + "@midwayjs/i18n": "workspace:^", "joi": "17.13.3" }, "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:^" } } diff --git a/packages/validate/test/i18n.test.ts b/packages/validate/test/i18n.test.ts index af96b49810f7..2fda399fba87 100644 --- a/packages/validate/test/i18n.test.ts +++ b/packages/validate/test/i18n.test.ts @@ -1,9 +1,9 @@ -import { createApp, close, createHttpRequest } from '@midwayjs/mock'; +import { createLegacyApp, close, createHttpRequest } from '@midwayjs/mock'; import { join } from 'path'; describe('test/i18n.test.ts', function () { it('should test with locale in decorator options', async () => { - const app = await createApp(join(__dirname, 'fixtures/base-app-koa')); + const app = await createLegacyApp(join(__dirname, 'fixtures/base-app-koa')); const result = await createHttpRequest(app) .post('/user/') .send({ @@ -15,7 +15,7 @@ describe('test/i18n.test.ts', function () { }); it('should test with locale global options', async () => { - const app = await createApp(join(__dirname, 'fixtures/base-app-koa-global-locale')); + const app = await createLegacyApp(join(__dirname, 'fixtures/base-app-koa-global-locale')); const result = await createHttpRequest(app) .post('/user/global_options') .send({ @@ -27,7 +27,7 @@ describe('test/i18n.test.ts', function () { }); it('should test with query locale', async () => { - const app = await createApp(join(__dirname, 'fixtures/base-app-koa-query-locale')); + const app = await createLegacyApp(join(__dirname, 'fixtures/base-app-koa-query-locale')); const result = await createHttpRequest(app) .post('/user/') .query({ @@ -42,7 +42,7 @@ describe('test/i18n.test.ts', function () { }); it('should test with locale fallback', async () => { - const app = await createApp(join(__dirname, 'fixtures/base-app-koa-fallback')); + const app = await createLegacyApp(join(__dirname, 'fixtures/base-app-koa-fallback')); const result = await createHttpRequest(app) .post('/user/') .send({ @@ -54,7 +54,7 @@ describe('test/i18n.test.ts', function () { }); it('should test with locale fallback use custom message', async () => { - const app = await createApp(join(__dirname, 'fixtures/base-app-koa-custom-message')); + const app = await createLegacyApp(join(__dirname, 'fixtures/base-app-koa-custom-message')); const result = await createHttpRequest(app) .post('/user/') .send({ diff --git a/packages/view-ejs/package.json b/packages/view-ejs/package.json index 538f43a3ab6f..5c9617d88dc5 100644 --- a/packages/view-ejs/package.json +++ b/packages/view-ejs/package.json @@ -28,12 +28,12 @@ }, "license": "MIT", "dependencies": { - "@midwayjs/view": "^3.18.0", + "@midwayjs/view": "workspace:^", "ejs": "3.1.10" }, "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:^" } } diff --git a/packages/view-ejs/test/index.test.ts b/packages/view-ejs/test/index.test.ts index bc955356bfc1..e3574735cbdb 100644 --- a/packages/view-ejs/test/index.test.ts +++ b/packages/view-ejs/test/index.test.ts @@ -1,10 +1,10 @@ -import { createApp, close, createHttpRequest } from '@midwayjs/mock'; +import { createLegacyApp, close, createHttpRequest } from '@midwayjs/mock'; import { join } from 'path'; describe('/test/index.test.ts', () => { it('should render with locals', async () => { - let app = await createApp(join(__dirname, 'fixtures', 'base-app'), {}); + let app = await createLegacyApp(join(__dirname, 'fixtures', 'base-app'), {}); const result = await createHttpRequest(app).get('/locals'); expect(result.status).toEqual(200); diff --git a/packages/view-nunjucks/package.json b/packages/view-nunjucks/package.json index 3079204d1e99..ed8e03b8356e 100644 --- a/packages/view-nunjucks/package.json +++ b/packages/view-nunjucks/package.json @@ -28,12 +28,12 @@ }, "license": "MIT", "dependencies": { - "@midwayjs/view": "^3.18.0", + "@midwayjs/view": "workspace:^", "nunjucks": "^3.2.2" }, "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:^" } } diff --git a/packages/view-nunjucks/test/index.test.ts b/packages/view-nunjucks/test/index.test.ts index 1b1e719f40c2..cf502363df17 100644 --- a/packages/view-nunjucks/test/index.test.ts +++ b/packages/view-nunjucks/test/index.test.ts @@ -1,4 +1,4 @@ -import { createApp, close, createHttpRequest } from '@midwayjs/mock'; +import { createLegacyApp, close, createHttpRequest } from '@midwayjs/mock'; import { join } from 'path'; describe('/test/index.test.ts', () => { @@ -6,7 +6,7 @@ describe('/test/index.test.ts', () => { let app; beforeAll(async () => { - app = await createApp(join(__dirname, 'fixtures', 'base-app'), {}); + app = await createLegacyApp(join(__dirname, 'fixtures', 'base-app'), {}); }); afterAll(async () => { diff --git a/packages/view/package.json b/packages/view/package.json index 9354f9180037..52c26bc7aab3 100644 --- a/packages/view/package.json +++ b/packages/view/package.json @@ -27,8 +27,8 @@ }, "license": "MIT", "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:^" } } diff --git a/packages/view/test/index.test.ts b/packages/view/test/index.test.ts index df29a167810c..927346cc1509 100644 --- a/packages/view/test/index.test.ts +++ b/packages/view/test/index.test.ts @@ -1,4 +1,4 @@ -import { createApp, close, createHttpRequest } from '@midwayjs/mock'; +import { createLegacyApp, close, createHttpRequest } from '@midwayjs/mock'; import { Framework } from '@midwayjs/koa'; import { join } from 'path'; import { ContextView, ViewManager } from '../src'; @@ -6,7 +6,7 @@ import { ContextView, ViewManager } from '../src'; describe('/test/index.test.ts', () => { it('should test create viewManager', async () => { - let app = await createApp(join(__dirname, 'fixtures', 'base-app'), {}); + let app = await createLegacyApp(join(__dirname, 'fixtures', 'base-app'), {}); let result = await createHttpRequest(app) .get('/render'); expect(result.status).toEqual(200); @@ -19,7 +19,7 @@ describe('/test/index.test.ts', () => { }); it('should test defaultExtension', async () => { - let app = await createApp(join(__dirname, 'fixtures', 'base-app-default'), {}); + let app = await createLegacyApp(join(__dirname, 'fixtures', 'base-app-default'), {}); let result = await createHttpRequest(app) .get('/render'); expect(result.status).toEqual(200); diff --git a/packages/web-express/package.json b/packages/web-express/package.json index de06ef20ca87..03da518719e4 100644 --- a/packages/web-express/package.json +++ b/packages/web-express/package.json @@ -24,14 +24,15 @@ ], "license": "MIT", "devDependencies": { - "@midwayjs/mock": "^3.18.0", + "@midwayjs/core": "workspace:^", + "@midwayjs/mock": "workspace:^", "@types/body-parser": "1.19.5", "@types/express": "4.17.21", "fs-extra": "11.2.0" }, "dependencies": { - "@midwayjs/core": "^3.18.0", - "@midwayjs/express-session": "^3.18.0", + + "@midwayjs/express-session": "workspace:^", "body-parser": "1.20.3", "cookie-parser": "^1.4.6", "express": "4.20.0" diff --git a/packages/web-express/test/fixtures/base-app-global-prefix/src/configuration.ts b/packages/web-express/test/fixtures/base-app-global-prefix/src/configuration.ts index 655b42a3334e..ed4778816892 100644 --- a/packages/web-express/test/fixtures/base-app-global-prefix/src/configuration.ts +++ b/packages/web-express/test/fixtures/base-app-global-prefix/src/configuration.ts @@ -10,7 +10,6 @@ import * as Express from '../../../../src'; imports: [ Express ], - conflictCheck: true, }) export class ContainerConfiguration { diff --git a/packages/web-express/test/index.test.ts b/packages/web-express/test/index.test.ts index 06dfd48f695a..6792ddb6f7f2 100644 --- a/packages/web-express/test/index.test.ts +++ b/packages/web-express/test/index.test.ts @@ -1,6 +1,5 @@ -import { closeApp, creatApp, createHttpRequest } from './utils'; import { IMidwayExpressApplication, MidwayExpressMiddlewareService } from '../src'; -import { createLightApp } from '@midwayjs/mock'; +import { createLightApp, createLegacyApp as creatApp, close as closeApp, createHttpRequest } from '@midwayjs/mock'; describe('/test/feature.test.ts', () => { diff --git a/packages/web-express/test/utils.ts b/packages/web-express/test/utils.ts deleted file mode 100644 index c14e3c307650..000000000000 --- a/packages/web-express/test/utils.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { IMidwayExpressConfigurationOptions, IMidwayExpressApplication } from '../src'; -import { join } from 'path'; -import { createApp, close } from '@midwayjs/mock'; - -export async function creatApp(name: string, options: IMidwayExpressConfigurationOptions = {}): Promise { - return createApp(join(__dirname, 'fixtures', name), options); -} - -export async function closeApp(app) { - return close(app); -} - -export { createHttpRequest } from '@midwayjs/mock'; diff --git a/packages/web-koa/package.json b/packages/web-koa/package.json index b4212df10bbd..b42f8b0fd6b3 100644 --- a/packages/web-koa/package.json +++ b/packages/web-koa/package.json @@ -24,15 +24,15 @@ ], "license": "MIT", "devDependencies": { - "@midwayjs/mock": "^3.18.0", + "@midwayjs/core": "workspace:^", + "@midwayjs/mock": "workspace:^", "@types/koa-router": "7.4.8", "fs-extra": "11.2.0" }, "dependencies": { "@koa/router": "^12.0.0", "@midwayjs/cookies": "^1.0.2", - "@midwayjs/core": "^3.18.0", - "@midwayjs/session": "^3.18.0", + "@midwayjs/session": "workspace:^", "@types/koa": "2.15.0", "@types/qs": "6.9.15", "koa": "2.15.3", diff --git a/packages/web-koa/test/fixtures/base-app-dynamic-router/src/configuration.ts b/packages/web-koa/test/fixtures/base-app-dynamic-router/src/configuration.ts index 396fc2fa60de..735e93cf3bc5 100644 --- a/packages/web-koa/test/fixtures/base-app-dynamic-router/src/configuration.ts +++ b/packages/web-koa/test/fixtures/base-app-dynamic-router/src/configuration.ts @@ -12,7 +12,6 @@ import { TestMiddleware } from './middleware/test'; imports: [ Validate ], - conflictCheck: true, }) export class ContainerConfiguration { diff --git a/packages/web-koa/test/fixtures/base-app-global-prefix/src/configuration.ts b/packages/web-koa/test/fixtures/base-app-global-prefix/src/configuration.ts index f9f2e8f0ad7e..a74fe6dde5b9 100644 --- a/packages/web-koa/test/fixtures/base-app-global-prefix/src/configuration.ts +++ b/packages/web-koa/test/fixtures/base-app-global-prefix/src/configuration.ts @@ -10,7 +10,6 @@ import * as Koa from '../../../../src'; imports: [ Koa ], - conflictCheck: true, }) export class ContainerConfiguration { diff --git a/packages/web-koa/test/fixtures/base-app/src/configuration.ts b/packages/web-koa/test/fixtures/base-app/src/configuration.ts index ddedc0fa6e4a..7fcaed2312c9 100644 --- a/packages/web-koa/test/fixtures/base-app/src/configuration.ts +++ b/packages/web-koa/test/fixtures/base-app/src/configuration.ts @@ -11,7 +11,6 @@ import { TestMiddleware } from './middleware/test'; imports: [ Validate ], - conflictCheck: true, }) export class ContainerConfiguration { diff --git a/packages/web-koa/test/utils.ts b/packages/web-koa/test/utils.ts index e6bd85175706..446081920e9f 100644 --- a/packages/web-koa/test/utils.ts +++ b/packages/web-koa/test/utils.ts @@ -1,10 +1,15 @@ import { IMidwayKoaConfigurationOptions, Framework, IMidwayKoaApplication } from '../src'; import * as koaModule from '../src'; import { join } from 'path'; -import { createApp, close } from '@midwayjs/mock'; +import { close, createLegacyApp } from '@midwayjs/mock'; export async function creatApp(name: string, options: IMidwayKoaConfigurationOptions = {}): Promise { - return createApp(join(__dirname, 'fixtures', name), options, koaModule); + return createLegacyApp(join(__dirname, 'fixtures', name), { + imports: [ + koaModule, + ], + ...options, + }); } export async function closeApp(app) { diff --git a/packages/web/package.json b/packages/web/package.json index c404e140b89b..8ee61e29571c 100644 --- a/packages/web/package.json +++ b/packages/web/package.json @@ -29,7 +29,7 @@ "license": "MIT", "devDependencies": { "@midwayjs/logger": "^3.0.0", - "@midwayjs/mock": "^3.18.0", + "@midwayjs/mock": "workspace:^", "@types/koa": "2.15.0", "dayjs": "1.11.13", "egg-logger": "3.5.0", @@ -48,8 +48,8 @@ "supertest": "6.3.3" }, "dependencies": { + "@midwayjs/core": "workspace:^", "@eggjs/router": "^2.0.0", - "@midwayjs/core": "^3.18.0", "egg": "^2.28.0", "egg-cluster": "^1.27.1", "egg-path-matching": "^2.1.0", diff --git a/packages/web/src/framework/lifecycle.ts b/packages/web/src/framework/lifecycle.ts index 4b98f2e92b0e..5bf7e57c0042 100644 --- a/packages/web/src/framework/lifecycle.ts +++ b/packages/web/src/framework/lifecycle.ts @@ -9,9 +9,9 @@ import { Provide, Scope, ScopeEnum, - FunctionalConfiguration, DecoratorManager, } from '@midwayjs/core'; +import { FunctionalConfiguration } from '@midwayjs/core/functional'; import { debuglog } from 'util'; const debug = debuglog('midway:debug'); @@ -102,10 +102,10 @@ export class MidwayWebLifeCycleService { this.configService.clearConfigMergeOrder(); } - // some preload module init - const modules = DecoratorManager.listPreloadModule(); + // some pre-start module init + const modules = DecoratorManager.listPreStartModule(); for (const module of modules) { - // preload init context + // pre-start init context await this.applicationContext.getAsync(module); } } diff --git a/packages/web/test/enhance.test.ts b/packages/web/test/enhance.test.ts index 41a164dcf7d2..8e658f041f77 100644 --- a/packages/web/test/enhance.test.ts +++ b/packages/web/test/enhance.test.ts @@ -2,6 +2,7 @@ const assert = require('assert'); const request = require('supertest'); import path = require('path'); import { creatApp, closeApp } from './utils'; +import { createApp as originCreateApp} from '@midwayjs/mock'; const mm = require('mm'); const pedding = require('pedding'); @@ -93,7 +94,7 @@ describe('/test/enhance.test.ts', () => { it('should load controller conflicts', async () => { let error; try { - await creatApp('enhance/base-app-controller-conflicts'); + await originCreateApp('enhance/base-app-controller-conflicts'); } catch (err) { error = err; } diff --git a/packages/web/test/feature.test.ts b/packages/web/test/feature.test.ts index 58d5c12bccfd..9fd988767728 100644 --- a/packages/web/test/feature.test.ts +++ b/packages/web/test/feature.test.ts @@ -1,4 +1,4 @@ -import { closeApp, creatApp, createHttpRequest, matchContentTimes, sleep } from './utils'; +import { closeApp, creatApp, originalCreateApp, createHttpRequest, matchContentTimes, sleep } from './utils'; import { IMidwayWebApplication } from '../src'; import { join } from 'path'; import { remove, existsSync } from 'fs-extra'; @@ -63,7 +63,7 @@ describe('/test/feature.test.ts', () => { }); it('should test global use midway middleware id in egg', async () => { - const app = await creatApp('feature/base-app-middleware'); + const app = await originalCreateApp('feature/base-app-middleware'); const result = await createHttpRequest(app).get('/'); expect(result.text).toEqual('11112222333344445555egg_middleware'); await closeApp(app); diff --git a/packages/web/test/fixtures/enhance/base-app-controller-conflicts/src/configuration.ts b/packages/web/test/fixtures/enhance/base-app-controller-conflicts/src/configuration.ts index 234396302bff..3c7c49cc7f48 100644 --- a/packages/web/test/fixtures/enhance/base-app-controller-conflicts/src/configuration.ts +++ b/packages/web/test/fixtures/enhance/base-app-controller-conflicts/src/configuration.ts @@ -1,6 +1,8 @@ -import { Configuration } from '@midwayjs/core'; +import { CommonJSFileDetector, Configuration } from '@midwayjs/core'; @Configuration({ - conflictCheck: true + detector: new CommonJSFileDetector({ + conflictCheck: true, + }), }) export class MainConfiguration {} diff --git a/packages/web/test/fixtures/enhance/base-app-decorator/node_modules/@midwayjs/midway-plugin-atmod/dist/configuration.js b/packages/web/test/fixtures/enhance/base-app-decorator/node_modules/@midwayjs/midway-plugin-atmod/dist/configuration.js index b759a185f52b..e4704d7adab3 100644 --- a/packages/web/test/fixtures/enhance/base-app-decorator/node_modules/@midwayjs/midway-plugin-atmod/dist/configuration.js +++ b/packages/web/test/fixtures/enhance/base-app-decorator/node_modules/@midwayjs/midway-plugin-atmod/dist/configuration.js @@ -8,9 +8,9 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, Object.defineProperty(exports, "__esModule", { value: true }); const decorator_1 = require("@midwayjs/core"); const path_1 = require("path"); -let AutoConfiguraion = class AutoConfiguraion { +let AutoConfiguration = class AutoConfiguration { }; -AutoConfiguraion = __decorate([ +AutoConfiguration = __decorate([ decorator_1.Configuration({ importConfigs: [ path_1.join(__dirname, './config.default'), @@ -18,6 +18,6 @@ AutoConfiguraion = __decorate([ ], namespace: 'midway-plugin-atmod' }) -], AutoConfiguraion); -exports.AutoConfiguraion = AutoConfiguraion; +], AutoConfiguration); +exports.AutoConfiguration = AutoConfiguration; //# sourceMappingURL=configuration.js.map diff --git a/packages/web/test/fixtures/enhance/base-app-decorator/node_modules/@midwayjs/midway-plugin-btmod/dist/configuration.js b/packages/web/test/fixtures/enhance/base-app-decorator/node_modules/@midwayjs/midway-plugin-btmod/dist/configuration.js index 7c708104ec3e..8feda2534278 100644 --- a/packages/web/test/fixtures/enhance/base-app-decorator/node_modules/@midwayjs/midway-plugin-btmod/dist/configuration.js +++ b/packages/web/test/fixtures/enhance/base-app-decorator/node_modules/@midwayjs/midway-plugin-btmod/dist/configuration.js @@ -8,9 +8,9 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, Object.defineProperty(exports, "__esModule", { value: true }); const decorator_1 = require("@midwayjs/core"); const path_1 = require("path"); -let AutoConfiguraion = class AutoConfiguraion { +let AutoConfiguration = class AutoConfiguration { }; -AutoConfiguraion = __decorate([ +AutoConfiguration = __decorate([ decorator_1.Configuration({ importConfigs: [ path_1.join(__dirname, './config.default'), @@ -18,6 +18,6 @@ AutoConfiguraion = __decorate([ ], namespace: 'midway-plugin-btmod' }) -], AutoConfiguraion); -exports.AutoConfiguraion = AutoConfiguraion; +], AutoConfiguration); +exports.AutoConfiguration = AutoConfiguration; //# sourceMappingURL=configuration.js.map diff --git a/packages/web/test/fixtures/enhance/base-app-decorator/node_modules/midway-plugin-mod/dist/configuration.js b/packages/web/test/fixtures/enhance/base-app-decorator/node_modules/midway-plugin-mod/dist/configuration.js index da2092525017..fa20497e655f 100644 --- a/packages/web/test/fixtures/enhance/base-app-decorator/node_modules/midway-plugin-mod/dist/configuration.js +++ b/packages/web/test/fixtures/enhance/base-app-decorator/node_modules/midway-plugin-mod/dist/configuration.js @@ -7,12 +7,12 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, }; Object.defineProperty(exports, "__esModule", { value: true }); const decorator_1 = require("@midwayjs/core"); -let AutoConfiguraion = class AutoConfiguraion { +let AutoConfiguration = class AutoConfiguration { }; -AutoConfiguraion = __decorate([ +AutoConfiguration = __decorate([ decorator_1.Configuration({ namespace: 'midway-plugin-mod' }) -], AutoConfiguraion); -exports.AutoConfiguraion = AutoConfiguraion; +], AutoConfiguration); +exports.AutoConfiguration = AutoConfiguration; //# sourceMappingURL=configuration.js.map diff --git a/packages/web/test/fixtures/feature/base-app-middleware/src/configuration.ts b/packages/web/test/fixtures/feature/base-app-middleware/src/configuration.ts index 39b913644bfa..2fd97ff4456a 100644 --- a/packages/web/test/fixtures/feature/base-app-middleware/src/configuration.ts +++ b/packages/web/test/fixtures/feature/base-app-middleware/src/configuration.ts @@ -1,4 +1,4 @@ -import { MainApp, Configuration } from '@midwayjs/core'; +import { MainApp, Configuration, CommonJSFileDetector } from '@midwayjs/core'; import { IMidwayWebApplication } from '../../../../../src'; import * as custom from './component/src'; import { join } from 'path'; @@ -9,7 +9,12 @@ import { join } from 'path'; ], imports: [ custom, - ] + ], + detector: new CommonJSFileDetector({ + ignore: [ + '**/component/**', + ] + }), }) export class ContainerConfiguration { diff --git a/packages/web/test/utils.ts b/packages/web/test/utils.ts index 309b6376f8ee..f11b1529456c 100644 --- a/packages/web/test/utils.ts +++ b/packages/web/test/utils.ts @@ -1,6 +1,6 @@ import * as Web from '../src'; import { join } from 'path'; -import { close, createApp } from '@midwayjs/mock'; +import { close, createApp, createLegacyApp } from '@midwayjs/mock'; import { existsSync, readFileSync } from 'fs'; import { remove } from 'fs-extra'; import { fork } from 'child_process'; @@ -37,6 +37,12 @@ export async function closeCuster(master) { } export async function creatApp(name, options = {}) { + return createLegacyApp(join(__dirname, 'fixtures', name), Object.assign(options, { + imports: [Web] + })) +} + +export async function originalCreateApp(name, options = {}) { return createApp(join(__dirname, 'fixtures', name), Object.assign(options, { imports: [Web] })) diff --git a/packages/ws/package.json b/packages/ws/package.json index a480e047fdcc..ec7ce9faf868 100644 --- a/packages/ws/package.json +++ b/packages/ws/package.json @@ -23,8 +23,8 @@ ], "license": "MIT", "devDependencies": { - "@midwayjs/core": "^3.18.0", - "@midwayjs/mock": "^3.18.0", + "@midwayjs/core": "workspace:^", + "@midwayjs/mock": "workspace:^", "fs-extra": "11.2.0" }, "dependencies": { diff --git a/packages/ws/test/utils.ts b/packages/ws/test/utils.ts index 77312328b38b..f311740eed78 100644 --- a/packages/ws/test/utils.ts +++ b/packages/ws/test/utils.ts @@ -1,7 +1,7 @@ import { Framework, IMidwayWSApplication, IMidwayWSConfigurationOptions } from '../src'; import * as ws from '../src'; import { join } from 'path'; -import { close, createApp } from '@midwayjs/mock'; +import { close, createLegacyApp } from '@midwayjs/mock'; /** * create a WebSocket app @@ -9,7 +9,9 @@ import { close, createApp } from '@midwayjs/mock'; * @param options */ export async function createServer(name: string, options: IMidwayWSConfigurationOptions = {}): Promise { - return createApp(join(__dirname, 'fixtures', name), options, ws); + return createLegacyApp(join(__dirname, 'fixtures', name), Object.assign({ + imports: [ws] + }, options)); } export async function closeApp(app) { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 078d74c0794f..6889658dad4b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -10,7 +10,7 @@ importers: devDependencies: '@babel/plugin-proposal-decorators': specifier: 7.24.7 - version: 7.24.7(@babel/core@7.25.7) + version: 7.24.7(@babel/core@7.26.0) '@nrwl/tao': specifier: 16.10.0 version: 16.10.0 @@ -49,13 +49,13 @@ importers: version: 1.2.2 ts-jest: specifier: 29.2.5 - version: 29.2.5(@babel/core@7.25.7)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.25.7))(jest@29.7.0(@types/node@20.16.10)(ts-node@10.9.2(@types/node@20.16.10)(typescript@5.3.3)))(typescript@5.3.3) + version: 29.2.5(@babel/core@7.26.0)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.26.0))(jest@29.7.0(@types/node@20.16.10)(ts-node@10.9.2(@types/node@20.16.10)(typescript@5.3.3)))(typescript@5.3.3) ts-node: specifier: 10.9.2 version: 10.9.2(@types/node@20.16.10)(typescript@5.3.3) typedoc: specifier: ^0.26.8 - version: 0.26.8(typescript@5.3.3) + version: 0.26.11(typescript@5.3.3) typescript: specifier: 5.3.3 version: 5.3.3 @@ -63,19 +63,19 @@ importers: specifier: 2.3.0 version: 2.3.0 zx: - specifier: 7.2.3 - version: 7.2.3 + specifier: 8.2.2 + version: 8.2.2 packages-resource/midway-test-component: devDependencies: '@midwayjs/core': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../../packages/core packages-resource/midway-test-inner-component: devDependencies: '@midwayjs/core': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../../packages/core packages-serverless/faas-typings: @@ -86,18 +86,15 @@ importers: packages-serverless/midway-fc-starter: dependencies: - '@midwayjs/async-hooks-context-manager': - specifier: ^3.18.0 - version: link:../../packages/async-hooks-context-manager '@midwayjs/faas': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../../packages/faas raw-body: specifier: 2.5.2 version: 2.5.2 devDependencies: '@midwayjs/core': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../../packages/core packages-serverless/serverless-http-parser: @@ -140,12 +137,6 @@ importers: specifier: 3.4.0 version: 3.4.0 - packages/async-hooks-context-manager: - devDependencies: - '@midwayjs/core': - specifier: ^3.18.0 - version: link:../core - packages/axios: dependencies: axios: @@ -153,10 +144,10 @@ importers: version: 1.7.7 devDependencies: '@midwayjs/core': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../core '@midwayjs/mock': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../mock nock: specifier: 13.5.5 @@ -164,15 +155,12 @@ importers: packages/bootstrap: dependencies: - '@midwayjs/async-hooks-context-manager': - specifier: ^3.18.0 - version: link:../async-hooks-context-manager '@midwayjs/event-bus': specifier: 1.10.0 version: 1.10.0 devDependencies: '@midwayjs/core': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../core '@midwayjs/logger': specifier: ^3.0.0 @@ -191,10 +179,10 @@ importers: version: 4.16.3 devDependencies: '@midwayjs/core': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../core '@midwayjs/mock': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../mock packages/bull-board: @@ -207,22 +195,22 @@ importers: version: 5.21.5 '@midwayjs/bull': specifier: ^3.18.0 - version: link:../bull + version: 3.19.1 ejs: specifier: 3.1.10 version: 3.1.10 devDependencies: '@midwayjs/core': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../core '@midwayjs/express': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../web-express '@midwayjs/koa': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../web-koa '@midwayjs/mock': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../mock packages/busboy: @@ -238,25 +226,25 @@ importers: version: 16.5.4 devDependencies: '@midwayjs/core': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../core '@midwayjs/express': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../web-express '@midwayjs/faas': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../faas '@midwayjs/fc-starter': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../../packages-serverless/midway-fc-starter '@midwayjs/koa': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../web-koa '@midwayjs/mock': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../mock '@midwayjs/web': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../web fs-extra: specifier: 11.2.0 @@ -272,13 +260,13 @@ importers: version: 7.18.3 devDependencies: '@midwayjs/core': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../core '@midwayjs/mock': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../mock '@midwayjs/redis': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../redis cache-manager: specifier: 6.0.0 @@ -290,7 +278,7 @@ importers: packages/captcha: dependencies: '@midwayjs/cache-manager': - specifier: ^3.18.1 + specifier: workspace:^ version: link:../cache-manager mini-svg-data-uri: specifier: 1.4.4 @@ -303,13 +291,13 @@ importers: version: 1.4.0 devDependencies: '@midwayjs/core': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../core '@midwayjs/koa': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../web-koa '@midwayjs/mock': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../mock packages/casbin: @@ -319,32 +307,32 @@ importers: version: 5.30.0 devDependencies: '@midwayjs/core': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../core '@midwayjs/koa': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../web-koa '@midwayjs/mock': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../mock packages/casbin-redis-adapter: dependencies: '@midwayjs/casbin': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../casbin '@midwayjs/redis': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../redis devDependencies: '@midwayjs/core': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../core '@midwayjs/koa': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../web-koa '@midwayjs/mock': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../mock casbin: specifier: 5.30.0 @@ -356,20 +344,20 @@ importers: packages/casbin-typeorm-adapter: dependencies: '@midwayjs/casbin': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../casbin '@midwayjs/typeorm': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../typeorm devDependencies: '@midwayjs/core': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../core '@midwayjs/koa': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../web-koa '@midwayjs/mock': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../mock casbin: specifier: 5.30.0 @@ -379,27 +367,27 @@ importers: version: 5.1.7 typeorm: specifier: 0.3.20 - version: 0.3.20(ioredis@5.4.1)(mysql2@3.11.3)(redis@3.1.2)(sqlite3@5.1.7)(ts-node@10.9.2(@types/node@20.16.10)(typescript@5.3.3)) + version: 0.3.20(ioredis@5.4.1)(mysql2@3.11.5)(redis@3.1.2)(sqlite3@5.1.7)(ts-node@10.9.2(@types/node@20.16.10)(typescript@5.3.3)) packages/code-dye: devDependencies: '@midwayjs/core': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../core '@midwayjs/express': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../web-express '@midwayjs/faas': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../faas '@midwayjs/koa': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../web-koa '@midwayjs/mock': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../mock '@midwayjs/web': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../web packages/consul: @@ -409,13 +397,13 @@ importers: version: 1.2.0 devDependencies: '@midwayjs/core': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../core '@midwayjs/koa': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../web-koa '@midwayjs/mock': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../mock '@types/consul': specifier: 0.40.3 @@ -432,9 +420,6 @@ importers: '@midwayjs/glob': specifier: ^1.0.2 version: 1.1.1 - class-transformer: - specifier: 0.5.1 - version: 0.5.1 picomatch: specifier: 2.3.1 version: 2.3.1 @@ -468,10 +453,10 @@ importers: version: 2.14.6 devDependencies: '@midwayjs/core': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../core '@midwayjs/mock': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../mock dotenv: specifier: 16.4.5 @@ -484,10 +469,10 @@ importers: version: 2.4.4 devDependencies: '@midwayjs/core': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../core '@midwayjs/mock': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../mock packages/cross-domain: @@ -497,22 +482,22 @@ importers: version: 1.1.2 devDependencies: '@midwayjs/core': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../core '@midwayjs/express': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../web-express '@midwayjs/faas': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../faas '@midwayjs/koa': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../web-koa '@midwayjs/mock': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../mock '@midwayjs/web': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../web packages/etcd: @@ -522,10 +507,10 @@ importers: version: 1.1.2 devDependencies: '@midwayjs/core': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../core '@midwayjs/mock': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../mock packages/express-session: @@ -538,10 +523,10 @@ importers: version: 1.18.0 devDependencies: '@midwayjs/core': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../core '@midwayjs/mock': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../mock '@types/express-session': specifier: 1.18.0 @@ -553,7 +538,7 @@ importers: packages/faas: dependencies: '@midwayjs/core': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../core '@midwayjs/serverless-http-parser': specifier: ^3.14.0 @@ -569,7 +554,7 @@ importers: specifier: ^3.0.0 version: 3.4.2 '@midwayjs/mock': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../mock mm: specifier: 3.4.0 @@ -583,13 +568,10 @@ importers: '@grpc/proto-loader': specifier: 0.7.13 version: 0.7.13 + devDependencies: '@midwayjs/core': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../core - devDependencies: - '@midwayjs/mock': - specifier: ^3.18.0 - version: link:../mock fs-extra: specifier: 11.2.0 version: 11.2.0 @@ -601,22 +583,22 @@ importers: version: 1.7.7 devDependencies: '@midwayjs/core': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../core '@midwayjs/express': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../web-express '@midwayjs/faas': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../faas '@midwayjs/koa': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../web-koa '@midwayjs/mock': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../mock '@midwayjs/web': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../web nock: specifier: 13.5.5 @@ -629,16 +611,16 @@ importers: version: 2.3.1 devDependencies: '@midwayjs/core': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../core '@midwayjs/express': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../web-express '@midwayjs/koa': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../web-koa '@midwayjs/mock': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../mock packages/info: @@ -648,16 +630,16 @@ importers: version: 2.3.1 devDependencies: '@midwayjs/core': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../core '@midwayjs/express': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../web-express '@midwayjs/koa': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../web-koa '@midwayjs/mock': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../mock packages/jwt: @@ -670,19 +652,19 @@ importers: version: 9.0.2 devDependencies: '@midwayjs/core': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../core '@midwayjs/express': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../web-express '@midwayjs/koa': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../web-koa '@midwayjs/mock': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../mock '@midwayjs/web': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../web packages/kafka: @@ -692,26 +674,26 @@ importers: version: 2.2.4 devDependencies: '@midwayjs/core': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../core '@midwayjs/mock': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../mock packages/leoric: dependencies: leoric: specifier: 2.12.3 - version: 2.12.3(mysql2@3.11.3)(sqlite3@5.1.7) + version: 2.12.3(mysql2@3.11.5)(sqlite3@5.1.7) devDependencies: '@midwayjs/core': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../core '@midwayjs/koa': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../web-koa '@midwayjs/mock': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../mock sqlite3: specifier: 5.1.7 @@ -720,13 +702,13 @@ importers: packages/mikro: devDependencies: '@midwayjs/core': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../core '@midwayjs/koa': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../web-koa '@midwayjs/mock': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../mock '@mikro-orm/core': specifier: 6.3.10 @@ -740,9 +722,6 @@ importers: packages/mock: dependencies: - '@midwayjs/async-hooks-context-manager': - specifier: ^3.18.0 - version: link:../async-hooks-context-manager '@types/superagent': specifier: 4.1.14 version: 4.1.14 @@ -760,7 +739,7 @@ importers: version: 6.3.3 devDependencies: '@midwayjs/core': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../core '@midwayjs/logger': specifier: ^3.0.0 @@ -787,10 +766,10 @@ importers: packages/mongoose: devDependencies: '@midwayjs/core': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../core '@midwayjs/mock': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../mock mongoose: specifier: 8.6.3 @@ -803,11 +782,41 @@ importers: version: 5.10.0 devDependencies: '@midwayjs/core': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../core '@midwayjs/mock': - specifier: ^3.18.0 + specifier: workspace:^ + version: link:../mock + + packages/nextjs: + devDependencies: + '@midwayjs/core': + specifier: workspace:^ + version: link:../core + '@midwayjs/koa': + specifier: workspace:^ + version: link:../web-koa + '@midwayjs/mock': + specifier: workspace:^ version: link:../mock + '@types/react': + specifier: ^18.3.12 + version: 18.3.16 + babel-loader: + specifier: ^9.2.1 + version: 9.2.1(@babel/core@7.26.0)(webpack@5.97.1) + next: + specifier: ~15.0.3 + version: 15.0.4(@babel/core@7.26.0)(@opentelemetry/api@1.9.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + null-loader: + specifier: ^4.0.1 + version: 4.0.1(webpack@5.97.1) + react: + specifier: ^18 + version: 18.3.1 + react-dom: + specifier: ^18 + version: 18.3.1(react@18.3.1) packages/oss: dependencies: @@ -819,10 +828,10 @@ importers: version: 6.21.0 devDependencies: '@midwayjs/core': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../core '@midwayjs/mock': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../mock dotenv: specifier: 16.4.5 @@ -835,13 +844,13 @@ importers: version: 1.9.0 devDependencies: '@midwayjs/core': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../core '@midwayjs/koa': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../web-koa '@midwayjs/mock': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../mock '@opentelemetry/sdk-node': specifier: 0.53.0 @@ -856,22 +865,22 @@ importers: packages/passport: devDependencies: '@midwayjs/core': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../core '@midwayjs/express': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../web-express '@midwayjs/jwt': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../jwt '@midwayjs/koa': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../web-koa '@midwayjs/mock': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../mock '@midwayjs/web': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../web '@types/passport-local': specifier: 1.0.38 @@ -902,13 +911,13 @@ importers: version: 2.88.2 devDependencies: '@midwayjs/core': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../core '@midwayjs/koa': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../web-koa '@midwayjs/mock': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../mock koa-bodyparser: specifier: 4.4.1 @@ -924,13 +933,13 @@ importers: version: 2.88.2 devDependencies: '@midwayjs/core': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../core '@midwayjs/koa': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../web-koa '@midwayjs/mock': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../mock '@types/request': specifier: 2.48.12 @@ -939,22 +948,22 @@ importers: packages/prometheus-socket-io: devDependencies: '@midwayjs/core': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../core '@midwayjs/koa': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../web-koa '@midwayjs/mock': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../mock '@midwayjs/prometheus': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../prometheus '@midwayjs/socketio': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../socketio '@midwayjs/web': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../web egg: specifier: ^2.28.0 @@ -963,15 +972,12 @@ importers: packages/rabbitmq: dependencies: '@midwayjs/core': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../core amqp-connection-manager: specifier: 4.1.14 version: 4.1.14(amqplib@0.10.4) devDependencies: - '@midwayjs/mock': - specifier: ^3.18.0 - version: link:../mock '@types/amqplib': specifier: 0.10.5 version: 0.10.5 @@ -989,10 +995,10 @@ importers: version: 5.4.1 devDependencies: '@midwayjs/core': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../core '@midwayjs/mock': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../mock packages/security: @@ -1017,34 +1023,31 @@ importers: version: 1.0.15 devDependencies: '@midwayjs/core': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../core '@midwayjs/express': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../web-express '@midwayjs/faas': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../faas '@midwayjs/koa': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../web-koa '@midwayjs/mock': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../mock '@midwayjs/web': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../web packages/sequelize: devDependencies: '@midwayjs/core': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../core - '@midwayjs/koa': - specifier: ^3.18.0 - version: link:../web-koa '@midwayjs/mock': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../mock sequelize: specifier: 6.37.3 @@ -1063,24 +1066,21 @@ importers: version: 1.2.0 devDependencies: '@midwayjs/core': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../core '@midwayjs/mock': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../mock packages/socketio: dependencies: - '@midwayjs/core': - specifier: ^3.18.0 - version: link:../core socket.io: specifier: 4.7.5 version: 4.7.5 devDependencies: - '@midwayjs/mock': - specifier: ^3.18.0 - version: link:../mock + '@midwayjs/core': + specifier: workspace:^ + version: link:../core fs-extra: specifier: 11.2.0 version: 11.2.0 @@ -1101,31 +1101,31 @@ importers: version: 1.4.0 devDependencies: '@midwayjs/core': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../core '@midwayjs/faas': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../faas '@midwayjs/koa': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../web-koa '@midwayjs/mock': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../mock packages/swagger: devDependencies: '@midwayjs/core': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../core '@midwayjs/koa': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../web-koa '@midwayjs/mock': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../mock '@midwayjs/validate': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../validate swagger-ui-dist: specifier: 5.17.14 @@ -1141,56 +1141,56 @@ importers: version: 5.5.1 devDependencies: '@midwayjs/core': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../core '@midwayjs/mock': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../mock packages/tags: devDependencies: '@midwayjs/core': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../core '@midwayjs/express': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../web-express '@midwayjs/faas': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../faas '@midwayjs/koa': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../web-koa '@midwayjs/mock': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../mock '@midwayjs/web': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../web mysql2: specifier: ^3.0.0 - version: 3.11.3 + version: 3.11.5 packages/tenant: devDependencies: '@midwayjs/core': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../core '@midwayjs/mock': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../mock packages/typegoose: dependencies: '@midwayjs/mongoose': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../mongoose devDependencies: '@midwayjs/core': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../core '@midwayjs/mock': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../mock '@typegoose/typegoose': specifier: 12.8.0 @@ -1202,17 +1202,17 @@ importers: packages/typeorm: devDependencies: '@midwayjs/core': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../core '@midwayjs/mock': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../mock sqlite3: specifier: 5.1.7 version: 5.1.7 typeorm: specifier: 0.3.20 - version: 0.3.20(ioredis@5.4.1)(mysql2@3.11.3)(redis@3.1.2)(sqlite3@5.1.7)(ts-node@10.9.2(@types/node@20.16.10)(typescript@5.3.3)) + version: 0.3.20(ioredis@5.4.1)(mysql2@3.11.5)(redis@3.1.2)(sqlite3@5.1.7)(ts-node@10.9.2(@types/node@20.16.10)(typescript@5.3.3)) packages/upload: dependencies: @@ -1224,44 +1224,44 @@ importers: version: 2.5.2 devDependencies: '@midwayjs/core': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../core '@midwayjs/express': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../web-express '@midwayjs/faas': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../faas '@midwayjs/koa': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../web-koa '@midwayjs/mock': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../mock '@midwayjs/web': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../web packages/validate: dependencies: '@midwayjs/i18n': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../i18n joi: specifier: 17.13.3 version: 17.13.3 devDependencies: '@midwayjs/core': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../core '@midwayjs/express': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../web-express '@midwayjs/koa': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../web-koa '@midwayjs/mock': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../mock packages/version: {} @@ -1269,51 +1269,51 @@ importers: packages/view: devDependencies: '@midwayjs/core': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../core '@midwayjs/koa': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../web-koa '@midwayjs/mock': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../mock packages/view-ejs: dependencies: '@midwayjs/view': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../view ejs: specifier: 3.1.10 version: 3.1.10 devDependencies: '@midwayjs/core': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../core '@midwayjs/koa': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../web-koa '@midwayjs/mock': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../mock packages/view-nunjucks: dependencies: '@midwayjs/view': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../view nunjucks: specifier: ^3.2.2 version: 3.2.4 devDependencies: '@midwayjs/core': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../core '@midwayjs/koa': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../web-koa '@midwayjs/mock': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../mock packages/web: @@ -1322,7 +1322,7 @@ importers: specifier: ^2.0.0 version: 2.0.1 '@midwayjs/core': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../core egg: specifier: ^2.28.0 @@ -1347,7 +1347,7 @@ importers: specifier: ^3.0.0 version: 3.4.2 '@midwayjs/mock': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../mock '@types/koa': specifier: 2.15.0 @@ -1378,7 +1378,7 @@ importers: version: 11.2.0 is-type-of: specifier: ^2.1.0 - version: 2.1.0 + version: 2.2.0 mm: specifier: 3.4.0 version: 3.4.0 @@ -1400,24 +1400,24 @@ importers: packages/web-express: dependencies: - '@midwayjs/core': - specifier: ^3.18.0 - version: link:../core '@midwayjs/express-session': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../express-session body-parser: specifier: 1.20.3 version: 1.20.3 cookie-parser: specifier: ^1.4.6 - version: 1.4.6 + version: 1.4.7 express: specifier: 4.20.0 version: 4.20.0 devDependencies: + '@midwayjs/core': + specifier: workspace:^ + version: link:../core '@midwayjs/mock': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../mock '@types/body-parser': specifier: 1.19.5 @@ -1437,11 +1437,8 @@ importers: '@midwayjs/cookies': specifier: ^1.0.2 version: 1.2.0 - '@midwayjs/core': - specifier: ^3.18.0 - version: link:../core '@midwayjs/session': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../session '@types/koa': specifier: 2.15.0 @@ -1459,8 +1456,11 @@ importers: specifier: 6.13.0 version: 6.13.0 devDependencies: + '@midwayjs/core': + specifier: workspace:^ + version: link:../core '@midwayjs/mock': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../mock '@types/koa-router': specifier: 7.4.8 @@ -1479,10 +1479,10 @@ importers: version: 8.18.0 devDependencies: '@midwayjs/core': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../core '@midwayjs/mock': - specifier: ^3.18.0 + specifier: workspace:^ version: link:../mock fs-extra: specifier: 11.2.0 @@ -1504,94 +1504,90 @@ packages: '@babel/code-frame@7.12.11': resolution: {integrity: sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw==} - '@babel/code-frame@7.25.7': - resolution: {integrity: sha512-0xZJFNE5XMpENsgfHYTw8FbX4kv53mFLn2i3XPoq69LyhYSCBJtitaHx9QnsVTrsogI4Z3+HtEfZ2/GFPOtf5g==} + '@babel/code-frame@7.26.2': + resolution: {integrity: sha512-RJlIHRueQgwWitWgF8OdFYGZX328Ax5BCemNGlqHfplnRT9ESi8JkFlvaVYbS+UubVY6dpv87Fs2u5M29iNFVQ==} engines: {node: '>=6.9.0'} - '@babel/compat-data@7.25.7': - resolution: {integrity: sha512-9ickoLz+hcXCeh7jrcin+/SLWm+GkxE2kTvoYyp38p4WkdFXfQJxDFGWp/YHjiKLPx06z2A7W8XKuqbReXDzsw==} + '@babel/compat-data@7.26.3': + resolution: {integrity: sha512-nHIxvKPniQXpmQLb0vhY3VaFb3S0YrTAwpOWJZh1wn3oJPjJk9Asva204PsBdmAE8vpzfHudT8DB0scYvy9q0g==} engines: {node: '>=6.9.0'} - '@babel/core@7.25.7': - resolution: {integrity: sha512-yJ474Zv3cwiSOO9nXJuqzvwEeM+chDuQ8GJirw+pZ91sCGCyOZ3dJkVE09fTV0VEVzXyLWhh3G/AolYTPX7Mow==} + '@babel/core@7.26.0': + resolution: {integrity: sha512-i1SLeK+DzNnQ3LL/CswPCa/E5u4lh1k6IAEphON8F+cXt0t9euTshDru0q7/IqMa1PMPz5RnHuHscF8/ZJsStg==} engines: {node: '>=6.9.0'} - '@babel/generator@7.25.7': - resolution: {integrity: sha512-5Dqpl5fyV9pIAD62yK9P7fcA768uVPUyrQmqpqstHWgMma4feF1x/oFysBCVZLY5wJ2GkMUCdsNDnGZrPoR6rA==} + '@babel/generator@7.26.3': + resolution: {integrity: sha512-6FF/urZvD0sTeO7k6/B15pMLC4CHUv1426lzr3N01aHJTl046uCAh9LXW/fzeXXjPNCJ6iABW5XaWOsIZB93aQ==} engines: {node: '>=6.9.0'} - '@babel/helper-annotate-as-pure@7.25.7': - resolution: {integrity: sha512-4xwU8StnqnlIhhioZf1tqnVWeQ9pvH/ujS8hRfw/WOza+/a+1qv69BWNy+oY231maTCWgKWhfBU7kDpsds6zAA==} + '@babel/helper-annotate-as-pure@7.25.9': + resolution: {integrity: sha512-gv7320KBUFJz1RnylIg5WWYPRXKZ884AGkYpgpWW02TH66Dl+HaC1t1CKd0z3R4b6hdYEcmrNZHUmfCP+1u3/g==} engines: {node: '>=6.9.0'} - '@babel/helper-compilation-targets@7.25.7': - resolution: {integrity: sha512-DniTEax0sv6isaw6qSQSfV4gVRNtw2rte8HHM45t9ZR0xILaufBRNkpMifCRiAPyvL4ACD6v0gfCwCmtOQaV4A==} + '@babel/helper-compilation-targets@7.25.9': + resolution: {integrity: sha512-j9Db8Suy6yV/VHa4qzrj9yZfZxhLWQdVnRlXxmKLYlhWUVB1sB2G5sxuWYXk/whHD9iW76PmNzxZ4UCnTQTVEQ==} engines: {node: '>=6.9.0'} - '@babel/helper-create-class-features-plugin@7.25.7': - resolution: {integrity: sha512-bD4WQhbkx80mAyj/WCm4ZHcF4rDxkoLFO6ph8/5/mQ3z4vAzltQXAmbc7GvVJx5H+lk5Mi5EmbTeox5nMGCsbw==} + '@babel/helper-create-class-features-plugin@7.25.9': + resolution: {integrity: sha512-UTZQMvt0d/rSz6KI+qdu7GQze5TIajwTS++GUozlw8VBJDEOAqSXwm1WvmYEZwqdqSGQshRocPDqrt4HBZB3fQ==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0 - '@babel/helper-member-expression-to-functions@7.25.7': - resolution: {integrity: sha512-O31Ssjd5K6lPbTX9AAYpSKrZmLeagt9uwschJd+Ixo6QiRyfpvgtVQp8qrDR9UNFjZ8+DO34ZkdrN+BnPXemeA==} + '@babel/helper-member-expression-to-functions@7.25.9': + resolution: {integrity: sha512-wbfdZ9w5vk0C0oyHqAJbc62+vet5prjj01jjJ8sKn3j9h3MQQlflEdXYvuqRWjHnM12coDEqiC1IRCi0U/EKwQ==} engines: {node: '>=6.9.0'} - '@babel/helper-module-imports@7.25.7': - resolution: {integrity: sha512-o0xCgpNmRohmnoWKQ0Ij8IdddjyBFE4T2kagL/x6M3+4zUgc+4qTOUBoNe4XxDskt1HPKO007ZPiMgLDq2s7Kw==} + '@babel/helper-module-imports@7.25.9': + resolution: {integrity: sha512-tnUA4RsrmflIM6W6RFTLFSXITtl0wKjgpnLgXyowocVPrbYrLUXSBXDgTs8BlbmIzIdlBySRQjINYs2BAkiLtw==} engines: {node: '>=6.9.0'} - '@babel/helper-module-transforms@7.25.7': - resolution: {integrity: sha512-k/6f8dKG3yDz/qCwSM+RKovjMix563SLxQFo0UhRNo239SP6n9u5/eLtKD6EAjwta2JHJ49CsD8pms2HdNiMMQ==} + '@babel/helper-module-transforms@7.26.0': + resolution: {integrity: sha512-xO+xu6B5K2czEnQye6BHA7DolFFmS3LB7stHZFaOLb1pAwO1HWLS8fXA+eh0A2yIvltPVmx3eNNDBJA2SLHXFw==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0 - '@babel/helper-optimise-call-expression@7.25.7': - resolution: {integrity: sha512-VAwcwuYhv/AT+Vfr28c9y6SHzTan1ryqrydSTFGjU0uDJHw3uZ+PduI8plCLkRsDnqK2DMEDmwrOQRsK/Ykjng==} + '@babel/helper-optimise-call-expression@7.25.9': + resolution: {integrity: sha512-FIpuNaz5ow8VyrYcnXQTDRGvV6tTjkNtCK/RYNDXGSLlUD6cBuQTSw43CShGxjvfBTfcUA/r6UhUCbtYqkhcuQ==} engines: {node: '>=6.9.0'} - '@babel/helper-plugin-utils@7.25.7': - resolution: {integrity: sha512-eaPZai0PiqCi09pPs3pAFfl/zYgGaE6IdXtYvmf0qlcDTd3WCtO7JWCcRd64e0EQrcYgiHibEZnOGsSY4QSgaw==} + '@babel/helper-plugin-utils@7.25.9': + resolution: {integrity: sha512-kSMlyUVdWe25rEsRGviIgOWnoT/nfABVWlqt9N19/dIPWViAOW2s9wznP5tURbs/IDuNk4gPy3YdYRgH3uxhBw==} engines: {node: '>=6.9.0'} - '@babel/helper-replace-supers@7.25.7': - resolution: {integrity: sha512-iy8JhqlUW9PtZkd4pHM96v6BdJ66Ba9yWSE4z0W4TvSZwLBPkyDsiIU3ENe4SmrzRBs76F7rQXTy1lYC49n6Lw==} + '@babel/helper-replace-supers@7.25.9': + resolution: {integrity: sha512-IiDqTOTBQy0sWyeXyGSC5TBJpGFXBkRynjBeXsvbhQFKj2viwJC76Epz35YLU1fpe/Am6Vppb7W7zM4fPQzLsQ==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0 - '@babel/helper-simple-access@7.25.7': - resolution: {integrity: sha512-FPGAkJmyoChQeM+ruBGIDyrT2tKfZJO8NcxdC+CWNJi7N8/rZpSxK7yvBJ5O/nF1gfu5KzN7VKG3YVSLFfRSxQ==} - engines: {node: '>=6.9.0'} - - '@babel/helper-skip-transparent-expression-wrappers@7.25.7': - resolution: {integrity: sha512-pPbNbchZBkPMD50K0p3JGcFMNLVUCuU/ABybm/PGNj4JiHrpmNyqqCphBk4i19xXtNV0JhldQJJtbSW5aUvbyA==} + '@babel/helper-skip-transparent-expression-wrappers@7.25.9': + resolution: {integrity: sha512-K4Du3BFa3gvyhzgPcntrkDgZzQaq6uozzcpGbOO1OEJaI+EJdqWIMTLgFgQf6lrfiDFo5FU+BxKepI9RmZqahA==} engines: {node: '>=6.9.0'} - '@babel/helper-string-parser@7.25.7': - resolution: {integrity: sha512-CbkjYdsJNHFk8uqpEkpCvRs3YRp9tY6FmFY7wLMSYuGYkrdUi7r2lc4/wqsvlHoMznX3WJ9IP8giGPq68T/Y6g==} + '@babel/helper-string-parser@7.25.9': + resolution: {integrity: sha512-4A/SCr/2KLd5jrtOMFzaKjVtAei3+2r/NChoBNoZ3EyP/+GlhoaEGoWOZUmFmoITP7zOJyHIMm+DYRd8o3PvHA==} engines: {node: '>=6.9.0'} - '@babel/helper-validator-identifier@7.25.7': - resolution: {integrity: sha512-AM6TzwYqGChO45oiuPqwL2t20/HdMC1rTPAesnBCgPCSF1x3oN9MVUwQV2iyz4xqWrctwK5RNC8LV22kaQCNYg==} + '@babel/helper-validator-identifier@7.25.9': + resolution: {integrity: sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ==} engines: {node: '>=6.9.0'} - '@babel/helper-validator-option@7.25.7': - resolution: {integrity: sha512-ytbPLsm+GjArDYXJ8Ydr1c/KJuutjF2besPNbIZnZ6MKUxi/uTA22t2ymmA4WFjZFpjiAMO0xuuJPqK2nvDVfQ==} + '@babel/helper-validator-option@7.25.9': + resolution: {integrity: sha512-e/zv1co8pp55dNdEcCynfj9X7nyUKUXoUEwfXqaZt0omVOmDe9oOTdKStH4GmAw6zxMFs50ZayuMfHDKlO7Tfw==} engines: {node: '>=6.9.0'} - '@babel/helpers@7.25.7': - resolution: {integrity: sha512-Sv6pASx7Esm38KQpF/U/OXLwPPrdGHNKoeblRxgZRLXnAtnkEe4ptJPDtAZM7fBLadbc1Q07kQpSiGQ0Jg6tRA==} + '@babel/helpers@7.26.0': + resolution: {integrity: sha512-tbhNuIxNcVb21pInl3ZSjksLCvgdZy9KwJ8brv993QtIVKJBBkYXz4q4ZbAv31GdnC+R90np23L5FbEBlthAEw==} engines: {node: '>=6.9.0'} - '@babel/highlight@7.25.7': - resolution: {integrity: sha512-iYyACpW3iW8Fw+ZybQK+drQre+ns/tKpXbNESfrhNnPLIklLbXr7MYJ6gPEd0iETGLOK+SxMjVvKb/ffmk+FEw==} + '@babel/highlight@7.25.9': + resolution: {integrity: sha512-llL88JShoCsth8fF8R4SJnIn+WLvR6ccFxu1H3FlMhDontdcmZWf2HgIZ7AIqV3Xcck1idlohrN4EUBQz6klbw==} engines: {node: '>=6.9.0'} - '@babel/parser@7.25.7': - resolution: {integrity: sha512-aZn7ETtQsjjGG5HruveUK06cU3Hljuhd9Iojm4M8WWv3wLE6OkE5PWbDUkItmMgegmccaITudyuW5RPYrYlgWw==} + '@babel/parser@7.26.3': + resolution: {integrity: sha512-WJ/CvmY8Mea8iDXo6a7RK2wbmJITT5fN3BEkRuFlxVyNx8jOKIIhmC4fSkTcPcf8JyavbBwIe6OpiCOBXt/IcA==} engines: {node: '>=6.0.0'} hasBin: true @@ -1622,14 +1618,14 @@ packages: peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-syntax-decorators@7.25.7': - resolution: {integrity: sha512-oXduHo642ZhstLVYTe2z2GSJIruU0c/W3/Ghr6A5yGMsVrvdnxO1z+3pbTcT7f3/Clnt+1z8D/w1r1f1SHaCHw==} + '@babel/plugin-syntax-decorators@7.25.9': + resolution: {integrity: sha512-ryzI0McXUPJnRCvMo4lumIKZUzhYUO/ScI+Mz4YVaTLt04DHNSjEUjKVvbzQjZFLuod/cYEc07mJWhzl6v4DPg==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-syntax-import-attributes@7.25.7': - resolution: {integrity: sha512-AqVo+dguCgmpi/3mYBdu9lkngOBlQ2w2vnNpa6gfiCxQZLzV4ZbhsXitJ2Yblkoe1VQwtHSaNmIaGll/26YWRw==} + '@babel/plugin-syntax-import-attributes@7.26.0': + resolution: {integrity: sha512-e2dttdsJ1ZTpi3B9UYGLw41hifAubg19AtCu/2I/F1QNVclOBr1dYpTdmdyZ84Xiz43BS/tCUkMAZNLv12Pi+A==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 @@ -1644,8 +1640,8 @@ packages: peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-syntax-jsx@7.25.7': - resolution: {integrity: sha512-ruZOnKO+ajVL/MVx+PwNBPOkrnXTXoWMtte1MBpegfCArhqOe3Bj52avVj1huLLxNKYKXYaSxZ2F+woK1ekXfw==} + '@babel/plugin-syntax-jsx@7.25.9': + resolution: {integrity: sha512-ld6oezHQMZsZfp6pWtbjaNDF2tiiCYYDqQszHt5VV437lewP9aSi2Of99CK0D0XB21k7FLgnLcmQKyKzynfeAA==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 @@ -1692,26 +1688,26 @@ packages: peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-syntax-typescript@7.25.7': - resolution: {integrity: sha512-rR+5FDjpCHqqZN2bzZm18bVYGaejGq5ZkpVCJLXor/+zlSrSoc4KWcHI0URVWjl/68Dyr1uwZUz/1njycEAv9g==} + '@babel/plugin-syntax-typescript@7.25.9': + resolution: {integrity: sha512-hjMgRy5hb8uJJjUcdWunWVcoi9bGpJp8p5Ol1229PoN6aytsLwNMgmdftO23wnCLMfVmTwZDWMPNq/D1SY60JQ==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/runtime@7.25.7': - resolution: {integrity: sha512-FjoyLe754PMiYsFaN5C94ttGiOmBNYTf6pLr4xXHAT5uctHb092PBszndLDR5XA/jghQvn4n7JMHl7dmTgbm9w==} + '@babel/runtime@7.26.0': + resolution: {integrity: sha512-FDSOghenHTiToteC/QRlv2q3DhPZ/oOXTBoirfWNx1Cx3TMVcGWQtMMmQcSvb/JjpNeGzx8Pq/b4fKEJuWm1sw==} engines: {node: '>=6.9.0'} - '@babel/template@7.25.7': - resolution: {integrity: sha512-wRwtAgI3bAS+JGU2upWNL9lSlDcRCqD05BZ1n3X2ONLH1WilFP6O1otQjeMK/1g0pvYcXC7b/qVUB1keofjtZA==} + '@babel/template@7.25.9': + resolution: {integrity: sha512-9DGttpmPvIxBb/2uwpVo3dqJ+O6RooAFOS+lB+xDqoE2PVCE8nfoHMdZLpfCQRLwvohzXISPZcgxt80xLfsuwg==} engines: {node: '>=6.9.0'} - '@babel/traverse@7.25.7': - resolution: {integrity: sha512-jatJPT1Zjqvh/1FyJs6qAHL+Dzb7sTb+xr7Q+gM1b+1oBsMsQQ4FkVKb6dFlJvLlVssqkRzV05Jzervt9yhnzg==} + '@babel/traverse@7.26.4': + resolution: {integrity: sha512-fH+b7Y4p3yqvApJALCPJcwb0/XaOSgtK4pzV6WVjPR5GLFQBRI7pfoX2V2iM48NXvX07NUxxm1Vw98YjqTcU5w==} engines: {node: '>=6.9.0'} - '@babel/types@7.25.7': - resolution: {integrity: sha512-vwIVdXG+j+FOpkwqHRcBgHLYNL7XMkufrlaFvL9o6Ai9sJn9+PdyIL5qa0XzTZw084c+u9LOls53eoZWP/W5WQ==} + '@babel/types@7.26.3': + resolution: {integrity: sha512-vN5p+1kl59GVKMvTHt55NzzmYVxprfJD+ql7U9NFIfKCBkYE55LYtS+WtPlaYOyzydrKI8Nezd+aZextrd+FMA==} engines: {node: '>=6.9.0'} '@bcoe/v8-coverage@0.2.3': @@ -1741,14 +1737,17 @@ packages: resolution: {integrity: sha512-oiP0sSMP6DkghgIp3VvpEgTRhTwDDpBzUdwaQH+sIpanlUOhctoRsw3zKVNwvOi/aNguHNNHaZUcq3HReBohhA==} engines: {node: '>= 8'} - '@eslint-community/eslint-utils@4.4.0': - resolution: {integrity: sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==} + '@emnapi/runtime@1.3.1': + resolution: {integrity: sha512-kEBmG8KyqtxJZv+ygbEim+KCGtIq1fC22Ms3S4ziXmYKm8uyoLX0MHONVKwp+9opg390VaKRNt4a7A9NwmpNhw==} + + '@eslint-community/eslint-utils@4.4.1': + resolution: {integrity: sha512-s3O3waFUrMV8P/XaF/+ZTp1X9XBZW1a4B97ZnjQF2KYWaFD2A8KyFBsrsfSjEmjn3RGWAIuvlneuZm3CUK3jbA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: eslint: ^6.0.0 || ^7.0.0 || >=8.0.0 - '@eslint-community/regexpp@4.11.1': - resolution: {integrity: sha512-m4DVN9ZqskZoLU5GlWZadwDnYo3vAEydiUayB9widCl9ffWx2IvPnp6n3on5rJmziJSw9Bv+Z3ChDVdMwXCY8Q==} + '@eslint-community/regexpp@4.12.1': + resolution: {integrity: sha512-CCZCDJuduB9OUkFkY2IgppNZMi2lBQgD2qzwXkEia16cge2pijY/aXi96CJMquDMn3nJdlPV1A5KrJEXwfLNzQ==} engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} '@eslint/eslintrc@0.4.3': @@ -1789,6 +1788,111 @@ packages: resolution: {integrity: sha512-H9XAx3hc0BQHY6l+IFSWHDySypcXsvsuLhgYLUGywmJ5pswRVQJUHpOsobnLYp2ZUaUlKiKDrgWWhosOwAEM8Q==} engines: {node: '>=6.9.0'} + '@img/sharp-darwin-arm64@0.33.5': + resolution: {integrity: sha512-UT4p+iz/2H4twwAoLCqfA9UH5pI6DggwKEGuaPy7nCVQ8ZsiY5PIcrRvD1DzuY3qYL07NtIQcWnBSY/heikIFQ==} + engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} + cpu: [arm64] + os: [darwin] + + '@img/sharp-darwin-x64@0.33.5': + resolution: {integrity: sha512-fyHac4jIc1ANYGRDxtiqelIbdWkIuQaI84Mv45KvGRRxSAa7o7d1ZKAOBaYbnepLC1WqxfpimdeWfvqqSGwR2Q==} + engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} + cpu: [x64] + os: [darwin] + + '@img/sharp-libvips-darwin-arm64@1.0.4': + resolution: {integrity: sha512-XblONe153h0O2zuFfTAbQYAX2JhYmDHeWikp1LM9Hul9gVPjFY427k6dFEcOL72O01QxQsWi761svJ/ev9xEDg==} + cpu: [arm64] + os: [darwin] + + '@img/sharp-libvips-darwin-x64@1.0.4': + resolution: {integrity: sha512-xnGR8YuZYfJGmWPvmlunFaWJsb9T/AO2ykoP3Fz/0X5XV2aoYBPkX6xqCQvUTKKiLddarLaxpzNe+b1hjeWHAQ==} + cpu: [x64] + os: [darwin] + + '@img/sharp-libvips-linux-arm64@1.0.4': + resolution: {integrity: sha512-9B+taZ8DlyyqzZQnoeIvDVR/2F4EbMepXMc/NdVbkzsJbzkUjhXv/70GQJ7tdLA4YJgNP25zukcxpX2/SueNrA==} + cpu: [arm64] + os: [linux] + + '@img/sharp-libvips-linux-arm@1.0.5': + resolution: {integrity: sha512-gvcC4ACAOPRNATg/ov8/MnbxFDJqf/pDePbBnuBDcjsI8PssmjoKMAz4LtLaVi+OnSb5FK/yIOamqDwGmXW32g==} + cpu: [arm] + os: [linux] + + '@img/sharp-libvips-linux-s390x@1.0.4': + resolution: {integrity: sha512-u7Wz6ntiSSgGSGcjZ55im6uvTrOxSIS8/dgoVMoiGE9I6JAfU50yH5BoDlYA1tcuGS7g/QNtetJnxA6QEsCVTA==} + cpu: [s390x] + os: [linux] + + '@img/sharp-libvips-linux-x64@1.0.4': + resolution: {integrity: sha512-MmWmQ3iPFZr0Iev+BAgVMb3ZyC4KeFc3jFxnNbEPas60e1cIfevbtuyf9nDGIzOaW9PdnDciJm+wFFaTlj5xYw==} + cpu: [x64] + os: [linux] + + '@img/sharp-libvips-linuxmusl-arm64@1.0.4': + resolution: {integrity: sha512-9Ti+BbTYDcsbp4wfYib8Ctm1ilkugkA/uscUn6UXK1ldpC1JjiXbLfFZtRlBhjPZ5o1NCLiDbg8fhUPKStHoTA==} + cpu: [arm64] + os: [linux] + + '@img/sharp-libvips-linuxmusl-x64@1.0.4': + resolution: {integrity: sha512-viYN1KX9m+/hGkJtvYYp+CCLgnJXwiQB39damAO7WMdKWlIhmYTfHjwSbQeUK/20vY154mwezd9HflVFM1wVSw==} + cpu: [x64] + os: [linux] + + '@img/sharp-linux-arm64@0.33.5': + resolution: {integrity: sha512-JMVv+AMRyGOHtO1RFBiJy/MBsgz0x4AWrT6QoEVVTyh1E39TrCUpTRI7mx9VksGX4awWASxqCYLCV4wBZHAYxA==} + engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} + cpu: [arm64] + os: [linux] + + '@img/sharp-linux-arm@0.33.5': + resolution: {integrity: sha512-JTS1eldqZbJxjvKaAkxhZmBqPRGmxgu+qFKSInv8moZ2AmT5Yib3EQ1c6gp493HvrvV8QgdOXdyaIBrhvFhBMQ==} + engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} + cpu: [arm] + os: [linux] + + '@img/sharp-linux-s390x@0.33.5': + resolution: {integrity: sha512-y/5PCd+mP4CA/sPDKl2961b+C9d+vPAveS33s6Z3zfASk2j5upL6fXVPZi7ztePZ5CuH+1kW8JtvxgbuXHRa4Q==} + engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} + cpu: [s390x] + os: [linux] + + '@img/sharp-linux-x64@0.33.5': + resolution: {integrity: sha512-opC+Ok5pRNAzuvq1AG0ar+1owsu842/Ab+4qvU879ippJBHvyY5n2mxF1izXqkPYlGuP/M556uh53jRLJmzTWA==} + engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} + cpu: [x64] + os: [linux] + + '@img/sharp-linuxmusl-arm64@0.33.5': + resolution: {integrity: sha512-XrHMZwGQGvJg2V/oRSUfSAfjfPxO+4DkiRh6p2AFjLQztWUuY/o8Mq0eMQVIY7HJ1CDQUJlxGGZRw1a5bqmd1g==} + engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} + cpu: [arm64] + os: [linux] + + '@img/sharp-linuxmusl-x64@0.33.5': + resolution: {integrity: sha512-WT+d/cgqKkkKySYmqoZ8y3pxx7lx9vVejxW/W4DOFMYVSkErR+w7mf2u8m/y4+xHe7yY9DAXQMWQhpnMuFfScw==} + engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} + cpu: [x64] + os: [linux] + + '@img/sharp-wasm32@0.33.5': + resolution: {integrity: sha512-ykUW4LVGaMcU9lu9thv85CbRMAwfeadCJHRsg2GmeRa/cJxsVY9Rbd57JcMxBkKHag5U/x7TSBpScF4U8ElVzg==} + engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} + cpu: [wasm32] + + '@img/sharp-win32-ia32@0.33.5': + resolution: {integrity: sha512-T36PblLaTwuVJ/zw/LaH0PdZkRz5rd3SmMHX8GSmR7vtNSP5Z6bQkExdSK7xGWyxLw4sUknBuugTelgw2faBbQ==} + engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} + cpu: [ia32] + os: [win32] + + '@img/sharp-win32-x64@0.33.5': + resolution: {integrity: sha512-MpY/o8/8kj+EcnxwvrP4aTJSWw/aZ7JIGR4aBeZkZw5B7/Jn+tY9/VNwtcoGmdT7GfggGIU4kygOMSbYnOrAbg==} + engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} + cpu: [x64] + os: [win32] + '@ioredis/commands@1.2.0': resolution: {integrity: sha512-Sx1pU8EM64o2BrqNpEO1CNLtKQwyhuXuqyfH7oGKCk+1a33d2r5saW8zNwm3j6BTExtjrv2BxTgzzkMwts6vGg==} @@ -1870,8 +1974,8 @@ packages: resolution: {integrity: sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - '@jridgewell/gen-mapping@0.3.5': - resolution: {integrity: sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==} + '@jridgewell/gen-mapping@0.3.8': + resolution: {integrity: sha512-imAbBGkb+ebQyxKgzv5Hu2nmROxoDOXHh80evxdoXNOrvAnVx7zimzc1Oo5h9RlfV4vPXaE2iM5pOFbvOCClWA==} engines: {node: '>=6.0.0'} '@jridgewell/resolve-uri@3.1.2': @@ -1882,6 +1986,9 @@ packages: resolution: {integrity: sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==} engines: {node: '>=6.0.0'} + '@jridgewell/source-map@0.3.6': + resolution: {integrity: sha512-1ZJTZebgqllO79ue2bm3rIGud/bOe0pP5BjSRCRxxYkEZS8STV7zN84UBbiYu7jy+eCKSnVIUgoWWE/tt+shMQ==} + '@jridgewell/sourcemap-codec@1.5.0': resolution: {integrity: sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==} @@ -1905,6 +2012,10 @@ packages: resolution: {integrity: sha512-GzScCIkAW3tg3+Yn/MKCH9963bzG+zpjGz2NdfYDlYWI7p0f/SH46v1dqpPpYmZ2E/m3JK8HjTNNNL8eIm8/YQ==} engines: {node: '>=18.0.0'} + '@midwayjs/bull@3.19.1': + resolution: {integrity: sha512-Dr+IO1VbiLBa6gfrsdQ/gN+1Py8j1jdwk4p2mqTcJYNUMVfNhfXEZA0O77bGxtv/XW3TZNCk5/ZGUZLy9n8I9Q==} + engines: {node: '>=12'} + '@midwayjs/cookies@1.2.0': resolution: {integrity: sha512-gdfAXk3+uL+9qcNo9lNnUFJCUGXXxCitBjyz9QJR08dcZ11mqTbxVNXhea525e3ZwKREy6f4PHAWofFwlPOZzQ==} engines: {node: '>=10'} @@ -1993,6 +2104,57 @@ packages: cpu: [x64] os: [win32] + '@next/env@15.0.4': + resolution: {integrity: sha512-WNRvtgnRVDD4oM8gbUcRc27IAhaL4eXQ/2ovGbgLnPGUvdyDr8UdXP4Q/IBDdAdojnD2eScryIDirv0YUCjUVw==} + + '@next/swc-darwin-arm64@15.0.4': + resolution: {integrity: sha512-QecQXPD0yRHxSXWL5Ff80nD+A56sUXZG9koUsjWJwA2Z0ZgVQfuy7gd0/otjxoOovPVHR2eVEvPMHbtZP+pf9w==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [darwin] + + '@next/swc-darwin-x64@15.0.4': + resolution: {integrity: sha512-pb7Bye3y1Og3PlCtnz2oO4z+/b3pH2/HSYkLbL0hbVuTGil7fPen8/3pyyLjdiTLcFJ+ymeU3bck5hd4IPFFCA==} + engines: {node: '>= 10'} + cpu: [x64] + os: [darwin] + + '@next/swc-linux-arm64-gnu@15.0.4': + resolution: {integrity: sha512-12oSaBFjGpB227VHzoXF3gJoK2SlVGmFJMaBJSu5rbpaoT5OjP5OuCLuR9/jnyBF1BAWMs/boa6mLMoJPRriMA==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [linux] + + '@next/swc-linux-arm64-musl@15.0.4': + resolution: {integrity: sha512-QARO88fR/a+wg+OFC3dGytJVVviiYFEyjc/Zzkjn/HevUuJ7qGUUAUYy5PGVWY1YgTzeRYz78akQrVQ8r+sMjw==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [linux] + + '@next/swc-linux-x64-gnu@15.0.4': + resolution: {integrity: sha512-Z50b0gvYiUU1vLzfAMiChV8Y+6u/T2mdfpXPHraqpypP7yIT2UV9YBBhcwYkxujmCvGEcRTVWOj3EP7XW/wUnw==} + engines: {node: '>= 10'} + cpu: [x64] + os: [linux] + + '@next/swc-linux-x64-musl@15.0.4': + resolution: {integrity: sha512-7H9C4FAsrTAbA/ENzvFWsVytqRYhaJYKa2B3fyQcv96TkOGVMcvyS6s+sj4jZlacxxTcn7ygaMXUPkEk7b78zw==} + engines: {node: '>= 10'} + cpu: [x64] + os: [linux] + + '@next/swc-win32-arm64-msvc@15.0.4': + resolution: {integrity: sha512-Z/v3WV5xRaeWlgJzN9r4PydWD8sXV35ywc28W63i37G2jnUgScA4OOgS8hQdiXLxE3gqfSuHTicUhr7931OXPQ==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [win32] + + '@next/swc-win32-x64-msvc@15.0.4': + resolution: {integrity: sha512-NGLchGruagh8lQpDr98bHLyWJXOBSmkEAfK980OiNBa7vNm6PsNoPvzTfstT78WyOeMRQphEQ455rggd7Eo+Dw==} + engines: {node: '>= 10'} + cpu: [x64] + os: [win32] + '@nodelib/fs.scandir@2.1.5': resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} engines: {node: '>= 8'} @@ -2422,20 +2584,20 @@ packages: '@protobufjs/utf8@1.1.0': resolution: {integrity: sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==} - '@shikijs/core@1.22.0': - resolution: {integrity: sha512-S8sMe4q71TJAW+qG93s5VaiihujRK6rqDFqBnxqvga/3LvqHEnxqBIOPkt//IdXVtHkQWKu4nOQNk0uBGicU7Q==} + '@shikijs/core@1.24.2': + resolution: {integrity: sha512-BpbNUSKIwbKrRRA+BQj0BEWSw+8kOPKDJevWeSE/xIqGX7K0xrCZQ9kK0nnEQyrzsUoka1l81ZtJ2mGaCA32HQ==} - '@shikijs/engine-javascript@1.22.0': - resolution: {integrity: sha512-AeEtF4Gcck2dwBqCFUKYfsCq0s+eEbCEbkUuFou53NZ0sTGnJnJ/05KHQFZxpii5HMXbocV9URYVowOP2wH5kw==} + '@shikijs/engine-javascript@1.24.2': + resolution: {integrity: sha512-EqsmYBJdLEwEiO4H+oExz34a5GhhnVp+jH9Q/XjPjmBPc6TE/x4/gD0X3i0EbkKKNqXYHHJTJUpOLRQNkEzS9Q==} - '@shikijs/engine-oniguruma@1.22.0': - resolution: {integrity: sha512-5iBVjhu/DYs1HB0BKsRRFipRrD7rqjxlWTj4F2Pf+nQSPqc3kcyqFFeZXnBMzDf0HdqaFVvhDRAGiYNvyLP+Mw==} + '@shikijs/engine-oniguruma@1.24.2': + resolution: {integrity: sha512-ZN6k//aDNWRJs1uKB12pturKHh7GejKugowOFGAuG7TxDRLod1Bd5JhpOikOiFqPmKjKEPtEA6mRCf7q3ulDyQ==} - '@shikijs/types@1.22.0': - resolution: {integrity: sha512-Fw/Nr7FGFhlQqHfxzZY8Cwtwk5E9nKDUgeLjZgt3UuhcM3yJR9xj3ZGNravZZok8XmEZMiYkSMTPlPkULB8nww==} + '@shikijs/types@1.24.2': + resolution: {integrity: sha512-bdeWZiDtajGLG9BudI0AHet0b6e7FbR0EsE4jpGaI0YwHm/XJunI9+3uZnzFtX65gsyJ6ngCIWUfA4NWRPnBkQ==} - '@shikijs/vscode-textmate@9.3.0': - resolution: {integrity: sha512-jn7/7ky30idSkd/O5yDBfAnVt+JJpepofP/POZ1iMOxK59cOfqIgg/Dj0eFsjOTMw+4ycJN0uhZH/Eb0bs/EUA==} + '@shikijs/vscode-textmate@9.3.1': + resolution: {integrity: sha512-79QfK1393x9Ho60QFyLti+QfdJzRQCVLFb97kOIV7Eo9vQU/roINgk7m24uv0a7AUvN//RDH36FLjjK48v0s9g==} '@sideway/address@4.1.5': resolution: {integrity: sha512-IqO/DUQHUkPeixNQ8n0JA6102hT9CmaljNTPmQ1u8MEhBo/R4Q8eKLN/vGZxuebwOroDB4cbpjheD4+/sKFK4Q==} @@ -2514,6 +2676,12 @@ packages: '@sqltools/formatter@1.2.5': resolution: {integrity: sha512-Uy0+khmZqUrUGm5dmMqVlnvufZRSK0FbYzVgp0UMstm+F5+W2/jnEEQyc9vo1ZR/E5ZI/B1WjjoTqBqwJL6Krw==} + '@swc/counter@0.1.3': + resolution: {integrity: sha512-e2BR4lsJkkRlKZ/qCHPw9ZaSxc0MVUd7gtbtaB7aMvHeJVYe8sOB8DBZkP2DtISHGSku9sCK6T6cnY0CtXrOCQ==} + + '@swc/helpers@0.5.13': + resolution: {integrity: sha512-UoKGxQ3r5kYI9dALKJapMmuK+1zWM/H17Z1+iwnNmzcJRnfFuevZs375TA5rW31pu4BS4NoSy1fRsexDXfWn5w==} + '@szmarczak/http-timer@1.1.2': resolution: {integrity: sha512-XIB2XbzHTN6ieIjfIMV9hlVcfPU26s2vafYWQcZHWXHOxiaRZYEDKEwdl129Zyg50+foYV2jCgtrqSA6qNuNSA==} engines: {node: '>=6'} @@ -2617,8 +2785,8 @@ packages: '@types/debug@4.1.12': resolution: {integrity: sha512-vIChWdVG3LG1SMxEvI/AK+FWJthlrqlTu7fbrlywTkkaONwk/UAGaULXRlf8vkzFBLVm0zkMdCquhL5aOjhXPQ==} - '@types/depd@1.1.36': - resolution: {integrity: sha512-+apvfj5Bn6ORfud9XrgoIu6H6s2pTN+X8rQ2LgkA3YUXY+PiXkCJjizh8qxv8CrLtXlxw3NCmYrNbbeckVOQrA==} + '@types/depd@1.1.37': + resolution: {integrity: sha512-PkEYFHnqDFgs+bJXJX0L8mq7sn3DWh+TP0m8BBJUJfZ2WcjRm7jd7Cq68jIJt+c31R1gX0cwSK1ZXOECvN97Rg==} '@types/empower-core@1.2.4': resolution: {integrity: sha512-FUik+m3zw2W2PIJfx/+lfGhxmNHQY74A0KNCLN0SA8Olc+pRn9JrgZxbBkPLV4YS4/IBPNt6/Kmuc0VwLVSy8w==} @@ -2626,6 +2794,15 @@ packages: '@types/empower@1.2.35': resolution: {integrity: sha512-CxKOTtOyeeEEvS8E+PrW3C2+pBtmr+1jm1hX0nEp4ZACAsoiQ+Dcn41zIOnhpZhZV9sz6/x2KZQcRym6KsAaJA==} + '@types/eslint-scope@3.7.7': + resolution: {integrity: sha512-MzMFlSLBqNF2gcHWO0G1vP/YQyfvrxZ0bF+u7mzUdZ1/xK4A4sru+nraZz5i3iEIk1l1uyicaDVTB4QbbEkAYg==} + + '@types/eslint@9.6.1': + resolution: {integrity: sha512-FXx2pKgId/WyYo2jXw63kk7/+TY7u7AziEJxJAnSFzHlqTAS3Ync6SvgYAN/k4/PQpnnVuzoMuVnByKK2qp0ag==} + + '@types/estree@1.0.6': + resolution: {integrity: sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==} + '@types/express-serve-static-core@4.19.6': resolution: {integrity: sha512-N4LZ2xG7DatVqhCZzOGb1Yi5lMbXSZcmdLDe9EzSndPV2HpWYWzRbaerl2n27irrm94EPpprqa8KpskPT085+A==} @@ -2647,8 +2824,8 @@ packages: '@types/hast@3.0.4': resolution: {integrity: sha512-WPs+bbQw5aCj+x6laNGWLH3wviHtoCv/P3+otBhbOhJgG8qtpdAMlTCxLtsTWA7LH1Oh/bFCHsBn0TPS5m30EQ==} - '@types/http-assert@1.5.5': - resolution: {integrity: sha512-4+tE/lwdAahgZT1g30Jkdm9PzFRde0xwxBNUyRsCitRvCQB90iuA2uJYdUnhnANRcqGXaWOGY4FEoxeElNAK2g==} + '@types/http-assert@1.5.6': + resolution: {integrity: sha512-TTEwmtjgVbYAzZYWyeHPrrtWnfVkm8tQkP8P21uQifPgMRgjrow3XDEYqucuC8SKZJT7pUnhU/JymvjggxO9vw==} '@types/http-errors@2.0.4': resolution: {integrity: sha512-D0CFMMtydbJAegzOyHjtiKPLlvnm3iTZyZRSZoLq2mRhDdmLfIWOCYPfQJ4cu2erKghU++QvjcUjp/5h7hESpA==} @@ -2716,9 +2893,6 @@ packages: '@types/ms@0.7.34': resolution: {integrity: sha512-nG96G3Wp6acyAgJqGasjODb+acrI7KltPiRxzHPXnP3NgI28bpQDRv53olbqGXbfcgF5aiiHmO3xpwEpS5Ld9g==} - '@types/node@18.19.55': - resolution: {integrity: sha512-zzw5Vw52205Zr/nmErSEkN5FLqXPuKX/k5d1D7RKHATGqU7y6YfX9QxZraUzUrFGqH6XzOzG196BC35ltJC4Cw==} - '@types/node@20.16.10': resolution: {integrity: sha512-vQUKgWTjEIRFCvK6CyriPH3MZYiYlNy0fKiEYHWbcoWLEgs4opurGGKlebrTLqdSMIbXImH6XExNiIyNUv3WpA==} @@ -2731,8 +2905,8 @@ packages: '@types/passport-strategy@0.2.38': resolution: {integrity: sha512-GC6eMqqojOooq993Tmnmp7AUTbbQSgilyvpCYQjT+H6JfG/g6RGc7nXEniZlp0zyKJ0WUdOiZWLBZft9Yug1uA==} - '@types/passport@1.0.16': - resolution: {integrity: sha512-FD0qD5hbPWQzaM0wHUnJ/T0BBCJBxCeemtnCwc/ThhTg3x9jfrAcRUmj5Dopza+MfFS9acTe3wk7rcVnRIp/0A==} + '@types/passport@1.0.17': + resolution: {integrity: sha512-aciLyx+wDwT2t2/kJGJR2AEeBz0nJU4WuRX04Wu9Dqc5lSUtwu0WERPHYsLhF9PtseiAMPBGNUOtFjxZ56prsg==} '@types/power-assert-formatter@1.4.33': resolution: {integrity: sha512-0SiJHRbxCLyC4jnCrK1NZhtu15Ay1kmf32Dm14UC2NKF5U/XlpgMV1h9XLtxZtr9x5a1+ex+ofmjBvfGcQQJ1g==} @@ -2740,8 +2914,8 @@ packages: '@types/power-assert@1.5.12': resolution: {integrity: sha512-dNBQIKnfnCDanT4aP2ZhY33ePEO7dGFZo+u+RPDqwvkoFwnH5GkVjo8Vb8SQ0VKlhylkEE0IgFbTirWEiHKHCw==} - '@types/ps-tree@1.1.6': - resolution: {integrity: sha512-PtrlVaOaI44/3pl3cvnlK+GxOM3re2526TJvPvh7W+keHIXdV4TE0ylpPBAcvFQCbGitaTXwL9u+RF7qtVeazQ==} + '@types/prop-types@15.7.14': + resolution: {integrity: sha512-gNMvNH49DJ7OJYv+KAKn0Xp45p8PLl6zo2YnvDIbTd4J6MER2BmWN49TG7n9LvkyihINxeKW8+3bfS2yDC9dzQ==} '@types/qs@6.9.15': resolution: {integrity: sha512-uXHQKES6DQKKCLh441Xv/dwxOq1TVS3JPUMlEqoEglvlhR6Mxnlew/Xq/LRVHpLyk7iK3zODe1qYHIMltO7XGg==} @@ -2749,8 +2923,11 @@ packages: '@types/range-parser@1.2.7': resolution: {integrity: sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ==} - '@types/readable-stream@4.0.15': - resolution: {integrity: sha512-oAZ3kw+kJFkEqyh7xORZOku1YAKvsFTogRY8kVl4vHpEKiDkfnSA/My8haRE7fvmix5Zyy+1pwzOi7yycGLBJw==} + '@types/react@18.3.16': + resolution: {integrity: sha512-oh8AMIC4Y2ciKufU8hnKgs+ufgbA/dhPTACaZPM86AbwX9QwnFtSoPWEeRUj8fge+v6kFt78BXcDhAU1SrrAsw==} + + '@types/readable-stream@4.0.18': + resolution: {integrity: sha512-21jK/1j+Wg+7jVw1xnSwy/2Q1VgVjWuFssbYGTREPUBeZ+rqVFl2udq0IkxzPC0ZhOzVceUbyIACFZKLqKEBlA==} '@types/request@2.48.12': resolution: {integrity: sha512-G3sY+NpsA9jnwm0ixhAFQSJ3Q9JkpLZpJbI3GMv0mIAT0y3mRabYeINzal5WOChIiaTEGQYlHOKgkaM9EisWHw==} @@ -2800,9 +2977,6 @@ packages: '@types/whatwg-url@11.0.5': resolution: {integrity: sha512-coYR071JRaHa+xoEvvYqvnIHaVqaYrLPbsufM9BF63HkwI5Lgmy2QR8Q5K/lYDYo5AK82wOvSOS0UsLTpTG7uQ==} - '@types/which@3.0.4': - resolution: {integrity: sha512-liyfuo/106JdlgSchJzXEQCVArk0CvevqPote8F8HgWgJ3dRCcTHgJIsLDuee0kxk/mhbInzIZk3QWSZJ8R+2w==} - '@types/ws@8.5.12': resolution: {integrity: sha512-3tPRkv1EtkDpzlgyKyI8pGsGZAGPEaXeu0DOj5DI25Ja91bdAYddYHbADRYVrZMRbfW+1l5YwXVDKohDJNQxkQ==} @@ -2887,13 +3061,64 @@ packages: resolution: {integrity: sha512-07ny+LHRzQXepkGg6w0mFY41fVUNBrL2Roj/++7V1txKugfjm/Ci/qSND03r2RhlJhJYMcTn9AhhSSqQp0Ysyw==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - '@ungap/structured-clone@1.2.0': - resolution: {integrity: sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==} + '@ungap/structured-clone@1.2.1': + resolution: {integrity: sha512-fEzPV3hSkSMltkw152tJKNARhOupqbH96MZWyRjNaYZOMIzbrTeQDG+MTc6Mr2pgzFQzFxAfmhGDNP5QK++2ZA==} '@vercel/ncc@0.38.2': resolution: {integrity: sha512-3yel3jaxUg9pHBv4+KeC9qlbdZPug+UMtUOlhvpDYCMSgcNSrS2Hv1LoqMsOV7hf2lYscx+BESfJOIla1WsmMQ==} hasBin: true + '@webassemblyjs/ast@1.14.1': + resolution: {integrity: sha512-nuBEDgQfm1ccRp/8bCQrx1frohyufl4JlbMMZ4P1wpeOfDhF6FQkxZJ1b/e+PLwr6X1Nhw6OLme5usuBWYBvuQ==} + + '@webassemblyjs/floating-point-hex-parser@1.13.2': + resolution: {integrity: sha512-6oXyTOzbKxGH4steLbLNOu71Oj+C8Lg34n6CqRvqfS2O71BxY6ByfMDRhBytzknj9yGUPVJ1qIKhRlAwO1AovA==} + + '@webassemblyjs/helper-api-error@1.13.2': + resolution: {integrity: sha512-U56GMYxy4ZQCbDZd6JuvvNV/WFildOjsaWD3Tzzvmw/mas3cXzRJPMjP83JqEsgSbyrmaGjBfDtV7KDXV9UzFQ==} + + '@webassemblyjs/helper-buffer@1.14.1': + resolution: {integrity: sha512-jyH7wtcHiKssDtFPRB+iQdxlDf96m0E39yb0k5uJVhFGleZFoNw1c4aeIcVUPPbXUVJ94wwnMOAqUHyzoEPVMA==} + + '@webassemblyjs/helper-numbers@1.13.2': + resolution: {integrity: sha512-FE8aCmS5Q6eQYcV3gI35O4J789wlQA+7JrqTTpJqn5emA4U2hvwJmvFRC0HODS+3Ye6WioDklgd6scJ3+PLnEA==} + + '@webassemblyjs/helper-wasm-bytecode@1.13.2': + resolution: {integrity: sha512-3QbLKy93F0EAIXLh0ogEVR6rOubA9AoZ+WRYhNbFyuB70j3dRdwH9g+qXhLAO0kiYGlg3TxDV+I4rQTr/YNXkA==} + + '@webassemblyjs/helper-wasm-section@1.14.1': + resolution: {integrity: sha512-ds5mXEqTJ6oxRoqjhWDU83OgzAYjwsCV8Lo/N+oRsNDmx/ZDpqalmrtgOMkHwxsG0iI//3BwWAErYRHtgn0dZw==} + + '@webassemblyjs/ieee754@1.13.2': + resolution: {integrity: sha512-4LtOzh58S/5lX4ITKxnAK2USuNEvpdVV9AlgGQb8rJDHaLeHciwG4zlGr0j/SNWlr7x3vO1lDEsuePvtcDNCkw==} + + '@webassemblyjs/leb128@1.13.2': + resolution: {integrity: sha512-Lde1oNoIdzVzdkNEAWZ1dZ5orIbff80YPdHx20mrHwHrVNNTjNr8E3xz9BdpcGqRQbAEa+fkrCb+fRFTl/6sQw==} + + '@webassemblyjs/utf8@1.13.2': + resolution: {integrity: sha512-3NQWGjKTASY1xV5m7Hr0iPeXD9+RDobLll3T9d2AO+g3my8xy5peVyjSag4I50mR1bBSN/Ct12lo+R9tJk0NZQ==} + + '@webassemblyjs/wasm-edit@1.14.1': + resolution: {integrity: sha512-RNJUIQH/J8iA/1NzlE4N7KtyZNHi3w7at7hDjvRNm5rcUXa00z1vRz3glZoULfJ5mpvYhLybmVcwcjGrC1pRrQ==} + + '@webassemblyjs/wasm-gen@1.14.1': + resolution: {integrity: sha512-AmomSIjP8ZbfGQhumkNvgC33AY7qtMCXnN6bL2u2Js4gVCg8fp735aEiMSBbDR7UQIj90n4wKAFUSEd0QN2Ukg==} + + '@webassemblyjs/wasm-opt@1.14.1': + resolution: {integrity: sha512-PTcKLUNvBqnY2U6E5bdOQcSM+oVP/PmrDY9NzowJjislEjwP/C4an2303MCVS2Mg9d3AJpIGdUFIQQWbPds0Sw==} + + '@webassemblyjs/wasm-parser@1.14.1': + resolution: {integrity: sha512-JLBl+KZ0R5qB7mCnud/yyX08jWFw5MsoalJ1pQ4EdFlgj9VdXKGuENGsiCIjegI1W7p91rUlcB/LB5yRJKNTcQ==} + + '@webassemblyjs/wast-printer@1.14.1': + resolution: {integrity: sha512-kPSSXE6De1XOR820C90RIo2ogvZG+c3KiHzqUoO/F34Y2shGzesfqv7o57xrxovZJH/MetF5UjroJ/R/3isoiw==} + + '@xtuc/ieee754@1.2.0': + resolution: {integrity: sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA==} + + '@xtuc/long@4.2.2': + resolution: {integrity: sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==} + '@yarnpkg/lockfile@1.1.0': resolution: {integrity: sha512-GpSwvyXOcOOlV70vbnzjj4fW5xW/FdUF6nQEt1ENy7m4ZCczi1+/buVUPAqmGfqznsORNFzUMjctTIp8a9tuCQ==} @@ -2954,8 +3179,8 @@ packages: engines: {node: '>=0.4.0'} hasBin: true - acorn@8.12.1: - resolution: {integrity: sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg==} + acorn@8.14.0: + resolution: {integrity: sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==} engines: {node: '>=0.4.0'} hasBin: true @@ -2973,8 +3198,8 @@ packages: resolution: {integrity: sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==} engines: {node: '>= 6.0.0'} - agent-base@7.1.1: - resolution: {integrity: sha512-H0TSyFNDMomMNJQBn8wFV5YC/2eJ+VXECwOadZJT554xP6cODZHPX3H9QMQECxvrgiSOP1pHjy1sMWQVYJOUOA==} + agent-base@7.1.3: + resolution: {integrity: sha512-jRR5wdylq8CkOe6hei19GGZnxM6rBGwFl3Bg0YItGDimvjGtAvdZk4Pu6Cl4u4Igsws4a1fd1Vq3ezrhn4KmFw==} engines: {node: '>= 14'} agentkeepalive@3.5.3: @@ -2997,6 +3222,24 @@ packages: ajv: optional: true + ajv-formats@2.1.1: + resolution: {integrity: sha512-Wx0Kx52hxE7C18hkMEggYlEifqWZtYaRgouJor+WMdPnQyEK13vgEWyVNup7SoeeoLMsr4kf5h6dOW11I15MUA==} + peerDependencies: + ajv: ^8.0.0 + peerDependenciesMeta: + ajv: + optional: true + + ajv-keywords@3.5.2: + resolution: {integrity: sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==} + peerDependencies: + ajv: ^6.9.1 + + ajv-keywords@5.1.0: + resolution: {integrity: sha512-YCS/JNFAUyr5vAuhk1DWm1CBxRHW9LbJ2ozWeemrIqpbsqKjHVxYPyi5GC0rjZIT5JxJ3virVTS8wk4i/Z+krw==} + peerDependencies: + ajv: ^8.8.2 + ajv@6.12.6: resolution: {integrity: sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==} @@ -3235,6 +3478,13 @@ packages: peerDependencies: '@babel/core': ^7.8.0 + babel-loader@9.2.1: + resolution: {integrity: sha512-fqe8naHt46e0yIdkjUZYqddSXfej3AHajX+CSO5X7oy0EmPc6o5Xh+RClNoHjnieWz9AW4kZxW9yyFMhVB1QLA==} + engines: {node: '>= 14.15.0'} + peerDependencies: + '@babel/core': ^7.12.0 + webpack: '>=5' + babel-plugin-istanbul@6.1.1: resolution: {integrity: sha512-Y1IQok9821cC9onCx5otgFfRm7Lm+I+wwxOx738M/WLPZ9Q42m4IG5W0FNX8WLL2gYMZo3JkuXIH2DOpWM+qwA==} engines: {node: '>=8'} @@ -3281,6 +3531,9 @@ packages: before-after-hook@2.2.3: resolution: {integrity: sha512-NzUnlZexiaH/46WDhANlyR2bXRopNg4F/zuSA3OpZnllCUgRaOF2znDioDWrmbNVsuZk6l9pMquQB38cfBZwkQ==} + big.js@5.2.2: + resolution: {integrity: sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ==} + bignumber.js@9.1.2: resolution: {integrity: sha512-2/mKyZH9K85bzOEfhXDBFZTGd1CTs+5IHpeFQo9luiBG7hghdC851Pj2WAhb6E3R6b9tZj/XKhbg4fum+Kepug==} @@ -3327,8 +3580,8 @@ packages: resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==} engines: {node: '>=8'} - browserslist@4.24.0: - resolution: {integrity: sha512-Rmb62sR1Zpjql25eSanFGEhAxcFwfA1K0GuQcLoaJBAcENegrQut3hYdhXFF1obQfiDyqIW/cLM5HSJ/9k884A==} + browserslist@4.24.3: + resolution: {integrity: sha512-1CPmv8iobE2fyRMV97dAcMVegvvWKxmq94hkLiAkUGwKVTyDLw33K+ZxiFrREKmmps4rIw6grcCFCnTMSZ/YiA==} engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} hasBin: true @@ -3339,8 +3592,8 @@ packages: bser@2.1.1: resolution: {integrity: sha512-gQxTNE/GAfIIrmHLUE3oJyp5FO6HRBfhjnw4/wMmA63ZGDJnWBmgY/lyQBpnDUkGmAhbSe39tx2d/iTOAfglwQ==} - bson@6.8.0: - resolution: {integrity: sha512-iOJg8pr7wq2tg/zSlCCHMi3hMm5JTOxLTagf3zxhcenHsFp+c6uOs6K7W5UE7A4QIJGtqh/ZovFNMP4mOPJynQ==} + bson@6.10.1: + resolution: {integrity: sha512-P92xmHDQjSKPLHqFxefqMxASNq/aWJMEZugpCjf+AF/pgcUpMMQCg7t7+ewko0/u8AapvF3luf/FoehddEK+sA==} engines: {node: '>=16.20.1'} buffer-equal-constant-time@1.0.1: @@ -3375,6 +3628,10 @@ packages: resolution: {integrity: sha512-BZbPzNiKXczfZPXBTVhcN73b+CQFHTzVb7yJi1bSYld4/8bDc9oh/j/dYTsQBgOAZIZahFeHO6dPHbVEXXCvCg==} engines: {node: '>=12'} + bull@4.16.4: + resolution: {integrity: sha512-CF+nGsJyfsCC9MJL8hFxqXzbwq+jGBXhaz1j15G+5N/XtKIPFUUy5O1mfWWKbKunfuH/x+UV4NYRQDHSkjCOgA==} + engines: {node: '>=12'} + busboy@0.2.14: resolution: {integrity: sha512-InWFDomvlkEj+xWLBfU3AvnbVYqeTWmQopiW0tWWEy5yehYm2YkGEc59sUmw/4ty5Zj/b0WHGs1LgecuBSBGrg==} engines: {node: '>=0.8.0'} @@ -3430,8 +3687,16 @@ packages: resolution: {integrity: sha512-Oj3cAGPCqOZX7Rz64Uny2GYAZNliQSqfbePrgAQ1wKAihYmCUnraBtJtKcGR4xz7wF+LoJC+ssFZvv5BgF9Igg==} engines: {node: '>=8'} - call-bind@1.0.7: - resolution: {integrity: sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==} + call-bind-apply-helpers@1.0.1: + resolution: {integrity: sha512-BhYE+WDaywFg2TBWYNXAE+8B1ATnThNBqXHP5nQu0jWJdVvY2hvkpyB3qOmtmDePiS5/BDQ8wASEWGMWRG148g==} + engines: {node: '>= 0.4'} + + call-bind@1.0.8: + resolution: {integrity: sha512-oKlSFMcMwpUg2ednkhQ454wfWiU/ul3CkJe/PEHcTKuiX6RpbehUiFMXu13HalGZxfUwCQzZG747YXBn1im9ww==} + engines: {node: '>= 0.4'} + + call-bound@1.0.2: + resolution: {integrity: sha512-0lk0PHFe/uz0vl527fG9CgdE9WdafjDbCXvBbs+LUv000TVt2Jjhqbs4Jwm8gz070w8xXyEAxrPOMullsxXeGg==} engines: {node: '>= 0.4'} call-me-maybe@1.0.2: @@ -3460,8 +3725,8 @@ packages: resolution: {integrity: sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==} engines: {node: '>=10'} - caniuse-lite@1.0.30001667: - resolution: {integrity: sha512-7LTwJjcRkzKFmtqGsibMeuXmvFDfZq/nzIjnmgCGzKKRVzjD72selLDK1oPF/Oxzmt4fNcPvTDvGqSDG4tCALw==} + caniuse-lite@1.0.30001688: + resolution: {integrity: sha512-Nmqpru91cuABu/DTCXbM2NSRHzM2uVHfPnhJ/1zEAJx/ILBRVmz3pzH4N7DZqbdG0gWClsCC05Oj0mJ/1AWMbA==} capital-case@1.0.4: resolution: {integrity: sha512-ds37W8CytHgwnhGGTi88pcPyR15qoNkOpYwmMMfnWqqWgESapLqvDx6huFjQ5vqWSn2Z06173XNA7LtMOeUh1A==} @@ -3491,10 +3756,6 @@ packages: resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==} engines: {node: '>=10'} - chalk@5.3.0: - resolution: {integrity: sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==} - engines: {node: ^12.17.0 || ^14.13 || >=16.0.0} - chan@0.6.1: resolution: {integrity: sha512-/TdBP2UhbBmw7qnqkzo9Mk4rzvwRv4dlNPXFerqWy90T8oBspKagJNZxrDbExKHhx9uXXHjo3f9mHgs9iKO3nQ==} @@ -3524,6 +3785,10 @@ packages: resolution: {integrity: sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==} engines: {node: '>=10'} + chrome-trace-event@1.0.4: + resolution: {integrity: sha512-rNjApaLzuwaOTjCiT8lSDdGN1APCiqkChLMJxJPWLunPAt5fy8xgU9/jNOchV84wfIxrA0lRQB7oCT8jrn/wrQ==} + engines: {node: '>=6.0'} + ci-info@2.0.0: resolution: {integrity: sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==} @@ -3537,9 +3802,6 @@ packages: cjs-module-lexer@1.4.1: resolution: {integrity: sha512-cuSVIHi9/9E/+821Qjdvngor+xpnlwnuwIyZOaLmHBVdXL+gP+I6QQB9VkO7RI77YIcTV+S1W9AreJ5eN63JBA==} - class-transformer@0.5.1: - resolution: {integrity: sha512-SQa1Ws6hUbfC98vKGxZH3KFY0Y1lm5Zm0SY8XX9zbK7FJCyVEac3ATW0RIpwzW+oOfmHE5PMPufDG9hCfoEOMw==} - class-utils@0.3.6: resolution: {integrity: sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==} engines: {node: '>=0.10.0'} @@ -3577,6 +3839,9 @@ packages: resolution: {integrity: sha512-FxqpkPPwu1HjuN93Omfm4h8uIanXofW0RxVEW3k5RKx+mJJYSthzNhp32Kzxxy3YAEZ/Dc/EWN1vZRY0+kOhbw==} engines: {node: '>= 10'} + client-only@0.0.1: + resolution: {integrity: sha512-IV3Ou0jSMzZrd3pZ48nLkT9DA7Ag1pnPzaiQhpW7c3RbcqqzvzzVu+L8gfqMp/8IM2MQtSiqaCxrrcfu8I8rMA==} + cliui@5.0.0: resolution: {integrity: sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==} @@ -3653,10 +3918,17 @@ packages: color-name@1.1.4: resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} + color-string@1.9.1: + resolution: {integrity: sha512-shrVawQFojnZv6xM40anx4CkoDP+fZsw/ZerEMsW/pyzsRbElpsL/DBVW7q3ExxwusdNXI3lXpuhEZkzs8p5Eg==} + color-support@1.1.3: resolution: {integrity: sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==} hasBin: true + color@4.2.3: + resolution: {integrity: sha512-1rXeuUUiGGrykh+CeBdu5Ie7OJwinCgQY0bc7GCRxy5xVHy+moaqkpL/jqQq0MtQOeYcrqEz4abc5f0KtU7W4A==} + engines: {node: '>=12.5.0'} + colorette@2.0.19: resolution: {integrity: sha512-3tlv/dIP7FWvj3BsbHrGLJ6l/oKh1O3TcgBqMn+yyCagOxc23fyzDS6HypQbgxWbkpDnf52p1LuR4eWDQ/K9WQ==} @@ -3697,6 +3969,9 @@ packages: resolution: {integrity: sha512-AFGH8ZI3e82QiVZkLDCPCFOnBsdvs/FhY+ueDOFuSr+EqMGzPnneB6DkQSWqy7PC6kbkasfX2VQR5RKRR205lw==} engines: {node: '>= 14.0.0'} + common-path-prefix@3.0.0: + resolution: {integrity: sha512-QE33hToZseCH3jS0qN96O/bSh3kaw/h+Tq7ngyY9eWDUnTlTNUyqfqvCXioLe5Na5jFsL78ra/wuBU4iuEgd4w==} + commondir@1.0.1: resolution: {integrity: sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==} @@ -3785,8 +4060,8 @@ packages: convert-source-map@2.0.0: resolution: {integrity: sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==} - cookie-parser@1.4.6: - resolution: {integrity: sha512-z3IzaNjdwUC2olLIB5/ITd0/setiaFMLYiZJle7xg5Fe9KWAceil7xszYfHHBtDFYLSgJduS2Ty0P1uJdPDJeA==} + cookie-parser@1.4.7: + resolution: {integrity: sha512-nGUvgXnotP3BsjiLX2ypbQnWoGUPIIfHQNZkkC668ntrzGWEZVW70HDEB1qnNGMicPje6EttlIgzo51YSwNQGw==} engines: {node: '>= 0.8.0'} cookie-session@2.1.0: @@ -3799,14 +4074,6 @@ packages: cookie-signature@1.0.7: resolution: {integrity: sha512-NXdYc3dLr47pBkpUCHtKSwIOQXLVn8dZEuywboCOJY/osA0wFSLlSawr3KN8qXJEyX66FcONTH8EIlVuK0yyFA==} - cookie@0.3.1: - resolution: {integrity: sha512-+IJOX0OqlHCszo2mBUq+SrEbCj6w7Kpffqx60zYbPTFaO4+yYgRjHwcZNpWvaTylDHaV7PPmBHzSecZiMhtPgw==} - engines: {node: '>= 0.6'} - - cookie@0.4.1: - resolution: {integrity: sha512-ZwrFkGJxUR3EIoXtO+yVE69Eb7KlixbaeAWfBQB9vVsNn/o+Yw69gBWSSDK825hQNdN+wF8zELf3dFNl/kxkUA==} - engines: {node: '>= 0.6'} - cookie@0.4.2: resolution: {integrity: sha512-aSWTXFzaKWkvHO1Ny/s+ePFpvKsPnjc551iI41v3ny/ow6tBG5Vd+FuqGNhh1LxOmVzOlGUriIlOaokOvhaStA==} engines: {node: '>= 0.6'} @@ -3815,6 +4082,10 @@ packages: resolution: {integrity: sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw==} engines: {node: '>= 0.6'} + cookie@0.7.2: + resolution: {integrity: sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==} + engines: {node: '>= 0.6'} + cookiejar@2.1.4: resolution: {integrity: sha512-LDx6oHrK+PhzLKJU9j5S7/Y3jM/mUHvD/DeI1WQmJn652iPC5Y4TBzC9l+5OMOXlyTTA+SmVUPm0HQUwpD5Jqw==} @@ -3881,12 +4152,12 @@ packages: cross-argv@2.0.0: resolution: {integrity: sha512-YIaY9TR5Nxeb8SMdtrU8asWVM4jqJDNDYlKV21LxtYcfNJhp1kEsgSa6qXwXgzN0WQWGODps0+TlGp2xQSHwOg==} - cross-spawn@6.0.5: - resolution: {integrity: sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==} + cross-spawn@6.0.6: + resolution: {integrity: sha512-VqCUuhcd1iB+dsv8gxPttb5iZh/D0iubSP21g36KXdEuf6I5JiioesUVjpCdHV9MZRUfVFlvwtIUyPfxo5trtw==} engines: {node: '>=4.8'} - cross-spawn@7.0.3: - resolution: {integrity: sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==} + cross-spawn@7.0.6: + resolution: {integrity: sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==} engines: {node: '>= 8'} crypto-random-string@2.0.0: @@ -3900,8 +4171,11 @@ packages: cssfilter@0.0.10: resolution: {integrity: sha512-FAaLDaplstoRsDR8XGYH51znUN0UY7nMc6Z9/fvE8EXGwvJE9hu7W2vHwx1+bd6gCYnln9nLbzxFTrcO9YQDZw==} - csv-parse@5.5.6: - resolution: {integrity: sha512-uNpm30m/AGSkLxxy7d9yRXpJQFrZzVWLFBkS+6ngPcZkw/5k3L/jjFuj7tVnEpRn+QgmiXr21nDlhCiUK4ij2A==} + csstype@3.1.3: + resolution: {integrity: sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==} + + csv-parse@5.6.0: + resolution: {integrity: sha512-l3nz3euub2QMg5ouu5U09Ew9Wf6/wQ8I++ch1loQ0ljmzhmfZYrH9fflS22i/PQEvsPvxCwxgz5q7UB8K1JO4Q==} dargs@7.0.0: resolution: {integrity: sha512-2iy1EkLdlBzQGvbweYRFxmFath8+K7+AKB0TlhHWkNuH+TmovaMH/Wp7V7R4u7f4SnX3OgLsU9t1NI9ioDnUpg==} @@ -3911,10 +4185,6 @@ packages: resolution: {integrity: sha512-jRFi8UDGo6j+odZiEpjazZaWqEal3w/basFjQHQEwVtZJGDpxbH1MeYluwCS8Xq5wmLJooDlMgvVarmWfGM44g==} engines: {node: '>=0.10'} - data-uri-to-buffer@4.0.1: - resolution: {integrity: sha512-0R9ikRb668HB7QDxT1vkpuUBtqc53YyAwMwGeUFKRojY/NWKvdZ+9UYtRfGmhqNbRkTSVpMbmyhXipFFv2cb/A==} - engines: {node: '>= 12'} - data-view-buffer@1.0.1: resolution: {integrity: sha512-0lht7OugA5x3iJLOWFhWK/5ehONdprk0ISXqVFn/NFrDu+cuc8iADFrGQz5BnRK7LLU3JmkbXSxaqX+/mXYtUA==} engines: {node: '>= 0.4'} @@ -3997,6 +4267,15 @@ packages: supports-color: optional: true + debug@4.4.0: + resolution: {integrity: sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==} + engines: {node: '>=6.0'} + peerDependencies: + supports-color: '*' + peerDependenciesMeta: + supports-color: + optional: true + decamelize-keys@1.1.1: resolution: {integrity: sha512-WiPxgEirIV0/eIOMcnFBA3/IJZAZqKnwAwWyvvdi4lsr1WCN22nhdf/3db3DoZcUjTV2SqfzIwNyp6y2xs3nmg==} engines: {node: '>=0.10.0'} @@ -4276,6 +4555,10 @@ packages: dottie@2.0.6: resolution: {integrity: sha512-iGCHkfUc5kFekGiqhe8B/mdaurD+lakO9txNnTvKtA6PISrw86LgqHvRzWYPyoE2Ph5aMIrCw9/uko6XHTKCwA==} + dunder-proto@1.0.0: + resolution: {integrity: sha512-9+Sj30DIu+4KvHqMfLUGLFYL2PkURSYMVXJyXe92nFRvlYq5hBjLEhblKB+vkd/WVlUYMWigiY07T91Fkk0+4A==} + engines: {node: '>= 0.4'} + duplexer3@0.1.5: resolution: {integrity: sha512-1A8za6ws41LQgv9HrE/66jyC5yuSjQ3L/KOpFtoBilsAK2iA2wuS5rTt1OCzIvtS2V7nVmedsUU+DGRcjBmOYA==} @@ -4345,8 +4628,8 @@ packages: resolution: {integrity: sha512-WZKJN3/6O0PKnSHvz22TSk7t8vWvEcexdhpb/zoKsKSoDAZgd0ffk3dy+dZR4+woePEth/gibHY8QZgp1CUFlA==} engines: {node: '>= 8.0.0'} - egg-onerror@2.2.0: - resolution: {integrity: sha512-wYAU2hBASXWaFD2A2WiUbffpEaLUiWeYkHN0u3Fvbi2uYeMSmQoqaIUsBbKb6paopiwRFFQzm8M0T3GVLwU1jw==} + egg-onerror@2.4.0: + resolution: {integrity: sha512-btmUsP1m6H9awd1IaAlvlzqN+uIbUKzaxJ8ArZI71r5FQ9LShZGv2pOT5fhL9mSnGkrvHUsjb9I5KoX2AY63bA==} engines: {node: '>=8.0.0'} egg-path-matching@1.1.0: @@ -4404,13 +4687,16 @@ packages: engines: {node: '>=0.10.0'} hasBin: true - electron-to-chromium@1.5.33: - resolution: {integrity: sha512-+cYTcFB1QqD4j4LegwLfpCNxifb6dDFUAwk6RsLusCwIaZI6or2f+q8rs5tTB2YC53HhOlIbEaqHMAAC8IOIwA==} + electron-to-chromium@1.5.73: + resolution: {integrity: sha512-8wGNxG9tAG5KhGd3eeA0o6ixhiNdgr0DcHWm85XPCphwZgD1lIEoi6t3VERayWao7SF7AAZTw6oARGJeVjH8Kg==} emittery@0.13.1: resolution: {integrity: sha512-DeWwawk6r5yR9jFgnDKYt4sLS0LmHJJi3ZOnb5/JdbYwj3nW+FxQnHIjhBKz8YLC7oRNPVM9NQ47I3CVx34eqQ==} engines: {node: '>=12'} + emoji-regex-xs@1.0.0: + resolution: {integrity: sha512-LRlerrMYoIDrT6jgpeZ2YYl/L8EulRTt5hQcYjy5AInh7HWXKimpqx68aknBFpGL2+/IcogTcaydJEgaTmOpDg==} + emoji-regex@7.0.3: resolution: {integrity: sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==} @@ -4420,6 +4706,10 @@ packages: emoji-regex@9.2.2: resolution: {integrity: sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==} + emojis-list@3.0.0: + resolution: {integrity: sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q==} + engines: {node: '>= 4'} + empower-core@1.2.0: resolution: {integrity: sha512-g6+K6Geyc1o6FdXs9HwrXleCFan7d66G5xSCfSF7x1mJDCes6t0om9lFQG3zOrzh3Bkb/45N0cZ5Gqsf7YrzGQ==} @@ -4496,12 +4786,12 @@ packages: error-ex@1.3.2: resolution: {integrity: sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==} - es-abstract@1.23.3: - resolution: {integrity: sha512-e+HfNH61Bj1X9/jLc5v1owaLYuHdeHHSQlkhCBiTK8rBvKaULl/beGMxwrMXjpYrv4pz22BlY570vVePA2ho4A==} + es-abstract@1.23.5: + resolution: {integrity: sha512-vlmniQ0WNPwXqA0BnmwV3Ng7HxiGlh6r5U6JcTMNx8OilcAGqVJBHJcPjqOMaczU9fRuRK5Px2BdVyPRnKMMVQ==} engines: {node: '>= 0.4'} - es-define-property@1.0.0: - resolution: {integrity: sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==} + es-define-property@1.0.1: + resolution: {integrity: sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==} engines: {node: '>= 0.4'} es-errors@1.3.0: @@ -4511,6 +4801,9 @@ packages: es-get-iterator@1.1.3: resolution: {integrity: sha512-sPZmqHBe6JIiTfN5q2pEi//TwxmAFHwj/XEuYjTuse78i8KxaqMTTzxPoFKuzRpDpTJ+0NAbpfenkmH2rePtuw==} + es-module-lexer@1.5.4: + resolution: {integrity: sha512-MVNK56NiMrOwitFB7cqDwq0CQutbw+0BvLshJSse0MUNU+y1FC3bUS/AQg7oUng+/wKrrki7JfmwtVHkVfPLlw==} + es-object-atoms@1.0.0: resolution: {integrity: sha512-MZ4iQ6JwHOBQjahnjwaC1ZtIBH+2ohjamzAO3oaHcXYup7qxjF2fixyH+Q71voWHeOkI2q/TnJao/KfXYIZWbw==} engines: {node: '>= 0.4'} @@ -4519,8 +4812,8 @@ packages: resolution: {integrity: sha512-3T8uNMC3OQTHkFUsFq8r/BwAXLHvU/9O9mE0fBc/MY5iq/8H7ncvO947LmYA6ldWw9Uh8Yhf25zu6n7nML5QWQ==} engines: {node: '>= 0.4'} - es-to-primitive@1.2.1: - resolution: {integrity: sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==} + es-to-primitive@1.3.0: + resolution: {integrity: sha512-w+5mJ3GuFL+NjVtJlvydShqE1eN3h3PbI7/5LAsYJP/2qtuMXjfL2LpHSRqo4b4eSF5K/DH1JXKUAHSB2UW50g==} engines: {node: '>= 0.4'} escalade@3.2.0: @@ -4763,8 +5056,8 @@ packages: resolution: {integrity: sha512-7OnTFAVPefgw2eBJ1xj2PGGR9FwYzSUso9decayHgCDX4sJkHLdcsYTytTg+tYv+wKF3U8gJuSBz2jJpQV4u/g==} engines: {node: '>=16.1.0'} - fast-uri@3.0.2: - resolution: {integrity: sha512-GR6f0hD7XXyNJa25Tb9BuIdN0tdr+0BMi6/CJPH3wJO1JjNG3n/VsSw38AwRdKZABm8lGbPfakLRkYzx2V9row==} + fast-uri@3.0.3: + resolution: {integrity: sha512-aLrHthzCjH5He4Z2H9YZ+v6Ujb9ocRuW6ZzkJQOrTxleEijANq4v1TsaPaVG1PZcuurEzrLcWRyYBYXD5cEiaw==} fast-xml-parser@4.2.5: resolution: {integrity: sha512-B9/wizE4WngqQftFPmdaMYlXoJlJOYxGQOanC77fq9k8+Z0v5dDSVh+3glErdIROP//s/jgb7ZuxKfB8nVyo0g==} @@ -4776,10 +5069,6 @@ packages: fb-watchman@2.0.2: resolution: {integrity: sha512-p5161BqbuCaSnB8jIbzQHOlpgsPmK5rJVDfDKO91Axs5NC1uu3HRQm6wt9cd9/+GtQQIO53JdGXXoyDpTAsgYA==} - fetch-blob@3.2.0: - resolution: {integrity: sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ==} - engines: {node: ^12.20 || >= 14.13} - figures@3.2.0: resolution: {integrity: sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==} engines: {node: '>=8'} @@ -4815,6 +5104,10 @@ packages: resolution: {integrity: sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg==} engines: {node: '>= 0.8'} + find-cache-dir@4.0.0: + resolution: {integrity: sha512-9ZonPT4ZAK4a+1pUPVPZJapbi7O5qbbJPdYw/NOQWZZbVLdDTYM3A4R9z/DpAM08IDaFGsvPgiGZ82WEwUDWjg==} + engines: {node: '>=14.16'} + find-up@2.1.0: resolution: {integrity: sha512-NWzkk0jSJtTt08+FBFMvXoeZnOJD+jTtsRmBYbAIzJdX6l7dLgR7CTubCM5/eDdPUBvLCeVasP1brfVR/9/EZQ==} engines: {node: '>=4'} @@ -4831,6 +5124,10 @@ packages: resolution: {integrity: sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==} engines: {node: '>=10'} + find-up@6.3.0: + resolution: {integrity: sha512-v2ZsoEuVHYy8ZIlYqwPe/39Cy+cFDzp4dXPaxNvkEuouymu+2Jbz0PxpKarJHYJTmv2HWT3O382qY8l4jMWthw==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + flat-cache@3.2.0: resolution: {integrity: sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==} engines: {node: ^10.12.0 || >=12.0.0} @@ -4842,8 +5139,8 @@ packages: flatbuffers@1.12.0: resolution: {integrity: sha512-c7CZADjRcl6j0PlvFy0ZqXQ67qSEZfrVPynmnL+2zPc+NtMvrF8Y0QceMo7QqnSPc7+uWjUIAbvCQ5WIKlMVdQ==} - flatted@3.3.1: - resolution: {integrity: sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==} + flatted@3.3.2: + resolution: {integrity: sha512-AiwGJM8YcNOaobumgtng+6NHuOqC3A7MixFeDafM3X9cIUM+xUXoS5Vfgf+OihAYe20fxqNM9yPBXJzRtZ/4eA==} flatten@1.0.3: resolution: {integrity: sha512-dVsPA/UwQ8+2uoFe5GHtiBMu48dWLTdsuEd7CKGlZlD78r1TTWBvDuFaFGKCo/ZfEr95Uk56vZoX86OsHkUeIg==} @@ -4876,18 +5173,14 @@ packages: resolution: {integrity: sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==} engines: {node: '>= 0.12'} - form-data@2.5.1: - resolution: {integrity: sha512-m21N3WOmEEURgk6B9GLOE4RuWOFf28Lhh9qGYeNlGq4VDXUlJy2th2slBNU8Gp8EzloYZOibZJ7t5ecIrFSjVA==} + form-data@2.5.2: + resolution: {integrity: sha512-GgwY0PS7DbXqajuGf4OYlsrIu3zgxD6Vvql43IBhm6MahqA5SK/7mwhtNj2AdH2z35YR34ujJ7BN+3fFC3jP5Q==} engines: {node: '>= 0.12'} - form-data@4.0.0: - resolution: {integrity: sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==} + form-data@4.0.1: + resolution: {integrity: sha512-tzN8e4TX8+kkxGPK8D5u0FNmjPUjw3lwC9lSLxxoB/+GtsJG91CO8bSWy73APlgAZzZbXEYZJuxjkHH2w+Ezhw==} engines: {node: '>= 6'} - formdata-polyfill@4.0.10: - resolution: {integrity: sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==} - engines: {node: '>=12.20.0'} - formidable@1.2.6: resolution: {integrity: sha512-KcpbcpuLNOwrEjnbpMC0gS+X8ciDoZE1kkqzat4a8vrprf+s9pKNQ/QIwWfbfs4ltgmFl3MD177SNTkve3BwGQ==} deprecated: 'Please upgrade to latest, formidable@v2 or formidable@v3! Check these notes: https://bit.ly/2ZEqIau' @@ -4952,10 +5245,6 @@ packages: functions-have-names@1.2.3: resolution: {integrity: sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==} - fx@35.0.0: - resolution: {integrity: sha512-O07q+Lknrom5RUX/u53tjo2KTTLUnL0K703JbqMYb19ORijfJNvijzFqqYXEjdk25T9R14S6t6wHD8fCWXCM0g==} - hasBin: true - gals@1.0.2: resolution: {integrity: sha512-h5c1Q6Q2cnRkO2v8ZxbuFCNRpM96CjGxGuoNcThoNF3dAEEYagF166EqJmaa9r2/I+ryij8TO3yMmqrMvQ1YXw==} engines: {node: '>= 16.0.0'} @@ -4984,8 +5273,8 @@ packages: resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==} engines: {node: 6.* || 8.* || >= 10.*} - get-intrinsic@1.2.4: - resolution: {integrity: sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==} + get-intrinsic@1.2.6: + resolution: {integrity: sha512-qxsEs+9A+u85HhllWJJFicJfPDhRmjzoYdl64aMWW9yRIJmSyxdn8IEkuIM530/7T+lv0TIHd8L6Q/ra0tEoeA==} engines: {node: '>= 0.4'} get-own-enumerable-property-symbols@3.0.2: @@ -5077,6 +5366,9 @@ packages: glob-to-regexp@0.3.0: resolution: {integrity: sha512-Iozmtbqv0noj0uDDqoL0zNq0VBEfK2YFoMAZoxJe4cwphvLR+JskfF30QhXHOR4m3KrE6NLRYw+U9MRXvifyig==} + glob-to-regexp@0.4.1: + resolution: {integrity: sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==} + glob@10.4.5: resolution: {integrity: sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==} hasBin: true @@ -5126,10 +5418,6 @@ packages: resolution: {integrity: sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==} engines: {node: '>=10'} - globby@13.2.2: - resolution: {integrity: sha512-Y1zNGV+pzQdh7H39l9zgB4PJqjRNqydvdYCDG4HFXM4XuvSaQQlEc91IU1yALL8gUTDomgBAfz3XJdmUS+oo0w==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - globby@9.2.0: resolution: {integrity: sha512-ollPHROa5mcxDEkwg6bPt3QbEf4pDQSNtd6JPL1YvOvAo/7/0VAm9TccUeoTmarjPw4pfUthSCqcyfNB1I3ZSg==} engines: {node: '>=6'} @@ -5139,8 +5427,9 @@ packages: engines: {node: '>=0.6.0'} hasBin: true - gopd@1.0.1: - resolution: {integrity: sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==} + gopd@1.2.0: + resolution: {integrity: sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==} + engines: {node: '>= 0.4'} got@9.6.0: resolution: {integrity: sha512-R7eWptXuGYxwijs0eV+v3o6+XH1IqVK8dJOEecQfTmkncw9AV4dcw/Dhxi8MdlqPthxxpZyizMzyg8RTmEsG+Q==} @@ -5200,12 +5489,12 @@ packages: has-property-descriptors@1.0.2: resolution: {integrity: sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==} - has-proto@1.0.3: - resolution: {integrity: sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==} + has-proto@1.2.0: + resolution: {integrity: sha512-KIL7eQPfHQRC8+XluaIw7BHUwwqL19bQn4hzNgdr+1wXoU0KKj6rufu47lhY7KbJR2C6T6+PfyN0Ea7wkSS+qQ==} engines: {node: '>= 0.4'} - has-symbols@1.0.3: - resolution: {integrity: sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==} + has-symbols@1.1.0: + resolution: {integrity: sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==} engines: {node: '>= 0.4'} has-tostringtag@1.0.2: @@ -5239,8 +5528,8 @@ packages: resolution: {integrity: sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==} engines: {node: '>= 0.4'} - hast-util-to-html@9.0.3: - resolution: {integrity: sha512-M17uBDzMJ9RPCqLMO92gNNUDuBSq10a25SDBI08iCCxmorf4Yy6sYHK57n9WAbRAAaU+DuR4W6GN9K4DFZesYg==} + hast-util-to-html@9.0.4: + resolution: {integrity: sha512-wxQzXtdbhiwGAUKrnQJXlOPmHnEehzphwkK7aluUPQ+lEc1xefC8pblMgpp2w5ldBTEfveRIrADcrhGIWrlTDA==} hast-util-whitespace@3.0.0: resolution: {integrity: sha512-88JUN06ipLwsnv+dVn+OIYOvAuvBMy/Qoi6O7mQHxdPXpjy+Cd6xRkWwux7DKO+4sYILtLBRIKgsdpS2gQc7qw==} @@ -5279,8 +5568,8 @@ packages: resolution: {integrity: sha512-kyCuEOWjJqZuDbRHzL8V93NzQhwIB71oFWSyzVo+KPZI+pnQPPxucdkrOZvkLRnrf5URsQM+IJ09Dw29cRALIA==} engines: {node: '>=10'} - hosted-git-info@6.1.1: - resolution: {integrity: sha512-r0EI+HBMcXadMrugk0GCQ+6BQV39PiWAZVfq7oIckeGiN7sjRGyQxPdft3nQekFTCQbYxLBH+/axZMeH8UX6+w==} + hosted-git-info@6.1.3: + resolution: {integrity: sha512-HVJyzUrLIL1c0QmviVh5E8VGyUS7xCFPS6yydaVd1UegW+ibV/CohqTH9MkOLDp5o+rb82DMo77PTuc9F/8GKw==} engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} hosted-git-info@7.0.2: @@ -5331,8 +5620,8 @@ packages: resolution: {integrity: sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==} engines: {node: '>= 6'} - https-proxy-agent@7.0.5: - resolution: {integrity: sha512-1e4Wqeblerz+tMKPIq2EMGiiWW1dIjZOksyHWSUm1rmuvw/how9hBHZ38lAGj5ID4Ik6EdkOw7NmWPy6LAwalw==} + https-proxy-agent@7.0.6: + resolution: {integrity: sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==} engines: {node: '>= 14'} human-signals@2.1.0: @@ -5379,8 +5668,8 @@ packages: resolution: {integrity: sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==} engines: {node: '>=6'} - import-in-the-middle@1.11.2: - resolution: {integrity: sha512-gK6Rr6EykBcc6cVWRSBR5TWf8nn6hZMYSRYqCcHa0l0d1fPK7JSYo6+Mlmck76jIX9aL/IZ71c06U2VpFwl1zA==} + import-in-the-middle@1.11.3: + resolution: {integrity: sha512-tNpKEb4AjZrCyrxi+Eyu43h5ig0O8ZRFSXPHh/00/o+4P4pKzVEW/m5lsVtsAT7fCIgmQOAPjdqecGDsBXRxsw==} import-lazy@2.1.0: resolution: {integrity: sha512-m7ZEHgtw69qOGw+jwxXkHlrlIPdTGkyh66zXZ1ajZbxkDBNjSY/LGbmjc7h0s2ELsUDTAhFr55TrPSSqJGPG0A==} @@ -5458,8 +5747,8 @@ packages: resolution: {integrity: sha512-+3azY4pXrjAupJHU1V9uGERWlhoqNswJNji6aD/02xac7oxol508AsMC5lxKhEqyZeDFy3enq5OGWXF4u75hiw==} engines: {node: '>= 4.5.0'} - internal-slot@1.0.7: - resolution: {integrity: sha512-NGnrKwXzSms2qUUih/ILZ5JBqNTSa1+ZmP6flaIp6KmSElgE9qdndzS3cqjrDovwFdmwsGsLdeFgB6suw+1e9g==} + internal-slot@1.1.0: + resolution: {integrity: sha512-4gd7VpWNQNB4UKKCFFVcp1AVv+FMOgs9NKzjHKusc8jTMhd5eL1NqQqOpE0KzMds804/yHlglp3uxgluOqAPLw==} engines: {node: '>= 0.4'} interpret@2.2.0: @@ -5485,8 +5774,8 @@ packages: resolution: {integrity: sha512-YBUanLI8Yoihw923YeFUS5fs0fF2f5TSFTNiYAAzhhDscDa3lEqYuz1pDOEP5KvX94I9ey3vsqjJcLVFVU+3QA==} engines: {node: '>= 0.10'} - is-arguments@1.1.1: - resolution: {integrity: sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA==} + is-arguments@1.2.0: + resolution: {integrity: sha512-7bVbi0huj/wrIAOzb8U1aszg9kdi3KN/CyU19CTI7tAoZYEZoL9yCDXpbXN+uPsuWnP02cyug1gleqq+TU+YCA==} engines: {node: '>= 0.4'} is-array-buffer@3.0.4: @@ -5496,11 +5785,19 @@ packages: is-arrayish@0.2.1: resolution: {integrity: sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==} - is-bigint@1.0.4: - resolution: {integrity: sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==} + is-arrayish@0.3.2: + resolution: {integrity: sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ==} + + is-async-function@2.0.0: + resolution: {integrity: sha512-Y1JXKrfykRJGdlDwdKlLpLyMIiWqWvuSd17TvZk68PLAOGOoF4Xyav1z0Xhoi+gCYjZVeC5SI+hYFOfvXmGRCA==} + engines: {node: '>= 0.4'} + + is-bigint@1.1.0: + resolution: {integrity: sha512-n4ZT37wG78iz03xPRKJrHTdZbe3IicyucEtdRsV5yglwc3GyUfbAfpSeD0FJ41NbUNSt5wbhqfp1fS+BgnvDFQ==} + engines: {node: '>= 0.4'} - is-boolean-object@1.1.2: - resolution: {integrity: sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==} + is-boolean-object@1.2.1: + resolution: {integrity: sha512-l9qO6eFlUETHtuihLcYOaLKByJ1f+N4kthcU9YjHy3N+B3hWv0y/2Nd0mu/7lTFnRQHTrSdXF50HQ3bl5fEnng==} engines: {node: '>= 0.4'} is-buffer@1.1.6: @@ -5521,20 +5818,20 @@ packages: is-class-hotfix@0.0.6: resolution: {integrity: sha512-0n+pzCC6ICtVr/WXnN2f03TK/3BfXY7me4cjCAqT8TYXEl0+JBRoqBo94JJHXcyDSLUeWbNX8Fvy5g5RJdAstQ==} - is-core-module@2.15.1: - resolution: {integrity: sha512-z0vtXSwucUJtANQWldhbtbt7BnL0vxiFjIdDLAatwhDYty2bad6s+rijD6Ri4YuYJubLzIJLUidCh09e1djEVQ==} + is-core-module@2.16.0: + resolution: {integrity: sha512-urTSINYfAYgcbLb0yDQ6egFm6h3Mo1DcF9EkyXSRjjzdHbsulg01qhwWuXdOoUBuTkbQ80KDboXa0vFJ+BDH+g==} engines: {node: '>= 0.4'} is-data-descriptor@1.0.1: resolution: {integrity: sha512-bc4NlCDiCr28U4aEsQ3Qs2491gVq4V8G7MQyws968ImqjKuYtTJXrl7Vq7jsN7Ly/C3xj5KWFrY7sHNeDkAzXw==} engines: {node: '>= 0.4'} - is-data-view@1.0.1: - resolution: {integrity: sha512-AHkaJrsUVW6wq6JS8y3JnM/GJF/9cf+k20+iDzlSaJrinEo5+7vRiteOSwBhHRiAyQATN1AmY4hwzxJKPmYf+w==} + is-data-view@1.0.2: + resolution: {integrity: sha512-RKtWF8pGmS87i2D6gqQu/l7EYRlVdfzemCJN/P3UOs//x1QE7mfhvzHIApBTRf7axvT6DMGwSwBXYCT0nfB9xw==} engines: {node: '>= 0.4'} - is-date-object@1.0.5: - resolution: {integrity: sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==} + is-date-object@1.1.0: + resolution: {integrity: sha512-PwwhEakHVKTdRNVOw+/Gyh0+MzlCl4R6qKvkhuvLtPMggI1WAHt9sOwZxQLSGpUaDnrdyDsomoRgNnCfKNSXXg==} engines: {node: '>= 0.4'} is-descriptor@0.1.7: @@ -5562,6 +5859,10 @@ packages: resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} engines: {node: '>=0.10.0'} + is-finalizationregistry@1.1.0: + resolution: {integrity: sha512-qfMdqbAQEwBw78ZyReKnlA8ezmPdb9BemzIIip/JkjaZUhitfXDkkr+3QTboW0JrSXT1QWyYShpvnNHGZ4c4yA==} + engines: {node: '>= 0.4'} + is-fullwidth-code-point@2.0.0: resolution: {integrity: sha512-VHskAKYM8RfSFXwee5t5cbN5PZeq1Wrh6qd5bkyiXIf6UQcN6w/A0eXM9r6t8d+GYOh+o6ZhiEnb88LN/Y8m2w==} engines: {node: '>=4'} @@ -5613,8 +5914,8 @@ packages: resolution: {integrity: sha512-WW/rQLOazUq+ST/bCAVBp/2oMERWLsR7OrKyt052dNDk4DHcDE0/7QSXITlmi+VBcV13DfIbysG3tZJm5RfdBA==} engines: {node: '>=10'} - is-number-object@1.0.7: - resolution: {integrity: sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ==} + is-number-object@1.1.0: + resolution: {integrity: sha512-KVSZV0Dunv9DTPkhXwcZ3Q+tUc9TsaE1ZwX5J2WMvsSGS6Md8TFPun5uwh0yRdrNerI6vf/tbJxqSx4c1ZI1Lw==} engines: {node: '>= 0.4'} is-number@3.0.0: @@ -5652,8 +5953,8 @@ packages: is-property@1.0.2: resolution: {integrity: sha512-Ks/IoX00TtClbGQr4TWXemAnktAQvYB7HzcCxDGqEZU6oCmb2INHuOoKxbtR+HFkmYWBKv/dOZtGRiAjDhj92g==} - is-regex@1.1.4: - resolution: {integrity: sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==} + is-regex@1.2.1: + resolution: {integrity: sha512-MjYsKHO5O7mCsmRGxWcLWheFqN9DJ/2TmngvjKXihe6efViPqc274+Fx/4fYj/r03+ESvBdTXK0V6tA3rgez1g==} engines: {node: '>= 0.4'} is-regexp@1.0.0: @@ -5682,12 +5983,12 @@ packages: resolution: {integrity: sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==} engines: {node: '>=8'} - is-string@1.0.7: - resolution: {integrity: sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==} + is-string@1.1.0: + resolution: {integrity: sha512-PlfzajuF9vSo5wErv3MJAKD/nqf9ngAs1NFQYm16nUYFO2IzxJ2hcm+IOCg+EEopdykNNUhVq5cz35cAUxU8+g==} engines: {node: '>= 0.4'} - is-symbol@1.0.4: - resolution: {integrity: sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==} + is-symbol@1.1.1: + resolution: {integrity: sha512-9gGx6GTtCQM73BgmHQXfDmLtfjjTUDSyoxTCbp5WtoixAhfgsDirWIcVQ/IHpvI5Vgd5i/J5F7B9cN/WlVbC/w==} engines: {node: '>= 0.4'} is-text-path@1.0.1: @@ -5697,8 +5998,8 @@ packages: is-type-of@1.4.0: resolution: {integrity: sha512-EddYllaovi5ysMLMEN7yzHEKh8A850cZ7pykrY1aNRQGn/CDjRDE9qEWbIdt7xGEVJmjBXzU/fNnC4ABTm8tEQ==} - is-type-of@2.1.0: - resolution: {integrity: sha512-hpTq+/nL0hPfmbMyee2mUmvAWoOhQz3s61E1gEAMq3spmJfYky2hwYDRkdZBfeGHB69RrH6sH+e4XB8pyqd6CA==} + is-type-of@2.2.0: + resolution: {integrity: sha512-72axShMJMnMy5HSU/jLGNOonZD5rWM0MwJSCYpKCTQCbggQZBJO/CLMMVP5HgS8kPSYFBkTysJexsD6NMvGKDQ==} is-typed-array@1.1.13: resolution: {integrity: sha512-uZ25/bUAlUY5fR4OKT4rZQEBrzQWYV9ZJYGGsUmEJ6thodVJ1HX64ePQ6Z0qPWP+m+Uq6e9UugrE38jeYsDSMw==} @@ -5722,8 +6023,9 @@ packages: resolution: {integrity: sha512-K5pXYOm9wqY1RgjpL3YTkF39tni1XajUIkawTLUo9EZEVUFga5gSQJF8nNS7ZwJQ02y+1YCNYcMh+HIf1ZqE+w==} engines: {node: '>= 0.4'} - is-weakref@1.0.2: - resolution: {integrity: sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ==} + is-weakref@1.1.0: + resolution: {integrity: sha512-SXM8Nwyys6nT5WP6pltOwKytLV7FqQ4UiibxVmW+EIosHcmCqkkjViTb5SNssDlkCiEYRP1/pdWUKVvZBmsR2Q==} + engines: {node: '>= 0.4'} is-weakset@2.0.3: resolution: {integrity: sha512-LvIm3/KWzS9oRFHugab7d+M/GcBXuXX5xZkzPmN+NxihdQlZUQ4dWuSV1xR/sq6upL1TJEDrfBgRepHFdBtSNQ==} @@ -5917,6 +6219,10 @@ packages: resolution: {integrity: sha512-49Fg7WXkU3Vl2h6LbLtMQ/HyB6rXSIX7SqvBLQmssRBGN9I0PNvPmAmCWSOY6SOvrjhI/F7/bGAv9RtnsPA03g==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + jest-worker@27.5.1: + resolution: {integrity: sha512-7vuh85V5cdDofPyxn58nrPjBktZo0u9x1g8WtjQol+jZDaE+fhN+cIvTj11GndBnMnyfrUOG1sZQxCdjKh+DKg==} + engines: {node: '>= 10.13.0'} + jest-worker@29.7.0: resolution: {integrity: sha512-eIz2msL/EzL9UFTFFx7jBTkeZfku0yUAyZZZmJ93H2TYEiroIx2PQjEXcwYtYl8zXCxb+PAmA2hLIt/6ZEkPHw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} @@ -5961,8 +6267,8 @@ packages: resolution: {integrity: sha512-AoRLBDc6JNnKjNcmonituEABS5bcfqDhQAWWXNTFrqu6nVXBpBAGfcoTGZMFlIrh9FjmE1CQyX9CTNwZrXMMDA==} engines: {node: '>= 6.0.0'} - jsesc@3.0.2: - resolution: {integrity: sha512-xKqzzWXDttJuOcawBt4KnKHHIf5oQ/Cxax+0PWFG+DFDgHNAdi+TXECADI+RYiFUMmx8792xsMbbgXj4CwnP4g==} + jsesc@3.1.0: + resolution: {integrity: sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==} engines: {node: '>=6'} hasBin: true @@ -6061,8 +6367,8 @@ packages: keyv@4.5.4: resolution: {integrity: sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==} - keyv@5.1.0: - resolution: {integrity: sha512-FUr1fbKVsj9IZkPkY9reJ80Lp2B3ldtFXH+xK0wvZYzOpwgHV1er3xP4JUhu2cgkV2X3BJQw+hzAbIGqa+hNIA==} + keyv@5.2.2: + resolution: {integrity: sha512-CRPP4Sq5ofbUE8s4FOirFmDgHeKZFRrH/8+WOUNvLJiMIplRMfnMjxmbaDb+zVd7ex0gGAWqMhZHfcL2u6PrNQ==} kind-of@3.2.2: resolution: {integrity: sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==} @@ -6229,6 +6535,14 @@ packages: resolution: {integrity: sha512-gUD/epcRms75Cw8RT1pUdHugZYM5ce64ucs2GEISABwkRsOQr0q2wm/MV2TKThycIe5e0ytRweW2RZxclogCdQ==} engines: {node: '>=8'} + loader-runner@4.3.0: + resolution: {integrity: sha512-3R/1M+yS3j5ou80Me59j7F9IMs4PXs3VqRrm0TU3AbKPxlmpoY1TNscJV/oGJXo8qCatFGTfDbY6W6ipGOYXfg==} + engines: {node: '>=6.11.5'} + + loader-utils@2.0.4: + resolution: {integrity: sha512-xXqpXoINfFhgua9xiqD8fPFHgkoq1mmmpE92WlDbm9rNRd/EbRb+Gqf908T2DMfuHjjJlksiK2RbHVOdD/MqSw==} + engines: {node: '>=8.9.0'} + locate-path@2.0.0: resolution: {integrity: sha512-NCI2kiDkyR7VeEKm27Kda/iQHyKJe1Bu0FlTbYp3CqJu+9IFe9bLyAjMxf5ZDDbEg+iMPzB5zYyUTSm8wVTKmA==} engines: {node: '>=4'} @@ -6245,6 +6559,10 @@ packages: resolution: {integrity: sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==} engines: {node: '>=10'} + locate-path@7.2.0: + resolution: {integrity: sha512-gvVijfZvn7R+2qyPX8mAuKcFGDf6Nc61GdvGafQsHL0sBIxfKzA+usWn4GFC/bk+QdwPUD4kWFJLhElipq+0VA==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + lodash.camelcase@4.3.0: resolution: {integrity: sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==} @@ -6436,6 +6754,10 @@ packages: resolution: {integrity: sha512-+BmqxWIubKTRKNWx/ahnCkk3mG8m7OturVlqq6HiojGJTd5hVYbgZm6WzcYPCoB+KBT4Vd6R7WSRG2OADNaCjg==} engines: {node: '>=4'} + math-intrinsics@1.0.0: + resolution: {integrity: sha512-4MqMiKP90ybymYvsut0CH2g4XWbfLtmlCkXmtmdcDCxNB+mQcu1w/1+L/VD7vi/PSv7X2JYV7SCcR+jiPXnQtA==} + engines: {node: '>= 0.4'} + mdast-util-to-hast@13.2.0: resolution: {integrity: sha512-QGYKEuUsYT9ykKBCMOEDLsU5JRObWQusAolFMeko/tYPufNkRffBAQjIE+99jbA87xv6FgmjLtwjh9wBWajwAA==} @@ -6478,20 +6800,20 @@ packages: resolution: {integrity: sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==} engines: {node: '>= 0.6'} - micromark-util-character@2.1.0: - resolution: {integrity: sha512-KvOVV+X1yLBfs9dCBSopq/+G1PcgT3lAK07mC4BzXi5E7ahzMAF8oIupDDJ6mievI6F+lAATkbQQlQixJfT3aQ==} + micromark-util-character@2.1.1: + resolution: {integrity: sha512-wv8tdUTJ3thSFFFJKtpYKOYiGP2+v96Hvk4Tu8KpCAsTMs6yi+nVmGh1syvSCsaxz45J6Jbw+9DD6g97+NV67Q==} - micromark-util-encode@2.0.0: - resolution: {integrity: sha512-pS+ROfCXAGLWCOc8egcBvT0kf27GoWMqtdarNfDcjb6YLuV5cM3ioG45Ys2qOVqeqSbjaKg72vU+Wby3eddPsA==} + micromark-util-encode@2.0.1: + resolution: {integrity: sha512-c3cVx2y4KqUnwopcO9b/SCdo2O67LwJJ/UyqGfbigahfegL9myoEFoDYZgkT7f36T0bLrM9hZTAaAyH+PCAXjw==} - micromark-util-sanitize-uri@2.0.0: - resolution: {integrity: sha512-WhYv5UEcZrbAtlsnPuChHUAsu/iBPOVaEVsntLBIdpibO0ddy8OzavZz3iL2xVvBZOpolujSliP65Kq0/7KIYw==} + micromark-util-sanitize-uri@2.0.1: + resolution: {integrity: sha512-9N9IomZ/YuGGZZmQec1MbgxtlgougxTodVwDzzEouPKo3qFWvymFHWcnDi2vzV1ff6kas9ucW+o3yzJK9YB1AQ==} - micromark-util-symbol@2.0.0: - resolution: {integrity: sha512-8JZt9ElZ5kyTnO94muPxIGS8oyElRJaiJO8EzV6ZSyGQ1Is8xwl4Q45qU5UOg+bGH4AikWziz0iN4sFLWs8PGw==} + micromark-util-symbol@2.0.1: + resolution: {integrity: sha512-vs5t8Apaud9N28kgCrRUdEed4UJ+wWNvicHLPxCa9ENlYuAY31M0ETy5y1vA33YoNPDFTghEbnh6efaE8h4x0Q==} - micromark-util-types@2.0.0: - resolution: {integrity: sha512-oNh6S2WMHWRZrmutsRmDDfkzKtxF+bc2VxLC9dvtrDIRFln627VsFP6fLMgTryGDljgLPjkrzQSDcPrjPyDJ5w==} + micromark-util-types@2.0.1: + resolution: {integrity: sha512-534m2WhVTddrcKVepwmVEVnUAmtrx9bfIjNoQHRqfnvdaHQiFytEhJoTgpWJvDEXCO5gLTQh3wYC1PgOJA4NSQ==} micromatch@3.1.10: resolution: {integrity: sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==} @@ -6757,8 +7079,8 @@ packages: resolution: {integrity: sha512-ikJRQTk8hw5DEoFVxHG1Gn9T/xcjtdnOKIU1JTmGjZZlg9LST2mBLmcX3/ICIbgJydT2GOc15RnNy5mHmzfSew==} engines: {node: '>=4.0.0'} - mqtt-packet@9.0.0: - resolution: {integrity: sha512-8v+HkX+fwbodsWAZIZTI074XIoxVBOmPeggQuDFCGg1SqNcC+uoRMWu7J6QlJPqIUIJXmjNYYHxBBLr1Y/Df4w==} + mqtt-packet@9.0.1: + resolution: {integrity: sha512-koZF1V/X2RZUI6uD9wN5OK1JxxcG1ofAR4H3LjCw1FkeKzruZQ26aAA6v2m1lZyWONZIR5wMMJFrZJDRNzbiQw==} mqtt@5.10.0: resolution: {integrity: sha512-2qpkUi5Ftp8cBX4sPCh/yr4ULBfLFQkjlhTGVpilHznOlsmDWIligmT1anSaJ1FqiH29RONNZJXhcJQaFwddgQ==} @@ -6782,8 +7104,8 @@ packages: resolution: {integrity: sha512-P0efT1C9jIdVRefqjzOQ9Xml57zpOXnIuS+csaB4MdZbTdmGDLo8XhzBG1N7aO11gKDDkJvBLULeFTo46wwreA==} hasBin: true - msgpackr@1.11.0: - resolution: {integrity: sha512-I8qXuuALqJe5laEBYoFykChhSXLikZmUhccjGsPuSJ/7uPip2TJ7lwdIQwWSAi0jGZDXv4WOP8Qg65QZRuXxXw==} + msgpackr@1.11.2: + resolution: {integrity: sha512-F9UngXRlPyWCDEASDpTf6c9uNhGPTqnTeLVt7bN+bU1eajoR/8V9ys2BRaV5C/e5ihE6sJ9uPIKaYt6bFuO32g==} muk-prop@1.2.1: resolution: {integrity: sha512-NdkOVav3GoIkBZqMUneU435HW0a90zitpuO1erPRhOQdPtl65dXD3G9/1k46G6/0ZMau4CJFFUHkMKVsyNZT+w==} @@ -6816,8 +7138,8 @@ packages: peerDependencies: typescript: '>=3' - mysql2@3.11.3: - resolution: {integrity: sha512-Qpu2ADfbKzyLdwC/5d4W7+5Yz7yBzCU05YWt5npWzACST37wJsB23wgOSo00qi043urkiRwXtEvJc9UnuLX/MQ==} + mysql2@3.11.5: + resolution: {integrity: sha512-0XFu8rUmFN9vC0ME36iBvCUObftiMHItrYFhlCRvFWbLgpNqtC4Br/NmZX1HNCszxT0GGy5QtP+k3Q3eCJPaYA==} engines: {node: '>= 8.0'} mz-modules@2.1.0: @@ -6861,9 +7183,34 @@ packages: resolution: {integrity: sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==} engines: {node: '>= 0.6'} + negotiator@0.6.4: + resolution: {integrity: sha512-myRT3DiWPHqho5PrJaIRyaMv2kgYf0mUVgBNOYMuCH5Ki1yEiQaf/ZJuQ62nvpc44wL5WDbTX7yGJi1Neevw8w==} + engines: {node: '>= 0.6'} + neo-async@2.6.2: resolution: {integrity: sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==} + next@15.0.4: + resolution: {integrity: sha512-nuy8FH6M1FG0lktGotamQDCXhh5hZ19Vo0ht1AOIQWrYJLP598TIUagKtvJrfJ5AGwB/WmDqkKaKhMpVifvGPA==} + engines: {node: ^18.18.0 || ^19.8.0 || >= 20.0.0} + hasBin: true + peerDependencies: + '@opentelemetry/api': ^1.1.0 + '@playwright/test': ^1.41.2 + babel-plugin-react-compiler: '*' + react: ^18.2.0 || 19.0.0-rc-66855b96-20241106 || ^19.0.0 + react-dom: ^18.2.0 || 19.0.0-rc-66855b96-20241106 || ^19.0.0 + sass: ^1.3.0 + peerDependenciesMeta: + '@opentelemetry/api': + optional: true + '@playwright/test': + optional: true + babel-plugin-react-compiler: + optional: true + sass: + optional: true + nice-try@1.0.5: resolution: {integrity: sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==} @@ -6877,8 +7224,8 @@ packages: resolution: {integrity: sha512-XKYnqUrCwXC8DGG1xX4YH5yNIrlh9c065uaMZZHUoeUUINTOyt+x/G+ezYk0Ft6ExSREVIs+qBJDK503viTfFA==} engines: {node: '>= 10.13'} - node-abi@3.68.0: - resolution: {integrity: sha512-7vbj10trelExNjFSBm5kTvZXXa7pZyKWx9RCKIyqe6I9Ev3IzGpQoqBP3a+cOdxY+pWj6VkP28n/2wWysBHD/A==} + node-abi@3.71.0: + resolution: {integrity: sha512-SZ40vRiy/+wRTf21hxkkEjPJZpARzUMVcJoQse2EF8qkUWbbO2z7vd5oA/H6bVH6SZQ5STGcu0KRDS7biNRfxw==} engines: {node: '>=10'} node-addon-api@3.2.1: @@ -6887,10 +7234,6 @@ packages: node-addon-api@7.1.1: resolution: {integrity: sha512-5m3bsyrjFWE1xf7nz7YXdN4udnVtXK6/Yfgn5qnahL6bCkf2yKt4k3nuTKAtT4r3IG8JNR2ncsIMdZuAzJjHQQ==} - node-domexception@1.0.0: - resolution: {integrity: sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==} - engines: {node: '>=10.5.0'} - node-fetch@2.6.7: resolution: {integrity: sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==} engines: {node: 4.x || >=6.0.0} @@ -6900,20 +7243,16 @@ packages: encoding: optional: true - node-fetch@3.3.1: - resolution: {integrity: sha512-cRVc/kyto/7E5shrWca1Wsea4y6tL9iYJE5FBCius3JQfb/4P4I295PfhgbJQBLTx6lATE4z+wK0rPM4VS2uow==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - node-gyp-build-optional-packages@5.2.2: resolution: {integrity: sha512-s+w+rBWnpTMwSFbaE0UXsRlg7hU4FjekKU4eyAih5T8nJuNZT1nNsskXpxmeqSK9UzkBl6UgRlnKc8hz8IEqOw==} hasBin: true - node-gyp-build@4.8.2: - resolution: {integrity: sha512-IRUxE4BVsHWXkV/SFOut4qTlagw2aM8T5/vnTsmrHJvVoKueJHRc/JaFND7QDDc61kLYUJ6qlZM3sqTSyx2dTw==} + node-gyp-build@4.8.4: + resolution: {integrity: sha512-LA4ZjwlnUblHVgq0oBF3Jl/6h/Nvs5fzBLwdEF4nuxnFdsfajde4WfxtJr3CaiH+F6ewcIB/q4jQ4UzPyid+CQ==} hasBin: true - node-gyp@10.2.0: - resolution: {integrity: sha512-sp3FonBAaFe4aYTcFdZUn2NYkbP7xroPGYvQmP4Nl5PxamznItBnNCgjrVTKrEfQynInMsJvZrdmqUnysCJ8rw==} + node-gyp@10.3.1: + resolution: {integrity: sha512-Pp3nFHBThHzVtNY7U6JfPjvT/DTE8+o/4xKsLQtBoU+j2HLsGlhcfzflAoUreaJbNmYnX+LlLi0qjV8kpyO6xQ==} engines: {node: ^16.14.0 || >=18.0.0} hasBin: true @@ -6936,8 +7275,8 @@ packages: node-machine-id@1.1.12: resolution: {integrity: sha512-QNABxbrPa3qEIfrE6GOJ7BYIuignnJw7iQ2YPbc3Nla1HzRJjXzZOiikfF8m7eAMfichLt3M4VgLOetqgDmgGQ==} - node-releases@2.0.18: - resolution: {integrity: sha512-d9VeXT4SJ7ZeOqGX6R5EM022wpL+eWPooLI+5UpWn2jCT1aosUQEhQP214x33Wkwx3JQMvIm+tIoVOdodFS40g==} + node-releases@2.0.19: + resolution: {integrity: sha512-xxOWJsBKtzAq7DY0J+DTzuz58K8e7sJbdgwkbMWQe8UYB6ekmsQ45q0M/tJDsGaZmbC+l7n57UV8Hl5tHxO9uw==} node-source-walk@4.3.0: resolution: {integrity: sha512-8Q1hXew6ETzqKRAs3jjLioSxNfT1cx74ooiF8RlAONwVMcfq+UdzLC2eB5qcPldUxaE5w3ytLkrmV1TGddhZTA==} @@ -7043,6 +7382,12 @@ packages: engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0} deprecated: This package is no longer supported. + null-loader@4.0.1: + resolution: {integrity: sha512-pxqVbi4U6N26lq+LmgIbB5XATP0VdZKOG25DhHi8btMmJJefGArFyDg1yc4U3hWCJbMqSrw0qyrz1UQX+qYXqg==} + engines: {node: '>= 10.13.0'} + peerDependencies: + webpack: ^4.0.0 || ^5.0.0 + number-allocator@1.0.14: resolution: {integrity: sha512-OrL44UTVAvkKdOdRQZIJpLkAdjXGTRda052sN4sO77bKEzYYqWKMBjQvrJFzqygI99gL6Z4u2xctPW1tB8ErvA==} @@ -7094,8 +7439,8 @@ packages: resolution: {integrity: sha512-79LYn6VAb63zgtmAteVOWo9Vdj71ZVBy3Pbse+VqxDpEP83XuujMrGqHIwAXJ5I/aM0zU7dIyIAhifVTPrNItQ==} engines: {node: '>=0.10.0'} - object-inspect@1.13.2: - resolution: {integrity: sha512-IRZSRuzJiynemAXPYtPe5BoI/RESNYR7TYm50MC5Mqbd3Jmw5y790sErYw3V6SryFJD64b74qQQs9wn5Bg/k3g==} + object-inspect@1.13.3: + resolution: {integrity: sha512-kDCGIbxkDSXE3euJZZXzc6to7fCrKHNI/hSRQnRuQ+BWjFNzZwiFF8fj/6o2t2G9/jTj8PSIYTfCLelLZEeRpA==} engines: {node: '>= 0.4'} object-is@1.1.6: @@ -7137,8 +7482,8 @@ packages: resolution: {integrity: sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==} engines: {node: '>=6'} - oniguruma-to-js@0.4.3: - resolution: {integrity: sha512-X0jWUcAlxORhOqqBREgPMgnshB7ZGYszBNspP+tS9hPD3l13CdaXcHbgImoHUHlrvGx/7AvFEkTRhAGYh+jzjQ==} + oniguruma-to-es@0.7.0: + resolution: {integrity: sha512-HRaRh09cE0gRS3+wi2zxekB+I5L8C/gN60S+vb11eADHUaB/q4u8wGGOX3GvwvitG8ixaeycZfeoyruKQzUgNg==} only@0.0.2: resolution: {integrity: sha512-Fvw+Jemq5fjjyWz6CpKx6w9s7xxqo3+JCyM0WXWeCSOboZ8ABkyvP8ID4CZuChA/wxSx+XSJmdOm8rGVyJ1hdQ==} @@ -7197,6 +7542,10 @@ packages: resolution: {integrity: sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==} engines: {node: '>=10'} + p-limit@4.0.0: + resolution: {integrity: sha512-5b0R4txpzjPWVw/cXXUResoD4hb6U/x9BH08L7nw+GN1sezDzPdxeRvpc9c433fZhBan/wusjbCsqwqm4EIBIQ==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + p-locate@2.0.0: resolution: {integrity: sha512-nQja7m7gSKuewoVRen45CtVfODR3crN3goVQ0DDZ9N3yHxgpkuBhZqsaiotSQRrADUrne346peY7kT3TSACykg==} engines: {node: '>=4'} @@ -7213,6 +7562,10 @@ packages: resolution: {integrity: sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==} engines: {node: '>=10'} + p-locate@6.0.0: + resolution: {integrity: sha512-wPrq66Llhl7/4AGC6I+cqxT07LhXvWL08LNXz1fENOw0Ap4sRZZ/gZpTTJ5jpurzzzfS2W/Ge9BY3LgLjCShcw==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + p-map-series@2.1.0: resolution: {integrity: sha512-RpYIIK1zXSNEOdwxcfe7FdvGcs7+y5n8rifMhMNWvaxRNMPINJHF5GDeuVxWqnfrcHPSCnp7Oo5yNXHId9Av2Q==} engines: {node: '>=8'} @@ -7360,6 +7713,10 @@ packages: resolution: {integrity: sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==} engines: {node: '>=8'} + path-exists@5.0.0: + resolution: {integrity: sha512-RjhtfwJOxzcFmNOi6ltcbcu4Iu+FL3zEj83dk4kAS+fVpTxXLO1b38RvJgT/0QwvV/L3aY9TAnyv0EOqW4GoMQ==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + path-is-absolute@1.0.1: resolution: {integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==} engines: {node: '>=0.10.0'} @@ -7415,8 +7772,8 @@ packages: pg-connection-string@2.7.0: resolution: {integrity: sha512-PI2W9mv53rXJQEOb8xNR8lH7Hr+EKa6oJa38zsK0S/ky2er16ios1wLKhZyxzD7jUReiWokc9WK5nxSnC7W1TA==} - picocolors@1.1.0: - resolution: {integrity: sha512-TQ92mBOW0l3LeMeyLV6mzy/kWr8lkd/hp3mTg7wYK7zJhuBStmGMBG0BdeDZS/dZx1IukaX6Bk11zcln25o1Aw==} + picocolors@1.1.1: + resolution: {integrity: sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==} picomatch@2.3.1: resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} @@ -7446,6 +7803,10 @@ packages: resolution: {integrity: sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==} engines: {node: '>=8'} + pkg-dir@7.0.0: + resolution: {integrity: sha512-Ie9z/WINcxxLp27BKOCHGde4ITq9UklYKDzVo1nhk5sqGEXU3FpkwP5GM2voTGJkGd9B3Otl+Q4uwSOeSUtOBA==} + engines: {node: '>=14.16'} + pkg-up@3.1.0: resolution: {integrity: sha512-nDywThFk1i4BQK4twPQ6TA4RT8bDY96yeuCVBWL3ePARCiEKDRSrNGbFIgUJpLp+XeIR65v8ra7WuJOFUBtkMA==} engines: {node: '>=8'} @@ -7479,8 +7840,12 @@ packages: peerDependencies: postcss: ^8.2.9 - postcss@8.4.47: - resolution: {integrity: sha512-56rxCq7G/XfB4EkXq9Egn5GCqugWvDFjafDOThIdMBsI15iqPqR5r15TfSr1YPYeEI19YeaXMCbY6u88Y76GLQ==} + postcss@8.4.31: + resolution: {integrity: sha512-PS08Iboia9mts/2ygV3eLpY5ghnUcfLV/EXTOW1E2qYxJKGGBUtNjN76FYHnMs36RmARn41bC0AZmn+rR0OVpQ==} + engines: {node: ^10 || ^12 || >=14} + + postcss@8.4.49: + resolution: {integrity: sha512-OCVPnIObs4N29kxTjzLfUryOkvZEq+pf8jTF0lg8E7uETuWHA+v7j3c/xJmiqpX450191LlmZfUKkXxkTry7nA==} engines: {node: ^10 || ^12 || >=14} power-assert-context-formatter@1.2.0: @@ -7639,8 +8004,8 @@ packages: pseudomap@1.0.2: resolution: {integrity: sha512-b/YwNhb8lk1Zz2+bXXpS/LK9OisiZZ1SNsSLxN1x2OXVEhW2Ckr/7mWE5vrC1ZTiJlD9g19jWszTmJsB+oEpFQ==} - psl@1.9.0: - resolution: {integrity: sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag==} + psl@1.15.0: + resolution: {integrity: sha512-JZd3gMVBAVQkSs6HdNZo9Sdo0LNcQeMNP3CozBJb3JYC/QUYZTnKxP+f8oWRX4rHP5EurWxqAHTSwUCjlNKa1w==} pump@2.0.1: resolution: {integrity: sha512-ruPMNRkN3MHP1cWJc9OWr+T/xDP0jhXYCLfJcBuX54hhfIBnaQmAUMfDcG4DM5UMWByBbJY69QSphm3jtDKIkA==} @@ -7695,6 +8060,9 @@ packages: resolution: {integrity: sha512-iv7LhNVO047HzYR3InF6pUcUsPQiHTM1Qal51DcGSuZFBil1aBBWG5eHPNek7bvILMaYJ/8RU1e8w1AMdHmLQQ==} engines: {node: '>= 0.8'} + randombytes@2.1.0: + resolution: {integrity: sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==} + range-parser@1.2.1: resolution: {integrity: sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==} engines: {node: '>= 0.6'} @@ -7712,6 +8080,11 @@ packages: peerDependencies: react: 17.0.2 + react-dom@18.3.1: + resolution: {integrity: sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw==} + peerDependencies: + react: ^18.3.1 + react-is@18.3.1: resolution: {integrity: sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==} @@ -7719,6 +8092,10 @@ packages: resolution: {integrity: sha512-gnhPt75i/dq/z3/6q/0asP78D0u592D5L1pd7M8P+dck6Fu/jJeL6iVVK23fptSUZj8Vjf++7wXA8UNclGQcbA==} engines: {node: '>=0.10.0'} + react@18.3.1: + resolution: {integrity: sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==} + engines: {node: '>=0.10.0'} + read-cmd-shim@4.0.0: resolution: {integrity: sha512-yILWifhaSEEytfXI76kB9xEEiG1AiozaCJZ83A87ytjRiN+jVibXjedjCRNjoZviinhG+4UkalO3mWTd8u5O0Q==} engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} @@ -7815,6 +8192,10 @@ packages: reflect-metadata@0.2.2: resolution: {integrity: sha512-urBwgfrvVP/eAyXx4hluJivBKzuEbSQs9rKWCrCkbSxNv8mxPcUZKeuoF3Uy4mJl3Lwprp6yy5/39VWigZ4K6Q==} + reflect.getprototypeof@1.0.8: + resolution: {integrity: sha512-B5dj6usc5dkk8uFliwjwDHM8To5/QwdKz9JcBZ8Ic4G1f0YmeeJTtE/ZTdgRFPAfxZFiUaPhZ1Jcs4qeagItGQ==} + engines: {node: '>= 0.4'} + regenerator-runtime@0.14.1: resolution: {integrity: sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==} @@ -7822,8 +8203,14 @@ packages: resolution: {integrity: sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==} engines: {node: '>=0.10.0'} - regex@4.3.3: - resolution: {integrity: sha512-r/AadFO7owAq1QJVeZ/nq9jNS1vyZt+6t1p/E59B56Rn2GCya+gr1KSyOzNL/er+r+B7phv5jG2xU2Nz1YkmJg==} + regex-recursion@4.3.0: + resolution: {integrity: sha512-5LcLnizwjcQ2ALfOj95MjcatxyqF5RPySx9yT+PaXu3Gox2vyAtLDjHB8NTJLtMGkvyau6nI3CfpwFCjPUIs/A==} + + regex-utilities@2.3.0: + resolution: {integrity: sha512-8VhliFJAWRaUiVvREIiW2NXXTmHs4vMNnSzuJVhscgmGav3g9VDxLrQndI3dZZVVdp0ZO/5v0xmX516/7M9cng==} + + regex@5.0.2: + resolution: {integrity: sha512-/pczGbKIQgfTMRV0XjABvc5RzLqQmwqxLHdQao2RTXPk+pmTXB2P0IaUHYdYyk412YLwUIkaeMd5T+RzVgTqnQ==} regexp.prototype.flags@1.5.3: resolution: {integrity: sha512-vqlC04+RQoFalODCbCumG2xIOvapzVMHwsyIGM/SIE8fRhFFsXeH8/QQ+s0T0kDAhKc4k30s73/0ydkHQz6HlQ==} @@ -7904,12 +8291,12 @@ packages: resolution: {integrity: sha512-ZuF55hVUQaaczgOIwqWzkEcEidmlD/xl44x1UZnhOXcYuFN2S6+rcxpG+C1N3So0wvNI3DmJICUFfu2SxhBmvg==} deprecated: https://github.com/lydell/resolve-url#deprecated - resolve.exports@2.0.2: - resolution: {integrity: sha512-X2UW6Nw3n/aMgDVy+0rSqgHlv39WZAlZrXCdnbyEiKm17DSqHX4MmQMaST3FbeWR5FTuRcUwYAziZajji0Y7mg==} + resolve.exports@2.0.3: + resolution: {integrity: sha512-OcXjMsGdhL4XnbShKpAcSqPMzQoYkYyhbEaeSko47MjRP9NfEQMhZkXL1DoFlt9LWQn4YttrdnV6X2OiyzBi+A==} engines: {node: '>=10'} - resolve@1.22.8: - resolution: {integrity: sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==} + resolve@1.22.9: + resolution: {integrity: sha512-QxrmX1DzraFIi9PxdG5VkRfRwIgjwyud+z/iBwfRRrVmHc+P9Q7u2lSSpQ6bjr2gy5lrqIiU9vb6iAeGf2400A==} hasBin: true responselike@1.0.2: @@ -7976,8 +8363,8 @@ packages: rxjs@7.8.1: resolution: {integrity: sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==} - safe-array-concat@1.1.2: - resolution: {integrity: sha512-vj6RsCsWBCf19jIeHEfkRMw8DPiBb+DMXklQ/1SGDHOMlHdPUkZXFQ2YdplS23zESTijAcurb1aSgJA3AgMu1Q==} + safe-array-concat@1.1.3: + resolution: {integrity: sha512-AURm5f0jYEOydBj7VQlVvDrjeFgthDdEF5H1dP+6mNpoXOMo1quQqJ4wvJDyRZ9+pO3kGWoOdmV08cSv2aJV6Q==} engines: {node: '>=0.4'} safe-buffer@5.1.2: @@ -7986,8 +8373,8 @@ packages: safe-buffer@5.2.1: resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==} - safe-regex-test@1.0.3: - resolution: {integrity: sha512-CdASjNJPvRa7roO6Ra/gLYBTzYzzPyyBXxIMdGW3USQLyjWEls2RgW5UBTXaQVp+OrpeCK3bLem8smtmheoRuw==} + safe-regex-test@1.1.0: + resolution: {integrity: sha512-x/+Cz4YrimQxQccJf5mKEbIa1NzeCRNI5Ecl/ekmlYaampdNLPalVyIcCZNNH3MvmqBugV5TMYZXv0ljslUlaw==} engines: {node: '>= 0.4'} safe-regex@1.1.0: @@ -8014,6 +8401,17 @@ packages: scheduler@0.20.2: resolution: {integrity: sha512-2eWfGgAqqWFGqtdMmcL5zCMK1U8KlXv8SQFGglL3CEtd0aDVDWgeF/YoCmvln55m5zSk3J/20hTaSBeSObsQDQ==} + scheduler@0.23.2: + resolution: {integrity: sha512-UOShsPwz7NrMUqhR6t0hWjFduvOzbtv7toDH1/hIrfRNIDBnnBWd0CwJTGvTpngVlmwGCdP9/Zl/tVrDqcuYzQ==} + + schema-utils@3.3.0: + resolution: {integrity: sha512-pN/yOAvcC+5rQ5nERGuwrjLlYvLTbCibnZ1I7B1LaiAz9BRBlE9GMgE/eqV30P7aJQUf7Ddimy/RsbYO/GrVGg==} + engines: {node: '>= 10.13.0'} + + schema-utils@4.3.0: + resolution: {integrity: sha512-Gf9qqc58SpCA/xdziiHz35F4GNIWYWZrEshUc/G/r5BnLph6xpKuLeoJoQuj5WfBIx/eQLf+hmVPYHaxJu7V2g==} + engines: {node: '>= 10.13.0'} + scmp@2.1.0: resolution: {integrity: sha512-o/mRQGk9Rcer/jEEw/yw4mwo3EU/NvYvp577/Btqrym9Qy5/MdWGBqipbALgd2lrdWTJ5/gqDusxfnQBxOxT2Q==} @@ -8112,6 +8510,9 @@ packages: tedious: optional: true + serialize-javascript@6.0.2: + resolution: {integrity: sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g==} + serialize-json@1.0.3: resolution: {integrity: sha512-TJvXOXSUEH4Lh2FNy1mYzNkUyBG7Ti5fRKGAbcpaDX3mLq23aT/5unC+cIFc5JTDi4/BHTaYLhynrboCCYrFaQ==} engines: {node: '>= 4.0.0'} @@ -8146,6 +8547,10 @@ packages: resolution: {integrity: sha512-/6KqX+GVUdqPuPPd2LxDDxzX6CAbjJehAAOKlNpqqUpAqPM6HeL8f+o3a+JsyGjn2lv0WY8UsTgUJjU9Ok55NA==} engines: {node: '>=8'} + sharp@0.33.5: + resolution: {integrity: sha512-haPVm1EkS9pgvHrQ/F3Xy+hgcuMV0Wm9vfIBSiwZ05k+xgb0PkBQpGsAA/oWdDobNaZTH5ppvHtzCFbnSEwHVw==} + engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} + shebang-command@1.2.0: resolution: {integrity: sha512-EV3L1+UQWGor21OmnvojK36mhg+TyIKDh3iFBKBohr5xeXIhNBcx8oWdgkTEEQ+BEFFYdLRuqMfd5L84N1V5Vg==} engines: {node: '>=0.10.0'} @@ -8162,8 +8567,8 @@ packages: resolution: {integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==} engines: {node: '>=8'} - shiki@1.22.0: - resolution: {integrity: sha512-/t5LlhNs+UOKQCYBtl5ZsH/Vclz73GIqT2yQsCBygr8L/ppTdmpL4w3kPLoZJbMKVWtoG77Ue1feOjZfDxvMkw==} + shiki@1.24.2: + resolution: {integrity: sha512-TR1fi6mkRrzW+SKT5G6uKuc32Dj2EEa7Kj0k8kGqiBINb+C1TiflVOiT9ta6GqOJtC4fraxO5SLUaKBcSY38Fg==} shimmer@1.2.1: resolution: {integrity: sha512-sQTKC1Re/rM6XyFM6fIAGHRPVGvyXfgzIDvzoq608vM+jeyVD0Tu1E6Np0Kc2zAIFWIj963V2800iF/9LPieQw==} @@ -8171,8 +8576,20 @@ packages: should-send-same-site-none@2.0.5: resolution: {integrity: sha512-7dig49H7sKnv1v/GPoFQChGgJdEX9s2oy9TQBSD5RbUx7M9CCRjHMaFP06v+DZQNM0K+o8dBhvBAd4eEKirqbQ==} - side-channel@1.0.6: - resolution: {integrity: sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==} + side-channel-list@1.0.0: + resolution: {integrity: sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==} + engines: {node: '>= 0.4'} + + side-channel-map@1.0.1: + resolution: {integrity: sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==} + engines: {node: '>= 0.4'} + + side-channel-weakmap@1.0.2: + resolution: {integrity: sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==} + engines: {node: '>= 0.4'} + + side-channel@1.1.0: + resolution: {integrity: sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==} engines: {node: '>= 0.4'} sift@17.1.3: @@ -8203,6 +8620,9 @@ packages: simple-get@4.0.1: resolution: {integrity: sha512-brv7p5WgH0jmQJr1ZDDfKDOSeWWg+OVypG99A/5vYGPqJ6pxiaHLy8nxtFjBA7oMa01ebA9gfh1uMCFqOuXxvA==} + simple-swizzle@0.2.2: + resolution: {integrity: sha512-JA//kQgZtbuY83m+xT+tXJkmJncGMTFT+C+g2h2R9uxkYIrE2yy9sgmcLhCnw57/WSD+Eh3J97FPEDFnbXnDUg==} + sinon@17.0.2: resolution: {integrity: sha512-uihLiaB9FhzesElPDFZA7hDcNABzsVHwr3YfmM9sBllVwab3l0ltGlRV1XhpNfIacNDLGD1QRZNLs5nU5+hTuA==} deprecated: There @@ -8218,10 +8638,6 @@ packages: resolution: {integrity: sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==} engines: {node: '>=8'} - slash@4.0.0: - resolution: {integrity: sha512-3dOsAHXXUkQTpOYcoAxLIorMTp4gIQr5IW3iVb7A7lFIp0VHhnynm9izx6TssdrIcVIESAlVjtnO2K8bg+Coew==} - engines: {node: '>=12'} - slice-ansi@4.0.0: resolution: {integrity: sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==} engines: {node: '>=10'} @@ -8287,8 +8703,8 @@ packages: resolution: {integrity: sha512-Fgl0YPZ902wEsAyiQ+idGd1A7rSFx/ayC1CQVMw5P+EQx2V0SgpGtf6OKFhVjPflPUl9YMmEOnmfjCdMUsygww==} engines: {node: '>= 10'} - socks-proxy-agent@8.0.4: - resolution: {integrity: sha512-GNAq/eg8Udq2x0eNiFkr9gRg5bA7PXEWagQdeRX4cPSG+X/8V38v637gim9bjFptMk1QWsCTr0ttrJEiXbNnRw==} + socks-proxy-agent@8.0.5: + resolution: {integrity: sha512-HehCEsotFqbPW9sJ8WVYB6UbmIMv7kUUORIF2Nncq4VQvBfNBLibW9YZR5dlYCSUhwcD628pRllm7n+E+YTzJw==} engines: {node: '>= 14'} socks@2.8.3: @@ -8422,8 +8838,8 @@ packages: resolution: {integrity: sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==} engines: {node: '>= 0.8'} - stop-iteration-iterator@1.0.0: - resolution: {integrity: sha512-iCGQj+0l0HOdZ2AEeBADlsRC+vsnDsZsbdSiH1yNSjcfKM7fdpCMfqAL/dwF5BLiw/XhRft/Wax6zQbhq2BcjQ==} + stop-iteration-iterator@1.1.0: + resolution: {integrity: sha512-eLoXW/DHyl62zxY4SCaIgnRhuMr6ri4juEYARS8E6sCEqzKpOiE521Ucofdx+KnDZl5xmvGYaaKCk5FEOxJCoQ==} engines: {node: '>= 0.4'} stream-combiner@0.0.4: @@ -8469,12 +8885,13 @@ packages: resolution: {integrity: sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==} engines: {node: '>=12'} - string.prototype.trim@1.2.9: - resolution: {integrity: sha512-klHuCNxiMZ8MlsOihJhJEBJAiMVqU3Z2nEXWfWnIqjN0gEFS9J9+IxKozWWtQGcgoa1WUZzLjKPTr4ZHNFTFxw==} + string.prototype.trim@1.2.10: + resolution: {integrity: sha512-Rs66F0P/1kedk5lyYyH9uBzuiI/kNRmwJAR9quK6VOtIpZ2G+hMZd+HQbbv25MgCA6gEffoMZYxlTod4WcdrKA==} engines: {node: '>= 0.4'} - string.prototype.trimend@1.0.8: - resolution: {integrity: sha512-p73uL5VCHCO2BZZ6krwwQE3kCzM7NKmis8S//xEC6fQonchbum4eP6kR4DLEjQFO3Wnj3Fuo8NM0kOSjVdHjZQ==} + string.prototype.trimend@1.0.9: + resolution: {integrity: sha512-G7Ok5C6E/j4SGfyLCloXTrngQIQU3PWtXGst3yM7Bea9FRURf1S42ZHlZZtsNque2FN2PoUhfZXYLNWwEr4dLQ==} + engines: {node: '>= 0.4'} string.prototype.trimstart@1.0.8: resolution: {integrity: sha512-UXSH262CSZY1tfu3G3Secr6uGLCFVPMhIqHjlgCUtCCcgihYc/xKs9djMTMUOb2j1mVSeU8EU6NWc/iQKU6Gfg==} @@ -8547,6 +8964,19 @@ packages: resolution: {integrity: sha512-fZtbhtvI9I48xDSywd/somNqgUHl2L2cstmXCCif0itOf96jeW18MBSyrLuNicYQVkvpOxkZtkzujiTJ9LW5Jw==} engines: {node: '>=10'} + styled-jsx@5.1.6: + resolution: {integrity: sha512-qSVyDTeMotdvQYoHWLNGwRFJHC+i+ZvdBRYosOFgC+Wg1vx4frN2/RG/NA7SYqqvKNLf39P2LSRA2pu6n0XYZA==} + engines: {node: '>= 12.0.0'} + peerDependencies: + '@babel/core': '*' + babel-plugin-macros: '*' + react: '>= 16.8.0 || 17.x.x || ^18.0.0-0 || ^19.0.0-0' + peerDependenciesMeta: + '@babel/core': + optional: true + babel-plugin-macros: + optional: true + stylus-lookup@3.0.2: resolution: {integrity: sha512-oEQGHSjg/AMaWlKe7gqsnYzan8DLcGIHe0dUaFkucZZ14z4zjENRlQMCHT4FNsiWnJf17YN9OvrCfCoi7VvOyg==} engines: {node: '>=6.0.0'} @@ -8596,8 +9026,8 @@ packages: swagger-ui-dist@5.17.14: resolution: {integrity: sha512-CVbSfaLpstV65OnSjbXfVd6Sta3q3F7Cj/yYuvHMp1P90LztOLs6PfUnKEVAeiIVQt9u2SaPwv0LiH/OyMjHRw==} - table@6.8.2: - resolution: {integrity: sha512-w2sfv80nrAh2VCbqR5AK27wswXhqcck2AhfnNW76beQXskGZ1V12GwS//yYVa3d3fcvAip2OUnbDAjW2k3v9fA==} + table@6.9.0: + resolution: {integrity: sha512-9kY+CygyYM6j02t5YFHbNz2FN5QmYGv9zAjVp4lCDjlCw7amdckXlEt/bjMhUIfj4ThGRE4gCUH5+yGnNuPo5A==} engines: {node: '>=10.0.0'} tablestore@5.5.1: @@ -8640,6 +9070,27 @@ packages: resolution: {integrity: sha512-xZFXEGbG7SNC3itwBzI3RYjq/cEhBkx2hJuKGIUOcEULmkQExXiHat2z/qkISYsuR+IKumhEfKKbV5qXmhICFQ==} engines: {node: '>=4'} + terser-webpack-plugin@5.3.11: + resolution: {integrity: sha512-RVCsMfuD0+cTt3EwX8hSl2Ks56EbFHWmhluwcqoPKtBnfjiT6olaq7PRIRfhyU8nnC2MrnDrBLfrD/RGE+cVXQ==} + engines: {node: '>= 10.13.0'} + peerDependencies: + '@swc/core': '*' + esbuild: '*' + uglify-js: '*' + webpack: ^5.1.0 + peerDependenciesMeta: + '@swc/core': + optional: true + esbuild: + optional: true + uglify-js: + optional: true + + terser@5.37.0: + resolution: {integrity: sha512-B8wRRkmre4ERucLM/uXx4MOV5cbnOlVAqUst+1+iLKPI0dOgFO28f84ptoQt9HEI537PMzfYa/d+GEPKTRXmYA==} + engines: {node: '>=10'} + hasBin: true + test-exclude@6.0.0: resolution: {integrity: sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==} engines: {node: '>=8'} @@ -8692,10 +9143,6 @@ packages: to-arraybuffer@1.0.1: resolution: {integrity: sha512-okFlQcoGTi4LQBG/PgSYblw9VOyptsz2KJZqc6qtgGdes8VktzUQkj4BI2blit072iS8VODNcMA+tvnS9dnuMA==} - to-fast-properties@2.0.0: - resolution: {integrity: sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==} - engines: {node: '>=4'} - to-object-path@0.3.0: resolution: {integrity: sha512-9mWHdnGRuh3onocaHzukyvCZhzvr6tiflAy/JRFXcJX0TjgfWA9pk9t8CMbzmBE4Jfw58pXbkngtBtqYxzNEyg==} engines: {node: '>=0.10.0'} @@ -8805,8 +9252,8 @@ packages: tslib@1.14.1: resolution: {integrity: sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==} - tslib@2.7.0: - resolution: {integrity: sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA==} + tslib@2.8.1: + resolution: {integrity: sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==} tsscmp@1.0.6: resolution: {integrity: sha512-LxhtAkPDTkVCMQjt2h6eBVY28KCjikZqZfMcC15YBeNjkgUpdCfBu5HoiOTDu86v6smE8yOjyEktJ8hlbANHQA==} @@ -8883,12 +9330,12 @@ packages: resolution: {integrity: sha512-3iMJ9q0ao7WE9tWcaYKIptkNBuOIcZCCT0d4MRvuuH88fEoEH62IuQe0OtraD3ebQEoTRk8XCBoknUNc1Y67pw==} engines: {node: '>= 0.4'} - typed-array-byte-offset@1.0.2: - resolution: {integrity: sha512-Ous0vodHa56FviZucS2E63zkgtgrACj7omjwd/8lTEMEPFFyjfixMZ1ZXenpgCFBBt4EC1J2XsyVS2gkG0eTFA==} + typed-array-byte-offset@1.0.3: + resolution: {integrity: sha512-GsvTyUHTriq6o/bHcTd0vM7OQ9JEdlvluu9YISaA7+KzDzPaIzEeDFNkTfhdE3MYcNhNi0vq/LlegYgIs5yPAw==} engines: {node: '>= 0.4'} - typed-array-length@1.0.6: - resolution: {integrity: sha512-/OxDN6OtAk5KBpGb28T+HZc2M+ADtvRxXrKKbUwtsLgdoxgX13hyy7ek6bFRl5+aBs2yZzB0c4CnQfAtVypW/g==} + typed-array-length@1.0.7: + resolution: {integrity: sha512-3KS2b+kL7fsuk/eJZ7EQdnEmQoaho/r6KUef7hxvltNA5DR8NAUM+8wJMbJyZ4G9/7i3v5zPBIMN5aybAh2/Jg==} engines: {node: '>= 0.4'} typedarray-to-buffer@3.1.5: @@ -8901,8 +9348,8 @@ packages: typedarray@0.0.6: resolution: {integrity: sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==} - typedoc@0.26.8: - resolution: {integrity: sha512-QBF0BMbnNeUc6U7pRHY7Jb8pjhmiNWZNQT8LU6uk9qP9t3goP9bJptdlNqMC0wBB2w9sQrxjZt835bpRSSq1LA==} + typedoc@0.26.11: + resolution: {integrity: sha512-sFEgRRtrcDl2FxVP58Ze++ZK2UQAEvtvvH8rRlig1Ja3o7dDaMHmaBfvJmdGnNEFaLTpQsN8dpvZaTqJSu/Ugw==} engines: {node: '>= 18'} hasBin: true peerDependencies: @@ -8999,9 +9446,6 @@ packages: unbox-primitive@1.0.2: resolution: {integrity: sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==} - undici-types@5.26.5: - resolution: {integrity: sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==} - undici-types@6.19.8: resolution: {integrity: sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==} @@ -9124,8 +9568,8 @@ packages: resolution: {integrity: sha512-PYxZDA+6QtvRvm//++aGdmKG/cI07jNwbROz0Ql+VzFV1+Z0Dy55NI4zZ7RHc9KKpBePNFwoErqIuqQv/cjiTA==} engines: {node: '>= 0.12.0'} - utility@2.1.0: - resolution: {integrity: sha512-EW1SiTanYlo91u304Rka3hEYqWmewWvZoljL1qu6Yju7PdCIhPEVMHYH/jSoCV6nZSw4dozeVDDkjWQ0/0bRmQ==} + utility@2.2.0: + resolution: {integrity: sha512-ujZh7W8xSr2QYUAhagadUTs6S+RBMLb6Qv/xZSnRrqpYN1LKmhdgDJdKsb1phr30u+liMN69af3AKD3Nj2+F+w==} engines: {node: '>= 16.0.0'} utils-merge@1.0.1: @@ -9196,13 +9640,13 @@ packages: walker@1.0.8: resolution: {integrity: sha512-ts/8E8l5b7kY0vlWLewOkDXMmPdLcVV4GmOQLyxuSswIJsweeFZtAsMF7k1Nszz+TYBQrlYRmzOnr398y1JemQ==} + watchpack@2.4.2: + resolution: {integrity: sha512-TnbFSbcOCcDgjZ4piURLCbJ3nJhznVh9kw6F6iokjiFPl8ONxe9A6nMDVXDiNbrSfLILs6vB07F7wLBrwPYzJw==} + engines: {node: '>=10.13.0'} + wcwidth@1.0.1: resolution: {integrity: sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg==} - web-streams-polyfill@3.3.3: - resolution: {integrity: sha512-d2JWLCivmZYTSIoge9MsgFCZrt571BikcWGYkjC1khllbTeDlGqZ2D8vD8E/lJa8WGWbb7Plm8/XJYV7IJHZZw==} - engines: {node: '>= 8'} - webidl-conversions@3.0.1: resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==} @@ -9210,9 +9654,19 @@ packages: resolution: {integrity: sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==} engines: {node: '>=12'} - webpod@0.0.2: - resolution: {integrity: sha512-cSwwQIeg8v4i3p4ajHhwgR7N6VyxAf+KYSSsY6Pd3aETE+xEU4vbitz7qQkB0I321xnhDdgtxuiSfk5r/FVtjg==} + webpack-sources@3.2.3: + resolution: {integrity: sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w==} + engines: {node: '>=10.13.0'} + + webpack@5.97.1: + resolution: {integrity: sha512-EksG6gFY3L1eFMROS/7Wzgrii5mBAFe4rIr3r2BTfo7bcc+DWwFZ4OJ/miOuHJO/A85HwyI4eQ0F6IKXesO7Fg==} + engines: {node: '>=10.13.0'} hasBin: true + peerDependencies: + webpack-cli: '*' + peerDependenciesMeta: + webpack-cli: + optional: true whatwg-url@13.0.0: resolution: {integrity: sha512-9WWbymnqj57+XEuqADHrCJ2eSXzn8WXIW/YSGaZtb2WKAInQ6CHfaUUcTyyver0p8BDg5StLQq8h1vtZuwmOig==} @@ -9221,8 +9675,13 @@ packages: whatwg-url@5.0.0: resolution: {integrity: sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==} - which-boxed-primitive@1.0.2: - resolution: {integrity: sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==} + which-boxed-primitive@1.1.0: + resolution: {integrity: sha512-Ei7Miu/AXe2JJ4iNF5j/UphAgRoma4trE6PtisM09bPygb3egMH3YLW/befsWb1A1AxvNSFidOFTB18XtnIIng==} + engines: {node: '>= 0.4'} + + which-builtin-type@1.2.1: + resolution: {integrity: sha512-6iBczoX+kDQ7a3+YJBnh3T+KZRxM/iYNPXicqk66/Qfm1b93iu+yOImkg0zHbj5LNOcNv1TEADiZ0xa34B4q6Q==} + engines: {node: '>= 0.4'} which-collection@1.0.2: resolution: {integrity: sha512-K4jVyjnBdgvc86Y6BkaLZEN933SwYOuBFkdmBu9ZfkcAbdVbpITnDmjvZ/aQjRXQrv5EPkTnD1s39GiiqbngCw==} @@ -9231,8 +9690,8 @@ packages: which-module@2.0.1: resolution: {integrity: sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ==} - which-typed-array@1.1.15: - resolution: {integrity: sha512-oV0jmFtUky6CXfkqehVvBP/LSWJ2sy4vWMioiENyJLePrBO/yKyV9OyJySfAKosh+RYkIl5zJCNZ8/4JncrpdA==} + which-typed-array@1.1.16: + resolution: {integrity: sha512-g+N+GAWiRj66DngFwHvISJd+ITsyphZvD1vChfVg6cEdnzy53GzB3oy0fUNlvhz7H7+MiqhYr26qxQShCpKTTQ==} engines: {node: '>= 0.4'} which@1.3.1: @@ -9244,11 +9703,6 @@ packages: engines: {node: '>= 8'} hasBin: true - which@3.0.1: - resolution: {integrity: sha512-XA1b62dzQzLfaEOSQFTCOd5KFf/1VSzZo7/7TUjnya6u0vGGKzU96UQBZTAThCb2j4/xjBAyii1OhRLJEivHvg==} - engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - hasBin: true - which@4.0.0: resolution: {integrity: sha512-GlaYyEb07DPxYCKhKzplCWBJtvxZcZMrL+4UkrTSJHHPyZU4mYYTv3qaOe77H7EODLSSopAUFAc6W8U4yqvscg==} engines: {node: ^16.13.0 || >=18.0.0} @@ -9415,8 +9869,8 @@ packages: yallist@4.0.0: resolution: {integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==} - yaml@2.5.1: - resolution: {integrity: sha512-bLQOjaX/ADgQ20isPJRvF0iRUHIxVhYvr53Of7wGcWlO2jvtUlH5m87DsmulFVxRpNLOnI4tB6p/oh8D7kpn9Q==} + yaml@2.6.1: + resolution: {integrity: sha512-7r0XPzioN/Q9kXBro/XPnA6kznR73DHq+GXh5ON7ZozRO6aMjbmiBuKste2wslTFkC5d1dw0GooOCepZXJ2SAg==} engines: {node: '>= 14'} hasBin: true @@ -9457,6 +9911,10 @@ packages: resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} engines: {node: '>=10'} + yocto-queue@1.1.1: + resolution: {integrity: sha512-b4JR1PFR10y1mKjhHY9LaGo6tmrgjit7hxVIeAmyMw3jegXR4dhYqLaQF5zMXZxY7tLpMyJeLjr1C4rLmkVe8g==} + engines: {node: '>=12.20'} + zlogger@1.1.0: resolution: {integrity: sha512-WjRPkjHe4rajXun45zZRAnViTSLkIr2PEFI303u+3NYIkhWqxhpTr0j67XPzhTJMmDH27pGoTSxGg/qP8FiaJA==} engines: {node: '>=4.3.1'} @@ -9464,9 +9922,9 @@ packages: zwitch@2.0.4: resolution: {integrity: sha512-bXE4cR/kVZhKZX/RjPEflHaKVhUVl85noU3v6b8apfQEc1x4A+zBxjZ4lN8LqGd6WZ3dl98pY4o717VFmoPp+A==} - zx@7.2.3: - resolution: {integrity: sha512-QODu38nLlYXg/B/Gw7ZKiZrvPkEsjPN3LQ5JFXM7h0JvwhEdPNNl+4Ao1y4+o3CLNiDUNcwzQYZ4/Ko7kKzCMA==} - engines: {node: '>= 16.0.0'} + zx@8.2.2: + resolution: {integrity: sha512-HSIdpU5P2ONI0nssnhsUZNCH9Sd/Z8LIFk9n8QTbu6JufzJx7qR7ajrMN21s06JqWSApcN012377iWsv8Vs5bg==} + engines: {node: '>= 12.17.0'} hasBin: true snapshots: @@ -9474,282 +9932,275 @@ snapshots: '@acuminous/bitsyntax@0.1.2': dependencies: buffer-more-ints: 1.0.0 - debug: 4.3.7 + debug: 4.4.0 safe-buffer: 5.1.2 transitivePeerDependencies: - supports-color '@ampproject/remapping@2.3.0': dependencies: - '@jridgewell/gen-mapping': 0.3.5 + '@jridgewell/gen-mapping': 0.3.8 '@jridgewell/trace-mapping': 0.3.25 '@assemblyscript/loader@0.19.23': {} '@babel/code-frame@7.12.11': dependencies: - '@babel/highlight': 7.25.7 + '@babel/highlight': 7.25.9 - '@babel/code-frame@7.25.7': + '@babel/code-frame@7.26.2': dependencies: - '@babel/highlight': 7.25.7 - picocolors: 1.1.0 + '@babel/helper-validator-identifier': 7.25.9 + js-tokens: 4.0.0 + picocolors: 1.1.1 - '@babel/compat-data@7.25.7': {} + '@babel/compat-data@7.26.3': {} - '@babel/core@7.25.7': + '@babel/core@7.26.0': dependencies: '@ampproject/remapping': 2.3.0 - '@babel/code-frame': 7.25.7 - '@babel/generator': 7.25.7 - '@babel/helper-compilation-targets': 7.25.7 - '@babel/helper-module-transforms': 7.25.7(@babel/core@7.25.7) - '@babel/helpers': 7.25.7 - '@babel/parser': 7.25.7 - '@babel/template': 7.25.7 - '@babel/traverse': 7.25.7 - '@babel/types': 7.25.7 + '@babel/code-frame': 7.26.2 + '@babel/generator': 7.26.3 + '@babel/helper-compilation-targets': 7.25.9 + '@babel/helper-module-transforms': 7.26.0(@babel/core@7.26.0) + '@babel/helpers': 7.26.0 + '@babel/parser': 7.26.3 + '@babel/template': 7.25.9 + '@babel/traverse': 7.26.4 + '@babel/types': 7.26.3 convert-source-map: 2.0.0 - debug: 4.3.7 + debug: 4.4.0 gensync: 1.0.0-beta.2 json5: 2.2.3 semver: 6.3.1 transitivePeerDependencies: - supports-color - '@babel/generator@7.25.7': + '@babel/generator@7.26.3': dependencies: - '@babel/types': 7.25.7 - '@jridgewell/gen-mapping': 0.3.5 + '@babel/parser': 7.26.3 + '@babel/types': 7.26.3 + '@jridgewell/gen-mapping': 0.3.8 '@jridgewell/trace-mapping': 0.3.25 - jsesc: 3.0.2 + jsesc: 3.1.0 - '@babel/helper-annotate-as-pure@7.25.7': + '@babel/helper-annotate-as-pure@7.25.9': dependencies: - '@babel/types': 7.25.7 + '@babel/types': 7.26.3 - '@babel/helper-compilation-targets@7.25.7': + '@babel/helper-compilation-targets@7.25.9': dependencies: - '@babel/compat-data': 7.25.7 - '@babel/helper-validator-option': 7.25.7 - browserslist: 4.24.0 + '@babel/compat-data': 7.26.3 + '@babel/helper-validator-option': 7.25.9 + browserslist: 4.24.3 lru-cache: 5.1.1 semver: 6.3.1 - '@babel/helper-create-class-features-plugin@7.25.7(@babel/core@7.25.7)': + '@babel/helper-create-class-features-plugin@7.25.9(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.7 - '@babel/helper-annotate-as-pure': 7.25.7 - '@babel/helper-member-expression-to-functions': 7.25.7 - '@babel/helper-optimise-call-expression': 7.25.7 - '@babel/helper-replace-supers': 7.25.7(@babel/core@7.25.7) - '@babel/helper-skip-transparent-expression-wrappers': 7.25.7 - '@babel/traverse': 7.25.7 + '@babel/core': 7.26.0 + '@babel/helper-annotate-as-pure': 7.25.9 + '@babel/helper-member-expression-to-functions': 7.25.9 + '@babel/helper-optimise-call-expression': 7.25.9 + '@babel/helper-replace-supers': 7.25.9(@babel/core@7.26.0) + '@babel/helper-skip-transparent-expression-wrappers': 7.25.9 + '@babel/traverse': 7.26.4 semver: 6.3.1 transitivePeerDependencies: - supports-color - '@babel/helper-member-expression-to-functions@7.25.7': + '@babel/helper-member-expression-to-functions@7.25.9': dependencies: - '@babel/traverse': 7.25.7 - '@babel/types': 7.25.7 + '@babel/traverse': 7.26.4 + '@babel/types': 7.26.3 transitivePeerDependencies: - supports-color - '@babel/helper-module-imports@7.25.7': + '@babel/helper-module-imports@7.25.9': dependencies: - '@babel/traverse': 7.25.7 - '@babel/types': 7.25.7 + '@babel/traverse': 7.26.4 + '@babel/types': 7.26.3 transitivePeerDependencies: - supports-color - '@babel/helper-module-transforms@7.25.7(@babel/core@7.25.7)': + '@babel/helper-module-transforms@7.26.0(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.7 - '@babel/helper-module-imports': 7.25.7 - '@babel/helper-simple-access': 7.25.7 - '@babel/helper-validator-identifier': 7.25.7 - '@babel/traverse': 7.25.7 + '@babel/core': 7.26.0 + '@babel/helper-module-imports': 7.25.9 + '@babel/helper-validator-identifier': 7.25.9 + '@babel/traverse': 7.26.4 transitivePeerDependencies: - supports-color - '@babel/helper-optimise-call-expression@7.25.7': + '@babel/helper-optimise-call-expression@7.25.9': dependencies: - '@babel/types': 7.25.7 + '@babel/types': 7.26.3 - '@babel/helper-plugin-utils@7.25.7': {} + '@babel/helper-plugin-utils@7.25.9': {} - '@babel/helper-replace-supers@7.25.7(@babel/core@7.25.7)': + '@babel/helper-replace-supers@7.25.9(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.7 - '@babel/helper-member-expression-to-functions': 7.25.7 - '@babel/helper-optimise-call-expression': 7.25.7 - '@babel/traverse': 7.25.7 + '@babel/core': 7.26.0 + '@babel/helper-member-expression-to-functions': 7.25.9 + '@babel/helper-optimise-call-expression': 7.25.9 + '@babel/traverse': 7.26.4 transitivePeerDependencies: - supports-color - '@babel/helper-simple-access@7.25.7': + '@babel/helper-skip-transparent-expression-wrappers@7.25.9': dependencies: - '@babel/traverse': 7.25.7 - '@babel/types': 7.25.7 + '@babel/traverse': 7.26.4 + '@babel/types': 7.26.3 transitivePeerDependencies: - supports-color - '@babel/helper-skip-transparent-expression-wrappers@7.25.7': - dependencies: - '@babel/traverse': 7.25.7 - '@babel/types': 7.25.7 - transitivePeerDependencies: - - supports-color - - '@babel/helper-string-parser@7.25.7': {} + '@babel/helper-string-parser@7.25.9': {} - '@babel/helper-validator-identifier@7.25.7': {} + '@babel/helper-validator-identifier@7.25.9': {} - '@babel/helper-validator-option@7.25.7': {} + '@babel/helper-validator-option@7.25.9': {} - '@babel/helpers@7.25.7': + '@babel/helpers@7.26.0': dependencies: - '@babel/template': 7.25.7 - '@babel/types': 7.25.7 + '@babel/template': 7.25.9 + '@babel/types': 7.26.3 - '@babel/highlight@7.25.7': + '@babel/highlight@7.25.9': dependencies: - '@babel/helper-validator-identifier': 7.25.7 + '@babel/helper-validator-identifier': 7.25.9 chalk: 2.4.2 js-tokens: 4.0.0 - picocolors: 1.1.0 + picocolors: 1.1.1 - '@babel/parser@7.25.7': + '@babel/parser@7.26.3': dependencies: - '@babel/types': 7.25.7 + '@babel/types': 7.26.3 - '@babel/plugin-proposal-decorators@7.24.7(@babel/core@7.25.7)': + '@babel/plugin-proposal-decorators@7.24.7(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.7 - '@babel/helper-create-class-features-plugin': 7.25.7(@babel/core@7.25.7) - '@babel/helper-plugin-utils': 7.25.7 - '@babel/plugin-syntax-decorators': 7.25.7(@babel/core@7.25.7) + '@babel/core': 7.26.0 + '@babel/helper-create-class-features-plugin': 7.25.9(@babel/core@7.26.0) + '@babel/helper-plugin-utils': 7.25.9 + '@babel/plugin-syntax-decorators': 7.25.9(@babel/core@7.26.0) transitivePeerDependencies: - supports-color - '@babel/plugin-syntax-async-generators@7.8.4(@babel/core@7.25.7)': + '@babel/plugin-syntax-async-generators@7.8.4(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.7 - '@babel/helper-plugin-utils': 7.25.7 + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.25.9 - '@babel/plugin-syntax-bigint@7.8.3(@babel/core@7.25.7)': + '@babel/plugin-syntax-bigint@7.8.3(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.7 - '@babel/helper-plugin-utils': 7.25.7 + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.25.9 - '@babel/plugin-syntax-class-properties@7.12.13(@babel/core@7.25.7)': + '@babel/plugin-syntax-class-properties@7.12.13(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.7 - '@babel/helper-plugin-utils': 7.25.7 + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.25.9 - '@babel/plugin-syntax-class-static-block@7.14.5(@babel/core@7.25.7)': + '@babel/plugin-syntax-class-static-block@7.14.5(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.7 - '@babel/helper-plugin-utils': 7.25.7 + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.25.9 - '@babel/plugin-syntax-decorators@7.25.7(@babel/core@7.25.7)': + '@babel/plugin-syntax-decorators@7.25.9(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.7 - '@babel/helper-plugin-utils': 7.25.7 + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.25.9 - '@babel/plugin-syntax-import-attributes@7.25.7(@babel/core@7.25.7)': + '@babel/plugin-syntax-import-attributes@7.26.0(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.7 - '@babel/helper-plugin-utils': 7.25.7 + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.25.9 - '@babel/plugin-syntax-import-meta@7.10.4(@babel/core@7.25.7)': + '@babel/plugin-syntax-import-meta@7.10.4(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.7 - '@babel/helper-plugin-utils': 7.25.7 + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.25.9 - '@babel/plugin-syntax-json-strings@7.8.3(@babel/core@7.25.7)': + '@babel/plugin-syntax-json-strings@7.8.3(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.7 - '@babel/helper-plugin-utils': 7.25.7 + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.25.9 - '@babel/plugin-syntax-jsx@7.25.7(@babel/core@7.25.7)': + '@babel/plugin-syntax-jsx@7.25.9(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.7 - '@babel/helper-plugin-utils': 7.25.7 + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.25.9 - '@babel/plugin-syntax-logical-assignment-operators@7.10.4(@babel/core@7.25.7)': + '@babel/plugin-syntax-logical-assignment-operators@7.10.4(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.7 - '@babel/helper-plugin-utils': 7.25.7 + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.25.9 - '@babel/plugin-syntax-nullish-coalescing-operator@7.8.3(@babel/core@7.25.7)': + '@babel/plugin-syntax-nullish-coalescing-operator@7.8.3(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.7 - '@babel/helper-plugin-utils': 7.25.7 + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.25.9 - '@babel/plugin-syntax-numeric-separator@7.10.4(@babel/core@7.25.7)': + '@babel/plugin-syntax-numeric-separator@7.10.4(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.7 - '@babel/helper-plugin-utils': 7.25.7 + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.25.9 - '@babel/plugin-syntax-object-rest-spread@7.8.3(@babel/core@7.25.7)': + '@babel/plugin-syntax-object-rest-spread@7.8.3(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.7 - '@babel/helper-plugin-utils': 7.25.7 + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.25.9 - '@babel/plugin-syntax-optional-catch-binding@7.8.3(@babel/core@7.25.7)': + '@babel/plugin-syntax-optional-catch-binding@7.8.3(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.7 - '@babel/helper-plugin-utils': 7.25.7 + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.25.9 - '@babel/plugin-syntax-optional-chaining@7.8.3(@babel/core@7.25.7)': + '@babel/plugin-syntax-optional-chaining@7.8.3(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.7 - '@babel/helper-plugin-utils': 7.25.7 + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.25.9 - '@babel/plugin-syntax-private-property-in-object@7.14.5(@babel/core@7.25.7)': + '@babel/plugin-syntax-private-property-in-object@7.14.5(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.7 - '@babel/helper-plugin-utils': 7.25.7 + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.25.9 - '@babel/plugin-syntax-top-level-await@7.14.5(@babel/core@7.25.7)': + '@babel/plugin-syntax-top-level-await@7.14.5(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.7 - '@babel/helper-plugin-utils': 7.25.7 + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.25.9 - '@babel/plugin-syntax-typescript@7.25.7(@babel/core@7.25.7)': + '@babel/plugin-syntax-typescript@7.25.9(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.7 - '@babel/helper-plugin-utils': 7.25.7 + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.25.9 - '@babel/runtime@7.25.7': + '@babel/runtime@7.26.0': dependencies: regenerator-runtime: 0.14.1 - '@babel/template@7.25.7': + '@babel/template@7.25.9': dependencies: - '@babel/code-frame': 7.25.7 - '@babel/parser': 7.25.7 - '@babel/types': 7.25.7 + '@babel/code-frame': 7.26.2 + '@babel/parser': 7.26.3 + '@babel/types': 7.26.3 - '@babel/traverse@7.25.7': + '@babel/traverse@7.26.4': dependencies: - '@babel/code-frame': 7.25.7 - '@babel/generator': 7.25.7 - '@babel/parser': 7.25.7 - '@babel/template': 7.25.7 - '@babel/types': 7.25.7 - debug: 4.3.7 + '@babel/code-frame': 7.26.2 + '@babel/generator': 7.26.3 + '@babel/parser': 7.26.3 + '@babel/template': 7.25.9 + '@babel/types': 7.26.3 + debug: 4.4.0 globals: 11.12.0 transitivePeerDependencies: - supports-color - '@babel/types@7.25.7': + '@babel/types@7.26.3': dependencies: - '@babel/helper-string-parser': 7.25.7 - '@babel/helper-validator-identifier': 7.25.7 - to-fast-properties: 2.0.0 + '@babel/helper-string-parser': 7.25.9 + '@babel/helper-validator-identifier': 7.25.9 '@bcoe/v8-coverage@0.2.3': {} @@ -9790,17 +10241,22 @@ snapshots: transitivePeerDependencies: - supports-color - '@eslint-community/eslint-utils@4.4.0(eslint@7.32.0)': + '@emnapi/runtime@1.3.1': + dependencies: + tslib: 2.8.1 + optional: true + + '@eslint-community/eslint-utils@4.4.1(eslint@7.32.0)': dependencies: eslint: 7.32.0 eslint-visitor-keys: 3.4.3 - '@eslint-community/regexpp@4.11.1': {} + '@eslint-community/regexpp@4.12.1': {} '@eslint/eslintrc@0.4.3': dependencies: ajv: 6.12.6 - debug: 4.3.7 + debug: 4.4.0 espree: 7.3.1 globals: 13.24.0 ignore: 4.0.6 @@ -9836,7 +10292,7 @@ snapshots: '@humanwhocodes/config-array@0.5.0': dependencies: '@humanwhocodes/object-schema': 1.2.1 - debug: 4.3.7 + debug: 4.4.0 minimatch: 3.1.2 transitivePeerDependencies: - supports-color @@ -9845,6 +10301,81 @@ snapshots: '@hutson/parse-repository-url@3.0.2': {} + '@img/sharp-darwin-arm64@0.33.5': + optionalDependencies: + '@img/sharp-libvips-darwin-arm64': 1.0.4 + optional: true + + '@img/sharp-darwin-x64@0.33.5': + optionalDependencies: + '@img/sharp-libvips-darwin-x64': 1.0.4 + optional: true + + '@img/sharp-libvips-darwin-arm64@1.0.4': + optional: true + + '@img/sharp-libvips-darwin-x64@1.0.4': + optional: true + + '@img/sharp-libvips-linux-arm64@1.0.4': + optional: true + + '@img/sharp-libvips-linux-arm@1.0.5': + optional: true + + '@img/sharp-libvips-linux-s390x@1.0.4': + optional: true + + '@img/sharp-libvips-linux-x64@1.0.4': + optional: true + + '@img/sharp-libvips-linuxmusl-arm64@1.0.4': + optional: true + + '@img/sharp-libvips-linuxmusl-x64@1.0.4': + optional: true + + '@img/sharp-linux-arm64@0.33.5': + optionalDependencies: + '@img/sharp-libvips-linux-arm64': 1.0.4 + optional: true + + '@img/sharp-linux-arm@0.33.5': + optionalDependencies: + '@img/sharp-libvips-linux-arm': 1.0.5 + optional: true + + '@img/sharp-linux-s390x@0.33.5': + optionalDependencies: + '@img/sharp-libvips-linux-s390x': 1.0.4 + optional: true + + '@img/sharp-linux-x64@0.33.5': + optionalDependencies: + '@img/sharp-libvips-linux-x64': 1.0.4 + optional: true + + '@img/sharp-linuxmusl-arm64@0.33.5': + optionalDependencies: + '@img/sharp-libvips-linuxmusl-arm64': 1.0.4 + optional: true + + '@img/sharp-linuxmusl-x64@0.33.5': + optionalDependencies: + '@img/sharp-libvips-linuxmusl-x64': 1.0.4 + optional: true + + '@img/sharp-wasm32@0.33.5': + dependencies: + '@emnapi/runtime': 1.3.1 + optional: true + + '@img/sharp-win32-ia32@0.33.5': + optional: true + + '@img/sharp-win32-x64@0.33.5': + optional: true + '@ioredis/commands@1.2.0': {} '@isaacs/cliui@8.0.2': @@ -10001,7 +10532,7 @@ snapshots: '@jest/transform@29.7.0': dependencies: - '@babel/core': 7.25.7 + '@babel/core': 7.26.0 '@jest/types': 29.6.3 '@jridgewell/trace-mapping': 0.3.25 babel-plugin-istanbul: 6.1.1 @@ -10028,7 +10559,7 @@ snapshots: '@types/yargs': 17.0.33 chalk: 4.1.2 - '@jridgewell/gen-mapping@0.3.5': + '@jridgewell/gen-mapping@0.3.8': dependencies: '@jridgewell/set-array': 1.2.1 '@jridgewell/sourcemap-codec': 1.5.0 @@ -10038,6 +10569,11 @@ snapshots: '@jridgewell/set-array@1.2.1': {} + '@jridgewell/source-map@0.3.6': + dependencies: + '@jridgewell/gen-mapping': 0.3.8 + '@jridgewell/trace-mapping': 0.3.25 + '@jridgewell/sourcemap-codec@1.5.0': {} '@jridgewell/trace-mapping@0.3.25': @@ -10058,7 +10594,7 @@ snapshots: '@koa/router@12.0.2': dependencies: - debug: 4.3.7 + debug: 4.4.0 http-errors: 2.0.0 koa-compose: 4.1.0 methods: 1.1.2 @@ -10141,6 +10677,12 @@ snapshots: - supports-color - typescript + '@midwayjs/bull@3.19.1': + dependencies: + bull: 4.16.4 + transitivePeerDependencies: + - supports-color + '@midwayjs/cookies@1.2.0': dependencies: scmp: 2.1.0 @@ -10247,6 +10789,32 @@ snapshots: '@msgpackr-extract/msgpackr-extract-win32-x64@3.0.3': optional: true + '@next/env@15.0.4': {} + + '@next/swc-darwin-arm64@15.0.4': + optional: true + + '@next/swc-darwin-x64@15.0.4': + optional: true + + '@next/swc-linux-arm64-gnu@15.0.4': + optional: true + + '@next/swc-linux-arm64-musl@15.0.4': + optional: true + + '@next/swc-linux-x64-gnu@15.0.4': + optional: true + + '@next/swc-linux-x64-musl@15.0.4': + optional: true + + '@next/swc-win32-arm64-msvc@15.0.4': + optional: true + + '@next/swc-win32-x64-msvc@15.0.4': + optional: true + '@nodelib/fs.scandir@2.1.5': dependencies: '@nodelib/fs.stat': 2.0.5 @@ -10263,11 +10831,11 @@ snapshots: '@npmcli/agent@2.2.2': dependencies: - agent-base: 7.1.1 + agent-base: 7.1.3 http-proxy-agent: 7.0.2 - https-proxy-agent: 7.0.5 + https-proxy-agent: 7.0.6 lru-cache: 10.4.3 - socks-proxy-agent: 8.0.4 + socks-proxy-agent: 8.0.5 transitivePeerDependencies: - supports-color @@ -10316,7 +10884,7 @@ snapshots: dependencies: '@npmcli/node-gyp': 3.0.0 '@npmcli/promise-spawn': 7.0.2 - node-gyp: 10.2.0 + node-gyp: 10.3.1 read-package-json-fast: 3.0.2 which: 4.0.0 transitivePeerDependencies: @@ -10331,7 +10899,7 @@ snapshots: '@nrwl/tao@16.10.0': dependencies: nx: 16.10.0 - tslib: 2.7.0 + tslib: 2.8.1 transitivePeerDependencies: - '@swc-node/register' - '@swc/core' @@ -10340,7 +10908,7 @@ snapshots: '@nrwl/tao@18.3.5': dependencies: nx: 18.3.5 - tslib: 2.7.0 + tslib: 2.8.1 transitivePeerDependencies: - '@swc-node/register' - '@swc/core' @@ -10355,7 +10923,7 @@ snapshots: nx: 18.3.5 semver: 7.6.3 tmp: 0.2.3 - tslib: 2.7.0 + tslib: 2.8.1 yargs-parser: 21.1.1 '@nx/nx-darwin-arm64@16.10.0': @@ -10586,7 +11154,7 @@ snapshots: '@opentelemetry/api': 1.9.0 '@opentelemetry/api-logs': 0.53.0 '@types/shimmer': 1.2.0 - import-in-the-middle: 1.11.2 + import-in-the-middle: 1.11.3 require-in-the-middle: 7.4.0 semver: 7.6.3 shimmer: 1.2.1 @@ -10691,7 +11259,7 @@ snapshots: '@parcel/watcher@2.0.4': dependencies: node-addon-api: 3.2.1 - node-gyp-build: 4.8.2 + node-gyp-build: 4.8.4 '@pkgjs/parseargs@0.11.0': optional: true @@ -10719,32 +11287,32 @@ snapshots: '@protobufjs/utf8@1.1.0': {} - '@shikijs/core@1.22.0': + '@shikijs/core@1.24.2': dependencies: - '@shikijs/engine-javascript': 1.22.0 - '@shikijs/engine-oniguruma': 1.22.0 - '@shikijs/types': 1.22.0 - '@shikijs/vscode-textmate': 9.3.0 + '@shikijs/engine-javascript': 1.24.2 + '@shikijs/engine-oniguruma': 1.24.2 + '@shikijs/types': 1.24.2 + '@shikijs/vscode-textmate': 9.3.1 '@types/hast': 3.0.4 - hast-util-to-html: 9.0.3 + hast-util-to-html: 9.0.4 - '@shikijs/engine-javascript@1.22.0': + '@shikijs/engine-javascript@1.24.2': dependencies: - '@shikijs/types': 1.22.0 - '@shikijs/vscode-textmate': 9.3.0 - oniguruma-to-js: 0.4.3 + '@shikijs/types': 1.24.2 + '@shikijs/vscode-textmate': 9.3.1 + oniguruma-to-es: 0.7.0 - '@shikijs/engine-oniguruma@1.22.0': + '@shikijs/engine-oniguruma@1.24.2': dependencies: - '@shikijs/types': 1.22.0 - '@shikijs/vscode-textmate': 9.3.0 + '@shikijs/types': 1.24.2 + '@shikijs/vscode-textmate': 9.3.1 - '@shikijs/types@1.22.0': + '@shikijs/types@1.24.2': dependencies: - '@shikijs/vscode-textmate': 9.3.0 + '@shikijs/vscode-textmate': 9.3.1 '@types/hast': 3.0.4 - '@shikijs/vscode-textmate@9.3.0': {} + '@shikijs/vscode-textmate@9.3.1': {} '@sideway/address@4.1.5': dependencies: @@ -10835,6 +11403,12 @@ snapshots: '@sqltools/formatter@1.2.5': {} + '@swc/counter@0.1.3': {} + + '@swc/helpers@0.5.13': + dependencies: + tslib: 2.8.1 + '@szmarczak/http-timer@1.1.2': dependencies: defer-to-connect: 1.1.3 @@ -10874,7 +11448,7 @@ snapshots: mongoose: 8.7.0(socks@2.8.3) reflect-metadata: 0.2.2 semver: 7.6.3 - tslib: 2.7.0 + tslib: 2.8.1 '@types/accepts@1.3.7': dependencies: @@ -10888,24 +11462,24 @@ snapshots: '@types/babel__core@7.20.5': dependencies: - '@babel/parser': 7.25.7 - '@babel/types': 7.25.7 + '@babel/parser': 7.26.3 + '@babel/types': 7.26.3 '@types/babel__generator': 7.6.8 '@types/babel__template': 7.4.4 '@types/babel__traverse': 7.20.6 '@types/babel__generator@7.6.8': dependencies: - '@babel/types': 7.25.7 + '@babel/types': 7.26.3 '@types/babel__template@7.4.4': dependencies: - '@babel/parser': 7.25.7 - '@babel/types': 7.25.7 + '@babel/parser': 7.26.3 + '@babel/types': 7.26.3 '@types/babel__traverse@7.20.6': dependencies: - '@babel/types': 7.25.7 + '@babel/types': 7.26.3 '@types/body-parser@1.19.5': dependencies: @@ -10947,7 +11521,7 @@ snapshots: dependencies: '@types/ms': 0.7.34 - '@types/depd@1.1.36': + '@types/depd@1.1.37': dependencies: '@types/node': 20.16.10 @@ -10960,6 +11534,18 @@ snapshots: '@types/empower-core': 1.2.4 '@types/power-assert-formatter': 1.4.33 + '@types/eslint-scope@3.7.7': + dependencies: + '@types/eslint': 9.6.1 + '@types/estree': 1.0.6 + + '@types/eslint@9.6.1': + dependencies: + '@types/estree': 1.0.6 + '@types/json-schema': 7.0.15 + + '@types/estree@1.0.6': {} + '@types/express-serve-static-core@4.19.6': dependencies: '@types/node': 20.16.10 @@ -10982,6 +11568,7 @@ snapshots: dependencies: '@types/jsonfile': 6.1.4 '@types/node': 20.16.10 + optional: true '@types/glob@7.2.0': dependencies: @@ -10996,7 +11583,7 @@ snapshots: dependencies: '@types/unist': 3.0.3 - '@types/http-assert@1.5.5': {} + '@types/http-assert@1.5.6': {} '@types/http-errors@2.0.4': {} @@ -11022,6 +11609,7 @@ snapshots: '@types/jsonfile@6.1.4': dependencies: '@types/node': 20.16.10 + optional: true '@types/jsonwebtoken@9.0.7': dependencies: @@ -11046,7 +11634,7 @@ snapshots: '@types/accepts': 1.3.7 '@types/content-disposition': 0.5.8 '@types/cookies': 0.9.0 - '@types/http-assert': 1.5.5 + '@types/http-assert': 1.5.6 '@types/http-errors': 2.0.4 '@types/keygrip': 1.0.6 '@types/koa-compose': 3.2.8 @@ -11070,10 +11658,6 @@ snapshots: '@types/ms@0.7.34': {} - '@types/node@18.19.55': - dependencies: - undici-types: 5.26.5 - '@types/node@20.16.10': dependencies: undici-types: 6.19.8 @@ -11083,15 +11667,15 @@ snapshots: '@types/passport-local@1.0.38': dependencies: '@types/express': 4.17.21 - '@types/passport': 1.0.16 + '@types/passport': 1.0.17 '@types/passport-strategy': 0.2.38 '@types/passport-strategy@0.2.38': dependencies: '@types/express': 4.17.21 - '@types/passport': 1.0.16 + '@types/passport': 1.0.17 - '@types/passport@1.0.16': + '@types/passport@1.0.17': dependencies: '@types/express': 4.17.21 @@ -11102,13 +11686,18 @@ snapshots: '@types/empower': 1.2.35 '@types/power-assert-formatter': 1.4.33 - '@types/ps-tree@1.1.6': {} + '@types/prop-types@15.7.14': {} '@types/qs@6.9.15': {} '@types/range-parser@1.2.7': {} - '@types/readable-stream@4.0.15': + '@types/react@18.3.16': + dependencies: + '@types/prop-types': 15.7.14 + csstype: 3.1.3 + + '@types/readable-stream@4.0.18': dependencies: '@types/node': 20.16.10 safe-buffer: 5.1.2 @@ -11118,7 +11707,7 @@ snapshots: '@types/caseless': 0.12.5 '@types/node': 20.16.10 '@types/tough-cookie': 4.0.5 - form-data: 2.5.1 + form-data: 2.5.2 '@types/responselike@1.0.3': dependencies: @@ -11168,8 +11757,6 @@ snapshots: dependencies: '@types/webidl-conversions': 7.0.3 - '@types/which@3.0.4': {} - '@types/ws@8.5.12': dependencies: '@types/node': 20.16.10 @@ -11182,12 +11769,12 @@ snapshots: '@typescript-eslint/eslint-plugin@5.62.0(@typescript-eslint/parser@5.62.0(eslint@7.32.0)(typescript@5.3.3))(eslint@7.32.0)(typescript@5.3.3)': dependencies: - '@eslint-community/regexpp': 4.11.1 + '@eslint-community/regexpp': 4.12.1 '@typescript-eslint/parser': 5.62.0(eslint@7.32.0)(typescript@5.3.3) '@typescript-eslint/scope-manager': 5.62.0 '@typescript-eslint/type-utils': 5.62.0(eslint@7.32.0)(typescript@5.3.3) '@typescript-eslint/utils': 5.62.0(eslint@7.32.0)(typescript@5.3.3) - debug: 4.3.7 + debug: 4.4.0 eslint: 7.32.0 graphemer: 1.4.0 ignore: 5.3.2 @@ -11204,7 +11791,7 @@ snapshots: '@typescript-eslint/scope-manager': 5.62.0 '@typescript-eslint/types': 5.62.0 '@typescript-eslint/typescript-estree': 5.62.0(typescript@5.3.3) - debug: 4.3.7 + debug: 4.4.0 eslint: 7.32.0 optionalDependencies: typescript: 5.3.3 @@ -11220,7 +11807,7 @@ snapshots: dependencies: '@typescript-eslint/typescript-estree': 5.62.0(typescript@5.3.3) '@typescript-eslint/utils': 5.62.0(eslint@7.32.0)(typescript@5.3.3) - debug: 4.3.7 + debug: 4.4.0 eslint: 7.32.0 tsutils: 3.21.0(typescript@5.3.3) optionalDependencies: @@ -11236,7 +11823,7 @@ snapshots: dependencies: '@typescript-eslint/types': 4.33.0 '@typescript-eslint/visitor-keys': 4.33.0 - debug: 4.3.7 + debug: 4.4.0 globby: 11.1.0 is-glob: 4.0.3 semver: 7.6.3 @@ -11250,7 +11837,7 @@ snapshots: dependencies: '@typescript-eslint/types': 5.62.0 '@typescript-eslint/visitor-keys': 5.62.0 - debug: 4.3.7 + debug: 4.4.0 globby: 11.1.0 is-glob: 4.0.3 semver: 7.6.3 @@ -11264,7 +11851,7 @@ snapshots: dependencies: '@typescript-eslint/types': 5.62.0 '@typescript-eslint/visitor-keys': 5.62.0 - debug: 4.3.7 + debug: 4.4.0 globby: 11.1.0 is-glob: 4.0.3 semver: 7.6.3 @@ -11276,7 +11863,7 @@ snapshots: '@typescript-eslint/utils@5.62.0(eslint@7.32.0)(typescript@5.3.3)': dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@7.32.0) + '@eslint-community/eslint-utils': 4.4.1(eslint@7.32.0) '@types/json-schema': 7.0.15 '@types/semver': 7.5.8 '@typescript-eslint/scope-manager': 5.62.0 @@ -11299,16 +11886,96 @@ snapshots: '@typescript-eslint/types': 5.62.0 eslint-visitor-keys: 3.4.3 - '@ungap/structured-clone@1.2.0': {} + '@ungap/structured-clone@1.2.1': {} '@vercel/ncc@0.38.2': {} + '@webassemblyjs/ast@1.14.1': + dependencies: + '@webassemblyjs/helper-numbers': 1.13.2 + '@webassemblyjs/helper-wasm-bytecode': 1.13.2 + + '@webassemblyjs/floating-point-hex-parser@1.13.2': {} + + '@webassemblyjs/helper-api-error@1.13.2': {} + + '@webassemblyjs/helper-buffer@1.14.1': {} + + '@webassemblyjs/helper-numbers@1.13.2': + dependencies: + '@webassemblyjs/floating-point-hex-parser': 1.13.2 + '@webassemblyjs/helper-api-error': 1.13.2 + '@xtuc/long': 4.2.2 + + '@webassemblyjs/helper-wasm-bytecode@1.13.2': {} + + '@webassemblyjs/helper-wasm-section@1.14.1': + dependencies: + '@webassemblyjs/ast': 1.14.1 + '@webassemblyjs/helper-buffer': 1.14.1 + '@webassemblyjs/helper-wasm-bytecode': 1.13.2 + '@webassemblyjs/wasm-gen': 1.14.1 + + '@webassemblyjs/ieee754@1.13.2': + dependencies: + '@xtuc/ieee754': 1.2.0 + + '@webassemblyjs/leb128@1.13.2': + dependencies: + '@xtuc/long': 4.2.2 + + '@webassemblyjs/utf8@1.13.2': {} + + '@webassemblyjs/wasm-edit@1.14.1': + dependencies: + '@webassemblyjs/ast': 1.14.1 + '@webassemblyjs/helper-buffer': 1.14.1 + '@webassemblyjs/helper-wasm-bytecode': 1.13.2 + '@webassemblyjs/helper-wasm-section': 1.14.1 + '@webassemblyjs/wasm-gen': 1.14.1 + '@webassemblyjs/wasm-opt': 1.14.1 + '@webassemblyjs/wasm-parser': 1.14.1 + '@webassemblyjs/wast-printer': 1.14.1 + + '@webassemblyjs/wasm-gen@1.14.1': + dependencies: + '@webassemblyjs/ast': 1.14.1 + '@webassemblyjs/helper-wasm-bytecode': 1.13.2 + '@webassemblyjs/ieee754': 1.13.2 + '@webassemblyjs/leb128': 1.13.2 + '@webassemblyjs/utf8': 1.13.2 + + '@webassemblyjs/wasm-opt@1.14.1': + dependencies: + '@webassemblyjs/ast': 1.14.1 + '@webassemblyjs/helper-buffer': 1.14.1 + '@webassemblyjs/wasm-gen': 1.14.1 + '@webassemblyjs/wasm-parser': 1.14.1 + + '@webassemblyjs/wasm-parser@1.14.1': + dependencies: + '@webassemblyjs/ast': 1.14.1 + '@webassemblyjs/helper-api-error': 1.13.2 + '@webassemblyjs/helper-wasm-bytecode': 1.13.2 + '@webassemblyjs/ieee754': 1.13.2 + '@webassemblyjs/leb128': 1.13.2 + '@webassemblyjs/utf8': 1.13.2 + + '@webassemblyjs/wast-printer@1.14.1': + dependencies: + '@webassemblyjs/ast': 1.14.1 + '@xtuc/long': 4.2.2 + + '@xtuc/ieee754@1.2.0': {} + + '@xtuc/long@4.2.2': {} + '@yarnpkg/lockfile@1.1.0': {} '@yarnpkg/parsers@3.0.0-rc.46': dependencies: js-yaml: 3.14.1 - tslib: 2.7.0 + tslib: 2.8.1 '@zkochan/js-yaml@0.0.6': dependencies: @@ -11337,9 +12004,9 @@ snapshots: acorn-es7-plugin@1.1.7: {} - acorn-import-attributes@1.9.5(acorn@8.12.1): + acorn-import-attributes@1.9.5(acorn@8.14.0): dependencies: - acorn: 8.12.1 + acorn: 8.14.0 acorn-jsx@5.3.2(acorn@7.4.1): dependencies: @@ -11347,13 +12014,13 @@ snapshots: acorn-walk@8.3.4: dependencies: - acorn: 8.12.1 + acorn: 8.14.0 acorn@5.7.4: {} acorn@7.4.1: {} - acorn@8.12.1: {} + acorn@8.14.0: {} add-stream@1.0.0: {} @@ -11363,15 +12030,11 @@ snapshots: agent-base@6.0.2: dependencies: - debug: 4.3.7 + debug: 4.4.0 transitivePeerDependencies: - supports-color - agent-base@7.1.1: - dependencies: - debug: 4.3.7 - transitivePeerDependencies: - - supports-color + agent-base@7.1.3: {} agentkeepalive@3.5.3: dependencies: @@ -11390,6 +12053,19 @@ snapshots: optionalDependencies: ajv: 7.2.4 + ajv-formats@2.1.1(ajv@8.17.1): + optionalDependencies: + ajv: 8.17.1 + + ajv-keywords@3.5.2(ajv@6.12.6): + dependencies: + ajv: 6.12.6 + + ajv-keywords@5.1.0(ajv@8.17.1): + dependencies: + ajv: 8.17.1 + fast-deep-equal: 3.1.3 + ajv@6.12.6: dependencies: fast-deep-equal: 3.1.3 @@ -11407,7 +12083,7 @@ snapshots: ajv@8.17.1: dependencies: fast-deep-equal: 3.1.3 - fast-uri: 3.0.2 + fast-uri: 3.0.3 json-schema-traverse: 1.0.0 require-from-string: 2.0.2 @@ -11418,7 +12094,7 @@ snapshots: bowser: 1.9.4 copy-to: 2.0.1 dateformat: 2.2.0 - debug: 4.3.7 + debug: 4.4.0 destroy: 1.2.0 end-or-error: 1.0.1 get-ready: 1.0.0 @@ -11518,7 +12194,7 @@ snapshots: array-buffer-byte-length@1.0.1: dependencies: - call-bind: 1.0.7 + call-bind: 1.0.8 is-array-buffer: 3.0.4 array-differ@1.0.0: {} @@ -11544,11 +12220,11 @@ snapshots: arraybuffer.prototype.slice@1.0.3: dependencies: array-buffer-byte-length: 1.0.1 - call-bind: 1.0.7 + call-bind: 1.0.8 define-properties: 1.2.1 - es-abstract: 1.23.3 + es-abstract: 1.23.5 es-errors: 1.3.0 - get-intrinsic: 1.2.4 + get-intrinsic: 1.2.6 is-array-buffer: 3.0.4 is-shared-array-buffer: 1.0.3 @@ -11591,7 +12267,7 @@ snapshots: cli-table3: 0.6.5 color-support: 1.1.3 cross-argv: 2.0.0 - form-data: 4.0.0 + form-data: 4.0.1 has-async-hooks: 1.0.0 hdr-histogram-js: 3.0.0 hdr-histogram-percentiles-obj: 3.0.0 @@ -11631,27 +12307,34 @@ snapshots: axios@1.7.7: dependencies: follow-redirects: 1.15.9 - form-data: 4.0.0 + form-data: 4.0.1 proxy-from-env: 1.1.0 transitivePeerDependencies: - debug - babel-jest@29.7.0(@babel/core@7.25.7): + babel-jest@29.7.0(@babel/core@7.26.0): dependencies: - '@babel/core': 7.25.7 + '@babel/core': 7.26.0 '@jest/transform': 29.7.0 '@types/babel__core': 7.20.5 babel-plugin-istanbul: 6.1.1 - babel-preset-jest: 29.6.3(@babel/core@7.25.7) + babel-preset-jest: 29.6.3(@babel/core@7.26.0) chalk: 4.1.2 graceful-fs: 4.2.11 slash: 3.0.0 transitivePeerDependencies: - supports-color + babel-loader@9.2.1(@babel/core@7.26.0)(webpack@5.97.1): + dependencies: + '@babel/core': 7.26.0 + find-cache-dir: 4.0.0 + schema-utils: 4.3.0 + webpack: 5.97.1 + babel-plugin-istanbul@6.1.1: dependencies: - '@babel/helper-plugin-utils': 7.25.7 + '@babel/helper-plugin-utils': 7.25.9 '@istanbuljs/load-nyc-config': 1.1.0 '@istanbuljs/schema': 0.1.3 istanbul-lib-instrument: 5.2.1 @@ -11661,35 +12344,35 @@ snapshots: babel-plugin-jest-hoist@29.6.3: dependencies: - '@babel/template': 7.25.7 - '@babel/types': 7.25.7 + '@babel/template': 7.25.9 + '@babel/types': 7.26.3 '@types/babel__core': 7.20.5 '@types/babel__traverse': 7.20.6 - babel-preset-current-node-syntax@1.1.0(@babel/core@7.25.7): - dependencies: - '@babel/core': 7.25.7 - '@babel/plugin-syntax-async-generators': 7.8.4(@babel/core@7.25.7) - '@babel/plugin-syntax-bigint': 7.8.3(@babel/core@7.25.7) - '@babel/plugin-syntax-class-properties': 7.12.13(@babel/core@7.25.7) - '@babel/plugin-syntax-class-static-block': 7.14.5(@babel/core@7.25.7) - '@babel/plugin-syntax-import-attributes': 7.25.7(@babel/core@7.25.7) - '@babel/plugin-syntax-import-meta': 7.10.4(@babel/core@7.25.7) - '@babel/plugin-syntax-json-strings': 7.8.3(@babel/core@7.25.7) - '@babel/plugin-syntax-logical-assignment-operators': 7.10.4(@babel/core@7.25.7) - '@babel/plugin-syntax-nullish-coalescing-operator': 7.8.3(@babel/core@7.25.7) - '@babel/plugin-syntax-numeric-separator': 7.10.4(@babel/core@7.25.7) - '@babel/plugin-syntax-object-rest-spread': 7.8.3(@babel/core@7.25.7) - '@babel/plugin-syntax-optional-catch-binding': 7.8.3(@babel/core@7.25.7) - '@babel/plugin-syntax-optional-chaining': 7.8.3(@babel/core@7.25.7) - '@babel/plugin-syntax-private-property-in-object': 7.14.5(@babel/core@7.25.7) - '@babel/plugin-syntax-top-level-await': 7.14.5(@babel/core@7.25.7) - - babel-preset-jest@29.6.3(@babel/core@7.25.7): - dependencies: - '@babel/core': 7.25.7 + babel-preset-current-node-syntax@1.1.0(@babel/core@7.26.0): + dependencies: + '@babel/core': 7.26.0 + '@babel/plugin-syntax-async-generators': 7.8.4(@babel/core@7.26.0) + '@babel/plugin-syntax-bigint': 7.8.3(@babel/core@7.26.0) + '@babel/plugin-syntax-class-properties': 7.12.13(@babel/core@7.26.0) + '@babel/plugin-syntax-class-static-block': 7.14.5(@babel/core@7.26.0) + '@babel/plugin-syntax-import-attributes': 7.26.0(@babel/core@7.26.0) + '@babel/plugin-syntax-import-meta': 7.10.4(@babel/core@7.26.0) + '@babel/plugin-syntax-json-strings': 7.8.3(@babel/core@7.26.0) + '@babel/plugin-syntax-logical-assignment-operators': 7.10.4(@babel/core@7.26.0) + '@babel/plugin-syntax-nullish-coalescing-operator': 7.8.3(@babel/core@7.26.0) + '@babel/plugin-syntax-numeric-separator': 7.10.4(@babel/core@7.26.0) + '@babel/plugin-syntax-object-rest-spread': 7.8.3(@babel/core@7.26.0) + '@babel/plugin-syntax-optional-catch-binding': 7.8.3(@babel/core@7.26.0) + '@babel/plugin-syntax-optional-chaining': 7.8.3(@babel/core@7.26.0) + '@babel/plugin-syntax-private-property-in-object': 7.14.5(@babel/core@7.26.0) + '@babel/plugin-syntax-top-level-await': 7.14.5(@babel/core@7.26.0) + + babel-preset-jest@29.6.3(@babel/core@7.26.0): + dependencies: + '@babel/core': 7.26.0 babel-plugin-jest-hoist: 29.6.3 - babel-preset-current-node-syntax: 1.1.0(@babel/core@7.25.7) + babel-preset-current-node-syntax: 1.1.0(@babel/core@7.26.0) backo2@1.0.2: {} @@ -11717,6 +12400,8 @@ snapshots: before-after-hook@2.2.3: {} + big.js@5.2.2: {} + bignumber.js@9.1.2: {} bindings@1.5.0: @@ -11733,7 +12418,7 @@ snapshots: bl@6.0.16: dependencies: - '@types/readable-stream': 4.0.15 + '@types/readable-stream': 4.0.18 buffer: 6.0.3 inherits: 2.0.4 readable-stream: 4.5.2 @@ -11800,12 +12485,12 @@ snapshots: dependencies: fill-range: 7.1.1 - browserslist@4.24.0: + browserslist@4.24.3: dependencies: - caniuse-lite: 1.0.30001667 - electron-to-chromium: 1.5.33 - node-releases: 2.0.18 - update-browserslist-db: 1.1.1(browserslist@4.24.0) + caniuse-lite: 1.0.30001688 + electron-to-chromium: 1.5.73 + node-releases: 2.0.19 + update-browserslist-db: 1.1.1(browserslist@4.24.3) bs-logger@0.2.6: dependencies: @@ -11815,7 +12500,7 @@ snapshots: dependencies: node-int64: 0.4.0 - bson@6.8.0: {} + bson@6.10.1: {} buffer-equal-constant-time@1.0.1: {} @@ -11853,7 +12538,19 @@ snapshots: get-port: 5.1.1 ioredis: 5.4.1 lodash: 4.17.21 - msgpackr: 1.11.0 + msgpackr: 1.11.2 + semver: 7.6.3 + uuid: 8.3.2 + transitivePeerDependencies: + - supports-color + + bull@4.16.4: + dependencies: + cron-parser: 4.9.0 + get-port: 5.1.1 + ioredis: 5.4.1 + lodash: 4.17.21 + msgpackr: 1.11.2 semver: 7.6.3 uuid: 8.3.2 transitivePeerDependencies: @@ -11962,7 +12659,7 @@ snapshots: cache-manager@6.0.0: dependencies: - keyv: 5.1.0 + keyv: 5.2.2 cacheable-request@6.1.0: dependencies: @@ -11974,14 +12671,23 @@ snapshots: normalize-url: 4.5.1 responselike: 1.0.2 - call-bind@1.0.7: + call-bind-apply-helpers@1.0.1: dependencies: - es-define-property: 1.0.0 es-errors: 1.3.0 function-bind: 1.1.2 - get-intrinsic: 1.2.4 + + call-bind@1.0.8: + dependencies: + call-bind-apply-helpers: 1.0.1 + es-define-property: 1.0.1 + get-intrinsic: 1.2.6 set-function-length: 1.2.2 + call-bound@1.0.2: + dependencies: + call-bind: 1.0.8 + get-intrinsic: 1.2.6 + call-me-maybe@1.0.2: {} call-signature@0.0.2: {} @@ -11991,7 +12697,7 @@ snapshots: camel-case@4.1.2: dependencies: pascal-case: 3.1.2 - tslib: 2.7.0 + tslib: 2.8.1 camelcase-keys@6.2.2: dependencies: @@ -12003,19 +12709,19 @@ snapshots: camelcase@6.3.0: {} - caniuse-lite@1.0.30001667: {} + caniuse-lite@1.0.30001688: {} capital-case@1.0.4: dependencies: no-case: 3.0.4 - tslib: 2.7.0 + tslib: 2.8.1 upper-case-first: 2.0.2 casbin@5.30.0: dependencies: await-lock: 2.2.2 buffer: 6.0.3 - csv-parse: 5.5.6 + csv-parse: 5.6.0 expression-eval: 5.0.1 minimatch: 7.4.6 @@ -12043,8 +12749,6 @@ snapshots: ansi-styles: 4.3.0 supports-color: 7.2.0 - chalk@5.3.0: {} - chan@0.6.1: {} change-case@4.1.2: @@ -12060,7 +12764,7 @@ snapshots: path-case: 3.0.4 sentence-case: 3.0.4 snake-case: 3.0.4 - tslib: 2.7.0 + tslib: 2.8.1 char-regex@1.0.2: {} @@ -12076,6 +12780,8 @@ snapshots: chownr@2.0.0: {} + chrome-trace-event@1.0.4: {} + ci-info@2.0.0: {} ci-info@3.9.0: {} @@ -12084,8 +12790,6 @@ snapshots: cjs-module-lexer@1.4.1: {} - class-transformer@0.5.1: {} - class-utils@0.3.6: dependencies: arr-union: 3.1.0 @@ -12122,6 +12826,8 @@ snapshots: cli-width@3.0.0: {} + client-only@0.0.1: {} + cliui@5.0.0: dependencies: string-width: 3.1.0 @@ -12163,7 +12869,7 @@ snapshots: sdk-base: 4.2.1 serialize-json: 1.0.3 tcp-base: 3.2.0 - utility: 2.1.0 + utility: 2.2.0 transitivePeerDependencies: - supports-color @@ -12194,8 +12900,8 @@ snapshots: coffee@5.5.1: dependencies: - cross-spawn: 6.0.5 - debug: 4.3.7 + cross-spawn: 6.0.6 + debug: 4.4.0 is-type-of: 1.4.0 transitivePeerDependencies: - supports-color @@ -12219,8 +12925,20 @@ snapshots: color-name@1.1.4: {} + color-string@1.9.1: + dependencies: + color-name: 1.1.4 + simple-swizzle: 0.2.2 + optional: true + color-support@1.1.3: {} + color@4.2.3: + dependencies: + color-convert: 2.0.1 + color-string: 1.9.1 + optional: true + colorette@2.0.19: {} columnify@1.6.0: @@ -12251,7 +12969,7 @@ snapshots: chalk: 4.1.2 change-case: 4.1.2 dargs: 7.0.0 - debug: 4.3.7 + debug: 4.4.0 is-type-of: 1.4.0 semver: 7.6.3 yargs: 13.3.2 @@ -12259,6 +12977,8 @@ snapshots: transitivePeerDependencies: - supports-color + common-path-prefix@3.0.0: {} + commondir@1.0.1: {} compare-func@2.0.0: @@ -12315,7 +13035,7 @@ snapshots: constant-case@3.0.4: dependencies: no-case: 3.0.4 - tslib: 2.7.0 + tslib: 2.8.1 upper-case: 2.0.2 consul@1.2.0: @@ -12382,9 +13102,9 @@ snapshots: convert-source-map@2.0.0: {} - cookie-parser@1.4.6: + cookie-parser@1.4.7: dependencies: - cookie: 0.4.1 + cookie: 0.7.2 cookie-signature: 1.0.6 cookie-session@2.1.0: @@ -12400,14 +13120,12 @@ snapshots: cookie-signature@1.0.7: {} - cookie@0.3.1: {} - - cookie@0.4.1: {} - cookie@0.4.2: {} cookie@0.6.0: {} + cookie@0.7.2: {} + cookiejar@2.1.4: {} cookies@0.9.1: @@ -12483,7 +13201,7 @@ snapshots: cross-argv@2.0.0: {} - cross-spawn@6.0.5: + cross-spawn@6.0.6: dependencies: nice-try: 1.0.5 path-key: 2.0.1 @@ -12491,7 +13209,7 @@ snapshots: shebang-command: 1.2.0 which: 1.3.1 - cross-spawn@7.0.3: + cross-spawn@7.0.6: dependencies: path-key: 3.1.1 shebang-command: 2.0.0 @@ -12507,7 +13225,9 @@ snapshots: cssfilter@0.0.10: {} - csv-parse@5.5.6: {} + csstype@3.1.3: {} + + csv-parse@5.6.0: {} dargs@7.0.0: {} @@ -12515,25 +13235,23 @@ snapshots: dependencies: assert-plus: 1.0.0 - data-uri-to-buffer@4.0.1: {} - data-view-buffer@1.0.1: dependencies: - call-bind: 1.0.7 + call-bind: 1.0.8 es-errors: 1.3.0 - is-data-view: 1.0.1 + is-data-view: 1.0.2 data-view-byte-length@1.0.1: dependencies: - call-bind: 1.0.7 + call-bind: 1.0.8 es-errors: 1.3.0 - is-data-view: 1.0.1 + is-data-view: 1.0.2 data-view-byte-offset@1.0.0: dependencies: - call-bind: 1.0.7 + call-bind: 1.0.8 es-errors: 1.3.0 - is-data-view: 1.0.1 + is-data-view: 1.0.2 dataloader@2.2.2: {} @@ -12573,6 +13291,10 @@ snapshots: dependencies: ms: 2.1.3 + debug@4.4.0: + dependencies: + ms: 2.1.3 + decamelize-keys@1.1.1: dependencies: decamelize: 1.2.0 @@ -12599,23 +13321,23 @@ snapshots: deep-equal@2.2.3: dependencies: array-buffer-byte-length: 1.0.1 - call-bind: 1.0.7 + call-bind: 1.0.8 es-get-iterator: 1.1.3 - get-intrinsic: 1.2.4 - is-arguments: 1.1.1 + get-intrinsic: 1.2.6 + is-arguments: 1.2.0 is-array-buffer: 3.0.4 - is-date-object: 1.0.5 - is-regex: 1.1.4 + is-date-object: 1.1.0 + is-regex: 1.2.1 is-shared-array-buffer: 1.0.3 isarray: 2.0.5 object-is: 1.1.6 object-keys: 1.1.1 object.assign: 4.1.5 regexp.prototype.flags: 1.5.3 - side-channel: 1.0.6 - which-boxed-primitive: 1.0.2 + side-channel: 1.1.0 + which-boxed-primitive: 1.1.0 which-collection: 1.0.2 - which-typed-array: 1.1.15 + which-typed-array: 1.1.16 deep-extend@0.6.0: {} @@ -12635,9 +13357,9 @@ snapshots: define-data-property@1.1.4: dependencies: - es-define-property: 1.0.0 + es-define-property: 1.0.1 es-errors: 1.3.0 - gopd: 1.0.1 + gopd: 1.2.0 define-lazy-prop@2.0.0: {} @@ -12675,7 +13397,7 @@ snapshots: dependency-tree@9.0.0: dependencies: commander: 2.20.3 - debug: 4.3.7 + debug: 4.4.0 filing-cabinet: 3.3.1 precinct: 9.2.1 typescript: 4.9.5 @@ -12697,7 +13419,7 @@ snapshots: detect-port@1.6.1: dependencies: address: 1.2.2 - debug: 4.3.7 + debug: 4.4.0 transitivePeerDependencies: - supports-color @@ -12735,7 +13457,7 @@ snapshots: detective-less@1.0.2: dependencies: - debug: 4.3.7 + debug: 4.4.0 gonzales-pe: 4.3.0 node-source-walk: 4.3.0 transitivePeerDependencies: @@ -12743,9 +13465,9 @@ snapshots: detective-postcss@4.0.0: dependencies: - debug: 4.3.7 + debug: 4.4.0 is-url: 1.2.4 - postcss: 8.4.47 + postcss: 8.4.49 postcss-values-parser: 2.0.1 transitivePeerDependencies: - supports-color @@ -12753,8 +13475,8 @@ snapshots: detective-postcss@6.1.3: dependencies: is-url: 1.2.4 - postcss: 8.4.47 - postcss-values-parser: 6.0.2(postcss@8.4.47) + postcss: 8.4.49 + postcss-values-parser: 6.0.2(postcss@8.4.49) detective-sass@3.0.2: dependencies: @@ -12839,7 +13561,7 @@ snapshots: dot-case@3.0.4: dependencies: no-case: 3.0.4 - tslib: 2.7.0 + tslib: 2.8.1 dot-prop@5.3.0: dependencies: @@ -12857,6 +13579,12 @@ snapshots: dottie@2.0.6: {} + dunder-proto@1.0.0: + dependencies: + call-bind-apply-helpers: 1.0.1 + es-errors: 1.3.0 + gopd: 1.2.0 + duplexer3@0.1.5: {} duplexer@0.1.2: {} @@ -12887,7 +13615,7 @@ snapshots: cfork: 1.11.0 cluster-reload: 1.1.0 co: 4.6.0 - debug: 4.3.7 + debug: 4.4.0 depd: 2.0.0 detect-port: 1.6.1 egg-logger: 2.9.1 @@ -12912,10 +13640,10 @@ snapshots: egg-core@4.31.0: dependencies: '@eggjs/router': 2.0.1 - '@types/depd': 1.1.36 + '@types/depd': 1.1.37 '@types/koa': 2.15.0 co: 4.6.0 - debug: 4.3.7 + debug: 4.4.0 depd: 2.0.0 egg-logger: 2.9.1 egg-path-matching: 1.1.0 @@ -12975,7 +13703,7 @@ snapshots: depd: 2.0.0 egg-errors: 2.3.2 iconv-lite: 0.6.3 - utility: 2.1.0 + utility: 2.2.0 egg-logrotator@3.2.0: dependencies: @@ -12989,7 +13717,7 @@ snapshots: await-event: 2.1.0 co: 4.6.0 coffee: 5.5.1 - debug: 4.3.7 + debug: 4.4.0 detect-port: 1.6.1 egg-logger: 2.9.1 egg-utils: 2.5.0 @@ -13020,9 +13748,9 @@ snapshots: stream-wormhole: 1.1.0 uuid: 8.3.2 - egg-onerror@2.2.0: + egg-onerror@2.4.0: dependencies: - cookie: 0.3.1 + cookie: 0.7.2 koa-onerror: 4.2.0 mustache: 2.3.2 stack-trace: 0.0.10 @@ -13047,7 +13775,7 @@ snapshots: dependencies: await-event: 2.1.0 common-bin: 3.0.1 - debug: 4.3.7 + debug: 4.4.0 egg-utils: 2.5.0 moment: 2.30.1 mz: 2.7.0 @@ -13062,7 +13790,7 @@ snapshots: egg-security@2.11.0: dependencies: csrf: 3.1.0 - debug: 4.3.7 + debug: 4.4.0 delegates: 1.0.0 egg-path-matching: 1.1.0 escape-html: 1.0.3 @@ -13087,7 +13815,7 @@ snapshots: egg-socket.io@4.1.6: dependencies: - debug: 4.3.7 + debug: 4.4.0 delegates: 1.0.0 is-type-of: 1.4.0 koa-compose: 4.1.0 @@ -13141,7 +13869,7 @@ snapshots: cache-content-type: 1.0.1 circular-json-for-egg: 1.0.0 cluster-client: 3.7.0 - debug: 4.3.7 + debug: 4.4.0 delegates: 1.0.0 egg-cluster: 1.27.1 egg-cookies: 2.10.1 @@ -13153,7 +13881,7 @@ snapshots: egg-logger: 2.9.1 egg-logrotator: 3.2.0 egg-multipart: 2.13.1 - egg-onerror: 2.2.0 + egg-onerror: 2.4.0 egg-schedule: 3.7.0 egg-security: 2.11.0 egg-session: 3.3.0 @@ -13183,16 +13911,20 @@ snapshots: dependencies: jake: 10.9.2 - electron-to-chromium@1.5.33: {} + electron-to-chromium@1.5.73: {} emittery@0.13.1: {} + emoji-regex-xs@1.0.0: {} + emoji-regex@7.0.3: {} emoji-regex@8.0.0: {} emoji-regex@9.2.2: {} + emojis-list@3.0.0: {} + empower-core@1.2.0: dependencies: call-signature: 0.0.2 @@ -13314,72 +14046,72 @@ snapshots: dependencies: is-arrayish: 0.2.1 - es-abstract@1.23.3: + es-abstract@1.23.5: dependencies: array-buffer-byte-length: 1.0.1 arraybuffer.prototype.slice: 1.0.3 available-typed-arrays: 1.0.7 - call-bind: 1.0.7 + call-bind: 1.0.8 data-view-buffer: 1.0.1 data-view-byte-length: 1.0.1 data-view-byte-offset: 1.0.0 - es-define-property: 1.0.0 + es-define-property: 1.0.1 es-errors: 1.3.0 es-object-atoms: 1.0.0 es-set-tostringtag: 2.0.3 - es-to-primitive: 1.2.1 + es-to-primitive: 1.3.0 function.prototype.name: 1.1.6 - get-intrinsic: 1.2.4 + get-intrinsic: 1.2.6 get-symbol-description: 1.0.2 globalthis: 1.0.4 - gopd: 1.0.1 + gopd: 1.2.0 has-property-descriptors: 1.0.2 - has-proto: 1.0.3 - has-symbols: 1.0.3 + has-proto: 1.2.0 + has-symbols: 1.1.0 hasown: 2.0.2 - internal-slot: 1.0.7 + internal-slot: 1.1.0 is-array-buffer: 3.0.4 is-callable: 1.2.7 - is-data-view: 1.0.1 + is-data-view: 1.0.2 is-negative-zero: 2.0.3 - is-regex: 1.1.4 + is-regex: 1.2.1 is-shared-array-buffer: 1.0.3 - is-string: 1.0.7 + is-string: 1.1.0 is-typed-array: 1.1.13 - is-weakref: 1.0.2 - object-inspect: 1.13.2 + is-weakref: 1.1.0 + object-inspect: 1.13.3 object-keys: 1.1.1 object.assign: 4.1.5 regexp.prototype.flags: 1.5.3 - safe-array-concat: 1.1.2 - safe-regex-test: 1.0.3 - string.prototype.trim: 1.2.9 - string.prototype.trimend: 1.0.8 + safe-array-concat: 1.1.3 + safe-regex-test: 1.1.0 + string.prototype.trim: 1.2.10 + string.prototype.trimend: 1.0.9 string.prototype.trimstart: 1.0.8 typed-array-buffer: 1.0.2 typed-array-byte-length: 1.0.1 - typed-array-byte-offset: 1.0.2 - typed-array-length: 1.0.6 + typed-array-byte-offset: 1.0.3 + typed-array-length: 1.0.7 unbox-primitive: 1.0.2 - which-typed-array: 1.1.15 + which-typed-array: 1.1.16 - es-define-property@1.0.0: - dependencies: - get-intrinsic: 1.2.4 + es-define-property@1.0.1: {} es-errors@1.3.0: {} es-get-iterator@1.1.3: dependencies: - call-bind: 1.0.7 - get-intrinsic: 1.2.4 - has-symbols: 1.0.3 - is-arguments: 1.1.1 + call-bind: 1.0.8 + get-intrinsic: 1.2.6 + has-symbols: 1.1.0 + is-arguments: 1.2.0 is-map: 2.0.3 is-set: 2.0.3 - is-string: 1.0.7 + is-string: 1.1.0 isarray: 2.0.5 - stop-iteration-iterator: 1.0.0 + stop-iteration-iterator: 1.1.0 + + es-module-lexer@1.5.4: {} es-object-atoms@1.0.0: dependencies: @@ -13387,15 +14119,15 @@ snapshots: es-set-tostringtag@2.0.3: dependencies: - get-intrinsic: 1.2.4 + get-intrinsic: 1.2.6 has-tostringtag: 1.0.2 hasown: 2.0.2 - es-to-primitive@1.2.1: + es-to-primitive@1.3.0: dependencies: is-callable: 1.2.7 - is-date-object: 1.0.5 - is-symbol: 1.0.4 + is-date-object: 1.1.0 + is-symbol: 1.1.1 escalade@3.2.0: {} @@ -13434,7 +14166,7 @@ snapshots: eslint-utils: 2.1.0 ignore: 5.3.2 minimatch: 3.1.2 - resolve: 1.22.8 + resolve: 1.22.9 semver: 6.3.1 eslint-plugin-prettier@3.4.1(eslint-config-prettier@8.10.0(eslint@7.32.0))(eslint@7.32.0)(prettier@2.8.8): @@ -13467,8 +14199,8 @@ snapshots: '@humanwhocodes/config-array': 0.5.0 ajv: 6.12.6 chalk: 4.1.2 - cross-spawn: 7.0.3 - debug: 4.3.7 + cross-spawn: 7.0.6 + debug: 4.4.0 doctrine: 3.0.0 enquirer: 2.4.1 escape-string-regexp: 4.0.0 @@ -13499,7 +14231,7 @@ snapshots: semver: 7.6.3 strip-ansi: 6.0.1 strip-json-comments: 3.1.1 - table: 6.8.2 + table: 6.9.0 text-table: 0.2.0 v8-compile-cache: 2.4.0 transitivePeerDependencies: @@ -13562,7 +14294,7 @@ snapshots: execa@5.0.0: dependencies: - cross-spawn: 7.0.3 + cross-spawn: 7.0.6 get-stream: 6.0.0 human-signals: 2.1.0 is-stream: 2.0.0 @@ -13574,7 +14306,7 @@ snapshots: execa@5.1.1: dependencies: - cross-spawn: 7.0.3 + cross-spawn: 7.0.6 get-stream: 6.0.1 human-signals: 2.1.0 is-stream: 2.0.1 @@ -13735,10 +14467,10 @@ snapshots: fast-unique-numbers@8.0.13: dependencies: - '@babel/runtime': 7.25.7 - tslib: 2.7.0 + '@babel/runtime': 7.26.0 + tslib: 2.8.1 - fast-uri@3.0.2: {} + fast-uri@3.0.3: {} fast-xml-parser@4.2.5: dependencies: @@ -13752,11 +14484,6 @@ snapshots: dependencies: bser: 2.1.1 - fetch-blob@3.2.0: - dependencies: - node-domexception: 1.0.0 - web-streams-polyfill: 3.3.3 - figures@3.2.0: dependencies: escape-string-regexp: 1.0.5 @@ -13781,12 +14508,12 @@ snapshots: dependencies: app-module-path: 2.2.0 commander: 2.20.3 - debug: 4.3.7 + debug: 4.4.0 enhanced-resolve: 5.17.1 is-relative-path: 1.0.2 module-definition: 3.4.0 module-lookup-amd: 7.0.1 - resolve: 1.22.8 + resolve: 1.22.9 resolve-dependency-path: 2.0.0 sass-lookup: 3.0.0 stylus-lookup: 3.0.2 @@ -13818,6 +14545,11 @@ snapshots: transitivePeerDependencies: - supports-color + find-cache-dir@4.0.0: + dependencies: + common-path-prefix: 3.0.0 + pkg-dir: 7.0.0 + find-up@2.1.0: dependencies: locate-path: 2.0.0 @@ -13836,9 +14568,14 @@ snapshots: locate-path: 6.0.0 path-exists: 4.0.0 + find-up@6.3.0: + dependencies: + locate-path: 7.2.0 + path-exists: 5.0.0 + flat-cache@3.2.0: dependencies: - flatted: 3.3.1 + flatted: 3.3.2 keyv: 4.5.4 rimraf: 3.0.2 @@ -13846,7 +14583,7 @@ snapshots: flatbuffers@1.12.0: {} - flatted@3.3.1: {} + flatted@3.3.2: {} flatten@1.0.3: {} @@ -13860,7 +14597,7 @@ snapshots: foreground-child@3.3.0: dependencies: - cross-spawn: 7.0.3 + cross-spawn: 7.0.6 signal-exit: 4.1.0 forever-agent@0.6.1: {} @@ -13871,22 +14608,19 @@ snapshots: combined-stream: 1.0.8 mime-types: 2.1.35 - form-data@2.5.1: + form-data@2.5.2: dependencies: asynckit: 0.4.0 combined-stream: 1.0.8 mime-types: 2.1.35 + safe-buffer: 5.2.1 - form-data@4.0.0: + form-data@4.0.1: dependencies: asynckit: 0.4.0 combined-stream: 1.0.8 mime-types: 2.1.35 - formdata-polyfill@4.0.10: - dependencies: - fetch-blob: 3.2.0 - formidable@1.2.6: {} formidable@2.1.2: @@ -13940,17 +14674,15 @@ snapshots: function.prototype.name@1.1.6: dependencies: - call-bind: 1.0.7 + call-bind: 1.0.8 define-properties: 1.2.1 - es-abstract: 1.23.3 + es-abstract: 1.23.5 functions-have-names: 1.2.3 functional-red-black-tree@1.0.1: {} functions-have-names@1.2.3: {} - fx@35.0.0: {} - gals@1.0.2: {} gauge@4.0.4: @@ -13982,13 +14714,18 @@ snapshots: get-caller-file@2.0.5: {} - get-intrinsic@1.2.4: + get-intrinsic@1.2.6: dependencies: + call-bind-apply-helpers: 1.0.1 + dunder-proto: 1.0.0 + es-define-property: 1.0.1 es-errors: 1.3.0 + es-object-atoms: 1.0.0 function-bind: 1.1.2 - has-proto: 1.0.3 - has-symbols: 1.0.3 + gopd: 1.2.0 + has-symbols: 1.1.0 hasown: 2.0.2 + math-intrinsics: 1.0.0 get-own-enumerable-property-symbols@3.0.2: {} @@ -14023,9 +14760,9 @@ snapshots: get-symbol-description@1.0.2: dependencies: - call-bind: 1.0.7 + call-bind: 1.0.8 es-errors: 1.3.0 - get-intrinsic: 1.2.4 + get-intrinsic: 1.2.6 get-value@2.0.6: {} @@ -14077,6 +14814,8 @@ snapshots: glob-to-regexp@0.3.0: {} + glob-to-regexp@0.4.1: {} + glob@10.4.5: dependencies: foreground-child: 3.3.0 @@ -14141,7 +14880,7 @@ snapshots: globalthis@1.0.4: dependencies: define-properties: 1.2.1 - gopd: 1.0.1 + gopd: 1.2.0 globby@10.0.2: dependencies: @@ -14163,14 +14902,6 @@ snapshots: merge2: 1.4.1 slash: 3.0.0 - globby@13.2.2: - dependencies: - dir-glob: 3.0.1 - fast-glob: 3.3.2 - ignore: 5.3.2 - merge2: 1.4.1 - slash: 4.0.0 - globby@9.2.0: dependencies: '@types/glob': 7.2.0 @@ -14188,9 +14919,7 @@ snapshots: dependencies: minimist: 1.2.8 - gopd@1.0.1: - dependencies: - get-intrinsic: 1.2.4 + gopd@1.2.0: {} got@9.6.0: dependencies: @@ -14256,15 +14985,17 @@ snapshots: has-property-descriptors@1.0.2: dependencies: - es-define-property: 1.0.0 + es-define-property: 1.0.1 - has-proto@1.0.3: {} + has-proto@1.2.0: + dependencies: + dunder-proto: 1.0.0 - has-symbols@1.0.3: {} + has-symbols@1.1.0: {} has-tostringtag@1.0.2: dependencies: - has-symbols: 1.0.3 + has-symbols: 1.1.0 has-unicode@2.0.1: {} @@ -14293,7 +15024,7 @@ snapshots: dependencies: function-bind: 1.1.2 - hast-util-to-html@9.0.3: + hast-util-to-html@9.0.4: dependencies: '@types/hast': 3.0.4 '@types/unist': 3.0.3 @@ -14322,7 +15053,7 @@ snapshots: header-case@2.0.4: dependencies: capital-case: 1.0.4 - tslib: 2.7.0 + tslib: 2.8.1 help-me@5.0.0: {} @@ -14342,7 +15073,7 @@ snapshots: dependencies: lru-cache: 6.0.0 - hosted-git-info@6.1.1: + hosted-git-info@6.1.3: dependencies: lru-cache: 7.18.3 @@ -14383,7 +15114,7 @@ snapshots: dependencies: '@tootallnate/once': 1.1.2 agent-base: 6.0.2 - debug: 4.3.7 + debug: 4.4.0 transitivePeerDependencies: - supports-color @@ -14391,14 +15122,14 @@ snapshots: dependencies: '@tootallnate/once': 2.0.0 agent-base: 6.0.2 - debug: 4.3.7 + debug: 4.4.0 transitivePeerDependencies: - supports-color http-proxy-agent@7.0.2: dependencies: - agent-base: 7.1.1 - debug: 4.3.7 + agent-base: 7.1.3 + debug: 4.4.0 transitivePeerDependencies: - supports-color @@ -14411,14 +15142,14 @@ snapshots: https-proxy-agent@5.0.1: dependencies: agent-base: 6.0.2 - debug: 4.3.7 + debug: 4.4.0 transitivePeerDependencies: - supports-color - https-proxy-agent@7.0.5: + https-proxy-agent@7.0.6: dependencies: - agent-base: 7.1.1 - debug: 4.3.7 + agent-base: 7.1.3 + debug: 4.4.0 transitivePeerDependencies: - supports-color @@ -14465,10 +15196,10 @@ snapshots: parent-module: 1.0.1 resolve-from: 4.0.0 - import-in-the-middle@1.11.2: + import-in-the-middle@1.11.3: dependencies: - acorn: 8.12.1 - acorn-import-attributes: 1.9.5(acorn@8.12.1) + acorn: 8.14.0 + acorn-import-attributes: 1.9.5(acorn@8.14.0) cjs-module-lexer: 1.4.1 module-details-from-path: 1.0.3 @@ -14559,11 +15290,11 @@ snapshots: int64-buffer@1.0.1: {} - internal-slot@1.0.7: + internal-slot@1.1.0: dependencies: es-errors: 1.3.0 hasown: 2.0.2 - side-channel: 1.0.6 + side-channel: 1.1.0 interpret@2.2.0: {} @@ -14571,7 +15302,7 @@ snapshots: dependencies: '@ioredis/commands': 1.2.0 cluster-key-slot: 1.1.2 - debug: 4.3.7 + debug: 4.4.0 denque: 2.1.0 lodash.defaults: 4.2.0 lodash.isarguments: 3.1.0 @@ -14594,25 +15325,32 @@ snapshots: dependencies: hasown: 2.0.2 - is-arguments@1.1.1: + is-arguments@1.2.0: dependencies: - call-bind: 1.0.7 + call-bound: 1.0.2 has-tostringtag: 1.0.2 is-array-buffer@3.0.4: dependencies: - call-bind: 1.0.7 - get-intrinsic: 1.2.4 + call-bind: 1.0.8 + get-intrinsic: 1.2.6 is-arrayish@0.2.1: {} - is-bigint@1.0.4: + is-arrayish@0.3.2: + optional: true + + is-async-function@2.0.0: + dependencies: + has-tostringtag: 1.0.2 + + is-bigint@1.1.0: dependencies: has-bigints: 1.0.2 - is-boolean-object@1.1.2: + is-boolean-object@1.2.1: dependencies: - call-bind: 1.0.7 + call-bound: 1.0.2 has-tostringtag: 1.0.2 is-buffer@1.1.6: {} @@ -14629,7 +15367,7 @@ snapshots: is-class-hotfix@0.0.6: {} - is-core-module@2.15.1: + is-core-module@2.16.0: dependencies: hasown: 2.0.2 @@ -14637,12 +15375,15 @@ snapshots: dependencies: hasown: 2.0.2 - is-data-view@1.0.1: + is-data-view@1.0.2: dependencies: + call-bound: 1.0.2 + get-intrinsic: 1.2.6 is-typed-array: 1.1.13 - is-date-object@1.0.5: + is-date-object@1.1.0: dependencies: + call-bound: 1.0.2 has-tostringtag: 1.0.2 is-descriptor@0.1.7: @@ -14665,6 +15406,10 @@ snapshots: is-extglob@2.1.1: {} + is-finalizationregistry@1.1.0: + dependencies: + call-bind: 1.0.8 + is-fullwidth-code-point@2.0.0: {} is-fullwidth-code-point@3.0.0: {} @@ -14696,15 +15441,16 @@ snapshots: is-nan@1.3.2: dependencies: - call-bind: 1.0.7 + call-bind: 1.0.8 define-properties: 1.2.1 is-negative-zero@2.0.3: {} is-npm@5.0.0: {} - is-number-object@1.0.7: + is-number-object@1.1.0: dependencies: + call-bind: 1.0.8 has-tostringtag: 1.0.2 is-number@3.0.0: @@ -14729,10 +15475,12 @@ snapshots: is-property@1.0.2: {} - is-regex@1.1.4: + is-regex@1.2.1: dependencies: - call-bind: 1.0.7 + call-bound: 1.0.2 + gopd: 1.2.0 has-tostringtag: 1.0.2 + hasown: 2.0.2 is-regexp@1.0.0: {} @@ -14742,7 +15490,7 @@ snapshots: is-shared-array-buffer@1.0.3: dependencies: - call-bind: 1.0.7 + call-bind: 1.0.8 is-ssh@1.4.0: dependencies: @@ -14752,13 +15500,16 @@ snapshots: is-stream@2.0.1: {} - is-string@1.0.7: + is-string@1.1.0: dependencies: + call-bind: 1.0.8 has-tostringtag: 1.0.2 - is-symbol@1.0.4: + is-symbol@1.1.1: dependencies: - has-symbols: 1.0.3 + call-bound: 1.0.2 + has-symbols: 1.1.0 + safe-regex-test: 1.1.0 is-text-path@1.0.1: dependencies: @@ -14770,11 +15521,11 @@ snapshots: is-class-hotfix: 0.0.6 isstream: 0.1.2 - is-type-of@2.1.0: {} + is-type-of@2.2.0: {} is-typed-array@1.1.13: dependencies: - which-typed-array: 1.1.15 + which-typed-array: 1.1.16 is-typedarray@1.0.0: {} @@ -14786,14 +15537,14 @@ snapshots: is-weakmap@2.0.2: {} - is-weakref@1.0.2: + is-weakref@1.1.0: dependencies: - call-bind: 1.0.7 + call-bound: 1.0.2 is-weakset@2.0.3: dependencies: - call-bind: 1.0.7 - get-intrinsic: 1.2.4 + call-bind: 1.0.8 + get-intrinsic: 1.2.6 is-windows@1.0.2: {} @@ -14827,8 +15578,8 @@ snapshots: istanbul-lib-instrument@5.2.1: dependencies: - '@babel/core': 7.25.7 - '@babel/parser': 7.25.7 + '@babel/core': 7.26.0 + '@babel/parser': 7.26.3 '@istanbuljs/schema': 0.1.3 istanbul-lib-coverage: 3.2.2 semver: 6.3.1 @@ -14837,8 +15588,8 @@ snapshots: istanbul-lib-instrument@6.0.3: dependencies: - '@babel/core': 7.25.7 - '@babel/parser': 7.25.7 + '@babel/core': 7.26.0 + '@babel/parser': 7.26.3 '@istanbuljs/schema': 0.1.3 istanbul-lib-coverage: 3.2.2 semver: 7.6.3 @@ -14853,7 +15604,7 @@ snapshots: istanbul-lib-source-maps@4.0.1: dependencies: - debug: 4.3.7 + debug: 4.4.0 istanbul-lib-coverage: 3.2.2 source-map: 0.6.1 transitivePeerDependencies: @@ -14930,10 +15681,10 @@ snapshots: jest-config@29.7.0(@types/node@20.16.10)(ts-node@10.9.2(@types/node@20.16.10)(typescript@5.3.3)): dependencies: - '@babel/core': 7.25.7 + '@babel/core': 7.26.0 '@jest/test-sequencer': 29.7.0 '@jest/types': 29.6.3 - babel-jest: 29.7.0(@babel/core@7.25.7) + babel-jest: 29.7.0(@babel/core@7.26.0) chalk: 4.1.2 ci-info: 3.9.0 deepmerge: 4.3.1 @@ -15019,7 +15770,7 @@ snapshots: jest-message-util@29.7.0: dependencies: - '@babel/code-frame': 7.25.7 + '@babel/code-frame': 7.26.2 '@jest/types': 29.6.3 '@types/stack-utils': 2.0.3 chalk: 4.1.2 @@ -15056,8 +15807,8 @@ snapshots: jest-pnp-resolver: 1.2.3(jest-resolve@29.7.0) jest-util: 29.7.0 jest-validate: 29.7.0 - resolve: 1.22.8 - resolve.exports: 2.0.2 + resolve: 1.22.9 + resolve.exports: 2.0.3 slash: 3.0.0 jest-runner@29.7.0: @@ -15115,15 +15866,15 @@ snapshots: jest-snapshot@29.7.0: dependencies: - '@babel/core': 7.25.7 - '@babel/generator': 7.25.7 - '@babel/plugin-syntax-jsx': 7.25.7(@babel/core@7.25.7) - '@babel/plugin-syntax-typescript': 7.25.7(@babel/core@7.25.7) - '@babel/types': 7.25.7 + '@babel/core': 7.26.0 + '@babel/generator': 7.26.3 + '@babel/plugin-syntax-jsx': 7.25.9(@babel/core@7.26.0) + '@babel/plugin-syntax-typescript': 7.25.9(@babel/core@7.26.0) + '@babel/types': 7.26.3 '@jest/expect-utils': 29.7.0 '@jest/transform': 29.7.0 '@jest/types': 29.6.3 - babel-preset-current-node-syntax: 1.1.0(@babel/core@7.25.7) + babel-preset-current-node-syntax: 1.1.0(@babel/core@7.26.0) chalk: 4.1.2 expect: 29.7.0 graceful-fs: 4.2.11 @@ -15167,6 +15918,12 @@ snapshots: jest-util: 29.7.0 string-length: 4.0.2 + jest-worker@27.5.1: + dependencies: + '@types/node': 20.16.10 + merge-stream: 2.0.0 + supports-color: 8.1.1 + jest-worker@29.7.0: dependencies: '@types/node': 20.16.10 @@ -15215,7 +15972,7 @@ snapshots: jsep@0.3.5: {} - jsesc@3.0.2: {} + jsesc@3.1.0: {} json-buffer@3.0.0: {} @@ -15308,7 +16065,7 @@ snapshots: dependencies: json-buffer: 3.0.1 - keyv@5.1.0: + keyv@5.2.2: dependencies: '@keyv/serialize': 1.0.1 @@ -15398,7 +16155,7 @@ snapshots: koa-session@6.4.0: dependencies: crc: 3.8.0 - debug: 4.3.7 + debug: 4.4.0 is-type-of: 1.4.0 uuid: 8.3.2 transitivePeerDependencies: @@ -15421,7 +16178,7 @@ snapshots: content-disposition: 0.5.4 content-type: 1.0.5 cookies: 0.9.1 - debug: 4.3.7 + debug: 4.4.0 delegates: 1.0.0 depd: 2.0.0 destroy: 1.2.0 @@ -15446,7 +16203,7 @@ snapshots: dependencies: package-json: 6.5.0 - leoric@2.12.3(mysql2@3.11.3)(sqlite3@5.1.7): + leoric@2.12.3(mysql2@3.11.5)(sqlite3@5.1.7): dependencies: dayjs: 1.11.13 debug: 3.2.7 @@ -15455,10 +16212,10 @@ snapshots: pluralize: 7.0.0 reflect-metadata: 0.1.14 sqlstring: 2.3.3 - tslib: 2.7.0 + tslib: 2.8.1 validator: 13.12.0 optionalDependencies: - mysql2: 3.11.3 + mysql2: 3.11.5 sqlite3: 5.1.7 transitivePeerDependencies: - supports-color @@ -15610,6 +16367,14 @@ snapshots: strip-bom: 4.0.0 type-fest: 0.6.0 + loader-runner@4.3.0: {} + + loader-utils@2.0.4: + dependencies: + big.js: 5.2.2 + emojis-list: 3.0.0 + json5: 2.2.3 + locate-path@2.0.0: dependencies: p-locate: 2.0.0 @@ -15628,6 +16393,10 @@ snapshots: dependencies: p-locate: 5.0.0 + locate-path@7.2.0: + dependencies: + p-locate: 6.0.0 + lodash.camelcase@4.3.0: {} lodash.chunk@4.2.0: {} @@ -15683,7 +16452,7 @@ snapshots: lower-case@2.0.2: dependencies: - tslib: 2.7.0 + tslib: 2.8.1 lowercase-keys@1.0.1: {} @@ -15719,7 +16488,7 @@ snapshots: chalk: 4.1.2 commander: 7.2.0 commondir: 1.0.1 - debug: 4.3.7 + debug: 4.4.0 dependency-tree: 9.0.0 detective-amd: 4.2.0 detective-cjs: 4.1.0 @@ -15771,7 +16540,7 @@ snapshots: minipass-fetch: 3.0.5 minipass-flush: 1.0.5 minipass-pipeline: 1.2.4 - negotiator: 0.6.3 + negotiator: 0.6.4 promise-retry: 2.0.1 socks-proxy-agent: 7.0.0 ssri: 10.0.6 @@ -15788,7 +16557,7 @@ snapshots: minipass-fetch: 3.0.5 minipass-flush: 1.0.5 minipass-pipeline: 1.2.4 - negotiator: 0.6.3 + negotiator: 0.6.4 proc-log: 4.2.0 promise-retry: 2.0.1 ssri: 10.0.6 @@ -15809,7 +16578,7 @@ snapshots: minipass-fetch: 1.4.1 minipass-flush: 1.0.5 minipass-pipeline: 1.2.4 - negotiator: 0.6.3 + negotiator: 0.6.4 promise-retry: 2.0.1 socks-proxy-agent: 6.2.1 ssri: 8.0.1 @@ -15850,13 +16619,15 @@ snapshots: dependencies: escape-string-regexp: 1.0.5 + math-intrinsics@1.0.0: {} + mdast-util-to-hast@13.2.0: dependencies: '@types/hast': 3.0.4 '@types/mdast': 4.0.4 - '@ungap/structured-clone': 1.2.0 + '@ungap/structured-clone': 1.2.1 devlop: 1.1.0 - micromark-util-sanitize-uri: 2.0.0 + micromark-util-sanitize-uri: 2.0.1 trim-lines: 3.0.1 unist-util-position: 5.0.0 unist-util-visit: 5.0.0 @@ -15874,7 +16645,7 @@ snapshots: memorystore@1.6.7: dependencies: - debug: 4.3.7 + debug: 4.4.0 lru-cache: 4.1.5 transitivePeerDependencies: - supports-color @@ -15916,22 +16687,22 @@ snapshots: methods@1.1.2: {} - micromark-util-character@2.1.0: + micromark-util-character@2.1.1: dependencies: - micromark-util-symbol: 2.0.0 - micromark-util-types: 2.0.0 + micromark-util-symbol: 2.0.1 + micromark-util-types: 2.0.1 - micromark-util-encode@2.0.0: {} + micromark-util-encode@2.0.1: {} - micromark-util-sanitize-uri@2.0.0: + micromark-util-sanitize-uri@2.0.1: dependencies: - micromark-util-character: 2.1.0 - micromark-util-encode: 2.0.0 - micromark-util-symbol: 2.0.0 + micromark-util-character: 2.1.1 + micromark-util-encode: 2.0.1 + micromark-util-symbol: 2.0.1 - micromark-util-symbol@2.0.0: {} + micromark-util-symbol@2.0.1: {} - micromark-util-types@2.0.0: {} + micromark-util-types@2.0.1: {} micromatch@3.1.10: dependencies: @@ -16112,7 +16883,7 @@ snapshots: module-lookup-amd@7.0.1: dependencies: commander: 2.20.3 - debug: 4.3.7 + debug: 4.4.0 glob: 7.2.3 requirejs: 2.3.7 requirejs-config-file: 4.0.0 @@ -16133,7 +16904,7 @@ snapshots: mongodb@6.8.0(socks@2.8.3): dependencies: '@mongodb-js/saslprep': 1.1.9 - bson: 6.8.0 + bson: 6.10.1 mongodb-connection-string-url: 3.0.1 optionalDependencies: socks: 2.8.3 @@ -16141,14 +16912,14 @@ snapshots: mongodb@6.9.0(socks@2.8.3): dependencies: '@mongodb-js/saslprep': 1.1.9 - bson: 6.8.0 + bson: 6.10.1 mongodb-connection-string-url: 3.0.1 optionalDependencies: socks: 2.8.3 mongoose@8.6.3(socks@2.8.3): dependencies: - bson: 6.8.0 + bson: 6.10.1 kareem: 2.6.3 mongodb: 6.8.0(socks@2.8.3) mpath: 0.9.0 @@ -16167,7 +16938,7 @@ snapshots: mongoose@8.7.0(socks@2.8.3): dependencies: - bson: 6.8.0 + bson: 6.10.1 kareem: 2.6.3 mongodb: 6.9.0(socks@2.8.3) mpath: 0.9.0 @@ -16186,25 +16957,25 @@ snapshots: mpath@0.9.0: {} - mqtt-packet@9.0.0: + mqtt-packet@9.0.1: dependencies: bl: 6.0.16 - debug: 4.3.7 + debug: 4.4.0 process-nextick-args: 2.0.1 transitivePeerDependencies: - supports-color mqtt@5.10.0: dependencies: - '@types/readable-stream': 4.0.15 + '@types/readable-stream': 4.0.18 '@types/ws': 8.5.12 commist: 3.2.0 concat-stream: 2.0.0 - debug: 4.3.7 + debug: 4.4.0 help-me: 5.0.0 lru-cache: 10.4.3 minimist: 1.2.8 - mqtt-packet: 9.0.0 + mqtt-packet: 9.0.1 number-allocator: 1.0.14 readable-stream: 4.5.2 reinterval: 1.1.0 @@ -16219,7 +16990,7 @@ snapshots: mquery@5.0.0: dependencies: - debug: 4.3.7 + debug: 4.4.0 transitivePeerDependencies: - supports-color @@ -16241,7 +17012,7 @@ snapshots: '@msgpackr-extract/msgpackr-extract-win32-x64': 3.0.3 optional: true - msgpackr@1.11.0: + msgpackr@1.11.2: optionalDependencies: msgpackr-extract: 3.0.3 @@ -16290,7 +17061,7 @@ snapshots: transitivePeerDependencies: - supports-color - mysql2@3.11.3: + mysql2@3.11.5: dependencies: aws-ssl-profiles: 1.1.2 denque: 2.1.0 @@ -16350,8 +17121,36 @@ snapshots: negotiator@0.6.3: {} + negotiator@0.6.4: {} + neo-async@2.6.2: {} + next@15.0.4(@babel/core@7.26.0)(@opentelemetry/api@1.9.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1): + dependencies: + '@next/env': 15.0.4 + '@swc/counter': 0.1.3 + '@swc/helpers': 0.5.13 + busboy: 1.6.0 + caniuse-lite: 1.0.30001688 + postcss: 8.4.31 + react: 18.3.1 + react-dom: 18.3.1(react@18.3.1) + styled-jsx: 5.1.6(@babel/core@7.26.0)(react@18.3.1) + optionalDependencies: + '@next/swc-darwin-arm64': 15.0.4 + '@next/swc-darwin-x64': 15.0.4 + '@next/swc-linux-arm64-gnu': 15.0.4 + '@next/swc-linux-arm64-musl': 15.0.4 + '@next/swc-linux-x64-gnu': 15.0.4 + '@next/swc-linux-x64-musl': 15.0.4 + '@next/swc-win32-arm64-msvc': 15.0.4 + '@next/swc-win32-x64-msvc': 15.0.4 + '@opentelemetry/api': 1.9.0 + sharp: 0.33.5 + transitivePeerDependencies: + - '@babel/core' + - babel-plugin-macros + nice-try@1.0.5: {} nise@5.1.9: @@ -16365,17 +17164,17 @@ snapshots: no-case@3.0.4: dependencies: lower-case: 2.0.2 - tslib: 2.7.0 + tslib: 2.8.1 nock@13.5.5: dependencies: - debug: 4.3.7 + debug: 4.4.0 json-stringify-safe: 5.0.1 propagate: 2.0.1 transitivePeerDependencies: - supports-color - node-abi@3.68.0: + node-abi@3.71.0: dependencies: semver: 7.6.3 @@ -16383,28 +17182,20 @@ snapshots: node-addon-api@7.1.1: {} - node-domexception@1.0.0: {} - node-fetch@2.6.7(encoding@0.1.13): dependencies: whatwg-url: 5.0.0 optionalDependencies: encoding: 0.1.13 - node-fetch@3.3.1: - dependencies: - data-uri-to-buffer: 4.0.1 - fetch-blob: 3.2.0 - formdata-polyfill: 4.0.10 - node-gyp-build-optional-packages@5.2.2: dependencies: detect-libc: 2.0.3 optional: true - node-gyp-build@4.8.2: {} + node-gyp-build@4.8.4: {} - node-gyp@10.2.0: + node-gyp@10.3.1: dependencies: env-paths: 2.2.1 exponential-backoff: 3.1.1 @@ -16444,15 +17235,15 @@ snapshots: node-machine-id@1.1.12: {} - node-releases@2.0.18: {} + node-releases@2.0.19: {} node-source-walk@4.3.0: dependencies: - '@babel/parser': 7.25.7 + '@babel/parser': 7.26.3 node-source-walk@5.0.2: dependencies: - '@babel/parser': 7.25.7 + '@babel/parser': 7.26.3 nopt@5.0.0: dependencies: @@ -16466,21 +17257,21 @@ snapshots: normalize-package-data@2.5.0: dependencies: hosted-git-info: 2.8.9 - resolve: 1.22.8 + resolve: 1.22.9 semver: 5.7.2 validate-npm-package-license: 3.0.4 normalize-package-data@3.0.3: dependencies: hosted-git-info: 4.1.0 - is-core-module: 2.15.1 + is-core-module: 2.16.0 semver: 7.6.3 validate-npm-package-license: 3.0.4 normalize-package-data@5.0.0: dependencies: - hosted-git-info: 6.1.1 - is-core-module: 2.15.1 + hosted-git-info: 6.1.3 + is-core-module: 2.16.0 semver: 7.6.3 validate-npm-package-license: 3.0.4 @@ -16514,7 +17305,7 @@ snapshots: npm-package-arg@10.1.0: dependencies: - hosted-git-info: 6.1.1 + hosted-git-info: 6.1.3 proc-log: 3.0.0 semver: 7.6.3 validate-npm-package-name: 5.0.0 @@ -16586,9 +17377,15 @@ snapshots: gauge: 4.0.4 set-blocking: 2.0.0 + null-loader@4.0.1(webpack@5.97.1): + dependencies: + loader-utils: 2.0.4 + schema-utils: 3.3.0 + webpack: 5.97.1 + number-allocator@1.0.14: dependencies: - debug: 4.3.7 + debug: 4.4.0 js-sdsl: 4.3.0 transitivePeerDependencies: - supports-color @@ -16633,7 +17430,7 @@ snapshots: tar-stream: 2.2.0 tmp: 0.2.3 tsconfig-paths: 4.2.0 - tslib: 2.7.0 + tslib: 2.8.1 v8-compile-cache: 2.3.0 yargs: 17.7.2 yargs-parser: 21.1.1 @@ -16684,7 +17481,7 @@ snapshots: tar-stream: 2.2.0 tmp: 0.2.3 tsconfig-paths: 4.2.0 - tslib: 2.7.0 + tslib: 2.8.1 yargs: 17.7.2 yargs-parser: 21.1.1 optionalDependencies: @@ -16713,11 +17510,11 @@ snapshots: define-property: 0.2.5 kind-of: 3.2.2 - object-inspect@1.13.2: {} + object-inspect@1.13.3: {} object-is@1.1.6: dependencies: - call-bind: 1.0.7 + call-bind: 1.0.8 define-properties: 1.2.1 object-keys@1.1.1: {} @@ -16728,9 +17525,9 @@ snapshots: object.assign@4.1.5: dependencies: - call-bind: 1.0.7 + call-bind: 1.0.8 define-properties: 1.2.1 - has-symbols: 1.0.3 + has-symbols: 1.1.0 object-keys: 1.1.1 object.pick@1.3.0: @@ -16753,9 +17550,11 @@ snapshots: dependencies: mimic-fn: 2.1.0 - oniguruma-to-js@0.4.3: + oniguruma-to-es@0.7.0: dependencies: - regex: 4.3.3 + emoji-regex-xs: 1.0.0 + regex: 5.0.2 + regex-recursion: 4.3.0 only@0.0.2: {} @@ -16828,6 +17627,10 @@ snapshots: dependencies: yocto-queue: 0.1.0 + p-limit@4.0.0: + dependencies: + yocto-queue: 1.1.1 + p-locate@2.0.0: dependencies: p-limit: 1.3.0 @@ -16844,6 +17647,10 @@ snapshots: dependencies: p-limit: 3.1.0 + p-locate@6.0.0: + dependencies: + p-limit: 4.0.0 + p-map-series@2.1.0: {} p-map@3.0.0: @@ -16917,7 +17724,7 @@ snapshots: param-case@3.0.4: dependencies: dot-case: 3.0.4 - tslib: 2.7.0 + tslib: 2.8.1 parent-module@1.0.1: dependencies: @@ -16930,7 +17737,7 @@ snapshots: parse-json@5.2.0: dependencies: - '@babel/code-frame': 7.25.7 + '@babel/code-frame': 7.26.2 error-ex: 1.3.2 json-parse-even-better-errors: 2.3.1 lines-and-columns: 1.2.4 @@ -16962,7 +17769,7 @@ snapshots: pascal-case@3.1.2: dependencies: no-case: 3.0.4 - tslib: 2.7.0 + tslib: 2.8.1 pascalcase@0.1.1: {} @@ -16989,7 +17796,7 @@ snapshots: path-case@3.0.4: dependencies: dot-case: 3.0.4 - tslib: 2.7.0 + tslib: 2.8.1 path-dirname@1.0.2: {} @@ -16997,6 +17804,8 @@ snapshots: path-exists@4.0.0: {} + path-exists@5.0.0: {} + path-is-absolute@1.0.1: {} path-key@2.0.1: {} @@ -17038,7 +17847,7 @@ snapshots: pg-connection-string@2.7.0: {} - picocolors@1.1.0: {} + picocolors@1.1.1: {} picomatch@2.3.1: {} @@ -17056,6 +17865,10 @@ snapshots: dependencies: find-up: 4.1.0 + pkg-dir@7.0.0: + dependencies: + find-up: 6.3.0 + pkg-up@3.1.0: dependencies: find-up: 3.0.0 @@ -17076,17 +17889,23 @@ snapshots: indexes-of: 1.0.1 uniq: 1.0.1 - postcss-values-parser@6.0.2(postcss@8.4.47): + postcss-values-parser@6.0.2(postcss@8.4.49): dependencies: color-name: 1.1.4 is-url-superb: 4.0.0 - postcss: 8.4.47 + postcss: 8.4.49 quote-unquote: 1.0.0 - postcss@8.4.47: + postcss@8.4.31: + dependencies: + nanoid: 3.3.7 + picocolors: 1.1.1 + source-map-js: 1.2.1 + + postcss@8.4.49: dependencies: nanoid: 3.3.7 - picocolors: 1.1.0 + picocolors: 1.1.1 source-map-js: 1.2.1 power-assert-context-formatter@1.2.0: @@ -17163,7 +17982,7 @@ snapshots: minimist: 1.2.8 mkdirp-classic: 0.5.3 napi-build-utils: 1.0.2 - node-abi: 3.68.0 + node-abi: 3.71.0 pump: 3.0.2 rc: 1.2.8 simple-get: 4.0.1 @@ -17173,7 +17992,7 @@ snapshots: precinct@8.3.1: dependencies: commander: 2.20.3 - debug: 4.3.7 + debug: 4.4.0 detective-amd: 3.1.2 detective-cjs: 3.1.3 detective-es6: 2.2.2 @@ -17309,7 +18128,9 @@ snapshots: pseudomap@1.0.2: {} - psl@1.9.0: {} + psl@1.15.0: + dependencies: + punycode: 2.3.1 pump@2.0.1: dependencies: @@ -17339,11 +18160,11 @@ snapshots: qs@6.11.0: dependencies: - side-channel: 1.0.6 + side-channel: 1.1.0 qs@6.13.0: dependencies: - side-channel: 1.0.6 + side-channel: 1.1.0 qs@6.5.3: {} @@ -17357,6 +18178,10 @@ snapshots: random-bytes@1.0.0: {} + randombytes@2.1.0: + dependencies: + safe-buffer: 5.2.1 + range-parser@1.2.1: {} raw-body@2.5.2: @@ -17380,6 +18205,12 @@ snapshots: react: 17.0.2 scheduler: 0.20.2 + react-dom@18.3.1(react@18.3.1): + dependencies: + loose-envify: 1.4.0 + react: 18.3.1 + scheduler: 0.23.2 + react-is@18.3.1: {} react@17.0.2: @@ -17387,6 +18218,10 @@ snapshots: loose-envify: 1.4.0 object-assign: 4.1.1 + react@18.3.1: + dependencies: + loose-envify: 1.4.0 + read-cmd-shim@4.0.0: {} read-package-json-fast@3.0.2: @@ -17486,7 +18321,7 @@ snapshots: rechoir@0.8.0: dependencies: - resolve: 1.22.8 + resolve: 1.22.9 redent@3.0.0: dependencies: @@ -17516,6 +18351,17 @@ snapshots: reflect-metadata@0.2.2: {} + reflect.getprototypeof@1.0.8: + dependencies: + call-bind: 1.0.8 + define-properties: 1.2.1 + dunder-proto: 1.0.0 + es-abstract: 1.23.5 + es-errors: 1.3.0 + get-intrinsic: 1.2.6 + gopd: 1.2.0 + which-builtin-type: 1.2.1 + regenerator-runtime@0.14.1: {} regex-not@1.0.2: @@ -17523,11 +18369,19 @@ snapshots: extend-shallow: 3.0.2 safe-regex: 1.1.0 - regex@4.3.3: {} + regex-recursion@4.3.0: + dependencies: + regex-utilities: 2.3.0 + + regex-utilities@2.3.0: {} + + regex@5.0.2: + dependencies: + regex-utilities: 2.3.0 regexp.prototype.flags@1.5.3: dependencies: - call-bind: 1.0.7 + call-bind: 1.0.8 define-properties: 1.2.1 es-errors: 1.3.0 set-function-name: 2.0.2 @@ -17577,9 +18431,9 @@ snapshots: require-in-the-middle@7.4.0: dependencies: - debug: 4.3.7 + debug: 4.4.0 module-details-from-path: 1.0.3 - resolve: 1.22.8 + resolve: 1.22.9 transitivePeerDependencies: - supports-color @@ -17606,11 +18460,11 @@ snapshots: resolve-url@0.2.1: {} - resolve.exports@2.0.2: {} + resolve.exports@2.0.3: {} - resolve@1.22.8: + resolve@1.22.9: dependencies: - is-core-module: 2.15.1 + is-core-module: 2.16.0 path-parse: 1.0.7 supports-preserve-symlinks-flag: 1.0.0 @@ -17665,24 +18519,25 @@ snapshots: rxjs@7.8.1: dependencies: - tslib: 2.7.0 + tslib: 2.8.1 - safe-array-concat@1.1.2: + safe-array-concat@1.1.3: dependencies: - call-bind: 1.0.7 - get-intrinsic: 1.2.4 - has-symbols: 1.0.3 + call-bind: 1.0.8 + call-bound: 1.0.2 + get-intrinsic: 1.2.6 + has-symbols: 1.1.0 isarray: 2.0.5 safe-buffer@5.1.2: {} safe-buffer@5.2.1: {} - safe-regex-test@1.0.3: + safe-regex-test@1.1.0: dependencies: - call-bind: 1.0.7 + call-bound: 1.0.2 es-errors: 1.3.0 - is-regex: 1.1.4 + is-regex: 1.2.1 safe-regex@1.1.0: dependencies: @@ -17705,6 +18560,23 @@ snapshots: loose-envify: 1.4.0 object-assign: 4.1.1 + scheduler@0.23.2: + dependencies: + loose-envify: 1.4.0 + + schema-utils@3.3.0: + dependencies: + '@types/json-schema': 7.0.15 + ajv: 6.12.6 + ajv-keywords: 3.5.2(ajv@6.12.6) + + schema-utils@4.3.0: + dependencies: + '@types/json-schema': 7.0.15 + ajv: 8.17.1 + ajv-formats: 2.1.1(ajv@8.17.1) + ajv-keywords: 5.1.0(ajv@8.17.1) + scmp@2.1.0: {} sdk-base@2.0.1: @@ -17780,7 +18652,7 @@ snapshots: sentence-case@3.0.4: dependencies: no-case: 3.0.4 - tslib: 2.7.0 + tslib: 2.8.1 upper-case-first: 2.0.2 seq-queue@0.0.5: {} @@ -17799,7 +18671,7 @@ snapshots: dependencies: '@types/debug': 4.1.12 '@types/validator': 13.12.2 - debug: 4.3.7 + debug: 4.4.0 dottie: 2.0.6 inflection: 1.13.4 lodash: 4.17.21 @@ -17818,6 +18690,10 @@ snapshots: transitivePeerDependencies: - supports-color + serialize-javascript@6.0.2: + dependencies: + randombytes: 2.1.0 + serialize-json@1.0.3: dependencies: debug: 3.2.7 @@ -17842,8 +18718,8 @@ snapshots: define-data-property: 1.1.4 es-errors: 1.3.0 function-bind: 1.1.2 - get-intrinsic: 1.2.4 - gopd: 1.0.1 + get-intrinsic: 1.2.6 + gopd: 1.2.0 has-property-descriptors: 1.0.2 set-function-name@2.0.2: @@ -17871,6 +18747,33 @@ snapshots: dependencies: kind-of: 6.0.3 + sharp@0.33.5: + dependencies: + color: 4.2.3 + detect-libc: 2.0.3 + semver: 7.6.3 + optionalDependencies: + '@img/sharp-darwin-arm64': 0.33.5 + '@img/sharp-darwin-x64': 0.33.5 + '@img/sharp-libvips-darwin-arm64': 1.0.4 + '@img/sharp-libvips-darwin-x64': 1.0.4 + '@img/sharp-libvips-linux-arm': 1.0.5 + '@img/sharp-libvips-linux-arm64': 1.0.4 + '@img/sharp-libvips-linux-s390x': 1.0.4 + '@img/sharp-libvips-linux-x64': 1.0.4 + '@img/sharp-libvips-linuxmusl-arm64': 1.0.4 + '@img/sharp-libvips-linuxmusl-x64': 1.0.4 + '@img/sharp-linux-arm': 0.33.5 + '@img/sharp-linux-arm64': 0.33.5 + '@img/sharp-linux-s390x': 0.33.5 + '@img/sharp-linux-x64': 0.33.5 + '@img/sharp-linuxmusl-arm64': 0.33.5 + '@img/sharp-linuxmusl-x64': 0.33.5 + '@img/sharp-wasm32': 0.33.5 + '@img/sharp-win32-ia32': 0.33.5 + '@img/sharp-win32-x64': 0.33.5 + optional: true + shebang-command@1.2.0: dependencies: shebang-regex: 1.0.0 @@ -17883,25 +18786,46 @@ snapshots: shebang-regex@3.0.0: {} - shiki@1.22.0: + shiki@1.24.2: dependencies: - '@shikijs/core': 1.22.0 - '@shikijs/engine-javascript': 1.22.0 - '@shikijs/engine-oniguruma': 1.22.0 - '@shikijs/types': 1.22.0 - '@shikijs/vscode-textmate': 9.3.0 + '@shikijs/core': 1.24.2 + '@shikijs/engine-javascript': 1.24.2 + '@shikijs/engine-oniguruma': 1.24.2 + '@shikijs/types': 1.24.2 + '@shikijs/vscode-textmate': 9.3.1 '@types/hast': 3.0.4 shimmer@1.2.1: {} should-send-same-site-none@2.0.5: {} - side-channel@1.0.6: + side-channel-list@1.0.0: + dependencies: + es-errors: 1.3.0 + object-inspect: 1.13.3 + + side-channel-map@1.0.1: + dependencies: + call-bound: 1.0.2 + es-errors: 1.3.0 + get-intrinsic: 1.2.6 + object-inspect: 1.13.3 + + side-channel-weakmap@1.0.2: dependencies: - call-bind: 1.0.7 + call-bound: 1.0.2 es-errors: 1.3.0 - get-intrinsic: 1.2.4 - object-inspect: 1.13.2 + get-intrinsic: 1.2.6 + object-inspect: 1.13.3 + side-channel-map: 1.0.1 + + side-channel@1.1.0: + dependencies: + es-errors: 1.3.0 + object-inspect: 1.13.3 + side-channel-list: 1.0.0 + side-channel-map: 1.0.1 + side-channel-weakmap: 1.0.2 sift@17.1.3: {} @@ -17940,6 +18864,11 @@ snapshots: once: 1.4.0 simple-concat: 1.0.1 + simple-swizzle@0.2.2: + dependencies: + is-arrayish: 0.3.2 + optional: true + sinon@17.0.2: dependencies: '@sinonjs/commons': 3.0.1 @@ -17955,8 +18884,6 @@ snapshots: slash@3.0.0: {} - slash@4.0.0: {} - slice-ansi@4.0.0: dependencies: ansi-styles: 4.3.0 @@ -17968,7 +18895,7 @@ snapshots: snake-case@3.0.4: dependencies: dot-case: 3.0.4 - tslib: 2.7.0 + tslib: 2.8.1 snapdragon-node@2.1.1: dependencies: @@ -18096,7 +19023,7 @@ snapshots: socks-proxy-agent@6.2.1: dependencies: agent-base: 6.0.2 - debug: 4.3.7 + debug: 4.4.0 socks: 2.8.3 transitivePeerDependencies: - supports-color @@ -18104,15 +19031,15 @@ snapshots: socks-proxy-agent@7.0.0: dependencies: agent-base: 6.0.2 - debug: 4.3.7 + debug: 4.4.0 socks: 2.8.3 transitivePeerDependencies: - supports-color - socks-proxy-agent@8.0.4: + socks-proxy-agent@8.0.5: dependencies: - agent-base: 7.1.1 - debug: 4.3.7 + agent-base: 7.1.3 + debug: 4.4.0 socks: 2.8.3 transitivePeerDependencies: - supports-color @@ -18257,9 +19184,10 @@ snapshots: statuses@2.0.1: {} - stop-iteration-iterator@1.0.0: + stop-iteration-iterator@1.1.0: dependencies: - internal-slot: 1.0.7 + es-errors: 1.3.0 + internal-slot: 1.1.0 stream-combiner@0.0.4: dependencies: @@ -18310,22 +19238,26 @@ snapshots: emoji-regex: 9.2.2 strip-ansi: 7.1.0 - string.prototype.trim@1.2.9: + string.prototype.trim@1.2.10: dependencies: - call-bind: 1.0.7 + call-bind: 1.0.8 + call-bound: 1.0.2 + define-data-property: 1.1.4 define-properties: 1.2.1 - es-abstract: 1.23.3 + es-abstract: 1.23.5 es-object-atoms: 1.0.0 + has-property-descriptors: 1.0.2 - string.prototype.trimend@1.0.8: + string.prototype.trimend@1.0.9: dependencies: - call-bind: 1.0.7 + call-bind: 1.0.8 + call-bound: 1.0.2 define-properties: 1.2.1 es-object-atoms: 1.0.0 string.prototype.trimstart@1.0.8: dependencies: - call-bind: 1.0.7 + call-bind: 1.0.8 define-properties: 1.2.1 es-object-atoms: 1.0.0 @@ -18395,10 +19327,17 @@ snapshots: '@tokenizer/token': 0.3.0 peek-readable: 4.1.0 + styled-jsx@5.1.6(@babel/core@7.26.0)(react@18.3.1): + dependencies: + client-only: 0.0.1 + react: 18.3.1 + optionalDependencies: + '@babel/core': 7.26.0 + stylus-lookup@3.0.2: dependencies: commander: 2.20.3 - debug: 4.3.7 + debug: 4.4.0 transitivePeerDependencies: - supports-color @@ -18412,7 +19351,7 @@ snapshots: cookiejar: 2.1.4 debug: 3.2.7 extend: 3.0.2 - form-data: 2.5.1 + form-data: 2.5.2 formidable: 1.2.6 methods: 1.1.2 mime: 1.6.0 @@ -18425,9 +19364,9 @@ snapshots: dependencies: component-emitter: 1.3.1 cookiejar: 2.1.4 - debug: 4.3.7 + debug: 4.4.0 fast-safe-stringify: 2.1.1 - form-data: 4.0.0 + form-data: 4.0.1 formidable: 2.1.2 methods: 1.1.2 mime: 2.6.0 @@ -18470,7 +19409,7 @@ snapshots: swagger-ui-dist@5.17.14: {} - table@6.8.2: + table@6.9.0: dependencies: ajv: 8.17.1 lodash.truncate: 4.4.2 @@ -18537,6 +19476,22 @@ snapshots: temp-dir@1.0.0: {} + terser-webpack-plugin@5.3.11(webpack@5.97.1): + dependencies: + '@jridgewell/trace-mapping': 0.3.25 + jest-worker: 27.5.1 + schema-utils: 4.3.0 + serialize-javascript: 6.0.2 + terser: 5.37.0 + webpack: 5.97.1 + + terser@5.37.0: + dependencies: + '@jridgewell/source-map': 0.3.6 + acorn: 8.14.0 + commander: 2.20.3 + source-map-support: 0.5.21 + test-exclude@6.0.0: dependencies: '@istanbuljs/schema': 0.1.3 @@ -18580,8 +19535,6 @@ snapshots: to-arraybuffer@1.0.1: {} - to-fast-properties@2.0.0: {} - to-object-path@0.3.0: dependencies: kind-of: 3.2.2 @@ -18615,7 +19568,7 @@ snapshots: tough-cookie@2.5.0: dependencies: - psl: 1.9.0 + psl: 1.15.0 punycode: 2.3.1 tr46@0.0.3: {} @@ -18626,9 +19579,9 @@ snapshots: traverse@0.6.10: dependencies: - gopd: 1.0.1 + gopd: 1.2.0 typedarray.prototype.slice: 1.0.3 - which-typed-array: 1.1.15 + which-typed-array: 1.1.16 tree-kill@1.2.2: {} @@ -18638,7 +19591,7 @@ snapshots: ts-graphviz@1.8.2: {} - ts-jest@29.2.5(@babel/core@7.25.7)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.25.7))(jest@29.7.0(@types/node@20.16.10)(ts-node@10.9.2(@types/node@20.16.10)(typescript@5.3.3)))(typescript@5.3.3): + ts-jest@29.2.5(@babel/core@7.26.0)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.26.0))(jest@29.7.0(@types/node@20.16.10)(ts-node@10.9.2(@types/node@20.16.10)(typescript@5.3.3)))(typescript@5.3.3): dependencies: bs-logger: 0.2.6 ejs: 3.1.10 @@ -18652,10 +19605,10 @@ snapshots: typescript: 5.3.3 yargs-parser: 21.1.1 optionalDependencies: - '@babel/core': 7.25.7 + '@babel/core': 7.26.0 '@jest/transform': 29.7.0 '@jest/types': 29.6.3 - babel-jest: 29.7.0(@babel/core@7.25.7) + babel-jest: 29.7.0(@babel/core@7.26.0) ts-node@10.9.2(@types/node@20.16.10)(typescript@5.3.3): dependencies: @@ -18665,7 +19618,7 @@ snapshots: '@tsconfig/node14': 1.0.3 '@tsconfig/node16': 1.0.4 '@types/node': 20.16.10 - acorn: 8.12.1 + acorn: 8.14.0 acorn-walk: 8.3.4 arg: 4.1.3 create-require: 1.1.1 @@ -18690,7 +19643,7 @@ snapshots: tslib@1.14.1: {} - tslib@2.7.0: {} + tslib@2.8.1: {} tsscmp@1.0.6: {} @@ -18712,7 +19665,7 @@ snapshots: tuf-js@1.1.7: dependencies: '@tufjs/models': 1.0.4 - debug: 4.3.7 + debug: 4.4.0 make-fetch-happen: 11.1.1 transitivePeerDependencies: - supports-color @@ -18720,7 +19673,7 @@ snapshots: tuf-js@2.2.1: dependencies: '@tufjs/models': 2.0.1 - debug: 4.3.7 + debug: 4.4.0 make-fetch-happen: 13.0.1 transitivePeerDependencies: - supports-color @@ -18760,35 +19713,36 @@ snapshots: typed-array-buffer@1.0.2: dependencies: - call-bind: 1.0.7 + call-bind: 1.0.8 es-errors: 1.3.0 is-typed-array: 1.1.13 typed-array-byte-length@1.0.1: dependencies: - call-bind: 1.0.7 + call-bind: 1.0.8 for-each: 0.3.3 - gopd: 1.0.1 - has-proto: 1.0.3 + gopd: 1.2.0 + has-proto: 1.2.0 is-typed-array: 1.1.13 - typed-array-byte-offset@1.0.2: + typed-array-byte-offset@1.0.3: dependencies: available-typed-arrays: 1.0.7 - call-bind: 1.0.7 + call-bind: 1.0.8 for-each: 0.3.3 - gopd: 1.0.1 - has-proto: 1.0.3 + gopd: 1.2.0 + has-proto: 1.2.0 is-typed-array: 1.1.13 + reflect.getprototypeof: 1.0.8 - typed-array-length@1.0.6: + typed-array-length@1.0.7: dependencies: - call-bind: 1.0.7 + call-bind: 1.0.8 for-each: 0.3.3 - gopd: 1.0.1 - has-proto: 1.0.3 + gopd: 1.2.0 is-typed-array: 1.1.13 possible-typed-array-names: 1.0.0 + reflect.getprototypeof: 1.0.8 typedarray-to-buffer@3.1.5: dependencies: @@ -18796,25 +19750,25 @@ snapshots: typedarray.prototype.slice@1.0.3: dependencies: - call-bind: 1.0.7 + call-bind: 1.0.8 define-properties: 1.2.1 - es-abstract: 1.23.3 + es-abstract: 1.23.5 es-errors: 1.3.0 typed-array-buffer: 1.0.2 - typed-array-byte-offset: 1.0.2 + typed-array-byte-offset: 1.0.3 typedarray@0.0.6: {} - typedoc@0.26.8(typescript@5.3.3): + typedoc@0.26.11(typescript@5.3.3): dependencies: lunr: 2.3.9 markdown-it: 14.1.0 minimatch: 9.0.5 - shiki: 1.22.0 + shiki: 1.24.2 typescript: 5.3.3 - yaml: 2.5.1 + yaml: 2.6.1 - typeorm@0.3.20(ioredis@5.4.1)(mysql2@3.11.3)(redis@3.1.2)(sqlite3@5.1.7)(ts-node@10.9.2(@types/node@20.16.10)(typescript@5.3.3)): + typeorm@0.3.20(ioredis@5.4.1)(mysql2@3.11.5)(redis@3.1.2)(sqlite3@5.1.7)(ts-node@10.9.2(@types/node@20.16.10)(typescript@5.3.3)): dependencies: '@sqltools/formatter': 1.2.5 app-root-path: 3.1.0 @@ -18822,18 +19776,18 @@ snapshots: chalk: 4.1.2 cli-highlight: 2.1.11 dayjs: 1.11.13 - debug: 4.3.7 + debug: 4.4.0 dotenv: 16.4.5 glob: 10.4.5 mkdirp: 2.1.6 reflect-metadata: 0.2.2 sha.js: 2.4.11 - tslib: 2.7.0 + tslib: 2.8.1 uuid: 9.0.1 yargs: 17.7.2 optionalDependencies: ioredis: 5.4.1 - mysql2: 3.11.3 + mysql2: 3.11.5 redis: 3.1.2 sqlite3: 5.1.7 ts-node: 10.9.2(@types/node@20.16.10)(typescript@5.3.3) @@ -18859,12 +19813,10 @@ snapshots: unbox-primitive@1.0.2: dependencies: - call-bind: 1.0.7 + call-bind: 1.0.8 has-bigints: 1.0.2 - has-symbols: 1.0.3 - which-boxed-primitive: 1.0.2 - - undici-types@5.26.5: {} + has-symbols: 1.1.0 + which-boxed-primitive: 1.1.0 undici-types@6.19.8: {} @@ -18943,11 +19895,11 @@ snapshots: upath@2.0.1: {} - update-browserslist-db@1.1.1(browserslist@4.24.0): + update-browserslist-db@1.1.1(browserslist@4.24.3): dependencies: - browserslist: 4.24.0 + browserslist: 4.24.3 escalade: 3.2.0 - picocolors: 1.1.0 + picocolors: 1.1.1 update-notifier@5.1.0: dependencies: @@ -18968,11 +19920,11 @@ snapshots: upper-case-first@2.0.2: dependencies: - tslib: 2.7.0 + tslib: 2.8.1 upper-case@2.0.2: dependencies: - tslib: 2.7.0 + tslib: 2.8.1 uri-js@4.4.1: dependencies: @@ -19018,7 +19970,7 @@ snapshots: mz: 2.7.0 unescape: 1.0.1 - utility@2.1.0: + utility@2.2.0: dependencies: escape-html: 1.0.3 unescape: 1.0.1 @@ -19084,17 +20036,50 @@ snapshots: dependencies: makeerror: 1.0.12 + watchpack@2.4.2: + dependencies: + glob-to-regexp: 0.4.1 + graceful-fs: 4.2.11 + wcwidth@1.0.1: dependencies: defaults: 1.0.4 - web-streams-polyfill@3.3.3: {} - webidl-conversions@3.0.1: {} webidl-conversions@7.0.0: {} - webpod@0.0.2: {} + webpack-sources@3.2.3: {} + + webpack@5.97.1: + dependencies: + '@types/eslint-scope': 3.7.7 + '@types/estree': 1.0.6 + '@webassemblyjs/ast': 1.14.1 + '@webassemblyjs/wasm-edit': 1.14.1 + '@webassemblyjs/wasm-parser': 1.14.1 + acorn: 8.14.0 + browserslist: 4.24.3 + chrome-trace-event: 1.0.4 + enhanced-resolve: 5.17.1 + es-module-lexer: 1.5.4 + eslint-scope: 5.1.1 + events: 3.3.0 + glob-to-regexp: 0.4.1 + graceful-fs: 4.2.11 + json-parse-even-better-errors: 2.3.1 + loader-runner: 4.3.0 + mime-types: 2.1.35 + neo-async: 2.6.2 + schema-utils: 3.3.0 + tapable: 2.2.1 + terser-webpack-plugin: 5.3.11(webpack@5.97.1) + watchpack: 2.4.2 + webpack-sources: 3.2.3 + transitivePeerDependencies: + - '@swc/core' + - esbuild + - uglify-js whatwg-url@13.0.0: dependencies: @@ -19106,13 +20091,29 @@ snapshots: tr46: 0.0.3 webidl-conversions: 3.0.1 - which-boxed-primitive@1.0.2: + which-boxed-primitive@1.1.0: + dependencies: + is-bigint: 1.1.0 + is-boolean-object: 1.2.1 + is-number-object: 1.1.0 + is-string: 1.1.0 + is-symbol: 1.1.1 + + which-builtin-type@1.2.1: dependencies: - is-bigint: 1.0.4 - is-boolean-object: 1.1.2 - is-number-object: 1.0.7 - is-string: 1.0.7 - is-symbol: 1.0.4 + call-bound: 1.0.2 + function.prototype.name: 1.1.6 + has-tostringtag: 1.0.2 + is-async-function: 2.0.0 + is-date-object: 1.1.0 + is-finalizationregistry: 1.1.0 + is-generator-function: 1.0.10 + is-regex: 1.2.1 + is-weakref: 1.1.0 + isarray: 2.0.5 + which-boxed-primitive: 1.1.0 + which-collection: 1.0.2 + which-typed-array: 1.1.16 which-collection@1.0.2: dependencies: @@ -19123,12 +20124,12 @@ snapshots: which-module@2.0.1: {} - which-typed-array@1.1.15: + which-typed-array@1.1.16: dependencies: available-typed-arrays: 1.0.7 - call-bind: 1.0.7 + call-bind: 1.0.8 for-each: 0.3.3 - gopd: 1.0.1 + gopd: 1.2.0 has-tostringtag: 1.0.2 which@1.3.1: @@ -19139,10 +20140,6 @@ snapshots: dependencies: isexe: 2.0.0 - which@3.0.1: - dependencies: - isexe: 2.0.0 - which@4.0.0: dependencies: isexe: 3.1.1 @@ -19174,20 +20171,20 @@ snapshots: worker-timers-broker@6.1.8: dependencies: - '@babel/runtime': 7.25.7 + '@babel/runtime': 7.26.0 fast-unique-numbers: 8.0.13 - tslib: 2.7.0 + tslib: 2.8.1 worker-timers-worker: 7.0.71 worker-timers-worker@7.0.71: dependencies: - '@babel/runtime': 7.25.7 - tslib: 2.7.0 + '@babel/runtime': 7.26.0 + tslib: 2.8.1 worker-timers@7.1.8: dependencies: - '@babel/runtime': 7.25.7 - tslib: 2.7.0 + '@babel/runtime': 7.26.0 + tslib: 2.8.1 worker-timers-broker: 6.1.8 worker-timers-worker: 7.0.71 @@ -19299,7 +20296,7 @@ snapshots: yallist@4.0.0: {} - yaml@2.5.1: {} + yaml@2.6.1: {} yargs-parser@13.1.2: dependencies: @@ -19351,6 +20348,8 @@ snapshots: yocto-queue@0.1.0: {} + yocto-queue@1.1.1: {} + zlogger@1.1.0: dependencies: pumpify: 1.5.1 @@ -19359,20 +20358,7 @@ snapshots: zwitch@2.0.4: {} - zx@7.2.3: - dependencies: + zx@8.2.2: + optionalDependencies: '@types/fs-extra': 11.0.4 - '@types/minimist': 1.2.5 - '@types/node': 18.19.55 - '@types/ps-tree': 1.1.6 - '@types/which': 3.0.4 - chalk: 5.3.0 - fs-extra: 11.2.0 - fx: 35.0.0 - globby: 13.2.2 - minimist: 1.2.8 - node-fetch: 3.3.1 - ps-tree: 1.2.0 - webpod: 0.0.2 - which: 3.0.1 - yaml: 2.5.1 + '@types/node': 20.16.10 diff --git a/web-sample/next-with-jest/.gitignore b/web-sample/next-with-jest/.gitignore new file mode 100644 index 000000000000..fd3dbb571a12 --- /dev/null +++ b/web-sample/next-with-jest/.gitignore @@ -0,0 +1,36 @@ +# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. + +# dependencies +/node_modules +/.pnp +.pnp.js +.yarn/install-state.gz + +# testing +/coverage + +# next.js +/.next/ +/out/ + +# production +/build + +# misc +.DS_Store +*.pem + +# debug +npm-debug.log* +yarn-debug.log* +yarn-error.log* + +# local env files +.env*.local + +# vercel +.vercel + +# typescript +*.tsbuildinfo +next-env.d.ts diff --git a/web-sample/next-with-jest/README.md b/web-sample/next-with-jest/README.md new file mode 100644 index 000000000000..d7dc44ee2288 --- /dev/null +++ b/web-sample/next-with-jest/README.md @@ -0,0 +1,43 @@ +# Next.js + Jest + +This example shows how to configure Jest to work with Next.js. + +This includes Next.js' built-in support for Global CSS, CSS Modules and TypeScript. This example also shows how to use Jest with the App Router and React Server Components. + +> **Note:** Since tests can be co-located alongside other files inside the App Router, we have placed those tests in `app/` to demonstrate this behavior (which is different than `pages/`). You can still place all tests in `__tests__` if you prefer. + +## Deploy your own + +[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https://github.com/vercel/next.js/tree/canary/examples/with-jest&project-name=with-jest&repository-name=with-jest) + +## How to Use + +Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init), [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/), or [pnpm](https://pnpm.io) to bootstrap the example: + +```bash +npx create-next-app --example with-jest with-jest-app +``` + +```bash +yarn create next-app --example with-jest with-jest-app +``` + +```bash +pnpm create next-app --example with-jest with-jest-app +``` + +## Running Tests + +```bash +npm test +``` + +```bash +yarn test +``` + +```bash +pnpm test +``` + +Deploy it to the cloud with [Vercel](https://vercel.com/new?utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). diff --git a/web-sample/next-with-jest/__tests__/__snapshots__/snapshot.tsx.snap b/web-sample/next-with-jest/__tests__/__snapshots__/snapshot.tsx.snap new file mode 100644 index 000000000000..28e364111723 --- /dev/null +++ b/web-sample/next-with-jest/__tests__/__snapshots__/snapshot.tsx.snap @@ -0,0 +1,135 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`renders homepage unchanged 1`] = ` +
+ +
+`; diff --git a/web-sample/next-with-jest/__tests__/snapshot.tsx b/web-sample/next-with-jest/__tests__/snapshot.tsx new file mode 100644 index 000000000000..47501f551140 --- /dev/null +++ b/web-sample/next-with-jest/__tests__/snapshot.tsx @@ -0,0 +1,10 @@ +/** + * @jest-environment jsdom + */ +import { render } from "@testing-library/react"; +import Home from "@/app/page"; + +it("renders homepage unchanged", () => { + const { container } = render(); + expect(container).toMatchSnapshot(); +}); diff --git a/web-sample/next-with-jest/jest.client.config.js b/web-sample/next-with-jest/jest.client.config.js new file mode 100644 index 000000000000..afde621b0748 --- /dev/null +++ b/web-sample/next-with-jest/jest.client.config.js @@ -0,0 +1,15 @@ +const nextJest = require("next/jest"); + +const createJestConfig = nextJest({ + // Provide the path to your Next.js app to load next.config.js and .env files in your test environment + dir: "./", +}); + +// Add any custom config to be passed to Jest +const customJestConfig = { + setupFilesAfterEnv: ["/jest.setup.js"], + testEnvironment: "jsdom", +}; + +// createJestConfig is exported this way to ensure that next/jest can load the Next.js config which is async +module.exports = createJestConfig(customJestConfig); diff --git a/web-sample/next-with-jest/jest.server.config.js b/web-sample/next-with-jest/jest.server.config.js new file mode 100644 index 000000000000..57284a428e47 --- /dev/null +++ b/web-sample/next-with-jest/jest.server.config.js @@ -0,0 +1,19 @@ +const nextJest = require("next/jest"); + +const createJestConfig = nextJest({ + // Provide the path to your Next.js app to load next.config.js and .env files in your test environment + dir: "./", +}); + +// Add any custom config to be passed to Jest +const customJestConfig = { + testEnvironment: "node", + setupFilesAfterEnv: ["/jest.setup.js"], + testMatch: [ + "/test/**/*.test.(ts|tsx|js|jsx)" + ], + forceExit: true, +}; + +// createJestConfig is exported this way to ensure that next/jest can load the Next.js config which is async +module.exports = createJestConfig(customJestConfig); diff --git a/web-sample/next-with-jest/jest.setup.js b/web-sample/next-with-jest/jest.setup.js new file mode 100644 index 000000000000..6b05be33bae4 --- /dev/null +++ b/web-sample/next-with-jest/jest.setup.js @@ -0,0 +1,4 @@ +// Learn more: https://github.com/testing-library/jest-dom +import "@testing-library/jest-dom"; +process.env.__NEXT_TEST_MODE = "jest"; +jest.setTimeout(30000); \ No newline at end of file diff --git a/web-sample/next-with-jest/next.config.mjs b/web-sample/next-with-jest/next.config.mjs new file mode 100644 index 000000000000..d86d7d49a003 --- /dev/null +++ b/web-sample/next-with-jest/next.config.mjs @@ -0,0 +1,25 @@ +/** @type {import('next').NextConfig} */ +const nextConfig = { + eslint: { + ignoreDuringBuilds: true, + }, + typescript: { + ignoreBuildErrors: true, + }, + webpack: (config, { isServer }) => { + if (isServer) { + const externals = [ + '@midwayjs/core', + '@midwayjs/core/functional', + ]; + + config.externals = [ + ...externals, + ...(Array.isArray(config.externals) ? config.externals : []), + ]; + } + return config; + }, +}; + +export default nextConfig; diff --git a/web-sample/next-with-jest/package.json b/web-sample/next-with-jest/package.json new file mode 100644 index 000000000000..4d85673eec0c --- /dev/null +++ b/web-sample/next-with-jest/package.json @@ -0,0 +1,30 @@ +{ + "private": true, + "scripts": { + "dev": "next dev", + "build": "next build", + "start": "next start", + "test:client": "jest -c jest.client.config.js", + "test:server": "jest -c jest.server.config.js", + "dev:server": "MIDWAY_SERVER_ENV=local mwtsc --project tsconfig.midway.json --watch --run @midwayjs/mock/app.js" + }, + "dependencies": { + "next": "~15.0.3", + "react": "^18.2.0", + "react-dom": "^18.2.0", + "@midwayjs/nextjs": "file:../../../packages/nextjs", + "@midwayjs/core": "file:../../../packages/core", + "@midwayjs/koa": "file:../../../packages/koa" + }, + "devDependencies": { + "@testing-library/jest-dom": "6.1.5", + "@testing-library/react": "14.1.2", + "@types/jest": "29.5.11", + "@types/react": "18.2.45", + "jest": "29.7.0", + "jest-environment-jsdom": "29.7.0", + "typescript": "5.3.3", + "@midwayjs/mock": "file:../../../packages/mock", + "mwtsc": "^1.13.0" + } +} diff --git a/web-sample/next-with-jest/src/app/favicon.ico b/web-sample/next-with-jest/src/app/favicon.ico new file mode 100644 index 000000000000..718d6fea4835 Binary files /dev/null and b/web-sample/next-with-jest/src/app/favicon.ico differ diff --git a/web-sample/next-with-jest/src/app/fonts/GeistMonoVF.woff b/web-sample/next-with-jest/src/app/fonts/GeistMonoVF.woff new file mode 100644 index 000000000000..f2ae185cbfd1 Binary files /dev/null and b/web-sample/next-with-jest/src/app/fonts/GeistMonoVF.woff differ diff --git a/web-sample/next-with-jest/src/app/fonts/GeistVF.woff b/web-sample/next-with-jest/src/app/fonts/GeistVF.woff new file mode 100644 index 000000000000..1b62daacff96 Binary files /dev/null and b/web-sample/next-with-jest/src/app/fonts/GeistVF.woff differ diff --git a/web-sample/next-with-jest/src/app/layout.tsx b/web-sample/next-with-jest/src/app/layout.tsx new file mode 100644 index 000000000000..ba65f7781610 --- /dev/null +++ b/web-sample/next-with-jest/src/app/layout.tsx @@ -0,0 +1,19 @@ +import type { Metadata } from "next"; +import React from 'react'; + +export const metadata: Metadata = { + title: "Create Next App", + description: "Generated by create next app", +}; + +export default function RootLayout({ + children, +}: { + children: React.ReactNode +}) { + return ( + + {children} + + ); +} diff --git a/web-sample/next-with-jest/src/app/page.tsx b/web-sample/next-with-jest/src/app/page.tsx new file mode 100644 index 000000000000..3d6489dfcb04 --- /dev/null +++ b/web-sample/next-with-jest/src/app/page.tsx @@ -0,0 +1,11 @@ +import { useInject } from '@midwayjs/core/functional'; + +export default async function Home() { + const result = (await useInject<{ hello(): Promise }>('test')).hello(); + return ( +
+

Hello World

+

{result}

+
+ ); +} diff --git a/web-sample/next-with-jest/src/index.ts b/web-sample/next-with-jest/src/index.ts new file mode 100644 index 000000000000..6b54fcd30bd8 --- /dev/null +++ b/web-sample/next-with-jest/src/index.ts @@ -0,0 +1,39 @@ +import { CustomModuleDetector, Provide } from '@midwayjs/core'; +import { defineConfiguration, useMainApp } from '@midwayjs/core/functional'; +import * as Next from '@midwayjs/nextjs'; +import * as Koa from '@midwayjs/koa'; + +@Provide() +class Test { + async hello() { + return 'hello'; + } +} + +export default defineConfiguration({ + importConfigs: [ + { + default: { + koa: { + keys: ['test'], + port: 3000, + }, + }, + } + ], + imports: [Koa, Next], + detector: new CustomModuleDetector({ + modules: [ + Test, + ] + }), + onReady: async (container) => { + const app = useMainApp(); + app.useMiddleware(async (ctx, next) => { + console.log('middleware'); + await next(); + console.log('middleware end'); + }); + console.log(app.getConfig('next.dev')); + }, +}); diff --git a/web-sample/next-with-jest/test/index.test.ts b/web-sample/next-with-jest/test/index.test.ts new file mode 100644 index 000000000000..cc9202e855e8 --- /dev/null +++ b/web-sample/next-with-jest/test/index.test.ts @@ -0,0 +1,16 @@ +import { createApp, createHttpRequest, close } from '@midwayjs/mock'; +import * as Configuration from '../src/index'; + +describe('index.test.ts', () => { + it('should work with koa and nextjs page router', async () => { + const app = await createApp({ + imports: [Configuration], + }); + const result = await createHttpRequest(app).get('/'); + console.log(result.headers['content-type']); + expect(result.text).toMatch(/Hello World/); + expect(result.status).toBe(200); + + await close(app); + }); +}); diff --git a/web-sample/next-with-jest/tsconfig.json b/web-sample/next-with-jest/tsconfig.json new file mode 100644 index 000000000000..5e84e51d001c --- /dev/null +++ b/web-sample/next-with-jest/tsconfig.json @@ -0,0 +1,43 @@ +{ + "compilerOptions": { + "lib": [ + "dom", + "dom.iterable", + "esnext" + ], + "allowJs": true, + "skipLibCheck": true, + "noEmit": true, + "esModuleInterop": true, + "module": "esnext", + "moduleResolution": "bundler", + "resolveJsonModule": true, + "isolatedModules": true, + "emitDecoratorMetadata": true, + "experimentalDecorators": true, + "jsx": "preserve", + "incremental": true, + "noImplicitAny": false, + "plugins": [ + { + "name": "next" + } + ], + "paths": { + "@/*": [ + "./src/*" + ] + }, + "target": "ES2018", + "strict": false + }, + "include": [ + "next-env.d.ts", + "**/*.ts", + "**/*.tsx", + ".next/types/**/*.ts" + ], + "exclude": [ + "node_modules" + ] +} diff --git a/web-sample/next-with-jest/tsconfig.midway.json b/web-sample/next-with-jest/tsconfig.midway.json new file mode 100644 index 000000000000..10b572e23d4f --- /dev/null +++ b/web-sample/next-with-jest/tsconfig.midway.json @@ -0,0 +1,25 @@ +{ + "compileOnSave": true, + "compilerOptions": { + "target": "ES2020", + "module": "Node16", + "moduleResolution": "node16", + "esModuleInterop": true, + "experimentalDecorators": true, + "emitDecoratorMetadata": true, + "inlineSourceMap": true, + "inlineSources": true, + "noImplicitThis": false, + "noUnusedLocals": true, + "stripInternal": true, + "skipLibCheck": true, + "pretty": true, + "declaration": true, + "forceConsistentCasingInFileNames": true, + "outDir": "dist", + "rootDir": "src" + }, + "include": [ + "src/index.ts" + ] +} \ No newline at end of file