Skip to content

typescript type not found #85

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

Closed
qhkm opened this issue Mar 8, 2021 · 12 comments
Closed

typescript type not found #85

qhkm opened this issue Mar 8, 2021 · 12 comments

Comments

@qhkm
Copy link

qhkm commented Mar 8, 2021

I'm not sure if this is the right place to ask this question but is there any typescript typedef anywhere as i could'nt find it anywhere (definitelyTyped). If there's none, will try my best to take some time to contribute. Thank you!

@ItsHarper
Copy link

The code has actually been rewritten in TS. Unfortunately, a new version hasn't come out since then.

@qhkm
Copy link
Author

qhkm commented Mar 8, 2021

Appreciate your response. Got that.

@drauggres
Copy link

To have a proper type declarations was one of the goals when I was rewriting code in TS. But compatible version was never released.
In my project I did this:

  1. Build adbkit from this commit
  • git clone https://github.com/DeviceFarmer/adbkit.git
  • cd adbkit
  • git checkout 8d011fa862d1465415864a41b6e347f3fffa8442
  • npm i (this command will not only install dependencies, but also build the lib and run tests)
  1. Copy types to my project
  • mkdir -p /path/to/my/project/typings/@devicefarmer/adbkit
  • find . ! \( -path './node_modules' -prune \) -name \*.d.ts -exec cp --parents \{\} /path/to/my/project/typings/@devicefarmer/adbkit \; (single line. run from adbkit root. explanation: copy all relevant *.d.ts to my project saving structure)
  1. Configure tsconfig.json
  • add "typeRoots": ["./typings"] (doc)

This way I can use the last released version (@devicefarmer/[email protected]) with TypeScript.

P.S. you will also need to add @types/bluebird and @types/node-forge to devDependencies in your project for it to work properly.

@koral--
Copy link
Member

koral-- commented Mar 8, 2021

Sorry for the delay, I'll release new versions of all the DeviceFarmer components ASAP.
Will keep this issue open until it happens.

@koral--
Copy link
Member

koral-- commented Mar 8, 2021

@drauggres it seems that we have an issue with TS:

tsc -p .00:13
src/adb/DeviceClient.ts:383:51 - error TS2345: Argument of type '{ fixLineFeeds: false; }' is not assignable to parameter of type 'ReaderOptions'.00:13
Type '{ fixLineFeeds: false; }' is missing the following properties from type 'ReaderOptions': format, priority00:13
383 .then((stream) => Logcat.readStream(stream, { fixLineFeeds: false }));

https://devicefarmer.semaphoreci.com/jobs/1f23bc72-30fc-4c88-b47a-931b525a2539

Do you have maybe some idea how to fix it in the best way?

@drauggres
Copy link

IDK, my code is gone after #79 was merged. I wasn't able to review the changes and have no idea what is happening in the master.

@UrielCh

@koral--
Copy link
Member

koral-- commented Mar 8, 2021

OK, I've reverted those changes from #79 for now.

@koral--
Copy link
Member

koral-- commented Mar 8, 2021

@drauggres I've checked that deeper and the last commit which builds (passes npm install) w/o error is 3bd94ba from #31
The next one 948713e from PR #38 does not build.

It looks like integration process does not work here properly, need to investigate that.
But any other idea how to clean up the status for now, except for moving back to last working commit?

@drauggres
Copy link

@drauggres I've checked that deeper and the last commit which builds (passes npm install) w/o error is 3bd94ba from #31
The next one 948713e from PR #38 does not build.

You probably forgot to clean node_modules between builds. npm i works fine with empty node_modules on both mentioned above commits.

@koral--
Copy link
Member

koral-- commented Mar 8, 2021

Yeah, that's the reason 🤦

@drauggres
Copy link

drauggres commented Mar 8, 2021

Now (with @devicefarmer/[email protected]) you should be able to release v3.
But I'm going to stick with v2 for some time, until something interesting appears in the new version.

@koral--
Copy link
Member

koral-- commented Mar 9, 2021

Thanks @drauggres for the help with resolving this.
And sorry for acting in rush as you spotted.
Basically I have a limited time and wanted to release as much as possible.

Closing this issue as version 3.2.0 was released.

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

No branches or pull requests

4 participants