hooks-demo

hooks-demo is a Cortex plugin. To see how to run the plugin inside of Cortex, see our docs.

Prerequisites

Developing and building this plugin requires either yarn or npm.

Getting started

  1. Run yarn or npm install to download all dependencies
  2. Run yarn build or npm run build to compile the plugin code into ./dist/ui.html
  3. Upload ui.html into Cortex on a create or edit plugin page
  4. Add or update the code and repeat steps 2-3 as necessary

Notable scripts

The following commands come pre-configured in this repository. You can see all available commands in the scripts section of package.json. They can be run with npm via npm run {script_name} or with yarn via yarn {script_name}, depending on your package manager preference. For instance, the build command can be run with npm run build or yarn build.

  • build - compiles the plugin. The compiled code root is ./src/index.tsx (or as defined by webpack.config.js) and the output is generated into dist/ui.html.
  • test - runs all tests defined in the repository using jest
  • lint - runs lint and format checking on the repository using prettier and eslint
  • lintfix - runs eslint in fix mode to fix any linting errors that can be fixed automatically
  • formatfix - runs Prettier in fix mode to fix any formatting errors that can be fixed automatically

Available React components

See available UI components via our Storybook.