@storm-software/cloudflare-tools 0.48.0 → 0.49.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (81) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/dist/chunk-3J7KBHMJ.mjs +0 -0
  3. package/dist/chunk-7Z5PILRU.mjs +0 -0
  4. package/dist/chunk-A4ZIZ2JU.mjs +228 -0
  5. package/dist/chunk-A7FFSBE6.mjs +26 -0
  6. package/dist/chunk-CVGPWUNP.js +1 -0
  7. package/dist/chunk-DHBG5ASJ.js +1 -0
  8. package/dist/chunk-I4XNMV5U.js +227 -0
  9. package/dist/chunk-J5SB6L2L.js +18 -0
  10. package/dist/chunk-JCB2DTP6.js +42 -0
  11. package/dist/chunk-KKOHB7JH.js +239 -0
  12. package/dist/chunk-MTM5OTKD.mjs +239 -0
  13. package/dist/chunk-NKCR3FSU.js +153 -0
  14. package/dist/chunk-NSLK6ZDO.mjs +603 -0
  15. package/dist/chunk-OARYMVO7.mjs +501 -0
  16. package/dist/chunk-OJNZ4PXQ.mjs +3466 -0
  17. package/dist/chunk-QEWY5YJA.mjs +89 -0
  18. package/dist/chunk-R7AIVBS7.js +89 -0
  19. package/dist/chunk-RCE3CC76.js +603 -0
  20. package/dist/chunk-VPT6GF3S.mjs +153 -0
  21. package/dist/chunk-VTHBMY4B.js +133 -0
  22. package/dist/chunk-VYOULWAK.mjs +42 -0
  23. package/dist/chunk-XO66D74Z.js +1 -0
  24. package/dist/chunk-XU6MTFCV.mjs +133 -0
  25. package/dist/chunk-YE4FHRXJ.js +501 -0
  26. package/dist/chunk-YSCEY447.mjs +0 -0
  27. package/dist/chunk-Z46UO4N7.js +3465 -0
  28. package/dist/executors.d.mts +2 -0
  29. package/dist/executors.d.ts +2 -0
  30. package/dist/executors.js +9 -0
  31. package/dist/executors.mjs +9 -0
  32. package/dist/generator-DJ1RuHyR.d.mts +14 -0
  33. package/dist/generator-DJ1RuHyR.d.ts +14 -0
  34. package/dist/generator-DW-9W9Fk.d.mts +22 -0
  35. package/dist/generator-DW-9W9Fk.d.ts +22 -0
  36. package/dist/generators.d.mts +4 -0
  37. package/dist/generators.d.ts +4 -0
  38. package/dist/generators.js +18 -0
  39. package/dist/generators.mjs +18 -0
  40. package/dist/index.d.mts +45 -0
  41. package/dist/index.d.ts +45 -0
  42. package/dist/index.js +151 -0
  43. package/dist/index.mjs +151 -0
  44. package/dist/schema.d-DgA16PUG.d.mts +24 -0
  45. package/dist/schema.d-DgA16PUG.d.ts +24 -0
  46. package/dist/schema.d-oSirXiCO.d.mts +11 -0
  47. package/dist/schema.d-oSirXiCO.d.ts +11 -0
  48. package/dist/src/executors/cloudflare-publish/executor.d.mts +8 -0
  49. package/dist/src/executors/cloudflare-publish/executor.d.ts +8 -0
  50. package/dist/src/executors/cloudflare-publish/executor.js +11 -0
  51. package/dist/src/executors/cloudflare-publish/executor.mjs +11 -0
  52. package/dist/src/executors/r2-upload-publish/executor.d.mts +8 -0
  53. package/dist/src/executors/r2-upload-publish/executor.d.ts +8 -0
  54. package/dist/src/executors/r2-upload-publish/executor.js +11 -0
  55. package/dist/src/executors/r2-upload-publish/executor.mjs +11 -0
  56. package/dist/src/executors/serve/executor.d.mts +1240 -0
  57. package/dist/src/executors/serve/executor.d.ts +1240 -0
  58. package/dist/src/executors/serve/executor.js +75 -0
  59. package/dist/src/executors/serve/executor.mjs +75 -0
  60. package/dist/src/executors/serve/schema.d.ts +1 -1
  61. package/dist/src/generators/init/generator.d.mts +2 -0
  62. package/dist/src/generators/init/generator.d.ts +2 -0
  63. package/dist/src/generators/init/generator.js +11 -0
  64. package/dist/src/generators/init/generator.mjs +11 -0
  65. package/dist/src/generators/worker/generator.d.mts +3 -0
  66. package/dist/src/generators/worker/generator.d.ts +3 -0
  67. package/dist/src/generators/worker/generator.js +14 -0
  68. package/dist/src/generators/worker/generator.mjs +14 -0
  69. package/dist/src/utils/index.d.mts +3 -0
  70. package/dist/src/utils/index.d.ts +3 -0
  71. package/dist/src/utils/index.js +11 -0
  72. package/dist/src/utils/index.mjs +11 -0
  73. package/dist/src/utils/r2-bucket-helpers.d.mts +7 -0
  74. package/dist/src/utils/r2-bucket-helpers.d.ts +7 -0
  75. package/dist/src/utils/r2-bucket-helpers.js +10 -0
  76. package/dist/src/utils/r2-bucket-helpers.mjs +10 -0
  77. package/dist/tsup.config.d.mts +5 -0
  78. package/dist/tsup.config.d.ts +5 -0
  79. package/dist/tsup.config.js +35 -0
  80. package/dist/tsup.config.mjs +35 -0
  81. package/package.json +1 -1
@@ -0,0 +1,603 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
2
+
3
+ var _chunkJ5SB6L2Ljs = require('./chunk-J5SB6L2L.js');
4
+
5
+ // ../config-tools/src/utilities/correct-paths.ts
6
+ var _devkit = require('@nx/devkit');
7
+ var correctPaths = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (path) => {
8
+ if (!path) {
9
+ return "";
10
+ }
11
+ if (!path.toUpperCase().startsWith("C:") && path.includes("\\")) {
12
+ path = `C:${path}`;
13
+ }
14
+ return path.replaceAll("\\", "/");
15
+ }, "correctPaths");
16
+ var joinPaths = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (...paths) => {
17
+ if (!paths || paths.length === 0) {
18
+ return "";
19
+ }
20
+ return correctPaths(_devkit.joinPathFragments.call(void 0, ...paths.map((path) => correctPaths(path))));
21
+ }, "joinPaths");
22
+
23
+ // ../config-tools/src/utilities/find-up.ts
24
+ var _fs = require('fs');
25
+ var _path = require('path');
26
+ var MAX_PATH_SEARCH_DEPTH = 30;
27
+ var depth = 0;
28
+ function findFolderUp(startPath, endFileNames) {
29
+ const _startPath = _nullishCoalesce(startPath, () => ( process.cwd()));
30
+ if (endFileNames.some((endFileName) => _fs.existsSync.call(void 0, _path.join.call(void 0, _startPath, endFileName)))) {
31
+ return _startPath;
32
+ }
33
+ if (_startPath !== "/" && depth++ < MAX_PATH_SEARCH_DEPTH) {
34
+ const parent = _path.join.call(void 0, _startPath, "..");
35
+ return findFolderUp(parent, endFileNames);
36
+ }
37
+ return void 0;
38
+ }
39
+ _chunkJ5SB6L2Ljs.__name.call(void 0, findFolderUp, "findFolderUp");
40
+
41
+ // ../config-tools/src/utilities/find-workspace-root.ts
42
+ var rootFiles = [
43
+ "storm.json",
44
+ "storm.json",
45
+ "storm.yaml",
46
+ "storm.yml",
47
+ "storm.js",
48
+ "storm.ts",
49
+ ".storm.json",
50
+ ".storm.yaml",
51
+ ".storm.yml",
52
+ ".storm.js",
53
+ ".storm.ts",
54
+ "lerna.json",
55
+ "nx.json",
56
+ "turbo.json",
57
+ "npm-workspace.json",
58
+ "yarn-workspace.json",
59
+ "pnpm-workspace.json",
60
+ "npm-workspace.yaml",
61
+ "yarn-workspace.yaml",
62
+ "pnpm-workspace.yaml",
63
+ "npm-workspace.yml",
64
+ "yarn-workspace.yml",
65
+ "pnpm-workspace.yml",
66
+ "npm-lock.json",
67
+ "yarn-lock.json",
68
+ "pnpm-lock.json",
69
+ "npm-lock.yaml",
70
+ "yarn-lock.yaml",
71
+ "pnpm-lock.yaml",
72
+ "npm-lock.yml",
73
+ "yarn-lock.yml",
74
+ "pnpm-lock.yml",
75
+ "bun.lockb"
76
+ ];
77
+ function findWorkspaceRootSafe(pathInsideMonorepo) {
78
+ if (process.env.STORM_WORKSPACE_ROOT || process.env.NX_WORKSPACE_ROOT_PATH) {
79
+ return correctPaths(_nullishCoalesce(process.env.STORM_WORKSPACE_ROOT, () => ( process.env.NX_WORKSPACE_ROOT_PATH)));
80
+ }
81
+ return correctPaths(findFolderUp(_nullishCoalesce(pathInsideMonorepo, () => ( process.cwd())), rootFiles));
82
+ }
83
+ _chunkJ5SB6L2Ljs.__name.call(void 0, findWorkspaceRootSafe, "findWorkspaceRootSafe");
84
+ function findWorkspaceRoot(pathInsideMonorepo) {
85
+ const result = findWorkspaceRootSafe(pathInsideMonorepo);
86
+ if (!result) {
87
+ throw new Error(`Cannot find workspace root upwards from known path. Files search list includes:
88
+ ${rootFiles.join("\n")}
89
+ Path: ${pathInsideMonorepo ? pathInsideMonorepo : process.cwd()}`);
90
+ }
91
+ return result;
92
+ }
93
+ _chunkJ5SB6L2Ljs.__name.call(void 0, findWorkspaceRoot, "findWorkspaceRoot");
94
+
95
+ // ../config-tools/src/types.ts
96
+ var LogLevel = {
97
+ SILENT: 0,
98
+ FATAL: 10,
99
+ ERROR: 20,
100
+ WARN: 30,
101
+ SUCCESS: 35,
102
+ INFO: 40,
103
+ DEBUG: 60,
104
+ TRACE: 70,
105
+ ALL: 100
106
+ };
107
+ var LogLevelLabel = {
108
+ SILENT: "silent",
109
+ FATAL: "fatal",
110
+ ERROR: "error",
111
+ WARN: "warn",
112
+ SUCCESS: "success",
113
+ INFO: "info",
114
+ DEBUG: "debug",
115
+ TRACE: "trace",
116
+ ALL: "all"
117
+ };
118
+
119
+ // ../config/src/constants.ts
120
+ var STORM_DEFAULT_DOCS = "https://docs.stormsoftware.com";
121
+ var STORM_DEFAULT_HOMEPAGE = "https://stormsoftware.com";
122
+ var STORM_DEFAULT_LICENSING = "https://license.stormsoftware.com";
123
+ var STORM_DEFAULT_LICENSE = "Apache-2.0";
124
+
125
+ // ../config/src/schema.ts
126
+ var _zod = require('zod'); var _zod2 = _interopRequireDefault(_zod);
127
+ var DarkColorSchema = _zod2.default.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7).default("#1d1e22").describe("The dark background color of the workspace");
128
+ var LightColorSchema = _zod2.default.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7).default("#f4f4f5").describe("The light background color of the workspace");
129
+ var BrandColorSchema = _zod2.default.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7).default("#1fb2a6").describe("The primary brand specific color of the workspace");
130
+ var AlternateColorSchema = _zod2.default.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7).optional().describe("The alternate brand specific color of the workspace");
131
+ var AccentColorSchema = _zod2.default.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7).optional().describe("The secondary brand specific color of the workspace");
132
+ var LinkColorSchema = _zod2.default.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7).optional().describe("The color used to display hyperlink text");
133
+ var HelpColorSchema = _zod2.default.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7).default("#8256D0").describe("The second brand specific color of the workspace");
134
+ var SuccessColorSchema = _zod2.default.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7).default("#12B66A").describe("The success color of the workspace");
135
+ var InfoColorSchema = _zod2.default.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7).default("#0070E0").describe("The informational color of the workspace");
136
+ var WarningColorSchema = _zod2.default.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7).default("#fcc419").describe("The warning color of the workspace");
137
+ var DangerColorSchema = _zod2.default.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7).default("#D8314A").describe("The danger color of the workspace");
138
+ var FatalColorSchema = _zod2.default.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7).optional().describe("The fatal color of the workspace");
139
+ var PositiveColorSchema = _zod2.default.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7).default("#4ade80").describe("The positive number color of the workspace");
140
+ var NegativeColorSchema = _zod2.default.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7).default("#ef4444").describe("The negative number color of the workspace");
141
+ var DarkThemeColorConfigSchema = _zod2.default.object({
142
+ foreground: LightColorSchema,
143
+ background: DarkColorSchema,
144
+ brand: BrandColorSchema,
145
+ alternate: AlternateColorSchema,
146
+ accent: AccentColorSchema,
147
+ link: LinkColorSchema,
148
+ help: HelpColorSchema,
149
+ success: SuccessColorSchema,
150
+ info: InfoColorSchema,
151
+ warning: WarningColorSchema,
152
+ danger: DangerColorSchema,
153
+ fatal: FatalColorSchema,
154
+ positive: PositiveColorSchema,
155
+ negative: NegativeColorSchema
156
+ });
157
+ var LightThemeColorConfigSchema = _zod2.default.object({
158
+ foreground: DarkColorSchema,
159
+ background: LightColorSchema,
160
+ brand: BrandColorSchema,
161
+ alternate: AlternateColorSchema,
162
+ accent: AccentColorSchema,
163
+ link: LinkColorSchema,
164
+ help: HelpColorSchema,
165
+ success: SuccessColorSchema,
166
+ info: InfoColorSchema,
167
+ warning: WarningColorSchema,
168
+ danger: DangerColorSchema,
169
+ fatal: FatalColorSchema,
170
+ positive: PositiveColorSchema,
171
+ negative: NegativeColorSchema
172
+ });
173
+ var MultiThemeColorConfigSchema = _zod2.default.object({
174
+ dark: DarkThemeColorConfigSchema,
175
+ light: LightThemeColorConfigSchema
176
+ });
177
+ var SingleThemeColorConfigSchema = _zod2.default.object({
178
+ dark: DarkColorSchema,
179
+ light: LightColorSchema,
180
+ brand: BrandColorSchema,
181
+ alternate: AlternateColorSchema,
182
+ accent: AccentColorSchema,
183
+ link: LinkColorSchema,
184
+ help: HelpColorSchema,
185
+ success: SuccessColorSchema,
186
+ info: InfoColorSchema,
187
+ warning: WarningColorSchema,
188
+ danger: DangerColorSchema,
189
+ fatal: FatalColorSchema,
190
+ positive: PositiveColorSchema,
191
+ negative: NegativeColorSchema
192
+ });
193
+ var RegistryUrlConfigSchema = _zod2.default.string().trim().toLowerCase().url().optional().describe("A remote registry URL used to publish distributable packages");
194
+ var RegistryConfigSchema = _zod2.default.object({
195
+ github: RegistryUrlConfigSchema,
196
+ npm: RegistryUrlConfigSchema,
197
+ cargo: RegistryUrlConfigSchema,
198
+ cyclone: RegistryUrlConfigSchema,
199
+ container: RegistryUrlConfigSchema
200
+ }).default({}).describe("A list of remote registry URLs used by Storm Software");
201
+ var ColorConfigSchema = SingleThemeColorConfigSchema.or(MultiThemeColorConfigSchema).describe("Colors used for various workspace elements");
202
+ var ColorConfigMapSchema = _zod2.default.union([
203
+ _zod2.default.object({
204
+ "base": ColorConfigSchema
205
+ }),
206
+ _zod2.default.record(_zod2.default.string(), ColorConfigSchema)
207
+ ]);
208
+ var WorkspaceBotConfigSchema = _zod2.default.object({
209
+ name: _zod2.default.string().trim().default("Stormie-Bot").describe("The workspace bot user's name (this is the bot that will be used to perform various tasks)"),
210
+ email: _zod2.default.string().trim().email().default("bot@stormsoftware.com").describe("The email of the workspace bot")
211
+ }).describe("The workspace's bot user's config used to automated various operations tasks");
212
+ var WorkspaceDirectoryConfigSchema = _zod2.default.object({
213
+ cache: _zod2.default.string().trim().optional().describe("The directory used to store the environment's cached file data"),
214
+ data: _zod2.default.string().trim().optional().describe("The directory used to store the environment's data files"),
215
+ config: _zod2.default.string().trim().optional().describe("The directory used to store the environment's configuration files"),
216
+ temp: _zod2.default.string().trim().optional().describe("The directory used to store the environment's temp files"),
217
+ log: _zod2.default.string().trim().optional().describe("The directory used to store the environment's temp files"),
218
+ build: _zod2.default.string().trim().default("dist").describe("The directory used to store the workspace's distributable files after a build (relative to the workspace root)")
219
+ }).describe("Various directories used by the workspace to store data, cache, and configuration files");
220
+ var StormConfigSchema = _zod2.default.object({
221
+ $schema: _zod2.default.string().trim().default("https://cdn.jsdelivr.net/npm/@storm-software/config/schemas/storm.schema.json").optional().nullish().describe("The URL to the JSON schema file that describes the Storm configuration file"),
222
+ extends: _zod2.default.string().trim().optional().describe("The path to a base JSON file to use as a configuration preset file"),
223
+ name: _zod2.default.string().trim().toLowerCase().optional().describe("The name of the service/package/scope using this configuration"),
224
+ namespace: _zod2.default.string().trim().toLowerCase().optional().describe("The namespace of the package"),
225
+ organization: _zod2.default.string().trim().default("storm-software").describe("The organization of the workspace"),
226
+ repository: _zod2.default.string().trim().url().optional().describe("The repo URL of the workspace (i.e. GitHub)"),
227
+ license: _zod2.default.string().trim().default("Apache-2.0").describe("The license type of the package"),
228
+ homepage: _zod2.default.string().trim().url().default(STORM_DEFAULT_HOMEPAGE).describe("The homepage of the workspace"),
229
+ docs: _zod2.default.string().trim().url().default(STORM_DEFAULT_DOCS).describe("The base documentation site for the workspace"),
230
+ licensing: _zod2.default.string().trim().url().default(STORM_DEFAULT_LICENSING).describe("The base licensing site for the workspace"),
231
+ branch: _zod2.default.string().trim().default("main").describe("The branch of the workspace"),
232
+ preid: _zod2.default.string().optional().describe("A tag specifying the version pre-release identifier"),
233
+ owner: _zod2.default.string().trim().default("@storm-software/admin").describe("The owner of the package"),
234
+ bot: WorkspaceBotConfigSchema,
235
+ env: _zod2.default.enum([
236
+ "development",
237
+ "staging",
238
+ "production"
239
+ ]).default("production").describe("The current runtime environment name for the package"),
240
+ workspaceRoot: _zod2.default.string().trim().default("").describe("The root directory of the workspace"),
241
+ externalPackagePatterns: _zod2.default.array(_zod2.default.string()).default([]).describe("The build will use these package patterns to determine if they should be external to the bundle"),
242
+ skipCache: _zod2.default.boolean().default(false).describe("Should all known types of workspace caching be skipped?"),
243
+ directories: WorkspaceDirectoryConfigSchema,
244
+ packageManager: _zod2.default.enum([
245
+ "npm",
246
+ "yarn",
247
+ "pnpm",
248
+ "bun"
249
+ ]).default("npm").describe("The JavaScript/TypeScript package manager used by the repository"),
250
+ timezone: _zod2.default.string().trim().default("America/New_York").describe("The default timezone of the workspace"),
251
+ locale: _zod2.default.string().trim().default("en-US").describe("The default locale of the workspace"),
252
+ logLevel: _zod2.default.enum([
253
+ "silent",
254
+ "fatal",
255
+ "error",
256
+ "warn",
257
+ "success",
258
+ "info",
259
+ "debug",
260
+ "trace",
261
+ "all"
262
+ ]).default("info").describe("The log level used to filter out lower priority log messages. If not provided, this is defaulted using the `environment` config value (if `environment` is set to `production` then `level` is `error`, else `level` is `debug`)."),
263
+ registry: RegistryConfigSchema,
264
+ configFile: _zod2.default.string().trim().nullable().default(null).describe("The filepath of the Storm config. When this field is null, no config file was found in the current workspace."),
265
+ colors: ColorConfigSchema.or(ColorConfigMapSchema).describe("Storm theme config values used for styling various package elements"),
266
+ extensions: _zod2.default.record(_zod2.default.any()).optional().default({}).describe("Configuration of each used extension")
267
+ }).describe("Storm Workspace config values used during various dev-ops processes. This type is a combination of the StormPackageConfig and StormProject types. It represents the config of the entire monorepo.");
268
+
269
+ // ../config/src/types.ts
270
+ var COLOR_KEYS = [
271
+ "dark",
272
+ "light",
273
+ "base",
274
+ "brand",
275
+ "alternate",
276
+ "accent",
277
+ "link",
278
+ "success",
279
+ "help",
280
+ "info",
281
+ "warning",
282
+ "danger",
283
+ "fatal",
284
+ "positive",
285
+ "negative"
286
+ ];
287
+
288
+ // ../config-tools/src/utilities/get-default-config.ts
289
+
290
+
291
+ var DEFAULT_COLOR_CONFIG = {
292
+ "light": {
293
+ "background": "#fafafa",
294
+ "foreground": "#1d1e22",
295
+ "brand": "#1fb2a6",
296
+ "alternate": "#db2777",
297
+ "help": "#5C4EE5",
298
+ "success": "#087f5b",
299
+ "info": "#0550ae",
300
+ "warning": "#e3b341",
301
+ "danger": "#D8314A",
302
+ "positive": "#22c55e",
303
+ "negative": "#dc2626"
304
+ },
305
+ "dark": {
306
+ "background": "#1d1e22",
307
+ "foreground": "#cbd5e1",
308
+ "brand": "#2dd4bf",
309
+ "alternate": "#db2777",
310
+ "help": "#818cf8",
311
+ "success": "#10b981",
312
+ "info": "#58a6ff",
313
+ "warning": "#f3d371",
314
+ "danger": "#D8314A",
315
+ "positive": "#22c55e",
316
+ "negative": "#dc2626"
317
+ }
318
+ };
319
+ var getDefaultConfig = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (root) => {
320
+ let license = STORM_DEFAULT_LICENSE;
321
+ let homepage = STORM_DEFAULT_HOMEPAGE;
322
+ let name;
323
+ let namespace;
324
+ let repository;
325
+ const workspaceRoot = findWorkspaceRoot(root);
326
+ if (_fs.existsSync.call(void 0, _path.join.call(void 0, workspaceRoot, "package.json"))) {
327
+ const file = _fs.readFileSync.call(void 0, _path.join.call(void 0, workspaceRoot, "package.json"), {
328
+ encoding: "utf8"
329
+ });
330
+ if (file) {
331
+ const packageJson = JSON.parse(file);
332
+ if (packageJson.name) {
333
+ name = packageJson.name;
334
+ }
335
+ if (packageJson.namespace) {
336
+ namespace = packageJson.namespace;
337
+ }
338
+ if (_optionalChain([packageJson, 'access', _2 => _2.repository, 'optionalAccess', _3 => _3.url])) {
339
+ repository = _optionalChain([packageJson, 'access', _4 => _4.repository, 'optionalAccess', _5 => _5.url]);
340
+ }
341
+ if (packageJson.license) {
342
+ license = packageJson.license;
343
+ }
344
+ if (packageJson.homepage) {
345
+ homepage = packageJson.homepage;
346
+ }
347
+ }
348
+ }
349
+ return {
350
+ workspaceRoot,
351
+ name,
352
+ namespace,
353
+ repository,
354
+ license,
355
+ homepage,
356
+ docs: `${homepage || STORM_DEFAULT_HOMEPAGE}/docs`,
357
+ licensing: `${homepage || STORM_DEFAULT_HOMEPAGE}/license`
358
+ };
359
+ }, "getDefaultConfig");
360
+
361
+ // ../config-tools/src/logger/chalk.ts
362
+ var _chalk2 = require('chalk'); var _chalk3 = _interopRequireDefault(_chalk2);
363
+ var chalkDefault = {
364
+ hex: /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (_) => (message) => message, "hex"),
365
+ bgHex: /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (_) => ({
366
+ whiteBright: /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (message) => message, "whiteBright")
367
+ }), "bgHex"),
368
+ whiteBright: /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (message) => message, "whiteBright"),
369
+ gray: /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (message) => message, "gray"),
370
+ bold: {
371
+ hex: /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (_) => (message) => message, "hex"),
372
+ bgHex: /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (_) => ({
373
+ whiteBright: /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (message) => message, "whiteBright")
374
+ }), "bgHex"),
375
+ whiteBright: /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (message) => message, "whiteBright")
376
+ },
377
+ dim: {
378
+ hex: /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (_) => (message) => message, "hex"),
379
+ gray: /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (message) => message, "gray")
380
+ }
381
+ };
382
+ var getChalk = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, () => {
383
+ let _chalk = _chalk3.default;
384
+ if (!_optionalChain([_chalk, 'optionalAccess', _6 => _6.hex]) || !_optionalChain([_chalk, 'optionalAccess', _7 => _7.bold, 'optionalAccess', _8 => _8.hex]) || !_optionalChain([_chalk, 'optionalAccess', _9 => _9.bgHex]) || !_optionalChain([_chalk, 'optionalAccess', _10 => _10.whiteBright])) {
385
+ _chalk = chalkDefault;
386
+ }
387
+ return _chalk;
388
+ }, "getChalk");
389
+
390
+ // ../config-tools/src/logger/is-unicode-supported.ts
391
+ var _process = require('process'); var _process2 = _interopRequireDefault(_process);
392
+ function isUnicodeSupported() {
393
+ const { env } = _process2.default;
394
+ const { TERM, TERM_PROGRAM } = env;
395
+ if (_process2.default.platform !== "win32") {
396
+ return TERM !== "linux";
397
+ }
398
+ return Boolean(env.WT_SESSION) || // Windows Terminal
399
+ Boolean(env.TERMINUS_SUBLIME) || // Terminus (<0.2.27)
400
+ env.ConEmuTask === "{cmd::Cmder}" || // ConEmu and cmder
401
+ TERM_PROGRAM === "Terminus-Sublime" || TERM_PROGRAM === "vscode" || TERM === "xterm-256color" || TERM === "alacritty" || TERM === "rxvt-unicode" || TERM === "rxvt-unicode-256color" || env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
402
+ }
403
+ _chunkJ5SB6L2Ljs.__name.call(void 0, isUnicodeSupported, "isUnicodeSupported");
404
+
405
+ // ../config-tools/src/logger/console-icons.ts
406
+ var useIcon = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (c, fallback) => isUnicodeSupported() ? c : fallback, "useIcon");
407
+ var CONSOLE_ICONS = {
408
+ [LogLevelLabel.ERROR]: useIcon("\u2718", "\xD7"),
409
+ [LogLevelLabel.FATAL]: useIcon("\u{1F480}", "\xD7"),
410
+ [LogLevelLabel.WARN]: useIcon("\u26A0", "\u203C"),
411
+ [LogLevelLabel.INFO]: useIcon("\u2139", "i"),
412
+ [LogLevelLabel.SUCCESS]: useIcon("\u2714", "\u221A"),
413
+ [LogLevelLabel.DEBUG]: useIcon("\u{1F6E0}", "D"),
414
+ [LogLevelLabel.TRACE]: useIcon("\u{1F6E0}", "T"),
415
+ [LogLevelLabel.ALL]: useIcon("\u2709", "\u2192")
416
+ };
417
+
418
+ // ../config-tools/src/logger/format-timestamp.ts
419
+ var formatTimestamp = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (date = /* @__PURE__ */ new Date()) => {
420
+ return `${date.toLocaleDateString()} ${date.toLocaleTimeString()}`;
421
+ }, "formatTimestamp");
422
+
423
+ // ../config-tools/src/logger/get-log-level.ts
424
+ var getLogLevel = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (label) => {
425
+ switch (label) {
426
+ case "all":
427
+ return LogLevel.ALL;
428
+ case "trace":
429
+ return LogLevel.TRACE;
430
+ case "debug":
431
+ return LogLevel.DEBUG;
432
+ case "info":
433
+ return LogLevel.INFO;
434
+ case "warn":
435
+ return LogLevel.WARN;
436
+ case "error":
437
+ return LogLevel.ERROR;
438
+ case "fatal":
439
+ return LogLevel.FATAL;
440
+ case "silent":
441
+ return LogLevel.SILENT;
442
+ default:
443
+ return LogLevel.INFO;
444
+ }
445
+ }, "getLogLevel");
446
+ var getLogLevelLabel = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (logLevel = LogLevel.INFO) => {
447
+ if (logLevel >= LogLevel.ALL) {
448
+ return LogLevelLabel.ALL;
449
+ }
450
+ if (logLevel >= LogLevel.TRACE) {
451
+ return LogLevelLabel.TRACE;
452
+ }
453
+ if (logLevel >= LogLevel.DEBUG) {
454
+ return LogLevelLabel.DEBUG;
455
+ }
456
+ if (logLevel >= LogLevel.INFO) {
457
+ return LogLevelLabel.INFO;
458
+ }
459
+ if (logLevel >= LogLevel.WARN) {
460
+ return LogLevelLabel.WARN;
461
+ }
462
+ if (logLevel >= LogLevel.ERROR) {
463
+ return LogLevelLabel.ERROR;
464
+ }
465
+ if (logLevel >= LogLevel.FATAL) {
466
+ return LogLevelLabel.FATAL;
467
+ }
468
+ if (logLevel <= LogLevel.SILENT) {
469
+ return LogLevelLabel.SILENT;
470
+ }
471
+ return LogLevelLabel.INFO;
472
+ }, "getLogLevelLabel");
473
+ var isVerbose = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (label = LogLevelLabel.SILENT) => {
474
+ const logLevel = typeof label === "string" ? getLogLevel(label) : label;
475
+ return logLevel >= LogLevel.DEBUG;
476
+ }, "isVerbose");
477
+
478
+ // ../config-tools/src/logger/console.ts
479
+ var getLogFn = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (logLevel = LogLevel.INFO, config = {}) => {
480
+ const _chalk = getChalk();
481
+ const colors = !_optionalChain([config, 'access', _11 => _11.colors, 'optionalAccess', _12 => _12.dark]) && !_optionalChain([config, 'access', _13 => _13.colors, 'optionalAccess', _14 => _14["base"]]) && !_optionalChain([config, 'access', _15 => _15.colors, 'optionalAccess', _16 => _16["base"], 'optionalAccess', _17 => _17.dark]) ? DEFAULT_COLOR_CONFIG : _optionalChain([config, 'access', _18 => _18.colors, 'optionalAccess', _19 => _19.dark]) && typeof config.colors.dark === "string" ? config.colors : _optionalChain([config, 'access', _20 => _20.colors, 'optionalAccess', _21 => _21["base"], 'optionalAccess', _22 => _22.dark]) && typeof config.colors["base"].dark === "string" ? config.colors["base"].dark : _optionalChain([config, 'access', _23 => _23.colors, 'optionalAccess', _24 => _24["base"]]) ? _optionalChain([config, 'access', _25 => _25.colors, 'optionalAccess', _26 => _26["base"]]) : DEFAULT_COLOR_CONFIG;
482
+ const configLogLevel = config.logLevel || process.env.STORM_LOG_LEVEL || LogLevelLabel.INFO;
483
+ if (typeof logLevel === "number" && (logLevel >= getLogLevel(configLogLevel) || logLevel <= LogLevel.SILENT) || typeof logLevel === "string" && getLogLevel(logLevel) >= getLogLevel(configLogLevel)) {
484
+ return (_) => {
485
+ };
486
+ }
487
+ if (typeof logLevel === "number" && LogLevel.FATAL >= logLevel || typeof logLevel === "string" && LogLevel.FATAL >= getLogLevel(logLevel)) {
488
+ return (message) => {
489
+ console.error(`
490
+ ${_chalk.gray(formatTimestamp())} ${_chalk.hex(_nullishCoalesce(colors.fatal, () => ( "#7d1a1a")))(`[${CONSOLE_ICONS[LogLevelLabel.FATAL]} Fatal]`)} ${_chalk.bold.whiteBright(formatLogMessage(message))}
491
+ `);
492
+ };
493
+ }
494
+ if (typeof logLevel === "number" && LogLevel.ERROR >= logLevel || typeof logLevel === "string" && LogLevel.ERROR >= getLogLevel(logLevel)) {
495
+ return (message) => {
496
+ console.error(`
497
+ ${_chalk.gray(formatTimestamp())} ${_chalk.hex(_nullishCoalesce(colors.danger, () => ( "#f85149")))(`[${CONSOLE_ICONS[LogLevelLabel.ERROR]} Error]`)} ${_chalk.bold.whiteBright(formatLogMessage(message))}
498
+ `);
499
+ };
500
+ }
501
+ if (typeof logLevel === "number" && LogLevel.WARN >= logLevel || typeof logLevel === "string" && LogLevel.WARN >= getLogLevel(logLevel)) {
502
+ return (message) => {
503
+ console.warn(`
504
+ ${_chalk.gray(formatTimestamp())} ${_chalk.hex(_nullishCoalesce(colors.warning, () => ( "#e3b341")))(`[${CONSOLE_ICONS[LogLevelLabel.WARN]} Warn]`)} ${_chalk.bold.whiteBright(formatLogMessage(message))}
505
+ `);
506
+ };
507
+ }
508
+ if (typeof logLevel === "number" && LogLevel.SUCCESS >= logLevel || typeof logLevel === "string" && LogLevel.SUCCESS >= getLogLevel(logLevel)) {
509
+ return (message) => {
510
+ console.info(`
511
+ ${_chalk.gray(formatTimestamp())} ${_chalk.hex(_nullishCoalesce(colors.success, () => ( "#56d364")))(`[${CONSOLE_ICONS[LogLevelLabel.SUCCESS]} Success]`)} ${_chalk.bold.whiteBright(formatLogMessage(message))}
512
+ `);
513
+ };
514
+ }
515
+ if (typeof logLevel === "number" && LogLevel.INFO >= logLevel || typeof logLevel === "string" && LogLevel.INFO >= getLogLevel(logLevel)) {
516
+ return (message) => {
517
+ console.info(`
518
+ ${_chalk.gray(formatTimestamp())} ${_chalk.hex(_nullishCoalesce(colors.info, () => ( "#58a6ff")))(`[${CONSOLE_ICONS[LogLevelLabel.INFO]} Info]`)} ${_chalk.bold.whiteBright(formatLogMessage(message))}
519
+ `);
520
+ };
521
+ }
522
+ if (typeof logLevel === "number" && LogLevel.TRACE >= logLevel || typeof logLevel === "string" && LogLevel.TRACE >= getLogLevel(logLevel)) {
523
+ return (message) => {
524
+ console.debug(`
525
+ ${_chalk.gray(formatTimestamp())} ${_chalk.hex(_nullishCoalesce(colors.brand, () => ( "#1fb2a6")))(`[${CONSOLE_ICONS[LogLevelLabel.DEBUG]} Debug]`)} ${_chalk.bold.whiteBright(formatLogMessage(message))}
526
+ `);
527
+ };
528
+ }
529
+ return (message) => {
530
+ console.log(`
531
+ ${_chalk.gray(formatTimestamp())} ${_chalk.hex(_nullishCoalesce(colors.brand, () => ( "#1fb2a6")))(`[${CONSOLE_ICONS[LogLevelLabel.ALL]} System]`)} ${_chalk.bold.whiteBright(formatLogMessage(message))}
532
+ `);
533
+ };
534
+ }, "getLogFn");
535
+ var writeFatal = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (message, config) => getLogFn(LogLevel.FATAL, config)(message), "writeFatal");
536
+ var writeError = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (message, config) => getLogFn(LogLevel.ERROR, config)(message), "writeError");
537
+ var writeWarning = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (message, config) => getLogFn(LogLevel.WARN, config)(message), "writeWarning");
538
+ var writeInfo = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (message, config) => getLogFn(LogLevel.INFO, config)(message), "writeInfo");
539
+ var writeSuccess = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (message, config) => getLogFn(LogLevel.SUCCESS, config)(message), "writeSuccess");
540
+ var writeDebug = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (message, config) => getLogFn(LogLevel.DEBUG, config)(message), "writeDebug");
541
+ var writeTrace = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (message, config) => getLogFn(LogLevel.TRACE, config)(message), "writeTrace");
542
+ var writeSystem = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (message, config) => getLogFn(LogLevel.ALL, config)(message), "writeSystem");
543
+ var getStopwatch = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (name) => {
544
+ const start = process.hrtime();
545
+ return () => {
546
+ const end = process.hrtime(start);
547
+ console.info(`
548
+ > \u23F1\uFE0F The${name ? ` ${name}` : ""} process took ${Math.round(end[0] * 1e3 + end[1] / 1e6)}ms to complete
549
+
550
+ `);
551
+ };
552
+ }, "getStopwatch");
553
+ var MAX_DEPTH = 4;
554
+ var formatLogMessage = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (message, options = {}, depth2 = 0) => {
555
+ if (depth2 > MAX_DEPTH) {
556
+ return "<max depth>";
557
+ }
558
+ const prefix = _nullishCoalesce(options.prefix, () => ( "-"));
559
+ const skip = _nullishCoalesce(options.skip, () => ( []));
560
+ return typeof message === "undefined" || message === null || !message && typeof message !== "boolean" ? "<none>" : typeof message === "string" ? message : Array.isArray(message) ? `
561
+ ${message.map((item, index) => ` ${prefix}> #${index} = ${formatLogMessage(item, {
562
+ prefix: `${prefix}-`,
563
+ skip
564
+ }, depth2 + 1)}`).join("\n")}` : typeof message === "object" ? `
565
+ ${Object.keys(message).filter((key) => !skip.includes(key)).map((key) => ` ${prefix}> ${key} = ${_isFunction(message[key]) ? "<function>" : typeof message[key] === "object" ? formatLogMessage(message[key], {
566
+ prefix: `${prefix}-`,
567
+ skip
568
+ }, depth2 + 1) : message[key]}`).join("\n")}` : message;
569
+ }, "formatLogMessage");
570
+ var _isFunction = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (value) => {
571
+ try {
572
+ return value instanceof Function || typeof value === "function" || !!(_optionalChain([value, 'optionalAccess', _27 => _27.constructor]) && _optionalChain([value, 'optionalAccess', _28 => _28.call]) && _optionalChain([value, 'optionalAccess', _29 => _29.apply]));
573
+ } catch (e) {
574
+ return false;
575
+ }
576
+ }, "_isFunction");
577
+
578
+
579
+
580
+
581
+
582
+
583
+
584
+
585
+
586
+
587
+
588
+
589
+
590
+
591
+
592
+
593
+
594
+
595
+
596
+
597
+
598
+
599
+
600
+
601
+
602
+
603
+ exports.LogLevel = LogLevel; exports.LogLevelLabel = LogLevelLabel; exports.STORM_DEFAULT_DOCS = STORM_DEFAULT_DOCS; exports.STORM_DEFAULT_HOMEPAGE = STORM_DEFAULT_HOMEPAGE; exports.STORM_DEFAULT_LICENSING = STORM_DEFAULT_LICENSING; exports.StormConfigSchema = StormConfigSchema; exports.COLOR_KEYS = COLOR_KEYS; exports.correctPaths = correctPaths; exports.joinPaths = joinPaths; exports.findWorkspaceRoot = findWorkspaceRoot; exports.getDefaultConfig = getDefaultConfig; exports.getLogLevel = getLogLevel; exports.getLogLevelLabel = getLogLevelLabel; exports.isVerbose = isVerbose; exports.writeFatal = writeFatal; exports.writeError = writeError; exports.writeWarning = writeWarning; exports.writeInfo = writeInfo; exports.writeSuccess = writeSuccess; exports.writeDebug = writeDebug; exports.writeTrace = writeTrace; exports.writeSystem = writeSystem; exports.getStopwatch = getStopwatch; exports.formatLogMessage = formatLogMessage;