Default preset for Boards CLI.
Note: Don't install this project directly. Instead, install the Boards CLI.
These presets get installed by default when installing Boards CLI.
Following are the tasks bundled with this preset. You can list them in your console by running:
boards default:tasks
boards default:tasks
Outputs the tasks for this preset.
boards default:preset <name>
Create a new preset template to simplify creating your own preset.
boards default:init [src]
Create a boards.js
file in your current directory. Provsided src
is used to set the path to your project's source code.
boards default:ensureNew
Utility task to use in your own tasks / preset tasks. Throws an error if there's a boards.js
file in the current directory.
{definedTask: 'default:ensureNew'}
boards default:ensureNotNew
Utility task to use in your own tasks / preset tasks. Throws an error if there's no boards.js
file in the current directory.
{definedTask: 'default:ensureNotNew'}
boards default:ensureExists
Utility task to use in your own tasks / preset tasks. Throws an error if provided file doesn't exist.
{
definedTask: 'default:ensureExists',
prepare: p => p.ensureExists = 'path to check (can be relative to cwd)'
}
boards default:ensureNotExists
Utility task to use in your own tasks / preset tasks. Throws an error if provided file exists.
{
definedTask: 'default:ensureNotExists',
prepare: p => p.ensureNotExists = 'path to check (can be relative to cwd)'
}
boards default:addDep
Utility task to use in your own tasks / preset tasks. Adds a dependency to an existing project.
This task detects which package manager is being used in the project (yarn or npm).
{
definedTask: 'default:addDep',
prepare: {
addDep: {
dev: true,
dependency: 'boards-preset-aor'
}
}
}
If you simply want to add a dependency (non-dev) you can also use a string:
{
definedTask: 'default:addDep',
prepare: 'boards-preset-aor'
}
boards default:cd
Utility task to use in your own tasks / preset tasks. Navigates to a new directory. Useful for example after creating a new directory (by using create-react-app for example).
{ definedTask: 'default:cd', prepare: p => p.cd = p.name }
Note: You might want to call default:prepare
after this, to reinitialize the package manager used in the new directory.
boards default:checkBinary
Utility task to use in your own tasks / preset tasks. Verifies a global binary exists on the system. Throws an error when the binary wasn't found.
{ definedTask: 'default:checkBinary', prepare: { checkBinary: 'create-react-app' } }
boards default:exec
Utility task to use in your own tasks / preset tasks. Executes a command on the cli.
{ definedTask: 'default:exec', prepare: p => { p.exec = `create-react-app ${p.name}`} }
boards default:prepare
Internal command, automatically called before the main task. This task sets default parameters holding information needed for boards to function.
Warning: Only call this method when needed (for example after default:cd
)
MIT