Skip to content

Latest commit

History

History
136 lines (95 loc) 路 6.17 KB

CONTRIBUTING.md

File metadata and controls

136 lines (95 loc) 路 6.17 KB

Contributing to Smart Gate

馃毄 Table of Contents

About

馃憤馃帀 First off, thanks for taking the time to contribute! 馃帀馃憤

The following is a set of guidelines for contributing to Smart Gate and its packages. Use your best judgment, and feel free to propose changes to this document in a pull request.

Want to Help?

Want to file a bug, contribute some code, or improve documentation? Excellent!

Read up on our guidelines for contributing and then check out one of our issues labeled as Help Wanted or Good First Issue.

馃帗 Getting started

Prerequisites

General project dependencies installation

yarn

馃摝 Packages Docs

Each package have their own documentation in a README file with set of guidelines.

Check below list of packages for details:

馃搹 Conventional Commits

Commitlint checks if your commit messages meet the conventional commit format. Also it requires package scope.

Structure:

type(package-name): general info

Structure with more inforamtion:

type(package-name): general info

- add login panel
- add avatar

Examples:

feat(api): add comment section
fix(client): flickering header

Common types according to commitlint-config-conventional (based on the Angular convention) can be: conventional-commit-types. Header (first line) must not be longer than 100 characters.

For just validating your commit message without commiting it use terminal:

echo 'foo: bar' | commitlint

馃 Hygen - Code generator

Hygen is the cli dev tool that provides the ability for generating scalable code. All code generation templates are defined in the __template directory. Remember to add created model to git files (typically those files are excluded from default).

It is completly optional but in long term it is very helpful.

For more details check Hygen docs.

Available generators:

Package Script Description
client hygen:element Creates new standardize React component, story and style file
client hygen:icon Creates new standardize Icon component and adds it to the main icon story
client hygen:util Creates new standardize helper function in util directory

馃摑 Available root scripts

Below you can find all scripts available in root package.json.

In general all packages have their own scripts, but here you can find all general propouse project scripts.

To run script, in terminal type yarn {script}.

Script Description Note
build Builds all packages
check Runs linter, prettier, tests and ts-check in all packages
heroku-postbuild It runs on heroku before api build
preinstall Checks is yarn was used package manager It runs automatically before every install
lint Checks linter rules
lint:fix Fix linter
prettier Checks prettier rules
prettier:fix Fix prettier
prepare Install husky It runs automatically after every install
removeNodeModules Remove all node_modules from project (all packages) Works only for linux systems
removeEslintCaches Remove all Eslint cache from project (all packages) Works only for linux systems
sortPackageJson Sort alphabetical all package.json in project
start Used to run api package on heroku
start:ci Start concurrently api and client in test mode
test Runs tests for all packages
type-check Checks TypeScript types for all packages