@gigster/module-react-base

Role | Name | Email | Slack ---- | ---- | ----- | ----- *Product Owner* | Frances Haugen | [frances@gigster.com](mailto:frances@gigster.com) | [@frances] *Maintainer* | Geoff Kinder | [geoff.kinder@gigster.com](mailto:geoff.kinder@gigster.com) | [@geoff]

Usage no npm install needed!

<script type="module">
  import gigsterModuleReactBase from 'https://cdn.skypack.dev/@gigster/module-react-base';
</script>

README

react-base

Role Name Email Slack
Product Owner Frances Haugen frances@gigster.com [@frances]
Maintainer Geoff Kinder geoff.kinder@gigster.com [@geoff]
Developer Mark Miyashita mark.miyashita@gigster.com [@mark]

Overview

Adds several features on top of the base create-react-app block, namely:

  • Proxy for browser requests to go through the node server.
  • .env support
  • Base .css styling
  • [Optional] Basic tests to make sure the app is functional

Usage

Specification

Name Status Description
generateTests true/false Set to true if you would like generated tests to be created for you for the app.

Dependencies

This module works with the create-react-app block located here.

Examples

There are two examples for this package:

  1. with-tests - This example is generated with generateTests: true so it has the infrastructure as well as generated tests.
  2. without-tests - This example is generated with generateTests: false so it only has the base infrastructure and does not contain tests.

Troubleshooting

Testing

Module tests are defined using a test/scenarios.yaml file. This file defines the set of example gigs that we generate as part of integration testing. To run all tests, run yarn test at the root of this module.

Each scenario is generated in test/scenario/<name> which you can then cd into and run the actual app. For a scenario called default, this is done via:

cd test/scenario/default
yarn install

# Run tests.
yarn test

# Start the app.
yarn start