@storm-software/config-tools 1.190.120 → 1.190.121
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/bin/config.cjs +1272 -105
- package/bin/config.mjs +1271 -0
- package/dist/_virtual/_rolldown/runtime.cjs +23 -0
- package/dist/config-file/get-config-file.cjs +63 -79
- package/dist/config-file/get-config-file.d.cts +5 -5
- package/dist/config-file/{get-config-file.d.ts → get-config-file.d.mts} +7 -5
- package/dist/config-file/get-config-file.mjs +66 -0
- package/dist/config-file/index.cjs +4 -1
- package/dist/config-file/index.d.cts +2 -3
- package/dist/config-file/index.d.mts +4 -0
- package/dist/config-file/index.mjs +5 -0
- package/dist/create-storm-config.cjs +105 -136
- package/dist/create-storm-config.d.cts +5 -5
- package/dist/{create-storm-config.d.ts → create-storm-config.d.mts} +7 -5
- package/dist/create-storm-config.mjs +113 -0
- package/dist/env/get-env.cjs +190 -214
- package/dist/env/get-env.d.cts +5 -5
- package/dist/env/{get-env.d.ts → get-env.d.mts} +7 -5
- package/dist/env/get-env.mjs +203 -0
- package/dist/env/index.cjs +7 -2
- package/dist/env/index.d.cts +3 -4
- package/dist/env/index.d.mts +5 -0
- package/dist/env/index.mjs +6 -0
- package/dist/env/set-env.cjs +218 -374
- package/dist/env/set-env.d.cts +8 -8
- package/dist/env/{set-env.d.ts → set-env.d.mts} +10 -8
- package/dist/env/set-env.mjs +231 -0
- package/dist/get-config.cjs +40 -29
- package/dist/get-config.d.cts +18 -18
- package/dist/{get-config.d.ts → get-config.d.mts} +20 -18
- package/dist/get-config.mjs +46 -0
- package/dist/index.cjs +98 -7
- package/dist/index.d.cts +27 -28
- package/dist/index.d.mts +29 -0
- package/dist/index.mjs +26 -0
- package/dist/logger/chalk.cjs +38 -29
- package/dist/logger/chalk.d.cts +18 -17
- package/dist/logger/chalk.d.mts +37 -0
- package/dist/logger/chalk.mjs +43 -0
- package/dist/logger/console-icons.cjs +15 -14
- package/dist/logger/console-icons.d.cts +5 -8
- package/dist/logger/console-icons.d.mts +7 -0
- package/dist/logger/console-icons.mjs +20 -0
- package/dist/logger/console.cjs +187 -183
- package/dist/logger/console.d.cts +25 -25
- package/dist/logger/{console.d.ts → console.d.mts} +27 -25
- package/dist/logger/console.mjs +185 -0
- package/dist/logger/create-logger.cjs +31 -24
- package/dist/logger/create-logger.d.cts +5 -6
- package/dist/logger/{create-logger.d.ts → create-logger.d.mts} +7 -6
- package/dist/logger/create-logger.mjs +34 -0
- package/dist/logger/format-timestamp.cjs +12 -4
- package/dist/logger/format-timestamp.d.cts +3 -2
- package/dist/logger/{format-timestamp.d.ts → format-timestamp.d.mts} +5 -2
- package/dist/logger/format-timestamp.mjs +16 -0
- package/dist/logger/get-log-level.cjs +50 -60
- package/dist/logger/get-log-level.d.cts +4 -5
- package/dist/logger/{get-log-level.d.ts → get-log-level.d.mts} +6 -5
- package/dist/logger/get-log-level.mjs +54 -0
- package/dist/logger/index.cjs +29 -7
- package/dist/logger/index.d.cts +8 -10
- package/dist/logger/index.d.mts +10 -0
- package/dist/logger/index.mjs +11 -0
- package/dist/logger/is-unicode-supported.cjs +6 -10
- package/dist/logger/is-unicode-supported.d.cts +3 -2
- package/dist/logger/is-unicode-supported.d.mts +6 -0
- package/dist/logger/is-unicode-supported.mjs +10 -0
- package/dist/types.cjs +26 -25
- package/dist/types.d.cts +39 -41
- package/dist/types.d.mts +53 -0
- package/dist/types.mjs +30 -0
- package/dist/utilities/apply-workspace-tokens.cjs +31 -70
- package/dist/utilities/apply-workspace-tokens.d.cts +4 -5
- package/dist/utilities/{apply-workspace-tokens.d.ts → apply-workspace-tokens.d.mts} +6 -5
- package/dist/utilities/apply-workspace-tokens.mjs +37 -0
- package/dist/utilities/colors.cjs +91 -74
- package/dist/utilities/colors.d.cts +4 -4
- package/dist/utilities/{colors.d.ts → colors.d.mts} +6 -4
- package/dist/utilities/colors.mjs +97 -0
- package/dist/utilities/correct-paths.cjs +166 -196
- package/dist/utilities/correct-paths.d.cts +4 -4
- package/dist/utilities/{correct-paths.d.ts → correct-paths.d.mts} +6 -4
- package/dist/utilities/correct-paths.mjs +190 -0
- package/dist/utilities/file-path-utils.cjs +42 -27
- package/dist/utilities/file-path-utils.d.cts +15 -14
- package/dist/utilities/{file-path-utils.d.ts → file-path-utils.d.mts} +17 -14
- package/dist/utilities/file-path-utils.mjs +48 -0
- package/dist/utilities/find-up.cjs +12 -18
- package/dist/utilities/find-up.d.cts +3 -2
- package/dist/utilities/{find-up.d.ts → find-up.d.mts} +5 -2
- package/dist/utilities/find-up.mjs +19 -0
- package/dist/utilities/find-workspace-root.cjs +64 -69
- package/dist/utilities/find-workspace-root.d.cts +3 -2
- package/dist/utilities/{find-workspace-root.d.ts → find-workspace-root.d.mts} +5 -2
- package/dist/utilities/find-workspace-root.mjs +73 -0
- package/dist/utilities/get-default-config.cjs +69 -91
- package/dist/utilities/get-default-config.d.cts +4 -4
- package/dist/utilities/{get-default-config.d.ts → get-default-config.d.mts} +6 -4
- package/dist/utilities/get-default-config.mjs +74 -0
- package/dist/utilities/index.cjs +49 -9
- package/dist/utilities/index.d.cts +10 -14
- package/dist/utilities/index.d.mts +12 -0
- package/dist/utilities/index.mjs +13 -0
- package/dist/utilities/process-handler.cjs +32 -47
- package/dist/utilities/process-handler.d.cts +4 -4
- package/dist/utilities/process-handler.d.mts +9 -0
- package/dist/utilities/process-handler.mjs +38 -0
- package/dist/utilities/run.cjs +62 -36
- package/dist/utilities/run.d.cts +5 -6
- package/dist/utilities/{run.d.ts → run.d.mts} +7 -6
- package/dist/utilities/run.mjs +64 -0
- package/dist/utilities/toml.cjs +27 -32
- package/dist/utilities/toml.d.cts +148 -147
- package/dist/utilities/toml.d.mts +192 -0
- package/dist/utilities/toml.mjs +33 -0
- package/package.json +105 -157
- package/bin/config.js +0 -108
- package/dist/config-file/get-config-file.js +0 -83
- package/dist/config-file/index.d.ts +0 -3
- package/dist/config-file/index.js +0 -1
- package/dist/create-storm-config.js +0 -147
- package/dist/env/get-env.js +0 -226
- package/dist/env/index.d.ts +0 -4
- package/dist/env/index.js +0 -2
- package/dist/env/set-env.js +0 -386
- package/dist/get-config.js +0 -35
- package/dist/index.d.ts +0 -28
- package/dist/index.js +0 -7
- package/dist/logger/chalk.d.ts +0 -34
- package/dist/logger/chalk.js +0 -34
- package/dist/logger/console-icons.d.ts +0 -8
- package/dist/logger/console-icons.js +0 -17
- package/dist/logger/console.js +0 -191
- package/dist/logger/create-logger.js +0 -27
- package/dist/logger/format-timestamp.js +0 -6
- package/dist/logger/get-log-level.js +0 -64
- package/dist/logger/index.d.ts +0 -10
- package/dist/logger/index.js +0 -7
- package/dist/logger/is-unicode-supported.d.ts +0 -3
- package/dist/logger/is-unicode-supported.js +0 -12
- package/dist/types.d.ts +0 -53
- package/dist/types.js +0 -28
- package/dist/utilities/apply-workspace-tokens.js +0 -76
- package/dist/utilities/colors.js +0 -81
- package/dist/utilities/correct-paths.js +0 -231
- package/dist/utilities/file-path-utils.js +0 -33
- package/dist/utilities/find-up.js +0 -23
- package/dist/utilities/find-workspace-root.js +0 -77
- package/dist/utilities/get-default-config.js +0 -95
- package/dist/utilities/index.d.ts +0 -14
- package/dist/utilities/index.js +0 -9
- package/dist/utilities/process-handler.d.ts +0 -7
- package/dist/utilities/process-handler.js +0 -53
- package/dist/utilities/run.js +0 -38
- package/dist/utilities/toml.d.ts +0 -189
- package/dist/utilities/toml.js +0 -42
|
@@ -1,95 +1,73 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_utilities_correct_paths = require("./correct-paths.cjs");
|
|
3
|
+
const require_utilities_find_workspace_root = require("./find-workspace-root.cjs");
|
|
4
|
+
let node_fs = require("node:fs");
|
|
5
|
+
let node_path = require("node:path");
|
|
6
|
+
let _storm_software_config = require("@storm-software/config");
|
|
7
|
+
let node_fs_promises = require("node:fs/promises");
|
|
8
|
+
//#region src/utilities/get-default-config.ts
|
|
9
|
+
/**
|
|
10
|
+
* Get the default Storm config values used during various dev-ops processes
|
|
11
|
+
*
|
|
12
|
+
* @returns The default Storm config values
|
|
13
|
+
*/
|
|
10
14
|
async function getPackageJsonConfig(root) {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
if (typeof packageJson.bugs === "string") {
|
|
46
|
-
support = packageJson.bugs;
|
|
47
|
-
} else if (packageJson.bugs.url) {
|
|
48
|
-
support = packageJson.bugs.url;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
return {
|
|
54
|
-
workspaceRoot,
|
|
55
|
-
name,
|
|
56
|
-
namespace,
|
|
57
|
-
repository,
|
|
58
|
-
license,
|
|
59
|
-
homepage,
|
|
60
|
-
support
|
|
61
|
-
};
|
|
15
|
+
let license = _storm_software_config.STORM_DEFAULT_LICENSE;
|
|
16
|
+
let homepage = void 0;
|
|
17
|
+
let support = void 0;
|
|
18
|
+
let name = void 0;
|
|
19
|
+
let namespace = void 0;
|
|
20
|
+
let repository = void 0;
|
|
21
|
+
const workspaceRoot = require_utilities_find_workspace_root.findWorkspaceRoot(root);
|
|
22
|
+
if ((0, node_fs.existsSync)((0, node_path.join)(workspaceRoot, "package.json"))) {
|
|
23
|
+
const file = await (0, node_fs_promises.readFile)(require_utilities_correct_paths.joinPaths(workspaceRoot, "package.json"), "utf8");
|
|
24
|
+
if (file) {
|
|
25
|
+
const packageJson = JSON.parse(file);
|
|
26
|
+
if (packageJson.name) name = packageJson.name;
|
|
27
|
+
if (packageJson.namespace) namespace = packageJson.namespace;
|
|
28
|
+
if (packageJson.repository) {
|
|
29
|
+
if (typeof packageJson.repository === "string") repository = packageJson.repository;
|
|
30
|
+
else if (packageJson.repository.url) repository = packageJson.repository.url;
|
|
31
|
+
}
|
|
32
|
+
if (packageJson.license) license = packageJson.license;
|
|
33
|
+
if (packageJson.homepage) homepage = packageJson.homepage;
|
|
34
|
+
if (packageJson.bugs) {
|
|
35
|
+
if (typeof packageJson.bugs === "string") support = packageJson.bugs;
|
|
36
|
+
else if (packageJson.bugs.url) support = packageJson.bugs.url;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
return {
|
|
41
|
+
workspaceRoot,
|
|
42
|
+
name,
|
|
43
|
+
namespace,
|
|
44
|
+
repository,
|
|
45
|
+
license,
|
|
46
|
+
homepage,
|
|
47
|
+
support
|
|
48
|
+
};
|
|
62
49
|
}
|
|
50
|
+
/**
|
|
51
|
+
* Apply default config values to the given config object
|
|
52
|
+
*
|
|
53
|
+
* @param config - The config object to apply defaults to
|
|
54
|
+
* @returns The config object with defaults applied
|
|
55
|
+
*/
|
|
63
56
|
function applyDefaultConfig(config) {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
if (!config.support) {
|
|
78
|
-
config.support = `${config.homepage}/support`;
|
|
79
|
-
}
|
|
80
|
-
if (!config.contact) {
|
|
81
|
-
config.contact = `${config.homepage}/contact`;
|
|
82
|
-
}
|
|
83
|
-
if (!_optionalChain([config, 'access', _ => _.error, 'optionalAccess', _2 => _2.codesFile]) || !_optionalChain([config, 'optionalAccess', _3 => _3.error, 'optionalAccess', _4 => _4.url])) {
|
|
84
|
-
config.error ??= { codesFile: _config.STORM_DEFAULT_ERROR_CODES_FILE };
|
|
85
|
-
if (config.homepage) {
|
|
86
|
-
config.error.url ??= `${config.homepage}/errors`;
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
return config;
|
|
57
|
+
if (!config.support && config.contact) config.support = config.contact;
|
|
58
|
+
if (!config.contact && config.support) config.contact = config.support;
|
|
59
|
+
if (config.homepage) {
|
|
60
|
+
if (!config.docs) config.docs = `${config.homepage}/docs`;
|
|
61
|
+
if (!config.license) config.license = `${config.homepage}/license`;
|
|
62
|
+
if (!config.support) config.support = `${config.homepage}/support`;
|
|
63
|
+
if (!config.contact) config.contact = `${config.homepage}/contact`;
|
|
64
|
+
if (!config.error?.codesFile || !config?.error?.url) {
|
|
65
|
+
config.error ??= { codesFile: _storm_software_config.STORM_DEFAULT_ERROR_CODES_FILE };
|
|
66
|
+
if (config.homepage) config.error.url ??= `${config.homepage}/errors`;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
return config;
|
|
91
70
|
}
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
exports.applyDefaultConfig = applyDefaultConfig; exports.getPackageJsonConfig = getPackageJsonConfig;
|
|
71
|
+
//#endregion
|
|
72
|
+
exports.applyDefaultConfig = applyDefaultConfig;
|
|
73
|
+
exports.getPackageJsonConfig = getPackageJsonConfig;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { StormWorkspaceConfig } from
|
|
2
|
-
|
|
1
|
+
import { StormWorkspaceConfig } from "@storm-software/config";
|
|
2
|
+
//#region src/utilities/get-default-config.d.ts
|
|
3
3
|
/**
|
|
4
4
|
* Get the default Storm config values used during various dev-ops processes
|
|
5
5
|
*
|
|
@@ -13,5 +13,5 @@ declare function getPackageJsonConfig(root?: string): Promise<Pick<StormWorkspac
|
|
|
13
13
|
* @returns The config object with defaults applied
|
|
14
14
|
*/
|
|
15
15
|
declare function applyDefaultConfig(config: Partial<StormWorkspaceConfig>): Partial<StormWorkspaceConfig>;
|
|
16
|
-
|
|
17
|
-
export { applyDefaultConfig, getPackageJsonConfig };
|
|
16
|
+
//#endregion
|
|
17
|
+
export { applyDefaultConfig, getPackageJsonConfig };
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import __tsdown_shims_path from 'node:path';
|
|
2
|
+
import __tsdown_shims_url from 'node:url';
|
|
3
|
+
import { StormWorkspaceConfig } from "@storm-software/config";
|
|
4
|
+
//#region src/utilities/get-default-config.d.ts
|
|
3
5
|
/**
|
|
4
6
|
* Get the default Storm config values used during various dev-ops processes
|
|
5
7
|
*
|
|
@@ -13,5 +15,5 @@ declare function getPackageJsonConfig(root?: string): Promise<Pick<StormWorkspac
|
|
|
13
15
|
* @returns The config object with defaults applied
|
|
14
16
|
*/
|
|
15
17
|
declare function applyDefaultConfig(config: Partial<StormWorkspaceConfig>): Partial<StormWorkspaceConfig>;
|
|
16
|
-
|
|
17
|
-
export { applyDefaultConfig, getPackageJsonConfig };
|
|
18
|
+
//#endregion
|
|
19
|
+
export { applyDefaultConfig, getPackageJsonConfig };
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import "node:path";
|
|
2
|
+
import "node:url";
|
|
3
|
+
import.meta.url;
|
|
4
|
+
import { joinPaths } from "./correct-paths.mjs";
|
|
5
|
+
import { findWorkspaceRoot } from "./find-workspace-root.mjs";
|
|
6
|
+
import { existsSync } from "node:fs";
|
|
7
|
+
import { join } from "node:path";
|
|
8
|
+
import { STORM_DEFAULT_ERROR_CODES_FILE, STORM_DEFAULT_LICENSE } from "@storm-software/config";
|
|
9
|
+
import { readFile } from "node:fs/promises";
|
|
10
|
+
//#region src/utilities/get-default-config.ts
|
|
11
|
+
/**
|
|
12
|
+
* Get the default Storm config values used during various dev-ops processes
|
|
13
|
+
*
|
|
14
|
+
* @returns The default Storm config values
|
|
15
|
+
*/
|
|
16
|
+
async function getPackageJsonConfig(root) {
|
|
17
|
+
let license = STORM_DEFAULT_LICENSE;
|
|
18
|
+
let homepage = void 0;
|
|
19
|
+
let support = void 0;
|
|
20
|
+
let name = void 0;
|
|
21
|
+
let namespace = void 0;
|
|
22
|
+
let repository = void 0;
|
|
23
|
+
const workspaceRoot = findWorkspaceRoot(root);
|
|
24
|
+
if (existsSync(join(workspaceRoot, "package.json"))) {
|
|
25
|
+
const file = await readFile(joinPaths(workspaceRoot, "package.json"), "utf8");
|
|
26
|
+
if (file) {
|
|
27
|
+
const packageJson = JSON.parse(file);
|
|
28
|
+
if (packageJson.name) name = packageJson.name;
|
|
29
|
+
if (packageJson.namespace) namespace = packageJson.namespace;
|
|
30
|
+
if (packageJson.repository) {
|
|
31
|
+
if (typeof packageJson.repository === "string") repository = packageJson.repository;
|
|
32
|
+
else if (packageJson.repository.url) repository = packageJson.repository.url;
|
|
33
|
+
}
|
|
34
|
+
if (packageJson.license) license = packageJson.license;
|
|
35
|
+
if (packageJson.homepage) homepage = packageJson.homepage;
|
|
36
|
+
if (packageJson.bugs) {
|
|
37
|
+
if (typeof packageJson.bugs === "string") support = packageJson.bugs;
|
|
38
|
+
else if (packageJson.bugs.url) support = packageJson.bugs.url;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
return {
|
|
43
|
+
workspaceRoot,
|
|
44
|
+
name,
|
|
45
|
+
namespace,
|
|
46
|
+
repository,
|
|
47
|
+
license,
|
|
48
|
+
homepage,
|
|
49
|
+
support
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Apply default config values to the given config object
|
|
54
|
+
*
|
|
55
|
+
* @param config - The config object to apply defaults to
|
|
56
|
+
* @returns The config object with defaults applied
|
|
57
|
+
*/
|
|
58
|
+
function applyDefaultConfig(config) {
|
|
59
|
+
if (!config.support && config.contact) config.support = config.contact;
|
|
60
|
+
if (!config.contact && config.support) config.contact = config.support;
|
|
61
|
+
if (config.homepage) {
|
|
62
|
+
if (!config.docs) config.docs = `${config.homepage}/docs`;
|
|
63
|
+
if (!config.license) config.license = `${config.homepage}/license`;
|
|
64
|
+
if (!config.support) config.support = `${config.homepage}/support`;
|
|
65
|
+
if (!config.contact) config.contact = `${config.homepage}/contact`;
|
|
66
|
+
if (!config.error?.codesFile || !config?.error?.url) {
|
|
67
|
+
config.error ??= { codesFile: STORM_DEFAULT_ERROR_CODES_FILE };
|
|
68
|
+
if (config.homepage) config.error.url ??= `${config.homepage}/errors`;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
return config;
|
|
72
|
+
}
|
|
73
|
+
//#endregion
|
|
74
|
+
export { applyDefaultConfig, getPackageJsonConfig };
|
package/dist/utilities/index.cjs
CHANGED
|
@@ -1,9 +1,49 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_utilities_colors = require("./colors.cjs");
|
|
3
|
+
const require_utilities_correct_paths = require("./correct-paths.cjs");
|
|
4
|
+
const require_utilities_find_workspace_root = require("./find-workspace-root.cjs");
|
|
5
|
+
const require_utilities_apply_workspace_tokens = require("./apply-workspace-tokens.cjs");
|
|
6
|
+
const require_utilities_file_path_utils = require("./file-path-utils.cjs");
|
|
7
|
+
const require_utilities_get_default_config = require("./get-default-config.cjs");
|
|
8
|
+
const require_utilities_process_handler = require("./process-handler.cjs");
|
|
9
|
+
const require_utilities_run = require("./run.cjs");
|
|
10
|
+
const require_utilities_toml = require("./toml.cjs");
|
|
11
|
+
exports.DEFAULT_COLOR_CONFIG = require_utilities_colors.DEFAULT_COLOR_CONFIG;
|
|
12
|
+
exports.LARGE_BUFFER = require_utilities_run.LARGE_BUFFER;
|
|
13
|
+
exports.applyDefaultConfig = require_utilities_get_default_config.applyDefaultConfig;
|
|
14
|
+
exports.applyWorkspaceBaseTokens = require_utilities_apply_workspace_tokens.applyWorkspaceBaseTokens;
|
|
15
|
+
exports.applyWorkspaceProjectTokens = require_utilities_apply_workspace_tokens.applyWorkspaceProjectTokens;
|
|
16
|
+
exports.applyWorkspaceTokens = require_utilities_apply_workspace_tokens.applyWorkspaceTokens;
|
|
17
|
+
exports.basename = require_utilities_correct_paths.basename;
|
|
18
|
+
exports.correctPaths = require_utilities_correct_paths.correctPaths;
|
|
19
|
+
exports.dirname = require_utilities_correct_paths.dirname;
|
|
20
|
+
exports.exitWithError = require_utilities_process_handler.exitWithError;
|
|
21
|
+
exports.exitWithSuccess = require_utilities_process_handler.exitWithSuccess;
|
|
22
|
+
exports.extname = require_utilities_correct_paths.extname;
|
|
23
|
+
exports.findFileName = require_utilities_file_path_utils.findFileName;
|
|
24
|
+
exports.findFilePath = require_utilities_file_path_utils.findFilePath;
|
|
25
|
+
exports.findWorkspaceRoot = require_utilities_find_workspace_root.findWorkspaceRoot;
|
|
26
|
+
exports.findWorkspaceRootSafe = require_utilities_find_workspace_root.findWorkspaceRootSafe;
|
|
27
|
+
exports.format = require_utilities_correct_paths.format;
|
|
28
|
+
exports.getColor = require_utilities_colors.getColor;
|
|
29
|
+
exports.getColors = require_utilities_colors.getColors;
|
|
30
|
+
exports.getGradient = require_utilities_colors.getGradient;
|
|
31
|
+
exports.getPackageJsonConfig = require_utilities_get_default_config.getPackageJsonConfig;
|
|
32
|
+
exports.handleProcess = require_utilities_process_handler.handleProcess;
|
|
33
|
+
exports.isAbsolute = require_utilities_correct_paths.isAbsolute;
|
|
34
|
+
exports.joinPaths = require_utilities_correct_paths.joinPaths;
|
|
35
|
+
exports.modifyCargoNestedTable = require_utilities_toml.modifyCargoNestedTable;
|
|
36
|
+
exports.modifyCargoTable = require_utilities_toml.modifyCargoTable;
|
|
37
|
+
exports.normalizeString = require_utilities_correct_paths.normalizeString;
|
|
38
|
+
exports.normalizeWindowsPath = require_utilities_correct_paths.normalizeWindowsPath;
|
|
39
|
+
exports.parse = require_utilities_correct_paths.parse;
|
|
40
|
+
exports.parseCargoToml = require_utilities_toml.parseCargoToml;
|
|
41
|
+
exports.parseCargoTomlWithTree = require_utilities_toml.parseCargoTomlWithTree;
|
|
42
|
+
exports.relative = require_utilities_correct_paths.relative;
|
|
43
|
+
exports.removeExtension = require_utilities_file_path_utils.removeExtension;
|
|
44
|
+
exports.resolve = require_utilities_correct_paths.resolve;
|
|
45
|
+
exports.run = require_utilities_run.run;
|
|
46
|
+
exports.runAsync = require_utilities_run.runAsync;
|
|
47
|
+
exports.sep = require_utilities_correct_paths.sep;
|
|
48
|
+
exports.stringifyCargoToml = require_utilities_toml.stringifyCargoToml;
|
|
49
|
+
exports.toNamespacedPath = require_utilities_correct_paths.toNamespacedPath;
|
|
@@ -1,14 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
import '@storm-software/config';
|
|
12
|
-
import '@storm-software/config/types';
|
|
13
|
-
import 'node:path';
|
|
14
|
-
import 'node:child_process';
|
|
1
|
+
import { applyWorkspaceBaseTokens, applyWorkspaceProjectTokens, applyWorkspaceTokens } from "./apply-workspace-tokens.cjs";
|
|
2
|
+
import { DEFAULT_COLOR_CONFIG, getColor, getColors, getGradient } from "./colors.cjs";
|
|
3
|
+
import { basename, correctPaths, dirname, extname, format, isAbsolute, joinPaths, normalizeString, normalizeWindowsPath, parse, relative, resolve, sep, toNamespacedPath } from "./correct-paths.cjs";
|
|
4
|
+
import { FindFileNameOptions, findFileName, findFilePath, removeExtension } from "./file-path-utils.cjs";
|
|
5
|
+
import { findWorkspaceRoot, findWorkspaceRootSafe } from "./find-workspace-root.cjs";
|
|
6
|
+
import { applyDefaultConfig, getPackageJsonConfig } from "./get-default-config.cjs";
|
|
7
|
+
import { exitWithError, exitWithSuccess, handleProcess } from "./process-handler.cjs";
|
|
8
|
+
import { IOType, LARGE_BUFFER, StdioOptions, run, runAsync } from "./run.cjs";
|
|
9
|
+
import { CargoMetadata, CargoToml, Dep, DepKind, Dependency, Docs, Docs2, Features, Metadata, Metadata2, Node, Package, Resolve, Rs, Rs2, Target, Tree, modifyCargoNestedTable, modifyCargoTable, parseCargoToml, parseCargoTomlWithTree, stringifyCargoToml } from "./toml.cjs";
|
|
10
|
+
export { CargoMetadata, CargoToml, DEFAULT_COLOR_CONFIG, Dep, DepKind, Dependency, Docs, Docs2, Features, FindFileNameOptions, IOType, LARGE_BUFFER, Metadata, Metadata2, Node, Package, Resolve, Rs, Rs2, StdioOptions, Target, Tree, applyDefaultConfig, applyWorkspaceBaseTokens, applyWorkspaceProjectTokens, applyWorkspaceTokens, basename, correctPaths, dirname, exitWithError, exitWithSuccess, extname, findFileName, findFilePath, findWorkspaceRoot, findWorkspaceRootSafe, format, getColor, getColors, getGradient, getPackageJsonConfig, handleProcess, isAbsolute, joinPaths, modifyCargoNestedTable, modifyCargoTable, normalizeString, normalizeWindowsPath, parse, parseCargoToml, parseCargoTomlWithTree, relative, removeExtension, resolve, run, runAsync, sep, stringifyCargoToml, toNamespacedPath };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import __tsdown_shims_path from 'node:path';
|
|
2
|
+
import __tsdown_shims_url from 'node:url';
|
|
3
|
+
import { applyWorkspaceBaseTokens, applyWorkspaceProjectTokens, applyWorkspaceTokens } from "./apply-workspace-tokens.mjs";
|
|
4
|
+
import { DEFAULT_COLOR_CONFIG, getColor, getColors, getGradient } from "./colors.mjs";
|
|
5
|
+
import { basename, correctPaths, dirname, extname, format, isAbsolute, joinPaths, normalizeString, normalizeWindowsPath, parse, relative, resolve, sep, toNamespacedPath } from "./correct-paths.mjs";
|
|
6
|
+
import { FindFileNameOptions, findFileName, findFilePath, removeExtension } from "./file-path-utils.mjs";
|
|
7
|
+
import { findWorkspaceRoot, findWorkspaceRootSafe } from "./find-workspace-root.mjs";
|
|
8
|
+
import { applyDefaultConfig, getPackageJsonConfig } from "./get-default-config.mjs";
|
|
9
|
+
import { exitWithError, exitWithSuccess, handleProcess } from "./process-handler.mjs";
|
|
10
|
+
import { IOType, LARGE_BUFFER, StdioOptions, run, runAsync } from "./run.mjs";
|
|
11
|
+
import { CargoMetadata, CargoToml, Dep, DepKind, Dependency, Docs, Docs2, Features, Metadata, Metadata2, Node, Package, Resolve, Rs, Rs2, Target, Tree, modifyCargoNestedTable, modifyCargoTable, parseCargoToml, parseCargoTomlWithTree, stringifyCargoToml } from "./toml.mjs";
|
|
12
|
+
export { CargoMetadata, CargoToml, DEFAULT_COLOR_CONFIG, Dep, DepKind, Dependency, Docs, Docs2, Features, FindFileNameOptions, IOType, LARGE_BUFFER, Metadata, Metadata2, Node, Package, Resolve, Rs, Rs2, StdioOptions, Target, Tree, applyDefaultConfig, applyWorkspaceBaseTokens, applyWorkspaceProjectTokens, applyWorkspaceTokens, basename, correctPaths, dirname, exitWithError, exitWithSuccess, extname, findFileName, findFilePath, findWorkspaceRoot, findWorkspaceRootSafe, format, getColor, getColors, getGradient, getPackageJsonConfig, handleProcess, isAbsolute, joinPaths, modifyCargoNestedTable, modifyCargoTable, normalizeString, normalizeWindowsPath, parse, parseCargoToml, parseCargoTomlWithTree, relative, removeExtension, resolve, run, runAsync, sep, stringifyCargoToml, toNamespacedPath };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import "node:path";
|
|
2
|
+
import "node:url";
|
|
3
|
+
import.meta.url;
|
|
4
|
+
import { DEFAULT_COLOR_CONFIG, getColor, getColors, getGradient } from "./colors.mjs";
|
|
5
|
+
import { basename, correctPaths, dirname, extname, format, isAbsolute, joinPaths, normalizeString, normalizeWindowsPath, parse, relative, resolve, sep, toNamespacedPath } from "./correct-paths.mjs";
|
|
6
|
+
import { findWorkspaceRoot, findWorkspaceRootSafe } from "./find-workspace-root.mjs";
|
|
7
|
+
import { applyWorkspaceBaseTokens, applyWorkspaceProjectTokens, applyWorkspaceTokens } from "./apply-workspace-tokens.mjs";
|
|
8
|
+
import { findFileName, findFilePath, removeExtension } from "./file-path-utils.mjs";
|
|
9
|
+
import { applyDefaultConfig, getPackageJsonConfig } from "./get-default-config.mjs";
|
|
10
|
+
import { exitWithError, exitWithSuccess, handleProcess } from "./process-handler.mjs";
|
|
11
|
+
import { LARGE_BUFFER, run, runAsync } from "./run.mjs";
|
|
12
|
+
import { modifyCargoNestedTable, modifyCargoTable, parseCargoToml, parseCargoTomlWithTree, stringifyCargoToml } from "./toml.mjs";
|
|
13
|
+
export { DEFAULT_COLOR_CONFIG, LARGE_BUFFER, applyDefaultConfig, applyWorkspaceBaseTokens, applyWorkspaceProjectTokens, applyWorkspaceTokens, basename, correctPaths, dirname, exitWithError, exitWithSuccess, extname, findFileName, findFilePath, findWorkspaceRoot, findWorkspaceRootSafe, format, getColor, getColors, getGradient, getPackageJsonConfig, handleProcess, isAbsolute, joinPaths, modifyCargoNestedTable, modifyCargoTable, normalizeString, normalizeWindowsPath, parse, parseCargoToml, parseCargoTomlWithTree, relative, removeExtension, resolve, run, runAsync, sep, stringifyCargoToml, toNamespacedPath };
|
|
@@ -1,53 +1,38 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
var _console = require('../logger/console');
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_logger_console = require("../logger/console.cjs");
|
|
3
|
+
//#region src/utilities/process-handler.ts
|
|
7
4
|
const exitWithError = (config) => {
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
require_logger_console.writeFatal("Exiting script with an error status...", config);
|
|
6
|
+
process.exit(1);
|
|
10
7
|
};
|
|
11
8
|
const exitWithSuccess = (config) => {
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
require_logger_console.writeSuccess("Script completed successfully. Exiting...", config);
|
|
10
|
+
process.exit(0);
|
|
14
11
|
};
|
|
15
12
|
const handleProcess = (config) => {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
_console.writeError.call(void 0, `The program terminated with signal code: ${signal}`, config);
|
|
38
|
-
exitWithError(config);
|
|
39
|
-
});
|
|
40
|
-
process.on("SIGINT", (signal) => {
|
|
41
|
-
_console.writeError.call(void 0, `The program terminated with signal code: ${signal}`, config);
|
|
42
|
-
exitWithError(config);
|
|
43
|
-
});
|
|
44
|
-
process.on("SIGHUP", (signal) => {
|
|
45
|
-
_console.writeError.call(void 0, `The program terminated with signal code: ${signal}`, config);
|
|
46
|
-
exitWithError(config);
|
|
47
|
-
});
|
|
13
|
+
require_logger_console.writeTrace(`Using the following arguments to process the script: ${process.argv.join(", ")}`, config);
|
|
14
|
+
process.on("unhandledRejection", (error) => {
|
|
15
|
+
require_logger_console.writeError(`An Unhandled Rejection occurred while running the program: ${error && typeof error === "object" && "message" in error && error?.message ? error.message : typeof error === "string" ? error : "Unknown error"} \nStacktrace: ${error && typeof error === "object" && "stack" in error && error?.stack ? error.stack : ""}`, config);
|
|
16
|
+
exitWithError(config);
|
|
17
|
+
});
|
|
18
|
+
process.on("uncaughtException", (error) => {
|
|
19
|
+
require_logger_console.writeError(`An Uncaught Exception occurred while running the program: ${error && typeof error === "object" && "message" in error && error?.message ? error.message : typeof error === "string" ? error : "Unknown error"} \nStacktrace: ${error && typeof error === "object" && "stack" in error && error?.stack ? error.stack : ""}`, config);
|
|
20
|
+
exitWithError(config);
|
|
21
|
+
});
|
|
22
|
+
process.on("SIGTERM", (signal) => {
|
|
23
|
+
require_logger_console.writeError(`The program terminated with signal code: ${signal}`, config);
|
|
24
|
+
exitWithError(config);
|
|
25
|
+
});
|
|
26
|
+
process.on("SIGINT", (signal) => {
|
|
27
|
+
require_logger_console.writeError(`The program terminated with signal code: ${signal}`, config);
|
|
28
|
+
exitWithError(config);
|
|
29
|
+
});
|
|
30
|
+
process.on("SIGHUP", (signal) => {
|
|
31
|
+
require_logger_console.writeError(`The program terminated with signal code: ${signal}`, config);
|
|
32
|
+
exitWithError(config);
|
|
33
|
+
});
|
|
48
34
|
};
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
exports.exitWithError = exitWithError; exports.exitWithSuccess = exitWithSuccess; exports.handleProcess = handleProcess;
|
|
35
|
+
//#endregion
|
|
36
|
+
exports.exitWithError = exitWithError;
|
|
37
|
+
exports.exitWithSuccess = exitWithSuccess;
|
|
38
|
+
exports.handleProcess = handleProcess;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { StormWorkspaceConfig } from
|
|
2
|
-
|
|
1
|
+
import { StormWorkspaceConfig } from "@storm-software/config";
|
|
2
|
+
//#region src/utilities/process-handler.d.ts
|
|
3
3
|
declare const exitWithError: (config?: Partial<StormWorkspaceConfig>) => never;
|
|
4
4
|
declare const exitWithSuccess: (config?: Partial<StormWorkspaceConfig>) => never;
|
|
5
5
|
declare const handleProcess: (config?: Partial<StormWorkspaceConfig>) => void;
|
|
6
|
-
|
|
7
|
-
export { exitWithError, exitWithSuccess, handleProcess };
|
|
6
|
+
//#endregion
|
|
7
|
+
export { exitWithError, exitWithSuccess, handleProcess };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import __tsdown_shims_path from 'node:path';
|
|
2
|
+
import __tsdown_shims_url from 'node:url';
|
|
3
|
+
import { StormWorkspaceConfig } from "@storm-software/config";
|
|
4
|
+
//#region src/utilities/process-handler.d.ts
|
|
5
|
+
declare const exitWithError: (config?: Partial<StormWorkspaceConfig>) => never;
|
|
6
|
+
declare const exitWithSuccess: (config?: Partial<StormWorkspaceConfig>) => never;
|
|
7
|
+
declare const handleProcess: (config?: Partial<StormWorkspaceConfig>) => void;
|
|
8
|
+
//#endregion
|
|
9
|
+
export { exitWithError, exitWithSuccess, handleProcess };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import "node:path";
|
|
2
|
+
import "node:url";
|
|
3
|
+
import.meta.url;
|
|
4
|
+
import { writeError, writeFatal, writeSuccess, writeTrace } from "../logger/console.mjs";
|
|
5
|
+
//#region src/utilities/process-handler.ts
|
|
6
|
+
const exitWithError = (config) => {
|
|
7
|
+
writeFatal("Exiting script with an error status...", config);
|
|
8
|
+
process.exit(1);
|
|
9
|
+
};
|
|
10
|
+
const exitWithSuccess = (config) => {
|
|
11
|
+
writeSuccess("Script completed successfully. Exiting...", config);
|
|
12
|
+
process.exit(0);
|
|
13
|
+
};
|
|
14
|
+
const handleProcess = (config) => {
|
|
15
|
+
writeTrace(`Using the following arguments to process the script: ${process.argv.join(", ")}`, config);
|
|
16
|
+
process.on("unhandledRejection", (error) => {
|
|
17
|
+
writeError(`An Unhandled Rejection occurred while running the program: ${error && typeof error === "object" && "message" in error && error?.message ? error.message : typeof error === "string" ? error : "Unknown error"} \nStacktrace: ${error && typeof error === "object" && "stack" in error && error?.stack ? error.stack : ""}`, config);
|
|
18
|
+
exitWithError(config);
|
|
19
|
+
});
|
|
20
|
+
process.on("uncaughtException", (error) => {
|
|
21
|
+
writeError(`An Uncaught Exception occurred while running the program: ${error && typeof error === "object" && "message" in error && error?.message ? error.message : typeof error === "string" ? error : "Unknown error"} \nStacktrace: ${error && typeof error === "object" && "stack" in error && error?.stack ? error.stack : ""}`, config);
|
|
22
|
+
exitWithError(config);
|
|
23
|
+
});
|
|
24
|
+
process.on("SIGTERM", (signal) => {
|
|
25
|
+
writeError(`The program terminated with signal code: ${signal}`, config);
|
|
26
|
+
exitWithError(config);
|
|
27
|
+
});
|
|
28
|
+
process.on("SIGINT", (signal) => {
|
|
29
|
+
writeError(`The program terminated with signal code: ${signal}`, config);
|
|
30
|
+
exitWithError(config);
|
|
31
|
+
});
|
|
32
|
+
process.on("SIGHUP", (signal) => {
|
|
33
|
+
writeError(`The program terminated with signal code: ${signal}`, config);
|
|
34
|
+
exitWithError(config);
|
|
35
|
+
});
|
|
36
|
+
};
|
|
37
|
+
//#endregion
|
|
38
|
+
export { exitWithError, exitWithSuccess, handleProcess };
|