@storm-software/unbuild 0.49.59 → 0.49.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,40 +1,30 @@
1
1
  import {
2
2
  cleanDirectories
3
- } from "./chunk-KCEFJ3KA.js";
3
+ } from "./chunk-QQE3PPKS.js";
4
4
  import {
5
5
  analyzePlugin
6
- } from "./chunk-SLMCYERU.js";
6
+ } from "./chunk-OOFI7BOW.js";
7
7
  import {
8
8
  onErrorPlugin
9
- } from "./chunk-U2JTX5UH.js";
9
+ } from "./chunk-NRCPBIXP.js";
10
10
  import {
11
11
  loadConfig,
12
12
  tscPlugin
13
- } from "./chunk-3QBGMWVL.js";
13
+ } from "./chunk-H4F245VJ.js";
14
14
  import {
15
- COLOR_KEYS,
16
15
  LogLevel,
17
16
  LogLevelLabel,
18
- STORM_DEFAULT_DOCS,
19
- STORM_DEFAULT_HOMEPAGE,
20
- STORM_DEFAULT_LICENSING,
21
- applyDefaultConfig,
22
- correctPaths,
23
- findWorkspaceRoot,
24
17
  formatLogMessage,
25
18
  getLogLevel,
26
19
  getLogLevelLabel,
27
- getPackageJsonConfig,
28
20
  getStopwatch,
29
21
  isVerbose,
30
- joinPaths,
31
- stormWorkspaceConfigSchema,
32
22
  writeDebug,
33
23
  writeFatal,
34
24
  writeSuccess,
35
25
  writeTrace,
36
26
  writeWarning
37
- } from "./chunk-QX4UI7BX.js";
27
+ } from "./chunk-VKJOPPWJ.js";
38
28
 
39
29
  // src/build.ts
40
30
  import {
@@ -60,6 +50,133 @@ import { relative } from "path";
60
50
 
61
51
  // ../build-tools/src/utilities/copy-assets.ts
62
52
  import { CopyAssetsHandler } from "@nx/js/src/utils/assets/copy-assets-handler";
53
+
54
+ // ../config-tools/src/utilities/correct-paths.ts
55
+ var _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
56
+ function normalizeWindowsPath(input = "") {
57
+ if (!input) {
58
+ return input;
59
+ }
60
+ return input.replace(/\\/g, "/").replace(_DRIVE_LETTER_START_RE, (r) => r.toUpperCase());
61
+ }
62
+ var _UNC_REGEX = /^[/\\]{2}/;
63
+ var _IS_ABSOLUTE_RE = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/;
64
+ var _DRIVE_LETTER_RE = /^[A-Za-z]:$/;
65
+ var correctPaths = function(path2) {
66
+ if (!path2 || path2.length === 0) {
67
+ return ".";
68
+ }
69
+ path2 = normalizeWindowsPath(path2);
70
+ const isUNCPath = path2.match(_UNC_REGEX);
71
+ const isPathAbsolute = isAbsolute(path2);
72
+ const trailingSeparator = path2[path2.length - 1] === "/";
73
+ path2 = normalizeString(path2, !isPathAbsolute);
74
+ if (path2.length === 0) {
75
+ if (isPathAbsolute) {
76
+ return "/";
77
+ }
78
+ return trailingSeparator ? "./" : ".";
79
+ }
80
+ if (trailingSeparator) {
81
+ path2 += "/";
82
+ }
83
+ if (_DRIVE_LETTER_RE.test(path2)) {
84
+ path2 += "/";
85
+ }
86
+ if (isUNCPath) {
87
+ if (!isPathAbsolute) {
88
+ return `//./${path2}`;
89
+ }
90
+ return `//${path2}`;
91
+ }
92
+ return isPathAbsolute && !isAbsolute(path2) ? `/${path2}` : path2;
93
+ };
94
+ var joinPaths = function(...segments) {
95
+ let path2 = "";
96
+ for (const seg of segments) {
97
+ if (!seg) {
98
+ continue;
99
+ }
100
+ if (path2.length > 0) {
101
+ const pathTrailing = path2[path2.length - 1] === "/";
102
+ const segLeading = seg[0] === "/";
103
+ const both = pathTrailing && segLeading;
104
+ if (both) {
105
+ path2 += seg.slice(1);
106
+ } else {
107
+ path2 += pathTrailing || segLeading ? seg : `/${seg}`;
108
+ }
109
+ } else {
110
+ path2 += seg;
111
+ }
112
+ }
113
+ return correctPaths(path2);
114
+ };
115
+ function normalizeString(path2, allowAboveRoot) {
116
+ let res = "";
117
+ let lastSegmentLength = 0;
118
+ let lastSlash = -1;
119
+ let dots = 0;
120
+ let char = null;
121
+ for (let index = 0; index <= path2.length; ++index) {
122
+ if (index < path2.length) {
123
+ char = path2[index];
124
+ } else if (char === "/") {
125
+ break;
126
+ } else {
127
+ char = "/";
128
+ }
129
+ if (char === "/") {
130
+ if (lastSlash === index - 1 || dots === 1) {
131
+ } else if (dots === 2) {
132
+ if (res.length < 2 || lastSegmentLength !== 2 || res[res.length - 1] !== "." || res[res.length - 2] !== ".") {
133
+ if (res.length > 2) {
134
+ const lastSlashIndex = res.lastIndexOf("/");
135
+ if (lastSlashIndex === -1) {
136
+ res = "";
137
+ lastSegmentLength = 0;
138
+ } else {
139
+ res = res.slice(0, lastSlashIndex);
140
+ lastSegmentLength = res.length - 1 - res.lastIndexOf("/");
141
+ }
142
+ lastSlash = index;
143
+ dots = 0;
144
+ continue;
145
+ } else if (res.length > 0) {
146
+ res = "";
147
+ lastSegmentLength = 0;
148
+ lastSlash = index;
149
+ dots = 0;
150
+ continue;
151
+ }
152
+ }
153
+ if (allowAboveRoot) {
154
+ res += res.length > 0 ? "/.." : "..";
155
+ lastSegmentLength = 2;
156
+ }
157
+ } else {
158
+ if (res.length > 0) {
159
+ res += `/${path2.slice(lastSlash + 1, index)}`;
160
+ } else {
161
+ res = path2.slice(lastSlash + 1, index);
162
+ }
163
+ lastSegmentLength = index - lastSlash - 1;
164
+ }
165
+ lastSlash = index;
166
+ dots = 0;
167
+ } else if (char === "." && dots !== -1) {
168
+ ++dots;
169
+ } else {
170
+ dots = -1;
171
+ }
172
+ }
173
+ return res;
174
+ }
175
+ var isAbsolute = function(p) {
176
+ return _IS_ABSOLUTE_RE.test(p);
177
+ };
178
+
179
+ // ../build-tools/src/utilities/copy-assets.ts
63
180
  import { glob } from "glob";
64
181
  import { readFile, writeFile } from "node:fs/promises";
65
182
  var copyAssets = async (config, assets, outputPath, projectRoot, sourceRoot, generatePackageJson2 = true, includeSrc = false, banner, footer) => {
@@ -132,8 +249,104 @@ ${footer && typeof footer === "string" ? footer.startsWith("//") ? footer : `//
132
249
 
133
250
  // ../build-tools/src/utilities/generate-package-json.ts
134
251
  import { calculateProjectBuildableDependencies } from "@nx/js/src/utils/buildable-libs-utils";
252
+
253
+ // ../config-tools/src/utilities/find-up.ts
254
+ import { existsSync } from "node:fs";
255
+ import { join } from "node:path";
256
+ var MAX_PATH_SEARCH_DEPTH = 30;
257
+ var depth = 0;
258
+ function findFolderUp(startPath, endFileNames = [], endDirectoryNames = []) {
259
+ const _startPath = startPath ?? process.cwd();
260
+ if (endDirectoryNames.some(
261
+ (endDirName) => existsSync(join(_startPath, endDirName))
262
+ )) {
263
+ return _startPath;
264
+ }
265
+ if (endFileNames.some(
266
+ (endFileName) => existsSync(join(_startPath, endFileName))
267
+ )) {
268
+ return _startPath;
269
+ }
270
+ if (_startPath !== "/" && depth++ < MAX_PATH_SEARCH_DEPTH) {
271
+ const parent = join(_startPath, "..");
272
+ return findFolderUp(parent, endFileNames, endDirectoryNames);
273
+ }
274
+ return void 0;
275
+ }
276
+
277
+ // ../config-tools/src/utilities/find-workspace-root.ts
278
+ var rootFiles = [
279
+ "storm-workspace.json",
280
+ "storm-workspace.yaml",
281
+ "storm-workspace.yml",
282
+ "storm-workspace.js",
283
+ "storm-workspace.ts",
284
+ ".storm-workspace.json",
285
+ ".storm-workspace.yaml",
286
+ ".storm-workspace.yml",
287
+ ".storm-workspace.js",
288
+ ".storm-workspace.ts",
289
+ "lerna.json",
290
+ "nx.json",
291
+ "turbo.json",
292
+ "npm-workspace.json",
293
+ "yarn-workspace.json",
294
+ "pnpm-workspace.json",
295
+ "npm-workspace.yaml",
296
+ "yarn-workspace.yaml",
297
+ "pnpm-workspace.yaml",
298
+ "npm-workspace.yml",
299
+ "yarn-workspace.yml",
300
+ "pnpm-workspace.yml",
301
+ "npm-lock.json",
302
+ "yarn-lock.json",
303
+ "pnpm-lock.json",
304
+ "npm-lock.yaml",
305
+ "yarn-lock.yaml",
306
+ "pnpm-lock.yaml",
307
+ "npm-lock.yml",
308
+ "yarn-lock.yml",
309
+ "pnpm-lock.yml",
310
+ "bun.lockb"
311
+ ];
312
+ var rootDirectories = [
313
+ ".storm-workspace",
314
+ ".nx",
315
+ ".github",
316
+ ".vscode",
317
+ ".verdaccio"
318
+ ];
319
+ function findWorkspaceRootSafe(pathInsideMonorepo) {
320
+ if (process.env.STORM_WORKSPACE_ROOT || process.env.NX_WORKSPACE_ROOT_PATH) {
321
+ return correctPaths(
322
+ process.env.STORM_WORKSPACE_ROOT ?? process.env.NX_WORKSPACE_ROOT_PATH
323
+ );
324
+ }
325
+ return correctPaths(
326
+ findFolderUp(
327
+ pathInsideMonorepo ?? process.cwd(),
328
+ rootFiles,
329
+ rootDirectories
330
+ )
331
+ );
332
+ }
333
+ function findWorkspaceRoot(pathInsideMonorepo) {
334
+ const result = findWorkspaceRootSafe(pathInsideMonorepo);
335
+ if (!result) {
336
+ throw new Error(
337
+ `Cannot find workspace root upwards from known path. Files search list includes:
338
+ ${rootFiles.join(
339
+ "\n"
340
+ )}
341
+ Path: ${pathInsideMonorepo ? pathInsideMonorepo : process.cwd()}`
342
+ );
343
+ }
344
+ return result;
345
+ }
346
+
347
+ // ../build-tools/src/utilities/generate-package-json.ts
135
348
  import { Glob } from "glob";
136
- import { existsSync, readFileSync } from "node:fs";
349
+ import { existsSync as existsSync2, readFileSync } from "node:fs";
137
350
  import { readFile as readFile2 } from "node:fs/promises";
138
351
  import {
139
352
  createProjectGraphAsync,
@@ -173,7 +386,7 @@ var addPackageDependencies = async (workspaceRoot, projectRoot, projectName, pac
173
386
  projectNode.data.root,
174
387
  "package.json"
175
388
  );
176
- if (existsSync(projectPackageJsonPath)) {
389
+ if (existsSync2(projectPackageJsonPath)) {
177
390
  const projectPackageJsonContent = await readFile2(
178
391
  projectPackageJsonPath,
179
392
  "utf8"
@@ -208,7 +421,7 @@ var addPackageDependencies = async (workspaceRoot, projectRoot, projectName, pac
208
421
  projectConfigurations.projects[dep].root,
209
422
  "package.json"
210
423
  );
211
- if (existsSync(depPackageJsonPath)) {
424
+ if (existsSync2(depPackageJsonPath)) {
212
425
  const depPackageJsonContent = readFileSync(
213
426
  depPackageJsonPath,
214
427
  "utf8"
@@ -284,6 +497,389 @@ var addWorkspacePackageJsonFields = async (workspaceConfig, projectRoot, sourceR
284
497
  // ../config-tools/src/config-file/get-config-file.ts
285
498
  import { loadConfig as loadConfig2 } from "c12";
286
499
  import defu from "defu";
500
+
501
+ // ../config/src/constants.ts
502
+ var STORM_DEFAULT_DOCS = "https://docs.stormsoftware.com";
503
+ var STORM_DEFAULT_HOMEPAGE = "https://stormsoftware.com";
504
+ var STORM_DEFAULT_CONTACT = "https://stormsoftware.com/contact";
505
+ var STORM_DEFAULT_LICENSING = "https://stormsoftware.com/license";
506
+ var STORM_DEFAULT_LICENSE = "Apache-2.0";
507
+ var STORM_DEFAULT_SOCIAL_TWITTER = "StormSoftwareHQ";
508
+ var STORM_DEFAULT_SOCIAL_DISCORD = "https://discord.gg/MQ6YVzakM5";
509
+ var STORM_DEFAULT_SOCIAL_TELEGRAM = "https://t.me/storm_software";
510
+ var STORM_DEFAULT_SOCIAL_SLACK = "https://join.slack.com/t/storm-software/shared_invite/zt-2gsmk04hs-i6yhK_r6urq0dkZYAwq2pA";
511
+ var STORM_DEFAULT_SOCIAL_MEDIUM = "https://medium.com/storm-software";
512
+ var STORM_DEFAULT_SOCIAL_GITHUB = "https://github.com/storm-software";
513
+ var STORM_DEFAULT_RELEASE_FOOTER = `
514
+ 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.
515
+
516
+ Join us on [Discord](${STORM_DEFAULT_SOCIAL_DISCORD}) to chat with the team, receive release notifications, ask questions, and get involved.
517
+
518
+ 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!
519
+ `;
520
+ var STORM_DEFAULT_ERROR_CODES_FILE = "tools/errors/codes.json";
521
+
522
+ // ../config/src/schema.ts
523
+ import * as z from "zod";
524
+ var ColorSchema = z.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7);
525
+ var DarkColorSchema = ColorSchema.default("#151718").describe(
526
+ "The dark background color of the workspace"
527
+ );
528
+ var LightColorSchema = ColorSchema.default("#cbd5e1").describe(
529
+ "The light background color of the workspace"
530
+ );
531
+ var BrandColorSchema = ColorSchema.default("#1fb2a6").describe(
532
+ "The primary brand specific color of the workspace"
533
+ );
534
+ var AlternateColorSchema = ColorSchema.optional().describe(
535
+ "The alternate brand specific color of the workspace"
536
+ );
537
+ var AccentColorSchema = ColorSchema.optional().describe(
538
+ "The secondary brand specific color of the workspace"
539
+ );
540
+ var LinkColorSchema = ColorSchema.default("#3fa6ff").describe(
541
+ "The color used to display hyperlink text"
542
+ );
543
+ var HelpColorSchema = ColorSchema.default("#818cf8").describe(
544
+ "The second brand specific color of the workspace"
545
+ );
546
+ var SuccessColorSchema = ColorSchema.default("#45b27e").describe(
547
+ "The success color of the workspace"
548
+ );
549
+ var InfoColorSchema = ColorSchema.default("#38bdf8").describe(
550
+ "The informational color of the workspace"
551
+ );
552
+ var WarningColorSchema = ColorSchema.default("#f3d371").describe(
553
+ "The warning color of the workspace"
554
+ );
555
+ var DangerColorSchema = ColorSchema.default("#d8314a").describe(
556
+ "The danger color of the workspace"
557
+ );
558
+ var FatalColorSchema = ColorSchema.optional().describe(
559
+ "The fatal color of the workspace"
560
+ );
561
+ var PositiveColorSchema = ColorSchema.default("#4ade80").describe(
562
+ "The positive number color of the workspace"
563
+ );
564
+ var NegativeColorSchema = ColorSchema.default("#ef4444").describe(
565
+ "The negative number color of the workspace"
566
+ );
567
+ var GradientStopsSchema = z.array(ColorSchema).optional().describe(
568
+ "The color stops for the base gradient color pattern used in the workspace"
569
+ );
570
+ var DarkThemeColorConfigSchema = z.object({
571
+ foreground: LightColorSchema,
572
+ background: DarkColorSchema,
573
+ brand: BrandColorSchema,
574
+ alternate: AlternateColorSchema,
575
+ accent: AccentColorSchema,
576
+ link: LinkColorSchema,
577
+ help: HelpColorSchema,
578
+ success: SuccessColorSchema,
579
+ info: InfoColorSchema,
580
+ warning: WarningColorSchema,
581
+ danger: DangerColorSchema,
582
+ fatal: FatalColorSchema,
583
+ positive: PositiveColorSchema,
584
+ negative: NegativeColorSchema,
585
+ gradient: GradientStopsSchema
586
+ });
587
+ var LightThemeColorConfigSchema = z.object({
588
+ foreground: DarkColorSchema,
589
+ background: LightColorSchema,
590
+ brand: BrandColorSchema,
591
+ alternate: AlternateColorSchema,
592
+ accent: AccentColorSchema,
593
+ link: LinkColorSchema,
594
+ help: HelpColorSchema,
595
+ success: SuccessColorSchema,
596
+ info: InfoColorSchema,
597
+ warning: WarningColorSchema,
598
+ danger: DangerColorSchema,
599
+ fatal: FatalColorSchema,
600
+ positive: PositiveColorSchema,
601
+ negative: NegativeColorSchema,
602
+ gradient: GradientStopsSchema
603
+ });
604
+ var MultiThemeColorConfigSchema = z.object({
605
+ dark: DarkThemeColorConfigSchema,
606
+ light: LightThemeColorConfigSchema
607
+ });
608
+ var SingleThemeColorConfigSchema = z.object({
609
+ dark: DarkColorSchema,
610
+ light: LightColorSchema,
611
+ brand: BrandColorSchema,
612
+ alternate: AlternateColorSchema,
613
+ accent: AccentColorSchema,
614
+ link: LinkColorSchema,
615
+ help: HelpColorSchema,
616
+ success: SuccessColorSchema,
617
+ info: InfoColorSchema,
618
+ warning: WarningColorSchema,
619
+ danger: DangerColorSchema,
620
+ fatal: FatalColorSchema,
621
+ positive: PositiveColorSchema,
622
+ negative: NegativeColorSchema,
623
+ gradient: GradientStopsSchema
624
+ });
625
+ var RegistryUrlConfigSchema = z.url().optional().describe("A remote registry URL used to publish distributable packages");
626
+ var RegistryConfigSchema = z.object({
627
+ github: RegistryUrlConfigSchema,
628
+ npm: RegistryUrlConfigSchema,
629
+ cargo: RegistryUrlConfigSchema,
630
+ cyclone: RegistryUrlConfigSchema,
631
+ container: RegistryUrlConfigSchema
632
+ }).default({}).describe("A list of remote registry URLs used by Storm Software");
633
+ var ColorConfigSchema = SingleThemeColorConfigSchema.or(
634
+ MultiThemeColorConfigSchema
635
+ ).describe("Colors used for various workspace elements");
636
+ var ColorConfigMapSchema = z.record(
637
+ z.union([z.literal("base"), z.string()]),
638
+ ColorConfigSchema
639
+ );
640
+ var ExtendsItemSchema = z.string().trim().describe(
641
+ "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."
642
+ );
643
+ var ExtendsSchema = ExtendsItemSchema.or(
644
+ z.array(ExtendsItemSchema)
645
+ ).describe(
646
+ "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."
647
+ );
648
+ var WorkspaceBotConfigSchema = z.object({
649
+ name: z.string().trim().default("stormie-bot").describe(
650
+ "The workspace bot user's name (this is the bot that will be used to perform various tasks)"
651
+ ),
652
+ email: z.email().default("bot@stormsoftware.com").describe("The email of the workspace bot")
653
+ }).describe(
654
+ "The workspace's bot user's config used to automated various operations tasks"
655
+ );
656
+ var WorkspaceReleaseConfigSchema = z.object({
657
+ banner: z.string().trim().optional().describe(
658
+ "A URL to a banner image used to display the workspace's release"
659
+ ),
660
+ header: z.string().trim().optional().describe(
661
+ "A header message appended to the start of the workspace's release notes"
662
+ ),
663
+ footer: z.string().trim().optional().describe(
664
+ "A footer message appended to the end of the workspace's release notes"
665
+ )
666
+ }).describe("The workspace's release config used during the release process");
667
+ var WorkspaceSocialsConfigSchema = z.object({
668
+ twitter: z.string().trim().default(STORM_DEFAULT_SOCIAL_TWITTER).describe("A Twitter/X account associated with the organization/project"),
669
+ discord: z.string().trim().default(STORM_DEFAULT_SOCIAL_DISCORD).describe("A Discord account associated with the organization/project"),
670
+ telegram: z.string().trim().default(STORM_DEFAULT_SOCIAL_TELEGRAM).describe("A Telegram account associated with the organization/project"),
671
+ slack: z.string().trim().default(STORM_DEFAULT_SOCIAL_SLACK).describe("A Slack account associated with the organization/project"),
672
+ medium: z.string().trim().default(STORM_DEFAULT_SOCIAL_MEDIUM).describe("A Medium account associated with the organization/project"),
673
+ github: z.string().trim().default(STORM_DEFAULT_SOCIAL_GITHUB).describe("A GitHub account associated with the organization/project")
674
+ }).describe(
675
+ "The workspace's account config used to store various social media links"
676
+ );
677
+ var WorkspaceDirectoryConfigSchema = z.object({
678
+ cache: z.string().trim().optional().describe(
679
+ "The directory used to store the environment's cached file data"
680
+ ),
681
+ data: z.string().trim().optional().describe("The directory used to store the environment's data files"),
682
+ config: z.string().trim().optional().describe(
683
+ "The directory used to store the environment's configuration files"
684
+ ),
685
+ temp: z.string().trim().optional().describe("The directory used to store the environment's temp files"),
686
+ log: z.string().trim().optional().describe("The directory used to store the environment's temp files"),
687
+ build: z.string().trim().default("dist").describe(
688
+ "The directory used to store the workspace's distributable files after a build (relative to the workspace root)"
689
+ )
690
+ }).describe(
691
+ "Various directories used by the workspace to store data, cache, and configuration files"
692
+ );
693
+ var errorConfigSchema = z.object({
694
+ codesFile: z.string().trim().default(STORM_DEFAULT_ERROR_CODES_FILE).describe("The path to the workspace's error codes JSON file"),
695
+ url: z.url().optional().describe(
696
+ "A URL to a page that looks up the workspace's error messages given a specific error code"
697
+ )
698
+ }).describe("The workspace's error config used during the error process");
699
+ var organizationConfigSchema = z.object({
700
+ name: z.string().trim().describe("The name of the organization"),
701
+ description: z.string().trim().optional().describe("A description of the organization"),
702
+ logo: z.url().optional().describe("A URL to the organization's logo image"),
703
+ icon: z.url().optional().describe("A URL to the organization's icon image"),
704
+ url: z.url().optional().describe(
705
+ "A URL to a page that provides more information about the organization"
706
+ )
707
+ }).describe("The workspace's organization details");
708
+ var stormWorkspaceConfigSchema = z.object({
709
+ $schema: z.string().trim().default(
710
+ "https://public.storm-cdn.com/schemas/storm-workspace.schema.json"
711
+ ).describe(
712
+ "The URL or file path to the JSON schema file that describes the Storm configuration file"
713
+ ),
714
+ extends: ExtendsSchema.optional(),
715
+ name: z.string().trim().toLowerCase().optional().describe(
716
+ "The name of the service/package/scope using this configuration"
717
+ ),
718
+ namespace: z.string().trim().toLowerCase().optional().describe("The namespace of the package"),
719
+ organization: organizationConfigSchema.or(z.string().trim().describe("The organization of the workspace")).optional().describe(
720
+ "The organization of the workspace. This can be a string or an object containing the organization's details"
721
+ ),
722
+ repository: z.string().trim().optional().describe("The repo URL of the workspace (i.e. GitHub)"),
723
+ license: z.string().trim().default("Apache-2.0").describe("The license type of the package"),
724
+ homepage: z.url().optional().describe("The homepage of the workspace"),
725
+ docs: z.url().optional().describe("The documentation site for the workspace"),
726
+ portal: z.url().optional().describe("The development portal site for the workspace"),
727
+ licensing: z.url().optional().describe("The licensing site for the workspace"),
728
+ contact: z.url().optional().describe("The contact site for the workspace"),
729
+ support: z.url().optional().describe(
730
+ "The support site for the workspace. If not provided, this is defaulted to the `contact` config value"
731
+ ),
732
+ branch: z.string().trim().default("main").describe("The branch of the workspace"),
733
+ preid: z.string().optional().describe("A tag specifying the version pre-release identifier"),
734
+ owner: z.string().trim().default("@storm-software/admin").describe("The owner of the package"),
735
+ bot: WorkspaceBotConfigSchema,
736
+ release: WorkspaceReleaseConfigSchema,
737
+ socials: WorkspaceSocialsConfigSchema,
738
+ error: errorConfigSchema,
739
+ mode: z.string().trim().default("production").describe("The current runtime environment mode for the package"),
740
+ workspaceRoot: z.string().trim().describe("The root directory of the workspace"),
741
+ skipCache: z.boolean().default(false).describe("Should all known types of workspace caching be skipped?"),
742
+ directories: WorkspaceDirectoryConfigSchema,
743
+ packageManager: z.enum(["npm", "yarn", "pnpm", "bun"]).default("npm").describe(
744
+ "The JavaScript/TypeScript package manager used by the repository"
745
+ ),
746
+ timezone: z.string().trim().default("America/New_York").describe("The default timezone of the workspace"),
747
+ locale: z.string().trim().default("en-US").describe("The default locale of the workspace"),
748
+ logLevel: z.enum([
749
+ "silent",
750
+ "fatal",
751
+ "error",
752
+ "warn",
753
+ "success",
754
+ "info",
755
+ "debug",
756
+ "trace",
757
+ "all"
758
+ ]).default("info").describe(
759
+ "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`)."
760
+ ),
761
+ skipConfigLogging: z.boolean().optional().describe(
762
+ "Should the logging of the current Storm Workspace configuration be skipped?"
763
+ ),
764
+ registry: RegistryConfigSchema,
765
+ configFile: z.string().trim().nullable().default(null).describe(
766
+ "The filepath of the Storm config. When this field is null, no config file was found in the current workspace."
767
+ ),
768
+ colors: ColorConfigSchema.or(ColorConfigMapSchema).describe(
769
+ "Storm theme config values used for styling various package elements"
770
+ ),
771
+ extensions: z.record(z.string(), z.any()).optional().default({}).describe("Configuration of each used extension")
772
+ }).describe(
773
+ "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."
774
+ );
775
+
776
+ // ../config/src/types.ts
777
+ var COLOR_KEYS = [
778
+ "dark",
779
+ "light",
780
+ "base",
781
+ "brand",
782
+ "alternate",
783
+ "accent",
784
+ "link",
785
+ "success",
786
+ "help",
787
+ "info",
788
+ "warning",
789
+ "danger",
790
+ "fatal",
791
+ "positive",
792
+ "negative"
793
+ ];
794
+
795
+ // ../config-tools/src/utilities/get-default-config.ts
796
+ import { existsSync as existsSync3 } from "node:fs";
797
+ import { readFile as readFile3 } from "node:fs/promises";
798
+ import { join as join2 } from "node:path";
799
+ async function getPackageJsonConfig(root) {
800
+ let license = STORM_DEFAULT_LICENSE;
801
+ let homepage = void 0;
802
+ let support = void 0;
803
+ let name = void 0;
804
+ let namespace = void 0;
805
+ let repository = void 0;
806
+ const workspaceRoot = findWorkspaceRoot(root);
807
+ if (existsSync3(join2(workspaceRoot, "package.json"))) {
808
+ const file = await readFile3(
809
+ joinPaths(workspaceRoot, "package.json"),
810
+ "utf8"
811
+ );
812
+ if (file) {
813
+ const packageJson = JSON.parse(file);
814
+ if (packageJson.name) {
815
+ name = packageJson.name;
816
+ }
817
+ if (packageJson.namespace) {
818
+ namespace = packageJson.namespace;
819
+ }
820
+ if (packageJson.repository) {
821
+ if (typeof packageJson.repository === "string") {
822
+ repository = packageJson.repository;
823
+ } else if (packageJson.repository.url) {
824
+ repository = packageJson.repository.url;
825
+ }
826
+ }
827
+ if (packageJson.license) {
828
+ license = packageJson.license;
829
+ }
830
+ if (packageJson.homepage) {
831
+ homepage = packageJson.homepage;
832
+ }
833
+ if (packageJson.bugs) {
834
+ if (typeof packageJson.bugs === "string") {
835
+ support = packageJson.bugs;
836
+ } else if (packageJson.bugs.url) {
837
+ support = packageJson.bugs.url;
838
+ }
839
+ }
840
+ }
841
+ }
842
+ return {
843
+ workspaceRoot,
844
+ name,
845
+ namespace,
846
+ repository,
847
+ license,
848
+ homepage,
849
+ support
850
+ };
851
+ }
852
+ function applyDefaultConfig(config) {
853
+ if (!config.support && config.contact) {
854
+ config.support = config.contact;
855
+ }
856
+ if (!config.contact && config.support) {
857
+ config.contact = config.support;
858
+ }
859
+ if (config.homepage) {
860
+ if (!config.docs) {
861
+ config.docs = `${config.homepage}/docs`;
862
+ }
863
+ if (!config.license) {
864
+ config.license = `${config.homepage}/license`;
865
+ }
866
+ if (!config.support) {
867
+ config.support = `${config.homepage}/support`;
868
+ }
869
+ if (!config.contact) {
870
+ config.contact = `${config.homepage}/contact`;
871
+ }
872
+ if (!config.error?.codesFile || !config?.error?.url) {
873
+ config.error ??= { codesFile: STORM_DEFAULT_ERROR_CODES_FILE };
874
+ if (config.homepage) {
875
+ config.error.url ??= `${config.homepage}/errors`;
876
+ }
877
+ }
878
+ }
879
+ return config;
880
+ }
881
+
882
+ // ../config-tools/src/config-file/get-config-file.ts
287
883
  var getConfigFileByName = async (fileName, filePath, options = {}) => {
288
884
  const workspacePath = filePath || findWorkspaceRoot(filePath);
289
885
  const configs = await Promise.all([
@@ -500,6 +1096,19 @@ var getThemeColorConfigEnv = (prefix, theme) => {
500
1096
  return process.env[`${prefix}${themeName}LIGHT_BRAND`] || process.env[`${prefix}${themeName}DARK_BRAND`] ? getMultiThemeColorConfigEnv(prefix + themeName) : getSingleThemeColorConfigEnv(prefix + themeName);
501
1097
  };
502
1098
  var getSingleThemeColorConfigEnv = (prefix) => {
1099
+ const gradient = [];
1100
+ if (process.env[`${prefix}GRADIENT_START`] && process.env[`${prefix}GRADIENT_END`]) {
1101
+ gradient.push(
1102
+ process.env[`${prefix}GRADIENT_START`],
1103
+ process.env[`${prefix}GRADIENT_END`]
1104
+ );
1105
+ } else if (process.env[`${prefix}GRADIENT_0`] || process.env[`${prefix}GRADIENT_1`]) {
1106
+ let index = process.env[`${prefix}GRADIENT_0`] ? 0 : 1;
1107
+ while (process.env[`${prefix}GRADIENT_${index}`]) {
1108
+ gradient.push(process.env[`${prefix}GRADIENT_${index}`]);
1109
+ index++;
1110
+ }
1111
+ }
503
1112
  return {
504
1113
  dark: process.env[`${prefix}DARK`],
505
1114
  light: process.env[`${prefix}LIGHT`],
@@ -514,7 +1123,8 @@ var getSingleThemeColorConfigEnv = (prefix) => {
514
1123
  danger: process.env[`${prefix}DANGER`],
515
1124
  fatal: process.env[`${prefix}FATAL`],
516
1125
  positive: process.env[`${prefix}POSITIVE`],
517
- negative: process.env[`${prefix}NEGATIVE`]
1126
+ negative: process.env[`${prefix}NEGATIVE`],
1127
+ gradient
518
1128
  };
519
1129
  };
520
1130
  var getMultiThemeColorConfigEnv = (prefix) => {
@@ -526,6 +1136,19 @@ var getMultiThemeColorConfigEnv = (prefix) => {
526
1136
  };
527
1137
  };
528
1138
  var getBaseThemeColorConfigEnv = (prefix) => {
1139
+ const gradient = [];
1140
+ if (process.env[`${prefix}GRADIENT_START`] && process.env[`${prefix}GRADIENT_END`]) {
1141
+ gradient.push(
1142
+ process.env[`${prefix}GRADIENT_START`],
1143
+ process.env[`${prefix}GRADIENT_END`]
1144
+ );
1145
+ } else if (process.env[`${prefix}GRADIENT_0`] || process.env[`${prefix}GRADIENT_1`]) {
1146
+ let index = process.env[`${prefix}GRADIENT_0`] ? 0 : 1;
1147
+ while (process.env[`${prefix}GRADIENT_${index}`]) {
1148
+ gradient.push(process.env[`${prefix}GRADIENT_${index}`]);
1149
+ index++;
1150
+ }
1151
+ }
529
1152
  return {
530
1153
  foreground: process.env[`${prefix}FOREGROUND`],
531
1154
  background: process.env[`${prefix}BACKGROUND`],
@@ -540,7 +1163,8 @@ var getBaseThemeColorConfigEnv = (prefix) => {
540
1163
  danger: process.env[`${prefix}DANGER`],
541
1164
  fatal: process.env[`${prefix}FATAL`],
542
1165
  positive: process.env[`${prefix}POSITIVE`],
543
- negative: process.env[`${prefix}NEGATIVE`]
1166
+ negative: process.env[`${prefix}NEGATIVE`],
1167
+ gradient
544
1168
  };
545
1169
  };
546
1170
 
@@ -671,11 +1295,12 @@ var setConfigEnv = (config) => {
671
1295
  process.env[`${prefix}TIMEZONE`] = config.timezone;
672
1296
  process.env.TZ = config.timezone;
673
1297
  process.env.DEFAULT_TIMEZONE = config.timezone;
1298
+ process.env.TIMEZONE = config.timezone;
674
1299
  }
675
1300
  if (config.locale) {
676
1301
  process.env[`${prefix}LOCALE`] = config.locale;
677
- process.env.LOCALE = config.locale;
678
1302
  process.env.DEFAULT_LOCALE = config.locale;
1303
+ process.env.LOCALE = config.locale;
679
1304
  process.env.LANG = config.locale ? `${config.locale.replaceAll("-", "_")}.UTF-8` : "en_US.UTF-8";
680
1305
  }
681
1306
  if (config.configFile) {
@@ -836,6 +1461,11 @@ var setSingleThemeColorConfigEnv = (prefix, config) => {
836
1461
  if (config.negative) {
837
1462
  process.env[`${prefix}NEGATIVE`] = config.negative;
838
1463
  }
1464
+ if (config.gradient) {
1465
+ for (let i = 0; i < config.gradient.length; i++) {
1466
+ process.env[`${prefix}GRADIENT_${i}`] = config.gradient[i];
1467
+ }
1468
+ }
839
1469
  };
840
1470
  var setMultiThemeColorConfigEnv = (prefix, config) => {
841
1471
  return {
@@ -886,6 +1516,11 @@ var setBaseThemeColorConfigEnv = (prefix, config) => {
886
1516
  if (config.negative) {
887
1517
  process.env[`${prefix}NEGATIVE`] = config.negative;
888
1518
  }
1519
+ if (config.gradient) {
1520
+ for (let i = 0; i < config.gradient.length; i++) {
1521
+ process.env[`${prefix}GRADIENT_${i}`] = config.gradient[i];
1522
+ }
1523
+ }
889
1524
  };
890
1525
 
891
1526
  // ../config-tools/src/create-storm-config.ts
@@ -989,8 +1624,8 @@ var getConfig = (workspaceRoot, skipLogs = false) => {
989
1624
  import { glob as glob2 } from "glob";
990
1625
 
991
1626
  // ../build-tools/src/utilities/read-nx-config.ts
992
- import { existsSync as existsSync2 } from "node:fs";
993
- import { readFile as readFile3 } from "node:fs/promises";
1627
+ import { existsSync as existsSync4 } from "node:fs";
1628
+ import { readFile as readFile4 } from "node:fs/promises";
994
1629
 
995
1630
  // ../build-tools/src/utilities/task-graph.ts
996
1631
  import {
@@ -1001,8 +1636,8 @@ import {
1001
1636
  // src/build.ts
1002
1637
  import defu3 from "defu";
1003
1638
  import { Glob as Glob2 } from "glob";
1004
- import { existsSync as existsSync3 } from "node:fs";
1005
- import { readFile as readFile4 } from "node:fs/promises";
1639
+ import { existsSync as existsSync5 } from "node:fs";
1640
+ import { readFile as readFile5 } from "node:fs/promises";
1006
1641
  import { relative as relative2 } from "node:path";
1007
1642
  import { findWorkspaceRoot as findWorkspaceRoot2 } from "nx/src/utils/find-workspace-root";
1008
1643
  import {
@@ -1035,10 +1670,10 @@ async function resolveOptions(options, config) {
1035
1670
  options.projectRoot,
1036
1671
  "project.json"
1037
1672
  );
1038
- if (!existsSync3(projectJsonPath)) {
1673
+ if (!existsSync5(projectJsonPath)) {
1039
1674
  throw new Error("Cannot find project.json configuration");
1040
1675
  }
1041
- const projectJsonContent = await readFile4(projectJsonPath, "utf8");
1676
+ const projectJsonContent = await readFile5(projectJsonPath, "utf8");
1042
1677
  const projectJson = JSON.parse(projectJsonContent);
1043
1678
  const projectName = projectJson.name;
1044
1679
  const packageJsonPath = joinPaths(
@@ -1046,10 +1681,10 @@ async function resolveOptions(options, config) {
1046
1681
  options.projectRoot,
1047
1682
  "package.json"
1048
1683
  );
1049
- if (!existsSync3(packageJsonPath)) {
1684
+ if (!existsSync5(packageJsonPath)) {
1050
1685
  throw new Error("Cannot find package.json configuration");
1051
1686
  }
1052
- const packageJsonContent = await readFile4(packageJsonPath, "utf8");
1687
+ const packageJsonContent = await readFile5(packageJsonPath, "utf8");
1053
1688
  const packageJson = JSON.parse(packageJsonContent);
1054
1689
  let tsconfig = options.tsconfig;
1055
1690
  if (!tsconfig) {
@@ -1058,14 +1693,14 @@ async function resolveOptions(options, config) {
1058
1693
  if (!tsconfig.startsWith(config.workspaceRoot)) {
1059
1694
  tsconfig = joinPaths(config.workspaceRoot, tsconfig);
1060
1695
  }
1061
- if (!existsSync3(tsconfig)) {
1696
+ if (!existsSync5(tsconfig)) {
1062
1697
  throw new Error("Cannot find tsconfig.json configuration");
1063
1698
  }
1064
1699
  let sourceRoot = projectJson.sourceRoot;
1065
1700
  if (!sourceRoot) {
1066
1701
  sourceRoot = joinPaths(options.projectRoot, "src");
1067
1702
  }
1068
- if (!existsSync3(sourceRoot)) {
1703
+ if (!existsSync5(sourceRoot)) {
1069
1704
  throw new Error("Cannot find sourceRoot directory");
1070
1705
  }
1071
1706
  const result = calculateProjectBuildableDependencies2(
@@ -1293,14 +1928,14 @@ var addPackageJsonExport = (file, type = "module", sourceRoot, projectRoot) => {
1293
1928
  };
1294
1929
  };
1295
1930
  async function generatePackageJson(options) {
1296
- if (options.generatePackageJson !== false && existsSync3(joinPaths(options.projectRoot, "package.json"))) {
1931
+ if (options.generatePackageJson !== false && existsSync5(joinPaths(options.projectRoot, "package.json"))) {
1297
1932
  writeDebug(" \u270D\uFE0F Writing package.json file", options.config);
1298
1933
  const stopwatch = getStopwatch("Write package.json file");
1299
1934
  const packageJsonPath = joinPaths(options.projectRoot, "project.json");
1300
- if (!existsSync3(packageJsonPath)) {
1935
+ if (!existsSync5(packageJsonPath)) {
1301
1936
  throw new Error("Cannot find package.json configuration");
1302
1937
  }
1303
- const packageJsonContent = await readFile4(
1938
+ const packageJsonContent = await readFile5(
1304
1939
  joinPaths(
1305
1940
  options.config.workspaceRoot,
1306
1941
  options.projectRoot,