gimbal-react

Create a React application to show the output from @modus/gimbal

Usage no npm install needed!

<script type="module">
  import gimbalReact from 'https://cdn.skypack.dev/gimbal-react';
</script>

README

Gimbal React Output Plugin

CircleCI PRs Welcome MIT Licensed

Installation | Contributing | Code of Conduct | Twitter

A plugin that creates a React app to consume Gimbal's report.

gimbal-react example output

Installation

npm install --save-dev gimbal-react

Usage

In your project's Gimbal configuration file, specify this plugin:

YAML

plugins:
  - gimbal-react

JSON

{
  "plugins": ["gimbal-react"]
}

JavaScript

module.exports = {
  plugins: ['gimbal-react'],
};

Configuration

This plugin has a few configs that you can modify:

  • build Defaults to true to build the generated React application. This will run npm run build, if you'd like to specify a different command, instead of true, pass a string of the command: yarn build.
  • clean Defaults to true, set to false if you do not want to remove the out directory prior to generating the React application.
  • install Defaults to true to install the node dependencies in the generated React application. This will run npm install, if you'd like to specify a different command, instead of true, pass a string of the command: yarn.
  • logError Default to false, set to true to show the error logs during commands like the build and install commands.
  • out Defaults to './artifacts/report' which is relative to where Gimbal is running (or told to run).

To specify a configuration, instead of the usage above, return an object:

YAML Configuration

plugins:
  - plugin: gimbal-react
    build: yarn build
    install: yarn

JSON Configuration

{
  "plugins": [
    {
      "plugin": "gimbal-react",
      "build": "yarn build",
      "install": "yarn"
    }
  ]
}

JavaScript Configuration

module.exports = {
  plugins: [
    {
      plugin: 'gimbal-react',
      build: 'yarn build',
      install: 'yarn',
    },
  ],
};

Notes

Due to how npm and yarn install node dependencies, if it detects a dependency being installed is available in a parent directory, it won't install in the generated React application directory. This means you may need to change the out to be somewhere that will install all the dependencies.

Licensing

This project is MIT licensed.