-
Notifications
You must be signed in to change notification settings - Fork 68
Distribute power-assert.d.ts(index.d.ts) type definition files using npm #29
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
Conversation
@falsandtru Thank you for your pull-req! Since this is a relatively bigger patch, and I don't know much about TypeScript, I would like @vvakame and @teppeis to review this pull-req. |
DefinitelyTyped is too large project because many pull requests are left unused. |
It's trade-off. Hosting index.d.ts ourself is nice for TypeScript users because they don't have to take care of DefinitelyTyped repo additionally. However, this PR includes tripleslash that is NOT allowed in index.d.ts.
In Typings for npm packages · Microsoft/TypeScript Wiki
Before power-assert itself, the dependencies (empower and power-assert-formatter) should host their own index.d.ts. Then power-assert can import them. |
Yes. My triple-slash is temporary measures because we cannot resolve type definition dependencies only in this repository. I will resolve this problem in the future. This PR's target is to resolve the hosting(distribute) and maintainance(care) problem. I'll resolve all .d.ts dependencies quickly if you want. |
Fixed email of commit metadata. And I cancel my idea because need an other server for security. |
Hi @falsandtru , @vvakame and @teppeis ,
Okay, I'm going to close this pull-req for now. However, your suggestion make me think about TypeScript users a lot. Thank you for your pull request! |
Oh it is not mean this pull request. Please continue. |
@falsandtru I'm so sorry for my very late response. Today I have a conversation with some TS users, and now I'm going to accept your suggestion. So, please wait a few days. |
Okay, I thought that this is my strongest pull-req(without behind-the-scenes maneuvering). |
Fixed @teppeis specified problems. This commit need typings of depended npm packages. Please reopen to show my fixed commit. |
@falsandtru Sorry for my late response.
Okay, I'll reopen this PR. Looking forward to see your update. |
I want to confirm what is the goal of this pull request? |
My goal: https://github.com/Microsoft/TypeScript/wiki/Typings-for-npm-packages If this pull request has a technical problem, I provide some ways for resolution. Please tell me your wants. |
sounds good. We are sharing a the goal. 😸
We should distributed index.d.ts to empower, power-assert-formatter and power-assert.
https://github.com/Microsoft/TypeScript/blob/master/doc/spec.md#12.2 |
I resolved that problem. This resolution refer to external modules directly. Please review again.
I'll fix module design if @twada want. Sample: // index.d.ts
declare function assert(value:any, message?:string): void;
declare namespace assert {
...
}
export default assert; Not ambient external module is minimal, but not good design for model case. Maybe many non-typescript node module developers cannot/doesn't design own .d.ts file. DefinitelyTyped:
// foo.d.ts
declare namespace foo {
export var fizz;
}
declare module "foo" {
export default foo;
export var fizz: typeof foo.fizz;
} External modules (compatible):
// foo.d.ts
declare namespace foo {
export var fizz;
}
declare module "foo" {
export default foo;
export var fizz: typeof foo.fizz;
}
// index.d.ts
import "./foo.d.ts";
export * from "foo";
export {default} from "foo"; External modules (for @vvakame):
// index.d.ts
declare namespace foo {
export var fizz;
}
export default foo;
export var fizz: typeof foo.fizz; I recommend compatible design. |
And @vvakame please read this point: http://qiita.com/vvakame/items/72d22e33632178f7db24#comment-482f292bbd35e004c74e
|
Thank you for your discussions. Thank you all, really. Decided. I close this pull-req for now. I think this PR is not bad. Hosting However I close this PR because,
So, I want to wait for time-proven and well-documented best practices of hosting type definitions. I'll reopen this or send another pull-req when the time for hosting typings has come. I'm so so sorry for closing this pull-request. Thanks. |
Enhanced node package distribute system. Distribute package with
.d.ts
type definition files using npm.https://github.com/Microsoft/TypeScript/wiki/Typings-for-npm-packages
Type definition files might well survive even after typescript died.
http://mozaic.fm/post/96461640633/8-altjs