@rmtc/plugin-npm-scripts
v1.0.0
Published
The toolchain npm scripts plugin
Downloads
8
Readme
@rmtc/plugin-npm-scripts
A plugin for @rmtc/toolchain that creates package.json
scripts for all defined workflows.
[!WARNING] This project is intended for use in @rowanmanning's projects. It's free to use but I don't offer support for use-cases outside of what I need.
Table of Contents
Requirements
This library requires the following to run:
Usage
Install the module with npm:
npm install --save-dev @rmtc/plugin-npm-scripts
Include it in your .rmtc.json
file:
{
plugins: [
// ...
'@rmtc/plugin-npm-scripts'
]
// ...
}
Workflows
This plugin defines the following workflows:
postinstall
: a general workflow used to indicate steps that should be run after dependencies have been installed.
Steps
This plugin defines the following steps that can be added to any workflow:
npm-scripts:install
: override thescripts
in the project'spackage.json
file, ensuring that there's a script matching each defined workflow. This is a destructive action and will make changes to your files, but it makes running scripts more convenient. E.g.If you have a
test
workflow defined by one of your plugins, then this script will add ascripts.test
property topackage.json
that runsnpx @rmtc/toolchain test
. You can now run tests with a regularnpm test
.When running this workflow for the first time it will output the original values of these scripts in case something was broken.
Configuration
This plugin provides no additional configuration.
Contributing
See the central README for a contribution guide and code of conduct.
License
Licensed under the MIT license. Copyright © 2023, Rowan Manning