@storm-software/cloudflare-tools 0.63.55 → 0.63.62

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 (40) hide show
  1. package/CHANGELOG.md +56 -0
  2. package/README.md +1 -2
  3. package/dist/chunk-2CDSXWFA.js +311 -0
  4. package/dist/{chunk-Q5XL7K7Z.mjs → chunk-47LTDAIV.mjs} +4 -4
  5. package/dist/{chunk-MB54NXKO.mjs → chunk-7ZAYEHFL.mjs} +11 -9
  6. package/dist/{chunk-AOAXSMD4.js → chunk-FULKT5FT.js} +121 -119
  7. package/dist/{chunk-TOB7OQN4.js → chunk-FVFZRRXE.js} +1 -1
  8. package/dist/{chunk-BRPTGDS4.mjs → chunk-IANDAPQS.mjs} +1 -1
  9. package/dist/{chunk-ADVG6LVE.mjs → chunk-LJBM3BJ3.mjs} +650 -14
  10. package/dist/chunk-MHMPOWJN.js +1370 -0
  11. package/dist/{chunk-57WTY3UY.js → chunk-NCQM44P3.js} +3 -3
  12. package/dist/{chunk-HSHWXMVT.mjs → chunk-OULGED23.mjs} +4 -4
  13. package/dist/{chunk-P45GT4VW.js → chunk-Q5A6EYKA.js} +12 -12
  14. package/dist/{chunk-X2ML265T.js → chunk-R6LCC4LT.js} +16 -16
  15. package/dist/{chunk-5GUQUTLT.mjs → chunk-TGT6YRXK.mjs} +1 -1
  16. package/dist/chunk-V44DYGWX.mjs +311 -0
  17. package/dist/executors.js +5 -5
  18. package/dist/executors.mjs +5 -5
  19. package/dist/generators.js +5 -5
  20. package/dist/generators.mjs +4 -4
  21. package/dist/index.js +8 -8
  22. package/dist/index.mjs +7 -7
  23. package/dist/src/executors/cloudflare-publish/executor.js +3 -3
  24. package/dist/src/executors/cloudflare-publish/executor.mjs +3 -3
  25. package/dist/src/executors/r2-upload-publish/executor.js +5 -5
  26. package/dist/src/executors/r2-upload-publish/executor.mjs +4 -4
  27. package/dist/src/executors/serve/executor.js +4 -4
  28. package/dist/src/executors/serve/executor.mjs +3 -3
  29. package/dist/src/generators/init/generator.js +2 -2
  30. package/dist/src/generators/init/generator.mjs +1 -1
  31. package/dist/src/generators/worker/generator.js +5 -5
  32. package/dist/src/generators/worker/generator.mjs +4 -4
  33. package/dist/src/utils/index.js +3 -3
  34. package/dist/src/utils/index.mjs +2 -2
  35. package/dist/src/utils/r2-bucket-helpers.js +3 -3
  36. package/dist/src/utils/r2-bucket-helpers.mjs +2 -2
  37. package/package.json +2 -2
  38. package/dist/chunk-AZSS2TUS.mjs +0 -879
  39. package/dist/chunk-KDRIR55G.js +0 -879
  40. package/dist/chunk-UOEUE2GI.js +0 -734
@@ -1,879 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } 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; }// ../config-tools/src/utilities/correct-paths.ts
2
- var _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
3
- function normalizeWindowsPath(input = "") {
4
- if (!input) {
5
- return input;
6
- }
7
- return input.replace(/\\/g, "/").replace(_DRIVE_LETTER_START_RE, (r) => r.toUpperCase());
8
- }
9
- var _UNC_REGEX = /^[/\\]{2}/;
10
- var _IS_ABSOLUTE_RE = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/;
11
- var _DRIVE_LETTER_RE = /^[A-Za-z]:$/;
12
- var correctPaths = function(path) {
13
- if (!path || path.length === 0) {
14
- return ".";
15
- }
16
- path = normalizeWindowsPath(path);
17
- const isUNCPath = path.match(_UNC_REGEX);
18
- const isPathAbsolute = isAbsolute(path);
19
- const trailingSeparator = path[path.length - 1] === "/";
20
- path = normalizeString(path, !isPathAbsolute);
21
- if (path.length === 0) {
22
- if (isPathAbsolute) {
23
- return "/";
24
- }
25
- return trailingSeparator ? "./" : ".";
26
- }
27
- if (trailingSeparator) {
28
- path += "/";
29
- }
30
- if (_DRIVE_LETTER_RE.test(path)) {
31
- path += "/";
32
- }
33
- if (isUNCPath) {
34
- if (!isPathAbsolute) {
35
- return `//./${path}`;
36
- }
37
- return `//${path}`;
38
- }
39
- return isPathAbsolute && !isAbsolute(path) ? `/${path}` : path;
40
- };
41
- var joinPaths = function(...segments) {
42
- let path = "";
43
- for (const seg of segments) {
44
- if (!seg) {
45
- continue;
46
- }
47
- if (path.length > 0) {
48
- const pathTrailing = path[path.length - 1] === "/";
49
- const segLeading = seg[0] === "/";
50
- const both = pathTrailing && segLeading;
51
- if (both) {
52
- path += seg.slice(1);
53
- } else {
54
- path += pathTrailing || segLeading ? seg : `/${seg}`;
55
- }
56
- } else {
57
- path += seg;
58
- }
59
- }
60
- return correctPaths(path);
61
- };
62
- function normalizeString(path, allowAboveRoot) {
63
- let res = "";
64
- let lastSegmentLength = 0;
65
- let lastSlash = -1;
66
- let dots = 0;
67
- let char = null;
68
- for (let index = 0; index <= path.length; ++index) {
69
- if (index < path.length) {
70
- char = path[index];
71
- } else if (char === "/") {
72
- break;
73
- } else {
74
- char = "/";
75
- }
76
- if (char === "/") {
77
- if (lastSlash === index - 1 || dots === 1) {
78
- } else if (dots === 2) {
79
- if (res.length < 2 || lastSegmentLength !== 2 || res[res.length - 1] !== "." || res[res.length - 2] !== ".") {
80
- if (res.length > 2) {
81
- const lastSlashIndex = res.lastIndexOf("/");
82
- if (lastSlashIndex === -1) {
83
- res = "";
84
- lastSegmentLength = 0;
85
- } else {
86
- res = res.slice(0, lastSlashIndex);
87
- lastSegmentLength = res.length - 1 - res.lastIndexOf("/");
88
- }
89
- lastSlash = index;
90
- dots = 0;
91
- continue;
92
- } else if (res.length > 0) {
93
- res = "";
94
- lastSegmentLength = 0;
95
- lastSlash = index;
96
- dots = 0;
97
- continue;
98
- }
99
- }
100
- if (allowAboveRoot) {
101
- res += res.length > 0 ? "/.." : "..";
102
- lastSegmentLength = 2;
103
- }
104
- } else {
105
- if (res.length > 0) {
106
- res += `/${path.slice(lastSlash + 1, index)}`;
107
- } else {
108
- res = path.slice(lastSlash + 1, index);
109
- }
110
- lastSegmentLength = index - lastSlash - 1;
111
- }
112
- lastSlash = index;
113
- dots = 0;
114
- } else if (char === "." && dots !== -1) {
115
- ++dots;
116
- } else {
117
- dots = -1;
118
- }
119
- }
120
- return res;
121
- }
122
- var isAbsolute = function(p) {
123
- return _IS_ABSOLUTE_RE.test(p);
124
- };
125
-
126
- // ../config-tools/src/utilities/find-up.ts
127
- var _fs = require('fs');
128
- var _path = require('path');
129
- var MAX_PATH_SEARCH_DEPTH = 30;
130
- var depth = 0;
131
- function findFolderUp(startPath, endFileNames = [], endDirectoryNames = []) {
132
- const _startPath = _nullishCoalesce(startPath, () => ( process.cwd()));
133
- if (endDirectoryNames.some(
134
- (endDirName) => _fs.existsSync.call(void 0, _path.join.call(void 0, _startPath, endDirName))
135
- )) {
136
- return _startPath;
137
- }
138
- if (endFileNames.some(
139
- (endFileName) => _fs.existsSync.call(void 0, _path.join.call(void 0, _startPath, endFileName))
140
- )) {
141
- return _startPath;
142
- }
143
- if (_startPath !== "/" && depth++ < MAX_PATH_SEARCH_DEPTH) {
144
- const parent = _path.join.call(void 0, _startPath, "..");
145
- return findFolderUp(parent, endFileNames, endDirectoryNames);
146
- }
147
- return void 0;
148
- }
149
-
150
- // ../config-tools/src/utilities/find-workspace-root.ts
151
- var rootFiles = [
152
- "storm-workspace.json",
153
- "storm-workspace.json",
154
- "storm-workspace.yaml",
155
- "storm-workspace.yml",
156
- "storm-workspace.js",
157
- "storm-workspace.ts",
158
- ".storm-workspace.json",
159
- ".storm-workspace.yaml",
160
- ".storm-workspace.yml",
161
- ".storm-workspace.js",
162
- ".storm-workspace.ts",
163
- "lerna.json",
164
- "nx.json",
165
- "turbo.json",
166
- "npm-workspace.json",
167
- "yarn-workspace.json",
168
- "pnpm-workspace.json",
169
- "npm-workspace.yaml",
170
- "yarn-workspace.yaml",
171
- "pnpm-workspace.yaml",
172
- "npm-workspace.yml",
173
- "yarn-workspace.yml",
174
- "pnpm-workspace.yml",
175
- "npm-lock.json",
176
- "yarn-lock.json",
177
- "pnpm-lock.json",
178
- "npm-lock.yaml",
179
- "yarn-lock.yaml",
180
- "pnpm-lock.yaml",
181
- "npm-lock.yml",
182
- "yarn-lock.yml",
183
- "pnpm-lock.yml",
184
- "bun.lockb"
185
- ];
186
- var rootDirectories = [
187
- ".storm-workspace",
188
- ".nx",
189
- ".github",
190
- ".vscode",
191
- ".verdaccio"
192
- ];
193
- function findWorkspaceRootSafe(pathInsideMonorepo) {
194
- if (process.env.STORM_WORKSPACE_ROOT || process.env.NX_WORKSPACE_ROOT_PATH) {
195
- return correctPaths(
196
- _nullishCoalesce(process.env.STORM_WORKSPACE_ROOT, () => ( process.env.NX_WORKSPACE_ROOT_PATH))
197
- );
198
- }
199
- return correctPaths(
200
- findFolderUp(
201
- _nullishCoalesce(pathInsideMonorepo, () => ( process.cwd())),
202
- rootFiles,
203
- rootDirectories
204
- )
205
- );
206
- }
207
- function findWorkspaceRoot(pathInsideMonorepo) {
208
- const result = findWorkspaceRootSafe(pathInsideMonorepo);
209
- if (!result) {
210
- throw new Error(
211
- `Cannot find workspace root upwards from known path. Files search list includes:
212
- ${rootFiles.join(
213
- "\n"
214
- )}
215
- Path: ${pathInsideMonorepo ? pathInsideMonorepo : process.cwd()}`
216
- );
217
- }
218
- return result;
219
- }
220
-
221
- // ../config-tools/src/types.ts
222
- var LogLevel = {
223
- SILENT: 0,
224
- FATAL: 10,
225
- ERROR: 20,
226
- WARN: 30,
227
- SUCCESS: 35,
228
- INFO: 40,
229
- DEBUG: 60,
230
- TRACE: 70,
231
- ALL: 100
232
- };
233
- var LogLevelLabel = {
234
- SILENT: "silent",
235
- FATAL: "fatal",
236
- ERROR: "error",
237
- WARN: "warn",
238
- SUCCESS: "success",
239
- INFO: "info",
240
- DEBUG: "debug",
241
- TRACE: "trace",
242
- ALL: "all"
243
- };
244
-
245
- // ../config/src/constants.ts
246
- var STORM_DEFAULT_DOCS = "https://docs.stormsoftware.com";
247
- var STORM_DEFAULT_HOMEPAGE = "https://stormsoftware.com";
248
- var STORM_DEFAULT_CONTACT = "https://stormsoftware.com/contact";
249
- var STORM_DEFAULT_LICENSING = "https://stormsoftware.com/license";
250
- var STORM_DEFAULT_LICENSE = "Apache-2.0";
251
- var STORM_DEFAULT_SOCIAL_TWITTER = "StormSoftwareHQ";
252
- var STORM_DEFAULT_SOCIAL_DISCORD = "https://discord.gg/MQ6YVzakM5";
253
- var STORM_DEFAULT_SOCIAL_TELEGRAM = "https://t.me/storm_software";
254
- var STORM_DEFAULT_SOCIAL_SLACK = "https://join.slack.com/t/storm-software/shared_invite/zt-2gsmk04hs-i6yhK_r6urq0dkZYAwq2pA";
255
- var STORM_DEFAULT_SOCIAL_MEDIUM = "https://medium.com/storm-software";
256
- var STORM_DEFAULT_SOCIAL_GITHUB = "https://github.com/storm-software";
257
- var STORM_DEFAULT_RELEASE_FOOTER = `
258
- 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.
259
-
260
- Join us on [Discord](${STORM_DEFAULT_SOCIAL_DISCORD}) to chat with the team, receive release notifications, ask questions, and get involved.
261
-
262
- If this sounds interesting, and you would like to help us in creating the next generation of development tools, please reach out on our [website](${STORM_DEFAULT_CONTACT}) or join our [Slack](${STORM_DEFAULT_SOCIAL_SLACK}) channel!
263
- `;
264
- var STORM_DEFAULT_ERROR_CODES_FILE = "tools/errors/codes.json";
265
-
266
- // ../config/src/schema.ts
267
- var _zod = require('zod'); var z = _interopRequireWildcard(_zod);
268
- 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");
269
- 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");
270
- 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");
271
- 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");
272
- 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");
273
- 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");
274
- 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");
275
- 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");
276
- 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");
277
- 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");
278
- 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");
279
- var FatalColorSchema = z.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7).optional().describe("The fatal color of the workspace");
280
- 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");
281
- 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");
282
- var DarkThemeColorConfigSchema = z.object({
283
- foreground: LightColorSchema,
284
- background: DarkColorSchema,
285
- brand: BrandColorSchema,
286
- alternate: AlternateColorSchema,
287
- accent: AccentColorSchema,
288
- link: LinkColorSchema,
289
- help: HelpColorSchema,
290
- success: SuccessColorSchema,
291
- info: InfoColorSchema,
292
- warning: WarningColorSchema,
293
- danger: DangerColorSchema,
294
- fatal: FatalColorSchema,
295
- positive: PositiveColorSchema,
296
- negative: NegativeColorSchema
297
- });
298
- var LightThemeColorConfigSchema = z.object({
299
- foreground: DarkColorSchema,
300
- background: LightColorSchema,
301
- brand: BrandColorSchema,
302
- alternate: AlternateColorSchema,
303
- accent: AccentColorSchema,
304
- link: LinkColorSchema,
305
- help: HelpColorSchema,
306
- success: SuccessColorSchema,
307
- info: InfoColorSchema,
308
- warning: WarningColorSchema,
309
- danger: DangerColorSchema,
310
- fatal: FatalColorSchema,
311
- positive: PositiveColorSchema,
312
- negative: NegativeColorSchema
313
- });
314
- var MultiThemeColorConfigSchema = z.object({
315
- dark: DarkThemeColorConfigSchema,
316
- light: LightThemeColorConfigSchema
317
- });
318
- var SingleThemeColorConfigSchema = z.object({
319
- dark: DarkColorSchema,
320
- light: LightColorSchema,
321
- brand: BrandColorSchema,
322
- alternate: AlternateColorSchema,
323
- accent: AccentColorSchema,
324
- link: LinkColorSchema,
325
- help: HelpColorSchema,
326
- success: SuccessColorSchema,
327
- info: InfoColorSchema,
328
- warning: WarningColorSchema,
329
- danger: DangerColorSchema,
330
- fatal: FatalColorSchema,
331
- positive: PositiveColorSchema,
332
- negative: NegativeColorSchema
333
- });
334
- var RegistryUrlConfigSchema = z.url().optional().describe("A remote registry URL used to publish distributable packages");
335
- var RegistryConfigSchema = z.object({
336
- github: RegistryUrlConfigSchema,
337
- npm: RegistryUrlConfigSchema,
338
- cargo: RegistryUrlConfigSchema,
339
- cyclone: RegistryUrlConfigSchema,
340
- container: RegistryUrlConfigSchema
341
- }).default({}).describe("A list of remote registry URLs used by Storm Software");
342
- var ColorConfigSchema = SingleThemeColorConfigSchema.or(
343
- MultiThemeColorConfigSchema
344
- ).describe("Colors used for various workspace elements");
345
- var ColorConfigMapSchema = z.record(
346
- z.union([z.literal("base"), z.string()]),
347
- ColorConfigSchema
348
- );
349
- var ExtendsItemSchema = z.string().trim().describe(
350
- "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."
351
- );
352
- var ExtendsSchema = ExtendsItemSchema.or(
353
- z.array(ExtendsItemSchema)
354
- ).describe(
355
- "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."
356
- );
357
- var WorkspaceBotConfigSchema = z.object({
358
- name: z.string().trim().default("stormie-bot").describe(
359
- "The workspace bot user's name (this is the bot that will be used to perform various tasks)"
360
- ),
361
- email: z.email().default("bot@stormsoftware.com").describe("The email of the workspace bot")
362
- }).describe(
363
- "The workspace's bot user's config used to automated various operations tasks"
364
- );
365
- var WorkspaceReleaseConfigSchema = z.object({
366
- banner: z.string().trim().optional().describe(
367
- "A URL to a banner image used to display the workspace's release"
368
- ),
369
- header: z.string().trim().optional().describe(
370
- "A header message appended to the start of the workspace's release notes"
371
- ),
372
- footer: z.string().trim().optional().describe(
373
- "A footer message appended to the end of the workspace's release notes"
374
- )
375
- }).describe("The workspace's release config used during the release process");
376
- var WorkspaceSocialsConfigSchema = z.object({
377
- twitter: z.string().trim().default(STORM_DEFAULT_SOCIAL_TWITTER).describe("A Twitter/X account associated with the organization/project"),
378
- discord: z.string().trim().default(STORM_DEFAULT_SOCIAL_DISCORD).describe("A Discord account associated with the organization/project"),
379
- telegram: z.string().trim().default(STORM_DEFAULT_SOCIAL_TELEGRAM).describe("A Telegram account associated with the organization/project"),
380
- slack: z.string().trim().default(STORM_DEFAULT_SOCIAL_SLACK).describe("A Slack account associated with the organization/project"),
381
- medium: z.string().trim().default(STORM_DEFAULT_SOCIAL_MEDIUM).describe("A Medium account associated with the organization/project"),
382
- github: z.string().trim().default(STORM_DEFAULT_SOCIAL_GITHUB).describe("A GitHub account associated with the organization/project")
383
- }).describe(
384
- "The workspace's account config used to store various social media links"
385
- );
386
- var WorkspaceDirectoryConfigSchema = z.object({
387
- cache: z.string().trim().optional().describe(
388
- "The directory used to store the environment's cached file data"
389
- ),
390
- data: z.string().trim().optional().describe("The directory used to store the environment's data files"),
391
- config: z.string().trim().optional().describe(
392
- "The directory used to store the environment's configuration files"
393
- ),
394
- temp: z.string().trim().optional().describe("The directory used to store the environment's temp files"),
395
- log: z.string().trim().optional().describe("The directory used to store the environment's temp files"),
396
- build: z.string().trim().default("dist").describe(
397
- "The directory used to store the workspace's distributable files after a build (relative to the workspace root)"
398
- )
399
- }).describe(
400
- "Various directories used by the workspace to store data, cache, and configuration files"
401
- );
402
- var errorConfigSchema = z.object({
403
- codesFile: z.string().trim().default(STORM_DEFAULT_ERROR_CODES_FILE).describe("The path to the workspace's error codes JSON file"),
404
- url: z.url().optional().describe(
405
- "A URL to a page that looks up the workspace's error messages given a specific error code"
406
- )
407
- }).describe("The workspace's error config used during the error process");
408
- var organizationConfigSchema = z.object({
409
- name: z.string().trim().describe("The name of the organization"),
410
- description: z.string().trim().optional().describe("A description of the organization"),
411
- logo: z.url().optional().describe("A URL to the organization's logo image"),
412
- icon: z.url().optional().describe("A URL to the organization's icon image"),
413
- url: z.url().optional().describe(
414
- "A URL to a page that provides more information about the organization"
415
- )
416
- }).describe("The workspace's organization details");
417
- var stormWorkspaceConfigSchema = z.object({
418
- $schema: z.string().trim().default(
419
- "https://public.storm-cdn.com/schemas/storm-workspace.schema.json"
420
- ).describe(
421
- "The URL or file path to the JSON schema file that describes the Storm configuration file"
422
- ),
423
- extends: ExtendsSchema.optional(),
424
- name: z.string().trim().toLowerCase().optional().describe(
425
- "The name of the service/package/scope using this configuration"
426
- ),
427
- namespace: z.string().trim().toLowerCase().optional().describe("The namespace of the package"),
428
- organization: organizationConfigSchema.or(z.string().trim().describe("The organization of the workspace")).optional().describe(
429
- "The organization of the workspace. This can be a string or an object containing the organization's details"
430
- ),
431
- repository: z.string().trim().optional().describe("The repo URL of the workspace (i.e. GitHub)"),
432
- license: z.string().trim().default("Apache-2.0").describe("The license type of the package"),
433
- homepage: z.url().optional().describe("The homepage of the workspace"),
434
- docs: z.url().optional().describe("The documentation site for the workspace"),
435
- portal: z.url().optional().describe("The development portal site for the workspace"),
436
- licensing: z.url().optional().describe("The licensing site for the workspace"),
437
- contact: z.url().optional().describe("The contact site for the workspace"),
438
- support: z.url().optional().describe(
439
- "The support site for the workspace. If not provided, this is defaulted to the `contact` config value"
440
- ),
441
- branch: z.string().trim().default("main").describe("The branch of the workspace"),
442
- preid: z.string().optional().describe("A tag specifying the version pre-release identifier"),
443
- owner: z.string().trim().default("@storm-software/admin").describe("The owner of the package"),
444
- bot: WorkspaceBotConfigSchema,
445
- release: WorkspaceReleaseConfigSchema,
446
- socials: WorkspaceSocialsConfigSchema,
447
- error: errorConfigSchema,
448
- mode: z.string().trim().default("production").describe("The current runtime environment mode for the package"),
449
- workspaceRoot: z.string().trim().describe("The root directory of the workspace"),
450
- skipCache: z.boolean().default(false).describe("Should all known types of workspace caching be skipped?"),
451
- directories: WorkspaceDirectoryConfigSchema,
452
- packageManager: z.enum(["npm", "yarn", "pnpm", "bun"]).default("npm").describe(
453
- "The JavaScript/TypeScript package manager used by the repository"
454
- ),
455
- timezone: z.string().trim().default("America/New_York").describe("The default timezone of the workspace"),
456
- locale: z.string().trim().default("en-US").describe("The default locale of the workspace"),
457
- logLevel: z.enum([
458
- "silent",
459
- "fatal",
460
- "error",
461
- "warn",
462
- "success",
463
- "info",
464
- "debug",
465
- "trace",
466
- "all"
467
- ]).default("info").describe(
468
- "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`)."
469
- ),
470
- skipConfigLogging: z.boolean().optional().describe(
471
- "Should the logging of the current Storm Workspace configuration be skipped?"
472
- ),
473
- registry: RegistryConfigSchema,
474
- configFile: z.string().trim().nullable().default(null).describe(
475
- "The filepath of the Storm config. When this field is null, no config file was found in the current workspace."
476
- ),
477
- colors: ColorConfigSchema.or(ColorConfigMapSchema).describe(
478
- "Storm theme config values used for styling various package elements"
479
- ),
480
- extensions: z.record(z.string(), z.any()).optional().default({}).describe("Configuration of each used extension")
481
- }).describe(
482
- "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."
483
- );
484
-
485
- // ../config/src/types.ts
486
- var COLOR_KEYS = [
487
- "dark",
488
- "light",
489
- "base",
490
- "brand",
491
- "alternate",
492
- "accent",
493
- "link",
494
- "success",
495
- "help",
496
- "info",
497
- "warning",
498
- "danger",
499
- "fatal",
500
- "positive",
501
- "negative"
502
- ];
503
-
504
- // ../config-tools/src/utilities/get-default-config.ts
505
-
506
- var _promises = require('fs/promises');
507
-
508
- var DEFAULT_COLOR_CONFIG = {
509
- light: {
510
- background: "#fafafa",
511
- foreground: "#1d1e22",
512
- brand: "#1fb2a6",
513
- alternate: "#db2777",
514
- help: "#5C4EE5",
515
- success: "#087f5b",
516
- info: "#0550ae",
517
- warning: "#e3b341",
518
- danger: "#D8314A",
519
- positive: "#22c55e",
520
- negative: "#dc2626"
521
- },
522
- dark: {
523
- background: "#1d1e22",
524
- foreground: "#cbd5e1",
525
- brand: "#2dd4bf",
526
- alternate: "#db2777",
527
- help: "#818cf8",
528
- success: "#10b981",
529
- info: "#58a6ff",
530
- warning: "#f3d371",
531
- danger: "#D8314A",
532
- positive: "#22c55e",
533
- negative: "#dc2626"
534
- }
535
- };
536
- async function getPackageJsonConfig(root) {
537
- let license = STORM_DEFAULT_LICENSE;
538
- let homepage = void 0;
539
- let support = void 0;
540
- let name = void 0;
541
- let namespace = void 0;
542
- let repository = void 0;
543
- const workspaceRoot = findWorkspaceRoot(root);
544
- if (_fs.existsSync.call(void 0, _path.join.call(void 0, workspaceRoot, "package.json"))) {
545
- const file = await _promises.readFile.call(void 0,
546
- joinPaths(workspaceRoot, "package.json"),
547
- "utf8"
548
- );
549
- if (file) {
550
- const packageJson = JSON.parse(file);
551
- if (packageJson.name) {
552
- name = packageJson.name;
553
- }
554
- if (packageJson.namespace) {
555
- namespace = packageJson.namespace;
556
- }
557
- if (packageJson.repository) {
558
- if (typeof packageJson.repository === "string") {
559
- repository = packageJson.repository;
560
- } else if (packageJson.repository.url) {
561
- repository = packageJson.repository.url;
562
- }
563
- }
564
- if (packageJson.license) {
565
- license = packageJson.license;
566
- }
567
- if (packageJson.homepage) {
568
- homepage = packageJson.homepage;
569
- }
570
- if (packageJson.bugs) {
571
- if (typeof packageJson.bugs === "string") {
572
- support = packageJson.bugs;
573
- } else if (packageJson.bugs.url) {
574
- support = packageJson.bugs.url;
575
- }
576
- }
577
- }
578
- }
579
- return {
580
- workspaceRoot,
581
- name,
582
- namespace,
583
- repository,
584
- license,
585
- homepage,
586
- support
587
- };
588
- }
589
- function applyDefaultConfig(config) {
590
- if (!config.support && config.contact) {
591
- config.support = config.contact;
592
- }
593
- if (!config.contact && config.support) {
594
- config.contact = config.support;
595
- }
596
- if (config.homepage) {
597
- if (!config.docs) {
598
- config.docs = `${config.homepage}/docs`;
599
- }
600
- if (!config.license) {
601
- config.license = `${config.homepage}/license`;
602
- }
603
- if (!config.support) {
604
- config.support = `${config.homepage}/support`;
605
- }
606
- if (!config.contact) {
607
- config.contact = `${config.homepage}/contact`;
608
- }
609
- if (!_optionalChain([config, 'access', _2 => _2.error, 'optionalAccess', _3 => _3.codesFile]) || !_optionalChain([config, 'optionalAccess', _4 => _4.error, 'optionalAccess', _5 => _5.url])) {
610
- config.error ??= { codesFile: STORM_DEFAULT_ERROR_CODES_FILE };
611
- if (config.homepage) {
612
- config.error.url ??= `${config.homepage}/errors`;
613
- }
614
- }
615
- }
616
- return config;
617
- }
618
-
619
- // ../config-tools/src/logger/chalk.ts
620
- var _chalk2 = require('chalk'); var _chalk3 = _interopRequireDefault(_chalk2);
621
- var chalkDefault = {
622
- hex: (_) => (message) => message,
623
- bgHex: (_) => ({
624
- whiteBright: (message) => message,
625
- white: (message) => message
626
- }),
627
- white: (message) => message,
628
- whiteBright: (message) => message,
629
- gray: (message) => message,
630
- bold: {
631
- hex: (_) => (message) => message,
632
- bgHex: (_) => ({
633
- whiteBright: (message) => message,
634
- white: (message) => message
635
- }),
636
- whiteBright: (message) => message,
637
- white: (message) => message
638
- },
639
- dim: {
640
- hex: (_) => (message) => message,
641
- gray: (message) => message
642
- }
643
- };
644
- var getChalk = () => {
645
- let _chalk = _chalk3.default;
646
- 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]) || !_optionalChain([_chalk, 'optionalAccess', _11 => _11.white])) {
647
- _chalk = chalkDefault;
648
- }
649
- return _chalk;
650
- };
651
-
652
- // ../config-tools/src/logger/is-unicode-supported.ts
653
- function isUnicodeSupported() {
654
- if (process.platform !== "win32") {
655
- return process.env.TERM !== "linux";
656
- }
657
- return Boolean(process.env.WT_SESSION) || // Windows Terminal
658
- Boolean(process.env.TERMINUS_SUBLIME) || // Terminus (<0.2.27)
659
- process.env.ConEmuTask === "{cmd::Cmder}" || // ConEmu and cmder
660
- 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";
661
- }
662
-
663
- // ../config-tools/src/logger/console-icons.ts
664
- var useIcon = (c, fallback) => isUnicodeSupported() ? c : fallback;
665
- var CONSOLE_ICONS = {
666
- [LogLevelLabel.ERROR]: useIcon("\u2718", "\xD7"),
667
- [LogLevelLabel.FATAL]: useIcon("\u{1F480}", "\xD7"),
668
- [LogLevelLabel.WARN]: useIcon("\u26A0", "\u203C"),
669
- [LogLevelLabel.INFO]: useIcon("\u2139", "i"),
670
- [LogLevelLabel.SUCCESS]: useIcon("\u2714", "\u221A"),
671
- [LogLevelLabel.DEBUG]: useIcon("\u{1F6E0}", "D"),
672
- [LogLevelLabel.TRACE]: useIcon("\u{1F6E0}", "T"),
673
- [LogLevelLabel.ALL]: useIcon("\u2709", "\u2192")
674
- };
675
-
676
- // ../config-tools/src/logger/format-timestamp.ts
677
- var formatTimestamp = (date = /* @__PURE__ */ new Date()) => {
678
- return `${date.toLocaleDateString()} ${date.toLocaleTimeString()}`;
679
- };
680
-
681
- // ../config-tools/src/logger/get-log-level.ts
682
- var getLogLevel = (label) => {
683
- switch (label) {
684
- case "all":
685
- return LogLevel.ALL;
686
- case "trace":
687
- return LogLevel.TRACE;
688
- case "debug":
689
- return LogLevel.DEBUG;
690
- case "info":
691
- return LogLevel.INFO;
692
- case "warn":
693
- return LogLevel.WARN;
694
- case "error":
695
- return LogLevel.ERROR;
696
- case "fatal":
697
- return LogLevel.FATAL;
698
- case "silent":
699
- return LogLevel.SILENT;
700
- default:
701
- return LogLevel.INFO;
702
- }
703
- };
704
- var getLogLevelLabel = (logLevel = LogLevel.INFO) => {
705
- if (logLevel >= LogLevel.ALL) {
706
- return LogLevelLabel.ALL;
707
- }
708
- if (logLevel >= LogLevel.TRACE) {
709
- return LogLevelLabel.TRACE;
710
- }
711
- if (logLevel >= LogLevel.DEBUG) {
712
- return LogLevelLabel.DEBUG;
713
- }
714
- if (logLevel >= LogLevel.INFO) {
715
- return LogLevelLabel.INFO;
716
- }
717
- if (logLevel >= LogLevel.WARN) {
718
- return LogLevelLabel.WARN;
719
- }
720
- if (logLevel >= LogLevel.ERROR) {
721
- return LogLevelLabel.ERROR;
722
- }
723
- if (logLevel >= LogLevel.FATAL) {
724
- return LogLevelLabel.FATAL;
725
- }
726
- if (logLevel <= LogLevel.SILENT) {
727
- return LogLevelLabel.SILENT;
728
- }
729
- return LogLevelLabel.INFO;
730
- };
731
-
732
- // ../config-tools/src/logger/console.ts
733
- var getLogFn = (logLevel = LogLevel.INFO, config = {}, _chalk = getChalk()) => {
734
- const colors = !_optionalChain([config, 'access', _12 => _12.colors, 'optionalAccess', _13 => _13.dark]) && !_optionalChain([config, 'access', _14 => _14.colors, 'optionalAccess', _15 => _15["base"]]) && !_optionalChain([config, 'access', _16 => _16.colors, 'optionalAccess', _17 => _17["base"], 'optionalAccess', _18 => _18.dark]) ? DEFAULT_COLOR_CONFIG : _optionalChain([config, 'access', _19 => _19.colors, 'optionalAccess', _20 => _20.dark]) && typeof config.colors.dark === "string" ? config.colors : _optionalChain([config, 'access', _21 => _21.colors, 'optionalAccess', _22 => _22["base"], 'optionalAccess', _23 => _23.dark]) && typeof config.colors["base"].dark === "string" ? config.colors["base"].dark : _optionalChain([config, 'access', _24 => _24.colors, 'optionalAccess', _25 => _25["base"]]) ? _optionalChain([config, 'access', _26 => _26.colors, 'optionalAccess', _27 => _27["base"]]) : DEFAULT_COLOR_CONFIG;
735
- const configLogLevel = config.logLevel || process.env.STORM_LOG_LEVEL || LogLevelLabel.INFO;
736
- if (logLevel > getLogLevel(configLogLevel) || logLevel <= LogLevel.SILENT || getLogLevel(configLogLevel) <= LogLevel.SILENT) {
737
- return (_) => {
738
- };
739
- }
740
- if (typeof logLevel === "number" && LogLevel.FATAL >= logLevel) {
741
- return (message) => {
742
- console.error(
743
- `
744
- ${_chalk.gray(formatTimestamp())} ${_chalk.hex(_nullishCoalesce(colors.fatal, () => ( "#7d1a1a")))(`[${CONSOLE_ICONS[LogLevelLabel.FATAL]} Fatal] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
745
- `
746
- );
747
- };
748
- }
749
- if (typeof logLevel === "number" && LogLevel.ERROR >= logLevel) {
750
- return (message) => {
751
- console.error(
752
- `
753
- ${_chalk.gray(formatTimestamp())} ${_chalk.hex(_nullishCoalesce(colors.danger, () => ( "#f85149")))(`[${CONSOLE_ICONS[LogLevelLabel.ERROR]} Error] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
754
- `
755
- );
756
- };
757
- }
758
- if (typeof logLevel === "number" && LogLevel.WARN >= logLevel) {
759
- return (message) => {
760
- console.warn(
761
- `
762
- ${_chalk.gray(formatTimestamp())} ${_chalk.hex(_nullishCoalesce(colors.warning, () => ( "#e3b341")))(`[${CONSOLE_ICONS[LogLevelLabel.WARN]} Warn] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
763
- `
764
- );
765
- };
766
- }
767
- if (typeof logLevel === "number" && LogLevel.SUCCESS >= logLevel) {
768
- return (message) => {
769
- console.info(
770
- `
771
- ${_chalk.gray(formatTimestamp())} ${_chalk.hex(_nullishCoalesce(colors.success, () => ( "#56d364")))(`[${CONSOLE_ICONS[LogLevelLabel.SUCCESS]} Success] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
772
- `
773
- );
774
- };
775
- }
776
- if (typeof logLevel === "number" && LogLevel.INFO >= logLevel) {
777
- return (message) => {
778
- console.info(
779
- `
780
- ${_chalk.gray(formatTimestamp())} ${_chalk.hex(_nullishCoalesce(colors.info, () => ( "#58a6ff")))(`[${CONSOLE_ICONS[LogLevelLabel.INFO]} Info] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
781
- `
782
- );
783
- };
784
- }
785
- if (typeof logLevel === "number" && LogLevel.DEBUG >= logLevel) {
786
- return (message) => {
787
- console.debug(
788
- `
789
- ${_chalk.gray(formatTimestamp())} ${_chalk.hex("#3e9eff")(`[${CONSOLE_ICONS[LogLevelLabel.DEBUG]} Debug] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
790
- `
791
- );
792
- };
793
- }
794
- if (typeof logLevel === "number" && LogLevel.TRACE >= logLevel) {
795
- return (message) => {
796
- console.debug(
797
- `
798
- ${_chalk.gray(formatTimestamp())} ${_chalk.hex("#0070E0")(`[${CONSOLE_ICONS[LogLevelLabel.TRACE]} Trace] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
799
- `
800
- );
801
- };
802
- }
803
- return (message) => {
804
- console.log(
805
- `
806
- ${_chalk.gray(formatTimestamp())} ${_chalk.hex("#0356a8")(`[${CONSOLE_ICONS[LogLevelLabel.ALL]} System] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
807
- `
808
- );
809
- };
810
- };
811
- var writeFatal = (message, config) => getLogFn(LogLevel.FATAL, config)(message);
812
- var writeError = (message, config) => getLogFn(LogLevel.ERROR, config)(message);
813
- var writeWarning = (message, config) => getLogFn(LogLevel.WARN, config)(message);
814
- var writeInfo = (message, config) => getLogFn(LogLevel.INFO, config)(message);
815
- var writeSuccess = (message, config) => getLogFn(LogLevel.SUCCESS, config)(message);
816
- var writeDebug = (message, config) => getLogFn(LogLevel.DEBUG, config)(message);
817
- var writeTrace = (message, config) => getLogFn(LogLevel.TRACE, config)(message);
818
- var getStopwatch = (name) => {
819
- const start = process.hrtime();
820
- return () => {
821
- const end = process.hrtime(start);
822
- console.info(
823
- `
824
- > \u23F1\uFE0F The${name ? ` ${name}` : ""} process took ${Math.round(
825
- end[0] * 1e3 + end[1] / 1e6
826
- )}ms to complete
827
- `
828
- );
829
- };
830
- };
831
- var MAX_DEPTH = 4;
832
- var formatLogMessage = (message, options = {}, depth2 = 0) => {
833
- if (depth2 > MAX_DEPTH) {
834
- return "<max depth>";
835
- }
836
- const prefix = _nullishCoalesce(options.prefix, () => ( "-"));
837
- const skip = _nullishCoalesce(options.skip, () => ( []));
838
- return typeof message === "undefined" || message === null || !message && typeof message !== "boolean" ? "<none>" : typeof message === "string" ? message : Array.isArray(message) ? `
839
- ${message.map((item, index) => ` ${prefix}> #${index} = ${formatLogMessage(item, { prefix: `${prefix}-`, skip }, depth2 + 1)}`).join("\n")}` : typeof message === "object" ? `
840
- ${Object.keys(message).filter((key) => !skip.includes(key)).map(
841
- (key) => ` ${prefix}> ${key} = ${_isFunction(message[key]) ? "<function>" : typeof message[key] === "object" ? formatLogMessage(
842
- message[key],
843
- { prefix: `${prefix}-`, skip },
844
- depth2 + 1
845
- ) : message[key]}`
846
- ).join("\n")}` : message;
847
- };
848
- var _isFunction = (value) => {
849
- try {
850
- return value instanceof Function || typeof value === "function" || !!(_optionalChain([value, 'optionalAccess', _28 => _28.constructor]) && _optionalChain([value, 'optionalAccess', _29 => _29.call]) && _optionalChain([value, 'optionalAccess', _30 => _30.apply]));
851
- } catch (e) {
852
- return false;
853
- }
854
- };
855
-
856
-
857
-
858
-
859
-
860
-
861
-
862
-
863
-
864
-
865
-
866
-
867
-
868
-
869
-
870
-
871
-
872
-
873
-
874
-
875
-
876
-
877
-
878
-
879
- exports.LogLevel = LogLevel; exports.STORM_DEFAULT_DOCS = STORM_DEFAULT_DOCS; exports.STORM_DEFAULT_HOMEPAGE = STORM_DEFAULT_HOMEPAGE; exports.STORM_DEFAULT_LICENSING = STORM_DEFAULT_LICENSING; exports.stormWorkspaceConfigSchema = stormWorkspaceConfigSchema; exports.COLOR_KEYS = COLOR_KEYS; exports.correctPaths = correctPaths; exports.joinPaths = joinPaths; exports.findWorkspaceRoot = findWorkspaceRoot; exports.getPackageJsonConfig = getPackageJsonConfig; exports.applyDefaultConfig = applyDefaultConfig; exports.getLogLevel = getLogLevel; exports.getLogLevelLabel = getLogLevelLabel; exports.writeFatal = writeFatal; exports.writeError = writeError; exports.writeWarning = writeWarning; exports.writeInfo = writeInfo; exports.writeSuccess = writeSuccess; exports.writeDebug = writeDebug; exports.writeTrace = writeTrace; exports.getStopwatch = getStopwatch; exports.formatLogMessage = formatLogMessage;