[go: up one dir, main page]

Skip to content

Latest commit

 

History

History
124 lines (87 loc) · 4.31 KB

DEVELOPING.md

File metadata and controls

124 lines (87 loc) · 4.31 KB

Developer's Guide

We use Visual Studio Code for developing LoopBack and recommend the same to our users.

VSCode setup

Install the following extensions:

Development workflow

Visual Studio Code

  1. Start the build task (Cmd+Shift+B) to run TypeScript compiler in the background, watching and recompiling files as you change them. Compilation errors will be shown in the VSCode's "PROBLEMS" window.

  2. Execute "Run Rest Task" from the Command Palette (Cmd+Shift+P) to re-run the test suite and lint the code for both programming and style errors. Linting errors will be shown in VSCode's "PROBLEMS" window. Failed tests are printed to terminal output only.

Other editors/IDEs

  1. Open a new terminal window/tab and start the continous build process via npm run build:watch. It will run TypeScript compiler in watch mode, recompiling files as you change them. Any compilation errors will be printed to the terminal.

  2. In your main terminal window/tab, run npm run test:dev to re-run the test suite and lint the code for both programming and style errors. You should run this command manually whenever you have new changes to test. Test failures and linter errors will be printed to the terminal.

Commit message guidelines

A good commit message should describe what changed and why.

Our commit messages are formatted according to Conventional Commits, we use commitlint to verify and enforce this convention. These rules lead to more readable messages that are easy to follow when looking through the project history. But also, we use the git commit messages to generate change logs when publishing new versions.

Commit Message Format

Each commit message consists of a header, a body and a footer. The header has a special format that includes a type, an optional scope and a subject:

<type>(<scope>): <subject>
<BLANK LINE>
<body>
<BLANK LINE>
<footer>

type

The type must be one of the following:

  • feat: A new feature
  • fix: A bug fix
  • docs: Documentation only changes
  • style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
  • refactor: A code change that neither fixes a bug nor adds a feature
  • perf: A code change that improves performance
  • test: Adding missing or correcting existing tests
  • build: Changes that affect the build system or external dependencies
  • ci: Changes to our CI configuration files and scripts
  • chore: Changes to the auxiliary tools and libraries such as documentation generation
  • revert: Reverts a previous commit

scope

The scope must be a list of one or more modules contained in this repo.

subject

The subject contains succinct description of the change:

  • use the imperative, present tense: "change" not "changed" nor "changes"
  • don't capitalize first letter
  • no dot (.) at the end

body

The body provides more details, it should include the motivation for the change and contrast this with previous behavior.

Just as in the subject, use the imperative, present tense: "change" not "changed" nor "changes"a

Paragraphs or bullet points are ok (must not exceed 100 characters per line). Typically a hyphen or asterisk is used for the bullet, followed by a single space, with blank lines in between.

references

Its mandatory to add references to JIRA ticket you are resolving as part of the commit.

footer (optional)

The footer should contain any information about Breaking Changes introduced by this commit.

This section must start with the upper case text BREAKING CHANGE followed by a colon (:) and a space (``). A description must be provided, describing what has changed and how to migrate from older versions.

Tools to help generate a commit message

This repository has commitizen support enabled. Commitizen can help you generate your commit messages automatically.

And to use it, simply call git commit. The tool will help you generate a commit message that follows the above guidelines.