@hyperfrontend/versioning 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/README.md +8 -6
- package/changelog/index.cjs.js +15 -4
- package/changelog/index.cjs.js.map +1 -1
- package/changelog/index.esm.js +15 -4
- package/changelog/index.esm.js.map +1 -1
- package/changelog/parse/index.cjs.js +62 -4
- package/changelog/parse/index.cjs.js.map +1 -1
- package/changelog/parse/index.esm.js +62 -4
- package/changelog/parse/index.esm.js.map +1 -1
- package/changelog/parse/parser.d.ts +0 -6
- package/changelog/parse/parser.d.ts.map +1 -1
- package/commits/classify/index.cjs.js +8 -6
- package/commits/classify/index.cjs.js.map +1 -1
- package/commits/classify/index.d.ts +1 -1
- package/commits/classify/index.d.ts.map +1 -1
- package/commits/classify/index.esm.js +8 -7
- package/commits/classify/index.esm.js.map +1 -1
- package/commits/classify/project-scopes.d.ts +10 -0
- package/commits/classify/project-scopes.d.ts.map +1 -1
- package/commits/index.cjs.js +8 -6
- package/commits/index.cjs.js.map +1 -1
- package/commits/index.esm.js +8 -7
- package/commits/index.esm.js.map +1 -1
- package/flow/executor/index.cjs.js +12 -0
- package/flow/executor/index.cjs.js.map +1 -1
- package/flow/executor/index.esm.js +12 -0
- package/flow/executor/index.esm.js.map +1 -1
- package/flow/index.cjs.js +89 -36
- package/flow/index.cjs.js.map +1 -1
- package/flow/index.esm.js +88 -37
- package/flow/index.esm.js.map +1 -1
- package/flow/models/index.cjs.js +13 -0
- package/flow/models/index.cjs.js.map +1 -1
- package/flow/models/index.d.ts +1 -1
- package/flow/models/index.d.ts.map +1 -1
- package/flow/models/index.esm.js +13 -1
- package/flow/models/index.esm.js.map +1 -1
- package/flow/models/types.d.ts +33 -1
- package/flow/models/types.d.ts.map +1 -1
- package/flow/presets/index.cjs.js +84 -36
- package/flow/presets/index.cjs.js.map +1 -1
- package/flow/presets/index.esm.js +84 -36
- package/flow/presets/index.esm.js.map +1 -1
- package/flow/steps/analyze-commits.d.ts.map +1 -1
- package/flow/steps/generate-changelog.d.ts +5 -0
- package/flow/steps/generate-changelog.d.ts.map +1 -1
- package/flow/steps/index.cjs.js +85 -36
- package/flow/steps/index.cjs.js.map +1 -1
- package/flow/steps/index.d.ts +1 -1
- package/flow/steps/index.d.ts.map +1 -1
- package/flow/steps/index.esm.js +85 -37
- package/flow/steps/index.esm.js.map +1 -1
- package/index.cjs.js +9223 -9172
- package/index.cjs.js.map +1 -1
- package/index.d.ts +3 -1
- package/index.d.ts.map +1 -1
- package/index.esm.js +9220 -9173
- package/index.esm.js.map +1 -1
- package/package.json +14 -1
- package/workspace/discovery/changelog-path.d.ts +3 -7
- package/workspace/discovery/changelog-path.d.ts.map +1 -1
- package/workspace/discovery/index.cjs.js +84 -5
- package/workspace/discovery/index.cjs.js.map +1 -1
- package/workspace/discovery/index.esm.js +84 -5
- package/workspace/discovery/index.esm.js.map +1 -1
- package/workspace/index.cjs.js +84 -5
- package/workspace/index.cjs.js.map +1 -1
- package/workspace/index.esm.js +84 -5
- package/workspace/index.esm.js.map +1 -1
package/flow/index.cjs.js
CHANGED
|
@@ -137,12 +137,12 @@ const createSet = (iterable) => _Reflect$4.construct(_Set, iterable ? [iterable]
|
|
|
137
137
|
* // Returns: ['app-demo', 'demo']
|
|
138
138
|
*/
|
|
139
139
|
function deriveProjectScopes(options) {
|
|
140
|
-
const { projectName, packageName, additionalScopes = [] } = options;
|
|
140
|
+
const { projectName, packageName, additionalScopes = [], prefixes = DEFAULT_PROJECT_PREFIXES } = options;
|
|
141
141
|
const scopes = createSet();
|
|
142
142
|
// Always include the full project name
|
|
143
143
|
scopes.add(projectName);
|
|
144
144
|
// Add variations based on common prefixes
|
|
145
|
-
const prefixVariations = extractPrefixVariations(projectName);
|
|
145
|
+
const prefixVariations = extractPrefixVariations(projectName, prefixes);
|
|
146
146
|
for (const variation of prefixVariations) {
|
|
147
147
|
scopes.add(variation);
|
|
148
148
|
}
|
|
@@ -162,18 +162,19 @@ function deriveProjectScopes(options) {
|
|
|
162
162
|
return [...scopes];
|
|
163
163
|
}
|
|
164
164
|
/**
|
|
165
|
-
*
|
|
165
|
+
* Default project name prefixes that can be stripped for scope matching.
|
|
166
166
|
*/
|
|
167
|
-
const
|
|
167
|
+
const DEFAULT_PROJECT_PREFIXES = ['lib-', 'app-', 'e2e-', 'tool-', 'plugin-', 'feature-', 'package-'];
|
|
168
168
|
/**
|
|
169
169
|
* Generates scope variations by stripping recognized project prefixes.
|
|
170
170
|
*
|
|
171
171
|
* @param projectName - The project name to extract variations from
|
|
172
|
+
* @param prefixes - Prefixes to check and strip
|
|
172
173
|
* @returns Array of scope name variations
|
|
173
174
|
*/
|
|
174
|
-
function extractPrefixVariations(projectName) {
|
|
175
|
+
function extractPrefixVariations(projectName, prefixes) {
|
|
175
176
|
const variations = [];
|
|
176
|
-
for (const prefix of
|
|
177
|
+
for (const prefix of prefixes) {
|
|
177
178
|
if (projectName.startsWith(prefix)) {
|
|
178
179
|
const withoutPrefix = projectName.slice(prefix.length);
|
|
179
180
|
if (withoutPrefix) {
|
|
@@ -593,6 +594,10 @@ function createMatchContext(commit, scope) {
|
|
|
593
594
|
};
|
|
594
595
|
}
|
|
595
596
|
|
|
597
|
+
/**
|
|
598
|
+
* Default changelog filename.
|
|
599
|
+
*/
|
|
600
|
+
const DEFAULT_CHANGELOG_FILENAME = 'CHANGELOG.md';
|
|
596
601
|
/**
|
|
597
602
|
* Default scope filtering configuration.
|
|
598
603
|
*
|
|
@@ -604,6 +609,7 @@ const DEFAULT_SCOPE_FILTERING_CONFIG = {
|
|
|
604
609
|
includeScopes: [],
|
|
605
610
|
excludeScopes: DEFAULT_EXCLUDE_SCOPES,
|
|
606
611
|
trackDependencyChanges: false,
|
|
612
|
+
projectPrefixes: DEFAULT_PROJECT_PREFIXES,
|
|
607
613
|
infrastructure: undefined,
|
|
608
614
|
infrastructureMatcher: undefined,
|
|
609
615
|
};
|
|
@@ -627,8 +633,11 @@ const DEFAULT_FLOW_CONFIG = {
|
|
|
627
633
|
allowPrerelease: false,
|
|
628
634
|
prereleaseId: 'alpha',
|
|
629
635
|
releaseAs: undefined,
|
|
636
|
+
maxCommitFallback: 500,
|
|
630
637
|
repository: undefined,
|
|
631
638
|
scopeFiltering: DEFAULT_SCOPE_FILTERING_CONFIG,
|
|
639
|
+
changelogFileName: DEFAULT_CHANGELOG_FILENAME,
|
|
640
|
+
commitTypeToSection: undefined,
|
|
632
641
|
};
|
|
633
642
|
|
|
634
643
|
/**
|
|
@@ -8187,6 +8196,7 @@ const ANALYZE_COMMITS_STEP_ID = 'analyze-commits';
|
|
|
8187
8196
|
function createAnalyzeCommitsStep() {
|
|
8188
8197
|
return createStep(ANALYZE_COMMITS_STEP_ID, 'Analyze Commits', async (ctx) => {
|
|
8189
8198
|
const { git, projectName, projectRoot, packageName, workspaceRoot, config, logger, state } = ctx;
|
|
8199
|
+
const maxFallback = config.maxCommitFallback ?? 500;
|
|
8190
8200
|
// Use publishedCommit from registry (set by fetch-registry step)
|
|
8191
8201
|
const { publishedCommit, isFirstRelease } = state;
|
|
8192
8202
|
let rawCommits;
|
|
@@ -8203,13 +8213,13 @@ function createAnalyzeCommitsStep() {
|
|
|
8203
8213
|
logger.warn(`Published commit ${publishedCommit.slice(0, 7)} not found in history. ` +
|
|
8204
8214
|
`This may indicate a rebase or force push occurred after publishing v${state.publishedVersion}. ` +
|
|
8205
8215
|
`Falling back to recent commit analysis.`);
|
|
8206
|
-
rawCommits = git.getCommitLog({ maxCount:
|
|
8216
|
+
rawCommits = git.getCommitLog({ maxCount: maxFallback });
|
|
8207
8217
|
// effectiveBaseCommit stays null - no compare URL will be generated
|
|
8208
8218
|
}
|
|
8209
8219
|
}
|
|
8210
8220
|
else {
|
|
8211
8221
|
// First release or no published version
|
|
8212
|
-
rawCommits = git.getCommitLog({ maxCount:
|
|
8222
|
+
rawCommits = git.getCommitLog({ maxCount: maxFallback });
|
|
8213
8223
|
logger.debug(`First release - analyzing up to ${rawCommits.length} commits`);
|
|
8214
8224
|
}
|
|
8215
8225
|
// Get scope filtering configuration
|
|
@@ -8251,7 +8261,7 @@ function createAnalyzeCommitsStep() {
|
|
|
8251
8261
|
const relativePath = getRelativePath(workspaceRoot, projectRoot);
|
|
8252
8262
|
const pathFilteredCommits = effectiveBaseCommit
|
|
8253
8263
|
? git.getCommitsSince(effectiveBaseCommit, { path: relativePath })
|
|
8254
|
-
: git.getCommitLog({ maxCount:
|
|
8264
|
+
: git.getCommitLog({ maxCount: maxFallback, path: relativePath });
|
|
8255
8265
|
fileCommitHashes = createSet(pathFilteredCommits.map((c) => c.hash));
|
|
8256
8266
|
logger.debug(`Found ${fileCommitHashes.size} commits touching ${relativePath}`);
|
|
8257
8267
|
}
|
|
@@ -8260,14 +8270,15 @@ function createAnalyzeCommitsStep() {
|
|
|
8260
8270
|
projectName,
|
|
8261
8271
|
packageName,
|
|
8262
8272
|
additionalScopes: scopeFilteringConfig.includeScopes,
|
|
8273
|
+
prefixes: scopeFilteringConfig.projectPrefixes,
|
|
8263
8274
|
});
|
|
8264
8275
|
logger.debug(`Project scopes: ${projectScopes.join(', ')}`);
|
|
8265
8276
|
// Build infrastructure commit hashes for file-based infrastructure detection
|
|
8266
|
-
const infrastructureCommitHashes = buildInfrastructureCommitHashes(git, effectiveBaseCommit, rawCommits, parsedCommits, scopeFilteringConfig, logger);
|
|
8277
|
+
const infrastructureCommitHashes = buildInfrastructureCommitHashes(git, effectiveBaseCommit, rawCommits, parsedCommits, scopeFilteringConfig, logger, maxFallback);
|
|
8267
8278
|
// Build dependency commit map if tracking is enabled (Phase 4)
|
|
8268
8279
|
let dependencyCommitMap;
|
|
8269
8280
|
if (scopeFilteringConfig.trackDependencyChanges) {
|
|
8270
|
-
dependencyCommitMap = buildDependencyCommitMap(git, workspaceRoot, projectName, effectiveBaseCommit, logger);
|
|
8281
|
+
dependencyCommitMap = buildDependencyCommitMap(git, workspaceRoot, projectName, effectiveBaseCommit, logger, maxFallback);
|
|
8271
8282
|
}
|
|
8272
8283
|
// Create classification context
|
|
8273
8284
|
const classificationContext = createClassificationContext(projectScopes, fileCommitHashes, {
|
|
@@ -8400,9 +8411,10 @@ function buildSummaryMessage(includedCount, totalCount, summary, strategy) {
|
|
|
8400
8411
|
* @param config - Scope filtering configuration
|
|
8401
8412
|
* @param logger - Logger with debug method for output
|
|
8402
8413
|
* @param logger.debug - Debug logging function
|
|
8414
|
+
* @param maxFallback - Maximum commits to query when baseCommit is null
|
|
8403
8415
|
* @returns Set of commit hashes classified as infrastructure
|
|
8404
8416
|
*/
|
|
8405
|
-
function buildInfrastructureCommitHashes(git, baseCommit, rawCommits, parsedCommits, config, logger) {
|
|
8417
|
+
function buildInfrastructureCommitHashes(git, baseCommit, rawCommits, parsedCommits, config, logger, maxFallback) {
|
|
8406
8418
|
// Collect all infrastructure commit hashes
|
|
8407
8419
|
let infraHashes = createSet();
|
|
8408
8420
|
// Method 1: Path-based detection (query git for commits touching infra paths)
|
|
@@ -8411,7 +8423,7 @@ function buildInfrastructureCommitHashes(git, baseCommit, rawCommits, parsedComm
|
|
|
8411
8423
|
for (const infraPath of infraPaths) {
|
|
8412
8424
|
const pathCommits = baseCommit
|
|
8413
8425
|
? git.getCommitsSince(baseCommit, { path: infraPath })
|
|
8414
|
-
: git.getCommitLog({ maxCount:
|
|
8426
|
+
: git.getCommitLog({ maxCount: maxFallback, path: infraPath });
|
|
8415
8427
|
for (const commit of pathCommits) {
|
|
8416
8428
|
infraHashes = infraHashes.add(commit.hash);
|
|
8417
8429
|
}
|
|
@@ -8479,9 +8491,10 @@ function combineMatcher(a, b) {
|
|
|
8479
8491
|
* @param baseCommit - Base commit hash for commit range (null for first release/fallback)
|
|
8480
8492
|
* @param logger - Logger with debug method for output
|
|
8481
8493
|
* @param logger.debug - Debug logging function
|
|
8494
|
+
* @param maxFallback - Maximum commits to query when baseCommit is null
|
|
8482
8495
|
* @returns Map of dependency names to commit hashes touching that dependency
|
|
8483
8496
|
*/
|
|
8484
|
-
function buildDependencyCommitMap(git, workspaceRoot, projectName, baseCommit, logger) {
|
|
8497
|
+
function buildDependencyCommitMap(git, workspaceRoot, projectName, baseCommit, logger, maxFallback) {
|
|
8485
8498
|
let dependencyMap = createMap();
|
|
8486
8499
|
try {
|
|
8487
8500
|
// Discover all projects in workspace using lib-project-scope
|
|
@@ -8506,7 +8519,7 @@ function buildDependencyCommitMap(git, workspaceRoot, projectName, baseCommit, l
|
|
|
8506
8519
|
// Query git for commits touching this dependency's path
|
|
8507
8520
|
const depCommits = baseCommit
|
|
8508
8521
|
? git.getCommitsSince(baseCommit, { path: depRoot })
|
|
8509
|
-
: git.getCommitLog({ maxCount:
|
|
8522
|
+
: git.getCommitLog({ maxCount: maxFallback, path: depRoot });
|
|
8510
8523
|
if (depCommits.length > 0) {
|
|
8511
8524
|
const hashSet = createSet(depCommits.map((c) => c.hash));
|
|
8512
8525
|
dependencyMap = dependencyMap.set(dep.target, hashSet);
|
|
@@ -10147,11 +10160,22 @@ function isWhitespace(char) {
|
|
|
10147
10160
|
}
|
|
10148
10161
|
|
|
10149
10162
|
/**
|
|
10150
|
-
*
|
|
10163
|
+
* Validates that a URL is actually a GitHub URL by parsing it properly.
|
|
10164
|
+
* This prevents SSRF attacks where 'github.com' could appear in path/query.
|
|
10151
10165
|
*
|
|
10152
|
-
*
|
|
10153
|
-
*
|
|
10166
|
+
* @param url - The URL string to validate
|
|
10167
|
+
* @returns True if the URL host is github.com or a subdomain
|
|
10154
10168
|
*/
|
|
10169
|
+
function isGitHubUrl(url) {
|
|
10170
|
+
try {
|
|
10171
|
+
const parsed = createURL(url);
|
|
10172
|
+
// Check that the host is exactly github.com or ends with .github.com
|
|
10173
|
+
return parsed.host === 'github.com' || parsed.host.endsWith('.github.com');
|
|
10174
|
+
}
|
|
10175
|
+
catch {
|
|
10176
|
+
return false;
|
|
10177
|
+
}
|
|
10178
|
+
}
|
|
10155
10179
|
/**
|
|
10156
10180
|
* Parses a changelog markdown string into a Changelog object.
|
|
10157
10181
|
*
|
|
@@ -10219,7 +10243,7 @@ function parseHeader(state) {
|
|
|
10219
10243
|
description.push(`[${token.value}](${nextToken.value})`);
|
|
10220
10244
|
links.push({ label: token.value, url: nextToken.value });
|
|
10221
10245
|
// Try to detect repository URL
|
|
10222
|
-
if (!state.repositoryUrl && nextToken.value
|
|
10246
|
+
if (!state.repositoryUrl && isGitHubUrl(nextToken.value)) {
|
|
10223
10247
|
state.repositoryUrl = extractRepoUrl(nextToken.value);
|
|
10224
10248
|
}
|
|
10225
10249
|
advance(state); // skip link-text
|
|
@@ -11021,7 +11045,7 @@ const GENERATE_CHANGELOG_STEP_ID = 'generate-changelog';
|
|
|
11021
11045
|
/**
|
|
11022
11046
|
* Maps conventional commit types to changelog section types.
|
|
11023
11047
|
*/
|
|
11024
|
-
const
|
|
11048
|
+
const DEFAULT_COMMIT_TYPE_TO_SECTION = {
|
|
11025
11049
|
feat: 'features',
|
|
11026
11050
|
fix: 'fixes',
|
|
11027
11051
|
perf: 'performance',
|
|
@@ -11034,6 +11058,18 @@ const COMMIT_TYPE_TO_SECTION = {
|
|
|
11034
11058
|
chore: 'chores',
|
|
11035
11059
|
style: 'other',
|
|
11036
11060
|
};
|
|
11061
|
+
/**
|
|
11062
|
+
* Resolves the commit type to section mapping by merging config with defaults.
|
|
11063
|
+
*
|
|
11064
|
+
* @param configMapping - User-provided partial mapping from FlowConfig
|
|
11065
|
+
* @returns Resolved mapping with user overrides applied
|
|
11066
|
+
*/
|
|
11067
|
+
function resolveCommitTypeMapping(configMapping) {
|
|
11068
|
+
if (!configMapping) {
|
|
11069
|
+
return DEFAULT_COMMIT_TYPE_TO_SECTION;
|
|
11070
|
+
}
|
|
11071
|
+
return { ...DEFAULT_COMMIT_TYPE_TO_SECTION, ...configMapping };
|
|
11072
|
+
}
|
|
11037
11073
|
/**
|
|
11038
11074
|
* Checks if a commit source represents an indirect change.
|
|
11039
11075
|
*
|
|
@@ -11047,16 +11083,22 @@ function isIndirectSource(source) {
|
|
|
11047
11083
|
* Groups classified commits by their section type.
|
|
11048
11084
|
*
|
|
11049
11085
|
* @param commits - Array of classified commits
|
|
11086
|
+
* @param mapping - Commit type to section mapping
|
|
11050
11087
|
* @returns Record of section type to classified commits
|
|
11051
11088
|
*/
|
|
11052
|
-
function groupClassifiedCommitsBySection(commits) {
|
|
11089
|
+
function groupClassifiedCommitsBySection(commits, mapping) {
|
|
11053
11090
|
const groups = {};
|
|
11054
11091
|
for (const classified of commits) {
|
|
11055
|
-
const sectionType =
|
|
11056
|
-
if (
|
|
11057
|
-
|
|
11092
|
+
const sectionType = mapping[classified.commit.type ?? 'chore'];
|
|
11093
|
+
// Skip if explicitly excluded (null)
|
|
11094
|
+
if (sectionType === null)
|
|
11095
|
+
continue;
|
|
11096
|
+
// Fallback to 'chores' for unmapped types
|
|
11097
|
+
const resolvedSection = sectionType ?? 'chores';
|
|
11098
|
+
if (!groups[resolvedSection]) {
|
|
11099
|
+
groups[resolvedSection] = [];
|
|
11058
11100
|
}
|
|
11059
|
-
groups[
|
|
11101
|
+
groups[resolvedSection].push(classified);
|
|
11060
11102
|
}
|
|
11061
11103
|
return groups;
|
|
11062
11104
|
}
|
|
@@ -11064,16 +11106,22 @@ function groupClassifiedCommitsBySection(commits) {
|
|
|
11064
11106
|
* Groups commits by their section type.
|
|
11065
11107
|
*
|
|
11066
11108
|
* @param commits - Array of conventional commits
|
|
11109
|
+
* @param mapping - Commit type to section mapping
|
|
11067
11110
|
* @returns Record of section type to commits
|
|
11068
11111
|
*/
|
|
11069
|
-
function groupCommitsBySection(commits) {
|
|
11112
|
+
function groupCommitsBySection(commits, mapping) {
|
|
11070
11113
|
const groups = {};
|
|
11071
11114
|
for (const commit of commits) {
|
|
11072
|
-
const sectionType =
|
|
11073
|
-
if (
|
|
11074
|
-
|
|
11115
|
+
const sectionType = mapping[commit.type ?? 'chore'];
|
|
11116
|
+
// Skip if explicitly excluded (null)
|
|
11117
|
+
if (sectionType === null)
|
|
11118
|
+
continue;
|
|
11119
|
+
// Fallback to 'chores' for unmapped types
|
|
11120
|
+
const resolvedSection = sectionType ?? 'chores';
|
|
11121
|
+
if (!groups[resolvedSection]) {
|
|
11122
|
+
groups[resolvedSection] = [];
|
|
11075
11123
|
}
|
|
11076
|
-
groups[
|
|
11124
|
+
groups[resolvedSection].push(commit);
|
|
11077
11125
|
}
|
|
11078
11126
|
return groups;
|
|
11079
11127
|
}
|
|
@@ -11141,6 +11189,8 @@ function createGenerateChangelogStep() {
|
|
|
11141
11189
|
return createStep(GENERATE_CHANGELOG_STEP_ID, 'Generate Changelog Entry', async (ctx) => {
|
|
11142
11190
|
const { config, state } = ctx;
|
|
11143
11191
|
const { commits, nextVersion, bumpType } = state;
|
|
11192
|
+
// Resolve commit type to section mapping
|
|
11193
|
+
const commitTypeMapping = resolveCommitTypeMapping(config.commitTypeToSection);
|
|
11144
11194
|
// Skip if no bump needed
|
|
11145
11195
|
if (!nextVersion || bumpType === 'none') {
|
|
11146
11196
|
return createSkippedResult('No version bump, skipping changelog generation');
|
|
@@ -11202,7 +11252,7 @@ function createGenerateChangelogStep() {
|
|
|
11202
11252
|
})));
|
|
11203
11253
|
}
|
|
11204
11254
|
// Group direct commits by section
|
|
11205
|
-
const groupedDirect = groupClassifiedCommitsBySection(directCommits);
|
|
11255
|
+
const groupedDirect = groupClassifiedCommitsBySection(directCommits, commitTypeMapping);
|
|
11206
11256
|
// Add other sections in conventional order (direct commits only)
|
|
11207
11257
|
const sectionOrder = [
|
|
11208
11258
|
{ type: 'features', heading: 'Features' },
|
|
@@ -11230,7 +11280,7 @@ function createGenerateChangelogStep() {
|
|
|
11230
11280
|
}
|
|
11231
11281
|
else {
|
|
11232
11282
|
// Fallback: use commits without classification (backward compatibility)
|
|
11233
|
-
const grouped = groupCommitsBySection(commits);
|
|
11283
|
+
const grouped = groupCommitsBySection(commits, commitTypeMapping);
|
|
11234
11284
|
// Add breaking changes section first if any
|
|
11235
11285
|
const breakingCommits = commits.filter((c) => c.breaking);
|
|
11236
11286
|
if (breakingCommits.length > 0) {
|
|
@@ -11306,14 +11356,15 @@ function createWriteChangelogStep() {
|
|
|
11306
11356
|
if (!nextVersion || bumpType === 'none' || !changelogEntry || config.skipChangelog) {
|
|
11307
11357
|
return createSkippedResult('No changelog to write');
|
|
11308
11358
|
}
|
|
11309
|
-
const
|
|
11359
|
+
const changelogFileName = config.changelogFileName ?? DEFAULT_CHANGELOG_FILENAME;
|
|
11360
|
+
const changelogPath = `${projectRoot}/${changelogFileName}`;
|
|
11310
11361
|
let existingContent = '';
|
|
11311
11362
|
// Read existing changelog
|
|
11312
11363
|
try {
|
|
11313
11364
|
existingContent = tree.read(changelogPath, 'utf-8') ?? '';
|
|
11314
11365
|
}
|
|
11315
11366
|
catch {
|
|
11316
|
-
logger.debug(
|
|
11367
|
+
logger.debug(`No existing ${changelogFileName} found`);
|
|
11317
11368
|
}
|
|
11318
11369
|
// If no existing content, create new changelog
|
|
11319
11370
|
if (!existingContent.trim()) {
|
|
@@ -11331,7 +11382,7 @@ function createWriteChangelogStep() {
|
|
|
11331
11382
|
stateUpdates: {
|
|
11332
11383
|
modifiedFiles: [...(state.modifiedFiles ?? []), changelogPath],
|
|
11333
11384
|
},
|
|
11334
|
-
message: `Created
|
|
11385
|
+
message: `Created ${changelogFileName} with version ${nextVersion}`,
|
|
11335
11386
|
};
|
|
11336
11387
|
}
|
|
11337
11388
|
// Parse existing and add entry
|
|
@@ -11365,7 +11416,7 @@ function createWriteChangelogStep() {
|
|
|
11365
11416
|
stateUpdates: {
|
|
11366
11417
|
modifiedFiles: [...(state.modifiedFiles ?? []), changelogPath],
|
|
11367
11418
|
},
|
|
11368
|
-
message: `Updated
|
|
11419
|
+
message: `Updated ${changelogFileName} with version ${nextVersion}`,
|
|
11369
11420
|
};
|
|
11370
11421
|
}, {
|
|
11371
11422
|
dependsOn: ['generate-changelog'],
|
|
@@ -12210,6 +12261,8 @@ exports.CALCULATE_BUMP_STEP_ID = CALCULATE_BUMP_STEP_ID;
|
|
|
12210
12261
|
exports.CONVENTIONAL_FLOW_CONFIG = CONVENTIONAL_FLOW_CONFIG;
|
|
12211
12262
|
exports.CREATE_COMMIT_STEP_ID = CREATE_COMMIT_STEP_ID;
|
|
12212
12263
|
exports.CREATE_TAG_STEP_ID = CREATE_TAG_STEP_ID;
|
|
12264
|
+
exports.DEFAULT_CHANGELOG_FILENAME = DEFAULT_CHANGELOG_FILENAME;
|
|
12265
|
+
exports.DEFAULT_COMMIT_TYPE_TO_SECTION = DEFAULT_COMMIT_TYPE_TO_SECTION;
|
|
12213
12266
|
exports.DEFAULT_FLOW_CONFIG = DEFAULT_FLOW_CONFIG;
|
|
12214
12267
|
exports.FETCH_REGISTRY_STEP_ID = FETCH_REGISTRY_STEP_ID;
|
|
12215
12268
|
exports.GENERATE_CHANGELOG_STEP_ID = GENERATE_CHANGELOG_STEP_ID;
|