Move all NextAuth.js projects into a monorepo #3952
Replies: 11 comments 1 reply
-
To replace
IMO, we can try this combo (astro use the same combo):
|
Beta Was this translation helpful? Give feedback.
-
I would love to help out with this if you need it! I've tried both turborepo and changesets in personal projects with decent result. Turborepo works great with I guess a good first step would be to setup turborepo in this repository, and make sure that every script etc. works the same way as before. Then following steps could be to extract shared configuration and bring in adapters and the docs. |
Beta Was this translation helpful? Give feedback.
-
Thank you! I believe @ThangHuuVu already has something he asked my opinion about, but any help is appreciated @adambrgmn! 🙏 I do use yarn 1 though (not 2 of 3), so that's not an issue for me. |
Beta Was this translation helpful? Give feedback.
-
Yeah, so I did try to merge
Furthermore, in this repo, we have With that, together with @adambrgmn's comment, I suggest the following steps:
TBD: The tech stack. Currently:
@balazsorban44 @adambrgmn What do you think about this? 🤝 |
Beta Was this translation helpful? Give feedback.
-
I think this sounds like a great plan 👍 let me know if you need help with something! Just "a few words"; I saw this tweet the other day. It has proven to be very true. We did a migration to NX at work before summer last year. We had two attempts before succeeding. The failures was due to us trying to "fix" stuff while migrating. |
Beta Was this translation helpful? Give feedback.
-
I'm so thankful for thinking this through! This sounds like a good plan, let's start with step 1. I am traveling this week and will meet up @ndom91 and @lluia the next week in live for the first time (:tada:). So if any of you want to open a PR until then, we could review, or else we can make this as our goal for the meetup to make the migration. |
Beta Was this translation helpful? Give feedback.
-
Wow thanks for all the hard work so far everyone! @balazsorban44 this sounds like a great project for us next week 🎉 |
Beta Was this translation helpful? Give feedback.
-
@ThangHuuVu I recommend moving "dev-app" to the apps folder as many mono-repo do |
Beta Was this translation helpful? Give feedback.
-
@ndom91 and I successfully moved the docs and adapter repositories into this one. Tests, builds are passing. Remaining tasks:
Admittedly, I don't seem to be a fan of Changesets, as it requires extra effort to write release notes. We already write commits, that should be enough to determine everything. I think https://github.com/pmowrer/semantic-release-monorepo might be a good solution for us. It is like For the example repo, we might move it into the monorepo, and have a GitHub action set up that commits all changes to the template repo. |
Beta Was this translation helpful? Give feedback.
-
I think moving |
Beta Was this translation helpful? Give feedback.
-
I believe we could take the above suggestion further. I propose something like this: This will allow extreme flexibility for us in the future, regarding work on other frameworks (#2294) |
Beta Was this translation helpful? Give feedback.
-
When NextAuth.js was first created, it had a single Adapter, and no docs. Later on, a documentation page was added, and until v4, it lived under a
www
folder in this repository.As the need for more adapters appeared, we decided to separate the project into multiple repositories:
Currently we have:
Core: https://github.com/nextauthjs/next-auth
Adapters: https://github.com/nextauthjs/adapters
Docs: https://github.com/nextauthjs/docs
JS Example: https://github.com/nextauthjs/next-auth-example
TS Example: https://github.com/nextauthjs/next-auth-typescript-example
I propose that we move Core, Adapters and Docs into the same repository again, but this time we do it properly as a monorepo.
Adapters is a good starting point, as it is already a monorepo, using Lerna under the hood.
For the new monorepo, Turborepo looks like a very good candidate. It currently does not support versioning, and I propose we have a look at Changesets as an alternative to
lerna
. I've had difficulties with it on the Adapters repo (mainly because of lack of experience, I admit), and I've heard good things about Changesets.As for the examples, ideally, we could also move those into the monorepo, but they are currently available as repository templates. We could add a cron job that copies our example packages from the monorepo to those repos, so we don't have to maintain them separately.
A reason for this proposal is that although the initial intention was a better separation of bug reports for easier maintenance, most of the time people don't check where they post a bug report, and it has been difficult to keep up with that (I mostly had to manually transfer issues to the correct place, which is tedious).
Further, as we plan to expand to other frameworks (#2294), it might be easier to keep everything under the same repository.
In the long term, the core package should be available as
@next-auth/core
probably, but for now let's keep it asnext-auth
.With this transition to a monorepo, we could start accepting PRs for other frameworks.
If you have any suggestions, let us know!
Beta Was this translation helpful? Give feedback.
All reactions