-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Manage TypeScript declaration files using npm #162
Conversation
@od1k: Thank you for submitting a pull request! Before we can merge it, you'll need to sign the Meteor Contributor Agreement here: https://contribute.meteor.com/ |
@od1k cool! I think there's even a typed-graphql npm package that we could use (same content as the github repo), which would make the |
For some reason, when typed-graphql was installed from npm, the compiler was complaining about missing types. But I will take another look at this problem in the evening. Completely getting rid of 'typings install' would be really nice. |
@od1k to use typed-graphql package you just need to state it in tsconfig. |
Thanks @DxCx! But even when I got it working there was still one issue remaining. When you The only way I could get it to work without having to do any additional steps after Ideal scenario would be for typed-graphql to be published to npm ~types. |
ok @od1k cool. |
Nice! I guess we wait until it becomes available on npm. |
@od1k i think it might take some time, IMO using the typings file can work in the meanwhile.. |
I guess you're right. I didn't find any information on how long does it take to get merged PRs on definitelytyped to get published to npm, so I've stayed with solution mentioned above. I think this is ready to be merged. |
TODO:
TypeScript 2 made it easier to install declaration files using npm.
Moving all the declaration file dependencies from typings to npm solves the problem where you have to install all the definitions manually (issue #124).
Now you just have to
npm install apollo-server
into your TS project and it just works, except for graphql definitions, those still need to be installed using the typings utility. Couldn't get them to work by installing from npm, for some reason.Note: Running
npm install
in an existing project will probably case duplicate definition errors with the typings directory. To resolve that just delete the typings directory and runtypings install
to install the graphql definitions.Also, having
@types/chai
in devDependencies resulted in missing type definition when compiling project that is depending on apollo-server. Thats why it's in dependencies section.