@rmtc/plugin-npm-scripts
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

@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 the scripts in the project's package.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 a scripts.test property to package.json that runs npx @rmtc/toolchain test. You can now run tests with a regular npm 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

Readme

Keywords

none

Package Sidebar

Install

npm i @rmtc/plugin-npm-scripts

Weekly Downloads

1

Version

1.0.0

License

MIT

Unpacked Size

5.38 kB

Total Files

5

Last publish

Collaborators

  • rowanmanning