Framework: typings not included in jspm distribution

Created on 28 Oct 2016  路  10Comments  路  Source: aurelia/framework

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?

enhancement

Most helpful comment

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.

All 10 comments

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

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

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.

Opening this to consider updating our distribution somehow.

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.

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

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.

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.

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

@AdamWillden

Are the d.ts files generated or manually updated?

they are generated based on TS types in ES6 sources.

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

firelizzard18 picture firelizzard18  路  3Comments

RichiCoder1 picture RichiCoder1  路  4Comments

pvencill picture pvencill  路  6Comments

piet-v picture piet-v  路  3Comments

arnonuem picture arnonuem  路  5Comments