{"action":"created","issue":{"url":"https://api.github.com/repos/DefinitelyTyped/tsd/issues/150","labels_url":"https://api.github.com/repos/DefinitelyTyped/tsd/issues/150/labels{/name}","comments_url":"https://api.github.com/repos/DefinitelyTyped/tsd/issues/150/comments","events_url":"https://api.github.com/repos/DefinitelyTyped/tsd/issues/150/events","html_url":"https://github.com/DefinitelyTyped/tsd/issues/150","id":72314444,"number":150,"title":"TSD Future","user":{"login":"blakeembrey","id":1088987,"avatar_url":"https://avatars.githubusercontent.com/u/1088987?v=3","gravatar_id":"","url":"https://api.github.com/users/blakeembrey","html_url":"https://github.com/blakeembrey","followers_url":"https://api.github.com/users/blakeembrey/followers","following_url":"https://api.github.com/users/blakeembrey/following{/other_user}","gists_url":"https://api.github.com/users/blakeembrey/gists{/gist_id}","starred_url":"https://api.github.com/users/blakeembrey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blakeembrey/subscriptions","organizations_url":"https://api.github.com/users/blakeembrey/orgs","repos_url":"https://api.github.com/users/blakeembrey/repos","events_url":"https://api.github.com/users/blakeembrey/events{/privacy}","received_events_url":"https://api.github.com/users/blakeembrey/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-05-01T00:00:26Z","updated_at":"2015-05-12T18:08:27Z","closed_at":null,"body":"Hey everyone!\r\n\r\nI'm going to be jumping into this project and seeing what we can do to improve the sharing of TypeScript definitions. Development isn't (quite) going to happen instantly, so I wanted to submit a short issue that describes some of my immediate goals and see if there are other ideas of what they want to see moving forward. Feel free to create new issues with feature requests and we can label them for TSD Future.\r\n\r\n## Goal\r\n\r\nThe goal of TSD future is to seamlessly support any TypeScript definition files, from any source. By default, you should still be able to search the definitely typed repository and install from there. However, more focus will be trained onto support independent definitions, specifically ones bundled with modules. This is a primary focus because as the ecosystem grows, a single repo is going to be a challenge to scale and I would like to give more power to module authors.\r\n\r\nCurrently TSD (`tsd@next`) supports a feature called `tsd link`. It's a great first step, but comes with many drawbacks - mostly because it's just a really simple path copy and paste. It needs a bit more to be useful. In the future, you'll be able to `tsd install` and it will look up your dependencies via `package.json` or `bower.json` and it will install definition files. However, it'll then recursively resolve dependencies from there. Any dependencies the module has likely have their own definition files that they're depending on.\r\n\r\nThis will make `tsd.d.ts` less editor friendly, but the goal is to avoid having to manually edit this file and check in dependencies any more. Just as you don't check in your `node_modules` or `bower_components`, you shouldn't have to check in your type dependencies. As we resolve dependencies down the tree, if we encounter `tsd.json` files they'll also factor into the recursive resolution. This is important since not every module can or will adapt over night. If there are conflicts between sub-dependency definitions, we will provide a dialog for selecting the version that should be used (resulting in that flat structure we wanted, a la bower).\r\n\r\nDoing this, we'll pull closer to the seamless usage of definition files. Similarly, the commands will be pulled closer to `npm` and `bower`. All that will be required from now on is `tsd install`. To remove old dependencies, you can `tsd prune`. Finally, `tsd uninstall` will remove a dependency from `tsd.json`. The `tsd.d.ts` file will always be kept in sync with hard module dependencies and the `tsd.json`.\r\n\r\nTo support all this, I think some changes to `tsd.json` are required. I'm going to change this last (avoid it if I can), but I think it's too tied to the one source approach which doesn't scale. From now on, manual definition file installations `tsd install <source>` should create an entry like `package.json` with `\"name\": \"source\"`, where source can be any file/url (`tsd.json` or `d.ts` file). For example, the source when installed from the definitely typed repo will the raw git files. This allows anyone to host their own definitions. `tsd install <module>` will still fall back to the definitely typed repo and `tsd search <module>` will still search the repo. It is possible for this to be automated as well.\r\n\r\nHaving the name -> source mapping allows us a little more flexibility. For example, we can now check in our custom definition files and have them resolve according to the recursive algorithm since they are defined. On top of that, we can create aliases (which are supported by build tools like `browserify` and `webpack`) from one module to another. Finally, we can eventually support the module output format by TypeScript and automatically compile that into the namespaced module. That would personally be very cool to do, since it's a pretty big pain point for third-party module developers.\r\n\r\nOk, I think I'm done rambling but there will definitely be more to come.\r\n\r\n## Tracking\r\n\r\n* [ ] TSD to have command parity with NPM and Bower #142 #119 #122 #6 #116\r\n* [ ] Perform a complete, recursive defintion resolution #134 #105 #130 #123 #109 #151\r\n* [ ] Make sure we're running on all node versions >= 0.8 and iojs #144\r\n* [ ] Fix general inconsistencies #143 #125 #120 #112 #62 #75 #113 #95 \r\n* [ ] Automatically install unknown dependency definitions #115\r\n* [ ] Install dependencies from any source #97 #135 #87 \r\n* [ ] Start work on a wrapper that will accept any definition file and declare as a module name\r\n\r\n## Testing\r\n\r\nI will start work in the next few days on the `future` branch.\r\n\r\n```\r\nnpm install -g DefinitelyTyped/tsd#future\r\n```\r\n\r\n## Related\r\n\r\nThere's a few proposals in TypeScript right now to fix the definitions situation that will probably (hopefully) make most of this redundant (https://github.com/Microsoft/TypeScript/issues/2338, https://github.com/Microsoft/TypeScript/issues/2839)."},"comment":{"url":"https://api.github.com/repos/DefinitelyTyped/tsd/issues/comments/101370780","html_url":"https://github.com/DefinitelyTyped/tsd/issues/150#issuecomment-101370780","issue_url":"https://api.github.com/repos/DefinitelyTyped/tsd/issues/150","id":101370780,"user":{"login":"5angel","id":351676,"avatar_url":"https://avatars.githubusercontent.com/u/351676?v=3","gravatar_id":"","url":"https://api.github.com/users/5angel","html_url":"https://github.com/5angel","followers_url":"https://api.github.com/users/5angel/followers","following_url":"https://api.github.com/users/5angel/following{/other_user}","gists_url":"https://api.github.com/users/5angel/gists{/gist_id}","starred_url":"https://api.github.com/users/5angel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/5angel/subscriptions","organizations_url":"https://api.github.com/users/5angel/orgs","repos_url":"https://api.github.com/users/5angel/repos","events_url":"https://api.github.com/users/5angel/events{/privacy}","received_events_url":"https://api.github.com/users/5angel/received_events","type":"User","site_admin":false},"created_at":"2015-05-12T18:08:26Z","updated_at":"2015-05-12T18:08:26Z","body":"@blakeembrey phew, thank you. It was thinking about cloning the rep and making a pull request (:"}}