@storm-software/esbuild 0.35.11 → 0.35.13

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 (58) hide show
  1. package/README.md +1 -2
  2. package/bin/esbuild.cjs +1225 -2788
  3. package/dist/assets.cjs +6 -6
  4. package/dist/assets.js +5 -5
  5. package/dist/build.cjs +13 -14
  6. package/dist/build.js +12 -13
  7. package/dist/{chunk-C5UZWWWR.js → chunk-2LYIFO7K.js} +3 -9
  8. package/dist/{chunk-KXCV2R7J.cjs → chunk-55UPQQ65.cjs} +288 -179
  9. package/dist/{chunk-INQXL7FE.js → chunk-72UBXZRO.js} +4 -6
  10. package/dist/{chunk-RMRB7CWQ.js → chunk-7KIT5JE6.js} +36 -30
  11. package/dist/{chunk-OHH3RWRK.cjs → chunk-B3MHVZOK.cjs} +10 -12
  12. package/dist/{chunk-NNO5TTNR.cjs → chunk-BK5GLVSJ.cjs} +47 -21
  13. package/dist/{chunk-J3XDBU5Z.cjs → chunk-BWMW4ZUS.cjs} +46 -40
  14. package/dist/{chunk-VITVYHJG.cjs → chunk-C25ALB4J.cjs} +975 -1209
  15. package/dist/chunk-CEJM5IFH.js +37 -0
  16. package/dist/{chunk-ICKIIBXC.js → chunk-FHHEEOIV.js} +2 -2
  17. package/dist/{chunk-PHC57UZZ.cjs → chunk-H7NSISN4.cjs} +33 -24
  18. package/dist/{chunk-QAYURSX7.cjs → chunk-IULOZ7MO.cjs} +5 -5
  19. package/dist/{chunk-QTR5272S.cjs → chunk-JCICRU7K.cjs} +3 -5
  20. package/dist/{chunk-OZEWXLIK.js → chunk-KV6GNLVF.js} +8 -10
  21. package/dist/{chunk-TULJZS5M.js → chunk-KXZCIMKJ.js} +149 -265
  22. package/dist/{chunk-T4UMKHLQ.cjs → chunk-LBRDOW2V.cjs} +18 -9
  23. package/dist/{chunk-5P6GWVMJ.js → chunk-NACKZM5D.js} +189 -116
  24. package/dist/chunk-NLIYZM5H.cjs +25 -0
  25. package/dist/{chunk-WHHAD2OY.js → chunk-Q3WZPCLD.js} +232 -123
  26. package/dist/{chunk-7ESNPD46.js → chunk-QOTJTLX7.js} +1 -1
  27. package/dist/{chunk-J5J57SEI.cjs → chunk-RBXXACL5.cjs} +204 -131
  28. package/dist/{chunk-KYRZY7X7.js → chunk-RNXNYWO3.js} +28 -19
  29. package/dist/{chunk-H35FAHLW.cjs → chunk-T4N45NGL.cjs} +17 -26
  30. package/dist/{chunk-66VO6PT4.js → chunk-VLK67MTI.js} +43 -17
  31. package/dist/{chunk-SR4MG2LN.js → chunk-VNLMOUVN.js} +15 -24
  32. package/dist/chunk-XHTD4QDZ.cjs +6 -0
  33. package/dist/clean.cjs +5 -5
  34. package/dist/clean.js +4 -4
  35. package/dist/config.cjs +6 -6
  36. package/dist/config.js +5 -5
  37. package/dist/context.cjs +7 -8
  38. package/dist/context.js +6 -7
  39. package/dist/index.cjs +15 -16
  40. package/dist/index.js +13 -14
  41. package/dist/package-json.cjs +6 -6
  42. package/dist/package-json.js +5 -5
  43. package/dist/plugins/deps-check.cjs +5 -5
  44. package/dist/plugins/deps-check.js +4 -4
  45. package/dist/plugins/resolve-paths.cjs +82 -5
  46. package/dist/plugins/resolve-paths.js +81 -4
  47. package/dist/tsup.cjs +5 -5
  48. package/dist/tsup.js +4 -4
  49. package/dist/types.cjs +2 -2
  50. package/dist/types.js +2 -2
  51. package/dist/watch.cjs +19 -29
  52. package/dist/watch.js +15 -25
  53. package/package.json +4 -4
  54. package/dist/chunk-AF5YHP7E.cjs +0 -57
  55. package/dist/chunk-BWCGRWHA.cjs +0 -6
  56. package/dist/chunk-ELF4S3RR.cjs +0 -31
  57. package/dist/chunk-IL6FCY37.js +0 -57
  58. package/dist/chunk-LQIX6FZY.js +0 -28
@@ -1,27 +1,36 @@
1
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
2
 
3
- var _chunkKXCV2R7Jcjs = require('./chunk-KXCV2R7J.cjs');
3
+ var _chunk55UPQQ65cjs = require('./chunk-55UPQQ65.cjs');
4
4
 
5
5
 
6
6
 
7
- var _chunkJ5J57SEIcjs = require('./chunk-J5J57SEI.cjs');
7
+ var _chunkRBXXACL5cjs = require('./chunk-RBXXACL5.cjs');
8
8
 
9
9
 
10
-
11
- var _chunkQTR5272Scjs = require('./chunk-QTR5272S.cjs');
10
+ var _chunkJCICRU7Kcjs = require('./chunk-JCICRU7K.cjs');
12
11
 
13
12
  // src/assets.ts
14
- _chunkQTR5272Scjs.init_cjs_shims.call(void 0, );
13
+ _chunkJCICRU7Kcjs.init_cjs_shims.call(void 0, );
15
14
  async function copyBuildAssets(context) {
16
15
  if (_optionalChain([context, 'access', _ => _.result, 'optionalAccess', _2 => _2.errors, 'access', _3 => _3.length]) === 0) {
17
- _chunkJ5J57SEIcjs.writeDebug.call(void 0, ` \u{1F4CB} Copying asset files to output directory: ${context.outputPath}`, context.workspaceConfig);
18
- const stopwatch = _chunkJ5J57SEIcjs.getStopwatch.call(void 0, `${context.options.name} asset copy`);
19
- await _chunkKXCV2R7Jcjs.copyAssets.call(void 0, context.workspaceConfig, _nullishCoalesce(context.options.assets, () => ( [])), context.outputPath, context.options.projectRoot, context.sourceRoot, true, false);
16
+ _chunkRBXXACL5cjs.writeDebug.call(void 0,
17
+ ` \u{1F4CB} Copying asset files to output directory: ${context.outputPath}`,
18
+ context.workspaceConfig
19
+ );
20
+ const stopwatch = _chunkRBXXACL5cjs.getStopwatch.call(void 0, `${context.options.name} asset copy`);
21
+ await _chunk55UPQQ65cjs.copyAssets.call(void 0,
22
+ context.workspaceConfig,
23
+ _nullishCoalesce(context.options.assets, () => ( [])),
24
+ context.outputPath,
25
+ context.options.projectRoot,
26
+ context.sourceRoot,
27
+ true,
28
+ false
29
+ );
20
30
  stopwatch();
21
31
  }
22
32
  return context;
23
33
  }
24
- _chunkQTR5272Scjs.__name.call(void 0, copyBuildAssets, "copyBuildAssets");
25
34
 
26
35
 
27
36
 
@@ -1,11 +1,10 @@
1
1
  import {
2
2
  correctPaths,
3
3
  joinPaths
4
- } from "./chunk-OZEWXLIK.js";
4
+ } from "./chunk-KV6GNLVF.js";
5
5
  import {
6
- __name,
7
6
  init_esm_shims
8
- } from "./chunk-INQXL7FE.js";
7
+ } from "./chunk-72UBXZRO.js";
9
8
 
10
9
  // ../config-tools/src/logger/console.ts
11
10
  init_esm_shims();
@@ -144,23 +143,39 @@ var RegistryConfigSchema = z.object({
144
143
  cyclone: RegistryUrlConfigSchema,
145
144
  container: RegistryUrlConfigSchema
146
145
  }).default({}).describe("A list of remote registry URLs used by Storm Software");
147
- var ColorConfigSchema = SingleThemeColorConfigSchema.or(MultiThemeColorConfigSchema).describe("Colors used for various workspace elements");
146
+ var ColorConfigSchema = SingleThemeColorConfigSchema.or(
147
+ MultiThemeColorConfigSchema
148
+ ).describe("Colors used for various workspace elements");
148
149
  var ColorConfigMapSchema = z.union([
149
- z.object({
150
- base: ColorConfigSchema
151
- }),
150
+ z.object({ base: ColorConfigSchema }),
152
151
  z.record(z.string(), ColorConfigSchema)
153
152
  ]);
154
- var ExtendsItemSchema = z.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.");
155
- var ExtendsSchema = ExtendsItemSchema.or(z.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.");
153
+ var ExtendsItemSchema = z.string().trim().describe(
154
+ "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."
155
+ );
156
+ var ExtendsSchema = ExtendsItemSchema.or(
157
+ z.array(ExtendsItemSchema)
158
+ ).describe(
159
+ "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."
160
+ );
156
161
  var WorkspaceBotConfigSchema = z.object({
157
- name: z.string().trim().default("stormie-bot").describe("The workspace bot user's name (this is the bot that will be used to perform various tasks)"),
162
+ name: z.string().trim().default("stormie-bot").describe(
163
+ "The workspace bot user's name (this is the bot that will be used to perform various tasks)"
164
+ ),
158
165
  email: z.string().trim().email().default("bot@stormsoftware.com").describe("The email of the workspace bot")
159
- }).describe("The workspace's bot user's config used to automated various operations tasks");
166
+ }).describe(
167
+ "The workspace's bot user's config used to automated various operations tasks"
168
+ );
160
169
  var WorkspaceReleaseConfigSchema = z.object({
161
- banner: z.string().trim().default(STORM_DEFAULT_RELEASE_BANNER).describe("A URL to a banner image used to display the workspace's release"),
162
- header: z.string().trim().optional().describe("A header message appended to the start of the workspace's release notes"),
163
- footer: z.string().trim().default(STORM_DEFAULT_RELEASE_FOOTER).describe("A footer message appended to the end of the workspace's release notes")
170
+ banner: z.string().trim().default(STORM_DEFAULT_RELEASE_BANNER).describe(
171
+ "A URL to a banner image used to display the workspace's release"
172
+ ),
173
+ header: z.string().trim().optional().describe(
174
+ "A header message appended to the start of the workspace's release notes"
175
+ ),
176
+ footer: z.string().trim().default(STORM_DEFAULT_RELEASE_FOOTER).describe(
177
+ "A footer message appended to the end of the workspace's release notes"
178
+ )
164
179
  }).describe("The workspace's release config used during the release process");
165
180
  var WorkspaceAccountConfigSchema = z.object({
166
181
  twitter: z.string().trim().default(STORM_DEFAULT_ACCOUNT_TWITTER).describe("A Twitter/X account associated with the organization/project"),
@@ -169,23 +184,41 @@ var WorkspaceAccountConfigSchema = z.object({
169
184
  slack: z.string().trim().default(STORM_DEFAULT_ACCOUNT_SLACK).describe("A Slack account associated with the organization/project"),
170
185
  medium: z.string().trim().default(STORM_DEFAULT_ACCOUNT_MEDIUM).describe("A Medium account associated with the organization/project"),
171
186
  github: z.string().trim().default(STORM_DEFAULT_ACCOUNT_GITHUB).describe("A GitHub account associated with the organization/project")
172
- }).describe("The workspace's account config used to store various social media links");
187
+ }).describe(
188
+ "The workspace's account config used to store various social media links"
189
+ );
173
190
  var WorkspaceDirectoryConfigSchema = z.object({
174
- cache: z.string().trim().optional().describe("The directory used to store the environment's cached file data"),
191
+ cache: z.string().trim().optional().describe(
192
+ "The directory used to store the environment's cached file data"
193
+ ),
175
194
  data: z.string().trim().optional().describe("The directory used to store the environment's data files"),
176
- config: z.string().trim().optional().describe("The directory used to store the environment's configuration files"),
195
+ config: z.string().trim().optional().describe(
196
+ "The directory used to store the environment's configuration files"
197
+ ),
177
198
  temp: z.string().trim().optional().describe("The directory used to store the environment's temp files"),
178
199
  log: z.string().trim().optional().describe("The directory used to store the environment's temp files"),
179
- build: z.string().trim().default("dist").describe("The directory used to store the workspace's distributable files after a build (relative to the workspace root)")
180
- }).describe("Various directories used by the workspace to store data, cache, and configuration files");
200
+ build: z.string().trim().default("dist").describe(
201
+ "The directory used to store the workspace's distributable files after a build (relative to the workspace root)"
202
+ )
203
+ }).describe(
204
+ "Various directories used by the workspace to store data, cache, and configuration files"
205
+ );
181
206
  var errorConfigSchema = z.object({
182
207
  codesFile: z.string().trim().default(STORM_DEFAULT_ERROR_CODES_FILE).describe("The path to the workspace's error codes JSON file"),
183
- url: z.string().trim().url().optional().describe("A URL to a page that looks up the workspace's error messages given a specific error code")
208
+ url: z.string().trim().url().optional().describe(
209
+ "A URL to a page that looks up the workspace's error messages given a specific error code"
210
+ )
184
211
  }).describe("The workspace's error config used during the error process");
185
212
  var stormWorkspaceConfigSchema = z.object({
186
- $schema: z.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"),
213
+ $schema: z.string().trim().default(
214
+ "https://cdn.jsdelivr.net/npm/@storm-software/config/schemas/storm-workspace.schema.json"
215
+ ).optional().nullish().describe(
216
+ "The URL to the JSON schema file that describes the Storm configuration file"
217
+ ),
187
218
  extends: ExtendsSchema.optional(),
188
- name: z.string().trim().toLowerCase().optional().describe("The name of the service/package/scope using this configuration"),
219
+ name: z.string().trim().toLowerCase().optional().describe(
220
+ "The name of the service/package/scope using this configuration"
221
+ ),
189
222
  namespace: z.string().trim().toLowerCase().optional().describe("The namespace of the package"),
190
223
  organization: z.string().trim().default("storm-software").describe("The organization of the workspace"),
191
224
  repository: z.string().trim().optional().describe("The repo URL of the workspace (i.e. GitHub)"),
@@ -201,21 +234,16 @@ var stormWorkspaceConfigSchema = z.object({
201
234
  release: WorkspaceReleaseConfigSchema,
202
235
  account: WorkspaceAccountConfigSchema,
203
236
  error: errorConfigSchema,
204
- mode: z.enum([
205
- "development",
206
- "staging",
207
- "production"
208
- ]).default("production").describe("The current runtime environment mode for the package"),
237
+ mode: z.enum(["development", "staging", "production"]).default("production").describe("The current runtime environment mode for the package"),
209
238
  workspaceRoot: z.string().trim().describe("The root directory of the workspace"),
210
- externalPackagePatterns: z.array(z.string()).default([]).describe("The build will use these package patterns to determine if they should be external to the bundle"),
239
+ externalPackagePatterns: z.array(z.string()).default([]).describe(
240
+ "The build will use these package patterns to determine if they should be external to the bundle"
241
+ ),
211
242
  skipCache: z.boolean().default(false).describe("Should all known types of workspace caching be skipped?"),
212
243
  directories: WorkspaceDirectoryConfigSchema,
213
- packageManager: z.enum([
214
- "npm",
215
- "yarn",
216
- "pnpm",
217
- "bun"
218
- ]).default("npm").describe("The JavaScript/TypeScript package manager used by the repository"),
244
+ packageManager: z.enum(["npm", "yarn", "pnpm", "bun"]).default("npm").describe(
245
+ "The JavaScript/TypeScript package manager used by the repository"
246
+ ),
219
247
  timezone: z.string().trim().default("America/New_York").describe("The default timezone of the workspace"),
220
248
  locale: z.string().trim().default("en-US").describe("The default locale of the workspace"),
221
249
  logLevel: z.enum([
@@ -228,13 +256,23 @@ var stormWorkspaceConfigSchema = z.object({
228
256
  "debug",
229
257
  "trace",
230
258
  "all"
231
- ]).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`)."),
232
- skipConfigLogging: z.boolean().optional().describe("Should the logging of the current Storm Workspace configuration be skipped?"),
259
+ ]).default("info").describe(
260
+ "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`)."
261
+ ),
262
+ skipConfigLogging: z.boolean().optional().describe(
263
+ "Should the logging of the current Storm Workspace configuration be skipped?"
264
+ ),
233
265
  registry: RegistryConfigSchema,
234
- configFile: z.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."),
235
- colors: ColorConfigSchema.or(ColorConfigMapSchema).describe("Storm theme config values used for styling various package elements"),
266
+ configFile: z.string().trim().nullable().default(null).describe(
267
+ "The filepath of the Storm config. When this field is null, no config file was found in the current workspace."
268
+ ),
269
+ colors: ColorConfigSchema.or(ColorConfigMapSchema).describe(
270
+ "Storm theme config values used for styling various package elements"
271
+ ),
236
272
  extensions: z.record(z.any()).optional().default({}).describe("Configuration of each used extension")
237
- }).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.");
273
+ }).describe(
274
+ "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."
275
+ );
238
276
 
239
277
  // ../config/src/types.ts
240
278
  init_esm_shims();
@@ -272,10 +310,14 @@ var MAX_PATH_SEARCH_DEPTH = 30;
272
310
  var depth = 0;
273
311
  function findFolderUp(startPath, endFileNames = [], endDirectoryNames = []) {
274
312
  const _startPath = startPath ?? process.cwd();
275
- if (endDirectoryNames.some((endDirName) => existsSync(join(_startPath, endDirName)))) {
313
+ if (endDirectoryNames.some(
314
+ (endDirName) => existsSync(join(_startPath, endDirName))
315
+ )) {
276
316
  return _startPath;
277
317
  }
278
- if (endFileNames.some((endFileName) => existsSync(join(_startPath, endFileName)))) {
318
+ if (endFileNames.some(
319
+ (endFileName) => existsSync(join(_startPath, endFileName))
320
+ )) {
279
321
  return _startPath;
280
322
  }
281
323
  if (_startPath !== "/" && depth++ < MAX_PATH_SEARCH_DEPTH) {
@@ -284,7 +326,6 @@ function findFolderUp(startPath, endFileNames = [], endDirectoryNames = []) {
284
326
  }
285
327
  return void 0;
286
328
  }
287
- __name(findFolderUp, "findFolderUp");
288
329
 
289
330
  // ../config-tools/src/utilities/find-workspace-root.ts
290
331
  var rootFiles = [
@@ -331,21 +372,31 @@ var rootDirectories = [
331
372
  ];
332
373
  function findWorkspaceRootSafe(pathInsideMonorepo) {
333
374
  if (process.env.STORM_WORKSPACE_ROOT || process.env.NX_WORKSPACE_ROOT_PATH) {
334
- return correctPaths(process.env.STORM_WORKSPACE_ROOT ?? process.env.NX_WORKSPACE_ROOT_PATH);
375
+ return correctPaths(
376
+ process.env.STORM_WORKSPACE_ROOT ?? process.env.NX_WORKSPACE_ROOT_PATH
377
+ );
335
378
  }
336
- return correctPaths(findFolderUp(pathInsideMonorepo ?? process.cwd(), rootFiles, rootDirectories));
379
+ return correctPaths(
380
+ findFolderUp(
381
+ pathInsideMonorepo ?? process.cwd(),
382
+ rootFiles,
383
+ rootDirectories
384
+ )
385
+ );
337
386
  }
338
- __name(findWorkspaceRootSafe, "findWorkspaceRootSafe");
339
387
  function findWorkspaceRoot(pathInsideMonorepo) {
340
388
  const result = findWorkspaceRootSafe(pathInsideMonorepo);
341
389
  if (!result) {
342
- throw new Error(`Cannot find workspace root upwards from known path. Files search list includes:
343
- ${rootFiles.join("\n")}
344
- Path: ${pathInsideMonorepo ? pathInsideMonorepo : process.cwd()}`);
390
+ throw new Error(
391
+ `Cannot find workspace root upwards from known path. Files search list includes:
392
+ ${rootFiles.join(
393
+ "\n"
394
+ )}
395
+ Path: ${pathInsideMonorepo ? pathInsideMonorepo : process.cwd()}`
396
+ );
345
397
  }
346
398
  return result;
347
399
  }
348
- __name(findWorkspaceRoot, "findWorkspaceRoot");
349
400
 
350
401
  // ../config-tools/src/utilities/get-default-config.ts
351
402
  var DEFAULT_COLOR_CONFIG = {
@@ -376,7 +427,7 @@ var DEFAULT_COLOR_CONFIG = {
376
427
  negative: "#dc2626"
377
428
  }
378
429
  };
379
- var getDefaultConfig = /* @__PURE__ */ __name(async (root) => {
430
+ var getDefaultConfig = async (root) => {
380
431
  let license = STORM_DEFAULT_LICENSE;
381
432
  let homepage = STORM_DEFAULT_HOMEPAGE;
382
433
  let name = void 0;
@@ -384,7 +435,10 @@ var getDefaultConfig = /* @__PURE__ */ __name(async (root) => {
384
435
  let repository = void 0;
385
436
  const workspaceRoot = findWorkspaceRoot(root);
386
437
  if (existsSync2(join2(workspaceRoot, "package.json"))) {
387
- const file = await readFile(joinPaths(workspaceRoot, "package.json"), "utf8");
438
+ const file = await readFile(
439
+ joinPaths(workspaceRoot, "package.json"),
440
+ "utf8"
441
+ );
388
442
  if (file) {
389
443
  const packageJson = JSON.parse(file);
390
444
  if (packageJson.name) {
@@ -421,37 +475,37 @@ var getDefaultConfig = /* @__PURE__ */ __name(async (root) => {
421
475
  url: `${homepage || STORM_DEFAULT_HOMEPAGE}/errors`
422
476
  }
423
477
  };
424
- }, "getDefaultConfig");
478
+ };
425
479
 
426
480
  // ../config-tools/src/logger/chalk.ts
427
481
  init_esm_shims();
428
482
  import chalk from "chalk";
429
483
  var chalkDefault = {
430
- hex: /* @__PURE__ */ __name((_) => (message) => message, "hex"),
431
- bgHex: /* @__PURE__ */ __name((_) => ({
432
- whiteBright: /* @__PURE__ */ __name((message) => message, "whiteBright")
433
- }), "bgHex"),
434
- whiteBright: /* @__PURE__ */ __name((message) => message, "whiteBright"),
435
- gray: /* @__PURE__ */ __name((message) => message, "gray"),
484
+ hex: (_) => (message) => message,
485
+ bgHex: (_) => ({
486
+ whiteBright: (message) => message
487
+ }),
488
+ whiteBright: (message) => message,
489
+ gray: (message) => message,
436
490
  bold: {
437
- hex: /* @__PURE__ */ __name((_) => (message) => message, "hex"),
438
- bgHex: /* @__PURE__ */ __name((_) => ({
439
- whiteBright: /* @__PURE__ */ __name((message) => message, "whiteBright")
440
- }), "bgHex"),
441
- whiteBright: /* @__PURE__ */ __name((message) => message, "whiteBright")
491
+ hex: (_) => (message) => message,
492
+ bgHex: (_) => ({
493
+ whiteBright: (message) => message
494
+ }),
495
+ whiteBright: (message) => message
442
496
  },
443
497
  dim: {
444
- hex: /* @__PURE__ */ __name((_) => (message) => message, "hex"),
445
- gray: /* @__PURE__ */ __name((message) => message, "gray")
498
+ hex: (_) => (message) => message,
499
+ gray: (message) => message
446
500
  }
447
501
  };
448
- var getChalk = /* @__PURE__ */ __name(() => {
502
+ var getChalk = () => {
449
503
  let _chalk = chalk;
450
504
  if (!_chalk?.hex || !_chalk?.bold?.hex || !_chalk?.bgHex || !_chalk?.whiteBright) {
451
505
  _chalk = chalkDefault;
452
506
  }
453
507
  return _chalk;
454
- }, "getChalk");
508
+ };
455
509
 
456
510
  // ../config-tools/src/logger/console-icons.ts
457
511
  init_esm_shims();
@@ -467,10 +521,9 @@ function isUnicodeSupported() {
467
521
  process.env.ConEmuTask === "{cmd::Cmder}" || // ConEmu and cmder
468
522
  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";
469
523
  }
470
- __name(isUnicodeSupported, "isUnicodeSupported");
471
524
 
472
525
  // ../config-tools/src/logger/console-icons.ts
473
- var useIcon = /* @__PURE__ */ __name((c, fallback) => isUnicodeSupported() ? c : fallback, "useIcon");
526
+ var useIcon = (c, fallback) => isUnicodeSupported() ? c : fallback;
474
527
  var CONSOLE_ICONS = {
475
528
  [LogLevelLabel.ERROR]: useIcon("\u2718", "\xD7"),
476
529
  [LogLevelLabel.FATAL]: useIcon("\u{1F480}", "\xD7"),
@@ -484,13 +537,13 @@ var CONSOLE_ICONS = {
484
537
 
485
538
  // ../config-tools/src/logger/format-timestamp.ts
486
539
  init_esm_shims();
487
- var formatTimestamp = /* @__PURE__ */ __name((date = /* @__PURE__ */ new Date()) => {
540
+ var formatTimestamp = (date = /* @__PURE__ */ new Date()) => {
488
541
  return `${date.toLocaleDateString()} ${date.toLocaleTimeString()}`;
489
- }, "formatTimestamp");
542
+ };
490
543
 
491
544
  // ../config-tools/src/logger/get-log-level.ts
492
545
  init_esm_shims();
493
- var getLogLevel = /* @__PURE__ */ __name((label) => {
546
+ var getLogLevel = (label) => {
494
547
  switch (label) {
495
548
  case "all":
496
549
  return LogLevel.ALL;
@@ -511,8 +564,8 @@ var getLogLevel = /* @__PURE__ */ __name((label) => {
511
564
  default:
512
565
  return LogLevel.INFO;
513
566
  }
514
- }, "getLogLevel");
515
- var getLogLevelLabel = /* @__PURE__ */ __name((logLevel = LogLevel.INFO) => {
567
+ };
568
+ var getLogLevelLabel = (logLevel = LogLevel.INFO) => {
516
569
  if (logLevel >= LogLevel.ALL) {
517
570
  return LogLevelLabel.ALL;
518
571
  }
@@ -538,10 +591,10 @@ var getLogLevelLabel = /* @__PURE__ */ __name((logLevel = LogLevel.INFO) => {
538
591
  return LogLevelLabel.SILENT;
539
592
  }
540
593
  return LogLevelLabel.INFO;
541
- }, "getLogLevelLabel");
594
+ };
542
595
 
543
596
  // ../config-tools/src/logger/console.ts
544
- var getLogFn = /* @__PURE__ */ __name((logLevel = LogLevel.INFO, config = {}, _chalk = getChalk()) => {
597
+ var getLogFn = (logLevel = LogLevel.INFO, config = {}, _chalk = getChalk()) => {
545
598
  const colors = !config.colors?.dark && !config.colors?.["base"] && !config.colors?.["base"]?.dark ? DEFAULT_COLOR_CONFIG : config.colors?.dark && typeof config.colors.dark === "string" ? config.colors : config.colors?.["base"]?.dark && typeof config.colors["base"].dark === "string" ? config.colors["base"].dark : config.colors?.["base"] ? config.colors?.["base"] : DEFAULT_COLOR_CONFIG;
546
599
  const configLogLevel = config.logLevel || process.env.STORM_LOG_LEVEL || LogLevelLabel.INFO;
547
600
  if (logLevel > getLogLevel(configLogLevel) || logLevel <= LogLevel.SILENT || getLogLevel(configLogLevel) <= LogLevel.SILENT) {
@@ -550,98 +603,118 @@ var getLogFn = /* @__PURE__ */ __name((logLevel = LogLevel.INFO, config = {}, _c
550
603
  }
551
604
  if (typeof logLevel === "number" && LogLevel.FATAL >= logLevel) {
552
605
  return (message) => {
553
- console.error(`
606
+ console.error(
607
+ `
554
608
  ${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.fatal ?? "#7d1a1a")(`[${CONSOLE_ICONS[LogLevelLabel.FATAL]} Fatal] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
555
- `);
609
+ `
610
+ );
556
611
  };
557
612
  }
558
613
  if (typeof logLevel === "number" && LogLevel.ERROR >= logLevel) {
559
614
  return (message) => {
560
- console.error(`
615
+ console.error(
616
+ `
561
617
  ${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.danger ?? "#f85149")(`[${CONSOLE_ICONS[LogLevelLabel.ERROR]} Error] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
562
- `);
618
+ `
619
+ );
563
620
  };
564
621
  }
565
622
  if (typeof logLevel === "number" && LogLevel.WARN >= logLevel) {
566
623
  return (message) => {
567
- console.warn(`
624
+ console.warn(
625
+ `
568
626
  ${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.warning ?? "#e3b341")(`[${CONSOLE_ICONS[LogLevelLabel.WARN]} Warn] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
569
- `);
627
+ `
628
+ );
570
629
  };
571
630
  }
572
631
  if (typeof logLevel === "number" && LogLevel.SUCCESS >= logLevel) {
573
632
  return (message) => {
574
- console.info(`
633
+ console.info(
634
+ `
575
635
  ${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.success ?? "#56d364")(`[${CONSOLE_ICONS[LogLevelLabel.SUCCESS]} Success] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
576
- `);
636
+ `
637
+ );
577
638
  };
578
639
  }
579
640
  if (typeof logLevel === "number" && LogLevel.INFO >= logLevel) {
580
641
  return (message) => {
581
- console.info(`
642
+ console.info(
643
+ `
582
644
  ${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.info ?? "#58a6ff")(`[${CONSOLE_ICONS[LogLevelLabel.INFO]} Info] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
583
- `);
645
+ `
646
+ );
584
647
  };
585
648
  }
586
649
  if (typeof logLevel === "number" && LogLevel.DEBUG >= logLevel) {
587
650
  return (message) => {
588
- console.debug(`
651
+ console.debug(
652
+ `
589
653
  ${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.brand ?? "#1fb2a6")(`[${CONSOLE_ICONS[LogLevelLabel.DEBUG]} Debug] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
590
- `);
654
+ `
655
+ );
591
656
  };
592
657
  }
593
658
  if (typeof logLevel === "number" && LogLevel.TRACE >= logLevel) {
594
659
  return (message) => {
595
- console.debug(`
660
+ console.debug(
661
+ `
596
662
  ${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.brand ?? "#1fb2a6")(`[${CONSOLE_ICONS[LogLevelLabel.TRACE]} Trace] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
597
- `);
663
+ `
664
+ );
598
665
  };
599
666
  }
600
667
  return (message) => {
601
- console.log(`
668
+ console.log(
669
+ `
602
670
  ${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.brand ?? "#1fb2a6")(`[${CONSOLE_ICONS[LogLevelLabel.ALL]} System] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
603
- `);
671
+ `
672
+ );
604
673
  };
605
- }, "getLogFn");
606
- var writeFatal = /* @__PURE__ */ __name((message, config) => getLogFn(LogLevel.FATAL, config)(message), "writeFatal");
607
- var writeError = /* @__PURE__ */ __name((message, config) => getLogFn(LogLevel.ERROR, config)(message), "writeError");
608
- var writeWarning = /* @__PURE__ */ __name((message, config) => getLogFn(LogLevel.WARN, config)(message), "writeWarning");
609
- var writeSuccess = /* @__PURE__ */ __name((message, config) => getLogFn(LogLevel.SUCCESS, config)(message), "writeSuccess");
610
- var writeDebug = /* @__PURE__ */ __name((message, config) => getLogFn(LogLevel.DEBUG, config)(message), "writeDebug");
611
- var writeTrace = /* @__PURE__ */ __name((message, config) => getLogFn(LogLevel.TRACE, config)(message), "writeTrace");
612
- var getStopwatch = /* @__PURE__ */ __name((name) => {
674
+ };
675
+ var writeFatal = (message, config) => getLogFn(LogLevel.FATAL, config)(message);
676
+ var writeError = (message, config) => getLogFn(LogLevel.ERROR, config)(message);
677
+ var writeWarning = (message, config) => getLogFn(LogLevel.WARN, config)(message);
678
+ var writeSuccess = (message, config) => getLogFn(LogLevel.SUCCESS, config)(message);
679
+ var writeDebug = (message, config) => getLogFn(LogLevel.DEBUG, config)(message);
680
+ var writeTrace = (message, config) => getLogFn(LogLevel.TRACE, config)(message);
681
+ var getStopwatch = (name) => {
613
682
  const start = process.hrtime();
614
683
  return () => {
615
684
  const end = process.hrtime(start);
616
- console.info(`
617
- > \u23F1\uFE0F The${name ? ` ${name}` : ""} process took ${Math.round(end[0] * 1e3 + end[1] / 1e6)}ms to complete
618
- `);
685
+ console.info(
686
+ `
687
+ > \u23F1\uFE0F The${name ? ` ${name}` : ""} process took ${Math.round(
688
+ end[0] * 1e3 + end[1] / 1e6
689
+ )}ms to complete
690
+ `
691
+ );
619
692
  };
620
- }, "getStopwatch");
693
+ };
621
694
  var MAX_DEPTH = 4;
622
- var formatLogMessage = /* @__PURE__ */ __name((message, options = {}, depth2 = 0) => {
695
+ var formatLogMessage = (message, options = {}, depth2 = 0) => {
623
696
  if (depth2 > MAX_DEPTH) {
624
697
  return "<max depth>";
625
698
  }
626
699
  const prefix = options.prefix ?? "-";
627
700
  const skip = options.skip ?? [];
628
701
  return typeof message === "undefined" || message === null || !message && typeof message !== "boolean" ? "<none>" : typeof message === "string" ? message : Array.isArray(message) ? `
629
- ${message.map((item, index) => ` ${prefix}> #${index} = ${formatLogMessage(item, {
630
- prefix: `${prefix}-`,
631
- skip
632
- }, depth2 + 1)}`).join("\n")}` : typeof message === "object" ? `
633
- ${Object.keys(message).filter((key) => !skip.includes(key)).map((key) => ` ${prefix}> ${key} = ${_isFunction(message[key]) ? "<function>" : typeof message[key] === "object" ? formatLogMessage(message[key], {
634
- prefix: `${prefix}-`,
635
- skip
636
- }, depth2 + 1) : message[key]}`).join("\n")}` : message;
637
- }, "formatLogMessage");
638
- var _isFunction = /* @__PURE__ */ __name((value) => {
702
+ ${message.map((item, index) => ` ${prefix}> #${index} = ${formatLogMessage(item, { prefix: `${prefix}-`, skip }, depth2 + 1)}`).join("\n")}` : typeof message === "object" ? `
703
+ ${Object.keys(message).filter((key) => !skip.includes(key)).map(
704
+ (key) => ` ${prefix}> ${key} = ${_isFunction(message[key]) ? "<function>" : typeof message[key] === "object" ? formatLogMessage(
705
+ message[key],
706
+ { prefix: `${prefix}-`, skip },
707
+ depth2 + 1
708
+ ) : message[key]}`
709
+ ).join("\n")}` : message;
710
+ };
711
+ var _isFunction = (value) => {
639
712
  try {
640
713
  return value instanceof Function || typeof value === "function" || !!(value?.constructor && value?.call && value?.apply);
641
714
  } catch (e) {
642
715
  return false;
643
716
  }
644
- }, "_isFunction");
717
+ };
645
718
 
646
719
  export {
647
720
  LogLevel,
@@ -0,0 +1,25 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+
4
+ var _chunkRBXXACL5cjs = require('./chunk-RBXXACL5.cjs');
5
+
6
+
7
+ var _chunkJCICRU7Kcjs = require('./chunk-JCICRU7K.cjs');
8
+
9
+ // src/clean.ts
10
+ _chunkJCICRU7Kcjs.init_cjs_shims.call(void 0, );
11
+ var _promises = require('fs/promises');
12
+ async function clean(name = "ESBuild", directory, config) {
13
+ _chunkRBXXACL5cjs.writeDebug.call(void 0, ` \u{1F9F9} Cleaning ${name} output path: ${directory}`, config);
14
+ const stopwatch = _chunkRBXXACL5cjs.getStopwatch.call(void 0, `${name} output clean`);
15
+ await cleanDirectories(directory);
16
+ stopwatch();
17
+ }
18
+ async function cleanDirectories(directory) {
19
+ await _promises.rm.call(void 0, directory, { recursive: true, force: true });
20
+ }
21
+
22
+
23
+
24
+
25
+ exports.clean = clean; exports.cleanDirectories = cleanDirectories;