feat(contracts): openapi base, error codes, type generation

Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
浅念
2026-09-17 17:04:12 +08:00
parent 9dc530feaf
commit 656498d748
10 changed files with 4360 additions and 8 deletions
+26
View File
@@ -0,0 +1,26 @@
/** @type {import('jest').Config} */
module.exports = {
testEnvironment: 'node',
// 包为 ESM("type": "module"),Jest 以 CJS 运行测试:
// 用内联 tsconfig 覆盖 module/moduleResolution(NodeNext 会按包类型产出 ESM)。
// Task 6 的类型测试沿用此配置。
transform: {
'^.+\\.tsx?$': [
'ts-jest',
{
tsconfig: {
module: 'commonjs',
moduleResolution: 'node10',
target: 'es2022',
strict: true,
esModuleInterop: true,
},
},
],
},
// TS 源码使用 NodeNext 风格的 .js 扩展导入,运行时映射回 .ts。
moduleNameMapper: {
'^(\\.{1,2}/.*)\\.js$': '$1',
},
testPathIgnorePatterns: ['/node_modules/', '/dist/'],
};