Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add TS types #6

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

Merged
HappyZombies merged 1 commit into node-oauth:development from orgads:types
Nov 24, 2021
Merged

Add TS types #6

HappyZombies merged 1 commit into node-oauth:development from orgads:types
Nov 24, 2021

Conversation

@orgads
Copy link
Contributor

@orgads orgads commented Oct 10, 2021

Copied from DefinitelyTyped.

maricn, Uzlopak, and jorenvandeweyer reacted with thumbs up emoji
Copy link
Member

Thank you @orgads can you please make this independent from express? // cc @HappyZombies

Copy link
Member

HappyZombies commented Oct 10, 2021
edited
Loading

branch v5-dev contains an entire TypeScript version. While this PR is fine, I think we need to be discussing Code Quality first, updating vulnerability packages and also (possibly) tackling what was left on v4. I think after all this THEN we can move to TS.

Copy link
Contributor Author

orgads commented Oct 10, 2021

@jankapunkt Why? The Request/Response types accept express input.

@HappyZombies This PR is not about migration to TS. It merely adds the definitions file. This is required for users that use @types/oauth2-server. It's either adding the types here, or adding a new package to DefinitelyTyped.

Copy link
Member

@orgads I know they to but not everybody uses express (which is why there are the adapters). Wouldn't the current import force people to install express?

Copy link
Member

Not to mention that @types/oauth2-server is from the old/previous module, so things will probably be different once we start adding new features/differences. So it would be incorrect to use @types/oauth2-server since it's not related to this repository/package.

Also, per README -> "The @node-oauth/oauth2-server module is framework-agnostic". Making it the express Request basically means that the module now depends on Express.

Copy link
Contributor Author

orgads commented Oct 10, 2021

@jankapunkt Done. Hope it's good enough now.

@HappyZombies This is exactly the reason I want to add the definitions file here, so it will be easier to adapt when making changes.

Generally, changes in a minor version should not break existing APIs, so the definitions file is not expected to change frequently.

Copy link
Member

@orgads got it, thanks for explaining, I am not 100% knowledgeable on the whole TypeScript-isms so thanks for being patient with me 😅

Copy link
Contributor Author

orgads commented Oct 13, 2021

ping?

Copy link
Member

hey @orgads we are still setting this up, there are many things we have to get running first, before we can merge new features or fixes. Please follow on the following PRs:

#18 #32 #29 #30 #35

@HappyZombies HappyZombies added on hold 🛑 We will look into it at a later time typescript 🔢 TypeScript related labels Oct 13, 2021
Copy link
Contributor Author

orgads commented Oct 17, 2021

ping

Copy link
Member

Branch is still pointing to master, besides we will ping you once ready, so no need to keep bumping us.

@orgads orgads changed the base branch from master to development October 19, 2021 12:38
Copy link
Contributor Author

orgads commented Oct 19, 2021

Changed target to development and rebased.

HappyZombies reacted with thumbs up emoji

Copy link
Contributor Author

orgads commented Nov 1, 2021

Sorry for bothering, but I'm stuck with a vulnerable lodash dependency because of the original oauth2-server package.

Is anything holding you now from merging this and releasing a new version?

Copy link
Member

@orgads I activate CI for your PR and you need one more review from either @HappyZombies or @jwerre as I am not the typescript expert

Copy link
Contributor Author

orgads commented Nov 4, 2021

Well?

Copy link
Collaborator

Uzlopak commented Nov 11, 2021

If you add typings to your package, then you put them into the typings-attribute of package.json and not into the types-attribute.

Copy link
Contributor Author

orgads commented Nov 11, 2021

Not according to the docs:

Note that the "typings" field is synonymous with types, and could be used as well.

Copy link
Collaborator

Uzlopak commented Nov 11, 2021

yes you are right. I apologize,

Copy link
Member

@HappyZombies @jwerre I think this is now worth a second look since we released 4.1.0

Copy link
Collaborator

@Uzlopak Uzlopak left a comment

Choose a reason for hiding this comment

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

I think http.IncomingMessage is the correct Interface.

@HappyZombies HappyZombies removed the on hold 🛑 We will look into it at a later time label Nov 12, 2021
Copied from DefinitelyTyped.
Copy link
Member

This issue is still keeping me from switching to @node-oauth/oauth2-server (and probably many other).

I think this should be merged and released as soon as possible and improved later.

Copy link
Contributor Author

orgads commented Nov 23, 2021

I lost my patience and created a forked package with the types: https://www.npmjs.com/package/@audc/oauth2-server

Feel free to use it :)

Copy link
Member

I'll try to get this out tomorrow, there were many issues initially so I was a bit sus, but I'm sure they're ironed out now. Sorry about that y'all.

jorenvandeweyer reacted with hooray emoji

Copy link
Contributor Author

orgads commented Nov 23, 2021

Thank you.

Copy link
Member

@jwerre mind approving?

Copy link
Contributor

jwerre commented Nov 24, 2021

Ohhh... I'm not much of a Typescripter. I'll approve but not with any confidence.

Copy link
Member

jorenvandeweyer commented Nov 24, 2021
edited
Loading

Ohhh... I'm not much of a Typescripter. I'll approve but not with any confidence.

I'll verify the types on some existing projects, and update them if necessary.

jwerre reacted with thumbs up emoji

Copy link
Collaborator

Uzlopak commented Nov 24, 2021

@jwerre

I am a typescript user and I think that the types look Ok so far. We can always modify them if the are wrong. In worst case a typescript user would do a // @ts-ignore and report this as a finding.
So nobody should be blocked by the typings and they dont modify active code so no breaking change.

Copy link
Member

100% @Uzlopak , any serious issue I have can be fixed later on. Just wanna unblock people looking forward to this

@HappyZombies HappyZombies merged commit 8784aed into node-oauth:development Nov 24, 2021
Copy link
Contributor

jwerre commented Nov 24, 2021

I wonder it we could set up DTSLint in order to test the types?

Copy link
Collaborator

Uzlopak commented Nov 24, 2021

Wie could use tsd like fastify does.

I added yesterday a type change to fastify/point-of-view and modified the test.

fastify/point-of-view#272 (comment)

@orgads orgads deleted the types branch November 24, 2021 20:20
Copy link
Member

Thanks for merging! Any idea when this will be released?

Copy link
Member

I'll try to get it out today or tomorrow

Copy link
Member

This has been released on 4.1.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@Uzlopak Uzlopak Uzlopak requested changes

@HappyZombies HappyZombies HappyZombies approved these changes

@jwerre jwerre Awaiting requested review from jwerre

Assignees

No one assigned

Labels

typescript 🔢 TypeScript related

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /