egg-static icon indicating copy to clipboard operation
egg-static copied to clipboard

feat: index.d.ts

Open ahungrynoob opened this issue 6 years ago • 6 comments

Checklist
  • [ ] npm test passes
  • [x] tests and/or benchmarks are included
  • [ ] documentation is changed or added
  • [x] commit message follows commit guidelines
Affected core subsystem(s)
Description of change

ahungrynoob avatar Oct 28 '19 05:10 ahungrynoob

Codecov Report

Merging #19 into master will not change coverage. The diff coverage is n/a.

Impacted file tree graph

@@          Coverage Diff          @@
##           master    #19   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files           3      3           
  Lines          37     37           
=====================================
  Hits           37     37

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 4d7de4f...b26efa3. Read the comment docs.

codecov[bot] avatar Oct 28 '19 05:10 codecov[bot]

建议这么写,这样当引入该声明的时候,就会自动合并声明到 egg 中了

请参考:https://github.com/eggjs/egg-view/blob/master/index.d.ts

同时记得补一下单测,参考:https://eggjs.org/zh-cn/tutorials/typescript.html#%E7%BB%99-egg-%E6%8F%92%E4%BB%B6%E6%8F%90%E4%BA%A4%E5%A3%B0%E6%98%8E%E7%9A%84%E6%97%B6%E5%80%99%E5%A6%82%E4%BD%95%E7%BC%96%E5%86%99%E5%8D%95%E6%B5%8B

whxaxes avatar Oct 28 '19 05:10 whxaxes

egg-static的.d.ts单测依赖egg/index.d.ts的,egg要先发版 @whxaxes

ahungrynoob avatar Oct 28 '19 07:10 ahungrynoob

你可以在 fixtures 里加个 d.ts 手动写一下 import 'egg-static' ,只要这个声明文件加载进来就可以合并进去

whxaxes avatar Oct 28 '19 07:10 whxaxes

https://github.com/eggjs/egg/pull/4012

ahungrynoob avatar Oct 28 '19 07:10 ahungrynoob

其他 LGTM ,不过该更改需要跟 egg 同时发版本

whxaxes avatar Oct 28 '19 07:10 whxaxes