[Pkg-javascript-devel] How to ship DefinitelyTyped's type definitions?

Julien Puydt julien.puydt at laposte.net
Fri May 11 21:26:53 BST 2018


Hi,

as you may know, more and more JS projects incorporate some TypeScript
these days. This requires some definitions because the typing is
stronger, so we have:
(1) projects adding typing for what they provide, and that means we
should now ship that too ;
(2) projects depending on typing for external deps, which don't provide
it yet.

How is (2) even possible, you might ask? In typical JS-frenzy, people
start using definitions for projects not yet providing them by using a
repository which provides those *outside of the relevant upstream*.

Here it is:
  https://github.com/DefinitelyTyped/DefinitelyTyped
(providing more than 4000 type definitions)

If you see some "@types/foo" in the depends of a JS-package, that might
be one of those.

So what can we do? I see several trails onward :

(1) Package that as a big source package providing a single big binary
package.
  Good: simple
  Bad: a huge dependency

(2) Package that as a big source package providing thousands of binary
packages.
  Good: no huge dependency
  Bad: huge number of binary packages for little data

(3) Modify Debian packages of upstreams not providing definitions on a
case-by-case basis, shipping them in debian/.
  Good: we ship only what we need, and when upstreams take the defs, we
just ship what they included and drop what we added (just like
DefinitelyTyped drops their definitions in that case)
  Bad: we drift away from upstream, and need to check for latest
versions of those separately by hand as long as upstream doesn't bundle
the definitions themselves.

What do you think about it?

Snark on #debian-js



More information about the Pkg-javascript-devel mailing list