@storm-software/esbuild 0.17.2 → 0.17.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 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 _chunkTP5EOMRDcjs = require('./chunk-TP5EOMRD.cjs');
3
+ var _chunkUJM4BCSPcjs = require('./chunk-UJM4BCSP.cjs');
4
4
 
5
5
 
6
6
 
@@ -14,10 +14,10 @@ var _chunkTP5EOMRDcjs = require('./chunk-TP5EOMRD.cjs');
14
14
 
15
15
 
16
16
 
17
- var _chunkMPTQJ2NMcjs = require('./chunk-MPTQJ2NM.cjs');
17
+ var _chunk2C3TGE3Acjs = require('./chunk-2C3TGE3A.cjs');
18
18
 
19
19
 
20
- var _chunkVZBOWHCMcjs = require('./chunk-VZBOWHCM.cjs');
20
+ var _chunkQJCTL2UQcjs = require('./chunk-QJCTL2UQ.cjs');
21
21
 
22
22
 
23
23
 
@@ -27,7 +27,7 @@ var _chunkVZBOWHCMcjs = require('./chunk-VZBOWHCM.cjs');
27
27
 
28
28
 
29
29
 
30
- var _chunkVBINBV4Zcjs = require('./chunk-VBINBV4Z.cjs');
30
+ var _chunkZKJVN5D7cjs = require('./chunk-ZKJVN5D7.cjs');
31
31
 
32
32
 
33
33
  var _chunkLVWQSCJMcjs = require('./chunk-LVWQSCJM.cjs');
@@ -277,9 +277,9 @@ var resolveOptions = /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0, async
277
277
  if (!workspaceRoot) {
278
278
  throw new Error("Cannot find Nx workspace root");
279
279
  }
280
- const config = await _chunkMPTQJ2NMcjs.loadStormConfig.call(void 0, workspaceRoot.dir);
281
- _chunkVBINBV4Zcjs.writeDebug.call(void 0, " \u2699\uFE0F Resolving build options", config);
282
- const stopwatch = _chunkVBINBV4Zcjs.getStopwatch.call(void 0, "Build options resolution");
280
+ const config = await _chunk2C3TGE3Acjs.loadStormConfig.call(void 0, workspaceRoot.dir);
281
+ _chunkZKJVN5D7cjs.writeDebug.call(void 0, " \u2699\uFE0F Resolving build options", config);
282
+ const stopwatch = _chunkZKJVN5D7cjs.getStopwatch.call(void 0, "Build options resolution");
283
283
  const projectGraph = await _devkit.createProjectGraphAsync.call(void 0, {
284
284
  exitOnError: true
285
285
  });
@@ -293,16 +293,16 @@ var resolveOptions = /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0, async
293
293
  if (!_optionalChain([projectConfigurations, 'optionalAccess', _14 => _14.projects, 'optionalAccess', _15 => _15[projectName]])) {
294
294
  throw new Error("The Build process failed because the project does not have a valid configuration in the project.json file. Check if the file exists in the root of the project.");
295
295
  }
296
- const options = _defu2.default.call(void 0, userOptions, _chunkMPTQJ2NMcjs.DEFAULT_BUILD_OPTIONS);
296
+ const options = _defu2.default.call(void 0, userOptions, _chunk2C3TGE3Acjs.DEFAULT_BUILD_OPTIONS);
297
297
  options.name ??= `${projectName}-${options.format}`;
298
- options.target ??= _chunkMPTQJ2NMcjs.DEFAULT_TARGET;
298
+ options.target ??= _chunk2C3TGE3Acjs.DEFAULT_TARGET;
299
299
  const packageJsonPath = _chunkLVWQSCJMcjs.joinPaths.call(void 0, workspaceRoot.dir, options.projectRoot, "package.json");
300
300
  if (!await _node.hfs.isFile(packageJsonPath)) {
301
301
  throw new Error("Cannot find package.json configuration");
302
302
  }
303
303
  const packageJson = await _node.hfs.json(packageJsonPath);
304
- const outExtension = _chunkMPTQJ2NMcjs.getOutputExtensionMap.call(void 0, options, packageJson.type);
305
- const env = _chunkMPTQJ2NMcjs.getEnv.call(void 0, "esbuild", options);
304
+ const outExtension = _chunk2C3TGE3Acjs.getOutputExtensionMap.call(void 0, options, packageJson.type);
305
+ const env = _chunk2C3TGE3Acjs.getEnv.call(void 0, "esbuild", options);
306
306
  const result = {
307
307
  ...options,
308
308
  config,
@@ -322,7 +322,7 @@ var resolveOptions = /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0, async
322
322
  ...userOptions,
323
323
  tsconfig: _chunkLVWQSCJMcjs.joinPaths.call(void 0, projectRoot, userOptions.tsconfig ? userOptions.tsconfig.replace(projectRoot, "") : "tsconfig.json"),
324
324
  format: options.format || "cjs",
325
- entryPoints: await _chunkMPTQJ2NMcjs.getEntryPoints.call(void 0, config, projectRoot, projectJson.sourceRoot, userOptions.entry || [
325
+ entryPoints: await _chunk2C3TGE3Acjs.getEntryPoints.call(void 0, config, projectRoot, projectJson.sourceRoot, userOptions.entry || [
326
326
  "./src/index.ts"
327
327
  ], userOptions.emitOnAll),
328
328
  outdir: userOptions.outputPath || _chunkLVWQSCJMcjs.joinPaths.call(void 0, "dist", projectRoot),
@@ -333,7 +333,7 @@ var resolveOptions = /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0, async
333
333
  projectGraph,
334
334
  sourceRoot: userOptions.sourceRoot || projectJson.sourceRoot || _chunkLVWQSCJMcjs.joinPaths.call(void 0, projectRoot, "src"),
335
335
  minify: userOptions.minify || !userOptions.debug,
336
- verbose: userOptions.verbose || _chunkVBINBV4Zcjs.isVerbose.call(void 0, ) || userOptions.debug === true,
336
+ verbose: userOptions.verbose || _chunkZKJVN5D7cjs.isVerbose.call(void 0, ) || userOptions.debug === true,
337
337
  includeSrc: userOptions.includeSrc === true,
338
338
  metafile: userOptions.metafile !== false,
339
339
  generatePackageJson: userOptions.generatePackageJson !== false,
@@ -347,8 +347,8 @@ var resolveOptions = /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0, async
347
347
  outExtension,
348
348
  footer: userOptions.footer,
349
349
  banner: {
350
- js: options.banner || _chunkMPTQJ2NMcjs.DEFAULT_COMPILED_BANNER,
351
- css: options.banner || _chunkMPTQJ2NMcjs.DEFAULT_COMPILED_BANNER
350
+ js: options.banner || _chunk2C3TGE3Acjs.DEFAULT_COMPILED_BANNER,
351
+ css: options.banner || _chunk2C3TGE3Acjs.DEFAULT_COMPILED_BANNER
352
352
  },
353
353
  splitting: options.format === "iife" ? false : typeof options.splitting === "boolean" ? options.splitting : options.format === "esm",
354
354
  treeShaking: options.format === "esm",
@@ -374,14 +374,14 @@ var resolveOptions = /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0, async
374
374
  ..._nullishCoalesce(options.inject, () => ( []))
375
375
  ].filter(Boolean)
376
376
  };
377
- result.plugins = _nullishCoalesce(userOptions.plugins, () => ( _chunkMPTQJ2NMcjs.getDefaultBuildPlugins.call(void 0, userOptions, result)));
377
+ result.plugins = _nullishCoalesce(userOptions.plugins, () => ( _chunk2C3TGE3Acjs.getDefaultBuildPlugins.call(void 0, userOptions, result)));
378
378
  stopwatch();
379
379
  return result;
380
380
  }, "resolveOptions");
381
381
  async function generatePackageJson(context2) {
382
382
  if (context2.options.generatePackageJson !== false && await _node.hfs.isFile(_chunkLVWQSCJMcjs.joinPaths.call(void 0, context2.options.projectRoot, "package.json"))) {
383
- _chunkVBINBV4Zcjs.writeDebug.call(void 0, " \u270D\uFE0F Writing package.json file", context2.options.config);
384
- const stopwatch = _chunkVBINBV4Zcjs.getStopwatch.call(void 0, "Write package.json file");
383
+ _chunkZKJVN5D7cjs.writeDebug.call(void 0, " \u270D\uFE0F Writing package.json file", context2.options.config);
384
+ const stopwatch = _chunkZKJVN5D7cjs.getStopwatch.call(void 0, "Write package.json file");
385
385
  const packageJsonPath = _chunkLVWQSCJMcjs.joinPaths.call(void 0, context2.options.projectRoot, "project.json");
386
386
  if (!await _node.hfs.isFile(packageJsonPath)) {
387
387
  throw new Error("Cannot find package.json configuration");
@@ -390,11 +390,11 @@ async function generatePackageJson(context2) {
390
390
  if (!packageJson) {
391
391
  throw new Error("Cannot find package.json configuration file");
392
392
  }
393
- packageJson = await _chunkMPTQJ2NMcjs.addPackageDependencies.call(void 0, context2.options.config.workspaceRoot, context2.options.projectRoot, context2.options.projectName, packageJson);
394
- packageJson = await _chunkMPTQJ2NMcjs.addWorkspacePackageJsonFields.call(void 0, context2.options.config, context2.options.projectRoot, context2.options.sourceRoot, context2.options.projectName, false, packageJson);
393
+ packageJson = await _chunk2C3TGE3Acjs.addPackageDependencies.call(void 0, context2.options.config.workspaceRoot, context2.options.projectRoot, context2.options.projectName, packageJson);
394
+ packageJson = await _chunk2C3TGE3Acjs.addWorkspacePackageJsonFields.call(void 0, context2.options.config, context2.options.projectRoot, context2.options.sourceRoot, context2.options.projectName, false, packageJson);
395
395
  packageJson.exports ??= {};
396
396
  packageJson.exports["./package.json"] ??= "./package.json";
397
- packageJson.exports["."] ??= _chunkMPTQJ2NMcjs.addPackageJsonExport.call(void 0, "index", packageJson.type, context2.options.sourceRoot);
397
+ packageJson.exports["."] ??= _chunk2C3TGE3Acjs.addPackageJsonExport.call(void 0, "index", packageJson.type, context2.options.sourceRoot);
398
398
  let entryPoints = [
399
399
  {
400
400
  in: "./src/index.ts",
@@ -412,7 +412,7 @@ async function generatePackageJson(context2) {
412
412
  const split = entryPoint.out.split(".");
413
413
  split.pop();
414
414
  const entry = split.join(".").replaceAll("\\", "/");
415
- packageJson.exports[`./${entry}`] ??= _chunkMPTQJ2NMcjs.addPackageJsonExport.call(void 0, entry, packageJson.type, context2.options.sourceRoot);
415
+ packageJson.exports[`./${entry}`] ??= _chunk2C3TGE3Acjs.addPackageJsonExport.call(void 0, entry, packageJson.type, context2.options.sourceRoot);
416
416
  }
417
417
  }
418
418
  packageJson.main = packageJson.type === "commonjs" ? "./dist/index.js" : "./dist/index.cjs";
@@ -450,8 +450,8 @@ async function generateContext(getOptions) {
450
450
  }
451
451
  _chunkBGYQAVKQcjs.__name.call(void 0, generateContext, "generateContext");
452
452
  async function executeEsBuild(context2) {
453
- _chunkVBINBV4Zcjs.writeDebug.call(void 0, ` \u{1F680} Running ${context2.options.name} build`, context2.options.config);
454
- const stopwatch = _chunkVBINBV4Zcjs.getStopwatch.call(void 0, `${context2.options.name} build`);
453
+ _chunkZKJVN5D7cjs.writeDebug.call(void 0, ` \u{1F680} Running ${context2.options.name} build`, context2.options.config);
454
+ const stopwatch = _chunkZKJVN5D7cjs.getStopwatch.call(void 0, `${context2.options.name} build`);
455
455
  if (process.env.WATCH === "true") {
456
456
  const ctx = await esbuild.context(context2.options);
457
457
  watch(ctx, context2.options);
@@ -467,9 +467,9 @@ async function executeEsBuild(context2) {
467
467
  _chunkBGYQAVKQcjs.__name.call(void 0, executeEsBuild, "executeEsBuild");
468
468
  async function copyBuildAssets(context2) {
469
469
  if (_optionalChain([context2, 'access', _16 => _16.result, 'optionalAccess', _17 => _17.errors, 'access', _18 => _18.length]) === 0) {
470
- _chunkVBINBV4Zcjs.writeDebug.call(void 0, ` \u{1F4CB} Copying asset files to output directory: ${context2.options.outdir}`, context2.options.config);
471
- const stopwatch = _chunkVBINBV4Zcjs.getStopwatch.call(void 0, `${context2.options.name} asset copy`);
472
- await _chunkMPTQJ2NMcjs.copyAssets.call(void 0, context2.options.config, _nullishCoalesce(context2.options.assets, () => ( [])), context2.options.outdir, context2.options.projectRoot, context2.options.projectName, context2.options.sourceRoot, true, false);
470
+ _chunkZKJVN5D7cjs.writeDebug.call(void 0, ` \u{1F4CB} Copying asset files to output directory: ${context2.options.outdir}`, context2.options.config);
471
+ const stopwatch = _chunkZKJVN5D7cjs.getStopwatch.call(void 0, `${context2.options.name} asset copy`);
472
+ await _chunk2C3TGE3Acjs.copyAssets.call(void 0, context2.options.config, _nullishCoalesce(context2.options.assets, () => ( [])), context2.options.outdir, context2.options.projectRoot, context2.options.projectName, context2.options.sourceRoot, true, false);
473
473
  stopwatch();
474
474
  }
475
475
  return context2;
@@ -478,9 +478,9 @@ _chunkBGYQAVKQcjs.__name.call(void 0, copyBuildAssets, "copyBuildAssets");
478
478
  async function reportResults(context2) {
479
479
  if (_optionalChain([context2, 'access', _19 => _19.result, 'optionalAccess', _20 => _20.errors, 'access', _21 => _21.length]) === 0) {
480
480
  if (context2.result.warnings.length > 0) {
481
- _chunkVBINBV4Zcjs.writeWarning.call(void 0, ` \u{1F6A7} The following warnings occurred during the build: ${context2.result.warnings.map((warning) => warning.text).join("\n")}`, context2.options.config);
481
+ _chunkZKJVN5D7cjs.writeWarning.call(void 0, ` \u{1F6A7} The following warnings occurred during the build: ${context2.result.warnings.map((warning) => warning.text).join("\n")}`, context2.options.config);
482
482
  }
483
- _chunkVBINBV4Zcjs.writeSuccess.call(void 0, ` \u{1F4E6} The ${context2.options.name} build completed successfully`, context2.options.config);
483
+ _chunkZKJVN5D7cjs.writeSuccess.call(void 0, ` \u{1F4E6} The ${context2.options.name} build completed successfully`, context2.options.config);
484
484
  }
485
485
  }
486
486
  _chunkBGYQAVKQcjs.__name.call(void 0, reportResults, "reportResults");
@@ -506,7 +506,7 @@ async function dependencyCheck(options) {
506
506
  write: false,
507
507
  outdir: "out",
508
508
  plugins: [
509
- _chunkVZBOWHCMcjs.depsCheckPlugin.call(void 0, options.bundle)
509
+ _chunkQJCTL2UQcjs.depsCheckPlugin.call(void 0, options.bundle)
510
510
  ]
511
511
  });
512
512
  await buildPromise.catch(() => {
@@ -516,14 +516,14 @@ async function dependencyCheck(options) {
516
516
  _chunkBGYQAVKQcjs.__name.call(void 0, dependencyCheck, "dependencyCheck");
517
517
  async function cleanOutputPath(context2) {
518
518
  if (context2.options.clean !== false && context2.options.outdir) {
519
- await _chunkTP5EOMRDcjs.clean.call(void 0, context2.options.name, context2.options.outdir, context2.options.config);
519
+ await _chunkUJM4BCSPcjs.clean.call(void 0, context2.options.name, context2.options.outdir, context2.options.config);
520
520
  }
521
521
  return context2;
522
522
  }
523
523
  _chunkBGYQAVKQcjs.__name.call(void 0, cleanOutputPath, "cleanOutputPath");
524
524
  async function build2(options) {
525
- _chunkVBINBV4Zcjs.writeDebug.call(void 0, ` \u26A1 Executing Storm ESBuild pipeline`);
526
- const stopwatch = _chunkVBINBV4Zcjs.getStopwatch.call(void 0, "ESBuild pipeline");
525
+ _chunkZKJVN5D7cjs.writeDebug.call(void 0, ` \u26A1 Executing Storm ESBuild pipeline`);
526
+ const stopwatch = _chunkZKJVN5D7cjs.getStopwatch.call(void 0, "ESBuild pipeline");
527
527
  try {
528
528
  const opts = Array.isArray(options) ? options : [
529
529
  options
@@ -533,9 +533,9 @@ async function build2(options) {
533
533
  }
534
534
  void transduce.async(opts, dependencyCheck);
535
535
  await transduce.async(await createOptions(opts), pipe.async(generateContext, cleanOutputPath, generatePackageJson, executeEsBuild, copyBuildAssets, reportResults));
536
- _chunkVBINBV4Zcjs.writeSuccess.call(void 0, " \u{1F3C1} ESBuild pipeline build completed successfully");
536
+ _chunkZKJVN5D7cjs.writeSuccess.call(void 0, " \u{1F3C1} ESBuild pipeline build completed successfully");
537
537
  } catch (error) {
538
- _chunkVBINBV4Zcjs.writeFatal.call(void 0, " \u274C Fatal errors occurred during the build that could not be recovered from. The build process has been terminated.");
538
+ _chunkZKJVN5D7cjs.writeFatal.call(void 0, " \u274C Fatal errors occurred during the build that could not be recovered from. The build process has been terminated.");
539
539
  throw error;
540
540
  } finally {
541
541
  stopwatch();
@@ -563,9 +563,9 @@ var watch = /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0, (context2, opt
563
563
  return context2.rebuild();
564
564
  });
565
565
  if (rebuildResult instanceof Error) {
566
- _chunkVBINBV4Zcjs.writeError.call(void 0, rebuildResult.message);
566
+ _chunkZKJVN5D7cjs.writeError.call(void 0, rebuildResult.message);
567
567
  }
568
- _chunkVBINBV4Zcjs.writeTrace.call(void 0, `${Date.now() - timeBefore}ms [${_nullishCoalesce(options.name, () => ( ""))}]`);
568
+ _chunkZKJVN5D7cjs.writeTrace.call(void 0, `${Date.now() - timeBefore}ms [${_nullishCoalesce(options.name, () => ( ""))}]`);
569
569
  }, 10);
570
570
  changeWatcher.on("change", fastRebuild);
571
571
  return void 0;
@@ -1,7 +1,7 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
2
2
 
3
3
 
4
- var _chunkVBINBV4Zcjs = require('./chunk-VBINBV4Z.cjs');
4
+ var _chunkZKJVN5D7cjs = require('./chunk-ZKJVN5D7.cjs');
5
5
 
6
6
 
7
7
 
@@ -86,8 +86,8 @@ var depsCheckPlugin = /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0, (bun
86
86
  const filteredMissingDeps = missingDependencies.filter((dep) => {
87
87
  return !missingIgnore.some((pattern) => dep.match(pattern)) && !peerDependencies.includes(dep);
88
88
  });
89
- _chunkVBINBV4Zcjs.writeWarning.call(void 0, `Unused Dependencies: ${JSON.stringify(filteredUnusedDeps)}`);
90
- _chunkVBINBV4Zcjs.writeError.call(void 0, `Missing Dependencies: ${JSON.stringify(filteredMissingDeps)}`);
89
+ _chunkZKJVN5D7cjs.writeWarning.call(void 0, `Unused Dependencies: ${JSON.stringify(filteredUnusedDeps)}`);
90
+ _chunkZKJVN5D7cjs.writeError.call(void 0, `Missing Dependencies: ${JSON.stringify(filteredMissingDeps)}`);
91
91
  if (filteredMissingDeps.length > 0) {
92
92
  throw new Error(`Missing dependencies detected - please install them:
93
93
  ${JSON.stringify(filteredMissingDeps)}
@@ -1,7 +1,7 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
3
 
4
- var _chunkVBINBV4Zcjs = require('./chunk-VBINBV4Z.cjs');
4
+ var _chunkZKJVN5D7cjs = require('./chunk-ZKJVN5D7.cjs');
5
5
 
6
6
 
7
7
  var _chunkBGYQAVKQcjs = require('./chunk-BGYQAVKQ.cjs');
@@ -9,8 +9,8 @@ var _chunkBGYQAVKQcjs = require('./chunk-BGYQAVKQ.cjs');
9
9
  // src/clean.ts
10
10
  var _node = require('@humanfs/node');
11
11
  async function clean(name = "ESBuild", directory, config) {
12
- _chunkVBINBV4Zcjs.writeDebug.call(void 0, ` \u{1F9F9} Cleaning ${name} output path: ${directory}`, config);
13
- const stopwatch = _chunkVBINBV4Zcjs.getStopwatch.call(void 0, `${name} output clean`);
12
+ _chunkZKJVN5D7cjs.writeDebug.call(void 0, ` \u{1F9F9} Cleaning ${name} output path: ${directory}`, config);
13
+ const stopwatch = _chunkZKJVN5D7cjs.getStopwatch.call(void 0, `${name} output clean`);
14
14
  await _node.hfs.deleteAll(directory);
15
15
  stopwatch();
16
16
  }
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  writeError
3
- } from "./chunk-HQGUIF4U.js";
3
+ } from "./chunk-IMZK22U3.js";
4
4
  import {
5
5
  joinPaths
6
6
  } from "./chunk-7MDMXJ5V.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  writeError
3
- } from "./chunk-HQGUIF4U.js";
3
+ } from "./chunk-IMZK22U3.js";
4
4
  import {
5
5
  __name
6
6
  } from "./chunk-3GQAWCBQ.js";
@@ -22,6 +22,7 @@ var LogLevelLabel = {
22
22
  FATAL: "fatal",
23
23
  ERROR: "error",
24
24
  WARN: "warn",
25
+ SUCCESS: "success",
25
26
  INFO: "info",
26
27
  DEBUG: "debug",
27
28
  TRACE: "trace",
@@ -80,7 +81,7 @@ var getLogLevelLabel = /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0, (lo
80
81
  }, "getLogLevelLabel");
81
82
  var isVerbose = /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0, (label = LogLevelLabel.SILENT) => {
82
83
  const logLevel = typeof label === "string" ? getLogLevel(label) : label;
83
- return logLevel <= LogLevel.DEBUG;
84
+ return logLevel >= LogLevel.DEBUG;
84
85
  }, "isVerbose");
85
86
 
86
87
  // ../config/src/constants.ts
@@ -221,6 +222,7 @@ var StormConfigSchema = _zod2.default.object({
221
222
  "fatal",
222
223
  "error",
223
224
  "warn",
225
+ "success",
224
226
  "info",
225
227
  "debug",
226
228
  "trace",
@@ -406,12 +408,17 @@ var chalkDefault = {
406
408
  whiteBright: /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0, (message) => message, "whiteBright")
407
409
  }), "bgHex"),
408
410
  whiteBright: /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0, (message) => message, "whiteBright"),
411
+ gray: /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0, (message) => message, "gray"),
409
412
  bold: {
410
413
  hex: /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0, (_) => (message) => message, "hex"),
411
414
  bgHex: /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0, (_) => ({
412
415
  whiteBright: /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0, (message) => message, "whiteBright")
413
416
  }), "bgHex"),
414
417
  whiteBright: /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0, (message) => message, "whiteBright")
418
+ },
419
+ dim: {
420
+ hex: /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0, (_) => (message) => message, "hex"),
421
+ gray: /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0, (message) => message, "gray")
415
422
  }
416
423
  };
417
424
  var getChalk = /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0, () => {
@@ -422,6 +429,38 @@ var getChalk = /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0, () => {
422
429
  return _chalk;
423
430
  }, "getChalk");
424
431
 
432
+ // ../config-tools/src/logger/is-unicode-supported.ts
433
+ var _process = require('process'); var _process2 = _interopRequireDefault(_process);
434
+ function isUnicodeSupported() {
435
+ const { env } = _process2.default;
436
+ const { TERM, TERM_PROGRAM } = env;
437
+ if (_process2.default.platform !== "win32") {
438
+ return TERM !== "linux";
439
+ }
440
+ return Boolean(env.WT_SESSION) || // Windows Terminal
441
+ Boolean(env.TERMINUS_SUBLIME) || // Terminus (<0.2.27)
442
+ env.ConEmuTask === "{cmd::Cmder}" || // ConEmu and cmder
443
+ TERM_PROGRAM === "Terminus-Sublime" || TERM_PROGRAM === "vscode" || TERM === "xterm-256color" || TERM === "alacritty" || TERM === "rxvt-unicode" || TERM === "rxvt-unicode-256color" || env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
444
+ }
445
+ _chunkBGYQAVKQcjs.__name.call(void 0, isUnicodeSupported, "isUnicodeSupported");
446
+
447
+ // ../config-tools/src/logger/console-icons.ts
448
+ var useIcon = /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0, (c, fallback) => isUnicodeSupported() ? c : fallback, "useIcon");
449
+ var CONSOLE_ICONS = {
450
+ [LogLevelLabel.ERROR]: useIcon("\u2718", "\xD7"),
451
+ [LogLevelLabel.FATAL]: useIcon("\u{1F480}", "\xD7"),
452
+ [LogLevelLabel.WARN]: useIcon("\u26A0", "\u203C"),
453
+ [LogLevelLabel.INFO]: useIcon("\u2139", "i"),
454
+ [LogLevelLabel.SUCCESS]: useIcon("\u2714", "\u221A"),
455
+ [LogLevelLabel.DEBUG]: useIcon("\u{1F6E0}", "D"),
456
+ [LogLevelLabel.TRACE]: useIcon("\u2709", "\u2192")
457
+ };
458
+
459
+ // ../config-tools/src/logger/format-timestamp.ts
460
+ var formatTimestamp = /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0, (date = /* @__PURE__ */ new Date()) => {
461
+ return `${date.toLocaleDateString()} ${date.toLocaleTimeString()}`;
462
+ }, "formatTimestamp");
463
+
425
464
  // ../config-tools/src/logger/console.ts
426
465
  var getLogFn = /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0, (logLevel = LogLevel.INFO, config = {}) => {
427
466
  const _chalk = getChalk();
@@ -433,42 +472,49 @@ var getLogFn = /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0, (logLevel =
433
472
  }
434
473
  if (typeof logLevel === "number" && LogLevel.FATAL >= logLevel || typeof logLevel === "string" && LogLevel.FATAL >= getLogLevel(logLevel)) {
435
474
  return (message) => {
436
- console.error(`${_chalk.bold.hex(_nullishCoalesce(colors.fatal, () => ( "#7d1a1a")))(">")} ${_chalk.bold.bgHex(_nullishCoalesce(colors.fatal, () => ( "#7d1a1a"))).whiteBright(" \u{1F480} Fatal ")} ${_chalk.hex(_nullishCoalesce(colors.fatal, () => ( "#7d1a1a")))(formatLogMessage(message))}
475
+ console.error(`
476
+ ${_chalk.gray(formatTimestamp())} ${_chalk.bold.hex(_nullishCoalesce(colors.fatal, () => ( "#7d1a1a")))(`[${CONSOLE_ICONS[LogLevelLabel.FATAL]} Fatal]`)} ${_chalk.hex(_nullishCoalesce(colors.fatal, () => ( "#7d1a1a")))(formatLogMessage(message))}
437
477
  `);
438
478
  };
439
479
  }
440
480
  if (typeof logLevel === "number" && LogLevel.ERROR >= logLevel || typeof logLevel === "string" && LogLevel.ERROR >= getLogLevel(logLevel)) {
441
481
  return (message) => {
442
- console.error(`${_chalk.bold.hex(_nullishCoalesce(colors.danger, () => ( "#f85149")))(">")} ${_chalk.bold.bgHex(_nullishCoalesce(colors.danger, () => ( "#f85149"))).whiteBright(" \u2718 Error ")} ${_chalk.hex(_nullishCoalesce(colors.danger, () => ( "#f85149")))(formatLogMessage(message))}
482
+ console.error(`
483
+ ${_chalk.gray(formatTimestamp())} ${_chalk.bold.hex(_nullishCoalesce(colors.danger, () => ( "#f85149")))(`[${CONSOLE_ICONS[LogLevelLabel.ERROR]} Error]`)} ${_chalk.hex(_nullishCoalesce(colors.danger, () => ( "#f85149")))(formatLogMessage(message))}
443
484
  `);
444
485
  };
445
486
  }
446
487
  if (typeof logLevel === "number" && LogLevel.WARN >= logLevel || typeof logLevel === "string" && LogLevel.WARN >= getLogLevel(logLevel)) {
447
488
  return (message) => {
448
- console.warn(`${_chalk.bold.hex(_nullishCoalesce(colors.warning, () => ( "#e3b341")))(">")} ${_chalk.bold.bgHex(_nullishCoalesce(colors.warning, () => ( "#e3b341"))).whiteBright(" \u26A0 Warn ")} ${_chalk.hex(_nullishCoalesce(colors.warning, () => ( "#e3b341")))(formatLogMessage(message))}
489
+ console.warn(`
490
+ ${_chalk.gray(formatTimestamp())} ${_chalk.bold.hex(_nullishCoalesce(colors.warning, () => ( "#e3b341")))(`[${CONSOLE_ICONS[LogLevelLabel.WARN]} Warn]`)} ${_chalk.hex(_nullishCoalesce(colors.warning, () => ( "#e3b341")))(formatLogMessage(message))}
449
491
  `);
450
492
  };
451
493
  }
452
494
  if (typeof logLevel === "number" && LogLevel.SUCCESS >= logLevel || typeof logLevel === "string" && LogLevel.SUCCESS >= getLogLevel(logLevel)) {
453
495
  return (message) => {
454
- console.info(`${_chalk.bold.hex(_nullishCoalesce(colors.success, () => ( "#56d364")))(">")} ${_chalk.bold.bgHex(_nullishCoalesce(colors.success, () => ( "#56d364"))).whiteBright(" \u2713 Success ")} ${_chalk.hex(_nullishCoalesce(colors.success, () => ( "#56d364")))(formatLogMessage(message))}
496
+ console.info(`
497
+ ${_chalk.gray(formatTimestamp())} ${_chalk.bold.hex(_nullishCoalesce(colors.success, () => ( "#56d364")))(`[${CONSOLE_ICONS[LogLevelLabel.SUCCESS]} Success]`)} ${_chalk.hex(_nullishCoalesce(colors.success, () => ( "#56d364")))(formatLogMessage(message))}
455
498
  `);
456
499
  };
457
500
  }
458
501
  if (typeof logLevel === "number" && LogLevel.INFO >= logLevel || typeof logLevel === "string" && LogLevel.INFO >= getLogLevel(logLevel)) {
459
502
  return (message) => {
460
- console.info(`${_chalk.bold.hex(_nullishCoalesce(colors.info, () => ( "#58a6ff")))(">")} ${_chalk.bold.bgHex(_nullishCoalesce(colors.info, () => ( "#58a6ff"))).whiteBright(" \u2139 Info ")} ${_chalk.hex(_nullishCoalesce(colors.info, () => ( "#58a6ff")))(formatLogMessage(message))}
503
+ console.info(`
504
+ ${_chalk.gray(formatTimestamp())} ${_chalk.bold.hex(_nullishCoalesce(colors.info, () => ( "#58a6ff")))(`[${CONSOLE_ICONS[LogLevelLabel.INFO]} Info]`)} ${_chalk.hex(_nullishCoalesce(colors.info, () => ( "#58a6ff")))(formatLogMessage(message))}
461
505
  `);
462
506
  };
463
507
  }
464
508
  if (typeof logLevel === "number" && LogLevel.TRACE >= logLevel || typeof logLevel === "string" && LogLevel.TRACE >= getLogLevel(logLevel)) {
465
509
  return (message) => {
466
- console.debug(`${_chalk.bold.hex(_nullishCoalesce(colors.brand, () => ( "#1fb2a6")))(">")} ${_chalk.bold.bgHex(_nullishCoalesce(colors.brand, () => ( "#1fb2a6"))).whiteBright(" \u{1F6E0} Debug ")} ${_chalk.hex(_nullishCoalesce(colors.brand, () => ( "#1fb2a6")))(formatLogMessage(message))}
510
+ console.debug(`
511
+ ${_chalk.gray(formatTimestamp())} ${_chalk.bold.hex(_nullishCoalesce(colors.brand, () => ( "#1fb2a6")))(`[${CONSOLE_ICONS[LogLevelLabel.TRACE]} Debug]`)} ${_chalk.hex(_nullishCoalesce(colors.brand, () => ( "#1fb2a6")))(formatLogMessage(message))}
467
512
  `);
468
513
  };
469
514
  }
470
515
  return (message) => {
471
- console.log(`${_chalk.bold.hex(_nullishCoalesce(colors.brand, () => ( "#1fb2a6")))(">")} ${_chalk.bold.bgHex(_nullishCoalesce(colors.brand, () => ( "#1fb2a6"))).whiteBright(" \u2709 System ")} ${_chalk.hex(_nullishCoalesce(colors.brand, () => ( "#1fb2a6")))(formatLogMessage(message))}
516
+ console.log(`
517
+ ${_chalk.gray(formatTimestamp())} ${_chalk.bold.hex(_nullishCoalesce(colors.brand, () => ( "#1fb2a6")))(`[${CONSOLE_ICONS[LogLevelLabel.ALL]} System]`)} ${_chalk.hex(_nullishCoalesce(colors.brand, () => ( "#1fb2a6")))(formatLogMessage(message))}
472
518
  `);
473
519
  };
474
520
  }, "getLogFn");
package/dist/clean.cjs CHANGED
@@ -1,9 +1,9 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkTP5EOMRDcjs = require('./chunk-TP5EOMRD.cjs');
4
- require('./chunk-VBINBV4Z.cjs');
3
+ var _chunkUJM4BCSPcjs = require('./chunk-UJM4BCSP.cjs');
4
+ require('./chunk-ZKJVN5D7.cjs');
5
5
  require('./chunk-LVWQSCJM.cjs');
6
6
  require('./chunk-BGYQAVKQ.cjs');
7
7
 
8
8
 
9
- exports.clean = _chunkTP5EOMRDcjs.clean;
9
+ exports.clean = _chunkUJM4BCSPcjs.clean;