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

Convert paypal-js to a monorepo with Changesets and npm workspaces #453

Merged
merged 5 commits into from
Feb 9, 2024

Conversation

wsbrunson
Copy link
Member

@wsbrunson wsbrunson commented Feb 1, 2024

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.

@wsbrunson wsbrunson mentioned this pull request Feb 1, 2024
@wsbrunson wsbrunson changed the title convert to monorepo Convert paypal-js to a monorepo with Changesets and npm workspaces Feb 1, 2024
@wsbrunson wsbrunson marked this pull request as ready for review February 1, 2024 21:05
@wsbrunson wsbrunson requested a review from a team as a code owner February 1, 2024 21:05
Copy link
Contributor

@ravishekhar ravishekhar left a comment

Choose a reason for hiding this comment

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

🎉

README.md Show resolved Hide resolved
README.md Show resolved Hide resolved
Copy link
Contributor

@jshawl jshawl left a 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) 🚀 :shipit:

package.json Show resolved Hide resolved
Copy link
Contributor

@gregjopa gregjopa left a comment

Choose a reason for hiding this comment

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

💯

@wsbrunson wsbrunson merged commit 082bd2f into main Feb 9, 2024
2 checks passed
@wsbrunson wsbrunson deleted the monorepo2 branch February 9, 2024 17:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants