Skip to content

Commit cfb18f6

Browse files
author
bcoe
committed
feat: initial commit
0 parents  commit cfb18f6

2 files changed

Lines changed: 69 additions & 0 deletions

File tree

README.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
## Conventional Commits Parser
2+
3+
Reference implementation of Conventional Commits specification.
4+
5+
## The Grammar
6+
7+
```bnf
8+
# See: https://tools.ietf.org/html/rfc3629#section-4
9+
<UTF8-octets> ::= 1*<UTF8-char>
10+
<CR> ::= "0x000D"
11+
<LF> ::= "0x000A"
12+
<newline> ::= <CR>? <LF>
13+
<parens> ::= "(" | ")"
14+
<ZWNBSP> ::= "U+FEFF"
15+
<TAB> ::= "U+0009"
16+
<VT> ::= "U+000B"
17+
<FF> ::= "U+000C"
18+
<SP> ::= "U+000C"
19+
<NBSP> ::= "U+00A0"
20+
# See: https://www.ecma-international.org/ecma-262/11.0/index.html#sec-white-space
21+
<USP> ::= "Any other Unicode “Space_Separator” code point"
22+
<whitespace> ::= <ZWNBSP> | <TAB> | <VT> | <FF> | <SP> | <NBSP> | <USP>
23+
24+
<message> ::= <summary> <newline> <newline> 1*<footer>
25+
| <summary> <newline> <newline> <body> <newline> <newline> 1*<footer>
26+
| <summary> <newline> <newline> <body>
27+
| <summary>
28+
29+
<summary> ::= <type> "(" <scope> ")" ":" <summary-text>
30+
| <type> ":" <summary-text>
31+
<type> ::= 1*<any UTF8-octets except newline or parens or ":" or whitespace>
32+
<scope> ::= 1*<any UTF8-octets except newline or parens>
33+
<summary-text> ::= 1*<any UTF8-octets except newline>
34+
35+
<footer> ::= <token> ":" <value>
36+
<token> ::= <type> "(" <scope> ")"
37+
| <type>
38+
| "BREAKING CHANGE"
39+
<value> ::= <summary-text> 1*<continuation>
40+
| <summary-text>
41+
<continuation> ::= <newline> <whitespace> <summary-text>
42+
43+
<body> ::= 1*<body-text>
44+
<body-text> ::= <newline>? <summary-text>
45+
```

package.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"name": "@conventional-commits/parser",
3+
"version": "1.0.0",
4+
"description": "reference implementation of conventionalcommits.org spec",
5+
"main": "index.js",
6+
"scripts": {
7+
"test": "c8 mocha test.js"
8+
},
9+
"repository": {
10+
"type": "git",
11+
"url": "git+ssh://git@github.com/conventional-commits/parser.git"
12+
},
13+
"keywords": [
14+
"parser",
15+
"conventional",
16+
"commits"
17+
],
18+
"author": "Ben Coe <bencoe@gmail.com>",
19+
"license": "ISC",
20+
"bugs": {
21+
"url": "https://github.com/conventional-commits/parser/issues"
22+
},
23+
"homepage": "https://github.com/conventional-commits/parser#readme"
24+
}

0 commit comments

Comments
 (0)