@breadstone-infrastructure/utilities 0.0.71 → 0.0.72
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 +26 -0
- package/IO/Directory.d.ts +8 -0
- package/IO/Directory.d.ts.map +1 -1
- package/IO/Directory.js +10 -0
- package/IO/Directory.js.map +1 -1
- package/IO/File.d.ts +47 -0
- package/IO/File.d.ts.map +1 -1
- package/IO/File.js +104 -0
- package/IO/File.js.map +1 -1
- package/IO/FileCache.d.ts +46 -0
- package/IO/FileCache.d.ts.map +1 -0
- package/IO/FileCache.js +94 -0
- package/IO/FileCache.js.map +1 -0
- package/IO/FileManifest.d.ts +57 -0
- package/IO/FileManifest.d.ts.map +1 -0
- package/IO/FileManifest.js +105 -0
- package/IO/FileManifest.js.map +1 -0
- package/IO/FileSystem.d.ts +488 -0
- package/IO/FileSystem.d.ts.map +1 -0
- package/IO/FileSystem.js +667 -0
- package/IO/FileSystem.js.map +1 -0
- package/IO/FileTracker.d.ts +73 -0
- package/IO/FileTracker.d.ts.map +1 -0
- package/IO/FileTracker.js +116 -0
- package/IO/FileTracker.js.map +1 -0
- package/IO/Interfaces/IDirectory.d.ts +115 -0
- package/IO/Interfaces/IDirectory.d.ts.map +1 -0
- package/IO/Interfaces/IDirectory.js +3 -0
- package/IO/Interfaces/IDirectory.js.map +1 -0
- package/IO/Interfaces/IFile.d.ts +152 -0
- package/IO/Interfaces/IFile.d.ts.map +1 -0
- package/IO/Interfaces/IFile.js +4 -0
- package/IO/Interfaces/IFile.js.map +1 -0
- package/IO/Interfaces/IFileCache.d.ts +56 -0
- package/IO/Interfaces/IFileCache.d.ts.map +1 -0
- package/IO/Interfaces/IFileCache.js +3 -0
- package/IO/Interfaces/IFileCache.js.map +1 -0
- package/IO/Interfaces/IFileSystem.d.ts +43 -0
- package/IO/Interfaces/IFileSystem.d.ts.map +1 -0
- package/IO/Interfaces/IFileSystem.js +4 -0
- package/IO/Interfaces/IFileSystem.js.map +1 -0
- package/IO/Interfaces/IFileTracker.d.ts +15 -0
- package/IO/Interfaces/IFileTracker.d.ts.map +1 -0
- package/IO/Interfaces/IFileTracker.js +4 -0
- package/IO/Interfaces/IFileTracker.js.map +1 -0
- package/IO/Interfaces/IPath.d.ts +97 -0
- package/IO/Interfaces/IPath.d.ts.map +1 -0
- package/IO/Interfaces/IPath.js +4 -0
- package/IO/Interfaces/IPath.js.map +1 -0
- package/IO/vNext/FileCache.d.ts +1 -1
- package/IO/vNext/FileTracker.d.ts +73 -0
- package/IO/vNext/FileTracker.d.ts.map +1 -0
- package/IO/vNext/FileTracker.js +116 -0
- package/IO/vNext/FileTracker.js.map +1 -0
- package/IO/vNext/Interfaces/IFileTracker.d.ts +15 -0
- package/IO/vNext/Interfaces/IFileTracker.d.ts.map +1 -0
- package/IO/vNext/Interfaces/IFileTracker.js +4 -0
- package/IO/vNext/Interfaces/IFileTracker.js.map +1 -0
- package/Index.d.ts +7 -4
- package/Index.d.ts.map +1 -1
- package/Index.js +7 -4
- package/Index.js.map +1 -1
- package/README.md +36 -36
- package/package.json +2 -2
- package/IO/SymbolikLink.d.ts +0 -6
- package/IO/SymbolikLink.d.ts.map +0 -1
- package/IO/SymbolikLink.js +0 -10
- package/IO/SymbolikLink.js.map +0 -1
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { IGlobOptions } from '../Glob';
|
|
2
|
+
/**
|
|
3
|
+
* Represents a file path utility interface that provides static methods for path manipulations.
|
|
4
|
+
*
|
|
5
|
+
* @public
|
|
6
|
+
*/
|
|
7
|
+
export interface IPath {
|
|
8
|
+
/**
|
|
9
|
+
* Gets the path separator.
|
|
10
|
+
* @returns The path separator string.
|
|
11
|
+
*/
|
|
12
|
+
readonly separator: string;
|
|
13
|
+
/**
|
|
14
|
+
* Changes the extension of a file path.
|
|
15
|
+
* @param path The file path.
|
|
16
|
+
* @param extension The new extension.
|
|
17
|
+
* @returns The file path with the changed extension.
|
|
18
|
+
*/
|
|
19
|
+
changeExtension(path: string, extension: string): string;
|
|
20
|
+
/**
|
|
21
|
+
* Gets the directory name of the given path.
|
|
22
|
+
* @param path The file path.
|
|
23
|
+
* @returns The directory name.
|
|
24
|
+
*/
|
|
25
|
+
getDirectoryName(path: string): string;
|
|
26
|
+
/**
|
|
27
|
+
* Gets the directory segments of the given path.
|
|
28
|
+
* @param path The file path.
|
|
29
|
+
* @returns The directory segments as an array of strings.
|
|
30
|
+
*/
|
|
31
|
+
getDirectorySegments(path: string): Array<string>;
|
|
32
|
+
/**
|
|
33
|
+
* Gets the file name and extension parts of the given path.
|
|
34
|
+
* @param path The file path.
|
|
35
|
+
* @returns The file name.
|
|
36
|
+
*/
|
|
37
|
+
getFileName(path: string): string;
|
|
38
|
+
/**
|
|
39
|
+
* Gets the file name without extension.
|
|
40
|
+
* @param path The file path.
|
|
41
|
+
* @returns The file name without extension.
|
|
42
|
+
*/
|
|
43
|
+
getFileNameWithoutExtension(path: string): string;
|
|
44
|
+
/**
|
|
45
|
+
* Gets the extension of the specified file path.
|
|
46
|
+
* @param path The file path.
|
|
47
|
+
* @param includeDot If true, includes the period before the extension.
|
|
48
|
+
* @returns The file extension.
|
|
49
|
+
*/
|
|
50
|
+
getExtension(path: string, includeDot?: boolean): string;
|
|
51
|
+
/**
|
|
52
|
+
* Gets a cryptographically strong random file name.
|
|
53
|
+
* @param alphanumeric If true, the name will only contain alphanumeric characters.
|
|
54
|
+
* @returns The random file name.
|
|
55
|
+
*/
|
|
56
|
+
getRandomFileName(alphanumeric?: boolean): string;
|
|
57
|
+
/**
|
|
58
|
+
* Combines multiple path segments.
|
|
59
|
+
* @param path The path segments.
|
|
60
|
+
* @returns The combined path.
|
|
61
|
+
*/
|
|
62
|
+
combine(...path: Array<string>): string;
|
|
63
|
+
/**
|
|
64
|
+
* Normalizes file path slashes to be unix-like forward slashes.
|
|
65
|
+
* @param path The file path.
|
|
66
|
+
* @param stripTrailing Pass false to disable removal of trailing slashes.
|
|
67
|
+
* @returns The normalized file path.
|
|
68
|
+
*/
|
|
69
|
+
normalize(path: string, stripTrailing?: boolean): string;
|
|
70
|
+
/**
|
|
71
|
+
* Converts a relative path to an absolute path.
|
|
72
|
+
* @param paths The path segments.
|
|
73
|
+
* @returns The absolute path.
|
|
74
|
+
*/
|
|
75
|
+
resolve(...paths: Array<string>): string;
|
|
76
|
+
/**
|
|
77
|
+
* Determines whether the path is absolute.
|
|
78
|
+
* @param path The file path.
|
|
79
|
+
* @returns True if the path is absolute; otherwise, false.
|
|
80
|
+
*/
|
|
81
|
+
isAbsolute(path: string): boolean;
|
|
82
|
+
/**
|
|
83
|
+
* Finds files and directories using glob patterns.
|
|
84
|
+
* @param pattern The glob pattern(s).
|
|
85
|
+
* @param options Globbing options.
|
|
86
|
+
* @returns Matching file or directory paths.
|
|
87
|
+
*/
|
|
88
|
+
glob(pattern: string | Array<string>, options?: IGlobOptions): Array<string>;
|
|
89
|
+
/**
|
|
90
|
+
* Gets the relative path from one location to another.
|
|
91
|
+
* @param from The source path.
|
|
92
|
+
* @param to The destination path.
|
|
93
|
+
* @returns The relative path.
|
|
94
|
+
*/
|
|
95
|
+
relative(from: string, to: string): string;
|
|
96
|
+
}
|
|
97
|
+
//# sourceMappingURL=IPath.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IPath.d.ts","sourceRoot":"","sources":["../../../src/IO/Interfaces/IPath.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAIvC;;;;GAIG;AACH,MAAM,WAAW,KAAK;IAIlB;;;OAGG;IACH,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAM3B;;;;;OAKG;IACH,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAAC;IAEzD;;;;OAIG;IACH,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;IAEvC;;;;OAIG;IACH,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC;IAElD;;;;OAIG;IACH,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;IAElC;;;;OAIG;IACH,2BAA2B,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;IAElD;;;;;OAKG;IACH,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IAEzD;;;;OAIG;IACH,iBAAiB,CAAC,YAAY,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IAElD;;;;OAIG;IACH,OAAO,CAAC,GAAG,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC;IAExC;;;;;OAKG;IACH,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,aAAa,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IAEzD;;;;OAIG;IACH,OAAO,CAAC,GAAG,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC;IAEzC;;;;OAIG;IACH,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;IAElC;;;;;OAKG;IACH,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC,EAAE,YAAY,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC;IAE7E;;;;;OAKG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC;CAI9C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IPath.js","sourceRoot":"","sources":["../../../src/IO/Interfaces/IPath.ts"],"names":[],"mappings":";AAAA,iBAAiB"}
|
package/IO/vNext/FileCache.d.ts
CHANGED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import type { IFileTracker } from './vNext/Interfaces/IFileTracker';
|
|
2
|
+
/**
|
|
3
|
+
* FileTracker manages and cleans up generated files based on a manifest.
|
|
4
|
+
* It also provides utility methods for writing and tracking files cleanly.
|
|
5
|
+
*
|
|
6
|
+
* @public
|
|
7
|
+
*/
|
|
8
|
+
export declare class FileTracker implements IFileTracker {
|
|
9
|
+
private readonly _rootDir;
|
|
10
|
+
private readonly _manifest;
|
|
11
|
+
/**
|
|
12
|
+
* Constructs a new instance of the `FileTracker` class.
|
|
13
|
+
*
|
|
14
|
+
* @public
|
|
15
|
+
* @param rootDir The root directory where files will be tracked.
|
|
16
|
+
* @param manifestFilename The name of the manifest file (default is '.filetracker.json').
|
|
17
|
+
*/
|
|
18
|
+
constructor(rootDir: string, manifestFilename?: string);
|
|
19
|
+
/**
|
|
20
|
+
* Loads the previous manifest to determine which files were generated in the last run.
|
|
21
|
+
* This is necessary for cleanup operations.
|
|
22
|
+
*
|
|
23
|
+
* @public
|
|
24
|
+
*/
|
|
25
|
+
loadPreviousManifest(): Promise<void>;
|
|
26
|
+
/**
|
|
27
|
+
* Adds a file to the manifest as a generated file.
|
|
28
|
+
* The path is resolved relative to the root directory.
|
|
29
|
+
*
|
|
30
|
+
* @public
|
|
31
|
+
* @param relativePath Path relative to the root directory
|
|
32
|
+
*/
|
|
33
|
+
addGeneratedFile(relativePath: string): void;
|
|
34
|
+
/**
|
|
35
|
+
* Cleans up files that were generated in previous runs but not in the current run.
|
|
36
|
+
* This helps to remove stale files that are no longer needed.
|
|
37
|
+
*
|
|
38
|
+
* @public
|
|
39
|
+
*/
|
|
40
|
+
cleanup(): Promise<void>;
|
|
41
|
+
/**
|
|
42
|
+
* Saves the current manifest, which includes all files tracked in this run.
|
|
43
|
+
* This should be called after all file operations are complete.
|
|
44
|
+
*
|
|
45
|
+
* @public
|
|
46
|
+
*/
|
|
47
|
+
saveManifest(): Promise<void>;
|
|
48
|
+
/**
|
|
49
|
+
* Writes a file to disk and tracks it in the manifest.
|
|
50
|
+
*
|
|
51
|
+
* @public
|
|
52
|
+
* @param relativePath Path relative to the root directory
|
|
53
|
+
* @param content File content
|
|
54
|
+
* @param options Optional write options
|
|
55
|
+
*/
|
|
56
|
+
writeFile(relativePath: string, content: string): Promise<void>;
|
|
57
|
+
/**
|
|
58
|
+
* Executes a custom file-writing callback and tracks the file.
|
|
59
|
+
*
|
|
60
|
+
* @public
|
|
61
|
+
* @param relativePath Path relative to the root directory
|
|
62
|
+
* @param writer A callback that receives the absolute path to write content
|
|
63
|
+
*/
|
|
64
|
+
trackFile(relativePath: string, writer: (absolutePath: string) => Promise<void>): Promise<void>;
|
|
65
|
+
/**
|
|
66
|
+
* Ensures that the directory for the given file path exists.
|
|
67
|
+
*
|
|
68
|
+
* @private
|
|
69
|
+
* @param fullFilePath The full path of the file to ensure its directory exists.
|
|
70
|
+
*/
|
|
71
|
+
private ensureDirectoryExists;
|
|
72
|
+
}
|
|
73
|
+
//# sourceMappingURL=FileTracker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FileTracker.d.ts","sourceRoot":"","sources":["../../../src/IO/vNext/FileTracker.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAO9D;;;;;GAKG;AACH,qBAAa,WAAY,YAAW,YAAY;IAI5C,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAS;IAClC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAe;IAMzC;;;;;;OAMG;gBACgB,OAAO,EAAE,MAAM,EAAE,gBAAgB,GAAE,MAA4B;IAWlF;;;;;OAKG;IACU,oBAAoB,IAAI,OAAO,CAAC,IAAI,CAAC;IAIlD;;;;;;OAMG;IACI,gBAAgB,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI;IAKnD;;;;;OAKG;IACU,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAIrC;;;;;OAKG;IACU,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC;IAI1C;;;;;;;OAOG;IACU,SAAS,CAAC,YAAY,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAO5E;;;;;;OAMG;IACU,SAAS,CAAC,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAO5G;;;;;OAKG;YACW,qBAAqB;CAUtC"}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// #region Imports
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.FileTracker = void 0;
|
|
5
|
+
const FileManifest_1 = require("../FileManifest");
|
|
6
|
+
const Path_1 = require("../Path");
|
|
7
|
+
const File_1 = require("../File");
|
|
8
|
+
const Directory_1 = require("../Directory");
|
|
9
|
+
// #endregion
|
|
10
|
+
/**
|
|
11
|
+
* FileTracker manages and cleans up generated files based on a manifest.
|
|
12
|
+
* It also provides utility methods for writing and tracking files cleanly.
|
|
13
|
+
*
|
|
14
|
+
* @public
|
|
15
|
+
*/
|
|
16
|
+
class FileTracker {
|
|
17
|
+
// #region Fields
|
|
18
|
+
_rootDir;
|
|
19
|
+
_manifest;
|
|
20
|
+
// #endregion
|
|
21
|
+
// #region Ctor
|
|
22
|
+
/**
|
|
23
|
+
* Constructs a new instance of the `FileTracker` class.
|
|
24
|
+
*
|
|
25
|
+
* @public
|
|
26
|
+
* @param rootDir The root directory where files will be tracked.
|
|
27
|
+
* @param manifestFilename The name of the manifest file (default is '.filetracker.json').
|
|
28
|
+
*/
|
|
29
|
+
constructor(rootDir, manifestFilename = '.filetracker.json') {
|
|
30
|
+
this._rootDir = Path_1.Path.resolve(rootDir);
|
|
31
|
+
this._manifest = new FileManifest_1.FileManifest({
|
|
32
|
+
manifestPath: Path_1.Path.combine(this._rootDir, manifestFilename)
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
// #endregion
|
|
36
|
+
// #region Methods
|
|
37
|
+
/**
|
|
38
|
+
* Loads the previous manifest to determine which files were generated in the last run.
|
|
39
|
+
* This is necessary for cleanup operations.
|
|
40
|
+
*
|
|
41
|
+
* @public
|
|
42
|
+
*/
|
|
43
|
+
async loadPreviousManifest() {
|
|
44
|
+
await this._manifest.load();
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Adds a file to the manifest as a generated file.
|
|
48
|
+
* The path is resolved relative to the root directory.
|
|
49
|
+
*
|
|
50
|
+
* @public
|
|
51
|
+
* @param relativePath Path relative to the root directory
|
|
52
|
+
*/
|
|
53
|
+
addGeneratedFile(relativePath) {
|
|
54
|
+
const fullPath = Path_1.Path.resolve(this._rootDir, relativePath);
|
|
55
|
+
this._manifest.add(fullPath);
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Cleans up files that were generated in previous runs but not in the current run.
|
|
59
|
+
* This helps to remove stale files that are no longer needed.
|
|
60
|
+
*
|
|
61
|
+
* @public
|
|
62
|
+
*/
|
|
63
|
+
async cleanup() {
|
|
64
|
+
await this._manifest.cleanup();
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Saves the current manifest, which includes all files tracked in this run.
|
|
68
|
+
* This should be called after all file operations are complete.
|
|
69
|
+
*
|
|
70
|
+
* @public
|
|
71
|
+
*/
|
|
72
|
+
async saveManifest() {
|
|
73
|
+
await this._manifest.save();
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Writes a file to disk and tracks it in the manifest.
|
|
77
|
+
*
|
|
78
|
+
* @public
|
|
79
|
+
* @param relativePath Path relative to the root directory
|
|
80
|
+
* @param content File content
|
|
81
|
+
* @param options Optional write options
|
|
82
|
+
*/
|
|
83
|
+
async writeFile(relativePath, content) {
|
|
84
|
+
const fullPath = Path_1.Path.resolve(this._rootDir, relativePath);
|
|
85
|
+
await this.ensureDirectoryExists(fullPath);
|
|
86
|
+
await File_1.File.writeAllTextAsync(fullPath, content);
|
|
87
|
+
this.addGeneratedFile(relativePath);
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Executes a custom file-writing callback and tracks the file.
|
|
91
|
+
*
|
|
92
|
+
* @public
|
|
93
|
+
* @param relativePath Path relative to the root directory
|
|
94
|
+
* @param writer A callback that receives the absolute path to write content
|
|
95
|
+
*/
|
|
96
|
+
async trackFile(relativePath, writer) {
|
|
97
|
+
const fullPath = Path_1.Path.resolve(this._rootDir, relativePath);
|
|
98
|
+
await this.ensureDirectoryExists(fullPath);
|
|
99
|
+
await writer(fullPath);
|
|
100
|
+
this.addGeneratedFile(relativePath);
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Ensures that the directory for the given file path exists.
|
|
104
|
+
*
|
|
105
|
+
* @private
|
|
106
|
+
* @param fullFilePath The full path of the file to ensure its directory exists.
|
|
107
|
+
*/
|
|
108
|
+
async ensureDirectoryExists(fullFilePath) {
|
|
109
|
+
const dir = Path_1.Path.getDirectoryName(fullFilePath);
|
|
110
|
+
if (!Directory_1.Directory.exists(dir)) {
|
|
111
|
+
await Directory_1.Directory.createAsync(dir);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
exports.FileTracker = FileTracker;
|
|
116
|
+
//# sourceMappingURL=FileTracker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FileTracker.js","sourceRoot":"","sources":["../../../src/IO/vNext/FileTracker.ts"],"names":[],"mappings":";AAAA,kBAAkB;;;AAElB,kDAA+C;AAE/C,kCAA+B;AAC/B,kCAA+B;AAC/B,4CAAyC;AAEzC,aAAa;AAEb;;;;;GAKG;AACH,MAAa,WAAW;IAEpB,iBAAiB;IAEA,QAAQ,CAAS;IACjB,SAAS,CAAe;IAEzC,aAAa;IAEb,eAAe;IAEf;;;;;;OAMG;IACH,YAAmB,OAAe,EAAE,mBAA2B,mBAAmB;QAC9E,IAAI,CAAC,QAAQ,GAAG,WAAI,CAAC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,EAAE,YAAY,CAAC,CAAC;QAC3D,MAAM,IAAI,CAAC,qBAAqB,CAAC,QAAQ,CAAC,CAAC;QAC3C,MAAM,MAAM,CAAC,QAAQ,CAAC,CAAC;QACvB,IAAI,CAAC,gBAAgB,CAAC,YAAY,CAAC,CAAC;IACxC,CAAC;IAED;;;;;OAKG;IACK,KAAK,CAAC,qBAAqB,CAAC,YAAoB;QACpD,MAAM,GAAG,GAAG,WAAI,CAAC,gBAAgB,CAAC,YAAY,CAAC,CAAC;QAEhD,IAAI,CAAC,qBAAS,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC;YACzB,MAAM,qBAAS,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;QACrC,CAAC;IACL,CAAC;CAIJ;AApHD,kCAoHC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { WriteFileOptions } from 'fs';
|
|
2
|
+
/**
|
|
3
|
+
* Interface defining the contract for tracking generated files.
|
|
4
|
+
*
|
|
5
|
+
* @public
|
|
6
|
+
*/
|
|
7
|
+
export interface IFileTracker {
|
|
8
|
+
loadPreviousManifest(): Promise<void>;
|
|
9
|
+
addGeneratedFile(relativePath: string): void;
|
|
10
|
+
cleanup(): Promise<void>;
|
|
11
|
+
saveManifest(): Promise<void>;
|
|
12
|
+
writeFile(relativePath: string, content: string, options?: WriteFileOptions): Promise<void>;
|
|
13
|
+
trackFile(relativePath: string, writer: (absolutePath: string) => Promise<void>): Promise<void>;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=IFileTracker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IFileTracker.d.ts","sourceRoot":"","sources":["../../../../src/IO/vNext/Interfaces/IFileTracker.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,IAAI,CAAC;AAI3C;;;;GAIG;AACH,MAAM,WAAW,YAAY;IACzB,oBAAoB,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACtC,gBAAgB,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7C,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACzB,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9B,SAAS,CAAC,YAAY,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5F,SAAS,CAAC,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACnG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IFileTracker.js","sourceRoot":"","sources":["../../../../src/IO/vNext/Interfaces/IFileTracker.ts"],"names":[],"mappings":";AAAA,kBAAkB"}
|
package/Index.d.ts
CHANGED
|
@@ -18,6 +18,7 @@ export * from './IO/Directory';
|
|
|
18
18
|
export * from './IO/File';
|
|
19
19
|
export * from './IO/FileSystemWatcher';
|
|
20
20
|
export * from './IO/FileSystemInfo';
|
|
21
|
+
export * from './IO/FileManifest';
|
|
21
22
|
export * from './IO/TemporaryDirectory';
|
|
22
23
|
export * from './IO/TemporaryFile';
|
|
23
24
|
export * from './IO/Path';
|
|
@@ -49,10 +50,12 @@ export * from './System/String';
|
|
|
49
50
|
export * from './System/Time';
|
|
50
51
|
export * from './System/Version';
|
|
51
52
|
export { Languages } from './Intl/Languages';
|
|
52
|
-
export { FileSystem } from './IO/
|
|
53
|
-
export {
|
|
54
|
-
export
|
|
55
|
-
export type {
|
|
53
|
+
export { FileSystem } from './IO/FileSystem.js';
|
|
54
|
+
export type { IFileSystem, IFileSystemEventMap } from './IO/Interfaces/IFileSystem.js';
|
|
55
|
+
export { FileCache } from './IO/FileCache.js';
|
|
56
|
+
export type { IFileCache, IFileCacheOptions } from './IO/Interfaces/IFileCache.js';
|
|
57
|
+
export { FileTracker } from './IO/FileTracker';
|
|
58
|
+
export type { IFileTracker } from './IO/Interfaces/IFileTracker';
|
|
56
59
|
export type { ILogger } from './Logging/vNext/Interfaces/ILogger.js';
|
|
57
60
|
export { logSeparator, logTree, logTag, logSummary, logPair, logTask, logBanner } from './Logging/vNext/LoggerExtensions.js';
|
|
58
61
|
export { ConsoleLogger } from './Logging/vNext/ConsoleLogger.js';
|
package/Index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Index.d.ts","sourceRoot":"","sources":["../src/Index.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAC;AAE1B,OAAO,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AACxE,YAAY,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAChE,YAAY,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAClE,YAAY,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACxE,YAAY,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAC1E,YAAY,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACtE,YAAY,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,YAAY,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AACvE,YAAY,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzD,cAAc,uBAAuB,CAAC;AACtC,cAAc,kCAAkC,CAAC;AACjD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,WAAW,CAAC;AAC1B,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAAC;AACpC,cAAc,yBAAyB,CAAC;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,EAAE,aAAa,EAAE,SAAS,EAAE,GAAG,EAAE,SAAS,EAAE,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,2CAA2C,CAAC;AAC5kB,OAAO,EAAE,CAAC,EAAE,MAAM,iCAAiC,CAAC"}
|
package/Index.js
CHANGED
|
@@ -14,8 +14,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.
|
|
18
|
-
exports.t = exports.text = exports.rainbow = exports.bgRainbow = exports.symbol = exports.style = exports.yellowBright = exports.yellow = exports.whiteBright = exports.white = exports.underline = exports.strikethrough = exports.reset = exports.redBright = exports.red = exports.overlined = exports.magentaBright = exports.magenta = void 0;
|
|
17
|
+
exports.inverse = exports.hidden = exports.grey = exports.greenBright = exports.green = exports.gray = exports.framed = exports.doubleunderline = exports.dim = exports.cyanBright = exports.cyan = exports.bold = exports.blueBright = exports.blue = exports.blink = exports.blackBright = exports.black = exports.bgYellowBright = exports.bgYellow = exports.bgWhiteBright = exports.bgWhite = exports.bgRedBright = exports.bgRed = exports.bgMagentaBright = exports.bgMagenta = exports.bgGrey = exports.bgGreenBright = exports.bgGreen = exports.bgGray = exports.bgCyanBright = exports.bgCyan = exports.bgBlueBright = exports.bgBlue = exports.bgBlackBright = exports.bgBlack = exports.ConsoleLogger = exports.logBanner = exports.logTask = exports.logPair = exports.logSummary = exports.logTag = exports.logTree = exports.logSeparator = exports.FileTracker = exports.FileCache = exports.FileSystem = exports.Languages = exports.ProgramBuilder = exports.Program = exports.ProgramCommandBase = void 0;
|
|
18
|
+
exports.t = exports.text = exports.rainbow = exports.bgRainbow = exports.symbol = exports.style = exports.yellowBright = exports.yellow = exports.whiteBright = exports.white = exports.underline = exports.strikethrough = exports.reset = exports.redBright = exports.red = exports.overlined = exports.magentaBright = exports.magenta = exports.italic = void 0;
|
|
19
19
|
require("reflect-metadata");
|
|
20
20
|
var ProgramCommandBase_1 = require("./Cli/Abstracts/ProgramCommandBase");
|
|
21
21
|
Object.defineProperty(exports, "ProgramCommandBase", { enumerable: true, get: function () { return ProgramCommandBase_1.ProgramCommandBase; } });
|
|
@@ -31,6 +31,7 @@ __exportStar(require("./IO/Directory"), exports);
|
|
|
31
31
|
__exportStar(require("./IO/File"), exports);
|
|
32
32
|
__exportStar(require("./IO/FileSystemWatcher"), exports);
|
|
33
33
|
__exportStar(require("./IO/FileSystemInfo"), exports);
|
|
34
|
+
__exportStar(require("./IO/FileManifest"), exports);
|
|
34
35
|
__exportStar(require("./IO/TemporaryDirectory"), exports);
|
|
35
36
|
__exportStar(require("./IO/TemporaryFile"), exports);
|
|
36
37
|
__exportStar(require("./IO/Path"), exports);
|
|
@@ -59,10 +60,12 @@ __exportStar(require("./System/Version"), exports);
|
|
|
59
60
|
var Languages_1 = require("./Intl/Languages");
|
|
60
61
|
Object.defineProperty(exports, "Languages", { enumerable: true, get: function () { return Languages_1.Languages; } });
|
|
61
62
|
// vNext
|
|
62
|
-
var FileSystem_js_1 = require("./IO/
|
|
63
|
+
var FileSystem_js_1 = require("./IO/FileSystem.js");
|
|
63
64
|
Object.defineProperty(exports, "FileSystem", { enumerable: true, get: function () { return FileSystem_js_1.FileSystem; } });
|
|
64
|
-
var FileCache_js_1 = require("./IO/
|
|
65
|
+
var FileCache_js_1 = require("./IO/FileCache.js");
|
|
65
66
|
Object.defineProperty(exports, "FileCache", { enumerable: true, get: function () { return FileCache_js_1.FileCache; } });
|
|
67
|
+
var FileTracker_1 = require("./IO/FileTracker");
|
|
68
|
+
Object.defineProperty(exports, "FileTracker", { enumerable: true, get: function () { return FileTracker_1.FileTracker; } });
|
|
66
69
|
var LoggerExtensions_js_1 = require("./Logging/vNext/LoggerExtensions.js");
|
|
67
70
|
Object.defineProperty(exports, "logSeparator", { enumerable: true, get: function () { return LoggerExtensions_js_1.logSeparator; } });
|
|
68
71
|
Object.defineProperty(exports, "logTree", { enumerable: true, get: function () { return LoggerExtensions_js_1.logTree; } });
|
package/Index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Index.js","sourceRoot":"","sources":["../src/Index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,4BAA0B;AAE1B,yEAAwE;AAA/D,wHAAA,kBAAkB,OAAA;AAO3B,yCAAwC;AAA/B,kGAAA,OAAO,OAAA;AAChB,gEAA+D;AAAtD,gHAAA,cAAc,OAAA;AAGvB,wDAAsC;AACtC,mEAAiD;AACjD,6DAA2C;AAC3C,6DAA2C;AAC3C,iDAA+B;AAC/B,4CAA0B;AAC1B,yDAAuC;AACvC,sDAAoC;AACpC,0DAAwC;AACxC,qDAAmC;AACnC,4CAA0B;AAC1B,0DAAwC;AACxC,4CAA0B;AAC1B,4CAA0B;AAC1B,gDAA8B;AAE9B,6DAA2C;AAE3C,6DAA2C;AAC3C,iDAA+B;AAC/B,8CAA4B;AAE5B,gDAA8B;AAC9B,iDAA+B;AAC/B,kDAAgC;AAChC,mDAAiC;AACjC,kDAAgC;AAChC,qDAAmC;AACnC,iDAA+B;AAG/B,gDAA8B;AAC9B,mDAAiC;AACjC,mDAAiC;AACjC,qDAAmC;AACnC,kDAAgC;AAChC,gDAA8B;AAC9B,mDAAiC;AACjC,8CAA6C;AAApC,sGAAA,SAAS,OAAA;AAElB,QAAQ;AACR,
|
|
1
|
+
{"version":3,"file":"Index.js","sourceRoot":"","sources":["../src/Index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,4BAA0B;AAE1B,yEAAwE;AAA/D,wHAAA,kBAAkB,OAAA;AAO3B,yCAAwC;AAA/B,kGAAA,OAAO,OAAA;A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infrastructure/utilities
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
| Package Status | Source |
|
|
4
|
+
|----------------|--------|
|
|
5
|
+
| [](https://www.npmjs.com/package/@breadstone-infrastructure/utilities) | [infra/utilities](../../infra/utilities) |
|
|
6
|
+
|
|
7
|
+
> Common utility classes and functions for Breadstone projects.
|
|
8
|
+
> CLI framework, file system, logging, DI, and more for Node.js/TypeScript monorepos.
|
|
6
9
|
|
|
7
10
|
---
|
|
8
11
|
|
|
9
|
-
##
|
|
12
|
+
## 📁 Project Structure
|
|
10
13
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
- **System Utilities**: Helpers for strings, arrays, numbers, guards, formatting, and more.
|
|
16
|
-
- **TypeScript-first**: Fully typed, modern codebase.
|
|
17
|
-
- **Nx Workspace**: Built for scalable, maintainable monorepo development.
|
|
14
|
+
Part of the monorepo [`mosaik`](https://github.com/RueDeRennes/mosaik)
|
|
15
|
+
Package path: `infra/utilities`
|
|
16
|
+
Version: see [npm](https://www.npmjs.com/package/@breadstone-infrastructure/utilities)
|
|
17
|
+
License: MIT
|
|
18
18
|
|
|
19
19
|
---
|
|
20
20
|
|
|
21
|
-
## Installation
|
|
21
|
+
## 📦 Installation
|
|
22
22
|
|
|
23
|
-
```
|
|
23
|
+
```bash
|
|
24
24
|
yarn add @breadstone-infrastructure/utilities
|
|
25
25
|
# or
|
|
26
26
|
npm install @breadstone-infrastructure/utilities
|
|
@@ -28,7 +28,7 @@ npm install @breadstone-infrastructure/utilities
|
|
|
28
28
|
|
|
29
29
|
---
|
|
30
30
|
|
|
31
|
-
## Usage
|
|
31
|
+
## 🔧 Usage
|
|
32
32
|
|
|
33
33
|
Import and use utilities in your TypeScript/Node.js projects:
|
|
34
34
|
|
|
@@ -51,38 +51,38 @@ const content = File.readAllText(files[0]);
|
|
|
51
51
|
|
|
52
52
|
---
|
|
53
53
|
|
|
54
|
-
##
|
|
54
|
+
## ⚙️ Features
|
|
55
55
|
|
|
56
|
-
|
|
56
|
+
- CLI framework for robust CLI tools
|
|
57
|
+
- File system utilities for files, directories, globs, JSON, RESX, templates, etc.
|
|
58
|
+
- Flexible logger with colorized output and advanced formatting
|
|
59
|
+
- Lightweight DI container
|
|
60
|
+
- System utilities for strings, arrays, numbers, formatting, and more
|
|
61
|
+
- TypeScript-first, modern codebase
|
|
62
|
+
- Nx Workspace integration
|
|
57
63
|
|
|
58
|
-
|
|
59
|
-
- `ProgramBuilder` – Fluent builder for CLI programs.
|
|
60
|
-
- `ProgramCommandBase` – Base class for CLI commands.
|
|
61
|
-
- Argument and command interfaces for strong typing.
|
|
64
|
+
---
|
|
62
65
|
|
|
63
|
-
|
|
66
|
+
## 🛠 Recommendations
|
|
64
67
|
|
|
65
|
-
-
|
|
66
|
-
-
|
|
67
|
-
- `FileSystem`, `FileCache` – Abstracted file system and caching (vNext).
|
|
68
|
-
- `TemporaryFile`, `TemporaryDirectory` – Easy temp file/dir management.
|
|
68
|
+
- Use with other Breadstone packages for CLI and automation tools.
|
|
69
|
+
- Integrate into your Nx workspace for shared utilities.
|
|
69
70
|
|
|
70
|
-
|
|
71
|
+
---
|
|
71
72
|
|
|
72
|
-
|
|
73
|
-
- `ConsoleLogger` – Simple console logger (vNext).
|
|
74
|
-
- `LoggerUtils` – Helpers for logging trees, summaries, etc.
|
|
75
|
-
- `logSeparator`, `logTree`, `logTag`, `logSummary`, `logPair`, `logTask`, `logBanner` – Advanced log formatting.
|
|
73
|
+
## 📦 Publishing
|
|
76
74
|
|
|
77
|
-
|
|
75
|
+
```bash
|
|
76
|
+
yarn nx run utilities:publish
|
|
77
|
+
```
|
|
78
78
|
|
|
79
|
-
|
|
80
|
-
- `inject` – Helper for dependency injection.
|
|
79
|
+
---
|
|
81
80
|
|
|
82
|
-
|
|
81
|
+
## 📄 License
|
|
83
82
|
|
|
84
|
-
|
|
83
|
+
MIT © Breadstone
|
|
85
84
|
|
|
85
|
+
---
|
|
86
86
|
---
|
|
87
87
|
|
|
88
88
|
## Example: CLI Program
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@breadstone-infrastructure/utilities",
|
|
3
3
|
"description": "Common utility classes and functions",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.72",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "andre.wehlert <awehlert@breadstone.de> (https://www.breadstone.de)",
|
|
7
7
|
"repository": {
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"dependencies": {
|
|
16
16
|
"argparse": "^2.0.1",
|
|
17
17
|
"dir-glob": "^3.0.1",
|
|
18
|
-
"es-toolkit": "^1.39.
|
|
18
|
+
"es-toolkit": "^1.39.6",
|
|
19
19
|
"fast-glob": "^3.3.3",
|
|
20
20
|
"fs-extra": "^11.3.0",
|
|
21
21
|
"jsonc-parser": "^3.3.1",
|
package/IO/SymbolikLink.d.ts
DELETED
package/IO/SymbolikLink.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SymbolikLink.d.ts","sourceRoot":"","sources":["../../src/IO/SymbolikLink.ts"],"names":[],"mappings":"AAAA,oBAAY,YAAY;IACpB,IAAI,SAAS;IACb,SAAS,QAAQ;IACjB,QAAQ,aAAa;CACxB"}
|
package/IO/SymbolikLink.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SymbolicLink = void 0;
|
|
4
|
-
var SymbolicLink;
|
|
5
|
-
(function (SymbolicLink) {
|
|
6
|
-
SymbolicLink["File"] = "file";
|
|
7
|
-
SymbolicLink["Directory"] = "dir";
|
|
8
|
-
SymbolicLink["Junction"] = "junction";
|
|
9
|
-
})(SymbolicLink || (exports.SymbolicLink = SymbolicLink = {}));
|
|
10
|
-
//# sourceMappingURL=SymbolikLink.js.map
|
package/IO/SymbolikLink.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SymbolikLink.js","sourceRoot":"","sources":["../../src/IO/SymbolikLink.ts"],"names":[],"mappings":";;;AAAA,IAAY,YAIX;AAJD,WAAY,YAAY;IACpB,6BAAa,CAAA;IACb,iCAAiB,CAAA;IACjB,qCAAqB,CAAA;AACzB,CAAC,EAJW,YAAY,4BAAZ,YAAY,QAIvB"}
|