Skip to content
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

node_modules/gulp-typescript/typings/tsd.d.ts not found. #436

Closed
gabzim opened this issue Oct 5, 2016 · 14 comments
Closed

node_modules/gulp-typescript/typings/tsd.d.ts not found. #436

gabzim opened this issue Oct 5, 2016 · 14 comments

Comments

@gabzim
Copy link

gabzim commented Oct 5, 2016

I'm using Typescript 2, to install types I just run @types/LIBRARY_NAME, I no longer have a typings folder, which is specially not needed since this library exports its types data.

However, this line in release/main.d.ts(1,1) is giving me an issue:
/// <reference path="../typings/tsd.d.ts" />

The module no longer has a typings folder when I install it with npm so this is referencing an inexistent folder. I get rid of that line and the error goes away. This is the error I'm seeing:

release/main.d.ts(1,1): error TS6053: File '/Users/gabriel/work/project_one/node_modules/gulp-typescript/typings/tsd.d.ts' not found.

@demurgos
Copy link
Contributor

demurgos commented Oct 9, 2016

Hi,
I do have the same issue.

The bundled definitions should not rely on any external source. I just started to write typings definitions for the dependencies instead of tsd ones to bring scoped modules (TSD is based on globals).

It would still be great if it was possible to fix it in the meantime until the typings definitions are published.

@CarlosSoares
Copy link

+1

1 similar comment
@drygiel
Copy link

drygiel commented Oct 17, 2016

+1

@demurgos
Copy link
Contributor

Hi, I almost finished converting the project from tsd to typings, this should solve this issue.

The main issue was the missing definition for gulp-util so I wrote it, but it relies on the typings of vinyl. The definition in the registry describes an older version of vinyl but the update should be merged soon and I'll be able to finish the conversion.

Here are some references:
https://github.com/demurgos/typed-gulp-util
typed-typings/npm-vinyl#1
typings/registry#832

@ivogabe
Copy link
Owner

ivogabe commented Oct 18, 2016

I'd prefer to use @types on npm, that would make it easier to use the type declarations. But I guess that it won't take long to switch to @types once you have updated all type declarations.

@gabzim
Copy link
Author

gabzim commented Oct 18, 2016

Hi @ivogabe, agreed, @types is the way to go looking forward. @demurgos If it's possible to rely on this rather it would be awesome.

@demurgos
Copy link
Contributor

demurgos commented Oct 18, 2016

I am also interested in @types so I'll take a look at it. I'll submit a PR fixing this issue with typings in the meantime, but I'll check the state of of @types and try to add it (it mostly depends on the support of external modules, and also learning how to publish updates to @types).

@ivogabe
Copy link
Owner

ivogabe commented Oct 18, 2016

That would be great! @types packages are genereated from the types-2.0 branch of Definitely Typed, so you should send PRs there if some definition file of a dependency is outdated.

@demurgos
Copy link
Contributor

demurgos commented Oct 18, 2016

I just submitted a PR to fix the issue using typings. I am starting to try to use @types. It still seems like it might not be that stable yet. My main issue is that it does not support "decentralized" repositories yet (microsoft/types-publisher#4) and leads to very long delays before PR are accepted and difficulties with maintenance since every single definition in @types has to live in the same repo.

I'll let you know how it does work out.

@demurgos
Copy link
Contributor

demurgos commented Oct 18, 2016

From a user perspective, @types is looks great but I encountered some conflicts:
https://travis-ci.org/demurgos/gulp-typescript/jobs/168724221

I won't have much time this week, so if someone wants to use @type feel free to pick this issue (either from master here or from my types branch).

@felixfbecker
Copy link

+1 for using typings until @types supports decentralized repositories.

@ivogabe
Copy link
Owner

ivogabe commented Oct 22, 2016

I don't think that decentralised repositories are necessary to use @types here. I took the types branch of @demurgos and got it working after some small changes. See #448. Can someone confirm that that solves all issues related to the type definitions of gulp-typescript?

@demurgos
Copy link
Contributor

demurgos commented Oct 22, 2016

Hi,
I could successfully run your branch, looks like I just made a mistake in my branch, unfortunately I wasn't then able to import it: I'm taking a look at it to give you more information.

About the decentralized repositories, I think you are right that "it works" to use @types as is right now. But it's a real pain to write definitions for this. You just need to be aware that until decentralized repositories are supported, typings will often have better definitions because they are tested, regularly updated and reviewed: this is just impossible with the current situation of definitely-typed.

I mostly care about your module not emitting errors and keeping it "contained" (it should not mess with global variables) so in the end you can choose whatever you prefer: I'm just happy that this issue is on the way to be solved.

@ivogabe
Copy link
Owner

ivogabe commented Oct 27, 2016

Version 3.1.0 now uses @types, so this issue is now fixed!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants