Skip to content
This repository has been archived by the owner on Jan 5, 2024. It is now read-only.

'bundle' command expects project's bower dependencies to have d.ts files. #668

Open
2 tasks done
ejmarino opened this issue Aug 17, 2016 · 4 comments
Open
2 tasks done

Comments

@ejmarino
Copy link

Prerequisites

  • Did you check the FAQ?
  • Did you search open and closed issues to see if your issue has already been reported?

Description

It looks like typings reads bower.json 'dependencies' and look for d.ts files on each component, later it complains about the file is not found. The components I use doesn't have d.ts files. For that same reason I use typings!
I don't know how to stop this behavior or make things the right way. I'm missing something.

I use this library in another proyect and I have the same error when I include it as a bower dependency (inside typings.json of that another project)

Steps to Reproduce

  1. clone https://github.com/ejmarino/angular-ms 0.1.5 tag
  2. npm install && bower install && typings install
  3. typings bundle -G -o bundle.d.ts

Actual behavior:

typings ERR! message Unable to read typings for "angular". The author of "angular-ms" needs to check the entry paths in "bower.json" are up to date
typings ERR! caused by ENOENT: no such file or directory, open 'C:\GitHub\angular-ms\bower_components\angular\angular.d.ts'

typings ERR! cwd C:\GitHub\angular-ms
typings ERR! system Windows_NT 10.0.10586

As you see, is looking for angular.d.ts inside bower angular component, and I have inside typings/global/angular..etc

Versions

1.3.2

@unional
Copy link
Member

unional commented Aug 17, 2016

Are you using typings bundle on your consuming library?
If so, it's the first time I see people using it out of the context of writing typings repository. 🌷

@ejmarino
Copy link
Author

Hi! I'm tring to make that library 'compatible' with typings. I'm trying to make it work when I declare it as a dependency in typings.json of another project. If I declare it like this:

  "globalDependencies": {
    "angular-ms": "file:bower_components/angular-ms/typings.json"
  }

it works, but if I declare it like i think I should...

  "globalDependencies": {
    "angular-ms": "bower:angular-ms"
  }

It doesn't work, throwing exactly the same error I described before.

Sorry if I was misleading you...

I just want to make sure i'm making my library the right way with typings.

Thanks

@unional
Copy link
Member

unional commented Aug 17, 2016

Not sure about the exact error, but I notice that your dist/typings/angular-ms.d.ts is not in the right format.

I believe it should be written in external module format.

@ejmarino
Copy link
Author

That file was obtained using 'typings' and it works. The project compiles without problems.
I don't think that that file is related to the problem. I looks like 'typings' command look into bower.json dependencies section for a .d.ts file in every component listed there. I don't know if this behavior is ok. It should not assume that every component I use must have a type declaration file. I use a lot of javascript project that hasn't declarations defined.

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

No branches or pull requests

2 participants