Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/monoweave/monoweave
Versioning and publishing toolchain for Yarn monorepos.
https://github.com/monoweave/monoweave
monorepo npm package yarn
Last synced: 3 days ago
JSON representation
Versioning and publishing toolchain for Yarn monorepos.
- Host: GitHub
- URL: https://github.com/monoweave/monoweave
- Owner: monoweave
- License: bsd-3-clause
- Created: 2024-02-29T14:39:59.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2024-09-18T21:41:58.000Z (3 months ago)
- Last Synced: 2024-10-09T23:32:04.091Z (3 months ago)
- Topics: monorepo, npm, package, yarn
- Language: TypeScript
- Homepage: https://monoweave.github.io/monoweave/
- Size: 3.12 MB
- Stars: 18
- Watchers: 0
- Forks: 1
- Open Issues: 17
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Security: SECURITY.md
Awesome Lists containing this project
README
# Monoweave - Versioning, Changelogs, Publishing with Yarn
[![Continuous Integration](https://github.com/monoweave/monoweave/actions/workflows/pull-request.yml/badge.svg)](https://github.com/monoweave/monoweave/actions/workflows/pull-request.yml)
[![codecov](https://codecov.io/gh/monoweave/monoweave/branch/main/graph/badge.svg)](https://codecov.io/gh/monoweave/monoweave)
[![GitHub license](https://img.shields.io/github/license/monoweave/monoweave)](https://github.com/monoweave/monoweave/blob/main/LICENSE)
![node-current](https://img.shields.io/node/v/@monoweave/cli)
[![npm](https://img.shields.io/npm/v/@monoweave/cli.svg)](https://www.npmjs.com/package/@monoweave/cli)
[![npm downloads](https://img.shields.io/npm/dm/@monoweave/cli.svg)](https://npm-stat.com/charts.html?package=@monoweave/cli)
![Discord](https://img.shields.io/discord/1253743105249902744)Monoweave is a tool for managing the versioning and publishing lifecycle of a Yarn-based monorepo.
There are a number of presets to choose from, and many aspects of monoweave can be customized. Out of the box, monoweave supports both an automatic mode that determines versioning from reading commit messages for modified files (via conventional commits), as well as a manual mode that puts the version determination in the hands of the developer (via changeset files).
See: [Monoweave Documentation](https://monoweave.github.io/monoweave/)
## Usage
It is recommended to follow the [Getting Started](https://monoweave.github.io/monoweave/getting-started/) guide in the monoweave documentation. In its simplest form to get started:
```sh
yarn add -D @monoweave/cli
```and then in a `monoweave.config.yaml` file:
```yaml
preset: monoweave/preset-recommended # or preset-manual for changeset files
```You can run: `yarn monoweave` locally to see a dry run of the changes that would be published.
If using GitHub Actions, also check out our release preview reusable action: [monoweave/github-action-preview@main](https://github.com/monoweave/github-action-preview).
## Monoweave vs. other popular tooling
Monoweave only supports [Yarn-modern](https://yarnpkg.com) projects with minimum Node version >=18.19.
| Tool | Package Managers | Monorepo Support | Conventional Commits | Changeset Files | Changelogs | publishConfig overrides | workspace:^ protocol | Version Groups | Pull Request Previews | GitHub Releases | Plugin Support |
| -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- |
| [Monoweave](https://github.com/monoweave/monoweave) | yarn | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| [Lerna](https://github.com/lerna/lerna) | yarn, npm, pnpm | ✅ | ✅ | ❌ | ✅ | ❌ | ❌ | 🟨 | ❌ | ✅ | ❌ |
| [Lerna Lite](https://github.com/lerna-lite/lerna-lite) | yarn, npm, pnpm | ✅ | ✅ | ❌ | ✅ | ✅ | ✅ | 🟨 | ❌ | ✅ | ❌ |
| [Yarn Version Plugin](https://yarnpkg.com/cli/version) | yarn | ✅ | ❌ | ✅ | ❌ | ✅ | ✅ | ❌ | ❌ | ❌ | ✅
| [Atlassian Changesets](https://github.com/changesets/changesets) | [yarn*](https://github.com/changesets/changesets/pull/674), npm, pnpm | ✅ | ❌ | ✅ | ✅ | ❌ | ❌ | ❌ | ✅ | ✅ | ❌
| [Microsoft Beachball](https://github.com/microsoft/beachball) | yarn, npm, pnpm | ✅ | ❌ | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ | ❌[*](https://github.com/microsoft/beachball/issues/885) | ❌
| [Semantic Release](https://github.com/semantic-release/semantic-release) | yarn, npm, pnpm | ❌ | ✅ | ❌ | ✅ | ✅ | N/A | N/A | ❌ | ✅ | ✅ |> Legend: ✅ supported, 🟨 partial support, ❌ not supported
_If you notice an error or inaccuracy in the above comparison table, please open a GitHub issue. It's not possible to remove bias, however this should still be an accurate representation of how monoweave compares to other tooling._
**Feature definitions/notes:**
1. Package Managers: Monoweave only supports Yarn modern. Changesets partially supports Yarn modern since they don't use Yarn internally to publish so don't natively support Yarn workspace protocols (e.g. `workspace:^`).
2. Monorepo Support: Only semantic release in the above list doesn't support monorepos. All other tools, including monoweave, also support publishing a single non-monorepo package.
3. Conventional Commits: Monoweave, Lerna, and Semantic Release all support reading git commit messages according to [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/) to determine the version strategy to apply. This behaviour can be disabled in monoweave, but is required for semantic release (Lerna does have a way to version from the command line to bypass commit messages).
4. Changeset Files: This is called "manual mode" in monoweave, and is a more explicit versioning approach compared to the conventional commits parsing above. Monoweave's changeset files are called "version files" and follow a format very similar to Changesets.
5. Changelogs: When using the conventional commits mode with Monoweave, changelogs are generated using [conventional changelogs](https://github.com/conventional-changelog/conventional-changelog), otherwise there's a default writer that pulls changelogs from manual version files.
6. publishConfig overrides: Monoweave uses Yarn publishing internally which will copy some fields from your package.json's publishConfig property. This enables a pattern of having "main" point to source code and "publishConfig.main" point to build artifacts.
7. workspace:^ protocol: Yarn supports listing workspace dependencies using `workspace:^` and `workspace:*`. This instructs Yarn to resolve the dependency to a local version instead of remote. Monoweave removes the workspace protocol during publish and respects the version range specifier (`^` and `*`).
8. Version Groups: Lerna offers a "fixed/locked" mode that ties all versions in a project together, however it's marked as "partial" in the table above since it doesn't offer granularity within a monorepo. Beachball calls this version groups.
9. Pull Request Previews: Monoweave has a [GitHub Action](https://github.com/monoweave/github-action-preview) for pull request previews. It can be adapted for other CI systems if there's demand.
10. GitHub Releases: Monoweave implements GitHub releases using the monoweave plugin system. We have some open issues tracking additional functionality for the plugin.
11. Plugin Support: Monoweave exposes [tappable](https://github.com/webpack/tapable) hooks, this is how the GitHub releases functionality is added. Since Monoweave uses Yarn internally, Yarn plugins can also be used to extend monoweave.## Stability of Monoweave / Public API
Monoweave respects semantic versioning, however only the `@monoweave/cli` package is considered entirely "public". The other packages, e.g. `@monoweave/changelog` are internal and may have unexpected breaking changes if relied upon directly -- we try not to do so, however unlike the CLI, there's less testing of the interface.
In terms of stability and feature completeness, although this GitHub repository is fairly new, monoweave's roots extend from the monodeploy project which has been around for a few years. As can be seen by the above tool comparison table, Monoweave supports all the core features necessary to manage a project. There's always room for improvement though, and contributions are very much welcome.
## Contributing
See the [Contributing Guide](https://monoweave.github.io/monoweave/contributing) for setup instructions, tips, and guidelines.
## Contributors
[![All Contributors](https://img.shields.io/badge/all_contributors-16-orange.svg?style=flat-square)](#contributors-)
Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
Noah
💻 🚇
Marc Cataford
💻 🚇
Filip Malinowski
💻 🐛
Ian McCausland
📖
Daniel Basilio
🐛
Michael Rose
💻 ⚠️
Brendan Hall-Hern
💻
Shouvik DCosta
💻
Maryam Pazirandeh
🎨
Jake Bolam
📖
Emmanuel Ogbizi
👀
Josh DM
💻 🚇
AnvarGazizovTH
🚇 🔧 💻
Edie Lemoine
💻
Ondřej Švanda
💻 📖
Shawn Drape
📖
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!
---
> This project is a fork of [Monodeploy (licensed under Apache-2.0)](https://github.com/tophat/monodeploy) by the original core contributor of Monodeploy.
>
> Note that since this project has been forked from Monodeploy, the original authors of Monodeploy are listed in the contributors section for credit (though the git history wasn't maintained).