-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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(typings): add typings to support TypeScript #646
Conversation
package.json
Outdated
@@ -16,10 +16,12 @@ | |||
}, | |||
"devDependencies": { | |||
"should": ">= 0.0.1 <9.0.0", | |||
"sinon": ">=1.17.1" | |||
"sinon": ">=1.17.1", | |||
"typescript": "^2.3.4" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unlikely to make a different to this PR, but 2.4.1 is available now 😄
With the carot it will take 2.4.1 anyways
…On Wed, 05 Jul 2017 at 23:43, Michael Wu ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In package.json
<#646 (comment)>:
> @@ -16,10 +16,12 @@
},
"devDependencies": {
"should": ">= 0.0.1 <9.0.0",
- "sinon": ">=1.17.1"
+ "sinon": ">=1.17.1",
+ "typescript": "^2.3.4"
unlikely to make a different to this PR, but 2.4.1 is available now 😄
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#646 (review)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AQv-WnZfMuSZN3IHDeKaE0F-HlKyRjBTks5sLAObgaJpZM4OERJx>
.
|
Can you resolve the pr on top of master, please :) |
What do you mean by 'resolve' please? I am current away and ill be able to do it on Friday |
Sorry, mean rebase, mistyped :) |
Ah okay, will do that on friday :)
…On Tue, 18 Jul 2017 at 20:59, Roman Vanesyan ***@***.***> wrote:
Sorry, mean rebase, mistyped :)
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#646 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AQv-WmvuFXHUmRMr5LP2bCJOphDJs6YUks5sPQCDgaJpZM4OERJx>
.
|
# Conflicts: # package.json
@vanesyan rebase done :) |
package.json
Outdated
@@ -28,8 +23,12 @@ | |||
"index.js" | |||
], | |||
"dependencies": { | |||
"@types/node": "^8.0.2", | |||
"graceful-readlink": ">= 1.0.0" | |||
"@types/node": "^8.0.2" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this go in peerDependencies?
Can go, if you prefer it that way. Though its not neccessary.
Not a bog fan of peers unless it's neccessery.
I'll do it as you prefer though. Just let me know :)
…On Sat, 22 Jul 2017 at 21:08, Roman Vanesyan ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In package.json
<#646 (comment)>:
> @@ -28,8 +23,12 @@
"index.js"
],
"dependencies": {
- ***@***.***/node": "^8.0.2",
- "graceful-readlink": ">= 1.0.0"
+ ***@***.***/node": "^8.0.2"
Shouldn't this go in peerDependencies?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#646 (review)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AQv-WnxTg9i3QV20u965QaikE-i_2HA5ks5sQkirgaJpZM4OERJx>
.
|
The simple reason why its dependency is that it that node is requeried by
commander.js because of the 'eventEmitter'
…On Sat, 22 Jul 2017 at 21:13, Alan Agius ***@***.***> wrote:
Can go, if you prefer it that way. Though its not neccessary.
Not a bog fan of peers unless it's neccessery.
I'll do it as you prefer though. Just let me know :)
On Sat, 22 Jul 2017 at 21:08, Roman Vanesyan ***@***.***>
wrote:
> ***@***.**** commented on this pull request.
> ------------------------------
>
> In package.json
> <#646 (comment)>:
>
> > @@ -28,8 +23,12 @@
> "index.js"
> ],
> "dependencies": {
> - ***@***.***/node": "^8.0.2",
> - "graceful-readlink": ">= 1.0.0"
> + ***@***.***/node": "^8.0.2"
>
> Shouldn't this go in peerDependencies?
>
> —
> You are receiving this because you authored the thread.
> Reply to this email directly, view it on GitHub
> <#646 (review)>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AQv-WnxTg9i3QV20u965QaikE-i_2HA5ks5sQkirgaJpZM4OERJx>
> .
>
|
Just worry about people that don't need typing for commander, they'll get extra deps. |
Thats trie, but its a very small deps.
Though i can change it if you wish
…On Sat, 22 Jul 2017 at 21:27, Roman Vanesyan ***@***.***> wrote:
Just worry about people that don't need typing for commander, they'll get
extra deps.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#646 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AQv-Wun8EGhzM0Y7nMpMUEANQNgmqxaHks5sQk0DgaJpZM4OERJx>
.
|
I'm not too familiar with TypeScript, but what do other publishers do? |
Usually they are set as dependencies even with the typyings packages
themselves.
https://www.npmjs.com/package/@types/commander
…On Sat, 22 Jul 2017 at 22:24, Roman Vanesyan ***@***.***> wrote:
I'm not too familiar with TypeScript, but what do other publishers do?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#646 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AQv-WiYns2lIPM4Hi6HfxyzK8KsOsePwks5sQlptgaJpZM4OERJx>
.
|
Sorry me, if it's a bit stupid question, but what do we want to include typings within package, when typings are already released in DefinitelyTyped for? :) |
Having typyings in DefinitlyTyped is a 'last' resort for the community to
have typings of a library that the owner doesn't want to have within his
library. TypeScript recommand having them within the library and not within
DefinitlyTyped.
…On Sat, 22 Jul 2017 at 22:44, Roman Vanesyan ***@***.***> wrote:
Sorry me, if it's a bit stupid question, but what do we want to include
typings within package, when typings are already released in
DefinitelyTyped? :)
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#646 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AQv-WqOsw2suOSOeDKwS4u2f94lfaW2kks5sQl9FgaJpZM4OERJx>
.
|
Sorry me, but I haven't found such suggestion by TypeScript. Furthermore as I understand they heavily rely on |
… On Sat, 22 Jul 2017 at 22:56, Roman Vanesyan ***@***.***> wrote:
Sorry me, but I haven't found such suggestion by TypeScript. Furthermore
as I understand they heavily rely on @types npm namespace, which from my
understanding is referring to DefinitelyTyped.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#646 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AQv-Wg6_TD8R6x7na6aoZ7Y6r2EIImRCks5sQmHvgaJpZM4OERJx>
.
|
@types is indeed for DefinitlyTyped which is used only for non typescript
libaries, as typically typescript libraries always have typing inside the
library itself and now andays even js libraries have typings in them such
as 'moment'
Reason being is for maintability and no need for addition packages.
TypeScript doesn't realy on DefinitlyTyped at all, its the consumer that
realies on them if he needs non TypeScript ready libraries.
…On Sat, 22 Jul 2017 at 22:59, Alan Agius ***@***.***> wrote:
https://github.com/Microsoft/TypeScript-Handbook/blob/master/pages/declaration%20files/Publishing.md
On Sat, 22 Jul 2017 at 22:56, Roman Vanesyan ***@***.***>
wrote:
> Sorry me, but I haven't found such suggestion by TypeScript. Furthermore
> as I understand they heavily rely on @types npm namespace, which from my
> understanding is referring to DefinitelyTyped.
>
> —
> You are receiving this because you authored the thread.
> Reply to this email directly, view it on GitHub
> <#646 (comment)>, or mute
> the thread
> <https://github.com/notifications/unsubscribe-auth/AQv-Wg6_TD8R6x7na6aoZ7Y6r2EIImRCks5sQmHvgaJpZM4OERJx>
> .
>
|
Ok, sorry me again, but previously I was able to use Node.js api out of the box when used typescript last time in the past. But sometimes not so far, I tried it again and now only way to use node.js api was to install 'em from DefinitelyTypes. |
Including node typings as a peer dependency is fine since it's a declaration that commander works with a minimum version of node, but you'll run into problems with:
I think we should keep it as an actual dependency to avoid |
So, what do you guys want me to do? |
My preference is to keep it as a dependency but use the version that commander is minimally compatible with. |
Thanks 👍 |
Hrmm. By adding The total size of the installed code-base seems to be increased by over 10x. Project was previously Not sure what the project maintainers are thinking here. Please review this again @michael-yx-wu. |
ERROR in [at-loader] ./app/examples/conference-agenda/conference-agenda-example.ts:63:5 TS2322: Type 'Timer' is not assignable to type 'number'. ERROR in [at-loader] ./app/examples/conference-agenda/conference-agenda-example.ts:71:9 TS2322: Type 'Timer' is not assignable to type 'number'. ERROR in [at-loader] ./app/examples/user-profile/user-profile-example.ts:89:5 TS2322: Type 'Timer' is not assignable to type 'number'. ERROR in [at-loader] ./app/examples/user-profile/user-profile-example.ts:97:9 TS2322: Type 'Timer' is not assignable to type 'number'. Caused by tj/commander.js#646. Related to tj/commander.js#719.
ERROR in [at-loader] ./app/examples/conference-agenda/conference-agenda-example.ts:63:5 TS2322: Type 'Timer' is not assignable to type 'number'. ERROR in [at-loader] ./app/examples/conference-agenda/conference-agenda-example.ts:71:9 TS2322: Type 'Timer' is not assignable to type 'number'. ERROR in [at-loader] ./app/examples/user-profile/user-profile-example.ts:89:5 TS2322: Type 'Timer' is not assignable to type 'number'. ERROR in [at-loader] ./app/examples/user-profile/user-profile-example.ts:97:9 TS2322: Type 'Timer' is not assignable to type 'number'. Caused by tj/commander.js#646. Related to tj/commander.js#719.
There's a couple of gotchas happening here:
So! That said, if I were to make a PR now, I'd remove deps, add a reference to the index, and edit files. That should get the bundle back down, because shipped files would go up by exactly 1 and we'd be back to the deps we had before. How does that sound? |
@xavdid the bundle size is still the same considering the fact that TypeScript is only for devDeps, to be honest though, finding solutions to keep the devDeps down by removing TS, for me it's not a good idea as like this you will remove the tests will keeps the sanity of the definition file. Why is it such a problem to have an extra devDeps which is actual used? Just for an example would you consider removing Re the test point. however, does the Types Definitions, know that they should write tests on them, as that's the standard. The test didn't fail, because commander argument can be accessed such as; program.cheese() Thus, when you changed |
I don't care about the bundle size, but other commenters seem to take issue with it. Since the API for a big project like this changes so infrequently, it's pretty easy to keep the typings up-to-date. I don't see a ton of value in the tests, but it's not a big deal. That's a good point about the tests, I'm still pretty new with commander. Nevertheless, the |
The files issue is fixed
#725 (review)
…On Tue, 28 Nov 2017 at 07:46, David Brownman ***@***.***> wrote:
I don't care about the bundle size, but other commenters seem to take
issue with it. Since the API for a big project like this changes so
infrequently, it's pretty easy to keep the typings up-to-date. I don't see
a ton of value in the tests, but it's not a big deal.
That's a good point about the tests, I'm still pretty new with commander.
Nevertheless, the files issue remains.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#646 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AQv-WoK2mbzhIJCSc1s3nP5kkl6G20nHks5s66xbgaJpZM4OERJx>
.
|
Add typings to support TypeScript