From 18d77ca7940757f3e1b79df318222e005131d89b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20Bajto=C5=A1?= Date: Thu, 8 Feb 2018 13:48:41 +0100 Subject: [PATCH] docs: add CONTRIBUTING, DEVELOPING and VSCODE Add a short CONTRIBUTING.md file serving as a collection of links pointing to other documentation. Start a guide for developers in DEVELOPING.md. Describe VS Code setup in VSCODE.md, document steps needed to verify integration with tsc and tslint. --- docs/CONTRIBUTING.md | 38 +++++++++ docs/DEVELOPING.md | 180 +++++++++++++++++++++++++++++++++++++++++++ docs/VSCODE.md | 93 ++++++++++++++++++++++ 3 files changed, 311 insertions(+) create mode 100644 docs/CONTRIBUTING.md create mode 100644 docs/DEVELOPING.md create mode 100644 docs/VSCODE.md diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md new file mode 100644 index 000000000000..50c10f2367a2 --- /dev/null +++ b/docs/CONTRIBUTING.md @@ -0,0 +1,38 @@ +# Contributing to LoopBack + +Contributions to Node.js include code, documentation, answering user questions, and advocating for all types of Node.js users. See our official documentation on loopback.io for more information common to all of our GitHub repositories: + + - http://loopback.io/doc/en/contrib/index.html + +## [Principles](http://loopback.io/doc/en/contrib/Governance.html#principles) + +LoopBack is an open, inclusive, and tolerant community of people working together to build a world-class Node framework and tools. We value diversity of individuals and opinions, and seek to operate on consensus whenever possible. We strive to maintain a welcoming, inclusive, and harassment-free environment, regardless of the form of communication. When consensus is not achievable, we defer to the owners of each individual module; the powers of the individual owner are kept in check by the ability of the community to fork and replace dependencies on the individual module and maintainer. + +## [Reporting issues](http://loopback.io/doc/en/contrib/Reporting-issues.html) + +Issues in [strongloop/loopback-next](https://github.com/strongloop/loopback-next/issues) are the primary means by which bug reports and general discussions are made. + + - [How to report an issue](http://loopback.io/doc/en/contrib/Reporting-issues.html#how-to-report-an-issue) + - [Disclosing security vulnerabilities](http://loopback.io/doc/en/contrib/Reporting-issues.html#security-issues) + +## [Contributing code](http://loopback.io/doc/en/contrib/code-contrib.html) + +Pull Requests are the way concrete changes are made to the code, documentation +and tools contained in LoopBack repositories. + + - [Setting up development environment](./DEVELOPING.md#setting-up-development-environment) + - [How to contribute the code](http://loopback.io/doc/en/contrib/code-contrib.html#how-to-contribute-to-the-code) + - [Coding style](http://loopback.io/doc/en/contrib/style-guide.html) + - [Git commit messages](./DEVELOPING.md#commit-message-guidelines) + - [Reviewing pull requests](http://loopback.io/doc/en/contrib/triaging-pull-requests.html) + - [Contributor License Agreement (CLA)](http://loopback.io/doc/en/contrib/code-contrib.html#agreeing-to-the-cla) + +## [Documentation](http://loopback.io/doc/en/contrib/doc-contrib.html) + +LoopBack documentation is sourced in the [strongloop/loopback.io](https://github.com/strongloop/loopback.io) GitHub repository. + + - [How LoopBack documentation works](http://loopback.io/doc/en/contrib/doc-contrib.html#how-loopback-documentation-works) + - [Using Jekyll](http://loopback.io/doc/en/contrib/jekyll_getting_started.html) + - [Authoring pages](http://loopback.io/doc/en/contrib/pages.html) + - [Translations](http://loopback.io/doc/en/contrib/translation.html) + diff --git a/docs/DEVELOPING.md b/docs/DEVELOPING.md new file mode 100644 index 000000000000..b8cdfbd2f1dc --- /dev/null +++ b/docs/DEVELOPING.md @@ -0,0 +1,180 @@ +# Developing LoopBack + +This document describes how to develop modules living in loopback-next monorepo. + + - [Setting up development environment](#setting-up-development-environment) + - [Building the project](#building-the-project) + - [Running tests](#running-tests) + - [Coding rules](#coding-rules) + - [API documentation](#api-documentation) + - [Commit message guidelines](#commit-message-guidelines) + - [How to test infrastructure changes](#how-to-test-infrastructure-changes) + +## Setting up development environment + +Before you can start developing LoopBack, you need to install and configure few +dependencies. + + - [git](https://git-scm.com/): Github's [Set Up Git](https://help.github.com/articles/set-up-git/) guide is a good source of information. + - [Node.js 8.x (LTS)](https://nodejs.org/en/download/) + +You may want to configure your IDE or editor to get better support for +TypeScript too. + + - [VisualStudio Code](./VSCODE.md) + - _Missing your favorite IDE/editor here? Pull requests are welcome!_ + +Before getting started, it is recommended to configure `git` so that it knows who you are: + +```sh +$ git config --global user.name "J. Random User" +$ git config --global user.email "j.random.user@example.com" +``` + +Please make sure this local email is also added to your [GitHub email list](https://github.com/settings/emails) so that your commits will be properly associated with your account and you will be promoted to Contributor once your first commit is landed. + +## Building the project + +Whenever you pull updates from GitHub or switch between feature branches, +we recommend to do a full reinstall of all npm dependencies: + +```sh +$ npm run clean:lerna && npm run bootstrap +``` + +The next step is to compile all packages from TypeScript to JavaScript: + +```sh +$ npm run build +``` + +Please note that we are automatically running the build from `pretest` +script, therefore you should not need to run this command as part of your +[red-green-refactor cycle](http://www.jamesshore.com/Blog/Red-Green-Refactor.html). + +## Running tests + +This is the only command you should need while developing LoopBack: + +```sh +$ npm test +``` + +It does all you need: + + - Compile TypeScript + - Run all tests + - Check code formatting using [Prettier](https://prettier.io/) + - Lint the code using [TSLint](https://palantir.github.io/tslint/) + +## Coding rules + +## API Documentation + +## Commit message guidelines + +A good commit message should describe what changed and why. + +Our commit messages are formatted according to [Conventional Commits](https://conventionalcommits.org/), we use [commitlint](https://github.com/marionebl/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**: + +``` +(): + + + +