Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

6.x 版本egg dev没有集成ets #242

Closed
evan-lc opened this issue Sep 27, 2023 · 12 comments · Fixed by #248
Closed

6.x 版本egg dev没有集成ets #242

evan-lc opened this issue Sep 27, 2023 · 12 comments · Fixed by #248
Assignees
Labels

Comments

@evan-lc
Copy link

evan-lc commented Sep 27, 2023

如题,6.x版本运行egg dev无法识别declarations配置,不会运行ets生成typings。这个符合预期吗,在changelog里没看到相关信息

@fengmk2
Copy link
Member

fengmk2 commented Sep 27, 2023

给一个可以复现的 repo?

@evan-lc
Copy link
Author

evan-lc commented Sep 27, 2023

@fengmk2 https://stackblitz.com/edit/stackblitz-starters-qkb6hw?description=&file=package.json&title=Egg.js%20Starter
egg-bin的版本是^6,package.json配置了egg.declarations,运行egg-bin没有typings文件,降级egg-bin到4或5是可以的
代码里搜了下egg-ts-helper,应该是重构的时候漏掉了

@fengmk2
Copy link
Member

fengmk2 commented Sep 27, 2023

https://github.com/eggjs/egg-bin/blob/master/scripts/postinstall.js#L40 在 npm install 阶段没有执行 postinstall 吗?

@evan-lc
Copy link
Author

evan-lc commented Sep 27, 2023

https://github.com/eggjs/egg-bin/blob/master/scripts/postinstall.js#L40 在 npm install 阶段没有执行 postinstall 吗?

我不是很理解,是说在postinstall执行ets么,难道更新typings靠重新npm install吗,这不太合理吧,之前都是egg-bin dev的时候执行ets

@evan-lc
Copy link
Author

evan-lc commented Sep 28, 2023

在packag.json加上如下配置可以了
"egg": { "require": "./node_modules/egg-ts-helper/register.js" },
@fengmk2 这属于breaking change了吧

@fengmk2
Copy link
Member

fengmk2 commented Sep 28, 2023

先记个 bug

@fengmk2 fengmk2 added the bug label Sep 28, 2023
@fengmk2 fengmk2 self-assigned this Nov 25, 2023
@fengmk2
Copy link
Member

fengmk2 commented Nov 25, 2023

https://github.com/eggjs/egg-boilerplate-ts/blob/master/boilerplate/_package.json 需要使用 ts 的脚手架,配置加上

  "egg": {
    "typescript": true
  }

@52atlidong
Copy link

https://github.com/eggjs/egg-bin/blob/master/scripts/postinstall.js#L40 在 npm install 阶段没有执行 postinstall 吗?

我不是很理解,是说在postinstall执行ets么,难道更新typings靠重新npm install吗,这不太合理吧,之前都是egg-bin dev的时候执行ets
我也不理解

@evan-lc
Copy link
Author

evan-lc commented Dec 8, 2023

https://github.com/eggjs/egg-boilerplate-ts/blob/master/boilerplate/_package.json 需要使用 ts 的脚手架,配置加上

  "egg": {
    "typescript": true
  }

试了下这个模版,把typing删了再npm run dev并不会重新生成类型声明文件

@malingxin
Copy link

https://github.com/eggjs/egg-boilerplate-ts/blob/master/boilerplate/_package.json 需要使用 ts 的脚手架,配置加上

  "egg": {
    "typescript": true
  }

试了下这个模版,把typing删了再npm run dev并不会重新生成类型声明文件

"egg": { "declarations": true, "typescript": true },

@evan-lc
Copy link
Author

evan-lc commented Dec 8, 2023

https://github.com/eggjs/egg-boilerplate-ts/blob/master/boilerplate/_package.json 需要使用 ts 的脚手架,配置加上

  "egg": {
    "typescript": true
  }

试了下这个模版,把typing删了再npm run dev并不会重新生成类型声明文件

"egg": { "declarations": true, "typescript": true },

一样的,6.x的egg-bin的我试了还是不行

@trylovetom
Copy link

https://github.com/eggjs/egg-boilerplate-ts/blob/master/boilerplate/_package.json 需要使用 ts 的脚手架,配置加上

  "egg": {
    "typescript": true
  }

试了下这个模版,把typing删了再npm run dev并不会重新生成类型声明文件

"egg": { "declarations": true, "typescript": true },

一样的,6.x的egg-bin的我试了还是不行

same problem here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants