chore: bump conventional-changelog-angular version
Some checks failed
/ test (push) Failing after 15s
Some checks failed
/ test (push) Failing after 15s
This commit is contained in:
parent
b013d20808
commit
f24bc45b25
367
dist/index.js
vendored
367
dist/index.js
vendored
@ -1,7 +1,7 @@
|
||||
import require$$0 from 'os';
|
||||
import require$$0$1 from 'crypto';
|
||||
import require$$1 from 'fs';
|
||||
import require$$1$4 from 'path';
|
||||
import require$$1$4, { resolve } from 'path';
|
||||
import require$$2$1 from 'http';
|
||||
import require$$3$1 from 'https';
|
||||
import require$$0$4 from 'net';
|
||||
@ -21,12 +21,13 @@ import require$$2$2 from 'perf_hooks';
|
||||
import require$$5 from 'util/types';
|
||||
import require$$4$2 from 'async_hooks';
|
||||
import require$$1$2 from 'console';
|
||||
import require$$1$3 from 'url';
|
||||
import require$$1$3, { fileURLToPath } from 'url';
|
||||
import require$$3$2 from 'zlib';
|
||||
import require$$6 from 'string_decoder';
|
||||
import require$$0$9 from 'diagnostics_channel';
|
||||
import require$$2$3 from 'child_process';
|
||||
import require$$6$1 from 'timers';
|
||||
import { readFile } from 'fs/promises';
|
||||
import { spawnSync } from 'node:child_process';
|
||||
|
||||
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
||||
@ -34479,34 +34480,20 @@ function requireConventionalCommitsParser () {
|
||||
|
||||
var conventionalCommitsParserExports = requireConventionalCommitsParser();
|
||||
|
||||
var parserOpts = {};
|
||||
|
||||
var hasRequiredParserOpts;
|
||||
|
||||
function requireParserOpts () {
|
||||
if (hasRequiredParserOpts) return parserOpts;
|
||||
hasRequiredParserOpts = 1;
|
||||
|
||||
function createParserOpts () {
|
||||
return {
|
||||
headerPattern: /^(\w*)(?:\((.*)\))?: (.*)$/,
|
||||
headerCorrespondence: [
|
||||
'type',
|
||||
'scope',
|
||||
'subject'
|
||||
],
|
||||
noteKeywords: ['BREAKING CHANGE'],
|
||||
revertPattern: /^(?:Revert|revert:)\s"?([\s\S]+?)"?\s*This reverts commit (\w*)\./i,
|
||||
revertCorrespondence: ['header', 'hash']
|
||||
}
|
||||
}
|
||||
|
||||
parserOpts.createParserOpts = createParserOpts;
|
||||
return parserOpts;
|
||||
function createParserOpts () {
|
||||
return {
|
||||
headerPattern: /^(\w*)(?:\((.*)\))?: (.*)$/,
|
||||
headerCorrespondence: [
|
||||
'type',
|
||||
'scope',
|
||||
'subject'
|
||||
],
|
||||
noteKeywords: ['BREAKING CHANGE'],
|
||||
revertPattern: /^(?:Revert|revert:)\s"?([\s\S]+?)"?\s*This reverts commit (\w{7,40})\b/i,
|
||||
revertCorrespondence: ['header', 'hash']
|
||||
}
|
||||
}
|
||||
|
||||
var writerOpts = {};
|
||||
|
||||
var arrayIfy;
|
||||
var hasRequiredArrayIfy;
|
||||
|
||||
@ -34733,220 +34720,154 @@ function requireCompareFunc () {
|
||||
return compareFunc_1;
|
||||
}
|
||||
|
||||
var hasRequiredWriterOpts;
|
||||
var compareFuncExports = requireCompareFunc();
|
||||
var compareFunc = /*@__PURE__*/getDefaultExportFromCjs(compareFuncExports);
|
||||
|
||||
function requireWriterOpts () {
|
||||
if (hasRequiredWriterOpts) return writerOpts;
|
||||
hasRequiredWriterOpts = 1;
|
||||
const dirname = fileURLToPath(new URL('.', import.meta.url));
|
||||
|
||||
const compareFunc = requireCompareFunc();
|
||||
const { readFile } = require$$1.promises;
|
||||
const { resolve } = require$$1$4;
|
||||
async function createWriterOpts () {
|
||||
const [template, header, commit, footer] = await Promise.all([
|
||||
readFile(resolve(dirname, './templates/template.hbs'), 'utf-8'),
|
||||
readFile(resolve(dirname, './templates/header.hbs'), 'utf-8'),
|
||||
readFile(resolve(dirname, './templates/commit.hbs'), 'utf-8'),
|
||||
readFile(resolve(dirname, './templates/footer.hbs'), 'utf-8')
|
||||
]);
|
||||
const writerOpts = getWriterOpts();
|
||||
|
||||
async function createWriterOpts () {
|
||||
const [template, header, commit, footer] = await Promise.all([
|
||||
readFile(resolve(__dirname, './templates/template.hbs'), 'utf-8'),
|
||||
readFile(resolve(__dirname, './templates/header.hbs'), 'utf-8'),
|
||||
readFile(resolve(__dirname, './templates/commit.hbs'), 'utf-8'),
|
||||
readFile(resolve(__dirname, './templates/footer.hbs'), 'utf-8')
|
||||
]);
|
||||
const writerOpts = getWriterOpts();
|
||||
writerOpts.mainTemplate = template;
|
||||
writerOpts.headerPartial = header;
|
||||
writerOpts.commitPartial = commit;
|
||||
writerOpts.footerPartial = footer;
|
||||
|
||||
writerOpts.mainTemplate = template;
|
||||
writerOpts.headerPartial = header;
|
||||
writerOpts.commitPartial = commit;
|
||||
writerOpts.footerPartial = footer;
|
||||
|
||||
return writerOpts
|
||||
}
|
||||
|
||||
writerOpts.createWriterOpts = createWriterOpts;
|
||||
|
||||
function getWriterOpts () {
|
||||
return {
|
||||
transform: (commit, context) => {
|
||||
let discard = true;
|
||||
const issues = [];
|
||||
|
||||
commit.notes.forEach(note => {
|
||||
note.title = 'BREAKING CHANGES';
|
||||
discard = false;
|
||||
});
|
||||
|
||||
if (commit.type === 'feat') {
|
||||
commit.type = 'Features';
|
||||
} else if (commit.type === 'fix') {
|
||||
commit.type = 'Bug Fixes';
|
||||
} else if (commit.type === 'perf') {
|
||||
commit.type = 'Performance Improvements';
|
||||
} else if (commit.type === 'revert' || commit.revert) {
|
||||
commit.type = 'Reverts';
|
||||
} else if (discard) {
|
||||
return
|
||||
} else if (commit.type === 'docs') {
|
||||
commit.type = 'Documentation';
|
||||
} else if (commit.type === 'style') {
|
||||
commit.type = 'Styles';
|
||||
} else if (commit.type === 'refactor') {
|
||||
commit.type = 'Code Refactoring';
|
||||
} else if (commit.type === 'test') {
|
||||
commit.type = 'Tests';
|
||||
} else if (commit.type === 'build') {
|
||||
commit.type = 'Build System';
|
||||
} else if (commit.type === 'ci') {
|
||||
commit.type = 'Continuous Integration';
|
||||
}
|
||||
|
||||
if (commit.scope === '*') {
|
||||
commit.scope = '';
|
||||
}
|
||||
|
||||
if (typeof commit.hash === 'string') {
|
||||
commit.shortHash = commit.hash.substring(0, 7);
|
||||
}
|
||||
|
||||
if (typeof commit.subject === 'string') {
|
||||
let url = context.repository
|
||||
? `${context.host}/${context.owner}/${context.repository}`
|
||||
: context.repoUrl;
|
||||
if (url) {
|
||||
url = `${url}/issues/`;
|
||||
// Issue URLs.
|
||||
commit.subject = commit.subject.replace(/#([0-9]+)/g, (_, issue) => {
|
||||
issues.push(issue);
|
||||
return `[#${issue}](${url}${issue})`
|
||||
});
|
||||
}
|
||||
if (context.host) {
|
||||
// User URLs.
|
||||
commit.subject = commit.subject.replace(/\B@([a-z0-9](?:-?[a-z0-9/]){0,38})/g, (_, username) => {
|
||||
if (username.includes('/')) {
|
||||
return `@${username}`
|
||||
}
|
||||
|
||||
return `[@${username}](${context.host}/${username})`
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// remove references that already appear in the subject
|
||||
commit.references = commit.references.filter(reference => {
|
||||
if (issues.indexOf(reference.issue) === -1) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
});
|
||||
|
||||
return commit
|
||||
},
|
||||
groupBy: 'type',
|
||||
commitGroupsSort: 'title',
|
||||
commitsSort: ['scope', 'subject'],
|
||||
noteGroupsSort: 'title',
|
||||
notesSort: compareFunc
|
||||
}
|
||||
}
|
||||
return writerOpts;
|
||||
return writerOpts
|
||||
}
|
||||
|
||||
var conventionalChangelog = {};
|
||||
function getWriterOpts () {
|
||||
return {
|
||||
transform: (commit, context) => {
|
||||
let discard = true;
|
||||
const notes = commit.notes.map(note => {
|
||||
discard = false;
|
||||
|
||||
var hasRequiredConventionalChangelog;
|
||||
return {
|
||||
...note,
|
||||
title: 'BREAKING CHANGES'
|
||||
}
|
||||
});
|
||||
|
||||
function requireConventionalChangelog () {
|
||||
if (hasRequiredConventionalChangelog) return conventionalChangelog;
|
||||
hasRequiredConventionalChangelog = 1;
|
||||
let type = commit.type;
|
||||
|
||||
function createConventionalChangelogOpts (parserOpts, writerOpts) {
|
||||
return {
|
||||
parserOpts,
|
||||
writerOpts
|
||||
}
|
||||
}
|
||||
if (commit.type === 'feat') {
|
||||
type = 'Features';
|
||||
} else if (commit.type === 'fix') {
|
||||
type = 'Bug Fixes';
|
||||
} else if (commit.type === 'perf') {
|
||||
type = 'Performance Improvements';
|
||||
} else if (commit.type === 'revert' || commit.revert) {
|
||||
type = 'Reverts';
|
||||
} else if (discard) {
|
||||
return
|
||||
} else if (commit.type === 'docs') {
|
||||
type = 'Documentation';
|
||||
} else if (commit.type === 'style') {
|
||||
type = 'Styles';
|
||||
} else if (commit.type === 'refactor') {
|
||||
type = 'Code Refactoring';
|
||||
} else if (commit.type === 'test') {
|
||||
type = 'Tests';
|
||||
} else if (commit.type === 'build') {
|
||||
type = 'Build System';
|
||||
} else if (commit.type === 'ci') {
|
||||
type = 'Continuous Integration';
|
||||
}
|
||||
|
||||
conventionalChangelog.createConventionalChangelogOpts = createConventionalChangelogOpts;
|
||||
return conventionalChangelog;
|
||||
const scope = commit.scope === '*' ? '' : commit.scope;
|
||||
const shortHash = typeof commit.hash === 'string'
|
||||
? commit.hash.substring(0, 7)
|
||||
: commit.shortHash;
|
||||
|
||||
const issues = [];
|
||||
let subject = commit.subject;
|
||||
|
||||
if (typeof subject === 'string') {
|
||||
let url = context.repository
|
||||
? `${context.host}/${context.owner}/${context.repository}`
|
||||
: context.repoUrl;
|
||||
if (url) {
|
||||
url = `${url}/issues/`;
|
||||
// Issue URLs.
|
||||
subject = subject.replace(/#([0-9]+)/g, (_, issue) => {
|
||||
issues.push(issue);
|
||||
return `[#${issue}](${url}${issue})`
|
||||
});
|
||||
}
|
||||
if (context.host) {
|
||||
// User URLs.
|
||||
subject = subject.replace(/\B@([a-z0-9](?:-?[a-z0-9/]){0,38})/g, (_, username) => {
|
||||
if (username.includes('/')) {
|
||||
return `@${username}`
|
||||
}
|
||||
|
||||
return `[@${username}](${context.host}/${username})`
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// remove references that already appear in the subject
|
||||
const references = commit.references.filter(reference => !issues.includes(reference.issue));
|
||||
|
||||
return {
|
||||
notes,
|
||||
type,
|
||||
scope,
|
||||
shortHash,
|
||||
subject,
|
||||
references
|
||||
}
|
||||
},
|
||||
groupBy: 'type',
|
||||
commitGroupsSort: 'title',
|
||||
commitsSort: ['scope', 'subject'],
|
||||
noteGroupsSort: 'title',
|
||||
notesSort: compareFunc
|
||||
}
|
||||
}
|
||||
|
||||
var conventionalRecommendedBump = {};
|
||||
function whatBump (commits) {
|
||||
let level = 2;
|
||||
let breakings = 0;
|
||||
let features = 0;
|
||||
|
||||
var hasRequiredConventionalRecommendedBump;
|
||||
commits.forEach(commit => {
|
||||
if (commit.notes.length > 0) {
|
||||
breakings += commit.notes.length;
|
||||
level = 0;
|
||||
} else if (commit.type === 'feat') {
|
||||
features += 1;
|
||||
if (level === 2) {
|
||||
level = 1;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
function requireConventionalRecommendedBump () {
|
||||
if (hasRequiredConventionalRecommendedBump) return conventionalRecommendedBump;
|
||||
hasRequiredConventionalRecommendedBump = 1;
|
||||
|
||||
function createConventionalRecommendedBumpOpts (parserOpts) {
|
||||
return {
|
||||
parserOpts,
|
||||
|
||||
whatBump (commits) {
|
||||
let level = 2;
|
||||
let breakings = 0;
|
||||
let features = 0;
|
||||
|
||||
commits.forEach(commit => {
|
||||
if (commit.notes.length > 0) {
|
||||
breakings += commit.notes.length;
|
||||
level = 0;
|
||||
} else if (commit.type === 'feat') {
|
||||
features += 1;
|
||||
if (level === 2) {
|
||||
level = 1;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return {
|
||||
level,
|
||||
reason: breakings === 1
|
||||
? `There is ${breakings} BREAKING CHANGE and ${features} features`
|
||||
: `There are ${breakings} BREAKING CHANGES and ${features} features`
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
conventionalRecommendedBump.createConventionalRecommendedBumpOpts = createConventionalRecommendedBumpOpts;
|
||||
return conventionalRecommendedBump;
|
||||
return {
|
||||
level,
|
||||
reason: breakings === 1
|
||||
? `There is ${breakings} BREAKING CHANGE and ${features} features`
|
||||
: `There are ${breakings} BREAKING CHANGES and ${features} features`
|
||||
}
|
||||
}
|
||||
|
||||
var conventionalChangelogAngular;
|
||||
var hasRequiredConventionalChangelogAngular;
|
||||
|
||||
function requireConventionalChangelogAngular () {
|
||||
if (hasRequiredConventionalChangelogAngular) return conventionalChangelogAngular;
|
||||
hasRequiredConventionalChangelogAngular = 1;
|
||||
|
||||
const { createParserOpts } = requireParserOpts();
|
||||
const { createWriterOpts } = requireWriterOpts();
|
||||
const { createConventionalChangelogOpts } = requireConventionalChangelog();
|
||||
const { createConventionalRecommendedBumpOpts } = requireConventionalRecommendedBump();
|
||||
|
||||
async function createPreset () {
|
||||
const parserOpts = createParserOpts();
|
||||
const writerOpts = await createWriterOpts();
|
||||
const recommendedBumpOpts = createConventionalRecommendedBumpOpts(parserOpts);
|
||||
const conventionalChangelog = createConventionalChangelogOpts(parserOpts, writerOpts);
|
||||
|
||||
return {
|
||||
parserOpts,
|
||||
writerOpts,
|
||||
recommendedBumpOpts,
|
||||
conventionalChangelog
|
||||
}
|
||||
}
|
||||
|
||||
conventionalChangelogAngular = createPreset;
|
||||
return conventionalChangelogAngular;
|
||||
async function createPreset () {
|
||||
return {
|
||||
parser: createParserOpts(),
|
||||
writer: await createWriterOpts(),
|
||||
whatBump
|
||||
}
|
||||
}
|
||||
|
||||
var conventionalChangelogAngularExports = requireConventionalChangelogAngular();
|
||||
var defaultChangelogOpts = /*@__PURE__*/getDefaultExportFromCjs(conventionalChangelogAngularExports);
|
||||
|
||||
async function parse(message, parser = conventionalCommitsParserExports.sync, parserOpts) {
|
||||
const preset = await defaultChangelogOpts();
|
||||
const preset = await createPreset();
|
||||
const defaultOpts = preset.parserOpts;
|
||||
const opts = {
|
||||
...defaultOpts,
|
||||
|
||||
2
dist/index.js.map
vendored
2
dist/index.js.map
vendored
File diff suppressed because one or more lines are too long
10
package-lock.json
generated
10
package-lock.json
generated
@ -130,7 +130,7 @@
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@commitlint/types": "^19.8.1",
|
||||
"conventional-changelog-angular": "^7.0.0",
|
||||
"conventional-changelog-angular": "^8.0.0",
|
||||
"conventional-commits-parser": "^5.0.0"
|
||||
},
|
||||
"engines": {
|
||||
@ -777,15 +777,15 @@
|
||||
}
|
||||
},
|
||||
"node_modules/conventional-changelog-angular": {
|
||||
"version": "7.0.0",
|
||||
"resolved": "https://registry.npmjs.org/conventional-changelog-angular/-/conventional-changelog-angular-7.0.0.tgz",
|
||||
"integrity": "sha512-ROjNchA9LgfNMTTFSIWPzebCwOGFdgkEq45EnvvrmSLvCtAw0HSmrCs7/ty+wAeYUZyNay0YMUNYFTRL72PkBQ==",
|
||||
"version": "8.0.0",
|
||||
"resolved": "https://registry.npmjs.org/conventional-changelog-angular/-/conventional-changelog-angular-8.0.0.tgz",
|
||||
"integrity": "sha512-CLf+zr6St0wIxos4bmaKHRXWAcsCXrJU6F4VdNDrGRK3B8LDLKoX3zuMV5GhtbGkVR/LohZ6MT6im43vZLSjmA==",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"compare-func": "^2.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=16"
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/conventional-commits-parser": {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user