0.4.0 • Published 4 years ago

chorus-components v0.4.0

Weekly downloads
-
License
-
Repository
-
Last release
4 years ago

Chorus Component Library

This project exposes a collection of components for use in the planning of LNG bunker vessels. The project consists of the main library located in the /src directory. It also houses a create-react-app example application to develop the library with in the /example directory.

Components

propertydescription
nominationIdThe _id of the nomination
sandboxIdboolean
companies
bunkerShips:
locations
userCompanyFleet:
year
month
user
authToken

Development

The project consists of a number of important parts.

To start developing: 1. Clone de repo 2. npm install on the root map. This installs all the dependancies including the dependancies in the /example app directory. 3. npm run dev this runs the build function of rollup to build the library and then issues the watch command to watch for any changes. Also starts up the example react-application. This way changes in both the example app and the library are automatically hot reloaded. Changes in the library cause rollup to build the entire library again into the esm and cjs files.

Project Structure

Project Root/
│
├── dist/  // Used for the library to expose. Consits of a CommonJS ( CSJ ) build and a ES Module ( ESM ) build.
│
├── src/ // Houses all the source code for the library including all the components and utility files.
│   └── components 
│   └── constants  
│   └── apiLayer   
│   └── context    
│   └── utilities  
│   └── styles     
├── example/ // A create-react-app which gets a version of the library build into it after building.
-------
├── rollup.config.js
├── tsconfig.json
└── README.md

Scripts

npm run build

Triggers the rollup build command. Builds the /src/ folder into /dist/ and a copy of the library to /example with the name chorus-component-library.

npm run build-watch

Builds the project using rollup and then run the rollup watch command to see if anything changes.

npm run postinstall

Runs after running npm install which installs peerDependancies and cd's into the example map to install required packages.

npm run start-example

Runs the npm start command in the example folder. This starts the create-react-application on a local server at port 3000

npm run deploy-example

Runs the react deploy script in the example map. Probably not required for now.

npm run test

Runs all the test files present in the project.

npm run pretest

Runs before the npm run test, makes sure the project is build using the npm run build command.

Publishing

INSERT INSTRUCTIONS ON NPM DEPLOYMENT