Skip to content

Commit 8d0ec82

Browse files
Eli Skeggsskeggse
Eli Skeggs
authored andcommitted
feat: initial fork release
- remove cli and local functionality - remove typescript - use standard Mixmax shared modules setup
1 parent 0759fc0 commit 8d0ec82

21 files changed

+12218
-3694
lines changed

.circleci/config.yml

-40
This file was deleted.

.eslintignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/dist

.eslintrc.json

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"extends": ["mixmax/node", "mixmax/prettier"],
3+
"parserOptions": {
4+
"sourceType": "module"
5+
}
6+
}

.gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ coverage/
77
*.tmp
88
*.tmp.*
99
log.txt
10-
*.sublime-project
1110
*.sublime-workspace
1211

1312
.idea/

.prettierrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"@mixmaxhq/prettier-config"

Jenkinsfile

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// This name is defined in the Jenkins management console, and pulled from a github repository under
2+
// our mixmaxhq organization by the same name. Specify a specific tag/revision by appending it along
3+
// with an '@' symbol to the string literal.
4+
@Library('scm-service-library') _
5+
6+
npmModulePipeline {
7+
nodeVersion = '10.16.0'
8+
npmVersion = '6.4.1'
9+
}

LICENSE

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
MIT License
22

3-
Copyright (c) 2017 Ionic
3+
Copyright (c) 2019 Mixmax, Inc
4+
5+
Copyright (c) 2017 Ionic where applicable
46

57
Permission is hereby granted, free of charge, to any person obtaining a copy
68
of this software and associated documentation files (the "Software"), to deal

README.md

+33-100
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,26 @@
1-
# Semantic Commitlint [![npm version](https://badge.fury.io/js/semantic-commitlint.svg)](https://badge.fury.io/js/semantic-commitlint)
1+
# Semantic Commitlint
22

33
📦🚀 + 📓 A continuous integration build tool to ensure all new commits meet your commit message format!
4-
️️
5-
6-
[![Build Status](https://img.shields.io/circleci/project/github/adriancarriger/semantic-commitlint/master.svg?maxAge=60)](https://circleci.com/gh/adriancarriger/semantic-commitlint)
7-
[![Dependency Status](https://img.shields.io/david/adriancarriger/semantic-commitlint.svg?maxAge=60)](https://david-dm.org/adriancarriger/semantic-commitlint)
8-
[![devDependency Status](https://img.shields.io/david/dev/adriancarriger/semantic-commitlint.svg?maxAge=60)](https://david-dm.org/adriancarriger/semantic-commitlint?type=dev)
9-
[![Downloads per month](https://img.shields.io/npm/dm/semantic-commitlint.svg)](https://www.npmjs.com/package/semantic-commitlint)
104

115
## Problem
126

13-
* [📦🚀 semantic-release](https://github.com/semantic-release/semantic-release) depends on properly formatted commit messages
14-
* [📓 commitlint](https://github.com/marionebl/commitlint) is awesome, but it doesn't know which commits occurred since your last release
7+
* [📦🚀 semantic-release](https://github.com/semantic-release/semantic-release) depends on properly
8+
formatted commit messages
9+
* [📓 commitlint](https://github.com/marionebl/commitlint) is awesome, but it doesn't know which
10+
commits occurred since your last release
1511

1612
## Solution
1713

18-
* [semantic-commitlint](https://github.com/adriancarriger/semantic-commitlint) fills the gap between semantic-release and commitlint by asking commitlint to lint new commit messages that have not been included in a previous release
14+
* [semantic-commitlint](https://github.com/adriancarriger/semantic-commitlint) fills the gap by
15+
providing a hook for `semantic-release` that asks `commitlint` to lint new commit messages that
16+
have not been included in a previous release
1917

2018
## Features
2119

2220
* Run in CI on all branches to ensure that only builds with valid commit messages pass
23-
* Wraps [semantic-release](https://github.com/semantic-release/semantic-release) and [commitlint](https://github.com/marionebl/commitlint) for an easy install
24-
* Minimal config
21+
* Wraps [`semantic-release`](https://github.com/semantic-release/semantic-release) and
22+
[`commitlint`](https://github.com/marionebl/commitlint) for an easy install
23+
* No config
2524

2625
## Install
2726

@@ -31,122 +30,56 @@ npm install semantic-commitlint --save-dev
3130

3231
## Setup
3332

34-
Add the following to your `package.json`
33+
Add the following to your `semantic-release` release block (e.g. in the `release` field of your
34+
`package.json`)
3535

3636
```json
3737
{
38-
"scripts": {
39-
"semantic-commitlint": "semantic-commitlint",
40-
"semantic-release": "semantic-release"
41-
},
42-
"release": {
43-
"verifyRelease": ["semantic-commitlint"]
44-
}
38+
"verifyRelease": ["semantic-commitlint"]
4539
}
4640
```
4741

4842
Setup [semantic-release authentication](https://github.com/semantic-release/semantic-release/blob/caribou/docs/usage/ci-configuration.md#ci-configuration) for CI
4943

50-
## Usage
51-
52-
Add the following commands to your CI build process
53-
54-
```bash
55-
npm run semantic-commitlint -- --ci
56-
npm run semantic-release
57-
```
58-
59-
## Local usage
60-
61-
To get early feedback on commit messages you can add the following to a commit hook or your regular set of tests.
62-
63-
```bash
64-
npm run semantic-commitlint
65-
```
66-
67-
This allows your project's contributors to get early feedback on their last commit message instead of waiting for CI to fail a build.
44+
`semantic-commitlint` currently only supports `@commitlint/config-conventional` - please open a PR
45+
if you need support for other configurations!
6846

69-
* **Last commit only** - this will not validate all new commit messages because Github auth is required to gather commits that have been added since the last release.
47+
## Usage
7048

71-
## Config
49+
Simply run `semantic-release` as normal as part of your CI build process
7250

73-
### Skip commits
51+
## Skip commits
7452

75-
If there are unreleased commits that shouldn't fail a build, then add them to your `package.json` inside the `semanticCommitlint` config.
53+
If there are unreleased commits that shouldn't fail a build, then add them to the
54+
`SEMANTIC_COMMITLINT_SKIP` environment variable as comma-separated GIT SHAs. This should be
55+
uncommon, provided your development workflow lints the commits before they get added to the release
56+
branch.
7657

7758
```json
7859
{
79-
"semanticCommitlint": {
80-
"skipCommits": ["a1be371"]
81-
}
82-
}
83-
```
84-
85-
### Custom lint functions
86-
87-
To add a custom lint function add your function's path in `package.json`.
88-
89-
```json
90-
{
91-
"semanticCommitlint": {
92-
"lintFunctions": ["./my-function.js"]
60+
"scripts": {
61+
"semantic-release": "SEMANTIC_COMMITLINT_SKIP=a1be371 semantic-release"
9362
}
9463
}
9564
```
9665

97-
The function itself works like this:
98-
99-
```js
100-
// my-function.js
101-
function customValidation(commitMessage, report) {
102-
if (commitMessage.includes('something bad')) {
103-
report.valid = false;
104-
report.errors.push({
105-
level: 2,
106-
valid: false,
107-
name: 'type-bad',
108-
message: 'Commit message should have been better!'
109-
});
110-
}
111-
}
112-
113-
module.exports = customValidation;
114-
```
115-
11666
## External config
11767

118-
This project just ties together some functionality from two external projects. For all other config options make sure to read through the docs.
68+
This project just ties together some functionality from two external projects. For all other config
69+
options make sure to read through the docs.
11970

12071
* [📦🚀 semantic-release](https://github.com/semantic-release/semantic-release)
12172
* [📓 commitlint](https://github.com/marionebl/commitlint)
12273

123-
## Commit hooks
124-
125-
You can prevent invalid commit messages from every being created by using [Git hooks](https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks)!
126-
127-
* Add [husky](https://github.com/typicode/husky)
128-
129-
```bash
130-
npm install --save-dev husky@next
131-
```
132-
133-
* Update `package.json`
134-
135-
```json
136-
{
137-
"husky": {
138-
"hooks": {
139-
"prepare-commit-msg": "npm run semantic-commitlint -- -h"
140-
}
141-
}
142-
}
143-
```
144-
14574
## Issues
14675

147-
Not all features implemented in semantic-release and commitlint are currently available when using semantic-commtlint. If you have a suggestion, please [open an issue](https://github.com/adriancarriger/semantic-commitlint/issues/new). Thanks!
76+
Not all features implemented in `semantic-release` and `commitlint` are currently available when
77+
using `semantic-commtlint`. If you have a suggestion, please
78+
[open an issue](https://github.com/mixmaxhq/semantic-commitlint/issues/new). Thanks!
14879

14980
## License
15081

15182
semantic-commitlint is licensed under the MIT Open Source license.
152-
For more information, see the [LICENSE](LICENSE) file in this repository.
83+
For more information, see the [LICENSE] file in this repository.
84+
85+
[LICENSE]: https://github.com/mixmaxhq/semantic-commitlint/blob/master/LICENSE

babel.config.js

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
plugins: ['@babel/plugin-transform-modules-commonjs', '@babel/plugin-transform-runtime'],
3+
};

0 commit comments

Comments
 (0)