@tffg/emn-lib-components v2.1.0
equipMe now React Component Library
A React component library for the equipMe now client applications built using NWB. Before getting started read here about Developing React Components and Libraries with nwb.
This project can be published to the TFFG NPM account, allowing components to easily be added to other projects.
Getting Started
You'll need nodejs and yarn installed.
Clone repo:
git clone git@github.com:tffg/emn-lib-components.gitInstall dependencies:
yarn installScripts
package.json is configured with "scripts" we can use with yarn run while developing the project.
| Command | Description |
|---|---|
yarn start | start a development server for the demo app |
yarn test | run tests |
yarn test:coverage | run tests and produce a code coverage report in coverage/ |
yarn test:watch | start a test server and re-run tests on every change |
yarn build | prepare for publishing to npm |
yarn clean | delete built resources |
Running the Demo App
The project includes a demo app in demo/src/index.js. When new components are created, they can be added to this demo app to preview how component will look and behave.
Running yarn start will start a development server for the demo app. Every time you make a change to the demo app or any component, it will refresh the current compilation status. Running yarn build will also buid a production version of the demo app which could deployed if desired.
Publishing to npm
Once you've built your project, it's ready for publishing to npm:
yarn publishYou must first be logged into the TFFG NPM account by running yarn login.
Local Testing
Ideally there would be tests written for each component, however since this may not always happen as it should it is also possible to do integration testing with the consuming application by creating a local symlink on your machine.
Within the emn-lib-components directory run:
yarn linkThen within the consuming application run:
yarn link "@tffg/emn-lib-components"Now you whenever you run yarn build on emn-lib-components the consuming application will update with the latest changes.
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago