diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..9a7bbf0 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,23 @@ +# To get started with Dependabot version updates, you'll need to specify which +# package ecosystems to update and where the package manifests are located. +# Please see the documentation for all configuration options: +# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates + +version: 2 +updates: + # root + - package-ecosystem: "npm" + directory: "/" # Location of package manifests + allow: + - dependency-type: "direct" + versioning-strategy: increase + commit-message: + prefix: "chore(deps):" + pull-request-branch-name: + separator: "-" + schedule: + interval: "daily" + labels: + - "npm" + - "dependencies" + diff --git a/package.json b/package.json index 0634489..7b1c364 100644 --- a/package.json +++ b/package.json @@ -100,15 +100,12 @@ "strip-ansi": "^6.0.0" }, "devDependencies": { - "@semantic-release/changelog": "^5.0.1", - "@semantic-release/exec": "^5.0.0", - "@semantic-release/git": "^9.0.0", - "@semantic-release/github": "^7.0.7", + "@codedependant/release-config-npm": "^1.0.3", "@vuepress/plugin-back-to-top": "^1.5.4", "cli-spinners": "^2.3.0", "eslint": "^7.9.0", "eslint-config-codedependant": "^2.1.1", - "semantic-release": "^17.3.9", + "semantic-release": "^17.4.2", "tap": "^14.10.2", "vuepress": "^1.8.2" }, diff --git a/release.config.js b/release.config.js index 3dcba74..a0b7b07 100644 --- a/release.config.js +++ b/release.config.js @@ -1,87 +1,6 @@ 'use strict' -const now = new Date() -const year = now.getFullYear() -const day = String(now.getDate()).padStart(2, '0') -const month = String(now.getMonth() + 1).padStart(2, '0') - -const COMMIT_TYPES = new Map([ - ['build', 'Build System'] -, ['ci', 'Continuous Integration'] -, ['chore', 'Chores'] -, ['default', 'Miscellaneous'] -, ['dep', 'Dependancies'] -, ['doc', 'Documentation'] -, ['docs', 'Documentation'] -, ['feat', 'Features'] -, ['fix', 'Bug Fixes'] -, ['lint', 'Lint'] -, ['perf', 'Performance Improvements'] -, ['revert', 'Reverts'] -, ['refactor', 'Code Refactoring'] -, ['style', 'Style'] -, ['test', 'Tests'] -]) - -function typeOf(type) { - return COMMIT_TYPES.get(type) || COMMIT_TYPES.get('default') -} - -function transform(commit) { - commit.type = typeOf(commit.type) - commit.shortHash = commit.hash.substring(0, 7) - return commit -} - module.exports = { - branches: [ - 'main' - ] -, parserOpts: { - noteKeywords: ['BREAKING', 'BREAKING CHANGE', 'BREAKING CHANGES'] - , headerPattern: /^(\w*)(?:\((.*)\))?!?: (.*)$/ - , breakingHeaderPattern: /^(\w*)(?:\((.*)\))?!: (.*)$/ - , headerCorrespondence: ['type', 'scope', 'subject'] - , issuePrefixes: ['#', 'gh-'] - , referenceActions: [ - 'close', 'closes', 'closed' - , 'fix', 'fixes', 'fixed' - , 'resolve', 'resolves', 'resolved' - ] - } -, writerOpts: {transform: transform} -, releaseRules: [ - {breaking: true, release: 'major'} - , {revert: true, release: 'patch'} - , {type: 'build', release: 'patch'} - , {type: 'ci', release: 'patch'} - , {type: 'release', release: 'patch'} - , {type: 'doc', release: 'patch'} - , {type: 'chore', release: 'patch'} - , {type: 'ci', release: 'patch'} - , {type: 'lib', release: 'patch'} - , {type: 'perf', release: 'minor'} - , {type: 'refactor', release: 'patch'} - , {type: 'release', release: false} - , {type: 'test', release: 'patch'} - , {type: 'fix', release: 'patch'} - ] -, plugins: [ - ['@semantic-release/commit-analyzer', null], - , ['@semantic-release/release-notes-generator', null] - , ['@semantic-release/changelog', { - changelogTitle: '# Changlog' - , changelogFile: 'CHANGELOG.md' - }] - , ['@semantic-release/npm', null] - , ['@semantic-release/exec', { - prepareCmd: 'npm run docs:build' - }] - , ['@semantic-release/git', { - assets: ['package.json', 'package-lock.json', 'CHANGELOG.md', 'docs'] - , message: `release: ${year}-${month}-${day}, ` - + 'Version <%= nextRelease.version %> [skip ci]' - }] - , ['@semantic-release/github', null] - ] + 'extends': '@codedependant/release-config-npm' +, 'branches': ['main'] }