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

chore: bump deps version #10

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

Conversation

waitingsong
Copy link
Member

@waitingsong waitingsong commented Oct 25, 2024

  • chalk 保持 v4,因为 v5 是纯 ESM 输出
  • typescript 保持 v4,因为 nodejs v12 不识别 ?? 语法……

跑测试时提示 base.proto 文件中

import "abc.proto";

abc.proto 文件不存在

@codecov-commenter
Copy link

codecov-commenter commented Oct 25, 2024

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 78.48%. Comparing base (f450dff) to head (eafc66b).

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master      #10      +/-   ##
==========================================
- Coverage   80.47%   78.48%   -2.00%     
==========================================
  Files          10       10              
  Lines         251      251              
  Branches       61       64       +3     
==========================================
- Hits          202      197       -5     
+ Misses         49       39      -10     
- Partials        0       15      +15     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@czy88840616
Copy link
Member

typescript 是 dev 依赖,不会装的吧

@waitingsong
Copy link
Member Author

typescript 是 dev 依赖,不会装的吧

嗯,对的。上面删除 node12 和 issue999 是看 ci 能过不。后面会把 node12 恢复,不过 999 那个咋弄?

@waitingsong
Copy link
Member Author

waitingsong commented Oct 26, 2024

nodejs12 太老了,很多js新语法不支持。
这个 jest 里面用到的 ?. 也不行: https://github.com/midwayjs/grpc-helper/actions/runs/11529535156/job/32098059431#step:6:9

@waitingsong
Copy link
Member Author

waitingsong commented Oct 26, 2024

nodejs api 也不兼容(nodejs12 没有 fs.rmSync 方法,又不支持新版本 fs-extra 的 remove())……

@waitingsong
Copy link
Member Author

咋整

@czy88840616
Copy link
Member

czy88840616 commented Oct 26, 2024

反正改的测试嘛,测试就直接拉到 16/jest 29 就行了,低版本代码就经验保证了。

ps:这个工具用的应该不多,grpc 我后面想直接换成nice-grpc了

@waitingsong
Copy link
Member Author

只要升级了 dev 依赖的 fs-extra , nodejs12 单测就过不了, devDeps 的基本保留老版本了。又不想花精力对 nodejs12 的单测单独做修改……

pbjs 和 pbts 啥关系,貌似 pbts 也可以直接生成 ts 声明文件
protobufjs/protobuf.js#1234

@czy88840616
Copy link
Member

生成定义的吧

@waitingsong
Copy link
Member Author

https://midwayjs.org/docs/extensions/grpc#%E9%85%8D%E7%BD%AE%E6%9C%8D%E5%8A%A1
路由集中在 config.ts 中定义感觉没有通过装饰器在类以及方法上面声明来得方便,这个能实现么

@waitingsong
Copy link
Member Author

waitingsong commented Oct 26, 2024

另外,对于 bigint 好像有点问题

message HelloReply {
  string message = 1;
  int64 id = 2;
}

生成的 ts 定义

  export interface HelloReply {
    message?: string
    id?: number  <== 变成了 number,在对返回值赋值的时候导致类型错误。应该是  bigint 或者 string  
  }

实际返回的数据 id 却是 string 类型。

@czy88840616
Copy link
Member

这种就和 rabbitmq 订阅很像,配置少的时候就想放装饰器上,但是一单多了,又觉得装饰器看着难受。。又想放回配置里

@czy88840616
Copy link
Member

另外,对于 bigint 好像有点问题

message HelloReply {
  string message = 1;
  int64 id = 2;
}

生成的 ts 定义

  export interface HelloReply {
    message?: string
    id?: number  <== 变成了 number,在对返回值赋值的时候导致类型错误。应该是  bigint 或者 string  
  }

实际返回的数据 id 却是 string 类型。

所以之前我们用的直接是 nice-grpc + grpc_tools_node_protoc了

@waitingsong
Copy link
Member Author

所以之前我们用的直接是 nice-grpc + grpc_tools_node_protoc了

啥时候整个文档吧

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

Successfully merging this pull request may close these issues.

3 participants