Comments (8)
Hi, @kapouer thanks for suggesting this. I have never used peerDependencies
so far, but I agree that Grant can't be used without it's host modules. I'll consider using this option.
from grant.
I did some testing with peerDependencies
and I don't think they quite work for this case.
Currently I use Grant in project that uses express version 3.4.4
and it works without a problem. In case of a peer dependency I won't be able to install Grant if the peer dependency is set to 4.x
. On the other hand I really do need to specify express 4.x because that's what I'm testing against.
Same for the other 4 express middlewares that I use, if only one of these modules is added as a dependency to the consumer project and have a version mismatch, the install will fail.
No idea how's the situation with different versions of Koa, but then again I'm actually requiring these modules inside the Koa consumer implementation.
Recently I added support for Hapi, and that's the only consumer module I'm not requiring directly in my code.
from grant.
@kapouer this should be fixed in https://github.com/simov/grant/releases/tag/3.0.0 or at least that way you'll get only the modules required for your web framework of choice.
from grant.
perfect !
from grant.
@kapouer checkout the latest changelog here https://github.com/simov/grant/blob/master/CHANGELOG.md - express, koa and hapi are set as peerDependencies in their respective meta modules, also session and body-parser middlewares are no longer required internally, so the user is free to use any session store.
from grant.
npm3 no longer install peerDependencies. Is there a workaround ?
from grant.
NPM3 shifts the responsibility for fulfilling peer dependencies from library framework / plugin maintainers to application authors, in that line of thinking you now just get a warning if the dependency is missing.
As a consumer of this module you are responsible for specifying in your package.json which version of Koa your app/module is going to use. Essentially almost nothing have changed, you just have to make sure you explicitly specify Koa as dependency in your app.
from grant.
ok thanks
from grant.
Related Issues (20)
- Intended method of accessing session.grant HOT 2
- Discord Profile route always 401 Unauthorized HOT 7
- Recommended approach for handling config without checking into git HOT 1
- Support Deno? HOT 3
- iFrame redirect issue with Shopify oAuth HOT 4
- OAuth 2 state - how can I associate a successful grant with a user id HOT 5
- Is there a framework-agnostic API? HOT 1
- Telegram Oauth HOT 2
- Export the grant config and Options HOT 4
- Not working with Next 13 App Router
- How to use dynamic params in custom_params of grant? HOT 1
- Autodesk deprecated v1 (lib's current) oauth endpoints HOT 4
- Incorrect inclusion of client_secret for authorization_code grant in OAuth2 implementation HOT 1
- Switch to OAuth 2 for OpenStreetMap provider HOT 1
- Itch.io authentication HOT 2
- Alternating Domains HOT 5
- Allow to customize "missing provider" error URL? HOT 3
- Any Help to Implement Grant in Next JS
- Is it possible to pass arbitrary data in? HOT 1
- Grant playground open-source? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from grant.