@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.esm.js
CHANGED
|
@@ -135,12 +135,12 @@ const createSet = (iterable) => _Reflect$4.construct(_Set, iterable ? [iterable]
|
|
|
135
135
|
* // Returns: ['app-demo', 'demo']
|
|
136
136
|
*/
|
|
137
137
|
function deriveProjectScopes(options) {
|
|
138
|
-
const { projectName, packageName, additionalScopes = [] } = options;
|
|
138
|
+
const { projectName, packageName, additionalScopes = [], prefixes = DEFAULT_PROJECT_PREFIXES } = options;
|
|
139
139
|
const scopes = createSet();
|
|
140
140
|
// Always include the full project name
|
|
141
141
|
scopes.add(projectName);
|
|
142
142
|
// Add variations based on common prefixes
|
|
143
|
-
const prefixVariations = extractPrefixVariations(projectName);
|
|
143
|
+
const prefixVariations = extractPrefixVariations(projectName, prefixes);
|
|
144
144
|
for (const variation of prefixVariations) {
|
|
145
145
|
scopes.add(variation);
|
|
146
146
|
}
|
|
@@ -160,18 +160,19 @@ function deriveProjectScopes(options) {
|
|
|
160
160
|
return [...scopes];
|
|
161
161
|
}
|
|
162
162
|
/**
|
|
163
|
-
*
|
|
163
|
+
* Default project name prefixes that can be stripped for scope matching.
|
|
164
164
|
*/
|
|
165
|
-
const
|
|
165
|
+
const DEFAULT_PROJECT_PREFIXES = ['lib-', 'app-', 'e2e-', 'tool-', 'plugin-', 'feature-', 'package-'];
|
|
166
166
|
/**
|
|
167
167
|
* Generates scope variations by stripping recognized project prefixes.
|
|
168
168
|
*
|
|
169
169
|
* @param projectName - The project name to extract variations from
|
|
170
|
+
* @param prefixes - Prefixes to check and strip
|
|
170
171
|
* @returns Array of scope name variations
|
|
171
172
|
*/
|
|
172
|
-
function extractPrefixVariations(projectName) {
|
|
173
|
+
function extractPrefixVariations(projectName, prefixes) {
|
|
173
174
|
const variations = [];
|
|
174
|
-
for (const prefix of
|
|
175
|
+
for (const prefix of prefixes) {
|
|
175
176
|
if (projectName.startsWith(prefix)) {
|
|
176
177
|
const withoutPrefix = projectName.slice(prefix.length);
|
|
177
178
|
if (withoutPrefix) {
|
|
@@ -591,6 +592,10 @@ function createMatchContext(commit, scope) {
|
|
|
591
592
|
};
|
|
592
593
|
}
|
|
593
594
|
|
|
595
|
+
/**
|
|
596
|
+
* Default changelog filename.
|
|
597
|
+
*/
|
|
598
|
+
const DEFAULT_CHANGELOG_FILENAME = 'CHANGELOG.md';
|
|
594
599
|
/**
|
|
595
600
|
* Default scope filtering configuration.
|
|
596
601
|
*
|
|
@@ -602,6 +607,7 @@ const DEFAULT_SCOPE_FILTERING_CONFIG = {
|
|
|
602
607
|
includeScopes: [],
|
|
603
608
|
excludeScopes: DEFAULT_EXCLUDE_SCOPES,
|
|
604
609
|
trackDependencyChanges: false,
|
|
610
|
+
projectPrefixes: DEFAULT_PROJECT_PREFIXES,
|
|
605
611
|
infrastructure: undefined,
|
|
606
612
|
infrastructureMatcher: undefined,
|
|
607
613
|
};
|
|
@@ -625,8 +631,11 @@ const DEFAULT_FLOW_CONFIG = {
|
|
|
625
631
|
allowPrerelease: false,
|
|
626
632
|
prereleaseId: 'alpha',
|
|
627
633
|
releaseAs: undefined,
|
|
634
|
+
maxCommitFallback: 500,
|
|
628
635
|
repository: undefined,
|
|
629
636
|
scopeFiltering: DEFAULT_SCOPE_FILTERING_CONFIG,
|
|
637
|
+
changelogFileName: DEFAULT_CHANGELOG_FILENAME,
|
|
638
|
+
commitTypeToSection: undefined,
|
|
630
639
|
};
|
|
631
640
|
|
|
632
641
|
/**
|
|
@@ -8185,6 +8194,7 @@ const ANALYZE_COMMITS_STEP_ID = 'analyze-commits';
|
|
|
8185
8194
|
function createAnalyzeCommitsStep() {
|
|
8186
8195
|
return createStep(ANALYZE_COMMITS_STEP_ID, 'Analyze Commits', async (ctx) => {
|
|
8187
8196
|
const { git, projectName, projectRoot, packageName, workspaceRoot, config, logger, state } = ctx;
|
|
8197
|
+
const maxFallback = config.maxCommitFallback ?? 500;
|
|
8188
8198
|
// Use publishedCommit from registry (set by fetch-registry step)
|
|
8189
8199
|
const { publishedCommit, isFirstRelease } = state;
|
|
8190
8200
|
let rawCommits;
|
|
@@ -8201,13 +8211,13 @@ function createAnalyzeCommitsStep() {
|
|
|
8201
8211
|
logger.warn(`Published commit ${publishedCommit.slice(0, 7)} not found in history. ` +
|
|
8202
8212
|
`This may indicate a rebase or force push occurred after publishing v${state.publishedVersion}. ` +
|
|
8203
8213
|
`Falling back to recent commit analysis.`);
|
|
8204
|
-
rawCommits = git.getCommitLog({ maxCount:
|
|
8214
|
+
rawCommits = git.getCommitLog({ maxCount: maxFallback });
|
|
8205
8215
|
// effectiveBaseCommit stays null - no compare URL will be generated
|
|
8206
8216
|
}
|
|
8207
8217
|
}
|
|
8208
8218
|
else {
|
|
8209
8219
|
// First release or no published version
|
|
8210
|
-
rawCommits = git.getCommitLog({ maxCount:
|
|
8220
|
+
rawCommits = git.getCommitLog({ maxCount: maxFallback });
|
|
8211
8221
|
logger.debug(`First release - analyzing up to ${rawCommits.length} commits`);
|
|
8212
8222
|
}
|
|
8213
8223
|
// Get scope filtering configuration
|
|
@@ -8249,7 +8259,7 @@ function createAnalyzeCommitsStep() {
|
|
|
8249
8259
|
const relativePath = getRelativePath(workspaceRoot, projectRoot);
|
|
8250
8260
|
const pathFilteredCommits = effectiveBaseCommit
|
|
8251
8261
|
? git.getCommitsSince(effectiveBaseCommit, { path: relativePath })
|
|
8252
|
-
: git.getCommitLog({ maxCount:
|
|
8262
|
+
: git.getCommitLog({ maxCount: maxFallback, path: relativePath });
|
|
8253
8263
|
fileCommitHashes = createSet(pathFilteredCommits.map((c) => c.hash));
|
|
8254
8264
|
logger.debug(`Found ${fileCommitHashes.size} commits touching ${relativePath}`);
|
|
8255
8265
|
}
|
|
@@ -8258,14 +8268,15 @@ function createAnalyzeCommitsStep() {
|
|
|
8258
8268
|
projectName,
|
|
8259
8269
|
packageName,
|
|
8260
8270
|
additionalScopes: scopeFilteringConfig.includeScopes,
|
|
8271
|
+
prefixes: scopeFilteringConfig.projectPrefixes,
|
|
8261
8272
|
});
|
|
8262
8273
|
logger.debug(`Project scopes: ${projectScopes.join(', ')}`);
|
|
8263
8274
|
// Build infrastructure commit hashes for file-based infrastructure detection
|
|
8264
|
-
const infrastructureCommitHashes = buildInfrastructureCommitHashes(git, effectiveBaseCommit, rawCommits, parsedCommits, scopeFilteringConfig, logger);
|
|
8275
|
+
const infrastructureCommitHashes = buildInfrastructureCommitHashes(git, effectiveBaseCommit, rawCommits, parsedCommits, scopeFilteringConfig, logger, maxFallback);
|
|
8265
8276
|
// Build dependency commit map if tracking is enabled (Phase 4)
|
|
8266
8277
|
let dependencyCommitMap;
|
|
8267
8278
|
if (scopeFilteringConfig.trackDependencyChanges) {
|
|
8268
|
-
dependencyCommitMap = buildDependencyCommitMap(git, workspaceRoot, projectName, effectiveBaseCommit, logger);
|
|
8279
|
+
dependencyCommitMap = buildDependencyCommitMap(git, workspaceRoot, projectName, effectiveBaseCommit, logger, maxFallback);
|
|
8269
8280
|
}
|
|
8270
8281
|
// Create classification context
|
|
8271
8282
|
const classificationContext = createClassificationContext(projectScopes, fileCommitHashes, {
|
|
@@ -8398,9 +8409,10 @@ function buildSummaryMessage(includedCount, totalCount, summary, strategy) {
|
|
|
8398
8409
|
* @param config - Scope filtering configuration
|
|
8399
8410
|
* @param logger - Logger with debug method for output
|
|
8400
8411
|
* @param logger.debug - Debug logging function
|
|
8412
|
+
* @param maxFallback - Maximum commits to query when baseCommit is null
|
|
8401
8413
|
* @returns Set of commit hashes classified as infrastructure
|
|
8402
8414
|
*/
|
|
8403
|
-
function buildInfrastructureCommitHashes(git, baseCommit, rawCommits, parsedCommits, config, logger) {
|
|
8415
|
+
function buildInfrastructureCommitHashes(git, baseCommit, rawCommits, parsedCommits, config, logger, maxFallback) {
|
|
8404
8416
|
// Collect all infrastructure commit hashes
|
|
8405
8417
|
let infraHashes = createSet();
|
|
8406
8418
|
// Method 1: Path-based detection (query git for commits touching infra paths)
|
|
@@ -8409,7 +8421,7 @@ function buildInfrastructureCommitHashes(git, baseCommit, rawCommits, parsedComm
|
|
|
8409
8421
|
for (const infraPath of infraPaths) {
|
|
8410
8422
|
const pathCommits = baseCommit
|
|
8411
8423
|
? git.getCommitsSince(baseCommit, { path: infraPath })
|
|
8412
|
-
: git.getCommitLog({ maxCount:
|
|
8424
|
+
: git.getCommitLog({ maxCount: maxFallback, path: infraPath });
|
|
8413
8425
|
for (const commit of pathCommits) {
|
|
8414
8426
|
infraHashes = infraHashes.add(commit.hash);
|
|
8415
8427
|
}
|
|
@@ -8477,9 +8489,10 @@ function combineMatcher(a, b) {
|
|
|
8477
8489
|
* @param baseCommit - Base commit hash for commit range (null for first release/fallback)
|
|
8478
8490
|
* @param logger - Logger with debug method for output
|
|
8479
8491
|
* @param logger.debug - Debug logging function
|
|
8492
|
+
* @param maxFallback - Maximum commits to query when baseCommit is null
|
|
8480
8493
|
* @returns Map of dependency names to commit hashes touching that dependency
|
|
8481
8494
|
*/
|
|
8482
|
-
function buildDependencyCommitMap(git, workspaceRoot, projectName, baseCommit, logger) {
|
|
8495
|
+
function buildDependencyCommitMap(git, workspaceRoot, projectName, baseCommit, logger, maxFallback) {
|
|
8483
8496
|
let dependencyMap = createMap();
|
|
8484
8497
|
try {
|
|
8485
8498
|
// Discover all projects in workspace using lib-project-scope
|
|
@@ -8504,7 +8517,7 @@ function buildDependencyCommitMap(git, workspaceRoot, projectName, baseCommit, l
|
|
|
8504
8517
|
// Query git for commits touching this dependency's path
|
|
8505
8518
|
const depCommits = baseCommit
|
|
8506
8519
|
? git.getCommitsSince(baseCommit, { path: depRoot })
|
|
8507
|
-
: git.getCommitLog({ maxCount:
|
|
8520
|
+
: git.getCommitLog({ maxCount: maxFallback, path: depRoot });
|
|
8508
8521
|
if (depCommits.length > 0) {
|
|
8509
8522
|
const hashSet = createSet(depCommits.map((c) => c.hash));
|
|
8510
8523
|
dependencyMap = dependencyMap.set(dep.target, hashSet);
|
|
@@ -10145,11 +10158,22 @@ function isWhitespace(char) {
|
|
|
10145
10158
|
}
|
|
10146
10159
|
|
|
10147
10160
|
/**
|
|
10148
|
-
*
|
|
10161
|
+
* Validates that a URL is actually a GitHub URL by parsing it properly.
|
|
10162
|
+
* This prevents SSRF attacks where 'github.com' could appear in path/query.
|
|
10149
10163
|
*
|
|
10150
|
-
*
|
|
10151
|
-
*
|
|
10164
|
+
* @param url - The URL string to validate
|
|
10165
|
+
* @returns True if the URL host is github.com or a subdomain
|
|
10152
10166
|
*/
|
|
10167
|
+
function isGitHubUrl(url) {
|
|
10168
|
+
try {
|
|
10169
|
+
const parsed = createURL(url);
|
|
10170
|
+
// Check that the host is exactly github.com or ends with .github.com
|
|
10171
|
+
return parsed.host === 'github.com' || parsed.host.endsWith('.github.com');
|
|
10172
|
+
}
|
|
10173
|
+
catch {
|
|
10174
|
+
return false;
|
|
10175
|
+
}
|
|
10176
|
+
}
|
|
10153
10177
|
/**
|
|
10154
10178
|
* Parses a changelog markdown string into a Changelog object.
|
|
10155
10179
|
*
|
|
@@ -10217,7 +10241,7 @@ function parseHeader(state) {
|
|
|
10217
10241
|
description.push(`[${token.value}](${nextToken.value})`);
|
|
10218
10242
|
links.push({ label: token.value, url: nextToken.value });
|
|
10219
10243
|
// Try to detect repository URL
|
|
10220
|
-
if (!state.repositoryUrl && nextToken.value
|
|
10244
|
+
if (!state.repositoryUrl && isGitHubUrl(nextToken.value)) {
|
|
10221
10245
|
state.repositoryUrl = extractRepoUrl(nextToken.value);
|
|
10222
10246
|
}
|
|
10223
10247
|
advance(state); // skip link-text
|
|
@@ -11019,7 +11043,7 @@ const GENERATE_CHANGELOG_STEP_ID = 'generate-changelog';
|
|
|
11019
11043
|
/**
|
|
11020
11044
|
* Maps conventional commit types to changelog section types.
|
|
11021
11045
|
*/
|
|
11022
|
-
const
|
|
11046
|
+
const DEFAULT_COMMIT_TYPE_TO_SECTION = {
|
|
11023
11047
|
feat: 'features',
|
|
11024
11048
|
fix: 'fixes',
|
|
11025
11049
|
perf: 'performance',
|
|
@@ -11032,6 +11056,18 @@ const COMMIT_TYPE_TO_SECTION = {
|
|
|
11032
11056
|
chore: 'chores',
|
|
11033
11057
|
style: 'other',
|
|
11034
11058
|
};
|
|
11059
|
+
/**
|
|
11060
|
+
* Resolves the commit type to section mapping by merging config with defaults.
|
|
11061
|
+
*
|
|
11062
|
+
* @param configMapping - User-provided partial mapping from FlowConfig
|
|
11063
|
+
* @returns Resolved mapping with user overrides applied
|
|
11064
|
+
*/
|
|
11065
|
+
function resolveCommitTypeMapping(configMapping) {
|
|
11066
|
+
if (!configMapping) {
|
|
11067
|
+
return DEFAULT_COMMIT_TYPE_TO_SECTION;
|
|
11068
|
+
}
|
|
11069
|
+
return { ...DEFAULT_COMMIT_TYPE_TO_SECTION, ...configMapping };
|
|
11070
|
+
}
|
|
11035
11071
|
/**
|
|
11036
11072
|
* Checks if a commit source represents an indirect change.
|
|
11037
11073
|
*
|
|
@@ -11045,16 +11081,22 @@ function isIndirectSource(source) {
|
|
|
11045
11081
|
* Groups classified commits by their section type.
|
|
11046
11082
|
*
|
|
11047
11083
|
* @param commits - Array of classified commits
|
|
11084
|
+
* @param mapping - Commit type to section mapping
|
|
11048
11085
|
* @returns Record of section type to classified commits
|
|
11049
11086
|
*/
|
|
11050
|
-
function groupClassifiedCommitsBySection(commits) {
|
|
11087
|
+
function groupClassifiedCommitsBySection(commits, mapping) {
|
|
11051
11088
|
const groups = {};
|
|
11052
11089
|
for (const classified of commits) {
|
|
11053
|
-
const sectionType =
|
|
11054
|
-
if (
|
|
11055
|
-
|
|
11090
|
+
const sectionType = mapping[classified.commit.type ?? 'chore'];
|
|
11091
|
+
// Skip if explicitly excluded (null)
|
|
11092
|
+
if (sectionType === null)
|
|
11093
|
+
continue;
|
|
11094
|
+
// Fallback to 'chores' for unmapped types
|
|
11095
|
+
const resolvedSection = sectionType ?? 'chores';
|
|
11096
|
+
if (!groups[resolvedSection]) {
|
|
11097
|
+
groups[resolvedSection] = [];
|
|
11056
11098
|
}
|
|
11057
|
-
groups[
|
|
11099
|
+
groups[resolvedSection].push(classified);
|
|
11058
11100
|
}
|
|
11059
11101
|
return groups;
|
|
11060
11102
|
}
|
|
@@ -11062,16 +11104,22 @@ function groupClassifiedCommitsBySection(commits) {
|
|
|
11062
11104
|
* Groups commits by their section type.
|
|
11063
11105
|
*
|
|
11064
11106
|
* @param commits - Array of conventional commits
|
|
11107
|
+
* @param mapping - Commit type to section mapping
|
|
11065
11108
|
* @returns Record of section type to commits
|
|
11066
11109
|
*/
|
|
11067
|
-
function groupCommitsBySection(commits) {
|
|
11110
|
+
function groupCommitsBySection(commits, mapping) {
|
|
11068
11111
|
const groups = {};
|
|
11069
11112
|
for (const commit of commits) {
|
|
11070
|
-
const sectionType =
|
|
11071
|
-
if (
|
|
11072
|
-
|
|
11113
|
+
const sectionType = mapping[commit.type ?? 'chore'];
|
|
11114
|
+
// Skip if explicitly excluded (null)
|
|
11115
|
+
if (sectionType === null)
|
|
11116
|
+
continue;
|
|
11117
|
+
// Fallback to 'chores' for unmapped types
|
|
11118
|
+
const resolvedSection = sectionType ?? 'chores';
|
|
11119
|
+
if (!groups[resolvedSection]) {
|
|
11120
|
+
groups[resolvedSection] = [];
|
|
11073
11121
|
}
|
|
11074
|
-
groups[
|
|
11122
|
+
groups[resolvedSection].push(commit);
|
|
11075
11123
|
}
|
|
11076
11124
|
return groups;
|
|
11077
11125
|
}
|
|
@@ -11139,6 +11187,8 @@ function createGenerateChangelogStep() {
|
|
|
11139
11187
|
return createStep(GENERATE_CHANGELOG_STEP_ID, 'Generate Changelog Entry', async (ctx) => {
|
|
11140
11188
|
const { config, state } = ctx;
|
|
11141
11189
|
const { commits, nextVersion, bumpType } = state;
|
|
11190
|
+
// Resolve commit type to section mapping
|
|
11191
|
+
const commitTypeMapping = resolveCommitTypeMapping(config.commitTypeToSection);
|
|
11142
11192
|
// Skip if no bump needed
|
|
11143
11193
|
if (!nextVersion || bumpType === 'none') {
|
|
11144
11194
|
return createSkippedResult('No version bump, skipping changelog generation');
|
|
@@ -11200,7 +11250,7 @@ function createGenerateChangelogStep() {
|
|
|
11200
11250
|
})));
|
|
11201
11251
|
}
|
|
11202
11252
|
// Group direct commits by section
|
|
11203
|
-
const groupedDirect = groupClassifiedCommitsBySection(directCommits);
|
|
11253
|
+
const groupedDirect = groupClassifiedCommitsBySection(directCommits, commitTypeMapping);
|
|
11204
11254
|
// Add other sections in conventional order (direct commits only)
|
|
11205
11255
|
const sectionOrder = [
|
|
11206
11256
|
{ type: 'features', heading: 'Features' },
|
|
@@ -11228,7 +11278,7 @@ function createGenerateChangelogStep() {
|
|
|
11228
11278
|
}
|
|
11229
11279
|
else {
|
|
11230
11280
|
// Fallback: use commits without classification (backward compatibility)
|
|
11231
|
-
const grouped = groupCommitsBySection(commits);
|
|
11281
|
+
const grouped = groupCommitsBySection(commits, commitTypeMapping);
|
|
11232
11282
|
// Add breaking changes section first if any
|
|
11233
11283
|
const breakingCommits = commits.filter((c) => c.breaking);
|
|
11234
11284
|
if (breakingCommits.length > 0) {
|
|
@@ -11304,14 +11354,15 @@ function createWriteChangelogStep() {
|
|
|
11304
11354
|
if (!nextVersion || bumpType === 'none' || !changelogEntry || config.skipChangelog) {
|
|
11305
11355
|
return createSkippedResult('No changelog to write');
|
|
11306
11356
|
}
|
|
11307
|
-
const
|
|
11357
|
+
const changelogFileName = config.changelogFileName ?? DEFAULT_CHANGELOG_FILENAME;
|
|
11358
|
+
const changelogPath = `${projectRoot}/${changelogFileName}`;
|
|
11308
11359
|
let existingContent = '';
|
|
11309
11360
|
// Read existing changelog
|
|
11310
11361
|
try {
|
|
11311
11362
|
existingContent = tree.read(changelogPath, 'utf-8') ?? '';
|
|
11312
11363
|
}
|
|
11313
11364
|
catch {
|
|
11314
|
-
logger.debug(
|
|
11365
|
+
logger.debug(`No existing ${changelogFileName} found`);
|
|
11315
11366
|
}
|
|
11316
11367
|
// If no existing content, create new changelog
|
|
11317
11368
|
if (!existingContent.trim()) {
|
|
@@ -11329,7 +11380,7 @@ function createWriteChangelogStep() {
|
|
|
11329
11380
|
stateUpdates: {
|
|
11330
11381
|
modifiedFiles: [...(state.modifiedFiles ?? []), changelogPath],
|
|
11331
11382
|
},
|
|
11332
|
-
message: `Created
|
|
11383
|
+
message: `Created ${changelogFileName} with version ${nextVersion}`,
|
|
11333
11384
|
};
|
|
11334
11385
|
}
|
|
11335
11386
|
// Parse existing and add entry
|
|
@@ -11363,7 +11414,7 @@ function createWriteChangelogStep() {
|
|
|
11363
11414
|
stateUpdates: {
|
|
11364
11415
|
modifiedFiles: [...(state.modifiedFiles ?? []), changelogPath],
|
|
11365
11416
|
},
|
|
11366
|
-
message: `Updated
|
|
11417
|
+
message: `Updated ${changelogFileName} with version ${nextVersion}`,
|
|
11367
11418
|
};
|
|
11368
11419
|
}, {
|
|
11369
11420
|
dependsOn: ['generate-changelog'],
|
|
@@ -12203,5 +12254,5 @@ function getPresetDescription(preset) {
|
|
|
12203
12254
|
}
|
|
12204
12255
|
}
|
|
12205
12256
|
|
|
12206
|
-
export { ANALYZE_COMMITS_STEP_ID, CALCULATE_BUMP_STEP_ID, CONVENTIONAL_FLOW_CONFIG, CREATE_COMMIT_STEP_ID, CREATE_TAG_STEP_ID, DEFAULT_FLOW_CONFIG, FETCH_REGISTRY_STEP_ID, GENERATE_CHANGELOG_STEP_ID, INDEPENDENT_FLOW_CONFIG, RESOLVE_REPOSITORY_STEP_ID, SYNCED_FLOW_CONFIG, UPDATE_PACKAGES_STEP_ID, addStep, createAnalyzeCommitsStep, createBatchReleaseFlow, createCalculateBumpStep, createCascadeDependenciesStep, createChangelogOnlyFlow, createCheckDependentBumpsStep, createCheckIdempotencyStep, createCombinedChangelogStep, createConventionalFlow, createDryRunFlow, createFailedResult, createFetchRegistryStep, createFixedVersionFlow, createFlow, createGenerateChangelogStep, createGitCommitStep, createIndependentFlow, createMinimalFlow, createNoopStep, createPushTagStep, createResolveRepositoryStep, createSkippedResult, createStep, createSuccessResult, createSyncAllPackagesStep, createSyncedFlow, createTagStep, createUpdatePackageStep, createVersionFlow, createWriteChangelogStep, dryRun, executeFlow, getAvailablePresets, getPresetDescription, getStep, hasStep, insertStep, insertStepAfter, insertStepBefore, removeStep, replaceStep, validateFlow, withConfig };
|
|
12257
|
+
export { ANALYZE_COMMITS_STEP_ID, CALCULATE_BUMP_STEP_ID, CONVENTIONAL_FLOW_CONFIG, CREATE_COMMIT_STEP_ID, CREATE_TAG_STEP_ID, DEFAULT_CHANGELOG_FILENAME, DEFAULT_COMMIT_TYPE_TO_SECTION, DEFAULT_FLOW_CONFIG, FETCH_REGISTRY_STEP_ID, GENERATE_CHANGELOG_STEP_ID, INDEPENDENT_FLOW_CONFIG, RESOLVE_REPOSITORY_STEP_ID, SYNCED_FLOW_CONFIG, UPDATE_PACKAGES_STEP_ID, addStep, createAnalyzeCommitsStep, createBatchReleaseFlow, createCalculateBumpStep, createCascadeDependenciesStep, createChangelogOnlyFlow, createCheckDependentBumpsStep, createCheckIdempotencyStep, createCombinedChangelogStep, createConventionalFlow, createDryRunFlow, createFailedResult, createFetchRegistryStep, createFixedVersionFlow, createFlow, createGenerateChangelogStep, createGitCommitStep, createIndependentFlow, createMinimalFlow, createNoopStep, createPushTagStep, createResolveRepositoryStep, createSkippedResult, createStep, createSuccessResult, createSyncAllPackagesStep, createSyncedFlow, createTagStep, createUpdatePackageStep, createVersionFlow, createWriteChangelogStep, dryRun, executeFlow, getAvailablePresets, getPresetDescription, getStep, hasStep, insertStep, insertStepAfter, insertStepBefore, removeStep, replaceStep, validateFlow, withConfig };
|
|
12207
12258
|
//# sourceMappingURL=index.esm.js.map
|