fork-version 4.1.9 → 5.0.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 (81) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/dist/cli.d.ts +1 -1
  3. package/dist/cli.js +54 -193
  4. package/dist/commands/inspect.d.ts +9 -0
  5. package/dist/commands/inspect.js +41 -0
  6. package/dist/commands/main.d.ts +16 -0
  7. package/dist/commands/main.js +30 -0
  8. package/dist/commands/validate-config.d.ts +6 -0
  9. package/dist/commands/validate-config.js +11 -0
  10. package/dist/commit-parser/commit-parser.d.ts +114 -0
  11. package/dist/commit-parser/commit-parser.js +327 -0
  12. package/dist/commit-parser/filter-reverted-commits.d.ts +17 -0
  13. package/dist/commit-parser/filter-reverted-commits.js +34 -0
  14. package/dist/commit-parser/options.d.ts +74 -0
  15. package/dist/commit-parser/options.js +70 -0
  16. package/dist/commit-parser/parser-error.js +14 -0
  17. package/dist/commit-parser/types.d.ts +53 -0
  18. package/dist/config/changelog-preset-config.js +41 -0
  19. package/dist/config/cli-arguments.d.ts +109 -0
  20. package/dist/config/cli-arguments.js +141 -0
  21. package/dist/config/defaults.js +38 -0
  22. package/dist/config/define-config.d.ts +9 -0
  23. package/dist/config/define-config.js +9 -0
  24. package/dist/config/load-config.js +45 -0
  25. package/dist/config/merge-files.js +12 -0
  26. package/dist/config/schema.d.ts +50 -0
  27. package/dist/config/schema.js +61 -0
  28. package/dist/config/types.d.ts +279 -0
  29. package/dist/config/user-config.d.ts +6 -0
  30. package/dist/config/user-config.js +50 -0
  31. package/dist/detect-git-host/detect-git-host.js +35 -0
  32. package/dist/detect-git-host/host-azure-devops.js +28 -0
  33. package/dist/detect-git-host/host-bitbucket.js +28 -0
  34. package/dist/detect-git-host/host-github.js +32 -0
  35. package/dist/detect-git-host/host-gitlab.js +48 -0
  36. package/dist/files/arm-bicep.js +44 -0
  37. package/dist/files/file-manager.d.ts +47 -0
  38. package/dist/files/file-manager.js +65 -0
  39. package/dist/files/install-shield-ism.js +59 -0
  40. package/dist/files/json-package.js +68 -0
  41. package/dist/files/ms-build-project.js +59 -0
  42. package/dist/files/plain-text.js +35 -0
  43. package/dist/files/yaml-package.js +61 -0
  44. package/dist/index.d.ts +21 -646
  45. package/dist/index.js +19 -10
  46. package/dist/process/changelog.d.ts +7 -0
  47. package/dist/process/changelog.js +69 -0
  48. package/dist/process/commit.d.ts +9 -0
  49. package/dist/process/commit.js +22 -0
  50. package/dist/process/get-commits.d.ts +14 -0
  51. package/dist/process/get-commits.js +25 -0
  52. package/dist/process/get-current-version.d.ts +13 -0
  53. package/dist/process/get-current-version.js +35 -0
  54. package/dist/process/get-next-version.d.ts +21 -0
  55. package/dist/process/get-next-version.js +72 -0
  56. package/dist/process/tag.d.ts +8 -0
  57. package/dist/process/tag.js +15 -0
  58. package/dist/services/git.d.ts +141 -0
  59. package/dist/services/git.js +236 -0
  60. package/dist/services/logger.d.ts +18 -0
  61. package/dist/services/logger.js +35 -0
  62. package/dist/utils/clean-tag.js +21 -0
  63. package/dist/utils/escape-regex.js +17 -0
  64. package/dist/utils/file-state.js +19 -0
  65. package/dist/utils/format-commit-message.js +13 -0
  66. package/dist/utils/parse-regexp-string.js +31 -0
  67. package/dist/utils/release-type.js +47 -0
  68. package/dist/utils/trim-string-array.js +20 -0
  69. package/package.json +11 -29
  70. package/dist/chunk-KRGBUNRK.cjs +0 -2264
  71. package/dist/chunk-KRGBUNRK.cjs.map +0 -1
  72. package/dist/chunk-X4NB24VR.js +0 -2220
  73. package/dist/chunk-X4NB24VR.js.map +0 -1
  74. package/dist/cli.cjs +0 -205
  75. package/dist/cli.cjs.map +0 -1
  76. package/dist/cli.d.cts +0 -1
  77. package/dist/cli.js.map +0 -1
  78. package/dist/index.cjs +0 -80
  79. package/dist/index.cjs.map +0 -1
  80. package/dist/index.d.cts +0 -646
  81. package/dist/index.js.map +0 -1
package/dist/index.d.ts CHANGED
@@ -1,646 +1,21 @@
1
- import { z } from 'zod';
2
- import * as meow from 'meow';
3
- import { ReleaseType } from 'semver';
4
-
5
- declare const ForkConfigSchema: z.ZodObject<{
6
- command: z.ZodLiteral<"main" | "inspect" | "inspect-version" | "inspect-tag" | "validate-config">;
7
- inspectVersion: z.ZodOptional<z.ZodBoolean>;
8
- files: z.ZodArray<z.ZodString>;
9
- glob: z.ZodOptional<z.ZodString>;
10
- path: z.ZodString;
11
- changelog: z.ZodString;
12
- header: z.ZodString;
13
- tagPrefix: z.ZodString;
14
- preRelease: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodBoolean]>>;
15
- currentVersion: z.ZodOptional<z.ZodString>;
16
- nextVersion: z.ZodOptional<z.ZodString>;
17
- releaseAs: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"major">, z.ZodLiteral<"minor">, z.ZodLiteral<"patch">]>>;
18
- allowMultipleVersions: z.ZodBoolean;
19
- commitAll: z.ZodBoolean;
20
- changelogAll: z.ZodBoolean;
21
- debug: z.ZodBoolean;
22
- dryRun: z.ZodBoolean;
23
- silent: z.ZodBoolean;
24
- gitTagFallback: z.ZodBoolean;
25
- sign: z.ZodBoolean;
26
- verify: z.ZodBoolean;
27
- asJson: z.ZodBoolean;
28
- skipBump: z.ZodBoolean;
29
- skipChangelog: z.ZodBoolean;
30
- skipCommit: z.ZodBoolean;
31
- skipTag: z.ZodBoolean;
32
- detectedGitHost: z.ZodOptional<z.ZodString>;
33
- changelogPresetConfig: z.ZodOptional<z.ZodObject<{
34
- types: z.ZodOptional<z.ZodArray<z.ZodObject<{
35
- type: z.ZodString;
36
- scope: z.ZodOptional<z.ZodString>;
37
- section: z.ZodOptional<z.ZodString>;
38
- hidden: z.ZodOptional<z.ZodBoolean>;
39
- }, z.core.$strip>>>;
40
- commitUrlFormat: z.ZodOptional<z.ZodString>;
41
- compareUrlFormat: z.ZodOptional<z.ZodString>;
42
- issueUrlFormat: z.ZodOptional<z.ZodString>;
43
- userUrlFormat: z.ZodOptional<z.ZodString>;
44
- releaseCommitMessageFormat: z.ZodOptional<z.ZodString>;
45
- issuePrefixes: z.ZodOptional<z.ZodArray<z.ZodString>>;
46
- }, z.core.$strip>>;
47
- releaseMessageSuffix: z.ZodOptional<z.ZodString>;
48
- commitParserOptions: z.ZodOptional<z.ZodObject<z.core.$ZodLooseShape, z.core.$loose>>;
49
- }, z.core.$strip>;
50
-
51
- declare function getCliArguments(): meow.Result<{
52
- /** @deprecated Set the `inspect-version` command instead. */
53
- inspectVersion: {
54
- type: "boolean";
55
- };
56
- files: {
57
- type: "string";
58
- isMultiple: true;
59
- aliases: string[];
60
- shortFlag: string;
61
- };
62
- glob: {
63
- type: "string";
64
- shortFlag: string;
65
- };
66
- path: {
67
- type: "string";
68
- shortFlag: string;
69
- };
70
- changelog: {
71
- type: "string";
72
- };
73
- header: {
74
- type: "string";
75
- };
76
- tagPrefix: {
77
- type: "string";
78
- };
79
- preRelease: {
80
- type: "boolean";
81
- };
82
- preReleaseTag: {
83
- type: "string";
84
- };
85
- currentVersion: {
86
- type: "string";
87
- };
88
- nextVersion: {
89
- type: "string";
90
- };
91
- releaseAs: {
92
- type: "string";
93
- choices: string[];
94
- };
95
- allowMultipleVersions: {
96
- type: "boolean";
97
- };
98
- commitAll: {
99
- type: "boolean";
100
- };
101
- changelogAll: {
102
- type: "boolean";
103
- };
104
- debug: {
105
- type: "boolean";
106
- };
107
- dryRun: {
108
- type: "boolean";
109
- };
110
- silent: {
111
- type: "boolean";
112
- };
113
- gitTagFallback: {
114
- type: "boolean";
115
- };
116
- sign: {
117
- type: "boolean";
118
- };
119
- verify: {
120
- type: "boolean";
121
- };
122
- asJson: {
123
- type: "boolean";
124
- };
125
- skipBump: {
126
- type: "boolean";
127
- };
128
- skipChangelog: {
129
- type: "boolean";
130
- };
131
- skipCommit: {
132
- type: "boolean";
133
- };
134
- skipTag: {
135
- type: "boolean";
136
- };
137
- commitUrlFormat: {
138
- type: "string";
139
- };
140
- compareUrlFormat: {
141
- type: "string";
142
- };
143
- issueUrlFormat: {
144
- type: "string";
145
- };
146
- userUrlFormat: {
147
- type: "string";
148
- };
149
- releaseCommitMessageFormat: {
150
- type: "string";
151
- };
152
- releaseMessageSuffix: {
153
- type: "string";
154
- };
155
- }>;
156
-
157
- interface ParserOptions {
158
- /**
159
- * Pattern to match commit subjects
160
- * - Expected capture groups: `type` `title`
161
- * - Optional capture groups: `scope`, `breakingChange`
162
- */
163
- subjectPattern: RegExp | undefined;
164
- /**
165
- * Pattern to match merge commits
166
- * - Expected capture groups: `id`, `source`
167
- */
168
- mergePattern: RegExp | undefined;
169
- /**
170
- * Pattern to match revert commits
171
- * - Expected capture groups: `subject`, `hash`
172
- */
173
- revertPattern: RegExp | undefined;
174
- /**
175
- * Pattern to match commented out lines which will be trimmed
176
- */
177
- commentPattern: RegExp | undefined;
178
- /**
179
- * Pattern to match mentions
180
- * - Expected capture groups: `username`
181
- */
182
- mentionPattern: RegExp | undefined;
183
- /**
184
- * List of action labels to match reference sections
185
- * @default
186
- * ["close", "closes", "closed", "fix", "fixes", "fixed", "resolve", "resolves", "resolved"]
187
- */
188
- referenceActions?: string[];
189
- /**
190
- * Pattern to match reference sections
191
- * - Expected capture groups: `action`, `reference`
192
- */
193
- referenceActionPattern: RegExp | undefined;
194
- /**
195
- * List of issue prefixes to match issue ids
196
- * @default
197
- * ["#"]
198
- */
199
- issuePrefixes?: string[];
200
- /**
201
- * Pattern to match issue references
202
- * - Expected capture groups: `repository`, `prefix`, `issue`
203
- */
204
- issuePattern: RegExp | undefined;
205
- /**
206
- * List of keywords to match note titles
207
- * @default
208
- * ["BREAKING CHANGE", "BREAKING-CHANGE"]
209
- */
210
- noteKeywords?: string[];
211
- /**
212
- * Pattern to match note sections
213
- * - Expected capture groups: `title`
214
- * - Optional capture groups: `text`
215
- */
216
- notePattern: RegExp | undefined;
217
- }
218
- declare function createParserOptions(userOptions?: Partial<ParserOptions>): ParserOptions;
219
-
220
- type ForkConfig = z.infer<typeof ForkConfigSchema> & {
221
- commitParserOptions?: Partial<ParserOptions>;
222
- };
223
- type Config = Partial<ForkConfig>;
224
- type CLIArguments = ReturnType<typeof getCliArguments>;
225
- interface ForkVersionCLIArgs {
226
- input: CLIArguments["input"];
227
- flags: Partial<CLIArguments["flags"]>;
228
- }
229
-
230
- interface LoggerConfig {
231
- silent?: ForkConfig["silent"];
232
- debug?: ForkConfig["debug"];
233
- }
234
- declare class Logger {
235
- #private;
236
- constructor(config: LoggerConfig);
237
- log(message: string): void;
238
- warn(message: string): void;
239
- error(message: string): void;
240
- debug(message: string, ...optionalParams: any[]): void;
241
- skipping(message: string): void;
242
- }
243
-
244
- interface FileState {
245
- name: string;
246
- path: string;
247
- version: string;
248
- [other: string]: unknown;
249
- }
250
- interface IFileManager {
251
- read(fileName: string): FileState | undefined;
252
- write(fileState: FileState, newVersion: string): void;
253
- isSupportedFile(fileName: string): boolean;
254
- }
255
- declare class FileManager {
256
- #private;
257
- constructor(config: ForkConfig, logger: Logger);
258
- /**
259
- * Get the state from the given file name.
260
- *
261
- * @example
262
- * ```ts
263
- * fileManager.read("package.json");
264
- * ```
265
- *
266
- * @returns
267
- * ```json
268
- * { "name": "package.json", "path": "/path/to/package.json", "version": "1.2.3", "isPrivate": true }
269
- * ```
270
- */
271
- read(pathOrName: string): FileState | undefined;
272
- /**
273
- * Write the new version to the given file.
274
- *
275
- * @example
276
- * ```ts
277
- * fileManager.write(
278
- * { name: "package.json", path: "/path/to/package.json", version: "1.2.2" },
279
- * "1.2.3"
280
- * );
281
- * ```
282
- */
283
- write(fileState: FileState, newVersion: string): void;
284
- }
285
-
286
- interface GitConfig {
287
- path: ForkConfig["path"];
288
- dryRun?: ForkConfig["dryRun"];
289
- }
290
- declare class Git {
291
- #private;
292
- constructor(config: GitConfig);
293
- /**
294
- * Add file contents to the index
295
- *
296
- * [git-add Documentation](https://git-scm.com/docs/git-add)
297
- *
298
- * @example
299
- * ```ts
300
- * await git.add("CHANGELOG.md");
301
- * ```
302
- */
303
- add(...args: (string | undefined)[]): Promise<string>;
304
- /**
305
- * Record changes to the repository
306
- *
307
- * [git-commit Documentation](https://git-scm.com/docs/git-commit)
308
- *
309
- * @example
310
- * ```ts
311
- * await git.commit("--message", "chore(release): 1.2.3");
312
- * ```
313
- */
314
- commit(...args: (string | undefined)[]): Promise<string>;
315
- /**
316
- * Create, list, delete or verify a tag object
317
- *
318
- * [git-tag Documentation](https://git-scm.com/docs/git-tag)
319
- *
320
- * @example
321
- * ```ts
322
- * await git.tag("--annotate", "v1.2.3", "--message", "chore(release): 1.2.3");
323
- * ```
324
- */
325
- tag(...args: (string | undefined)[]): Promise<string>;
326
- /**
327
- * Show commit logs
328
- *
329
- * - [git-log Documentation](https://git-scm.com/docs/git-log)
330
- * - [pretty-formats Documentation](https://git-scm.com/docs/pretty-formats)
331
- *
332
- * @example
333
- * ```ts
334
- * await git.log("--oneline");
335
- * ```
336
- */
337
- log(...args: (string | undefined)[]): Promise<string>;
338
- /**
339
- * Check if a file is ignored by git
340
- *
341
- * [git-check-ignore Documentation](https://git-scm.com/docs/git-check-ignore)
342
- *
343
- * @example
344
- * ```ts
345
- * await git.isIgnored("src/my-file.txt");
346
- * ```
347
- */
348
- isIgnored(file: string): Promise<boolean>;
349
- /**
350
- * Get the name of the current branch
351
- *
352
- * [git-rev-parse Documentation](https://git-scm.com/docs/git-rev-parse)
353
- *
354
- * @example
355
- * ```ts
356
- * await git.getBranchName(); // "main"
357
- * ```
358
- */
359
- getBranchName(): Promise<string>;
360
- /**
361
- * Get the URL of the remote repository
362
- *
363
- * [git-config Documentation](https://git-scm.com/docs/git-config)
364
- *
365
- * @example
366
- * ```ts
367
- * await git.getRemoteUrl(); // "https://github.com/eglavin/fork-version"
368
- * ```
369
- */
370
- getRemoteUrl(): Promise<string>;
371
- /**
372
- * `getTags` returns valid semver version tags in order of the commit history
373
- *
374
- * Using `git log` to get the commit history, we then parse the tags from the
375
- * commit details which is expected to be in the following format:
376
- * ```txt
377
- * commit 3841b1d05750d42197fe958e3d8e06df378a842d (HEAD -> main, tag: v1.0.2, tag: v1.0.1, tag: v1.0.0)
378
- * Author: Username <username@example.com>
379
- * Date: Sat Nov 9 15:00:00 2024 +0000
380
- *
381
- * chore(release): v1.0.0
382
- * ```
383
- *
384
- * - [Functionality extracted from the conventional-changelog - git-semver-tags project](https://github.com/conventional-changelog/conventional-changelog/blob/fac8045242099c016f5f3905e54e02b7d466bd7b/packages/git-semver-tags/index.js)
385
- * - [conventional-changelog git-semver-tags MIT Licence](https://github.com/conventional-changelog/conventional-changelog/blob/fac8045242099c016f5f3905e54e02b7d466bd7b/packages/git-semver-tags/LICENSE.md)
386
- *
387
- * @example
388
- * ```ts
389
- * await git.getTags("v"); // ["v1.0.2", "v1.0.1", "v1.0.0"]
390
- * ```
391
- */
392
- getTags(tagPrefix: string | undefined): Promise<string[]>;
393
- /**
394
- * Returns the most recent tag from the commit history, or `undefined` if no valid semver tags are found
395
- *
396
- * @example
397
- * ```ts
398
- * await git.getMostRecentTag("v"); // "1.2.3"
399
- * ```
400
- */
401
- getMostRecentTag(tagPrefix: string | undefined): Promise<string | undefined>;
402
- /**
403
- * Get commit history in a parsable format
404
- *
405
- * An array of strings with commit details is returned in the following format:
406
- * ```txt
407
- * subject
408
- * body
409
- * hash
410
- * committer date
411
- * committer name
412
- * committer email
413
- * ```
414
- *
415
- * @example
416
- * ```ts
417
- * await git.getCommits("v1.0.0", "HEAD", "src/utils");
418
- * ```
419
- */
420
- getCommits(from?: string, to?: string, ...paths: string[]): Promise<string[]>;
421
- }
422
-
423
- declare function inspect(config: ForkConfig, logger: Logger, fileManager: FileManager, git: Git): Promise<void>;
424
-
425
- interface CommitMerge {
426
- id: string;
427
- source: string;
428
- }
429
- interface CommitRevert {
430
- hash: string;
431
- subject: string;
432
- }
433
- interface CommitReference {
434
- prefix: string;
435
- issue: string;
436
- action: string | null;
437
- owner: string | null;
438
- repository: string | null;
439
- }
440
- interface CommitNote {
441
- title: string;
442
- text: string;
443
- }
444
- interface Commit {
445
- raw: string;
446
- subject: string;
447
- body: string;
448
- hash: string;
449
- refNames: string;
450
- /**
451
- * Committer date in ISO 8601 format
452
- * @example
453
- * "2024-12-22T17:36:50Z"
454
- */
455
- date: string;
456
- /**
457
- * Committer name (respects .mailmap)
458
- */
459
- name: string;
460
- /**
461
- * Committer email (respects .mailmap)
462
- */
463
- email: string;
464
- type: string;
465
- scope: string;
466
- breakingChange: string;
467
- title: string;
468
- merge: CommitMerge | null;
469
- revert: CommitRevert | null;
470
- mentions: string[];
471
- references: CommitReference[];
472
- notes: CommitNote[];
473
- tags: string[];
474
- }
475
-
476
- interface NextVersion {
477
- version: string;
478
- releaseType?: ReleaseType;
479
- preMajor?: boolean;
480
- changes?: {
481
- major: number;
482
- minor: number;
483
- patch: number;
484
- merges: number;
485
- reverts: number;
486
- };
487
- }
488
- declare function getNextVersion(config: ForkConfig, logger: Logger, commits: Commit[], currentVersion: string): Promise<NextVersion>;
489
-
490
- interface CurrentVersion {
491
- version: string;
492
- files: FileState[];
493
- }
494
- declare function getCurrentVersion(config: ForkConfig, logger: Logger, git: Git, fileManager: FileManager, filesToUpdate: string[], latestTagVersion: string | undefined): Promise<CurrentVersion>;
495
-
496
- interface CommitsSinceTag {
497
- latestTag: string | undefined;
498
- latestTagVersion: string | undefined;
499
- commits: Commit[];
500
- }
501
- declare function getCommitsSinceTag(config: ForkConfig, logger: Logger, git: Git): Promise<CommitsSinceTag>;
502
-
503
- declare function main(config: ForkConfig, logger: Logger, fileManager: FileManager, git: Git): Promise<{
504
- config: ForkConfig;
505
- commits: CommitsSinceTag;
506
- current: CurrentVersion;
507
- next: NextVersion;
508
- }>;
509
-
510
- declare function validateConfig(config: ForkConfig): void;
511
-
512
- declare class CommitParser {
513
- #private;
514
- constructor(userOptions?: Partial<ParserOptions>);
515
- setLogger(logger: Logger): this;
516
- createCommit(): Commit;
517
- /**
518
- * Parse the raw commit message into its expected parts
519
- * - subject
520
- * - body
521
- * - hash
522
- * - date
523
- * - name
524
- * - email
525
- *
526
- * @throws {ParserError}
527
- */
528
- parseRawCommit(rawCommit: string): Commit;
529
- /**
530
- * Parse the commit subject into its expected parts
531
- * - type
532
- * - scope (optional)
533
- * - breaking change (optional)
534
- * - title
535
- *
536
- * @throws {ParserError}
537
- */
538
- parseSubject(commit: Commit): boolean;
539
- /**
540
- * Parse merge information from the commit subject
541
- * @example
542
- * ```txt
543
- * "Merge pull request #123 from fork-version/feature"
544
- * ```
545
- */
546
- parseMerge(commit: Commit): boolean;
547
- /**
548
- * Parse revert information from the commit body
549
- * @example
550
- * ```txt
551
- * "Revert "feat: initial commit"
552
- *
553
- * This reverts commit 4a79e9e546b4020d2882b7810dc549fa71960f4f."
554
- * ```
555
- */
556
- parseRevert(commit: Commit): boolean;
557
- /**
558
- * Search for mentions from the commit line
559
- * @example
560
- * ```txt
561
- * "@fork-version"
562
- * ```
563
- */
564
- parseMentions(line: string, outMentions: Set<string>): boolean;
565
- /**
566
- * Search for references from the commit line
567
- * @example
568
- * ```txt
569
- * "#1234"
570
- * "owner/repo#1234"
571
- * ```
572
- */
573
- parseReferenceParts(referenceText: string, action: string | null): CommitReference[] | undefined;
574
- /**
575
- * Search for actions and references from the commit line
576
- * @example
577
- * ```txt
578
- * "Closes #1234"
579
- * "fixes owner/repo#1234"
580
- * ```
581
- */
582
- parseReferences(line: string, outReferences: CommitReference[]): boolean;
583
- /**
584
- * Search for notes from the commit line
585
- * @example
586
- * ```txt
587
- * "BREAKING CHANGE: this is a breaking change"
588
- * ```
589
- */
590
- parseNotes(line: string, outNotes: CommitNote[]): boolean;
591
- /**
592
- * Parse the raw commit for mentions, references and notes
593
- */
594
- parseRawLines(commit: Commit): void;
595
- /**
596
- * Parse a commit log with the following format separated by new line characters:
597
- * ```txt
598
- * refactor: add test file
599
- * Add a test file to the project
600
- * 4ef2c86d393a9660aa9f753144256b1f200c16bd
601
- * 2024-12-22T17:36:50Z
602
- * Fork Version
603
- * fork-version@example.com
604
- * ```
605
- *
606
- * @example
607
- * ```ts
608
- * parse("refactor: add test file\nAdd a test file to the project\n4ef2c86d393a9660aa9f753144256b1f200c16bd\n2024-12-22T17:36:50Z\nFork Version\nfork-version@example.com");
609
- * ```
610
- *
611
- * The expected input value can be generated by running the following command:
612
- * ```sh
613
- * git log --format="%s%n%b%n%H%n%cI%n%cN%n%cE%n"
614
- * ```
615
- * @see {@link https://git-scm.com/docs/pretty-formats|Git Pretty Format Documentation}
616
- */
617
- parse(rawCommit: string): Commit | undefined;
618
- }
619
-
620
- /**
621
- * Filter out revert commits and their corresponding reverted commits,
622
- * this function expects the input to be sorted by date in descending order
623
- * from the most recent to the oldest commit.
624
- *
625
- * @example
626
- * ```ts
627
- * const commits: Commit[] = [...];
628
- * const filteredCommits = filterRevertedCommits(commits);
629
- * ```
630
- */
631
- declare function filterRevertedCommits(parsedCommits: Commit[]): Commit[];
632
-
633
- /**
634
- * [Fork-Version - Config Properties](https://github.com/eglavin/fork-version/blob/main/README.md#config-properties)
635
- */
636
- declare function defineConfig(config: Config): Config;
637
-
638
- declare function getUserConfig(cliArguments: ForkVersionCLIArgs): Promise<ForkConfig>;
639
-
640
- declare function updateChangelog(config: ForkConfig, logger: Logger, nextVersion: string): Promise<void>;
641
-
642
- declare function commitChanges(config: ForkConfig, logger: Logger, git: Git, files: FileState[], nextVersion: string): Promise<void>;
643
-
644
- declare function tagChanges(config: ForkConfig, logger: Logger, git: Git, nextVersion: string): Promise<void>;
645
-
646
- export { type Commit, type CommitMerge, type CommitNote, CommitParser, type CommitReference, type CommitRevert, type CommitsSinceTag, type Config, type CurrentVersion, FileManager, type FileState, type ForkConfig, ForkConfigSchema, Git, type IFileManager, Logger, type NextVersion, type ParserOptions, commitChanges, createParserOptions, defineConfig, filterRevertedCommits, getCommitsSinceTag, getCurrentVersion, getNextVersion, getUserConfig, inspect, main, tagChanges, updateChangelog, validateConfig };
1
+ import { ParserOptions, createParserOptions } from "./commit-parser/options.js";
2
+ import { ChangelogPresetConfig, ChangelogPresetConfigType, Config, ForkConfig } from "./config/types.js";
3
+ import { Logger } from "./services/logger.js";
4
+ import { FileManager, FileState, IFileManager } from "./files/file-manager.js";
5
+ import { Git } from "./services/git.js";
6
+ import { inspect } from "./commands/inspect.js";
7
+ import { main } from "./commands/main.js";
8
+ import { validateConfig } from "./commands/validate-config.js";
9
+ import { Commit, CommitMerge, CommitNote, CommitReference, CommitRevert } from "./commit-parser/types.js";
10
+ import { CommitParser } from "./commit-parser/commit-parser.js";
11
+ import { filterRevertedCommits } from "./commit-parser/filter-reverted-commits.js";
12
+ import { ForkConfigSchema } from "./config/schema.js";
13
+ import { defineConfig } from "./config/define-config.js";
14
+ import { getUserConfig } from "./config/user-config.js";
15
+ import { CommitsSinceTag, getCommitsSinceTag } from "./process/get-commits.js";
16
+ import { CurrentVersion, getCurrentVersion } from "./process/get-current-version.js";
17
+ import { NextVersion, getNextVersion } from "./process/get-next-version.js";
18
+ import { updateChangelog } from "./process/changelog.js";
19
+ import { commitChanges } from "./process/commit.js";
20
+ import { tagChanges } from "./process/tag.js";
21
+ export { type ChangelogPresetConfig, type ChangelogPresetConfigType, type Commit, type CommitMerge, type CommitNote, CommitParser, type CommitReference, type CommitRevert, type CommitsSinceTag, type Config, type CurrentVersion, FileManager, type FileState, type ForkConfig, ForkConfigSchema, Git, type IFileManager, Logger, type NextVersion, type ParserOptions, commitChanges, createParserOptions, defineConfig, filterRevertedCommits, getCommitsSinceTag, getCurrentVersion, getNextVersion, getUserConfig, inspect, main, tagChanges, updateChangelog, validateConfig };
package/dist/index.js CHANGED
@@ -1,10 +1,19 @@
1
- export { CommitParser, FileManager, ForkConfigSchema, Git, Logger, commitChanges, createParserOptions, filterRevertedCommits, getCommitsSinceTag, getCurrentVersion, getNextVersion, getUserConfig, inspect, main, tagChanges, updateChangelog, validateConfig } from './chunk-X4NB24VR.js';
2
-
3
- // src/config/define-config.ts
4
- function defineConfig(config) {
5
- return config;
6
- }
7
-
8
- export { defineConfig };
9
- //# sourceMappingURL=index.js.map
10
- //# sourceMappingURL=index.js.map
1
+ import { createParserOptions } from "./commit-parser/options.js";
2
+ import { CommitParser } from "./commit-parser/commit-parser.js";
3
+ import { filterRevertedCommits } from "./commit-parser/filter-reverted-commits.js";
4
+ import { getCommitsSinceTag } from "./process/get-commits.js";
5
+ import { getCurrentVersion } from "./process/get-current-version.js";
6
+ import { inspect } from "./commands/inspect.js";
7
+ import { getNextVersion } from "./process/get-next-version.js";
8
+ import { updateChangelog } from "./process/changelog.js";
9
+ import { commitChanges } from "./process/commit.js";
10
+ import { tagChanges } from "./process/tag.js";
11
+ import { main } from "./commands/main.js";
12
+ import { validateConfig } from "./commands/validate-config.js";
13
+ import { ForkConfigSchema } from "./config/schema.js";
14
+ import { defineConfig } from "./config/define-config.js";
15
+ import { Git } from "./services/git.js";
16
+ import { getUserConfig } from "./config/user-config.js";
17
+ import { FileManager } from "./files/file-manager.js";
18
+ import { Logger } from "./services/logger.js";
19
+ export { CommitParser, FileManager, ForkConfigSchema, Git, Logger, commitChanges, createParserOptions, defineConfig, filterRevertedCommits, getCommitsSinceTag, getCurrentVersion, getNextVersion, getUserConfig, inspect, main, tagChanges, updateChangelog, validateConfig };