Skip to content

Latest commit

 

History

History
111 lines (76 loc) · 3.66 KB

DEVELOPERS.md

File metadata and controls

111 lines (76 loc) · 3.66 KB

Building and Testing this project

This document describes how to set up your development environment to build and test this project. It also explains the basic mechanics of using git and node

See the contribution guidelines if you'd like to contribute to this project.

Prerequisite Software

Before you can build and test this project, you must install and configure the following products on your development machine:

Project organisation

The project is organised into the following folder structure:

  • / - Project-level configuration (linting rules, CI, docs, license)
  • bin/ - Path to "binary" file, used as the entry point to the command (e.g. awl -> bin/index.js)
  • fixtures/ - Files used during tests to simulate running the plugin inside Serverless Framework
  • src/ - The source code and test specifications

Installing

# Install the dependencies & devDependencies
npm install

Running Tests

# Run unit tests
npm test

# Run unit tests in watch mode
npm run test:watch

# Run tests and see the coverage report
npm run test:resport

Formatting your source code

This project uses eslint and prettier to format the source code. If the source code is not properly formatted, the CI will fail and the PR cannot be merged.

You can automatically format your code by running:

  • npm run lint: format all source code

A better way is to set up your IDE to format the changed file on each file save.

WebStorm / IntelliJ

  1. Open Preferences > Languages & Frameworks > JavaScript > Prettier
  2. Find the field named "Prettier Package"
  3. Add <PATH_TO_YOUR_WORKSPACE>/<project-root>/packages/web-app/node_modules/prettier

Linting/Verifying the Source Code

You can check that your code is properly formatted and adheres to coding style:

# Check that the code is formatted and following the coding style:
npm run verify

# Fix any auto-fixable errors
npm run lint

Semantic Release Setup

This section is include for informational purposes only.

This repo uses semantic-release to manage software versions and packaging. There is a one-time setup-step required - WHICH HAS ALREADY BEEN DONE, which creates a GitHub personal access token, an NPM token, and connects them to Travis CI.

One time setup:

cd <path-to-repo>
npx semantic-release-cli setup

? What is your npm registry? https://registry.npmjs.org/
? What is your npm username? u_glow
? What is your npm password? [hidden]
? Provide a GitHub Personal Access Token (create a token at https://github.com/settings/tokens/new?scopes=repo)  
? What CI are you using? Other (choose "Other" and the tokens are displayed for you manually add to your CI)