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

[@chenfengyuan/datepicker] Add types for options #48526

Merged
merged 1 commit into from
Oct 12, 2020

Conversation

aried3r
Copy link
Contributor

@aried3r aried3r commented Oct 5, 2020

Please fill in this template.

  • Use a meaningful title for the pull request. Include the name of the package modified.
  • Test the change in your own code. (Compile and run.)
  • Add or edit tests to reflect the change. (Run with npm test YOUR_PACKAGE_NAME.)
  • Follow the advice from the readme.
  • Avoid common mistakes.
  • Run npm run lint package-name (or tsc if no tslint.json is present).

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 be present and it shouldn't have any additional or disabling of rules. Just content as { "extends": "dtslint/dt.json" }. If for reason the some rule need to be disabled, disable it for that line using // tslint:disable-next-line [ruleName] and not for whole package so that the need for disabling can be reviewed.
  • tsconfig.json should have noImplicitAny, noImplicitThis, strictNullChecks, and strictFunctionTypes set to true.

Only adds types for options.

https://github.com/fengyuanchen/datepicker#options
https://github.com/fengyuanchen/datepicker/blob/b233093ba7922a3a2d9d1c4aad6457a50cc7b080/docs/js/main.js#L8-L16
https://github.com/fengyuanchen/datepicker/blob/b233093ba7922a3a2d9d1c4aad6457a50cc7b080/test/events/pick.js#L17-L20

@typescript-bot
Copy link
Contributor

typescript-bot commented Oct 5, 2020

@aried3r Thank you for submitting this PR!

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": 48526,
  "author": "aried3r",
  "owners": [],
  "dangerLevel": "ScopedAndConfiguration",
  "headCommitAbbrOid": "d7877a9",
  "headCommitOid": "d7877a94830f885a9f34512e9a729c91eca97615",
  "mergeIsRequested": false,
  "stalenessInDays": 6,
  "lastPushDate": "2020-10-05T21:58:56.000Z",
  "lastCommentDate": "2020-10-05T22:01:15.000Z",
  "maintainerBlessed": false,
  "reviewLink": "https://github.com/DefinitelyTyped/DefinitelyTyped/pull/48526/files",
  "hasMergeConflict": false,
  "authorIsOwner": false,
  "isFirstContribution": false,
  "popularityLevel": "Well-liked by everyone",
  "newPackages": [
    "chenfengyuan__datepicker"
  ],
  "packages": [
    "chenfengyuan__datepicker"
  ],
  "files": [
    {
      "path": "types/chenfengyuan__datepicker/chenfengyuan__datepicker-tests.ts",
      "kind": "test",
      "package": "chenfengyuan__datepicker"
    },
    {
      "path": "types/chenfengyuan__datepicker/index.d.ts",
      "kind": "definition",
      "package": "chenfengyuan__datepicker"
    },
    {
      "path": "types/chenfengyuan__datepicker/tsconfig.json",
      "kind": "package-meta",
      "package": "chenfengyuan__datepicker",
      "suspect": "created"
    },
    {
      "path": "types/chenfengyuan__datepicker/tslint.json",
      "kind": "package-meta-ok",
      "package": "chenfengyuan__datepicker"
    }
  ],
  "hasDismissedReview": false,
  "ciResult": "pass",
  "reviewersWithStaleReviews": [],
  "approvalFlags": 0,
  "isChangesRequested": false
}

@typescript-bot
Copy link
Contributor

🔔 @aried3r — 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...)

@aried3r aried3r changed the title [@chenfengyuan/datepicker] Add types [@chenfengyuan/datepicker] Add types for options Oct 5, 2020
@aried3r
Copy link
Contributor Author

aried3r commented Oct 5, 2020

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.

@fengyuanchen, would you be up for reviewing this? Fully optional of course.

@typescript-bot typescript-bot added the New Definition This PR creates a new definition package. label Oct 5, 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 chenfengyuan__datepicker with its source on master.

Comparison details 📊
Batch compilation
Type count 25370
Assignability cache size 5380
Language service measurements
Samples taken 186
Identifiers in tests 186
getCompletionsAtPosition
    Mean duration (ms) 666.5
    Mean CV 7.5%
    Worst duration (ms) 1352.3
    Worst identifier trigger
getQuickInfoAtPosition
    Mean duration (ms) 667.4
    Mean CV 7.9%
    Worst duration (ms) 1121.2
    Worst identifier datepicker
System information
Node version v12.18.4
CPU count 2
CPU speed 2.397 GHz
CPU model Intel(R) Xeon(R) CPU E5-2673 v3 @ 2.40GHz
CPU Architecture x64
Memory 6.8 GiB
Platform linux
Release 4.15.0-1095-azure

@orta
Copy link
Collaborator

orta commented Oct 12, 2020

Nice work, great tests and well documented 10/10 👍🏻

@orta orta merged commit 48ca562 into DefinitelyTyped:master Oct 12, 2020
@typescript-bot
Copy link
Contributor

I just published @types/chenfengyuan__datepicker@1.0.0 to npm.

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.

3 participants