Skip to content

Contribution

Evgenii Koriakin edited this page Feb 23, 2020 · 20 revisions

Contribution

  1. To contribute just create a pull request and describe the changes.

Running locally

  1. Clone the repository and install the dependencies wiht npm install.
  2. Use ionic serve (v3) or ng serve (v4) to run the app that contains ionic-selectable module together with demos.

Prepare release

  1. Update the version in the package.json according to Semantic Versioning. For example, if the release contains breaking changes than major number should be bumped and others reset to 0 - from 4.1.6 to 5.0.0.
  2. Run gulp from the root folder to prepare an npm package that will be created in dist folder.
  3. Run npm publish dist to publish the package to npm.
  4. Create a GitHub tag and describe the changes following the pattern.

Conventions

Naming

  1. Boolean fields and variables should start with is, has, can, should, etc, for example isEnabled, hasConfirmButton, canSearch, shouldFocusSearchbar.
  2. Events should be named with a past participle, for example changed, selected, itemAdded.
  3. Prefer complete words over contractions, for example, element instead of el, event instead of ev, count instead of cnt, etc. Some commonly used contractions are allowed: id, min, max.
  4. Avoid general suffixes that don't add value to the meaning, such as Detail, Details, Data, etc. For example, prefer Item over ItemDetail.
  5. Add I prefix to interfaces. It might seem an obsolete Hungarian notation, but it allows to have nice short names for both class and its interface. For example, interface IEvent and class Event implements IEvent.

Formatting

  1. Use Prettier code formatter. Rules are set up in .prettierrc file.
  2. Install and use editorconfig extension for your IDE. Rules are set up in .editorconfig file.

Git

  1. A commit message should represent a complete sentence starting with a capital letter and ending with a dot, for example, Added isDisabled field.. A prefix can be added where applicable to label the commit. Some common prefixes:
  • Issue prefix, for example, #22: Added isDisabled field.
  • Refactor prefix, Refactor: Renamed isEnabled to isDisabled.
Clone this wiki locally