![]() ![]() ![]() ![]() + "compile:tailwind-config": "yarn workspace compile", + "compile:shared-components": "yarn workspace compile", + "compile:resource-utils": "yarn workspace compile", + "compile:utils": "yarn workspace compile", + "compile:fakers": "yarn workspace compile", "check:graphql-server": "yarn -cwd 'packages/graphql-server' run check-server", "compile:dolthub": "yarn -cwd 'packages/dolthub' compile", ![]() "compile:graphql-server": "yarn -cwd 'packages/graphql-server' compile", "compile:blog": "yarn -cwd 'packages/blog' compile", "compile:tailwind-config": "yarn -cwd 'packages/tailwind-config' compile", "compile:shared-components": "yarn -cwd 'packages/shared-components' compile", "compile:resource-utils": "yarn -cwd 'packages/resource-utils' compile", "compile:utils": "yarn -cwd 'packages/utils' compile", "compile:fakers": "yarn -cwd 'packages/fakers' compile", Here are all the steps we needed to migrate our monorepo. Which I discuss below, and I was eventually able to successfully land the migration. There were a few extra changes I needed to make Without it to continue with the migration. (specifically ESLint, dependabot) and it still seemed like there were enough benefits We wanted React 18 to be more stable before upgrading and webpack 4Įarly because it didn't seem like enough of the tools we were using were compatible To resolve it we either needed to downgrade to I did try and fail a few times before landing the change. In the end, the actual changes required to migrate to Yarn 2 were not that many. You can read more about our front-end architecture This is an abbreviated version of what our web directory looks like: Package, but they are resolved locally and share a single node_modules and yarn.lock. Packages as dependencies in one another's package.json files exactly as with any other Lives in a directory within ld called web, which is split up into packages managedĮach package is just a regular NPM package with its own package.json. Our monorepo (named ld, short for Liquidata, our former company name) houses all of ourīack-end, front-end, deployment configuration, and other related code. Into it and got excited about some of the new commands,Īnd potential performance gains, so I decided to try it out. I initially decided to upgrade our repository when I came across one of Yarn 2's newĬommands researching a solution to a dependency issue we were having. Yarn summarizes the reasons to upgrade to Yarn Modern on their We thought sharing them could be useful for others looking to adopt Yarn 2. It took us some extra steps to make Yarn 2 work with our monorepo and other We recently migrated our monorepo to Yarn 2 (or We recommend trying out the new npm workspaces and providing feedback to the npm team so they get even better over time.React to share, discover, and collaborate onĭolt databases. from and it will find it on disk through the symlink. Our root package.json adds those three directories’ children as workspaces: We don’t have to keep these three types of packages separated, but it helps us navigate around. We’ve broken our project up into three different types of packages: apps which are preact apps intended to be bundled and deployed somewhere, modules which are plain npm packages for node/browsers and do not bundle their dependencies, and workers which are either Worker or ServiceWorker scripts entirely bundled up with no imports or exports. I’ll try to give a brief overview of our directory structure and how npm’s workspaces work for us.įor us, the new workspaces feature means two things: 1) all dependencies of the root package + sub-packages are installed into a single node_modules folder at the root and 2) sub-packages are symlinked into node_modules during npm install. Workspaces have been available to try since version 7 was released and is now considered “generally available.” I have been familiar with yarn workspaces for some time and I was a bit confused at first about what npm workspaces actually did. Recently I wrote about changing the tooling we use for our JavaScript monorepo and mentioned we are using npm 7’s new workspaces feature. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |