@storm-software/tsdown 0.36.59 → 0.36.66

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.
@@ -1,27 +1,17 @@
1
1
  import {
2
- COLOR_KEYS,
3
2
  LogLevel,
4
- STORM_DEFAULT_DOCS,
5
- STORM_DEFAULT_HOMEPAGE,
6
- STORM_DEFAULT_LICENSING,
7
- applyDefaultConfig,
8
3
  cleanDirectories,
9
- correctPaths,
10
- findWorkspaceRoot,
11
4
  formatLogMessage,
12
5
  getLogLevel,
13
6
  getLogLevelLabel,
14
- getPackageJsonConfig,
15
7
  getStopwatch,
16
8
  isVerbose,
17
- joinPaths,
18
- stormWorkspaceConfigSchema,
19
9
  writeDebug,
20
10
  writeFatal,
21
11
  writeSuccess,
22
12
  writeTrace,
23
13
  writeWarning
24
- } from "./chunk-7DJJEEQO.js";
14
+ } from "./chunk-IAKUT4HI.js";
25
15
  import {
26
16
  DEFAULT_BUILD_OPTIONS
27
17
  } from "./chunk-2YE3GBQH.js";
@@ -53,6 +43,133 @@ import { relative } from "path";
53
43
 
54
44
  // ../build-tools/src/utilities/copy-assets.ts
55
45
  import { CopyAssetsHandler } from "@nx/js/src/utils/assets/copy-assets-handler";
46
+
47
+ // ../config-tools/src/utilities/correct-paths.ts
48
+ var _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
49
+ function normalizeWindowsPath(input = "") {
50
+ if (!input) {
51
+ return input;
52
+ }
53
+ return input.replace(/\\/g, "/").replace(_DRIVE_LETTER_START_RE, (r) => r.toUpperCase());
54
+ }
55
+ var _UNC_REGEX = /^[/\\]{2}/;
56
+ var _IS_ABSOLUTE_RE = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/;
57
+ var _DRIVE_LETTER_RE = /^[A-Za-z]:$/;
58
+ var correctPaths = function(path2) {
59
+ if (!path2 || path2.length === 0) {
60
+ return ".";
61
+ }
62
+ path2 = normalizeWindowsPath(path2);
63
+ const isUNCPath = path2.match(_UNC_REGEX);
64
+ const isPathAbsolute = isAbsolute(path2);
65
+ const trailingSeparator = path2[path2.length - 1] === "/";
66
+ path2 = normalizeString(path2, !isPathAbsolute);
67
+ if (path2.length === 0) {
68
+ if (isPathAbsolute) {
69
+ return "/";
70
+ }
71
+ return trailingSeparator ? "./" : ".";
72
+ }
73
+ if (trailingSeparator) {
74
+ path2 += "/";
75
+ }
76
+ if (_DRIVE_LETTER_RE.test(path2)) {
77
+ path2 += "/";
78
+ }
79
+ if (isUNCPath) {
80
+ if (!isPathAbsolute) {
81
+ return `//./${path2}`;
82
+ }
83
+ return `//${path2}`;
84
+ }
85
+ return isPathAbsolute && !isAbsolute(path2) ? `/${path2}` : path2;
86
+ };
87
+ var joinPaths = function(...segments) {
88
+ let path2 = "";
89
+ for (const seg of segments) {
90
+ if (!seg) {
91
+ continue;
92
+ }
93
+ if (path2.length > 0) {
94
+ const pathTrailing = path2[path2.length - 1] === "/";
95
+ const segLeading = seg[0] === "/";
96
+ const both = pathTrailing && segLeading;
97
+ if (both) {
98
+ path2 += seg.slice(1);
99
+ } else {
100
+ path2 += pathTrailing || segLeading ? seg : `/${seg}`;
101
+ }
102
+ } else {
103
+ path2 += seg;
104
+ }
105
+ }
106
+ return correctPaths(path2);
107
+ };
108
+ function normalizeString(path2, allowAboveRoot) {
109
+ let res = "";
110
+ let lastSegmentLength = 0;
111
+ let lastSlash = -1;
112
+ let dots = 0;
113
+ let char = null;
114
+ for (let index = 0; index <= path2.length; ++index) {
115
+ if (index < path2.length) {
116
+ char = path2[index];
117
+ } else if (char === "/") {
118
+ break;
119
+ } else {
120
+ char = "/";
121
+ }
122
+ if (char === "/") {
123
+ if (lastSlash === index - 1 || dots === 1) {
124
+ } else if (dots === 2) {
125
+ if (res.length < 2 || lastSegmentLength !== 2 || res[res.length - 1] !== "." || res[res.length - 2] !== ".") {
126
+ if (res.length > 2) {
127
+ const lastSlashIndex = res.lastIndexOf("/");
128
+ if (lastSlashIndex === -1) {
129
+ res = "";
130
+ lastSegmentLength = 0;
131
+ } else {
132
+ res = res.slice(0, lastSlashIndex);
133
+ lastSegmentLength = res.length - 1 - res.lastIndexOf("/");
134
+ }
135
+ lastSlash = index;
136
+ dots = 0;
137
+ continue;
138
+ } else if (res.length > 0) {
139
+ res = "";
140
+ lastSegmentLength = 0;
141
+ lastSlash = index;
142
+ dots = 0;
143
+ continue;
144
+ }
145
+ }
146
+ if (allowAboveRoot) {
147
+ res += res.length > 0 ? "/.." : "..";
148
+ lastSegmentLength = 2;
149
+ }
150
+ } else {
151
+ if (res.length > 0) {
152
+ res += `/${path2.slice(lastSlash + 1, index)}`;
153
+ } else {
154
+ res = path2.slice(lastSlash + 1, index);
155
+ }
156
+ lastSegmentLength = index - lastSlash - 1;
157
+ }
158
+ lastSlash = index;
159
+ dots = 0;
160
+ } else if (char === "." && dots !== -1) {
161
+ ++dots;
162
+ } else {
163
+ dots = -1;
164
+ }
165
+ }
166
+ return res;
167
+ }
168
+ var isAbsolute = function(p) {
169
+ return _IS_ABSOLUTE_RE.test(p);
170
+ };
171
+
172
+ // ../build-tools/src/utilities/copy-assets.ts
56
173
  import { glob } from "glob";
57
174
  import { readFile, writeFile } from "node:fs/promises";
58
175
  var copyAssets = async (config, assets, outputPath, projectRoot, sourceRoot, generatePackageJson2 = true, includeSrc = false, banner, footer) => {
@@ -125,8 +242,104 @@ ${footer && typeof footer === "string" ? footer.startsWith("//") ? footer : `//
125
242
 
126
243
  // ../build-tools/src/utilities/generate-package-json.ts
127
244
  import { calculateProjectBuildableDependencies } from "@nx/js/src/utils/buildable-libs-utils";
245
+
246
+ // ../config-tools/src/utilities/find-up.ts
247
+ import { existsSync } from "node:fs";
248
+ import { join } from "node:path";
249
+ var MAX_PATH_SEARCH_DEPTH = 30;
250
+ var depth = 0;
251
+ function findFolderUp(startPath, endFileNames = [], endDirectoryNames = []) {
252
+ const _startPath = startPath ?? process.cwd();
253
+ if (endDirectoryNames.some(
254
+ (endDirName) => existsSync(join(_startPath, endDirName))
255
+ )) {
256
+ return _startPath;
257
+ }
258
+ if (endFileNames.some(
259
+ (endFileName) => existsSync(join(_startPath, endFileName))
260
+ )) {
261
+ return _startPath;
262
+ }
263
+ if (_startPath !== "/" && depth++ < MAX_PATH_SEARCH_DEPTH) {
264
+ const parent = join(_startPath, "..");
265
+ return findFolderUp(parent, endFileNames, endDirectoryNames);
266
+ }
267
+ return void 0;
268
+ }
269
+
270
+ // ../config-tools/src/utilities/find-workspace-root.ts
271
+ var rootFiles = [
272
+ "storm-workspace.json",
273
+ "storm-workspace.yaml",
274
+ "storm-workspace.yml",
275
+ "storm-workspace.js",
276
+ "storm-workspace.ts",
277
+ ".storm-workspace.json",
278
+ ".storm-workspace.yaml",
279
+ ".storm-workspace.yml",
280
+ ".storm-workspace.js",
281
+ ".storm-workspace.ts",
282
+ "lerna.json",
283
+ "nx.json",
284
+ "turbo.json",
285
+ "npm-workspace.json",
286
+ "yarn-workspace.json",
287
+ "pnpm-workspace.json",
288
+ "npm-workspace.yaml",
289
+ "yarn-workspace.yaml",
290
+ "pnpm-workspace.yaml",
291
+ "npm-workspace.yml",
292
+ "yarn-workspace.yml",
293
+ "pnpm-workspace.yml",
294
+ "npm-lock.json",
295
+ "yarn-lock.json",
296
+ "pnpm-lock.json",
297
+ "npm-lock.yaml",
298
+ "yarn-lock.yaml",
299
+ "pnpm-lock.yaml",
300
+ "npm-lock.yml",
301
+ "yarn-lock.yml",
302
+ "pnpm-lock.yml",
303
+ "bun.lockb"
304
+ ];
305
+ var rootDirectories = [
306
+ ".storm-workspace",
307
+ ".nx",
308
+ ".github",
309
+ ".vscode",
310
+ ".verdaccio"
311
+ ];
312
+ function findWorkspaceRootSafe(pathInsideMonorepo) {
313
+ if (process.env.STORM_WORKSPACE_ROOT || process.env.NX_WORKSPACE_ROOT_PATH) {
314
+ return correctPaths(
315
+ process.env.STORM_WORKSPACE_ROOT ?? process.env.NX_WORKSPACE_ROOT_PATH
316
+ );
317
+ }
318
+ return correctPaths(
319
+ findFolderUp(
320
+ pathInsideMonorepo ?? process.cwd(),
321
+ rootFiles,
322
+ rootDirectories
323
+ )
324
+ );
325
+ }
326
+ function findWorkspaceRoot(pathInsideMonorepo) {
327
+ const result = findWorkspaceRootSafe(pathInsideMonorepo);
328
+ if (!result) {
329
+ throw new Error(
330
+ `Cannot find workspace root upwards from known path. Files search list includes:
331
+ ${rootFiles.join(
332
+ "\n"
333
+ )}
334
+ Path: ${pathInsideMonorepo ? pathInsideMonorepo : process.cwd()}`
335
+ );
336
+ }
337
+ return result;
338
+ }
339
+
340
+ // ../build-tools/src/utilities/generate-package-json.ts
128
341
  import { Glob } from "glob";
129
- import { existsSync, readFileSync } from "node:fs";
342
+ import { existsSync as existsSync2, readFileSync } from "node:fs";
130
343
  import { readFile as readFile2 } from "node:fs/promises";
131
344
  import {
132
345
  createProjectGraphAsync,
@@ -166,7 +379,7 @@ var addPackageDependencies = async (workspaceRoot, projectRoot, projectName, pac
166
379
  projectNode.data.root,
167
380
  "package.json"
168
381
  );
169
- if (existsSync(projectPackageJsonPath)) {
382
+ if (existsSync2(projectPackageJsonPath)) {
170
383
  const projectPackageJsonContent = await readFile2(
171
384
  projectPackageJsonPath,
172
385
  "utf8"
@@ -201,7 +414,7 @@ var addPackageDependencies = async (workspaceRoot, projectRoot, projectName, pac
201
414
  projectConfigurations.projects[dep].root,
202
415
  "package.json"
203
416
  );
204
- if (existsSync(depPackageJsonPath)) {
417
+ if (existsSync2(depPackageJsonPath)) {
205
418
  const depPackageJsonContent = readFileSync(
206
419
  depPackageJsonPath,
207
420
  "utf8"
@@ -297,6 +510,389 @@ var addPackageJsonExport = (file, type = "module", sourceRoot) => {
297
510
  // ../config-tools/src/config-file/get-config-file.ts
298
511
  import { loadConfig } from "c12";
299
512
  import defu from "defu";
513
+
514
+ // ../config/src/constants.ts
515
+ var STORM_DEFAULT_DOCS = "https://docs.stormsoftware.com";
516
+ var STORM_DEFAULT_HOMEPAGE = "https://stormsoftware.com";
517
+ var STORM_DEFAULT_CONTACT = "https://stormsoftware.com/contact";
518
+ var STORM_DEFAULT_LICENSING = "https://stormsoftware.com/license";
519
+ var STORM_DEFAULT_LICENSE = "Apache-2.0";
520
+ var STORM_DEFAULT_SOCIAL_TWITTER = "StormSoftwareHQ";
521
+ var STORM_DEFAULT_SOCIAL_DISCORD = "https://discord.gg/MQ6YVzakM5";
522
+ var STORM_DEFAULT_SOCIAL_TELEGRAM = "https://t.me/storm_software";
523
+ var STORM_DEFAULT_SOCIAL_SLACK = "https://join.slack.com/t/storm-software/shared_invite/zt-2gsmk04hs-i6yhK_r6urq0dkZYAwq2pA";
524
+ var STORM_DEFAULT_SOCIAL_MEDIUM = "https://medium.com/storm-software";
525
+ var STORM_DEFAULT_SOCIAL_GITHUB = "https://github.com/storm-software";
526
+ var STORM_DEFAULT_RELEASE_FOOTER = `
527
+ 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.
528
+
529
+ Join us on [Discord](${STORM_DEFAULT_SOCIAL_DISCORD}) to chat with the team, receive release notifications, ask questions, and get involved.
530
+
531
+ 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!
532
+ `;
533
+ var STORM_DEFAULT_ERROR_CODES_FILE = "tools/errors/codes.json";
534
+
535
+ // ../config/src/schema.ts
536
+ import * as z from "zod";
537
+ var ColorSchema = z.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7);
538
+ var DarkColorSchema = ColorSchema.default("#151718").describe(
539
+ "The dark background color of the workspace"
540
+ );
541
+ var LightColorSchema = ColorSchema.default("#cbd5e1").describe(
542
+ "The light background color of the workspace"
543
+ );
544
+ var BrandColorSchema = ColorSchema.default("#1fb2a6").describe(
545
+ "The primary brand specific color of the workspace"
546
+ );
547
+ var AlternateColorSchema = ColorSchema.optional().describe(
548
+ "The alternate brand specific color of the workspace"
549
+ );
550
+ var AccentColorSchema = ColorSchema.optional().describe(
551
+ "The secondary brand specific color of the workspace"
552
+ );
553
+ var LinkColorSchema = ColorSchema.default("#3fa6ff").describe(
554
+ "The color used to display hyperlink text"
555
+ );
556
+ var HelpColorSchema = ColorSchema.default("#818cf8").describe(
557
+ "The second brand specific color of the workspace"
558
+ );
559
+ var SuccessColorSchema = ColorSchema.default("#45b27e").describe(
560
+ "The success color of the workspace"
561
+ );
562
+ var InfoColorSchema = ColorSchema.default("#38bdf8").describe(
563
+ "The informational color of the workspace"
564
+ );
565
+ var WarningColorSchema = ColorSchema.default("#f3d371").describe(
566
+ "The warning color of the workspace"
567
+ );
568
+ var DangerColorSchema = ColorSchema.default("#d8314a").describe(
569
+ "The danger color of the workspace"
570
+ );
571
+ var FatalColorSchema = ColorSchema.optional().describe(
572
+ "The fatal color of the workspace"
573
+ );
574
+ var PositiveColorSchema = ColorSchema.default("#4ade80").describe(
575
+ "The positive number color of the workspace"
576
+ );
577
+ var NegativeColorSchema = ColorSchema.default("#ef4444").describe(
578
+ "The negative number color of the workspace"
579
+ );
580
+ var GradientStopsSchema = z.array(ColorSchema).optional().describe(
581
+ "The color stops for the base gradient color pattern used in the workspace"
582
+ );
583
+ var DarkThemeColorConfigSchema = z.object({
584
+ foreground: LightColorSchema,
585
+ background: DarkColorSchema,
586
+ brand: BrandColorSchema,
587
+ alternate: AlternateColorSchema,
588
+ accent: AccentColorSchema,
589
+ link: LinkColorSchema,
590
+ help: HelpColorSchema,
591
+ success: SuccessColorSchema,
592
+ info: InfoColorSchema,
593
+ warning: WarningColorSchema,
594
+ danger: DangerColorSchema,
595
+ fatal: FatalColorSchema,
596
+ positive: PositiveColorSchema,
597
+ negative: NegativeColorSchema,
598
+ gradient: GradientStopsSchema
599
+ });
600
+ var LightThemeColorConfigSchema = z.object({
601
+ foreground: DarkColorSchema,
602
+ background: LightColorSchema,
603
+ brand: BrandColorSchema,
604
+ alternate: AlternateColorSchema,
605
+ accent: AccentColorSchema,
606
+ link: LinkColorSchema,
607
+ help: HelpColorSchema,
608
+ success: SuccessColorSchema,
609
+ info: InfoColorSchema,
610
+ warning: WarningColorSchema,
611
+ danger: DangerColorSchema,
612
+ fatal: FatalColorSchema,
613
+ positive: PositiveColorSchema,
614
+ negative: NegativeColorSchema,
615
+ gradient: GradientStopsSchema
616
+ });
617
+ var MultiThemeColorConfigSchema = z.object({
618
+ dark: DarkThemeColorConfigSchema,
619
+ light: LightThemeColorConfigSchema
620
+ });
621
+ var SingleThemeColorConfigSchema = z.object({
622
+ dark: DarkColorSchema,
623
+ light: LightColorSchema,
624
+ brand: BrandColorSchema,
625
+ alternate: AlternateColorSchema,
626
+ accent: AccentColorSchema,
627
+ link: LinkColorSchema,
628
+ help: HelpColorSchema,
629
+ success: SuccessColorSchema,
630
+ info: InfoColorSchema,
631
+ warning: WarningColorSchema,
632
+ danger: DangerColorSchema,
633
+ fatal: FatalColorSchema,
634
+ positive: PositiveColorSchema,
635
+ negative: NegativeColorSchema,
636
+ gradient: GradientStopsSchema
637
+ });
638
+ var RegistryUrlConfigSchema = z.url().optional().describe("A remote registry URL used to publish distributable packages");
639
+ var RegistryConfigSchema = z.object({
640
+ github: RegistryUrlConfigSchema,
641
+ npm: RegistryUrlConfigSchema,
642
+ cargo: RegistryUrlConfigSchema,
643
+ cyclone: RegistryUrlConfigSchema,
644
+ container: RegistryUrlConfigSchema
645
+ }).default({}).describe("A list of remote registry URLs used by Storm Software");
646
+ var ColorConfigSchema = SingleThemeColorConfigSchema.or(
647
+ MultiThemeColorConfigSchema
648
+ ).describe("Colors used for various workspace elements");
649
+ var ColorConfigMapSchema = z.record(
650
+ z.union([z.literal("base"), z.string()]),
651
+ ColorConfigSchema
652
+ );
653
+ var ExtendsItemSchema = z.string().trim().describe(
654
+ "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."
655
+ );
656
+ var ExtendsSchema = ExtendsItemSchema.or(
657
+ z.array(ExtendsItemSchema)
658
+ ).describe(
659
+ "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."
660
+ );
661
+ var WorkspaceBotConfigSchema = z.object({
662
+ name: z.string().trim().default("stormie-bot").describe(
663
+ "The workspace bot user's name (this is the bot that will be used to perform various tasks)"
664
+ ),
665
+ email: z.email().default("bot@stormsoftware.com").describe("The email of the workspace bot")
666
+ }).describe(
667
+ "The workspace's bot user's config used to automated various operations tasks"
668
+ );
669
+ var WorkspaceReleaseConfigSchema = z.object({
670
+ banner: z.string().trim().optional().describe(
671
+ "A URL to a banner image used to display the workspace's release"
672
+ ),
673
+ header: z.string().trim().optional().describe(
674
+ "A header message appended to the start of the workspace's release notes"
675
+ ),
676
+ footer: z.string().trim().optional().describe(
677
+ "A footer message appended to the end of the workspace's release notes"
678
+ )
679
+ }).describe("The workspace's release config used during the release process");
680
+ var WorkspaceSocialsConfigSchema = z.object({
681
+ twitter: z.string().trim().default(STORM_DEFAULT_SOCIAL_TWITTER).describe("A Twitter/X account associated with the organization/project"),
682
+ discord: z.string().trim().default(STORM_DEFAULT_SOCIAL_DISCORD).describe("A Discord account associated with the organization/project"),
683
+ telegram: z.string().trim().default(STORM_DEFAULT_SOCIAL_TELEGRAM).describe("A Telegram account associated with the organization/project"),
684
+ slack: z.string().trim().default(STORM_DEFAULT_SOCIAL_SLACK).describe("A Slack account associated with the organization/project"),
685
+ medium: z.string().trim().default(STORM_DEFAULT_SOCIAL_MEDIUM).describe("A Medium account associated with the organization/project"),
686
+ github: z.string().trim().default(STORM_DEFAULT_SOCIAL_GITHUB).describe("A GitHub account associated with the organization/project")
687
+ }).describe(
688
+ "The workspace's account config used to store various social media links"
689
+ );
690
+ var WorkspaceDirectoryConfigSchema = z.object({
691
+ cache: z.string().trim().optional().describe(
692
+ "The directory used to store the environment's cached file data"
693
+ ),
694
+ data: z.string().trim().optional().describe("The directory used to store the environment's data files"),
695
+ config: z.string().trim().optional().describe(
696
+ "The directory used to store the environment's configuration files"
697
+ ),
698
+ temp: z.string().trim().optional().describe("The directory used to store the environment's temp files"),
699
+ log: z.string().trim().optional().describe("The directory used to store the environment's temp files"),
700
+ build: z.string().trim().default("dist").describe(
701
+ "The directory used to store the workspace's distributable files after a build (relative to the workspace root)"
702
+ )
703
+ }).describe(
704
+ "Various directories used by the workspace to store data, cache, and configuration files"
705
+ );
706
+ var errorConfigSchema = z.object({
707
+ codesFile: z.string().trim().default(STORM_DEFAULT_ERROR_CODES_FILE).describe("The path to the workspace's error codes JSON file"),
708
+ url: z.url().optional().describe(
709
+ "A URL to a page that looks up the workspace's error messages given a specific error code"
710
+ )
711
+ }).describe("The workspace's error config used during the error process");
712
+ var organizationConfigSchema = z.object({
713
+ name: z.string().trim().describe("The name of the organization"),
714
+ description: z.string().trim().optional().describe("A description of the organization"),
715
+ logo: z.url().optional().describe("A URL to the organization's logo image"),
716
+ icon: z.url().optional().describe("A URL to the organization's icon image"),
717
+ url: z.url().optional().describe(
718
+ "A URL to a page that provides more information about the organization"
719
+ )
720
+ }).describe("The workspace's organization details");
721
+ var stormWorkspaceConfigSchema = z.object({
722
+ $schema: z.string().trim().default(
723
+ "https://public.storm-cdn.com/schemas/storm-workspace.schema.json"
724
+ ).describe(
725
+ "The URL or file path to the JSON schema file that describes the Storm configuration file"
726
+ ),
727
+ extends: ExtendsSchema.optional(),
728
+ name: z.string().trim().toLowerCase().optional().describe(
729
+ "The name of the service/package/scope using this configuration"
730
+ ),
731
+ namespace: z.string().trim().toLowerCase().optional().describe("The namespace of the package"),
732
+ organization: organizationConfigSchema.or(z.string().trim().describe("The organization of the workspace")).optional().describe(
733
+ "The organization of the workspace. This can be a string or an object containing the organization's details"
734
+ ),
735
+ repository: z.string().trim().optional().describe("The repo URL of the workspace (i.e. GitHub)"),
736
+ license: z.string().trim().default("Apache-2.0").describe("The license type of the package"),
737
+ homepage: z.url().optional().describe("The homepage of the workspace"),
738
+ docs: z.url().optional().describe("The documentation site for the workspace"),
739
+ portal: z.url().optional().describe("The development portal site for the workspace"),
740
+ licensing: z.url().optional().describe("The licensing site for the workspace"),
741
+ contact: z.url().optional().describe("The contact site for the workspace"),
742
+ support: z.url().optional().describe(
743
+ "The support site for the workspace. If not provided, this is defaulted to the `contact` config value"
744
+ ),
745
+ branch: z.string().trim().default("main").describe("The branch of the workspace"),
746
+ preid: z.string().optional().describe("A tag specifying the version pre-release identifier"),
747
+ owner: z.string().trim().default("@storm-software/admin").describe("The owner of the package"),
748
+ bot: WorkspaceBotConfigSchema,
749
+ release: WorkspaceReleaseConfigSchema,
750
+ socials: WorkspaceSocialsConfigSchema,
751
+ error: errorConfigSchema,
752
+ mode: z.string().trim().default("production").describe("The current runtime environment mode for the package"),
753
+ workspaceRoot: z.string().trim().describe("The root directory of the workspace"),
754
+ skipCache: z.boolean().default(false).describe("Should all known types of workspace caching be skipped?"),
755
+ directories: WorkspaceDirectoryConfigSchema,
756
+ packageManager: z.enum(["npm", "yarn", "pnpm", "bun"]).default("npm").describe(
757
+ "The JavaScript/TypeScript package manager used by the repository"
758
+ ),
759
+ timezone: z.string().trim().default("America/New_York").describe("The default timezone of the workspace"),
760
+ locale: z.string().trim().default("en-US").describe("The default locale of the workspace"),
761
+ logLevel: z.enum([
762
+ "silent",
763
+ "fatal",
764
+ "error",
765
+ "warn",
766
+ "success",
767
+ "info",
768
+ "debug",
769
+ "trace",
770
+ "all"
771
+ ]).default("info").describe(
772
+ "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`)."
773
+ ),
774
+ skipConfigLogging: z.boolean().optional().describe(
775
+ "Should the logging of the current Storm Workspace configuration be skipped?"
776
+ ),
777
+ registry: RegistryConfigSchema,
778
+ configFile: z.string().trim().nullable().default(null).describe(
779
+ "The filepath of the Storm config. When this field is null, no config file was found in the current workspace."
780
+ ),
781
+ colors: ColorConfigSchema.or(ColorConfigMapSchema).describe(
782
+ "Storm theme config values used for styling various package elements"
783
+ ),
784
+ extensions: z.record(z.string(), z.any()).optional().default({}).describe("Configuration of each used extension")
785
+ }).describe(
786
+ "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."
787
+ );
788
+
789
+ // ../config/src/types.ts
790
+ var COLOR_KEYS = [
791
+ "dark",
792
+ "light",
793
+ "base",
794
+ "brand",
795
+ "alternate",
796
+ "accent",
797
+ "link",
798
+ "success",
799
+ "help",
800
+ "info",
801
+ "warning",
802
+ "danger",
803
+ "fatal",
804
+ "positive",
805
+ "negative"
806
+ ];
807
+
808
+ // ../config-tools/src/utilities/get-default-config.ts
809
+ import { existsSync as existsSync3 } from "node:fs";
810
+ import { readFile as readFile3 } from "node:fs/promises";
811
+ import { join as join2 } from "node:path";
812
+ async function getPackageJsonConfig(root) {
813
+ let license = STORM_DEFAULT_LICENSE;
814
+ let homepage = void 0;
815
+ let support = void 0;
816
+ let name = void 0;
817
+ let namespace = void 0;
818
+ let repository = void 0;
819
+ const workspaceRoot = findWorkspaceRoot(root);
820
+ if (existsSync3(join2(workspaceRoot, "package.json"))) {
821
+ const file = await readFile3(
822
+ joinPaths(workspaceRoot, "package.json"),
823
+ "utf8"
824
+ );
825
+ if (file) {
826
+ const packageJson = JSON.parse(file);
827
+ if (packageJson.name) {
828
+ name = packageJson.name;
829
+ }
830
+ if (packageJson.namespace) {
831
+ namespace = packageJson.namespace;
832
+ }
833
+ if (packageJson.repository) {
834
+ if (typeof packageJson.repository === "string") {
835
+ repository = packageJson.repository;
836
+ } else if (packageJson.repository.url) {
837
+ repository = packageJson.repository.url;
838
+ }
839
+ }
840
+ if (packageJson.license) {
841
+ license = packageJson.license;
842
+ }
843
+ if (packageJson.homepage) {
844
+ homepage = packageJson.homepage;
845
+ }
846
+ if (packageJson.bugs) {
847
+ if (typeof packageJson.bugs === "string") {
848
+ support = packageJson.bugs;
849
+ } else if (packageJson.bugs.url) {
850
+ support = packageJson.bugs.url;
851
+ }
852
+ }
853
+ }
854
+ }
855
+ return {
856
+ workspaceRoot,
857
+ name,
858
+ namespace,
859
+ repository,
860
+ license,
861
+ homepage,
862
+ support
863
+ };
864
+ }
865
+ function applyDefaultConfig(config) {
866
+ if (!config.support && config.contact) {
867
+ config.support = config.contact;
868
+ }
869
+ if (!config.contact && config.support) {
870
+ config.contact = config.support;
871
+ }
872
+ if (config.homepage) {
873
+ if (!config.docs) {
874
+ config.docs = `${config.homepage}/docs`;
875
+ }
876
+ if (!config.license) {
877
+ config.license = `${config.homepage}/license`;
878
+ }
879
+ if (!config.support) {
880
+ config.support = `${config.homepage}/support`;
881
+ }
882
+ if (!config.contact) {
883
+ config.contact = `${config.homepage}/contact`;
884
+ }
885
+ if (!config.error?.codesFile || !config?.error?.url) {
886
+ config.error ??= { codesFile: STORM_DEFAULT_ERROR_CODES_FILE };
887
+ if (config.homepage) {
888
+ config.error.url ??= `${config.homepage}/errors`;
889
+ }
890
+ }
891
+ }
892
+ return config;
893
+ }
894
+
895
+ // ../config-tools/src/config-file/get-config-file.ts
300
896
  var getConfigFileByName = async (fileName, filePath, options = {}) => {
301
897
  const workspacePath = filePath || findWorkspaceRoot(filePath);
302
898
  const configs = await Promise.all([
@@ -513,6 +1109,19 @@ var getThemeColorConfigEnv = (prefix, theme) => {
513
1109
  return process.env[`${prefix}${themeName}LIGHT_BRAND`] || process.env[`${prefix}${themeName}DARK_BRAND`] ? getMultiThemeColorConfigEnv(prefix + themeName) : getSingleThemeColorConfigEnv(prefix + themeName);
514
1110
  };
515
1111
  var getSingleThemeColorConfigEnv = (prefix) => {
1112
+ const gradient = [];
1113
+ if (process.env[`${prefix}GRADIENT_START`] && process.env[`${prefix}GRADIENT_END`]) {
1114
+ gradient.push(
1115
+ process.env[`${prefix}GRADIENT_START`],
1116
+ process.env[`${prefix}GRADIENT_END`]
1117
+ );
1118
+ } else if (process.env[`${prefix}GRADIENT_0`] || process.env[`${prefix}GRADIENT_1`]) {
1119
+ let index = process.env[`${prefix}GRADIENT_0`] ? 0 : 1;
1120
+ while (process.env[`${prefix}GRADIENT_${index}`]) {
1121
+ gradient.push(process.env[`${prefix}GRADIENT_${index}`]);
1122
+ index++;
1123
+ }
1124
+ }
516
1125
  return {
517
1126
  dark: process.env[`${prefix}DARK`],
518
1127
  light: process.env[`${prefix}LIGHT`],
@@ -527,7 +1136,8 @@ var getSingleThemeColorConfigEnv = (prefix) => {
527
1136
  danger: process.env[`${prefix}DANGER`],
528
1137
  fatal: process.env[`${prefix}FATAL`],
529
1138
  positive: process.env[`${prefix}POSITIVE`],
530
- negative: process.env[`${prefix}NEGATIVE`]
1139
+ negative: process.env[`${prefix}NEGATIVE`],
1140
+ gradient
531
1141
  };
532
1142
  };
533
1143
  var getMultiThemeColorConfigEnv = (prefix) => {
@@ -539,6 +1149,19 @@ var getMultiThemeColorConfigEnv = (prefix) => {
539
1149
  };
540
1150
  };
541
1151
  var getBaseThemeColorConfigEnv = (prefix) => {
1152
+ const gradient = [];
1153
+ if (process.env[`${prefix}GRADIENT_START`] && process.env[`${prefix}GRADIENT_END`]) {
1154
+ gradient.push(
1155
+ process.env[`${prefix}GRADIENT_START`],
1156
+ process.env[`${prefix}GRADIENT_END`]
1157
+ );
1158
+ } else if (process.env[`${prefix}GRADIENT_0`] || process.env[`${prefix}GRADIENT_1`]) {
1159
+ let index = process.env[`${prefix}GRADIENT_0`] ? 0 : 1;
1160
+ while (process.env[`${prefix}GRADIENT_${index}`]) {
1161
+ gradient.push(process.env[`${prefix}GRADIENT_${index}`]);
1162
+ index++;
1163
+ }
1164
+ }
542
1165
  return {
543
1166
  foreground: process.env[`${prefix}FOREGROUND`],
544
1167
  background: process.env[`${prefix}BACKGROUND`],
@@ -553,7 +1176,8 @@ var getBaseThemeColorConfigEnv = (prefix) => {
553
1176
  danger: process.env[`${prefix}DANGER`],
554
1177
  fatal: process.env[`${prefix}FATAL`],
555
1178
  positive: process.env[`${prefix}POSITIVE`],
556
- negative: process.env[`${prefix}NEGATIVE`]
1179
+ negative: process.env[`${prefix}NEGATIVE`],
1180
+ gradient
557
1181
  };
558
1182
  };
559
1183
 
@@ -684,11 +1308,12 @@ var setConfigEnv = (config) => {
684
1308
  process.env[`${prefix}TIMEZONE`] = config.timezone;
685
1309
  process.env.TZ = config.timezone;
686
1310
  process.env.DEFAULT_TIMEZONE = config.timezone;
1311
+ process.env.TIMEZONE = config.timezone;
687
1312
  }
688
1313
  if (config.locale) {
689
1314
  process.env[`${prefix}LOCALE`] = config.locale;
690
- process.env.LOCALE = config.locale;
691
1315
  process.env.DEFAULT_LOCALE = config.locale;
1316
+ process.env.LOCALE = config.locale;
692
1317
  process.env.LANG = config.locale ? `${config.locale.replaceAll("-", "_")}.UTF-8` : "en_US.UTF-8";
693
1318
  }
694
1319
  if (config.configFile) {
@@ -849,6 +1474,11 @@ var setSingleThemeColorConfigEnv = (prefix, config) => {
849
1474
  if (config.negative) {
850
1475
  process.env[`${prefix}NEGATIVE`] = config.negative;
851
1476
  }
1477
+ if (config.gradient) {
1478
+ for (let i = 0; i < config.gradient.length; i++) {
1479
+ process.env[`${prefix}GRADIENT_${i}`] = config.gradient[i];
1480
+ }
1481
+ }
852
1482
  };
853
1483
  var setMultiThemeColorConfigEnv = (prefix, config) => {
854
1484
  return {
@@ -899,6 +1529,11 @@ var setBaseThemeColorConfigEnv = (prefix, config) => {
899
1529
  if (config.negative) {
900
1530
  process.env[`${prefix}NEGATIVE`] = config.negative;
901
1531
  }
1532
+ if (config.gradient) {
1533
+ for (let i = 0; i < config.gradient.length; i++) {
1534
+ process.env[`${prefix}GRADIENT_${i}`] = config.gradient[i];
1535
+ }
1536
+ }
902
1537
  };
903
1538
 
904
1539
  // ../config-tools/src/create-storm-config.ts
@@ -1079,8 +1714,8 @@ var getEnv = (builder, options) => {
1079
1714
  };
1080
1715
 
1081
1716
  // ../build-tools/src/utilities/read-nx-config.ts
1082
- import { existsSync as existsSync2 } from "node:fs";
1083
- import { readFile as readFile3 } from "node:fs/promises";
1717
+ import { existsSync as existsSync4 } from "node:fs";
1718
+ import { readFile as readFile4 } from "node:fs/promises";
1084
1719
 
1085
1720
  // ../build-tools/src/utilities/task-graph.ts
1086
1721
  import {
@@ -1090,7 +1725,7 @@ import {
1090
1725
 
1091
1726
  // src/build.ts
1092
1727
  import defu3 from "defu";
1093
- import { existsSync as existsSync3 } from "node:fs";
1728
+ import { existsSync as existsSync5 } from "node:fs";
1094
1729
  import hf from "node:fs/promises";
1095
1730
  import { findWorkspaceRoot as findWorkspaceRoot2 } from "nx/src/utils/find-workspace-root";
1096
1731
  import { build as tsdown } from "tsdown";
@@ -1111,7 +1746,7 @@ var resolveOptions = async (userOptions) => {
1111
1746
  projectRoot,
1112
1747
  "project.json"
1113
1748
  );
1114
- if (!existsSync3(projectJsonPath)) {
1749
+ if (!existsSync5(projectJsonPath)) {
1115
1750
  throw new Error("Cannot find project.json configuration");
1116
1751
  }
1117
1752
  const projectJsonFile = await hf.readFile(projectJsonPath, "utf8");
@@ -1131,7 +1766,7 @@ var resolveOptions = async (userOptions) => {
1131
1766
  options.projectRoot,
1132
1767
  "package.json"
1133
1768
  );
1134
- if (!existsSync3(packageJsonPath)) {
1769
+ if (!existsSync5(packageJsonPath)) {
1135
1770
  throw new Error("Cannot find package.json configuration");
1136
1771
  }
1137
1772
  const env = getEnv("tsdown", options);
@@ -1191,11 +1826,11 @@ var resolveOptions = async (userOptions) => {
1191
1826
  return result;
1192
1827
  };
1193
1828
  async function generatePackageJson(options) {
1194
- if (options.generatePackageJson !== false && existsSync3(joinPaths(options.projectRoot, "package.json"))) {
1829
+ if (options.generatePackageJson !== false && existsSync5(joinPaths(options.projectRoot, "package.json"))) {
1195
1830
  writeDebug(" \u270D\uFE0F Writing package.json file", options.config);
1196
1831
  const stopwatch = getStopwatch("Write package.json file");
1197
1832
  const packageJsonPath = joinPaths(options.projectRoot, "project.json");
1198
- if (!existsSync3(packageJsonPath)) {
1833
+ if (!existsSync5(packageJsonPath)) {
1199
1834
  throw new Error("Cannot find package.json configuration");
1200
1835
  }
1201
1836
  const packageJsonFile = await hf.readFile(