Skip to content

Commit

Permalink
chore: add release-it (#4)
Browse files Browse the repository at this point in the history
* docs: add npm version & size to readme

* chore: extract husky config from package.json

* chore: extract prettier config from package.json

* chore: add commitlint

* chore: add release-it

* docs: add an empty changelog file

* chore: update release-it npm publish config
  • Loading branch information
gorhom authored Dec 23, 2019
1 parent ae60ad4 commit 30fe9b9
Show file tree
Hide file tree
Showing 10 changed files with 1,980 additions and 74 deletions.
6 changes: 6 additions & 0 deletions .huskyrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"hooks": {
"pre-commit": "pretty-quick --staged",
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
}
}
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules/
dist/
6 changes: 6 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"printWidth": 80,
"semi": true,
"singleQuote": true,
"trailingComma": "es5"
}
23 changes: 23 additions & 0 deletions .release-it.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"git": {
"push": true,
"tagName": "v${version}",
"commitMessage": "chore: release v${version}",
"changelog": "auto-changelog --stdout --commit-limit false --ignore-commit-pattern \"^chore: release v\" --unreleased --template ./release-template.hbs"
},
"github": {
"release": true,
"releaseNotes": "auto-changelog --stdout --commit-limit false --ignore-commit-pattern \"^chore: release v\" --unreleased --template ./release-template.hbs"
},
"npm": {
"publish": true
},
"plugins": {
"@release-it/conventional-changelog": {
"preset": "angular"
}
},
"hooks": {
"after:bump": "auto-changelog -p --ignore-commit-pattern \"^chore: release v\""
}
}
Empty file added CHANGELOG.md
Empty file.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# TypeScript Codable
# TypeScript Codable ![npm](https://img.shields.io/npm/v/ts-codable) ![npm bundle size](https://img.shields.io/bundlephobia/minzip/ts-codable)

another strict json parser inspired by [Swift Codable](https://developer.apple.com/documentation/swift/codable) ❤️

Expand Down
1 change: 1 addition & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = { extends: ['@commitlint/config-conventional'] };
19 changes: 7 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,26 +33,21 @@
"scripts": {
"start": "tsdx watch",
"build": "tsdx build",
"test": "tsdx test"
"test": "tsdx test",
"release": "release-it"
},
"peerDependencies": {},
"husky": {
"hooks": {
"pre-commit": "pretty-quick --staged"
}
},
"prettier": {
"printWidth": 80,
"semi": true,
"singleQuote": true,
"trailingComma": "es5"
},
"devDependencies": {
"@commitlint/cli": "^8.2.0",
"@commitlint/config-conventional": "^8.2.0",
"@release-it/conventional-changelog": "^1.1.0",
"@types/jest": "^24.0.24",
"@types/lodash": "^4.14.149",
"auto-changelog": "^1.16.2",
"husky": "^3.1.0",
"prettier": "^1.19.1",
"pretty-quick": "^2.0.1",
"release-it": "^12.4.3",
"tsdx": "^0.12.0",
"tslib": "^1.10.0",
"typescript": "^3.7.4"
Expand Down
13 changes: 13 additions & 0 deletions release-template.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{{#each releases}}
{{#if @first}}
{{#each merges}}
- {{{message}}}{{#if href}} [`#{{id}}`]({{href}}){{/if}}
{{/each}}
{{#each fixes}}
- {{{commit.subject}}}{{#each fixes}}{{#if href}} [`#{{id}}`]({{href}}){{/if}}{{/each}}
{{/each}}
{{#each commits}}
- {{#if breaking}}**Breaking change:** {{/if}}{{{subject}}}{{#if href}} [`{{shorthash}}`]({{href}}){{/if}}
{{/each}}
{{/if}}
{{/each}}
Loading

0 comments on commit 30fe9b9

Please sign in to comment.