Skip to content

typings not included in jspm distribution #644

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

Closed
unional opened this issue Oct 27, 2016 · 10 comments
Closed

typings not included in jspm distribution #644

unional opened this issue Oct 27, 2016 · 10 comments

Comments

@unional
Copy link

unional commented Oct 27, 2016

Hi @EisenbergEffect ,

I finally get time to test jspm support for typings.
I notice when I install aurelia packages in jspm, the package.json and *.d.ts is not included.

Using aurelia-pal as an example, it points to dist/amd which does not have *.d.ts
Also, package.json should also be deployed to that we can find out where the typings file is located (same as what tsc does on npm side).

Can you take a look into it?

@jdanyow
Copy link
Contributor

jdanyow commented Nov 1, 2016

@unional take a look at the typescript skeleton. It uses typescript, typings and jspm:

https://github.com/aurelia/skeleton-navigation/tree/master/skeleton-typescript

@jdanyow jdanyow closed this as completed Nov 1, 2016
@unional
Copy link
Author

unional commented Nov 1, 2016

Please reopen. I'm a contributor of typings. This is directly related to adding jspm support in typings.

Currently, due to limitation of TypeScript support for jspm, we have to install the package both on jspm and npm, or install on jspm and use typings install github:aurelia/*** to install the typings.

I'm adding jspm support in typings, so that user can do:

jspm i npm:aurelia-***
typings i jspm:aurelia-*** // this will resolve the jspm dependency and add the typings locally

ping @EisenbergEffect , he is aware of this feature.

EDIT: To clarify how this is related, when jspm support is available in typings, the current jspm distribution (OP, without the typings file), user will not be able to do typings install jspm:aurelia-*** because the typings file is not available.

@EisenbergEffect
Copy link
Contributor

Opening this to consider updating our distribution somehow.

@unional
Copy link
Author

unional commented Nov 2, 2016

Thanks. The PR for this feature is at typings/core and there is one identified bug not related to this feature blocking the merge. I hope it will be merged soon.

@unional
Copy link
Author

unional commented Dec 7, 2016

Hi, jspm support is landed in typings 2.0. So if aurelia distribute typings files during jspm install, it would be great. 🌷

@AdamWillden
Copy link

AdamWillden commented Jun 5, 2017

I've had a few issues relating to this.

There's no other option, that I can see, than to distribute/duplicate the .d.ts in within each dist sub directory.

I've just remembered that, following the move to typescript, aurelia-dialog no longer exhibits the issue mentioned here because the d.ts is indeed distributed/duplicated in each dist sub directory ..and of course aurelia-validation built using typescript is the same.

Would it be an acceptable idea to update all non-TS libraries to distribute the d.ts in the same way? Are the d.ts files generated or manually updated? If manually updated I suggest the d.ts files are moved to source and then copied as part of the build task.

@AdamWillden
Copy link

Commonly used packages to check and update would be:

  • dependency-injection
  • event-aggregator
  • fetch-client
  • framework
  • http-client
  • logging
  • logging-console
  • metadata
  • pal
  • i18n
  • task-queue
  • templating
  • templating-binding
  • templating-router
  • templating-resources
  • testing
  • router
  • binding
  • ui-virtualization

Any of these?

  • animator-css
  • animator-velocity
  • bootstrapper
  • history-browser
  • history
  • loader
  • loader-default
  • pal-browser
  • path
  • route-recognizer

Quite a list... and I fear I may have missed one or two.

@aluanhaddad
Copy link

I have written my own tool to handle this. It is far from ideal.

@atsu85
Copy link
Contributor

atsu85 commented Aug 2, 2017

@AdamWillden

Are the d.ts files generated or manually updated?

they are generated based on TS types in ES6 sources.

@davismj
Copy link
Member

davismj commented Mar 6, 2019

OP is asking for typings support for the jspm repository. Typings is deprecated..

The problem OP was trying to solve is "how do we make typescript and typescript-enabled IDEs aware of types installed by jspm." The TypeScript team has noted that analyzing jspm_packages for types the way it works with node_modules is not as viable because of the way that jspm versions packages.

jspm has provided no further specification for specifying types that we can comply with.

The less than ideal but not entirely painful solution is to run an npm install to get your types.

@davismj davismj closed this as completed Mar 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants