@ckeditor/ckeditor5-dev-changelog 50.1.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.
Files changed (36) hide show
  1. package/LICENSE.md +16 -0
  2. package/README.md +46 -0
  3. package/bin/generate-template.js +12 -0
  4. package/dist/index.d.ts +7 -0
  5. package/dist/index.js +1284 -0
  6. package/dist/tasks/generatechangelogformonorepository.d.ts +11 -0
  7. package/dist/tasks/generatechangelogforsinglerepository.d.ts +8 -0
  8. package/dist/template.d.ts +20 -0
  9. package/dist/template.js +108 -0
  10. package/dist/types.d.ts +120 -0
  11. package/dist/utils/asyncarray.d.ts +35 -0
  12. package/dist/utils/commitchanges.d.ts +8 -0
  13. package/dist/utils/composechangelog.d.ts +27 -0
  14. package/dist/utils/composereleasesummary.d.ts +23 -0
  15. package/dist/utils/constants.d.ts +56 -0
  16. package/dist/utils/determinenextversion.d.ts +26 -0
  17. package/dist/utils/displaychanges.d.ts +22 -0
  18. package/dist/utils/filtervisiblesections.d.ts +13 -0
  19. package/dist/utils/findchangelogentrypaths.d.ts +15 -0
  20. package/dist/utils/findpackages.d.ts +16 -0
  21. package/dist/utils/generatechangelog.d.ts +18 -0
  22. package/dist/utils/getdateformatted.d.ts +8 -0
  23. package/dist/utils/groupentriesbysection.d.ts +16 -0
  24. package/dist/utils/internalerror.d.ts +10 -0
  25. package/dist/utils/linktogithubuser.d.ts +11 -0
  26. package/dist/utils/loginfo.d.ts +12 -0
  27. package/dist/utils/modifychangelog.d.ts +11 -0
  28. package/dist/utils/normalizeentry.d.ts +6 -0
  29. package/dist/utils/parsechangelogentries.d.ts +9 -0
  30. package/dist/utils/providenewversion.d.ts +21 -0
  31. package/dist/utils/removechangelogentryfiles.d.ts +10 -0
  32. package/dist/utils/sortentriesbyscopeanddate.d.ts +12 -0
  33. package/dist/utils/truncatechangelog.d.ts +8 -0
  34. package/dist/utils/useraborterror.d.ts +9 -0
  35. package/dist/utils/validateentry.d.ts +17 -0
  36. package/package.json +40 -0
@@ -0,0 +1,11 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md.
4
+ */
5
+ import type { ConfigBase, GenerateChangelogEntryPoint, MonoRepoConfigBase } from '../types.js';
6
+ type MonoRepositoryConfig = ConfigBase & MonoRepoConfigBase & {
7
+ packagesDirectory: ConfigBase['packagesDirectory'];
8
+ transformScope: MonoRepoConfigBase['transformScope'];
9
+ };
10
+ export declare const generateChangelogForMonoRepository: GenerateChangelogEntryPoint<MonoRepositoryConfig>;
11
+ export {};
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md.
4
+ */
5
+ import type { ConfigBase, GenerateChangelogEntryPoint } from '../types.js';
6
+ type SingleRepositoryConfig = Omit<ConfigBase, 'packagesDirectory'>;
7
+ export declare const generateChangelogForSingleRepository: GenerateChangelogEntryPoint<SingleRepositoryConfig>;
8
+ export {};
@@ -0,0 +1,20 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md.
4
+ */
5
+ /**
6
+ * Options for the `generateTemplate` function.
7
+ */
8
+ interface GenerateTemplateOptions {
9
+ directory: string;
10
+ }
11
+ /**
12
+ * Returns a filename for the template file based on the current date and git branch name.
13
+ * The filename is formatted as `YYYYMMDDHHMMSS_{GIT_BRANCH_NAME}.md`.
14
+ */
15
+ export declare function getFileName(): Promise<string>;
16
+ /**
17
+ * Generates a template file for the changelog in the specified directory.
18
+ */
19
+ export declare function generateTemplate(args?: Partial<GenerateTemplateOptions>, retries?: number): Promise<void>;
20
+ export {};
@@ -0,0 +1,108 @@
1
+ import { mkdir, copyFile, constants } from 'fs/promises';
2
+ import { styleText, parseArgs, promisify } from 'util';
3
+ import { exec } from 'child_process';
4
+ import path from 'upath';
5
+ import { format } from 'date-fns';
6
+
7
+ /**
8
+ * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
9
+ * For licensing, see LICENSE.md.
10
+ */
11
+ const CHANGESET_DIRECTORY = '.changelog';
12
+ const TEMPLATE_FILE = path.join(import.meta.dirname, '../template/template.md');
13
+
14
+ /**
15
+ * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
16
+ * For licensing, see LICENSE.md.
17
+ */
18
+ /**
19
+ * Default options for the `generateTemplate` function.
20
+ */
21
+ const DEFAULT_OPTIONS = {
22
+ directory: CHANGESET_DIRECTORY
23
+ };
24
+ /**
25
+ * Reads CLI arguments and turn the keys into camelcase.
26
+ */
27
+ function getCliArguments() {
28
+ const { values } = parseArgs({
29
+ options: {
30
+ directory: { type: 'string' }
31
+ },
32
+ // Skip `node ckeditor5-dev-changelog`.
33
+ args: process.argv.slice(2),
34
+ // Fail when unknown argument is used.
35
+ strict: true
36
+ });
37
+ return values;
38
+ }
39
+ /**
40
+ * Returns normalized options object for the `generateTemplate` function.
41
+ */
42
+ function normalizeOptions(options) {
43
+ const normalized = Object.assign({}, DEFAULT_OPTIONS, options);
44
+ // Ensure that paths are absolute and resolve to the current working directory.
45
+ normalized.directory = path.resolve(process.cwd(), normalized.directory);
46
+ return normalized;
47
+ }
48
+ /**
49
+ * Returns the current git branch name formatted to be used in a filename.
50
+ */
51
+ async function getFormattedGitBranchName() {
52
+ try {
53
+ const asyncExec = promisify(exec);
54
+ const { stdout } = await asyncExec('git rev-parse --abbrev-ref HEAD', { encoding: 'utf8' });
55
+ return stdout
56
+ .trim()
57
+ .replace(/[^a-zA-Z0-9]/g, '_');
58
+ }
59
+ catch {
60
+ console.error(styleText(['red', 'bold'], 'Error: Git is not installed or the current folder is not in git repository.'));
61
+ process.exit(1);
62
+ }
63
+ }
64
+ /**
65
+ * Returns a filename for the template file based on the current date and git branch name.
66
+ * The filename is formatted as `YYYYMMDDHHMMSS_{GIT_BRANCH_NAME}.md`.
67
+ */
68
+ async function getFileName() {
69
+ const date = format(new Date(), 'yyyyMMddHHmmss');
70
+ const gitBranchName = await getFormattedGitBranchName();
71
+ return `${date}_${gitBranchName}.md`;
72
+ }
73
+ /**
74
+ * Generates a template file for the changelog in the specified directory.
75
+ */
76
+ async function generateTemplate(args = getCliArguments(), retries = 5) {
77
+ const options = normalizeOptions(args);
78
+ const filename = await getFileName();
79
+ const outputPath = path.resolve(options.directory, filename);
80
+ await mkdir(options.directory, { recursive: true });
81
+ try {
82
+ await copyFile(TEMPLATE_FILE, outputPath, constants.COPYFILE_EXCL);
83
+ const indent = ' '.repeat(3);
84
+ const relativePath = path.relative(process.cwd(), outputPath);
85
+ console.log(styleText('green', '✅ The changelog file has been successfully created.'));
86
+ console.log('');
87
+ console.log('✍️ Please fill it with relevant information about your changes.');
88
+ console.log(indent + styleText('cyan', `file://${outputPath}`));
89
+ console.log('');
90
+ console.log('📥 Once done, commit the changelog file:');
91
+ console.log(indent + styleText('gray', `$ git add ${relativePath}`));
92
+ console.log(indent + styleText('gray', '$ git commit -m "..."'));
93
+ }
94
+ catch (error) {
95
+ if (retries <= 0) {
96
+ console.error(styleText(['red', 'bold'], 'Error: Generating changelog file failed with the following error:'));
97
+ throw error;
98
+ }
99
+ console.error(styleText('gray', 'You are going to fast 🥵 Waiting 1 second to ensure unique changelog name.'));
100
+ return new Promise(resolve => {
101
+ setTimeout(() => {
102
+ resolve(generateTemplate(options, retries - 1));
103
+ }, 1000);
104
+ });
105
+ }
106
+ }
107
+
108
+ export { generateTemplate, getFileName };
@@ -0,0 +1,120 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md.
4
+ */
5
+ import type { SECTIONS } from './utils/constants.js';
6
+ export type ConfigBase = RepositoryConfig & {
7
+ /**
8
+ * The next version number to use. If not provided, will be calculated based on changes.
9
+ * Can be a semver string or 'internal' for internal changes only.
10
+ */
11
+ nextVersion?: string | 'internal';
12
+ /**
13
+ * Array of external repository configurations to include in the changelog.
14
+ */
15
+ externalRepositories?: Array<RepositoryConfig>;
16
+ /**
17
+ * The date to use for the changelog entry. Defaults to current date in YYYY-MM-DD format.
18
+ */
19
+ date?: string;
20
+ };
21
+ export type MonoRepoConfigBase = {
22
+ /**
23
+ * Function to transform package scopes in the changelog entries.
24
+ */
25
+ transformScope?: TransformScope;
26
+ /**
27
+ * Whether to include the root package name in the bumped packages versions section in the changelog.
28
+ */
29
+ shouldIgnoreRootPackage?: unknown;
30
+ /**
31
+ * The package that will be used when determining if the next version is available on npm.
32
+ */
33
+ npmPackageToCheck?: unknown;
34
+ } & NpmPackageRequiredWhenSkipRootPackage;
35
+ export type RepositoryConfig = {
36
+ /**
37
+ * The current working directory of the repository.
38
+ */
39
+ cwd: string;
40
+ /**
41
+ * The directory containing the packages. Defaults to 'packages'.
42
+ */
43
+ packagesDirectory: null | string;
44
+ /**
45
+ * Whether to skip links in the changelog entries. Defaults to false.
46
+ */
47
+ shouldSkipLinks?: boolean;
48
+ };
49
+ export type GenerateChangelogEntryPoint<K extends object> = <T extends boolean | undefined = undefined>(config: K & {
50
+ /**
51
+ * Controls whether changeset files will be deleted after generating changelog.
52
+ */
53
+ disableFilesystemOperations?: T;
54
+ }) => Promise<T extends true ? string : void>;
55
+ export type SectionName = keyof typeof SECTIONS;
56
+ export type Entry = {
57
+ message: string;
58
+ data: {
59
+ type: string;
60
+ scope: Array<string>;
61
+ mainContent: string | undefined;
62
+ restContent: Array<string>;
63
+ communityCredits: Array<string>;
64
+ validations: Array<string>;
65
+ see: Array<LinkObject>;
66
+ closes: Array<LinkObject>;
67
+ };
68
+ changesetPath: string;
69
+ };
70
+ export type ParsedFile<T = FileMetadata> = {
71
+ content: string;
72
+ data: T;
73
+ changesetPath: string;
74
+ createdAt: Date;
75
+ gitHubUrl: string;
76
+ shouldSkipLinks: boolean;
77
+ };
78
+ export type Section = {
79
+ entries: Array<Entry>;
80
+ title: string;
81
+ titleInLogs?: string;
82
+ excludeInChangelog?: boolean;
83
+ };
84
+ export type SectionsWithEntries = Record<SectionName, Section>;
85
+ export type ReleaseInfo = {
86
+ title: string;
87
+ version: string;
88
+ packages: Array<string>;
89
+ };
90
+ export type TransformScope = (name: string) => {
91
+ displayName: string;
92
+ npmUrl: string;
93
+ };
94
+ export type ChangesetPathsWithGithubUrl = {
95
+ filePaths: Array<string>;
96
+ gitHubUrl: string;
97
+ shouldSkipLinks: boolean;
98
+ cwd: string;
99
+ isRoot: boolean;
100
+ };
101
+ type NpmPackageRequiredWhenSkipRootPackage = {
102
+ shouldIgnoreRootPackage?: true;
103
+ npmPackageToCheck: string;
104
+ } | {
105
+ shouldIgnoreRootPackage?: false;
106
+ npmPackageToCheck?: never;
107
+ };
108
+ export type LinkObject = {
109
+ displayName: string;
110
+ link: string;
111
+ };
112
+ export type FileMetadata = {
113
+ type: string;
114
+ scope: Array<string>;
115
+ closes: Array<string>;
116
+ see: Array<string>;
117
+ communityCredits: Array<string>;
118
+ validations: Array<string>;
119
+ };
120
+ export {};
@@ -0,0 +1,35 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md.
4
+ */
5
+ /**
6
+ * A utility class that wraps a Promise of an array and provides async array-like operations.
7
+ */
8
+ export declare class AsyncArray<T> {
9
+ private readonly promise;
10
+ /**
11
+ * Creates a new `AsyncArray` instance.
12
+ */
13
+ constructor(promise: Promise<Array<T>>);
14
+ /**
15
+ * Creates an `AsyncArray` from a given promise.
16
+ */
17
+ static from<U>(promise: Promise<Array<U>>): AsyncArray<U>;
18
+ /**
19
+ * Asynchronously maps each item in the array using the provided callback.
20
+ */
21
+ map<U>(fn: (item: T, index: number, array: Array<T>) => U | Promise<U>): AsyncArray<U>;
22
+ /**
23
+ * Flattens one level of nesting in an array of arrays.
24
+ */
25
+ flat<U>(this: AsyncArray<Array<U>>): AsyncArray<U>;
26
+ /**
27
+ * Maps each item using a callback that returns an array (or promise of an array),
28
+ * then flattens the result by one level.
29
+ */
30
+ flatMap<U>(fn: (item: T, index: number, array: Array<T>) => Array<U> | Promise<Array<U>>): AsyncArray<U>;
31
+ /**
32
+ * Allows chaining or awaiting the result of the internal promise.
33
+ */
34
+ then<U>(onfulfilled: (value: Array<T>) => U | Promise<U>): Promise<U>;
35
+ }
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md.
4
+ */
5
+ import type { ChangesetPathsWithGithubUrl } from '../types.js';
6
+ type RepositoryData = Pick<ChangesetPathsWithGithubUrl, 'cwd' | 'isRoot' | 'filePaths'>;
7
+ export declare function commitChanges(version: string, repositories: Array<RepositoryData>): Promise<void>;
8
+ export {};
@@ -0,0 +1,27 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md.
4
+ */
5
+ import type { ReleaseInfo, Section } from '../types.js';
6
+ type ComposeChangelogOptions = {
7
+ cwd: string;
8
+ date: string;
9
+ currentVersion: string;
10
+ newVersion: string;
11
+ sections: Array<Section>;
12
+ releasedPackagesInfo: Array<ReleaseInfo>;
13
+ isInternal: boolean;
14
+ isSinglePackage: boolean;
15
+ packagesMetadata: Map<string, string>;
16
+ };
17
+ /**
18
+ * Generates a formatted changelog string for a new version release.
19
+ *
20
+ * This function constructs the changelog content including
21
+ * * A version header with a link to the GitHub comparison view (except for an initial version).
22
+ * * Sections with grouped changelog entries and their messages.
23
+ * * A collapsible summary of released packages and their version bumps for a mono-repository setup.
24
+ * * Special handling for internal-only releases and single-package repositories.
25
+ */
26
+ export declare function composeChangelog(options: ComposeChangelogOptions): Promise<string>;
27
+ export {};
@@ -0,0 +1,23 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md.
4
+ */
5
+ import type { ReleaseInfo, SectionsWithEntries } from '../types.js';
6
+ type ComposeReleaseSummaryOptions = {
7
+ sections: SectionsWithEntries;
8
+ currentVersion: string;
9
+ newVersion: string;
10
+ packagesMetadata: Map<string, string>;
11
+ };
12
+ /**
13
+ * Generates a categorized summary of packages released in the new version,
14
+ * including new packages, major, minor, feature, and other releases.
15
+ *
16
+ * This function analyzes changelog sections and package metadata to:
17
+ * * Identify new packages introduced with version '0.0.1'.
18
+ * * Group packages by release type based on the changelog sections: major, minor, and features.
19
+ * * Exclude packages already accounted for in higher-priority release categories from lower ones.
20
+ * * Provide a fallback category for "other releases" that don't fall into the above groups.
21
+ */
22
+ export declare function composeReleaseSummary(options: ComposeReleaseSummaryOptions): Promise<Array<ReleaseInfo>>;
23
+ export {};
@@ -0,0 +1,56 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md.
4
+ */
5
+ export declare const CHANGELOG_FILE = "CHANGELOG.md";
6
+ export declare const CHANGELOG_HEADER = "Changelog\n=========";
7
+ export declare const NPM_URL = "https://www.npmjs.com/package";
8
+ export declare const VERSIONING_POLICY_URL = "https://ckeditor.com/docs/ckeditor5/latest/framework/guides/support/versioning-policy.html";
9
+ export declare const CHANGESET_DIRECTORY = ".changelog";
10
+ export declare const TEMPLATE_FILE: string;
11
+ export declare const SECTIONS: {
12
+ readonly major: {
13
+ readonly title: "MAJOR BREAKING CHANGES [ℹ️](https://ckeditor.com/docs/ckeditor5/latest/framework/guides/support/versioning-policy.html#major-and-minor-breaking-changes)";
14
+ readonly titleInLogs: "MAJOR BREAKING CHANGES";
15
+ };
16
+ readonly minor: {
17
+ readonly title: "MINOR BREAKING CHANGES [ℹ️](https://ckeditor.com/docs/ckeditor5/latest/framework/guides/support/versioning-policy.html#major-and-minor-breaking-changes)";
18
+ readonly titleInLogs: "MINOR BREAKING CHANGES";
19
+ };
20
+ readonly breaking: {
21
+ readonly title: "BREAKING CHANGES";
22
+ };
23
+ readonly feature: {
24
+ readonly title: "Features";
25
+ };
26
+ readonly fix: {
27
+ readonly title: "Bug fixes";
28
+ };
29
+ readonly other: {
30
+ readonly title: "Other changes";
31
+ };
32
+ readonly warning: {
33
+ readonly title: "Incorrect values";
34
+ readonly excludeInChangelog: true;
35
+ };
36
+ readonly invalid: {
37
+ readonly title: "Invalid files";
38
+ readonly excludeInChangelog: true;
39
+ };
40
+ };
41
+ export declare const ISSUE_SLUG_PATTERN: RegExp;
42
+ export declare const ISSUE_PATTERN: RegExp;
43
+ export declare const ISSUE_URL_PATTERN: RegExp;
44
+ export declare const TYPES: readonly [{
45
+ readonly name: "Feature";
46
+ }, {
47
+ readonly name: "Other";
48
+ }, {
49
+ readonly name: "Fix";
50
+ }, {
51
+ readonly name: "Major breaking change";
52
+ }, {
53
+ readonly name: "Minor breaking change";
54
+ }, {
55
+ readonly name: "Breaking change";
56
+ }];
@@ -0,0 +1,26 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md.
4
+ */
5
+ import type { SectionsWithEntries } from '../types.js';
6
+ type NextVersionOutput = {
7
+ isInternal: boolean;
8
+ newVersion: string;
9
+ };
10
+ export type DetermineNextVersionOptions = {
11
+ sections: SectionsWithEntries;
12
+ currentVersion: string;
13
+ packageName: string;
14
+ nextVersion: string | undefined;
15
+ };
16
+ /**
17
+ * Determines the next version for a single package or a mono-repository setup based on
18
+ * the change sections, * user input, and semantic versioning rules.
19
+ *
20
+ * The function handles:
21
+ * * Automatic version bump calculation from categorized changelog sections (major, minor, patch).
22
+ * * Accepting explicit next version overrides, including a special `internal` version bump.
23
+ * * User prompts for version input when no explicit version is provided.
24
+ */
25
+ export declare function determineNextVersion(options: DetermineNextVersionOptions): Promise<NextVersionOutput>;
26
+ export {};
@@ -0,0 +1,22 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md.
4
+ */
5
+ import type { SectionsWithEntries, TransformScope } from '../types.js';
6
+ type DisplayChangesOptions = {
7
+ sections: SectionsWithEntries;
8
+ isSinglePackage: boolean;
9
+ transformScope?: TransformScope;
10
+ };
11
+ /**
12
+ * Displays a formatted summary of all changelog entries grouped by sections (e.g., Features, Fixes, Breaking changes).
13
+ *
14
+ * This function:
15
+ * * Lists all non-empty changelog sections with appropriate formatting.
16
+ * * Differentiates between valid and invalid entries using visual indicators (`+` for valid, `x` for invalid).
17
+ * * Supports both mono-repository and single package repositories through the `isSinglePackage` flag.
18
+ * * Applies a transformation to scope names using the `transformScope` callback for a mono-repository setup.
19
+ * * Outputs a helpful legend for interpreting the entry indicators.
20
+ */
21
+ export declare function displayChanges(options: DisplayChangesOptions): void;
22
+ export {};
@@ -0,0 +1,13 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md.
4
+ */
5
+ import type { Section, SectionsWithEntries } from '../types.js';
6
+ /**
7
+ * Filters and returns only those changelog sections that:
8
+ * * Have at least one entry.
9
+ * * Are not explicitly marked to be excluded from the final changelog.
10
+ *
11
+ * This is used to determine which sections should be displayed or processed for changelog generation.
12
+ */
13
+ export declare function filterVisibleSections(sectionsWithEntries: SectionsWithEntries): Array<Section>;
@@ -0,0 +1,15 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md.
4
+ */
5
+ import type { ChangesetPathsWithGithubUrl, RepositoryConfig } from '../types.js';
6
+ type FindChangelogEntryPathsOptions = {
7
+ cwd: string;
8
+ externalRepositories: Array<RepositoryConfig>;
9
+ shouldSkipLinks: boolean;
10
+ };
11
+ /**
12
+ * Gathers changelog entry file paths (Markdown files) from the main repository and any configured external repositories.
13
+ */
14
+ export declare function findChangelogEntryPaths(options: FindChangelogEntryPathsOptions): Promise<Array<ChangesetPathsWithGithubUrl>>;
15
+ export {};
@@ -0,0 +1,16 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md.
4
+ */
5
+ import type { RepositoryConfig } from '../types.js';
6
+ type FindPackagesOptions = {
7
+ cwd: string;
8
+ packagesDirectory: string | null;
9
+ externalRepositories: Array<RepositoryConfig>;
10
+ shouldIgnoreRootPackage?: boolean;
11
+ };
12
+ /**
13
+ * Retrieves the names and versions of packages found in both the main repository and any external repositories.
14
+ */
15
+ export declare function findPackages(options: FindPackagesOptions): Promise<Map<string, string>>;
16
+ export {};
@@ -0,0 +1,18 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md.
4
+ */
5
+ import type { ConfigBase, GenerateChangelogEntryPoint, MonoRepoConfigBase } from '../types.js';
6
+ type GenerateChangelogConfig = ConfigBase & MonoRepoConfigBase & {
7
+ isSinglePackage: boolean;
8
+ };
9
+ /**
10
+ * Entry point for generating a changelog with error handling.
11
+ *
12
+ * This wrapper ensures that:
13
+ * * Interruptions from the user (e.g., Ctrl+C or intentional aborts) exit silently with code 0.
14
+ * * Expected and unexpected internal errors are logged to the console and exit with code 1.
15
+ * * Other unexpected errors are re-thrown for higher-level handling.
16
+ */
17
+ export declare const generateChangelog: GenerateChangelogEntryPoint<GenerateChangelogConfig>;
18
+ export {};
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md.
4
+ */
5
+ /**
6
+ * Formats a date string `YYYY-MM-DD` into a human-readable format for the changelog.
7
+ */
8
+ export declare function getDateFormatted(date: string): string;
@@ -0,0 +1,16 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md.
4
+ */
5
+ import type { ParsedFile, SectionsWithEntries, TransformScope } from '../types.js';
6
+ type GroupEntriesBySectionOptions = {
7
+ files: Array<ParsedFile>;
8
+ packagesMetadata: Map<string, string>;
9
+ transformScope?: TransformScope;
10
+ isSinglePackage: boolean;
11
+ };
12
+ /**
13
+ * This function categorizes changelog entries based on their types and packages.
14
+ */
15
+ export declare function groupEntriesBySection(options: GroupEntriesBySectionOptions): SectionsWithEntries;
16
+ export {};
@@ -0,0 +1,10 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md.
4
+ */
5
+ /**
6
+ * Custom error class for handling validation errors in the changelog generation process.
7
+ */
8
+ export declare class InternalError extends Error {
9
+ constructor();
10
+ }
@@ -0,0 +1,11 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md.
4
+ */
5
+ /**
6
+ * This function enhances changelog entries by linking contributor usernames to their GitHub profiles.
7
+ *
8
+ * It searches for occurrences of GitHub-style mentions (e.g., @username) in the given comment string
9
+ * and transforms them into Markdown links pointing to the corresponding GitHub user page.
10
+ */
11
+ export declare function linkToGitHubUser(comment: string): string;
@@ -0,0 +1,12 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md.
4
+ */
5
+ /**
6
+ * This function provides a consistent logging format for the changelog generation process.
7
+ *
8
+ * It logs the given text to the console, optionally indenting it by a specified number of levels.
9
+ */
10
+ export declare function logInfo(text: string, { indent }?: {
11
+ indent: number;
12
+ }): void;
@@ -0,0 +1,11 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md.
4
+ */
5
+ /**
6
+ * This function writes the generated changelog content to the repository's changelog file.
7
+ *
8
+ * It reads the existing changelog (if any), inserts the new changelog content after the defined header,
9
+ * writes the updated content back to the changelog file, and truncates the changelog to keep a manageable length.
10
+ */
11
+ export declare function modifyChangelog(newChangelog: string, cwd: string): Promise<void>;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md.
4
+ */
5
+ import type { FileMetadata, ParsedFile } from '../types.js';
6
+ export declare function normalizeEntry(entry: ParsedFile<Partial<FileMetadata>>, isSinglePackage: boolean): ParsedFile;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md.
4
+ */
5
+ import type { ChangesetPathsWithGithubUrl, ParsedFile } from '../types.js';
6
+ /**
7
+ * Reads and processes input files to extract changelog entries.
8
+ */
9
+ export declare function parseChangelogEntries(entryPaths: Array<ChangesetPathsWithGithubUrl>, isSinglePackage: boolean): Promise<Array<ParsedFile>>;
@@ -0,0 +1,21 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md.
4
+ */
5
+ import { type ReleaseType } from 'semver';
6
+ type Options = {
7
+ packageName: string;
8
+ version: string;
9
+ bumpType: ReleaseType;
10
+ indentLevel?: number;
11
+ displayValidationWarning: boolean;
12
+ };
13
+ /**
14
+ * Prompts the user to provide a new version for a package.
15
+ *
16
+ * Validates the input (version format, version higher than current, availability).
17
+ *
18
+ * Optionally shows warnings for invalid changes and allows user to abort.
19
+ */
20
+ export declare function provideNewVersion(options: Options): Promise<string>;
21
+ export {};