Skip to content
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

Created typings for maplibre-gl which is an opensource fork of mapbox-gl #50116

Merged
merged 2 commits into from Dec 15, 2020

Conversation

folke
Copy link
Contributor

@folke folke commented Dec 14, 2020

MapLibre GL is a community led fork derived from mapbox-gl-js prior to their switch to a non-OSS license.
I've forked and edited the mapbox-gl-js v1.13 typings, so they can be used for maplibre-gl.

Please fill in this template.

Select one of these and delete the others:

If adding a new definition:

  • The package does not already provide its own types, or cannot have its .d.ts files generated via --declaration
  • If this is for an NPM package, match the name. If not, do not conflict with the name of an NPM package.
  • Create it with dts-gen --dt, not by basing it on an existing project.
  • Represents shape of module/library correctly
  • tslint.json should contain { "extends": "dtslint/dt.json" }, and no additional rules.
  • tsconfig.json should have noImplicitAny, noImplicitThis, strictNullChecks, and strictFunctionTypes set to true.

@typescript-bot typescript-bot added the New Definition This PR creates a new definition package. label Dec 14, 2020
@typescript-bot typescript-bot added this to Waiting for Code Reviews in New Pull Request Status Board Dec 14, 2020
@typescript-bot
Copy link
Contributor

typescript-bot commented Dec 14, 2020

@folke Thank you for submitting this PR! I see this is your first time submitting to DefinitelyTyped 👋 — I'm the local bot who will help you through the process of getting things through.

This is a live comment which I will keep updated.

1 package in this PR

Code Reviews

This PR adds a new definition, so it needs to be reviewed by a DT maintainer before it can be merged.

Status

  • ✅ No merge conflicts
  • ✅ Continuous integration tests have passed
  • ❌ Only a DT maintainer can approve changes when there are new packages added

Once every item on this list is checked, I'll ask you for permission to merge and publish the changes.


Diagnostic Information: What the bot saw about this PR
{
  "type": "info",
  "now": "-",
  "pr_number": 50116,
  "author": "folke",
  "headCommitAbbrOid": "2b64bb5",
  "headCommitOid": "2b64bb53f6e2f79689e03ac2090e258ddf574032",
  "lastPushDate": "2020-12-14T16:20:59.000Z",
  "lastActivityDate": "2020-12-14T23:10:35.000Z",
  "maintainerBlessed": false,
  "hasMergeConflict": false,
  "isFirstContribution": true,
  "popularityLevel": "Well-liked by everyone",
  "pkgInfo": [
    {
      "name": "maplibre-gl",
      "kind": "add",
      "files": [
        {
          "path": "types/maplibre-gl/index.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/maplibre-gl/maplibre-gl-tests.ts",
          "kind": "test"
        },
        {
          "path": "types/maplibre-gl/tsconfig.json",
          "kind": "package-meta",
          "suspect": "not [the required form](https://github.com/DefinitelyTyped/DefinitelyTyped#tsconfigjson)"
        },
        {
          "path": "types/maplibre-gl/tslint.json",
          "kind": "package-meta",
          "suspect": "not [the required form](https://github.com/DefinitelyTyped/DefinitelyTyped#linter-tslintjson)"
        }
      ],
      "owners": [],
      "addedOwners": [
        "dobrud",
        "patrickr",
        "macobo",
        "dmytro-gokun",
        "LiamAttClarke",
        "life777",
        "mklopets",
        "amxfonseca",
        "folke"
      ],
      "deletedOwners": [],
      "popularityLevel": "Well-liked by everyone"
    }
  ],
  "reviews": [],
  "ciResult": "pass"
}

@typescript-bot
Copy link
Contributor

🔔 @folke — you're the only owner, but it would still be good if you find someone to review this PR in the next few days, otherwise a maintainer will look at it. (And if you do find someone, maybe even recruit them to be a second owner to make future changes easier...)

@typescript-bot typescript-bot moved this from Waiting for Code Reviews to Needs Maintainer Action in New Pull Request Status Board Dec 14, 2020
@typescript-bot
Copy link
Contributor

👋 Hi there! I’ve run some quick measurements against master and your PR. These metrics should help the humans reviewing this PR gauge whether it might negatively affect compile times or editor responsiveness for users who install these typings.

Let’s review the numbers, shall we?

These typings are for a package that doesn’t yet exist on master, so I don’t have anything to compare against yet! In the future, I’ll be able to compare PRs to maplibre-gl with its source on master.

Comparison details 📊
Batch compilation
Type count 12476
Assignability cache size 4013
Language service measurements
Samples taken 2456
Identifiers in tests 2456
getCompletionsAtPosition
    Mean duration (ms) 375.1
    Mean CV 9.0%
    Worst duration (ms) 521.3
    Worst identifier document
getQuickInfoAtPosition
    Mean duration (ms) 374.3
    Mean CV 9.6%
    Worst duration (ms) 531.8
    Worst identifier querySelector
System information
Node version v14.15.1
CPU count 2
CPU speed 2.095 GHz
CPU model Intel(R) Xeon(R) Platinum 8171M CPU @ 2.60GHz
CPU Architecture x64
Memory 6.8 GiB
Platform linux
Release 4.15.0-1098-azure

@orta
Copy link
Collaborator

orta commented Dec 14, 2020

It might better, at least while you're still at an incubation stage to re-export the mapbox types rather than C&P them over into a new definition?

@folke
Copy link
Contributor Author

folke commented Dec 14, 2020

@orta is there any way I can make a "reference" to a specific version of mapbox-gl?
The closest @types version would be 1.12.8

The ones I've copied into maplibre-gl is a more recent commit that corresponds to mapbox-gl@1.13.

The latest @types/mapbox-gl is for mapbox-gl@2.0.0. This version has a lot of changes and is no longer opensource.

The goal for @types/maplibre-js is to point to the latest opensource release which is 1.13.0

@orta
Copy link
Collaborator

orta commented Dec 15, 2020

Cool, then this seems reasonable to me 👍🏻

@orta orta merged commit f1e879e into DefinitelyTyped:master Dec 15, 2020
@typescript-bot
Copy link
Contributor

I just published @types/maplibre-gl@1.13.0 to npm.

@elibarzilay elibarzilay moved this from Needs Maintainer Action to Recently Merged in New Pull Request Status Board Dec 19, 2020
@typescript-bot typescript-bot removed this from Recently Merged in New Pull Request Status Board Dec 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
New Definition This PR creates a new definition package.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants