egg icon indicating copy to clipboard operation
egg copied to clipboard

egg-ts-helper 运行 npx ets 后,egg 原本的类型不见了

Open MinorN opened this issue 8 months ago • 4 comments

版本如下:

 "dependencies": {
    "egg": "^4.0.0",
  },
  "devDependencies": {
    "@types/node": "22",
    "egg-ts-helper": "^3.1.1",
    "typescript": "^5.1.6"
  }

手动运行 npx ets 后,生成了 typings 文件,但是原本的 egg 类型不见了,如下

Image

MinorN avatar May 13 '25 01:05 MinorN

感谢反馈,我会跟进修复

fengmk2 avatar May 13 '25 01:05 fengmk2

感谢反馈,我会跟进修复

好的感谢

MinorN avatar May 13 '25 02:05 MinorN

你的代码是自己初始化的?少了不少配置,需要加上 egg bin 依赖和 typescript true 配置。egg-ts-helper 不需要单独依赖

我的测试

{
  "egg": {
    "typescript": true
  },
  "scripts": {
    "dev": "egg-bin dev",
    "test": "egg-bin test"
  },
  "dependencies": {
    "egg": "^4.0.0"
  },
  "devDependencies": {
    "@eggjs/bin": "^7.3.1",
    "@types/node": "22",
    "typescript": "^5.1.6"
  }
}

Image

fengmk2 avatar Jun 14 '25 01:06 fengmk2

同遇到

Image Image

yuuk avatar Oct 12 '25 13:10 yuuk