@nestagencyuk/typescript_lib-frontend v1.0.9
TypeScript Frontend Library
This repository contains Nest's frontend TypeScript library. This will hold any useful code snippets for re-use across all internal projects.
Contributing
If you wish to contribute to this repo directly, then continue reading the contribution instructions below.
Setup
Install all dependencies.
$ npm install
Develop
Bundles everything using webpack, starts the dev server and watches for changes.
$ npm run dev
Scaffold
You can quickly scaffold a new function by running:
$ NAME=MyNewFunction npm run scaffold
This will create a new function folder with all the required files and some example variants. This is the best way of ensuring a new function complies with our coding standards and naming conventions.
Build
Bundles everything using webpack.
$ npm run build
Testing
Run all tests:
$ npm run test
Run individual tests:
Command | Description |
---|---|
$ npm run test:unit | Run component unit tests |
$ npm run test:coverage | Run coverage tests and send coverage report |
Release
To create a new release:
- First ensure that you're on the
develop
branch and all pull requests and branches have been pulled and merged in (incl. master as the version may have been bumped). - Using Git Flow*, run
git flow release start vX.X.X
, replacing theX.X.X
with the appropriate new version number, incremented by one. Follow semvar practices, e.g vX.0.0 denotes a major version, v0.X.0 is a minor version and v0.0.X is a patch. See the package.json for the most recent version number. - Carry out any last minute work on the release branch and commit as normal.
- When finished, run
git flow release finish vX.X.X
and add any relevant commit messages. You must add a tag message otherwise the release will fail. - The release branch should now be merged into both
develop
andmaster
. Now you just need to runnpm run deploy
and you're done! The CI pipeline will handle the rest.
NOTE: Using Git Flow ensures the tagging is handled correctly. Creating a release branch manually won't work.