@webiny/stdlib 0.0.3 → 0.0.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/README.md +1 -0
- package/dist/README.md +1 -0
- package/dist/node/features/HashFolderTool/HashFolderTool.d.ts +19 -0
- package/dist/node/features/HashFolderTool/HashFolderTool.d.ts.map +1 -0
- package/dist/node/features/HashFolderTool/HashFolderTool.js +99 -0
- package/dist/node/features/HashFolderTool/HashFolderTool.js.map +1 -0
- package/dist/node/features/HashFolderTool/abstractions/HashFolderTool.d.ts +32 -0
- package/dist/node/features/HashFolderTool/abstractions/HashFolderTool.d.ts.map +1 -0
- package/dist/node/features/HashFolderTool/abstractions/HashFolderTool.js +3 -0
- package/dist/node/features/HashFolderTool/abstractions/HashFolderTool.js.map +1 -0
- package/dist/node/features/HashFolderTool/abstractions/index.d.ts +2 -0
- package/dist/node/features/HashFolderTool/abstractions/index.d.ts.map +1 -0
- package/dist/node/features/HashFolderTool/abstractions/index.js +2 -0
- package/dist/node/features/HashFolderTool/abstractions/index.js.map +1 -0
- package/dist/node/features/HashFolderTool/feature.d.ts +5 -0
- package/dist/node/features/HashFolderTool/feature.d.ts.map +1 -0
- package/dist/node/features/HashFolderTool/feature.js +9 -0
- package/dist/node/features/HashFolderTool/feature.js.map +1 -0
- package/dist/node/features/HashFolderTool/index.d.ts +4 -0
- package/dist/node/features/HashFolderTool/index.d.ts.map +1 -0
- package/dist/node/features/HashFolderTool/index.js +4 -0
- package/dist/node/features/HashFolderTool/index.js.map +1 -0
- package/dist/node/index.d.ts +1 -0
- package/dist/node/index.d.ts.map +1 -1
- package/dist/node/index.js +1 -0
- package/dist/node/index.js.map +1 -1
- package/dist/package.json +4 -4
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -44,6 +44,7 @@ The package is ESM-only and ships three subpath exports. Because each is a separ
|
|
|
44
44
|
| `NdJsonReaderTool` / `NdJsonReaderToolFeature` | Parse NDJSON from files, streams, or in-memory lines with checkpoint support — [docs](src/node/features/NdJsonReaderTool/README.md) |
|
|
45
45
|
| `ReadStreamFactory` / `ReadStreamFactoryFeature` | Disposable `node:fs` read streams via `AsyncDisposable` — [docs](src/node/features/ReadStreamFactory/README.md) |
|
|
46
46
|
| `PackageJsonFileTool` / `PackageJsonFileToolFeature` | Read, validate, mutate, and write `package.json` files — [docs](src/node/features/PackageJsonFileTool/README.md) |
|
|
47
|
+
| `HashFolderTool` / `HashFolderToolFeature` | Deterministic SHA-256 hash of a folder's contents — [docs](src/node/features/HashFolderTool/README.md) |
|
|
47
48
|
|
|
48
49
|
---
|
|
49
50
|
|
package/dist/README.md
CHANGED
|
@@ -44,6 +44,7 @@ The package is ESM-only and ships three subpath exports. Because each is a separ
|
|
|
44
44
|
| `NdJsonReaderTool` / `NdJsonReaderToolFeature` | Parse NDJSON from files, streams, or in-memory lines with checkpoint support — [docs](src/node/features/NdJsonReaderTool/README.md) |
|
|
45
45
|
| `ReadStreamFactory` / `ReadStreamFactoryFeature` | Disposable `node:fs` read streams via `AsyncDisposable` — [docs](src/node/features/ReadStreamFactory/README.md) |
|
|
46
46
|
| `PackageJsonFileTool` / `PackageJsonFileToolFeature` | Read, validate, mutate, and write `package.json` files — [docs](src/node/features/PackageJsonFileTool/README.md) |
|
|
47
|
+
| `HashFolderTool` / `HashFolderToolFeature` | Deterministic SHA-256 hash of a folder's contents — [docs](src/node/features/HashFolderTool/README.md) |
|
|
47
48
|
|
|
48
49
|
---
|
|
49
50
|
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { HashFolderTool as HashFolderToolAbstraction, type HashFolderOptions, type HashFolderResult } from "./abstractions/HashFolderTool.js";
|
|
2
|
+
declare class HashFolderToolImpl implements HashFolderToolAbstraction.Interface {
|
|
3
|
+
hash(folderPath: string, options?: HashFolderOptions): HashFolderResult;
|
|
4
|
+
hashAsync(folderPath: string, options?: HashFolderOptions): Promise<HashFolderResult>;
|
|
5
|
+
}
|
|
6
|
+
export declare const HashFolderTool: typeof HashFolderToolImpl & {
|
|
7
|
+
__abstraction: import("@webiny/di").Abstraction<import("./abstractions/HashFolderTool.js").IHashFolderTool>;
|
|
8
|
+
};
|
|
9
|
+
export declare function createHashFolderTool(): HashFolderToolAbstraction.Interface;
|
|
10
|
+
/**
|
|
11
|
+
* Standalone sync — computes a SHA-256 hash of a folder's contents.
|
|
12
|
+
*/
|
|
13
|
+
export declare function hashFolder(folderPath: string, options?: HashFolderOptions): HashFolderResult;
|
|
14
|
+
/**
|
|
15
|
+
* Standalone async — reads files and subdirectories in parallel.
|
|
16
|
+
*/
|
|
17
|
+
export declare function hashFolderAsync(folderPath: string, options?: HashFolderOptions): Promise<HashFolderResult>;
|
|
18
|
+
export {};
|
|
19
|
+
//# sourceMappingURL=HashFolderTool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HashFolderTool.d.ts","sourceRoot":"","sources":["../../../../src/node/features/HashFolderTool/HashFolderTool.ts"],"names":[],"mappings":"AAIA,OAAO,EACH,cAAc,IAAI,yBAAyB,EAC3C,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACxB,MAAM,kCAAkC,CAAC;AAkG1C,cAAM,kBAAmB,YAAW,yBAAyB,CAAC,SAAS;IAC5D,IAAI,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,iBAAiB,GAAG,gBAAgB,CAK7E;IAEY,SAAS,CAClB,UAAU,EAAE,MAAM,EAClB,OAAO,CAAC,EAAE,iBAAiB,GAC5B,OAAO,CAAC,gBAAgB,CAAC,CAU3B;CACJ;AAED,eAAO,MAAM,cAAc;;CAGzB,CAAC;AAEH,wBAAgB,oBAAoB,IAAI,yBAAyB,CAAC,SAAS,CAE1E;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,iBAAiB,GAAG,gBAAgB,CAE5F;AAED;;GAEG;AACH,wBAAsB,eAAe,CACjC,UAAU,EAAE,MAAM,EAClB,OAAO,CAAC,EAAE,iBAAiB,GAC5B,OAAO,CAAC,gBAAgB,CAAC,CAE3B"}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { createHash } from "node:crypto";
|
|
2
|
+
import { readdirSync, readFileSync } from "node:fs";
|
|
3
|
+
import { readdir, readFile } from "node:fs/promises";
|
|
4
|
+
import { join, relative } from "node:path";
|
|
5
|
+
import { HashFolderTool as HashFolderToolAbstraction } from "./abstractions/HashFolderTool.js";
|
|
6
|
+
function combineEntries(entries) {
|
|
7
|
+
entries.sort((a, b) => a.relativePath.localeCompare(b.relativePath));
|
|
8
|
+
const combined = createHash("sha256");
|
|
9
|
+
for (const entry of entries) {
|
|
10
|
+
combined.update(entry.relativePath);
|
|
11
|
+
combined.update(entry.fileHash);
|
|
12
|
+
}
|
|
13
|
+
return combined.digest("hex");
|
|
14
|
+
}
|
|
15
|
+
function collectFilesSync(rootPath, currentPath, excludeFolders, excludeFiles) {
|
|
16
|
+
const entries = [];
|
|
17
|
+
const dirEntries = readdirSync(currentPath, { withFileTypes: true });
|
|
18
|
+
for (const dirEntry of dirEntries) {
|
|
19
|
+
if (dirEntry.isDirectory()) {
|
|
20
|
+
if (excludeFolders.has(dirEntry.name)) {
|
|
21
|
+
continue;
|
|
22
|
+
}
|
|
23
|
+
const subEntries = collectFilesSync(rootPath, join(currentPath, dirEntry.name), excludeFolders, excludeFiles);
|
|
24
|
+
entries.push(...subEntries);
|
|
25
|
+
}
|
|
26
|
+
else if (dirEntry.isFile()) {
|
|
27
|
+
if (excludeFiles.has(dirEntry.name)) {
|
|
28
|
+
continue;
|
|
29
|
+
}
|
|
30
|
+
const filePath = join(currentPath, dirEntry.name);
|
|
31
|
+
const content = readFileSync(filePath);
|
|
32
|
+
const fileHash = createHash("sha256").update(content).digest("hex");
|
|
33
|
+
entries.push({ relativePath: relative(rootPath, filePath), fileHash });
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
return entries;
|
|
37
|
+
}
|
|
38
|
+
async function collectFilesAsync(rootPath, currentPath, excludeFolders, excludeFiles) {
|
|
39
|
+
const dirEntries = await readdir(currentPath, { withFileTypes: true });
|
|
40
|
+
const tasks = [];
|
|
41
|
+
const fileEntries = [];
|
|
42
|
+
for (const dirEntry of dirEntries) {
|
|
43
|
+
if (dirEntry.isDirectory()) {
|
|
44
|
+
if (excludeFolders.has(dirEntry.name)) {
|
|
45
|
+
continue;
|
|
46
|
+
}
|
|
47
|
+
tasks.push(collectFilesAsync(rootPath, join(currentPath, dirEntry.name), excludeFolders, excludeFiles));
|
|
48
|
+
}
|
|
49
|
+
else if (dirEntry.isFile()) {
|
|
50
|
+
if (excludeFiles.has(dirEntry.name)) {
|
|
51
|
+
continue;
|
|
52
|
+
}
|
|
53
|
+
const filePath = join(currentPath, dirEntry.name);
|
|
54
|
+
fileEntries.push(readFile(filePath).then(content => ({
|
|
55
|
+
relativePath: relative(rootPath, filePath),
|
|
56
|
+
fileHash: createHash("sha256").update(content).digest("hex")
|
|
57
|
+
})));
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
const [subResults, localFiles] = await Promise.all([
|
|
61
|
+
Promise.all(tasks),
|
|
62
|
+
Promise.all(fileEntries)
|
|
63
|
+
]);
|
|
64
|
+
return subResults.flat().concat(localFiles);
|
|
65
|
+
}
|
|
66
|
+
class HashFolderToolImpl {
|
|
67
|
+
hash(folderPath, options) {
|
|
68
|
+
const excludeFolders = new Set(options?.excludeFolders ?? []);
|
|
69
|
+
const excludeFiles = new Set(options?.excludeFiles ?? []);
|
|
70
|
+
const entries = collectFilesSync(folderPath, folderPath, excludeFolders, excludeFiles);
|
|
71
|
+
return { hash: combineEntries(entries) };
|
|
72
|
+
}
|
|
73
|
+
async hashAsync(folderPath, options) {
|
|
74
|
+
const excludeFolders = new Set(options?.excludeFolders ?? []);
|
|
75
|
+
const excludeFiles = new Set(options?.excludeFiles ?? []);
|
|
76
|
+
const entries = await collectFilesAsync(folderPath, folderPath, excludeFolders, excludeFiles);
|
|
77
|
+
return { hash: combineEntries(entries) };
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
export const HashFolderTool = HashFolderToolAbstraction.createImplementation({
|
|
81
|
+
implementation: HashFolderToolImpl,
|
|
82
|
+
dependencies: []
|
|
83
|
+
});
|
|
84
|
+
export function createHashFolderTool() {
|
|
85
|
+
return new HashFolderToolImpl();
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Standalone sync — computes a SHA-256 hash of a folder's contents.
|
|
89
|
+
*/
|
|
90
|
+
export function hashFolder(folderPath, options) {
|
|
91
|
+
return new HashFolderToolImpl().hash(folderPath, options);
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Standalone async — reads files and subdirectories in parallel.
|
|
95
|
+
*/
|
|
96
|
+
export async function hashFolderAsync(folderPath, options) {
|
|
97
|
+
return new HashFolderToolImpl().hashAsync(folderPath, options);
|
|
98
|
+
}
|
|
99
|
+
//# sourceMappingURL=HashFolderTool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HashFolderTool.js","sourceRoot":"","sources":["../../../../src/node/features/HashFolderTool/HashFolderTool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EACH,cAAc,IAAI,yBAAyB,EAG9C,MAAM,kCAAkC,CAAC;AAO1C,SAAS,cAAc,CAAC,OAAoB;IACxC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC,aAAa,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,C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AAC;CACJ;AAED,MAAM,CAAC,MAAM,cAAc,GAAG,yBAAyB,CAAC,oBAAoB,CAAC;IACzE,cAAc,EAAE,kBAAkB;IAClC,YAAY,EAAE,EAAE;CACnB,CAAC,CAAC;AAEH,MAAM,UAAU,oBAAoB;IAChC,OAAO,IAAI,kBAAkB,EAAE,CAAC;AACpC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,UAAU,CAAC,UAAkB,EAAE,OAA2B;IACtE,OAAO,IAAI,kBAAkB,EAAE,CAAC,IAAI,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;AAC9D,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe,CACjC,UAAkB,EAClB,OAA2B;IAE3B,OAAO,IAAI,kBAAkB,EAAE,CAAC,SAAS,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;AACnE,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Options for filtering which folders and files are included in the hash.
|
|
3
|
+
*/
|
|
4
|
+
export interface HashFolderOptions {
|
|
5
|
+
/** Folder names to skip during traversal (e.g. "node_modules", "dist"). */
|
|
6
|
+
excludeFolders?: string[];
|
|
7
|
+
/** File names to skip (e.g. "tsconfig.build.tsbuildinfo"). */
|
|
8
|
+
excludeFiles?: string[];
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Result of hashing a folder's contents.
|
|
12
|
+
*/
|
|
13
|
+
export interface HashFolderResult {
|
|
14
|
+
/** Hex-encoded SHA-256 digest. */
|
|
15
|
+
hash: string;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Computes a deterministic SHA-256 hash of a folder's contents.
|
|
19
|
+
* Walks the directory recursively, hashes each file, sorts by relative path,
|
|
20
|
+
* then produces a single combined hash.
|
|
21
|
+
*/
|
|
22
|
+
export interface IHashFolderTool {
|
|
23
|
+
/** Returns a result containing the hex-encoded SHA-256 hash (synchronous). */
|
|
24
|
+
hash(folderPath: string, options?: HashFolderOptions): HashFolderResult;
|
|
25
|
+
/** Parallel variant — reads files and subdirectories concurrently. */
|
|
26
|
+
hashAsync(folderPath: string, options?: HashFolderOptions): Promise<HashFolderResult>;
|
|
27
|
+
}
|
|
28
|
+
export declare const HashFolderTool: import("@webiny/di").Abstraction<IHashFolderTool>;
|
|
29
|
+
export declare namespace HashFolderTool {
|
|
30
|
+
type Interface = IHashFolderTool;
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=HashFolderTool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HashFolderTool.d.ts","sourceRoot":"","sources":["../../../../../src/node/features/HashFolderTool/abstractions/HashFolderTool.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAC9B,2EAA2E;IAC3E,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B,8DAA8D;IAC9D,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;CAC3B;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC7B,kCAAkC;IAClC,IAAI,EAAE,MAAM,CAAC;CAChB;AAED;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC5B,8EAA8E;IAC9E,IAAI,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,iBAAiB,GAAG,gBAAgB,CAAC;IACxE,sEAAsE;IACtE,SAAS,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;CACzF;AAED,eAAO,MAAM,cAAc,mDAA4D,CAAC;AAExF,yBAAiB,cAAc,CAAC;IAC5B,KAAY,SAAS,GAAG,eAAe,CAAC;CAC3C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HashFolderTool.js","sourceRoot":"","sources":["../../../../../src/node/features/HashFolderTool/abstractions/HashFolderTool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAgCtD,MAAM,CAAC,MAAM,cAAc,GAAG,iBAAiB,CAAkB,qBAAqB,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/node/features/HashFolderTool/abstractions/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,KAAK,iBAAiB,EAAE,KAAK,gBAAgB,EAAE,MAAM,qBAAqB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/node/features/HashFolderTool/abstractions/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAiD,MAAM,qBAAqB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"feature.d.ts","sourceRoot":"","sources":["../../../../src/node/features/HashFolderTool/feature.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,qBAAqB;;;CAKhC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { createFeature } from "../../../common/index.js";
|
|
2
|
+
import { HashFolderTool } from "./HashFolderTool.js";
|
|
3
|
+
export const HashFolderToolFeature = createFeature({
|
|
4
|
+
name: "Node/HashFolderToolFeature",
|
|
5
|
+
register(container) {
|
|
6
|
+
container.register(HashFolderTool).inSingletonScope();
|
|
7
|
+
}
|
|
8
|
+
});
|
|
9
|
+
//# sourceMappingURL=feature.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"feature.js","sourceRoot":"","sources":["../../../../src/node/features/HashFolderTool/feature.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErD,MAAM,CAAC,MAAM,qBAAqB,GAAG,aAAa,CAAC;IAC/C,IAAI,EAAE,4BAA4B;IAClC,QAAQ,CAAC,SAAS;QACd,SAAS,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC,gBAAgB,EAAE,CAAC;IAC1D,CAAC;CACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { HashFolderTool, type HashFolderOptions, type HashFolderResult } from "./abstractions/index.js";
|
|
2
|
+
export { HashFolderToolFeature } from "./feature.js";
|
|
3
|
+
export { createHashFolderTool, hashFolder, hashFolderAsync } from "./HashFolderTool.js";
|
|
4
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/node/features/HashFolderTool/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,cAAc,EACd,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACxB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,oBAAoB,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/node/features/HashFolderTool/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,cAAc,EAGjB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,oBAAoB,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC"}
|
package/dist/node/index.d.ts
CHANGED
|
@@ -6,4 +6,5 @@ export { PathTool, PathToolFeature, createPathTool, PackageNotFoundError } from
|
|
|
6
6
|
export { NdJsonReaderTool, NdJsonReaderToolFeature, createNdJsonReaderTool, type CreateNdJsonReaderToolParams, type NdJsonRow, type NdJsonReaderOptions } from "./features/NdJsonReaderTool/index.js";
|
|
7
7
|
export { ReadStreamFactory, ReadStreamFactoryFeature, createReadStreamFactory } from "./features/ReadStreamFactory/index.js";
|
|
8
8
|
export { PackageJsonFileTool, PackageJsonFileToolFeature, createPackageJsonFileTool, type CreatePackageJsonFileToolParams, PackageJsonFile } from "./features/PackageJsonFileTool/index.js";
|
|
9
|
+
export { HashFolderTool, HashFolderToolFeature, createHashFolderTool, hashFolder, hashFolderAsync, type HashFolderOptions, type HashFolderResult } from "./features/HashFolderTool/index.js";
|
|
9
10
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/node/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/node/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,QAAQ,EACR,eAAe,EACf,cAAc,EACd,KAAK,oBAAoB,EAC5B,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACH,aAAa,EACb,oBAAoB,EACpB,mBAAmB,EACnB,KAAK,yBAAyB,EAC9B,KAAK,WAAW,EACnB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EACH,YAAY,EACZ,mBAAmB,EACnB,kBAAkB,EAClB,KAAK,UAAU,EACf,KAAK,cAAc,EACnB,KAAK,wBAAwB,EAChC,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EACH,gBAAgB,EAChB,iBAAiB,EACjB,gBAAgB,EAChB,KAAK,sBAAsB,EAC9B,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACH,QAAQ,EACR,eAAe,EACf,cAAc,EACd,oBAAoB,EACvB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACH,gBAAgB,EAChB,uBAAuB,EACvB,sBAAsB,EACtB,KAAK,4BAA4B,EACjC,KAAK,SAAS,EACd,KAAK,mBAAmB,EAC3B,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EACH,iBAAiB,EACjB,wBAAwB,EACxB,uBAAuB,EAC1B,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EACH,mBAAmB,EACnB,0BAA0B,EAC1B,yBAAyB,EACzB,KAAK,+BAA+B,EACpC,eAAe,EAClB,MAAM,yCAAyC,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/node/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,QAAQ,EACR,eAAe,EACf,cAAc,EACd,KAAK,oBAAoB,EAC5B,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACH,aAAa,EACb,oBAAoB,EACpB,mBAAmB,EACnB,KAAK,yBAAyB,EAC9B,KAAK,WAAW,EACnB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EACH,YAAY,EACZ,mBAAmB,EACnB,kBAAkB,EAClB,KAAK,UAAU,EACf,KAAK,cAAc,EACnB,KAAK,wBAAwB,EAChC,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EACH,gBAAgB,EAChB,iBAAiB,EACjB,gBAAgB,EAChB,KAAK,sBAAsB,EAC9B,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACH,QAAQ,EACR,eAAe,EACf,cAAc,EACd,oBAAoB,EACvB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACH,gBAAgB,EAChB,uBAAuB,EACvB,sBAAsB,EACtB,KAAK,4BAA4B,EACjC,KAAK,SAAS,EACd,KAAK,mBAAmB,EAC3B,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EACH,iBAAiB,EACjB,wBAAwB,EACxB,uBAAuB,EAC1B,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EACH,mBAAmB,EACnB,0BAA0B,EAC1B,yBAAyB,EACzB,KAAK,+BAA+B,EACpC,eAAe,EAClB,MAAM,yCAAyC,CAAC;AACjD,OAAO,EACH,cAAc,EACd,qBAAqB,EACrB,oBAAoB,EACpB,UAAU,EACV,eAAe,EACf,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACxB,MAAM,oCAAoC,CAAC"}
|
package/dist/node/index.js
CHANGED
|
@@ -6,4 +6,5 @@ export { PathTool, PathToolFeature, createPathTool, PackageNotFoundError } from
|
|
|
6
6
|
export { NdJsonReaderTool, NdJsonReaderToolFeature, createNdJsonReaderTool } from "./features/NdJsonReaderTool/index.js";
|
|
7
7
|
export { ReadStreamFactory, ReadStreamFactoryFeature, createReadStreamFactory } from "./features/ReadStreamFactory/index.js";
|
|
8
8
|
export { PackageJsonFileTool, PackageJsonFileToolFeature, createPackageJsonFileTool, PackageJsonFile } from "./features/PackageJsonFileTool/index.js";
|
|
9
|
+
export { HashFolderTool, HashFolderToolFeature, createHashFolderTool, hashFolder, hashFolderAsync } from "./features/HashFolderTool/index.js";
|
|
9
10
|
//# sourceMappingURL=index.js.map
|
package/dist/node/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/node/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,QAAQ,EACR,eAAe,EACf,cAAc,EAEjB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACH,aAAa,EACb,oBAAoB,EACpB,mBAAmB,EAGtB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EACH,YAAY,EACZ,mBAAmB,EACnB,kBAAkB,EAIrB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EACH,gBAAgB,EAChB,iBAAiB,EACjB,gBAAgB,EAEnB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACH,QAAQ,EACR,eAAe,EACf,cAAc,EACd,oBAAoB,EACvB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACH,gBAAgB,EAChB,uBAAuB,EACvB,sBAAsB,EAIzB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EACH,iBAAiB,EACjB,wBAAwB,EACxB,uBAAuB,EAC1B,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EACH,mBAAmB,EACnB,0BAA0B,EAC1B,yBAAyB,EAEzB,eAAe,EAClB,MAAM,yCAAyC,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/node/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,QAAQ,EACR,eAAe,EACf,cAAc,EAEjB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACH,aAAa,EACb,oBAAoB,EACpB,mBAAmB,EAGtB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EACH,YAAY,EACZ,mBAAmB,EACnB,kBAAkB,EAIrB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EACH,gBAAgB,EAChB,iBAAiB,EACjB,gBAAgB,EAEnB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACH,QAAQ,EACR,eAAe,EACf,cAAc,EACd,oBAAoB,EACvB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACH,gBAAgB,EAChB,uBAAuB,EACvB,sBAAsB,EAIzB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EACH,iBAAiB,EACjB,wBAAwB,EACxB,uBAAuB,EAC1B,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EACH,mBAAmB,EACnB,0BAA0B,EAC1B,yBAAyB,EAEzB,eAAe,EAClB,MAAM,yCAAyC,CAAC;AACjD,OAAO,EACH,cAAc,EACd,qBAAqB,EACrB,oBAAoB,EACpB,UAAU,EACV,eAAe,EAGlB,MAAM,oCAAoC,CAAC"}
|
package/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webiny/stdlib",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Standard library for Webiny — platform-agnostic, Node.js, and browser utilities",
|
|
6
6
|
"license": "MIT",
|
|
@@ -32,13 +32,13 @@
|
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@changesets/cli": "^2.31.0",
|
|
34
34
|
"@types/node": ">=24",
|
|
35
|
-
"@typescript/native-preview": "^7.0.0-dev.
|
|
36
|
-
"@vitest/coverage-v8": "^4.1.
|
|
35
|
+
"@typescript/native-preview": "^7.0.0-dev.20260522.1",
|
|
36
|
+
"@vitest/coverage-v8": "^4.1.7",
|
|
37
37
|
"adio": "^3.0.0",
|
|
38
38
|
"happy-dom": "^20.9.0",
|
|
39
39
|
"oxfmt": "^0.51.0",
|
|
40
40
|
"oxlint": "^1.66.0",
|
|
41
|
-
"vitest": "^4.1.
|
|
41
|
+
"vitest": "^4.1.7"
|
|
42
42
|
},
|
|
43
43
|
"scripts": {
|
|
44
44
|
"clean": "rm -rf dist",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webiny/stdlib",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Standard library for Webiny — platform-agnostic, Node.js, and browser utilities",
|
|
6
6
|
"license": "MIT",
|
|
@@ -35,13 +35,13 @@
|
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"@changesets/cli": "^2.31.0",
|
|
37
37
|
"@types/node": ">=24",
|
|
38
|
-
"@typescript/native-preview": "^7.0.0-dev.
|
|
39
|
-
"@vitest/coverage-v8": "^4.1.
|
|
38
|
+
"@typescript/native-preview": "^7.0.0-dev.20260522.1",
|
|
39
|
+
"@vitest/coverage-v8": "^4.1.7",
|
|
40
40
|
"adio": "^3.0.0",
|
|
41
41
|
"happy-dom": "^20.9.0",
|
|
42
42
|
"oxfmt": "^0.51.0",
|
|
43
43
|
"oxlint": "^1.66.0",
|
|
44
|
-
"vitest": "^4.1.
|
|
44
|
+
"vitest": "^4.1.7"
|
|
45
45
|
},
|
|
46
46
|
"scripts": {
|
|
47
47
|
"clean": "rm -rf dist",
|