-
Notifications
You must be signed in to change notification settings - Fork 100
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
Convert paypal-js to a monorepo with Changesets and npm workspaces #453
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks great! just one small q about publishing alpha releases (I don't need this functionality at the moment but just thinking ahead) 🚀
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💯
The motivation for this change is to create a central repository for all of PayPal's JS SDK libraries that are intended for merchant use. We'd like this to be the one place to go to find framework-specific SDK wrappers, helper libraries, and constants/types. We'd also like it to be the single place where developers can open Github Issues about the PayPal SDK.
There are 2 changes to discuss that impact the workflow. We are heavily borrowing from grumbler-scripts if you'd like to see a current working example.
Note: I'm turning off prettier checking for now so that we don't mess up the diff too badly. Once this is merged, I'm going to create a separate PR to upgrade the version of prettier and remove any config options so that we are using the base prettier options.
Moving to Changesets
Before, this repo was using standard commits to manage versioning and changelogs. Its a nice tool for simple usecases but something like Changesets makes managing packages in a monorepo incredibly simple. It also doesn't require any formatting for commit messages, it has a cli helper to create a changelog entry and determine the type of change (patch, minor, major). Changesets will handle versioning each package and deploying them to npm.
NPM workspaces
The root package.json has a
workspaces
property now pointing to the/packages
folder. You can learn more about workspaces here. The general gist is that they are a great way to handle repositories with multiple npm packages provided directly from the npm team.In the future, we could consider a solution like Turbo if our requirements get more complicated. For now though, workspaces should suffice.