Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/sxzz/monoman

Manage monorepo common files.
https://github.com/sxzz/monoman

cli monorepo

Last synced: about 2 months ago
JSON representation

Manage monorepo common files.

Awesome Lists containing this project

README

        

# monoman [![npm](https://img.shields.io/npm/v/monoman.svg)](https://npmjs.com/package/monoman)

[![Unit Test](https://github.com/sxzz/monoman/actions/workflows/unit-test.yml/badge.svg)](https://github.com/sxzz/monoman/actions/workflows/unit-test.yml)

Manage monorepo common files.

## Install

```bash
npm i monoman
```

## Usage

```
pnpm monoman [-c | --check | -w | --write]
```

```ts
// monoman.config.[ts,js]
import { defineConfig } from 'monoman'

export default defineConfig([
{
// Globs to match files
include: ['**/package.json'],
exclude: ['exclude/package.json'],
type: 'json',
contents(data: Record) {
data.name = 'monoman'
return data
},
},
{
include: ['**/package.json'],
exclude: ['exclude/package.json'],
type: 'text',
contents(text) {
return `${text} hello monoman!`
},
},
])
```

See an [example](https://github.com/vue-macros/vue-macros/blob/main/monoman.config.ts) for more details.

## Presets

### `dedupeDeps`

Make all dependencies in all `package.json` unique.

```ts
function dedupeDeps({
include = 'packages/*/package.json',
exclude,
distinguishType = false,
types = ['dependencies', 'devDependencies'],
ignoreProtocols = ['file', 'link', 'workspace'],
}: {
include?: Arrayable
exclude?: Arrayable
distinguishType?: boolean
types?: string[]
ignoreProtocols?: string[]
} = {})
```

## Sponsors





## License

[MIT](./LICENSE) License © 2023 [三咲智子](https://github.com/sxzz)