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

feat: add typescript support #28

Merged
merged 6 commits into from
Dec 29, 2018
Merged

feat: add typescript support #28

merged 6 commits into from
Dec 29, 2018

Conversation

whxaxes
Copy link
Contributor

@whxaxes whxaxes commented Dec 28, 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

add typescript support

index.d.ts Outdated
rawArgv: string[];
env: PlainObject;
argv: Arguments<PlainObject>;
}
Copy link
Member

Choose a reason for hiding this comment

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

不止这些的,还有 execArgv, execArgvObj 等几个

Copy link
Contributor Author

Choose a reason for hiding this comment

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

加上了

@codecov
Copy link

codecov bot commented Dec 28, 2018

Codecov Report

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

Impacted file tree graph

@@           Coverage Diff           @@
##           master      #28   +/-   ##
=======================================
  Coverage   97.52%   97.52%           
=======================================
  Files           3        3           
  Lines         202      202           
=======================================
  Hits          197      197           
  Misses          5        5
Impacted Files Coverage Δ
lib/helper.js 94.52% <ø> (ø) ⬆️

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 c43cab6...7dbdb5b. Read the comment docs.

@codecov
Copy link

codecov bot commented Dec 28, 2018

Codecov Report

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

Impacted file tree graph

@@           Coverage Diff           @@
##           master      #28   +/-   ##
=======================================
  Coverage   97.52%   97.52%           
=======================================
  Files           3        3           
  Lines         202      202           
=======================================
  Hits          197      197           
  Misses          5        5
Impacted Files Coverage Δ
lib/helper.js 94.52% <ø> (ø) ⬆️

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 c43cab6...ca4d994. Read the comment docs.

index.d.ts Outdated

// migrating to common-bin later
declare class CommonBin {
options: Options;
Copy link
Member

Choose a reason for hiding this comment

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

这个当时设计的有点特殊,只是一个 setter,然后是 merge 的

Copy link
Contributor Author

Choose a reason for hiding this comment

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

那是不用写出来?

Copy link
Member

Choose a reason for hiding this comment

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

不写也行吧,我在 plus 里面提供了 initOptions 这个 protect 来提供

index.d.ts Outdated
* @param {Array} context.rawArgv - the raw argv, `[ "--baseDir=simple" ]`
* @protected
*/
protected run(context?: CommonBin.Context): void;
Copy link
Member

Choose a reason for hiding this comment

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

这个应该是允许返回的吧?是不是要 any ?

/**
* start point of bin process
*/
start(): void;
Copy link
Member

Choose a reason for hiding this comment

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

这个好像是 promise 的

Copy link
Contributor Author

Choose a reason for hiding this comment

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

start 里是直接跑 co ,没有 return

@atian25 atian25 merged commit db4258b into master Dec 29, 2018
@atian25 atian25 deleted the ts-support branch December 29, 2018 06:29
@atian25
Copy link
Member

atian25 commented Dec 29, 2018

2.8.1

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

Successfully merging this pull request may close these issues.

None yet

2 participants