lukeed / taskr

A fast, concurrency-focused task automation tool.
MIT License
2.53k stars 74 forks source link

[WIP] bootstrapped TypeScript declarations #267

Closed hzlmn closed 7 years ago

hzlmn commented 7 years ago

cc @lukeed @jbucaran

Hi, as discussed.

Also i am wondering how we could describe node related functions like read write that works with Buffer object ? Should we pass @typings/node as peerDependency ?

jorgebucaran commented 7 years ago

@hzlmn Woah, this is awesome thank you! 🤘

Should we pass @typings/node as peerDependency ?

What would that be used for? I thought typings are mostly there to help code editors offer better completion, help type linters to check for type mismatches, etc.

lukeed commented 7 years ago

Nice @hzlmn! I'm not sure what the answers are to your questions. I don't use TS but can help you find the answer if you need help.

Also, do you mind restructuring a little bit? Can we move this to the project root as fly.d.ts?

Then you also have to add fly.d.ts to the files entry of the package.json, or else your hard work won't be downloaded.

hzlmn commented 7 years ago

@jbucaran Yes, they are. But as fly is node tool it use some Node APIs like Buffer, for example, that is unknown for TypeScript by default, but there are separate declarations for Node @typings/node

@lukeed Yes sure, restructuring is good, that's why i create this as a WIP

Possible solutions is to add @types/node as a peerDependency like here or just define any type for Node related stuffs but it is not very convenient.

lukeed commented 7 years ago

Thanks!

Hmm.. It's probably not ideal, but I think the any type might be better here, because we don't want to tell every downloader that they're missing a peerDep for @types/node. I, for one, would be annoyed by that since I don't use TS.

hzlmn commented 7 years ago

Sorry, forgot about it. Updated