Skip to content

Commit 202117a

Browse files
committed
ci: add CONTRIBUTING as a template and various changes
Added types from the commit validation script to CONTRIBUTING. Added packages names from the package script to the scope section. Added examples of good commit messages. Also corrected some texts.
1 parent 5f8230c commit 202117a

File tree

7 files changed

+420
-84
lines changed

7 files changed

+420
-84
lines changed

CONTRIBUTING.md

+39-15
Original file line numberDiff line numberDiff line change
@@ -180,41 +180,65 @@ If the commit reverts a previous commit, it should begin with `revert: `, follow
180180
### Type
181181
Must be one of the following:
182182

183-
* **build**: Changes that affect the build system or external dependencies
184-
* **ci**: Changes to our CI configuration files and scripts
185-
* **docs**: Documentation only changes
186-
* **feat**: A new feature
187-
* **fix**: A bug fix
188-
* **perf**: A code change that improves performance
189-
* **refactor**: A code change that neither fixes a bug nor adds a feature
190-
* **style**: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
191-
* **test**: Adding missing tests or correcting existing tests
183+
* **build**: Changes that affect the build system or external dependencies. [2]
184+
* **ci**: Changes to our CI configuration files and scripts. [2]
185+
* **docs**: Documentation only changes.
186+
* **feat**: A new feature. [1]
187+
* **fix**: A bug fix. [1]
188+
* **refactor**: A code change that neither fixes a bug nor adds a feature
189+
* **release**: A release commit. Must only include version changes. [2]
190+
* **revert**: A git commit revert. The description must include the original commit message. [2]
191+
* **style**: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc).
192+
* **test**: Adding missing tests or correcting existing tests.
193+
194+
195+
<sup>[1] This type MUST have a scope. See the next section for more information.</sup><br/>
196+
<sup>[2] This type MUST NOT have a scope. It only applies to general scripts and tooling.</sup>
192197

193198
### Scope
194199
The scope should be the name of the npm package affected as perceived by the person reading changelog generated from the commit messages.
195200

196201
The following is the list of supported scopes:
197202

198-
* **@angular-devkit/core**
203+
* **@angular/cli**
204+
* **@angular/pwa**
205+
* **@angular-devkit/architect**
206+
* **@angular-devkit/architect-cli**
207+
* **@angular-devkit/build-angular**
208+
* **@angular-devkit/build-ng-packagr**
199209
* **@angular-devkit/build-optimizer**
210+
* **@angular-devkit/build-webpack**
211+
* **@angular-devkit/core**
200212
* **@angular-devkit/schematics**
201213
* **@angular-devkit/schematics-cli**
214+
* **@ngtools/webpack**
202215
* **@schematics/angular**
203216
* **@schematics/schematics**
217+
* **@schematics/update**
204218

205-
There are currently a few exceptions to the "use package name" rule:
206-
207-
* **packaging**: used for changes that change the npm package layout in all of our packages, e.g. public path changes, package.json changes done to all packages, d.ts file/format changes, changes to bundles, etc.
208-
* **changelog**: used for updating the release notes in CHANGELOG.md
209-
* none/empty string: useful for `style`, `test` and `refactor` changes that are done across all packages (e.g. `style: add missing semicolons`)
210219

211220
### Subject
212221
The subject contains succinct description of the change:
213222

214223
* use the imperative, present tense: "change" not "changed" nor "changes"
215224
* don't capitalize first letter
225+
* be concise and direct
216226
* no dot (.) at the end
217227
228+
### Examples
229+
Examples of valid commit messages:
230+
231+
* `fix(@angular/cli): prevent the flubber from grassing`
232+
* `refactor(@schematics/angular): move all JSON classes together`
233+
234+
Examples of invalid commit messages:
235+
* `fix(@angular/cli): add a new XYZ command`
236+
237+
This is a feature, not a fix.
238+
* `ci(@angular/cli): fix publishing workflow`
239+
240+
The `ci` type cannot have a scope.
241+
218242
### Body
219243
Just as in the **subject**, use the imperative, present tense: "change" not "changed" nor "changes".
220244
The body should include the motivation for the change and contrast this with previous behavior.

README.md

+9-12
Original file line numberDiff line numberDiff line change
@@ -25,28 +25,25 @@ This is the home of the DevKit and the Angular CLI code. You can find the Angula
2525

2626

2727

28-
----
29-
30-
This is the home for all the tools and libraries built to assist developers with their Angular applications.
31-
3228
### Quick Links
3329
[Gitter](https://gitter.im/angular/angular-cli) | [Contributing](https://github.com/angular/angular-cli/blob/master/CONTRIBUTING.md) | [Angular CLI](http://github.com/angular/angular-cli) |
3430
|---|---|---|
3531

32+
----
33+
34+
## The Goal of Angular CLI
35+
36+
The Angular CLI creates, manages, builds and test your Angular projects. It's built on top of the
37+
Angular DevKit.
3638

3739
## The Goal of DevKit
3840

39-
Our goal is to provide a large set of libraries that can be used to manage, develop, deploy and
41+
DevKit's goal is to provide a large set of libraries that can be used to manage, develop, deploy and
4042
analyze your code.
4143

42-
This is the extension of the Angular CLI Project. Once this set of tools is done, the Angular CLI
43-
as it is today will become one of many interfaces available to perform those tasks. Everything
44-
will also be available to third party tools and IDEs.
45-
46-
4744

4845

49-
## Tools
46+
# Tools
5047

5148
| Project | Package | Version | Links |
5249
|---|---|---|---|
@@ -55,7 +52,7 @@ will also be available to third party tools and IDEs.
5552

5653

5754

58-
## Packages
55+
# Packages
5956
This is a monorepo which contains many packages:
6057

6158

scripts/templates.ts

+19-9
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,27 @@
99
import { logging } from '@angular-devkit/core';
1010
import * as fs from 'fs';
1111
import * as path from 'path';
12-
import { packages } from '../lib/packages';
1312

14-
export default function(_options: {}, logger: logging.Logger) {
15-
const monorepo = require('../.monorepo.json');
1613

17-
logger.info('Building README...');
18-
const readme = require('./templates/readme').default;
19-
const content = readme({
20-
monorepo,
21-
packages,
14+
function _runTemplate(inputPath: string, outputPath: string, logger: logging.Logger) {
15+
inputPath = path.resolve(__dirname, inputPath);
16+
outputPath = path.resolve(__dirname, outputPath);
17+
18+
logger.info(`Building ${path.relative(path.dirname(__dirname), outputPath)}...`);
19+
20+
const template = require(inputPath).default;
21+
const content = template({
22+
monorepo: require('../.monorepo.json'),
23+
packages: require('../lib/packages').packages,
2224
encode: (x: string) => global.encodeURIComponent(x),
25+
require: (x: string) => require(path.resolve(path.dirname(inputPath), x)),
2326
});
24-
fs.writeFileSync(path.join(__dirname, '../README.md'), content, 'utf-8');
27+
fs.writeFileSync(outputPath, content, 'utf-8');
28+
}
29+
30+
export default async function(_options: {}, logger: logging.Logger): Promise<number> {
31+
_runTemplate('./templates/readme', '../README.md', logger);
32+
_runTemplate('./templates/contributing', '../CONTRIBUTING.md', logger);
33+
34+
return 1;
2535
}

0 commit comments

Comments
 (0)