Skip to content

Commit

Permalink
feat: add semantic-release, complete config
Browse files Browse the repository at this point in the history
  • Loading branch information
iamyoki committed Dec 16, 2021
1 parent 26be3f0 commit 3f97686
Show file tree
Hide file tree
Showing 3 changed files with 1,895 additions and 122 deletions.
12 changes: 10 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "transition-hook",
"version": "0.0.1",
"version": "0.0.0-development",
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
"types": "dist/types/index.d.ts",
Expand All @@ -20,7 +20,8 @@
"clean": "rimraf dist",
"build": "yarn clean && run-p build:*",
"watch": "yarn clean && run-p 'build:* -- --watch'",
"lint": "eslint src --fix"
"lint": "eslint src --fix",
"semantic-release": "semantic-release"
},
"peerDependencies": {
"react": "^16.8.0 || ^17.0.0",
Expand All @@ -29,6 +30,8 @@
"devDependencies": {
"@commitlint/cli": "^15.0.0",
"@commitlint/config-conventional": "^15.0.0",
"@semantic-release/changelog": "^6.0.1",
"@semantic-release/git": "^10.0.1",
"@types/react": "^17.0.37",
"eslint": "^8.4.1",
"eslint-config-prettier": "^8.3.0",
Expand All @@ -39,7 +42,12 @@
"npm-run-all": "^4.1.5",
"prettier": "^2.5.1",
"rimraf": "^3.0.2",
"semantic-release": "^18.0.1",
"semantic-release-cli": "^5.4.4",
"typescript": "^4.5.4"
},
"repository": {
"type": "git",
"url": "https://github.com/iamyoki/transition-hook.git"
}
}
77 changes: 77 additions & 0 deletions release.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
/** @type {import('semantic-release').Options} */
const config = {
branches: 'main',
plugins: [
[
'@semantic-release/commit-analyzer',
{
preset: 'conventionalcommits',
parserOpts: {
noteKeywords: ['BREAKING CHANGE', 'BREAKING CHANGES', 'BREAKING'],
},
releaseRules: [
{type: 'chore', release: 'patch'},
{
type: 'docs',
release: 'patch',
},
{
type: 'build',
release: 'patch',
},
{
type: 'ci',
release: 'patch',
},
{
type: 'style',
release: 'patch',
},
{
type: 'test',
release: 'patch',
},
],
},
],
[
'@semantic-release/release-notes-generator',
{
preset: 'conventionalcommits',
parserOpts: {
noteKeywords: ['BREAKING CHANGE', 'BREAKING CHANGES', 'BREAKING'],
},
writerOpts: {
commitsSort: ['subject', 'scope'],
},
presetConfig: {
types: [
{type: 'feat', section: 'Features'},
{type: 'fix', section: 'Bug Fixes'},
{type: 'chore', hidden: false},
{type: 'build', hidden: false},
{type: 'ci', hidden: false},
{type: 'docs', hidden: false},
{type: 'style', hidden: false},
{type: 'refactor', hidden: false},
{type: 'perf', hidden: false},
{type: 'test', hidden: false},
],
},
},
],
'@semantic-release/github',
'@semantic-release/npm',
[
'@semantic-release/git',
{
message:
// eslint-disable-next-line no-template-curly-in-string
'chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}',
},
],
'@semantic-release/changelog',
],
};

module.exports = config;
Loading

0 comments on commit 3f97686

Please sign in to comment.