@settlemint/sdk-utils 2.3.2-pref69a5a3 → 2.3.2-preff27199
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 +51 -7
- package/dist/environment.cjs +17705 -384
- package/dist/environment.cjs.map +1 -1
- package/dist/environment.d.cts +263 -98
- package/dist/environment.d.ts +263 -98
- package/dist/environment.js +17743 -0
- package/dist/environment.js.map +1 -0
- package/dist/filesystem.cjs +6746 -113
- package/dist/filesystem.cjs.map +1 -1
- package/dist/filesystem.d.cts +22 -1
- package/dist/filesystem.d.ts +22 -1
- package/dist/filesystem.js +6766 -0
- package/dist/filesystem.js.map +1 -0
- package/dist/http.cjs +214 -94
- package/dist/http.cjs.map +1 -1
- package/dist/http.d.cts +9 -1
- package/dist/http.d.ts +9 -1
- package/dist/http.js +226 -0
- package/dist/http.js.map +1 -0
- package/dist/index.cjs +292 -110
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +9 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.js +306 -0
- package/dist/index.js.map +1 -0
- package/dist/json.cjs +83 -0
- package/dist/json.cjs.map +1 -0
- package/dist/json.d.cts +56 -0
- package/dist/json.d.ts +56 -0
- package/dist/json.js +80 -0
- package/dist/json.js.map +1 -0
- package/dist/logging.cjs +209 -137
- package/dist/logging.cjs.map +1 -1
- package/dist/logging.d.cts +23 -14
- package/dist/logging.d.ts +23 -14
- package/dist/logging.js +221 -0
- package/dist/logging.js.map +1 -0
- package/dist/package-manager.cjs +7350 -173
- package/dist/package-manager.cjs.map +1 -1
- package/dist/package-manager.d.cts +26 -3
- package/dist/package-manager.d.ts +26 -3
- package/dist/package-manager.js +7382 -0
- package/dist/package-manager.js.map +1 -0
- package/dist/retry.cjs +137 -0
- package/dist/retry.cjs.map +1 -0
- package/dist/retry.d.cts +19 -0
- package/dist/retry.d.ts +19 -0
- package/dist/retry.js +136 -0
- package/dist/retry.js.map +1 -0
- package/dist/runtime.cjs +58 -40
- package/dist/runtime.cjs.map +1 -1
- package/dist/runtime.d.cts +3 -0
- package/dist/runtime.d.ts +3 -0
- package/dist/runtime.js +45 -0
- package/dist/runtime.js.map +1 -0
- package/dist/string.cjs +76 -0
- package/dist/string.cjs.map +1 -0
- package/dist/string.d.cts +58 -0
- package/dist/string.d.ts +58 -0
- package/dist/string.js +72 -0
- package/dist/string.js.map +1 -0
- package/dist/terminal.cjs +423 -229
- package/dist/terminal.cjs.map +1 -1
- package/dist/terminal.d.cts +54 -24
- package/dist/terminal.d.ts +54 -24
- package/dist/terminal.js +438 -0
- package/dist/terminal.js.map +1 -0
- package/dist/url.cjs +25 -0
- package/dist/url.cjs.map +1 -0
- package/dist/url.d.cts +20 -0
- package/dist/url.d.ts +20 -0
- package/dist/url.js +24 -0
- package/dist/url.js.map +1 -0
- package/dist/validation.cjs +10486 -193
- package/dist/validation.cjs.map +1 -1
- package/dist/validation.d.cts +124 -94
- package/dist/validation.d.ts +124 -94
- package/dist/validation.js +10482 -0
- package/dist/validation.js.map +1 -0
- package/package.json +6 -6
- package/dist/environment.mjs +0 -384
- package/dist/environment.mjs.map +0 -1
- package/dist/filesystem.mjs +0 -105
- package/dist/filesystem.mjs.map +0 -1
- package/dist/http.mjs +0 -80
- package/dist/http.mjs.map +0 -1
- package/dist/index.mjs +0 -98
- package/dist/index.mjs.map +0 -1
- package/dist/logging.mjs +0 -123
- package/dist/logging.mjs.map +0 -1
- package/dist/package-manager.mjs +0 -167
- package/dist/package-manager.mjs.map +0 -1
- package/dist/runtime.mjs +0 -23
- package/dist/runtime.mjs.map +0 -1
- package/dist/terminal.mjs +0 -230
- package/dist/terminal.mjs.map +0 -1
- package/dist/validation.mjs +0 -161
- package/dist/validation.mjs.map +0 -1
package/dist/filesystem.d.cts
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
|
-
import { PathLike } from
|
|
1
|
+
import { PathLike } from "node:fs";
|
|
2
2
|
|
|
3
|
+
//#region src/filesystem/project-root.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* Finds the root directory of the current project by locating the nearest package.json file
|
|
6
|
+
*
|
|
7
|
+
* @param fallbackToCwd - If true, will return the current working directory if no package.json is found
|
|
8
|
+
* @param cwd - The directory to start searching for the package.json file from (defaults to process.cwd())
|
|
9
|
+
* @returns Promise that resolves to the absolute path of the project root directory
|
|
10
|
+
* @throws Will throw an error if no package.json is found in the directory tree
|
|
11
|
+
* @example
|
|
12
|
+
* import { projectRoot } from "@settlemint/sdk-utils/filesystem";
|
|
13
|
+
*
|
|
14
|
+
* // Get project root path
|
|
15
|
+
* const rootDir = await projectRoot();
|
|
16
|
+
* console.log(`Project root is at: ${rootDir}`);
|
|
17
|
+
*/
|
|
3
18
|
/**
|
|
4
19
|
* Finds the root directory of the current project by locating the nearest package.json file
|
|
5
20
|
*
|
|
@@ -16,6 +31,8 @@ import { PathLike } from 'node:fs';
|
|
|
16
31
|
*/
|
|
17
32
|
declare function projectRoot(fallbackToCwd?: boolean, cwd?: string): Promise<string>;
|
|
18
33
|
|
|
34
|
+
//#endregion
|
|
35
|
+
//#region src/filesystem/exists.d.ts
|
|
19
36
|
/**
|
|
20
37
|
* Checks if a file or directory exists at the given path
|
|
21
38
|
*
|
|
@@ -31,6 +48,8 @@ declare function projectRoot(fallbackToCwd?: boolean, cwd?: string): Promise<str
|
|
|
31
48
|
*/
|
|
32
49
|
declare function exists(path: PathLike): Promise<boolean>;
|
|
33
50
|
|
|
51
|
+
//#endregion
|
|
52
|
+
//#region src/filesystem/mono-repo.d.ts
|
|
34
53
|
/**
|
|
35
54
|
* Finds the root directory of a monorepo
|
|
36
55
|
*
|
|
@@ -56,4 +75,6 @@ declare function findMonoRepoRoot(startDir: string): Promise<string | null>;
|
|
|
56
75
|
*/
|
|
57
76
|
declare function findMonoRepoPackages(projectDir: string): Promise<string[]>;
|
|
58
77
|
|
|
78
|
+
//#endregion
|
|
59
79
|
export { exists, findMonoRepoPackages, findMonoRepoRoot, projectRoot };
|
|
80
|
+
//# sourceMappingURL=filesystem.d.cts.map
|
package/dist/filesystem.d.ts
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
|
-
import { PathLike } from
|
|
1
|
+
import { PathLike } from "node:fs";
|
|
2
2
|
|
|
3
|
+
//#region src/filesystem/project-root.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* Finds the root directory of the current project by locating the nearest package.json file
|
|
6
|
+
*
|
|
7
|
+
* @param fallbackToCwd - If true, will return the current working directory if no package.json is found
|
|
8
|
+
* @param cwd - The directory to start searching for the package.json file from (defaults to process.cwd())
|
|
9
|
+
* @returns Promise that resolves to the absolute path of the project root directory
|
|
10
|
+
* @throws Will throw an error if no package.json is found in the directory tree
|
|
11
|
+
* @example
|
|
12
|
+
* import { projectRoot } from "@settlemint/sdk-utils/filesystem";
|
|
13
|
+
*
|
|
14
|
+
* // Get project root path
|
|
15
|
+
* const rootDir = await projectRoot();
|
|
16
|
+
* console.log(`Project root is at: ${rootDir}`);
|
|
17
|
+
*/
|
|
3
18
|
/**
|
|
4
19
|
* Finds the root directory of the current project by locating the nearest package.json file
|
|
5
20
|
*
|
|
@@ -16,6 +31,8 @@ import { PathLike } from 'node:fs';
|
|
|
16
31
|
*/
|
|
17
32
|
declare function projectRoot(fallbackToCwd?: boolean, cwd?: string): Promise<string>;
|
|
18
33
|
|
|
34
|
+
//#endregion
|
|
35
|
+
//#region src/filesystem/exists.d.ts
|
|
19
36
|
/**
|
|
20
37
|
* Checks if a file or directory exists at the given path
|
|
21
38
|
*
|
|
@@ -31,6 +48,8 @@ declare function projectRoot(fallbackToCwd?: boolean, cwd?: string): Promise<str
|
|
|
31
48
|
*/
|
|
32
49
|
declare function exists(path: PathLike): Promise<boolean>;
|
|
33
50
|
|
|
51
|
+
//#endregion
|
|
52
|
+
//#region src/filesystem/mono-repo.d.ts
|
|
34
53
|
/**
|
|
35
54
|
* Finds the root directory of a monorepo
|
|
36
55
|
*
|
|
@@ -56,4 +75,6 @@ declare function findMonoRepoRoot(startDir: string): Promise<string | null>;
|
|
|
56
75
|
*/
|
|
57
76
|
declare function findMonoRepoPackages(projectDir: string): Promise<string[]>;
|
|
58
77
|
|
|
78
|
+
//#endregion
|
|
59
79
|
export { exists, findMonoRepoPackages, findMonoRepoRoot, projectRoot };
|
|
80
|
+
//# sourceMappingURL=filesystem.d.ts.map
|