@storm-software/projen 0.15.52 → 0.15.58
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.
- package/CHANGELOG.md +44 -0
- package/README.md +1 -1
- package/dist/{chunk-SRTKLDKB.js → chunk-BKFZ5MIF.js} +750 -664
- package/dist/{chunk-5GTHGNYB.mjs → chunk-MTYNYKCU.mjs} +747 -661
- package/dist/generators.js +2 -2
- package/dist/generators.mjs +1 -1
- package/dist/index.js +4 -4
- package/dist/index.mjs +3 -3
- package/dist/src/generators/init/generator.js +2 -2
- package/dist/src/generators/init/generator.mjs +1 -1
- package/package.json +2 -2
|
@@ -61,289 +61,297 @@ var LogLevelLabel = {
|
|
|
61
61
|
ALL: "all"
|
|
62
62
|
};
|
|
63
63
|
|
|
64
|
-
// ../config-tools/src/utilities/
|
|
64
|
+
// ../config-tools/src/utilities/colors.ts
|
|
65
65
|
_chunkRQT3Z4GIjs.init_cjs_shims.call(void 0, );
|
|
66
|
+
var DEFAULT_COLOR_CONFIG = {
|
|
67
|
+
light: {
|
|
68
|
+
background: "#fafafa",
|
|
69
|
+
foreground: "#1d1e22",
|
|
70
|
+
brand: "#1fb2a6",
|
|
71
|
+
alternate: "#db2777",
|
|
72
|
+
help: "#5C4EE5",
|
|
73
|
+
success: "#087f5b",
|
|
74
|
+
info: "#0550ae",
|
|
75
|
+
warning: "#e3b341",
|
|
76
|
+
danger: "#D8314A",
|
|
77
|
+
fatal: "#51070f",
|
|
78
|
+
link: "#3fa6ff",
|
|
79
|
+
positive: "#22c55e",
|
|
80
|
+
negative: "#dc2626",
|
|
81
|
+
gradient: ["#1fb2a6", "#db2777", "#5C4EE5"]
|
|
82
|
+
},
|
|
83
|
+
dark: {
|
|
84
|
+
background: "#1d1e22",
|
|
85
|
+
foreground: "#cbd5e1",
|
|
86
|
+
brand: "#2dd4bf",
|
|
87
|
+
alternate: "#db2777",
|
|
88
|
+
help: "#818cf8",
|
|
89
|
+
success: "#10b981",
|
|
90
|
+
info: "#58a6ff",
|
|
91
|
+
warning: "#f3d371",
|
|
92
|
+
danger: "#D8314A",
|
|
93
|
+
fatal: "#a40e26",
|
|
94
|
+
link: "#3fa6ff",
|
|
95
|
+
positive: "#22c55e",
|
|
96
|
+
negative: "#dc2626",
|
|
97
|
+
gradient: ["#1fb2a6", "#db2777", "#818cf8"]
|
|
98
|
+
}
|
|
99
|
+
};
|
|
66
100
|
|
|
67
|
-
// ../config/src/
|
|
101
|
+
// ../config-tools/src/logger/chalk.ts
|
|
68
102
|
_chunkRQT3Z4GIjs.init_cjs_shims.call(void 0, );
|
|
103
|
+
var _chalk2 = require('chalk'); var _chalk3 = _interopRequireDefault(_chalk2);
|
|
104
|
+
var chalkDefault = {
|
|
105
|
+
hex: (_) => (message) => message,
|
|
106
|
+
bgHex: (_) => ({
|
|
107
|
+
whiteBright: (message) => message,
|
|
108
|
+
white: (message) => message
|
|
109
|
+
}),
|
|
110
|
+
white: (message) => message,
|
|
111
|
+
whiteBright: (message) => message,
|
|
112
|
+
gray: (message) => message,
|
|
113
|
+
bold: {
|
|
114
|
+
hex: (_) => (message) => message,
|
|
115
|
+
bgHex: (_) => ({
|
|
116
|
+
whiteBright: (message) => message,
|
|
117
|
+
white: (message) => message
|
|
118
|
+
}),
|
|
119
|
+
whiteBright: (message) => message,
|
|
120
|
+
white: (message) => message
|
|
121
|
+
},
|
|
122
|
+
dim: {
|
|
123
|
+
hex: (_) => (message) => message,
|
|
124
|
+
gray: (message) => message
|
|
125
|
+
}
|
|
126
|
+
};
|
|
127
|
+
var getChalk = () => {
|
|
128
|
+
let _chalk = _chalk3.default;
|
|
129
|
+
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]) || !_optionalChain([_chalk, 'optionalAccess', _7 => _7.white])) {
|
|
130
|
+
_chalk = chalkDefault;
|
|
131
|
+
}
|
|
132
|
+
return _chalk;
|
|
133
|
+
};
|
|
69
134
|
|
|
70
|
-
// ../config/src/
|
|
135
|
+
// ../config-tools/src/logger/console-icons.ts
|
|
71
136
|
_chunkRQT3Z4GIjs.init_cjs_shims.call(void 0, );
|
|
72
|
-
var STORM_DEFAULT_DOCS = "https://docs.stormsoftware.com";
|
|
73
|
-
var STORM_DEFAULT_HOMEPAGE = "https://stormsoftware.com";
|
|
74
|
-
var STORM_DEFAULT_CONTACT = "https://stormsoftware.com/contact";
|
|
75
|
-
var STORM_DEFAULT_LICENSING = "https://stormsoftware.com/license";
|
|
76
|
-
var STORM_DEFAULT_LICENSE = "Apache-2.0";
|
|
77
|
-
var STORM_DEFAULT_SOCIAL_TWITTER = "StormSoftwareHQ";
|
|
78
|
-
var STORM_DEFAULT_SOCIAL_DISCORD = "https://discord.gg/MQ6YVzakM5";
|
|
79
|
-
var STORM_DEFAULT_SOCIAL_TELEGRAM = "https://t.me/storm_software";
|
|
80
|
-
var STORM_DEFAULT_SOCIAL_SLACK = "https://join.slack.com/t/storm-software/shared_invite/zt-2gsmk04hs-i6yhK_r6urq0dkZYAwq2pA";
|
|
81
|
-
var STORM_DEFAULT_SOCIAL_MEDIUM = "https://medium.com/storm-software";
|
|
82
|
-
var STORM_DEFAULT_SOCIAL_GITHUB = "https://github.com/storm-software";
|
|
83
|
-
var STORM_DEFAULT_RELEASE_FOOTER = `
|
|
84
|
-
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.
|
|
85
137
|
|
|
86
|
-
|
|
138
|
+
// ../config-tools/src/logger/is-unicode-supported.ts
|
|
139
|
+
_chunkRQT3Z4GIjs.init_cjs_shims.call(void 0, );
|
|
140
|
+
function isUnicodeSupported() {
|
|
141
|
+
if (process.platform !== "win32") {
|
|
142
|
+
return process.env.TERM !== "linux";
|
|
143
|
+
}
|
|
144
|
+
return Boolean(process.env.WT_SESSION) || // Windows Terminal
|
|
145
|
+
Boolean(process.env.TERMINUS_SUBLIME) || // Terminus (<0.2.27)
|
|
146
|
+
process.env.ConEmuTask === "{cmd::Cmder}" || // ConEmu and cmder
|
|
147
|
+
process.env.TERM_PROGRAM === "Terminus-Sublime" || process.env.TERM_PROGRAM === "vscode" || process.env.TERM === "xterm-256color" || process.env.TERM === "alacritty" || process.env.TERM === "rxvt-unicode" || process.env.TERM === "rxvt-unicode-256color" || process.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
|
|
148
|
+
}
|
|
87
149
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
var
|
|
150
|
+
// ../config-tools/src/logger/console-icons.ts
|
|
151
|
+
var useIcon = (c, fallback) => isUnicodeSupported() ? c : fallback;
|
|
152
|
+
var CONSOLE_ICONS = {
|
|
153
|
+
[LogLevelLabel.ERROR]: useIcon("\u2718", "\xD7"),
|
|
154
|
+
[LogLevelLabel.FATAL]: useIcon("\u{1F480}", "\xD7"),
|
|
155
|
+
[LogLevelLabel.WARN]: useIcon("\u26A0", "\u203C"),
|
|
156
|
+
[LogLevelLabel.INFO]: useIcon("\u2139", "i"),
|
|
157
|
+
[LogLevelLabel.SUCCESS]: useIcon("\u2714", "\u221A"),
|
|
158
|
+
[LogLevelLabel.DEBUG]: useIcon("\u{1F6E0}", "D"),
|
|
159
|
+
[LogLevelLabel.TRACE]: useIcon("\u{1F6E0}", "T"),
|
|
160
|
+
[LogLevelLabel.ALL]: useIcon("\u2709", "\u2192")
|
|
161
|
+
};
|
|
91
162
|
|
|
92
|
-
// ../config/src/
|
|
163
|
+
// ../config-tools/src/logger/format-timestamp.ts
|
|
93
164
|
_chunkRQT3Z4GIjs.init_cjs_shims.call(void 0, );
|
|
165
|
+
var formatTimestamp = (date = /* @__PURE__ */ new Date()) => {
|
|
166
|
+
return `${date.toLocaleDateString()} ${date.toLocaleTimeString()}`;
|
|
167
|
+
};
|
|
94
168
|
|
|
95
|
-
// ../config/src/
|
|
169
|
+
// ../config-tools/src/logger/get-log-level.ts
|
|
96
170
|
_chunkRQT3Z4GIjs.init_cjs_shims.call(void 0, );
|
|
97
|
-
var
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
light: LightThemeColorConfigSchema
|
|
147
|
-
});
|
|
148
|
-
var SingleThemeColorConfigSchema = z.object({
|
|
149
|
-
dark: DarkColorSchema,
|
|
150
|
-
light: LightColorSchema,
|
|
151
|
-
brand: BrandColorSchema,
|
|
152
|
-
alternate: AlternateColorSchema,
|
|
153
|
-
accent: AccentColorSchema,
|
|
154
|
-
link: LinkColorSchema,
|
|
155
|
-
help: HelpColorSchema,
|
|
156
|
-
success: SuccessColorSchema,
|
|
157
|
-
info: InfoColorSchema,
|
|
158
|
-
warning: WarningColorSchema,
|
|
159
|
-
danger: DangerColorSchema,
|
|
160
|
-
fatal: FatalColorSchema,
|
|
161
|
-
positive: PositiveColorSchema,
|
|
162
|
-
negative: NegativeColorSchema
|
|
163
|
-
});
|
|
164
|
-
var RegistryUrlConfigSchema = z.url().optional().describe("A remote registry URL used to publish distributable packages");
|
|
165
|
-
var RegistryConfigSchema = z.object({
|
|
166
|
-
github: RegistryUrlConfigSchema,
|
|
167
|
-
npm: RegistryUrlConfigSchema,
|
|
168
|
-
cargo: RegistryUrlConfigSchema,
|
|
169
|
-
cyclone: RegistryUrlConfigSchema,
|
|
170
|
-
container: RegistryUrlConfigSchema
|
|
171
|
-
}).default({}).describe("A list of remote registry URLs used by Storm Software");
|
|
172
|
-
var ColorConfigSchema = SingleThemeColorConfigSchema.or(
|
|
173
|
-
MultiThemeColorConfigSchema
|
|
174
|
-
).describe("Colors used for various workspace elements");
|
|
175
|
-
var ColorConfigMapSchema = z.record(
|
|
176
|
-
z.union([z.literal("base"), z.string()]),
|
|
177
|
-
ColorConfigSchema
|
|
178
|
-
);
|
|
179
|
-
var ExtendsItemSchema = z.string().trim().describe(
|
|
180
|
-
"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."
|
|
181
|
-
);
|
|
182
|
-
var ExtendsSchema = ExtendsItemSchema.or(
|
|
183
|
-
z.array(ExtendsItemSchema)
|
|
184
|
-
).describe(
|
|
185
|
-
"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."
|
|
186
|
-
);
|
|
187
|
-
var WorkspaceBotConfigSchema = z.object({
|
|
188
|
-
name: z.string().trim().default("stormie-bot").describe(
|
|
189
|
-
"The workspace bot user's name (this is the bot that will be used to perform various tasks)"
|
|
190
|
-
),
|
|
191
|
-
email: z.email().default("bot@stormsoftware.com").describe("The email of the workspace bot")
|
|
192
|
-
}).describe(
|
|
193
|
-
"The workspace's bot user's config used to automated various operations tasks"
|
|
194
|
-
);
|
|
195
|
-
var WorkspaceReleaseConfigSchema = z.object({
|
|
196
|
-
banner: z.string().trim().optional().describe(
|
|
197
|
-
"A URL to a banner image used to display the workspace's release"
|
|
198
|
-
),
|
|
199
|
-
header: z.string().trim().optional().describe(
|
|
200
|
-
"A header message appended to the start of the workspace's release notes"
|
|
201
|
-
),
|
|
202
|
-
footer: z.string().trim().optional().describe(
|
|
203
|
-
"A footer message appended to the end of the workspace's release notes"
|
|
204
|
-
)
|
|
205
|
-
}).describe("The workspace's release config used during the release process");
|
|
206
|
-
var WorkspaceSocialsConfigSchema = z.object({
|
|
207
|
-
twitter: z.string().trim().default(STORM_DEFAULT_SOCIAL_TWITTER).describe("A Twitter/X account associated with the organization/project"),
|
|
208
|
-
discord: z.string().trim().default(STORM_DEFAULT_SOCIAL_DISCORD).describe("A Discord account associated with the organization/project"),
|
|
209
|
-
telegram: z.string().trim().default(STORM_DEFAULT_SOCIAL_TELEGRAM).describe("A Telegram account associated with the organization/project"),
|
|
210
|
-
slack: z.string().trim().default(STORM_DEFAULT_SOCIAL_SLACK).describe("A Slack account associated with the organization/project"),
|
|
211
|
-
medium: z.string().trim().default(STORM_DEFAULT_SOCIAL_MEDIUM).describe("A Medium account associated with the organization/project"),
|
|
212
|
-
github: z.string().trim().default(STORM_DEFAULT_SOCIAL_GITHUB).describe("A GitHub account associated with the organization/project")
|
|
213
|
-
}).describe(
|
|
214
|
-
"The workspace's account config used to store various social media links"
|
|
215
|
-
);
|
|
216
|
-
var WorkspaceDirectoryConfigSchema = z.object({
|
|
217
|
-
cache: z.string().trim().optional().describe(
|
|
218
|
-
"The directory used to store the environment's cached file data"
|
|
219
|
-
),
|
|
220
|
-
data: z.string().trim().optional().describe("The directory used to store the environment's data files"),
|
|
221
|
-
config: z.string().trim().optional().describe(
|
|
222
|
-
"The directory used to store the environment's configuration files"
|
|
223
|
-
),
|
|
224
|
-
temp: z.string().trim().optional().describe("The directory used to store the environment's temp files"),
|
|
225
|
-
log: z.string().trim().optional().describe("The directory used to store the environment's temp files"),
|
|
226
|
-
build: z.string().trim().default("dist").describe(
|
|
227
|
-
"The directory used to store the workspace's distributable files after a build (relative to the workspace root)"
|
|
228
|
-
)
|
|
229
|
-
}).describe(
|
|
230
|
-
"Various directories used by the workspace to store data, cache, and configuration files"
|
|
231
|
-
);
|
|
232
|
-
var errorConfigSchema = z.object({
|
|
233
|
-
codesFile: z.string().trim().default(STORM_DEFAULT_ERROR_CODES_FILE).describe("The path to the workspace's error codes JSON file"),
|
|
234
|
-
url: z.url().optional().describe(
|
|
235
|
-
"A URL to a page that looks up the workspace's error messages given a specific error code"
|
|
236
|
-
)
|
|
237
|
-
}).describe("The workspace's error config used during the error process");
|
|
238
|
-
var organizationConfigSchema = z.object({
|
|
239
|
-
name: z.string().trim().describe("The name of the organization"),
|
|
240
|
-
description: z.string().trim().optional().describe("A description of the organization"),
|
|
241
|
-
logo: z.url().optional().describe("A URL to the organization's logo image"),
|
|
242
|
-
icon: z.url().optional().describe("A URL to the organization's icon image"),
|
|
243
|
-
url: z.url().optional().describe(
|
|
244
|
-
"A URL to a page that provides more information about the organization"
|
|
245
|
-
)
|
|
246
|
-
}).describe("The workspace's organization details");
|
|
247
|
-
var stormWorkspaceConfigSchema = z.object({
|
|
248
|
-
$schema: z.string().trim().default(
|
|
249
|
-
"https://public.storm-cdn.com/schemas/storm-workspace.schema.json"
|
|
250
|
-
).describe(
|
|
251
|
-
"The URL or file path to the JSON schema file that describes the Storm configuration file"
|
|
252
|
-
),
|
|
253
|
-
extends: ExtendsSchema.optional(),
|
|
254
|
-
name: z.string().trim().toLowerCase().optional().describe(
|
|
255
|
-
"The name of the service/package/scope using this configuration"
|
|
256
|
-
),
|
|
257
|
-
namespace: z.string().trim().toLowerCase().optional().describe("The namespace of the package"),
|
|
258
|
-
organization: organizationConfigSchema.or(z.string().trim().describe("The organization of the workspace")).optional().describe(
|
|
259
|
-
"The organization of the workspace. This can be a string or an object containing the organization's details"
|
|
260
|
-
),
|
|
261
|
-
repository: z.string().trim().optional().describe("The repo URL of the workspace (i.e. GitHub)"),
|
|
262
|
-
license: z.string().trim().default("Apache-2.0").describe("The license type of the package"),
|
|
263
|
-
homepage: z.url().optional().describe("The homepage of the workspace"),
|
|
264
|
-
docs: z.url().optional().describe("The documentation site for the workspace"),
|
|
265
|
-
portal: z.url().optional().describe("The development portal site for the workspace"),
|
|
266
|
-
licensing: z.url().optional().describe("The licensing site for the workspace"),
|
|
267
|
-
contact: z.url().optional().describe("The contact site for the workspace"),
|
|
268
|
-
support: z.url().optional().describe(
|
|
269
|
-
"The support site for the workspace. If not provided, this is defaulted to the `contact` config value"
|
|
270
|
-
),
|
|
271
|
-
branch: z.string().trim().default("main").describe("The branch of the workspace"),
|
|
272
|
-
preid: z.string().optional().describe("A tag specifying the version pre-release identifier"),
|
|
273
|
-
owner: z.string().trim().default("@storm-software/admin").describe("The owner of the package"),
|
|
274
|
-
bot: WorkspaceBotConfigSchema,
|
|
275
|
-
release: WorkspaceReleaseConfigSchema,
|
|
276
|
-
socials: WorkspaceSocialsConfigSchema,
|
|
277
|
-
error: errorConfigSchema,
|
|
278
|
-
mode: z.string().trim().default("production").describe("The current runtime environment mode for the package"),
|
|
279
|
-
workspaceRoot: z.string().trim().describe("The root directory of the workspace"),
|
|
280
|
-
skipCache: z.boolean().default(false).describe("Should all known types of workspace caching be skipped?"),
|
|
281
|
-
directories: WorkspaceDirectoryConfigSchema,
|
|
282
|
-
packageManager: z.enum(["npm", "yarn", "pnpm", "bun"]).default("npm").describe(
|
|
283
|
-
"The JavaScript/TypeScript package manager used by the repository"
|
|
284
|
-
),
|
|
285
|
-
timezone: z.string().trim().default("America/New_York").describe("The default timezone of the workspace"),
|
|
286
|
-
locale: z.string().trim().default("en-US").describe("The default locale of the workspace"),
|
|
287
|
-
logLevel: z.enum([
|
|
288
|
-
"silent",
|
|
289
|
-
"fatal",
|
|
290
|
-
"error",
|
|
291
|
-
"warn",
|
|
292
|
-
"success",
|
|
293
|
-
"info",
|
|
294
|
-
"debug",
|
|
295
|
-
"trace",
|
|
296
|
-
"all"
|
|
297
|
-
]).default("info").describe(
|
|
298
|
-
"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`)."
|
|
299
|
-
),
|
|
300
|
-
skipConfigLogging: z.boolean().optional().describe(
|
|
301
|
-
"Should the logging of the current Storm Workspace configuration be skipped?"
|
|
302
|
-
),
|
|
303
|
-
registry: RegistryConfigSchema,
|
|
304
|
-
configFile: z.string().trim().nullable().default(null).describe(
|
|
305
|
-
"The filepath of the Storm config. When this field is null, no config file was found in the current workspace."
|
|
306
|
-
),
|
|
307
|
-
colors: ColorConfigSchema.or(ColorConfigMapSchema).describe(
|
|
308
|
-
"Storm theme config values used for styling various package elements"
|
|
309
|
-
),
|
|
310
|
-
extensions: z.record(z.string(), z.any()).optional().default({}).describe("Configuration of each used extension")
|
|
311
|
-
}).describe(
|
|
312
|
-
"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."
|
|
313
|
-
);
|
|
171
|
+
var getLogLevel = (label) => {
|
|
172
|
+
switch (label) {
|
|
173
|
+
case "all":
|
|
174
|
+
return LogLevel.ALL;
|
|
175
|
+
case "trace":
|
|
176
|
+
return LogLevel.TRACE;
|
|
177
|
+
case "debug":
|
|
178
|
+
return LogLevel.DEBUG;
|
|
179
|
+
case "info":
|
|
180
|
+
return LogLevel.INFO;
|
|
181
|
+
case "warn":
|
|
182
|
+
return LogLevel.WARN;
|
|
183
|
+
case "error":
|
|
184
|
+
return LogLevel.ERROR;
|
|
185
|
+
case "fatal":
|
|
186
|
+
return LogLevel.FATAL;
|
|
187
|
+
case "silent":
|
|
188
|
+
return LogLevel.SILENT;
|
|
189
|
+
default:
|
|
190
|
+
return LogLevel.INFO;
|
|
191
|
+
}
|
|
192
|
+
};
|
|
193
|
+
var getLogLevelLabel = (logLevel = LogLevel.INFO) => {
|
|
194
|
+
if (logLevel >= LogLevel.ALL) {
|
|
195
|
+
return LogLevelLabel.ALL;
|
|
196
|
+
}
|
|
197
|
+
if (logLevel >= LogLevel.TRACE) {
|
|
198
|
+
return LogLevelLabel.TRACE;
|
|
199
|
+
}
|
|
200
|
+
if (logLevel >= LogLevel.DEBUG) {
|
|
201
|
+
return LogLevelLabel.DEBUG;
|
|
202
|
+
}
|
|
203
|
+
if (logLevel >= LogLevel.INFO) {
|
|
204
|
+
return LogLevelLabel.INFO;
|
|
205
|
+
}
|
|
206
|
+
if (logLevel >= LogLevel.WARN) {
|
|
207
|
+
return LogLevelLabel.WARN;
|
|
208
|
+
}
|
|
209
|
+
if (logLevel >= LogLevel.ERROR) {
|
|
210
|
+
return LogLevelLabel.ERROR;
|
|
211
|
+
}
|
|
212
|
+
if (logLevel >= LogLevel.FATAL) {
|
|
213
|
+
return LogLevelLabel.FATAL;
|
|
214
|
+
}
|
|
215
|
+
if (logLevel <= LogLevel.SILENT) {
|
|
216
|
+
return LogLevelLabel.SILENT;
|
|
217
|
+
}
|
|
218
|
+
return LogLevelLabel.INFO;
|
|
219
|
+
};
|
|
314
220
|
|
|
315
|
-
// ../config/src/
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
"
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
"
|
|
333
|
-
|
|
221
|
+
// ../config-tools/src/logger/console.ts
|
|
222
|
+
var getLogFn = (logLevel = LogLevel.INFO, config = {}, _chalk = getChalk()) => {
|
|
223
|
+
const colors = !_optionalChain([config, 'access', _8 => _8.colors, 'optionalAccess', _9 => _9.dark]) && !_optionalChain([config, 'access', _10 => _10.colors, 'optionalAccess', _11 => _11["base"]]) && !_optionalChain([config, 'access', _12 => _12.colors, 'optionalAccess', _13 => _13["base"], 'optionalAccess', _14 => _14.dark]) ? DEFAULT_COLOR_CONFIG : _optionalChain([config, 'access', _15 => _15.colors, 'optionalAccess', _16 => _16.dark]) && typeof config.colors.dark === "string" ? config.colors : _optionalChain([config, 'access', _17 => _17.colors, 'optionalAccess', _18 => _18["base"], 'optionalAccess', _19 => _19.dark]) && typeof config.colors["base"].dark === "string" ? config.colors["base"].dark : _optionalChain([config, 'access', _20 => _20.colors, 'optionalAccess', _21 => _21["base"]]) ? _optionalChain([config, 'access', _22 => _22.colors, 'optionalAccess', _23 => _23["base"]]) : DEFAULT_COLOR_CONFIG;
|
|
224
|
+
const configLogLevel = config.logLevel || process.env.STORM_LOG_LEVEL || LogLevelLabel.INFO;
|
|
225
|
+
if (logLevel > getLogLevel(configLogLevel) || logLevel <= LogLevel.SILENT || getLogLevel(configLogLevel) <= LogLevel.SILENT) {
|
|
226
|
+
return (_) => {
|
|
227
|
+
};
|
|
228
|
+
}
|
|
229
|
+
if (typeof logLevel === "number" && LogLevel.FATAL >= logLevel) {
|
|
230
|
+
return (message) => {
|
|
231
|
+
console.error(
|
|
232
|
+
`
|
|
233
|
+
${_chalk.gray(formatTimestamp())} ${_chalk.hex(_nullishCoalesce(colors.fatal, () => ( DEFAULT_COLOR_CONFIG.dark.fatal)))(`[${CONSOLE_ICONS[LogLevelLabel.FATAL]} Fatal] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
234
|
+
`
|
|
235
|
+
);
|
|
236
|
+
};
|
|
237
|
+
}
|
|
238
|
+
if (typeof logLevel === "number" && LogLevel.ERROR >= logLevel) {
|
|
239
|
+
return (message) => {
|
|
240
|
+
console.error(
|
|
241
|
+
`
|
|
242
|
+
${_chalk.gray(formatTimestamp())} ${_chalk.hex(_nullishCoalesce(colors.danger, () => ( DEFAULT_COLOR_CONFIG.dark.danger)))(`[${CONSOLE_ICONS[LogLevelLabel.ERROR]} Error] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
243
|
+
`
|
|
244
|
+
);
|
|
245
|
+
};
|
|
246
|
+
}
|
|
247
|
+
if (typeof logLevel === "number" && LogLevel.WARN >= logLevel) {
|
|
248
|
+
return (message) => {
|
|
249
|
+
console.warn(
|
|
250
|
+
`
|
|
251
|
+
${_chalk.gray(formatTimestamp())} ${_chalk.hex(_nullishCoalesce(colors.warning, () => ( DEFAULT_COLOR_CONFIG.dark.warning)))(`[${CONSOLE_ICONS[LogLevelLabel.WARN]} Warn] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
252
|
+
`
|
|
253
|
+
);
|
|
254
|
+
};
|
|
255
|
+
}
|
|
256
|
+
if (typeof logLevel === "number" && LogLevel.SUCCESS >= logLevel) {
|
|
257
|
+
return (message) => {
|
|
258
|
+
console.info(
|
|
259
|
+
`
|
|
260
|
+
${_chalk.gray(formatTimestamp())} ${_chalk.hex(_nullishCoalesce(colors.success, () => ( DEFAULT_COLOR_CONFIG.dark.success)))(`[${CONSOLE_ICONS[LogLevelLabel.SUCCESS]} Success] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
261
|
+
`
|
|
262
|
+
);
|
|
263
|
+
};
|
|
264
|
+
}
|
|
265
|
+
if (typeof logLevel === "number" && LogLevel.INFO >= logLevel) {
|
|
266
|
+
return (message) => {
|
|
267
|
+
console.info(
|
|
268
|
+
`
|
|
269
|
+
${_chalk.gray(formatTimestamp())} ${_chalk.hex(_nullishCoalesce(colors.info, () => ( DEFAULT_COLOR_CONFIG.dark.info)))(`[${CONSOLE_ICONS[LogLevelLabel.INFO]} Info] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
270
|
+
`
|
|
271
|
+
);
|
|
272
|
+
};
|
|
273
|
+
}
|
|
274
|
+
if (typeof logLevel === "number" && LogLevel.DEBUG >= logLevel) {
|
|
275
|
+
return (message) => {
|
|
276
|
+
console.debug(
|
|
277
|
+
`
|
|
278
|
+
${_chalk.gray(formatTimestamp())} ${_chalk.hex(_nullishCoalesce(colors.info, () => ( DEFAULT_COLOR_CONFIG.dark.info)))(`[${CONSOLE_ICONS[LogLevelLabel.DEBUG]} Debug] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
279
|
+
`
|
|
280
|
+
);
|
|
281
|
+
};
|
|
282
|
+
}
|
|
283
|
+
if (typeof logLevel === "number" && LogLevel.TRACE >= logLevel) {
|
|
284
|
+
return (message) => {
|
|
285
|
+
console.debug(
|
|
286
|
+
`
|
|
287
|
+
${_chalk.gray(formatTimestamp())} ${_chalk.hex(_nullishCoalesce(colors.info, () => ( DEFAULT_COLOR_CONFIG.dark.info)))(`[${CONSOLE_ICONS[LogLevelLabel.TRACE]} Trace] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
288
|
+
`
|
|
289
|
+
);
|
|
290
|
+
};
|
|
291
|
+
}
|
|
292
|
+
return (message) => {
|
|
293
|
+
console.log(
|
|
294
|
+
`
|
|
295
|
+
${_chalk.gray(formatTimestamp())} ${_chalk.hex(_nullishCoalesce(colors.brand, () => ( DEFAULT_COLOR_CONFIG.dark.brand)))(`[${CONSOLE_ICONS[LogLevelLabel.ALL]} System] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
296
|
+
`
|
|
297
|
+
);
|
|
298
|
+
};
|
|
299
|
+
};
|
|
300
|
+
var writeFatal = (message, config) => getLogFn(LogLevel.FATAL, config)(message);
|
|
301
|
+
var writeError = (message, config) => getLogFn(LogLevel.ERROR, config)(message);
|
|
302
|
+
var writeWarning = (message, config) => getLogFn(LogLevel.WARN, config)(message);
|
|
303
|
+
var writeInfo = (message, config) => getLogFn(LogLevel.INFO, config)(message);
|
|
304
|
+
var writeSuccess = (message, config) => getLogFn(LogLevel.SUCCESS, config)(message);
|
|
305
|
+
var writeDebug = (message, config) => getLogFn(LogLevel.DEBUG, config)(message);
|
|
306
|
+
var writeTrace = (message, config) => getLogFn(LogLevel.TRACE, config)(message);
|
|
307
|
+
var getStopwatch = (name) => {
|
|
308
|
+
const start = process.hrtime();
|
|
309
|
+
return () => {
|
|
310
|
+
const end = process.hrtime(start);
|
|
311
|
+
console.info(
|
|
312
|
+
`
|
|
313
|
+
> \u23F1\uFE0F The${name ? ` ${name}` : ""} process took ${Math.round(
|
|
314
|
+
end[0] * 1e3 + end[1] / 1e6
|
|
315
|
+
)}ms to complete
|
|
316
|
+
`
|
|
317
|
+
);
|
|
318
|
+
};
|
|
319
|
+
};
|
|
320
|
+
var MAX_DEPTH = 4;
|
|
321
|
+
var formatLogMessage = (message, options = {}, depth2 = 0) => {
|
|
322
|
+
if (depth2 > MAX_DEPTH) {
|
|
323
|
+
return "<max depth>";
|
|
324
|
+
}
|
|
325
|
+
const prefix = _nullishCoalesce(options.prefix, () => ( "-"));
|
|
326
|
+
const skip = _nullishCoalesce(options.skip, () => ( []));
|
|
327
|
+
return typeof message === "undefined" || message === null || !message && typeof message !== "boolean" ? "<none>" : typeof message === "string" ? message : Array.isArray(message) ? `
|
|
328
|
+
${message.map((item, index) => ` ${prefix}> #${index} = ${formatLogMessage(item, { prefix: `${prefix}-`, skip }, depth2 + 1)}`).join("\n")}` : typeof message === "object" ? `
|
|
329
|
+
${Object.keys(message).filter((key) => !skip.includes(key)).map(
|
|
330
|
+
(key) => ` ${prefix}> ${key} = ${_isFunction(message[key]) ? "<function>" : typeof message[key] === "object" ? formatLogMessage(
|
|
331
|
+
message[key],
|
|
332
|
+
{ prefix: `${prefix}-`, skip },
|
|
333
|
+
depth2 + 1
|
|
334
|
+
) : message[key]}`
|
|
335
|
+
).join("\n")}` : message;
|
|
336
|
+
};
|
|
337
|
+
var _isFunction = (value) => {
|
|
338
|
+
try {
|
|
339
|
+
return value instanceof Function || typeof value === "function" || !!(_optionalChain([value, 'optionalAccess', _24 => _24.constructor]) && _optionalChain([value, 'optionalAccess', _25 => _25.call]) && _optionalChain([value, 'optionalAccess', _26 => _26.apply]));
|
|
340
|
+
} catch (e2) {
|
|
341
|
+
return false;
|
|
342
|
+
}
|
|
343
|
+
};
|
|
334
344
|
|
|
335
|
-
// ../config-tools/src/utilities/
|
|
336
|
-
|
|
337
|
-
var _promises = require('fs/promises'); var _promises2 = _interopRequireDefault(_promises);
|
|
338
|
-
var _path = require('path'); var path3 = _interopRequireWildcard(_path);
|
|
345
|
+
// ../config-tools/src/utilities/apply-workspace-tokens.ts
|
|
346
|
+
_chunkRQT3Z4GIjs.init_cjs_shims.call(void 0, );
|
|
339
347
|
|
|
340
348
|
// ../config-tools/src/utilities/find-workspace-root.ts
|
|
341
349
|
_chunkRQT3Z4GIjs.init_cjs_shims.call(void 0, );
|
|
342
350
|
|
|
343
351
|
// ../config-tools/src/utilities/find-up.ts
|
|
344
352
|
_chunkRQT3Z4GIjs.init_cjs_shims.call(void 0, );
|
|
345
|
-
|
|
346
|
-
|
|
353
|
+
var _fs = require('fs'); var _fs2 = _interopRequireDefault(_fs);
|
|
354
|
+
var _path = require('path'); var path3 = _interopRequireWildcard(_path);
|
|
347
355
|
var MAX_PATH_SEARCH_DEPTH = 30;
|
|
348
356
|
var depth = 0;
|
|
349
357
|
function findFolderUp(startPath, endFileNames = [], endDirectoryNames = []) {
|
|
@@ -435,434 +443,470 @@ Path: ${pathInsideMonorepo ? pathInsideMonorepo : process.cwd()}`
|
|
|
435
443
|
return result;
|
|
436
444
|
}
|
|
437
445
|
|
|
438
|
-
// ../config-tools/src/utilities/
|
|
439
|
-
var
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
brand: "#1fb2a6",
|
|
444
|
-
alternate: "#db2777",
|
|
445
|
-
help: "#5C4EE5",
|
|
446
|
-
success: "#087f5b",
|
|
447
|
-
info: "#0550ae",
|
|
448
|
-
warning: "#e3b341",
|
|
449
|
-
danger: "#D8314A",
|
|
450
|
-
positive: "#22c55e",
|
|
451
|
-
negative: "#dc2626"
|
|
452
|
-
},
|
|
453
|
-
dark: {
|
|
454
|
-
background: "#1d1e22",
|
|
455
|
-
foreground: "#cbd5e1",
|
|
456
|
-
brand: "#2dd4bf",
|
|
457
|
-
alternate: "#db2777",
|
|
458
|
-
help: "#818cf8",
|
|
459
|
-
success: "#10b981",
|
|
460
|
-
info: "#58a6ff",
|
|
461
|
-
warning: "#f3d371",
|
|
462
|
-
danger: "#D8314A",
|
|
463
|
-
positive: "#22c55e",
|
|
464
|
-
negative: "#dc2626"
|
|
446
|
+
// ../config-tools/src/utilities/apply-workspace-tokens.ts
|
|
447
|
+
var applyWorkspaceBaseTokens = async (option, tokenParams) => {
|
|
448
|
+
let result = option;
|
|
449
|
+
if (!result) {
|
|
450
|
+
return result;
|
|
465
451
|
}
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
if (_fs.existsSync.call(void 0, _path.join.call(void 0, workspaceRoot3, "package.json"))) {
|
|
476
|
-
const file = await _promises.readFile.call(void 0,
|
|
477
|
-
_chunkAHMWONJPjs.joinPaths.call(void 0, workspaceRoot3, "package.json"),
|
|
478
|
-
"utf8"
|
|
479
|
-
);
|
|
480
|
-
if (file) {
|
|
481
|
-
const packageJson = JSON.parse(file);
|
|
482
|
-
if (packageJson.name) {
|
|
483
|
-
name = packageJson.name;
|
|
484
|
-
}
|
|
485
|
-
if (packageJson.namespace) {
|
|
486
|
-
namespace = packageJson.namespace;
|
|
487
|
-
}
|
|
488
|
-
if (packageJson.repository) {
|
|
489
|
-
if (typeof packageJson.repository === "string") {
|
|
490
|
-
repository = packageJson.repository;
|
|
491
|
-
} else if (packageJson.repository.url) {
|
|
492
|
-
repository = packageJson.repository.url;
|
|
452
|
+
if (tokenParams) {
|
|
453
|
+
const optionKeys = Object.keys(tokenParams);
|
|
454
|
+
if (optionKeys.some((optionKey) => result.includes(`{${optionKey}}`))) {
|
|
455
|
+
for (const optionKey of optionKeys) {
|
|
456
|
+
if (result.includes(`{${optionKey}}`)) {
|
|
457
|
+
result = result.replaceAll(
|
|
458
|
+
`{${optionKey}}`,
|
|
459
|
+
_optionalChain([tokenParams, 'optionalAccess', _27 => _27[optionKey]]) || ""
|
|
460
|
+
);
|
|
493
461
|
}
|
|
494
462
|
}
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
463
|
+
}
|
|
464
|
+
}
|
|
465
|
+
if (tokenParams.config) {
|
|
466
|
+
const configKeys = Object.keys(tokenParams.config);
|
|
467
|
+
if (configKeys.some((configKey) => result.includes(`{${configKey}}`))) {
|
|
468
|
+
for (const configKey of configKeys) {
|
|
469
|
+
if (result.includes(`{${configKey}}`)) {
|
|
470
|
+
result = result.replaceAll(
|
|
471
|
+
`{${configKey}}`,
|
|
472
|
+
tokenParams.config[configKey] || ""
|
|
473
|
+
);
|
|
506
474
|
}
|
|
507
475
|
}
|
|
508
476
|
}
|
|
509
477
|
}
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
license,
|
|
516
|
-
homepage,
|
|
517
|
-
support
|
|
518
|
-
};
|
|
519
|
-
}
|
|
520
|
-
function applyDefaultConfig(config) {
|
|
521
|
-
if (!config.support && config.contact) {
|
|
522
|
-
config.support = config.contact;
|
|
478
|
+
if (result.includes("{workspaceRoot}")) {
|
|
479
|
+
result = result.replaceAll(
|
|
480
|
+
"{workspaceRoot}",
|
|
481
|
+
_nullishCoalesce(_nullishCoalesce(tokenParams.workspaceRoot, () => ( _optionalChain([tokenParams, 'access', _28 => _28.config, 'optionalAccess', _29 => _29.workspaceRoot]))), () => ( findWorkspaceRoot()))
|
|
482
|
+
);
|
|
523
483
|
}
|
|
524
|
-
|
|
525
|
-
|
|
484
|
+
return result;
|
|
485
|
+
};
|
|
486
|
+
var applyWorkspaceProjectTokens = (option, tokenParams) => {
|
|
487
|
+
return applyWorkspaceBaseTokens(option, tokenParams);
|
|
488
|
+
};
|
|
489
|
+
var applyWorkspaceTokens = async (options, tokenParams, tokenizerFn) => {
|
|
490
|
+
if (!options) {
|
|
491
|
+
return {};
|
|
526
492
|
}
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
}
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
}
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
493
|
+
const result = {};
|
|
494
|
+
for (const option of Object.keys(options)) {
|
|
495
|
+
if (typeof options[option] === "string") {
|
|
496
|
+
result[option] = await Promise.resolve(
|
|
497
|
+
tokenizerFn(options[option], tokenParams)
|
|
498
|
+
);
|
|
499
|
+
} else if (Array.isArray(options[option])) {
|
|
500
|
+
result[option] = await Promise.all(
|
|
501
|
+
options[option].map(
|
|
502
|
+
async (item) => typeof item === "string" ? await Promise.resolve(tokenizerFn(item, tokenParams)) : item
|
|
503
|
+
)
|
|
504
|
+
);
|
|
505
|
+
} else if (typeof options[option] === "object") {
|
|
506
|
+
result[option] = await applyWorkspaceTokens(
|
|
507
|
+
options[option],
|
|
508
|
+
tokenParams,
|
|
509
|
+
tokenizerFn
|
|
510
|
+
);
|
|
511
|
+
} else {
|
|
512
|
+
result[option] = options[option];
|
|
545
513
|
}
|
|
546
514
|
}
|
|
547
|
-
return
|
|
548
|
-
}
|
|
515
|
+
return result;
|
|
516
|
+
};
|
|
549
517
|
|
|
550
|
-
// ../config-tools/src/
|
|
518
|
+
// ../config-tools/src/utilities/get-default-config.ts
|
|
551
519
|
_chunkRQT3Z4GIjs.init_cjs_shims.call(void 0, );
|
|
552
|
-
var _chalk2 = require('chalk'); var _chalk3 = _interopRequireDefault(_chalk2);
|
|
553
|
-
var chalkDefault = {
|
|
554
|
-
hex: (_) => (message) => message,
|
|
555
|
-
bgHex: (_) => ({
|
|
556
|
-
whiteBright: (message) => message,
|
|
557
|
-
white: (message) => message
|
|
558
|
-
}),
|
|
559
|
-
white: (message) => message,
|
|
560
|
-
whiteBright: (message) => message,
|
|
561
|
-
gray: (message) => message,
|
|
562
|
-
bold: {
|
|
563
|
-
hex: (_) => (message) => message,
|
|
564
|
-
bgHex: (_) => ({
|
|
565
|
-
whiteBright: (message) => message,
|
|
566
|
-
white: (message) => message
|
|
567
|
-
}),
|
|
568
|
-
whiteBright: (message) => message,
|
|
569
|
-
white: (message) => message
|
|
570
|
-
},
|
|
571
|
-
dim: {
|
|
572
|
-
hex: (_) => (message) => message,
|
|
573
|
-
gray: (message) => message
|
|
574
|
-
}
|
|
575
|
-
};
|
|
576
|
-
var getChalk = () => {
|
|
577
|
-
let _chalk = _chalk3.default;
|
|
578
|
-
if (!_optionalChain([_chalk, 'optionalAccess', _6 => _6.hex]) || !_optionalChain([_chalk, 'optionalAccess', _7 => _7.bold, 'optionalAccess', _8 => _8.hex]) || !_optionalChain([_chalk, 'optionalAccess', _9 => _9.bgHex]) || !_optionalChain([_chalk, 'optionalAccess', _10 => _10.whiteBright]) || !_optionalChain([_chalk, 'optionalAccess', _11 => _11.white])) {
|
|
579
|
-
_chalk = chalkDefault;
|
|
580
|
-
}
|
|
581
|
-
return _chalk;
|
|
582
|
-
};
|
|
583
520
|
|
|
584
|
-
// ../config
|
|
521
|
+
// ../config/src/index.ts
|
|
585
522
|
_chunkRQT3Z4GIjs.init_cjs_shims.call(void 0, );
|
|
586
523
|
|
|
587
|
-
// ../config
|
|
524
|
+
// ../config/src/constants.ts
|
|
588
525
|
_chunkRQT3Z4GIjs.init_cjs_shims.call(void 0, );
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
526
|
+
var STORM_DEFAULT_DOCS = "https://docs.stormsoftware.com";
|
|
527
|
+
var STORM_DEFAULT_HOMEPAGE = "https://stormsoftware.com";
|
|
528
|
+
var STORM_DEFAULT_CONTACT = "https://stormsoftware.com/contact";
|
|
529
|
+
var STORM_DEFAULT_LICENSING = "https://stormsoftware.com/license";
|
|
530
|
+
var STORM_DEFAULT_LICENSE = "Apache-2.0";
|
|
531
|
+
var STORM_DEFAULT_SOCIAL_TWITTER = "StormSoftwareHQ";
|
|
532
|
+
var STORM_DEFAULT_SOCIAL_DISCORD = "https://discord.gg/MQ6YVzakM5";
|
|
533
|
+
var STORM_DEFAULT_SOCIAL_TELEGRAM = "https://t.me/storm_software";
|
|
534
|
+
var STORM_DEFAULT_SOCIAL_SLACK = "https://join.slack.com/t/storm-software/shared_invite/zt-2gsmk04hs-i6yhK_r6urq0dkZYAwq2pA";
|
|
535
|
+
var STORM_DEFAULT_SOCIAL_MEDIUM = "https://medium.com/storm-software";
|
|
536
|
+
var STORM_DEFAULT_SOCIAL_GITHUB = "https://github.com/storm-software";
|
|
537
|
+
var STORM_DEFAULT_RELEASE_FOOTER = `
|
|
538
|
+
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.
|
|
598
539
|
|
|
599
|
-
|
|
600
|
-
var useIcon = (c, fallback) => isUnicodeSupported() ? c : fallback;
|
|
601
|
-
var CONSOLE_ICONS = {
|
|
602
|
-
[LogLevelLabel.ERROR]: useIcon("\u2718", "\xD7"),
|
|
603
|
-
[LogLevelLabel.FATAL]: useIcon("\u{1F480}", "\xD7"),
|
|
604
|
-
[LogLevelLabel.WARN]: useIcon("\u26A0", "\u203C"),
|
|
605
|
-
[LogLevelLabel.INFO]: useIcon("\u2139", "i"),
|
|
606
|
-
[LogLevelLabel.SUCCESS]: useIcon("\u2714", "\u221A"),
|
|
607
|
-
[LogLevelLabel.DEBUG]: useIcon("\u{1F6E0}", "D"),
|
|
608
|
-
[LogLevelLabel.TRACE]: useIcon("\u{1F6E0}", "T"),
|
|
609
|
-
[LogLevelLabel.ALL]: useIcon("\u2709", "\u2192")
|
|
610
|
-
};
|
|
540
|
+
Join us on [Discord](${STORM_DEFAULT_SOCIAL_DISCORD}) to chat with the team, receive release notifications, ask questions, and get involved.
|
|
611
541
|
|
|
612
|
-
|
|
542
|
+
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!
|
|
543
|
+
`;
|
|
544
|
+
var STORM_DEFAULT_ERROR_CODES_FILE = "tools/errors/codes.json";
|
|
545
|
+
|
|
546
|
+
// ../config/src/define-config.ts
|
|
613
547
|
_chunkRQT3Z4GIjs.init_cjs_shims.call(void 0, );
|
|
614
|
-
var formatTimestamp = (date = /* @__PURE__ */ new Date()) => {
|
|
615
|
-
return `${date.toLocaleDateString()} ${date.toLocaleTimeString()}`;
|
|
616
|
-
};
|
|
617
548
|
|
|
618
|
-
// ../config
|
|
549
|
+
// ../config/src/schema.ts
|
|
619
550
|
_chunkRQT3Z4GIjs.init_cjs_shims.call(void 0, );
|
|
620
|
-
var
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
var
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
).
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
551
|
+
var _zod = require('zod'); var z = _interopRequireWildcard(_zod); var z2 = _interopRequireWildcard(_zod);
|
|
552
|
+
var ColorSchema = z.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7);
|
|
553
|
+
var DarkColorSchema = ColorSchema.default("#151718").describe(
|
|
554
|
+
"The dark background color of the workspace"
|
|
555
|
+
);
|
|
556
|
+
var LightColorSchema = ColorSchema.default("#cbd5e1").describe(
|
|
557
|
+
"The light background color of the workspace"
|
|
558
|
+
);
|
|
559
|
+
var BrandColorSchema = ColorSchema.default("#1fb2a6").describe(
|
|
560
|
+
"The primary brand specific color of the workspace"
|
|
561
|
+
);
|
|
562
|
+
var AlternateColorSchema = ColorSchema.optional().describe(
|
|
563
|
+
"The alternate brand specific color of the workspace"
|
|
564
|
+
);
|
|
565
|
+
var AccentColorSchema = ColorSchema.optional().describe(
|
|
566
|
+
"The secondary brand specific color of the workspace"
|
|
567
|
+
);
|
|
568
|
+
var LinkColorSchema = ColorSchema.default("#3fa6ff").describe(
|
|
569
|
+
"The color used to display hyperlink text"
|
|
570
|
+
);
|
|
571
|
+
var HelpColorSchema = ColorSchema.default("#818cf8").describe(
|
|
572
|
+
"The second brand specific color of the workspace"
|
|
573
|
+
);
|
|
574
|
+
var SuccessColorSchema = ColorSchema.default("#45b27e").describe(
|
|
575
|
+
"The success color of the workspace"
|
|
576
|
+
);
|
|
577
|
+
var InfoColorSchema = ColorSchema.default("#38bdf8").describe(
|
|
578
|
+
"The informational color of the workspace"
|
|
579
|
+
);
|
|
580
|
+
var WarningColorSchema = ColorSchema.default("#f3d371").describe(
|
|
581
|
+
"The warning color of the workspace"
|
|
582
|
+
);
|
|
583
|
+
var DangerColorSchema = ColorSchema.default("#d8314a").describe(
|
|
584
|
+
"The danger color of the workspace"
|
|
585
|
+
);
|
|
586
|
+
var FatalColorSchema = ColorSchema.optional().describe(
|
|
587
|
+
"The fatal color of the workspace"
|
|
588
|
+
);
|
|
589
|
+
var PositiveColorSchema = ColorSchema.default("#4ade80").describe(
|
|
590
|
+
"The positive number color of the workspace"
|
|
591
|
+
);
|
|
592
|
+
var NegativeColorSchema = ColorSchema.default("#ef4444").describe(
|
|
593
|
+
"The negative number color of the workspace"
|
|
594
|
+
);
|
|
595
|
+
var GradientStopsSchema = z.array(ColorSchema).optional().describe(
|
|
596
|
+
"The color stops for the base gradient color pattern used in the workspace"
|
|
597
|
+
);
|
|
598
|
+
var DarkThemeColorConfigSchema = z.object({
|
|
599
|
+
foreground: LightColorSchema,
|
|
600
|
+
background: DarkColorSchema,
|
|
601
|
+
brand: BrandColorSchema,
|
|
602
|
+
alternate: AlternateColorSchema,
|
|
603
|
+
accent: AccentColorSchema,
|
|
604
|
+
link: LinkColorSchema,
|
|
605
|
+
help: HelpColorSchema,
|
|
606
|
+
success: SuccessColorSchema,
|
|
607
|
+
info: InfoColorSchema,
|
|
608
|
+
warning: WarningColorSchema,
|
|
609
|
+
danger: DangerColorSchema,
|
|
610
|
+
fatal: FatalColorSchema,
|
|
611
|
+
positive: PositiveColorSchema,
|
|
612
|
+
negative: NegativeColorSchema,
|
|
613
|
+
gradient: GradientStopsSchema
|
|
614
|
+
});
|
|
615
|
+
var LightThemeColorConfigSchema = z.object({
|
|
616
|
+
foreground: DarkColorSchema,
|
|
617
|
+
background: LightColorSchema,
|
|
618
|
+
brand: BrandColorSchema,
|
|
619
|
+
alternate: AlternateColorSchema,
|
|
620
|
+
accent: AccentColorSchema,
|
|
621
|
+
link: LinkColorSchema,
|
|
622
|
+
help: HelpColorSchema,
|
|
623
|
+
success: SuccessColorSchema,
|
|
624
|
+
info: InfoColorSchema,
|
|
625
|
+
warning: WarningColorSchema,
|
|
626
|
+
danger: DangerColorSchema,
|
|
627
|
+
fatal: FatalColorSchema,
|
|
628
|
+
positive: PositiveColorSchema,
|
|
629
|
+
negative: NegativeColorSchema,
|
|
630
|
+
gradient: GradientStopsSchema
|
|
631
|
+
});
|
|
632
|
+
var MultiThemeColorConfigSchema = z.object({
|
|
633
|
+
dark: DarkThemeColorConfigSchema,
|
|
634
|
+
light: LightThemeColorConfigSchema
|
|
635
|
+
});
|
|
636
|
+
var SingleThemeColorConfigSchema = z.object({
|
|
637
|
+
dark: DarkColorSchema,
|
|
638
|
+
light: LightColorSchema,
|
|
639
|
+
brand: BrandColorSchema,
|
|
640
|
+
alternate: AlternateColorSchema,
|
|
641
|
+
accent: AccentColorSchema,
|
|
642
|
+
link: LinkColorSchema,
|
|
643
|
+
help: HelpColorSchema,
|
|
644
|
+
success: SuccessColorSchema,
|
|
645
|
+
info: InfoColorSchema,
|
|
646
|
+
warning: WarningColorSchema,
|
|
647
|
+
danger: DangerColorSchema,
|
|
648
|
+
fatal: FatalColorSchema,
|
|
649
|
+
positive: PositiveColorSchema,
|
|
650
|
+
negative: NegativeColorSchema,
|
|
651
|
+
gradient: GradientStopsSchema
|
|
652
|
+
});
|
|
653
|
+
var RegistryUrlConfigSchema = z.url().optional().describe("A remote registry URL used to publish distributable packages");
|
|
654
|
+
var RegistryConfigSchema = z.object({
|
|
655
|
+
github: RegistryUrlConfigSchema,
|
|
656
|
+
npm: RegistryUrlConfigSchema,
|
|
657
|
+
cargo: RegistryUrlConfigSchema,
|
|
658
|
+
cyclone: RegistryUrlConfigSchema,
|
|
659
|
+
container: RegistryUrlConfigSchema
|
|
660
|
+
}).default({}).describe("A list of remote registry URLs used by Storm Software");
|
|
661
|
+
var ColorConfigSchema = SingleThemeColorConfigSchema.or(
|
|
662
|
+
MultiThemeColorConfigSchema
|
|
663
|
+
).describe("Colors used for various workspace elements");
|
|
664
|
+
var ColorConfigMapSchema = z.record(
|
|
665
|
+
z.union([z.literal("base"), z.string()]),
|
|
666
|
+
ColorConfigSchema
|
|
667
|
+
);
|
|
668
|
+
var ExtendsItemSchema = z.string().trim().describe(
|
|
669
|
+
"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."
|
|
670
|
+
);
|
|
671
|
+
var ExtendsSchema = ExtendsItemSchema.or(
|
|
672
|
+
z.array(ExtendsItemSchema)
|
|
673
|
+
).describe(
|
|
674
|
+
"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."
|
|
675
|
+
);
|
|
676
|
+
var WorkspaceBotConfigSchema = z.object({
|
|
677
|
+
name: z.string().trim().default("stormie-bot").describe(
|
|
678
|
+
"The workspace bot user's name (this is the bot that will be used to perform various tasks)"
|
|
679
|
+
),
|
|
680
|
+
email: z.email().default("bot@stormsoftware.com").describe("The email of the workspace bot")
|
|
681
|
+
}).describe(
|
|
682
|
+
"The workspace's bot user's config used to automated various operations tasks"
|
|
683
|
+
);
|
|
684
|
+
var WorkspaceReleaseConfigSchema = z.object({
|
|
685
|
+
banner: z.string().trim().optional().describe(
|
|
686
|
+
"A URL to a banner image used to display the workspace's release"
|
|
687
|
+
),
|
|
688
|
+
header: z.string().trim().optional().describe(
|
|
689
|
+
"A header message appended to the start of the workspace's release notes"
|
|
690
|
+
),
|
|
691
|
+
footer: z.string().trim().optional().describe(
|
|
692
|
+
"A footer message appended to the end of the workspace's release notes"
|
|
693
|
+
)
|
|
694
|
+
}).describe("The workspace's release config used during the release process");
|
|
695
|
+
var WorkspaceSocialsConfigSchema = z.object({
|
|
696
|
+
twitter: z.string().trim().default(STORM_DEFAULT_SOCIAL_TWITTER).describe("A Twitter/X account associated with the organization/project"),
|
|
697
|
+
discord: z.string().trim().default(STORM_DEFAULT_SOCIAL_DISCORD).describe("A Discord account associated with the organization/project"),
|
|
698
|
+
telegram: z.string().trim().default(STORM_DEFAULT_SOCIAL_TELEGRAM).describe("A Telegram account associated with the organization/project"),
|
|
699
|
+
slack: z.string().trim().default(STORM_DEFAULT_SOCIAL_SLACK).describe("A Slack account associated with the organization/project"),
|
|
700
|
+
medium: z.string().trim().default(STORM_DEFAULT_SOCIAL_MEDIUM).describe("A Medium account associated with the organization/project"),
|
|
701
|
+
github: z.string().trim().default(STORM_DEFAULT_SOCIAL_GITHUB).describe("A GitHub account associated with the organization/project")
|
|
702
|
+
}).describe(
|
|
703
|
+
"The workspace's account config used to store various social media links"
|
|
704
|
+
);
|
|
705
|
+
var WorkspaceDirectoryConfigSchema = z.object({
|
|
706
|
+
cache: z.string().trim().optional().describe(
|
|
707
|
+
"The directory used to store the environment's cached file data"
|
|
708
|
+
),
|
|
709
|
+
data: z.string().trim().optional().describe("The directory used to store the environment's data files"),
|
|
710
|
+
config: z.string().trim().optional().describe(
|
|
711
|
+
"The directory used to store the environment's configuration files"
|
|
712
|
+
),
|
|
713
|
+
temp: z.string().trim().optional().describe("The directory used to store the environment's temp files"),
|
|
714
|
+
log: z.string().trim().optional().describe("The directory used to store the environment's temp files"),
|
|
715
|
+
build: z.string().trim().default("dist").describe(
|
|
716
|
+
"The directory used to store the workspace's distributable files after a build (relative to the workspace root)"
|
|
717
|
+
)
|
|
718
|
+
}).describe(
|
|
719
|
+
"Various directories used by the workspace to store data, cache, and configuration files"
|
|
720
|
+
);
|
|
721
|
+
var errorConfigSchema = z.object({
|
|
722
|
+
codesFile: z.string().trim().default(STORM_DEFAULT_ERROR_CODES_FILE).describe("The path to the workspace's error codes JSON file"),
|
|
723
|
+
url: z.url().optional().describe(
|
|
724
|
+
"A URL to a page that looks up the workspace's error messages given a specific error code"
|
|
725
|
+
)
|
|
726
|
+
}).describe("The workspace's error config used during the error process");
|
|
727
|
+
var organizationConfigSchema = z.object({
|
|
728
|
+
name: z.string().trim().describe("The name of the organization"),
|
|
729
|
+
description: z.string().trim().optional().describe("A description of the organization"),
|
|
730
|
+
logo: z.url().optional().describe("A URL to the organization's logo image"),
|
|
731
|
+
icon: z.url().optional().describe("A URL to the organization's icon image"),
|
|
732
|
+
url: z.url().optional().describe(
|
|
733
|
+
"A URL to a page that provides more information about the organization"
|
|
734
|
+
)
|
|
735
|
+
}).describe("The workspace's organization details");
|
|
736
|
+
var stormWorkspaceConfigSchema = z.object({
|
|
737
|
+
$schema: z.string().trim().default(
|
|
738
|
+
"https://public.storm-cdn.com/schemas/storm-workspace.schema.json"
|
|
739
|
+
).describe(
|
|
740
|
+
"The URL or file path to the JSON schema file that describes the Storm configuration file"
|
|
741
|
+
),
|
|
742
|
+
extends: ExtendsSchema.optional(),
|
|
743
|
+
name: z.string().trim().toLowerCase().optional().describe(
|
|
744
|
+
"The name of the service/package/scope using this configuration"
|
|
745
|
+
),
|
|
746
|
+
namespace: z.string().trim().toLowerCase().optional().describe("The namespace of the package"),
|
|
747
|
+
organization: organizationConfigSchema.or(z.string().trim().describe("The organization of the workspace")).optional().describe(
|
|
748
|
+
"The organization of the workspace. This can be a string or an object containing the organization's details"
|
|
749
|
+
),
|
|
750
|
+
repository: z.string().trim().optional().describe("The repo URL of the workspace (i.e. GitHub)"),
|
|
751
|
+
license: z.string().trim().default("Apache-2.0").describe("The license type of the package"),
|
|
752
|
+
homepage: z.url().optional().describe("The homepage of the workspace"),
|
|
753
|
+
docs: z.url().optional().describe("The documentation site for the workspace"),
|
|
754
|
+
portal: z.url().optional().describe("The development portal site for the workspace"),
|
|
755
|
+
licensing: z.url().optional().describe("The licensing site for the workspace"),
|
|
756
|
+
contact: z.url().optional().describe("The contact site for the workspace"),
|
|
757
|
+
support: z.url().optional().describe(
|
|
758
|
+
"The support site for the workspace. If not provided, this is defaulted to the `contact` config value"
|
|
759
|
+
),
|
|
760
|
+
branch: z.string().trim().default("main").describe("The branch of the workspace"),
|
|
761
|
+
preid: z.string().optional().describe("A tag specifying the version pre-release identifier"),
|
|
762
|
+
owner: z.string().trim().default("@storm-software/admin").describe("The owner of the package"),
|
|
763
|
+
bot: WorkspaceBotConfigSchema,
|
|
764
|
+
release: WorkspaceReleaseConfigSchema,
|
|
765
|
+
socials: WorkspaceSocialsConfigSchema,
|
|
766
|
+
error: errorConfigSchema,
|
|
767
|
+
mode: z.string().trim().default("production").describe("The current runtime environment mode for the package"),
|
|
768
|
+
workspaceRoot: z.string().trim().describe("The root directory of the workspace"),
|
|
769
|
+
skipCache: z.boolean().default(false).describe("Should all known types of workspace caching be skipped?"),
|
|
770
|
+
directories: WorkspaceDirectoryConfigSchema,
|
|
771
|
+
packageManager: z.enum(["npm", "yarn", "pnpm", "bun"]).default("npm").describe(
|
|
772
|
+
"The JavaScript/TypeScript package manager used by the repository"
|
|
773
|
+
),
|
|
774
|
+
timezone: z.string().trim().default("America/New_York").describe("The default timezone of the workspace"),
|
|
775
|
+
locale: z.string().trim().default("en-US").describe("The default locale of the workspace"),
|
|
776
|
+
logLevel: z.enum([
|
|
777
|
+
"silent",
|
|
778
|
+
"fatal",
|
|
779
|
+
"error",
|
|
780
|
+
"warn",
|
|
781
|
+
"success",
|
|
782
|
+
"info",
|
|
783
|
+
"debug",
|
|
784
|
+
"trace",
|
|
785
|
+
"all"
|
|
786
|
+
]).default("info").describe(
|
|
787
|
+
"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`)."
|
|
788
|
+
),
|
|
789
|
+
skipConfigLogging: z.boolean().optional().describe(
|
|
790
|
+
"Should the logging of the current Storm Workspace configuration be skipped?"
|
|
791
|
+
),
|
|
792
|
+
registry: RegistryConfigSchema,
|
|
793
|
+
configFile: z.string().trim().nullable().default(null).describe(
|
|
794
|
+
"The filepath of the Storm config. When this field is null, no config file was found in the current workspace."
|
|
795
|
+
),
|
|
796
|
+
colors: ColorConfigSchema.or(ColorConfigMapSchema).describe(
|
|
797
|
+
"Storm theme config values used for styling various package elements"
|
|
798
|
+
),
|
|
799
|
+
extensions: z.record(z.string(), z.any()).optional().default({}).describe("Configuration of each used extension")
|
|
800
|
+
}).describe(
|
|
801
|
+
"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."
|
|
802
|
+
);
|
|
793
803
|
|
|
794
|
-
// ../config
|
|
804
|
+
// ../config/src/types.ts
|
|
795
805
|
_chunkRQT3Z4GIjs.init_cjs_shims.call(void 0, );
|
|
796
|
-
var
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
806
|
+
var COLOR_KEYS = [
|
|
807
|
+
"dark",
|
|
808
|
+
"light",
|
|
809
|
+
"base",
|
|
810
|
+
"brand",
|
|
811
|
+
"alternate",
|
|
812
|
+
"accent",
|
|
813
|
+
"link",
|
|
814
|
+
"success",
|
|
815
|
+
"help",
|
|
816
|
+
"info",
|
|
817
|
+
"warning",
|
|
818
|
+
"danger",
|
|
819
|
+
"fatal",
|
|
820
|
+
"positive",
|
|
821
|
+
"negative"
|
|
822
|
+
];
|
|
823
|
+
|
|
824
|
+
// ../config-tools/src/utilities/get-default-config.ts
|
|
825
|
+
|
|
826
|
+
var _promises = require('fs/promises'); var _promises2 = _interopRequireDefault(_promises);
|
|
827
|
+
|
|
828
|
+
async function getPackageJsonConfig(root) {
|
|
829
|
+
let license = STORM_DEFAULT_LICENSE;
|
|
830
|
+
let homepage = void 0;
|
|
831
|
+
let support = void 0;
|
|
832
|
+
let name = void 0;
|
|
833
|
+
let namespace = void 0;
|
|
834
|
+
let repository = void 0;
|
|
835
|
+
const workspaceRoot3 = findWorkspaceRoot(root);
|
|
836
|
+
if (_fs.existsSync.call(void 0, _path.join.call(void 0, workspaceRoot3, "package.json"))) {
|
|
837
|
+
const file = await _promises.readFile.call(void 0,
|
|
838
|
+
_chunkAHMWONJPjs.joinPaths.call(void 0, workspaceRoot3, "package.json"),
|
|
839
|
+
"utf8"
|
|
840
|
+
);
|
|
841
|
+
if (file) {
|
|
842
|
+
const packageJson = JSON.parse(file);
|
|
843
|
+
if (packageJson.name) {
|
|
844
|
+
name = packageJson.name;
|
|
845
|
+
}
|
|
846
|
+
if (packageJson.namespace) {
|
|
847
|
+
namespace = packageJson.namespace;
|
|
848
|
+
}
|
|
849
|
+
if (packageJson.repository) {
|
|
850
|
+
if (typeof packageJson.repository === "string") {
|
|
851
|
+
repository = packageJson.repository;
|
|
852
|
+
} else if (packageJson.repository.url) {
|
|
853
|
+
repository = packageJson.repository.url;
|
|
810
854
|
}
|
|
811
855
|
}
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
856
|
+
if (packageJson.license) {
|
|
857
|
+
license = packageJson.license;
|
|
858
|
+
}
|
|
859
|
+
if (packageJson.homepage) {
|
|
860
|
+
homepage = packageJson.homepage;
|
|
861
|
+
}
|
|
862
|
+
if (packageJson.bugs) {
|
|
863
|
+
if (typeof packageJson.bugs === "string") {
|
|
864
|
+
support = packageJson.bugs;
|
|
865
|
+
} else if (packageJson.bugs.url) {
|
|
866
|
+
support = packageJson.bugs.url;
|
|
823
867
|
}
|
|
824
868
|
}
|
|
825
869
|
}
|
|
826
870
|
}
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
871
|
+
return {
|
|
872
|
+
workspaceRoot: workspaceRoot3,
|
|
873
|
+
name,
|
|
874
|
+
namespace,
|
|
875
|
+
repository,
|
|
876
|
+
license,
|
|
877
|
+
homepage,
|
|
878
|
+
support
|
|
879
|
+
};
|
|
880
|
+
}
|
|
881
|
+
function applyDefaultConfig(config) {
|
|
882
|
+
if (!config.support && config.contact) {
|
|
883
|
+
config.support = config.contact;
|
|
832
884
|
}
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
var applyWorkspaceProjectTokens = (option, tokenParams) => {
|
|
836
|
-
return applyWorkspaceBaseTokens(option, tokenParams);
|
|
837
|
-
};
|
|
838
|
-
var applyWorkspaceTokens = async (options, tokenParams, tokenizerFn) => {
|
|
839
|
-
if (!options) {
|
|
840
|
-
return {};
|
|
885
|
+
if (!config.contact && config.support) {
|
|
886
|
+
config.contact = config.support;
|
|
841
887
|
}
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
}
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
}
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
} else {
|
|
861
|
-
result[option] = options[option];
|
|
888
|
+
if (config.homepage) {
|
|
889
|
+
if (!config.docs) {
|
|
890
|
+
config.docs = `${config.homepage}/docs`;
|
|
891
|
+
}
|
|
892
|
+
if (!config.license) {
|
|
893
|
+
config.license = `${config.homepage}/license`;
|
|
894
|
+
}
|
|
895
|
+
if (!config.support) {
|
|
896
|
+
config.support = `${config.homepage}/support`;
|
|
897
|
+
}
|
|
898
|
+
if (!config.contact) {
|
|
899
|
+
config.contact = `${config.homepage}/contact`;
|
|
900
|
+
}
|
|
901
|
+
if (!_optionalChain([config, 'access', _30 => _30.error, 'optionalAccess', _31 => _31.codesFile]) || !_optionalChain([config, 'optionalAccess', _32 => _32.error, 'optionalAccess', _33 => _33.url])) {
|
|
902
|
+
config.error ??= { codesFile: STORM_DEFAULT_ERROR_CODES_FILE };
|
|
903
|
+
if (config.homepage) {
|
|
904
|
+
config.error.url ??= `${config.homepage}/errors`;
|
|
905
|
+
}
|
|
862
906
|
}
|
|
863
907
|
}
|
|
864
|
-
return
|
|
865
|
-
}
|
|
908
|
+
return config;
|
|
909
|
+
}
|
|
866
910
|
|
|
867
911
|
// ../config-tools/src/config-file/get-config-file.ts
|
|
868
912
|
var getConfigFileByName = async (fileName, filePath, options = {}) => {
|
|
@@ -1083,6 +1127,19 @@ var getThemeColorConfigEnv = (prefix, theme) => {
|
|
|
1083
1127
|
return process.env[`${prefix}${themeName}LIGHT_BRAND`] || process.env[`${prefix}${themeName}DARK_BRAND`] ? getMultiThemeColorConfigEnv(prefix + themeName) : getSingleThemeColorConfigEnv(prefix + themeName);
|
|
1084
1128
|
};
|
|
1085
1129
|
var getSingleThemeColorConfigEnv = (prefix) => {
|
|
1130
|
+
const gradient = [];
|
|
1131
|
+
if (process.env[`${prefix}GRADIENT_START`] && process.env[`${prefix}GRADIENT_END`]) {
|
|
1132
|
+
gradient.push(
|
|
1133
|
+
process.env[`${prefix}GRADIENT_START`],
|
|
1134
|
+
process.env[`${prefix}GRADIENT_END`]
|
|
1135
|
+
);
|
|
1136
|
+
} else if (process.env[`${prefix}GRADIENT_0`] || process.env[`${prefix}GRADIENT_1`]) {
|
|
1137
|
+
let index = process.env[`${prefix}GRADIENT_0`] ? 0 : 1;
|
|
1138
|
+
while (process.env[`${prefix}GRADIENT_${index}`]) {
|
|
1139
|
+
gradient.push(process.env[`${prefix}GRADIENT_${index}`]);
|
|
1140
|
+
index++;
|
|
1141
|
+
}
|
|
1142
|
+
}
|
|
1086
1143
|
return {
|
|
1087
1144
|
dark: process.env[`${prefix}DARK`],
|
|
1088
1145
|
light: process.env[`${prefix}LIGHT`],
|
|
@@ -1097,7 +1154,8 @@ var getSingleThemeColorConfigEnv = (prefix) => {
|
|
|
1097
1154
|
danger: process.env[`${prefix}DANGER`],
|
|
1098
1155
|
fatal: process.env[`${prefix}FATAL`],
|
|
1099
1156
|
positive: process.env[`${prefix}POSITIVE`],
|
|
1100
|
-
negative: process.env[`${prefix}NEGATIVE`]
|
|
1157
|
+
negative: process.env[`${prefix}NEGATIVE`],
|
|
1158
|
+
gradient
|
|
1101
1159
|
};
|
|
1102
1160
|
};
|
|
1103
1161
|
var getMultiThemeColorConfigEnv = (prefix) => {
|
|
@@ -1109,6 +1167,19 @@ var getMultiThemeColorConfigEnv = (prefix) => {
|
|
|
1109
1167
|
};
|
|
1110
1168
|
};
|
|
1111
1169
|
var getBaseThemeColorConfigEnv = (prefix) => {
|
|
1170
|
+
const gradient = [];
|
|
1171
|
+
if (process.env[`${prefix}GRADIENT_START`] && process.env[`${prefix}GRADIENT_END`]) {
|
|
1172
|
+
gradient.push(
|
|
1173
|
+
process.env[`${prefix}GRADIENT_START`],
|
|
1174
|
+
process.env[`${prefix}GRADIENT_END`]
|
|
1175
|
+
);
|
|
1176
|
+
} else if (process.env[`${prefix}GRADIENT_0`] || process.env[`${prefix}GRADIENT_1`]) {
|
|
1177
|
+
let index = process.env[`${prefix}GRADIENT_0`] ? 0 : 1;
|
|
1178
|
+
while (process.env[`${prefix}GRADIENT_${index}`]) {
|
|
1179
|
+
gradient.push(process.env[`${prefix}GRADIENT_${index}`]);
|
|
1180
|
+
index++;
|
|
1181
|
+
}
|
|
1182
|
+
}
|
|
1112
1183
|
return {
|
|
1113
1184
|
foreground: process.env[`${prefix}FOREGROUND`],
|
|
1114
1185
|
background: process.env[`${prefix}BACKGROUND`],
|
|
@@ -1123,7 +1194,8 @@ var getBaseThemeColorConfigEnv = (prefix) => {
|
|
|
1123
1194
|
danger: process.env[`${prefix}DANGER`],
|
|
1124
1195
|
fatal: process.env[`${prefix}FATAL`],
|
|
1125
1196
|
positive: process.env[`${prefix}POSITIVE`],
|
|
1126
|
-
negative: process.env[`${prefix}NEGATIVE`]
|
|
1197
|
+
negative: process.env[`${prefix}NEGATIVE`],
|
|
1198
|
+
gradient
|
|
1127
1199
|
};
|
|
1128
1200
|
};
|
|
1129
1201
|
|
|
@@ -1255,11 +1327,12 @@ var setConfigEnv = (config) => {
|
|
|
1255
1327
|
process.env[`${prefix}TIMEZONE`] = config.timezone;
|
|
1256
1328
|
process.env.TZ = config.timezone;
|
|
1257
1329
|
process.env.DEFAULT_TIMEZONE = config.timezone;
|
|
1330
|
+
process.env.TIMEZONE = config.timezone;
|
|
1258
1331
|
}
|
|
1259
1332
|
if (config.locale) {
|
|
1260
1333
|
process.env[`${prefix}LOCALE`] = config.locale;
|
|
1261
|
-
process.env.LOCALE = config.locale;
|
|
1262
1334
|
process.env.DEFAULT_LOCALE = config.locale;
|
|
1335
|
+
process.env.LOCALE = config.locale;
|
|
1263
1336
|
process.env.LANG = config.locale ? `${config.locale.replaceAll("-", "_")}.UTF-8` : "en_US.UTF-8";
|
|
1264
1337
|
}
|
|
1265
1338
|
if (config.configFile) {
|
|
@@ -1420,6 +1493,11 @@ var setSingleThemeColorConfigEnv = (prefix, config) => {
|
|
|
1420
1493
|
if (config.negative) {
|
|
1421
1494
|
process.env[`${prefix}NEGATIVE`] = config.negative;
|
|
1422
1495
|
}
|
|
1496
|
+
if (config.gradient) {
|
|
1497
|
+
for (let i = 0; i < config.gradient.length; i++) {
|
|
1498
|
+
process.env[`${prefix}GRADIENT_${i}`] = config.gradient[i];
|
|
1499
|
+
}
|
|
1500
|
+
}
|
|
1423
1501
|
};
|
|
1424
1502
|
var setMultiThemeColorConfigEnv = (prefix, config) => {
|
|
1425
1503
|
return {
|
|
@@ -1470,6 +1548,11 @@ var setBaseThemeColorConfigEnv = (prefix, config) => {
|
|
|
1470
1548
|
if (config.negative) {
|
|
1471
1549
|
process.env[`${prefix}NEGATIVE`] = config.negative;
|
|
1472
1550
|
}
|
|
1551
|
+
if (config.gradient) {
|
|
1552
|
+
for (let i = 0; i < config.gradient.length; i++) {
|
|
1553
|
+
process.env[`${prefix}GRADIENT_${i}`] = config.gradient[i];
|
|
1554
|
+
}
|
|
1555
|
+
}
|
|
1473
1556
|
};
|
|
1474
1557
|
|
|
1475
1558
|
// ../config-tools/src/create-storm-config.ts
|
|
@@ -2078,7 +2161,7 @@ var addPackageDependencies = async (workspaceRoot3, projectRoot, projectName, pa
|
|
|
2078
2161
|
let projectGraph;
|
|
2079
2162
|
try {
|
|
2080
2163
|
projectGraph = _projectgraph.readCachedProjectGraph.call(void 0, );
|
|
2081
|
-
} catch (
|
|
2164
|
+
} catch (e3) {
|
|
2082
2165
|
await _projectgraph.createProjectGraphAsync.call(void 0, );
|
|
2083
2166
|
projectGraph = _projectgraph.readCachedProjectGraph.call(void 0, );
|
|
2084
2167
|
}
|
|
@@ -2893,7 +2976,7 @@ async function sizeLimitExecutorFn(options, context, config) {
|
|
|
2893
2976
|
"The Size-Limit process failed because the context is not valid. Please run this command from a workspace."
|
|
2894
2977
|
);
|
|
2895
2978
|
}
|
|
2896
|
-
writeInfo(`\u{1F4CF}
|
|
2979
|
+
writeInfo(`\u{1F4CF} Running Size-Limit on ${context.projectName}`, config);
|
|
2897
2980
|
_sizelimit2.default.call(void 0, [_file2.default, _esbuild3.default, _esbuildwhy2.default], {
|
|
2898
2981
|
checks: _nullishCoalesce(_nullishCoalesce(options.entry, () => ( _optionalChain([context, 'access', _145 => _145.projectsConfigurations, 'access', _146 => _146.projects, 'access', _147 => _147[context.projectName], 'optionalAccess', _148 => _148.sourceRoot]))), () => ( _devkit.joinPathFragments.call(void 0,
|
|
2899
2982
|
_nullishCoalesce(_optionalChain([context, 'access', _149 => _149.projectsConfigurations, 'access', _150 => _150.projects, 'access', _151 => _151[context.projectName], 'optionalAccess', _152 => _152.root]), () => ( "./")),
|
|
@@ -2901,7 +2984,7 @@ async function sizeLimitExecutorFn(options, context, config) {
|
|
|
2901
2984
|
)))
|
|
2902
2985
|
}).then((result) => {
|
|
2903
2986
|
writeInfo(
|
|
2904
|
-
`\u{1F4CF}
|
|
2987
|
+
`\u{1F4CF} ${context.projectName} Size-Limit result: ${JSON.stringify(result)}`,
|
|
2905
2988
|
config
|
|
2906
2989
|
);
|
|
2907
2990
|
});
|
|
@@ -4647,6 +4730,9 @@ var YARN_LOCK_PATH = _path.join.call(void 0, _devkit.workspaceRoot, YARN_LOCK_FI
|
|
|
4647
4730
|
var NPM_LOCK_PATH = _path.join.call(void 0, _devkit.workspaceRoot, NPM_LOCK_FILE);
|
|
4648
4731
|
var PNPM_LOCK_PATH = _path.join.call(void 0, _devkit.workspaceRoot, PNPM_LOCK_FILE);
|
|
4649
4732
|
|
|
4733
|
+
// ../workspace-tools/src/utils/nx-json.ts
|
|
4734
|
+
_chunkRQT3Z4GIjs.init_cjs_shims.call(void 0, );
|
|
4735
|
+
|
|
4650
4736
|
// ../workspace-tools/src/utils/plugin-helpers.ts
|
|
4651
4737
|
_chunkRQT3Z4GIjs.init_cjs_shims.call(void 0, );
|
|
4652
4738
|
|