diff --git a/index.d.ts b/index-old.d.ts similarity index 100% rename from index.d.ts rename to index-old.d.ts diff --git a/package.json b/package.json index 2305b92856..8ca4140b68 100644 --- a/package.json +++ b/package.json @@ -60,6 +60,7 @@ "@arethetypeswrong/cli": "^0.15.3", "@eggjs/tsconfig": "1", "@types/koa-bodyparser": "^4.3.12", + "@types/mocha": "^10.0.7", "@types/ms": "^0.7.34", "@types/node": "20", "address": "2", @@ -117,6 +118,10 @@ "require": "./dist/commonjs" } }, + "files": [ + "dist", + "src" + ], "type": "module", "tshy": { "exports": { diff --git a/test/index.test.js b/test/index.test.ts similarity index 80% rename from test/index.test.js rename to test/index.test.ts index 6b52ae6fee..b345f62899 100644 --- a/test/index.test.js +++ b/test/index.test.ts @@ -1,7 +1,5 @@ -'use strict'; - -const assert = require('assert'); -const egg = require('..'); +import { strict as assert } from 'node:assert'; +import * as egg from '../src/index.js'; describe('test/index.test.js', () => { it('should expose properties', () => { diff --git a/tsconfig.json b/tsconfig.json index 7f39495db7..ff41b73422 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,18 +1,10 @@ { + "extends": "@eggjs/tsconfig", "compilerOptions": { - "declaration": true, - "declarationMap": true, - "esModuleInterop": true, - "forceConsistentCasingInFileNames": true, - "inlineSources": true, - "jsx": "react", - "module": "nodenext", - "moduleResolution": "nodenext", - "noUncheckedIndexedAccess": true, - "resolveJsonModule": true, - "skipLibCheck": true, - "sourceMap": true, "strict": true, - "target": "es2022" + "noImplicitAny": true, + "target": "ES2022", + "module": "NodeNext", + "moduleResolution": "NodeNext" } }