![]() ![]() Most open-source JavaScript and TypeScript libraries use Semantic Versioning to express the different types of changes a maintainer has made to a package. You normally do this by incrementing the version number of your package. When you modify a package, you need to signal to its consumers that you've made changes. If you're sitting there wondering what a monorepo is, go read this post. It sounds like people have heard incorrect information about monorepos! I was surprised to hear someone say that you can't version packages in a monorepo. "We’re going to put it in a monorepo so you can’t even version things!" That's when a second tweet popped up that read: I think it taps into a fear that a lot of developers have about design systems and component libraries.I think some of that fear stems from a misunderstanding of how versioning works. I was thinking about the joke a bit more. "Cool, so we'd like to change this component." "We're introducing a design system so that when we make a change, it'll go everywhere." I was scrolling through twitter the other day and I saw a joke tweet about design systems: Before You Build A Component Library: Versioning.Should my component library be a monorepo?.This post is part of an ongoing series about the problems you'll need to solve before you start building a component library. To enable it, add the following to the seed.Before You Build A Component Library: Monorepo Versioning Seed supports deploying Serverless monorepo projects that use Lerna and Yarn Workspaces. If they don't belong to any of your Lerna packages ( lerna ls -all), deploy all the services. Run lerna ls -since $ to get a list of all the updated files.To implement the above, use the following algorithm in your CI: If any of the libs are changed, then all services will get deployed. For ex, if sample-package is changed, then service1 should be deployed. If a package is changed, then only the service that depends on this package should be deployed. For ex, if you change any code in service1, then service2 should not be deployed. Only the service that has been changed should be deployed. We want to ensure that only the services that have been updated get deployed. $ yarn add -W some-npm-package Deployment Without Webpack, you'll need to disable hoisting since Serverless Framework does not package the dependencies of a service correctly on its own. But it also ensures that you can have Yarn hoist all your NPM packages to the project root. This is good for keeping your Lambda packages small. It uses the serverless-bundle plugin (based on Webpack) to create optimized Lambda packages. Each service is based on our Serverless Node.js Starter. The Serverless services are meant to be managed on their own. The packages/ and services/ directories are Yarn Workspaces. Any changes here should redeploy all our services. ![]() service2: Does not depend on any internal packages.Īny common code that you might not want to maintain as a package.This means that if it changes, we want to deploy service1. service1: Depends on the sample-package.These are Serverless services that are deployed. Any changes to a package should only deploy the service that depends on it. Each contains a package.json and can be optionally published to NPM. These are internal packages that are used in our services. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |