@storm-software/config-tools 1.37.0 → 1.38.1
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/CHANGELOG.md +30 -24
- package/LICENSE +201 -0
- package/README.md +43 -7
- package/declarations.d.ts +26 -23
- package/index.cjs +72683 -0
- package/index.js +72641 -0
- package/meta.cjs.json +1 -0
- package/meta.esm.json +1 -0
- package/package.json +3 -2
- package/utilities/chalk.cjs +1610 -0
- package/utilities/chalk.js +1606 -0
- package/utilities/find-workspace-root.cjs +111 -0
- package/utilities/find-workspace-root.js +84 -0
- package/utilities/logger.cjs +1785 -0
- package/utilities/logger.js +1770 -0
- package/.eslintrc.json +0 -37
- package/jest.config.ts +0 -3
- package/project.json +0 -67
- package/src/config-file/get-config-file.ts +0 -69
- package/src/config-file/index.ts +0 -1
- package/src/create-storm-config.ts +0 -134
- package/src/env/get-env.ts +0 -141
- package/src/env/index.ts +0 -2
- package/src/env/set-env.ts +0 -207
- package/src/index.ts +0 -14
- package/src/types.ts +0 -45
- package/src/utilities/apply-workspace-tokens.ts +0 -83
- package/src/utilities/chalk.ts +0 -53
- package/src/utilities/correct-paths.ts +0 -12
- package/src/utilities/file-path-utils.ts +0 -26
- package/src/utilities/find-up.ts +0 -21
- package/src/utilities/find-workspace-root.ts +0 -68
- package/src/utilities/get-default-config.ts +0 -106
- package/src/utilities/get-log-level.ts +0 -64
- package/src/utilities/index.ts +0 -10
- package/src/utilities/logger.ts +0 -239
- package/src/utilities/process-handler.ts +0 -44
- package/src/utilities/run.ts +0 -37
- package/tsconfig.json +0 -15
- package/tsconfig.spec.json +0 -16
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// packages/config-tools/src/utilities/find-workspace-root.ts
|
|
20
|
+
var find_workspace_root_exports = {};
|
|
21
|
+
__export(find_workspace_root_exports, {
|
|
22
|
+
findWorkspaceRoot: () => findWorkspaceRoot,
|
|
23
|
+
findWorkspaceRootSafe: () => findWorkspaceRootSafe
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(find_workspace_root_exports);
|
|
26
|
+
|
|
27
|
+
// packages/config-tools/src/utilities/correct-paths.ts
|
|
28
|
+
var correctPaths = (path) => {
|
|
29
|
+
if (!path) {
|
|
30
|
+
return "";
|
|
31
|
+
}
|
|
32
|
+
if (path?.toUpperCase()?.startsWith("C:")) {
|
|
33
|
+
return path.replaceAll("/", "\\");
|
|
34
|
+
}
|
|
35
|
+
return path.replaceAll("\\", "/");
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
// packages/config-tools/src/utilities/find-up.ts
|
|
39
|
+
var import_node_fs = require("node:fs");
|
|
40
|
+
var import_node_path = require("node:path");
|
|
41
|
+
var MAX_PATH_SEARCH_DEPTH = 30;
|
|
42
|
+
var depth = 0;
|
|
43
|
+
function findFolderUp(startPath, endFileNames) {
|
|
44
|
+
const _startPath = startPath ?? process.cwd();
|
|
45
|
+
if (endFileNames.some((endFileName) => (0, import_node_fs.existsSync)((0, import_node_path.join)(_startPath, endFileName)))) {
|
|
46
|
+
return _startPath;
|
|
47
|
+
}
|
|
48
|
+
if (_startPath !== "/" && depth++ < MAX_PATH_SEARCH_DEPTH) {
|
|
49
|
+
const parent = (0, import_node_path.join)(_startPath, "..");
|
|
50
|
+
return findFolderUp(parent, endFileNames);
|
|
51
|
+
}
|
|
52
|
+
return void 0;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// packages/config-tools/src/utilities/find-workspace-root.ts
|
|
56
|
+
var rootFiles = [
|
|
57
|
+
"storm.json",
|
|
58
|
+
"storm.config.js",
|
|
59
|
+
"storm.config.ts",
|
|
60
|
+
".storm.json",
|
|
61
|
+
".storm.yaml",
|
|
62
|
+
".storm.yml",
|
|
63
|
+
".storm.js",
|
|
64
|
+
".storm.ts",
|
|
65
|
+
"lerna.json",
|
|
66
|
+
"nx.json",
|
|
67
|
+
"turbo.json",
|
|
68
|
+
"npm-workspace.json",
|
|
69
|
+
"yarn-workspace.json",
|
|
70
|
+
"pnpm-workspace.json",
|
|
71
|
+
"npm-workspace.yaml",
|
|
72
|
+
"yarn-workspace.yaml",
|
|
73
|
+
"pnpm-workspace.yaml",
|
|
74
|
+
"npm-workspace.yml",
|
|
75
|
+
"yarn-workspace.yml",
|
|
76
|
+
"pnpm-workspace.yml",
|
|
77
|
+
"npm-lock.json",
|
|
78
|
+
"yarn-lock.json",
|
|
79
|
+
"pnpm-lock.json",
|
|
80
|
+
"npm-lock.yaml",
|
|
81
|
+
"yarn-lock.yaml",
|
|
82
|
+
"pnpm-lock.yaml",
|
|
83
|
+
"npm-lock.yml",
|
|
84
|
+
"yarn-lock.yml",
|
|
85
|
+
"pnpm-lock.yml",
|
|
86
|
+
"bun.lockb"
|
|
87
|
+
];
|
|
88
|
+
function findWorkspaceRootSafe(pathInsideMonorepo) {
|
|
89
|
+
if (process.env.STORM_WORKSPACE_ROOT || process.env.NX_WORKSPACE_ROOT_PATH) {
|
|
90
|
+
return correctPaths(process.env.STORM_WORKSPACE_ROOT ?? process.env.NX_WORKSPACE_ROOT_PATH);
|
|
91
|
+
}
|
|
92
|
+
return correctPaths(findFolderUp(pathInsideMonorepo ?? process.cwd(), rootFiles));
|
|
93
|
+
}
|
|
94
|
+
function findWorkspaceRoot(pathInsideMonorepo) {
|
|
95
|
+
const result = findWorkspaceRootSafe(pathInsideMonorepo);
|
|
96
|
+
if (!result) {
|
|
97
|
+
throw new Error(
|
|
98
|
+
`Cannot find workspace root upwards from known path. Files search list includes:
|
|
99
|
+
${rootFiles.join(
|
|
100
|
+
"\n"
|
|
101
|
+
)}
|
|
102
|
+
Path: ${pathInsideMonorepo ? pathInsideMonorepo : process.cwd()}`
|
|
103
|
+
);
|
|
104
|
+
}
|
|
105
|
+
return result;
|
|
106
|
+
}
|
|
107
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
108
|
+
0 && (module.exports = {
|
|
109
|
+
findWorkspaceRoot,
|
|
110
|
+
findWorkspaceRootSafe
|
|
111
|
+
});
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
// packages/config-tools/src/utilities/correct-paths.ts
|
|
2
|
+
var correctPaths = (path) => {
|
|
3
|
+
if (!path) {
|
|
4
|
+
return "";
|
|
5
|
+
}
|
|
6
|
+
if (path?.toUpperCase()?.startsWith("C:")) {
|
|
7
|
+
return path.replaceAll("/", "\\");
|
|
8
|
+
}
|
|
9
|
+
return path.replaceAll("\\", "/");
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
// packages/config-tools/src/utilities/find-up.ts
|
|
13
|
+
import { existsSync } from "node:fs";
|
|
14
|
+
import { join } from "node:path";
|
|
15
|
+
var MAX_PATH_SEARCH_DEPTH = 30;
|
|
16
|
+
var depth = 0;
|
|
17
|
+
function findFolderUp(startPath, endFileNames) {
|
|
18
|
+
const _startPath = startPath ?? process.cwd();
|
|
19
|
+
if (endFileNames.some((endFileName) => existsSync(join(_startPath, endFileName)))) {
|
|
20
|
+
return _startPath;
|
|
21
|
+
}
|
|
22
|
+
if (_startPath !== "/" && depth++ < MAX_PATH_SEARCH_DEPTH) {
|
|
23
|
+
const parent = join(_startPath, "..");
|
|
24
|
+
return findFolderUp(parent, endFileNames);
|
|
25
|
+
}
|
|
26
|
+
return void 0;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
// packages/config-tools/src/utilities/find-workspace-root.ts
|
|
30
|
+
var rootFiles = [
|
|
31
|
+
"storm.json",
|
|
32
|
+
"storm.config.js",
|
|
33
|
+
"storm.config.ts",
|
|
34
|
+
".storm.json",
|
|
35
|
+
".storm.yaml",
|
|
36
|
+
".storm.yml",
|
|
37
|
+
".storm.js",
|
|
38
|
+
".storm.ts",
|
|
39
|
+
"lerna.json",
|
|
40
|
+
"nx.json",
|
|
41
|
+
"turbo.json",
|
|
42
|
+
"npm-workspace.json",
|
|
43
|
+
"yarn-workspace.json",
|
|
44
|
+
"pnpm-workspace.json",
|
|
45
|
+
"npm-workspace.yaml",
|
|
46
|
+
"yarn-workspace.yaml",
|
|
47
|
+
"pnpm-workspace.yaml",
|
|
48
|
+
"npm-workspace.yml",
|
|
49
|
+
"yarn-workspace.yml",
|
|
50
|
+
"pnpm-workspace.yml",
|
|
51
|
+
"npm-lock.json",
|
|
52
|
+
"yarn-lock.json",
|
|
53
|
+
"pnpm-lock.json",
|
|
54
|
+
"npm-lock.yaml",
|
|
55
|
+
"yarn-lock.yaml",
|
|
56
|
+
"pnpm-lock.yaml",
|
|
57
|
+
"npm-lock.yml",
|
|
58
|
+
"yarn-lock.yml",
|
|
59
|
+
"pnpm-lock.yml",
|
|
60
|
+
"bun.lockb"
|
|
61
|
+
];
|
|
62
|
+
function findWorkspaceRootSafe(pathInsideMonorepo) {
|
|
63
|
+
if (process.env.STORM_WORKSPACE_ROOT || process.env.NX_WORKSPACE_ROOT_PATH) {
|
|
64
|
+
return correctPaths(process.env.STORM_WORKSPACE_ROOT ?? process.env.NX_WORKSPACE_ROOT_PATH);
|
|
65
|
+
}
|
|
66
|
+
return correctPaths(findFolderUp(pathInsideMonorepo ?? process.cwd(), rootFiles));
|
|
67
|
+
}
|
|
68
|
+
function findWorkspaceRoot(pathInsideMonorepo) {
|
|
69
|
+
const result = findWorkspaceRootSafe(pathInsideMonorepo);
|
|
70
|
+
if (!result) {
|
|
71
|
+
throw new Error(
|
|
72
|
+
`Cannot find workspace root upwards from known path. Files search list includes:
|
|
73
|
+
${rootFiles.join(
|
|
74
|
+
"\n"
|
|
75
|
+
)}
|
|
76
|
+
Path: ${pathInsideMonorepo ? pathInsideMonorepo : process.cwd()}`
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
return result;
|
|
80
|
+
}
|
|
81
|
+
export {
|
|
82
|
+
findWorkspaceRoot,
|
|
83
|
+
findWorkspaceRootSafe
|
|
84
|
+
};
|