@storm-software/config-tools 1.148.3 → 1.149.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (106) hide show
  1. package/README.md +1 -1
  2. package/dist/config-file/get-config-file.cjs +66 -22
  3. package/dist/config-file/get-config-file.js +65 -21
  4. package/dist/config-file/index.cjs +1 -27
  5. package/dist/config-file/index.js +1 -27
  6. package/dist/create-storm-config.cjs +68 -26
  7. package/dist/create-storm-config.js +67 -25
  8. package/dist/env/get-env.cjs +152 -9
  9. package/dist/env/get-env.js +151 -8
  10. package/dist/env/index.cjs +2 -20
  11. package/dist/env/index.js +2 -20
  12. package/dist/env/set-env.cjs +259 -8
  13. package/dist/env/set-env.js +258 -7
  14. package/dist/get-config.cjs +9 -25
  15. package/dist/get-config.js +9 -25
  16. package/dist/index.cjs +7 -171
  17. package/dist/index.js +7 -171
  18. package/dist/logger/chalk.cjs +30 -4
  19. package/dist/logger/chalk.js +29 -3
  20. package/dist/logger/console-icons.cjs +15 -5
  21. package/dist/logger/console-icons.js +15 -5
  22. package/dist/logger/console.cjs +126 -38
  23. package/dist/logger/console.js +112 -24
  24. package/dist/logger/create-logger.cjs +31 -16
  25. package/dist/logger/create-logger.js +30 -15
  26. package/dist/logger/format-timestamp.cjs +5 -3
  27. package/dist/logger/format-timestamp.js +5 -3
  28. package/dist/logger/get-log-level.cjs +56 -6
  29. package/dist/logger/get-log-level.js +56 -6
  30. package/dist/logger/index.cjs +7 -62
  31. package/dist/logger/index.js +7 -62
  32. package/dist/logger/is-unicode-supported.cjs +16 -4
  33. package/dist/logger/is-unicode-supported.js +15 -3
  34. package/dist/types.cjs +24 -6
  35. package/dist/types.js +22 -4
  36. package/dist/utilities/apply-workspace-tokens.cjs +55 -9
  37. package/dist/utilities/apply-workspace-tokens.js +54 -8
  38. package/dist/utilities/correct-paths.cjs +242 -33
  39. package/dist/utilities/correct-paths.js +225 -16
  40. package/dist/utilities/file-path-utils.cjs +18 -5
  41. package/dist/utilities/file-path-utils.js +17 -4
  42. package/dist/utilities/find-up.cjs +22 -4
  43. package/dist/utilities/find-up.js +21 -3
  44. package/dist/utilities/find-workspace-root.cjs +64 -7
  45. package/dist/utilities/find-workspace-root.js +63 -6
  46. package/dist/utilities/get-default-config.cjs +79 -8
  47. package/dist/utilities/get-default-config.js +79 -8
  48. package/dist/utilities/index.cjs +7 -85
  49. package/dist/utilities/index.js +7 -85
  50. package/dist/utilities/process-handler.cjs +35 -17
  51. package/dist/utilities/process-handler.js +35 -17
  52. package/dist/utilities/run.cjs +34 -6
  53. package/dist/utilities/run.js +33 -5
  54. package/package.json +1 -1
  55. package/dist/chunk-23WUCNWX.js +0 -142
  56. package/dist/chunk-2AVLCXLT.js +0 -0
  57. package/dist/chunk-2IKEUEGY.cjs +0 -94
  58. package/dist/chunk-3NWKPYIG.cjs +0 -68
  59. package/dist/chunk-4DLP6LZY.cjs +0 -65
  60. package/dist/chunk-65SWKEHV.cjs +0 -1
  61. package/dist/chunk-6OM23J4N.js +0 -65
  62. package/dist/chunk-6T3V5XJK.js +0 -180
  63. package/dist/chunk-7JBLPO7O.cjs +0 -168
  64. package/dist/chunk-7NSHGJWY.cjs +0 -12
  65. package/dist/chunk-7PV6L7I7.cjs +0 -1
  66. package/dist/chunk-BHZFTVXN.js +0 -42
  67. package/dist/chunk-C4RHWKK6.cjs +0 -142
  68. package/dist/chunk-CCO2PASC.js +0 -168
  69. package/dist/chunk-DD3HX2NX.cjs +0 -1
  70. package/dist/chunk-DD5UX56L.cjs +0 -272
  71. package/dist/chunk-FDJZUZKJ.js +0 -93
  72. package/dist/chunk-GS25DBTT.cjs +0 -93
  73. package/dist/chunk-GZFXEQPB.js +0 -94
  74. package/dist/chunk-HESFC24Z.cjs +0 -245
  75. package/dist/chunk-HI33NNPB.js +0 -68
  76. package/dist/chunk-HKZSDZZ4.cjs +0 -19
  77. package/dist/chunk-HSCCBYAV.js +0 -25
  78. package/dist/chunk-IRCFHYKZ.cjs +0 -28
  79. package/dist/chunk-IUT7Y2UY.js +0 -26
  80. package/dist/chunk-IWD6YQKX.cjs +0 -1
  81. package/dist/chunk-KNLWLA7O.cjs +0 -75
  82. package/dist/chunk-L6UNTUC4.js +0 -0
  83. package/dist/chunk-MLUBD3PU.js +0 -245
  84. package/dist/chunk-NJVL3GF4.js +0 -0
  85. package/dist/chunk-OIEEXHKO.js +0 -75
  86. package/dist/chunk-P7Q327IR.js +0 -272
  87. package/dist/chunk-POXTJ6GF.js +0 -28
  88. package/dist/chunk-PR7RQHRE.js +0 -12
  89. package/dist/chunk-Q7MMWMEN.js +0 -44
  90. package/dist/chunk-QBS3OCHH.js +0 -22
  91. package/dist/chunk-RRKB32OH.js +0 -0
  92. package/dist/chunk-RVM5N5ZI.cjs +0 -22
  93. package/dist/chunk-SLGVSUEV.cjs +0 -36
  94. package/dist/chunk-SVQE7WVB.cjs +0 -180
  95. package/dist/chunk-SWX2MJHI.cjs +0 -28
  96. package/dist/chunk-TZO4SYUO.cjs +0 -49
  97. package/dist/chunk-UZ5SHCFX.js +0 -49
  98. package/dist/chunk-WMWOH7LS.js +0 -79
  99. package/dist/chunk-XAJB3BSF.cjs +0 -25
  100. package/dist/chunk-XDBACKKN.cjs +0 -42
  101. package/dist/chunk-XIVRONKM.cjs +0 -44
  102. package/dist/chunk-XQPQRRG3.js +0 -28
  103. package/dist/chunk-XVIPFWZW.cjs +0 -79
  104. package/dist/chunk-XY2LDOQ4.cjs +0 -26
  105. package/dist/chunk-ZA4IO7YJ.js +0 -36
  106. package/dist/chunk-ZU6V7IRV.js +0 -19
@@ -1,22 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
2
-
3
- var _chunkUSNT2KNTcjs = require('./chunk-USNT2KNT.cjs');
4
-
5
- // src/logger/is-unicode-supported.ts
6
- var _process = require('process'); var _process2 = _interopRequireDefault(_process);
7
- function isUnicodeSupported() {
8
- const { env } = _process2.default;
9
- const { TERM, TERM_PROGRAM } = env;
10
- if (_process2.default.platform !== "win32") {
11
- return TERM !== "linux";
12
- }
13
- return Boolean(env.WT_SESSION) || // Windows Terminal
14
- Boolean(env.TERMINUS_SUBLIME) || // Terminus (<0.2.27)
15
- env.ConEmuTask === "{cmd::Cmder}" || // ConEmu and cmder
16
- TERM_PROGRAM === "Terminus-Sublime" || TERM_PROGRAM === "vscode" || TERM === "xterm-256color" || TERM === "alacritty" || TERM === "rxvt-unicode" || TERM === "rxvt-unicode-256color" || env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
17
- }
18
- _chunkUSNT2KNTcjs.__name.call(void 0, isUnicodeSupported, "isUnicodeSupported");
19
-
20
-
21
-
22
- exports.isUnicodeSupported = isUnicodeSupported;
@@ -1,36 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
2
-
3
- var _chunkUSNT2KNTcjs = require('./chunk-USNT2KNT.cjs');
4
-
5
- // src/logger/chalk.ts
6
- var _chalk2 = require('chalk'); var _chalk3 = _interopRequireDefault(_chalk2);
7
- var chalkDefault = {
8
- hex: /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, (_) => (message) => message, "hex"),
9
- bgHex: /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, (_) => ({
10
- whiteBright: /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, (message) => message, "whiteBright")
11
- }), "bgHex"),
12
- whiteBright: /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, (message) => message, "whiteBright"),
13
- gray: /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, (message) => message, "gray"),
14
- bold: {
15
- hex: /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, (_) => (message) => message, "hex"),
16
- bgHex: /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, (_) => ({
17
- whiteBright: /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, (message) => message, "whiteBright")
18
- }), "bgHex"),
19
- whiteBright: /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, (message) => message, "whiteBright")
20
- },
21
- dim: {
22
- hex: /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, (_) => (message) => message, "hex"),
23
- gray: /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, (message) => message, "gray")
24
- }
25
- };
26
- var getChalk = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, () => {
27
- let _chalk = _chalk3.default;
28
- if (!_optionalChain([_chalk, 'optionalAccess', _2 => _2.hex]) || !_optionalChain([_chalk, 'optionalAccess', _3 => _3.bold, 'optionalAccess', _4 => _4.hex]) || !_optionalChain([_chalk, 'optionalAccess', _5 => _5.bgHex]) || !_optionalChain([_chalk, 'optionalAccess', _6 => _6.whiteBright])) {
29
- _chalk = chalkDefault;
30
- }
31
- return _chalk;
32
- }, "getChalk");
33
-
34
-
35
-
36
- exports.getChalk = getChalk;
@@ -1,180 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }// ../config/src/constants.ts
2
- var STORM_DEFAULT_DOCS = "https://docs.stormsoftware.com";
3
- var STORM_DEFAULT_HOMEPAGE = "https://stormsoftware.com";
4
- var STORM_DEFAULT_LICENSING = "https://license.stormsoftware.com";
5
- var STORM_DEFAULT_LICENSE = "Apache-2.0";
6
-
7
- // ../config/src/schema.ts
8
- var _zod = require('zod'); var _zod2 = _interopRequireDefault(_zod);
9
- var DarkColorSchema = _zod2.default.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7).default("#1d1e22").describe("The dark background color of the workspace");
10
- var LightColorSchema = _zod2.default.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7).default("#f4f4f5").describe("The light background color of the workspace");
11
- var BrandColorSchema = _zod2.default.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7).default("#1fb2a6").describe("The primary brand specific color of the workspace");
12
- var AlternateColorSchema = _zod2.default.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7).optional().describe("The alternate brand specific color of the workspace");
13
- var AccentColorSchema = _zod2.default.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7).optional().describe("The secondary brand specific color of the workspace");
14
- var LinkColorSchema = _zod2.default.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7).optional().describe("The color used to display hyperlink text");
15
- var HelpColorSchema = _zod2.default.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7).default("#8256D0").describe("The second brand specific color of the workspace");
16
- var SuccessColorSchema = _zod2.default.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7).default("#12B66A").describe("The success color of the workspace");
17
- var InfoColorSchema = _zod2.default.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7).default("#0070E0").describe("The informational color of the workspace");
18
- var WarningColorSchema = _zod2.default.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7).default("#fcc419").describe("The warning color of the workspace");
19
- var DangerColorSchema = _zod2.default.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7).default("#D8314A").describe("The danger color of the workspace");
20
- var FatalColorSchema = _zod2.default.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7).optional().describe("The fatal color of the workspace");
21
- var PositiveColorSchema = _zod2.default.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7).default("#4ade80").describe("The positive number color of the workspace");
22
- var NegativeColorSchema = _zod2.default.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7).default("#ef4444").describe("The negative number color of the workspace");
23
- var DarkThemeColorConfigSchema = _zod2.default.object({
24
- foreground: LightColorSchema,
25
- background: DarkColorSchema,
26
- brand: BrandColorSchema,
27
- alternate: AlternateColorSchema,
28
- accent: AccentColorSchema,
29
- link: LinkColorSchema,
30
- help: HelpColorSchema,
31
- success: SuccessColorSchema,
32
- info: InfoColorSchema,
33
- warning: WarningColorSchema,
34
- danger: DangerColorSchema,
35
- fatal: FatalColorSchema,
36
- positive: PositiveColorSchema,
37
- negative: NegativeColorSchema
38
- });
39
- var LightThemeColorConfigSchema = _zod2.default.object({
40
- foreground: DarkColorSchema,
41
- background: LightColorSchema,
42
- brand: BrandColorSchema,
43
- alternate: AlternateColorSchema,
44
- accent: AccentColorSchema,
45
- link: LinkColorSchema,
46
- help: HelpColorSchema,
47
- success: SuccessColorSchema,
48
- info: InfoColorSchema,
49
- warning: WarningColorSchema,
50
- danger: DangerColorSchema,
51
- fatal: FatalColorSchema,
52
- positive: PositiveColorSchema,
53
- negative: NegativeColorSchema
54
- });
55
- var MultiThemeColorConfigSchema = _zod2.default.object({
56
- dark: DarkThemeColorConfigSchema,
57
- light: LightThemeColorConfigSchema
58
- });
59
- var SingleThemeColorConfigSchema = _zod2.default.object({
60
- dark: DarkColorSchema,
61
- light: LightColorSchema,
62
- brand: BrandColorSchema,
63
- alternate: AlternateColorSchema,
64
- accent: AccentColorSchema,
65
- link: LinkColorSchema,
66
- help: HelpColorSchema,
67
- success: SuccessColorSchema,
68
- info: InfoColorSchema,
69
- warning: WarningColorSchema,
70
- danger: DangerColorSchema,
71
- fatal: FatalColorSchema,
72
- positive: PositiveColorSchema,
73
- negative: NegativeColorSchema
74
- });
75
- var RegistryUrlConfigSchema = _zod2.default.string().trim().toLowerCase().url().optional().describe("A remote registry URL used to publish distributable packages");
76
- var RegistryConfigSchema = _zod2.default.object({
77
- github: RegistryUrlConfigSchema,
78
- npm: RegistryUrlConfigSchema,
79
- cargo: RegistryUrlConfigSchema,
80
- cyclone: RegistryUrlConfigSchema,
81
- container: RegistryUrlConfigSchema
82
- }).default({}).describe("A list of remote registry URLs used by Storm Software");
83
- var ColorConfigSchema = SingleThemeColorConfigSchema.or(MultiThemeColorConfigSchema).describe("Colors used for various workspace elements");
84
- var ColorConfigMapSchema = _zod2.default.union([
85
- _zod2.default.object({
86
- "base": ColorConfigSchema
87
- }),
88
- _zod2.default.record(_zod2.default.string(), ColorConfigSchema)
89
- ]);
90
- var ExtendsItemSchema = _zod2.default.string().trim().describe("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.");
91
- var ExtendsSchema = ExtendsItemSchema.or(_zod2.default.array(ExtendsItemSchema)).describe("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.");
92
- var WorkspaceBotConfigSchema = _zod2.default.object({
93
- name: _zod2.default.string().trim().default("Stormie-Bot").describe("The workspace bot user's name (this is the bot that will be used to perform various tasks)"),
94
- email: _zod2.default.string().trim().email().default("bot@stormsoftware.com").describe("The email of the workspace bot")
95
- }).describe("The workspace's bot user's config used to automated various operations tasks");
96
- var WorkspaceDirectoryConfigSchema = _zod2.default.object({
97
- cache: _zod2.default.string().trim().optional().describe("The directory used to store the environment's cached file data"),
98
- data: _zod2.default.string().trim().optional().describe("The directory used to store the environment's data files"),
99
- config: _zod2.default.string().trim().optional().describe("The directory used to store the environment's configuration files"),
100
- temp: _zod2.default.string().trim().optional().describe("The directory used to store the environment's temp files"),
101
- log: _zod2.default.string().trim().optional().describe("The directory used to store the environment's temp files"),
102
- build: _zod2.default.string().trim().default("dist").describe("The directory used to store the workspace's distributable files after a build (relative to the workspace root)")
103
- }).describe("Various directories used by the workspace to store data, cache, and configuration files");
104
- var StormConfigSchema = _zod2.default.object({
105
- $schema: _zod2.default.string().trim().default("https://cdn.jsdelivr.net/npm/@storm-software/config/schemas/storm-workspace.schema.json").optional().nullish().describe("The URL to the JSON schema file that describes the Storm configuration file"),
106
- extends: ExtendsSchema.optional(),
107
- name: _zod2.default.string().trim().toLowerCase().optional().describe("The name of the service/package/scope using this configuration"),
108
- namespace: _zod2.default.string().trim().toLowerCase().optional().describe("The namespace of the package"),
109
- organization: _zod2.default.string().trim().default("storm-software").describe("The organization of the workspace"),
110
- repository: _zod2.default.string().trim().optional().describe("The repo URL of the workspace (i.e. GitHub)"),
111
- license: _zod2.default.string().trim().default("Apache-2.0").describe("The license type of the package"),
112
- homepage: _zod2.default.string().trim().url().default(STORM_DEFAULT_HOMEPAGE).describe("The homepage of the workspace"),
113
- docs: _zod2.default.string().trim().url().default(STORM_DEFAULT_DOCS).describe("The base documentation site for the workspace"),
114
- licensing: _zod2.default.string().trim().url().default(STORM_DEFAULT_LICENSING).describe("The base licensing site for the workspace"),
115
- branch: _zod2.default.string().trim().default("main").describe("The branch of the workspace"),
116
- preid: _zod2.default.string().optional().describe("A tag specifying the version pre-release identifier"),
117
- owner: _zod2.default.string().trim().default("@storm-software/admin").describe("The owner of the package"),
118
- bot: WorkspaceBotConfigSchema,
119
- env: _zod2.default.enum([
120
- "development",
121
- "staging",
122
- "production"
123
- ]).default("production").describe("The current runtime environment name for the package"),
124
- workspaceRoot: _zod2.default.string().trim().default("").describe("The root directory of the workspace"),
125
- externalPackagePatterns: _zod2.default.array(_zod2.default.string()).default([]).describe("The build will use these package patterns to determine if they should be external to the bundle"),
126
- skipCache: _zod2.default.boolean().default(false).describe("Should all known types of workspace caching be skipped?"),
127
- directories: WorkspaceDirectoryConfigSchema,
128
- packageManager: _zod2.default.enum([
129
- "npm",
130
- "yarn",
131
- "pnpm",
132
- "bun"
133
- ]).default("npm").describe("The JavaScript/TypeScript package manager used by the repository"),
134
- timezone: _zod2.default.string().trim().default("America/New_York").describe("The default timezone of the workspace"),
135
- locale: _zod2.default.string().trim().default("en-US").describe("The default locale of the workspace"),
136
- logLevel: _zod2.default.enum([
137
- "silent",
138
- "fatal",
139
- "error",
140
- "warn",
141
- "success",
142
- "info",
143
- "debug",
144
- "trace",
145
- "all"
146
- ]).default("info").describe("The log level used to filter out lower priority log messages. If not provided, this is defaulted using the `environment` config value (if `environment` is set to `production` then `level` is `error`, else `level` is `debug`)."),
147
- skipConfigLogging: _zod2.default.boolean().optional().describe("Should the logging of the current Storm Workspace configuration be skipped?"),
148
- registry: RegistryConfigSchema,
149
- configFile: _zod2.default.string().trim().nullable().default(null).describe("The filepath of the Storm config. When this field is null, no config file was found in the current workspace."),
150
- colors: ColorConfigSchema.or(ColorConfigMapSchema).describe("Storm theme config values used for styling various package elements"),
151
- extensions: _zod2.default.record(_zod2.default.any()).optional().default({}).describe("Configuration of each used extension")
152
- }).describe("Storm Workspace config values used during various dev-ops processes. This type is a combination of the StormPackageConfig and StormProject types. It represents the config of the entire monorepo.");
153
-
154
- // ../config/src/types.ts
155
- var COLOR_KEYS = [
156
- "dark",
157
- "light",
158
- "base",
159
- "brand",
160
- "alternate",
161
- "accent",
162
- "link",
163
- "success",
164
- "help",
165
- "info",
166
- "warning",
167
- "danger",
168
- "fatal",
169
- "positive",
170
- "negative"
171
- ];
172
-
173
-
174
-
175
-
176
-
177
-
178
-
179
-
180
- exports.STORM_DEFAULT_DOCS = STORM_DEFAULT_DOCS; exports.STORM_DEFAULT_HOMEPAGE = STORM_DEFAULT_HOMEPAGE; exports.STORM_DEFAULT_LICENSING = STORM_DEFAULT_LICENSING; exports.STORM_DEFAULT_LICENSE = STORM_DEFAULT_LICENSE; exports.StormConfigSchema = StormConfigSchema; exports.COLOR_KEYS = COLOR_KEYS;
@@ -1,28 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
2
-
3
- var _chunkUSNT2KNTcjs = require('./chunk-USNT2KNT.cjs');
4
-
5
- // src/utilities/find-up.ts
6
- var _fs = require('fs');
7
- var _path = require('path');
8
- var MAX_PATH_SEARCH_DEPTH = 30;
9
- var depth = 0;
10
- function findFolderUp(startPath, endFileNames = [], endDirectoryNames = []) {
11
- const _startPath = _nullishCoalesce(startPath, () => ( process.cwd()));
12
- if (endDirectoryNames.some((endDirName) => _fs.existsSync.call(void 0, _path.join.call(void 0, _startPath, endDirName)))) {
13
- return _startPath;
14
- }
15
- if (endFileNames.some((endFileName) => _fs.existsSync.call(void 0, _path.join.call(void 0, _startPath, endFileName)))) {
16
- return _startPath;
17
- }
18
- if (_startPath !== "/" && depth++ < MAX_PATH_SEARCH_DEPTH) {
19
- const parent = _path.join.call(void 0, _startPath, "..");
20
- return findFolderUp(parent, endFileNames, endDirectoryNames);
21
- }
22
- return void 0;
23
- }
24
- _chunkUSNT2KNTcjs.__name.call(void 0, findFolderUp, "findFolderUp");
25
-
26
-
27
-
28
- exports.findFolderUp = findFolderUp;
@@ -1,49 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
-
3
-
4
-
5
-
6
- var _chunkC4RHWKK6cjs = require('./chunk-C4RHWKK6.cjs');
7
-
8
-
9
- var _chunkUSNT2KNTcjs = require('./chunk-USNT2KNT.cjs');
10
-
11
- // src/utilities/process-handler.ts
12
- var exitWithError = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, (config) => {
13
- _chunkC4RHWKK6cjs.writeFatal.call(void 0, "Exiting script with an error status...", config);
14
- process.exit(1);
15
- }, "exitWithError");
16
- var exitWithSuccess = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, (config) => {
17
- _chunkC4RHWKK6cjs.writeSuccess.call(void 0, "Script completed successfully. Exiting...", config);
18
- process.exit(0);
19
- }, "exitWithSuccess");
20
- var handleProcess = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, (config) => {
21
- _chunkC4RHWKK6cjs.writeTrace.call(void 0, `Using the following arguments to process the script: ${process.argv.join(", ")}`, config);
22
- process.on("unhandledRejection", (error) => {
23
- _chunkC4RHWKK6cjs.writeError.call(void 0, `An Unhandled Rejection occurred while running the program: ${error}`, config);
24
- exitWithError(config);
25
- });
26
- process.on("uncaughtException", (error) => {
27
- _chunkC4RHWKK6cjs.writeError.call(void 0, `An Uncaught Exception occurred while running the program: ${error.message}
28
- Stacktrace: ${error.stack}`, config);
29
- exitWithError(config);
30
- });
31
- process.on("SIGTERM", (signal) => {
32
- _chunkC4RHWKK6cjs.writeError.call(void 0, `The program terminated with signal code: ${signal}`, config);
33
- exitWithError(config);
34
- });
35
- process.on("SIGINT", (signal) => {
36
- _chunkC4RHWKK6cjs.writeError.call(void 0, `The program terminated with signal code: ${signal}`, config);
37
- exitWithError(config);
38
- });
39
- process.on("SIGHUP", (signal) => {
40
- _chunkC4RHWKK6cjs.writeError.call(void 0, `The program terminated with signal code: ${signal}`, config);
41
- exitWithError(config);
42
- });
43
- }, "handleProcess");
44
-
45
-
46
-
47
-
48
-
49
- exports.exitWithError = exitWithError; exports.exitWithSuccess = exitWithSuccess; exports.handleProcess = handleProcess;
@@ -1,49 +0,0 @@
1
- import {
2
- writeError,
3
- writeFatal,
4
- writeSuccess,
5
- writeTrace
6
- } from "./chunk-23WUCNWX.js";
7
- import {
8
- __name
9
- } from "./chunk-SHUYVCID.js";
10
-
11
- // src/utilities/process-handler.ts
12
- var exitWithError = /* @__PURE__ */ __name((config) => {
13
- writeFatal("Exiting script with an error status...", config);
14
- process.exit(1);
15
- }, "exitWithError");
16
- var exitWithSuccess = /* @__PURE__ */ __name((config) => {
17
- writeSuccess("Script completed successfully. Exiting...", config);
18
- process.exit(0);
19
- }, "exitWithSuccess");
20
- var handleProcess = /* @__PURE__ */ __name((config) => {
21
- writeTrace(`Using the following arguments to process the script: ${process.argv.join(", ")}`, config);
22
- process.on("unhandledRejection", (error) => {
23
- writeError(`An Unhandled Rejection occurred while running the program: ${error}`, config);
24
- exitWithError(config);
25
- });
26
- process.on("uncaughtException", (error) => {
27
- writeError(`An Uncaught Exception occurred while running the program: ${error.message}
28
- Stacktrace: ${error.stack}`, config);
29
- exitWithError(config);
30
- });
31
- process.on("SIGTERM", (signal) => {
32
- writeError(`The program terminated with signal code: ${signal}`, config);
33
- exitWithError(config);
34
- });
35
- process.on("SIGINT", (signal) => {
36
- writeError(`The program terminated with signal code: ${signal}`, config);
37
- exitWithError(config);
38
- });
39
- process.on("SIGHUP", (signal) => {
40
- writeError(`The program terminated with signal code: ${signal}`, config);
41
- exitWithError(config);
42
- });
43
- }, "handleProcess");
44
-
45
- export {
46
- exitWithError,
47
- exitWithSuccess,
48
- handleProcess
49
- };
@@ -1,79 +0,0 @@
1
- import {
2
- writeTrace
3
- } from "./chunk-23WUCNWX.js";
4
- import {
5
- findWorkspaceRoot
6
- } from "./chunk-OIEEXHKO.js";
7
- import {
8
- joinPaths
9
- } from "./chunk-MLUBD3PU.js";
10
- import {
11
- __name
12
- } from "./chunk-SHUYVCID.js";
13
-
14
- // src/config-file/get-config-file.ts
15
- import { loadConfig } from "c12";
16
- import defu from "defu";
17
- var getConfigFileByName = /* @__PURE__ */ __name(async (fileName, filePath, options = {}) => {
18
- const workspacePath = filePath || findWorkspaceRoot(filePath);
19
- const configs = await Promise.all([
20
- loadConfig({
21
- cwd: workspacePath,
22
- packageJson: true,
23
- name: fileName,
24
- envName: fileName?.toUpperCase(),
25
- jitiOptions: {
26
- debug: false,
27
- fsCache: process.env.STORM_SKIP_CACHE === "true" ? false : joinPaths(process.env.STORM_CACHE_DIR || "node_modules/.cache/storm", "jiti")
28
- },
29
- ...options
30
- }),
31
- loadConfig({
32
- cwd: workspacePath,
33
- packageJson: true,
34
- name: fileName,
35
- envName: fileName?.toUpperCase(),
36
- jitiOptions: {
37
- debug: false,
38
- fsCache: process.env.STORM_SKIP_CACHE === "true" ? false : joinPaths(process.env.STORM_CACHE_DIR || "node_modules/.cache/storm", "jiti")
39
- },
40
- configFile: fileName,
41
- ...options
42
- })
43
- ]);
44
- return defu(configs[0] ?? {}, configs[1] ?? {});
45
- }, "getConfigFileByName");
46
- var getConfigFile = /* @__PURE__ */ __name(async (filePath, additionalFileNames = []) => {
47
- const workspacePath = filePath ? filePath : findWorkspaceRoot(filePath);
48
- const result = await getConfigFileByName("storm-workspace", workspacePath);
49
- let config = result.config;
50
- const configFile = result.configFile;
51
- if (config && configFile && Object.keys(config).length > 0 && !config.skipConfigLogging) {
52
- writeTrace(`Found Storm configuration file "${configFile.includes(`${workspacePath}/`) ? configFile.replace(`${workspacePath}/`, "") : configFile}" at "${workspacePath}"`, {
53
- logLevel: "all"
54
- });
55
- }
56
- if (additionalFileNames && additionalFileNames.length > 0) {
57
- const results = await Promise.all(additionalFileNames.map((fileName) => getConfigFileByName(fileName, workspacePath)));
58
- for (const result2 of results) {
59
- if (result2?.config && result2?.configFile && Object.keys(result2.config).length > 0) {
60
- if (!config.skipConfigLogging && !result2.config.skipConfigLogging) {
61
- writeTrace(`Found alternative configuration file "${result2.configFile.includes(`${workspacePath}/`) ? result2.configFile.replace(`${workspacePath}/`, "") : result2.configFile}" at "${workspacePath}"`, {
62
- logLevel: "all"
63
- });
64
- }
65
- config = defu(result2.config ?? {}, config ?? {});
66
- }
67
- }
68
- }
69
- if (!config) {
70
- return void 0;
71
- }
72
- config.configFile = configFile;
73
- return config;
74
- }, "getConfigFile");
75
-
76
- export {
77
- getConfigFileByName,
78
- getConfigFile
79
- };
@@ -1,25 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
2
-
3
- var _chunkUSNT2KNTcjs = require('./chunk-USNT2KNT.cjs');
4
-
5
- // src/utilities/file-path-utils.ts
6
- var _path = require('path');
7
- var removeExtension = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, (filePath) => {
8
- const result = !filePath || (filePath.match(/./g) || []).length <= 1 ? "." : filePath.lastIndexOf(".") ? filePath.substring(0, filePath.lastIndexOf(".")) : filePath;
9
- if (result.startsWith("./")) {
10
- return result.substring(2);
11
- }
12
- if (result.startsWith(".") || result.startsWith("/")) {
13
- return result.substring(1);
14
- }
15
- return result;
16
- }, "removeExtension");
17
- function findFileName(filePath) {
18
- return _nullishCoalesce(_optionalChain([filePath, 'optionalAccess', _ => _.split, 'call', _2 => _2(_optionalChain([filePath, 'optionalAccess', _3 => _3.includes, 'call', _4 => _4(_path.sep)]) ? _path.sep : _optionalChain([filePath, 'optionalAccess', _5 => _5.includes, 'call', _6 => _6("/")]) ? "/" : "\\"), 'optionalAccess', _7 => _7.pop, 'call', _8 => _8()]), () => ( ""));
19
- }
20
- _chunkUSNT2KNTcjs.__name.call(void 0, findFileName, "findFileName");
21
-
22
-
23
-
24
-
25
- exports.removeExtension = removeExtension; exports.findFileName = findFileName;
@@ -1,42 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
2
-
3
- var _chunkUSNT2KNTcjs = require('./chunk-USNT2KNT.cjs');
4
-
5
- // src/utilities/run.ts
6
- var _child_process = require('child_process');
7
- var LARGE_BUFFER = 1024 * 1e6;
8
- var run = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, (config, command, cwd = _nullishCoalesce(config.workspaceRoot, () => ( process.cwd())), stdio = "inherit", env = process.env) => {
9
- return _child_process.execSync.call(void 0, command, {
10
- cwd,
11
- env: {
12
- ...process.env,
13
- ...env,
14
- CLICOLOR: "true",
15
- FORCE_COLOR: "true"
16
- },
17
- windowsHide: true,
18
- stdio,
19
- maxBuffer: LARGE_BUFFER,
20
- killSignal: "SIGTERM"
21
- });
22
- }, "run");
23
- var runAsync = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, (config, command, cwd = _nullishCoalesce(config.workspaceRoot, () => ( process.cwd())), env = process.env) => {
24
- return _child_process.exec.call(void 0, command, {
25
- cwd,
26
- env: {
27
- ...process.env,
28
- ...env,
29
- CLICOLOR: "true",
30
- FORCE_COLOR: "true"
31
- },
32
- windowsHide: true,
33
- maxBuffer: LARGE_BUFFER,
34
- killSignal: "SIGTERM"
35
- });
36
- }, "runAsync");
37
-
38
-
39
-
40
-
41
-
42
- exports.LARGE_BUFFER = LARGE_BUFFER; exports.run = run; exports.runAsync = runAsync;
@@ -1,44 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
2
-
3
-
4
- var _chunkC4RHWKK6cjs = require('./chunk-C4RHWKK6.cjs');
5
-
6
-
7
- var _chunkKNLWLA7Ocjs = require('./chunk-KNLWLA7O.cjs');
8
-
9
-
10
- var _chunkIRCFHYKZcjs = require('./chunk-IRCFHYKZ.cjs');
11
-
12
-
13
- var _chunkUSNT2KNTcjs = require('./chunk-USNT2KNT.cjs');
14
-
15
- // src/logger/create-logger.ts
16
- var _chalk = require('chalk'); var _chalk2 = _interopRequireDefault(_chalk);
17
- async function createLogger(config) {
18
- const workspaceRoot = _chunkKNLWLA7Ocjs.findWorkspaceRoot.call(void 0, );
19
- if (!workspaceRoot) {
20
- throw new Error("Cannot find workspace root");
21
- }
22
- const writeFatal = _chunkC4RHWKK6cjs.getLogFn.call(void 0, _chunkIRCFHYKZcjs.LogLevel.FATAL, config, _chalk2.default);
23
- const writeError = _chunkC4RHWKK6cjs.getLogFn.call(void 0, _chunkIRCFHYKZcjs.LogLevel.ERROR, config, _chalk2.default);
24
- const writeWarning = _chunkC4RHWKK6cjs.getLogFn.call(void 0, _chunkIRCFHYKZcjs.LogLevel.WARN, config, _chalk2.default);
25
- const writeInfo = _chunkC4RHWKK6cjs.getLogFn.call(void 0, _chunkIRCFHYKZcjs.LogLevel.INFO, config, _chalk2.default);
26
- const writeSuccess = _chunkC4RHWKK6cjs.getLogFn.call(void 0, _chunkIRCFHYKZcjs.LogLevel.SUCCESS, config, _chalk2.default);
27
- const writeDebug = _chunkC4RHWKK6cjs.getLogFn.call(void 0, _chunkIRCFHYKZcjs.LogLevel.DEBUG, config, _chalk2.default);
28
- const writeTrace = _chunkC4RHWKK6cjs.getLogFn.call(void 0, _chunkIRCFHYKZcjs.LogLevel.DEBUG, config, _chalk2.default);
29
- return {
30
- fatal: writeFatal,
31
- error: writeError,
32
- warning: writeWarning,
33
- info: writeInfo,
34
- success: writeSuccess,
35
- debug: writeDebug,
36
- trace: writeTrace,
37
- getStopwatch: _chunkC4RHWKK6cjs.getStopwatch
38
- };
39
- }
40
- _chunkUSNT2KNTcjs.__name.call(void 0, createLogger, "createLogger");
41
-
42
-
43
-
44
- exports.createLogger = createLogger;
@@ -1,28 +0,0 @@
1
- import {
2
- __name
3
- } from "./chunk-SHUYVCID.js";
4
-
5
- // src/utilities/find-up.ts
6
- import { existsSync } from "node:fs";
7
- import { join } from "node:path";
8
- var MAX_PATH_SEARCH_DEPTH = 30;
9
- var depth = 0;
10
- function findFolderUp(startPath, endFileNames = [], endDirectoryNames = []) {
11
- const _startPath = startPath ?? process.cwd();
12
- if (endDirectoryNames.some((endDirName) => existsSync(join(_startPath, endDirName)))) {
13
- return _startPath;
14
- }
15
- if (endFileNames.some((endFileName) => existsSync(join(_startPath, endFileName)))) {
16
- return _startPath;
17
- }
18
- if (_startPath !== "/" && depth++ < MAX_PATH_SEARCH_DEPTH) {
19
- const parent = join(_startPath, "..");
20
- return findFolderUp(parent, endFileNames, endDirectoryNames);
21
- }
22
- return void 0;
23
- }
24
- __name(findFolderUp, "findFolderUp");
25
-
26
- export {
27
- findFolderUp
28
- };