Skip to content

Commit 91c125f

Browse files
pvdlggr2m
authored andcommitted
chore: rename plugin and move to semantic-release org
1 parent 39469d0 commit 91c125f

File tree

5 files changed

+20
-43
lines changed

5 files changed

+20
-43
lines changed

README.md

+8-27
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,28 @@
1-
# **sr-commit-analyzer**
1+
# **commit-analyzer**
22

33
Customizable commit-analyzer plugin for [semantic-release](https://github.com/semantic-release/semantic-release) based on [conventional-changelog](https://github.com/conventional-changelog/conventional-changelog)
44

5-
[![npm](https://img.shields.io/npm/v/sr-commit-analyzer.svg)](https://www.npmjs.com/package/sr-commit-analyzer)
6-
[![npm](https://img.shields.io/npm/dt/sr-commit-analyzer.svg)](https://www.npmjs.com/package/sr-commit-analyzer)
7-
[![Greenkeeper badge](https://badges.greenkeeper.io/vanduynslagerp/sr-commit-analyzer.svg)](https://greenkeeper.io/)
8-
[![license](https://img.shields.io/github/license/vanduynslagerp/sr-commit-analyzer.svg)](https://github.com/vanduynslagerp/sr-commit-analyzer/blob/master/LICENSE)
5+
[![npm](https://img.shields.io/npm/v/@semantic-release/commit-analyzer.svg)](https://www.npmjs.com/package/@semantic-release/commit-analyzer)
6+
[![npm](https://img.shields.io/npm/dt/@semantic-release/commit-analyzer.svg)](https://www.npmjs.com/package/@semantic-release/commit-analyzer)
7+
[![Greenkeeper badge](https://badges.greenkeeper.io/semantic-release/commit-analyzer.svg)](https://greenkeeper.io/)
8+
[![license](https://img.shields.io/github/license/semantic-release/commit-analyzer.svg)](https://github.com/semantic-release/commit-analyzer/blob/master/LICENSE)
99
[![styled with prettier](https://img.shields.io/badge/styled_with-prettier-ff69b4.svg)](https://github.com/prettier/prettier)
1010
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)
1111
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)
1212

13-
[![Travis](https://img.shields.io/travis/vanduynslagerp/sr-commit-analyzer.svg)](https://travis-ci.org/vanduynslagerp/sr-commit-analyzer)
14-
[![Codecov](https://img.shields.io/codecov/c/github/vanduynslagerp/sr-commit-analyzer.svg)](https://codecov.io/gh/vanduynslagerp/sr-commit-analyzer)
15-
16-
## Install
17-
```bash
18-
npm install --save-dev semantic-release sr-commit-analyzer
19-
```
20-
21-
Set the `analyzeCommits` plugin for `semantic-release` in `package.json`. See [semantic-release plugins](https://github.com/semantic-release/semantic-release#plugins).
22-
```json
23-
{
24-
"release": {
25-
"analyzeCommits": "sr-commit-analyzer"
26-
}
27-
}
28-
```
13+
[![Travis](https://img.shields.io/travis/semantic-release/commit-analyzer.svg)](https://travis-ci.org/semantic-release/commit-analyzer)
14+
[![Codecov](https://img.shields.io/codecov/c/github/semantic-release/commit-analyzer.svg)](https://codecov.io/gh/semantic-release/commit-analyzer)
2915

3016
## Options
3117

32-
By default `sr-commit-analyzer` uses the `angular` format described in [Angular convention](https://github.com/conventional-changelog/conventional-changelog/blob/master/packages/conventional-changelog-angular/convention.md).
18+
By default `commit-analyzer` uses the `angular` format described in [Angular convention](https://github.com/conventional-changelog/conventional-changelog/blob/master/packages/conventional-changelog-angular/convention.md).
3319

3420
Additionnal options can be set within the plugin definition in `package.json` to use a different commit format and to customize it:
3521

3622
```json
3723
{
3824
"release": {
3925
"analyzeCommits": {
40-
"path": "sr-commit-analyzer",
4126
"preset": "angular",
4227
"releaseRules": [
4328
{"type": "docs", "scope":"README", "release": "patch"},
@@ -69,7 +54,6 @@ This is an `Array` of rule objects. A rule object has a `release` property and 1
6954
{
7055
"release": {
7156
"analyzeCommits": {
72-
"path": "sr-commit-analyzer",
7357
"preset": "angular",
7458
"releaseRules": [
7559
{"type": "docs", "scope": "README", "release": "patch"},
@@ -129,7 +113,6 @@ For example with `eslint` preset:
129113
{
130114
"release": {
131115
"analyzeCommits": {
132-
"path": "sr-commit-analyzer",
133116
"preset": "eslint",
134117
"releaseRules": [
135118
{"tag": "Docs", "message":"/README/", "release": "patch"},
@@ -155,7 +138,6 @@ With this configuration:
155138
{
156139
"release": {
157140
"analyzeCommits": {
158-
"path": "sr-commit-analyzer",
159141
"preset": "angular",
160142
"releaseRules": "./config/release-rules.js"
161143
}
@@ -180,7 +162,6 @@ The following example uses [Angular convention](https://github.com/conventional-
180162
{
181163
"release": {
182164
"analyzeCommits": {
183-
"path": "sr-commit-analyzer",
184165
"preset": "angular",
185166
"parserOpts": {
186167
"noteKeywords": ["BREAKING CHANGE", "BREAKING CHANGES", "BREAKING"],

lib/load/release-rules.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@ module.exports = ({releaseRules}) => {
1919

2020
if (!Array.isArray(loadedReleaseRules)) {
2121
throw new SemanticReleaseError(
22-
'Error in sr-commit-analyzer configuration: "releaseRules" must be an array of rules',
22+
'Error in commit-analyzer configuration: "releaseRules" must be an array of rules',
2323
'EINVALIDCONFIG'
2424
);
2525
}
2626

2727
loadedReleaseRules.forEach(rule => {
2828
if (RELEASE_TYPES.indexOf(rule.release) === -1) {
2929
throw new SemanticReleaseError(
30-
`Error in sr-commit-analyzer configuration: "${rule.release}" is not a valid release type. Valid values are: ${JSON.stringify(
30+
`Error in commit-analyzer configuration: "${rule.release}" is not a valid release type. Valid values are: ${JSON.stringify(
3131
RELEASE_TYPES
3232
)}`,
3333
'EINVALIDRELEASE'

package.json

+4-8
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
2-
"name": "sr-commit-analyzer",
2+
"name": "@semantic-release/commit-analyzer",
33
"description": "Customizable commit-analyzer plugin for semantic-release",
44
"version": "0.0.0-development",
55
"author": "Pierre Vanduynslager",
66
"bugs": {
7-
"url": "https://github.com/vanduynslagerp/sr-commit-analyzer/issues"
7+
"url": "https://github.com/semantic-release/commit-analyzer/issues"
88
},
99
"config": {
1010
"commitizen": {
@@ -44,7 +44,6 @@
4444
"prettier": "^1.5.3",
4545
"rimraf": "^2.6.1",
4646
"semantic-release": "^8.0.0",
47-
"sr-release-notes-generator": "^1.1.1",
4847
"tempy": "^0.2.0"
4948
},
5049
"engines": {
@@ -73,7 +72,7 @@
7372
"files": [
7473
"lib"
7574
],
76-
"homepage": "https://github.com/vanduynslagerp/sr-commit-analyzer#readme",
75+
"homepage": "https://github.com/semantic-release/commit-analyzer#readme",
7776
"keywords": [
7877
"changelog",
7978
"commit-analyzer",
@@ -115,14 +114,11 @@
115114
"release": {
116115
"analyzeCommits": {
117116
"path": "./lib/index.js"
118-
},
119-
"generateNotes": {
120-
"path": "sr-release-notes-generator"
121117
}
122118
},
123119
"repository": {
124120
"type": "git",
125-
"url": "https://github.com/vanduynslagerp/sr-commit-analyzer.git"
121+
"url": "https://github.com/semantic-release/commit-analyzer.git"
126122
},
127123
"scripts": {
128124
"clean": "rimraf coverage && rimraf .nyc_output",

test/integration.test.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ test('Throw "SemanticReleaseError" if "preset" doesn`t exist', async t => {
140140
test('Throw "SemanticReleaseError" if "releaseRules" is not an Array or a String', async t => {
141141
const error = await t.throws(
142142
pify(commitAnalyzer)({releaseRules: {}}, {}),
143-
/Error in sr-commit-analyzer configuration: "releaseRules" must be an array of rules/
143+
/Error in commit-analyzer configuration: "releaseRules" must be an array of rules/
144144
);
145145

146146
t.true(error instanceof SemanticReleaseError);
@@ -150,7 +150,7 @@ test('Throw "SemanticReleaseError" if "releaseRules" is not an Array or a String
150150
test('Throw "SemanticReleaseError" if "releaseRules" option reference a requierable module that is not an Array or a String', async t => {
151151
const error = await t.throws(
152152
pify(commitAnalyzer)({releaseRules: './test/fixtures/release-rules-invalid'}, {}),
153-
/Error in sr-commit-analyzer configuration: "releaseRules" must be an array of rules/
153+
/Error in commit-analyzer configuration: "releaseRules" must be an array of rules/
154154
);
155155

156156
t.true(error instanceof SemanticReleaseError);
@@ -171,7 +171,7 @@ test('Throw "SemanticReleaseError" if "config" doesn`t exist', async t => {
171171
test('Throw "SemanticReleaseError" if "releaseRules" reference invalid commit type', async t => {
172172
const error = await t.throws(
173173
pify(commitAnalyzer)({preset: 'eslint', releaseRules: [{tag: 'Update', release: 'invalid'}]}, {}),
174-
/Error in sr-commit-analyzer configuration: "invalid" is not a valid release type\. Valid values are:\[?.*\]/
174+
/Error in commit-analyzer configuration: "invalid" is not a valid release type\. Valid values are:\[?.*\]/
175175
);
176176

177177
t.is(error.code, 'EINVALIDRELEASE');

test/load-release-rules.test.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ test('Return undefined if "releaseRules" not set', t => {
2424
test('Throw "SemanticReleaseError" if "releaseRules" reference invalid commit type', t => {
2525
const error = t.throws(
2626
() => loadReleaseRules({releaseRules: [{tag: 'Update', release: 'invalid'}]}),
27-
/Error in sr-commit-analyzer configuration: "invalid" is not a valid release type\. Valid values are:\[?.*\]/
27+
/Error in commit-analyzer configuration: "invalid" is not a valid release type\. Valid values are:\[?.*\]/
2828
);
2929

3030
t.is(error.code, 'EINVALIDRELEASE');
@@ -34,7 +34,7 @@ test('Throw "SemanticReleaseError" if "releaseRules" reference invalid commit ty
3434
test('Throw "SemanticReleaseError" if "releaseRules" is not an Array or a String', t => {
3535
const error = t.throws(
3636
() => loadReleaseRules({releaseRules: {}}, {}),
37-
/Error in sr-commit-analyzer configuration: "releaseRules" must be an array of rules/
37+
/Error in commit-analyzer configuration: "releaseRules" must be an array of rules/
3838
);
3939

4040
t.true(error instanceof SemanticReleaseError);
@@ -44,7 +44,7 @@ test('Throw "SemanticReleaseError" if "releaseRules" is not an Array or a String
4444
test('Throw "SemanticReleaseError" if "releaseRules" option reference a requierable module that is not an Array or a String', t => {
4545
const error = t.throws(
4646
() => loadReleaseRules({releaseRules: './test/fixtures/release-rules-invalid'}),
47-
/Error in sr-commit-analyzer configuration: "releaseRules" must be an array of rules/
47+
/Error in commit-analyzer configuration: "releaseRules" must be an array of rules/
4848
);
4949

5050
t.true(error instanceof SemanticReleaseError);

0 commit comments

Comments
 (0)