fork-version 5.1.3 → 5.1.4
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 +8 -0
- package/README.md +3 -0
- package/dist/files/file-manager.d.ts +7 -1
- package/dist/files/file-manager.js +9 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Fork Version
|
|
2
2
|
|
|
3
|
+
## [5.1.4](https://github.com/eglavin/fork-version/compare/v5.1.3...v5.1.4) (2026-04-18)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Refactor
|
|
7
|
+
|
|
8
|
+
* add defineFileManager function ([6e0f437](https://github.com/eglavin/fork-version/commit/6e0f4371824a232f85880a80b218d13b3decb25f))
|
|
9
|
+
|
|
10
|
+
|
|
3
11
|
## [5.1.3](https://github.com/eglavin/fork-version/compare/v5.1.2...v5.1.3) (2026-04-18)
|
|
4
12
|
|
|
5
13
|
|
package/README.md
CHANGED
|
@@ -574,6 +574,9 @@ Example `test.json` file:
|
|
|
574
574
|
|
|
575
575
|
Example Custom File Manager implementation:
|
|
576
576
|
|
|
577
|
+
- [Using a class to define a file manager](./examples/custom-file-manager/fork.config.ts)
|
|
578
|
+
- [Using the defineFileManager function](./examples/custom-file-manager/fork.config.defineFileManager.ts)
|
|
579
|
+
|
|
577
580
|
```ts
|
|
578
581
|
// fork.config.ts
|
|
579
582
|
import { readFile, writeFile } from "node:fs/promises";
|
|
@@ -61,6 +61,12 @@ interface IFileManager {
|
|
|
61
61
|
*/
|
|
62
62
|
isSupportedFile(filePath: string): boolean;
|
|
63
63
|
}
|
|
64
|
+
/**
|
|
65
|
+
* Helper function to define a custom file manager with proper typing.
|
|
66
|
+
*
|
|
67
|
+
* [Fork-Version - Custom File Managers](https://github.com/eglavin/fork-version#custom-file-updaters)
|
|
68
|
+
*/
|
|
69
|
+
declare function defineFileManager(fileManager: IFileManager): IFileManager;
|
|
64
70
|
declare class FileManager {
|
|
65
71
|
#private;
|
|
66
72
|
constructor(config: ForkConfig, logger: Logger);
|
|
@@ -90,4 +96,4 @@ declare class FileManager {
|
|
|
90
96
|
write(fileState: FileState, newVersion: string): Promise<void>;
|
|
91
97
|
}
|
|
92
98
|
//#endregion
|
|
93
|
-
export { FileManager, FileState, IFileManager, MissingPropertyException };
|
|
99
|
+
export { FileManager, FileState, IFileManager, MissingPropertyException, defineFileManager };
|
|
@@ -22,6 +22,14 @@ var MissingPropertyException = class extends Error {
|
|
|
22
22
|
this.propertyName = propertyName;
|
|
23
23
|
}
|
|
24
24
|
};
|
|
25
|
+
/**
|
|
26
|
+
* Helper function to define a custom file manager with proper typing.
|
|
27
|
+
*
|
|
28
|
+
* [Fork-Version - Custom File Managers](https://github.com/eglavin/fork-version#custom-file-updaters)
|
|
29
|
+
*/
|
|
30
|
+
function defineFileManager(fileManager) {
|
|
31
|
+
return fileManager;
|
|
32
|
+
}
|
|
25
33
|
var FileManager = class {
|
|
26
34
|
#config;
|
|
27
35
|
#logger;
|
|
@@ -97,4 +105,4 @@ var FileManager = class {
|
|
|
97
105
|
}
|
|
98
106
|
};
|
|
99
107
|
//#endregion
|
|
100
|
-
export { FileManager, MissingPropertyException };
|
|
108
|
+
export { FileManager, MissingPropertyException, defineFileManager };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ParserOptions, createParserOptions } from "./commit-parser/options.js";
|
|
2
2
|
import { Logger } from "./services/logger.js";
|
|
3
|
-
import { FileManager, FileState, IFileManager, MissingPropertyException } from "./files/file-manager.js";
|
|
3
|
+
import { FileManager, FileState, IFileManager, MissingPropertyException, defineFileManager } from "./files/file-manager.js";
|
|
4
4
|
import { ChangelogPresetConfig, ChangelogPresetConfigType, Config, ForkConfig } from "./config/types.js";
|
|
5
5
|
import { Git } from "./services/git.js";
|
|
6
6
|
import { inspect } from "./commands/inspect.js";
|
|
@@ -18,4 +18,4 @@ import { NextVersion, getNextVersion } from "./process/get-next-version.js";
|
|
|
18
18
|
import { updateChangelog } from "./process/changelog.js";
|
|
19
19
|
import { commitChanges } from "./process/commit.js";
|
|
20
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, ForkConfigJSONSchema, ForkConfigJSSchema, Git, type IFileManager, Logger, MissingPropertyException, type NextVersion, type ParserOptions, commitChanges, createParserOptions, defineConfig, filterRevertedCommits, getCommitsSinceTag, getCurrentVersion, getNextVersion, getUserConfig, inspect, main, tagChanges, updateChangelog, validateConfig };
|
|
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, ForkConfigJSONSchema, ForkConfigJSSchema, Git, type IFileManager, Logger, MissingPropertyException, type NextVersion, type ParserOptions, commitChanges, createParserOptions, defineConfig, defineFileManager, filterRevertedCommits, getCommitsSinceTag, getCurrentVersion, getNextVersion, getUserConfig, inspect, main, tagChanges, updateChangelog, validateConfig };
|
package/dist/index.js
CHANGED
|
@@ -14,6 +14,6 @@ import { ForkConfigJSONSchema, ForkConfigJSSchema } from "./config/schema.js";
|
|
|
14
14
|
import { defineConfig } from "./config/define-config.js";
|
|
15
15
|
import { Git } from "./services/git.js";
|
|
16
16
|
import { getUserConfig } from "./config/user-config.js";
|
|
17
|
-
import { FileManager, MissingPropertyException } from "./files/file-manager.js";
|
|
17
|
+
import { FileManager, MissingPropertyException, defineFileManager } from "./files/file-manager.js";
|
|
18
18
|
import { Logger } from "./services/logger.js";
|
|
19
|
-
export { CommitParser, FileManager, ForkConfigJSONSchema, ForkConfigJSSchema, Git, Logger, MissingPropertyException, commitChanges, createParserOptions, defineConfig, filterRevertedCommits, getCommitsSinceTag, getCurrentVersion, getNextVersion, getUserConfig, inspect, main, tagChanges, updateChangelog, validateConfig };
|
|
19
|
+
export { CommitParser, FileManager, ForkConfigJSONSchema, ForkConfigJSSchema, Git, Logger, MissingPropertyException, commitChanges, createParserOptions, defineConfig, defineFileManager, filterRevertedCommits, getCommitsSinceTag, getCurrentVersion, getNextVersion, getUserConfig, inspect, main, tagChanges, updateChangelog, validateConfig };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fork-version",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.4",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Fork-Version automates version control tasks such as determining, updating, and committing versions, files, and changelogs, simplifying the process when adhering to the conventional commit standard.",
|
|
6
6
|
"keywords": [
|