all3dp / direct-sales-widget

Apache License 2.0
1 stars 0 forks source link

Direct Sales Widget

Direct sales widget intended for embedding via oEmbed.

Requirements

To build and run the source code you need to install a recent version of Node.js, NPM and Yarn.

Project setup

Run the command npm install in the root of the project folder to install all required dependencies.

NPM commands

There are various commands available via NPM for use during development and to create a production build of the source code.

Start Dist Build

To start the application from the /dist folder do the following:

$ npm install
$ npm run build
$ npm run start

Terminology

Dependency Injection

We don't use a explicit dependency injection model. We use ES6-Module export and sinon.stub() for testing instead. Be aware that sinon.stub() only stubs methods not other object properties. If you want to stub all object properties you have to use sinon.sandbox.create().

CSS

SASS is our CSS preprocessor of choice. Use BEM to structure your CSS. Deep nesting should be prevented. Colors should be semantic. Therefore, use Sass variables for design-specific colors. Use variables and comments to explain 'magic numbers'.

Tests

Linter and tests are executed with npm run test. Use npm test:coverage for checking the test coverage via istanbul.

The following folders are unit tested and should have 100% test coverage: