@storm-software/config-tools 1.119.0 → 1.130.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (144) hide show
  1. package/README.md +1 -1
  2. package/dist/chunk-4IYEDNYJ.mjs +426 -0
  3. package/dist/chunk-5P4S7DMV.js +51 -0
  4. package/dist/chunk-5QZ7AV2J.js +27 -0
  5. package/dist/chunk-6OYLNZFT.mjs +169 -0
  6. package/dist/chunk-6SJLAEJ3.js +70 -0
  7. package/dist/chunk-6WPG3DXV.js +32 -0
  8. package/dist/chunk-7XY63NME.js +44 -0
  9. package/dist/chunk-A7VLTBS6.mjs +271 -0
  10. package/dist/chunk-BNNLKDKI.mjs +102 -0
  11. package/dist/chunk-BO45V6E2.mjs +51 -0
  12. package/dist/chunk-BS5OC5E6.js +426 -0
  13. package/dist/chunk-E3IN3SQD.mjs +6 -0
  14. package/dist/chunk-FW22KPOW.mjs +27 -0
  15. package/dist/chunk-GIZ23UUE.js +189 -0
  16. package/dist/chunk-GOQAHXJF.mjs +28 -0
  17. package/dist/chunk-H6XXDZ7A.js +28 -0
  18. package/dist/chunk-K6TQN2LZ.js +6 -0
  19. package/dist/chunk-LCD7F65X.js +545 -0
  20. package/dist/chunk-LKZSRXS7.js +169 -0
  21. package/dist/chunk-MGI2M3SX.js +6 -0
  22. package/dist/chunk-N32EGEJB.js +90 -0
  23. package/dist/chunk-N4BRCEYB.js +27 -0
  24. package/dist/chunk-PEHVR33I.js +67 -0
  25. package/dist/chunk-PQNCKJAR.js +271 -0
  26. package/dist/chunk-PVPSTJNJ.mjs +90 -0
  27. package/dist/chunk-QHVHX67K.js +6 -0
  28. package/dist/chunk-QUVGIEZZ.mjs +6 -0
  29. package/dist/chunk-RAWSXKTG.mjs +189 -0
  30. package/dist/chunk-RHGJNRVE.mjs +125 -0
  31. package/dist/chunk-RYIDKM6L.mjs +545 -0
  32. package/dist/chunk-SJO5XZQA.js +6 -0
  33. package/dist/chunk-T2X5W62C.js +125 -0
  34. package/dist/chunk-TEKFJAJJ.mjs +70 -0
  35. package/dist/chunk-TTCXDK6S.mjs +27 -0
  36. package/dist/chunk-UCUOC6LA.mjs +70 -0
  37. package/dist/chunk-VFRDDJD4.js +102 -0
  38. package/dist/chunk-VQLOUFMG.mjs +32 -0
  39. package/dist/chunk-WRFJFYOU.mjs +51 -0
  40. package/dist/chunk-WXOSG64C.js +70 -0
  41. package/dist/chunk-WXYJGX4C.mjs +6 -0
  42. package/dist/chunk-X6VIYUJR.mjs +6 -0
  43. package/dist/chunk-XJEQHMOE.js +49 -0
  44. package/dist/chunk-XLMGW4ZW.mjs +67 -0
  45. package/dist/chunk-XXHENMLT.mjs +44 -0
  46. package/dist/config-file/get-config-file.d.mts +20 -0
  47. package/dist/config-file/get-config-file.d.ts +20 -0
  48. package/dist/config-file/get-config-file.js +23 -0
  49. package/dist/config-file/get-config-file.mjs +23 -0
  50. package/dist/config-file/index.d.mts +4 -0
  51. package/dist/config-file/index.d.ts +4 -0
  52. package/dist/config-file/index.js +24 -0
  53. package/dist/config-file/index.mjs +24 -0
  54. package/dist/create-storm-config.d.mts +29 -0
  55. package/dist/create-storm-config.d.ts +29 -0
  56. package/dist/create-storm-config.js +30 -0
  57. package/dist/create-storm-config.mjs +30 -0
  58. package/dist/env/get-env.d.mts +19 -0
  59. package/dist/env/get-env.d.ts +19 -0
  60. package/dist/env/get-env.js +13 -0
  61. package/dist/env/get-env.mjs +13 -0
  62. package/dist/env/index.d.mts +5 -0
  63. package/dist/env/index.d.ts +5 -0
  64. package/dist/env/index.js +20 -0
  65. package/dist/env/index.mjs +20 -0
  66. package/{src/env/get-env.d.ts → dist/env/set-env.d.mts} +7 -4
  67. package/{src → dist}/env/set-env.d.ts +7 -3
  68. package/dist/env/set-env.js +12 -0
  69. package/dist/env/set-env.mjs +12 -0
  70. package/dist/index.d.mts +19 -0
  71. package/dist/index.d.ts +19 -0
  72. package/dist/index.js +132 -0
  73. package/dist/index.mjs +132 -0
  74. package/dist/types-DGWqy1xb.d.mts +1395 -0
  75. package/dist/types-DGWqy1xb.d.ts +1395 -0
  76. package/dist/types.d.mts +40 -0
  77. package/{src → dist}/types.d.ts +14 -7
  78. package/dist/types.js +9 -0
  79. package/dist/types.mjs +9 -0
  80. package/dist/utilities/apply-workspace-tokens.d.mts +9 -0
  81. package/dist/utilities/apply-workspace-tokens.d.ts +9 -0
  82. package/dist/utilities/apply-workspace-tokens.js +14 -0
  83. package/dist/utilities/apply-workspace-tokens.mjs +14 -0
  84. package/dist/utilities/correct-paths.d.mts +19 -0
  85. package/dist/utilities/correct-paths.d.ts +19 -0
  86. package/dist/utilities/correct-paths.js +9 -0
  87. package/dist/utilities/correct-paths.mjs +9 -0
  88. package/dist/utilities/file-path-utils.d.mts +4 -0
  89. package/dist/utilities/file-path-utils.d.ts +4 -0
  90. package/dist/utilities/file-path-utils.js +9 -0
  91. package/dist/utilities/file-path-utils.mjs +9 -0
  92. package/dist/utilities/find-up.d.mts +6 -0
  93. package/dist/utilities/find-up.d.ts +6 -0
  94. package/dist/utilities/find-up.js +7 -0
  95. package/dist/utilities/find-up.mjs +7 -0
  96. package/dist/utilities/find-workspace-root.d.mts +16 -0
  97. package/{src → dist}/utilities/find-workspace-root.d.ts +4 -2
  98. package/dist/utilities/find-workspace-root.js +11 -0
  99. package/dist/utilities/find-workspace-root.mjs +11 -0
  100. package/dist/utilities/get-default-config.d.mts +15 -0
  101. package/dist/utilities/get-default-config.d.ts +15 -0
  102. package/dist/utilities/get-default-config.js +13 -0
  103. package/dist/utilities/get-default-config.mjs +13 -0
  104. package/dist/utilities/index.d.mts +11 -0
  105. package/dist/utilities/index.d.ts +11 -0
  106. package/dist/utilities/index.js +58 -0
  107. package/dist/utilities/index.mjs +58 -0
  108. package/dist/utilities/process-handler.d.mts +8 -0
  109. package/dist/utilities/process-handler.d.ts +8 -0
  110. package/dist/utilities/process-handler.js +20 -0
  111. package/dist/utilities/process-handler.mjs +20 -0
  112. package/dist/utilities/run.d.mts +36 -0
  113. package/dist/utilities/run.d.ts +36 -0
  114. package/dist/utilities/run.js +11 -0
  115. package/dist/utilities/run.mjs +11 -0
  116. package/package.json +1 -24
  117. package/CHANGELOG.md +0 -3122
  118. package/declarations.d.ts +0 -304
  119. package/index.cjs +0 -67508
  120. package/index.js +0 -67463
  121. package/meta.cjs.json +0 -5352
  122. package/meta.esm.json +0 -5413
  123. package/src/config-file/get-config-file.d.ts +0 -16
  124. package/src/config-file/index.d.ts +0 -1
  125. package/src/create-storm-config.d.ts +0 -26
  126. package/src/env/index.d.ts +0 -2
  127. package/src/index.d.ts +0 -13
  128. package/src/utilities/apply-workspace-tokens.d.ts +0 -4
  129. package/src/utilities/chalk.d.ts +0 -23
  130. package/src/utilities/correct-paths.d.ts +0 -1
  131. package/src/utilities/file-path-utils.d.ts +0 -2
  132. package/src/utilities/find-up.d.ts +0 -4
  133. package/src/utilities/get-default-config.d.ts +0 -15
  134. package/src/utilities/get-log-level.d.ts +0 -22
  135. package/src/utilities/index.d.ts +0 -10
  136. package/src/utilities/logger.d.ts +0 -78
  137. package/src/utilities/process-handler.d.ts +0 -4
  138. package/src/utilities/run.d.ts +0 -18
  139. package/utilities/chalk.cjs +0 -1610
  140. package/utilities/chalk.js +0 -1605
  141. package/utilities/find-workspace-root.cjs +0 -118
  142. package/utilities/find-workspace-root.js +0 -91
  143. package/utilities/logger.cjs +0 -5914
  144. package/utilities/logger.js +0 -5897
@@ -0,0 +1,90 @@
1
+ import {
2
+ findWorkspaceRoot
3
+ } from "./chunk-TEKFJAJJ.mjs";
4
+ import {
5
+ STORM_DEFAULT_HOMEPAGE,
6
+ STORM_DEFAULT_LICENSE
7
+ } from "./chunk-RAWSXKTG.mjs";
8
+ import {
9
+ __name,
10
+ init_esm_shims
11
+ } from "./chunk-WRFJFYOU.mjs";
12
+
13
+ // src/utilities/get-default-config.ts
14
+ init_esm_shims();
15
+ import { existsSync, readFileSync } from "node:fs";
16
+ import { join } from "node:path";
17
+ var DEFAULT_COLOR_CONFIG = {
18
+ "light": {
19
+ "background": "#fafafa",
20
+ "foreground": "#1d1e22",
21
+ "brand": "#1fb2a6",
22
+ "alternate": "#db2777",
23
+ "help": "#5C4EE5",
24
+ "success": "#087f5b",
25
+ "info": "#0550ae",
26
+ "warning": "#e3b341",
27
+ "danger": "#D8314A",
28
+ "positive": "#22c55e",
29
+ "negative": "#dc2626"
30
+ },
31
+ "dark": {
32
+ "background": "#1d1e22",
33
+ "foreground": "#cbd5e1",
34
+ "brand": "#2dd4bf",
35
+ "alternate": "#db2777",
36
+ "help": "#818cf8",
37
+ "success": "#10b981",
38
+ "info": "#58a6ff",
39
+ "warning": "#f3d371",
40
+ "danger": "#D8314A",
41
+ "positive": "#22c55e",
42
+ "negative": "#dc2626"
43
+ }
44
+ };
45
+ var getDefaultConfig = /* @__PURE__ */ __name((root) => {
46
+ let license = STORM_DEFAULT_LICENSE;
47
+ let homepage = STORM_DEFAULT_HOMEPAGE;
48
+ let name;
49
+ let namespace;
50
+ let repository;
51
+ const workspaceRoot = findWorkspaceRoot(root);
52
+ if (existsSync(join(workspaceRoot, "package.json"))) {
53
+ const file = readFileSync(join(workspaceRoot, "package.json"), {
54
+ encoding: "utf8"
55
+ });
56
+ if (file) {
57
+ const packageJson = JSON.parse(file);
58
+ if (packageJson.name) {
59
+ name = packageJson.name;
60
+ }
61
+ if (packageJson.namespace) {
62
+ namespace = packageJson.namespace;
63
+ }
64
+ if (packageJson.repository?.url) {
65
+ repository = packageJson.repository?.url;
66
+ }
67
+ if (packageJson.license) {
68
+ license = packageJson.license;
69
+ }
70
+ if (packageJson.homepage) {
71
+ homepage = packageJson.homepage;
72
+ }
73
+ }
74
+ }
75
+ return {
76
+ workspaceRoot,
77
+ name,
78
+ namespace,
79
+ repository,
80
+ license,
81
+ homepage,
82
+ docs: `${homepage || STORM_DEFAULT_HOMEPAGE}/docs`,
83
+ licensing: `${homepage || STORM_DEFAULT_HOMEPAGE}/license`
84
+ };
85
+ }, "getDefaultConfig");
86
+
87
+ export {
88
+ DEFAULT_COLOR_CONFIG,
89
+ getDefaultConfig
90
+ };
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+
3
+ var _chunkXJEQHMOEjs = require('./chunk-XJEQHMOE.js');
4
+
5
+ // src/config-file/index.ts
6
+ _chunkXJEQHMOEjs.init_cjs_shims.call(void 0, );
@@ -0,0 +1,6 @@
1
+ import {
2
+ init_esm_shims
3
+ } from "./chunk-WRFJFYOU.mjs";
4
+
5
+ // src/env/index.ts
6
+ init_esm_shims();
@@ -0,0 +1,189 @@
1
+ import {
2
+ init_esm_shims
3
+ } from "./chunk-WRFJFYOU.mjs";
4
+
5
+ // ../config/src/constants.ts
6
+ init_esm_shims();
7
+ var STORM_DEFAULT_DOCS = "https://docs.stormsoftware.com";
8
+ var STORM_DEFAULT_HOMEPAGE = "https://stormsoftware.com";
9
+ var STORM_DEFAULT_LICENSING = "https://license.stormsoftware.com";
10
+ var STORM_DEFAULT_LICENSE = "Apache-2.0";
11
+
12
+ // ../config/src/schema.ts
13
+ init_esm_shims();
14
+ import z from "zod";
15
+ 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");
16
+ 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");
17
+ 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");
18
+ 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");
19
+ 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");
20
+ 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");
21
+ 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");
22
+ 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");
23
+ 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");
24
+ 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");
25
+ 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");
26
+ var FatalColorSchema = z.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7).optional().describe("The fatal color of the workspace");
27
+ 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");
28
+ 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");
29
+ var DarkThemeColorConfigSchema = z.object({
30
+ foreground: LightColorSchema,
31
+ background: DarkColorSchema,
32
+ brand: BrandColorSchema,
33
+ alternate: AlternateColorSchema,
34
+ accent: AccentColorSchema,
35
+ link: LinkColorSchema,
36
+ help: HelpColorSchema,
37
+ success: SuccessColorSchema,
38
+ info: InfoColorSchema,
39
+ warning: WarningColorSchema,
40
+ danger: DangerColorSchema,
41
+ fatal: FatalColorSchema,
42
+ positive: PositiveColorSchema,
43
+ negative: NegativeColorSchema
44
+ });
45
+ var LightThemeColorConfigSchema = z.object({
46
+ foreground: DarkColorSchema,
47
+ background: LightColorSchema,
48
+ brand: BrandColorSchema,
49
+ alternate: AlternateColorSchema,
50
+ accent: AccentColorSchema,
51
+ link: LinkColorSchema,
52
+ help: HelpColorSchema,
53
+ success: SuccessColorSchema,
54
+ info: InfoColorSchema,
55
+ warning: WarningColorSchema,
56
+ danger: DangerColorSchema,
57
+ fatal: FatalColorSchema,
58
+ positive: PositiveColorSchema,
59
+ negative: NegativeColorSchema
60
+ });
61
+ var MultiThemeColorConfigSchema = z.object({
62
+ dark: DarkThemeColorConfigSchema,
63
+ light: LightThemeColorConfigSchema
64
+ });
65
+ var SingleThemeColorConfigSchema = z.object({
66
+ dark: DarkColorSchema,
67
+ light: LightColorSchema,
68
+ brand: BrandColorSchema,
69
+ alternate: AlternateColorSchema,
70
+ accent: AccentColorSchema,
71
+ link: LinkColorSchema,
72
+ help: HelpColorSchema,
73
+ success: SuccessColorSchema,
74
+ info: InfoColorSchema,
75
+ warning: WarningColorSchema,
76
+ danger: DangerColorSchema,
77
+ fatal: FatalColorSchema,
78
+ positive: PositiveColorSchema,
79
+ negative: NegativeColorSchema
80
+ });
81
+ var RegistryUrlConfigSchema = z.string().trim().toLowerCase().url().optional().describe("A remote registry URL used to publish distributable packages");
82
+ var RegistryConfigSchema = z.object({
83
+ github: RegistryUrlConfigSchema,
84
+ npm: RegistryUrlConfigSchema,
85
+ cargo: RegistryUrlConfigSchema,
86
+ cyclone: RegistryUrlConfigSchema,
87
+ container: RegistryUrlConfigSchema
88
+ }).default({}).describe("A list of remote registry URLs used by Storm Software");
89
+ var ColorConfigSchema = SingleThemeColorConfigSchema.or(MultiThemeColorConfigSchema).describe("Colors used for various workspace elements");
90
+ var ColorConfigMapSchema = z.union([
91
+ z.object({
92
+ "base": ColorConfigSchema
93
+ }),
94
+ z.record(z.string(), ColorConfigSchema)
95
+ ]);
96
+ var WorkspaceBotConfigSchema = z.object({
97
+ name: z.string().trim().default("Stormie-Bot").describe("The workspace bot user's name (this is the bot that will be used to perform various tasks)"),
98
+ email: z.string().trim().email().default("bot@stormsoftware.com").describe("The email of the workspace bot")
99
+ }).describe("The workspace's bot user's config used to automated various operations tasks");
100
+ var WorkspaceDirectoryConfigSchema = z.object({
101
+ cache: z.string().trim().optional().describe("The directory used to store the environment's cached file data"),
102
+ data: z.string().trim().optional().describe("The directory used to store the environment's data files"),
103
+ config: z.string().trim().optional().describe("The directory used to store the environment's configuration files"),
104
+ temp: z.string().trim().optional().describe("The directory used to store the environment's temp files"),
105
+ log: z.string().trim().optional().describe("The directory used to store the environment's temp files"),
106
+ build: z.string().trim().default("dist").describe("The directory used to store the workspace's distributable files after a build (relative to the workspace root)")
107
+ }).describe("Various directories used by the workspace to store data, cache, and configuration files");
108
+ var StormConfigSchema = z.object({
109
+ $schema: z.string().trim().default("https://cdn.jsdelivr.net/npm/@storm-software/config/schemas/storm.schema.json").optional().nullish().describe("The URL to the JSON schema file that describes the Storm configuration file"),
110
+ extends: z.string().trim().optional().describe("The path to a base JSON file to use as a configuration preset file"),
111
+ name: z.string().trim().toLowerCase().optional().describe("The name of the service/package/scope using this configuration"),
112
+ namespace: z.string().trim().toLowerCase().optional().describe("The namespace of the package"),
113
+ organization: z.string().trim().default("storm-software").describe("The organization of the workspace"),
114
+ repository: z.string().trim().url().optional().describe("The repo URL of the workspace (i.e. GitHub)"),
115
+ license: z.string().trim().default("Apache-2.0").describe("The license type of the package"),
116
+ homepage: z.string().trim().url().default(STORM_DEFAULT_HOMEPAGE).describe("The homepage of the workspace"),
117
+ docs: z.string().trim().url().default(STORM_DEFAULT_DOCS).describe("The base documentation site for the workspace"),
118
+ licensing: z.string().trim().url().default(STORM_DEFAULT_LICENSING).describe("The base licensing site for the workspace"),
119
+ branch: z.string().trim().default("main").describe("The branch of the workspace"),
120
+ preid: z.string().optional().describe("A tag specifying the version pre-release identifier"),
121
+ owner: z.string().trim().default("@storm-software/admin").describe("The owner of the package"),
122
+ bot: WorkspaceBotConfigSchema,
123
+ env: z.enum([
124
+ "development",
125
+ "staging",
126
+ "production"
127
+ ]).default("production").describe("The current runtime environment name for the package"),
128
+ workspaceRoot: z.string().trim().default("").describe("The root directory of the workspace"),
129
+ externalPackagePatterns: z.array(z.string()).default([]).describe("The build will use these package patterns to determine if they should be external to the bundle"),
130
+ skipCache: z.boolean().default(false).describe("Should all known types of workspace caching be skipped?"),
131
+ directories: WorkspaceDirectoryConfigSchema,
132
+ packageManager: z.enum([
133
+ "npm",
134
+ "yarn",
135
+ "pnpm",
136
+ "bun"
137
+ ]).default("npm").describe("The JavaScript/TypeScript package manager used by the repository"),
138
+ timezone: z.string().trim().default("America/New_York").describe("The default timezone of the workspace"),
139
+ locale: z.string().trim().default("en-US").describe("The default locale of the workspace"),
140
+ logLevel: z.enum([
141
+ "silent",
142
+ "fatal",
143
+ "error",
144
+ "warn",
145
+ "info",
146
+ "debug",
147
+ "trace",
148
+ "all"
149
+ ]).default("info").describe("The log level used to filter out lower priority log messages. If not provided, this is defaulted using the `environment` config value (if `environment` is set to `production` then `level` is `error`, else `level` is `debug`)."),
150
+ registry: RegistryConfigSchema,
151
+ configFile: z.string().trim().nullable().default(null).describe("The filepath of the Storm config. When this field is null, no config file was found in the current workspace."),
152
+ colors: ColorConfigSchema.or(ColorConfigMapSchema).describe("Storm theme config values used for styling various package elements"),
153
+ extensions: z.record(z.any()).optional().default({}).describe("Configuration of each used extension")
154
+ }).describe("Storm Workspace config values used during various dev-ops processes. This type is a combination of the StormPackageConfig and StormProject types. It represents the config of the entire monorepo.");
155
+
156
+ // ../config/src/types.ts
157
+ init_esm_shims();
158
+ var COLOR_KEYS = [
159
+ "dark",
160
+ "light",
161
+ "base",
162
+ "brand",
163
+ "alternate",
164
+ "accent",
165
+ "link",
166
+ "success",
167
+ "help",
168
+ "info",
169
+ "warning",
170
+ "danger",
171
+ "fatal",
172
+ "positive",
173
+ "negative"
174
+ ];
175
+
176
+ // ../config/src/index.ts
177
+ init_esm_shims();
178
+
179
+ // ../config/src/define-config.ts
180
+ init_esm_shims();
181
+
182
+ export {
183
+ STORM_DEFAULT_DOCS,
184
+ STORM_DEFAULT_HOMEPAGE,
185
+ STORM_DEFAULT_LICENSING,
186
+ STORM_DEFAULT_LICENSE,
187
+ StormConfigSchema,
188
+ COLOR_KEYS
189
+ };
@@ -0,0 +1,125 @@
1
+ import {
2
+ DEFAULT_COLOR_CONFIG
3
+ } from "./chunk-PVPSTJNJ.mjs";
4
+ import {
5
+ getChalk
6
+ } from "./chunk-4IYEDNYJ.mjs";
7
+ import {
8
+ getLogLevel
9
+ } from "./chunk-UCUOC6LA.mjs";
10
+ import {
11
+ LogLevel,
12
+ LogLevelLabel
13
+ } from "./chunk-VQLOUFMG.mjs";
14
+ import {
15
+ __name,
16
+ init_esm_shims
17
+ } from "./chunk-WRFJFYOU.mjs";
18
+
19
+ // src/logger/console.ts
20
+ init_esm_shims();
21
+ var getLogFn = /* @__PURE__ */ __name((logLevel = LogLevel.INFO, config = {}) => {
22
+ const _chalk = getChalk();
23
+ 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;
24
+ const configLogLevel = config.logLevel || process.env.STORM_LOG_LEVEL || LogLevelLabel.INFO;
25
+ if (typeof logLevel === "number" && (logLevel >= getLogLevel(configLogLevel) || logLevel <= LogLevel.SILENT) || typeof logLevel === "string" && getLogLevel(logLevel) >= getLogLevel(configLogLevel)) {
26
+ return (_) => {
27
+ };
28
+ }
29
+ if (typeof logLevel === "number" && LogLevel.FATAL >= logLevel || typeof logLevel === "string" && LogLevel.FATAL >= getLogLevel(logLevel)) {
30
+ return (message) => {
31
+ console.error(`${_chalk.bold.hex(colors.fatal ?? "#7d1a1a")(">")} ${_chalk.bold.bgHex(colors.fatal ?? "#7d1a1a").whiteBright(" \u{1F480} Fatal ")} ${_chalk.hex(colors.fatal ?? "#7d1a1a")(formatLogMessage(message))}
32
+ `);
33
+ };
34
+ }
35
+ if (typeof logLevel === "number" && LogLevel.ERROR >= logLevel || typeof logLevel === "string" && LogLevel.ERROR >= getLogLevel(logLevel)) {
36
+ return (message) => {
37
+ console.error(`${_chalk.bold.hex(colors.danger ?? "#f85149")(">")} ${_chalk.bold.bgHex(colors.danger ?? "#f85149").whiteBright(" \u2718 Error ")} ${_chalk.hex(colors.danger ?? "#f85149")(formatLogMessage(message))}
38
+ `);
39
+ };
40
+ }
41
+ if (typeof logLevel === "number" && LogLevel.WARN >= logLevel || typeof logLevel === "string" && LogLevel.WARN >= getLogLevel(logLevel)) {
42
+ return (message) => {
43
+ console.warn(`${_chalk.bold.hex(colors.warning ?? "#e3b341")(">")} ${_chalk.bold.bgHex(colors.warning ?? "#e3b341").whiteBright(" \u26A0 Warn ")} ${_chalk.hex(colors.warning ?? "#e3b341")(formatLogMessage(message))}
44
+ `);
45
+ };
46
+ }
47
+ if (typeof logLevel === "number" && LogLevel.SUCCESS >= logLevel || typeof logLevel === "string" && LogLevel.SUCCESS >= getLogLevel(logLevel)) {
48
+ return (message) => {
49
+ console.info(`${_chalk.bold.hex(colors.success ?? "#56d364")(">")} ${_chalk.bold.bgHex(colors.success ?? "#56d364").whiteBright(" \u2713 Success ")} ${_chalk.hex(colors.success ?? "#56d364")(formatLogMessage(message))}
50
+ `);
51
+ };
52
+ }
53
+ if (typeof logLevel === "number" && LogLevel.INFO >= logLevel || typeof logLevel === "string" && LogLevel.INFO >= getLogLevel(logLevel)) {
54
+ return (message) => {
55
+ console.info(`${_chalk.bold.hex(colors.info ?? "#58a6ff")(">")} ${_chalk.bold.bgHex(colors.info ?? "#58a6ff").whiteBright(" \u2139 Info ")} ${_chalk.hex(colors.info ?? "#58a6ff")(formatLogMessage(message))}
56
+ `);
57
+ };
58
+ }
59
+ if (typeof logLevel === "number" && LogLevel.TRACE >= logLevel || typeof logLevel === "string" && LogLevel.TRACE >= getLogLevel(logLevel)) {
60
+ return (message) => {
61
+ console.debug(`${_chalk.bold.hex(colors.brand ?? "#1fb2a6")(">")} ${_chalk.bold.bgHex(colors.brand ?? "#1fb2a6").whiteBright(" \u{1F6E0} Debug ")} ${_chalk.hex(colors.brand ?? "#1fb2a6")(formatLogMessage(message))}
62
+ `);
63
+ };
64
+ }
65
+ return (message) => {
66
+ console.log(`${_chalk.bold.hex(colors.brand ?? "#1fb2a6")(">")} ${_chalk.bold.bgHex(colors.brand ?? "#1fb2a6").whiteBright(" \u2709 System ")} ${_chalk.hex(colors.brand ?? "#1fb2a6")(formatLogMessage(message))}
67
+ `);
68
+ };
69
+ }, "getLogFn");
70
+ var writeFatal = /* @__PURE__ */ __name((message, config) => getLogFn(LogLevel.FATAL, config)(message), "writeFatal");
71
+ var writeError = /* @__PURE__ */ __name((message, config) => getLogFn(LogLevel.ERROR, config)(message), "writeError");
72
+ var writeWarning = /* @__PURE__ */ __name((message, config) => getLogFn(LogLevel.WARN, config)(message), "writeWarning");
73
+ var writeInfo = /* @__PURE__ */ __name((message, config) => getLogFn(LogLevel.INFO, config)(message), "writeInfo");
74
+ var writeSuccess = /* @__PURE__ */ __name((message, config) => getLogFn(LogLevel.SUCCESS, config)(message), "writeSuccess");
75
+ var writeDebug = /* @__PURE__ */ __name((message, config) => getLogFn(LogLevel.DEBUG, config)(message), "writeDebug");
76
+ var writeTrace = /* @__PURE__ */ __name((message, config) => getLogFn(LogLevel.TRACE, config)(message), "writeTrace");
77
+ var writeSystem = /* @__PURE__ */ __name((message, config) => getLogFn(LogLevel.ALL, config)(message), "writeSystem");
78
+ var getStopwatch = /* @__PURE__ */ __name((name) => {
79
+ const start = process.hrtime();
80
+ return () => {
81
+ const end = process.hrtime(start);
82
+ console.info(`
83
+ > \u23F1\uFE0F The${name ? ` ${name}` : ""} process took ${Math.round(end[0] * 1e3 + end[1] / 1e6)}ms to complete
84
+
85
+ `);
86
+ };
87
+ }, "getStopwatch");
88
+ var MAX_DEPTH = 4;
89
+ var formatLogMessage = /* @__PURE__ */ __name((message, options = {}, depth = 0) => {
90
+ if (depth > MAX_DEPTH) {
91
+ return "<max depth>";
92
+ }
93
+ const prefix = options.prefix ?? "-";
94
+ const skip = options.skip ?? [];
95
+ return typeof message === "undefined" || message === null || !message && typeof message !== "boolean" ? "<none>" : typeof message === "string" ? message : Array.isArray(message) ? `
96
+ ${message.map((item, index) => ` ${prefix}> #${index} = ${formatLogMessage(item, {
97
+ prefix: `${prefix}-`,
98
+ skip
99
+ }, depth + 1)}`).join("\n")}` : typeof message === "object" ? `
100
+ ${Object.keys(message).filter((key) => !skip.includes(key)).map((key) => ` ${prefix}> ${key} = ${_isFunction(message[key]) ? "<function>" : typeof message[key] === "object" ? formatLogMessage(message[key], {
101
+ prefix: `${prefix}-`,
102
+ skip
103
+ }, depth + 1) : message[key]}`).join("\n")}` : message;
104
+ }, "formatLogMessage");
105
+ var _isFunction = /* @__PURE__ */ __name((value) => {
106
+ try {
107
+ return value instanceof Function || typeof value === "function" || !!(value?.constructor && value?.call && value?.apply);
108
+ } catch (e) {
109
+ return false;
110
+ }
111
+ }, "_isFunction");
112
+
113
+ export {
114
+ getLogFn,
115
+ writeFatal,
116
+ writeError,
117
+ writeWarning,
118
+ writeInfo,
119
+ writeSuccess,
120
+ writeDebug,
121
+ writeTrace,
122
+ writeSystem,
123
+ getStopwatch,
124
+ formatLogMessage
125
+ };