@storm-software/k8s-tools 0.18.0 → 0.19.0
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 +11 -0
- package/dist/chunk-2GAU2GHG.js +203 -0
- package/dist/chunk-2QNNUD5M.js +86 -0
- package/dist/chunk-3GQAWCBQ.js +13 -0
- package/dist/chunk-3J7KBHMJ.mjs +0 -0
- package/dist/chunk-6V45YKVB.mjs +203 -0
- package/dist/chunk-7AV2CVBT.mjs +169 -0
- package/dist/chunk-7BCSLKT3.js +98 -0
- package/dist/chunk-7IJP4RLN.mjs +63 -0
- package/dist/chunk-AFPEYAYK.js +61 -0
- package/dist/chunk-DHBG5ASJ.js +1 -0
- package/dist/chunk-DZ5UCMNL.mjs +1063 -0
- package/dist/chunk-EAQFLLRB.js +23 -0
- package/dist/chunk-EISL3C34.js +169 -0
- package/dist/chunk-GDXB64KG.js +1063 -0
- package/dist/chunk-GOVHOOTS.js +184 -0
- package/dist/chunk-IOT45LXV.js +134 -0
- package/dist/chunk-LFNGKV6F.js +18 -0
- package/dist/chunk-LSBSNYPQ.mjs +86 -0
- package/dist/chunk-O7U3AH6A.mjs +58 -0
- package/dist/chunk-OA63SGD6.mjs +23 -0
- package/dist/chunk-OBT35QXS.mjs +59 -0
- package/dist/chunk-OXY6AHKS.js +57 -0
- package/dist/chunk-Q6DDBFXE.mjs +147 -0
- package/dist/chunk-RVFKH45R.mjs +134 -0
- package/dist/chunk-T5WNZJOD.js +63 -0
- package/dist/chunk-TUDMFJIT.mjs +98 -0
- package/dist/chunk-U76ID4TS.js +1 -0
- package/dist/chunk-UDLI3L7V.mjs +18 -0
- package/dist/chunk-UWJTAL4W.js +59 -0
- package/dist/chunk-W7DPLC4K.mjs +184 -0
- package/dist/chunk-WWU25UQ4.mjs +0 -0
- package/dist/chunk-XMPMWMWQ.js +147 -0
- package/dist/chunk-XO66D74Z.js +1 -0
- package/dist/chunk-XUV4U54K.mjs +21 -0
- package/dist/chunk-YSCEY447.mjs +0 -0
- package/dist/chunk-ZO7MGNKJ.mjs +61 -0
- package/dist/executor-DY-z8MOl.d.mts +53 -0
- package/dist/executor-Dr6UXfvX.d.ts +53 -0
- package/dist/executors.d.mts +6 -0
- package/dist/executors.d.ts +6 -0
- package/dist/executors.js +19 -0
- package/dist/executors.mjs +19 -0
- package/dist/generator-B5bCfIUV.d.ts +24 -0
- package/dist/generator-BIe65kKR.d.mts +28 -0
- package/dist/generator-Cad7bXVB.d.mts +24 -0
- package/dist/generator-D7M45zOU.d.ts +28 -0
- package/dist/generators.d.mts +6 -0
- package/dist/generators.d.ts +6 -0
- package/dist/generators.js +15 -0
- package/dist/generators.mjs +15 -0
- package/dist/index.d.mts +15 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.js +57 -0
- package/dist/index.mjs +57 -0
- package/dist/schema.d-Cx_3iG9A.d.mts +150 -0
- package/dist/schema.d-Cx_3iG9A.d.ts +150 -0
- package/dist/src/executors/container-publish/executor.d.mts +11 -0
- package/dist/src/executors/container-publish/executor.d.ts +11 -0
- package/dist/src/executors/container-publish/executor.js +13 -0
- package/dist/src/executors/container-publish/executor.mjs +13 -0
- package/dist/src/executors/helm-package/executor.d.mts +4 -0
- package/dist/src/executors/helm-package/executor.d.ts +4 -0
- package/dist/src/executors/helm-package/executor.js +15 -0
- package/dist/src/executors/helm-package/executor.mjs +15 -0
- package/dist/src/executors/helm-package/schema.d.ts +1 -1
- package/dist/src/generators/helm-chart/files/chart/templates/NOTES.txt +22 -0
- package/dist/src/generators/helm-chart/files/chart/templates/_helpers.yaml +62 -0
- package/dist/src/generators/helm-chart/files/chart/templates/deployment.yaml +68 -0
- package/dist/src/generators/helm-chart/files/chart/templates/hpa.yaml +32 -0
- package/dist/src/generators/helm-chart/files/chart/templates/ingress.yaml +61 -0
- package/dist/src/generators/helm-chart/files/chart/templates/service.yaml +13 -0
- package/dist/src/generators/helm-chart/files/chart/templates/serviceaccount.yaml +13 -0
- package/dist/src/generators/helm-chart/files/chart/templates/test/test-connection.yaml +15 -0
- package/dist/src/generators/helm-chart/generator.d.mts +5 -0
- package/dist/src/generators/helm-chart/generator.d.ts +5 -0
- package/dist/src/generators/helm-chart/generator.js +12 -0
- package/dist/src/generators/helm-chart/generator.mjs +12 -0
- package/dist/src/generators/helm-chart/schema.d.ts +1 -1
- package/dist/src/generators/helm-dependency/generator.d.mts +5 -0
- package/dist/src/generators/helm-dependency/generator.d.ts +5 -0
- package/dist/src/generators/helm-dependency/generator.js +12 -0
- package/dist/src/generators/helm-dependency/generator.mjs +12 -0
- package/dist/src/generators/helm-dependency/schema.d.ts +1 -1
- package/dist/src/plugins/docker/index.d.mts +12 -0
- package/dist/src/plugins/docker/index.d.ts +12 -0
- package/dist/src/plugins/docker/index.js +15 -0
- package/dist/src/plugins/docker/index.mjs +15 -0
- package/dist/src/utils/client.d.mts +35 -0
- package/dist/src/utils/client.d.ts +35 -0
- package/dist/src/utils/client.js +11 -0
- package/dist/src/utils/client.mjs +11 -0
- package/dist/src/utils/ensure-init.d.mts +11 -0
- package/dist/src/utils/ensure-init.d.ts +11 -0
- package/dist/src/utils/ensure-init.js +7 -0
- package/dist/src/utils/ensure-init.mjs +7 -0
- package/dist/src/utils/index.d.mts +6 -0
- package/dist/src/utils/index.d.ts +6 -0
- package/dist/src/utils/index.js +21 -0
- package/dist/src/utils/index.mjs +21 -0
- package/dist/src/utils/prettier.d.mts +13 -0
- package/dist/src/utils/prettier.d.ts +13 -0
- package/dist/src/utils/prettier.js +9 -0
- package/dist/src/utils/prettier.mjs +9 -0
- package/dist/tsup.config.d.mts +5 -0
- package/dist/tsup.config.d.ts +5 -0
- package/dist/tsup.config.js +36 -0
- package/dist/tsup.config.mjs +36 -0
- package/dist/types-BCBFBwnJ.d.mts +20 -0
- package/dist/types-BCBFBwnJ.d.ts +20 -0
- package/dist/types-CIJRaFHD.d.mts +1185 -0
- package/dist/types-CIJRaFHD.d.ts +1185 -0
- package/package.json +1 -1
|
@@ -0,0 +1,1063 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__name
|
|
3
|
+
} from "./chunk-XUV4U54K.mjs";
|
|
4
|
+
|
|
5
|
+
// ../config-tools/src/utilities/correct-paths.ts
|
|
6
|
+
import { joinPathFragments } from "@nx/devkit";
|
|
7
|
+
var correctPaths = /* @__PURE__ */ __name((path) => {
|
|
8
|
+
if (!path) {
|
|
9
|
+
return "";
|
|
10
|
+
}
|
|
11
|
+
if (!path.toUpperCase().startsWith("C:") && path.includes("\\")) {
|
|
12
|
+
path = `C:${path}`;
|
|
13
|
+
}
|
|
14
|
+
return path.replaceAll("\\", "/");
|
|
15
|
+
}, "correctPaths");
|
|
16
|
+
var joinPaths = /* @__PURE__ */ __name((...paths) => {
|
|
17
|
+
if (!paths || paths.length === 0) {
|
|
18
|
+
return "";
|
|
19
|
+
}
|
|
20
|
+
return correctPaths(joinPathFragments(...paths.map((path) => correctPaths(path))));
|
|
21
|
+
}, "joinPaths");
|
|
22
|
+
|
|
23
|
+
// ../config-tools/src/utilities/find-up.ts
|
|
24
|
+
import { existsSync } from "node:fs";
|
|
25
|
+
import { join } from "node:path";
|
|
26
|
+
var MAX_PATH_SEARCH_DEPTH = 30;
|
|
27
|
+
var depth = 0;
|
|
28
|
+
function findFolderUp(startPath, endFileNames) {
|
|
29
|
+
const _startPath = startPath ?? process.cwd();
|
|
30
|
+
if (endFileNames.some((endFileName) => existsSync(join(_startPath, endFileName)))) {
|
|
31
|
+
return _startPath;
|
|
32
|
+
}
|
|
33
|
+
if (_startPath !== "/" && depth++ < MAX_PATH_SEARCH_DEPTH) {
|
|
34
|
+
const parent = join(_startPath, "..");
|
|
35
|
+
return findFolderUp(parent, endFileNames);
|
|
36
|
+
}
|
|
37
|
+
return void 0;
|
|
38
|
+
}
|
|
39
|
+
__name(findFolderUp, "findFolderUp");
|
|
40
|
+
|
|
41
|
+
// ../config-tools/src/utilities/find-workspace-root.ts
|
|
42
|
+
var rootFiles = [
|
|
43
|
+
"storm.json",
|
|
44
|
+
"storm.json",
|
|
45
|
+
"storm.yaml",
|
|
46
|
+
"storm.yml",
|
|
47
|
+
"storm.js",
|
|
48
|
+
"storm.ts",
|
|
49
|
+
".storm.json",
|
|
50
|
+
".storm.yaml",
|
|
51
|
+
".storm.yml",
|
|
52
|
+
".storm.js",
|
|
53
|
+
".storm.ts",
|
|
54
|
+
"lerna.json",
|
|
55
|
+
"nx.json",
|
|
56
|
+
"turbo.json",
|
|
57
|
+
"npm-workspace.json",
|
|
58
|
+
"yarn-workspace.json",
|
|
59
|
+
"pnpm-workspace.json",
|
|
60
|
+
"npm-workspace.yaml",
|
|
61
|
+
"yarn-workspace.yaml",
|
|
62
|
+
"pnpm-workspace.yaml",
|
|
63
|
+
"npm-workspace.yml",
|
|
64
|
+
"yarn-workspace.yml",
|
|
65
|
+
"pnpm-workspace.yml",
|
|
66
|
+
"npm-lock.json",
|
|
67
|
+
"yarn-lock.json",
|
|
68
|
+
"pnpm-lock.json",
|
|
69
|
+
"npm-lock.yaml",
|
|
70
|
+
"yarn-lock.yaml",
|
|
71
|
+
"pnpm-lock.yaml",
|
|
72
|
+
"npm-lock.yml",
|
|
73
|
+
"yarn-lock.yml",
|
|
74
|
+
"pnpm-lock.yml",
|
|
75
|
+
"bun.lockb"
|
|
76
|
+
];
|
|
77
|
+
function findWorkspaceRootSafe(pathInsideMonorepo) {
|
|
78
|
+
if (process.env.STORM_WORKSPACE_ROOT || process.env.NX_WORKSPACE_ROOT_PATH) {
|
|
79
|
+
return correctPaths(process.env.STORM_WORKSPACE_ROOT ?? process.env.NX_WORKSPACE_ROOT_PATH);
|
|
80
|
+
}
|
|
81
|
+
return correctPaths(findFolderUp(pathInsideMonorepo ?? process.cwd(), rootFiles));
|
|
82
|
+
}
|
|
83
|
+
__name(findWorkspaceRootSafe, "findWorkspaceRootSafe");
|
|
84
|
+
function findWorkspaceRoot(pathInsideMonorepo) {
|
|
85
|
+
const result = findWorkspaceRootSafe(pathInsideMonorepo);
|
|
86
|
+
if (!result) {
|
|
87
|
+
throw new Error(`Cannot find workspace root upwards from known path. Files search list includes:
|
|
88
|
+
${rootFiles.join("\n")}
|
|
89
|
+
Path: ${pathInsideMonorepo ? pathInsideMonorepo : process.cwd()}`);
|
|
90
|
+
}
|
|
91
|
+
return result;
|
|
92
|
+
}
|
|
93
|
+
__name(findWorkspaceRoot, "findWorkspaceRoot");
|
|
94
|
+
|
|
95
|
+
// ../config-tools/src/types.ts
|
|
96
|
+
var LogLevel = {
|
|
97
|
+
SILENT: 0,
|
|
98
|
+
FATAL: 10,
|
|
99
|
+
ERROR: 20,
|
|
100
|
+
WARN: 30,
|
|
101
|
+
SUCCESS: 35,
|
|
102
|
+
INFO: 40,
|
|
103
|
+
DEBUG: 60,
|
|
104
|
+
TRACE: 70,
|
|
105
|
+
ALL: 100
|
|
106
|
+
};
|
|
107
|
+
var LogLevelLabel = {
|
|
108
|
+
SILENT: "silent",
|
|
109
|
+
FATAL: "fatal",
|
|
110
|
+
ERROR: "error",
|
|
111
|
+
WARN: "warn",
|
|
112
|
+
SUCCESS: "success",
|
|
113
|
+
INFO: "info",
|
|
114
|
+
DEBUG: "debug",
|
|
115
|
+
TRACE: "trace",
|
|
116
|
+
ALL: "all"
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
// ../config/src/constants.ts
|
|
120
|
+
var STORM_DEFAULT_DOCS = "https://docs.stormsoftware.com";
|
|
121
|
+
var STORM_DEFAULT_HOMEPAGE = "https://stormsoftware.com";
|
|
122
|
+
var STORM_DEFAULT_LICENSING = "https://license.stormsoftware.com";
|
|
123
|
+
var STORM_DEFAULT_LICENSE = "Apache-2.0";
|
|
124
|
+
|
|
125
|
+
// ../config/src/schema.ts
|
|
126
|
+
import z from "zod";
|
|
127
|
+
var DarkColorSchema = z.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7).default("#1d1e22").describe("The dark background color of the workspace");
|
|
128
|
+
var LightColorSchema = z.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7).default("#f4f4f5").describe("The light background color of the workspace");
|
|
129
|
+
var BrandColorSchema = z.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7).default("#1fb2a6").describe("The primary brand specific color of the workspace");
|
|
130
|
+
var AlternateColorSchema = z.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7).optional().describe("The alternate brand specific color of the workspace");
|
|
131
|
+
var AccentColorSchema = z.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7).optional().describe("The secondary brand specific color of the workspace");
|
|
132
|
+
var LinkColorSchema = z.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7).optional().describe("The color used to display hyperlink text");
|
|
133
|
+
var HelpColorSchema = z.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7).default("#8256D0").describe("The second brand specific color of the workspace");
|
|
134
|
+
var SuccessColorSchema = z.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7).default("#12B66A").describe("The success color of the workspace");
|
|
135
|
+
var InfoColorSchema = z.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7).default("#0070E0").describe("The informational color of the workspace");
|
|
136
|
+
var WarningColorSchema = z.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7).default("#fcc419").describe("The warning color of the workspace");
|
|
137
|
+
var DangerColorSchema = z.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7).default("#D8314A").describe("The danger color of the workspace");
|
|
138
|
+
var FatalColorSchema = z.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7).optional().describe("The fatal color of the workspace");
|
|
139
|
+
var PositiveColorSchema = z.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7).default("#4ade80").describe("The positive number color of the workspace");
|
|
140
|
+
var NegativeColorSchema = z.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7).default("#ef4444").describe("The negative number color of the workspace");
|
|
141
|
+
var DarkThemeColorConfigSchema = z.object({
|
|
142
|
+
foreground: LightColorSchema,
|
|
143
|
+
background: DarkColorSchema,
|
|
144
|
+
brand: BrandColorSchema,
|
|
145
|
+
alternate: AlternateColorSchema,
|
|
146
|
+
accent: AccentColorSchema,
|
|
147
|
+
link: LinkColorSchema,
|
|
148
|
+
help: HelpColorSchema,
|
|
149
|
+
success: SuccessColorSchema,
|
|
150
|
+
info: InfoColorSchema,
|
|
151
|
+
warning: WarningColorSchema,
|
|
152
|
+
danger: DangerColorSchema,
|
|
153
|
+
fatal: FatalColorSchema,
|
|
154
|
+
positive: PositiveColorSchema,
|
|
155
|
+
negative: NegativeColorSchema
|
|
156
|
+
});
|
|
157
|
+
var LightThemeColorConfigSchema = z.object({
|
|
158
|
+
foreground: DarkColorSchema,
|
|
159
|
+
background: LightColorSchema,
|
|
160
|
+
brand: BrandColorSchema,
|
|
161
|
+
alternate: AlternateColorSchema,
|
|
162
|
+
accent: AccentColorSchema,
|
|
163
|
+
link: LinkColorSchema,
|
|
164
|
+
help: HelpColorSchema,
|
|
165
|
+
success: SuccessColorSchema,
|
|
166
|
+
info: InfoColorSchema,
|
|
167
|
+
warning: WarningColorSchema,
|
|
168
|
+
danger: DangerColorSchema,
|
|
169
|
+
fatal: FatalColorSchema,
|
|
170
|
+
positive: PositiveColorSchema,
|
|
171
|
+
negative: NegativeColorSchema
|
|
172
|
+
});
|
|
173
|
+
var MultiThemeColorConfigSchema = z.object({
|
|
174
|
+
dark: DarkThemeColorConfigSchema,
|
|
175
|
+
light: LightThemeColorConfigSchema
|
|
176
|
+
});
|
|
177
|
+
var SingleThemeColorConfigSchema = z.object({
|
|
178
|
+
dark: DarkColorSchema,
|
|
179
|
+
light: LightColorSchema,
|
|
180
|
+
brand: BrandColorSchema,
|
|
181
|
+
alternate: AlternateColorSchema,
|
|
182
|
+
accent: AccentColorSchema,
|
|
183
|
+
link: LinkColorSchema,
|
|
184
|
+
help: HelpColorSchema,
|
|
185
|
+
success: SuccessColorSchema,
|
|
186
|
+
info: InfoColorSchema,
|
|
187
|
+
warning: WarningColorSchema,
|
|
188
|
+
danger: DangerColorSchema,
|
|
189
|
+
fatal: FatalColorSchema,
|
|
190
|
+
positive: PositiveColorSchema,
|
|
191
|
+
negative: NegativeColorSchema
|
|
192
|
+
});
|
|
193
|
+
var RegistryUrlConfigSchema = z.string().trim().toLowerCase().url().optional().describe("A remote registry URL used to publish distributable packages");
|
|
194
|
+
var RegistryConfigSchema = z.object({
|
|
195
|
+
github: RegistryUrlConfigSchema,
|
|
196
|
+
npm: RegistryUrlConfigSchema,
|
|
197
|
+
cargo: RegistryUrlConfigSchema,
|
|
198
|
+
cyclone: RegistryUrlConfigSchema,
|
|
199
|
+
container: RegistryUrlConfigSchema
|
|
200
|
+
}).default({}).describe("A list of remote registry URLs used by Storm Software");
|
|
201
|
+
var ColorConfigSchema = SingleThemeColorConfigSchema.or(MultiThemeColorConfigSchema).describe("Colors used for various workspace elements");
|
|
202
|
+
var ColorConfigMapSchema = z.union([
|
|
203
|
+
z.object({
|
|
204
|
+
"base": ColorConfigSchema
|
|
205
|
+
}),
|
|
206
|
+
z.record(z.string(), ColorConfigSchema)
|
|
207
|
+
]);
|
|
208
|
+
var WorkspaceBotConfigSchema = z.object({
|
|
209
|
+
name: z.string().trim().default("Stormie-Bot").describe("The workspace bot user's name (this is the bot that will be used to perform various tasks)"),
|
|
210
|
+
email: z.string().trim().email().default("bot@stormsoftware.com").describe("The email of the workspace bot")
|
|
211
|
+
}).describe("The workspace's bot user's config used to automated various operations tasks");
|
|
212
|
+
var WorkspaceDirectoryConfigSchema = z.object({
|
|
213
|
+
cache: z.string().trim().optional().describe("The directory used to store the environment's cached file data"),
|
|
214
|
+
data: z.string().trim().optional().describe("The directory used to store the environment's data files"),
|
|
215
|
+
config: z.string().trim().optional().describe("The directory used to store the environment's configuration files"),
|
|
216
|
+
temp: z.string().trim().optional().describe("The directory used to store the environment's temp files"),
|
|
217
|
+
log: z.string().trim().optional().describe("The directory used to store the environment's temp files"),
|
|
218
|
+
build: z.string().trim().default("dist").describe("The directory used to store the workspace's distributable files after a build (relative to the workspace root)")
|
|
219
|
+
}).describe("Various directories used by the workspace to store data, cache, and configuration files");
|
|
220
|
+
var StormConfigSchema = z.object({
|
|
221
|
+
$schema: z.string().trim().default("https://cdn.jsdelivr.net/npm/@storm-software/config/schemas/storm.schema.json").optional().nullish().describe("The URL to the JSON schema file that describes the Storm configuration file"),
|
|
222
|
+
extends: z.string().trim().optional().describe("The path to a base JSON file to use as a configuration preset file"),
|
|
223
|
+
name: z.string().trim().toLowerCase().optional().describe("The name of the service/package/scope using this configuration"),
|
|
224
|
+
namespace: z.string().trim().toLowerCase().optional().describe("The namespace of the package"),
|
|
225
|
+
organization: z.string().trim().default("storm-software").describe("The organization of the workspace"),
|
|
226
|
+
repository: z.string().trim().url().optional().describe("The repo URL of the workspace (i.e. GitHub)"),
|
|
227
|
+
license: z.string().trim().default("Apache-2.0").describe("The license type of the package"),
|
|
228
|
+
homepage: z.string().trim().url().default(STORM_DEFAULT_HOMEPAGE).describe("The homepage of the workspace"),
|
|
229
|
+
docs: z.string().trim().url().default(STORM_DEFAULT_DOCS).describe("The base documentation site for the workspace"),
|
|
230
|
+
licensing: z.string().trim().url().default(STORM_DEFAULT_LICENSING).describe("The base licensing site for the workspace"),
|
|
231
|
+
branch: z.string().trim().default("main").describe("The branch of the workspace"),
|
|
232
|
+
preid: z.string().optional().describe("A tag specifying the version pre-release identifier"),
|
|
233
|
+
owner: z.string().trim().default("@storm-software/admin").describe("The owner of the package"),
|
|
234
|
+
bot: WorkspaceBotConfigSchema,
|
|
235
|
+
env: z.enum([
|
|
236
|
+
"development",
|
|
237
|
+
"staging",
|
|
238
|
+
"production"
|
|
239
|
+
]).default("production").describe("The current runtime environment name for the package"),
|
|
240
|
+
workspaceRoot: z.string().trim().default("").describe("The root directory of the workspace"),
|
|
241
|
+
externalPackagePatterns: z.array(z.string()).default([]).describe("The build will use these package patterns to determine if they should be external to the bundle"),
|
|
242
|
+
skipCache: z.boolean().default(false).describe("Should all known types of workspace caching be skipped?"),
|
|
243
|
+
directories: WorkspaceDirectoryConfigSchema,
|
|
244
|
+
packageManager: z.enum([
|
|
245
|
+
"npm",
|
|
246
|
+
"yarn",
|
|
247
|
+
"pnpm",
|
|
248
|
+
"bun"
|
|
249
|
+
]).default("npm").describe("The JavaScript/TypeScript package manager used by the repository"),
|
|
250
|
+
timezone: z.string().trim().default("America/New_York").describe("The default timezone of the workspace"),
|
|
251
|
+
locale: z.string().trim().default("en-US").describe("The default locale of the workspace"),
|
|
252
|
+
logLevel: z.enum([
|
|
253
|
+
"silent",
|
|
254
|
+
"fatal",
|
|
255
|
+
"error",
|
|
256
|
+
"warn",
|
|
257
|
+
"success",
|
|
258
|
+
"info",
|
|
259
|
+
"debug",
|
|
260
|
+
"trace",
|
|
261
|
+
"all"
|
|
262
|
+
]).default("info").describe("The log level used to filter out lower priority log messages. If not provided, this is defaulted using the `environment` config value (if `environment` is set to `production` then `level` is `error`, else `level` is `debug`)."),
|
|
263
|
+
registry: RegistryConfigSchema,
|
|
264
|
+
configFile: z.string().trim().nullable().default(null).describe("The filepath of the Storm config. When this field is null, no config file was found in the current workspace."),
|
|
265
|
+
colors: ColorConfigSchema.or(ColorConfigMapSchema).describe("Storm theme config values used for styling various package elements"),
|
|
266
|
+
extensions: z.record(z.any()).optional().default({}).describe("Configuration of each used extension")
|
|
267
|
+
}).describe("Storm Workspace config values used during various dev-ops processes. This type is a combination of the StormPackageConfig and StormProject types. It represents the config of the entire monorepo.");
|
|
268
|
+
|
|
269
|
+
// ../config/src/types.ts
|
|
270
|
+
var COLOR_KEYS = [
|
|
271
|
+
"dark",
|
|
272
|
+
"light",
|
|
273
|
+
"base",
|
|
274
|
+
"brand",
|
|
275
|
+
"alternate",
|
|
276
|
+
"accent",
|
|
277
|
+
"link",
|
|
278
|
+
"success",
|
|
279
|
+
"help",
|
|
280
|
+
"info",
|
|
281
|
+
"warning",
|
|
282
|
+
"danger",
|
|
283
|
+
"fatal",
|
|
284
|
+
"positive",
|
|
285
|
+
"negative"
|
|
286
|
+
];
|
|
287
|
+
|
|
288
|
+
// ../config-tools/src/utilities/get-default-config.ts
|
|
289
|
+
import { existsSync as existsSync2, readFileSync } from "node:fs";
|
|
290
|
+
import { join as join2 } from "node:path";
|
|
291
|
+
var DEFAULT_COLOR_CONFIG = {
|
|
292
|
+
"light": {
|
|
293
|
+
"background": "#fafafa",
|
|
294
|
+
"foreground": "#1d1e22",
|
|
295
|
+
"brand": "#1fb2a6",
|
|
296
|
+
"alternate": "#db2777",
|
|
297
|
+
"help": "#5C4EE5",
|
|
298
|
+
"success": "#087f5b",
|
|
299
|
+
"info": "#0550ae",
|
|
300
|
+
"warning": "#e3b341",
|
|
301
|
+
"danger": "#D8314A",
|
|
302
|
+
"positive": "#22c55e",
|
|
303
|
+
"negative": "#dc2626"
|
|
304
|
+
},
|
|
305
|
+
"dark": {
|
|
306
|
+
"background": "#1d1e22",
|
|
307
|
+
"foreground": "#cbd5e1",
|
|
308
|
+
"brand": "#2dd4bf",
|
|
309
|
+
"alternate": "#db2777",
|
|
310
|
+
"help": "#818cf8",
|
|
311
|
+
"success": "#10b981",
|
|
312
|
+
"info": "#58a6ff",
|
|
313
|
+
"warning": "#f3d371",
|
|
314
|
+
"danger": "#D8314A",
|
|
315
|
+
"positive": "#22c55e",
|
|
316
|
+
"negative": "#dc2626"
|
|
317
|
+
}
|
|
318
|
+
};
|
|
319
|
+
var getDefaultConfig = /* @__PURE__ */ __name((root) => {
|
|
320
|
+
let license = STORM_DEFAULT_LICENSE;
|
|
321
|
+
let homepage = STORM_DEFAULT_HOMEPAGE;
|
|
322
|
+
let name;
|
|
323
|
+
let namespace;
|
|
324
|
+
let repository;
|
|
325
|
+
const workspaceRoot = findWorkspaceRoot(root);
|
|
326
|
+
if (existsSync2(join2(workspaceRoot, "package.json"))) {
|
|
327
|
+
const file = readFileSync(join2(workspaceRoot, "package.json"), {
|
|
328
|
+
encoding: "utf8"
|
|
329
|
+
});
|
|
330
|
+
if (file) {
|
|
331
|
+
const packageJson = JSON.parse(file);
|
|
332
|
+
if (packageJson.name) {
|
|
333
|
+
name = packageJson.name;
|
|
334
|
+
}
|
|
335
|
+
if (packageJson.namespace) {
|
|
336
|
+
namespace = packageJson.namespace;
|
|
337
|
+
}
|
|
338
|
+
if (packageJson.repository?.url) {
|
|
339
|
+
repository = packageJson.repository?.url;
|
|
340
|
+
}
|
|
341
|
+
if (packageJson.license) {
|
|
342
|
+
license = packageJson.license;
|
|
343
|
+
}
|
|
344
|
+
if (packageJson.homepage) {
|
|
345
|
+
homepage = packageJson.homepage;
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
return {
|
|
350
|
+
workspaceRoot,
|
|
351
|
+
name,
|
|
352
|
+
namespace,
|
|
353
|
+
repository,
|
|
354
|
+
license,
|
|
355
|
+
homepage,
|
|
356
|
+
docs: `${homepage || STORM_DEFAULT_HOMEPAGE}/docs`,
|
|
357
|
+
licensing: `${homepage || STORM_DEFAULT_HOMEPAGE}/license`
|
|
358
|
+
};
|
|
359
|
+
}, "getDefaultConfig");
|
|
360
|
+
|
|
361
|
+
// ../config-tools/src/logger/chalk.ts
|
|
362
|
+
import chalk from "chalk";
|
|
363
|
+
var chalkDefault = {
|
|
364
|
+
hex: /* @__PURE__ */ __name((_) => (message) => message, "hex"),
|
|
365
|
+
bgHex: /* @__PURE__ */ __name((_) => ({
|
|
366
|
+
whiteBright: /* @__PURE__ */ __name((message) => message, "whiteBright")
|
|
367
|
+
}), "bgHex"),
|
|
368
|
+
whiteBright: /* @__PURE__ */ __name((message) => message, "whiteBright"),
|
|
369
|
+
gray: /* @__PURE__ */ __name((message) => message, "gray"),
|
|
370
|
+
bold: {
|
|
371
|
+
hex: /* @__PURE__ */ __name((_) => (message) => message, "hex"),
|
|
372
|
+
bgHex: /* @__PURE__ */ __name((_) => ({
|
|
373
|
+
whiteBright: /* @__PURE__ */ __name((message) => message, "whiteBright")
|
|
374
|
+
}), "bgHex"),
|
|
375
|
+
whiteBright: /* @__PURE__ */ __name((message) => message, "whiteBright")
|
|
376
|
+
},
|
|
377
|
+
dim: {
|
|
378
|
+
hex: /* @__PURE__ */ __name((_) => (message) => message, "hex"),
|
|
379
|
+
gray: /* @__PURE__ */ __name((message) => message, "gray")
|
|
380
|
+
}
|
|
381
|
+
};
|
|
382
|
+
var getChalk = /* @__PURE__ */ __name(() => {
|
|
383
|
+
let _chalk = chalk;
|
|
384
|
+
if (!_chalk?.hex || !_chalk?.bold?.hex || !_chalk?.bgHex || !_chalk?.whiteBright) {
|
|
385
|
+
_chalk = chalkDefault;
|
|
386
|
+
}
|
|
387
|
+
return _chalk;
|
|
388
|
+
}, "getChalk");
|
|
389
|
+
|
|
390
|
+
// ../config-tools/src/logger/is-unicode-supported.ts
|
|
391
|
+
import process2 from "node:process";
|
|
392
|
+
function isUnicodeSupported() {
|
|
393
|
+
const { env } = process2;
|
|
394
|
+
const { TERM, TERM_PROGRAM } = env;
|
|
395
|
+
if (process2.platform !== "win32") {
|
|
396
|
+
return TERM !== "linux";
|
|
397
|
+
}
|
|
398
|
+
return Boolean(env.WT_SESSION) || // Windows Terminal
|
|
399
|
+
Boolean(env.TERMINUS_SUBLIME) || // Terminus (<0.2.27)
|
|
400
|
+
env.ConEmuTask === "{cmd::Cmder}" || // ConEmu and cmder
|
|
401
|
+
TERM_PROGRAM === "Terminus-Sublime" || TERM_PROGRAM === "vscode" || TERM === "xterm-256color" || TERM === "alacritty" || TERM === "rxvt-unicode" || TERM === "rxvt-unicode-256color" || env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
|
|
402
|
+
}
|
|
403
|
+
__name(isUnicodeSupported, "isUnicodeSupported");
|
|
404
|
+
|
|
405
|
+
// ../config-tools/src/logger/console-icons.ts
|
|
406
|
+
var useIcon = /* @__PURE__ */ __name((c, fallback) => isUnicodeSupported() ? c : fallback, "useIcon");
|
|
407
|
+
var CONSOLE_ICONS = {
|
|
408
|
+
[LogLevelLabel.ERROR]: useIcon("\u2718", "\xD7"),
|
|
409
|
+
[LogLevelLabel.FATAL]: useIcon("\u{1F480}", "\xD7"),
|
|
410
|
+
[LogLevelLabel.WARN]: useIcon("\u26A0", "\u203C"),
|
|
411
|
+
[LogLevelLabel.INFO]: useIcon("\u2139", "i"),
|
|
412
|
+
[LogLevelLabel.SUCCESS]: useIcon("\u2714", "\u221A"),
|
|
413
|
+
[LogLevelLabel.DEBUG]: useIcon("\u{1F6E0}", "D"),
|
|
414
|
+
[LogLevelLabel.TRACE]: useIcon("\u{1F6E0}", "T"),
|
|
415
|
+
[LogLevelLabel.ALL]: useIcon("\u2709", "\u2192")
|
|
416
|
+
};
|
|
417
|
+
|
|
418
|
+
// ../config-tools/src/logger/format-timestamp.ts
|
|
419
|
+
var formatTimestamp = /* @__PURE__ */ __name((date = /* @__PURE__ */ new Date()) => {
|
|
420
|
+
return `${date.toLocaleDateString()} ${date.toLocaleTimeString()}`;
|
|
421
|
+
}, "formatTimestamp");
|
|
422
|
+
|
|
423
|
+
// ../config-tools/src/logger/get-log-level.ts
|
|
424
|
+
var getLogLevel = /* @__PURE__ */ __name((label) => {
|
|
425
|
+
switch (label) {
|
|
426
|
+
case "all":
|
|
427
|
+
return LogLevel.ALL;
|
|
428
|
+
case "trace":
|
|
429
|
+
return LogLevel.TRACE;
|
|
430
|
+
case "debug":
|
|
431
|
+
return LogLevel.DEBUG;
|
|
432
|
+
case "info":
|
|
433
|
+
return LogLevel.INFO;
|
|
434
|
+
case "warn":
|
|
435
|
+
return LogLevel.WARN;
|
|
436
|
+
case "error":
|
|
437
|
+
return LogLevel.ERROR;
|
|
438
|
+
case "fatal":
|
|
439
|
+
return LogLevel.FATAL;
|
|
440
|
+
case "silent":
|
|
441
|
+
return LogLevel.SILENT;
|
|
442
|
+
default:
|
|
443
|
+
return LogLevel.INFO;
|
|
444
|
+
}
|
|
445
|
+
}, "getLogLevel");
|
|
446
|
+
var getLogLevelLabel = /* @__PURE__ */ __name((logLevel = LogLevel.INFO) => {
|
|
447
|
+
if (logLevel >= LogLevel.ALL) {
|
|
448
|
+
return LogLevelLabel.ALL;
|
|
449
|
+
}
|
|
450
|
+
if (logLevel >= LogLevel.TRACE) {
|
|
451
|
+
return LogLevelLabel.TRACE;
|
|
452
|
+
}
|
|
453
|
+
if (logLevel >= LogLevel.DEBUG) {
|
|
454
|
+
return LogLevelLabel.DEBUG;
|
|
455
|
+
}
|
|
456
|
+
if (logLevel >= LogLevel.INFO) {
|
|
457
|
+
return LogLevelLabel.INFO;
|
|
458
|
+
}
|
|
459
|
+
if (logLevel >= LogLevel.WARN) {
|
|
460
|
+
return LogLevelLabel.WARN;
|
|
461
|
+
}
|
|
462
|
+
if (logLevel >= LogLevel.ERROR) {
|
|
463
|
+
return LogLevelLabel.ERROR;
|
|
464
|
+
}
|
|
465
|
+
if (logLevel >= LogLevel.FATAL) {
|
|
466
|
+
return LogLevelLabel.FATAL;
|
|
467
|
+
}
|
|
468
|
+
if (logLevel <= LogLevel.SILENT) {
|
|
469
|
+
return LogLevelLabel.SILENT;
|
|
470
|
+
}
|
|
471
|
+
return LogLevelLabel.INFO;
|
|
472
|
+
}, "getLogLevelLabel");
|
|
473
|
+
|
|
474
|
+
// ../config-tools/src/logger/console.ts
|
|
475
|
+
var getLogFn = /* @__PURE__ */ __name((logLevel = LogLevel.INFO, config = {}) => {
|
|
476
|
+
const _chalk = getChalk();
|
|
477
|
+
const colors = !config.colors?.dark && !config.colors?.["base"] && !config.colors?.["base"]?.dark ? DEFAULT_COLOR_CONFIG : config.colors?.dark && typeof config.colors.dark === "string" ? config.colors : config.colors?.["base"]?.dark && typeof config.colors["base"].dark === "string" ? config.colors["base"].dark : config.colors?.["base"] ? config.colors?.["base"] : DEFAULT_COLOR_CONFIG;
|
|
478
|
+
const configLogLevel = config.logLevel || process.env.STORM_LOG_LEVEL || LogLevelLabel.INFO;
|
|
479
|
+
if (typeof logLevel === "number" && (logLevel >= getLogLevel(configLogLevel) || logLevel <= LogLevel.SILENT) || typeof logLevel === "string" && getLogLevel(logLevel) >= getLogLevel(configLogLevel)) {
|
|
480
|
+
return (_) => {
|
|
481
|
+
};
|
|
482
|
+
}
|
|
483
|
+
if (typeof logLevel === "number" && LogLevel.FATAL >= logLevel || typeof logLevel === "string" && LogLevel.FATAL >= getLogLevel(logLevel)) {
|
|
484
|
+
return (message) => {
|
|
485
|
+
console.error(`
|
|
486
|
+
${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.fatal ?? "#7d1a1a")(`[${CONSOLE_ICONS[LogLevelLabel.FATAL]} Fatal]`)} ${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
487
|
+
`);
|
|
488
|
+
};
|
|
489
|
+
}
|
|
490
|
+
if (typeof logLevel === "number" && LogLevel.ERROR >= logLevel || typeof logLevel === "string" && LogLevel.ERROR >= getLogLevel(logLevel)) {
|
|
491
|
+
return (message) => {
|
|
492
|
+
console.error(`
|
|
493
|
+
${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.danger ?? "#f85149")(`[${CONSOLE_ICONS[LogLevelLabel.ERROR]} Error]`)} ${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
494
|
+
`);
|
|
495
|
+
};
|
|
496
|
+
}
|
|
497
|
+
if (typeof logLevel === "number" && LogLevel.WARN >= logLevel || typeof logLevel === "string" && LogLevel.WARN >= getLogLevel(logLevel)) {
|
|
498
|
+
return (message) => {
|
|
499
|
+
console.warn(`
|
|
500
|
+
${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.warning ?? "#e3b341")(`[${CONSOLE_ICONS[LogLevelLabel.WARN]} Warn]`)} ${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
501
|
+
`);
|
|
502
|
+
};
|
|
503
|
+
}
|
|
504
|
+
if (typeof logLevel === "number" && LogLevel.SUCCESS >= logLevel || typeof logLevel === "string" && LogLevel.SUCCESS >= getLogLevel(logLevel)) {
|
|
505
|
+
return (message) => {
|
|
506
|
+
console.info(`
|
|
507
|
+
${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.success ?? "#56d364")(`[${CONSOLE_ICONS[LogLevelLabel.SUCCESS]} Success]`)} ${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
508
|
+
`);
|
|
509
|
+
};
|
|
510
|
+
}
|
|
511
|
+
if (typeof logLevel === "number" && LogLevel.INFO >= logLevel || typeof logLevel === "string" && LogLevel.INFO >= getLogLevel(logLevel)) {
|
|
512
|
+
return (message) => {
|
|
513
|
+
console.info(`
|
|
514
|
+
${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.info ?? "#58a6ff")(`[${CONSOLE_ICONS[LogLevelLabel.INFO]} Info]`)} ${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
515
|
+
`);
|
|
516
|
+
};
|
|
517
|
+
}
|
|
518
|
+
if (typeof logLevel === "number" && LogLevel.TRACE >= logLevel || typeof logLevel === "string" && LogLevel.TRACE >= getLogLevel(logLevel)) {
|
|
519
|
+
return (message) => {
|
|
520
|
+
console.debug(`
|
|
521
|
+
${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.brand ?? "#1fb2a6")(`[${CONSOLE_ICONS[LogLevelLabel.DEBUG]} Debug]`)} ${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
522
|
+
`);
|
|
523
|
+
};
|
|
524
|
+
}
|
|
525
|
+
return (message) => {
|
|
526
|
+
console.log(`
|
|
527
|
+
${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.brand ?? "#1fb2a6")(`[${CONSOLE_ICONS[LogLevelLabel.ALL]} System]`)} ${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
528
|
+
`);
|
|
529
|
+
};
|
|
530
|
+
}, "getLogFn");
|
|
531
|
+
var writeFatal = /* @__PURE__ */ __name((message, config) => getLogFn(LogLevel.FATAL, config)(message), "writeFatal");
|
|
532
|
+
var writeError = /* @__PURE__ */ __name((message, config) => getLogFn(LogLevel.ERROR, config)(message), "writeError");
|
|
533
|
+
var writeWarning = /* @__PURE__ */ __name((message, config) => getLogFn(LogLevel.WARN, config)(message), "writeWarning");
|
|
534
|
+
var writeInfo = /* @__PURE__ */ __name((message, config) => getLogFn(LogLevel.INFO, config)(message), "writeInfo");
|
|
535
|
+
var writeSuccess = /* @__PURE__ */ __name((message, config) => getLogFn(LogLevel.SUCCESS, config)(message), "writeSuccess");
|
|
536
|
+
var writeDebug = /* @__PURE__ */ __name((message, config) => getLogFn(LogLevel.DEBUG, config)(message), "writeDebug");
|
|
537
|
+
var writeTrace = /* @__PURE__ */ __name((message, config) => getLogFn(LogLevel.TRACE, config)(message), "writeTrace");
|
|
538
|
+
var writeSystem = /* @__PURE__ */ __name((message, config) => getLogFn(LogLevel.ALL, config)(message), "writeSystem");
|
|
539
|
+
var getStopwatch = /* @__PURE__ */ __name((name) => {
|
|
540
|
+
const start = process.hrtime();
|
|
541
|
+
return () => {
|
|
542
|
+
const end = process.hrtime(start);
|
|
543
|
+
console.info(`
|
|
544
|
+
> \u23F1\uFE0F The${name ? ` ${name}` : ""} process took ${Math.round(end[0] * 1e3 + end[1] / 1e6)}ms to complete
|
|
545
|
+
|
|
546
|
+
`);
|
|
547
|
+
};
|
|
548
|
+
}, "getStopwatch");
|
|
549
|
+
var MAX_DEPTH = 4;
|
|
550
|
+
var formatLogMessage = /* @__PURE__ */ __name((message, options = {}, depth2 = 0) => {
|
|
551
|
+
if (depth2 > MAX_DEPTH) {
|
|
552
|
+
return "<max depth>";
|
|
553
|
+
}
|
|
554
|
+
const prefix = options.prefix ?? "-";
|
|
555
|
+
const skip = options.skip ?? [];
|
|
556
|
+
return typeof message === "undefined" || message === null || !message && typeof message !== "boolean" ? "<none>" : typeof message === "string" ? message : Array.isArray(message) ? `
|
|
557
|
+
${message.map((item, index) => ` ${prefix}> #${index} = ${formatLogMessage(item, {
|
|
558
|
+
prefix: `${prefix}-`,
|
|
559
|
+
skip
|
|
560
|
+
}, depth2 + 1)}`).join("\n")}` : typeof message === "object" ? `
|
|
561
|
+
${Object.keys(message).filter((key) => !skip.includes(key)).map((key) => ` ${prefix}> ${key} = ${_isFunction(message[key]) ? "<function>" : typeof message[key] === "object" ? formatLogMessage(message[key], {
|
|
562
|
+
prefix: `${prefix}-`,
|
|
563
|
+
skip
|
|
564
|
+
}, depth2 + 1) : message[key]}`).join("\n")}` : message;
|
|
565
|
+
}, "formatLogMessage");
|
|
566
|
+
var _isFunction = /* @__PURE__ */ __name((value) => {
|
|
567
|
+
try {
|
|
568
|
+
return value instanceof Function || typeof value === "function" || !!(value?.constructor && value?.call && value?.apply);
|
|
569
|
+
} catch (e) {
|
|
570
|
+
return false;
|
|
571
|
+
}
|
|
572
|
+
}, "_isFunction");
|
|
573
|
+
|
|
574
|
+
// ../config-tools/src/create-storm-config.ts
|
|
575
|
+
import defu2 from "defu";
|
|
576
|
+
|
|
577
|
+
// ../config-tools/src/config-file/get-config-file.ts
|
|
578
|
+
import { loadConfig } from "c12";
|
|
579
|
+
import defu from "defu";
|
|
580
|
+
var getConfigFileByName = /* @__PURE__ */ __name(async (fileName, filePath, options = {}) => {
|
|
581
|
+
const workspacePath = filePath || findWorkspaceRoot(filePath);
|
|
582
|
+
let config = loadConfig({
|
|
583
|
+
cwd: workspacePath,
|
|
584
|
+
packageJson: true,
|
|
585
|
+
name: fileName,
|
|
586
|
+
envName: fileName?.toUpperCase(),
|
|
587
|
+
jitiOptions: {
|
|
588
|
+
debug: false,
|
|
589
|
+
cache: process.env.STORM_SKIP_CACHE === "true" ? false : joinPaths(process.env.STORM_CACHE_DIR || "node_modules/.cache", "storm")
|
|
590
|
+
},
|
|
591
|
+
...options
|
|
592
|
+
});
|
|
593
|
+
if (!config || Object.keys(config).length === 0) {
|
|
594
|
+
config = loadConfig({
|
|
595
|
+
cwd: workspacePath,
|
|
596
|
+
packageJson: true,
|
|
597
|
+
name: fileName,
|
|
598
|
+
envName: fileName?.toUpperCase(),
|
|
599
|
+
jitiOptions: {
|
|
600
|
+
debug: false,
|
|
601
|
+
cache: process.env.STORM_SKIP_CACHE === "true" ? false : joinPaths(process.env.STORM_CACHE_DIR || "node_modules/.cache", "storm")
|
|
602
|
+
},
|
|
603
|
+
configFile: fileName,
|
|
604
|
+
...options
|
|
605
|
+
});
|
|
606
|
+
}
|
|
607
|
+
return config;
|
|
608
|
+
}, "getConfigFileByName");
|
|
609
|
+
var getConfigFile = /* @__PURE__ */ __name(async (filePath, additionalFileNames = []) => {
|
|
610
|
+
const workspacePath = filePath ? filePath : findWorkspaceRoot(filePath);
|
|
611
|
+
const result = await getConfigFileByName("storm", workspacePath);
|
|
612
|
+
let config = result.config;
|
|
613
|
+
const configFile = result.configFile;
|
|
614
|
+
if (config && configFile && Object.keys(config).length > 0) {
|
|
615
|
+
writeSystem(`Found Storm configuration file "${configFile.includes(`${workspacePath}/`) ? configFile.replace(`${workspacePath}/`, "") : configFile}" at "${workspacePath}"`, {
|
|
616
|
+
logLevel: "all"
|
|
617
|
+
});
|
|
618
|
+
}
|
|
619
|
+
if (additionalFileNames && additionalFileNames.length > 0) {
|
|
620
|
+
const results = await Promise.all(additionalFileNames.map((fileName) => getConfigFileByName(fileName, workspacePath)));
|
|
621
|
+
for (const result2 of results) {
|
|
622
|
+
if (result2?.config && result2?.configFile && Object.keys(result2.config).length > 0) {
|
|
623
|
+
writeSystem(`Found alternative configuration file "${result2.configFile.includes(`${workspacePath}/`) ? result2.configFile.replace(`${workspacePath}/`, "") : result2.configFile}" at "${workspacePath}"`, {
|
|
624
|
+
logLevel: "all"
|
|
625
|
+
});
|
|
626
|
+
config = defu(result2.config ?? {}, config ?? {});
|
|
627
|
+
}
|
|
628
|
+
}
|
|
629
|
+
}
|
|
630
|
+
if (!config) {
|
|
631
|
+
return void 0;
|
|
632
|
+
}
|
|
633
|
+
config.configFile = configFile;
|
|
634
|
+
return config;
|
|
635
|
+
}, "getConfigFile");
|
|
636
|
+
|
|
637
|
+
// ../config-tools/src/env/get-env.ts
|
|
638
|
+
var getConfigEnv = /* @__PURE__ */ __name(() => {
|
|
639
|
+
const prefix = "STORM_";
|
|
640
|
+
let config = {
|
|
641
|
+
extends: process.env[`${prefix}EXTENDS`] || void 0,
|
|
642
|
+
name: process.env[`${prefix}NAME`] || void 0,
|
|
643
|
+
namespace: process.env[`${prefix}NAMESPACE`] || void 0,
|
|
644
|
+
owner: process.env[`${prefix}OWNER`] || void 0,
|
|
645
|
+
bot: {
|
|
646
|
+
name: process.env[`${prefix}BOT_NAME`] || void 0,
|
|
647
|
+
email: process.env[`${prefix}BOT_EMAIL`] || void 0
|
|
648
|
+
},
|
|
649
|
+
organization: process.env[`${prefix}ORGANIZATION`] || void 0,
|
|
650
|
+
packageManager: process.env[`${prefix}PACKAGE_MANAGER`] || void 0,
|
|
651
|
+
license: process.env[`${prefix}LICENSE`] || void 0,
|
|
652
|
+
homepage: process.env[`${prefix}HOMEPAGE`] || void 0,
|
|
653
|
+
docs: process.env[`${prefix}DOCS`] || void 0,
|
|
654
|
+
licensing: process.env[`${prefix}LICENSING`] || void 0,
|
|
655
|
+
timezone: process.env[`${prefix}TIMEZONE`] || process.env.TZ || void 0,
|
|
656
|
+
locale: process.env[`${prefix}LOCALE`] || process.env.LOCALE || void 0,
|
|
657
|
+
configFile: process.env[`${prefix}CONFIG_FILE`] ? correctPaths(process.env[`${prefix}CONFIG_FILE`]) : void 0,
|
|
658
|
+
workspaceRoot: process.env[`${prefix}WORKSPACE_ROOT`] ? correctPaths(process.env[`${prefix}WORKSPACE_ROOT`]) : void 0,
|
|
659
|
+
directories: {
|
|
660
|
+
cache: process.env[`${prefix}CACHE_DIR`] ? correctPaths(process.env[`${prefix}CACHE_DIR`]) : void 0,
|
|
661
|
+
data: process.env[`${prefix}DATA_DIR`] ? correctPaths(process.env[`${prefix}DATA_DIR`]) : void 0,
|
|
662
|
+
config: process.env[`${prefix}CONFIG_DIR`] ? correctPaths(process.env[`${prefix}CONFIG_DIR`]) : void 0,
|
|
663
|
+
temp: process.env[`${prefix}TEMP_DIR`] ? correctPaths(process.env[`${prefix}TEMP_DIR`]) : void 0,
|
|
664
|
+
log: process.env[`${prefix}LOG_DIR`] ? correctPaths(process.env[`${prefix}LOG_DIR`]) : void 0,
|
|
665
|
+
build: process.env[`${prefix}BUILD_DIR`] ? correctPaths(process.env[`${prefix}BUILD_DIR`]) : void 0
|
|
666
|
+
},
|
|
667
|
+
skipCache: process.env[`${prefix}SKIP_CACHE`] !== void 0 ? Boolean(process.env[`${prefix}SKIP_CACHE`]) : void 0,
|
|
668
|
+
env: (process.env[`${prefix}ENV`] ?? process.env.NODE_ENV ?? process.env.ENVIRONMENT) || void 0,
|
|
669
|
+
// ci:
|
|
670
|
+
// process.env[`${prefix}CI`] !== undefined
|
|
671
|
+
// ? Boolean(
|
|
672
|
+
// process.env[`${prefix}CI`] ??
|
|
673
|
+
// process.env.CI ??
|
|
674
|
+
// process.env.CONTINUOUS_INTEGRATION
|
|
675
|
+
// )
|
|
676
|
+
// : undefined,
|
|
677
|
+
repository: process.env[`${prefix}REPOSITORY`] || void 0,
|
|
678
|
+
branch: process.env[`${prefix}BRANCH`] || void 0,
|
|
679
|
+
preid: process.env[`${prefix}PRE_ID`] || void 0,
|
|
680
|
+
externalPackagePatterns: process.env[`${prefix}EXTERNAL_PACKAGE_PATTERNS`] ? JSON.parse(process.env[`${prefix}EXTERNAL_PACKAGE_PATTERNS`]) : [],
|
|
681
|
+
registry: {
|
|
682
|
+
github: process.env[`${prefix}REGISTRY_GITHUB`] || void 0,
|
|
683
|
+
npm: process.env[`${prefix}REGISTRY_NPM`] || void 0,
|
|
684
|
+
cargo: process.env[`${prefix}REGISTRY_CARGO`] || void 0,
|
|
685
|
+
cyclone: process.env[`${prefix}REGISTRY_CYCLONE`] || void 0,
|
|
686
|
+
container: process.env[`${prefix}REGISTRY_CONTAINER`] || void 0
|
|
687
|
+
},
|
|
688
|
+
logLevel: process.env[`${prefix}LOG_LEVEL`] !== null && process.env[`${prefix}LOG_LEVEL`] !== void 0 ? process.env[`${prefix}LOG_LEVEL`] && Number.isSafeInteger(Number.parseInt(process.env[`${prefix}LOG_LEVEL`])) ? getLogLevelLabel(Number.parseInt(process.env[`${prefix}LOG_LEVEL`])) : process.env[`${prefix}LOG_LEVEL`] : void 0
|
|
689
|
+
};
|
|
690
|
+
const themeNames = Object.keys(process.env).filter((envKey) => envKey.startsWith(`${prefix}COLOR_`) && COLOR_KEYS.every((colorKey) => !envKey.startsWith(`${prefix}COLOR_LIGHT_${colorKey}`) && !envKey.startsWith(`${prefix}COLOR_DARK_${colorKey}`)));
|
|
691
|
+
config.colors = themeNames.length > 0 ? themeNames.reduce((ret, themeName) => {
|
|
692
|
+
ret[themeName] = getThemeColorConfigEnv(prefix, themeName);
|
|
693
|
+
return ret;
|
|
694
|
+
}, {}) : getThemeColorConfigEnv(prefix);
|
|
695
|
+
if (config.docs === STORM_DEFAULT_DOCS) {
|
|
696
|
+
if (config.homepage === STORM_DEFAULT_HOMEPAGE) {
|
|
697
|
+
config.docs = `${STORM_DEFAULT_HOMEPAGE}/projects/${config.name}/docs`;
|
|
698
|
+
} else {
|
|
699
|
+
config.docs = `${config.homepage}/docs`;
|
|
700
|
+
}
|
|
701
|
+
}
|
|
702
|
+
if (config.licensing === STORM_DEFAULT_LICENSING) {
|
|
703
|
+
if (config.homepage === STORM_DEFAULT_HOMEPAGE) {
|
|
704
|
+
config.licensing = `${STORM_DEFAULT_HOMEPAGE}/projects/${config.name}/licensing`;
|
|
705
|
+
} else {
|
|
706
|
+
config.licensing = `${config.homepage}/docs`;
|
|
707
|
+
}
|
|
708
|
+
}
|
|
709
|
+
const serializedConfig = process.env[`${prefix}CONFIG`];
|
|
710
|
+
if (serializedConfig) {
|
|
711
|
+
const parsed = JSON.parse(serializedConfig);
|
|
712
|
+
config = {
|
|
713
|
+
...config,
|
|
714
|
+
...parsed,
|
|
715
|
+
colors: {
|
|
716
|
+
...config.colors,
|
|
717
|
+
...parsed.colors
|
|
718
|
+
},
|
|
719
|
+
extensions: {
|
|
720
|
+
...config.extensions,
|
|
721
|
+
...parsed.extensions
|
|
722
|
+
}
|
|
723
|
+
};
|
|
724
|
+
}
|
|
725
|
+
return config;
|
|
726
|
+
}, "getConfigEnv");
|
|
727
|
+
var getThemeColorConfigEnv = /* @__PURE__ */ __name((prefix, theme) => {
|
|
728
|
+
const themeName = `COLOR_${theme && theme !== "base" ? `${theme}_` : ""}`.toUpperCase();
|
|
729
|
+
return process.env[`${prefix}${themeName}LIGHT_BRAND`] || process.env[`${prefix}${themeName}DARK_BRAND`] ? getMultiThemeColorConfigEnv(prefix + themeName) : getSingleThemeColorConfigEnv(prefix + themeName);
|
|
730
|
+
}, "getThemeColorConfigEnv");
|
|
731
|
+
var getSingleThemeColorConfigEnv = /* @__PURE__ */ __name((prefix) => {
|
|
732
|
+
return {
|
|
733
|
+
dark: process.env[`${prefix}DARK`],
|
|
734
|
+
light: process.env[`${prefix}LIGHT`],
|
|
735
|
+
brand: process.env[`${prefix}BRAND`],
|
|
736
|
+
alternate: process.env[`${prefix}ALTERNATE`],
|
|
737
|
+
accent: process.env[`${prefix}ACCENT`],
|
|
738
|
+
link: process.env[`${prefix}LINK`],
|
|
739
|
+
help: process.env[`${prefix}HELP`],
|
|
740
|
+
success: process.env[`${prefix}SUCCESS`],
|
|
741
|
+
info: process.env[`${prefix}INFO`],
|
|
742
|
+
warning: process.env[`${prefix}WARNING`],
|
|
743
|
+
danger: process.env[`${prefix}DANGER`],
|
|
744
|
+
fatal: process.env[`${prefix}FATAL`],
|
|
745
|
+
positive: process.env[`${prefix}POSITIVE`],
|
|
746
|
+
negative: process.env[`${prefix}NEGATIVE`]
|
|
747
|
+
};
|
|
748
|
+
}, "getSingleThemeColorConfigEnv");
|
|
749
|
+
var getMultiThemeColorConfigEnv = /* @__PURE__ */ __name((prefix) => {
|
|
750
|
+
return {
|
|
751
|
+
light: getBaseThemeColorConfigEnv(`${prefix}_LIGHT_`),
|
|
752
|
+
dark: getBaseThemeColorConfigEnv(`${prefix}_DARK_`)
|
|
753
|
+
};
|
|
754
|
+
}, "getMultiThemeColorConfigEnv");
|
|
755
|
+
var getBaseThemeColorConfigEnv = /* @__PURE__ */ __name((prefix) => {
|
|
756
|
+
return {
|
|
757
|
+
foreground: process.env[`${prefix}FOREGROUND`],
|
|
758
|
+
background: process.env[`${prefix}BACKGROUND`],
|
|
759
|
+
brand: process.env[`${prefix}BRAND`],
|
|
760
|
+
alternate: process.env[`${prefix}ALTERNATE`],
|
|
761
|
+
accent: process.env[`${prefix}ACCENT`],
|
|
762
|
+
link: process.env[`${prefix}LINK`],
|
|
763
|
+
help: process.env[`${prefix}HELP`],
|
|
764
|
+
success: process.env[`${prefix}SUCCESS`],
|
|
765
|
+
info: process.env[`${prefix}INFO`],
|
|
766
|
+
warning: process.env[`${prefix}WARNING`],
|
|
767
|
+
danger: process.env[`${prefix}DANGER`],
|
|
768
|
+
fatal: process.env[`${prefix}FATAL`],
|
|
769
|
+
positive: process.env[`${prefix}POSITIVE`],
|
|
770
|
+
negative: process.env[`${prefix}NEGATIVE`]
|
|
771
|
+
};
|
|
772
|
+
}, "getBaseThemeColorConfigEnv");
|
|
773
|
+
|
|
774
|
+
// ../config-tools/src/env/set-env.ts
|
|
775
|
+
var setExtensionEnv = /* @__PURE__ */ __name((extensionName, extension) => {
|
|
776
|
+
for (const key of Object.keys(extension ?? {})) {
|
|
777
|
+
if (extension[key]) {
|
|
778
|
+
const result = key?.replace(/([A-Z])+/g, (input) => input ? input[0]?.toUpperCase() + input.slice(1) : "").split(/(?=[A-Z])|[.\-\s_]/).map((x) => x.toLowerCase()) ?? [];
|
|
779
|
+
let extensionKey;
|
|
780
|
+
if (result.length === 0) {
|
|
781
|
+
return;
|
|
782
|
+
}
|
|
783
|
+
if (result.length === 1) {
|
|
784
|
+
extensionKey = result[0]?.toUpperCase() ?? "";
|
|
785
|
+
} else {
|
|
786
|
+
extensionKey = result.reduce((ret, part) => {
|
|
787
|
+
return `${ret}_${part.toLowerCase()}`;
|
|
788
|
+
});
|
|
789
|
+
}
|
|
790
|
+
process.env[`STORM_EXTENSION_${extensionName.toUpperCase()}_${extensionKey.toUpperCase()}`] = extension[key];
|
|
791
|
+
}
|
|
792
|
+
}
|
|
793
|
+
}, "setExtensionEnv");
|
|
794
|
+
var setConfigEnv = /* @__PURE__ */ __name((config) => {
|
|
795
|
+
const prefix = "STORM_";
|
|
796
|
+
if (config.extends) {
|
|
797
|
+
process.env[`${prefix}EXTENDS`] = config.extends;
|
|
798
|
+
}
|
|
799
|
+
if (config.name) {
|
|
800
|
+
process.env[`${prefix}NAME`] = config.name;
|
|
801
|
+
}
|
|
802
|
+
if (config.namespace) {
|
|
803
|
+
process.env[`${prefix}NAMESPACE`] = config.namespace;
|
|
804
|
+
}
|
|
805
|
+
if (config.owner) {
|
|
806
|
+
process.env[`${prefix}OWNER`] = config.owner;
|
|
807
|
+
}
|
|
808
|
+
if (config.bot) {
|
|
809
|
+
process.env[`${prefix}BOT_NAME`] = config.bot.name;
|
|
810
|
+
process.env[`${prefix}BOT_EMAIL`] = config.bot.email;
|
|
811
|
+
}
|
|
812
|
+
if (config.organization) {
|
|
813
|
+
process.env[`${prefix}ORGANIZATION`] = config.organization;
|
|
814
|
+
}
|
|
815
|
+
if (config.packageManager) {
|
|
816
|
+
process.env[`${prefix}PACKAGE_MANAGER`] = config.packageManager;
|
|
817
|
+
}
|
|
818
|
+
if (config.license) {
|
|
819
|
+
process.env[`${prefix}LICENSE`] = config.license;
|
|
820
|
+
}
|
|
821
|
+
if (config.homepage) {
|
|
822
|
+
process.env[`${prefix}HOMEPAGE`] = config.homepage;
|
|
823
|
+
}
|
|
824
|
+
if (config.docs) {
|
|
825
|
+
process.env[`${prefix}DOCS`] = config.docs;
|
|
826
|
+
}
|
|
827
|
+
if (config.licensing) {
|
|
828
|
+
process.env[`${prefix}LICENSING`] = config.licensing;
|
|
829
|
+
}
|
|
830
|
+
if (config.timezone) {
|
|
831
|
+
process.env[`${prefix}TIMEZONE`] = config.timezone;
|
|
832
|
+
process.env.TZ = config.timezone;
|
|
833
|
+
process.env.DEFAULT_TIMEZONE = config.timezone;
|
|
834
|
+
}
|
|
835
|
+
if (config.locale) {
|
|
836
|
+
process.env[`${prefix}LOCALE`] = config.locale;
|
|
837
|
+
process.env.LOCALE = config.locale;
|
|
838
|
+
process.env.DEFAULT_LOCALE = config.locale;
|
|
839
|
+
process.env.LANG = config.locale ? `${config.locale.replaceAll("-", "_")}.UTF-8` : "en_US.UTF-8";
|
|
840
|
+
}
|
|
841
|
+
if (config.configFile) {
|
|
842
|
+
process.env[`${prefix}CONFIG_FILE`] = correctPaths(config.configFile);
|
|
843
|
+
}
|
|
844
|
+
if (config.workspaceRoot) {
|
|
845
|
+
process.env[`${prefix}WORKSPACE_ROOT`] = correctPaths(config.workspaceRoot);
|
|
846
|
+
process.env.NX_WORKSPACE_ROOT = correctPaths(config.workspaceRoot);
|
|
847
|
+
process.env.NX_WORKSPACE_ROOT_PATH = correctPaths(config.workspaceRoot);
|
|
848
|
+
}
|
|
849
|
+
if (config.directories) {
|
|
850
|
+
if (!config.skipCache && config.directories.cache) {
|
|
851
|
+
process.env[`${prefix}CACHE_DIR`] = correctPaths(config.directories.cache);
|
|
852
|
+
}
|
|
853
|
+
if (config.directories.data) {
|
|
854
|
+
process.env[`${prefix}DATA_DIR`] = correctPaths(config.directories.data);
|
|
855
|
+
}
|
|
856
|
+
if (config.directories.config) {
|
|
857
|
+
process.env[`${prefix}CONFIG_DIR`] = correctPaths(config.directories.config);
|
|
858
|
+
}
|
|
859
|
+
if (config.directories.temp) {
|
|
860
|
+
process.env[`${prefix}TEMP_DIR`] = correctPaths(config.directories.temp);
|
|
861
|
+
}
|
|
862
|
+
if (config.directories.log) {
|
|
863
|
+
process.env[`${prefix}LOG_DIR`] = correctPaths(config.directories.log);
|
|
864
|
+
}
|
|
865
|
+
if (config.directories.build) {
|
|
866
|
+
process.env[`${prefix}BUILD_DIR`] = correctPaths(config.directories.build);
|
|
867
|
+
}
|
|
868
|
+
}
|
|
869
|
+
if (config.skipCache !== void 0) {
|
|
870
|
+
process.env[`${prefix}SKIP_CACHE`] = String(config.skipCache);
|
|
871
|
+
if (config.skipCache) {
|
|
872
|
+
process.env.NX_SKIP_NX_CACHE ??= String(config.skipCache);
|
|
873
|
+
process.env.NX_CACHE_PROJECT_GRAPH ??= String(config.skipCache);
|
|
874
|
+
}
|
|
875
|
+
}
|
|
876
|
+
if (config.env) {
|
|
877
|
+
process.env[`${prefix}ENV`] = config.env;
|
|
878
|
+
process.env.NODE_ENV = config.env;
|
|
879
|
+
process.env.ENVIRONMENT = config.env;
|
|
880
|
+
}
|
|
881
|
+
if (config.colors?.base?.light || config.colors?.base?.dark) {
|
|
882
|
+
for (const key of Object.keys(config.colors)) {
|
|
883
|
+
setThemeColorConfigEnv(`${prefix}COLOR_${key}_`, config.colors[key]);
|
|
884
|
+
}
|
|
885
|
+
} else {
|
|
886
|
+
setThemeColorConfigEnv(`${prefix}COLOR_`, config.colors);
|
|
887
|
+
}
|
|
888
|
+
if (config.repository) {
|
|
889
|
+
process.env[`${prefix}REPOSITORY`] = config.repository;
|
|
890
|
+
}
|
|
891
|
+
if (config.branch) {
|
|
892
|
+
process.env[`${prefix}BRANCH`] = config.branch;
|
|
893
|
+
}
|
|
894
|
+
if (config.preid) {
|
|
895
|
+
process.env[`${prefix}PRE_ID`] = String(config.preid);
|
|
896
|
+
}
|
|
897
|
+
if (config.externalPackagePatterns) {
|
|
898
|
+
process.env[`${prefix}EXTERNAL_PACKAGE_PATTERNS`] = JSON.stringify(config.externalPackagePatterns);
|
|
899
|
+
}
|
|
900
|
+
if (config.registry) {
|
|
901
|
+
if (config.registry.github) {
|
|
902
|
+
process.env[`${prefix}REGISTRY_GITHUB`] = String(config.registry.github);
|
|
903
|
+
}
|
|
904
|
+
if (config.registry.npm) {
|
|
905
|
+
process.env[`${prefix}REGISTRY_NPM`] = String(config.registry.npm);
|
|
906
|
+
}
|
|
907
|
+
if (config.registry.cargo) {
|
|
908
|
+
process.env[`${prefix}REGISTRY_CARGO`] = String(config.registry.cargo);
|
|
909
|
+
}
|
|
910
|
+
if (config.registry.cyclone) {
|
|
911
|
+
process.env[`${prefix}REGISTRY_CYCLONE`] = String(config.registry.cyclone);
|
|
912
|
+
}
|
|
913
|
+
if (config.registry.container) {
|
|
914
|
+
process.env[`${prefix}REGISTRY_CONTAINER`] = String(config.registry.cyclone);
|
|
915
|
+
}
|
|
916
|
+
}
|
|
917
|
+
if (config.logLevel) {
|
|
918
|
+
process.env[`${prefix}LOG_LEVEL`] = String(config.logLevel);
|
|
919
|
+
process.env.LOG_LEVEL = String(config.logLevel);
|
|
920
|
+
process.env.NX_VERBOSE_LOGGING = String(getLogLevel(config.logLevel) >= LogLevel.DEBUG ? true : false);
|
|
921
|
+
process.env.RUST_BACKTRACE = getLogLevel(config.logLevel) >= LogLevel.DEBUG ? "full" : "none";
|
|
922
|
+
}
|
|
923
|
+
process.env[`${prefix}CONFIG`] = JSON.stringify(config);
|
|
924
|
+
for (const key of Object.keys(config.extensions ?? {})) {
|
|
925
|
+
config.extensions[key] && Object.keys(config.extensions[key]) && setExtensionEnv(key, config.extensions[key]);
|
|
926
|
+
}
|
|
927
|
+
}, "setConfigEnv");
|
|
928
|
+
var setThemeColorConfigEnv = /* @__PURE__ */ __name((prefix, config) => {
|
|
929
|
+
return config?.light?.brand || config?.dark?.brand ? setMultiThemeColorConfigEnv(prefix, config) : setSingleThemeColorConfigEnv(prefix, config);
|
|
930
|
+
}, "setThemeColorConfigEnv");
|
|
931
|
+
var setSingleThemeColorConfigEnv = /* @__PURE__ */ __name((prefix, config) => {
|
|
932
|
+
if (config.dark) {
|
|
933
|
+
process.env[`${prefix}DARK`] = config.dark;
|
|
934
|
+
}
|
|
935
|
+
if (config.light) {
|
|
936
|
+
process.env[`${prefix}LIGHT`] = config.light;
|
|
937
|
+
}
|
|
938
|
+
if (config.brand) {
|
|
939
|
+
process.env[`${prefix}BRAND`] = config.brand;
|
|
940
|
+
}
|
|
941
|
+
if (config.alternate) {
|
|
942
|
+
process.env[`${prefix}ALTERNATE`] = config.alternate;
|
|
943
|
+
}
|
|
944
|
+
if (config.accent) {
|
|
945
|
+
process.env[`${prefix}ACCENT`] = config.accent;
|
|
946
|
+
}
|
|
947
|
+
if (config.link) {
|
|
948
|
+
process.env[`${prefix}LINK`] = config.link;
|
|
949
|
+
}
|
|
950
|
+
if (config.help) {
|
|
951
|
+
process.env[`${prefix}HELP`] = config.help;
|
|
952
|
+
}
|
|
953
|
+
if (config.success) {
|
|
954
|
+
process.env[`${prefix}SUCCESS`] = config.success;
|
|
955
|
+
}
|
|
956
|
+
if (config.info) {
|
|
957
|
+
process.env[`${prefix}INFO`] = config.info;
|
|
958
|
+
}
|
|
959
|
+
if (config.warning) {
|
|
960
|
+
process.env[`${prefix}WARNING`] = config.warning;
|
|
961
|
+
}
|
|
962
|
+
if (config.danger) {
|
|
963
|
+
process.env[`${prefix}DANGER`] = config.danger;
|
|
964
|
+
}
|
|
965
|
+
if (config.fatal) {
|
|
966
|
+
process.env[`${prefix}FATAL`] = config.fatal;
|
|
967
|
+
}
|
|
968
|
+
if (config.positive) {
|
|
969
|
+
process.env[`${prefix}POSITIVE`] = config.positive;
|
|
970
|
+
}
|
|
971
|
+
if (config.negative) {
|
|
972
|
+
process.env[`${prefix}NEGATIVE`] = config.negative;
|
|
973
|
+
}
|
|
974
|
+
}, "setSingleThemeColorConfigEnv");
|
|
975
|
+
var setMultiThemeColorConfigEnv = /* @__PURE__ */ __name((prefix, config) => {
|
|
976
|
+
return {
|
|
977
|
+
light: setBaseThemeColorConfigEnv(`${prefix}LIGHT_`, config.light),
|
|
978
|
+
dark: setBaseThemeColorConfigEnv(`${prefix}DARK_`, config.dark)
|
|
979
|
+
};
|
|
980
|
+
}, "setMultiThemeColorConfigEnv");
|
|
981
|
+
var setBaseThemeColorConfigEnv = /* @__PURE__ */ __name((prefix, config) => {
|
|
982
|
+
if (config.foreground) {
|
|
983
|
+
process.env[`${prefix}FOREGROUND`] = config.foreground;
|
|
984
|
+
}
|
|
985
|
+
if (config.background) {
|
|
986
|
+
process.env[`${prefix}BACKGROUND`] = config.background;
|
|
987
|
+
}
|
|
988
|
+
if (config.brand) {
|
|
989
|
+
process.env[`${prefix}BRAND`] = config.brand;
|
|
990
|
+
}
|
|
991
|
+
if (config.alternate) {
|
|
992
|
+
process.env[`${prefix}ALTERNATE`] = config.alternate;
|
|
993
|
+
}
|
|
994
|
+
if (config.accent) {
|
|
995
|
+
process.env[`${prefix}ACCENT`] = config.accent;
|
|
996
|
+
}
|
|
997
|
+
if (config.link) {
|
|
998
|
+
process.env[`${prefix}LINK`] = config.link;
|
|
999
|
+
}
|
|
1000
|
+
if (config.help) {
|
|
1001
|
+
process.env[`${prefix}HELP`] = config.help;
|
|
1002
|
+
}
|
|
1003
|
+
if (config.success) {
|
|
1004
|
+
process.env[`${prefix}SUCCESS`] = config.success;
|
|
1005
|
+
}
|
|
1006
|
+
if (config.info) {
|
|
1007
|
+
process.env[`${prefix}INFO`] = config.info;
|
|
1008
|
+
}
|
|
1009
|
+
if (config.warning) {
|
|
1010
|
+
process.env[`${prefix}WARNING`] = config.warning;
|
|
1011
|
+
}
|
|
1012
|
+
if (config.danger) {
|
|
1013
|
+
process.env[`${prefix}DANGER`] = config.danger;
|
|
1014
|
+
}
|
|
1015
|
+
if (config.fatal) {
|
|
1016
|
+
process.env[`${prefix}FATAL`] = config.fatal;
|
|
1017
|
+
}
|
|
1018
|
+
if (config.positive) {
|
|
1019
|
+
process.env[`${prefix}POSITIVE`] = config.positive;
|
|
1020
|
+
}
|
|
1021
|
+
if (config.negative) {
|
|
1022
|
+
process.env[`${prefix}NEGATIVE`] = config.negative;
|
|
1023
|
+
}
|
|
1024
|
+
}, "setBaseThemeColorConfigEnv");
|
|
1025
|
+
|
|
1026
|
+
// ../config-tools/src/create-storm-config.ts
|
|
1027
|
+
var _static_cache = void 0;
|
|
1028
|
+
var loadStormConfig = /* @__PURE__ */ __name(async (workspaceRoot) => {
|
|
1029
|
+
let config = {};
|
|
1030
|
+
if (_static_cache?.data && _static_cache?.timestamp && _static_cache.timestamp >= Date.now() + 3e4) {
|
|
1031
|
+
writeTrace(`Configuration cache hit - ${_static_cache.timestamp}`, _static_cache.data);
|
|
1032
|
+
return _static_cache.data;
|
|
1033
|
+
}
|
|
1034
|
+
let _workspaceRoot = workspaceRoot;
|
|
1035
|
+
if (!_workspaceRoot) {
|
|
1036
|
+
_workspaceRoot = findWorkspaceRoot();
|
|
1037
|
+
}
|
|
1038
|
+
const configFile = await getConfigFile(_workspaceRoot);
|
|
1039
|
+
if (!configFile) {
|
|
1040
|
+
writeWarning("No Storm config file found in the current workspace. Please ensure this is the expected behavior - you can add a `storm.json` file to the root of your workspace if it is not.\n", {
|
|
1041
|
+
logLevel: "all"
|
|
1042
|
+
});
|
|
1043
|
+
}
|
|
1044
|
+
config = defu2(getConfigEnv(), configFile, getDefaultConfig(_workspaceRoot));
|
|
1045
|
+
setConfigEnv(config);
|
|
1046
|
+
writeTrace(`\u2699\uFE0F Using Storm configuration:
|
|
1047
|
+
${formatLogMessage(config)}`, config);
|
|
1048
|
+
return config;
|
|
1049
|
+
}, "loadStormConfig");
|
|
1050
|
+
|
|
1051
|
+
export {
|
|
1052
|
+
findWorkspaceRoot,
|
|
1053
|
+
writeFatal,
|
|
1054
|
+
writeError,
|
|
1055
|
+
writeWarning,
|
|
1056
|
+
writeInfo,
|
|
1057
|
+
writeSuccess,
|
|
1058
|
+
writeDebug,
|
|
1059
|
+
writeTrace,
|
|
1060
|
+
getStopwatch,
|
|
1061
|
+
formatLogMessage,
|
|
1062
|
+
loadStormConfig
|
|
1063
|
+
};
|