Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
84 lines (61 sloc) 5.31 KB

๐Ÿ“Œ index / ๐Ÿ’ป developers guidelines

๐Ÿ‘จโ€๐Ÿ’ป Developers Guidelines

This document provides specifications on how-to contribute to the project.

๐Ÿ—ƒ Branch's

Name Type Checkout Description
nightly alpha git checkout nightly All pull request here, draft code and tests
beta beta git checkout beta If nightly correctly works, merge in beta
master stable git checkout master If beta correctly works, merge in master

All developers will work in nightly or in sub-branch of nightly. Git flow is recommended. Only owner (example: @ptkdev) merges in beta and merges in master if code works correctly after tests.

๐Ÿ—„ Update your fork (sync your code of branch)

If you fork the repo for contributions before send pull request you need align your source code to latest version. This is a simple task, run:

  1. npm run git-set-upstream (only once)
  2. npm run git-pull-upstream (sync your code before sending pull request)

๐Ÿšฉ Commit message

It's recommended, for consistency, to use similar commit message. I love [Tag] Message syntax. Example:

Message Status Description
[Feature] Available likemode_name Good Tag Feature is ok
[Fix] Bad selector likemode_name Good Tag Fix is ok
[Test] New test for likemode_name Good Tag Test is ok
[Update/Test] Test likemode_name Good Multiple tags is ok
[Refactor] Utils constructor Good Tag Refactor is ok
[Update] package.js Good Tag Update is ok
Update AUTHORS.md Bad Missing [ ]
Fix Bad Useless comment, missing [ ]
[Fix]text text text Bad Need space after ]
[Fixs] Bad selector likemode_name Bad Don't use plural tag name

๐Ÿ Linter and snake_case

Important: Is recommended to use eslint globally (npm install eslint -g) and use vs-code or sublime-text with eslint plugin.

npm run lint provides show syntax errors (eslint plugin in ide/editor will show it automatically). After git commit the eslint, run --fix command and it'll fix automatically 90% of syntax errors.

Other eslint rules are marked in eslintrc.json file, check it.

๐Ÿ Syntax

Type Syntax Note
class Snake_case First letter uppercase (capital letter)
method snake_case Lower case
function snake_case Lower case
var name snake_case Lower case
let name snake_case Lower case
const name snake_case Lower case
enum / struct SNAKE_CASE All letters uppercase (all capital letters)

It happens that another library use camelCase method and eslint --fix convert camelCase method in snake_case. A solution for this problem is to add method or variable names in eslintrc.json whitelist.

Example: "snakecasejs/whitelist": ["defaultViewport","executablePath"] that ignores executablePath and defaultViewport camelCase name. See snakecasejs.

๐Ÿ„ NPM Version and package.json

Name Branch Description
1.0-nightly.20180101 nightly Version-BranchName-YearMonthDay
1.0-beta.1 beta Version-BranchName-NumberOfBeta
1.0 master Version

Update the suffix value (in nightly branch) to current date. See semver.

Dependences are all set on @latest, IMHO is good, supports latest version of libraries (why? in primis: security!)

๐ŸŽ Support: Donate

๐Ÿ’ซ License

  • Documentation and Contributions have CC BY 4.0 License
  • Images and Logos have CC BY-NC 4.0 License
  • Code Snippets/Examples have MIT License
Copyleft (c) 2018-2019 Patryk Rzucidล‚o (@PTKDev) <support@ptkdev.io>
You canโ€™t perform that action at this time.