From f1d6c681ac48862283f7fcdfc908ebd8eee8fc72 Mon Sep 17 00:00:00 2001 From: Chen Asraf Date: Wed, 31 May 2023 00:21:56 +0300 Subject: [PATCH] build: fix release.config.js --- release.config.js | 89 ---------------------------------------------- release.config.mjs | 87 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 87 insertions(+), 89 deletions(-) delete mode 100644 release.config.js create mode 100644 release.config.mjs diff --git a/release.config.js b/release.config.js deleted file mode 100644 index f0c5a7c..0000000 --- a/release.config.js +++ /dev/null @@ -1,89 +0,0 @@ -const releaseRules = [ - { type: 'feat', section: 'Features', release: 'minor' }, - { type: 'revert', section: 'Features', release: 'minor' }, - { type: 'fix', section: 'Bug Fixes', release: 'patch' }, - { type: 'chore', section: 'Misc', release: 'patch' }, - { type: 'refactor', section: 'Misc', release: 'patch' }, - { type: 'perf', section: 'Misc', release: 'patch' }, - { type: 'build', section: 'Build', release: 'patch' }, - { type: 'docs', section: 'Build', release: false }, - { type: 'test', section: 'Tests', release: 'patch' }, -] - -/** @type {import('semantic-release').Options} */ -module.exports = { - branches: [ - '+([0-9])?(.{+([0-9]),x}).x', - 'master', - 'next', - 'next-major', - { name: 'develop', prerelease: true }, - { name: 'beta', prerelease: true }, - { name: 'alpha', prerelease: true }, - ], - analyzeCommits: { - path: 'semantic-release-conventional-commits', - majorTypes: releaseRules.filter((x) => x.release === 'major').map((x) => x.type), - minorTypes: releaseRules.filter((x) => x.release === 'minor').map((x) => x.type), - patchTypes: releaseRules.filter((x) => x.release === 'patch').map((x) => x.type), - }, - plugins: [ - [ - '@semantic-release/commit-analyzer', - { - preset: 'conventionalcommits', - parserOpts: { - noteKeywords: ['breaking:', 'breaking-fix:', 'breaking-feat:'], - }, - releaseRules: releaseRules, - }, - ], - [ - '@semantic-release/release-notes-generator', - { - preset: 'conventionalcommits', - parserOpts: { - noteKeywords: ['breaking', 'major'], - types: releaseRules, - }, - }, - ], - [ - '@semantic-release/changelog', - { - changelogFile: 'CHANGELOG.md', - changelogTitle: '# Change Log', - }, - ], - [ - '@semantic-release/npm', - { - npmPublish: false, - }, - ], - [ - '@semantic-release/npm', - { - npmPublish: true, - pkgRoot: 'dist', - }, - ], - [ - '@semantic-release/git', - { - assets: ['CHANGELOG.md', 'package.json'], - }, - ], - [ - '@semantic-release/github', - { - assets: [ - { - path: '*.tgz', - name: 'licenseg.tgz', - }, - ], - }, - ], - ], -} diff --git a/release.config.mjs b/release.config.mjs new file mode 100644 index 0000000..695a554 --- /dev/null +++ b/release.config.mjs @@ -0,0 +1,87 @@ +const releaseRules = [ + { type: 'feat', section: 'Features', release: 'minor' }, + { type: 'revert', section: 'Features', release: 'minor' }, + { type: 'fix', section: 'Bug Fixes', release: 'patch' }, + { type: 'chore', section: 'Misc', release: 'patch' }, + { type: 'refactor', section: 'Misc', release: 'patch' }, + { type: 'perf', section: 'Misc', release: 'patch' }, + { type: 'build', section: 'Build', release: 'patch' }, + { type: 'docs', section: 'Build', release: false }, + { type: 'test', section: 'Tests', release: 'patch' }, +] + +/** @type {import('semantic-release').Options} */ +export const branches = [ + '+([0-9])?(.{+([0-9]),x}).x', + 'master', + 'next', + 'next-major', + { name: 'develop', prerelease: true }, + { name: 'beta', prerelease: true }, + { name: 'alpha', prerelease: true }, +] +export const analyzeCommits = { + path: 'semantic-release-conventional-commits', + majorTypes: releaseRules.filter((x) => x.release === 'major').map((x) => x.type), + minorTypes: releaseRules.filter((x) => x.release === 'minor').map((x) => x.type), + patchTypes: releaseRules.filter((x) => x.release === 'patch').map((x) => x.type), +} +export const plugins = [ + [ + '@semantic-release/commit-analyzer', + { + preset: 'conventionalcommits', + parserOpts: { + noteKeywords: ['breaking:', 'breaking-fix:', 'breaking-feat:'], + }, + releaseRules: releaseRules, + }, + ], + [ + '@semantic-release/release-notes-generator', + { + preset: 'conventionalcommits', + parserOpts: { + noteKeywords: ['breaking', 'major'], + types: releaseRules, + }, + }, + ], + [ + '@semantic-release/changelog', + { + changelogFile: 'CHANGELOG.md', + changelogTitle: '# Change Log', + }, + ], + [ + '@semantic-release/npm', + { + npmPublish: false, + }, + ], + [ + '@semantic-release/npm', + { + npmPublish: true, + pkgRoot: 'dist', + }, + ], + [ + '@semantic-release/git', + { + assets: ['CHANGELOG.md', 'package.json'], + }, + ], + [ + '@semantic-release/github', + { + assets: [ + { + path: '*.tgz', + name: 'licenseg.tgz', + }, + ], + }, + ], +]