0.6.0 • Published 4 years ago
pliz v0.6.0
Pliz is a cli tool that invokes JS functions (typically development, build, or deploy tasks).
Pliz can be supercharged with Google's zx for more shell power.
So when calling:
pliz bump minorThis function will be called:
// plizers.js
import { $ } from 'zx';
export async function bump([versionType]) {
await $`npm version ${versionType}`;
await $`git push`;
await $`git push --tags`;
}Rationale
Modern Javascript projects involve a multitude of development tasks. Typically these live in:
package.jsonscript commands, possible issues with which:- shell rather than JS
- no comments
- sometimes require extra dependencies (eg,
cross-env) - parametrisation can be tricky
scriptsfolder- onboarding and discoverability may be sub-optimal
- Our heads
- What's the command to kill a process? Do everyone remember
-9? What about Windows? - What's the command to enter a docker image interactive shell again?
- What's the command to kill a process? Do everyone remember
Pliz reduces the team's cognitive load by offering a single source of truth to all these.
Quick Start
1. Install
npm i -g pliz2. Create plizers
Create the following plizers.js file (or plizers/index.js) in your project root:
const say = ([text]) => {
console.log(`${text}!`);
};
module.exports = {
say,
};pliz.config.js:
require('@babel/register')({
presets: [
[
'@babel/preset-env',
{
targets: { node: 'current' },
},
],
],
});plizers.js:
export const say = ([text]) => {
console.log(`${text}!`);
};3. Use
In your shell:
pliz say Hello