Skip to content

Commit 3d01335

Browse files
authored
Merge pull request #72 from open-tux/feature/semantic-release
Implement semantic-release and conventional commits
2 parents 65d488c + 6189c2f commit 3d01335

File tree

7 files changed

+1075
-90
lines changed

7 files changed

+1075
-90
lines changed

.eslintrc.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ module.exports = {
1010
'plugin:ember-suave/recommended'
1111
],
1212
env: {
13-
browser: true
13+
browser: true,
14+
node: true
1415
},
1516
rules: {
1617
}

.travis.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,6 @@ script:
4040
# Usually, it's ok to finish the test scenario without reverting
4141
# to the addon's original dependency state, skipping "cleanup".
4242
- node_modules/.bin/ember try:one $EMBER_TRY_SCENARIO --skip-cleanup
43+
44+
after_success:
45+
- yarn semantic-release

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
[![Build Status](https://travis-ci.org/open-tux/ember-bulma.svg?branch=master)](https://travis-ci.org/open-tux/ember-bulma)
33
[![Ember Observer Score](http://emberobserver.com/badges/ember-bulma.svg)](https://emberobserver.com/addons/ember-bulma)
44

5+
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)
6+
[![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)
7+
58
# ember-bulma
69

710
[Ember Bulma](http://open-tux.github.io/ember-bulma/) is a collection of Ember components and services for [Bulma](https://github.com/jgthms/bulma), a modern CSS framework by Jeremy Thomas

commitizen.config.js

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
const types = [
2+
{
3+
value: 'feat',
4+
name: 'feat: A new feature'
5+
},
6+
{
7+
value: 'fix',
8+
name: 'fix: A bug fix'
9+
},
10+
{
11+
value: 'docs',
12+
name: 'docs: Documentation only changes'
13+
},
14+
{
15+
value: 'style',
16+
name: `style: Changes that do not affect the meaning of the code
17+
(white-space, formatting, missing semi-colons, etc)`
18+
},
19+
{
20+
value: 'refactor',
21+
name: 'refactor: A code change that neither fixes a bug nor adds a feature'
22+
},
23+
{
24+
value: 'perf',
25+
name: 'perf: A code change that improves performance'
26+
},
27+
{
28+
value: 'test',
29+
name: 'test: Adding missing tests'
30+
},
31+
{
32+
value: 'chore',
33+
name: `chore: Changes to the build process or auxiliary tools
34+
and libraries such as documentation generation`
35+
},
36+
{
37+
value: 'revert',
38+
name: 'revert: Revert to a commit'
39+
}
40+
];
41+
42+
const scopes = [
43+
'modifiers',
44+
'grid',
45+
'elements',
46+
'components',
47+
'layout',
48+
'themes'
49+
].map((name) => ({ name }));
50+
51+
module.exports = {
52+
types,
53+
scopes,
54+
allowCustomScopes: true,
55+
allowBreakingChanges: [
56+
'feat',
57+
'fix',
58+
'refactor'
59+
]
60+
};

commitlint.config.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
const { types, scopes } = require('./commitizen.config');
2+
3+
const validTypes = types.map((type) => type.value);
4+
const validScopes = scopes.map((scope) => scope.name);
5+
6+
module.exports = {
7+
extends: ['@commitlint/config-angular'],
8+
9+
rules: {
10+
'body-leading-blank': [2, 'always'],
11+
'body-tense': [0, 'always', ['present-imperative']],
12+
'scope-enum': [1, 'always', validScopes],
13+
'type-enum': [2, 'always', validTypes]
14+
}
15+
};

package.json

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ember-bulma",
3-
"version": "0.2.0",
3+
"version": "0.0.0-semantically-released",
44
"description": "Ember Bulma is a collection of Ember components and services for Bulma, a modern CSS framework by Jeremy Thomas",
55
"keywords": [
66
"ember-addon",
@@ -20,9 +20,20 @@
2020
"repository": "https://github.com/open-tux/ember-bulma",
2121
"scripts": {
2222
"build": "ember build",
23+
"commit": "git-cz",
24+
"commitmsg": "commitlint -e",
2325
"start": "ember server",
26+
"semantic-release": "semantic-release pre && npm publish && semantic-release post",
2427
"test": "ember try:each"
2528
},
29+
"config": {
30+
"commitizen": {
31+
"path": "node_modules/cz-customizable"
32+
},
33+
"cz-customizable": {
34+
"config": "commitizen.config.js"
35+
}
36+
},
2637
"dependencies": {
2738
"babel-eslint": "^7.2.3",
2839
"broccoli-funnel": "^1.2.0",
@@ -31,9 +42,13 @@
3142
"ember-decorators": "^1.2.1"
3243
},
3344
"devDependencies": {
45+
"@commitlint/cli": "^3.1.2",
46+
"@commitlint/config-angular": "3.1.1",
3447
"babel-plugin-transform-decorators-legacy": "^1.3.4",
3548
"broccoli-asset-rev": "^2.4.5",
3649
"bulma": "^0.5.0",
50+
"commitizen": "^2.9.6",
51+
"cz-customizable": "^5.0.0",
3752
"ember-ajax": "^3.0.0",
3853
"ember-cli": "~2.14.1",
3954
"ember-cli-content-security-policy": "^0.6.0",
@@ -54,7 +69,9 @@
5469
"ember-source": "~2.14.1",
5570
"ember-themed-syntax": "0.0.7",
5671
"eslint-plugin-ember-suave": "^1.0.0",
57-
"loader.js": "^4.2.3"
72+
"husky": "^0.14.3",
73+
"loader.js": "^4.2.3",
74+
"semantic-release": "^6.3.6"
5875
},
5976
"engines": {
6077
"node": "^4.5 || 6.* || >= 7.*"

0 commit comments

Comments
 (0)