@storm-software/eslint 0.159.9 → 0.159.11

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/dist/preset.js CHANGED
@@ -5,14 +5,16 @@ import {
5
5
  isPackageInScope,
6
6
  parserPlain,
7
7
  renameRules
8
- } from "./chunk-2JAS25NL.js";
8
+ } from "./chunk-RYB2G356.js";
9
9
  import {
10
10
  getTsConfigPath
11
- } from "./chunk-LURSUA23.js";
11
+ } from "./chunk-SGJC2PIV.js";
12
12
  import {
13
13
  banner_plugin_default
14
- } from "./chunk-F5ULWOMY.js";
15
- import "./chunk-7HV2SCAT.js";
14
+ } from "./chunk-IDI2VOSV.js";
15
+ import {
16
+ getFileBanner
17
+ } from "./chunk-JPQ3H24H.js";
16
18
  import {
17
19
  GLOB_ASTRO,
18
20
  GLOB_ASTRO_TS,
@@ -39,22 +41,22 @@ import {
39
41
  GLOB_TSX,
40
42
  GLOB_XML,
41
43
  GLOB_YAML
42
- } from "./chunk-Z4QO5BZJ.js";
44
+ } from "./chunk-D2XDF23C.js";
43
45
  import {
44
46
  findWorkspaceRoot
45
- } from "./chunk-WY33RVIK.js";
47
+ } from "./chunk-TS6H5T6G.js";
46
48
  import {
47
49
  joinPaths
48
- } from "./chunk-IYZBR6CU.js";
50
+ } from "./chunk-IDY7RCOU.js";
49
51
  import {
50
52
  __commonJS,
51
53
  __toESM,
52
54
  init_esm_shims
53
- } from "./chunk-UNRUDVIB.js";
55
+ } from "./chunk-VYMVJJZO.js";
54
56
 
55
- // ../../node_modules/.pnpm/eslint-plugin-tsdoc@0.4.0_patch_hash=5461761ec250d73f2fa3105b0db6754a0d9370fc3e67cdbca919e292a05a3bcc/node_modules/eslint-plugin-tsdoc/lib/Debug.js
57
+ // ../../node_modules/.pnpm/eslint-plugin-tsdoc@0.4.0_patch_hash=e11a3887a5b3ec5d675ce58bd21db060debc09ebe2f9ce229a088d3f69e21238/node_modules/eslint-plugin-tsdoc/lib/Debug.js
56
58
  var require_Debug = __commonJS({
57
- "../../node_modules/.pnpm/eslint-plugin-tsdoc@0.4.0_patch_hash=5461761ec250d73f2fa3105b0db6754a0d9370fc3e67cdbca919e292a05a3bcc/node_modules/eslint-plugin-tsdoc/lib/Debug.js"(exports) {
59
+ "../../node_modules/.pnpm/eslint-plugin-tsdoc@0.4.0_patch_hash=e11a3887a5b3ec5d675ce58bd21db060debc09ebe2f9ce229a088d3f69e21238/node_modules/eslint-plugin-tsdoc/lib/Debug.js"(exports) {
58
60
  "use strict";
59
61
  init_esm_shims();
60
62
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -68,12 +70,12 @@ var require_Debug = __commonJS({
68
70
  }
69
71
  });
70
72
 
71
- // ../../node_modules/.pnpm/eslint-plugin-tsdoc@0.4.0_patch_hash=5461761ec250d73f2fa3105b0db6754a0d9370fc3e67cdbca919e292a05a3bcc/node_modules/eslint-plugin-tsdoc/lib/ConfigCache.js
73
+ // ../../node_modules/.pnpm/eslint-plugin-tsdoc@0.4.0_patch_hash=e11a3887a5b3ec5d675ce58bd21db060debc09ebe2f9ce229a088d3f69e21238/node_modules/eslint-plugin-tsdoc/lib/ConfigCache.js
72
74
  import * as __import__microsoft_tsdocConfig from "@microsoft/tsdoc-config";
73
75
  import * as __import_path from "path";
74
76
  import * as __import_fs from "fs";
75
77
  var require_ConfigCache = __commonJS({
76
- "../../node_modules/.pnpm/eslint-plugin-tsdoc@0.4.0_patch_hash=5461761ec250d73f2fa3105b0db6754a0d9370fc3e67cdbca919e292a05a3bcc/node_modules/eslint-plugin-tsdoc/lib/ConfigCache.js"(exports) {
78
+ "../../node_modules/.pnpm/eslint-plugin-tsdoc@0.4.0_patch_hash=e11a3887a5b3ec5d675ce58bd21db060debc09ebe2f9ce229a088d3f69e21238/node_modules/eslint-plugin-tsdoc/lib/ConfigCache.js"(exports) {
77
79
  "use strict";
78
80
  init_esm_shims();
79
81
  var __import___Debug = __toESM(require_Debug());
@@ -118,8 +120,8 @@ var require_ConfigCache = __commonJS({
118
120
  }
119
121
  var _fs = __import_fs;
120
122
  var _path = __import_path;
121
- var MAX_PATH_SEARCH_DEPTH = 30;
122
- var depth = 0;
123
+ var MAX_PATH_SEARCH_DEPTH2 = 30;
124
+ var depth2 = 0;
123
125
  var ROOT_FILES = [
124
126
  "storm-workspace.json",
125
127
  "storm-workspace.json",
@@ -162,7 +164,7 @@ var require_ConfigCache = __commonJS({
162
164
  ".vscode",
163
165
  ".verdaccio"
164
166
  ];
165
- function findWorkspaceRoot2(startPath) {
167
+ function findWorkspaceRoot3(startPath) {
166
168
  const _startPath = _nullishCoalesce(startPath, () => process.cwd());
167
169
  if (ROOT_DIRECTORIES.some(
168
170
  (endDirName) => _fs.existsSync.call(void 0, _path.join.call(void 0, _startPath, endDirName))
@@ -174,9 +176,9 @@ var require_ConfigCache = __commonJS({
174
176
  )) {
175
177
  return _startPath;
176
178
  }
177
- if (_startPath !== "/" && depth++ < MAX_PATH_SEARCH_DEPTH) {
179
+ if (_startPath !== "/" && depth2++ < MAX_PATH_SEARCH_DEPTH2) {
178
180
  const parent = _path.join.call(void 0, _startPath, "..");
179
- return findWorkspaceRoot2(parent);
181
+ return findWorkspaceRoot3(parent);
180
182
  }
181
183
  return void 0;
182
184
  }
@@ -246,9 +248,19 @@ var require_ConfigCache = __commonJS({
246
248
  workspaceRoot = process.env.STORM_WORKSPACE_ROOT || process.env.NX_WORKSPACE_ROOT_PATH;
247
249
  }
248
250
  if (!workspaceRoot) {
249
- workspaceRoot = findWorkspaceRoot2();
251
+ workspaceRoot = findWorkspaceRoot3();
250
252
  }
251
- const configFilePath = process.env.STORM_TSDOC_CONFIG_FILE ? process.env.STORM_TSDOC_CONFIG_FILE : configFile ? configFile : path.join(
253
+ const configFilePath = process.env.STORM_TSDOC_CONFIG_FILE ? process.env.STORM_TSDOC_CONFIG_FILE : configFile ? path.existsSync(
254
+ path.join(
255
+ workspaceRoot,
256
+ "node_modules",
257
+ configFile
258
+ )
259
+ ) ? path.join(
260
+ workspaceRoot,
261
+ "node_modules",
262
+ configFile
263
+ ) : configFile : path.join(
252
264
  workspaceRoot,
253
265
  "node_modules",
254
266
  "@storm-software",
@@ -306,10 +318,10 @@ var require_ConfigCache = __commonJS({
306
318
  }
307
319
  });
308
320
 
309
- // ../../node_modules/.pnpm/eslint-plugin-tsdoc@0.4.0_patch_hash=5461761ec250d73f2fa3105b0db6754a0d9370fc3e67cdbca919e292a05a3bcc/node_modules/eslint-plugin-tsdoc/lib/index.js
321
+ // ../../node_modules/.pnpm/eslint-plugin-tsdoc@0.4.0_patch_hash=e11a3887a5b3ec5d675ce58bd21db060debc09ebe2f9ce229a088d3f69e21238/node_modules/eslint-plugin-tsdoc/lib/index.js
310
322
  import * as __import__microsoft_tsdoc from "@microsoft/tsdoc";
311
323
  var require_lib = __commonJS({
312
- "../../node_modules/.pnpm/eslint-plugin-tsdoc@0.4.0_patch_hash=5461761ec250d73f2fa3105b0db6754a0d9370fc3e67cdbca919e292a05a3bcc/node_modules/eslint-plugin-tsdoc/lib/index.js"(exports, module) {
324
+ "../../node_modules/.pnpm/eslint-plugin-tsdoc@0.4.0_patch_hash=e11a3887a5b3ec5d675ce58bd21db060debc09ebe2f9ce229a088d3f69e21238/node_modules/eslint-plugin-tsdoc/lib/index.js"(exports, module) {
313
325
  "use strict";
314
326
  init_esm_shims();
315
327
  var __import___Debug = __toESM(require_Debug());
@@ -1857,16 +1869,1569 @@ async function imports(options = {}) {
1857
1869
 
1858
1870
  // src/configs/javascript.ts
1859
1871
  init_esm_shims();
1872
+
1873
+ // ../config-tools/src/config-file/get-config-file.ts
1874
+ init_esm_shims();
1875
+ import { loadConfig } from "c12";
1860
1876
  import defu2 from "defu";
1877
+
1878
+ // ../config-tools/src/logger/console.ts
1879
+ init_esm_shims();
1880
+
1881
+ // ../config-tools/src/types.ts
1882
+ init_esm_shims();
1883
+ var LogLevel = {
1884
+ SILENT: 0,
1885
+ FATAL: 10,
1886
+ ERROR: 20,
1887
+ WARN: 30,
1888
+ SUCCESS: 35,
1889
+ INFO: 40,
1890
+ DEBUG: 60,
1891
+ TRACE: 70,
1892
+ ALL: 100
1893
+ };
1894
+ var LogLevelLabel = {
1895
+ SILENT: "silent",
1896
+ FATAL: "fatal",
1897
+ ERROR: "error",
1898
+ WARN: "warn",
1899
+ SUCCESS: "success",
1900
+ INFO: "info",
1901
+ DEBUG: "debug",
1902
+ TRACE: "trace",
1903
+ ALL: "all"
1904
+ };
1905
+
1906
+ // ../config-tools/src/utilities/get-default-config.ts
1907
+ init_esm_shims();
1908
+
1909
+ // ../config/src/index.ts
1910
+ init_esm_shims();
1911
+
1912
+ // ../config/src/constants.ts
1913
+ init_esm_shims();
1914
+ var STORM_DEFAULT_DOCS = "https://stormsoftware.com/docs";
1915
+ var STORM_DEFAULT_HOMEPAGE = "https://stormsoftware.com";
1916
+ var STORM_DEFAULT_CONTACT = "https://stormsoftware.com/contact";
1917
+ var STORM_DEFAULT_LICENSING = "https://stormsoftware.com/license";
1918
+ var STORM_DEFAULT_LICENSE = "Apache-2.0";
1919
+ var STORM_DEFAULT_RELEASE_BANNER = "https://public.storm-cdn.com/brand-banner.png";
1920
+ var STORM_DEFAULT_ACCOUNT_TWITTER = "StormSoftwareHQ";
1921
+ var STORM_DEFAULT_ACCOUNT_DISCORD = "https://discord.gg/MQ6YVzakM5";
1922
+ var STORM_DEFAULT_ACCOUNT_TELEGRAM = "https://t.me/storm_software";
1923
+ var STORM_DEFAULT_ACCOUNT_SLACK = "https://join.slack.com/t/storm-software/shared_invite/zt-2gsmk04hs-i6yhK_r6urq0dkZYAwq2pA";
1924
+ var STORM_DEFAULT_ACCOUNT_MEDIUM = "https://medium.com/storm-software";
1925
+ var STORM_DEFAULT_ACCOUNT_GITHUB = "https://github.com/storm-software";
1926
+ var STORM_DEFAULT_RELEASE_FOOTER = `
1927
+ 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.
1928
+
1929
+ Join us on [Discord](${STORM_DEFAULT_ACCOUNT_DISCORD}) to chat with the team, receive release notifications, ask questions, and get involved.
1930
+
1931
+ 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_ACCOUNT_SLACK}) channel!
1932
+ `;
1933
+ var STORM_DEFAULT_ERROR_CODES_FILE = "tools/errors/codes.json";
1934
+
1935
+ // ../config/src/define-config.ts
1936
+ init_esm_shims();
1937
+
1938
+ // ../config/src/schema.ts
1939
+ init_esm_shims();
1940
+ import z from "zod";
1941
+ 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");
1942
+ 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");
1943
+ 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");
1944
+ 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");
1945
+ 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");
1946
+ 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");
1947
+ 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");
1948
+ 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");
1949
+ 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");
1950
+ 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");
1951
+ 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");
1952
+ var FatalColorSchema = z.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7).optional().describe("The fatal color of the workspace");
1953
+ 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");
1954
+ 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");
1955
+ var DarkThemeColorConfigSchema = z.object({
1956
+ foreground: LightColorSchema,
1957
+ background: DarkColorSchema,
1958
+ brand: BrandColorSchema,
1959
+ alternate: AlternateColorSchema,
1960
+ accent: AccentColorSchema,
1961
+ link: LinkColorSchema,
1962
+ help: HelpColorSchema,
1963
+ success: SuccessColorSchema,
1964
+ info: InfoColorSchema,
1965
+ warning: WarningColorSchema,
1966
+ danger: DangerColorSchema,
1967
+ fatal: FatalColorSchema,
1968
+ positive: PositiveColorSchema,
1969
+ negative: NegativeColorSchema
1970
+ });
1971
+ var LightThemeColorConfigSchema = z.object({
1972
+ foreground: DarkColorSchema,
1973
+ background: LightColorSchema,
1974
+ brand: BrandColorSchema,
1975
+ alternate: AlternateColorSchema,
1976
+ accent: AccentColorSchema,
1977
+ link: LinkColorSchema,
1978
+ help: HelpColorSchema,
1979
+ success: SuccessColorSchema,
1980
+ info: InfoColorSchema,
1981
+ warning: WarningColorSchema,
1982
+ danger: DangerColorSchema,
1983
+ fatal: FatalColorSchema,
1984
+ positive: PositiveColorSchema,
1985
+ negative: NegativeColorSchema
1986
+ });
1987
+ var MultiThemeColorConfigSchema = z.object({
1988
+ dark: DarkThemeColorConfigSchema,
1989
+ light: LightThemeColorConfigSchema
1990
+ });
1991
+ var SingleThemeColorConfigSchema = z.object({
1992
+ dark: DarkColorSchema,
1993
+ light: LightColorSchema,
1994
+ brand: BrandColorSchema,
1995
+ alternate: AlternateColorSchema,
1996
+ accent: AccentColorSchema,
1997
+ link: LinkColorSchema,
1998
+ help: HelpColorSchema,
1999
+ success: SuccessColorSchema,
2000
+ info: InfoColorSchema,
2001
+ warning: WarningColorSchema,
2002
+ danger: DangerColorSchema,
2003
+ fatal: FatalColorSchema,
2004
+ positive: PositiveColorSchema,
2005
+ negative: NegativeColorSchema
2006
+ });
2007
+ var RegistryUrlConfigSchema = z.string().trim().toLowerCase().url().optional().describe("A remote registry URL used to publish distributable packages");
2008
+ var RegistryConfigSchema = z.object({
2009
+ github: RegistryUrlConfigSchema,
2010
+ npm: RegistryUrlConfigSchema,
2011
+ cargo: RegistryUrlConfigSchema,
2012
+ cyclone: RegistryUrlConfigSchema,
2013
+ container: RegistryUrlConfigSchema
2014
+ }).default({}).describe("A list of remote registry URLs used by Storm Software");
2015
+ var ColorConfigSchema = SingleThemeColorConfigSchema.or(
2016
+ MultiThemeColorConfigSchema
2017
+ ).describe("Colors used for various workspace elements");
2018
+ var ColorConfigMapSchema = z.union([
2019
+ z.object({ base: ColorConfigSchema }),
2020
+ z.record(z.string(), ColorConfigSchema)
2021
+ ]);
2022
+ var ExtendsItemSchema = z.string().trim().describe(
2023
+ "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."
2024
+ );
2025
+ var ExtendsSchema = ExtendsItemSchema.or(
2026
+ z.array(ExtendsItemSchema)
2027
+ ).describe(
2028
+ "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."
2029
+ );
2030
+ var WorkspaceBotConfigSchema = z.object({
2031
+ name: z.string().trim().default("stormie-bot").describe(
2032
+ "The workspace bot user's name (this is the bot that will be used to perform various tasks)"
2033
+ ),
2034
+ email: z.string().trim().email().default("bot@stormsoftware.com").describe("The email of the workspace bot")
2035
+ }).describe(
2036
+ "The workspace's bot user's config used to automated various operations tasks"
2037
+ );
2038
+ var WorkspaceReleaseConfigSchema = z.object({
2039
+ banner: z.string().trim().default(STORM_DEFAULT_RELEASE_BANNER).describe(
2040
+ "A URL to a banner image used to display the workspace's release"
2041
+ ),
2042
+ header: z.string().trim().optional().describe(
2043
+ "A header message appended to the start of the workspace's release notes"
2044
+ ),
2045
+ footer: z.string().trim().default(STORM_DEFAULT_RELEASE_FOOTER).describe(
2046
+ "A footer message appended to the end of the workspace's release notes"
2047
+ )
2048
+ }).describe("The workspace's release config used during the release process");
2049
+ var WorkspaceAccountConfigSchema = z.object({
2050
+ twitter: z.string().trim().default(STORM_DEFAULT_ACCOUNT_TWITTER).describe("A Twitter/X account associated with the organization/project"),
2051
+ discord: z.string().trim().default(STORM_DEFAULT_ACCOUNT_DISCORD).describe("A Discord account associated with the organization/project"),
2052
+ telegram: z.string().trim().default(STORM_DEFAULT_ACCOUNT_TELEGRAM).describe("A Telegram account associated with the organization/project"),
2053
+ slack: z.string().trim().default(STORM_DEFAULT_ACCOUNT_SLACK).describe("A Slack account associated with the organization/project"),
2054
+ medium: z.string().trim().default(STORM_DEFAULT_ACCOUNT_MEDIUM).describe("A Medium account associated with the organization/project"),
2055
+ github: z.string().trim().default(STORM_DEFAULT_ACCOUNT_GITHUB).describe("A GitHub account associated with the organization/project")
2056
+ }).describe(
2057
+ "The workspace's account config used to store various social media links"
2058
+ );
2059
+ var WorkspaceDirectoryConfigSchema = z.object({
2060
+ cache: z.string().trim().optional().describe(
2061
+ "The directory used to store the environment's cached file data"
2062
+ ),
2063
+ data: z.string().trim().optional().describe("The directory used to store the environment's data files"),
2064
+ config: z.string().trim().optional().describe(
2065
+ "The directory used to store the environment's configuration files"
2066
+ ),
2067
+ temp: z.string().trim().optional().describe("The directory used to store the environment's temp files"),
2068
+ log: z.string().trim().optional().describe("The directory used to store the environment's temp files"),
2069
+ build: z.string().trim().default("dist").describe(
2070
+ "The directory used to store the workspace's distributable files after a build (relative to the workspace root)"
2071
+ )
2072
+ }).describe(
2073
+ "Various directories used by the workspace to store data, cache, and configuration files"
2074
+ );
2075
+ var errorConfigSchema = z.object({
2076
+ codesFile: z.string().trim().default(STORM_DEFAULT_ERROR_CODES_FILE).describe("The path to the workspace's error codes JSON file"),
2077
+ url: z.string().trim().url().optional().describe(
2078
+ "A URL to a page that looks up the workspace's error messages given a specific error code"
2079
+ )
2080
+ }).describe("The workspace's error config used during the error process");
2081
+ var stormWorkspaceConfigSchema = z.object({
2082
+ $schema: z.string().trim().default(
2083
+ "https://cdn.jsdelivr.net/npm/@storm-software/config/schemas/storm-workspace.schema.json"
2084
+ ).optional().nullish().describe(
2085
+ "The URL to the JSON schema file that describes the Storm configuration file"
2086
+ ),
2087
+ extends: ExtendsSchema.optional(),
2088
+ name: z.string().trim().toLowerCase().optional().describe(
2089
+ "The name of the service/package/scope using this configuration"
2090
+ ),
2091
+ namespace: z.string().trim().toLowerCase().optional().describe("The namespace of the package"),
2092
+ organization: z.string().trim().default("storm-software").describe("The organization of the workspace"),
2093
+ repository: z.string().trim().optional().describe("The repo URL of the workspace (i.e. GitHub)"),
2094
+ license: z.string().trim().default("Apache-2.0").describe("The license type of the package"),
2095
+ homepage: z.string().trim().url().optional().describe("The homepage of the workspace"),
2096
+ docs: z.string().trim().url().optional().describe("The documentation site for the workspace"),
2097
+ portal: z.string().trim().url().optional().describe("The development portal site for the workspace"),
2098
+ licensing: z.string().trim().url().optional().describe("The licensing site for the workspace"),
2099
+ contact: z.string().trim().url().optional().describe("The contact site for the workspace"),
2100
+ support: z.string().trim().url().optional().describe(
2101
+ "The support site for the workspace. If not provided, this is defaulted to the `contact` config value"
2102
+ ),
2103
+ branch: z.string().trim().default("main").describe("The branch of the workspace"),
2104
+ preid: z.string().optional().describe("A tag specifying the version pre-release identifier"),
2105
+ owner: z.string().trim().default("@storm-software/admin").describe("The owner of the package"),
2106
+ bot: WorkspaceBotConfigSchema,
2107
+ release: WorkspaceReleaseConfigSchema,
2108
+ account: WorkspaceAccountConfigSchema,
2109
+ error: errorConfigSchema,
2110
+ mode: z.enum(["development", "staging", "production"]).default("production").describe("The current runtime environment mode for the package"),
2111
+ workspaceRoot: z.string().trim().describe("The root directory of the workspace"),
2112
+ externalPackagePatterns: z.array(z.string()).default([]).describe(
2113
+ "The build will use these package patterns to determine if they should be external to the bundle"
2114
+ ),
2115
+ skipCache: z.boolean().default(false).describe("Should all known types of workspace caching be skipped?"),
2116
+ directories: WorkspaceDirectoryConfigSchema,
2117
+ packageManager: z.enum(["npm", "yarn", "pnpm", "bun"]).default("npm").describe(
2118
+ "The JavaScript/TypeScript package manager used by the repository"
2119
+ ),
2120
+ timezone: z.string().trim().default("America/New_York").describe("The default timezone of the workspace"),
2121
+ locale: z.string().trim().default("en-US").describe("The default locale of the workspace"),
2122
+ logLevel: z.enum([
2123
+ "silent",
2124
+ "fatal",
2125
+ "error",
2126
+ "warn",
2127
+ "success",
2128
+ "info",
2129
+ "debug",
2130
+ "trace",
2131
+ "all"
2132
+ ]).default("info").describe(
2133
+ "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`)."
2134
+ ),
2135
+ skipConfigLogging: z.boolean().optional().describe(
2136
+ "Should the logging of the current Storm Workspace configuration be skipped?"
2137
+ ),
2138
+ registry: RegistryConfigSchema,
2139
+ configFile: z.string().trim().nullable().default(null).describe(
2140
+ "The filepath of the Storm config. When this field is null, no config file was found in the current workspace."
2141
+ ),
2142
+ colors: ColorConfigSchema.or(ColorConfigMapSchema).describe(
2143
+ "Storm theme config values used for styling various package elements"
2144
+ ),
2145
+ extensions: z.record(z.any()).optional().default({}).describe("Configuration of each used extension")
2146
+ }).describe(
2147
+ "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."
2148
+ );
2149
+
2150
+ // ../config/src/types.ts
2151
+ init_esm_shims();
2152
+ var COLOR_KEYS = [
2153
+ "dark",
2154
+ "light",
2155
+ "base",
2156
+ "brand",
2157
+ "alternate",
2158
+ "accent",
2159
+ "link",
2160
+ "success",
2161
+ "help",
2162
+ "info",
2163
+ "warning",
2164
+ "danger",
2165
+ "fatal",
2166
+ "positive",
2167
+ "negative"
2168
+ ];
2169
+
2170
+ // ../config-tools/src/utilities/get-default-config.ts
2171
+ import { existsSync as existsSync3 } from "node:fs";
2172
+ import { readFile } from "node:fs/promises";
2173
+ import { join as join2 } from "node:path";
2174
+
2175
+ // ../config-tools/src/utilities/correct-paths.ts
2176
+ init_esm_shims();
2177
+ var _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
2178
+ function normalizeWindowsPath(input = "") {
2179
+ if (!input) {
2180
+ return input;
2181
+ }
2182
+ return input.replace(/\\/g, "/").replace(_DRIVE_LETTER_START_RE, (r) => r.toUpperCase());
2183
+ }
2184
+ var _UNC_REGEX = /^[/\\]{2}/;
2185
+ var _IS_ABSOLUTE_RE = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/;
2186
+ var _DRIVE_LETTER_RE = /^[A-Za-z]:$/;
2187
+ var correctPaths = function(path) {
2188
+ if (!path || path.length === 0) {
2189
+ return ".";
2190
+ }
2191
+ path = normalizeWindowsPath(path);
2192
+ const isUNCPath = path.match(_UNC_REGEX);
2193
+ const isPathAbsolute = isAbsolute(path);
2194
+ const trailingSeparator = path[path.length - 1] === "/";
2195
+ path = normalizeString(path, !isPathAbsolute);
2196
+ if (path.length === 0) {
2197
+ if (isPathAbsolute) {
2198
+ return "/";
2199
+ }
2200
+ return trailingSeparator ? "./" : ".";
2201
+ }
2202
+ if (trailingSeparator) {
2203
+ path += "/";
2204
+ }
2205
+ if (_DRIVE_LETTER_RE.test(path)) {
2206
+ path += "/";
2207
+ }
2208
+ if (isUNCPath) {
2209
+ if (!isPathAbsolute) {
2210
+ return `//./${path}`;
2211
+ }
2212
+ return `//${path}`;
2213
+ }
2214
+ return isPathAbsolute && !isAbsolute(path) ? `/${path}` : path;
2215
+ };
2216
+ var joinPaths2 = function(...segments) {
2217
+ let path = "";
2218
+ for (const seg of segments) {
2219
+ if (!seg) {
2220
+ continue;
2221
+ }
2222
+ if (path.length > 0) {
2223
+ const pathTrailing = path[path.length - 1] === "/";
2224
+ const segLeading = seg[0] === "/";
2225
+ const both = pathTrailing && segLeading;
2226
+ if (both) {
2227
+ path += seg.slice(1);
2228
+ } else {
2229
+ path += pathTrailing || segLeading ? seg : `/${seg}`;
2230
+ }
2231
+ } else {
2232
+ path += seg;
2233
+ }
2234
+ }
2235
+ return correctPaths(path);
2236
+ };
2237
+ function normalizeString(path, allowAboveRoot) {
2238
+ let res = "";
2239
+ let lastSegmentLength = 0;
2240
+ let lastSlash = -1;
2241
+ let dots = 0;
2242
+ let char = null;
2243
+ for (let index = 0; index <= path.length; ++index) {
2244
+ if (index < path.length) {
2245
+ char = path[index];
2246
+ } else if (char === "/") {
2247
+ break;
2248
+ } else {
2249
+ char = "/";
2250
+ }
2251
+ if (char === "/") {
2252
+ if (lastSlash === index - 1 || dots === 1) {
2253
+ } else if (dots === 2) {
2254
+ if (res.length < 2 || lastSegmentLength !== 2 || res[res.length - 1] !== "." || res[res.length - 2] !== ".") {
2255
+ if (res.length > 2) {
2256
+ const lastSlashIndex = res.lastIndexOf("/");
2257
+ if (lastSlashIndex === -1) {
2258
+ res = "";
2259
+ lastSegmentLength = 0;
2260
+ } else {
2261
+ res = res.slice(0, lastSlashIndex);
2262
+ lastSegmentLength = res.length - 1 - res.lastIndexOf("/");
2263
+ }
2264
+ lastSlash = index;
2265
+ dots = 0;
2266
+ continue;
2267
+ } else if (res.length > 0) {
2268
+ res = "";
2269
+ lastSegmentLength = 0;
2270
+ lastSlash = index;
2271
+ dots = 0;
2272
+ continue;
2273
+ }
2274
+ }
2275
+ if (allowAboveRoot) {
2276
+ res += res.length > 0 ? "/.." : "..";
2277
+ lastSegmentLength = 2;
2278
+ }
2279
+ } else {
2280
+ if (res.length > 0) {
2281
+ res += `/${path.slice(lastSlash + 1, index)}`;
2282
+ } else {
2283
+ res = path.slice(lastSlash + 1, index);
2284
+ }
2285
+ lastSegmentLength = index - lastSlash - 1;
2286
+ }
2287
+ lastSlash = index;
2288
+ dots = 0;
2289
+ } else if (char === "." && dots !== -1) {
2290
+ ++dots;
2291
+ } else {
2292
+ dots = -1;
2293
+ }
2294
+ }
2295
+ return res;
2296
+ }
2297
+ var isAbsolute = function(p) {
2298
+ return _IS_ABSOLUTE_RE.test(p);
2299
+ };
2300
+
2301
+ // ../config-tools/src/utilities/find-workspace-root.ts
2302
+ init_esm_shims();
2303
+
2304
+ // ../config-tools/src/utilities/find-up.ts
2305
+ init_esm_shims();
2306
+ import { existsSync as existsSync2 } from "node:fs";
2307
+ import { join } from "node:path";
2308
+ var MAX_PATH_SEARCH_DEPTH = 30;
2309
+ var depth = 0;
2310
+ function findFolderUp(startPath, endFileNames = [], endDirectoryNames = []) {
2311
+ const _startPath = startPath ?? process.cwd();
2312
+ if (endDirectoryNames.some(
2313
+ (endDirName) => existsSync2(join(_startPath, endDirName))
2314
+ )) {
2315
+ return _startPath;
2316
+ }
2317
+ if (endFileNames.some(
2318
+ (endFileName) => existsSync2(join(_startPath, endFileName))
2319
+ )) {
2320
+ return _startPath;
2321
+ }
2322
+ if (_startPath !== "/" && depth++ < MAX_PATH_SEARCH_DEPTH) {
2323
+ const parent = join(_startPath, "..");
2324
+ return findFolderUp(parent, endFileNames, endDirectoryNames);
2325
+ }
2326
+ return void 0;
2327
+ }
2328
+
2329
+ // ../config-tools/src/utilities/find-workspace-root.ts
2330
+ var rootFiles = [
2331
+ "storm-workspace.json",
2332
+ "storm-workspace.json",
2333
+ "storm-workspace.yaml",
2334
+ "storm-workspace.yml",
2335
+ "storm-workspace.js",
2336
+ "storm-workspace.ts",
2337
+ ".storm-workspace.json",
2338
+ ".storm-workspace.yaml",
2339
+ ".storm-workspace.yml",
2340
+ ".storm-workspace.js",
2341
+ ".storm-workspace.ts",
2342
+ "lerna.json",
2343
+ "nx.json",
2344
+ "turbo.json",
2345
+ "npm-workspace.json",
2346
+ "yarn-workspace.json",
2347
+ "pnpm-workspace.json",
2348
+ "npm-workspace.yaml",
2349
+ "yarn-workspace.yaml",
2350
+ "pnpm-workspace.yaml",
2351
+ "npm-workspace.yml",
2352
+ "yarn-workspace.yml",
2353
+ "pnpm-workspace.yml",
2354
+ "npm-lock.json",
2355
+ "yarn-lock.json",
2356
+ "pnpm-lock.json",
2357
+ "npm-lock.yaml",
2358
+ "yarn-lock.yaml",
2359
+ "pnpm-lock.yaml",
2360
+ "npm-lock.yml",
2361
+ "yarn-lock.yml",
2362
+ "pnpm-lock.yml",
2363
+ "bun.lockb"
2364
+ ];
2365
+ var rootDirectories = [
2366
+ ".storm-workspace",
2367
+ ".nx",
2368
+ ".github",
2369
+ ".vscode",
2370
+ ".verdaccio"
2371
+ ];
2372
+ function findWorkspaceRootSafe(pathInsideMonorepo) {
2373
+ if (process.env.STORM_WORKSPACE_ROOT || process.env.NX_WORKSPACE_ROOT_PATH) {
2374
+ return correctPaths(
2375
+ process.env.STORM_WORKSPACE_ROOT ?? process.env.NX_WORKSPACE_ROOT_PATH
2376
+ );
2377
+ }
2378
+ return correctPaths(
2379
+ findFolderUp(
2380
+ pathInsideMonorepo ?? process.cwd(),
2381
+ rootFiles,
2382
+ rootDirectories
2383
+ )
2384
+ );
2385
+ }
2386
+ function findWorkspaceRoot2(pathInsideMonorepo) {
2387
+ const result = findWorkspaceRootSafe(pathInsideMonorepo);
2388
+ if (!result) {
2389
+ throw new Error(
2390
+ `Cannot find workspace root upwards from known path. Files search list includes:
2391
+ ${rootFiles.join(
2392
+ "\n"
2393
+ )}
2394
+ Path: ${pathInsideMonorepo ? pathInsideMonorepo : process.cwd()}`
2395
+ );
2396
+ }
2397
+ return result;
2398
+ }
2399
+
2400
+ // ../config-tools/src/utilities/get-default-config.ts
2401
+ var DEFAULT_COLOR_CONFIG = {
2402
+ light: {
2403
+ background: "#fafafa",
2404
+ foreground: "#1d1e22",
2405
+ brand: "#1fb2a6",
2406
+ alternate: "#db2777",
2407
+ help: "#5C4EE5",
2408
+ success: "#087f5b",
2409
+ info: "#0550ae",
2410
+ warning: "#e3b341",
2411
+ danger: "#D8314A",
2412
+ positive: "#22c55e",
2413
+ negative: "#dc2626"
2414
+ },
2415
+ dark: {
2416
+ background: "#1d1e22",
2417
+ foreground: "#cbd5e1",
2418
+ brand: "#2dd4bf",
2419
+ alternate: "#db2777",
2420
+ help: "#818cf8",
2421
+ success: "#10b981",
2422
+ info: "#58a6ff",
2423
+ warning: "#f3d371",
2424
+ danger: "#D8314A",
2425
+ positive: "#22c55e",
2426
+ negative: "#dc2626"
2427
+ }
2428
+ };
2429
+ async function getPackageJsonConfig(root) {
2430
+ let license = STORM_DEFAULT_LICENSE;
2431
+ let homepage = void 0;
2432
+ let support = void 0;
2433
+ let name2 = void 0;
2434
+ let namespace = void 0;
2435
+ let repository = void 0;
2436
+ const workspaceRoot = findWorkspaceRoot2(root);
2437
+ if (existsSync3(join2(workspaceRoot, "package.json"))) {
2438
+ const file = await readFile(
2439
+ joinPaths2(workspaceRoot, "package.json"),
2440
+ "utf8"
2441
+ );
2442
+ if (file) {
2443
+ const packageJson = JSON.parse(file);
2444
+ if (packageJson.name) {
2445
+ name2 = packageJson.name;
2446
+ }
2447
+ if (packageJson.namespace) {
2448
+ namespace = packageJson.namespace;
2449
+ }
2450
+ if (packageJson.repository) {
2451
+ if (typeof packageJson.repository === "string") {
2452
+ repository = packageJson.repository;
2453
+ } else if (packageJson.repository.url) {
2454
+ repository = packageJson.repository.url;
2455
+ }
2456
+ }
2457
+ if (packageJson.license) {
2458
+ license = packageJson.license;
2459
+ }
2460
+ if (packageJson.homepage) {
2461
+ homepage = packageJson.homepage;
2462
+ }
2463
+ if (packageJson.bugs) {
2464
+ if (typeof packageJson.bugs === "string") {
2465
+ support = packageJson.bugs;
2466
+ } else if (packageJson.bugs.url) {
2467
+ support = packageJson.bugs.url;
2468
+ }
2469
+ }
2470
+ }
2471
+ }
2472
+ return {
2473
+ workspaceRoot,
2474
+ name: name2,
2475
+ namespace,
2476
+ repository,
2477
+ license,
2478
+ homepage,
2479
+ support
2480
+ };
2481
+ }
2482
+ function applyDefaultConfig(config2) {
2483
+ if (!config2.support && config2.contact) {
2484
+ config2.support = config2.contact;
2485
+ }
2486
+ if (!config2.contact && config2.support) {
2487
+ config2.contact = config2.support;
2488
+ }
2489
+ if (config2.homepage) {
2490
+ if (!config2.docs) {
2491
+ config2.docs = `${config2.homepage}/docs`;
2492
+ }
2493
+ if (!config2.license) {
2494
+ config2.license = `${config2.homepage}/license`;
2495
+ }
2496
+ if (!config2.support) {
2497
+ config2.support = `${config2.homepage}/support`;
2498
+ }
2499
+ if (!config2.contact) {
2500
+ config2.contact = `${config2.homepage}/contact`;
2501
+ }
2502
+ if (!config2.error?.codesFile || !config2?.error?.url) {
2503
+ config2.error ??= { codesFile: STORM_DEFAULT_ERROR_CODES_FILE };
2504
+ if (config2.homepage) {
2505
+ config2.error.url ??= `${config2.homepage}/errors`;
2506
+ }
2507
+ }
2508
+ }
2509
+ return config2;
2510
+ }
2511
+
2512
+ // ../config-tools/src/logger/chalk.ts
2513
+ init_esm_shims();
2514
+ import chalk from "chalk";
2515
+ var chalkDefault = {
2516
+ hex: (_) => (message) => message,
2517
+ bgHex: (_) => ({
2518
+ whiteBright: (message) => message
2519
+ }),
2520
+ whiteBright: (message) => message,
2521
+ gray: (message) => message,
2522
+ bold: {
2523
+ hex: (_) => (message) => message,
2524
+ bgHex: (_) => ({
2525
+ whiteBright: (message) => message
2526
+ }),
2527
+ whiteBright: (message) => message
2528
+ },
2529
+ dim: {
2530
+ hex: (_) => (message) => message,
2531
+ gray: (message) => message
2532
+ }
2533
+ };
2534
+ var getChalk = () => {
2535
+ let _chalk = chalk;
2536
+ if (!_chalk?.hex || !_chalk?.bold?.hex || !_chalk?.bgHex || !_chalk?.whiteBright) {
2537
+ _chalk = chalkDefault;
2538
+ }
2539
+ return _chalk;
2540
+ };
2541
+
2542
+ // ../config-tools/src/logger/console-icons.ts
2543
+ init_esm_shims();
2544
+
2545
+ // ../config-tools/src/logger/is-unicode-supported.ts
2546
+ init_esm_shims();
2547
+ function isUnicodeSupported() {
2548
+ if (process.platform !== "win32") {
2549
+ return process.env.TERM !== "linux";
2550
+ }
2551
+ return Boolean(process.env.WT_SESSION) || // Windows Terminal
2552
+ Boolean(process.env.TERMINUS_SUBLIME) || // Terminus (<0.2.27)
2553
+ process.env.ConEmuTask === "{cmd::Cmder}" || // ConEmu and cmder
2554
+ 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";
2555
+ }
2556
+
2557
+ // ../config-tools/src/logger/console-icons.ts
2558
+ var useIcon = (c, fallback) => isUnicodeSupported() ? c : fallback;
2559
+ var CONSOLE_ICONS = {
2560
+ [LogLevelLabel.ERROR]: useIcon("\u2718", "\xD7"),
2561
+ [LogLevelLabel.FATAL]: useIcon("\u{1F480}", "\xD7"),
2562
+ [LogLevelLabel.WARN]: useIcon("\u26A0", "\u203C"),
2563
+ [LogLevelLabel.INFO]: useIcon("\u2139", "i"),
2564
+ [LogLevelLabel.SUCCESS]: useIcon("\u2714", "\u221A"),
2565
+ [LogLevelLabel.DEBUG]: useIcon("\u{1F6E0}", "D"),
2566
+ [LogLevelLabel.TRACE]: useIcon("\u{1F6E0}", "T"),
2567
+ [LogLevelLabel.ALL]: useIcon("\u2709", "\u2192")
2568
+ };
2569
+
2570
+ // ../config-tools/src/logger/format-timestamp.ts
2571
+ init_esm_shims();
2572
+ var formatTimestamp = (date = /* @__PURE__ */ new Date()) => {
2573
+ return `${date.toLocaleDateString()} ${date.toLocaleTimeString()}`;
2574
+ };
2575
+
2576
+ // ../config-tools/src/logger/get-log-level.ts
2577
+ init_esm_shims();
2578
+ var getLogLevel = (label) => {
2579
+ switch (label) {
2580
+ case "all":
2581
+ return LogLevel.ALL;
2582
+ case "trace":
2583
+ return LogLevel.TRACE;
2584
+ case "debug":
2585
+ return LogLevel.DEBUG;
2586
+ case "info":
2587
+ return LogLevel.INFO;
2588
+ case "warn":
2589
+ return LogLevel.WARN;
2590
+ case "error":
2591
+ return LogLevel.ERROR;
2592
+ case "fatal":
2593
+ return LogLevel.FATAL;
2594
+ case "silent":
2595
+ return LogLevel.SILENT;
2596
+ default:
2597
+ return LogLevel.INFO;
2598
+ }
2599
+ };
2600
+ var getLogLevelLabel = (logLevel = LogLevel.INFO) => {
2601
+ if (logLevel >= LogLevel.ALL) {
2602
+ return LogLevelLabel.ALL;
2603
+ }
2604
+ if (logLevel >= LogLevel.TRACE) {
2605
+ return LogLevelLabel.TRACE;
2606
+ }
2607
+ if (logLevel >= LogLevel.DEBUG) {
2608
+ return LogLevelLabel.DEBUG;
2609
+ }
2610
+ if (logLevel >= LogLevel.INFO) {
2611
+ return LogLevelLabel.INFO;
2612
+ }
2613
+ if (logLevel >= LogLevel.WARN) {
2614
+ return LogLevelLabel.WARN;
2615
+ }
2616
+ if (logLevel >= LogLevel.ERROR) {
2617
+ return LogLevelLabel.ERROR;
2618
+ }
2619
+ if (logLevel >= LogLevel.FATAL) {
2620
+ return LogLevelLabel.FATAL;
2621
+ }
2622
+ if (logLevel <= LogLevel.SILENT) {
2623
+ return LogLevelLabel.SILENT;
2624
+ }
2625
+ return LogLevelLabel.INFO;
2626
+ };
2627
+
2628
+ // ../config-tools/src/logger/console.ts
2629
+ var getLogFn = (logLevel = LogLevel.INFO, config2 = {}, _chalk = getChalk()) => {
2630
+ const colors = !config2.colors?.dark && !config2.colors?.["base"] && !config2.colors?.["base"]?.dark ? DEFAULT_COLOR_CONFIG : config2.colors?.dark && typeof config2.colors.dark === "string" ? config2.colors : config2.colors?.["base"]?.dark && typeof config2.colors["base"].dark === "string" ? config2.colors["base"].dark : config2.colors?.["base"] ? config2.colors?.["base"] : DEFAULT_COLOR_CONFIG;
2631
+ const configLogLevel = config2.logLevel || process.env.STORM_LOG_LEVEL || LogLevelLabel.INFO;
2632
+ if (logLevel > getLogLevel(configLogLevel) || logLevel <= LogLevel.SILENT || getLogLevel(configLogLevel) <= LogLevel.SILENT) {
2633
+ return (_) => {
2634
+ };
2635
+ }
2636
+ if (typeof logLevel === "number" && LogLevel.FATAL >= logLevel) {
2637
+ return (message) => {
2638
+ console.error(
2639
+ `
2640
+ ${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.fatal ?? "#7d1a1a")(`[${CONSOLE_ICONS[LogLevelLabel.FATAL]} Fatal] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
2641
+ `
2642
+ );
2643
+ };
2644
+ }
2645
+ if (typeof logLevel === "number" && LogLevel.ERROR >= logLevel) {
2646
+ return (message) => {
2647
+ console.error(
2648
+ `
2649
+ ${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.danger ?? "#f85149")(`[${CONSOLE_ICONS[LogLevelLabel.ERROR]} Error] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
2650
+ `
2651
+ );
2652
+ };
2653
+ }
2654
+ if (typeof logLevel === "number" && LogLevel.WARN >= logLevel) {
2655
+ return (message) => {
2656
+ console.warn(
2657
+ `
2658
+ ${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.warning ?? "#e3b341")(`[${CONSOLE_ICONS[LogLevelLabel.WARN]} Warn] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
2659
+ `
2660
+ );
2661
+ };
2662
+ }
2663
+ if (typeof logLevel === "number" && LogLevel.SUCCESS >= logLevel) {
2664
+ return (message) => {
2665
+ console.info(
2666
+ `
2667
+ ${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.success ?? "#56d364")(`[${CONSOLE_ICONS[LogLevelLabel.SUCCESS]} Success] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
2668
+ `
2669
+ );
2670
+ };
2671
+ }
2672
+ if (typeof logLevel === "number" && LogLevel.INFO >= logLevel) {
2673
+ return (message) => {
2674
+ console.info(
2675
+ `
2676
+ ${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.info ?? "#58a6ff")(`[${CONSOLE_ICONS[LogLevelLabel.INFO]} Info] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
2677
+ `
2678
+ );
2679
+ };
2680
+ }
2681
+ if (typeof logLevel === "number" && LogLevel.DEBUG >= logLevel) {
2682
+ return (message) => {
2683
+ console.debug(
2684
+ `
2685
+ ${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.brand ?? "#1fb2a6")(`[${CONSOLE_ICONS[LogLevelLabel.DEBUG]} Debug] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
2686
+ `
2687
+ );
2688
+ };
2689
+ }
2690
+ if (typeof logLevel === "number" && LogLevel.TRACE >= logLevel) {
2691
+ return (message) => {
2692
+ console.debug(
2693
+ `
2694
+ ${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.brand ?? "#1fb2a6")(`[${CONSOLE_ICONS[LogLevelLabel.TRACE]} Trace] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
2695
+ `
2696
+ );
2697
+ };
2698
+ }
2699
+ return (message) => {
2700
+ console.log(
2701
+ `
2702
+ ${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.brand ?? "#1fb2a6")(`[${CONSOLE_ICONS[LogLevelLabel.ALL]} System] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
2703
+ `
2704
+ );
2705
+ };
2706
+ };
2707
+ var writeWarning = (message, config2) => getLogFn(LogLevel.WARN, config2)(message);
2708
+ var writeTrace = (message, config2) => getLogFn(LogLevel.TRACE, config2)(message);
2709
+ var MAX_DEPTH = 4;
2710
+ var formatLogMessage = (message, options = {}, depth2 = 0) => {
2711
+ if (depth2 > MAX_DEPTH) {
2712
+ return "<max depth>";
2713
+ }
2714
+ const prefix = options.prefix ?? "-";
2715
+ const skip = options.skip ?? [];
2716
+ return typeof message === "undefined" || message === null || !message && typeof message !== "boolean" ? "<none>" : typeof message === "string" ? message : Array.isArray(message) ? `
2717
+ ${message.map((item, index) => ` ${prefix}> #${index} = ${formatLogMessage(item, { prefix: `${prefix}-`, skip }, depth2 + 1)}`).join("\n")}` : typeof message === "object" ? `
2718
+ ${Object.keys(message).filter((key) => !skip.includes(key)).map(
2719
+ (key) => ` ${prefix}> ${key} = ${_isFunction(message[key]) ? "<function>" : typeof message[key] === "object" ? formatLogMessage(
2720
+ message[key],
2721
+ { prefix: `${prefix}-`, skip },
2722
+ depth2 + 1
2723
+ ) : message[key]}`
2724
+ ).join("\n")}` : message;
2725
+ };
2726
+ var _isFunction = (value) => {
2727
+ try {
2728
+ return value instanceof Function || typeof value === "function" || !!(value?.constructor && value?.call && value?.apply);
2729
+ } catch (e) {
2730
+ return false;
2731
+ }
2732
+ };
2733
+
2734
+ // ../config-tools/src/config-file/get-config-file.ts
2735
+ var getConfigFileByName = async (fileName, filePath, options = {}) => {
2736
+ const workspacePath = filePath || findWorkspaceRoot2(filePath);
2737
+ const configs3 = await Promise.all([
2738
+ loadConfig({
2739
+ cwd: workspacePath,
2740
+ packageJson: true,
2741
+ name: fileName,
2742
+ envName: fileName?.toUpperCase(),
2743
+ jitiOptions: {
2744
+ debug: false,
2745
+ fsCache: process.env.STORM_SKIP_CACHE === "true" ? false : joinPaths2(
2746
+ process.env.STORM_CACHE_DIR || "node_modules/.cache/storm",
2747
+ "jiti"
2748
+ )
2749
+ },
2750
+ ...options
2751
+ }),
2752
+ loadConfig({
2753
+ cwd: workspacePath,
2754
+ packageJson: true,
2755
+ name: fileName,
2756
+ envName: fileName?.toUpperCase(),
2757
+ jitiOptions: {
2758
+ debug: false,
2759
+ fsCache: process.env.STORM_SKIP_CACHE === "true" ? false : joinPaths2(
2760
+ process.env.STORM_CACHE_DIR || "node_modules/.cache/storm",
2761
+ "jiti"
2762
+ )
2763
+ },
2764
+ configFile: fileName,
2765
+ ...options
2766
+ })
2767
+ ]);
2768
+ return defu2(configs3[0] ?? {}, configs3[1] ?? {});
2769
+ };
2770
+ var getConfigFile = async (filePath, additionalFileNames = []) => {
2771
+ const workspacePath = filePath ? filePath : findWorkspaceRoot2(filePath);
2772
+ const result = await getConfigFileByName("storm-workspace", workspacePath);
2773
+ let config2 = result.config;
2774
+ const configFile = result.configFile;
2775
+ if (config2 && configFile && Object.keys(config2).length > 0 && !config2.skipConfigLogging) {
2776
+ writeTrace(
2777
+ `Found Storm configuration file "${configFile.includes(`${workspacePath}/`) ? configFile.replace(`${workspacePath}/`, "") : configFile}" at "${workspacePath}"`,
2778
+ {
2779
+ logLevel: "all"
2780
+ }
2781
+ );
2782
+ }
2783
+ if (additionalFileNames && additionalFileNames.length > 0) {
2784
+ const results = await Promise.all(
2785
+ additionalFileNames.map(
2786
+ (fileName) => getConfigFileByName(fileName, workspacePath)
2787
+ )
2788
+ );
2789
+ for (const result2 of results) {
2790
+ if (result2?.config && result2?.configFile && Object.keys(result2.config).length > 0) {
2791
+ if (!config2.skipConfigLogging && !result2.config.skipConfigLogging) {
2792
+ writeTrace(
2793
+ `Found alternative configuration file "${result2.configFile.includes(`${workspacePath}/`) ? result2.configFile.replace(`${workspacePath}/`, "") : result2.configFile}" at "${workspacePath}"`,
2794
+ {
2795
+ logLevel: "all"
2796
+ }
2797
+ );
2798
+ }
2799
+ config2 = defu2(result2.config ?? {}, config2 ?? {});
2800
+ }
2801
+ }
2802
+ }
2803
+ if (!config2 || Object.keys(config2).length === 0) {
2804
+ return void 0;
2805
+ }
2806
+ config2.configFile = configFile;
2807
+ return config2;
2808
+ };
2809
+
2810
+ // ../config-tools/src/create-storm-config.ts
2811
+ init_esm_shims();
2812
+ import defu3 from "defu";
2813
+
2814
+ // ../config-tools/src/env/get-env.ts
2815
+ init_esm_shims();
2816
+ var getExtensionEnv = (extensionName) => {
2817
+ const prefix = `STORM_EXTENSION_${extensionName.toUpperCase()}_`;
2818
+ return Object.keys(process.env).filter((key) => key.startsWith(prefix)).reduce((ret, key) => {
2819
+ const name2 = key.replace(prefix, "").split("_").map(
2820
+ (i) => i.length > 0 ? i.trim().charAt(0).toUpperCase() + i.trim().slice(1) : ""
2821
+ ).join("");
2822
+ if (name2) {
2823
+ ret[name2] = process.env[key];
2824
+ }
2825
+ return ret;
2826
+ }, {});
2827
+ };
2828
+ var getConfigEnv = () => {
2829
+ const prefix = "STORM_";
2830
+ let config2 = {
2831
+ extends: process.env[`${prefix}EXTENDS`] || void 0,
2832
+ name: process.env[`${prefix}NAME`] || void 0,
2833
+ namespace: process.env[`${prefix}NAMESPACE`] || void 0,
2834
+ owner: process.env[`${prefix}OWNER`] || void 0,
2835
+ bot: {
2836
+ name: process.env[`${prefix}BOT_NAME`] || void 0,
2837
+ email: process.env[`${prefix}BOT_EMAIL`] || void 0
2838
+ },
2839
+ release: {
2840
+ banner: process.env[`${prefix}RELEASE_BANNER`] || void 0,
2841
+ header: process.env[`${prefix}RELEASE_HEADER`] || void 0,
2842
+ footer: process.env[`${prefix}RELEASE_FOOTER`] || void 0
2843
+ },
2844
+ error: {
2845
+ codesFile: process.env[`${prefix}ERROR_CODES_FILE`] || void 0,
2846
+ url: process.env[`${prefix}ERROR_URL`] || void 0
2847
+ },
2848
+ account: {
2849
+ twitter: process.env[`${prefix}ACCOUNT_TWITTER`] || void 0,
2850
+ discord: process.env[`${prefix}ACCOUNT_DISCORD`] || void 0,
2851
+ telegram: process.env[`${prefix}ACCOUNT_TELEGRAM`] || void 0,
2852
+ slack: process.env[`${prefix}ACCOUNT_SLACK`] || void 0,
2853
+ medium: process.env[`${prefix}ACCOUNT_MEDIUM`] || void 0,
2854
+ github: process.env[`${prefix}ACCOUNT_GITHUB`] || void 0
2855
+ },
2856
+ organization: process.env[`${prefix}ORGANIZATION`] || void 0,
2857
+ packageManager: process.env[`${prefix}PACKAGE_MANAGER`] || void 0,
2858
+ license: process.env[`${prefix}LICENSE`] || void 0,
2859
+ homepage: process.env[`${prefix}HOMEPAGE`] || void 0,
2860
+ docs: process.env[`${prefix}DOCS`] || void 0,
2861
+ portal: process.env[`${prefix}PORTAL`] || void 0,
2862
+ licensing: process.env[`${prefix}LICENSING`] || void 0,
2863
+ contact: process.env[`${prefix}CONTACT`] || void 0,
2864
+ support: process.env[`${prefix}SUPPORT`] || void 0,
2865
+ timezone: process.env[`${prefix}TIMEZONE`] || process.env.TZ || void 0,
2866
+ locale: process.env[`${prefix}LOCALE`] || process.env.LOCALE || void 0,
2867
+ configFile: process.env[`${prefix}CONFIG_FILE`] ? correctPaths(process.env[`${prefix}CONFIG_FILE`]) : void 0,
2868
+ workspaceRoot: process.env[`${prefix}WORKSPACE_ROOT`] ? correctPaths(process.env[`${prefix}WORKSPACE_ROOT`]) : void 0,
2869
+ directories: {
2870
+ cache: process.env[`${prefix}CACHE_DIR`] ? correctPaths(process.env[`${prefix}CACHE_DIR`]) : process.env[`${prefix}CACHE_DIRECTORY`] ? correctPaths(process.env[`${prefix}CACHE_DIRECTORY`]) : void 0,
2871
+ data: process.env[`${prefix}DATA_DIR`] ? correctPaths(process.env[`${prefix}DATA_DIR`]) : process.env[`${prefix}DATA_DIRECTORY`] ? correctPaths(process.env[`${prefix}DATA_DIRECTORY`]) : void 0,
2872
+ config: process.env[`${prefix}CONFIG_DIR`] ? correctPaths(process.env[`${prefix}CONFIG_DIR`]) : process.env[`${prefix}CONFIG_DIRECTORY`] ? correctPaths(process.env[`${prefix}CONFIG_DIRECTORY`]) : void 0,
2873
+ temp: process.env[`${prefix}TEMP_DIR`] ? correctPaths(process.env[`${prefix}TEMP_DIR`]) : process.env[`${prefix}TEMP_DIRECTORY`] ? correctPaths(process.env[`${prefix}TEMP_DIRECTORY`]) : void 0,
2874
+ log: process.env[`${prefix}LOG_DIR`] ? correctPaths(process.env[`${prefix}LOG_DIR`]) : process.env[`${prefix}LOG_DIRECTORY`] ? correctPaths(process.env[`${prefix}LOG_DIRECTORY`]) : void 0,
2875
+ build: process.env[`${prefix}BUILD_DIR`] ? correctPaths(process.env[`${prefix}BUILD_DIR`]) : process.env[`${prefix}BUILD_DIRECTORY`] ? correctPaths(process.env[`${prefix}BUILD_DIRECTORY`]) : void 0
2876
+ },
2877
+ skipCache: process.env[`${prefix}SKIP_CACHE`] !== void 0 ? Boolean(process.env[`${prefix}SKIP_CACHE`]) : void 0,
2878
+ mode: (process.env[`${prefix}MODE`] ?? process.env.NODE_ENV ?? process.env.ENVIRONMENT) || void 0,
2879
+ // ci:
2880
+ // process.env[`${prefix}CI`] !== undefined
2881
+ // ? Boolean(
2882
+ // process.env[`${prefix}CI`] ??
2883
+ // process.env.CI ??
2884
+ // process.env.CONTINUOUS_INTEGRATION
2885
+ // )
2886
+ // : undefined,
2887
+ repository: process.env[`${prefix}REPOSITORY`] || void 0,
2888
+ branch: process.env[`${prefix}BRANCH`] || void 0,
2889
+ preid: process.env[`${prefix}PRE_ID`] || void 0,
2890
+ externalPackagePatterns: process.env[`${prefix}EXTERNAL_PACKAGE_PATTERNS`] ? JSON.parse(process.env[`${prefix}EXTERNAL_PACKAGE_PATTERNS`]) : [],
2891
+ registry: {
2892
+ github: process.env[`${prefix}REGISTRY_GITHUB`] || void 0,
2893
+ npm: process.env[`${prefix}REGISTRY_NPM`] || void 0,
2894
+ cargo: process.env[`${prefix}REGISTRY_CARGO`] || void 0,
2895
+ cyclone: process.env[`${prefix}REGISTRY_CYCLONE`] || void 0,
2896
+ container: process.env[`${prefix}REGISTRY_CONTAINER`] || void 0
2897
+ },
2898
+ logLevel: process.env[`${prefix}LOG_LEVEL`] !== null && process.env[`${prefix}LOG_LEVEL`] !== void 0 ? process.env[`${prefix}LOG_LEVEL`] && Number.isSafeInteger(
2899
+ Number.parseInt(process.env[`${prefix}LOG_LEVEL`])
2900
+ ) ? getLogLevelLabel(
2901
+ Number.parseInt(process.env[`${prefix}LOG_LEVEL`])
2902
+ ) : process.env[`${prefix}LOG_LEVEL`] : void 0,
2903
+ skipConfigLogging: process.env[`${prefix}SKIP_CONFIG_LOGGING`] !== void 0 ? Boolean(process.env[`${prefix}SKIP_CONFIG_LOGGING`]) : void 0
2904
+ };
2905
+ const themeNames = Object.keys(process.env).filter(
2906
+ (envKey) => envKey.startsWith(`${prefix}COLOR_`) && COLOR_KEYS.every(
2907
+ (colorKey) => !envKey.startsWith(`${prefix}COLOR_LIGHT_${colorKey}`) && !envKey.startsWith(`${prefix}COLOR_DARK_${colorKey}`)
2908
+ )
2909
+ );
2910
+ config2.colors = themeNames.length > 0 ? themeNames.reduce(
2911
+ (ret, themeName) => {
2912
+ ret[themeName] = getThemeColorConfigEnv(prefix, themeName);
2913
+ return ret;
2914
+ },
2915
+ {}
2916
+ ) : getThemeColorConfigEnv(prefix);
2917
+ if (config2.docs === STORM_DEFAULT_DOCS) {
2918
+ if (config2.homepage === STORM_DEFAULT_HOMEPAGE) {
2919
+ config2.docs = `${STORM_DEFAULT_HOMEPAGE}/projects/${config2.name}/docs`;
2920
+ } else {
2921
+ config2.docs = `${config2.homepage}/docs`;
2922
+ }
2923
+ }
2924
+ if (config2.licensing === STORM_DEFAULT_LICENSING) {
2925
+ if (config2.homepage === STORM_DEFAULT_HOMEPAGE) {
2926
+ config2.licensing = `${STORM_DEFAULT_HOMEPAGE}/projects/${config2.name}/licensing`;
2927
+ } else {
2928
+ config2.licensing = `${config2.homepage}/docs`;
2929
+ }
2930
+ }
2931
+ const serializedConfig = process.env[`${prefix}CONFIG`];
2932
+ if (serializedConfig) {
2933
+ const parsed = JSON.parse(serializedConfig);
2934
+ config2 = {
2935
+ ...config2,
2936
+ ...parsed,
2937
+ colors: { ...config2.colors, ...parsed.colors },
2938
+ extensions: { ...config2.extensions, ...parsed.extensions }
2939
+ };
2940
+ }
2941
+ return config2;
2942
+ };
2943
+ var getThemeColorConfigEnv = (prefix, theme) => {
2944
+ const themeName = `COLOR_${theme && theme !== "base" ? `${theme}_` : ""}`.toUpperCase();
2945
+ return process.env[`${prefix}${themeName}LIGHT_BRAND`] || process.env[`${prefix}${themeName}DARK_BRAND`] ? getMultiThemeColorConfigEnv(prefix + themeName) : getSingleThemeColorConfigEnv(prefix + themeName);
2946
+ };
2947
+ var getSingleThemeColorConfigEnv = (prefix) => {
2948
+ return {
2949
+ dark: process.env[`${prefix}DARK`],
2950
+ light: process.env[`${prefix}LIGHT`],
2951
+ brand: process.env[`${prefix}BRAND`],
2952
+ alternate: process.env[`${prefix}ALTERNATE`],
2953
+ accent: process.env[`${prefix}ACCENT`],
2954
+ link: process.env[`${prefix}LINK`],
2955
+ help: process.env[`${prefix}HELP`],
2956
+ success: process.env[`${prefix}SUCCESS`],
2957
+ info: process.env[`${prefix}INFO`],
2958
+ warning: process.env[`${prefix}WARNING`],
2959
+ danger: process.env[`${prefix}DANGER`],
2960
+ fatal: process.env[`${prefix}FATAL`],
2961
+ positive: process.env[`${prefix}POSITIVE`],
2962
+ negative: process.env[`${prefix}NEGATIVE`]
2963
+ };
2964
+ };
2965
+ var getMultiThemeColorConfigEnv = (prefix) => {
2966
+ return {
2967
+ light: getBaseThemeColorConfigEnv(
2968
+ `${prefix}_LIGHT_`
2969
+ ),
2970
+ dark: getBaseThemeColorConfigEnv(`${prefix}_DARK_`)
2971
+ };
2972
+ };
2973
+ var getBaseThemeColorConfigEnv = (prefix) => {
2974
+ return {
2975
+ foreground: process.env[`${prefix}FOREGROUND`],
2976
+ background: process.env[`${prefix}BACKGROUND`],
2977
+ brand: process.env[`${prefix}BRAND`],
2978
+ alternate: process.env[`${prefix}ALTERNATE`],
2979
+ accent: process.env[`${prefix}ACCENT`],
2980
+ link: process.env[`${prefix}LINK`],
2981
+ help: process.env[`${prefix}HELP`],
2982
+ success: process.env[`${prefix}SUCCESS`],
2983
+ info: process.env[`${prefix}INFO`],
2984
+ warning: process.env[`${prefix}WARNING`],
2985
+ danger: process.env[`${prefix}DANGER`],
2986
+ fatal: process.env[`${prefix}FATAL`],
2987
+ positive: process.env[`${prefix}POSITIVE`],
2988
+ negative: process.env[`${prefix}NEGATIVE`]
2989
+ };
2990
+ };
2991
+
2992
+ // ../config-tools/src/env/set-env.ts
2993
+ init_esm_shims();
2994
+ var setExtensionEnv = (extensionName, extension) => {
2995
+ for (const key of Object.keys(extension ?? {})) {
2996
+ if (extension[key]) {
2997
+ const result = key?.replace(
2998
+ /([A-Z])+/g,
2999
+ (input) => input ? input[0]?.toUpperCase() + input.slice(1) : ""
3000
+ ).split(/(?=[A-Z])|[.\-\s_]/).map((x) => x.toLowerCase()) ?? [];
3001
+ let extensionKey;
3002
+ if (result.length === 0) {
3003
+ return;
3004
+ }
3005
+ if (result.length === 1) {
3006
+ extensionKey = result[0]?.toUpperCase() ?? "";
3007
+ } else {
3008
+ extensionKey = result.reduce((ret, part) => {
3009
+ return `${ret}_${part.toLowerCase()}`;
3010
+ });
3011
+ }
3012
+ process.env[`STORM_EXTENSION_${extensionName.toUpperCase()}_${extensionKey.toUpperCase()}`] = extension[key];
3013
+ }
3014
+ }
3015
+ };
3016
+ var setConfigEnv = (config2) => {
3017
+ const prefix = "STORM_";
3018
+ if (config2.extends) {
3019
+ process.env[`${prefix}EXTENDS`] = Array.isArray(config2.extends) ? JSON.stringify(config2.extends) : config2.extends;
3020
+ }
3021
+ if (config2.name) {
3022
+ process.env[`${prefix}NAME`] = config2.name;
3023
+ }
3024
+ if (config2.namespace) {
3025
+ process.env[`${prefix}NAMESPACE`] = config2.namespace;
3026
+ }
3027
+ if (config2.owner) {
3028
+ process.env[`${prefix}OWNER`] = config2.owner;
3029
+ }
3030
+ if (config2.bot) {
3031
+ process.env[`${prefix}BOT_NAME`] = config2.bot.name;
3032
+ process.env[`${prefix}BOT_EMAIL`] = config2.bot.email;
3033
+ }
3034
+ if (config2.error) {
3035
+ process.env[`${prefix}ERROR_CODES_FILE`] = config2.error.codesFile;
3036
+ process.env[`${prefix}ERROR_URL`] = config2.error.url;
3037
+ }
3038
+ if (config2.release) {
3039
+ process.env[`${prefix}RELEASE_BANNER`] = config2.release.banner;
3040
+ process.env[`${prefix}RELEASE_HEADER`] = config2.release.header;
3041
+ process.env[`${prefix}RELEASE_FOOTER`] = config2.release.footer;
3042
+ }
3043
+ if (config2.account) {
3044
+ if (config2.account.twitter) {
3045
+ process.env[`${prefix}ACCOUNT_TWITTER`] = config2.account.twitter;
3046
+ }
3047
+ if (config2.account.discord) {
3048
+ process.env[`${prefix}ACCOUNT_DISCORD`] = config2.account.discord;
3049
+ }
3050
+ if (config2.account.telegram) {
3051
+ process.env[`${prefix}ACCOUNT_TELEGRAM`] = config2.account.telegram;
3052
+ }
3053
+ if (config2.account.slack) {
3054
+ process.env[`${prefix}ACCOUNT_SLACK`] = config2.account.slack;
3055
+ }
3056
+ if (config2.account.medium) {
3057
+ process.env[`${prefix}ACCOUNT_MEDIUM`] = config2.account.medium;
3058
+ }
3059
+ if (config2.account.github) {
3060
+ process.env[`${prefix}ACCOUNT_GITHUB`] = config2.account.github;
3061
+ }
3062
+ }
3063
+ if (config2.organization) {
3064
+ process.env[`${prefix}ORGANIZATION`] = config2.organization;
3065
+ }
3066
+ if (config2.packageManager) {
3067
+ process.env[`${prefix}PACKAGE_MANAGER`] = config2.packageManager;
3068
+ }
3069
+ if (config2.license) {
3070
+ process.env[`${prefix}LICENSE`] = config2.license;
3071
+ }
3072
+ if (config2.homepage) {
3073
+ process.env[`${prefix}HOMEPAGE`] = config2.homepage;
3074
+ }
3075
+ if (config2.docs) {
3076
+ process.env[`${prefix}DOCS`] = config2.docs;
3077
+ }
3078
+ if (config2.portal) {
3079
+ process.env[`${prefix}PORTAL`] = config2.portal;
3080
+ }
3081
+ if (config2.licensing) {
3082
+ process.env[`${prefix}LICENSING`] = config2.licensing;
3083
+ }
3084
+ if (config2.contact) {
3085
+ process.env[`${prefix}CONTACT`] = config2.contact;
3086
+ }
3087
+ if (config2.support) {
3088
+ process.env[`${prefix}SUPPORT`] = config2.support;
3089
+ }
3090
+ if (config2.timezone) {
3091
+ process.env[`${prefix}TIMEZONE`] = config2.timezone;
3092
+ process.env.TZ = config2.timezone;
3093
+ process.env.DEFAULT_TIMEZONE = config2.timezone;
3094
+ }
3095
+ if (config2.locale) {
3096
+ process.env[`${prefix}LOCALE`] = config2.locale;
3097
+ process.env.LOCALE = config2.locale;
3098
+ process.env.DEFAULT_LOCALE = config2.locale;
3099
+ process.env.LANG = config2.locale ? `${config2.locale.replaceAll("-", "_")}.UTF-8` : "en_US.UTF-8";
3100
+ }
3101
+ if (config2.configFile) {
3102
+ process.env[`${prefix}CONFIG_FILE`] = correctPaths(config2.configFile);
3103
+ }
3104
+ if (config2.workspaceRoot) {
3105
+ process.env[`${prefix}WORKSPACE_ROOT`] = correctPaths(config2.workspaceRoot);
3106
+ process.env.NX_WORKSPACE_ROOT = correctPaths(config2.workspaceRoot);
3107
+ process.env.NX_WORKSPACE_ROOT_PATH = correctPaths(config2.workspaceRoot);
3108
+ }
3109
+ if (config2.directories) {
3110
+ if (!config2.skipCache && config2.directories.cache) {
3111
+ process.env[`${prefix}CACHE_DIR`] = correctPaths(
3112
+ config2.directories.cache
3113
+ );
3114
+ process.env[`${prefix}CACHE_DIRECTORY`] = process.env[`${prefix}CACHE_DIR`];
3115
+ }
3116
+ if (config2.directories.data) {
3117
+ process.env[`${prefix}DATA_DIR`] = correctPaths(config2.directories.data);
3118
+ process.env[`${prefix}DATA_DIRECTORY`] = process.env[`${prefix}DATA_DIR`];
3119
+ }
3120
+ if (config2.directories.config) {
3121
+ process.env[`${prefix}CONFIG_DIR`] = correctPaths(
3122
+ config2.directories.config
3123
+ );
3124
+ process.env[`${prefix}CONFIG_DIRECTORY`] = process.env[`${prefix}CONFIG_DIR`];
3125
+ }
3126
+ if (config2.directories.temp) {
3127
+ process.env[`${prefix}TEMP_DIR`] = correctPaths(config2.directories.temp);
3128
+ process.env[`${prefix}TEMP_DIRECTORY`] = process.env[`${prefix}TEMP_DIR`];
3129
+ }
3130
+ if (config2.directories.log) {
3131
+ process.env[`${prefix}LOG_DIR`] = correctPaths(config2.directories.log);
3132
+ process.env[`${prefix}LOG_DIRECTORY`] = process.env[`${prefix}LOG_DIR`];
3133
+ }
3134
+ if (config2.directories.build) {
3135
+ process.env[`${prefix}BUILD_DIR`] = correctPaths(
3136
+ config2.directories.build
3137
+ );
3138
+ process.env[`${prefix}BUILD_DIRECTORY`] = process.env[`${prefix}BUILD_DIR`];
3139
+ }
3140
+ }
3141
+ if (config2.skipCache !== void 0) {
3142
+ process.env[`${prefix}SKIP_CACHE`] = String(config2.skipCache);
3143
+ if (config2.skipCache) {
3144
+ process.env.NX_SKIP_NX_CACHE ??= String(config2.skipCache);
3145
+ process.env.NX_CACHE_PROJECT_GRAPH ??= String(config2.skipCache);
3146
+ }
3147
+ }
3148
+ if (config2.mode) {
3149
+ process.env[`${prefix}MODE`] = config2.mode;
3150
+ process.env.NODE_ENV = config2.mode;
3151
+ process.env.ENVIRONMENT = config2.mode;
3152
+ }
3153
+ if (config2.colors?.base?.light || config2.colors?.base?.dark) {
3154
+ for (const key of Object.keys(config2.colors)) {
3155
+ setThemeColorConfigEnv(`${prefix}COLOR_${key}_`, config2.colors[key]);
3156
+ }
3157
+ } else {
3158
+ setThemeColorConfigEnv(
3159
+ `${prefix}COLOR_`,
3160
+ config2.colors
3161
+ );
3162
+ }
3163
+ if (config2.repository) {
3164
+ process.env[`${prefix}REPOSITORY`] = config2.repository;
3165
+ }
3166
+ if (config2.branch) {
3167
+ process.env[`${prefix}BRANCH`] = config2.branch;
3168
+ }
3169
+ if (config2.preid) {
3170
+ process.env[`${prefix}PRE_ID`] = String(config2.preid);
3171
+ }
3172
+ if (config2.externalPackagePatterns) {
3173
+ process.env[`${prefix}EXTERNAL_PACKAGE_PATTERNS`] = JSON.stringify(
3174
+ config2.externalPackagePatterns
3175
+ );
3176
+ }
3177
+ if (config2.registry) {
3178
+ if (config2.registry.github) {
3179
+ process.env[`${prefix}REGISTRY_GITHUB`] = String(config2.registry.github);
3180
+ }
3181
+ if (config2.registry.npm) {
3182
+ process.env[`${prefix}REGISTRY_NPM`] = String(config2.registry.npm);
3183
+ }
3184
+ if (config2.registry.cargo) {
3185
+ process.env[`${prefix}REGISTRY_CARGO`] = String(config2.registry.cargo);
3186
+ }
3187
+ if (config2.registry.cyclone) {
3188
+ process.env[`${prefix}REGISTRY_CYCLONE`] = String(
3189
+ config2.registry.cyclone
3190
+ );
3191
+ }
3192
+ if (config2.registry.container) {
3193
+ process.env[`${prefix}REGISTRY_CONTAINER`] = String(
3194
+ config2.registry.container
3195
+ );
3196
+ }
3197
+ }
3198
+ if (config2.logLevel) {
3199
+ process.env[`${prefix}LOG_LEVEL`] = String(config2.logLevel);
3200
+ process.env.LOG_LEVEL = String(config2.logLevel);
3201
+ process.env.NX_VERBOSE_LOGGING = String(
3202
+ getLogLevel(config2.logLevel) >= LogLevel.DEBUG ? true : false
3203
+ );
3204
+ process.env.RUST_BACKTRACE = getLogLevel(config2.logLevel) >= LogLevel.DEBUG ? "full" : "none";
3205
+ }
3206
+ if (config2.skipConfigLogging !== void 0) {
3207
+ process.env[`${prefix}SKIP_CONFIG_LOGGING`] = String(
3208
+ config2.skipConfigLogging
3209
+ );
3210
+ }
3211
+ process.env[`${prefix}CONFIG`] = JSON.stringify(config2);
3212
+ for (const key of Object.keys(config2.extensions ?? {})) {
3213
+ if (config2.extensions[key] && Object.keys(config2.extensions[key])) {
3214
+ setExtensionEnv(key, config2.extensions[key]);
3215
+ }
3216
+ }
3217
+ };
3218
+ var setThemeColorConfigEnv = (prefix, config2) => {
3219
+ return config2?.light?.brand || config2?.dark?.brand ? setMultiThemeColorConfigEnv(prefix, config2) : setSingleThemeColorConfigEnv(prefix, config2);
3220
+ };
3221
+ var setSingleThemeColorConfigEnv = (prefix, config2) => {
3222
+ if (config2.dark) {
3223
+ process.env[`${prefix}DARK`] = config2.dark;
3224
+ }
3225
+ if (config2.light) {
3226
+ process.env[`${prefix}LIGHT`] = config2.light;
3227
+ }
3228
+ if (config2.brand) {
3229
+ process.env[`${prefix}BRAND`] = config2.brand;
3230
+ }
3231
+ if (config2.alternate) {
3232
+ process.env[`${prefix}ALTERNATE`] = config2.alternate;
3233
+ }
3234
+ if (config2.accent) {
3235
+ process.env[`${prefix}ACCENT`] = config2.accent;
3236
+ }
3237
+ if (config2.link) {
3238
+ process.env[`${prefix}LINK`] = config2.link;
3239
+ }
3240
+ if (config2.help) {
3241
+ process.env[`${prefix}HELP`] = config2.help;
3242
+ }
3243
+ if (config2.success) {
3244
+ process.env[`${prefix}SUCCESS`] = config2.success;
3245
+ }
3246
+ if (config2.info) {
3247
+ process.env[`${prefix}INFO`] = config2.info;
3248
+ }
3249
+ if (config2.warning) {
3250
+ process.env[`${prefix}WARNING`] = config2.warning;
3251
+ }
3252
+ if (config2.danger) {
3253
+ process.env[`${prefix}DANGER`] = config2.danger;
3254
+ }
3255
+ if (config2.fatal) {
3256
+ process.env[`${prefix}FATAL`] = config2.fatal;
3257
+ }
3258
+ if (config2.positive) {
3259
+ process.env[`${prefix}POSITIVE`] = config2.positive;
3260
+ }
3261
+ if (config2.negative) {
3262
+ process.env[`${prefix}NEGATIVE`] = config2.negative;
3263
+ }
3264
+ };
3265
+ var setMultiThemeColorConfigEnv = (prefix, config2) => {
3266
+ return {
3267
+ light: setBaseThemeColorConfigEnv(`${prefix}LIGHT_`, config2.light),
3268
+ dark: setBaseThemeColorConfigEnv(`${prefix}DARK_`, config2.dark)
3269
+ };
3270
+ };
3271
+ var setBaseThemeColorConfigEnv = (prefix, config2) => {
3272
+ if (config2.foreground) {
3273
+ process.env[`${prefix}FOREGROUND`] = config2.foreground;
3274
+ }
3275
+ if (config2.background) {
3276
+ process.env[`${prefix}BACKGROUND`] = config2.background;
3277
+ }
3278
+ if (config2.brand) {
3279
+ process.env[`${prefix}BRAND`] = config2.brand;
3280
+ }
3281
+ if (config2.alternate) {
3282
+ process.env[`${prefix}ALTERNATE`] = config2.alternate;
3283
+ }
3284
+ if (config2.accent) {
3285
+ process.env[`${prefix}ACCENT`] = config2.accent;
3286
+ }
3287
+ if (config2.link) {
3288
+ process.env[`${prefix}LINK`] = config2.link;
3289
+ }
3290
+ if (config2.help) {
3291
+ process.env[`${prefix}HELP`] = config2.help;
3292
+ }
3293
+ if (config2.success) {
3294
+ process.env[`${prefix}SUCCESS`] = config2.success;
3295
+ }
3296
+ if (config2.info) {
3297
+ process.env[`${prefix}INFO`] = config2.info;
3298
+ }
3299
+ if (config2.warning) {
3300
+ process.env[`${prefix}WARNING`] = config2.warning;
3301
+ }
3302
+ if (config2.danger) {
3303
+ process.env[`${prefix}DANGER`] = config2.danger;
3304
+ }
3305
+ if (config2.fatal) {
3306
+ process.env[`${prefix}FATAL`] = config2.fatal;
3307
+ }
3308
+ if (config2.positive) {
3309
+ process.env[`${prefix}POSITIVE`] = config2.positive;
3310
+ }
3311
+ if (config2.negative) {
3312
+ process.env[`${prefix}NEGATIVE`] = config2.negative;
3313
+ }
3314
+ };
3315
+
3316
+ // ../config-tools/src/create-storm-config.ts
3317
+ var _extension_cache = /* @__PURE__ */ new WeakMap();
3318
+ var _static_cache = void 0;
3319
+ var createStormWorkspaceConfig = async (extensionName, schema, workspaceRoot, skipLogs = false, useDefault = true) => {
3320
+ let result;
3321
+ if (!_static_cache?.data || !_static_cache?.timestamp || _static_cache.timestamp < Date.now() - 8e3) {
3322
+ let _workspaceRoot = workspaceRoot;
3323
+ if (!_workspaceRoot) {
3324
+ _workspaceRoot = findWorkspaceRoot2();
3325
+ }
3326
+ const configEnv = getConfigEnv();
3327
+ const configFile = await getConfigFile(_workspaceRoot);
3328
+ if (!configFile) {
3329
+ if (!skipLogs) {
3330
+ writeWarning(
3331
+ "No Storm Workspace configuration file found in the current repository. Please ensure this is the expected behavior - you can add a `storm-workspace.json` file to the root of your workspace if it is not.\n",
3332
+ { logLevel: "all" }
3333
+ );
3334
+ }
3335
+ if (useDefault === false) {
3336
+ return void 0;
3337
+ }
3338
+ }
3339
+ const defaultConfig = await getPackageJsonConfig(_workspaceRoot);
3340
+ result = applyDefaultConfig(
3341
+ await stormWorkspaceConfigSchema.parseAsync(
3342
+ defu3(configEnv, configFile, defaultConfig)
3343
+ )
3344
+ );
3345
+ result.workspaceRoot ??= _workspaceRoot;
3346
+ } else {
3347
+ result = _static_cache.data;
3348
+ }
3349
+ if (schema && extensionName) {
3350
+ result.extensions = {
3351
+ ...result.extensions,
3352
+ [extensionName]: createConfigExtension(extensionName, schema)
3353
+ };
3354
+ }
3355
+ _static_cache = {
3356
+ timestamp: Date.now(),
3357
+ data: result
3358
+ };
3359
+ return result;
3360
+ };
3361
+ var createConfigExtension = (extensionName, schema) => {
3362
+ const extension_cache_key = { extensionName };
3363
+ if (_extension_cache.has(extension_cache_key)) {
3364
+ return _extension_cache.get(extension_cache_key);
3365
+ }
3366
+ let extension = getExtensionEnv(extensionName);
3367
+ if (schema) {
3368
+ extension = schema.parse(extension);
3369
+ }
3370
+ _extension_cache.set(extension_cache_key, extension);
3371
+ return extension;
3372
+ };
3373
+ var tryLoadStormWorkspaceConfig = async (workspaceRoot, skipLogs = true, useDefault = false) => {
3374
+ try {
3375
+ const config2 = await createStormWorkspaceConfig(
3376
+ void 0,
3377
+ void 0,
3378
+ workspaceRoot,
3379
+ skipLogs,
3380
+ useDefault
3381
+ );
3382
+ if (!config2) {
3383
+ return void 0;
3384
+ }
3385
+ setConfigEnv(config2);
3386
+ if (!skipLogs && !config2.skipConfigLogging) {
3387
+ writeTrace(
3388
+ `\u2699\uFE0F Using Storm Workspace configuration:
3389
+ ${formatLogMessage(config2)}`,
3390
+ config2
3391
+ );
3392
+ }
3393
+ return config2;
3394
+ } catch (error) {
3395
+ if (!skipLogs) {
3396
+ writeWarning(
3397
+ `\u26A0\uFE0F Failed to load Storm Workspace configuration: ${error}`,
3398
+ { logLevel: "all" }
3399
+ );
3400
+ }
3401
+ return void 0;
3402
+ }
3403
+ };
3404
+
3405
+ // ../config-tools/src/get-config.ts
3406
+ init_esm_shims();
3407
+ var tryGetWorkspaceConfig = async (skipLogs = true, options = {}) => {
3408
+ try {
3409
+ let workspaceRoot = options.workspaceRoot;
3410
+ if (!workspaceRoot) {
3411
+ workspaceRoot = findWorkspaceRoot2(options.cwd);
3412
+ }
3413
+ return tryLoadStormWorkspaceConfig(
3414
+ workspaceRoot,
3415
+ skipLogs,
3416
+ options.useDefault
3417
+ );
3418
+ } catch {
3419
+ return void 0;
3420
+ }
3421
+ };
3422
+
3423
+ // src/configs/javascript.ts
3424
+ import defu4 from "defu";
1861
3425
  import globalsLib from "globals";
1862
3426
  async function javascript(options = {}) {
1863
3427
  const { lineEndings = "unix", overrides = {}, name: name2, globals = {} } = options;
3428
+ const workspaceConfig = await tryGetWorkspaceConfig();
1864
3429
  return [
1865
3430
  {
1866
3431
  name: "storm/javascript/setup",
1867
3432
  languageOptions: {
1868
3433
  ecmaVersion: 2022,
1869
- globals: defu2(globals, {
3434
+ globals: defu4(globals, {
1870
3435
  ...globalsLib.browser,
1871
3436
  ...globalsLib.es2021,
1872
3437
  ...globalsLib.node,
@@ -1894,9 +3459,10 @@ async function javascript(options = {}) {
1894
3459
  "banner/banner": [
1895
3460
  "error",
1896
3461
  {
3462
+ name: name2,
3463
+ banner: getFileBanner(name2, workspaceConfig),
1897
3464
  commentType: "block",
1898
3465
  numNewlines: 2,
1899
- name: name2,
1900
3466
  lineEndings
1901
3467
  }
1902
3468
  ]
@@ -3228,7 +4794,7 @@ async function node() {
3228
4794
 
3229
4795
  // src/configs/nx.ts
3230
4796
  init_esm_shims();
3231
- import defu3 from "defu";
4797
+ import defu5 from "defu";
3232
4798
  async function nx(options = {}) {
3233
4799
  const {
3234
4800
  depsCheck = false,
@@ -3258,7 +4824,7 @@ async function nx(options = {}) {
3258
4824
  rules: depsCheck !== false ? {
3259
4825
  "@nx/dependency-checks": [
3260
4826
  depsCheckSeverity,
3261
- defu3(depsCheck, {
4827
+ defu5(depsCheck, {
3262
4828
  buildTargets: ["build-base", "build"],
3263
4829
  ignoredDependencies,
3264
4830
  ignoredFiles,
@@ -3277,7 +4843,7 @@ async function nx(options = {}) {
3277
4843
  rules: moduleBoundaries !== false ? {
3278
4844
  "@nx/enforce-module-boundaries": [
3279
4845
  "error",
3280
- defu3(moduleBoundaries ?? {}, {
4846
+ defu5(moduleBoundaries ?? {}, {
3281
4847
  enforceBuildableLibDependency: false,
3282
4848
  checkDynamicDependenciesExceptions: [".*"],
3283
4849
  allow: [],
@@ -3348,8 +4914,8 @@ import {
3348
4914
  createProjectGraphAsync,
3349
4915
  readCachedProjectGraph
3350
4916
  } from "@nx/devkit";
3351
- import { existsSync as existsSync2 } from "node:fs";
3352
- import { readFile } from "node:fs/promises";
4917
+ import { existsSync as existsSync4 } from "node:fs";
4918
+ import { readFile as readFile2 } from "node:fs/promises";
3353
4919
  async function pnpm(options = {}) {
3354
4920
  const {
3355
4921
  overrides = {},
@@ -3381,8 +4947,8 @@ async function pnpm(options = {}) {
3381
4947
  projectNode.data.root,
3382
4948
  "package.json"
3383
4949
  );
3384
- if (existsSync2(projectPackageJsonPath)) {
3385
- const projectPackageJsonContent = await readFile(
4950
+ if (existsSync4(projectPackageJsonPath)) {
4951
+ const projectPackageJsonContent = await readFile2(
3386
4952
  projectPackageJsonPath,
3387
4953
  "utf8"
3388
4954
  );