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

Add types for @mysql/xdevapi #28062

Closed
wants to merge 4 commits into from
Closed

Conversation

r-a303931
Copy link

@r-a303931 r-a303931 commented Aug 12, 2018

  • 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.)

  • Follow the advice from the readme.

  • Avoid common mistakes.

  • Run npm run lint package-name (or tsc if no tslint.json is present).

  • 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.

  • tslint.json should be present, and 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 Aug 12, 2018
@typescript-bot
Copy link
Contributor

typescript-bot commented Aug 12, 2018

@r-a303931 Thank you for submitting this PR!

Because this is a new definition, a DefinitelyTyped maintainer will be reviewing this PR in the next few days once the Travis CI build passes.

In the meantime, if the build fails or a merge conflict occurs, I'll let you know. Have a nice day!

@@ -0,0 +1,493 @@
// Type definitions for @mysql/xdevapi 8.0
// Project: https://github.com/mysql/mysql-connector-nodejs (Does not have to be to GitHub, but prefer linking to a source code repository rather than to a project website.)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should be just // Project: https://github.com/mysql/mysql-connector-nodejs here

@typescript-bot typescript-bot moved this from Review to Needs Author Attention in Pull Request Status Board Aug 13, 2018
@typescript-bot typescript-bot added Revision needed This PR needs code changes before it can be merged. and removed Awaiting reviewer feedback labels Aug 13, 2018
@typescript-bot
Copy link
Contributor

typescript-bot commented Aug 13, 2018

@r-a303931 One or more reviewers has requested changes. Please address their comments. I'll be back once they sign off or you've pushed new commits. Thank you!

@typescript-bot typescript-bot added the Revision needed This PR needs code changes before it can be merged. label Aug 13, 2018
@typescript-bot
Copy link
Contributor

🔔 @plantain-00 - Thanks for your review of this PR! Can you please look at the new code and update your review status if appropriate?

@typescript-bot typescript-bot added the Revision needed This PR needs code changes before it can be merged. label Aug 13, 2018
@typescript-bot typescript-bot moved this from Needs Author Attention to Review in Pull Request Status Board Aug 13, 2018
@typescript-bot typescript-bot added Other Approved This PR was reviewed and signed-off by a community member. Awaiting reviewer feedback labels Aug 13, 2018

export interface SocketFactory {
// tslint:disable-next-line
createSocket: Function;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discussed here, it's not good practice to use Function.

}

export class Schema implements DatabaseObject {
// tslint:disable-next-line
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What TSLint rule are you disabling here and why?

createCollection<T>(
name: string,
options: CreateCollectionOptions
// tslint:disable-next-line
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

arrayAppend<
K extends keyof T = keyof T,
// tslint:disable-next-line:no-unnecessary-generics
J extends keyof T[K] = keyof T[K]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think you need these defaults here (e.g. = keyof T).
In fact, you don't even need J; you can just index with keyof T[K].

getClassName(): string;

// tslint:disable-next-line
getCollection<T>(name: string): Collection<T>;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discussed here, it's cleaner if this is just getCollection(name: string): Collection<any>.

getName(): string;

// tslint:disable-next-line:no-unnecessary-generics
getTable<T = {}>(name: string): Table<T>;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here, except Table<{}>.

@typescript-bot typescript-bot moved this from Review to Needs Author Attention in Pull Request Status Board Aug 14, 2018
@typescript-bot typescript-bot added Revision needed This PR needs code changes before it can be merged. and removed Other Approved This PR was reviewed and signed-off by a community member. Awaiting reviewer feedback labels Aug 14, 2018
@typescript-bot typescript-bot added Abandoned This PR had no activity for a long time, and is considered abandoned Revision needed This PR needs code changes before it can be merged. labels Aug 21, 2018
@typescript-bot
Copy link
Contributor

@r-a303931 To keep things tidy, we have to close PRs that aren't mergeable but don't have activity from their author. No worries, though - please open a new PR if you'd like to continue with this change. Thank you!

@typescript-bot typescript-bot removed this from Needs Author Attention in Pull Request Status Board Aug 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Abandoned This PR had no activity for a long time, and is considered abandoned New Definition This PR creates a new definition package. Revision needed This PR needs code changes before it can be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants