# @aiou/mario

> generator of neo

Latest version **0.3.1** (published 2025-08-31) · MIT license · 0 weekly downloads

## Install

```sh
npm install @aiou/mario
pnpm add @aiou/mario
yarn add @aiou/mario
bun add @aiou/mario
```

## Health

**Score 40/100 (D)** — status: maintenance-mode.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads; pre 1.0.

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.3.1 |
| Published | 2025-08-31 |
| First published | 2022-01-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=12 |
| Dependencies | 15 |
| Unpacked size | 34.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 11 |
| Author | JW |
| Maintainers | qidanta |
| Keywords | neo, generator |

## Links

- npm: https://www.npmjs.com/package/@aiou/mario
- Repository: https://github.com/neo-hack/neo
- Homepage: https://github.com/neo-hack/neo#readme
- Issues: https://github.com/neo-hack/neo/issues
- npm.io page: https://npm.io/package/@aiou/mario

## Dependencies (15)

- [del](https://npm.io/package/del.md) ^6.0.0
- [gulp](https://npm.io/package/gulp.md) ^4.0.2
- [debug](https://npm.io/package/debug.md) 4.3.3
- [consola](https://npm.io/package/consola.md) ^2.15.3
- [fs-extra](https://npm.io/package/fs-extra.md) ^10.0.0
- [hookable](https://npm.io/package/hookable.md) ^5.1.1
- [gulp-copy](https://npm.io/package/gulp-copy.md) ^4.0.1
- [lodash-es](https://npm.io/package/lodash-es.md) ^4.17.21
- [gulp-debug](https://npm.io/package/gulp-debug.md) ^4.0.0
- [gulp-shell](https://npm.io/package/gulp-shell.md) ^0.8.0
- [gulp-filter](https://npm.io/package/gulp-filter.md) ^7.0.0
- [gulp-rename](https://npm.io/package/gulp-rename.md) ^2.0.0
- [gulp-replace](https://npm.io/package/gulp-replace.md) ^1.1.3
- [read-yaml-file](https://npm.io/package/read-yaml-file.md) ^2.1.0
- [gulp-json-editor](https://npm.io/package/gulp-json-editor.md) ^2.5.6

## Recent versions

- 0.3.1 (latest) — 2025-08-31
- 0.0.0-beta-20220122125303 (beta) — 2022-01-22
- 0.3.0 — 2025-08-31
- 0.2.1 — 2022-02-08
- 0.2.0 — 2022-01-31
- 0.1.0 — 2022-01-23
- 0.0.0 — 2022-01-22

## README

# @aiou/mario
*Simple Manipulate syste mbased on gulp*

[![npm](https://img.shields.io/npm/v/@aiou/mario)](https://github.com/neo-hack/mario/tree/master) [![GitHub](https://img.shields.io/npm/l/@aiou/mario)](https://github.com/neo-hack/mario/tree/master)

## features

- 🖐️ Similar syntax like github workflow, check supported syntax [here](https://github.com/neo-hack/neo/tree/master/packages/mario/src/interface/index.ts)
- 📦 Builtin most use actions like `replace/copy/clean/json-editor`
- 📝 Work with [listr](https://github.com/neo-hack/neo/blob/master/packages/mario/docs/recipes.md)
- ⚡ Support expression string like [github-outputs](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#example-defining-outputs-for-a-job)

## install

```console
npm install @aiou/mario
```

## usage

```ts
import { create } from '@aiou/mario'

const mario = await create(filepath)
await mario.start()
```
### common options

common options for `job`

- `job.paths` - Not required, in default will be all files under `process.cwd()`, auto ignore `node_modules`. If specific `paths` but not match files, will skip job.

common options for `uses` `run` in workflow

- `steps.continue-on-error` - no exit if error

```yaml
steps:
  - name: Setup Husky
    run: pnpx --yes husky-init
    continue-on-error: true
```

### uses
**only support builtin actions**

**replace**

```yaml
jobs:
  REPLACE:
    paths: "output/**/*.ts"
    steps:
      - name: Replace Action
      - uses: replace
        with:
          match: one
          replacement: target

      # batch replace
      - name: Replace Action
      - uses: replace
        with:
          pairs:
            - match: two
              replacement: target
            - match: three
              replacement: ${{ outputs.variable }}

```

**json-editor**

```yaml
jobs:
  JSON EDITOR:
    paths: "output/**/*.json"
    steps:
      - name: Json Editor Action
      - uses: json-editor
        with:
          content:
            version: "1.0.0"
          pairs:
            - path: "scripts.ci:prepare"
              value: "pnpm publish"
            - path: "lint-staged"
              value:
                "**/**/*.{js,ts,tsx,vue,json}": ["eslint --fix"]
            
```

- `content` - overwrite matched json file
- `pairs` - partial updated json content
  - `path` - `separator` is `.` like `lodash.set`
  - `value`

**clean**

```yaml
jobs:
  CLEAN:
    paths: "*.ts"
    steps:
      - name: Clean Action
      - uses: clean
        with:
          paths:
            - "output/*"
```

- `output` - clean files matched `output/**`

**copy**

```yaml
jobs:
  COPY:
    paths: "assets.ts"
    steps:
      - name: COPY
      - uses: copy
        with:
          output: output
```

- `output` - copy `paths` files to `output`

## run

```yaml
jobs:
  RUN:
    paths: "output/*"
    steps:
      - name: Run Shell
        run: echo hello
        with:
          quiet: false
```

- `quiet` - silent exec

## how it work

```yaml
jobs:
  //...
  Issue template:
    name: Setup github issue templates
    paths: .neo/**/assets/templates/ISSUE_TEMPLATE/*.md
    steps:
      - name: Issue templates
        uses: copy
        with:
          output: .github/ISSUE_TEMPLATE
  //...
```

will convert to

```ts
gulp.task('Setup github issue templates', function () {
  gulp.src('.neo/**/assets/templates/ISSUE_TEMPLATE/*.md')
    .pipe('copy to output')
    .dest('..')
})
```

## TODO

- [ ] dynamic load external uses action
- [ ] more github workflow syntax, e.g. if

# 
<div align='right'>

*built with ❤️ by 😼*

</div>

---
_Source: https://npm.io/package/@aiou/mario · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
