0.2.1 • Published 2 years ago
@aiou/mario v0.2.1
@aiou/mario
Simple Manipulate syste mbased on gulp
features
- 🖐️ Similar syntax like github workflow, check supported syntax here
- 📦 Builtin most use actions like
replace/copy/clean/json-editor
- 📝 Work with listr
- ⚡ Support expression string like github-outputs
install
npm install @aiou/mario
usage
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 underprocess.cwd()
, auto ignorenode_modules
. If specificpaths
but not match files, will skip job.
common options for uses
run
in workflow
steps.continue-on-error
- no exit if error
steps:
- name: Setup Husky
run: pnpx --yes husky-init
continue-on-error: true
uses
only support builtin actions
replace
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
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 filepairs
- partial updated json contentpath
-separator
is.
likelodash.set
value
clean
jobs:
CLEAN:
paths: "*.ts"
steps:
- name: Clean Action
- uses: clean
with:
paths:
- "output/*"
output
- clean files matchedoutput/**
copy
jobs:
COPY:
paths: "assets.ts"
steps:
- name: COPY
- uses: copy
with:
output: output
output
- copypaths
files tooutput
run
jobs:
RUN:
paths: "output/*"
steps:
- name: Run Shell
run: echo hello
with:
quiet: false
quiet
- silent exec
how it work
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
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
built with ❤️ by 😼
0.2.1
2 years ago
0.2.0
2 years ago
0.1.0
2 years ago
0.0.0-beta-20220122125303
2 years ago
0.0.0
2 years ago