@storm-software/git-tools 2.113.24 → 2.113.30
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/{chunk-3MTHCLGM.cjs → chunk-EBHPAULB.cjs} +907 -822
- package/bin/{chunk-7FHPOB4N.js → chunk-W7SSBH3S.js} +907 -822
- package/bin/git.cjs +65 -65
- package/bin/git.js +1 -1
- package/bin/post-checkout.cjs +9 -9
- package/bin/post-checkout.js +1 -1
- package/bin/post-commit.cjs +9 -9
- package/bin/post-commit.js +1 -1
- package/bin/post-merge.cjs +9 -9
- package/bin/post-merge.js +1 -1
- package/bin/pre-commit.cjs +9 -9
- package/bin/pre-commit.js +1 -1
- package/bin/pre-install.cjs +9 -9
- package/bin/pre-install.js +1 -1
- package/bin/pre-push.cjs +13 -13
- package/bin/pre-push.js +1 -1
- package/bin/prepare.cjs +7 -7
- package/bin/prepare.js +1 -1
- package/bin/version-warning.cjs +5 -5
- package/bin/version-warning.js +1 -1
- package/package.json +4 -4
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
var chalk = require('chalk');
|
|
3
4
|
var z = require('zod');
|
|
5
|
+
var c12 = require('c12');
|
|
4
6
|
var fs = require('fs');
|
|
5
|
-
var promises = require('fs/promises');
|
|
6
7
|
var path = require('path');
|
|
7
|
-
var
|
|
8
|
-
var c12 = require('c12');
|
|
8
|
+
var promises = require('fs/promises');
|
|
9
9
|
|
|
10
10
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
11
|
|
|
@@ -27,8 +27,8 @@ function _interopNamespace(e) {
|
|
|
27
27
|
return Object.freeze(n);
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
var z__namespace = /*#__PURE__*/_interopNamespace(z);
|
|
31
30
|
var chalk__default = /*#__PURE__*/_interopDefault(chalk);
|
|
31
|
+
var z__namespace = /*#__PURE__*/_interopNamespace(z);
|
|
32
32
|
|
|
33
33
|
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
34
34
|
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
@@ -61,877 +61,923 @@ var LogLevelLabel = {
|
|
|
61
61
|
ALL: "all"
|
|
62
62
|
};
|
|
63
63
|
|
|
64
|
-
// ../config/src/
|
|
65
|
-
var
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
var
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
negative: NegativeColorSchema
|
|
105
|
-
});
|
|
106
|
-
var LightThemeColorConfigSchema = z__namespace.object({
|
|
107
|
-
foreground: DarkColorSchema,
|
|
108
|
-
background: LightColorSchema,
|
|
109
|
-
brand: BrandColorSchema,
|
|
110
|
-
alternate: AlternateColorSchema,
|
|
111
|
-
accent: AccentColorSchema,
|
|
112
|
-
link: LinkColorSchema,
|
|
113
|
-
help: HelpColorSchema,
|
|
114
|
-
success: SuccessColorSchema,
|
|
115
|
-
info: InfoColorSchema,
|
|
116
|
-
warning: WarningColorSchema,
|
|
117
|
-
danger: DangerColorSchema,
|
|
118
|
-
fatal: FatalColorSchema,
|
|
119
|
-
positive: PositiveColorSchema,
|
|
120
|
-
negative: NegativeColorSchema
|
|
121
|
-
});
|
|
122
|
-
var MultiThemeColorConfigSchema = z__namespace.object({
|
|
123
|
-
dark: DarkThemeColorConfigSchema,
|
|
124
|
-
light: LightThemeColorConfigSchema
|
|
125
|
-
});
|
|
126
|
-
var SingleThemeColorConfigSchema = z__namespace.object({
|
|
127
|
-
dark: DarkColorSchema,
|
|
128
|
-
light: LightColorSchema,
|
|
129
|
-
brand: BrandColorSchema,
|
|
130
|
-
alternate: AlternateColorSchema,
|
|
131
|
-
accent: AccentColorSchema,
|
|
132
|
-
link: LinkColorSchema,
|
|
133
|
-
help: HelpColorSchema,
|
|
134
|
-
success: SuccessColorSchema,
|
|
135
|
-
info: InfoColorSchema,
|
|
136
|
-
warning: WarningColorSchema,
|
|
137
|
-
danger: DangerColorSchema,
|
|
138
|
-
fatal: FatalColorSchema,
|
|
139
|
-
positive: PositiveColorSchema,
|
|
140
|
-
negative: NegativeColorSchema
|
|
141
|
-
});
|
|
142
|
-
var RegistryUrlConfigSchema = z__namespace.url().optional().describe("A remote registry URL used to publish distributable packages");
|
|
143
|
-
var RegistryConfigSchema = z__namespace.object({
|
|
144
|
-
github: RegistryUrlConfigSchema,
|
|
145
|
-
npm: RegistryUrlConfigSchema,
|
|
146
|
-
cargo: RegistryUrlConfigSchema,
|
|
147
|
-
cyclone: RegistryUrlConfigSchema,
|
|
148
|
-
container: RegistryUrlConfigSchema
|
|
149
|
-
}).default({}).describe("A list of remote registry URLs used by Storm Software");
|
|
150
|
-
var ColorConfigSchema = SingleThemeColorConfigSchema.or(
|
|
151
|
-
MultiThemeColorConfigSchema
|
|
152
|
-
).describe("Colors used for various workspace elements");
|
|
153
|
-
var ColorConfigMapSchema = z__namespace.record(
|
|
154
|
-
z__namespace.union([z__namespace.literal("base"), z__namespace.string()]),
|
|
155
|
-
ColorConfigSchema
|
|
156
|
-
);
|
|
157
|
-
var ExtendsItemSchema = z__namespace.string().trim().describe(
|
|
158
|
-
"The path to a base config file to use as a configuration preset file. Documentation can be found at https://github.com/unjs/c12#extending-configuration."
|
|
159
|
-
);
|
|
160
|
-
var ExtendsSchema = ExtendsItemSchema.or(
|
|
161
|
-
z__namespace.array(ExtendsItemSchema)
|
|
162
|
-
).describe(
|
|
163
|
-
"The path to a base config file to use as a configuration preset file. Documentation can be found at https://github.com/unjs/c12#extending-configuration."
|
|
164
|
-
);
|
|
165
|
-
var WorkspaceBotConfigSchema = z__namespace.object({
|
|
166
|
-
name: z__namespace.string().trim().default("stormie-bot").describe(
|
|
167
|
-
"The workspace bot user's name (this is the bot that will be used to perform various tasks)"
|
|
168
|
-
),
|
|
169
|
-
email: z__namespace.email().default("bot@stormsoftware.com").describe("The email of the workspace bot")
|
|
170
|
-
}).describe(
|
|
171
|
-
"The workspace's bot user's config used to automated various operations tasks"
|
|
172
|
-
);
|
|
173
|
-
var WorkspaceReleaseConfigSchema = z__namespace.object({
|
|
174
|
-
banner: z__namespace.string().trim().optional().describe(
|
|
175
|
-
"A URL to a banner image used to display the workspace's release"
|
|
176
|
-
),
|
|
177
|
-
header: z__namespace.string().trim().optional().describe(
|
|
178
|
-
"A header message appended to the start of the workspace's release notes"
|
|
179
|
-
),
|
|
180
|
-
footer: z__namespace.string().trim().optional().describe(
|
|
181
|
-
"A footer message appended to the end of the workspace's release notes"
|
|
182
|
-
)
|
|
183
|
-
}).describe("The workspace's release config used during the release process");
|
|
184
|
-
var WorkspaceSocialsConfigSchema = z__namespace.object({
|
|
185
|
-
twitter: z__namespace.string().trim().default(STORM_DEFAULT_SOCIAL_TWITTER).describe("A Twitter/X account associated with the organization/project"),
|
|
186
|
-
discord: z__namespace.string().trim().default(STORM_DEFAULT_SOCIAL_DISCORD).describe("A Discord account associated with the organization/project"),
|
|
187
|
-
telegram: z__namespace.string().trim().default(STORM_DEFAULT_SOCIAL_TELEGRAM).describe("A Telegram account associated with the organization/project"),
|
|
188
|
-
slack: z__namespace.string().trim().default(STORM_DEFAULT_SOCIAL_SLACK).describe("A Slack account associated with the organization/project"),
|
|
189
|
-
medium: z__namespace.string().trim().default(STORM_DEFAULT_SOCIAL_MEDIUM).describe("A Medium account associated with the organization/project"),
|
|
190
|
-
github: z__namespace.string().trim().default(STORM_DEFAULT_SOCIAL_GITHUB).describe("A GitHub account associated with the organization/project")
|
|
191
|
-
}).describe(
|
|
192
|
-
"The workspace's account config used to store various social media links"
|
|
193
|
-
);
|
|
194
|
-
var WorkspaceDirectoryConfigSchema = z__namespace.object({
|
|
195
|
-
cache: z__namespace.string().trim().optional().describe(
|
|
196
|
-
"The directory used to store the environment's cached file data"
|
|
197
|
-
),
|
|
198
|
-
data: z__namespace.string().trim().optional().describe("The directory used to store the environment's data files"),
|
|
199
|
-
config: z__namespace.string().trim().optional().describe(
|
|
200
|
-
"The directory used to store the environment's configuration files"
|
|
201
|
-
),
|
|
202
|
-
temp: z__namespace.string().trim().optional().describe("The directory used to store the environment's temp files"),
|
|
203
|
-
log: z__namespace.string().trim().optional().describe("The directory used to store the environment's temp files"),
|
|
204
|
-
build: z__namespace.string().trim().default("dist").describe(
|
|
205
|
-
"The directory used to store the workspace's distributable files after a build (relative to the workspace root)"
|
|
206
|
-
)
|
|
207
|
-
}).describe(
|
|
208
|
-
"Various directories used by the workspace to store data, cache, and configuration files"
|
|
209
|
-
);
|
|
210
|
-
var errorConfigSchema = z__namespace.object({
|
|
211
|
-
codesFile: z__namespace.string().trim().default(STORM_DEFAULT_ERROR_CODES_FILE).describe("The path to the workspace's error codes JSON file"),
|
|
212
|
-
url: z__namespace.url().optional().describe(
|
|
213
|
-
"A URL to a page that looks up the workspace's error messages given a specific error code"
|
|
214
|
-
)
|
|
215
|
-
}).describe("The workspace's error config used during the error process");
|
|
216
|
-
var organizationConfigSchema = z__namespace.object({
|
|
217
|
-
name: z__namespace.string().trim().describe("The name of the organization"),
|
|
218
|
-
description: z__namespace.string().trim().optional().describe("A description of the organization"),
|
|
219
|
-
logo: z__namespace.url().optional().describe("A URL to the organization's logo image"),
|
|
220
|
-
icon: z__namespace.url().optional().describe("A URL to the organization's icon image"),
|
|
221
|
-
url: z__namespace.url().optional().describe(
|
|
222
|
-
"A URL to a page that provides more information about the organization"
|
|
223
|
-
)
|
|
224
|
-
}).describe("The workspace's organization details");
|
|
225
|
-
var stormWorkspaceConfigSchema = z__namespace.object({
|
|
226
|
-
$schema: z__namespace.string().trim().default(
|
|
227
|
-
"https://public.storm-cdn.com/schemas/storm-workspace.schema.json"
|
|
228
|
-
).describe(
|
|
229
|
-
"The URL or file path to the JSON schema file that describes the Storm configuration file"
|
|
230
|
-
),
|
|
231
|
-
extends: ExtendsSchema.optional(),
|
|
232
|
-
name: z__namespace.string().trim().toLowerCase().optional().describe(
|
|
233
|
-
"The name of the service/package/scope using this configuration"
|
|
234
|
-
),
|
|
235
|
-
namespace: z__namespace.string().trim().toLowerCase().optional().describe("The namespace of the package"),
|
|
236
|
-
organization: organizationConfigSchema.or(z__namespace.string().trim().describe("The organization of the workspace")).optional().describe(
|
|
237
|
-
"The organization of the workspace. This can be a string or an object containing the organization's details"
|
|
238
|
-
),
|
|
239
|
-
repository: z__namespace.string().trim().optional().describe("The repo URL of the workspace (i.e. GitHub)"),
|
|
240
|
-
license: z__namespace.string().trim().default("Apache-2.0").describe("The license type of the package"),
|
|
241
|
-
homepage: z__namespace.url().optional().describe("The homepage of the workspace"),
|
|
242
|
-
docs: z__namespace.url().optional().describe("The documentation site for the workspace"),
|
|
243
|
-
portal: z__namespace.url().optional().describe("The development portal site for the workspace"),
|
|
244
|
-
licensing: z__namespace.url().optional().describe("The licensing site for the workspace"),
|
|
245
|
-
contact: z__namespace.url().optional().describe("The contact site for the workspace"),
|
|
246
|
-
support: z__namespace.url().optional().describe(
|
|
247
|
-
"The support site for the workspace. If not provided, this is defaulted to the `contact` config value"
|
|
248
|
-
),
|
|
249
|
-
branch: z__namespace.string().trim().default("main").describe("The branch of the workspace"),
|
|
250
|
-
preid: z__namespace.string().optional().describe("A tag specifying the version pre-release identifier"),
|
|
251
|
-
owner: z__namespace.string().trim().default("@storm-software/admin").describe("The owner of the package"),
|
|
252
|
-
bot: WorkspaceBotConfigSchema,
|
|
253
|
-
release: WorkspaceReleaseConfigSchema,
|
|
254
|
-
socials: WorkspaceSocialsConfigSchema,
|
|
255
|
-
error: errorConfigSchema,
|
|
256
|
-
mode: z__namespace.string().trim().default("production").describe("The current runtime environment mode for the package"),
|
|
257
|
-
workspaceRoot: z__namespace.string().trim().describe("The root directory of the workspace"),
|
|
258
|
-
skipCache: z__namespace.boolean().default(false).describe("Should all known types of workspace caching be skipped?"),
|
|
259
|
-
directories: WorkspaceDirectoryConfigSchema,
|
|
260
|
-
packageManager: z__namespace.enum(["npm", "yarn", "pnpm", "bun"]).default("npm").describe(
|
|
261
|
-
"The JavaScript/TypeScript package manager used by the repository"
|
|
262
|
-
),
|
|
263
|
-
timezone: z__namespace.string().trim().default("America/New_York").describe("The default timezone of the workspace"),
|
|
264
|
-
locale: z__namespace.string().trim().default("en-US").describe("The default locale of the workspace"),
|
|
265
|
-
logLevel: z__namespace.enum([
|
|
266
|
-
"silent",
|
|
267
|
-
"fatal",
|
|
268
|
-
"error",
|
|
269
|
-
"warn",
|
|
270
|
-
"success",
|
|
271
|
-
"info",
|
|
272
|
-
"debug",
|
|
273
|
-
"trace",
|
|
274
|
-
"all"
|
|
275
|
-
]).default("info").describe(
|
|
276
|
-
"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`)."
|
|
277
|
-
),
|
|
278
|
-
skipConfigLogging: z__namespace.boolean().optional().describe(
|
|
279
|
-
"Should the logging of the current Storm Workspace configuration be skipped?"
|
|
280
|
-
),
|
|
281
|
-
registry: RegistryConfigSchema,
|
|
282
|
-
configFile: z__namespace.string().trim().nullable().default(null).describe(
|
|
283
|
-
"The filepath of the Storm config. When this field is null, no config file was found in the current workspace."
|
|
284
|
-
),
|
|
285
|
-
colors: ColorConfigSchema.or(ColorConfigMapSchema).describe(
|
|
286
|
-
"Storm theme config values used for styling various package elements"
|
|
287
|
-
),
|
|
288
|
-
extensions: z__namespace.record(z__namespace.string(), z__namespace.any()).optional().default({}).describe("Configuration of each used extension")
|
|
289
|
-
}).describe(
|
|
290
|
-
"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."
|
|
291
|
-
);
|
|
64
|
+
// ../config-tools/src/utilities/colors.ts
|
|
65
|
+
var DEFAULT_COLOR_CONFIG = {
|
|
66
|
+
dark: {
|
|
67
|
+
brand: "#2dd4bf",
|
|
68
|
+
success: "#10b981",
|
|
69
|
+
info: "#58a6ff",
|
|
70
|
+
warning: "#f3d371",
|
|
71
|
+
danger: "#D8314A",
|
|
72
|
+
fatal: "#a40e26"}
|
|
73
|
+
};
|
|
74
|
+
var chalkDefault = {
|
|
75
|
+
hex: (_) => (message) => message,
|
|
76
|
+
bgHex: (_) => ({
|
|
77
|
+
whiteBright: (message) => message,
|
|
78
|
+
white: (message) => message
|
|
79
|
+
}),
|
|
80
|
+
white: (message) => message,
|
|
81
|
+
whiteBright: (message) => message,
|
|
82
|
+
gray: (message) => message,
|
|
83
|
+
bold: {
|
|
84
|
+
hex: (_) => (message) => message,
|
|
85
|
+
bgHex: (_) => ({
|
|
86
|
+
whiteBright: (message) => message,
|
|
87
|
+
white: (message) => message
|
|
88
|
+
}),
|
|
89
|
+
whiteBright: (message) => message,
|
|
90
|
+
white: (message) => message
|
|
91
|
+
},
|
|
92
|
+
dim: {
|
|
93
|
+
hex: (_) => (message) => message,
|
|
94
|
+
gray: (message) => message
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
var getChalk = () => {
|
|
98
|
+
let _chalk = chalk__default.default;
|
|
99
|
+
if (!_chalk?.hex || !_chalk?.bold?.hex || !_chalk?.bgHex || !_chalk?.whiteBright || !_chalk?.white) {
|
|
100
|
+
_chalk = chalkDefault;
|
|
101
|
+
}
|
|
102
|
+
return _chalk;
|
|
103
|
+
};
|
|
292
104
|
|
|
293
|
-
// ../config/src/
|
|
294
|
-
|
|
295
|
-
"
|
|
296
|
-
|
|
297
|
-
"base",
|
|
298
|
-
"brand",
|
|
299
|
-
"alternate",
|
|
300
|
-
"accent",
|
|
301
|
-
"link",
|
|
302
|
-
"success",
|
|
303
|
-
"help",
|
|
304
|
-
"info",
|
|
305
|
-
"warning",
|
|
306
|
-
"danger",
|
|
307
|
-
"fatal",
|
|
308
|
-
"positive",
|
|
309
|
-
"negative"
|
|
310
|
-
];
|
|
311
|
-
|
|
312
|
-
// ../config-tools/src/utilities/correct-paths.ts
|
|
313
|
-
var _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
|
|
314
|
-
function normalizeWindowsPath(input = "") {
|
|
315
|
-
if (!input) {
|
|
316
|
-
return input;
|
|
105
|
+
// ../config-tools/src/logger/is-unicode-supported.ts
|
|
106
|
+
function isUnicodeSupported() {
|
|
107
|
+
if (process.platform !== "win32") {
|
|
108
|
+
return process.env.TERM !== "linux";
|
|
317
109
|
}
|
|
318
|
-
return
|
|
110
|
+
return Boolean(process.env.WT_SESSION) || // Windows Terminal
|
|
111
|
+
Boolean(process.env.TERMINUS_SUBLIME) || // Terminus (<0.2.27)
|
|
112
|
+
process.env.ConEmuTask === "{cmd::Cmder}" || // ConEmu and cmder
|
|
113
|
+
process.env.TERM_PROGRAM === "Terminus-Sublime" || process.env.TERM_PROGRAM === "vscode" || process.env.TERM === "xterm-256color" || process.env.TERM === "alacritty" || process.env.TERM === "rxvt-unicode" || process.env.TERM === "rxvt-unicode-256color" || process.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
|
|
319
114
|
}
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
var
|
|
323
|
-
var
|
|
324
|
-
|
|
325
|
-
|
|
115
|
+
|
|
116
|
+
// ../config-tools/src/logger/console-icons.ts
|
|
117
|
+
var useIcon = (c, fallback) => isUnicodeSupported() ? c : fallback;
|
|
118
|
+
var CONSOLE_ICONS = {
|
|
119
|
+
[LogLevelLabel.ERROR]: useIcon("\u2718", "\xD7"),
|
|
120
|
+
[LogLevelLabel.FATAL]: useIcon("\u{1F480}", "\xD7"),
|
|
121
|
+
[LogLevelLabel.WARN]: useIcon("\u26A0", "\u203C"),
|
|
122
|
+
[LogLevelLabel.INFO]: useIcon("\u2139", "i"),
|
|
123
|
+
[LogLevelLabel.SUCCESS]: useIcon("\u2714", "\u221A"),
|
|
124
|
+
[LogLevelLabel.DEBUG]: useIcon("\u{1F6E0}", "D"),
|
|
125
|
+
[LogLevelLabel.TRACE]: useIcon("\u{1F6E0}", "T"),
|
|
126
|
+
[LogLevelLabel.ALL]: useIcon("\u2709", "\u2192")
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
// ../config-tools/src/logger/format-timestamp.ts
|
|
130
|
+
var formatTimestamp = (date = /* @__PURE__ */ new Date()) => {
|
|
131
|
+
return `${date.toLocaleDateString()} ${date.toLocaleTimeString()}`;
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
// ../config-tools/src/logger/get-log-level.ts
|
|
135
|
+
var getLogLevel = (label) => {
|
|
136
|
+
switch (label) {
|
|
137
|
+
case "all":
|
|
138
|
+
return LogLevel.ALL;
|
|
139
|
+
case "trace":
|
|
140
|
+
return LogLevel.TRACE;
|
|
141
|
+
case "debug":
|
|
142
|
+
return LogLevel.DEBUG;
|
|
143
|
+
case "info":
|
|
144
|
+
return LogLevel.INFO;
|
|
145
|
+
case "warn":
|
|
146
|
+
return LogLevel.WARN;
|
|
147
|
+
case "error":
|
|
148
|
+
return LogLevel.ERROR;
|
|
149
|
+
case "fatal":
|
|
150
|
+
return LogLevel.FATAL;
|
|
151
|
+
case "silent":
|
|
152
|
+
return LogLevel.SILENT;
|
|
153
|
+
default:
|
|
154
|
+
return LogLevel.INFO;
|
|
326
155
|
}
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
path = normalizeString(path, !isPathAbsolute);
|
|
332
|
-
if (path.length === 0) {
|
|
333
|
-
if (isPathAbsolute) {
|
|
334
|
-
return "/";
|
|
335
|
-
}
|
|
336
|
-
return trailingSeparator ? "./" : ".";
|
|
156
|
+
};
|
|
157
|
+
var getLogLevelLabel = (logLevel = LogLevel.INFO) => {
|
|
158
|
+
if (logLevel >= LogLevel.ALL) {
|
|
159
|
+
return LogLevelLabel.ALL;
|
|
337
160
|
}
|
|
338
|
-
if (
|
|
339
|
-
|
|
161
|
+
if (logLevel >= LogLevel.TRACE) {
|
|
162
|
+
return LogLevelLabel.TRACE;
|
|
340
163
|
}
|
|
341
|
-
if (
|
|
342
|
-
|
|
164
|
+
if (logLevel >= LogLevel.DEBUG) {
|
|
165
|
+
return LogLevelLabel.DEBUG;
|
|
343
166
|
}
|
|
344
|
-
if (
|
|
345
|
-
|
|
346
|
-
return `//./${path}`;
|
|
347
|
-
}
|
|
348
|
-
return `//${path}`;
|
|
167
|
+
if (logLevel >= LogLevel.INFO) {
|
|
168
|
+
return LogLevelLabel.INFO;
|
|
349
169
|
}
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
var joinPaths = function(...segments) {
|
|
353
|
-
let path = "";
|
|
354
|
-
for (const seg of segments) {
|
|
355
|
-
if (!seg) {
|
|
356
|
-
continue;
|
|
357
|
-
}
|
|
358
|
-
if (path.length > 0) {
|
|
359
|
-
const pathTrailing = path[path.length - 1] === "/";
|
|
360
|
-
const segLeading = seg[0] === "/";
|
|
361
|
-
const both = pathTrailing && segLeading;
|
|
362
|
-
if (both) {
|
|
363
|
-
path += seg.slice(1);
|
|
364
|
-
} else {
|
|
365
|
-
path += pathTrailing || segLeading ? seg : `/${seg}`;
|
|
366
|
-
}
|
|
367
|
-
} else {
|
|
368
|
-
path += seg;
|
|
369
|
-
}
|
|
170
|
+
if (logLevel >= LogLevel.WARN) {
|
|
171
|
+
return LogLevelLabel.WARN;
|
|
370
172
|
}
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
function normalizeString(path, allowAboveRoot) {
|
|
374
|
-
let res = "";
|
|
375
|
-
let lastSegmentLength = 0;
|
|
376
|
-
let lastSlash = -1;
|
|
377
|
-
let dots = 0;
|
|
378
|
-
let char = null;
|
|
379
|
-
for (let index = 0; index <= path.length; ++index) {
|
|
380
|
-
if (index < path.length) {
|
|
381
|
-
char = path[index];
|
|
382
|
-
} else if (char === "/") {
|
|
383
|
-
break;
|
|
384
|
-
} else {
|
|
385
|
-
char = "/";
|
|
386
|
-
}
|
|
387
|
-
if (char === "/") {
|
|
388
|
-
if (lastSlash === index - 1 || dots === 1) ; else if (dots === 2) {
|
|
389
|
-
if (res.length < 2 || lastSegmentLength !== 2 || res[res.length - 1] !== "." || res[res.length - 2] !== ".") {
|
|
390
|
-
if (res.length > 2) {
|
|
391
|
-
const lastSlashIndex = res.lastIndexOf("/");
|
|
392
|
-
if (lastSlashIndex === -1) {
|
|
393
|
-
res = "";
|
|
394
|
-
lastSegmentLength = 0;
|
|
395
|
-
} else {
|
|
396
|
-
res = res.slice(0, lastSlashIndex);
|
|
397
|
-
lastSegmentLength = res.length - 1 - res.lastIndexOf("/");
|
|
398
|
-
}
|
|
399
|
-
lastSlash = index;
|
|
400
|
-
dots = 0;
|
|
401
|
-
continue;
|
|
402
|
-
} else if (res.length > 0) {
|
|
403
|
-
res = "";
|
|
404
|
-
lastSegmentLength = 0;
|
|
405
|
-
lastSlash = index;
|
|
406
|
-
dots = 0;
|
|
407
|
-
continue;
|
|
408
|
-
}
|
|
409
|
-
}
|
|
410
|
-
if (allowAboveRoot) {
|
|
411
|
-
res += res.length > 0 ? "/.." : "..";
|
|
412
|
-
lastSegmentLength = 2;
|
|
413
|
-
}
|
|
414
|
-
} else {
|
|
415
|
-
if (res.length > 0) {
|
|
416
|
-
res += `/${path.slice(lastSlash + 1, index)}`;
|
|
417
|
-
} else {
|
|
418
|
-
res = path.slice(lastSlash + 1, index);
|
|
419
|
-
}
|
|
420
|
-
lastSegmentLength = index - lastSlash - 1;
|
|
421
|
-
}
|
|
422
|
-
lastSlash = index;
|
|
423
|
-
dots = 0;
|
|
424
|
-
} else if (char === "." && dots !== -1) {
|
|
425
|
-
++dots;
|
|
426
|
-
} else {
|
|
427
|
-
dots = -1;
|
|
428
|
-
}
|
|
173
|
+
if (logLevel >= LogLevel.ERROR) {
|
|
174
|
+
return LogLevelLabel.ERROR;
|
|
429
175
|
}
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
176
|
+
if (logLevel >= LogLevel.FATAL) {
|
|
177
|
+
return LogLevelLabel.FATAL;
|
|
178
|
+
}
|
|
179
|
+
if (logLevel <= LogLevel.SILENT) {
|
|
180
|
+
return LogLevelLabel.SILENT;
|
|
181
|
+
}
|
|
182
|
+
return LogLevelLabel.INFO;
|
|
434
183
|
};
|
|
435
|
-
var
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
184
|
+
var isVerbose = (label = LogLevelLabel.SILENT) => {
|
|
185
|
+
const logLevel = typeof label === "string" ? getLogLevel(label) : label;
|
|
186
|
+
return logLevel >= LogLevel.DEBUG;
|
|
187
|
+
};
|
|
188
|
+
|
|
189
|
+
// ../config-tools/src/logger/console.ts
|
|
190
|
+
var getLogFn = (logLevel = LogLevel.INFO, config = {}, _chalk = getChalk()) => {
|
|
191
|
+
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;
|
|
192
|
+
const configLogLevel = config.logLevel || process.env.STORM_LOG_LEVEL || LogLevelLabel.INFO;
|
|
193
|
+
if (logLevel > getLogLevel(configLogLevel) || logLevel <= LogLevel.SILENT || getLogLevel(configLogLevel) <= LogLevel.SILENT) {
|
|
194
|
+
return (_) => {
|
|
195
|
+
};
|
|
443
196
|
}
|
|
444
|
-
if (
|
|
445
|
-
(
|
|
446
|
-
|
|
447
|
-
|
|
197
|
+
if (typeof logLevel === "number" && LogLevel.FATAL >= logLevel) {
|
|
198
|
+
return (message) => {
|
|
199
|
+
console.error(
|
|
200
|
+
`
|
|
201
|
+
${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.fatal ?? DEFAULT_COLOR_CONFIG.dark.fatal)(`[${CONSOLE_ICONS[LogLevelLabel.FATAL]} Fatal] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
202
|
+
`
|
|
203
|
+
);
|
|
204
|
+
};
|
|
448
205
|
}
|
|
449
|
-
if (
|
|
450
|
-
|
|
451
|
-
|
|
206
|
+
if (typeof logLevel === "number" && LogLevel.ERROR >= logLevel) {
|
|
207
|
+
return (message) => {
|
|
208
|
+
console.error(
|
|
209
|
+
`
|
|
210
|
+
${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.danger ?? DEFAULT_COLOR_CONFIG.dark.danger)(`[${CONSOLE_ICONS[LogLevelLabel.ERROR]} Error] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
211
|
+
`
|
|
212
|
+
);
|
|
213
|
+
};
|
|
452
214
|
}
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
"storm-workspace.js",
|
|
462
|
-
"storm-workspace.ts",
|
|
463
|
-
".storm-workspace.json",
|
|
464
|
-
".storm-workspace.yaml",
|
|
465
|
-
".storm-workspace.yml",
|
|
466
|
-
".storm-workspace.js",
|
|
467
|
-
".storm-workspace.ts",
|
|
468
|
-
"lerna.json",
|
|
469
|
-
"nx.json",
|
|
470
|
-
"turbo.json",
|
|
471
|
-
"npm-workspace.json",
|
|
472
|
-
"yarn-workspace.json",
|
|
473
|
-
"pnpm-workspace.json",
|
|
474
|
-
"npm-workspace.yaml",
|
|
475
|
-
"yarn-workspace.yaml",
|
|
476
|
-
"pnpm-workspace.yaml",
|
|
477
|
-
"npm-workspace.yml",
|
|
478
|
-
"yarn-workspace.yml",
|
|
479
|
-
"pnpm-workspace.yml",
|
|
480
|
-
"npm-lock.json",
|
|
481
|
-
"yarn-lock.json",
|
|
482
|
-
"pnpm-lock.json",
|
|
483
|
-
"npm-lock.yaml",
|
|
484
|
-
"yarn-lock.yaml",
|
|
485
|
-
"pnpm-lock.yaml",
|
|
486
|
-
"npm-lock.yml",
|
|
487
|
-
"yarn-lock.yml",
|
|
488
|
-
"pnpm-lock.yml",
|
|
489
|
-
"bun.lockb"
|
|
490
|
-
];
|
|
491
|
-
var rootDirectories = [
|
|
492
|
-
".storm-workspace",
|
|
493
|
-
".nx",
|
|
494
|
-
".github",
|
|
495
|
-
".vscode",
|
|
496
|
-
".verdaccio"
|
|
497
|
-
];
|
|
498
|
-
function findWorkspaceRootSafe(pathInsideMonorepo) {
|
|
499
|
-
if (process.env.STORM_WORKSPACE_ROOT || process.env.NX_WORKSPACE_ROOT_PATH) {
|
|
500
|
-
return correctPaths(
|
|
501
|
-
process.env.STORM_WORKSPACE_ROOT ?? process.env.NX_WORKSPACE_ROOT_PATH
|
|
502
|
-
);
|
|
503
|
-
}
|
|
504
|
-
return correctPaths(
|
|
505
|
-
findFolderUp(
|
|
506
|
-
pathInsideMonorepo ?? process.cwd(),
|
|
507
|
-
rootFiles,
|
|
508
|
-
rootDirectories
|
|
509
|
-
)
|
|
510
|
-
);
|
|
511
|
-
}
|
|
512
|
-
function findWorkspaceRoot(pathInsideMonorepo) {
|
|
513
|
-
const result = findWorkspaceRootSafe(pathInsideMonorepo);
|
|
514
|
-
if (!result) {
|
|
515
|
-
throw new Error(
|
|
516
|
-
`Cannot find workspace root upwards from known path. Files search list includes:
|
|
517
|
-
${rootFiles.join(
|
|
518
|
-
"\n"
|
|
519
|
-
)}
|
|
520
|
-
Path: ${pathInsideMonorepo ? pathInsideMonorepo : process.cwd()}`
|
|
521
|
-
);
|
|
522
|
-
}
|
|
523
|
-
return result;
|
|
524
|
-
}
|
|
525
|
-
|
|
526
|
-
// ../config-tools/src/utilities/get-default-config.ts
|
|
527
|
-
var DEFAULT_COLOR_CONFIG = {
|
|
528
|
-
};
|
|
529
|
-
async function getPackageJsonConfig(root) {
|
|
530
|
-
let license = STORM_DEFAULT_LICENSE;
|
|
531
|
-
let homepage = void 0;
|
|
532
|
-
let support = void 0;
|
|
533
|
-
let name = void 0;
|
|
534
|
-
let namespace = void 0;
|
|
535
|
-
let repository = void 0;
|
|
536
|
-
const workspaceRoot = findWorkspaceRoot(root);
|
|
537
|
-
if (fs.existsSync(path.join(workspaceRoot, "package.json"))) {
|
|
538
|
-
const file = await promises.readFile(
|
|
539
|
-
joinPaths(workspaceRoot, "package.json"),
|
|
540
|
-
"utf8"
|
|
541
|
-
);
|
|
542
|
-
if (file) {
|
|
543
|
-
const packageJson = JSON.parse(file);
|
|
544
|
-
if (packageJson.name) {
|
|
545
|
-
name = packageJson.name;
|
|
546
|
-
}
|
|
547
|
-
if (packageJson.namespace) {
|
|
548
|
-
namespace = packageJson.namespace;
|
|
549
|
-
}
|
|
550
|
-
if (packageJson.repository) {
|
|
551
|
-
if (typeof packageJson.repository === "string") {
|
|
552
|
-
repository = packageJson.repository;
|
|
553
|
-
} else if (packageJson.repository.url) {
|
|
554
|
-
repository = packageJson.repository.url;
|
|
555
|
-
}
|
|
556
|
-
}
|
|
557
|
-
if (packageJson.license) {
|
|
558
|
-
license = packageJson.license;
|
|
559
|
-
}
|
|
560
|
-
if (packageJson.homepage) {
|
|
561
|
-
homepage = packageJson.homepage;
|
|
562
|
-
}
|
|
563
|
-
if (packageJson.bugs) {
|
|
564
|
-
if (typeof packageJson.bugs === "string") {
|
|
565
|
-
support = packageJson.bugs;
|
|
566
|
-
} else if (packageJson.bugs.url) {
|
|
567
|
-
support = packageJson.bugs.url;
|
|
568
|
-
}
|
|
569
|
-
}
|
|
570
|
-
}
|
|
215
|
+
if (typeof logLevel === "number" && LogLevel.WARN >= logLevel) {
|
|
216
|
+
return (message) => {
|
|
217
|
+
console.warn(
|
|
218
|
+
`
|
|
219
|
+
${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.warning ?? DEFAULT_COLOR_CONFIG.dark.warning)(`[${CONSOLE_ICONS[LogLevelLabel.WARN]} Warn] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
220
|
+
`
|
|
221
|
+
);
|
|
222
|
+
};
|
|
571
223
|
}
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
};
|
|
581
|
-
}
|
|
582
|
-
function applyDefaultConfig(config) {
|
|
583
|
-
if (!config.support && config.contact) {
|
|
584
|
-
config.support = config.contact;
|
|
224
|
+
if (typeof logLevel === "number" && LogLevel.SUCCESS >= logLevel) {
|
|
225
|
+
return (message) => {
|
|
226
|
+
console.info(
|
|
227
|
+
`
|
|
228
|
+
${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.success ?? DEFAULT_COLOR_CONFIG.dark.success)(`[${CONSOLE_ICONS[LogLevelLabel.SUCCESS]} Success] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
229
|
+
`
|
|
230
|
+
);
|
|
231
|
+
};
|
|
585
232
|
}
|
|
586
|
-
if (
|
|
587
|
-
|
|
233
|
+
if (typeof logLevel === "number" && LogLevel.INFO >= logLevel) {
|
|
234
|
+
return (message) => {
|
|
235
|
+
console.info(
|
|
236
|
+
`
|
|
237
|
+
${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.info ?? DEFAULT_COLOR_CONFIG.dark.info)(`[${CONSOLE_ICONS[LogLevelLabel.INFO]} Info] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
238
|
+
`
|
|
239
|
+
);
|
|
240
|
+
};
|
|
588
241
|
}
|
|
589
|
-
if (
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
config.support = `${config.homepage}/support`;
|
|
598
|
-
}
|
|
599
|
-
if (!config.contact) {
|
|
600
|
-
config.contact = `${config.homepage}/contact`;
|
|
601
|
-
}
|
|
602
|
-
if (!config.error?.codesFile || !config?.error?.url) {
|
|
603
|
-
config.error ??= { codesFile: STORM_DEFAULT_ERROR_CODES_FILE };
|
|
604
|
-
if (config.homepage) {
|
|
605
|
-
config.error.url ??= `${config.homepage}/errors`;
|
|
606
|
-
}
|
|
607
|
-
}
|
|
242
|
+
if (typeof logLevel === "number" && LogLevel.DEBUG >= logLevel) {
|
|
243
|
+
return (message) => {
|
|
244
|
+
console.debug(
|
|
245
|
+
`
|
|
246
|
+
${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.info ?? DEFAULT_COLOR_CONFIG.dark.info)(`[${CONSOLE_ICONS[LogLevelLabel.DEBUG]} Debug] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
247
|
+
`
|
|
248
|
+
);
|
|
249
|
+
};
|
|
608
250
|
}
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
white: (message) => message,
|
|
618
|
-
whiteBright: (message) => message,
|
|
619
|
-
gray: (message) => message,
|
|
620
|
-
bold: {
|
|
621
|
-
hex: (_) => (message) => message,
|
|
622
|
-
bgHex: (_) => ({
|
|
623
|
-
whiteBright: (message) => message,
|
|
624
|
-
white: (message) => message
|
|
625
|
-
}),
|
|
626
|
-
whiteBright: (message) => message,
|
|
627
|
-
white: (message) => message
|
|
628
|
-
},
|
|
629
|
-
dim: {
|
|
630
|
-
hex: (_) => (message) => message,
|
|
631
|
-
gray: (message) => message
|
|
251
|
+
if (typeof logLevel === "number" && LogLevel.TRACE >= logLevel) {
|
|
252
|
+
return (message) => {
|
|
253
|
+
console.debug(
|
|
254
|
+
`
|
|
255
|
+
${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.info ?? DEFAULT_COLOR_CONFIG.dark.info)(`[${CONSOLE_ICONS[LogLevelLabel.TRACE]} Trace] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
256
|
+
`
|
|
257
|
+
);
|
|
258
|
+
};
|
|
632
259
|
}
|
|
260
|
+
return (message) => {
|
|
261
|
+
console.log(
|
|
262
|
+
`
|
|
263
|
+
${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.brand ?? DEFAULT_COLOR_CONFIG.dark.brand)(`[${CONSOLE_ICONS[LogLevelLabel.ALL]} System] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
264
|
+
`
|
|
265
|
+
);
|
|
266
|
+
};
|
|
633
267
|
};
|
|
634
|
-
var
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
268
|
+
var writeFatal = (message, config) => getLogFn(LogLevel.FATAL, config)(message);
|
|
269
|
+
var writeError = (message, config) => getLogFn(LogLevel.ERROR, config)(message);
|
|
270
|
+
var writeWarning = (message, config) => getLogFn(LogLevel.WARN, config)(message);
|
|
271
|
+
var writeInfo = (message, config) => getLogFn(LogLevel.INFO, config)(message);
|
|
272
|
+
var writeSuccess = (message, config) => getLogFn(LogLevel.SUCCESS, config)(message);
|
|
273
|
+
var writeDebug = (message, config) => getLogFn(LogLevel.DEBUG, config)(message);
|
|
274
|
+
var writeTrace = (message, config) => getLogFn(LogLevel.TRACE, config)(message);
|
|
275
|
+
var MAX_DEPTH = 4;
|
|
276
|
+
var formatLogMessage = (message, options = {}, depth2 = 0) => {
|
|
277
|
+
if (depth2 > MAX_DEPTH) {
|
|
278
|
+
return "<max depth>";
|
|
638
279
|
}
|
|
639
|
-
|
|
280
|
+
const prefix = options.prefix ?? "-";
|
|
281
|
+
const skip = options.skip ?? [];
|
|
282
|
+
return typeof message === "undefined" || message === null || !message && typeof message !== "boolean" ? "<none>" : typeof message === "string" ? message : Array.isArray(message) ? `
|
|
283
|
+
${message.map((item, index) => ` ${prefix}> #${index} = ${formatLogMessage(item, { prefix: `${prefix}-`, skip }, depth2 + 1)}`).join("\n")}` : typeof message === "object" ? `
|
|
284
|
+
${Object.keys(message).filter((key) => !skip.includes(key)).map(
|
|
285
|
+
(key) => ` ${prefix}> ${key} = ${_isFunction(message[key]) ? "<function>" : typeof message[key] === "object" ? formatLogMessage(
|
|
286
|
+
message[key],
|
|
287
|
+
{ prefix: `${prefix}-`, skip },
|
|
288
|
+
depth2 + 1
|
|
289
|
+
) : message[key]}`
|
|
290
|
+
).join("\n")}` : message;
|
|
640
291
|
};
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
function
|
|
644
|
-
|
|
645
|
-
return
|
|
292
|
+
var _isFunction = (value) => {
|
|
293
|
+
try {
|
|
294
|
+
return value instanceof Function || typeof value === "function" || !!(value?.constructor && value?.call && value?.apply);
|
|
295
|
+
} catch {
|
|
296
|
+
return false;
|
|
646
297
|
}
|
|
647
|
-
return Boolean(process.env.WT_SESSION) || // Windows Terminal
|
|
648
|
-
Boolean(process.env.TERMINUS_SUBLIME) || // Terminus (<0.2.27)
|
|
649
|
-
process.env.ConEmuTask === "{cmd::Cmder}" || // ConEmu and cmder
|
|
650
|
-
process.env.TERM_PROGRAM === "Terminus-Sublime" || process.env.TERM_PROGRAM === "vscode" || process.env.TERM === "xterm-256color" || process.env.TERM === "alacritty" || process.env.TERM === "rxvt-unicode" || process.env.TERM === "rxvt-unicode-256color" || process.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
|
|
651
|
-
}
|
|
652
|
-
|
|
653
|
-
// ../config-tools/src/logger/console-icons.ts
|
|
654
|
-
var useIcon = (c, fallback) => isUnicodeSupported() ? c : fallback;
|
|
655
|
-
var CONSOLE_ICONS = {
|
|
656
|
-
[LogLevelLabel.ERROR]: useIcon("\u2718", "\xD7"),
|
|
657
|
-
[LogLevelLabel.FATAL]: useIcon("\u{1F480}", "\xD7"),
|
|
658
|
-
[LogLevelLabel.WARN]: useIcon("\u26A0", "\u203C"),
|
|
659
|
-
[LogLevelLabel.INFO]: useIcon("\u2139", "i"),
|
|
660
|
-
[LogLevelLabel.SUCCESS]: useIcon("\u2714", "\u221A"),
|
|
661
|
-
[LogLevelLabel.DEBUG]: useIcon("\u{1F6E0}", "D"),
|
|
662
|
-
[LogLevelLabel.TRACE]: useIcon("\u{1F6E0}", "T"),
|
|
663
|
-
[LogLevelLabel.ALL]: useIcon("\u2709", "\u2192")
|
|
664
298
|
};
|
|
665
299
|
|
|
666
|
-
// ../config-tools/src/
|
|
667
|
-
var
|
|
668
|
-
|
|
300
|
+
// ../config-tools/src/utilities/process-handler.ts
|
|
301
|
+
var exitWithError = (config) => {
|
|
302
|
+
writeFatal("Exiting script with an error status...", config);
|
|
303
|
+
process.exit(1);
|
|
304
|
+
};
|
|
305
|
+
var exitWithSuccess = (config) => {
|
|
306
|
+
writeSuccess("Script completed successfully. Exiting...", config);
|
|
307
|
+
process.exit(0);
|
|
308
|
+
};
|
|
309
|
+
var handleProcess = (config) => {
|
|
310
|
+
writeTrace(
|
|
311
|
+
`Using the following arguments to process the script: ${process.argv.join(", ")}`,
|
|
312
|
+
config
|
|
313
|
+
);
|
|
314
|
+
process.on("unhandledRejection", (error) => {
|
|
315
|
+
writeError(
|
|
316
|
+
`An Unhandled Rejection occurred while running the program: ${error}`,
|
|
317
|
+
config
|
|
318
|
+
);
|
|
319
|
+
exitWithError(config);
|
|
320
|
+
});
|
|
321
|
+
process.on("uncaughtException", (error) => {
|
|
322
|
+
writeError(
|
|
323
|
+
`An Uncaught Exception occurred while running the program: ${error.message}
|
|
324
|
+
Stacktrace: ${error.stack}`,
|
|
325
|
+
config
|
|
326
|
+
);
|
|
327
|
+
exitWithError(config);
|
|
328
|
+
});
|
|
329
|
+
process.on("SIGTERM", (signal) => {
|
|
330
|
+
writeError(`The program terminated with signal code: ${signal}`, config);
|
|
331
|
+
exitWithError(config);
|
|
332
|
+
});
|
|
333
|
+
process.on("SIGINT", (signal) => {
|
|
334
|
+
writeError(`The program terminated with signal code: ${signal}`, config);
|
|
335
|
+
exitWithError(config);
|
|
336
|
+
});
|
|
337
|
+
process.on("SIGHUP", (signal) => {
|
|
338
|
+
writeError(`The program terminated with signal code: ${signal}`, config);
|
|
339
|
+
exitWithError(config);
|
|
340
|
+
});
|
|
669
341
|
};
|
|
670
342
|
|
|
671
|
-
// ../config
|
|
672
|
-
var
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
343
|
+
// ../config/src/constants.ts
|
|
344
|
+
var STORM_DEFAULT_DOCS = "https://docs.stormsoftware.com";
|
|
345
|
+
var STORM_DEFAULT_HOMEPAGE = "https://stormsoftware.com";
|
|
346
|
+
var STORM_DEFAULT_LICENSING = "https://stormsoftware.com/license";
|
|
347
|
+
var STORM_DEFAULT_LICENSE = "Apache-2.0";
|
|
348
|
+
var STORM_DEFAULT_SOCIAL_TWITTER = "StormSoftwareHQ";
|
|
349
|
+
var STORM_DEFAULT_SOCIAL_DISCORD = "https://discord.gg/MQ6YVzakM5";
|
|
350
|
+
var STORM_DEFAULT_SOCIAL_TELEGRAM = "https://t.me/storm_software";
|
|
351
|
+
var STORM_DEFAULT_SOCIAL_SLACK = "https://join.slack.com/t/storm-software/shared_invite/zt-2gsmk04hs-i6yhK_r6urq0dkZYAwq2pA";
|
|
352
|
+
var STORM_DEFAULT_SOCIAL_MEDIUM = "https://medium.com/storm-software";
|
|
353
|
+
var STORM_DEFAULT_SOCIAL_GITHUB = "https://github.com/storm-software";
|
|
354
|
+
var STORM_DEFAULT_ERROR_CODES_FILE = "tools/errors/codes.json";
|
|
355
|
+
|
|
356
|
+
// ../config/src/schema.ts
|
|
357
|
+
var ColorSchema = z__namespace.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7);
|
|
358
|
+
var DarkColorSchema = ColorSchema.default("#151718").describe(
|
|
359
|
+
"The dark background color of the workspace"
|
|
360
|
+
);
|
|
361
|
+
var LightColorSchema = ColorSchema.default("#cbd5e1").describe(
|
|
362
|
+
"The light background color of the workspace"
|
|
363
|
+
);
|
|
364
|
+
var BrandColorSchema = ColorSchema.default("#1fb2a6").describe(
|
|
365
|
+
"The primary brand specific color of the workspace"
|
|
366
|
+
);
|
|
367
|
+
var AlternateColorSchema = ColorSchema.optional().describe(
|
|
368
|
+
"The alternate brand specific color of the workspace"
|
|
369
|
+
);
|
|
370
|
+
var AccentColorSchema = ColorSchema.optional().describe(
|
|
371
|
+
"The secondary brand specific color of the workspace"
|
|
372
|
+
);
|
|
373
|
+
var LinkColorSchema = ColorSchema.default("#3fa6ff").describe(
|
|
374
|
+
"The color used to display hyperlink text"
|
|
375
|
+
);
|
|
376
|
+
var HelpColorSchema = ColorSchema.default("#818cf8").describe(
|
|
377
|
+
"The second brand specific color of the workspace"
|
|
378
|
+
);
|
|
379
|
+
var SuccessColorSchema = ColorSchema.default("#45b27e").describe(
|
|
380
|
+
"The success color of the workspace"
|
|
381
|
+
);
|
|
382
|
+
var InfoColorSchema = ColorSchema.default("#38bdf8").describe(
|
|
383
|
+
"The informational color of the workspace"
|
|
384
|
+
);
|
|
385
|
+
var WarningColorSchema = ColorSchema.default("#f3d371").describe(
|
|
386
|
+
"The warning color of the workspace"
|
|
387
|
+
);
|
|
388
|
+
var DangerColorSchema = ColorSchema.default("#d8314a").describe(
|
|
389
|
+
"The danger color of the workspace"
|
|
390
|
+
);
|
|
391
|
+
var FatalColorSchema = ColorSchema.optional().describe(
|
|
392
|
+
"The fatal color of the workspace"
|
|
393
|
+
);
|
|
394
|
+
var PositiveColorSchema = ColorSchema.default("#4ade80").describe(
|
|
395
|
+
"The positive number color of the workspace"
|
|
396
|
+
);
|
|
397
|
+
var NegativeColorSchema = ColorSchema.default("#ef4444").describe(
|
|
398
|
+
"The negative number color of the workspace"
|
|
399
|
+
);
|
|
400
|
+
var GradientStopsSchema = z__namespace.array(ColorSchema).optional().describe(
|
|
401
|
+
"The color stops for the base gradient color pattern used in the workspace"
|
|
402
|
+
);
|
|
403
|
+
var DarkThemeColorConfigSchema = z__namespace.object({
|
|
404
|
+
foreground: LightColorSchema,
|
|
405
|
+
background: DarkColorSchema,
|
|
406
|
+
brand: BrandColorSchema,
|
|
407
|
+
alternate: AlternateColorSchema,
|
|
408
|
+
accent: AccentColorSchema,
|
|
409
|
+
link: LinkColorSchema,
|
|
410
|
+
help: HelpColorSchema,
|
|
411
|
+
success: SuccessColorSchema,
|
|
412
|
+
info: InfoColorSchema,
|
|
413
|
+
warning: WarningColorSchema,
|
|
414
|
+
danger: DangerColorSchema,
|
|
415
|
+
fatal: FatalColorSchema,
|
|
416
|
+
positive: PositiveColorSchema,
|
|
417
|
+
negative: NegativeColorSchema,
|
|
418
|
+
gradient: GradientStopsSchema
|
|
419
|
+
});
|
|
420
|
+
var LightThemeColorConfigSchema = z__namespace.object({
|
|
421
|
+
foreground: DarkColorSchema,
|
|
422
|
+
background: LightColorSchema,
|
|
423
|
+
brand: BrandColorSchema,
|
|
424
|
+
alternate: AlternateColorSchema,
|
|
425
|
+
accent: AccentColorSchema,
|
|
426
|
+
link: LinkColorSchema,
|
|
427
|
+
help: HelpColorSchema,
|
|
428
|
+
success: SuccessColorSchema,
|
|
429
|
+
info: InfoColorSchema,
|
|
430
|
+
warning: WarningColorSchema,
|
|
431
|
+
danger: DangerColorSchema,
|
|
432
|
+
fatal: FatalColorSchema,
|
|
433
|
+
positive: PositiveColorSchema,
|
|
434
|
+
negative: NegativeColorSchema,
|
|
435
|
+
gradient: GradientStopsSchema
|
|
436
|
+
});
|
|
437
|
+
var MultiThemeColorConfigSchema = z__namespace.object({
|
|
438
|
+
dark: DarkThemeColorConfigSchema,
|
|
439
|
+
light: LightThemeColorConfigSchema
|
|
440
|
+
});
|
|
441
|
+
var SingleThemeColorConfigSchema = z__namespace.object({
|
|
442
|
+
dark: DarkColorSchema,
|
|
443
|
+
light: LightColorSchema,
|
|
444
|
+
brand: BrandColorSchema,
|
|
445
|
+
alternate: AlternateColorSchema,
|
|
446
|
+
accent: AccentColorSchema,
|
|
447
|
+
link: LinkColorSchema,
|
|
448
|
+
help: HelpColorSchema,
|
|
449
|
+
success: SuccessColorSchema,
|
|
450
|
+
info: InfoColorSchema,
|
|
451
|
+
warning: WarningColorSchema,
|
|
452
|
+
danger: DangerColorSchema,
|
|
453
|
+
fatal: FatalColorSchema,
|
|
454
|
+
positive: PositiveColorSchema,
|
|
455
|
+
negative: NegativeColorSchema,
|
|
456
|
+
gradient: GradientStopsSchema
|
|
457
|
+
});
|
|
458
|
+
var RegistryUrlConfigSchema = z__namespace.url().optional().describe("A remote registry URL used to publish distributable packages");
|
|
459
|
+
var RegistryConfigSchema = z__namespace.object({
|
|
460
|
+
github: RegistryUrlConfigSchema,
|
|
461
|
+
npm: RegistryUrlConfigSchema,
|
|
462
|
+
cargo: RegistryUrlConfigSchema,
|
|
463
|
+
cyclone: RegistryUrlConfigSchema,
|
|
464
|
+
container: RegistryUrlConfigSchema
|
|
465
|
+
}).default({}).describe("A list of remote registry URLs used by Storm Software");
|
|
466
|
+
var ColorConfigSchema = SingleThemeColorConfigSchema.or(
|
|
467
|
+
MultiThemeColorConfigSchema
|
|
468
|
+
).describe("Colors used for various workspace elements");
|
|
469
|
+
var ColorConfigMapSchema = z__namespace.record(
|
|
470
|
+
z__namespace.union([z__namespace.literal("base"), z__namespace.string()]),
|
|
471
|
+
ColorConfigSchema
|
|
472
|
+
);
|
|
473
|
+
var ExtendsItemSchema = z__namespace.string().trim().describe(
|
|
474
|
+
"The path to a base config file to use as a configuration preset file. Documentation can be found at https://github.com/unjs/c12#extending-configuration."
|
|
475
|
+
);
|
|
476
|
+
var ExtendsSchema = ExtendsItemSchema.or(
|
|
477
|
+
z__namespace.array(ExtendsItemSchema)
|
|
478
|
+
).describe(
|
|
479
|
+
"The path to a base config file to use as a configuration preset file. Documentation can be found at https://github.com/unjs/c12#extending-configuration."
|
|
480
|
+
);
|
|
481
|
+
var WorkspaceBotConfigSchema = z__namespace.object({
|
|
482
|
+
name: z__namespace.string().trim().default("stormie-bot").describe(
|
|
483
|
+
"The workspace bot user's name (this is the bot that will be used to perform various tasks)"
|
|
484
|
+
),
|
|
485
|
+
email: z__namespace.email().default("bot@stormsoftware.com").describe("The email of the workspace bot")
|
|
486
|
+
}).describe(
|
|
487
|
+
"The workspace's bot user's config used to automated various operations tasks"
|
|
488
|
+
);
|
|
489
|
+
var WorkspaceReleaseConfigSchema = z__namespace.object({
|
|
490
|
+
banner: z__namespace.string().trim().optional().describe(
|
|
491
|
+
"A URL to a banner image used to display the workspace's release"
|
|
492
|
+
),
|
|
493
|
+
header: z__namespace.string().trim().optional().describe(
|
|
494
|
+
"A header message appended to the start of the workspace's release notes"
|
|
495
|
+
),
|
|
496
|
+
footer: z__namespace.string().trim().optional().describe(
|
|
497
|
+
"A footer message appended to the end of the workspace's release notes"
|
|
498
|
+
)
|
|
499
|
+
}).describe("The workspace's release config used during the release process");
|
|
500
|
+
var WorkspaceSocialsConfigSchema = z__namespace.object({
|
|
501
|
+
twitter: z__namespace.string().trim().default(STORM_DEFAULT_SOCIAL_TWITTER).describe("A Twitter/X account associated with the organization/project"),
|
|
502
|
+
discord: z__namespace.string().trim().default(STORM_DEFAULT_SOCIAL_DISCORD).describe("A Discord account associated with the organization/project"),
|
|
503
|
+
telegram: z__namespace.string().trim().default(STORM_DEFAULT_SOCIAL_TELEGRAM).describe("A Telegram account associated with the organization/project"),
|
|
504
|
+
slack: z__namespace.string().trim().default(STORM_DEFAULT_SOCIAL_SLACK).describe("A Slack account associated with the organization/project"),
|
|
505
|
+
medium: z__namespace.string().trim().default(STORM_DEFAULT_SOCIAL_MEDIUM).describe("A Medium account associated with the organization/project"),
|
|
506
|
+
github: z__namespace.string().trim().default(STORM_DEFAULT_SOCIAL_GITHUB).describe("A GitHub account associated with the organization/project")
|
|
507
|
+
}).describe(
|
|
508
|
+
"The workspace's account config used to store various social media links"
|
|
509
|
+
);
|
|
510
|
+
var WorkspaceDirectoryConfigSchema = z__namespace.object({
|
|
511
|
+
cache: z__namespace.string().trim().optional().describe(
|
|
512
|
+
"The directory used to store the environment's cached file data"
|
|
513
|
+
),
|
|
514
|
+
data: z__namespace.string().trim().optional().describe("The directory used to store the environment's data files"),
|
|
515
|
+
config: z__namespace.string().trim().optional().describe(
|
|
516
|
+
"The directory used to store the environment's configuration files"
|
|
517
|
+
),
|
|
518
|
+
temp: z__namespace.string().trim().optional().describe("The directory used to store the environment's temp files"),
|
|
519
|
+
log: z__namespace.string().trim().optional().describe("The directory used to store the environment's temp files"),
|
|
520
|
+
build: z__namespace.string().trim().default("dist").describe(
|
|
521
|
+
"The directory used to store the workspace's distributable files after a build (relative to the workspace root)"
|
|
522
|
+
)
|
|
523
|
+
}).describe(
|
|
524
|
+
"Various directories used by the workspace to store data, cache, and configuration files"
|
|
525
|
+
);
|
|
526
|
+
var errorConfigSchema = z__namespace.object({
|
|
527
|
+
codesFile: z__namespace.string().trim().default(STORM_DEFAULT_ERROR_CODES_FILE).describe("The path to the workspace's error codes JSON file"),
|
|
528
|
+
url: z__namespace.url().optional().describe(
|
|
529
|
+
"A URL to a page that looks up the workspace's error messages given a specific error code"
|
|
530
|
+
)
|
|
531
|
+
}).describe("The workspace's error config used during the error process");
|
|
532
|
+
var organizationConfigSchema = z__namespace.object({
|
|
533
|
+
name: z__namespace.string().trim().describe("The name of the organization"),
|
|
534
|
+
description: z__namespace.string().trim().optional().describe("A description of the organization"),
|
|
535
|
+
logo: z__namespace.url().optional().describe("A URL to the organization's logo image"),
|
|
536
|
+
icon: z__namespace.url().optional().describe("A URL to the organization's icon image"),
|
|
537
|
+
url: z__namespace.url().optional().describe(
|
|
538
|
+
"A URL to a page that provides more information about the organization"
|
|
539
|
+
)
|
|
540
|
+
}).describe("The workspace's organization details");
|
|
541
|
+
var stormWorkspaceConfigSchema = z__namespace.object({
|
|
542
|
+
$schema: z__namespace.string().trim().default(
|
|
543
|
+
"https://public.storm-cdn.com/schemas/storm-workspace.schema.json"
|
|
544
|
+
).describe(
|
|
545
|
+
"The URL or file path to the JSON schema file that describes the Storm configuration file"
|
|
546
|
+
),
|
|
547
|
+
extends: ExtendsSchema.optional(),
|
|
548
|
+
name: z__namespace.string().trim().toLowerCase().optional().describe(
|
|
549
|
+
"The name of the service/package/scope using this configuration"
|
|
550
|
+
),
|
|
551
|
+
namespace: z__namespace.string().trim().toLowerCase().optional().describe("The namespace of the package"),
|
|
552
|
+
organization: organizationConfigSchema.or(z__namespace.string().trim().describe("The organization of the workspace")).optional().describe(
|
|
553
|
+
"The organization of the workspace. This can be a string or an object containing the organization's details"
|
|
554
|
+
),
|
|
555
|
+
repository: z__namespace.string().trim().optional().describe("The repo URL of the workspace (i.e. GitHub)"),
|
|
556
|
+
license: z__namespace.string().trim().default("Apache-2.0").describe("The license type of the package"),
|
|
557
|
+
homepage: z__namespace.url().optional().describe("The homepage of the workspace"),
|
|
558
|
+
docs: z__namespace.url().optional().describe("The documentation site for the workspace"),
|
|
559
|
+
portal: z__namespace.url().optional().describe("The development portal site for the workspace"),
|
|
560
|
+
licensing: z__namespace.url().optional().describe("The licensing site for the workspace"),
|
|
561
|
+
contact: z__namespace.url().optional().describe("The contact site for the workspace"),
|
|
562
|
+
support: z__namespace.url().optional().describe(
|
|
563
|
+
"The support site for the workspace. If not provided, this is defaulted to the `contact` config value"
|
|
564
|
+
),
|
|
565
|
+
branch: z__namespace.string().trim().default("main").describe("The branch of the workspace"),
|
|
566
|
+
preid: z__namespace.string().optional().describe("A tag specifying the version pre-release identifier"),
|
|
567
|
+
owner: z__namespace.string().trim().default("@storm-software/admin").describe("The owner of the package"),
|
|
568
|
+
bot: WorkspaceBotConfigSchema,
|
|
569
|
+
release: WorkspaceReleaseConfigSchema,
|
|
570
|
+
socials: WorkspaceSocialsConfigSchema,
|
|
571
|
+
error: errorConfigSchema,
|
|
572
|
+
mode: z__namespace.string().trim().default("production").describe("The current runtime environment mode for the package"),
|
|
573
|
+
workspaceRoot: z__namespace.string().trim().describe("The root directory of the workspace"),
|
|
574
|
+
skipCache: z__namespace.boolean().default(false).describe("Should all known types of workspace caching be skipped?"),
|
|
575
|
+
directories: WorkspaceDirectoryConfigSchema,
|
|
576
|
+
packageManager: z__namespace.enum(["npm", "yarn", "pnpm", "bun"]).default("npm").describe(
|
|
577
|
+
"The JavaScript/TypeScript package manager used by the repository"
|
|
578
|
+
),
|
|
579
|
+
timezone: z__namespace.string().trim().default("America/New_York").describe("The default timezone of the workspace"),
|
|
580
|
+
locale: z__namespace.string().trim().default("en-US").describe("The default locale of the workspace"),
|
|
581
|
+
logLevel: z__namespace.enum([
|
|
582
|
+
"silent",
|
|
583
|
+
"fatal",
|
|
584
|
+
"error",
|
|
585
|
+
"warn",
|
|
586
|
+
"success",
|
|
587
|
+
"info",
|
|
588
|
+
"debug",
|
|
589
|
+
"trace",
|
|
590
|
+
"all"
|
|
591
|
+
]).default("info").describe(
|
|
592
|
+
"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`)."
|
|
593
|
+
),
|
|
594
|
+
skipConfigLogging: z__namespace.boolean().optional().describe(
|
|
595
|
+
"Should the logging of the current Storm Workspace configuration be skipped?"
|
|
596
|
+
),
|
|
597
|
+
registry: RegistryConfigSchema,
|
|
598
|
+
configFile: z__namespace.string().trim().nullable().default(null).describe(
|
|
599
|
+
"The filepath of the Storm config. When this field is null, no config file was found in the current workspace."
|
|
600
|
+
),
|
|
601
|
+
colors: ColorConfigSchema.or(ColorConfigMapSchema).describe(
|
|
602
|
+
"Storm theme config values used for styling various package elements"
|
|
603
|
+
),
|
|
604
|
+
extensions: z__namespace.record(z__namespace.string(), z__namespace.any()).optional().default({}).describe("Configuration of each used extension")
|
|
605
|
+
}).describe(
|
|
606
|
+
"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."
|
|
607
|
+
);
|
|
608
|
+
|
|
609
|
+
// ../../node_modules/.pnpm/defu@6.1.4/node_modules/defu/dist/defu.mjs
|
|
610
|
+
function isPlainObject(value) {
|
|
611
|
+
if (value === null || typeof value !== "object") {
|
|
612
|
+
return false;
|
|
692
613
|
}
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
return LogLevelLabel.ALL;
|
|
614
|
+
const prototype = Object.getPrototypeOf(value);
|
|
615
|
+
if (prototype !== null && prototype !== Object.prototype && Object.getPrototypeOf(prototype) !== null) {
|
|
616
|
+
return false;
|
|
697
617
|
}
|
|
698
|
-
if (
|
|
699
|
-
return
|
|
618
|
+
if (Symbol.iterator in value) {
|
|
619
|
+
return false;
|
|
620
|
+
}
|
|
621
|
+
if (Symbol.toStringTag in value) {
|
|
622
|
+
return Object.prototype.toString.call(value) === "[object Module]";
|
|
623
|
+
}
|
|
624
|
+
return true;
|
|
625
|
+
}
|
|
626
|
+
function _defu(baseObject, defaults, namespace = ".", merger) {
|
|
627
|
+
if (!isPlainObject(defaults)) {
|
|
628
|
+
return _defu(baseObject, {}, namespace, merger);
|
|
629
|
+
}
|
|
630
|
+
const object2 = Object.assign({}, defaults);
|
|
631
|
+
for (const key in baseObject) {
|
|
632
|
+
if (key === "__proto__" || key === "constructor") {
|
|
633
|
+
continue;
|
|
634
|
+
}
|
|
635
|
+
const value = baseObject[key];
|
|
636
|
+
if (value === null || value === void 0) {
|
|
637
|
+
continue;
|
|
638
|
+
}
|
|
639
|
+
if (merger && merger(object2, key, value, namespace)) {
|
|
640
|
+
continue;
|
|
641
|
+
}
|
|
642
|
+
if (Array.isArray(value) && Array.isArray(object2[key])) {
|
|
643
|
+
object2[key] = [...value, ...object2[key]];
|
|
644
|
+
} else if (isPlainObject(value) && isPlainObject(object2[key])) {
|
|
645
|
+
object2[key] = _defu(
|
|
646
|
+
value,
|
|
647
|
+
object2[key],
|
|
648
|
+
(namespace ? `${namespace}.` : "") + key.toString(),
|
|
649
|
+
merger
|
|
650
|
+
);
|
|
651
|
+
} else {
|
|
652
|
+
object2[key] = value;
|
|
653
|
+
}
|
|
700
654
|
}
|
|
701
|
-
|
|
702
|
-
|
|
655
|
+
return object2;
|
|
656
|
+
}
|
|
657
|
+
function createDefu(merger) {
|
|
658
|
+
return (...arguments_) => (
|
|
659
|
+
// eslint-disable-next-line unicorn/no-array-reduce
|
|
660
|
+
arguments_.reduce((p, c) => _defu(p, c, "", merger), {})
|
|
661
|
+
);
|
|
662
|
+
}
|
|
663
|
+
var defu = createDefu();
|
|
664
|
+
|
|
665
|
+
// ../config-tools/src/utilities/correct-paths.ts
|
|
666
|
+
var _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
|
|
667
|
+
function normalizeWindowsPath(input = "") {
|
|
668
|
+
if (!input) {
|
|
669
|
+
return input;
|
|
703
670
|
}
|
|
704
|
-
|
|
705
|
-
|
|
671
|
+
return input.replace(/\\/g, "/").replace(_DRIVE_LETTER_START_RE, (r) => r.toUpperCase());
|
|
672
|
+
}
|
|
673
|
+
var _UNC_REGEX = /^[/\\]{2}/;
|
|
674
|
+
var _IS_ABSOLUTE_RE = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/;
|
|
675
|
+
var _DRIVE_LETTER_RE = /^[A-Za-z]:$/;
|
|
676
|
+
var correctPaths = function(path) {
|
|
677
|
+
if (!path || path.length === 0) {
|
|
678
|
+
return ".";
|
|
706
679
|
}
|
|
707
|
-
|
|
708
|
-
|
|
680
|
+
path = normalizeWindowsPath(path);
|
|
681
|
+
const isUNCPath = path.match(_UNC_REGEX);
|
|
682
|
+
const isPathAbsolute = isAbsolute(path);
|
|
683
|
+
const trailingSeparator = path[path.length - 1] === "/";
|
|
684
|
+
path = normalizeString(path, !isPathAbsolute);
|
|
685
|
+
if (path.length === 0) {
|
|
686
|
+
if (isPathAbsolute) {
|
|
687
|
+
return "/";
|
|
688
|
+
}
|
|
689
|
+
return trailingSeparator ? "./" : ".";
|
|
709
690
|
}
|
|
710
|
-
if (
|
|
711
|
-
|
|
691
|
+
if (trailingSeparator) {
|
|
692
|
+
path += "/";
|
|
712
693
|
}
|
|
713
|
-
if (
|
|
714
|
-
|
|
694
|
+
if (_DRIVE_LETTER_RE.test(path)) {
|
|
695
|
+
path += "/";
|
|
715
696
|
}
|
|
716
|
-
if (
|
|
717
|
-
|
|
697
|
+
if (isUNCPath) {
|
|
698
|
+
if (!isPathAbsolute) {
|
|
699
|
+
return `//./${path}`;
|
|
700
|
+
}
|
|
701
|
+
return `//${path}`;
|
|
718
702
|
}
|
|
719
|
-
return
|
|
720
|
-
};
|
|
721
|
-
var isVerbose = (label = LogLevelLabel.SILENT) => {
|
|
722
|
-
const logLevel = typeof label === "string" ? getLogLevel(label) : label;
|
|
723
|
-
return logLevel >= LogLevel.DEBUG;
|
|
703
|
+
return isPathAbsolute && !isAbsolute(path) ? `/${path}` : path;
|
|
724
704
|
};
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
if (typeof logLevel === "number" && LogLevel.ERROR >= logLevel) {
|
|
744
|
-
return (message) => {
|
|
745
|
-
console.error(
|
|
746
|
-
`
|
|
747
|
-
${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.danger ?? "#f85149")(`[${CONSOLE_ICONS[LogLevelLabel.ERROR]} Error] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
748
|
-
`
|
|
749
|
-
);
|
|
750
|
-
};
|
|
751
|
-
}
|
|
752
|
-
if (typeof logLevel === "number" && LogLevel.WARN >= logLevel) {
|
|
753
|
-
return (message) => {
|
|
754
|
-
console.warn(
|
|
755
|
-
`
|
|
756
|
-
${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.warning ?? "#e3b341")(`[${CONSOLE_ICONS[LogLevelLabel.WARN]} Warn] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
757
|
-
`
|
|
758
|
-
);
|
|
759
|
-
};
|
|
705
|
+
var joinPaths = function(...segments) {
|
|
706
|
+
let path = "";
|
|
707
|
+
for (const seg of segments) {
|
|
708
|
+
if (!seg) {
|
|
709
|
+
continue;
|
|
710
|
+
}
|
|
711
|
+
if (path.length > 0) {
|
|
712
|
+
const pathTrailing = path[path.length - 1] === "/";
|
|
713
|
+
const segLeading = seg[0] === "/";
|
|
714
|
+
const both = pathTrailing && segLeading;
|
|
715
|
+
if (both) {
|
|
716
|
+
path += seg.slice(1);
|
|
717
|
+
} else {
|
|
718
|
+
path += pathTrailing || segLeading ? seg : `/${seg}`;
|
|
719
|
+
}
|
|
720
|
+
} else {
|
|
721
|
+
path += seg;
|
|
722
|
+
}
|
|
760
723
|
}
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
724
|
+
return correctPaths(path);
|
|
725
|
+
};
|
|
726
|
+
function normalizeString(path, allowAboveRoot) {
|
|
727
|
+
let res = "";
|
|
728
|
+
let lastSegmentLength = 0;
|
|
729
|
+
let lastSlash = -1;
|
|
730
|
+
let dots = 0;
|
|
731
|
+
let char = null;
|
|
732
|
+
for (let index = 0; index <= path.length; ++index) {
|
|
733
|
+
if (index < path.length) {
|
|
734
|
+
char = path[index];
|
|
735
|
+
} else if (char === "/") {
|
|
736
|
+
break;
|
|
737
|
+
} else {
|
|
738
|
+
char = "/";
|
|
739
|
+
}
|
|
740
|
+
if (char === "/") {
|
|
741
|
+
if (lastSlash === index - 1 || dots === 1) ; else if (dots === 2) {
|
|
742
|
+
if (res.length < 2 || lastSegmentLength !== 2 || res[res.length - 1] !== "." || res[res.length - 2] !== ".") {
|
|
743
|
+
if (res.length > 2) {
|
|
744
|
+
const lastSlashIndex = res.lastIndexOf("/");
|
|
745
|
+
if (lastSlashIndex === -1) {
|
|
746
|
+
res = "";
|
|
747
|
+
lastSegmentLength = 0;
|
|
748
|
+
} else {
|
|
749
|
+
res = res.slice(0, lastSlashIndex);
|
|
750
|
+
lastSegmentLength = res.length - 1 - res.lastIndexOf("/");
|
|
751
|
+
}
|
|
752
|
+
lastSlash = index;
|
|
753
|
+
dots = 0;
|
|
754
|
+
continue;
|
|
755
|
+
} else if (res.length > 0) {
|
|
756
|
+
res = "";
|
|
757
|
+
lastSegmentLength = 0;
|
|
758
|
+
lastSlash = index;
|
|
759
|
+
dots = 0;
|
|
760
|
+
continue;
|
|
761
|
+
}
|
|
762
|
+
}
|
|
763
|
+
if (allowAboveRoot) {
|
|
764
|
+
res += res.length > 0 ? "/.." : "..";
|
|
765
|
+
lastSegmentLength = 2;
|
|
766
|
+
}
|
|
767
|
+
} else {
|
|
768
|
+
if (res.length > 0) {
|
|
769
|
+
res += `/${path.slice(lastSlash + 1, index)}`;
|
|
770
|
+
} else {
|
|
771
|
+
res = path.slice(lastSlash + 1, index);
|
|
772
|
+
}
|
|
773
|
+
lastSegmentLength = index - lastSlash - 1;
|
|
774
|
+
}
|
|
775
|
+
lastSlash = index;
|
|
776
|
+
dots = 0;
|
|
777
|
+
} else if (char === "." && dots !== -1) {
|
|
778
|
+
++dots;
|
|
779
|
+
} else {
|
|
780
|
+
dots = -1;
|
|
781
|
+
}
|
|
769
782
|
}
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
783
|
+
return res;
|
|
784
|
+
}
|
|
785
|
+
var isAbsolute = function(p) {
|
|
786
|
+
return _IS_ABSOLUTE_RE.test(p);
|
|
787
|
+
};
|
|
788
|
+
var MAX_PATH_SEARCH_DEPTH = 30;
|
|
789
|
+
var depth = 0;
|
|
790
|
+
function findFolderUp(startPath, endFileNames = [], endDirectoryNames = []) {
|
|
791
|
+
const _startPath = startPath ?? process.cwd();
|
|
792
|
+
if (endDirectoryNames.some(
|
|
793
|
+
(endDirName) => fs.existsSync(path.join(_startPath, endDirName))
|
|
794
|
+
)) {
|
|
795
|
+
return _startPath;
|
|
778
796
|
}
|
|
779
|
-
if (
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
${_chalk.gray(formatTimestamp())} ${_chalk.hex("#3e9eff")(`[${CONSOLE_ICONS[LogLevelLabel.DEBUG]} Debug] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
784
|
-
`
|
|
785
|
-
);
|
|
786
|
-
};
|
|
797
|
+
if (endFileNames.some(
|
|
798
|
+
(endFileName) => fs.existsSync(path.join(_startPath, endFileName))
|
|
799
|
+
)) {
|
|
800
|
+
return _startPath;
|
|
787
801
|
}
|
|
788
|
-
if (
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
`
|
|
792
|
-
${_chalk.gray(formatTimestamp())} ${_chalk.hex("#0070E0")(`[${CONSOLE_ICONS[LogLevelLabel.TRACE]} Trace] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
793
|
-
`
|
|
794
|
-
);
|
|
795
|
-
};
|
|
802
|
+
if (_startPath !== "/" && depth++ < MAX_PATH_SEARCH_DEPTH) {
|
|
803
|
+
const parent = path.join(_startPath, "..");
|
|
804
|
+
return findFolderUp(parent, endFileNames, endDirectoryNames);
|
|
796
805
|
}
|
|
797
|
-
return
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
806
|
+
return void 0;
|
|
807
|
+
}
|
|
808
|
+
|
|
809
|
+
// ../config-tools/src/utilities/find-workspace-root.ts
|
|
810
|
+
var rootFiles = [
|
|
811
|
+
"storm-workspace.json",
|
|
812
|
+
"storm-workspace.yaml",
|
|
813
|
+
"storm-workspace.yml",
|
|
814
|
+
"storm-workspace.js",
|
|
815
|
+
"storm-workspace.ts",
|
|
816
|
+
".storm-workspace.json",
|
|
817
|
+
".storm-workspace.yaml",
|
|
818
|
+
".storm-workspace.yml",
|
|
819
|
+
".storm-workspace.js",
|
|
820
|
+
".storm-workspace.ts",
|
|
821
|
+
"lerna.json",
|
|
822
|
+
"nx.json",
|
|
823
|
+
"turbo.json",
|
|
824
|
+
"npm-workspace.json",
|
|
825
|
+
"yarn-workspace.json",
|
|
826
|
+
"pnpm-workspace.json",
|
|
827
|
+
"npm-workspace.yaml",
|
|
828
|
+
"yarn-workspace.yaml",
|
|
829
|
+
"pnpm-workspace.yaml",
|
|
830
|
+
"npm-workspace.yml",
|
|
831
|
+
"yarn-workspace.yml",
|
|
832
|
+
"pnpm-workspace.yml",
|
|
833
|
+
"npm-lock.json",
|
|
834
|
+
"yarn-lock.json",
|
|
835
|
+
"pnpm-lock.json",
|
|
836
|
+
"npm-lock.yaml",
|
|
837
|
+
"yarn-lock.yaml",
|
|
838
|
+
"pnpm-lock.yaml",
|
|
839
|
+
"npm-lock.yml",
|
|
840
|
+
"yarn-lock.yml",
|
|
841
|
+
"pnpm-lock.yml",
|
|
842
|
+
"bun.lockb"
|
|
843
|
+
];
|
|
844
|
+
var rootDirectories = [
|
|
845
|
+
".storm-workspace",
|
|
846
|
+
".nx",
|
|
847
|
+
".github",
|
|
848
|
+
".vscode",
|
|
849
|
+
".verdaccio"
|
|
850
|
+
];
|
|
851
|
+
function findWorkspaceRootSafe(pathInsideMonorepo) {
|
|
852
|
+
if (process.env.STORM_WORKSPACE_ROOT || process.env.NX_WORKSPACE_ROOT_PATH) {
|
|
853
|
+
return correctPaths(
|
|
854
|
+
process.env.STORM_WORKSPACE_ROOT ?? process.env.NX_WORKSPACE_ROOT_PATH
|
|
802
855
|
);
|
|
803
|
-
};
|
|
804
|
-
};
|
|
805
|
-
var writeFatal = (message, config) => getLogFn(LogLevel.FATAL, config)(message);
|
|
806
|
-
var writeError = (message, config) => getLogFn(LogLevel.ERROR, config)(message);
|
|
807
|
-
var writeWarning = (message, config) => getLogFn(LogLevel.WARN, config)(message);
|
|
808
|
-
var writeInfo = (message, config) => getLogFn(LogLevel.INFO, config)(message);
|
|
809
|
-
var writeSuccess = (message, config) => getLogFn(LogLevel.SUCCESS, config)(message);
|
|
810
|
-
var writeDebug = (message, config) => getLogFn(LogLevel.DEBUG, config)(message);
|
|
811
|
-
var writeTrace = (message, config) => getLogFn(LogLevel.TRACE, config)(message);
|
|
812
|
-
var MAX_DEPTH = 4;
|
|
813
|
-
var formatLogMessage = (message, options = {}, depth2 = 0) => {
|
|
814
|
-
if (depth2 > MAX_DEPTH) {
|
|
815
|
-
return "<max depth>";
|
|
816
|
-
}
|
|
817
|
-
const prefix = options.prefix ?? "-";
|
|
818
|
-
const skip = options.skip ?? [];
|
|
819
|
-
return typeof message === "undefined" || message === null || !message && typeof message !== "boolean" ? "<none>" : typeof message === "string" ? message : Array.isArray(message) ? `
|
|
820
|
-
${message.map((item, index) => ` ${prefix}> #${index} = ${formatLogMessage(item, { prefix: `${prefix}-`, skip }, depth2 + 1)}`).join("\n")}` : typeof message === "object" ? `
|
|
821
|
-
${Object.keys(message).filter((key) => !skip.includes(key)).map(
|
|
822
|
-
(key) => ` ${prefix}> ${key} = ${_isFunction(message[key]) ? "<function>" : typeof message[key] === "object" ? formatLogMessage(
|
|
823
|
-
message[key],
|
|
824
|
-
{ prefix: `${prefix}-`, skip },
|
|
825
|
-
depth2 + 1
|
|
826
|
-
) : message[key]}`
|
|
827
|
-
).join("\n")}` : message;
|
|
828
|
-
};
|
|
829
|
-
var _isFunction = (value) => {
|
|
830
|
-
try {
|
|
831
|
-
return value instanceof Function || typeof value === "function" || !!(value?.constructor && value?.call && value?.apply);
|
|
832
|
-
} catch (e) {
|
|
833
|
-
return false;
|
|
834
856
|
}
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
};
|
|
842
|
-
var exitWithSuccess = (config) => {
|
|
843
|
-
writeSuccess("Script completed successfully. Exiting...", config);
|
|
844
|
-
process.exit(0);
|
|
845
|
-
};
|
|
846
|
-
var handleProcess = (config) => {
|
|
847
|
-
writeTrace(
|
|
848
|
-
`Using the following arguments to process the script: ${process.argv.join(", ")}`,
|
|
849
|
-
config
|
|
857
|
+
return correctPaths(
|
|
858
|
+
findFolderUp(
|
|
859
|
+
pathInsideMonorepo ?? process.cwd(),
|
|
860
|
+
rootFiles,
|
|
861
|
+
rootDirectories
|
|
862
|
+
)
|
|
850
863
|
);
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
Stacktrace: ${error.stack}`,
|
|
862
|
-
config
|
|
864
|
+
}
|
|
865
|
+
function findWorkspaceRoot(pathInsideMonorepo) {
|
|
866
|
+
const result = findWorkspaceRootSafe(pathInsideMonorepo);
|
|
867
|
+
if (!result) {
|
|
868
|
+
throw new Error(
|
|
869
|
+
`Cannot find workspace root upwards from known path. Files search list includes:
|
|
870
|
+
${rootFiles.join(
|
|
871
|
+
"\n"
|
|
872
|
+
)}
|
|
873
|
+
Path: ${pathInsideMonorepo ? pathInsideMonorepo : process.cwd()}`
|
|
863
874
|
);
|
|
864
|
-
exitWithError(config);
|
|
865
|
-
});
|
|
866
|
-
process.on("SIGTERM", (signal) => {
|
|
867
|
-
writeError(`The program terminated with signal code: ${signal}`, config);
|
|
868
|
-
exitWithError(config);
|
|
869
|
-
});
|
|
870
|
-
process.on("SIGINT", (signal) => {
|
|
871
|
-
writeError(`The program terminated with signal code: ${signal}`, config);
|
|
872
|
-
exitWithError(config);
|
|
873
|
-
});
|
|
874
|
-
process.on("SIGHUP", (signal) => {
|
|
875
|
-
writeError(`The program terminated with signal code: ${signal}`, config);
|
|
876
|
-
exitWithError(config);
|
|
877
|
-
});
|
|
878
|
-
};
|
|
879
|
-
|
|
880
|
-
// ../../node_modules/.pnpm/defu@6.1.4/node_modules/defu/dist/defu.mjs
|
|
881
|
-
function isPlainObject(value) {
|
|
882
|
-
if (value === null || typeof value !== "object") {
|
|
883
|
-
return false;
|
|
884
|
-
}
|
|
885
|
-
const prototype = Object.getPrototypeOf(value);
|
|
886
|
-
if (prototype !== null && prototype !== Object.prototype && Object.getPrototypeOf(prototype) !== null) {
|
|
887
|
-
return false;
|
|
888
875
|
}
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
876
|
+
return result;
|
|
877
|
+
}
|
|
878
|
+
|
|
879
|
+
// ../config/src/types.ts
|
|
880
|
+
var COLOR_KEYS = [
|
|
881
|
+
"dark",
|
|
882
|
+
"light",
|
|
883
|
+
"base",
|
|
884
|
+
"brand",
|
|
885
|
+
"alternate",
|
|
886
|
+
"accent",
|
|
887
|
+
"link",
|
|
888
|
+
"success",
|
|
889
|
+
"help",
|
|
890
|
+
"info",
|
|
891
|
+
"warning",
|
|
892
|
+
"danger",
|
|
893
|
+
"fatal",
|
|
894
|
+
"positive",
|
|
895
|
+
"negative"
|
|
896
|
+
];
|
|
897
|
+
async function getPackageJsonConfig(root) {
|
|
898
|
+
let license = STORM_DEFAULT_LICENSE;
|
|
899
|
+
let homepage = void 0;
|
|
900
|
+
let support = void 0;
|
|
901
|
+
let name = void 0;
|
|
902
|
+
let namespace = void 0;
|
|
903
|
+
let repository = void 0;
|
|
904
|
+
const workspaceRoot = findWorkspaceRoot(root);
|
|
905
|
+
if (fs.existsSync(path.join(workspaceRoot, "package.json"))) {
|
|
906
|
+
const file = await promises.readFile(
|
|
907
|
+
joinPaths(workspaceRoot, "package.json"),
|
|
908
|
+
"utf8"
|
|
909
|
+
);
|
|
910
|
+
if (file) {
|
|
911
|
+
const packageJson = JSON.parse(file);
|
|
912
|
+
if (packageJson.name) {
|
|
913
|
+
name = packageJson.name;
|
|
914
|
+
}
|
|
915
|
+
if (packageJson.namespace) {
|
|
916
|
+
namespace = packageJson.namespace;
|
|
917
|
+
}
|
|
918
|
+
if (packageJson.repository) {
|
|
919
|
+
if (typeof packageJson.repository === "string") {
|
|
920
|
+
repository = packageJson.repository;
|
|
921
|
+
} else if (packageJson.repository.url) {
|
|
922
|
+
repository = packageJson.repository.url;
|
|
923
|
+
}
|
|
924
|
+
}
|
|
925
|
+
if (packageJson.license) {
|
|
926
|
+
license = packageJson.license;
|
|
927
|
+
}
|
|
928
|
+
if (packageJson.homepage) {
|
|
929
|
+
homepage = packageJson.homepage;
|
|
930
|
+
}
|
|
931
|
+
if (packageJson.bugs) {
|
|
932
|
+
if (typeof packageJson.bugs === "string") {
|
|
933
|
+
support = packageJson.bugs;
|
|
934
|
+
} else if (packageJson.bugs.url) {
|
|
935
|
+
support = packageJson.bugs.url;
|
|
936
|
+
}
|
|
937
|
+
}
|
|
938
|
+
}
|
|
894
939
|
}
|
|
895
|
-
return
|
|
940
|
+
return {
|
|
941
|
+
workspaceRoot,
|
|
942
|
+
name,
|
|
943
|
+
namespace,
|
|
944
|
+
repository,
|
|
945
|
+
license,
|
|
946
|
+
homepage,
|
|
947
|
+
support
|
|
948
|
+
};
|
|
896
949
|
}
|
|
897
|
-
function
|
|
898
|
-
if (!
|
|
899
|
-
|
|
950
|
+
function applyDefaultConfig(config) {
|
|
951
|
+
if (!config.support && config.contact) {
|
|
952
|
+
config.support = config.contact;
|
|
900
953
|
}
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
954
|
+
if (!config.contact && config.support) {
|
|
955
|
+
config.contact = config.support;
|
|
956
|
+
}
|
|
957
|
+
if (config.homepage) {
|
|
958
|
+
if (!config.docs) {
|
|
959
|
+
config.docs = `${config.homepage}/docs`;
|
|
905
960
|
}
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
continue;
|
|
961
|
+
if (!config.license) {
|
|
962
|
+
config.license = `${config.homepage}/license`;
|
|
909
963
|
}
|
|
910
|
-
if (
|
|
911
|
-
|
|
964
|
+
if (!config.support) {
|
|
965
|
+
config.support = `${config.homepage}/support`;
|
|
912
966
|
}
|
|
913
|
-
if (
|
|
914
|
-
|
|
915
|
-
}
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
);
|
|
922
|
-
} else {
|
|
923
|
-
object2[key] = value;
|
|
967
|
+
if (!config.contact) {
|
|
968
|
+
config.contact = `${config.homepage}/contact`;
|
|
969
|
+
}
|
|
970
|
+
if (!config.error?.codesFile || !config?.error?.url) {
|
|
971
|
+
config.error ??= { codesFile: STORM_DEFAULT_ERROR_CODES_FILE };
|
|
972
|
+
if (config.homepage) {
|
|
973
|
+
config.error.url ??= `${config.homepage}/errors`;
|
|
974
|
+
}
|
|
924
975
|
}
|
|
925
976
|
}
|
|
926
|
-
return
|
|
927
|
-
}
|
|
928
|
-
function createDefu(merger) {
|
|
929
|
-
return (...arguments_) => (
|
|
930
|
-
// eslint-disable-next-line unicorn/no-array-reduce
|
|
931
|
-
arguments_.reduce((p, c) => _defu(p, c, "", merger), {})
|
|
932
|
-
);
|
|
977
|
+
return config;
|
|
933
978
|
}
|
|
934
|
-
|
|
979
|
+
|
|
980
|
+
// ../config-tools/src/config-file/get-config-file.ts
|
|
935
981
|
var getConfigFileByName = async (fileName, filePath, options = {}) => {
|
|
936
982
|
const workspacePath = filePath || findWorkspaceRoot(filePath);
|
|
937
983
|
const configs = await Promise.all([
|
|
@@ -1131,6 +1177,19 @@ var getThemeColorConfigEnv = (prefix, theme) => {
|
|
|
1131
1177
|
return process.env[`${prefix}${themeName}LIGHT_BRAND`] || process.env[`${prefix}${themeName}DARK_BRAND`] ? getMultiThemeColorConfigEnv(prefix + themeName) : getSingleThemeColorConfigEnv(prefix + themeName);
|
|
1132
1178
|
};
|
|
1133
1179
|
var getSingleThemeColorConfigEnv = (prefix) => {
|
|
1180
|
+
const gradient = [];
|
|
1181
|
+
if (process.env[`${prefix}GRADIENT_START`] && process.env[`${prefix}GRADIENT_END`]) {
|
|
1182
|
+
gradient.push(
|
|
1183
|
+
process.env[`${prefix}GRADIENT_START`],
|
|
1184
|
+
process.env[`${prefix}GRADIENT_END`]
|
|
1185
|
+
);
|
|
1186
|
+
} else if (process.env[`${prefix}GRADIENT_0`] || process.env[`${prefix}GRADIENT_1`]) {
|
|
1187
|
+
let index = process.env[`${prefix}GRADIENT_0`] ? 0 : 1;
|
|
1188
|
+
while (process.env[`${prefix}GRADIENT_${index}`]) {
|
|
1189
|
+
gradient.push(process.env[`${prefix}GRADIENT_${index}`]);
|
|
1190
|
+
index++;
|
|
1191
|
+
}
|
|
1192
|
+
}
|
|
1134
1193
|
return {
|
|
1135
1194
|
dark: process.env[`${prefix}DARK`],
|
|
1136
1195
|
light: process.env[`${prefix}LIGHT`],
|
|
@@ -1145,7 +1204,8 @@ var getSingleThemeColorConfigEnv = (prefix) => {
|
|
|
1145
1204
|
danger: process.env[`${prefix}DANGER`],
|
|
1146
1205
|
fatal: process.env[`${prefix}FATAL`],
|
|
1147
1206
|
positive: process.env[`${prefix}POSITIVE`],
|
|
1148
|
-
negative: process.env[`${prefix}NEGATIVE`]
|
|
1207
|
+
negative: process.env[`${prefix}NEGATIVE`],
|
|
1208
|
+
gradient
|
|
1149
1209
|
};
|
|
1150
1210
|
};
|
|
1151
1211
|
var getMultiThemeColorConfigEnv = (prefix) => {
|
|
@@ -1157,6 +1217,19 @@ var getMultiThemeColorConfigEnv = (prefix) => {
|
|
|
1157
1217
|
};
|
|
1158
1218
|
};
|
|
1159
1219
|
var getBaseThemeColorConfigEnv = (prefix) => {
|
|
1220
|
+
const gradient = [];
|
|
1221
|
+
if (process.env[`${prefix}GRADIENT_START`] && process.env[`${prefix}GRADIENT_END`]) {
|
|
1222
|
+
gradient.push(
|
|
1223
|
+
process.env[`${prefix}GRADIENT_START`],
|
|
1224
|
+
process.env[`${prefix}GRADIENT_END`]
|
|
1225
|
+
);
|
|
1226
|
+
} else if (process.env[`${prefix}GRADIENT_0`] || process.env[`${prefix}GRADIENT_1`]) {
|
|
1227
|
+
let index = process.env[`${prefix}GRADIENT_0`] ? 0 : 1;
|
|
1228
|
+
while (process.env[`${prefix}GRADIENT_${index}`]) {
|
|
1229
|
+
gradient.push(process.env[`${prefix}GRADIENT_${index}`]);
|
|
1230
|
+
index++;
|
|
1231
|
+
}
|
|
1232
|
+
}
|
|
1160
1233
|
return {
|
|
1161
1234
|
foreground: process.env[`${prefix}FOREGROUND`],
|
|
1162
1235
|
background: process.env[`${prefix}BACKGROUND`],
|
|
@@ -1171,7 +1244,8 @@ var getBaseThemeColorConfigEnv = (prefix) => {
|
|
|
1171
1244
|
danger: process.env[`${prefix}DANGER`],
|
|
1172
1245
|
fatal: process.env[`${prefix}FATAL`],
|
|
1173
1246
|
positive: process.env[`${prefix}POSITIVE`],
|
|
1174
|
-
negative: process.env[`${prefix}NEGATIVE`]
|
|
1247
|
+
negative: process.env[`${prefix}NEGATIVE`],
|
|
1248
|
+
gradient
|
|
1175
1249
|
};
|
|
1176
1250
|
};
|
|
1177
1251
|
|
|
@@ -1302,11 +1376,12 @@ var setConfigEnv = (config) => {
|
|
|
1302
1376
|
process.env[`${prefix}TIMEZONE`] = config.timezone;
|
|
1303
1377
|
process.env.TZ = config.timezone;
|
|
1304
1378
|
process.env.DEFAULT_TIMEZONE = config.timezone;
|
|
1379
|
+
process.env.TIMEZONE = config.timezone;
|
|
1305
1380
|
}
|
|
1306
1381
|
if (config.locale) {
|
|
1307
1382
|
process.env[`${prefix}LOCALE`] = config.locale;
|
|
1308
|
-
process.env.LOCALE = config.locale;
|
|
1309
1383
|
process.env.DEFAULT_LOCALE = config.locale;
|
|
1384
|
+
process.env.LOCALE = config.locale;
|
|
1310
1385
|
process.env.LANG = config.locale ? `${config.locale.replaceAll("-", "_")}.UTF-8` : "en_US.UTF-8";
|
|
1311
1386
|
}
|
|
1312
1387
|
if (config.configFile) {
|
|
@@ -1467,6 +1542,11 @@ var setSingleThemeColorConfigEnv = (prefix, config) => {
|
|
|
1467
1542
|
if (config.negative) {
|
|
1468
1543
|
process.env[`${prefix}NEGATIVE`] = config.negative;
|
|
1469
1544
|
}
|
|
1545
|
+
if (config.gradient) {
|
|
1546
|
+
for (let i = 0; i < config.gradient.length; i++) {
|
|
1547
|
+
process.env[`${prefix}GRADIENT_${i}`] = config.gradient[i];
|
|
1548
|
+
}
|
|
1549
|
+
}
|
|
1470
1550
|
};
|
|
1471
1551
|
var setMultiThemeColorConfigEnv = (prefix, config) => {
|
|
1472
1552
|
return {
|
|
@@ -1517,6 +1597,11 @@ var setBaseThemeColorConfigEnv = (prefix, config) => {
|
|
|
1517
1597
|
if (config.negative) {
|
|
1518
1598
|
process.env[`${prefix}NEGATIVE`] = config.negative;
|
|
1519
1599
|
}
|
|
1600
|
+
if (config.gradient) {
|
|
1601
|
+
for (let i = 0; i < config.gradient.length; i++) {
|
|
1602
|
+
process.env[`${prefix}GRADIENT_${i}`] = config.gradient[i];
|
|
1603
|
+
}
|
|
1604
|
+
}
|
|
1520
1605
|
};
|
|
1521
1606
|
var _static_cache = void 0;
|
|
1522
1607
|
var createStormWorkspaceConfig = async (extensionName, schema, workspaceRoot, skipLogs = false, useDefault = true) => {
|