@storm-software/config-tools 1.190.119 → 1.190.120
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 +20 -1532
- package/bin/config.js +19 -1527
- package/dist/config-file/get-config-file.cjs +80 -25
- package/dist/config-file/get-config-file.js +79 -24
- package/dist/config-file/index.cjs +1 -29
- package/dist/config-file/index.js +1 -29
- package/dist/create-storm-config.cjs +138 -26
- package/dist/create-storm-config.js +140 -28
- package/dist/env/get-env.cjs +221 -6
- package/dist/env/get-env.js +221 -6
- package/dist/env/index.cjs +2 -18
- package/dist/env/index.js +2 -18
- package/dist/env/set-env.cjs +383 -8
- package/dist/env/set-env.js +382 -7
- package/dist/get-config.cjs +28 -27
- package/dist/get-config.js +29 -28
- package/dist/index.cjs +7 -201
- package/dist/index.js +7 -201
- package/dist/logger/chalk.cjs +32 -4
- package/dist/logger/chalk.js +31 -3
- package/dist/logger/console-icons.cjs +15 -6
- package/dist/logger/console-icons.js +14 -5
- package/dist/logger/console.cjs +191 -37
- package/dist/logger/console.js +176 -22
- package/dist/logger/create-logger.cjs +25 -12
- package/dist/logger/create-logger.js +24 -11
- package/dist/logger/format-timestamp.cjs +4 -4
- package/dist/logger/format-timestamp.js +3 -3
- package/dist/logger/get-log-level.cjs +60 -7
- package/dist/logger/get-log-level.js +59 -6
- package/dist/logger/index.cjs +7 -61
- package/dist/logger/index.js +7 -61
- package/dist/logger/is-unicode-supported.cjs +10 -4
- package/dist/logger/is-unicode-supported.js +9 -3
- package/dist/types.cjs +25 -5
- package/dist/types.js +24 -4
- package/dist/utilities/apply-workspace-tokens.cjs +72 -9
- package/dist/utilities/apply-workspace-tokens.js +71 -8
- package/dist/utilities/colors.cjs +76 -7
- package/dist/utilities/colors.js +75 -6
- package/dist/utilities/correct-paths.cjs +231 -32
- package/dist/utilities/correct-paths.js +215 -16
- package/dist/utilities/file-path-utils.cjs +29 -7
- package/dist/utilities/file-path-utils.js +28 -6
- package/dist/utilities/find-up.cjs +21 -4
- package/dist/utilities/find-up.js +20 -3
- package/dist/utilities/find-workspace-root.cjs +74 -7
- package/dist/utilities/find-workspace-root.js +73 -6
- package/dist/utilities/get-default-config.cjs +90 -6
- package/dist/utilities/get-default-config.js +90 -6
- package/dist/utilities/index.cjs +9 -109
- package/dist/utilities/index.js +9 -109
- package/dist/utilities/process-handler.cjs +46 -11
- package/dist/utilities/process-handler.js +47 -12
- package/dist/utilities/run.cjs +34 -6
- package/dist/utilities/run.js +33 -5
- package/dist/utilities/toml.cjs +42 -24
- package/dist/utilities/toml.js +35 -17
- package/package.json +4 -4
- package/dist/chunk-24B36RDB.cjs +0 -81
- package/dist/chunk-27N3QEX5.js +0 -40
- package/dist/chunk-2AVLCXLT.js +0 -0
- package/dist/chunk-2RLMTBVZ.js +0 -233
- package/dist/chunk-2WBD2G3E.cjs +0 -38
- package/dist/chunk-3COHMHPU.cjs +0 -1
- package/dist/chunk-4Q45WJYQ.js +0 -165
- package/dist/chunk-5C7PIENF.js +0 -92
- package/dist/chunk-5J2SS4QU.js +0 -83
- package/dist/chunk-65SWKEHV.cjs +0 -1
- package/dist/chunk-6Y623TCS.cjs +0 -40
- package/dist/chunk-7PV6L7I7.cjs +0 -1
- package/dist/chunk-7QBTVNMR.cjs +0 -30
- package/dist/chunk-BDATZ3UB.cjs +0 -233
- package/dist/chunk-BZRTSWH4.cjs +0 -395
- package/dist/chunk-D3FRXXDE.js +0 -947
- package/dist/chunk-DTGT4OI3.cjs +0 -14
- package/dist/chunk-EC2KPWRG.cjs +0 -24
- package/dist/chunk-EENQN6N2.js +0 -40
- package/dist/chunk-ENI4UUSK.cjs +0 -35
- package/dist/chunk-FJNXECWU.js +0 -395
- package/dist/chunk-FMDVBSP6.cjs +0 -83
- package/dist/chunk-G2MK47WL.js +0 -14
- package/dist/chunk-HFS7WJVW.js +0 -81
- package/dist/chunk-HVVJHTFS.js +0 -36
- package/dist/chunk-IWD6YQKX.cjs +0 -1
- package/dist/chunk-IWQRXQ4N.cjs +0 -84
- package/dist/chunk-JK4TT5IV.js +0 -35
- package/dist/chunk-JWLDCEBZ.cjs +0 -70
- package/dist/chunk-JZAYHDV3.js +0 -8
- package/dist/chunk-KSMN3HSC.js +0 -38
- package/dist/chunk-L6UNTUC4.js +0 -0
- package/dist/chunk-LOY6ICHZ.cjs +0 -36
- package/dist/chunk-MBG2FTBL.cjs +0 -47
- package/dist/chunk-MQG74XF7.js +0 -102
- package/dist/chunk-MSAQEGBK.cjs +0 -92
- package/dist/chunk-NJFLUTGH.cjs +0 -25
- package/dist/chunk-PCYB64MB.cjs +0 -40
- package/dist/chunk-RALMUN5C.js +0 -30
- package/dist/chunk-RRKB32OH.js +0 -0
- package/dist/chunk-RUKM6FCF.js +0 -25
- package/dist/chunk-SIW7AXUG.js +0 -56
- package/dist/chunk-SLICWTO2.cjs +0 -165
- package/dist/chunk-SO3FWVXC.js +0 -84
- package/dist/chunk-SXPH7ILL.js +0 -70
- package/dist/chunk-T7YISGRS.cjs +0 -102
- package/dist/chunk-TZZRLM5J.cjs +0 -947
- package/dist/chunk-UJ77IBHD.cjs +0 -233
- package/dist/chunk-UKGRDKIH.js +0 -0
- package/dist/chunk-V3GMJ4TX.js +0 -233
- package/dist/chunk-WQJYIPSL.cjs +0 -8
- package/dist/chunk-YBVOKYAM.cjs +0 -56
- package/dist/chunk-YX4736HU.js +0 -47
- package/dist/chunk-ZFNAUMQS.js +0 -24
package/dist/chunk-RUKM6FCF.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
// src/utilities/find-up.ts
|
|
2
|
-
import { existsSync } from "node:fs";
|
|
3
|
-
import { join } from "node:path";
|
|
4
|
-
var MAX_PATH_SEARCH_DEPTH = 30;
|
|
5
|
-
var depth = 0;
|
|
6
|
-
function findFolderUp(startPath, endFileNames = [], endDirectoryNames = []) {
|
|
7
|
-
const _startPath = startPath ?? process.cwd();
|
|
8
|
-
if (endDirectoryNames.some(
|
|
9
|
-
(endDirName) => existsSync(join(_startPath, endDirName))
|
|
10
|
-
)) {
|
|
11
|
-
return _startPath;
|
|
12
|
-
}
|
|
13
|
-
if (endFileNames.some((endFileName) => existsSync(join(_startPath, endFileName)))) {
|
|
14
|
-
return _startPath;
|
|
15
|
-
}
|
|
16
|
-
if (_startPath !== "/" && depth++ < MAX_PATH_SEARCH_DEPTH) {
|
|
17
|
-
const parent = join(_startPath, "..");
|
|
18
|
-
return findFolderUp(parent, endFileNames, endDirectoryNames);
|
|
19
|
-
}
|
|
20
|
-
return void 0;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export {
|
|
24
|
-
findFolderUp
|
|
25
|
-
};
|
package/dist/chunk-SIW7AXUG.js
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
writeError,
|
|
3
|
-
writeFatal,
|
|
4
|
-
writeSuccess,
|
|
5
|
-
writeTrace
|
|
6
|
-
} from "./chunk-D3FRXXDE.js";
|
|
7
|
-
|
|
8
|
-
// src/utilities/process-handler.ts
|
|
9
|
-
var exitWithError = (config) => {
|
|
10
|
-
writeFatal("Exiting script with an error status...", config);
|
|
11
|
-
process.exit(1);
|
|
12
|
-
};
|
|
13
|
-
var exitWithSuccess = (config) => {
|
|
14
|
-
writeSuccess("Script completed successfully. Exiting...", config);
|
|
15
|
-
process.exit(0);
|
|
16
|
-
};
|
|
17
|
-
var handleProcess = (config) => {
|
|
18
|
-
writeTrace(
|
|
19
|
-
`Using the following arguments to process the script: ${process.argv.join(", ")}`,
|
|
20
|
-
config
|
|
21
|
-
);
|
|
22
|
-
process.on("unhandledRejection", (error) => {
|
|
23
|
-
writeError(
|
|
24
|
-
`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"}
|
|
25
|
-
Stacktrace: ${error && typeof error === "object" && "stack" in error && error?.stack ? error.stack : ""}`,
|
|
26
|
-
config
|
|
27
|
-
);
|
|
28
|
-
exitWithError(config);
|
|
29
|
-
});
|
|
30
|
-
process.on("uncaughtException", (error) => {
|
|
31
|
-
writeError(
|
|
32
|
-
`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"}
|
|
33
|
-
Stacktrace: ${error && typeof error === "object" && "stack" in error && error?.stack ? error.stack : ""}`,
|
|
34
|
-
config
|
|
35
|
-
);
|
|
36
|
-
exitWithError(config);
|
|
37
|
-
});
|
|
38
|
-
process.on("SIGTERM", (signal) => {
|
|
39
|
-
writeError(`The program terminated with signal code: ${signal}`, config);
|
|
40
|
-
exitWithError(config);
|
|
41
|
-
});
|
|
42
|
-
process.on("SIGINT", (signal) => {
|
|
43
|
-
writeError(`The program terminated with signal code: ${signal}`, config);
|
|
44
|
-
exitWithError(config);
|
|
45
|
-
});
|
|
46
|
-
process.on("SIGHUP", (signal) => {
|
|
47
|
-
writeError(`The program terminated with signal code: ${signal}`, config);
|
|
48
|
-
exitWithError(config);
|
|
49
|
-
});
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
export {
|
|
53
|
-
exitWithError,
|
|
54
|
-
exitWithSuccess,
|
|
55
|
-
handleProcess
|
|
56
|
-
};
|
package/dist/chunk-SLICWTO2.cjs
DELETED
|
@@ -1,165 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
|
-
|
|
3
|
-
var _chunkMSAQEGBKcjs = require('./chunk-MSAQEGBK.cjs');
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
var _chunkT7YISGRScjs = require('./chunk-T7YISGRS.cjs');
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
var _chunkIWQRXQ4Ncjs = require('./chunk-IWQRXQ4N.cjs');
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
var _chunkTZZRLM5Jcjs = require('./chunk-TZZRLM5J.cjs');
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
var _chunkBZRTSWH4cjs = require('./chunk-BZRTSWH4.cjs');
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
var _chunkUJ77IBHDcjs = require('./chunk-UJ77IBHD.cjs');
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
var _chunkBDATZ3UBcjs = require('./chunk-BDATZ3UB.cjs');
|
|
26
|
-
|
|
27
|
-
// src/create-storm-config.ts
|
|
28
|
-
var _schema = require('@storm-software/config/schema');
|
|
29
|
-
var _defu = require('defu'); var _defu2 = _interopRequireDefault(_defu);
|
|
30
|
-
var _fs = require('fs');
|
|
31
|
-
var _extension_cache = /* @__PURE__ */ new WeakMap();
|
|
32
|
-
var _static_cache = void 0;
|
|
33
|
-
var createStormWorkspaceConfig = async (extensionName, schema, workspaceRoot, skipLogs = false, useDefault = true) => {
|
|
34
|
-
let result;
|
|
35
|
-
if (!_optionalChain([_static_cache, 'optionalAccess', _ => _.data]) || !_optionalChain([_static_cache, 'optionalAccess', _2 => _2.timestamp]) || _static_cache.timestamp < Date.now() - 8e3) {
|
|
36
|
-
let _workspaceRoot = workspaceRoot;
|
|
37
|
-
if (!_workspaceRoot) {
|
|
38
|
-
_workspaceRoot = _chunkIWQRXQ4Ncjs.findWorkspaceRoot.call(void 0, );
|
|
39
|
-
}
|
|
40
|
-
const configEnv = _chunkUJ77IBHDcjs.getConfigEnv.call(void 0, );
|
|
41
|
-
const configFile = await _chunkMSAQEGBKcjs.getConfigFile.call(void 0, _workspaceRoot);
|
|
42
|
-
if (!configFile) {
|
|
43
|
-
if (!skipLogs) {
|
|
44
|
-
_chunkTZZRLM5Jcjs.writeWarning.call(void 0,
|
|
45
|
-
"No Storm Workspace configuration file found in the current repository. Please ensure this is the expected behavior - you can add a `storm-workspace.json` file to the root of your workspace if it is not.\n",
|
|
46
|
-
{ logLevel: "all" }
|
|
47
|
-
);
|
|
48
|
-
}
|
|
49
|
-
if (useDefault === false) {
|
|
50
|
-
return void 0;
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
const defaultConfig = await _chunkT7YISGRScjs.getPackageJsonConfig.call(void 0, _workspaceRoot);
|
|
54
|
-
const configInput = _defu2.default.call(void 0,
|
|
55
|
-
configEnv,
|
|
56
|
-
configFile,
|
|
57
|
-
defaultConfig
|
|
58
|
-
);
|
|
59
|
-
if (!configInput.variant) {
|
|
60
|
-
configInput.variant = _fs.existsSync.call(void 0, _chunkBDATZ3UBcjs.joinPaths.call(void 0, _workspaceRoot, "nx.json")) || _fs.existsSync.call(void 0, _chunkBDATZ3UBcjs.joinPaths.call(void 0, _workspaceRoot, ".nx")) || _fs.existsSync.call(void 0, _chunkBDATZ3UBcjs.joinPaths.call(void 0, _workspaceRoot, "lerna.json")) || _fs.existsSync.call(void 0, _chunkBDATZ3UBcjs.joinPaths.call(void 0, _workspaceRoot, "turbo.json")) ? "monorepo" : "minimal";
|
|
61
|
-
}
|
|
62
|
-
try {
|
|
63
|
-
const parseResult = await Promise.resolve(
|
|
64
|
-
_schema.workspaceConfigSchema._zod.parse(
|
|
65
|
-
{ value: configInput, issues: [] },
|
|
66
|
-
{ async: true }
|
|
67
|
-
)
|
|
68
|
-
);
|
|
69
|
-
result = _chunkT7YISGRScjs.applyDefaultConfig.call(void 0, parseResult.value);
|
|
70
|
-
result.workspaceRoot ??= _workspaceRoot;
|
|
71
|
-
} catch (error) {
|
|
72
|
-
throw new Error(
|
|
73
|
-
`Failed to parse Storm Workspace configuration${_optionalChain([error, 'optionalAccess', _3 => _3.message]) ? `: ${error.message}` : ""}
|
|
74
|
-
|
|
75
|
-
Please ensure your configuration file is valid JSON and matches the expected schema. The current workspace configuration input is: ${_chunkTZZRLM5Jcjs.formatLogMessage.call(void 0,
|
|
76
|
-
configInput
|
|
77
|
-
)}`,
|
|
78
|
-
{
|
|
79
|
-
cause: error
|
|
80
|
-
}
|
|
81
|
-
);
|
|
82
|
-
}
|
|
83
|
-
} else {
|
|
84
|
-
result = _static_cache.data;
|
|
85
|
-
}
|
|
86
|
-
if (schema && extensionName) {
|
|
87
|
-
result.extensions = {
|
|
88
|
-
...result.extensions,
|
|
89
|
-
[extensionName]: createConfigExtension(extensionName, schema)
|
|
90
|
-
};
|
|
91
|
-
}
|
|
92
|
-
_static_cache = {
|
|
93
|
-
timestamp: Date.now(),
|
|
94
|
-
data: result
|
|
95
|
-
};
|
|
96
|
-
return result;
|
|
97
|
-
};
|
|
98
|
-
var createConfigExtension = (extensionName, schema) => {
|
|
99
|
-
const extension_cache_key = { extensionName };
|
|
100
|
-
if (_extension_cache.has(extension_cache_key)) {
|
|
101
|
-
return _extension_cache.get(extension_cache_key);
|
|
102
|
-
}
|
|
103
|
-
let extension = _chunkUJ77IBHDcjs.getExtensionEnv.call(void 0, extensionName);
|
|
104
|
-
if (schema) {
|
|
105
|
-
extension = schema.parse(extension);
|
|
106
|
-
}
|
|
107
|
-
_extension_cache.set(extension_cache_key, extension);
|
|
108
|
-
return extension;
|
|
109
|
-
};
|
|
110
|
-
var loadStormWorkspaceConfig = async (workspaceRoot, skipLogs = false) => {
|
|
111
|
-
const config = await createStormWorkspaceConfig(
|
|
112
|
-
void 0,
|
|
113
|
-
void 0,
|
|
114
|
-
workspaceRoot,
|
|
115
|
-
skipLogs,
|
|
116
|
-
true
|
|
117
|
-
);
|
|
118
|
-
_chunkBZRTSWH4cjs.setConfigEnv.call(void 0, config);
|
|
119
|
-
if (!skipLogs && !config.skipConfigLogging) {
|
|
120
|
-
_chunkTZZRLM5Jcjs.writeTrace.call(void 0,
|
|
121
|
-
`\u2699\uFE0F Using Storm Workspace configuration:
|
|
122
|
-
${_chunkTZZRLM5Jcjs.formatLogMessage.call(void 0, config)}`,
|
|
123
|
-
config
|
|
124
|
-
);
|
|
125
|
-
}
|
|
126
|
-
return config;
|
|
127
|
-
};
|
|
128
|
-
var tryLoadStormWorkspaceConfig = async (workspaceRoot, skipLogs = true, useDefault = false) => {
|
|
129
|
-
try {
|
|
130
|
-
const config = await createStormWorkspaceConfig(
|
|
131
|
-
void 0,
|
|
132
|
-
void 0,
|
|
133
|
-
workspaceRoot,
|
|
134
|
-
skipLogs,
|
|
135
|
-
useDefault
|
|
136
|
-
);
|
|
137
|
-
if (!config) {
|
|
138
|
-
return void 0;
|
|
139
|
-
}
|
|
140
|
-
_chunkBZRTSWH4cjs.setConfigEnv.call(void 0, config);
|
|
141
|
-
if (!skipLogs && !config.skipConfigLogging) {
|
|
142
|
-
_chunkTZZRLM5Jcjs.writeTrace.call(void 0,
|
|
143
|
-
`\u2699\uFE0F Using Storm Workspace configuration:
|
|
144
|
-
${_chunkTZZRLM5Jcjs.formatLogMessage.call(void 0, config)}`,
|
|
145
|
-
config
|
|
146
|
-
);
|
|
147
|
-
}
|
|
148
|
-
return config;
|
|
149
|
-
} catch (error) {
|
|
150
|
-
if (!skipLogs) {
|
|
151
|
-
_chunkTZZRLM5Jcjs.writeWarning.call(void 0,
|
|
152
|
-
`\u26A0\uFE0F Failed to load Storm Workspace configuration: ${error}`,
|
|
153
|
-
{ logLevel: "all" }
|
|
154
|
-
);
|
|
155
|
-
}
|
|
156
|
-
return void 0;
|
|
157
|
-
}
|
|
158
|
-
};
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
exports.createStormWorkspaceConfig = createStormWorkspaceConfig; exports.createConfigExtension = createConfigExtension; exports.loadStormWorkspaceConfig = loadStormWorkspaceConfig; exports.tryLoadStormWorkspaceConfig = tryLoadStormWorkspaceConfig;
|
package/dist/chunk-SO3FWVXC.js
DELETED
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
findFolderUp
|
|
3
|
-
} from "./chunk-RUKM6FCF.js";
|
|
4
|
-
import {
|
|
5
|
-
correctPaths
|
|
6
|
-
} from "./chunk-V3GMJ4TX.js";
|
|
7
|
-
|
|
8
|
-
// src/utilities/find-workspace-root.ts
|
|
9
|
-
var rootFiles = [
|
|
10
|
-
"storm-workspace.json",
|
|
11
|
-
"storm-workspace.yaml",
|
|
12
|
-
"storm-workspace.yml",
|
|
13
|
-
"storm-workspace.js",
|
|
14
|
-
"storm-workspace.ts",
|
|
15
|
-
".storm-workspace.json",
|
|
16
|
-
".storm-workspace.yaml",
|
|
17
|
-
".storm-workspace.yml",
|
|
18
|
-
".storm-workspace.js",
|
|
19
|
-
".storm-workspace.ts",
|
|
20
|
-
"lerna.json",
|
|
21
|
-
"nx.json",
|
|
22
|
-
"turbo.json",
|
|
23
|
-
"npm-workspace.json",
|
|
24
|
-
"yarn-workspace.json",
|
|
25
|
-
"pnpm-workspace.json",
|
|
26
|
-
"npm-workspace.yaml",
|
|
27
|
-
"yarn-workspace.yaml",
|
|
28
|
-
"pnpm-workspace.yaml",
|
|
29
|
-
"npm-workspace.yml",
|
|
30
|
-
"yarn-workspace.yml",
|
|
31
|
-
"pnpm-workspace.yml",
|
|
32
|
-
"npm-lock.json",
|
|
33
|
-
"yarn-lock.json",
|
|
34
|
-
"pnpm-lock.json",
|
|
35
|
-
"npm-lock.yaml",
|
|
36
|
-
"yarn-lock.yaml",
|
|
37
|
-
"pnpm-lock.yaml",
|
|
38
|
-
"npm-lock.yml",
|
|
39
|
-
"yarn-lock.yml",
|
|
40
|
-
"pnpm-lock.yml",
|
|
41
|
-
"bun.lockb",
|
|
42
|
-
"bun.lock",
|
|
43
|
-
"bunfig.toml"
|
|
44
|
-
];
|
|
45
|
-
var rootDirectories = [
|
|
46
|
-
".storm-workspace",
|
|
47
|
-
".nx",
|
|
48
|
-
".git",
|
|
49
|
-
".github",
|
|
50
|
-
".vscode",
|
|
51
|
-
".verdaccio"
|
|
52
|
-
];
|
|
53
|
-
function findWorkspaceRootSafe(pathInsideMonorepo) {
|
|
54
|
-
if (process.env.STORM_WORKSPACE_ROOT || process.env.NX_WORKSPACE_ROOT_PATH) {
|
|
55
|
-
return correctPaths(
|
|
56
|
-
process.env.STORM_WORKSPACE_ROOT ?? process.env.NX_WORKSPACE_ROOT_PATH
|
|
57
|
-
);
|
|
58
|
-
}
|
|
59
|
-
return correctPaths(
|
|
60
|
-
findFolderUp(
|
|
61
|
-
pathInsideMonorepo ?? process.cwd(),
|
|
62
|
-
rootFiles,
|
|
63
|
-
rootDirectories
|
|
64
|
-
)
|
|
65
|
-
);
|
|
66
|
-
}
|
|
67
|
-
function findWorkspaceRoot(pathInsideMonorepo) {
|
|
68
|
-
const result = findWorkspaceRootSafe(pathInsideMonorepo);
|
|
69
|
-
if (!result) {
|
|
70
|
-
throw new Error(
|
|
71
|
-
`Cannot find workspace root upwards from known path. Files search list includes:
|
|
72
|
-
${rootFiles.join(
|
|
73
|
-
"\n"
|
|
74
|
-
)}
|
|
75
|
-
Path: ${pathInsideMonorepo ? pathInsideMonorepo : process.cwd()}`
|
|
76
|
-
);
|
|
77
|
-
}
|
|
78
|
-
return result;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
export {
|
|
82
|
-
findWorkspaceRootSafe,
|
|
83
|
-
findWorkspaceRoot
|
|
84
|
-
};
|
package/dist/chunk-SXPH7ILL.js
DELETED
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
LogLevel,
|
|
3
|
-
LogLevelLabel
|
|
4
|
-
} from "./chunk-RALMUN5C.js";
|
|
5
|
-
|
|
6
|
-
// src/logger/get-log-level.ts
|
|
7
|
-
var getLogLevel = (label) => {
|
|
8
|
-
switch (label) {
|
|
9
|
-
case "all":
|
|
10
|
-
return LogLevel.ALL;
|
|
11
|
-
case "trace":
|
|
12
|
-
return LogLevel.TRACE;
|
|
13
|
-
case "debug":
|
|
14
|
-
return LogLevel.DEBUG;
|
|
15
|
-
case "performance":
|
|
16
|
-
return LogLevel.PERFORMANCE;
|
|
17
|
-
case "info":
|
|
18
|
-
return LogLevel.INFO;
|
|
19
|
-
case "warn":
|
|
20
|
-
return LogLevel.WARN;
|
|
21
|
-
case "error":
|
|
22
|
-
return LogLevel.ERROR;
|
|
23
|
-
case "fatal":
|
|
24
|
-
return LogLevel.FATAL;
|
|
25
|
-
case "silent":
|
|
26
|
-
return LogLevel.SILENT;
|
|
27
|
-
default:
|
|
28
|
-
return LogLevel.INFO;
|
|
29
|
-
}
|
|
30
|
-
};
|
|
31
|
-
var getLogLevelLabel = (logLevel = LogLevel.INFO) => {
|
|
32
|
-
if (logLevel >= LogLevel.ALL) {
|
|
33
|
-
return LogLevelLabel.ALL;
|
|
34
|
-
}
|
|
35
|
-
if (logLevel >= LogLevel.TRACE) {
|
|
36
|
-
return LogLevelLabel.TRACE;
|
|
37
|
-
}
|
|
38
|
-
if (logLevel >= LogLevel.DEBUG) {
|
|
39
|
-
return LogLevelLabel.DEBUG;
|
|
40
|
-
}
|
|
41
|
-
if (logLevel >= LogLevel.PERFORMANCE) {
|
|
42
|
-
return LogLevelLabel.PERFORMANCE;
|
|
43
|
-
}
|
|
44
|
-
if (logLevel >= LogLevel.INFO) {
|
|
45
|
-
return LogLevelLabel.INFO;
|
|
46
|
-
}
|
|
47
|
-
if (logLevel >= LogLevel.WARN) {
|
|
48
|
-
return LogLevelLabel.WARN;
|
|
49
|
-
}
|
|
50
|
-
if (logLevel >= LogLevel.ERROR) {
|
|
51
|
-
return LogLevelLabel.ERROR;
|
|
52
|
-
}
|
|
53
|
-
if (logLevel >= LogLevel.FATAL) {
|
|
54
|
-
return LogLevelLabel.FATAL;
|
|
55
|
-
}
|
|
56
|
-
if (logLevel <= LogLevel.SILENT) {
|
|
57
|
-
return LogLevelLabel.SILENT;
|
|
58
|
-
}
|
|
59
|
-
return LogLevelLabel.INFO;
|
|
60
|
-
};
|
|
61
|
-
var isVerbose = (label = LogLevelLabel.SILENT) => {
|
|
62
|
-
const logLevel = typeof label === "string" ? getLogLevel(label) : label;
|
|
63
|
-
return logLevel >= LogLevel.DEBUG;
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
export {
|
|
67
|
-
getLogLevel,
|
|
68
|
-
getLogLevelLabel,
|
|
69
|
-
isVerbose
|
|
70
|
-
};
|
package/dist/chunk-T7YISGRS.cjs
DELETED
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
|
-
|
|
3
|
-
var _chunkIWQRXQ4Ncjs = require('./chunk-IWQRXQ4N.cjs');
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
var _chunkBDATZ3UBcjs = require('./chunk-BDATZ3UB.cjs');
|
|
7
|
-
|
|
8
|
-
// src/utilities/get-default-config.ts
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
var _config = require('@storm-software/config');
|
|
13
|
-
var _fs = require('fs');
|
|
14
|
-
var _promises = require('fs/promises');
|
|
15
|
-
var _path = require('path');
|
|
16
|
-
async function getPackageJsonConfig(root) {
|
|
17
|
-
let license = _config.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 = _chunkIWQRXQ4Ncjs.findWorkspaceRoot.call(void 0, root);
|
|
24
|
-
if (_fs.existsSync.call(void 0, _path.join.call(void 0, workspaceRoot, "package.json"))) {
|
|
25
|
-
const file = await _promises.readFile.call(void 0,
|
|
26
|
-
_chunkBDATZ3UBcjs.joinPaths.call(void 0, workspaceRoot, "package.json"),
|
|
27
|
-
"utf8"
|
|
28
|
-
);
|
|
29
|
-
if (file) {
|
|
30
|
-
const packageJson = JSON.parse(file);
|
|
31
|
-
if (packageJson.name) {
|
|
32
|
-
name = packageJson.name;
|
|
33
|
-
}
|
|
34
|
-
if (packageJson.namespace) {
|
|
35
|
-
namespace = packageJson.namespace;
|
|
36
|
-
}
|
|
37
|
-
if (packageJson.repository) {
|
|
38
|
-
if (typeof packageJson.repository === "string") {
|
|
39
|
-
repository = packageJson.repository;
|
|
40
|
-
} else if (packageJson.repository.url) {
|
|
41
|
-
repository = packageJson.repository.url;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
if (packageJson.license) {
|
|
45
|
-
license = packageJson.license;
|
|
46
|
-
}
|
|
47
|
-
if (packageJson.homepage) {
|
|
48
|
-
homepage = packageJson.homepage;
|
|
49
|
-
}
|
|
50
|
-
if (packageJson.bugs) {
|
|
51
|
-
if (typeof packageJson.bugs === "string") {
|
|
52
|
-
support = packageJson.bugs;
|
|
53
|
-
} else if (packageJson.bugs.url) {
|
|
54
|
-
support = packageJson.bugs.url;
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
return {
|
|
60
|
-
workspaceRoot,
|
|
61
|
-
name,
|
|
62
|
-
namespace,
|
|
63
|
-
repository,
|
|
64
|
-
license,
|
|
65
|
-
homepage,
|
|
66
|
-
support
|
|
67
|
-
};
|
|
68
|
-
}
|
|
69
|
-
function applyDefaultConfig(config) {
|
|
70
|
-
if (!config.support && config.contact) {
|
|
71
|
-
config.support = config.contact;
|
|
72
|
-
}
|
|
73
|
-
if (!config.contact && config.support) {
|
|
74
|
-
config.contact = config.support;
|
|
75
|
-
}
|
|
76
|
-
if (config.homepage) {
|
|
77
|
-
if (!config.docs) {
|
|
78
|
-
config.docs = `${config.homepage}/docs`;
|
|
79
|
-
}
|
|
80
|
-
if (!config.license) {
|
|
81
|
-
config.license = `${config.homepage}/license`;
|
|
82
|
-
}
|
|
83
|
-
if (!config.support) {
|
|
84
|
-
config.support = `${config.homepage}/support`;
|
|
85
|
-
}
|
|
86
|
-
if (!config.contact) {
|
|
87
|
-
config.contact = `${config.homepage}/contact`;
|
|
88
|
-
}
|
|
89
|
-
if (!_optionalChain([config, 'access', _ => _.error, 'optionalAccess', _2 => _2.codesFile]) || !_optionalChain([config, 'optionalAccess', _3 => _3.error, 'optionalAccess', _4 => _4.url])) {
|
|
90
|
-
config.error ??= { codesFile: _config.STORM_DEFAULT_ERROR_CODES_FILE };
|
|
91
|
-
if (config.homepage) {
|
|
92
|
-
config.error.url ??= `${config.homepage}/errors`;
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
return config;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
exports.getPackageJsonConfig = getPackageJsonConfig; exports.applyDefaultConfig = applyDefaultConfig;
|