A set of standard plugins for use with
onecmd
.
npm install @onecmd/standard-plugins --save-dev
- Install the standard plugins:
npm install @onecmd/standard-plugins --save-dev
- Create a file named
onecmd.js
:
// @ts-check
const std = require('@onecmd/standard-plugins');
const nodeVersion = '16';
/** @type {readonly import('onecmd').Plugin[]} */
const plugins = [
std.babel(),
std.editorconfig(),
std.eslint(),
std.git(),
std.github({nodeVersion}),
std.jest({coverage: true}),
std.node(nodeVersion),
std.npm(),
std.prettier(),
std.typescript('node', 'package'),
std.vscode({showFilesInEditor: false}),
];
module.exports = plugins;
- Run:
onecmd setup
- Run:
onecmd compile && onecmd format --check && onecmd lint && onecmd test
function babel(): Plugin;
- setup
new
file.babelrc.json
with content of typeobject
function editorconfig(): Plugin;
- setup
new
file.editorconfig
with content of typestring[]
mod
file.vscode/extensions.json
with content of typeobject
mod
file.vscode/settings.json
with content of typeobject
function eslint(): Plugin;
- lint
- setup
new
file.eslintignore
with content of typestring[]
new
file.eslintrc.json
with content of typeobject
mod
file.vscode/extensions.json
with content of typeobject
function git(): Plugin;
- setup
new
file.gitignore
with content of typestring[]
function github({
branches = ['main'],
nodeVersion = undefined,
omitReleaseStep = false,
runner = 'ubuntu-latest',
}?: GithubPluginOptions): Plugin;
- setup
new
file.github/workflows/ci.yml
with content of typeobject
function jest({coverage = false}?: JestPluginOptions): Plugin;
- test
- setup
new
filejest.config.json
with content of typeobject
ref
filecoverage
function node(version: string): Plugin;
- setup
new
file.node-version
with content of typestring
mod
file.babelrc.json
with content of typeobject
function npm(): Plugin;
- setup
ref
filenode_modules
ref
filepackage-lock.json
ref
filepackage.json
function preact(): Plugin;
- setup
mod
filetsconfig.json
with content of typeobject
function prettier(): Plugin;
- format
- setup
new
file.prettierignore
with content of typestring[]
new
file.prettierrc.json
with content of typeobject
mod
file.editorconfig
with content of typestring[]
mod
file.eslintrc.json
with content of typeobject
mod
file.vscode/extensions.json
with content of typeobject
mod
file.vscode/settings.json
with content of typeobject
function react(): Plugin;
- setup
mod
file.babelrc.json
with content of typeobject
mod
filetsconfig.json
with content of typeobject
function typescript(arch: 'node' | 'web', dist: 'bundle' | 'package'): Plugin;
- compile
- setup
new
filetsconfig.json
with content of typeobject
new
filetsconfig.cjs.json
with content of typeobject
(dist='package'
)new
filetsconfig.esm.json
with content of typeobject
(dist='package'
)mod
file.babelrc.json
with content of typeobject
mod
file.eslintrc.json
with content of typeobject
mod
file.vscode/settings.json
with content of typeobject
ref
filelib
(dist='package'
)
function vscode({showFilesInEditor = false}?: VscodePluginOptions): Plugin;
- setup
new
file.vscode/extensions.json
with content of typeobject
new
file.vscode/settings.json
with content of typeobject
ref
file.vscode
Copyright 2021 Clemens Akens. All rights reserved. MIT license.