@storm-software/projen 0.15.52 → 0.15.59

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.
@@ -62,281 +62,289 @@ var LogLevelLabel = {
62
62
  ALL: "all"
63
63
  };
64
64
 
65
- // ../config-tools/src/utilities/get-default-config.ts
65
+ // ../config-tools/src/utilities/colors.ts
66
66
  init_esm_shims();
67
+ var DEFAULT_COLOR_CONFIG = {
68
+ light: {
69
+ background: "#fafafa",
70
+ foreground: "#1d1e22",
71
+ brand: "#1fb2a6",
72
+ alternate: "#db2777",
73
+ help: "#5C4EE5",
74
+ success: "#087f5b",
75
+ info: "#0550ae",
76
+ warning: "#e3b341",
77
+ danger: "#D8314A",
78
+ fatal: "#51070f",
79
+ link: "#3fa6ff",
80
+ positive: "#22c55e",
81
+ negative: "#dc2626",
82
+ gradient: ["#1fb2a6", "#db2777", "#5C4EE5"]
83
+ },
84
+ dark: {
85
+ background: "#1d1e22",
86
+ foreground: "#cbd5e1",
87
+ brand: "#2dd4bf",
88
+ alternate: "#db2777",
89
+ help: "#818cf8",
90
+ success: "#10b981",
91
+ info: "#58a6ff",
92
+ warning: "#f3d371",
93
+ danger: "#D8314A",
94
+ fatal: "#a40e26",
95
+ link: "#3fa6ff",
96
+ positive: "#22c55e",
97
+ negative: "#dc2626",
98
+ gradient: ["#1fb2a6", "#db2777", "#818cf8"]
99
+ }
100
+ };
67
101
 
68
- // ../config/src/index.ts
102
+ // ../config-tools/src/logger/chalk.ts
69
103
  init_esm_shims();
104
+ import chalk from "chalk";
105
+ var chalkDefault = {
106
+ hex: (_) => (message) => message,
107
+ bgHex: (_) => ({
108
+ whiteBright: (message) => message,
109
+ white: (message) => message
110
+ }),
111
+ white: (message) => message,
112
+ whiteBright: (message) => message,
113
+ gray: (message) => message,
114
+ bold: {
115
+ hex: (_) => (message) => message,
116
+ bgHex: (_) => ({
117
+ whiteBright: (message) => message,
118
+ white: (message) => message
119
+ }),
120
+ whiteBright: (message) => message,
121
+ white: (message) => message
122
+ },
123
+ dim: {
124
+ hex: (_) => (message) => message,
125
+ gray: (message) => message
126
+ }
127
+ };
128
+ var getChalk = () => {
129
+ let _chalk = chalk;
130
+ if (!_chalk?.hex || !_chalk?.bold?.hex || !_chalk?.bgHex || !_chalk?.whiteBright || !_chalk?.white) {
131
+ _chalk = chalkDefault;
132
+ }
133
+ return _chalk;
134
+ };
70
135
 
71
- // ../config/src/constants.ts
136
+ // ../config-tools/src/logger/console-icons.ts
72
137
  init_esm_shims();
73
- var STORM_DEFAULT_DOCS = "https://docs.stormsoftware.com";
74
- var STORM_DEFAULT_HOMEPAGE = "https://stormsoftware.com";
75
- var STORM_DEFAULT_CONTACT = "https://stormsoftware.com/contact";
76
- var STORM_DEFAULT_LICENSING = "https://stormsoftware.com/license";
77
- var STORM_DEFAULT_LICENSE = "Apache-2.0";
78
- var STORM_DEFAULT_SOCIAL_TWITTER = "StormSoftwareHQ";
79
- var STORM_DEFAULT_SOCIAL_DISCORD = "https://discord.gg/MQ6YVzakM5";
80
- var STORM_DEFAULT_SOCIAL_TELEGRAM = "https://t.me/storm_software";
81
- var STORM_DEFAULT_SOCIAL_SLACK = "https://join.slack.com/t/storm-software/shared_invite/zt-2gsmk04hs-i6yhK_r6urq0dkZYAwq2pA";
82
- var STORM_DEFAULT_SOCIAL_MEDIUM = "https://medium.com/storm-software";
83
- var STORM_DEFAULT_SOCIAL_GITHUB = "https://github.com/storm-software";
84
- var STORM_DEFAULT_RELEASE_FOOTER = `
85
- Storm Software is an open source software development organization with the mission is to make software development more accessible. Our ideal future is one where anyone can create software without years of prior development experience serving as a barrier to entry. We hope to achieve this via LLMs, Generative AI, and intuitive, high-level data modeling/programming languages.
86
138
 
87
- Join us on [Discord](${STORM_DEFAULT_SOCIAL_DISCORD}) to chat with the team, receive release notifications, ask questions, and get involved.
139
+ // ../config-tools/src/logger/is-unicode-supported.ts
140
+ init_esm_shims();
141
+ function isUnicodeSupported() {
142
+ if (process.platform !== "win32") {
143
+ return process.env.TERM !== "linux";
144
+ }
145
+ return Boolean(process.env.WT_SESSION) || // Windows Terminal
146
+ Boolean(process.env.TERMINUS_SUBLIME) || // Terminus (<0.2.27)
147
+ process.env.ConEmuTask === "{cmd::Cmder}" || // ConEmu and cmder
148
+ 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";
149
+ }
88
150
 
89
- If this sounds interesting, and you would like to help us in creating the next generation of development tools, please reach out on our [website](${STORM_DEFAULT_CONTACT}) or join our [Slack](${STORM_DEFAULT_SOCIAL_SLACK}) channel!
90
- `;
91
- var STORM_DEFAULT_ERROR_CODES_FILE = "tools/errors/codes.json";
151
+ // ../config-tools/src/logger/console-icons.ts
152
+ var useIcon = (c, fallback) => isUnicodeSupported() ? c : fallback;
153
+ var CONSOLE_ICONS = {
154
+ [LogLevelLabel.ERROR]: useIcon("\u2718", "\xD7"),
155
+ [LogLevelLabel.FATAL]: useIcon("\u{1F480}", "\xD7"),
156
+ [LogLevelLabel.WARN]: useIcon("\u26A0", "\u203C"),
157
+ [LogLevelLabel.INFO]: useIcon("\u2139", "i"),
158
+ [LogLevelLabel.SUCCESS]: useIcon("\u2714", "\u221A"),
159
+ [LogLevelLabel.DEBUG]: useIcon("\u{1F6E0}", "D"),
160
+ [LogLevelLabel.TRACE]: useIcon("\u{1F6E0}", "T"),
161
+ [LogLevelLabel.ALL]: useIcon("\u2709", "\u2192")
162
+ };
92
163
 
93
- // ../config/src/define-config.ts
164
+ // ../config-tools/src/logger/format-timestamp.ts
94
165
  init_esm_shims();
166
+ var formatTimestamp = (date = /* @__PURE__ */ new Date()) => {
167
+ return `${date.toLocaleDateString()} ${date.toLocaleTimeString()}`;
168
+ };
95
169
 
96
- // ../config/src/schema.ts
170
+ // ../config-tools/src/logger/get-log-level.ts
97
171
  init_esm_shims();
98
- import * as z from "zod";
99
- 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");
100
- 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");
101
- 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");
102
- 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");
103
- 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");
104
- 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");
105
- 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");
106
- 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");
107
- 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");
108
- 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");
109
- 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");
110
- var FatalColorSchema = z.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7).optional().describe("The fatal color of the workspace");
111
- 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");
112
- 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");
113
- var DarkThemeColorConfigSchema = z.object({
114
- foreground: LightColorSchema,
115
- background: DarkColorSchema,
116
- brand: BrandColorSchema,
117
- alternate: AlternateColorSchema,
118
- accent: AccentColorSchema,
119
- link: LinkColorSchema,
120
- help: HelpColorSchema,
121
- success: SuccessColorSchema,
122
- info: InfoColorSchema,
123
- warning: WarningColorSchema,
124
- danger: DangerColorSchema,
125
- fatal: FatalColorSchema,
126
- positive: PositiveColorSchema,
127
- negative: NegativeColorSchema
128
- });
129
- var LightThemeColorConfigSchema = z.object({
130
- foreground: DarkColorSchema,
131
- background: LightColorSchema,
132
- brand: BrandColorSchema,
133
- alternate: AlternateColorSchema,
134
- accent: AccentColorSchema,
135
- link: LinkColorSchema,
136
- help: HelpColorSchema,
137
- success: SuccessColorSchema,
138
- info: InfoColorSchema,
139
- warning: WarningColorSchema,
140
- danger: DangerColorSchema,
141
- fatal: FatalColorSchema,
142
- positive: PositiveColorSchema,
143
- negative: NegativeColorSchema
144
- });
145
- var MultiThemeColorConfigSchema = z.object({
146
- dark: DarkThemeColorConfigSchema,
147
- light: LightThemeColorConfigSchema
148
- });
149
- var SingleThemeColorConfigSchema = z.object({
150
- dark: DarkColorSchema,
151
- light: LightColorSchema,
152
- brand: BrandColorSchema,
153
- alternate: AlternateColorSchema,
154
- accent: AccentColorSchema,
155
- link: LinkColorSchema,
156
- help: HelpColorSchema,
157
- success: SuccessColorSchema,
158
- info: InfoColorSchema,
159
- warning: WarningColorSchema,
160
- danger: DangerColorSchema,
161
- fatal: FatalColorSchema,
162
- positive: PositiveColorSchema,
163
- negative: NegativeColorSchema
164
- });
165
- var RegistryUrlConfigSchema = z.url().optional().describe("A remote registry URL used to publish distributable packages");
166
- var RegistryConfigSchema = z.object({
167
- github: RegistryUrlConfigSchema,
168
- npm: RegistryUrlConfigSchema,
169
- cargo: RegistryUrlConfigSchema,
170
- cyclone: RegistryUrlConfigSchema,
171
- container: RegistryUrlConfigSchema
172
- }).default({}).describe("A list of remote registry URLs used by Storm Software");
173
- var ColorConfigSchema = SingleThemeColorConfigSchema.or(
174
- MultiThemeColorConfigSchema
175
- ).describe("Colors used for various workspace elements");
176
- var ColorConfigMapSchema = z.record(
177
- z.union([z.literal("base"), z.string()]),
178
- ColorConfigSchema
179
- );
180
- var ExtendsItemSchema = z.string().trim().describe(
181
- "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."
182
- );
183
- var ExtendsSchema = ExtendsItemSchema.or(
184
- z.array(ExtendsItemSchema)
185
- ).describe(
186
- "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."
187
- );
188
- var WorkspaceBotConfigSchema = z.object({
189
- name: z.string().trim().default("stormie-bot").describe(
190
- "The workspace bot user's name (this is the bot that will be used to perform various tasks)"
191
- ),
192
- email: z.email().default("bot@stormsoftware.com").describe("The email of the workspace bot")
193
- }).describe(
194
- "The workspace's bot user's config used to automated various operations tasks"
195
- );
196
- var WorkspaceReleaseConfigSchema = z.object({
197
- banner: z.string().trim().optional().describe(
198
- "A URL to a banner image used to display the workspace's release"
199
- ),
200
- header: z.string().trim().optional().describe(
201
- "A header message appended to the start of the workspace's release notes"
202
- ),
203
- footer: z.string().trim().optional().describe(
204
- "A footer message appended to the end of the workspace's release notes"
205
- )
206
- }).describe("The workspace's release config used during the release process");
207
- var WorkspaceSocialsConfigSchema = z.object({
208
- twitter: z.string().trim().default(STORM_DEFAULT_SOCIAL_TWITTER).describe("A Twitter/X account associated with the organization/project"),
209
- discord: z.string().trim().default(STORM_DEFAULT_SOCIAL_DISCORD).describe("A Discord account associated with the organization/project"),
210
- telegram: z.string().trim().default(STORM_DEFAULT_SOCIAL_TELEGRAM).describe("A Telegram account associated with the organization/project"),
211
- slack: z.string().trim().default(STORM_DEFAULT_SOCIAL_SLACK).describe("A Slack account associated with the organization/project"),
212
- medium: z.string().trim().default(STORM_DEFAULT_SOCIAL_MEDIUM).describe("A Medium account associated with the organization/project"),
213
- github: z.string().trim().default(STORM_DEFAULT_SOCIAL_GITHUB).describe("A GitHub account associated with the organization/project")
214
- }).describe(
215
- "The workspace's account config used to store various social media links"
216
- );
217
- var WorkspaceDirectoryConfigSchema = z.object({
218
- cache: z.string().trim().optional().describe(
219
- "The directory used to store the environment's cached file data"
220
- ),
221
- data: z.string().trim().optional().describe("The directory used to store the environment's data files"),
222
- config: z.string().trim().optional().describe(
223
- "The directory used to store the environment's configuration files"
224
- ),
225
- temp: z.string().trim().optional().describe("The directory used to store the environment's temp files"),
226
- log: z.string().trim().optional().describe("The directory used to store the environment's temp files"),
227
- build: z.string().trim().default("dist").describe(
228
- "The directory used to store the workspace's distributable files after a build (relative to the workspace root)"
229
- )
230
- }).describe(
231
- "Various directories used by the workspace to store data, cache, and configuration files"
232
- );
233
- var errorConfigSchema = z.object({
234
- codesFile: z.string().trim().default(STORM_DEFAULT_ERROR_CODES_FILE).describe("The path to the workspace's error codes JSON file"),
235
- url: z.url().optional().describe(
236
- "A URL to a page that looks up the workspace's error messages given a specific error code"
237
- )
238
- }).describe("The workspace's error config used during the error process");
239
- var organizationConfigSchema = z.object({
240
- name: z.string().trim().describe("The name of the organization"),
241
- description: z.string().trim().optional().describe("A description of the organization"),
242
- logo: z.url().optional().describe("A URL to the organization's logo image"),
243
- icon: z.url().optional().describe("A URL to the organization's icon image"),
244
- url: z.url().optional().describe(
245
- "A URL to a page that provides more information about the organization"
246
- )
247
- }).describe("The workspace's organization details");
248
- var stormWorkspaceConfigSchema = z.object({
249
- $schema: z.string().trim().default(
250
- "https://public.storm-cdn.com/schemas/storm-workspace.schema.json"
251
- ).describe(
252
- "The URL or file path to the JSON schema file that describes the Storm configuration file"
253
- ),
254
- extends: ExtendsSchema.optional(),
255
- name: z.string().trim().toLowerCase().optional().describe(
256
- "The name of the service/package/scope using this configuration"
257
- ),
258
- namespace: z.string().trim().toLowerCase().optional().describe("The namespace of the package"),
259
- organization: organizationConfigSchema.or(z.string().trim().describe("The organization of the workspace")).optional().describe(
260
- "The organization of the workspace. This can be a string or an object containing the organization's details"
261
- ),
262
- repository: z.string().trim().optional().describe("The repo URL of the workspace (i.e. GitHub)"),
263
- license: z.string().trim().default("Apache-2.0").describe("The license type of the package"),
264
- homepage: z.url().optional().describe("The homepage of the workspace"),
265
- docs: z.url().optional().describe("The documentation site for the workspace"),
266
- portal: z.url().optional().describe("The development portal site for the workspace"),
267
- licensing: z.url().optional().describe("The licensing site for the workspace"),
268
- contact: z.url().optional().describe("The contact site for the workspace"),
269
- support: z.url().optional().describe(
270
- "The support site for the workspace. If not provided, this is defaulted to the `contact` config value"
271
- ),
272
- branch: z.string().trim().default("main").describe("The branch of the workspace"),
273
- preid: z.string().optional().describe("A tag specifying the version pre-release identifier"),
274
- owner: z.string().trim().default("@storm-software/admin").describe("The owner of the package"),
275
- bot: WorkspaceBotConfigSchema,
276
- release: WorkspaceReleaseConfigSchema,
277
- socials: WorkspaceSocialsConfigSchema,
278
- error: errorConfigSchema,
279
- mode: z.string().trim().default("production").describe("The current runtime environment mode for the package"),
280
- workspaceRoot: z.string().trim().describe("The root directory of the workspace"),
281
- skipCache: z.boolean().default(false).describe("Should all known types of workspace caching be skipped?"),
282
- directories: WorkspaceDirectoryConfigSchema,
283
- packageManager: z.enum(["npm", "yarn", "pnpm", "bun"]).default("npm").describe(
284
- "The JavaScript/TypeScript package manager used by the repository"
285
- ),
286
- timezone: z.string().trim().default("America/New_York").describe("The default timezone of the workspace"),
287
- locale: z.string().trim().default("en-US").describe("The default locale of the workspace"),
288
- logLevel: z.enum([
289
- "silent",
290
- "fatal",
291
- "error",
292
- "warn",
293
- "success",
294
- "info",
295
- "debug",
296
- "trace",
297
- "all"
298
- ]).default("info").describe(
299
- "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`)."
300
- ),
301
- skipConfigLogging: z.boolean().optional().describe(
302
- "Should the logging of the current Storm Workspace configuration be skipped?"
303
- ),
304
- registry: RegistryConfigSchema,
305
- configFile: z.string().trim().nullable().default(null).describe(
306
- "The filepath of the Storm config. When this field is null, no config file was found in the current workspace."
307
- ),
308
- colors: ColorConfigSchema.or(ColorConfigMapSchema).describe(
309
- "Storm theme config values used for styling various package elements"
310
- ),
311
- extensions: z.record(z.string(), z.any()).optional().default({}).describe("Configuration of each used extension")
312
- }).describe(
313
- "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."
314
- );
172
+ var getLogLevel = (label) => {
173
+ switch (label) {
174
+ case "all":
175
+ return LogLevel.ALL;
176
+ case "trace":
177
+ return LogLevel.TRACE;
178
+ case "debug":
179
+ return LogLevel.DEBUG;
180
+ case "info":
181
+ return LogLevel.INFO;
182
+ case "warn":
183
+ return LogLevel.WARN;
184
+ case "error":
185
+ return LogLevel.ERROR;
186
+ case "fatal":
187
+ return LogLevel.FATAL;
188
+ case "silent":
189
+ return LogLevel.SILENT;
190
+ default:
191
+ return LogLevel.INFO;
192
+ }
193
+ };
194
+ var getLogLevelLabel = (logLevel = LogLevel.INFO) => {
195
+ if (logLevel >= LogLevel.ALL) {
196
+ return LogLevelLabel.ALL;
197
+ }
198
+ if (logLevel >= LogLevel.TRACE) {
199
+ return LogLevelLabel.TRACE;
200
+ }
201
+ if (logLevel >= LogLevel.DEBUG) {
202
+ return LogLevelLabel.DEBUG;
203
+ }
204
+ if (logLevel >= LogLevel.INFO) {
205
+ return LogLevelLabel.INFO;
206
+ }
207
+ if (logLevel >= LogLevel.WARN) {
208
+ return LogLevelLabel.WARN;
209
+ }
210
+ if (logLevel >= LogLevel.ERROR) {
211
+ return LogLevelLabel.ERROR;
212
+ }
213
+ if (logLevel >= LogLevel.FATAL) {
214
+ return LogLevelLabel.FATAL;
215
+ }
216
+ if (logLevel <= LogLevel.SILENT) {
217
+ return LogLevelLabel.SILENT;
218
+ }
219
+ return LogLevelLabel.INFO;
220
+ };
315
221
 
316
- // ../config/src/types.ts
317
- init_esm_shims();
318
- var COLOR_KEYS = [
319
- "dark",
320
- "light",
321
- "base",
322
- "brand",
323
- "alternate",
324
- "accent",
325
- "link",
326
- "success",
327
- "help",
328
- "info",
329
- "warning",
330
- "danger",
331
- "fatal",
332
- "positive",
333
- "negative"
334
- ];
222
+ // ../config-tools/src/logger/console.ts
223
+ var getLogFn = (logLevel = LogLevel.INFO, config = {}, _chalk = getChalk()) => {
224
+ 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;
225
+ const configLogLevel = config.logLevel || process.env.STORM_LOG_LEVEL || LogLevelLabel.INFO;
226
+ if (logLevel > getLogLevel(configLogLevel) || logLevel <= LogLevel.SILENT || getLogLevel(configLogLevel) <= LogLevel.SILENT) {
227
+ return (_) => {
228
+ };
229
+ }
230
+ if (typeof logLevel === "number" && LogLevel.FATAL >= logLevel) {
231
+ return (message) => {
232
+ console.error(
233
+ `
234
+ ${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.fatal ?? DEFAULT_COLOR_CONFIG.dark.fatal)(`[${CONSOLE_ICONS[LogLevelLabel.FATAL]} Fatal] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
235
+ `
236
+ );
237
+ };
238
+ }
239
+ if (typeof logLevel === "number" && LogLevel.ERROR >= logLevel) {
240
+ return (message) => {
241
+ console.error(
242
+ `
243
+ ${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.danger ?? DEFAULT_COLOR_CONFIG.dark.danger)(`[${CONSOLE_ICONS[LogLevelLabel.ERROR]} Error] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
244
+ `
245
+ );
246
+ };
247
+ }
248
+ if (typeof logLevel === "number" && LogLevel.WARN >= logLevel) {
249
+ return (message) => {
250
+ console.warn(
251
+ `
252
+ ${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.warning ?? DEFAULT_COLOR_CONFIG.dark.warning)(`[${CONSOLE_ICONS[LogLevelLabel.WARN]} Warn] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
253
+ `
254
+ );
255
+ };
256
+ }
257
+ if (typeof logLevel === "number" && LogLevel.SUCCESS >= logLevel) {
258
+ return (message) => {
259
+ console.info(
260
+ `
261
+ ${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.success ?? DEFAULT_COLOR_CONFIG.dark.success)(`[${CONSOLE_ICONS[LogLevelLabel.SUCCESS]} Success] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
262
+ `
263
+ );
264
+ };
265
+ }
266
+ if (typeof logLevel === "number" && LogLevel.INFO >= logLevel) {
267
+ return (message) => {
268
+ console.info(
269
+ `
270
+ ${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.info ?? DEFAULT_COLOR_CONFIG.dark.info)(`[${CONSOLE_ICONS[LogLevelLabel.INFO]} Info] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
271
+ `
272
+ );
273
+ };
274
+ }
275
+ if (typeof logLevel === "number" && LogLevel.DEBUG >= logLevel) {
276
+ return (message) => {
277
+ console.debug(
278
+ `
279
+ ${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.info ?? DEFAULT_COLOR_CONFIG.dark.info)(`[${CONSOLE_ICONS[LogLevelLabel.DEBUG]} Debug] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
280
+ `
281
+ );
282
+ };
283
+ }
284
+ if (typeof logLevel === "number" && LogLevel.TRACE >= logLevel) {
285
+ return (message) => {
286
+ console.debug(
287
+ `
288
+ ${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.info ?? DEFAULT_COLOR_CONFIG.dark.info)(`[${CONSOLE_ICONS[LogLevelLabel.TRACE]} Trace] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
289
+ `
290
+ );
291
+ };
292
+ }
293
+ return (message) => {
294
+ console.log(
295
+ `
296
+ ${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.brand ?? DEFAULT_COLOR_CONFIG.dark.brand)(`[${CONSOLE_ICONS[LogLevelLabel.ALL]} System] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
297
+ `
298
+ );
299
+ };
300
+ };
301
+ var writeFatal = (message, config) => getLogFn(LogLevel.FATAL, config)(message);
302
+ var writeError = (message, config) => getLogFn(LogLevel.ERROR, config)(message);
303
+ var writeWarning = (message, config) => getLogFn(LogLevel.WARN, config)(message);
304
+ var writeInfo = (message, config) => getLogFn(LogLevel.INFO, config)(message);
305
+ var writeSuccess = (message, config) => getLogFn(LogLevel.SUCCESS, config)(message);
306
+ var writeDebug = (message, config) => getLogFn(LogLevel.DEBUG, config)(message);
307
+ var writeTrace = (message, config) => getLogFn(LogLevel.TRACE, config)(message);
308
+ var getStopwatch = (name) => {
309
+ const start = process.hrtime();
310
+ return () => {
311
+ const end = process.hrtime(start);
312
+ console.info(
313
+ `
314
+ > \u23F1\uFE0F The${name ? ` ${name}` : ""} process took ${Math.round(
315
+ end[0] * 1e3 + end[1] / 1e6
316
+ )}ms to complete
317
+ `
318
+ );
319
+ };
320
+ };
321
+ var MAX_DEPTH = 4;
322
+ var formatLogMessage = (message, options = {}, depth2 = 0) => {
323
+ if (depth2 > MAX_DEPTH) {
324
+ return "<max depth>";
325
+ }
326
+ const prefix = options.prefix ?? "-";
327
+ const skip = options.skip ?? [];
328
+ return typeof message === "undefined" || message === null || !message && typeof message !== "boolean" ? "<none>" : typeof message === "string" ? message : Array.isArray(message) ? `
329
+ ${message.map((item, index) => ` ${prefix}> #${index} = ${formatLogMessage(item, { prefix: `${prefix}-`, skip }, depth2 + 1)}`).join("\n")}` : typeof message === "object" ? `
330
+ ${Object.keys(message).filter((key) => !skip.includes(key)).map(
331
+ (key) => ` ${prefix}> ${key} = ${_isFunction(message[key]) ? "<function>" : typeof message[key] === "object" ? formatLogMessage(
332
+ message[key],
333
+ { prefix: `${prefix}-`, skip },
334
+ depth2 + 1
335
+ ) : message[key]}`
336
+ ).join("\n")}` : message;
337
+ };
338
+ var _isFunction = (value) => {
339
+ try {
340
+ return value instanceof Function || typeof value === "function" || !!(value?.constructor && value?.call && value?.apply);
341
+ } catch {
342
+ return false;
343
+ }
344
+ };
335
345
 
336
- // ../config-tools/src/utilities/get-default-config.ts
337
- import { existsSync as existsSync2 } from "node:fs";
338
- import { readFile } from "node:fs/promises";
339
- import { join as join2 } from "node:path";
346
+ // ../config-tools/src/utilities/apply-workspace-tokens.ts
347
+ init_esm_shims();
340
348
 
341
349
  // ../config-tools/src/utilities/find-workspace-root.ts
342
350
  init_esm_shims();
@@ -436,434 +444,470 @@ Path: ${pathInsideMonorepo ? pathInsideMonorepo : process.cwd()}`
436
444
  return result;
437
445
  }
438
446
 
439
- // ../config-tools/src/utilities/get-default-config.ts
440
- var DEFAULT_COLOR_CONFIG = {
441
- light: {
442
- background: "#fafafa",
443
- foreground: "#1d1e22",
444
- brand: "#1fb2a6",
445
- alternate: "#db2777",
446
- help: "#5C4EE5",
447
- success: "#087f5b",
448
- info: "#0550ae",
449
- warning: "#e3b341",
450
- danger: "#D8314A",
451
- positive: "#22c55e",
452
- negative: "#dc2626"
453
- },
454
- dark: {
455
- background: "#1d1e22",
456
- foreground: "#cbd5e1",
457
- brand: "#2dd4bf",
458
- alternate: "#db2777",
459
- help: "#818cf8",
460
- success: "#10b981",
461
- info: "#58a6ff",
462
- warning: "#f3d371",
463
- danger: "#D8314A",
464
- positive: "#22c55e",
465
- negative: "#dc2626"
447
+ // ../config-tools/src/utilities/apply-workspace-tokens.ts
448
+ var applyWorkspaceBaseTokens = async (option, tokenParams) => {
449
+ let result = option;
450
+ if (!result) {
451
+ return result;
466
452
  }
467
- };
468
- async function getPackageJsonConfig(root) {
469
- let license = STORM_DEFAULT_LICENSE;
470
- let homepage = void 0;
471
- let support = void 0;
472
- let name = void 0;
473
- let namespace = void 0;
474
- let repository = void 0;
475
- const workspaceRoot3 = findWorkspaceRoot(root);
476
- if (existsSync2(join2(workspaceRoot3, "package.json"))) {
477
- const file = await readFile(
478
- joinPaths(workspaceRoot3, "package.json"),
479
- "utf8"
480
- );
481
- if (file) {
482
- const packageJson = JSON.parse(file);
483
- if (packageJson.name) {
484
- name = packageJson.name;
485
- }
486
- if (packageJson.namespace) {
487
- namespace = packageJson.namespace;
488
- }
489
- if (packageJson.repository) {
490
- if (typeof packageJson.repository === "string") {
491
- repository = packageJson.repository;
492
- } else if (packageJson.repository.url) {
493
- repository = packageJson.repository.url;
453
+ if (tokenParams) {
454
+ const optionKeys = Object.keys(tokenParams);
455
+ if (optionKeys.some((optionKey) => result.includes(`{${optionKey}}`))) {
456
+ for (const optionKey of optionKeys) {
457
+ if (result.includes(`{${optionKey}}`)) {
458
+ result = result.replaceAll(
459
+ `{${optionKey}}`,
460
+ tokenParams?.[optionKey] || ""
461
+ );
494
462
  }
495
463
  }
496
- if (packageJson.license) {
497
- license = packageJson.license;
498
- }
499
- if (packageJson.homepage) {
500
- homepage = packageJson.homepage;
501
- }
502
- if (packageJson.bugs) {
503
- if (typeof packageJson.bugs === "string") {
504
- support = packageJson.bugs;
505
- } else if (packageJson.bugs.url) {
506
- support = packageJson.bugs.url;
464
+ }
465
+ }
466
+ if (tokenParams.config) {
467
+ const configKeys = Object.keys(tokenParams.config);
468
+ if (configKeys.some((configKey) => result.includes(`{${configKey}}`))) {
469
+ for (const configKey of configKeys) {
470
+ if (result.includes(`{${configKey}}`)) {
471
+ result = result.replaceAll(
472
+ `{${configKey}}`,
473
+ tokenParams.config[configKey] || ""
474
+ );
507
475
  }
508
476
  }
509
477
  }
510
478
  }
511
- return {
512
- workspaceRoot: workspaceRoot3,
513
- name,
514
- namespace,
515
- repository,
516
- license,
517
- homepage,
518
- support
519
- };
520
- }
521
- function applyDefaultConfig(config) {
522
- if (!config.support && config.contact) {
523
- config.support = config.contact;
479
+ if (result.includes("{workspaceRoot}")) {
480
+ result = result.replaceAll(
481
+ "{workspaceRoot}",
482
+ tokenParams.workspaceRoot ?? tokenParams.config?.workspaceRoot ?? findWorkspaceRoot()
483
+ );
524
484
  }
525
- if (!config.contact && config.support) {
526
- config.contact = config.support;
485
+ return result;
486
+ };
487
+ var applyWorkspaceProjectTokens = (option, tokenParams) => {
488
+ return applyWorkspaceBaseTokens(option, tokenParams);
489
+ };
490
+ var applyWorkspaceTokens = async (options, tokenParams, tokenizerFn) => {
491
+ if (!options) {
492
+ return {};
527
493
  }
528
- if (config.homepage) {
529
- if (!config.docs) {
530
- config.docs = `${config.homepage}/docs`;
531
- }
532
- if (!config.license) {
533
- config.license = `${config.homepage}/license`;
534
- }
535
- if (!config.support) {
536
- config.support = `${config.homepage}/support`;
537
- }
538
- if (!config.contact) {
539
- config.contact = `${config.homepage}/contact`;
540
- }
541
- if (!config.error?.codesFile || !config?.error?.url) {
542
- config.error ??= { codesFile: STORM_DEFAULT_ERROR_CODES_FILE };
543
- if (config.homepage) {
544
- config.error.url ??= `${config.homepage}/errors`;
545
- }
494
+ const result = {};
495
+ for (const option of Object.keys(options)) {
496
+ if (typeof options[option] === "string") {
497
+ result[option] = await Promise.resolve(
498
+ tokenizerFn(options[option], tokenParams)
499
+ );
500
+ } else if (Array.isArray(options[option])) {
501
+ result[option] = await Promise.all(
502
+ options[option].map(
503
+ async (item) => typeof item === "string" ? await Promise.resolve(tokenizerFn(item, tokenParams)) : item
504
+ )
505
+ );
506
+ } else if (typeof options[option] === "object") {
507
+ result[option] = await applyWorkspaceTokens(
508
+ options[option],
509
+ tokenParams,
510
+ tokenizerFn
511
+ );
512
+ } else {
513
+ result[option] = options[option];
546
514
  }
547
515
  }
548
- return config;
549
- }
516
+ return result;
517
+ };
550
518
 
551
- // ../config-tools/src/logger/chalk.ts
519
+ // ../config-tools/src/utilities/get-default-config.ts
552
520
  init_esm_shims();
553
- import chalk from "chalk";
554
- var chalkDefault = {
555
- hex: (_) => (message) => message,
556
- bgHex: (_) => ({
557
- whiteBright: (message) => message,
558
- white: (message) => message
559
- }),
560
- white: (message) => message,
561
- whiteBright: (message) => message,
562
- gray: (message) => message,
563
- bold: {
564
- hex: (_) => (message) => message,
565
- bgHex: (_) => ({
566
- whiteBright: (message) => message,
567
- white: (message) => message
568
- }),
569
- whiteBright: (message) => message,
570
- white: (message) => message
571
- },
572
- dim: {
573
- hex: (_) => (message) => message,
574
- gray: (message) => message
575
- }
576
- };
577
- var getChalk = () => {
578
- let _chalk = chalk;
579
- if (!_chalk?.hex || !_chalk?.bold?.hex || !_chalk?.bgHex || !_chalk?.whiteBright || !_chalk?.white) {
580
- _chalk = chalkDefault;
581
- }
582
- return _chalk;
583
- };
584
521
 
585
- // ../config-tools/src/logger/console-icons.ts
522
+ // ../config/src/index.ts
586
523
  init_esm_shims();
587
524
 
588
- // ../config-tools/src/logger/is-unicode-supported.ts
525
+ // ../config/src/constants.ts
589
526
  init_esm_shims();
590
- function isUnicodeSupported() {
591
- if (process.platform !== "win32") {
592
- return process.env.TERM !== "linux";
593
- }
594
- return Boolean(process.env.WT_SESSION) || // Windows Terminal
595
- Boolean(process.env.TERMINUS_SUBLIME) || // Terminus (<0.2.27)
596
- process.env.ConEmuTask === "{cmd::Cmder}" || // ConEmu and cmder
597
- 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";
598
- }
527
+ var STORM_DEFAULT_DOCS = "https://docs.stormsoftware.com";
528
+ var STORM_DEFAULT_HOMEPAGE = "https://stormsoftware.com";
529
+ var STORM_DEFAULT_CONTACT = "https://stormsoftware.com/contact";
530
+ var STORM_DEFAULT_LICENSING = "https://stormsoftware.com/license";
531
+ var STORM_DEFAULT_LICENSE = "Apache-2.0";
532
+ var STORM_DEFAULT_SOCIAL_TWITTER = "StormSoftwareHQ";
533
+ var STORM_DEFAULT_SOCIAL_DISCORD = "https://discord.gg/MQ6YVzakM5";
534
+ var STORM_DEFAULT_SOCIAL_TELEGRAM = "https://t.me/storm_software";
535
+ var STORM_DEFAULT_SOCIAL_SLACK = "https://join.slack.com/t/storm-software/shared_invite/zt-2gsmk04hs-i6yhK_r6urq0dkZYAwq2pA";
536
+ var STORM_DEFAULT_SOCIAL_MEDIUM = "https://medium.com/storm-software";
537
+ var STORM_DEFAULT_SOCIAL_GITHUB = "https://github.com/storm-software";
538
+ var STORM_DEFAULT_RELEASE_FOOTER = `
539
+ Storm Software is an open source software development organization with the mission is to make software development more accessible. Our ideal future is one where anyone can create software without years of prior development experience serving as a barrier to entry. We hope to achieve this via LLMs, Generative AI, and intuitive, high-level data modeling/programming languages.
599
540
 
600
- // ../config-tools/src/logger/console-icons.ts
601
- var useIcon = (c, fallback) => isUnicodeSupported() ? c : fallback;
602
- var CONSOLE_ICONS = {
603
- [LogLevelLabel.ERROR]: useIcon("\u2718", "\xD7"),
604
- [LogLevelLabel.FATAL]: useIcon("\u{1F480}", "\xD7"),
605
- [LogLevelLabel.WARN]: useIcon("\u26A0", "\u203C"),
606
- [LogLevelLabel.INFO]: useIcon("\u2139", "i"),
607
- [LogLevelLabel.SUCCESS]: useIcon("\u2714", "\u221A"),
608
- [LogLevelLabel.DEBUG]: useIcon("\u{1F6E0}", "D"),
609
- [LogLevelLabel.TRACE]: useIcon("\u{1F6E0}", "T"),
610
- [LogLevelLabel.ALL]: useIcon("\u2709", "\u2192")
611
- };
541
+ Join us on [Discord](${STORM_DEFAULT_SOCIAL_DISCORD}) to chat with the team, receive release notifications, ask questions, and get involved.
612
542
 
613
- // ../config-tools/src/logger/format-timestamp.ts
543
+ If this sounds interesting, and you would like to help us in creating the next generation of development tools, please reach out on our [website](${STORM_DEFAULT_CONTACT}) or join our [Slack](${STORM_DEFAULT_SOCIAL_SLACK}) channel!
544
+ `;
545
+ var STORM_DEFAULT_ERROR_CODES_FILE = "tools/errors/codes.json";
546
+
547
+ // ../config/src/define-config.ts
614
548
  init_esm_shims();
615
- var formatTimestamp = (date = /* @__PURE__ */ new Date()) => {
616
- return `${date.toLocaleDateString()} ${date.toLocaleTimeString()}`;
617
- };
618
549
 
619
- // ../config-tools/src/logger/get-log-level.ts
550
+ // ../config/src/schema.ts
620
551
  init_esm_shims();
621
- var getLogLevel = (label) => {
622
- switch (label) {
623
- case "all":
624
- return LogLevel.ALL;
625
- case "trace":
626
- return LogLevel.TRACE;
627
- case "debug":
628
- return LogLevel.DEBUG;
629
- case "info":
630
- return LogLevel.INFO;
631
- case "warn":
632
- return LogLevel.WARN;
633
- case "error":
634
- return LogLevel.ERROR;
635
- case "fatal":
636
- return LogLevel.FATAL;
637
- case "silent":
638
- return LogLevel.SILENT;
639
- default:
640
- return LogLevel.INFO;
641
- }
642
- };
643
- var getLogLevelLabel = (logLevel = LogLevel.INFO) => {
644
- if (logLevel >= LogLevel.ALL) {
645
- return LogLevelLabel.ALL;
646
- }
647
- if (logLevel >= LogLevel.TRACE) {
648
- return LogLevelLabel.TRACE;
649
- }
650
- if (logLevel >= LogLevel.DEBUG) {
651
- return LogLevelLabel.DEBUG;
652
- }
653
- if (logLevel >= LogLevel.INFO) {
654
- return LogLevelLabel.INFO;
655
- }
656
- if (logLevel >= LogLevel.WARN) {
657
- return LogLevelLabel.WARN;
658
- }
659
- if (logLevel >= LogLevel.ERROR) {
660
- return LogLevelLabel.ERROR;
661
- }
662
- if (logLevel >= LogLevel.FATAL) {
663
- return LogLevelLabel.FATAL;
664
- }
665
- if (logLevel <= LogLevel.SILENT) {
666
- return LogLevelLabel.SILENT;
667
- }
668
- return LogLevelLabel.INFO;
669
- };
670
-
671
- // ../config-tools/src/logger/console.ts
672
- var getLogFn = (logLevel = LogLevel.INFO, config = {}, _chalk = getChalk()) => {
673
- 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;
674
- const configLogLevel = config.logLevel || process.env.STORM_LOG_LEVEL || LogLevelLabel.INFO;
675
- if (logLevel > getLogLevel(configLogLevel) || logLevel <= LogLevel.SILENT || getLogLevel(configLogLevel) <= LogLevel.SILENT) {
676
- return (_) => {
677
- };
678
- }
679
- if (typeof logLevel === "number" && LogLevel.FATAL >= logLevel) {
680
- return (message) => {
681
- console.error(
682
- `
683
- ${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.fatal ?? "#7d1a1a")(`[${CONSOLE_ICONS[LogLevelLabel.FATAL]} Fatal] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
684
- `
685
- );
686
- };
687
- }
688
- if (typeof logLevel === "number" && LogLevel.ERROR >= logLevel) {
689
- return (message) => {
690
- console.error(
691
- `
692
- ${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.danger ?? "#f85149")(`[${CONSOLE_ICONS[LogLevelLabel.ERROR]} Error] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
693
- `
694
- );
695
- };
696
- }
697
- if (typeof logLevel === "number" && LogLevel.WARN >= logLevel) {
698
- return (message) => {
699
- console.warn(
700
- `
701
- ${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.warning ?? "#e3b341")(`[${CONSOLE_ICONS[LogLevelLabel.WARN]} Warn] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
702
- `
703
- );
704
- };
705
- }
706
- if (typeof logLevel === "number" && LogLevel.SUCCESS >= logLevel) {
707
- return (message) => {
708
- console.info(
709
- `
710
- ${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.success ?? "#56d364")(`[${CONSOLE_ICONS[LogLevelLabel.SUCCESS]} Success] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
711
- `
712
- );
713
- };
714
- }
715
- if (typeof logLevel === "number" && LogLevel.INFO >= logLevel) {
716
- return (message) => {
717
- console.info(
718
- `
719
- ${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.info ?? "#58a6ff")(`[${CONSOLE_ICONS[LogLevelLabel.INFO]} Info] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
720
- `
721
- );
722
- };
723
- }
724
- if (typeof logLevel === "number" && LogLevel.DEBUG >= logLevel) {
725
- return (message) => {
726
- console.debug(
727
- `
728
- ${_chalk.gray(formatTimestamp())} ${_chalk.hex("#3e9eff")(`[${CONSOLE_ICONS[LogLevelLabel.DEBUG]} Debug] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
729
- `
730
- );
731
- };
732
- }
733
- if (typeof logLevel === "number" && LogLevel.TRACE >= logLevel) {
734
- return (message) => {
735
- console.debug(
736
- `
737
- ${_chalk.gray(formatTimestamp())} ${_chalk.hex("#0070E0")(`[${CONSOLE_ICONS[LogLevelLabel.TRACE]} Trace] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
738
- `
739
- );
740
- };
741
- }
742
- return (message) => {
743
- console.log(
744
- `
745
- ${_chalk.gray(formatTimestamp())} ${_chalk.hex("#0356a8")(`[${CONSOLE_ICONS[LogLevelLabel.ALL]} System] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
746
- `
747
- );
748
- };
749
- };
750
- var writeFatal = (message, config) => getLogFn(LogLevel.FATAL, config)(message);
751
- var writeError = (message, config) => getLogFn(LogLevel.ERROR, config)(message);
752
- var writeWarning = (message, config) => getLogFn(LogLevel.WARN, config)(message);
753
- var writeInfo = (message, config) => getLogFn(LogLevel.INFO, config)(message);
754
- var writeSuccess = (message, config) => getLogFn(LogLevel.SUCCESS, config)(message);
755
- var writeDebug = (message, config) => getLogFn(LogLevel.DEBUG, config)(message);
756
- var writeTrace = (message, config) => getLogFn(LogLevel.TRACE, config)(message);
757
- var getStopwatch = (name) => {
758
- const start = process.hrtime();
759
- return () => {
760
- const end = process.hrtime(start);
761
- console.info(
762
- `
763
- > \u23F1\uFE0F The${name ? ` ${name}` : ""} process took ${Math.round(
764
- end[0] * 1e3 + end[1] / 1e6
765
- )}ms to complete
766
- `
767
- );
768
- };
769
- };
770
- var MAX_DEPTH = 4;
771
- var formatLogMessage = (message, options = {}, depth2 = 0) => {
772
- if (depth2 > MAX_DEPTH) {
773
- return "<max depth>";
774
- }
775
- const prefix = options.prefix ?? "-";
776
- const skip = options.skip ?? [];
777
- return typeof message === "undefined" || message === null || !message && typeof message !== "boolean" ? "<none>" : typeof message === "string" ? message : Array.isArray(message) ? `
778
- ${message.map((item, index) => ` ${prefix}> #${index} = ${formatLogMessage(item, { prefix: `${prefix}-`, skip }, depth2 + 1)}`).join("\n")}` : typeof message === "object" ? `
779
- ${Object.keys(message).filter((key) => !skip.includes(key)).map(
780
- (key) => ` ${prefix}> ${key} = ${_isFunction(message[key]) ? "<function>" : typeof message[key] === "object" ? formatLogMessage(
781
- message[key],
782
- { prefix: `${prefix}-`, skip },
783
- depth2 + 1
784
- ) : message[key]}`
785
- ).join("\n")}` : message;
786
- };
787
- var _isFunction = (value) => {
788
- try {
789
- return value instanceof Function || typeof value === "function" || !!(value?.constructor && value?.call && value?.apply);
790
- } catch (e) {
791
- return false;
792
- }
793
- };
552
+ import * as z from "zod";
553
+ var ColorSchema = z.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7);
554
+ var DarkColorSchema = ColorSchema.default("#151718").describe(
555
+ "The dark background color of the workspace"
556
+ );
557
+ var LightColorSchema = ColorSchema.default("#cbd5e1").describe(
558
+ "The light background color of the workspace"
559
+ );
560
+ var BrandColorSchema = ColorSchema.default("#1fb2a6").describe(
561
+ "The primary brand specific color of the workspace"
562
+ );
563
+ var AlternateColorSchema = ColorSchema.optional().describe(
564
+ "The alternate brand specific color of the workspace"
565
+ );
566
+ var AccentColorSchema = ColorSchema.optional().describe(
567
+ "The secondary brand specific color of the workspace"
568
+ );
569
+ var LinkColorSchema = ColorSchema.default("#3fa6ff").describe(
570
+ "The color used to display hyperlink text"
571
+ );
572
+ var HelpColorSchema = ColorSchema.default("#818cf8").describe(
573
+ "The second brand specific color of the workspace"
574
+ );
575
+ var SuccessColorSchema = ColorSchema.default("#45b27e").describe(
576
+ "The success color of the workspace"
577
+ );
578
+ var InfoColorSchema = ColorSchema.default("#38bdf8").describe(
579
+ "The informational color of the workspace"
580
+ );
581
+ var WarningColorSchema = ColorSchema.default("#f3d371").describe(
582
+ "The warning color of the workspace"
583
+ );
584
+ var DangerColorSchema = ColorSchema.default("#d8314a").describe(
585
+ "The danger color of the workspace"
586
+ );
587
+ var FatalColorSchema = ColorSchema.optional().describe(
588
+ "The fatal color of the workspace"
589
+ );
590
+ var PositiveColorSchema = ColorSchema.default("#4ade80").describe(
591
+ "The positive number color of the workspace"
592
+ );
593
+ var NegativeColorSchema = ColorSchema.default("#ef4444").describe(
594
+ "The negative number color of the workspace"
595
+ );
596
+ var GradientStopsSchema = z.array(ColorSchema).optional().describe(
597
+ "The color stops for the base gradient color pattern used in the workspace"
598
+ );
599
+ var DarkThemeColorConfigSchema = z.object({
600
+ foreground: LightColorSchema,
601
+ background: DarkColorSchema,
602
+ brand: BrandColorSchema,
603
+ alternate: AlternateColorSchema,
604
+ accent: AccentColorSchema,
605
+ link: LinkColorSchema,
606
+ help: HelpColorSchema,
607
+ success: SuccessColorSchema,
608
+ info: InfoColorSchema,
609
+ warning: WarningColorSchema,
610
+ danger: DangerColorSchema,
611
+ fatal: FatalColorSchema,
612
+ positive: PositiveColorSchema,
613
+ negative: NegativeColorSchema,
614
+ gradient: GradientStopsSchema
615
+ });
616
+ var LightThemeColorConfigSchema = z.object({
617
+ foreground: DarkColorSchema,
618
+ background: LightColorSchema,
619
+ brand: BrandColorSchema,
620
+ alternate: AlternateColorSchema,
621
+ accent: AccentColorSchema,
622
+ link: LinkColorSchema,
623
+ help: HelpColorSchema,
624
+ success: SuccessColorSchema,
625
+ info: InfoColorSchema,
626
+ warning: WarningColorSchema,
627
+ danger: DangerColorSchema,
628
+ fatal: FatalColorSchema,
629
+ positive: PositiveColorSchema,
630
+ negative: NegativeColorSchema,
631
+ gradient: GradientStopsSchema
632
+ });
633
+ var MultiThemeColorConfigSchema = z.object({
634
+ dark: DarkThemeColorConfigSchema,
635
+ light: LightThemeColorConfigSchema
636
+ });
637
+ var SingleThemeColorConfigSchema = z.object({
638
+ dark: DarkColorSchema,
639
+ light: LightColorSchema,
640
+ brand: BrandColorSchema,
641
+ alternate: AlternateColorSchema,
642
+ accent: AccentColorSchema,
643
+ link: LinkColorSchema,
644
+ help: HelpColorSchema,
645
+ success: SuccessColorSchema,
646
+ info: InfoColorSchema,
647
+ warning: WarningColorSchema,
648
+ danger: DangerColorSchema,
649
+ fatal: FatalColorSchema,
650
+ positive: PositiveColorSchema,
651
+ negative: NegativeColorSchema,
652
+ gradient: GradientStopsSchema
653
+ });
654
+ var RegistryUrlConfigSchema = z.url().optional().describe("A remote registry URL used to publish distributable packages");
655
+ var RegistryConfigSchema = z.object({
656
+ github: RegistryUrlConfigSchema,
657
+ npm: RegistryUrlConfigSchema,
658
+ cargo: RegistryUrlConfigSchema,
659
+ cyclone: RegistryUrlConfigSchema,
660
+ container: RegistryUrlConfigSchema
661
+ }).default({}).describe("A list of remote registry URLs used by Storm Software");
662
+ var ColorConfigSchema = SingleThemeColorConfigSchema.or(
663
+ MultiThemeColorConfigSchema
664
+ ).describe("Colors used for various workspace elements");
665
+ var ColorConfigMapSchema = z.record(
666
+ z.union([z.literal("base"), z.string()]),
667
+ ColorConfigSchema
668
+ );
669
+ var ExtendsItemSchema = z.string().trim().describe(
670
+ "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."
671
+ );
672
+ var ExtendsSchema = ExtendsItemSchema.or(
673
+ z.array(ExtendsItemSchema)
674
+ ).describe(
675
+ "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."
676
+ );
677
+ var WorkspaceBotConfigSchema = z.object({
678
+ name: z.string().trim().default("stormie-bot").describe(
679
+ "The workspace bot user's name (this is the bot that will be used to perform various tasks)"
680
+ ),
681
+ email: z.email().default("bot@stormsoftware.com").describe("The email of the workspace bot")
682
+ }).describe(
683
+ "The workspace's bot user's config used to automated various operations tasks"
684
+ );
685
+ var WorkspaceReleaseConfigSchema = z.object({
686
+ banner: z.string().trim().optional().describe(
687
+ "A URL to a banner image used to display the workspace's release"
688
+ ),
689
+ header: z.string().trim().optional().describe(
690
+ "A header message appended to the start of the workspace's release notes"
691
+ ),
692
+ footer: z.string().trim().optional().describe(
693
+ "A footer message appended to the end of the workspace's release notes"
694
+ )
695
+ }).describe("The workspace's release config used during the release process");
696
+ var WorkspaceSocialsConfigSchema = z.object({
697
+ twitter: z.string().trim().default(STORM_DEFAULT_SOCIAL_TWITTER).describe("A Twitter/X account associated with the organization/project"),
698
+ discord: z.string().trim().default(STORM_DEFAULT_SOCIAL_DISCORD).describe("A Discord account associated with the organization/project"),
699
+ telegram: z.string().trim().default(STORM_DEFAULT_SOCIAL_TELEGRAM).describe("A Telegram account associated with the organization/project"),
700
+ slack: z.string().trim().default(STORM_DEFAULT_SOCIAL_SLACK).describe("A Slack account associated with the organization/project"),
701
+ medium: z.string().trim().default(STORM_DEFAULT_SOCIAL_MEDIUM).describe("A Medium account associated with the organization/project"),
702
+ github: z.string().trim().default(STORM_DEFAULT_SOCIAL_GITHUB).describe("A GitHub account associated with the organization/project")
703
+ }).describe(
704
+ "The workspace's account config used to store various social media links"
705
+ );
706
+ var WorkspaceDirectoryConfigSchema = z.object({
707
+ cache: z.string().trim().optional().describe(
708
+ "The directory used to store the environment's cached file data"
709
+ ),
710
+ data: z.string().trim().optional().describe("The directory used to store the environment's data files"),
711
+ config: z.string().trim().optional().describe(
712
+ "The directory used to store the environment's configuration files"
713
+ ),
714
+ temp: z.string().trim().optional().describe("The directory used to store the environment's temp files"),
715
+ log: z.string().trim().optional().describe("The directory used to store the environment's temp files"),
716
+ build: z.string().trim().default("dist").describe(
717
+ "The directory used to store the workspace's distributable files after a build (relative to the workspace root)"
718
+ )
719
+ }).describe(
720
+ "Various directories used by the workspace to store data, cache, and configuration files"
721
+ );
722
+ var errorConfigSchema = z.object({
723
+ codesFile: z.string().trim().default(STORM_DEFAULT_ERROR_CODES_FILE).describe("The path to the workspace's error codes JSON file"),
724
+ url: z.url().optional().describe(
725
+ "A URL to a page that looks up the workspace's error messages given a specific error code"
726
+ )
727
+ }).describe("The workspace's error config used during the error process");
728
+ var organizationConfigSchema = z.object({
729
+ name: z.string().trim().describe("The name of the organization"),
730
+ description: z.string().trim().optional().describe("A description of the organization"),
731
+ logo: z.url().optional().describe("A URL to the organization's logo image"),
732
+ icon: z.url().optional().describe("A URL to the organization's icon image"),
733
+ url: z.url().optional().describe(
734
+ "A URL to a page that provides more information about the organization"
735
+ )
736
+ }).describe("The workspace's organization details");
737
+ var stormWorkspaceConfigSchema = z.object({
738
+ $schema: z.string().trim().default(
739
+ "https://public.storm-cdn.com/schemas/storm-workspace.schema.json"
740
+ ).describe(
741
+ "The URL or file path to the JSON schema file that describes the Storm configuration file"
742
+ ),
743
+ extends: ExtendsSchema.optional(),
744
+ name: z.string().trim().toLowerCase().optional().describe(
745
+ "The name of the service/package/scope using this configuration"
746
+ ),
747
+ namespace: z.string().trim().toLowerCase().optional().describe("The namespace of the package"),
748
+ organization: organizationConfigSchema.or(z.string().trim().describe("The organization of the workspace")).optional().describe(
749
+ "The organization of the workspace. This can be a string or an object containing the organization's details"
750
+ ),
751
+ repository: z.string().trim().optional().describe("The repo URL of the workspace (i.e. GitHub)"),
752
+ license: z.string().trim().default("Apache-2.0").describe("The license type of the package"),
753
+ homepage: z.url().optional().describe("The homepage of the workspace"),
754
+ docs: z.url().optional().describe("The documentation site for the workspace"),
755
+ portal: z.url().optional().describe("The development portal site for the workspace"),
756
+ licensing: z.url().optional().describe("The licensing site for the workspace"),
757
+ contact: z.url().optional().describe("The contact site for the workspace"),
758
+ support: z.url().optional().describe(
759
+ "The support site for the workspace. If not provided, this is defaulted to the `contact` config value"
760
+ ),
761
+ branch: z.string().trim().default("main").describe("The branch of the workspace"),
762
+ preid: z.string().optional().describe("A tag specifying the version pre-release identifier"),
763
+ owner: z.string().trim().default("@storm-software/admin").describe("The owner of the package"),
764
+ bot: WorkspaceBotConfigSchema,
765
+ release: WorkspaceReleaseConfigSchema,
766
+ socials: WorkspaceSocialsConfigSchema,
767
+ error: errorConfigSchema,
768
+ mode: z.string().trim().default("production").describe("The current runtime environment mode for the package"),
769
+ workspaceRoot: z.string().trim().describe("The root directory of the workspace"),
770
+ skipCache: z.boolean().default(false).describe("Should all known types of workspace caching be skipped?"),
771
+ directories: WorkspaceDirectoryConfigSchema,
772
+ packageManager: z.enum(["npm", "yarn", "pnpm", "bun"]).default("npm").describe(
773
+ "The JavaScript/TypeScript package manager used by the repository"
774
+ ),
775
+ timezone: z.string().trim().default("America/New_York").describe("The default timezone of the workspace"),
776
+ locale: z.string().trim().default("en-US").describe("The default locale of the workspace"),
777
+ logLevel: z.enum([
778
+ "silent",
779
+ "fatal",
780
+ "error",
781
+ "warn",
782
+ "success",
783
+ "info",
784
+ "debug",
785
+ "trace",
786
+ "all"
787
+ ]).default("info").describe(
788
+ "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`)."
789
+ ),
790
+ skipConfigLogging: z.boolean().optional().describe(
791
+ "Should the logging of the current Storm Workspace configuration be skipped?"
792
+ ),
793
+ registry: RegistryConfigSchema,
794
+ configFile: z.string().trim().nullable().default(null).describe(
795
+ "The filepath of the Storm config. When this field is null, no config file was found in the current workspace."
796
+ ),
797
+ colors: ColorConfigSchema.or(ColorConfigMapSchema).describe(
798
+ "Storm theme config values used for styling various package elements"
799
+ ),
800
+ extensions: z.record(z.string(), z.any()).optional().default({}).describe("Configuration of each used extension")
801
+ }).describe(
802
+ "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."
803
+ );
794
804
 
795
- // ../config-tools/src/utilities/apply-workspace-tokens.ts
805
+ // ../config/src/types.ts
796
806
  init_esm_shims();
797
- var applyWorkspaceBaseTokens = async (option, tokenParams) => {
798
- let result = option;
799
- if (!result) {
800
- return result;
801
- }
802
- if (tokenParams) {
803
- const optionKeys = Object.keys(tokenParams);
804
- if (optionKeys.some((optionKey) => result.includes(`{${optionKey}}`))) {
805
- for (const optionKey of optionKeys) {
806
- if (result.includes(`{${optionKey}}`)) {
807
- result = result.replaceAll(
808
- `{${optionKey}}`,
809
- tokenParams?.[optionKey] || ""
810
- );
807
+ var COLOR_KEYS = [
808
+ "dark",
809
+ "light",
810
+ "base",
811
+ "brand",
812
+ "alternate",
813
+ "accent",
814
+ "link",
815
+ "success",
816
+ "help",
817
+ "info",
818
+ "warning",
819
+ "danger",
820
+ "fatal",
821
+ "positive",
822
+ "negative"
823
+ ];
824
+
825
+ // ../config-tools/src/utilities/get-default-config.ts
826
+ import { existsSync as existsSync2 } from "node:fs";
827
+ import { readFile } from "node:fs/promises";
828
+ import { join as join2 } from "node:path";
829
+ async function getPackageJsonConfig(root) {
830
+ let license = STORM_DEFAULT_LICENSE;
831
+ let homepage = void 0;
832
+ let support = void 0;
833
+ let name = void 0;
834
+ let namespace = void 0;
835
+ let repository = void 0;
836
+ const workspaceRoot3 = findWorkspaceRoot(root);
837
+ if (existsSync2(join2(workspaceRoot3, "package.json"))) {
838
+ const file = await readFile(
839
+ joinPaths(workspaceRoot3, "package.json"),
840
+ "utf8"
841
+ );
842
+ if (file) {
843
+ const packageJson = JSON.parse(file);
844
+ if (packageJson.name) {
845
+ name = packageJson.name;
846
+ }
847
+ if (packageJson.namespace) {
848
+ namespace = packageJson.namespace;
849
+ }
850
+ if (packageJson.repository) {
851
+ if (typeof packageJson.repository === "string") {
852
+ repository = packageJson.repository;
853
+ } else if (packageJson.repository.url) {
854
+ repository = packageJson.repository.url;
811
855
  }
812
856
  }
813
- }
814
- }
815
- if (tokenParams.config) {
816
- const configKeys = Object.keys(tokenParams.config);
817
- if (configKeys.some((configKey) => result.includes(`{${configKey}}`))) {
818
- for (const configKey of configKeys) {
819
- if (result.includes(`{${configKey}}`)) {
820
- result = result.replaceAll(
821
- `{${configKey}}`,
822
- tokenParams.config[configKey] || ""
823
- );
857
+ if (packageJson.license) {
858
+ license = packageJson.license;
859
+ }
860
+ if (packageJson.homepage) {
861
+ homepage = packageJson.homepage;
862
+ }
863
+ if (packageJson.bugs) {
864
+ if (typeof packageJson.bugs === "string") {
865
+ support = packageJson.bugs;
866
+ } else if (packageJson.bugs.url) {
867
+ support = packageJson.bugs.url;
824
868
  }
825
869
  }
826
870
  }
827
871
  }
828
- if (result.includes("{workspaceRoot}")) {
829
- result = result.replaceAll(
830
- "{workspaceRoot}",
831
- tokenParams.workspaceRoot ?? tokenParams.config?.workspaceRoot ?? findWorkspaceRoot()
832
- );
872
+ return {
873
+ workspaceRoot: workspaceRoot3,
874
+ name,
875
+ namespace,
876
+ repository,
877
+ license,
878
+ homepage,
879
+ support
880
+ };
881
+ }
882
+ function applyDefaultConfig(config) {
883
+ if (!config.support && config.contact) {
884
+ config.support = config.contact;
833
885
  }
834
- return result;
835
- };
836
- var applyWorkspaceProjectTokens = (option, tokenParams) => {
837
- return applyWorkspaceBaseTokens(option, tokenParams);
838
- };
839
- var applyWorkspaceTokens = async (options, tokenParams, tokenizerFn) => {
840
- if (!options) {
841
- return {};
886
+ if (!config.contact && config.support) {
887
+ config.contact = config.support;
842
888
  }
843
- const result = {};
844
- for (const option of Object.keys(options)) {
845
- if (typeof options[option] === "string") {
846
- result[option] = await Promise.resolve(
847
- tokenizerFn(options[option], tokenParams)
848
- );
849
- } else if (Array.isArray(options[option])) {
850
- result[option] = await Promise.all(
851
- options[option].map(
852
- async (item) => typeof item === "string" ? await Promise.resolve(tokenizerFn(item, tokenParams)) : item
853
- )
854
- );
855
- } else if (typeof options[option] === "object") {
856
- result[option] = await applyWorkspaceTokens(
857
- options[option],
858
- tokenParams,
859
- tokenizerFn
860
- );
861
- } else {
862
- result[option] = options[option];
889
+ if (config.homepage) {
890
+ if (!config.docs) {
891
+ config.docs = `${config.homepage}/docs`;
892
+ }
893
+ if (!config.license) {
894
+ config.license = `${config.homepage}/license`;
895
+ }
896
+ if (!config.support) {
897
+ config.support = `${config.homepage}/support`;
898
+ }
899
+ if (!config.contact) {
900
+ config.contact = `${config.homepage}/contact`;
901
+ }
902
+ if (!config.error?.codesFile || !config?.error?.url) {
903
+ config.error ??= { codesFile: STORM_DEFAULT_ERROR_CODES_FILE };
904
+ if (config.homepage) {
905
+ config.error.url ??= `${config.homepage}/errors`;
906
+ }
863
907
  }
864
908
  }
865
- return result;
866
- };
909
+ return config;
910
+ }
867
911
 
868
912
  // ../config-tools/src/config-file/get-config-file.ts
869
913
  var getConfigFileByName = async (fileName, filePath, options = {}) => {
@@ -1084,6 +1128,19 @@ var getThemeColorConfigEnv = (prefix, theme) => {
1084
1128
  return process.env[`${prefix}${themeName}LIGHT_BRAND`] || process.env[`${prefix}${themeName}DARK_BRAND`] ? getMultiThemeColorConfigEnv(prefix + themeName) : getSingleThemeColorConfigEnv(prefix + themeName);
1085
1129
  };
1086
1130
  var getSingleThemeColorConfigEnv = (prefix) => {
1131
+ const gradient = [];
1132
+ if (process.env[`${prefix}GRADIENT_START`] && process.env[`${prefix}GRADIENT_END`]) {
1133
+ gradient.push(
1134
+ process.env[`${prefix}GRADIENT_START`],
1135
+ process.env[`${prefix}GRADIENT_END`]
1136
+ );
1137
+ } else if (process.env[`${prefix}GRADIENT_0`] || process.env[`${prefix}GRADIENT_1`]) {
1138
+ let index = process.env[`${prefix}GRADIENT_0`] ? 0 : 1;
1139
+ while (process.env[`${prefix}GRADIENT_${index}`]) {
1140
+ gradient.push(process.env[`${prefix}GRADIENT_${index}`]);
1141
+ index++;
1142
+ }
1143
+ }
1087
1144
  return {
1088
1145
  dark: process.env[`${prefix}DARK`],
1089
1146
  light: process.env[`${prefix}LIGHT`],
@@ -1098,7 +1155,8 @@ var getSingleThemeColorConfigEnv = (prefix) => {
1098
1155
  danger: process.env[`${prefix}DANGER`],
1099
1156
  fatal: process.env[`${prefix}FATAL`],
1100
1157
  positive: process.env[`${prefix}POSITIVE`],
1101
- negative: process.env[`${prefix}NEGATIVE`]
1158
+ negative: process.env[`${prefix}NEGATIVE`],
1159
+ gradient
1102
1160
  };
1103
1161
  };
1104
1162
  var getMultiThemeColorConfigEnv = (prefix) => {
@@ -1110,6 +1168,19 @@ var getMultiThemeColorConfigEnv = (prefix) => {
1110
1168
  };
1111
1169
  };
1112
1170
  var getBaseThemeColorConfigEnv = (prefix) => {
1171
+ const gradient = [];
1172
+ if (process.env[`${prefix}GRADIENT_START`] && process.env[`${prefix}GRADIENT_END`]) {
1173
+ gradient.push(
1174
+ process.env[`${prefix}GRADIENT_START`],
1175
+ process.env[`${prefix}GRADIENT_END`]
1176
+ );
1177
+ } else if (process.env[`${prefix}GRADIENT_0`] || process.env[`${prefix}GRADIENT_1`]) {
1178
+ let index = process.env[`${prefix}GRADIENT_0`] ? 0 : 1;
1179
+ while (process.env[`${prefix}GRADIENT_${index}`]) {
1180
+ gradient.push(process.env[`${prefix}GRADIENT_${index}`]);
1181
+ index++;
1182
+ }
1183
+ }
1113
1184
  return {
1114
1185
  foreground: process.env[`${prefix}FOREGROUND`],
1115
1186
  background: process.env[`${prefix}BACKGROUND`],
@@ -1124,7 +1195,8 @@ var getBaseThemeColorConfigEnv = (prefix) => {
1124
1195
  danger: process.env[`${prefix}DANGER`],
1125
1196
  fatal: process.env[`${prefix}FATAL`],
1126
1197
  positive: process.env[`${prefix}POSITIVE`],
1127
- negative: process.env[`${prefix}NEGATIVE`]
1198
+ negative: process.env[`${prefix}NEGATIVE`],
1199
+ gradient
1128
1200
  };
1129
1201
  };
1130
1202
 
@@ -1256,11 +1328,12 @@ var setConfigEnv = (config) => {
1256
1328
  process.env[`${prefix}TIMEZONE`] = config.timezone;
1257
1329
  process.env.TZ = config.timezone;
1258
1330
  process.env.DEFAULT_TIMEZONE = config.timezone;
1331
+ process.env.TIMEZONE = config.timezone;
1259
1332
  }
1260
1333
  if (config.locale) {
1261
1334
  process.env[`${prefix}LOCALE`] = config.locale;
1262
- process.env.LOCALE = config.locale;
1263
1335
  process.env.DEFAULT_LOCALE = config.locale;
1336
+ process.env.LOCALE = config.locale;
1264
1337
  process.env.LANG = config.locale ? `${config.locale.replaceAll("-", "_")}.UTF-8` : "en_US.UTF-8";
1265
1338
  }
1266
1339
  if (config.configFile) {
@@ -1421,6 +1494,11 @@ var setSingleThemeColorConfigEnv = (prefix, config) => {
1421
1494
  if (config.negative) {
1422
1495
  process.env[`${prefix}NEGATIVE`] = config.negative;
1423
1496
  }
1497
+ if (config.gradient) {
1498
+ for (let i = 0; i < config.gradient.length; i++) {
1499
+ process.env[`${prefix}GRADIENT_${i}`] = config.gradient[i];
1500
+ }
1501
+ }
1424
1502
  };
1425
1503
  var setMultiThemeColorConfigEnv = (prefix, config) => {
1426
1504
  return {
@@ -1471,6 +1549,11 @@ var setBaseThemeColorConfigEnv = (prefix, config) => {
1471
1549
  if (config.negative) {
1472
1550
  process.env[`${prefix}NEGATIVE`] = config.negative;
1473
1551
  }
1552
+ if (config.gradient) {
1553
+ for (let i = 0; i < config.gradient.length; i++) {
1554
+ process.env[`${prefix}GRADIENT_${i}`] = config.gradient[i];
1555
+ }
1556
+ }
1474
1557
  };
1475
1558
 
1476
1559
  // ../config-tools/src/create-storm-config.ts
@@ -2894,7 +2977,7 @@ async function sizeLimitExecutorFn(options, context, config) {
2894
2977
  "The Size-Limit process failed because the context is not valid. Please run this command from a workspace."
2895
2978
  );
2896
2979
  }
2897
- writeInfo(`\u{1F4CF} Running Size-Limit on ${context.projectName}`, config);
2980
+ writeInfo(`\u{1F4CF} Running Size-Limit on ${context.projectName}`, config);
2898
2981
  sizeLimit([filePlugin, esBuildPlugin, esBuildWhyPlugin], {
2899
2982
  checks: options.entry ?? context.projectsConfigurations.projects[context.projectName]?.sourceRoot ?? joinPathFragments4(
2900
2983
  context.projectsConfigurations.projects[context.projectName]?.root ?? "./",
@@ -2902,7 +2985,7 @@ async function sizeLimitExecutorFn(options, context, config) {
2902
2985
  )
2903
2986
  }).then((result) => {
2904
2987
  writeInfo(
2905
- `\u{1F4CF} ${context.projectName} Size-Limit result: ${JSON.stringify(result)}`,
2988
+ `\u{1F4CF} ${context.projectName} Size-Limit result: ${JSON.stringify(result)}`,
2906
2989
  config
2907
2990
  );
2908
2991
  });
@@ -4648,6 +4731,9 @@ var YARN_LOCK_PATH = join4(workspaceRoot2, YARN_LOCK_FILE);
4648
4731
  var NPM_LOCK_PATH = join4(workspaceRoot2, NPM_LOCK_FILE);
4649
4732
  var PNPM_LOCK_PATH = join4(workspaceRoot2, PNPM_LOCK_FILE);
4650
4733
 
4734
+ // ../workspace-tools/src/utils/nx-json.ts
4735
+ init_esm_shims();
4736
+
4651
4737
  // ../workspace-tools/src/utils/plugin-helpers.ts
4652
4738
  init_esm_shims();
4653
4739
  import {