0.0.2 • Published 4 years ago

sdk-test-harness-int v0.0.2

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

GBG Web SDK - Test Harness

Technologies

The following is a list of the technologies in use in this project. Versions are subject to change and are as such not listed. Check the packages.json for versions which should be fixed with the package-lock.json file.

Prerequisites

This project was designed to be built using Node v10.15.2. It is suggested you use NVM (Windows, Unix) to install this version of node as it means you can have multiple versions installed at the same time and select which to use.

Contributing

Please ensure all of the following rules are complied with before committing anything to the codebase:

  • All line endings should be set to LF (Line-Feed, UNIX Style)
  • Only tabs should be used for indentation
  • Only use single quotes for string literals
  • Save files using UTF-8 where possible
  • Use K&R style braces

An EditorConfig file is included to assist with the above rules, plugins are available for most popular editors.

If contributing using Visual Studio Code, there are pre-defined settings which will assist you with editing and help keep things clean and tidy as well as suggesting useful plugins. Whilst it is not compulsory to use this as your editor, it is recommended.

This project uses TSLint for code consistency. Ensure you have a plugin for your editor to make sure your code is checked against the project's rules. Avoid disabling lines/rules where possible.

Redux Guidelines

Always remember to return new objects in your reducers and NEVER modify the state object which is passed into the reducer as this WILL cause unwanted side effects in your components.

Helper Functions

When you need to do any form of array or object processing, be sure to check the ./src/helpers/ directory for existing functions you could use before writing any additional ones. Avoid having complex/repeated functions in views, reducers and actions where possible.

Building

First of all, ensure you have installed the listed above, then run npm install in the root of the project directory to install all of the node modules required for building and running the solution.

There are two build types/modes in use in this project.

Build

The build mode creates a one off build of the solution in production mode and outputs the artefacts to the dist folder in such a way you can just drop it on a web server and it works™. It will output a web.config file with the appropriate settings for hosting on an IIS based web server.

You can produce a build in this mode with the npm run build command from the root of the solution.

This is the mode which will be run by TeamCity for automated deployment.

Watch

The watch mode will initially build a version of the solution in development mode with sourcemaps and handlers for react and redux development tools.

It uses the hot module reloader plugin which should auto-reload the page when anything has changed after a build. It reloads the whole page rather than individual modules for a clean start.

The development build of the web application will be self hosted using the webpack dev server which can be accessed at localhost:8080 which will be automatically opened in your default browser at build time.

You can produce a build in this mode with the npm run start command.