@storm-software/config-tools 1.176.15 → 1.176.18
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 -1
- package/bin/config.cjs +8 -4
- package/bin/config.js +8 -4
- package/dist/{chunk-DVENQC2F.cjs → chunk-2IFNLLUL.cjs} +3 -3
- package/dist/{chunk-ZLQAA425.js → chunk-5DA26BV4.js} +1 -1
- package/dist/{chunk-CCW22JYO.js → chunk-7MBEC23I.js} +1 -1
- package/dist/{chunk-C77H5TXM.js → chunk-BEFQ5B4E.js} +1 -1
- package/dist/{chunk-RGAB6SWX.js → chunk-C5L7VSBR.js} +1 -1
- package/dist/{chunk-34OCDM7F.js → chunk-ENEFXS5D.js} +1 -1
- package/dist/{chunk-RP3PSEDA.cjs → chunk-EVOHJKUO.cjs} +2 -2
- package/dist/{chunk-P2KJ6EZO.js → chunk-HVVJHTFS.js} +8 -4
- package/dist/{chunk-EV4US3SK.cjs → chunk-INZ6GCPT.cjs} +2 -2
- package/dist/{chunk-EKVUGCY6.cjs → chunk-J2LN5PAX.cjs} +3 -3
- package/dist/{chunk-J7OMCZHA.cjs → chunk-LKCXHEY6.cjs} +10 -10
- package/dist/{chunk-CTYIEJ7C.cjs → chunk-LOY6ICHZ.cjs} +8 -4
- package/dist/{chunk-D3VDRI3F.js → chunk-UHSAPVE4.js} +1 -1
- package/dist/{chunk-2OGCM7UN.js → chunk-YEFBKZON.js} +2 -2
- package/dist/{chunk-NP5N65JN.cjs → chunk-YNDGTWLY.cjs} +9 -9
- package/dist/{chunk-BGR77S6Y.cjs → chunk-ZNODVZNQ.cjs} +9 -9
- package/dist/config-file/get-config-file.cjs +7 -7
- package/dist/config-file/get-config-file.js +6 -6
- package/dist/config-file/index.cjs +7 -7
- package/dist/config-file/index.js +6 -6
- package/dist/create-storm-config.cjs +8 -8
- package/dist/create-storm-config.js +7 -7
- package/dist/get-config.cjs +9 -9
- package/dist/get-config.js +8 -8
- package/dist/index.cjs +9 -9
- package/dist/index.js +8 -8
- package/dist/logger/chalk.cjs +2 -2
- package/dist/logger/chalk.d.cts +4 -0
- package/dist/logger/chalk.d.ts +4 -0
- package/dist/logger/chalk.js +1 -1
- package/dist/logger/console.cjs +3 -3
- package/dist/logger/console.js +2 -2
- package/dist/logger/create-logger.cjs +4 -4
- package/dist/logger/create-logger.js +3 -3
- package/dist/logger/index.cjs +4 -4
- package/dist/logger/index.js +3 -3
- package/dist/utilities/index.cjs +6 -6
- package/dist/utilities/index.js +5 -5
- package/dist/utilities/process-handler.cjs +4 -4
- package/dist/utilities/process-handler.js +3 -3
- package/dist/utilities/toml.cjs +5 -5
- package/dist/utilities/toml.js +4 -4
- package/package.json +3 -3
- package/dist/chunk-5IK56ULJ.cjs +0 -55
- package/dist/chunk-66NG3IMH.js +0 -131
- package/dist/chunk-6RRYSEZX.js +0 -82
- package/dist/chunk-7ETBV5GI.js +0 -47
- package/dist/chunk-B3GCBJWU.js +0 -358
- package/dist/chunk-CGZUIRJC.js +0 -154
- package/dist/chunk-COFLNWWF.cjs +0 -199
- package/dist/chunk-FN5I4YDC.js +0 -40
- package/dist/chunk-H23BFVJZ.js +0 -92
- package/dist/chunk-HDZDJM2A.cjs +0 -158
- package/dist/chunk-HGKCHX5V.js +0 -199
- package/dist/chunk-LAMW4XOL.cjs +0 -92
- package/dist/chunk-LFMYCBX4.cjs +0 -33
- package/dist/chunk-N3XDUGRP.cjs +0 -154
- package/dist/chunk-PQFFXKJC.js +0 -158
- package/dist/chunk-QSPWWF3B.cjs +0 -40
- package/dist/chunk-SNUKAQ73.js +0 -81
- package/dist/chunk-V34OFEO4.js +0 -39
- package/dist/chunk-V6LEGHTB.cjs +0 -47
- package/dist/chunk-WAGU7L62.cjs +0 -358
- package/dist/chunk-WELR3VV2.js +0 -33
- package/dist/chunk-XGDVC6AM.cjs +0 -39
- package/dist/chunk-XGOYEDHP.cjs +0 -131
- package/dist/chunk-Y73PCV6G.js +0 -55
- package/dist/chunk-ZAEOJ4ND.cjs +0 -82
- package/dist/chunk-ZGSL4YCI.cjs +0 -81
package/dist/utilities/toml.js
CHANGED
|
@@ -4,14 +4,14 @@ import {
|
|
|
4
4
|
parseCargoToml,
|
|
5
5
|
parseCargoTomlWithTree,
|
|
6
6
|
stringifyCargoToml
|
|
7
|
-
} from "../chunk-
|
|
7
|
+
} from "../chunk-ENEFXS5D.js";
|
|
8
8
|
import "../chunk-RRKB32OH.js";
|
|
9
|
-
import "../chunk-
|
|
10
|
-
import "../chunk-
|
|
9
|
+
import "../chunk-UHSAPVE4.js";
|
|
10
|
+
import "../chunk-C5L7VSBR.js";
|
|
11
11
|
import "../chunk-SHD7ZUSQ.js";
|
|
12
12
|
import "../chunk-PTHGOJU6.js";
|
|
13
13
|
import "../chunk-6JBGUE4A.js";
|
|
14
|
-
import "../chunk-
|
|
14
|
+
import "../chunk-HVVJHTFS.js";
|
|
15
15
|
import "../chunk-LM2UMGYA.js";
|
|
16
16
|
import "../chunk-G2MK47WL.js";
|
|
17
17
|
import "../chunk-CZ4IE2QN.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storm-software/config-tools",
|
|
3
|
-
"version": "1.176.
|
|
3
|
+
"version": "1.176.18",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A package containing various utilities to support custom workspace configurations and environment management for Storm Software projects, including configuration file handling, environment variable management, and logging utilities.",
|
|
6
6
|
"repository": {
|
|
@@ -211,7 +211,7 @@
|
|
|
211
211
|
],
|
|
212
212
|
"dependencies": {
|
|
213
213
|
"@ltd/j-toml": "1.38.0",
|
|
214
|
-
"@storm-software/config": "^1.125.
|
|
214
|
+
"@storm-software/config": "^1.125.16",
|
|
215
215
|
"c12": "^2.0.0-beta.2",
|
|
216
216
|
"chalk": "^4.1.2",
|
|
217
217
|
"commander": "^12.1.0",
|
|
@@ -224,5 +224,5 @@
|
|
|
224
224
|
"devDependencies": { "@types/node": "^22.10.2", "tsup": "8.4.0" },
|
|
225
225
|
"publishConfig": { "access": "public" },
|
|
226
226
|
"sideEffects": false,
|
|
227
|
-
"gitHead": "
|
|
227
|
+
"gitHead": "1f847d84feecf3f77906317450fd4caa540aaacd"
|
|
228
228
|
}
|
package/dist/chunk-5IK56ULJ.cjs
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
var _chunkRP3PSEDAcjs = require('./chunk-RP3PSEDA.cjs');
|
|
7
|
-
|
|
8
|
-
// src/utilities/process-handler.ts
|
|
9
|
-
var exitWithError = (config) => {
|
|
10
|
-
_chunkRP3PSEDAcjs.writeFatal.call(void 0, "Exiting script with an error status...", config);
|
|
11
|
-
process.exit(1);
|
|
12
|
-
};
|
|
13
|
-
var exitWithSuccess = (config) => {
|
|
14
|
-
_chunkRP3PSEDAcjs.writeSuccess.call(void 0, "Script completed successfully. Exiting...", config);
|
|
15
|
-
process.exit(0);
|
|
16
|
-
};
|
|
17
|
-
var handleProcess = (config) => {
|
|
18
|
-
_chunkRP3PSEDAcjs.writeTrace.call(void 0,
|
|
19
|
-
`Using the following arguments to process the script: ${process.argv.join(", ")}`,
|
|
20
|
-
config
|
|
21
|
-
);
|
|
22
|
-
process.on("unhandledRejection", (error) => {
|
|
23
|
-
_chunkRP3PSEDAcjs.writeError.call(void 0,
|
|
24
|
-
`An Unhandled Rejection occurred while running the program: ${error}`,
|
|
25
|
-
config
|
|
26
|
-
);
|
|
27
|
-
exitWithError(config);
|
|
28
|
-
});
|
|
29
|
-
process.on("uncaughtException", (error) => {
|
|
30
|
-
_chunkRP3PSEDAcjs.writeError.call(void 0,
|
|
31
|
-
`An Uncaught Exception occurred while running the program: ${error.message}
|
|
32
|
-
Stacktrace: ${error.stack}`,
|
|
33
|
-
config
|
|
34
|
-
);
|
|
35
|
-
exitWithError(config);
|
|
36
|
-
});
|
|
37
|
-
process.on("SIGTERM", (signal) => {
|
|
38
|
-
_chunkRP3PSEDAcjs.writeError.call(void 0, `The program terminated with signal code: ${signal}`, config);
|
|
39
|
-
exitWithError(config);
|
|
40
|
-
});
|
|
41
|
-
process.on("SIGINT", (signal) => {
|
|
42
|
-
_chunkRP3PSEDAcjs.writeError.call(void 0, `The program terminated with signal code: ${signal}`, config);
|
|
43
|
-
exitWithError(config);
|
|
44
|
-
});
|
|
45
|
-
process.on("SIGHUP", (signal) => {
|
|
46
|
-
_chunkRP3PSEDAcjs.writeError.call(void 0, `The program terminated with signal code: ${signal}`, config);
|
|
47
|
-
exitWithError(config);
|
|
48
|
-
});
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
exports.exitWithError = exitWithError; exports.exitWithSuccess = exitWithSuccess; exports.handleProcess = handleProcess;
|
package/dist/chunk-66NG3IMH.js
DELETED
|
@@ -1,131 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
findWorkspaceRoot
|
|
3
|
-
} from "./chunk-6RRYSEZX.js";
|
|
4
|
-
import {
|
|
5
|
-
joinPaths
|
|
6
|
-
} from "./chunk-7IMLZPZF.js";
|
|
7
|
-
|
|
8
|
-
// src/utilities/get-default-config.ts
|
|
9
|
-
import {
|
|
10
|
-
STORM_DEFAULT_ERROR_CODES_FILE,
|
|
11
|
-
STORM_DEFAULT_LICENSE
|
|
12
|
-
} from "@storm-software/config";
|
|
13
|
-
import { existsSync } from "node:fs";
|
|
14
|
-
import { readFile } from "node:fs/promises";
|
|
15
|
-
import { join } from "node:path";
|
|
16
|
-
var DEFAULT_COLOR_CONFIG = {
|
|
17
|
-
light: {
|
|
18
|
-
background: "#fafafa",
|
|
19
|
-
foreground: "#1d1e22",
|
|
20
|
-
brand: "#1fb2a6",
|
|
21
|
-
alternate: "#db2777",
|
|
22
|
-
help: "#5C4EE5",
|
|
23
|
-
success: "#087f5b",
|
|
24
|
-
info: "#0550ae",
|
|
25
|
-
warning: "#e3b341",
|
|
26
|
-
danger: "#D8314A",
|
|
27
|
-
positive: "#22c55e",
|
|
28
|
-
negative: "#dc2626"
|
|
29
|
-
},
|
|
30
|
-
dark: {
|
|
31
|
-
background: "#1d1e22",
|
|
32
|
-
foreground: "#cbd5e1",
|
|
33
|
-
brand: "#2dd4bf",
|
|
34
|
-
alternate: "#db2777",
|
|
35
|
-
help: "#818cf8",
|
|
36
|
-
success: "#10b981",
|
|
37
|
-
info: "#58a6ff",
|
|
38
|
-
warning: "#f3d371",
|
|
39
|
-
danger: "#D8314A",
|
|
40
|
-
positive: "#22c55e",
|
|
41
|
-
negative: "#dc2626"
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
|
-
async function getPackageJsonConfig(root) {
|
|
45
|
-
let license = STORM_DEFAULT_LICENSE;
|
|
46
|
-
let homepage = void 0;
|
|
47
|
-
let support = void 0;
|
|
48
|
-
let name = void 0;
|
|
49
|
-
let namespace = void 0;
|
|
50
|
-
let repository = void 0;
|
|
51
|
-
const workspaceRoot = findWorkspaceRoot(root);
|
|
52
|
-
if (existsSync(join(workspaceRoot, "package.json"))) {
|
|
53
|
-
const file = await readFile(
|
|
54
|
-
joinPaths(workspaceRoot, "package.json"),
|
|
55
|
-
"utf8"
|
|
56
|
-
);
|
|
57
|
-
if (file) {
|
|
58
|
-
const packageJson = JSON.parse(file);
|
|
59
|
-
if (packageJson.name) {
|
|
60
|
-
name = packageJson.name;
|
|
61
|
-
}
|
|
62
|
-
if (packageJson.namespace) {
|
|
63
|
-
namespace = packageJson.namespace;
|
|
64
|
-
}
|
|
65
|
-
if (packageJson.repository) {
|
|
66
|
-
if (typeof packageJson.repository === "string") {
|
|
67
|
-
repository = packageJson.repository;
|
|
68
|
-
} else if (packageJson.repository.url) {
|
|
69
|
-
repository = packageJson.repository.url;
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
if (packageJson.license) {
|
|
73
|
-
license = packageJson.license;
|
|
74
|
-
}
|
|
75
|
-
if (packageJson.homepage) {
|
|
76
|
-
homepage = packageJson.homepage;
|
|
77
|
-
}
|
|
78
|
-
if (packageJson.bugs) {
|
|
79
|
-
if (typeof packageJson.bugs === "string") {
|
|
80
|
-
support = packageJson.bugs;
|
|
81
|
-
} else if (packageJson.bugs.url) {
|
|
82
|
-
support = packageJson.bugs.url;
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
return {
|
|
88
|
-
workspaceRoot,
|
|
89
|
-
name,
|
|
90
|
-
namespace,
|
|
91
|
-
repository,
|
|
92
|
-
license,
|
|
93
|
-
homepage,
|
|
94
|
-
support
|
|
95
|
-
};
|
|
96
|
-
}
|
|
97
|
-
function applyDefaultConfig(config) {
|
|
98
|
-
if (!config.support && config.contact) {
|
|
99
|
-
config.support = config.contact;
|
|
100
|
-
}
|
|
101
|
-
if (!config.contact && config.support) {
|
|
102
|
-
config.contact = config.support;
|
|
103
|
-
}
|
|
104
|
-
if (config.homepage) {
|
|
105
|
-
if (!config.docs) {
|
|
106
|
-
config.docs = `${config.homepage}/docs`;
|
|
107
|
-
}
|
|
108
|
-
if (!config.license) {
|
|
109
|
-
config.license = `${config.homepage}/license`;
|
|
110
|
-
}
|
|
111
|
-
if (!config.support) {
|
|
112
|
-
config.support = `${config.homepage}/support`;
|
|
113
|
-
}
|
|
114
|
-
if (!config.contact) {
|
|
115
|
-
config.contact = `${config.homepage}/contact`;
|
|
116
|
-
}
|
|
117
|
-
if (!config.error?.codesFile || !config?.error?.url) {
|
|
118
|
-
config.error ??= { codesFile: STORM_DEFAULT_ERROR_CODES_FILE };
|
|
119
|
-
if (config.homepage) {
|
|
120
|
-
config.error.url ??= `${config.homepage}/errors`;
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
return config;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
export {
|
|
128
|
-
DEFAULT_COLOR_CONFIG,
|
|
129
|
-
getPackageJsonConfig,
|
|
130
|
-
applyDefaultConfig
|
|
131
|
-
};
|
package/dist/chunk-6RRYSEZX.js
DELETED
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
correctPaths
|
|
3
|
-
} from "./chunk-7IMLZPZF.js";
|
|
4
|
-
import {
|
|
5
|
-
findFolderUp
|
|
6
|
-
} from "./chunk-6JBGUE4A.js";
|
|
7
|
-
|
|
8
|
-
// src/utilities/find-workspace-root.ts
|
|
9
|
-
var rootFiles = [
|
|
10
|
-
"storm-workspace.json",
|
|
11
|
-
"storm-workspace.json",
|
|
12
|
-
"storm-workspace.yaml",
|
|
13
|
-
"storm-workspace.yml",
|
|
14
|
-
"storm-workspace.js",
|
|
15
|
-
"storm-workspace.ts",
|
|
16
|
-
".storm-workspace.json",
|
|
17
|
-
".storm-workspace.yaml",
|
|
18
|
-
".storm-workspace.yml",
|
|
19
|
-
".storm-workspace.js",
|
|
20
|
-
".storm-workspace.ts",
|
|
21
|
-
"lerna.json",
|
|
22
|
-
"nx.json",
|
|
23
|
-
"turbo.json",
|
|
24
|
-
"npm-workspace.json",
|
|
25
|
-
"yarn-workspace.json",
|
|
26
|
-
"pnpm-workspace.json",
|
|
27
|
-
"npm-workspace.yaml",
|
|
28
|
-
"yarn-workspace.yaml",
|
|
29
|
-
"pnpm-workspace.yaml",
|
|
30
|
-
"npm-workspace.yml",
|
|
31
|
-
"yarn-workspace.yml",
|
|
32
|
-
"pnpm-workspace.yml",
|
|
33
|
-
"npm-lock.json",
|
|
34
|
-
"yarn-lock.json",
|
|
35
|
-
"pnpm-lock.json",
|
|
36
|
-
"npm-lock.yaml",
|
|
37
|
-
"yarn-lock.yaml",
|
|
38
|
-
"pnpm-lock.yaml",
|
|
39
|
-
"npm-lock.yml",
|
|
40
|
-
"yarn-lock.yml",
|
|
41
|
-
"pnpm-lock.yml",
|
|
42
|
-
"bun.lockb"
|
|
43
|
-
];
|
|
44
|
-
var rootDirectories = [
|
|
45
|
-
".storm-workspace",
|
|
46
|
-
".nx",
|
|
47
|
-
".github",
|
|
48
|
-
".vscode",
|
|
49
|
-
".verdaccio"
|
|
50
|
-
];
|
|
51
|
-
function findWorkspaceRootSafe(pathInsideMonorepo) {
|
|
52
|
-
if (process.env.STORM_WORKSPACE_ROOT || process.env.NX_WORKSPACE_ROOT_PATH) {
|
|
53
|
-
return correctPaths(
|
|
54
|
-
process.env.STORM_WORKSPACE_ROOT ?? process.env.NX_WORKSPACE_ROOT_PATH
|
|
55
|
-
);
|
|
56
|
-
}
|
|
57
|
-
return correctPaths(
|
|
58
|
-
findFolderUp(
|
|
59
|
-
pathInsideMonorepo ?? process.cwd(),
|
|
60
|
-
rootFiles,
|
|
61
|
-
rootDirectories
|
|
62
|
-
)
|
|
63
|
-
);
|
|
64
|
-
}
|
|
65
|
-
function findWorkspaceRoot(pathInsideMonorepo) {
|
|
66
|
-
const result = findWorkspaceRootSafe(pathInsideMonorepo);
|
|
67
|
-
if (!result) {
|
|
68
|
-
throw new Error(
|
|
69
|
-
`Cannot find workspace root upwards from known path. Files search list includes:
|
|
70
|
-
${rootFiles.join(
|
|
71
|
-
"\n"
|
|
72
|
-
)}
|
|
73
|
-
Path: ${pathInsideMonorepo ? pathInsideMonorepo : process.cwd()}`
|
|
74
|
-
);
|
|
75
|
-
}
|
|
76
|
-
return result;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
export {
|
|
80
|
-
findWorkspaceRootSafe,
|
|
81
|
-
findWorkspaceRoot
|
|
82
|
-
};
|
package/dist/chunk-7ETBV5GI.js
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
writeError
|
|
3
|
-
} from "./chunk-RGAB6SWX.js";
|
|
4
|
-
|
|
5
|
-
// src/utilities/toml.ts
|
|
6
|
-
import TOML from "@ltd/j-toml";
|
|
7
|
-
function parseCargoTomlWithTree(tree, projectRoot, projectName) {
|
|
8
|
-
const cargoTomlString = tree.read(`${projectRoot}/Cargo.toml`)?.toString();
|
|
9
|
-
if (!cargoTomlString) {
|
|
10
|
-
writeError(`Cannot find a Cargo.toml file in the ${projectName}`);
|
|
11
|
-
throw new Error();
|
|
12
|
-
}
|
|
13
|
-
return parseCargoToml(cargoTomlString);
|
|
14
|
-
}
|
|
15
|
-
function parseCargoToml(cargoString) {
|
|
16
|
-
if (!cargoString) {
|
|
17
|
-
throw new Error("Cargo.toml is empty");
|
|
18
|
-
}
|
|
19
|
-
return TOML.parse(cargoString, {
|
|
20
|
-
x: { comment: true }
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
function stringifyCargoToml(cargoToml) {
|
|
24
|
-
const tomlString = TOML.stringify(cargoToml, {
|
|
25
|
-
newlineAround: "section"
|
|
26
|
-
});
|
|
27
|
-
if (Array.isArray(tomlString)) {
|
|
28
|
-
return tomlString.join("\n");
|
|
29
|
-
}
|
|
30
|
-
return tomlString;
|
|
31
|
-
}
|
|
32
|
-
function modifyCargoTable(toml, section, key, value) {
|
|
33
|
-
toml[section] ??= TOML.Section({});
|
|
34
|
-
toml[section][key] = typeof value === "object" && !Array.isArray(value) ? TOML.inline(value) : typeof value === "function" ? value() : value;
|
|
35
|
-
}
|
|
36
|
-
function modifyCargoNestedTable(toml, section, key, value) {
|
|
37
|
-
toml[section] ??= {};
|
|
38
|
-
toml[section][key] = TOML.Section(value);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export {
|
|
42
|
-
parseCargoTomlWithTree,
|
|
43
|
-
parseCargoToml,
|
|
44
|
-
stringifyCargoToml,
|
|
45
|
-
modifyCargoTable,
|
|
46
|
-
modifyCargoNestedTable
|
|
47
|
-
};
|