πPutout plugin adds ability to transform madrun scripts
npm install @putout/plugin-madrun[NPMIMGURL]: https://img.shields.io/npm/v/@putout/plugin-madrun.svg?style=flat&longCache=true
[NPMURL]: https://npmjs.org/package/@putout/plugin-madrun "npm"
> CLI tool to run multiple npm-scripts in a madly comfortable way.
>
> (c) Madrun
πPutout plugin adds ability to fix issues with
Madrun config file.
```
npm i putout @putout/plugin-madrun -D
- β
add-cut-env;
- β
add-fix-lint;
- β
add-function;
- β
add-missing-quotes-to-watcher;
- β
add-run;
- β
call-run;
- β
convert-args-to-scripts;
- β
convert-cut-env-to-run;
- β
convert-lint-lib;
- β
convert-nyc-to-c8
- β
convert-run-argument;
- β
convert-run-to-cut-env;
- β
convert-to-async;
- β
declare;
- β
remove-check-duplicates-from-test;
- β
remove-putout;
- β
remove-useless-array-in-run;
- β
remove-useless-string-conversion;
- β
rename-eslint-to-putout;
- β
rename-series-to-run;
- β
set-lint-dot;
- β
set-report-lcov;
- β rename-file;
`json`
{
"rules": {
"madrun/add-function": "on",
"madrun/add-fix-lint": "on",
"madrun/add-run": "on",
"madrun/add-missing-quotes-to-watcher": "on",
"madrun/add-cut-env": "on",
"madrun/call-run": "on",
"madrun/convert-run-argument": "on",
"madrun/convert-args-to-scripts": "on",
"madrun/convert-run-to-cut-env": "on",
"madrun/convert-cut-env-to-run": "on",
"madrun/rename-file": "off",
"madrun/rename-series-to-run": "on",
"madrun/rename-eslint-to-putout": "on",
"madrun/set-lint-dot": "on",
"madrun/convert-to-async": "on",
"madrun/convert-nyc-to-c8": "on",
"madrun/set-report-lcov": "on",
"madrun/remove-check-duplicates-from-test": "on",
"madrun/remove-useless-array-in-run": "on",
"madrun/remove-useless-string-conversion": "on"
}
}
`js`
module.exports = {
hello: 'world',
};
`js`
module.exports = {
hello: () => 'world',
};
`js
const {run} = require('madrun');
module.exports = {
lint: 'putout lib test',
};
`
`js
const {run} = require('madrun');
module.exports = {
'lint': 'putout lib test',
'fix:lint': run('lint', '--fix'),
};
`
Checkout in πPutout Editor.
`js`
export default {
'watch:test': async () => await run('watcher', await run('test')),
};
`js"${await run('test')}"
export default {
'watch:test': async () => await run('watcher', ),`
};
`js`
module.exports = {
lint: 'putout lib test',
};
`js
const {run} = require('madrun');
module.exports = {
lint: 'putout lib test',
};
`
`js`
export default {
'test': () => [env, 'test:only'],
'test:only': () => [env, 'npm test'],
};
`js
import {cutEnv} from 'madrun';
export default {
'test': async () => [testEnv, await cutEnv('test:only')],
'test:only': () => [env, 'npm test'],
};
`
`js`
module.exports = {
hello: () => run(['a']),
};
`js`
module.exports = {
hello: () => run('a'),
};
Check out in πPutout Editor.
`js`
export default {
build: () => 'tsup',
wisdom: () => run('build', 'test', 'test:dts'),
};
`js`
export default {
build: () => 'tsup',
wisdom: () => run(['build', 'test', 'test:dts']),
};
`js`
export default {
'test': () => [env, 'npm test'],
'test:only': () => 'npm test',
'coverage': async () => [env, await run('test')],
'coverage:only': async () => [env, await run('test:only')],
};
`js`
export default {
'test': () => [env, 'npm test'],
'test:only': () => 'npm test',
'coverage': async () => [env, await cutEnv('test')],
'coverage:only': async () => [env, await run('test:only')],
};
`js`
export default {
'test': () => [env, 'npm test'],
'test:only': () => 'npm test',
'coverage': async () => [env, await cutEnv('test')],
'coverage:only': async () => [env, await cutEnv('test:only')],
};
`js`
export default {
'test': () => [env, 'npm test'],
'test:only': () => 'npm test',
'coverage': async () => [env, await cutEnv('test')],
'coverage:only': async () => [env, await run('test:only')],
};
`js`
module.exports = {
lint: 'eslint lib test --ignore test/fixture',
};
`js`
module.exports = {
lint: 'putout lib test',
};
Rename madrun.js to .madrun.js when located near package.json.
Checkout in πPutout Editor.
``
-madrun.js
+.madrun.js
`js`
module.exports = {
lint: 'putout lib test',
};
`js`
module.exports = {
lint: 'putout .',
};
`js`
module.exports = {
lint: () => String(run('hello')),
};
`js`
module.exports = {
lint: async () => String(await run('hello')),
};
`jsnyc report --reporter=text-lcov | coveralls
export default {
coverage: () => 'nyc npm test',
report: () => ,`
};
`js`
export default {
coverage: () => 'c8 npm test',
report: 'c8 report --reporter=lcov',
};
`jsc8 report --reporter=text-lcov | coveralls || true
export default {
report: () => ,`
};
`js`
export default {
report: 'c8 report --reporter=lcov',
};
`js`
export default {
test: () => 'tape -d *.js',
};
`js`
export default {
test: () => 'tape *.js',
};
Checkout in πPutout Editor.
`js`
export default {
time: async () => await run(['lint:fresh', '-f time']),
};
`js`
export default {
time: async () => await run('lint:fresh', '-f time'),
};
Checkout in πPutout Editor.
`js`
export default {
time: async () => [testEnv, String(await cutEnv('test:raw'))],
};
`js`
export default {
time: async () => [testEnv, await cutEnv('test:raw')],
};
`jsc8 ${await cutEnv('test')}
export default {
coverage: async () => [env, ],`
};
`js
import {cutEnv} from 'madrun';
export default {
coverage: async () => [env, c8 ${await cutEnv('test')}],``
};
MIT