@webiny/stdlib 0.0.2 → 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.
Files changed (32) hide show
  1. package/README.md +2 -1
  2. package/dist/README.md +2 -1
  3. package/dist/common/utils/dotProp.d.ts +4 -0
  4. package/dist/common/utils/dotProp.d.ts.map +1 -1
  5. package/dist/common/utils/dotProp.js +14 -6
  6. package/dist/common/utils/dotProp.js.map +1 -1
  7. package/dist/node/features/HashFolderTool/HashFolderTool.d.ts +19 -0
  8. package/dist/node/features/HashFolderTool/HashFolderTool.d.ts.map +1 -0
  9. package/dist/node/features/HashFolderTool/HashFolderTool.js +99 -0
  10. package/dist/node/features/HashFolderTool/HashFolderTool.js.map +1 -0
  11. package/dist/node/features/HashFolderTool/abstractions/HashFolderTool.d.ts +32 -0
  12. package/dist/node/features/HashFolderTool/abstractions/HashFolderTool.d.ts.map +1 -0
  13. package/dist/node/features/HashFolderTool/abstractions/HashFolderTool.js +3 -0
  14. package/dist/node/features/HashFolderTool/abstractions/HashFolderTool.js.map +1 -0
  15. package/dist/node/features/HashFolderTool/abstractions/index.d.ts +2 -0
  16. package/dist/node/features/HashFolderTool/abstractions/index.d.ts.map +1 -0
  17. package/dist/node/features/HashFolderTool/abstractions/index.js +2 -0
  18. package/dist/node/features/HashFolderTool/abstractions/index.js.map +1 -0
  19. package/dist/node/features/HashFolderTool/feature.d.ts +5 -0
  20. package/dist/node/features/HashFolderTool/feature.d.ts.map +1 -0
  21. package/dist/node/features/HashFolderTool/feature.js +9 -0
  22. package/dist/node/features/HashFolderTool/feature.js.map +1 -0
  23. package/dist/node/features/HashFolderTool/index.d.ts +4 -0
  24. package/dist/node/features/HashFolderTool/index.d.ts.map +1 -0
  25. package/dist/node/features/HashFolderTool/index.js +4 -0
  26. package/dist/node/features/HashFolderTool/index.js.map +1 -0
  27. package/dist/node/index.d.ts +1 -0
  28. package/dist/node/index.d.ts.map +1 -1
  29. package/dist/node/index.js +1 -0
  30. package/dist/node/index.js.map +1 -1
  31. package/dist/package.json +4 -4
  32. 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
 
@@ -57,4 +58,4 @@ The package is ESM-only and ships three subpath exports. Because each is a separ
57
58
 
58
59
  ## Versioning
59
60
 
60
- The package version in `package.json` is always `0.0.0`. The real version is injected at publish time by the release pipeline using conventional commits: `feat` bumps the minor, everything else (`fix`, `chore`, `refactor`, …) bumps the patch. There are no major version bumps — breaking changes may land on minor releases.
61
+ Versioning and publishing are managed by [Changesets](https://github.com/changesets/changesets). The version in `package.json` is the real published version, bumped automatically when a version PR is merged. To record a version bump, run `yarn changeset` before opening a PR. There are no major version bumps — breaking changes may land on minor releases.
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
 
@@ -57,4 +58,4 @@ The package is ESM-only and ships three subpath exports. Because each is a separ
57
58
 
58
59
  ## Versioning
59
60
 
60
- The package version in `package.json` is always `0.0.0`. The real version is injected at publish time by the release pipeline using conventional commits: `feat` bumps the minor, everything else (`fix`, `chore`, `refactor`, …) bumps the patch. There are no major version bumps — breaking changes may land on minor releases.
61
+ Versioning and publishing are managed by [Changesets](https://github.com/changesets/changesets). The version in `package.json` is the real published version, bumped automatically when a version PR is merged. To record a version bump, run `yarn changeset` before opening a PR. There are no major version bumps — breaking changes may land on minor releases.
@@ -9,7 +9,9 @@ declare function immutableGet<T = unknown>(target: Record<string, any> | null |
9
9
  declare function immutableSet<T extends Record<string, any>>(target: T, path: string, value: unknown | ((current: any) => unknown)): T;
10
10
  /**
11
11
  * Returns a deep clone with the property at the given path removed.
12
+ * When target is an array, pass a numeric index to splice the element out of the clone.
12
13
  */
14
+ declare function immutableDelete<T>(target: T[], index: number): T[];
13
15
  declare function immutableDelete<T extends Record<string, any>>(target: T, path: string): T;
14
16
  /**
15
17
  * Sets the value at the given path on the original target.
@@ -17,7 +19,9 @@ declare function immutableDelete<T extends Record<string, any>>(target: T, path:
17
19
  declare function mutableSet<T extends Record<string, any>>(target: T, path: string, value: unknown): T;
18
20
  /**
19
21
  * Removes the property at the given path from the original target.
22
+ * When target is an array, pass a numeric index to splice the element out.
20
23
  */
24
+ declare function mutableDelete<T>(target: T[], index: number): boolean;
21
25
  declare function mutableDelete<T extends Record<string, any>>(target: T, path: string): boolean;
22
26
  export { immutableGet, immutableSet, immutableDelete, mutableSet, mutableDelete };
23
27
  //# sourceMappingURL=dotProp.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"dotProp.d.ts","sourceRoot":"","sources":["../../../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,IAAI,GAAG,SAAS,EAC9C,IAAI,EAAE,MAAM,EACZ,YAAY,CAAC,EAAE,CAAC,GACjB,CAAC,CAOH;AAED;;;GAGG;AACH,iBAAS,YAAY,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC/C,MAAM,EAAE,CAAC,EACT,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,OAAO,GAAG,CAAC,CAAC,OAAO,EAAE,GAAG,KAAK,OAAO,CAAC,GAC7C,CAAC,CAKH;AAED;;;GAGG;AACH,iBAAS,eAAe,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,EAAE,KAAK,EAAE,MAAM,GAAG,CAAC,EAAE,CAAC;AAC7D,iBAAS,eAAe,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,GAAG,CAAC,CAAC;AAcpF;;GAEG;AACH,iBAAS,UAAU,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,CAAC,CAE7F;AAED;;;GAGG;AACH,iBAAS,aAAa,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC;AAC/D,iBAAS,aAAa,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;AAYxF,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,eAAe,EAAE,UAAU,EAAE,aAAa,EAAE,CAAC"}
@@ -21,11 +21,15 @@ function immutableSet(target, path, value) {
21
21
  setProperty(clone, path, finalValue);
22
22
  return clone;
23
23
  }
24
- /**
25
- * Returns a deep clone with the property at the given path removed.
26
- */
27
24
  function immutableDelete(target, path) {
28
25
  const clone = structuredClone(target);
26
+ if (Array.isArray(clone) && typeof path === "number") {
27
+ if (path < 0 || path >= clone.length) {
28
+ return clone;
29
+ }
30
+ clone.splice(path, 1);
31
+ return clone;
32
+ }
29
33
  deleteProperty(clone, path);
30
34
  return clone;
31
35
  }
@@ -35,10 +39,14 @@ function immutableDelete(target, path) {
35
39
  function mutableSet(target, path, value) {
36
40
  return setProperty(target, path, value);
37
41
  }
38
- /**
39
- * Removes the property at the given path from the original target.
40
- */
41
42
  function mutableDelete(target, path) {
43
+ if (Array.isArray(target) && typeof path === "number") {
44
+ if (path < 0 || path >= target.length) {
45
+ return false;
46
+ }
47
+ target.splice(path, 1);
48
+ return true;
49
+ }
42
50
  return deleteProperty(target, path);
43
51
  }
44
52
  export { immutableGet, immutableSet, immutableDelete, mutableSet, mutableDelete };
@@ -1 +1 @@
1
- {"version":3,"file":"dotProp.js","sourceRoot":"","sources":["../../../src/common/utils/dotProp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAEpE;;GAEG;AACH,SAAS,YAAY,CACjB,MAA8C,EAC9C,IAAY,EACZ,YAAgB;IAEhB,IAAI,CAAC,MAAM,IAAI,CAAC,YAAY,EAAE,CAAC;QAC3B,OAAO,YAA4B,CAAC;IACxC,CAAC;SAAM,IAAI,CAAC,MAAM,EAAE,CAAC;QACjB,OAAO,eAAe,CAAC,YAAY,CAAM,CAAC;IAC9C,CAAC;IACD,OAAO,WAAW,CAAC,eAAe,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,YAAY,CAAM,CAAC;AACzE,CAAC;AAED;;;GAGG;AACH,SAAS,YAAY,CACjB,MAAS,EACT,IAAY,EACZ,KAA4C;IAE5C,MAAM,KAAK,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC;IACtC,MAAM,UAAU,GAAG,OAAO,KAAK,KAAK,UAAU,CAAC,CAAC,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CAAC;QACjB,CAAC;QACD,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;QACvB,OAAO,IAAI,CAAC;IAChB,CAAC;IACD,OAAO,cAAc,CAAC,MAA6B,EAAE,IAAc,CAAC,CAAC;AACzE,CAAC;AAED,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,eAAe,EAAE,UAAU,EAAE,aAAa,EAAE,CAAC"}
@@ -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,CAAC;IACrE,MAAM,QAAQ,GAAG,UAAU,CAAC,QAAQ,CAAC,CAAC;IACtC,KAAK,MAAM,KAAK,IAAI,OAAO,EAAE,CAAC;QAC1B,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;QACpC,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IACpC,CAAC;IACD,OAAO,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAClC,CAAC;AAED,SAAS,gBAA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AC,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,3 @@
1
+ import { createAbstraction } from "../../../../common/index.js";
2
+ export const HashFolderTool = createAbstraction("Node/HashFolderTool");
3
+ //# sourceMappingURL=HashFolderTool.js.map
@@ -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,2 @@
1
+ export { HashFolderTool, type HashFolderOptions, type HashFolderResult } from "./HashFolderTool.js";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -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,2 @@
1
+ export { HashFolderTool } from "./HashFolderTool.js";
2
+ //# sourceMappingURL=index.js.map
@@ -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,5 @@
1
+ export declare const HashFolderToolFeature: {
2
+ name: string;
3
+ register(container: import("@webiny/di").Container): void;
4
+ };
5
+ //# sourceMappingURL=feature.d.ts.map
@@ -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,4 @@
1
+ export { HashFolderTool } from "./abstractions/index.js";
2
+ export { HashFolderToolFeature } from "./feature.js";
3
+ export { createHashFolderTool, hashFolder, hashFolderAsync } from "./HashFolderTool.js";
4
+ //# sourceMappingURL=index.js.map
@@ -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"}
@@ -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
@@ -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"}
@@ -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
@@ -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.2",
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.20260519.1",
36
- "@vitest/coverage-v8": "^4.1.6",
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.6"
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.2",
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.20260519.1",
39
- "@vitest/coverage-v8": "^4.1.6",
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.6"
44
+ "vitest": "^4.1.7"
45
45
  },
46
46
  "scripts": {
47
47
  "clean": "rm -rf dist",