Skip to content

TypeScript #31

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

Merged
merged 15 commits into from
Oct 25, 2020
Merged

TypeScript #31

merged 15 commits into from
Oct 25, 2020

Conversation

drauggres
Copy link

@drauggres drauggres commented Oct 13, 2020

Done:

  • Compile CoffeeScript to JavaScript (drop *.coffee)
  • Rewite JavaScript in TypeScript (drop *.js)
  • Annotate with types as much as possible
  • Add eslint, prettier

Lost:

  • grunt (I think we don't really need it)
  • grunt-jsonlint (package.json is linted by npm on any update)
  • watch

For compatibility file names are not changed and the code is placed in lib.
Don't have any API changes from the current version.

refs openstf#48

place sources in /lib for compatibility

Signed-off-by: Sergey Volkov <[email protected]>
Signed-off-by: Sergey Volkov <[email protected]>
Signed-off-by: Sergey Volkov <[email protected]>
Signed-off-by: Sergey Volkov <[email protected]>
Signed-off-by: Sergey Volkov <[email protected]>
Signed-off-by: Sergey Volkov <[email protected]>
Signed-off-by: Sergey Volkov <[email protected]>
Signed-off-by: Sergey Volkov <[email protected]>
use "files" in package.json instead of .npmignore

Signed-off-by: Sergey Volkov <[email protected]>
Signed-off-by: Sergey Volkov <[email protected]>
@koral--
Copy link
Member

koral-- commented Oct 15, 2020

@drauggres your PR does not pass DCO check. Please add sign off to your commits.

@drauggres
Copy link
Author

@drauggres your PR does not pass DCO check. Please add sign off to your commits.

Done.

There is one more issue I found: generated typescript declarations have a reference to '@devicefarmer/adbkit-logcat' which has no type declarations. So if you'll try to use this updated library from typescript you may get an error (until you write declarations for adbkit-logcat)

@koral--
Copy link
Member

koral-- commented Oct 15, 2020

What do you suggest for that issue? Also rewriting adbkit-logcat?

@drauggres
Copy link
Author

Should be enough to write declarations and include them into adbkit-logcat (or publish as @types/adbkit-logcat).
Rewriting will also do fine. BTW it will be not so hard, because it is already in es6. I can do it if you are interested.

P.S. obviously this problem does not affect anyone using this library from js.

@drauggres
Copy link
Author

As another option we could replace Logcat to any here

client.openLogcat(serial: string, options?: {
        clear?: boolean;
    } | typeof callback, callback?: Callback<Logcat>): Bluebird<Logcat>;

It does reduce usefulness but can be done right now.

Auth.parsePublicKey returns value based on PulicKey class from node-forge

Signed-off-by: Sergey Volkov <[email protected]>
@koral--
Copy link
Member

koral-- commented Oct 17, 2020

IMO the best option is to rewrite adbkit-logcat as well. Don't hesitate to do that.
That way no functionality is lost and no workarounds are needed.

Signed-off-by: Sergey Volkov <[email protected]>
@koral-- koral-- merged commit 3bd94ba into DeviceFarmer:master Oct 25, 2020
@drauggres drauggres deleted the feature/typescript branch October 26, 2020 21:57
@koral-- koral-- mentioned this pull request Mar 8, 2021
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.

2 participants