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

增加ts的支持 #15

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
Open

增加ts的支持 #15

wants to merge 14 commits into from

Conversation

ShuaiShuaiguo
Copy link

@ShuaiShuaiguo ShuaiShuaiguo commented Jun 8, 2018

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

@codecov
Copy link

codecov bot commented Jun 8, 2018

Codecov Report

Merging #15 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff          @@
##           master    #15   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files           8      7    -1     
  Lines          94     92    -2     
=====================================
- Hits           94     92    -2
Impacted Files Coverage Δ
app/extend/context.js 100% <ø> (ø) ⬆️
lib/loader/graphql-loader.js 100% <100%> (ø)
agent.js 100% <100%> (ø) ⬆️
app.js 100% <100%> (ø) ⬆️

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 0248cb2...ab3006d. Read the comment docs.

README.md Outdated
在项目根目录创建 tshelper.js,并赋值如下代码:

```
module.exports = require("egg-graphql/tshelper");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

感觉这个不应该插件来做

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

是的,看到egg-ts-helper源码中定义了默加载路径,只是提供了对外的配置,没有想到pull-request

@atian25 atian25 requested a review from whxaxes June 21, 2018 00:32
tshelper.js Outdated
const generator = require('./lib/ts-generator/connector');

module.exports = {
watchDirs: {
Copy link
Member

@whxaxes whxaxes Jun 21, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

直接提 PR 到 egg-ts-helper 中吧,不要把生成 d.ts 的功能集成到插件里

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

好的,我试下

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@whxaxes 最近遇到个问题,我自定义的ts文件中的declare module 'egg' {}会覆盖掉egg的index.d.ts,而egg-ts-helper自定义生成的文件却可以合并。请问是怎么合并的?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

你在 declare module 'egg' 前面加个 import ,import 什么都行,然后就能正常合并了......

@alex86w
Copy link

alex86w commented Oct 10, 2018

什么情况 ,为什么不合并呢

@atian25
Copy link
Member

atian25 commented Oct 10, 2018

@whxaxes 这个 PR 进度如何?

@ShuaiShuaiguo 需要 Rebase 下

@zhanba
Copy link

zhanba commented Nov 29, 2018

有进展吗?

@DarrenHou1993
Copy link

没人维护了吗?进度就这么停着?

@yuu2lee4
Copy link

进展如何?

@atian25
Copy link
Member

atian25 commented Feb 12, 2019

看底部,需要 rebase 处理冲突问题。

@Carrotzpc
Copy link

@ShuaiShuaiguo 方便处理下冲突吗?想升级到 egg-bin + egg-ts-helper 的方式,egg-graphql 加载的是 js 文件,导致 egg-bin dev 开发时 app/graphql 文件夹对应 js 文件不会自动生成

@codecov-io
Copy link

Codecov Report

Merging #15 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff          @@
##           master    #15   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files           8      7    -1     
  Lines         110     92   -18     
=====================================
- Hits          110     92   -18
Impacted Files Coverage Δ
app/extend/context.js 100% <ø> (ø) ⬆️
app.js 100% <100%> (ø) ⬆️
agent.js 100% <100%> (ø) ⬆️
lib/loader/graphql-loader.js 100% <100%> (ø)
app/middleware/graphql.js 100% <0%> (ø) ⬆️

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 3d89ee5...045cc34. Read the comment docs.

@codecov-io
Copy link

codecov-io commented Apr 15, 2019

Codecov Report

Merging #15 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff          @@
##           master    #15   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files           8      7    -1     
  Lines         110    102    -8     
=====================================
- Hits          110    102    -8
Impacted Files Coverage Δ
app/extend/context.js 100% <ø> (ø) ⬆️
lib/loader/graphql-loader.js 100% <100%> (ø)
app.js 100% <100%> (ø) ⬆️
agent.js 100% <100%> (ø) ⬆️

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 3d89ee5...3026c75. Read the comment docs.

@ShuaiShuaiguo
Copy link
Author

非常抱歉,由于工作原因且graphql项目始终无法落地,故关注度降低。egg-ts-helper支持请参照,希望提PR

@Carrotzpc
Copy link

@ShuaiShuaiguo 感谢,commits 可能需要 rebase 合并下,egg-ts-helper 后面我可以做下支持

@Carrotzpc
Copy link

自己整合了下代码。。。着急的童鞋可以用这个版本:
https://www.npmjs.com/package/@switchdog/egg-graphql/v/3.1.0-beta.1

@yuu2lee4
Copy link

eggjs/egg#3092

@droplet-js
Copy link

大佬们,啥时候 ts 支持能落地啊 ...

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