Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
752811d
fix: prepare packages for typescript 7
czy88840616 Aug 14, 2026
3fe1eca
fix: handle raw-body interop in fc starter
czy88840616 Aug 15, 2026
84928cf
fix: handle koa body parser interop
czy88840616 Aug 15, 2026
443278c
fix: include jest types in test compilation
czy88840616 Aug 15, 2026
40da57f
fix: enable interop for test compilation
czy88840616 Aug 15, 2026
fa43b14
fix: update test interop imports
czy88840616 Aug 15, 2026
3dd89e7
fix: update remaining coverage test imports
czy88840616 Aug 15, 2026
0e53a3c
fix: update faas test interop
czy88840616 Aug 15, 2026
f3837bf
fix: resolve koa coverage imports
czy88840616 Aug 16, 2026
2b6b791
fix: handle mongoose interop
czy88840616 Aug 16, 2026
9cbac27
fix: wait for redis service subscriptions
czy88840616 Aug 16, 2026
08dcd7c
fix: handle express session interop
czy88840616 Aug 16, 2026
75ce051
fix: handle i18n picomatch interop
czy88840616 Aug 16, 2026
0ccae8c
fix: handle security utility interop
czy88840616 Aug 16, 2026
09221e2
fix: update bullmq assert import
czy88840616 Aug 16, 2026
ea6d7d3
fix: update assert test imports
czy88840616 Aug 16, 2026
d6a6ac9
fix: handle cache manager interop
czy88840616 Aug 16, 2026
49f9d6c
fix: handle info service interop
czy88840616 Aug 16, 2026
a8bc909
fix: update axios test imports
czy88840616 Aug 16, 2026
3eef62a
fix: handle http proxy interop
czy88840616 Aug 16, 2026
fc87d6f
fix: handle static middleware interop
czy88840616 Aug 16, 2026
1c00f60
fix: handle process agent interop
czy88840616 Aug 16, 2026
1c92caf
fix: update swagger parser import
czy88840616 Aug 16, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages-serverless/midway-fc-starter/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
AbstractBootstrapStarter,
IFaaSConfigurationOptions,
} from '@midwayjs/faas';
import * as getRawBody from 'raw-body';
import getRawBody from 'raw-body';
import { IncomingMessage } from 'http';
import { mockContext } from './mock';
import { InitializeContext } from './interface';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { context } from './context';
import { request } from './request';
import { response } from './response';
import * as only from 'only';
import only from 'only';
import { EventEmitter } from 'events';
import { format } from 'util';

Expand Down
2 changes: 1 addition & 1 deletion packages-serverless/serverless-http-parser/src/context.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as util from 'util';
import * as createError from 'http-errors';
import createError from 'http-errors';
import { Cookies } from '@midwayjs/cookies';

const COOKIES = Symbol('context#cookies');
Expand Down
2 changes: 1 addition & 1 deletion packages-serverless/serverless-http-parser/src/http/req.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { is as typeis } from 'type-is';
import * as qs from 'querystring';
import * as parseurl from 'parseurl';
import parseurl from 'parseurl';
import { isPlainObject } from '../util';

const EVENT = Symbol.for('ctx#event');
Expand Down
4 changes: 2 additions & 2 deletions packages-serverless/serverless-http-parser/src/request.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { is as typeis } from 'type-is';
import * as accepts from 'accepts';
import accepts from 'accepts';
import * as qs from 'querystring';
import * as only from 'only';
import only from 'only';
import { isPlainObject } from './util';

const BODY = Symbol.for('ctx#body');
Expand Down
10 changes: 5 additions & 5 deletions packages-serverless/serverless-http-parser/src/response.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import * as getType from 'cache-content-type';
import getType from 'cache-content-type';
import * as assert from 'assert';
import * as statuses from 'statuses';
import { is as typeis } from 'type-is';
import * as encodeUrl from 'encodeurl';
import * as escape from 'escape-html';
import * as only from 'only';
import * as vary from 'vary';
import encodeUrl from 'encodeurl';
import escape from 'escape-html';
import only from 'only';
import vary from 'vary';

export const response = {
_explicitStatus: false,
Expand Down
4 changes: 2 additions & 2 deletions packages-serverless/serverless-http-parser/test/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as assert from 'assert';
import assert from 'assert';
import { Application, HTTPRequest, HTTPResponse } from '../src';
import * as mm from 'mm';
import mm from 'mm';
import { createReadStream, createWriteStream, readFileSync } from 'fs';
import { join } from 'path';

Expand Down
2 changes: 1 addition & 1 deletion packages/axios/test/factory.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { join } from 'path';
import { HttpServiceFactory } from '../src';
import { close, createLightApp } from '@midwayjs/mock';
import * as nock from 'nock';
import nock from 'nock';
import { MidwayTraceService } from '@midwayjs/core';

describe('/test/factory.test.ts', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/axios/test/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { join } from 'path';
import { HttpService, Axios } from '../src';
import { createLightApp } from '@midwayjs/mock';
import * as nock from 'nock';
import nock from 'nock';

describe('/test/index.test.ts', () => {
let httpService: any;
Expand Down
2 changes: 1 addition & 1 deletion packages/bootstrap/test/bootstrap.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { fork } from 'child_process';
import { join } from 'path';
import { sleep } from '@midwayjs/core';
import * as request from 'request';
import request from 'request';
import { io as socketClient } from 'socket.io-client';

describe('/test/bootstrap.test.ts', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/bootstrap/test/fork/cp.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ClusterManager } from '../../src';
import { join } from 'path';
import * as request from 'request';
import request from 'request';
import { sleep } from '../../src/util';
const cluster = require('cluster');

Expand Down
2 changes: 1 addition & 1 deletion packages/bootstrap/test/fork/thread.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { join } from 'path';
import * as request from 'request';
import request from 'request';
import { sleep } from '../../src/util';
import { ThreadManager } from '../../src/manager/thread';
const cluster = require('cluster');
Expand Down
2 changes: 1 addition & 1 deletion packages/bullmq/test/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
import * as bullmq from '../src';
import { Processor, Application, IProcessor, Context } from '../src';
import { JobsOptions, Job } from 'bullmq';
import * as assert from 'node:assert';
import assert from 'node:assert';

describe(`/test/index.test.ts`, () => {
it('test auto repeat processor', async () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/busboy/src/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import {
import { parseMultipart } from './parse';
import { fromBuffer } from 'file-type';
import { formatExt, streamToAsyncIterator } from './utils';
import * as busboy from 'busboy';
import busboy from 'busboy';
import { BusboyConfig } from 'busboy';
import { EXT_KEY } from './constants';

Expand Down
2 changes: 1 addition & 1 deletion packages/busboy/test/express.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { createHttpRequest, close, createLegacyApp } from '@midwayjs/mock';
import { join } from 'path';
import * as assert from 'assert';
import assert from 'assert';
import { statSync } from 'fs';

describe.skip('test/express.test.ts', function () {
Expand Down
2 changes: 1 addition & 1 deletion packages/busboy/test/faas.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { createHttpRequest, close, createLegacyFunctionApp } from '@midwayjs/mock';
import { join } from 'path';
import * as assert from 'assert';
import assert from 'assert';
import { existsSync, statSync } from 'fs';
import { Framework } from '@midwayjs/faas';

Expand Down
2 changes: 1 addition & 1 deletion packages/busboy/test/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { createHttpRequest, createLightApp, close } from '@midwayjs/mock';
import * as koa from '@midwayjs/koa';
import { join } from 'path';
import { createWriteStream, statSync, writeFileSync, unlinkSync, existsSync } from 'fs';
import * as assert from 'assert';
import assert from 'assert';
import { Controller, createMiddleware, Post } from '@midwayjs/core';
import { tmpdir } from 'os';
import { UploadMiddleware, UploadStreamFileInfo } from '../src';
Expand Down
2 changes: 1 addition & 1 deletion packages/busboy/test/koa.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import * as koa from '@midwayjs/koa';
import * as busboy from '../src';
import { Controller, createMiddleware, Fields, Files, Post, File } from "@midwayjs/core";
import { ensureDir, removeSync } from "fs-extra";
import * as assert from 'assert';
import assert from 'assert';
import { tmpdir } from "os";
import { randomUUID } from "node:crypto";

Expand Down
2 changes: 1 addition & 1 deletion packages/busboy/test/web.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { createHttpRequest, close, createLegacyApp } from '@midwayjs/mock';
import { join } from 'path';
import * as assert from 'assert';
import assert from 'assert';
import { statSync } from 'fs';

describe.skip('test/web.test.ts', function () {
Expand Down
4 changes: 2 additions & 2 deletions packages/cache-manager/src/base/store.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as LRUCache from 'lru-cache';
import * as cloneDeep from 'lodash.clonedeep';
import LRUCache from 'lru-cache';
import cloneDeep from 'lodash.clonedeep';
import { MemoryConfig, MemoryStore, LRU } from './types';

function clone<T>(object: T): T {
Expand Down
2 changes: 1 addition & 1 deletion packages/captcha/src/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
} from '@midwayjs/core';
import { CachingFactory, MidwayCache } from '@midwayjs/cache-manager';
import * as svgCaptcha from 'svg-captcha-fixed';
import * as svgBase64 from 'mini-svg-data-uri';
import svgBase64 from 'mini-svg-data-uri';
import { nanoid } from 'nanoid';
import {
FormulaCaptchaOptions,
Expand Down
8 changes: 4 additions & 4 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,14 @@
},
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.js",
"require": "./dist/index.js",
"types": "./dist/index.d.ts"
"require": "./dist/index.js"
},
"./functional": {
"types": "./dist/functional/index.d.ts",
"import": "./dist/functional/index.js",
"require": "./dist/functional/index.js",
"types": "./dist/functional/index.d.ts"
"require": "./dist/functional/index.js"
}
}
}
2 changes: 1 addition & 1 deletion packages/core/src/context/managedResolverFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {
ScopeEnum,
} from '../interface';
import * as util from 'util';
import * as EventEmitter from 'events';
import { EventEmitter } from 'events';
import {
MidwayCommonError,
MidwayDefinitionNotFoundError,
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/service/aspectService.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as pm from 'picomatch';
import pm from 'picomatch';
import {
IMidwayContainer,
AspectMetadata,
Expand Down
4 changes: 2 additions & 2 deletions packages/core/test/baseFramework.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as assert from 'assert';
import assert from 'assert';
import * as path from 'path';
import * as mm from 'mm';
import mm from 'mm';
import {
getCurrentApplicationContext,
getCurrentMainApp,
Expand Down
2 changes: 1 addition & 1 deletion packages/core/test/common/asyncContextManager.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

import * as assert from 'assert';
import assert from 'assert';
import { EventEmitter } from 'events';
import { ASYNC_ROOT_CONTEXT, AsyncLocalStorageContextManager } from '../../src/common/asyncContextManager';

Expand Down
2 changes: 1 addition & 1 deletion packages/core/test/common/contextManager.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as assert from 'assert';
import assert from 'assert';
import { NoopContextManager, ASYNC_ROOT_CONTEXT } from '../../src/common/asyncContextManager';

/** Get a key to uniquely identify a context value */
Expand Down
2 changes: 1 addition & 1 deletion packages/core/test/common/dataSourceManager.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { DataSourceManager, sleep } from '../../src';
import { join } from 'path';
import * as assert from 'assert';
import assert from 'assert';

describe('test/common/dataSourceManager.test.ts', () => {

Expand Down
2 changes: 1 addition & 1 deletion packages/core/test/context/midwayContainer.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import {
} from '../../src';
import { App } from '../fixtures/ts-app-inject/app';
import { TestCons } from '../fixtures/ts-app-inject/test';
import * as assert from 'assert';
import assert from 'assert';
import { ComponentConfigurationLoader } from '../../src/context/componentLoader';
import { defineConfiguration } from '../../src/functional';

Expand Down
2 changes: 1 addition & 1 deletion packages/core/test/decorator/util/uuid.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Utils } from '../../../src';
import * as assert from 'assert';
import assert from 'assert';

describe('test/util/uuid.test.ts', () => {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Aspect, IMethodAspect, JoinPoint, Provide } from '../../../../../src';
import { Home } from '../home';
import * as assert from 'assert';
import assert from 'assert';

@Provide()
@Aspect([Home])
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Aspect, IMethodAspect, JoinPoint, Provide } from '../../../../../src';
import { Home } from '../home';
import * as assert from 'assert';
import assert from 'assert';

@Provide()
@Aspect([Home], '*2', 1)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Aspect, IMethodAspect, JoinPoint, Provide } from '../../../../../src';
import { UserController } from '../home';
import * as assert from 'assert';
import assert from 'assert';

@Provide()
@Aspect([UserController])
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Configuration, App, Logger, IMidwayApplication } from '../../../../src';
import * as assert from 'assert';
import assert from 'assert';
import { ILogger } from '@midwayjs/logger';

@Configuration()
Expand Down
2 changes: 1 addition & 1 deletion packages/core/test/logger.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { MidwayContextLogger } from '@midwayjs/logger';
import { join } from 'path';
import * as mm from 'mm';
import mm from 'mm';
import { tmpdir } from 'os';
import { existsSync } from 'fs';
import { createLightFramework } from './util';
Expand Down
2 changes: 1 addition & 1 deletion packages/core/test/proxy.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as assert from 'assert';
import assert from 'assert';
import { extend } from '../src';

describe('/test/proxy.test.ts', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/core/test/response/http.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// import whyIsNodeRunning from 'why-is-node-running'
import * as EventSource from 'eventsource';
import EventSource from 'eventsource';
import { HttpServerResponse, ServerSendEventMessage, sleep } from '../../src';
import { createServer, request, ServerResponse } from 'http';
import { join } from 'path';
Expand Down
2 changes: 1 addition & 1 deletion packages/core/test/service/aspectService.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as assert from 'assert';
import assert from 'assert';

import { MidwayAspectService, MidwayContainer } from '../../src';

Expand Down
2 changes: 1 addition & 1 deletion packages/core/test/service/configService.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import assert = require('assert');
import { resolve, join } from 'path';
import { MidwayContainer, MidwayConfigService, MidwayInformationService, MidwayEnvironmentService, MidwayInvalidConfigError } from '../../src';
import * as mm from 'mm';
import mm from 'mm';

async function createConfigService(): Promise<MidwayConfigService> {
const container = new MidwayContainer();
Expand Down
2 changes: 1 addition & 1 deletion packages/core/test/service/middlewareService.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Provide, MidwayMiddlewareService, MidwayContainer, Init, IgnoreMatcher, createMiddleware } from '../../src';
import * as assert from 'assert';
import assert from 'assert';

describe('/test/services/middlewareService.test.ts', () => {

Expand Down
2 changes: 1 addition & 1 deletion packages/core/test/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import {
} from '../src';
import { join } from 'path';
import * as http from 'http';
import * as getRawBody from 'raw-body';
import getRawBody from 'raw-body';

/**
* 任意一个数组中的对象,和预期的对象属性一致即可
Expand Down
2 changes: 1 addition & 1 deletion packages/core/test/util/path-match.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { pathMatching as match } from '../../src/';
import * as assert from 'assert';
import assert from 'assert';

describe('/test/util/path-matching.test.ts', () => {
it('options.match and options.ignore both present should throw', () => {
Expand Down
4 changes: 2 additions & 2 deletions packages/core/test/util/util.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as assert from 'assert';
import assert from 'assert';
import { join } from 'path';
import {
safeRequire,
Expand All @@ -14,7 +14,7 @@ import {
sleep,
} from '../../src/util';
import { PathFileUtils } from '../../src';
import * as EventEmitter from 'events';
import { EventEmitter } from 'events';
import { fork } from 'child_process';

describe('/test/util/util.test.ts', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/cos/src/manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
MidwayTraceService,
} from '@midwayjs/core';
import * as assert from 'assert';
import * as COS from 'cos-nodejs-sdk-v5';
import COS from 'cos-nodejs-sdk-v5';

@Provide()
@Scope(ScopeEnum.Singleton)
Expand Down
4 changes: 2 additions & 2 deletions packages/express-session/src/middleware/session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import {
MidwayConfigMissingError,
MidwayConfigService,
} from '@midwayjs/core';
import * as session from 'express-session';
import * as cookieSession from 'cookie-session';
import session from 'express-session';
import cookieSession from 'cookie-session';
import { SessionStoreManager } from '../store';

@Middleware()
Expand Down
Loading
Loading