profile
viewpoint
吖猩 whxaxes Alipay Guangzhou, China https://wanghx.cn/ Work hard everyday but no money.

whxaxes/canvas-test 1497

🎮 happy canvas

cnodejs/egg-cnode 1344

CNode 社区 Egg 版本

whxaxes/blog 169

📖 My personal blog

whxaxes/egg-ts-helper 111

🍳 Generate TypeScript definition files(d.ts) for Egg

whxaxes/boom 57

🎧 A music player base on electron-vue

whxaxes/egg-boilerplate-d-ts 44

egg ts boilerplate using d.ts

whxaxes/egg-whistle 13

Using whistle in egg

whxaxes/check-md 11

checks dead links of markdown

eggjs/egg-tslint-to-eslint 9

Migrate tslint-config-egg to eslint-config-egg in ts project.

whxaxes/easy-router 9

Create a Server quickly and easily

push eventeggjs/egg

Ink

commit sha 7b6e4371c7367583627977a0ca4aa2ff66e28429

docs(typescript): Add --noEmit to unittest example code (#4250)

view details

push time in a day

PR merged eggjs/egg

docs(typescript): Add --noEmit to unittest example code to avoid running unittest generation js code

…ing unittest generation js code

<!-- Thank you for your pull request. Please review below requirements. Bug fixes and new features should include tests and possibly benchmarks. Contributors guide: https://github.com/eggjs/egg/blob/master/CONTRIBUTING.md

感谢您贡献代码。请确认下列 checklist 的完成情况。 Bug 修复和新功能必须包含测试,必要时请附上性能测试。 Contributors guide: https://github.com/eggjs/egg/blob/master/CONTRIBUTING.md -->

Checklist

<!-- Remove items that do not apply. For completed items, change [ ] to [x]. -->

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

<!-- Provide affected core subsystem(s). -->

Description of change

<!-- Provide a description of the change below this comment. -->

<!--

  • any feature?
  • close https://github.com/eggjs/egg/ISSUE_URL -->
+8 -2

0 comment

2 changed files

nightink

pr closed time in a day

issue commenteggjs/egg

当socket.io 加入extraHeaders 后,出现跨域问题

提供个可稳定复现的 repo

BGOnline-CN

comment created time in 9 days

issue commentwhxaxes/egg-ts-helper

抽象Service,会导致类型丢失。

嗯,应该是条件类型判断的问题,我修复一下

joey-lucky

comment created time in 9 days

pull request commenteggjs/egg-multipart

fix: 修复 whiteList ts类型注释

2.10.2

cjfff

comment created time in 9 days

created tageggjs/egg-multipart

tag2.10.2

multipart plugin for egg

created time in 9 days

push eventeggjs/egg-multipart

wanghx

commit sha ae5aa117908400f859c6e1cafb838d7a49ba4b04

Release 2.10.2

view details

push time in 9 days

push eventeggjs/egg-multipart

cjf

commit sha ce33219f008e390a7321a8dfb52e887ca2d6aa71

fix: definition of config.whitelist (#43) Co-authored-by: cjfff <cjfff1996@gmali.com>

view details

push time in 9 days

PR merged eggjs/egg-multipart

fix: 修复 whiteList ts类型注释

错误信息

image

此处代码贡献只是做了类型修复,就不做性能测试啥的了。

源码中一共有三种情况

  1. whiteList 是一个函数
  2. whiteList 是一个数组
  3. whiteList 为空

image

然后原本的类型注释是这样的

whitelist?: (() => string[])|string[];

这里应该为函数返回 boolean 属性才对。

whitelist?: ((filename: string) => boolean)|string[];
+1 -1

1 comment

1 changed file

cjfff

pr closed time in 9 days

issue commenteggjs/egg

当socket.io 加入extraHeaders 后,出现跨域问题

没看懂你的问题,egg-socket.io 自定义请求头是什么意思。

BGOnline-CN

comment created time in 9 days

issue commentwhxaxes/egg-ts-helper

添加 egg-socket.io 和 egg-graphql 支持

@v7lin 你可以试一下。。。。我这边没有用过 graphql 。。。不太好验证

v7lin

comment created time in 19 days

issue commentwhxaxes/egg-ts-helper

添加 egg-socket.io 和 egg-graphql 支持

https://github.com/whxaxes/egg-ts-helper/blob/master/README.zh-CN.md#generator 可以尝试用 generator 配置自动生成 d.ts

v7lin

comment created time in 20 days

push eventwhxaxes/egg-ts-helper

snyk-bot

commit sha a0d825d4938fce93033a1275cb7285721ccc037f

fix: package.json to reduce vulnerabilities The following vulnerabilities are fixed with an upgrade: - https://snyk.io/vuln/SNYK-JS-MINIMIST-559764

view details

push time in a month

Pull request review commenteggjs/egg-rest

feat: support load typescript file

 module.exports = app => {         continue;       } -      if (stat.isFile() && path.extname(name) === '.js') {+      if (stat.isFile() && [ '.js', '.ts' ].includes(path.extname(name))) {         let handler = require(filepath);

这里直接 require 也会有问题,ts compile 出来的 js 是 esm ,模块内容是挂在 default 中的

sabakugaara

comment created time in a month

Pull request review commenteggjs/egg-rest

feat: support load typescript file

 module.exports = app => {         continue;       } -      if (stat.isFile() && path.extname(name) === '.js') {+      if (stat.isFile() && [ '.js', '.ts' ].includes(path.extname(name))) {

这里感觉有问题,如果项目下刚好同时存在同名的 .js 和 .ts 文件,但是又没有使用 ts-node ,下面的 require 就会出问题

sabakugaara

comment created time in a month

pull request commenteggjs/egg-rest

feat: support load typescript file

补一下单测

sabakugaara

comment created time in a month

created tagwhxaxes/egg-ts-helper

tag1.25.7

🍳 Generate TypeScript definition files(d.ts) for Egg

created time in a month

push eventwhxaxes/egg-ts-helper

wanghx

commit sha 9203ba8b70ded22fc60941303ea7f69aa57b9a04

Release 1.25.7

view details

push time in a month

issue commentwhxaxes/egg-ts-helper

webstorm

@duncup 有空的话,帮忙验证一下上面那种做法?我这边没有 webstorm 的 license 了 ...

duncup

comment created time in a month

push eventwhxaxes/egg-ts-helper

吖猩

commit sha 29b6299118f814173d12c5e83569c08559ab3384

fix: service is method (#58) * fix: service is method * fix: ci

view details

push time in a month

PR merged whxaxes/egg-ts-helper

fix: service is method

<!-- Thank you for your pull request. Please review below requirements. Bug fixes and new features should include tests and possibly benchmarks. Contributors guide: https://github.com/eggjs/egg/blob/master/CONTRIBUTING.md

感谢您贡献代码。请确认下列 checklist 的完成情况。 Bug 修复和新功能必须包含测试,必要时请附上性能测试。 Contributors guide: https://github.com/eggjs/egg/blob/master/CONTRIBUTING.md -->

Checklist

<!-- Remove items that do not apply. For completed items, change [ ] to [x]. -->

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

<!-- Provide affected core subsystem(s). -->

Description of change

<!-- Provide a description of the change below this comment. -->

+8 -8

1 comment

3 changed files

whxaxes

pr closed time in a month

push eventwhxaxes/egg-ts-helper

wanghx

commit sha eb2fb142b20c406015f4b6eb5b417ab44c143784

fix: ci

view details

push time in a month

push eventwhxaxes/egg-ts-helper

wanghx

commit sha cf24c7ca1ef5aa32a76d7e29b7aedbb4fe97de88

fix: service is method

view details

push time in a month

PR opened whxaxes/egg-ts-helper

fix: service is method

<!-- Thank you for your pull request. Please review below requirements. Bug fixes and new features should include tests and possibly benchmarks. Contributors guide: https://github.com/eggjs/egg/blob/master/CONTRIBUTING.md

感谢您贡献代码。请确认下列 checklist 的完成情况。 Bug 修复和新功能必须包含测试,必要时请附上性能测试。 Contributors guide: https://github.com/eggjs/egg/blob/master/CONTRIBUTING.md -->

Checklist

<!-- Remove items that do not apply. For completed items, change [ ] to [x]. -->

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

<!-- Provide affected core subsystem(s). -->

Description of change

<!-- Provide a description of the change below this comment. -->

+1 -1

0 comment

1 changed file

pr created time in a month

create barnchwhxaxes/egg-ts-helper

branch : fix-service-is-method

created branch time in a month

create barnchwhxaxes/egg-ts-helper

branch : change-to-eslint

created branch time in a month

pull request commenteggjs/egg-graphql

feat: support typescript

@whlsxl 对,在 test/fixtures 下加个 ts 的 example ,然后加个 test case 跑一下

bobo1133

comment created time in 2 months

Pull request review commentwhxaxes/egg-ts-helper

feat: hack support for webstorm(intellij)

 export default function(config: TsGenConfig, baseConfig: TsHelperConfig) {   return {     dist: path.resolve(config.dtsDir, 'index.d.ts'),     content:+      `import { Context, IService } from '${baseConfig.framework}';\n` +       `export * from '${baseConfig.framework}';\n` +-      'export as namespace Egg;\n',+      'export as namespace Egg;\n\n' ++      `\/\/ hack support for webstorm (intellij)+declare module 'egg' {+  export interface Context {+    service: IService;

好,我待会验证一下

zhangciwu

comment created time in 2 months

pull request commenteggjs/egg-graphql

feat: support typescript

看逻辑没啥问题,补充一下单测吧

bobo1133

comment created time in 2 months

Pull request review commentwhxaxes/egg-ts-helper

feat: hack support for webstorm(intellij)

 export default function(config: TsGenConfig, baseConfig: TsHelperConfig) {   return {     dist: path.resolve(config.dtsDir, 'index.d.ts'),     content:+      `import { Context, IService } from '${baseConfig.framework}';\n` +       `export * from '${baseConfig.framework}';\n` +-      'export as namespace Egg;\n',+      'export as namespace Egg;\n\n' ++      `\/\/ hack support for webstorm (intellij)+declare module 'egg' {+  export interface Context {+    service: IService;

我知道这是追加,但是 webstorm 不是识别不到 egg 的声明么,那这样新加个声明它就可以识别到了?

zhangciwu

comment created time in 2 months

Pull request review commentwhxaxes/egg-ts-helper

feat: hack support for webstorm(intellij)

 export default function(config: TsGenConfig, baseConfig: TsHelperConfig) {   return {     dist: path.resolve(config.dtsDir, 'index.d.ts'),     content:+      `import { Context, IService } from '${baseConfig.framework}';\n` +       `export * from '${baseConfig.framework}';\n` +-      'export as namespace Egg;\n',+      'export as namespace Egg;\n\n' ++      `\/\/ hack support for webstorm (intellij)+declare module 'egg' {+  export interface Context {+    service: IService;

这样不是导致 ctx 只有一个 service 属性了么 ...

zhangciwu

comment created time in 2 months

push eventwhxaxes/egg-ts-helper

snyk-bot

commit sha 86020d7009600507c3887b62181edac5cab6fb74

fix: package.json to reduce vulnerabilities The following vulnerabilities are fixed with an upgrade: - https://snyk.io/vuln/SNYK-JS-DOTPROP-543489

view details

push time in 2 months

create barnchwhxaxes/egg-ts-helper

branch : snyk-fix-f070f9c3ea5a6bf1ef61cd9692a42bf6

created branch time in 2 months

push eventwhxaxes/egg-ast-utils

snyk-bot

commit sha bfc4767896534cf867190b1584090de62d002caa

fix: package.json to reduce vulnerabilities The following vulnerabilities are fixed with an upgrade: - https://snyk.io/vuln/SNYK-JS-KINDOF-537849

view details

push time in 3 months

create barnchwhxaxes/egg-ast-utils

branch : snyk-fix-da8e4b40c448b0440045ae846abde132

created branch time in 3 months

Pull request review commenteggjs/eslint-config-egg

fix: unused vars rule

 sudo: false language: node_js node_js:-  - '8'

支持呀

sang4lv

comment created time in 3 months

pull request commenteggjs/eslint-config-egg

fix: unused vars rule

8.0.1

sang4lv

comment created time in 3 months

created tageggjs/eslint-config-egg

tag8.0.1

Node Style Guide for Egg.

created time in 3 months

push eventeggjs/eslint-config-egg

wanghx

commit sha 483777ee69c55819d17b4d215f9b7112bc8cc8c5

Release 8.0.1

view details

push time in 3 months

push eventeggjs/eslint-config-egg

Angela

commit sha 2591d1d2b64ba89c0a6f27b537d7706e5e4b3ce7

fix: unused vars rule (#50) * fix: unused-vars is now valid * chore: update CI generated config * feat: turn on unused-vars check * chore: force CI refresh * feat: unused-vars should check local variables only * fix: update trailing comma test case

view details

push time in 3 months

PR merged eggjs/eslint-config-egg

fix: unused vars rule

<!-- Thank you for your pull request. Please review below requirements. Bug fixes and new features should include tests and possibly benchmarks. Contributors guide: https://github.com/eggjs/egg/blob/master/CONTRIBUTING.md

感谢您贡献代码。请确认下列 checklist 的完成情况。 Bug 修复和新功能必须包含测试,必要时请附上性能测试。 Contributors guide: https://github.com/eggjs/egg/blob/master/CONTRIBUTING.md -->

Checklist

<!-- Remove items that do not apply. For completed items, change [ ] to [x]. -->

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

<!-- Provide affected core subsystem(s). -->

Description of change

<!-- Provide a description of the change below this comment. -->

add no-unused-vars rule which is prerequisite for rule @typescript-eslint/no-unused-vars. New test case is included, CI config updated.

+31 -12

0 comment

11 changed files

sang4lv

pr closed time in 3 months

pull request commenteggjs/egg-boilerplate-ts

feat: change tslint to eslint

1.7.0

whxaxes

comment created time in 3 months

created tageggjs/egg-boilerplate-ts

tag1.7.0

Boilerplate for egg typescript project

created time in 3 months

push eventeggjs/egg-boilerplate-ts

wanghx

commit sha d84ff6a45d1d3a4d44a45a6bedf3ed21cf2c25a1

Release 1.7.0

view details

push time in 3 months

delete branch eggjs/egg-boilerplate-ts

delete branch : update-to-eslint

delete time in 3 months

push eventeggjs/egg-boilerplate-ts

吖猩

commit sha 144f5ae09d6e196e92c3183a73d6bc26cb1795c0

feat: change tslint to eslint (#17) * feat: update to eslint * chore: add .vscode * feat: update node version

view details

push time in 3 months

PR merged eggjs/egg-boilerplate-ts

feat: change tslint to eslint

<!-- Thank you for your pull request. Please review below requirements. Bug fixes and new features should include tests and possibly benchmarks. Contributors guide: https://github.com/eggjs/egg/blob/master/CONTRIBUTING.md

感谢您贡献代码。请确认下列 checklist 的完成情况。 Bug 修复和新功能必须包含测试,必要时请附上性能测试。 Contributors guide: https://github.com/eggjs/egg/blob/master/CONTRIBUTING.md -->

Checklist

<!-- Remove items that do not apply. For completed items, change [ ] to [x]. -->

  • [x] 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)

<!-- Provide affected core subsystem(s). -->

Change tslint to eslint.

Description of change

<!-- Provide a description of the change below this comment. -->

+30 -10

1 comment

9 changed files

whxaxes

pr closed time in 3 months

push eventwhxaxes/blog

wanghx

commit sha fb8d46d2cec6883149faa2bffe08cc6c7503d321

feat: add copyright

view details

push time in 3 months

issue commenteggjs/egg

eggjs-ts 使用egg-sequelize的datasources 抛出:Property 'appOneModel' does not exist on type 'Application'.

那你需要先对着 ts 官方文档系统学习一下,不要一下子步子跨的太大

smallos

comment created time in 3 months

issue commenteggjs/egg

eggjs-ts 使用egg-sequelize的datasources 抛出:Property 'appOneModel' does not exist on type 'Application'.

参考 https://github.com/eggjs/examples/tree/master/sequelize-ts

smallos

comment created time in 3 months

created tageggjs/egg-passport

tag2.1.1

passport plugin for egg

created time in 3 months

push eventeggjs/egg-passport

wanghx

commit sha 9ae5c783cbdc36ede2456f0a4d0410105afcb04a

Release 2.1.1

view details

push time in 3 months

push eventeggjs/egg-passport

lightrabbit

commit sha 9b93fa30906848d58c161f3a62a390ca5273eb65

fix: index.d.ts extends IMountOptions by AuthenticateOptions. (#13)

view details

push time in 3 months

PR merged eggjs/egg-passport

Reviewers
fix: index.d.ts extends IMountOptions by AuthenticateOptions.

<!-- Thank you for your pull request. Please review below requirements. Bug fixes and new features should include tests and possibly benchmarks. Contributors guide: https://github.com/eggjs/egg/blob/master/CONTRIBUTING.md

感谢您贡献代码。请确认下列 checklist 的完成情况。 Bug 修复和新功能必须包含测试,必要时请附上性能测试。 Contributors guide: https://github.com/eggjs/egg/blob/master/CONTRIBUTING.md -->

Checklist

<!-- Remove items that do not apply. For completed items, change [ ] to [x]. -->

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

<!-- Provide affected core subsystem(s). -->

Description of change

<!-- Provide a description of the change below this comment. --> 完善了声明文件,passport.mount 中的 options 参数会传递给 passport.authenticate,所以passport.mountoptions 参数也应该拥有 passport.authenticateoptions 参数中的选项。

+3 -3

3 comments

1 changed file

lightrabbit

pr closed time in 3 months

more