UNPKG

@latipun7/releaserc

Version:

๐Ÿฅท Nerdy Ninja's shareable Semantic Release configuration ๐Ÿš€

129 lines (128 loc) โ€ข 4.31 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.vscePlugins = exports.plugins = void 0; const fs_1 = require("fs"); const path_1 = require("path"); const preset = 'conventionalcommits'; const releaseRules = [ { breaking: true, release: 'major' }, { revert: true, release: 'patch' }, { type: 'feat', release: 'minor' }, { type: 'feature', release: 'minor' }, { type: 'fix', release: 'patch' }, { type: 'docs', release: 'patch' }, { type: 'perf', release: 'patch' }, { type: 'revert', release: 'patch' }, { type: 'security', release: 'patch' }, ]; const presetConfig = { types: [ { type: 'feat', section: 'โœจ Features' }, { type: 'feature', section: 'โœจ Features' }, { type: 'fix', section: '๐Ÿ› Fixes' }, { type: 'perf', section: 'โšก Performance Improvements' }, { type: 'revert', section: 'โ™ป๏ธ Reverts' }, { type: 'docs', section: '๐Ÿ“š Documentations' }, { type: 'security', section: '๐Ÿ” Security Patches' }, { type: 'style', section: '๐ŸŽจ Styles', hidden: true }, { type: 'chore', section: '๐Ÿงน Miscellaneous Chores', hidden: true }, { type: 'refactor', section: '๐ŸŽฏ Code Refactoring', hidden: true }, { type: 'test', section: '๐Ÿงช Tests', hidden: true }, { type: 'build', section: '๐Ÿ—๏ธ Builds System', hidden: true }, { type: 'ci', section: '๐Ÿšš Continuous Integrations', hidden: true }, ], }; const parserOpts = { referenceActions: [ 'close', 'closes', 'closed', 'fix', 'fixes', 'fixed', 'resolve', 'resolves', 'resolved', 'see', 'sees', 'track', 'tracks', 'tracked', ], }; const writerOpts = { mainTemplate: (0, fs_1.readFileSync)((0, path_1.resolve)(__dirname, '..', 'templates', 'main.hbs'), { encoding: 'utf-8' }), commitPartial: (0, fs_1.readFileSync)((0, path_1.resolve)(__dirname, '..', 'templates', 'commit-partial.hbs'), { encoding: 'utf-8' }), partials: { importantNotes: '{{{text}}}', commitNotes: '{{{body}}}', }, commitGroupsSort: (first, second) => { const commitGroupOrder = [ 'โœจ Features', '๐Ÿ› Fixes', '๐Ÿ” Security Patches', 'โšก Performance Improvements', 'โ™ป๏ธ Reverts', '๐Ÿ“š Documentations', ]; const gRankA = commitGroupOrder.indexOf(first.title || ''); const gRankB = commitGroupOrder.indexOf(second.title || ''); if (gRankA <= gRankB) return -1; return 1; }, }; const commitAnalyzerPlugin = [ '@semantic-release/commit-analyzer', { preset, parserOpts, releaseRules, presetConfig }, ]; const releaseNotesGeneratorPlugin = [ '@semantic-release/release-notes-generator', { preset, parserOpts, writerOpts, presetConfig }, ]; const changelogPlugin = [ '@semantic-release/changelog', { changelogFile: 'changelog.md', changelogTitle: '# Changelog\n\nAll notable changes to this project will be documented in this file.\nThis project adheres to [Semantic Versioning](https://semver.org) and [Conventional Commits](https://www.conventionalcommits.org) for commit guidelines.\n\n', }, ]; const npmPlugin = '@semantic-release/npm'; const vscePlugin = ['semantic-release-vsce', { packageVsix: true }]; const gitPlugin = [ '@semantic-release/git', { message: 'chore(release): publish <%= nextRelease.gitTag %> ๐Ÿ“ฆ๐Ÿš€\n\n[skip ci]', assets: [ 'changelog.md', 'package.json', 'package-lock.json', 'npm-shrinkwrap.json', 'yarn.lock', ], }, ]; const githubPlugin = '@semantic-release/github'; const githubVSCEPlugin = [ '@semantic-release/github', { assets: '*.vsix' }, ]; const plugins = [ commitAnalyzerPlugin, releaseNotesGeneratorPlugin, changelogPlugin, npmPlugin, gitPlugin, githubPlugin, ]; exports.plugins = plugins; const vscePlugins = [ commitAnalyzerPlugin, releaseNotesGeneratorPlugin, changelogPlugin, vscePlugin, gitPlugin, githubVSCEPlugin, ]; exports.vscePlugins = vscePlugins;