https://github.com/igrek8/yarn-changed-workspaces
Show changed workspaces for a mono repository pattern
https://github.com/igrek8/yarn-changed-workspaces
changed-workspaces monorepo monorepository workspaces yarn
Last synced: 10 months ago
JSON representation
Show changed workspaces for a mono repository pattern
- Host: GitHub
- URL: https://github.com/igrek8/yarn-changed-workspaces
- Owner: igrek8
- Created: 2020-08-23T10:36:46.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2021-11-18T01:15:20.000Z (over 4 years ago)
- Last Synced: 2025-08-08T15:49:02.530Z (10 months ago)
- Topics: changed-workspaces, monorepo, monorepository, workspaces, yarn
- Language: JavaScript
- Homepage:
- Size: 91.8 KB
- Stars: 10
- Watchers: 1
- Forks: 3
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# yarn-changed-workspaces
A small utility tool to be used in CI/CD pipelines along with `git` to trigger dependent libraries' workflows in a monorepo pattern.

[](https://coveralls.io/github/igrek8/yarn-changed-workspaces?branch=master)
## Install
```
yarn global add yarn-changed-workspaces
```
## CLI
```
yarn-changed-workspaces --help
```
## Node.js
`./package.json`
```json
{
"workspaces": ["packages/*"]
}
```
```js
const getChangedWorkspaces = require("yarn-changed-workspaces");
(async () => {
const workspaces = await getChangedWorkspaces({
branch: "master",
projectRoot: process.cwd(),
});
console.log("changes", workspaces);
})();
```
## Control scope of change
`./package.json`
```json
{
"private": true,
"workspaces": ["packages/*"]
}
```
`./packages/app/package.json`
```json
{
"name": "@team/ui",
"version": "1.0.0",
"workspace": { "files": ["!**/*.(test|spec).(j|t)s(x)?"] }
}
```
## Limitation
`git` is the core diffing tool. **This library will not work if you use a different distributed version-control system** for tracking changes in source code during software development