question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Migrate types from dt~leaflet to this repo and its `package.json`

See original GitHub issue

How to reproduce

  • Leaflet version I’m using: 1.0.1

What behaviour I’m expecting and which behaviour I’m seeing

The package.json does not define types and the typescript definition is not included in this repo. See http://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html for new practice for publishing.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:14 (13 by maintainers)

github_iconTop GitHub Comments

1reaction
danzelcommented, Aug 9, 2017

Yes, lets close these 👍 Currently a typescript user will yarn add @types/leaflet, and I advise we keep it that way.

The types are hosted in the DefinitelyTyped repository, and can be contributed to there: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/leaflet By having these externally we are not held up waiting for .d.ts updates for each release, and the types can be improved without requiring a new release.

1reaction
patrickarltcommented, Oct 23, 2016

This kind of thing happened with PouchDB https://github.com/pouchdb/pouchdb/issues/5389 and it’s .d.ts files. In particular https://github.com/pouchdb/pouchdb/issues/5389#issuecomment-228610251, particularly:

it’s better for library authors not to ship their own index.d.ts files, unless they are well-versed in TypeScript and prepared to maintain it.

Seeing that none of the Leaflet core team has any Typescript experiance, I think @mourner’s suggestion of creating a seperate repo like leaflet-typings that can simply serve as a common point of discussion for those willing to maintain the types.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Install @types packages as part of migrating #115 - GitHub
Following on from part of the discussion in #100, it would be really useful to install @types packages automatically as part of a...
Read more >
package.json - npm Docs
This helps people discover your package as it's listed in npm search . ... If the git repo is on GitHub, then the...
Read more >
Migrating an NPM package to use ES Modules - Medium
In this article, I'm going to show you the steps needed to convert an NPM package from using CommonJS (CJS) modules, to the...
Read more >
Move a module from devDependencies to dependencies in ...
Shorthand to move from devDependencies to dependencies (prod): npm i <module_name> -P. If you want to do the opposite (i.e. move a module ......
Read more >
The Basics of Package.json - NodeSource
json is an array that defines where the source code for the module lives. Typically, this would be a public GitHub repo for...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found