@storm-software/esbuild 0.22.1 → 0.22.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.
package/README.md CHANGED
@@ -21,7 +21,7 @@ This package is part of the <b>⚡Storm-Ops</b> monorepo. The Storm-Ops packages
21
21
 
22
22
  <h3 align="center">💻 Visit <a href="https://stormsoftware.com" target="_blank">stormsoftware.com</a> to stay up to date with this developer</h3><br />
23
23
 
24
- [![Version](https://img.shields.io/badge/version-0.22.0-1fb2a6.svg?style=for-the-badge&color=1fb2a6)](https://prettier.io/)&nbsp;[![Nx](https://img.shields.io/badge/Nx-17.0.2-lightgrey?style=for-the-badge&logo=nx&logoWidth=20&&color=1fb2a6)](http://nx.dev/)&nbsp;[![NextJs](https://img.shields.io/badge/Next.js-14.0.2-lightgrey?style=for-the-badge&logo=nextdotjs&logoWidth=20&color=1fb2a6)](https://nextjs.org/)&nbsp;[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg?style=for-the-badge&logo=commitlint&color=1fb2a6)](http://commitizen.github.io/cz-cli/)&nbsp;![Semantic-Release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=for-the-badge&color=1fb2a6)&nbsp;[![documented with Fumadocs](https://img.shields.io/badge/documented_with-fumadocs-success.svg?style=for-the-badge&logo=readthedocs&color=1fb2a6)](https://fumadocs.vercel.app/)&nbsp;![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/storm-software/storm-ops/cr.yml?style=for-the-badge&logo=github-actions&color=1fb2a6)
24
+ [![Version](https://img.shields.io/badge/version-0.22.3-1fb2a6.svg?style=for-the-badge&color=1fb2a6)](https://prettier.io/)&nbsp;[![Nx](https://img.shields.io/badge/Nx-17.0.2-lightgrey?style=for-the-badge&logo=nx&logoWidth=20&&color=1fb2a6)](http://nx.dev/)&nbsp;[![NextJs](https://img.shields.io/badge/Next.js-14.0.2-lightgrey?style=for-the-badge&logo=nextdotjs&logoWidth=20&color=1fb2a6)](https://nextjs.org/)&nbsp;[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg?style=for-the-badge&logo=commitlint&color=1fb2a6)](http://commitizen.github.io/cz-cli/)&nbsp;![Semantic-Release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=for-the-badge&color=1fb2a6)&nbsp;[![documented with Fumadocs](https://img.shields.io/badge/documented_with-fumadocs-success.svg?style=for-the-badge&logo=readthedocs&color=1fb2a6)](https://fumadocs.vercel.app/)&nbsp;![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/storm-software/storm-ops/cr.yml?style=for-the-badge&logo=github-actions&color=1fb2a6)
25
25
 
26
26
  <!-- prettier-ignore-start -->
27
27
  <!-- markdownlint-disable -->
package/dist/build.cjs CHANGED
@@ -1,13 +1,14 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkMSCC7MGMcjs = require('./chunk-MSCC7MGM.cjs');
4
- require('./chunk-UEYUN2J6.cjs');
5
- require('./chunk-CJ3YJPNC.cjs');
3
+
4
+ var _chunkZQYP5TTVcjs = require('./chunk-ZQYP5TTV.cjs');
5
+ require('./chunk-V747733R.cjs');
6
+ require('./chunk-U2QMMQDA.cjs');
6
7
  require('./chunk-S6M44SSZ.cjs');
7
8
  require('./chunk-WRBUO7H6.cjs');
8
9
  require('./chunk-AP5TC7E5.cjs');
9
10
  require('./chunk-5UODOOQA.cjs');
10
- require('./chunk-W6IC5BU4.cjs');
11
+ require('./chunk-YHAEJIC5.cjs');
11
12
  require('./chunk-CNHHELK6.cjs');
12
13
  require('./chunk-MPZUORUA.cjs');
13
14
  require('./chunk-GHWCUMOG.cjs');
@@ -16,4 +17,5 @@ require('./chunk-EZGTDCYM.cjs');
16
17
  require('./chunk-BGYQAVKQ.cjs');
17
18
 
18
19
 
19
- exports.build = _chunkMSCC7MGMcjs.build;
20
+
21
+ exports.build = _chunkZQYP5TTVcjs.build; exports.cleanOutputPath = _chunkZQYP5TTVcjs.cleanOutputPath;
package/dist/build.d.cts CHANGED
@@ -1,10 +1,16 @@
1
- import { ESBuildOptions } from './types.cjs';
1
+ import { ESBuildContext, ESBuildOptions } from './types.cjs';
2
2
  import '@nx/devkit';
3
3
  import '@storm-software/build-tools';
4
4
  import 'esbuild';
5
5
  import 'rollup';
6
6
  import 'source-map';
7
7
 
8
+ /**
9
+ * Clean the output path
10
+ *
11
+ * @param context - the build context
12
+ */
13
+ declare function cleanOutputPath(context: ESBuildContext): Promise<ESBuildContext>;
8
14
  /**
9
15
  * Execution pipeline that applies a set of actions
10
16
  *
@@ -13,4 +19,4 @@ import 'source-map';
13
19
  */
14
20
  declare function build(options: ESBuildOptions | ESBuildOptions[]): Promise<void>;
15
21
 
16
- export { build };
22
+ export { build, cleanOutputPath };
package/dist/build.d.ts CHANGED
@@ -1,10 +1,16 @@
1
- import { ESBuildOptions } from './types.js';
1
+ import { ESBuildContext, ESBuildOptions } from './types.js';
2
2
  import '@nx/devkit';
3
3
  import '@storm-software/build-tools';
4
4
  import 'esbuild';
5
5
  import 'rollup';
6
6
  import 'source-map';
7
7
 
8
+ /**
9
+ * Clean the output path
10
+ *
11
+ * @param context - the build context
12
+ */
13
+ declare function cleanOutputPath(context: ESBuildContext): Promise<ESBuildContext>;
8
14
  /**
9
15
  * Execution pipeline that applies a set of actions
10
16
  *
@@ -13,4 +19,4 @@ import 'source-map';
13
19
  */
14
20
  declare function build(options: ESBuildOptions | ESBuildOptions[]): Promise<void>;
15
21
 
16
- export { build };
22
+ export { build, cleanOutputPath };
package/dist/build.js CHANGED
@@ -1,13 +1,14 @@
1
1
  import {
2
- build
3
- } from "./chunk-57U4XU5O.js";
4
- import "./chunk-V7HJ2CJT.js";
5
- import "./chunk-7N4NGXDE.js";
2
+ build,
3
+ cleanOutputPath
4
+ } from "./chunk-HXF5CHDH.js";
5
+ import "./chunk-JYZKDIZJ.js";
6
+ import "./chunk-2STSOOUQ.js";
6
7
  import "./chunk-T5272PC2.js";
7
8
  import "./chunk-LYDEMC26.js";
8
9
  import "./chunk-5A3PLYYB.js";
9
10
  import "./chunk-XOY3T2ZQ.js";
10
- import "./chunk-XCY6RUA6.js";
11
+ import "./chunk-RIVOXICH.js";
11
12
  import "./chunk-4Q76YH6E.js";
12
13
  import "./chunk-B2PY326H.js";
13
14
  import "./chunk-P4V2LVOO.js";
@@ -15,5 +16,6 @@ import "./chunk-YNQ45EAM.js";
15
16
  import "./chunk-GWG4HOQ6.js";
16
17
  import "./chunk-3GQAWCBQ.js";
17
18
  export {
18
- build
19
+ build,
20
+ cleanOutputPath
19
21
  };
@@ -12,7 +12,7 @@ import {
12
12
  } from "./chunk-XOY3T2ZQ.js";
13
13
  import {
14
14
  tscPlugin
15
- } from "./chunk-XCY6RUA6.js";
15
+ } from "./chunk-RIVOXICH.js";
16
16
  import {
17
17
  COLOR_KEYS,
18
18
  LogLevel,
@@ -1,6 +1,6 @@
1
1
  import {
2
- clean
3
- } from "./chunk-V7HJ2CJT.js";
2
+ cleanDirectories
3
+ } from "./chunk-JYZKDIZJ.js";
4
4
  import {
5
5
  DEFAULT_BUILD_OPTIONS,
6
6
  DEFAULT_COMPILED_BANNER,
@@ -14,7 +14,7 @@ import {
14
14
  getEntryPoints,
15
15
  getEnv,
16
16
  getOutputExtensionMap
17
- } from "./chunk-7N4NGXDE.js";
17
+ } from "./chunk-2STSOOUQ.js";
18
18
  import {
19
19
  depsCheckPlugin
20
20
  } from "./chunk-4Q76YH6E.js";
@@ -36,7 +36,6 @@ import {
36
36
  } from "./chunk-3GQAWCBQ.js";
37
37
 
38
38
  // src/build.ts
39
- import { hfs } from "@humanfs/node";
40
39
  import { createProjectGraphAsync, readProjectsConfigurationFromProjectGraph, writeJsonFile } from "@nx/devkit";
41
40
  import { watch as createWatcher } from "chokidar";
42
41
  import defu from "defu";
@@ -44,6 +43,8 @@ import { debounce, flatten } from "es-toolkit";
44
43
  import { map } from "es-toolkit/compat";
45
44
  import * as esbuild from "esbuild";
46
45
  import { globbySync } from "globby";
46
+ import { existsSync } from "node:fs";
47
+ import hf from "node:fs/promises";
47
48
  import { findWorkspaceRoot } from "nx/src/utils/find-workspace-root";
48
49
 
49
50
  // src/base/renderer-engine.ts
@@ -284,10 +285,11 @@ var resolveOptions = /* @__PURE__ */ __name(async (userOptions) => {
284
285
  exitOnError: true
285
286
  });
286
287
  const projectJsonPath = joinPaths(workspaceRoot.dir, projectRoot, "project.json");
287
- if (!await hfs.isFile(projectJsonPath)) {
288
+ if (!existsSync(projectJsonPath)) {
288
289
  throw new Error("Cannot find project.json configuration");
289
290
  }
290
- const projectJson = await hfs.json(projectJsonPath);
291
+ const projectJsonFile = await hf.readFile(projectJsonPath, "utf8");
292
+ const projectJson = JSON.parse(projectJsonFile);
291
293
  const projectName = projectJson.name;
292
294
  const projectConfigurations = readProjectsConfigurationFromProjectGraph(projectGraph);
293
295
  if (!projectConfigurations?.projects?.[projectName]) {
@@ -297,10 +299,11 @@ var resolveOptions = /* @__PURE__ */ __name(async (userOptions) => {
297
299
  options.name ??= `${projectName}-${options.format}`;
298
300
  options.target ??= DEFAULT_TARGET;
299
301
  const packageJsonPath = joinPaths(workspaceRoot.dir, options.projectRoot, "package.json");
300
- if (!await hfs.isFile(packageJsonPath)) {
302
+ if (!existsSync(packageJsonPath)) {
301
303
  throw new Error("Cannot find package.json configuration");
302
304
  }
303
- const packageJson = await hfs.json(packageJsonPath);
305
+ const packageJsonFile = await hf.readFile(packageJsonPath, "utf8");
306
+ const packageJson = JSON.parse(packageJsonFile);
304
307
  const outExtension = getOutputExtensionMap(options, packageJson.type);
305
308
  const env = getEnv("esbuild", options);
306
309
  const result = {
@@ -379,14 +382,15 @@ var resolveOptions = /* @__PURE__ */ __name(async (userOptions) => {
379
382
  return result;
380
383
  }, "resolveOptions");
381
384
  async function generatePackageJson(context2) {
382
- if (context2.options.generatePackageJson !== false && await hfs.isFile(joinPaths(context2.options.projectRoot, "package.json"))) {
385
+ if (context2.options.generatePackageJson !== false && existsSync(joinPaths(context2.options.projectRoot, "package.json"))) {
383
386
  writeDebug(" \u270D\uFE0F Writing package.json file", context2.options.config);
384
387
  const stopwatch = getStopwatch("Write package.json file");
385
388
  const packageJsonPath = joinPaths(context2.options.projectRoot, "project.json");
386
- if (!await hfs.isFile(packageJsonPath)) {
389
+ if (!existsSync(packageJsonPath)) {
387
390
  throw new Error("Cannot find package.json configuration");
388
391
  }
389
- let packageJson = await hfs.json(joinPaths(context2.options.config.workspaceRoot, context2.options.projectRoot, "package.json"));
392
+ const packageJsonFile = await hf.readFile(joinPaths(context2.options.config.workspaceRoot, context2.options.projectRoot, "package.json"), "utf8");
393
+ let packageJson = JSON.parse(packageJsonFile);
390
394
  if (!packageJson) {
391
395
  throw new Error("Cannot find package.json configuration file");
392
396
  }
@@ -459,7 +463,7 @@ async function executeEsBuild(context2) {
459
463
  const result = await esbuild.build(context2.options);
460
464
  if (result.metafile) {
461
465
  const metafilePath = `${context2.options.outdir}/${context2.options.name}.meta.json`;
462
- await hfs.write(metafilePath, JSON.stringify(result.metafile));
466
+ await hf.writeFile(metafilePath, JSON.stringify(result.metafile));
463
467
  }
464
468
  stopwatch();
465
469
  return context2;
@@ -516,7 +520,10 @@ async function dependencyCheck(options) {
516
520
  __name(dependencyCheck, "dependencyCheck");
517
521
  async function cleanOutputPath(context2) {
518
522
  if (context2.options.clean !== false && context2.options.outdir) {
519
- await clean(context2.options.name, context2.options.outdir, context2.options.config);
523
+ writeDebug(` \u{1F9F9} Cleaning ${context2.options.name} output path: ${context2.options.outdir}`, context2.options.config);
524
+ const stopwatch = getStopwatch(`${context2.options.name} output clean`);
525
+ await cleanDirectories(context2.options.name, context2.options.outdir, context2.options.config);
526
+ stopwatch();
520
527
  }
521
528
  return context2;
522
529
  }
@@ -578,5 +585,6 @@ export {
578
585
  Mapper,
579
586
  transduce,
580
587
  pipe,
588
+ cleanOutputPath,
581
589
  build2 as build
582
590
  };
@@ -7,15 +7,23 @@ import {
7
7
  } from "./chunk-3GQAWCBQ.js";
8
8
 
9
9
  // src/clean.ts
10
- import { hfs } from "@humanfs/node";
10
+ import { rm } from "node:fs/promises";
11
11
  async function clean(name = "ESBuild", directory, config) {
12
12
  writeDebug(` \u{1F9F9} Cleaning ${name} output path: ${directory}`, config);
13
13
  const stopwatch = getStopwatch(`${name} output clean`);
14
- await hfs.deleteAll(directory);
14
+ await cleanDirectories(name, directory, config);
15
15
  stopwatch();
16
16
  }
17
17
  __name(clean, "clean");
18
+ async function cleanDirectories(name = "ESBuild", directory, config) {
19
+ await rm(directory, {
20
+ recursive: true,
21
+ force: true
22
+ });
23
+ }
24
+ __name(cleanDirectories, "cleanDirectories");
18
25
 
19
26
  export {
20
- clean
27
+ clean,
28
+ cleanDirectories
21
29
  };
@@ -10,7 +10,6 @@ import {
10
10
  } from "./chunk-3GQAWCBQ.js";
11
11
 
12
12
  // src/plugins/tsc.ts
13
- import { hfs } from "@humanfs/node";
14
13
  import { Extractor, ExtractorConfig } from "@microsoft/api-extractor";
15
14
 
16
15
  // ../config-tools/src/utilities/run.ts
@@ -33,6 +32,8 @@ var run = /* @__PURE__ */ __name((config, command, cwd = config.workspaceRoot ??
33
32
  }, "run");
34
33
 
35
34
  // src/plugins/tsc.ts
35
+ import { existsSync } from "node:fs";
36
+ import fs from "node:fs/promises";
36
37
  function bundleTypeDefinitions(filename, outfile, externals, options) {
37
38
  const { dependencies, peerDependencies, devDependencies } = __require(joinPaths(options.projectRoot, "package.json"));
38
39
  const dependenciesKeys = Object.keys(dependencies ?? {}).flatMap((p) => [
@@ -105,18 +106,18 @@ var tscPlugin = /* @__PURE__ */ __name((options, resolvedOptions) => ({
105
106
  const entryPoint = resolvedOptions.entryPoints[0].replace(sourceRoot, "").replace(/\.ts$/, "");
106
107
  const bundlePath = joinPaths(resolvedOptions.outdir, entryPoint);
107
108
  let dtsPath;
108
- if (await hfs.isFile(joinPaths(resolvedOptions.config.workspaceRoot, typeOutDir, `${entryPoint}.d.ts`))) {
109
+ if (existsSync(joinPaths(resolvedOptions.config.workspaceRoot, typeOutDir, `${entryPoint}.d.ts`))) {
109
110
  dtsPath = joinPaths(resolvedOptions.config.workspaceRoot, typeOutDir, `${entryPoint}.d.ts`);
110
- } else if (await hfs.isFile(joinPaths(resolvedOptions.config.workspaceRoot, typeOutDir, `${entryPoint.replace(/^src\//, "")}.d.ts`))) {
111
+ } else if (existsSync(joinPaths(resolvedOptions.config.workspaceRoot, typeOutDir, `${entryPoint.replace(/^src\//, "")}.d.ts`))) {
111
112
  dtsPath = joinPaths(resolvedOptions.config.workspaceRoot, typeOutDir, `${entryPoint.replace(/^src\//, "")}.d.ts`);
112
113
  }
113
114
  const ext = resolvedOptions.outExtension.dts || resolvedOptions.format === "esm" ? "d.mts" : "d.ts";
114
115
  if (process.env.WATCH !== "true" && process.env.DEV !== "true") {
115
116
  bundleTypeDefinitions(dtsPath, bundlePath, resolvedOptions.external ?? [], resolvedOptions);
116
- const dtsContents = await hfs.text(`${bundlePath}.d.ts`);
117
- await hfs.write(`${bundlePath}.${ext}`, dtsContents);
117
+ const dtsContents = await fs.readFile(`${bundlePath}.d.ts`, "utf8");
118
+ await fs.writeFile(`${bundlePath}.${ext}`, dtsContents);
118
119
  } else {
119
- await hfs.write(`${bundlePath}.${ext}`, `export * from './${entryPoint}'`);
120
+ await fs.writeFile(`${bundlePath}.${ext}`, `export * from './${entryPoint}'`);
120
121
  }
121
122
  }
122
123
  });
@@ -12,7 +12,7 @@ var _chunkAP5TC7E5cjs = require('./chunk-AP5TC7E5.cjs');
12
12
  var _chunk5UODOOQAcjs = require('./chunk-5UODOOQA.cjs');
13
13
 
14
14
 
15
- var _chunkW6IC5BU4cjs = require('./chunk-W6IC5BU4.cjs');
15
+ var _chunkYHAEJIC5cjs = require('./chunk-YHAEJIC5.cjs');
16
16
 
17
17
 
18
18
 
@@ -856,7 +856,7 @@ var getDefaultBuildPlugins = /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void
856
856
  _chunkEZGTDCYMcjs.fixImportsPlugin.call(void 0, options, resolvedOptions),
857
857
  _chunkS6M44SSZcjs.nativeNodeModulesPlugin.call(void 0, options, resolvedOptions),
858
858
  _chunkCGFDQ5AJcjs.esmSplitCodeToCjsPlugin.call(void 0, options, resolvedOptions),
859
- _chunkW6IC5BU4cjs.tscPlugin.call(void 0, options, resolvedOptions),
859
+ _chunkYHAEJIC5cjs.tscPlugin.call(void 0, options, resolvedOptions),
860
860
  _chunkAP5TC7E5cjs.onErrorPlugin.call(void 0, options, resolvedOptions)
861
861
  ], "getDefaultBuildPlugins");
862
862
  var DEFAULT_BUILD_OPTIONS = {
@@ -7,15 +7,23 @@ var _chunkMPZUORUAcjs = require('./chunk-MPZUORUA.cjs');
7
7
  var _chunkBGYQAVKQcjs = require('./chunk-BGYQAVKQ.cjs');
8
8
 
9
9
  // src/clean.ts
10
- var _node = require('@humanfs/node');
10
+ var _promises = require('fs/promises');
11
11
  async function clean(name = "ESBuild", directory, config) {
12
12
  _chunkMPZUORUAcjs.writeDebug.call(void 0, ` \u{1F9F9} Cleaning ${name} output path: ${directory}`, config);
13
13
  const stopwatch = _chunkMPZUORUAcjs.getStopwatch.call(void 0, `${name} output clean`);
14
- await _node.hfs.deleteAll(directory);
14
+ await cleanDirectories(name, directory, config);
15
15
  stopwatch();
16
16
  }
17
17
  _chunkBGYQAVKQcjs.__name.call(void 0, clean, "clean");
18
+ async function cleanDirectories(name = "ESBuild", directory, config) {
19
+ await _promises.rm.call(void 0, directory, {
20
+ recursive: true,
21
+ force: true
22
+ });
23
+ }
24
+ _chunkBGYQAVKQcjs.__name.call(void 0, cleanDirectories, "cleanDirectories");
25
+
18
26
 
19
27
 
20
28
 
21
- exports.clean = clean;
29
+ exports.clean = clean; exports.cleanDirectories = cleanDirectories;
@@ -1,4 +1,4 @@
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; }
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(); } } 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
3
  var _chunkMPZUORUAcjs = require('./chunk-MPZUORUA.cjs');
4
4
 
@@ -10,7 +10,6 @@ var _chunkGHWCUMOGcjs = require('./chunk-GHWCUMOG.cjs');
10
10
  var _chunkBGYQAVKQcjs = require('./chunk-BGYQAVKQ.cjs');
11
11
 
12
12
  // src/plugins/tsc.ts
13
- var _node = require('@humanfs/node');
14
13
  var _apiextractor = require('@microsoft/api-extractor');
15
14
 
16
15
  // ../config-tools/src/utilities/run.ts
@@ -33,6 +32,8 @@ var run = /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0, (config, command
33
32
  }, "run");
34
33
 
35
34
  // src/plugins/tsc.ts
35
+ var _fs = require('fs');
36
+ var _promises = require('fs/promises'); var _promises2 = _interopRequireDefault(_promises);
36
37
  function bundleTypeDefinitions(filename, outfile, externals, options) {
37
38
  const { dependencies, peerDependencies, devDependencies } = _chunkBGYQAVKQcjs.__require.call(void 0, _chunkGHWCUMOGcjs.joinPaths.call(void 0, options.projectRoot, "package.json"));
38
39
  const dependenciesKeys = Object.keys(_nullishCoalesce(dependencies, () => ( {}))).flatMap((p) => [
@@ -105,18 +106,18 @@ var tscPlugin = /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0, (options,
105
106
  const entryPoint = resolvedOptions.entryPoints[0].replace(sourceRoot, "").replace(/\.ts$/, "");
106
107
  const bundlePath = _chunkGHWCUMOGcjs.joinPaths.call(void 0, resolvedOptions.outdir, entryPoint);
107
108
  let dtsPath;
108
- if (await _node.hfs.isFile(_chunkGHWCUMOGcjs.joinPaths.call(void 0, resolvedOptions.config.workspaceRoot, typeOutDir, `${entryPoint}.d.ts`))) {
109
+ if (_fs.existsSync.call(void 0, _chunkGHWCUMOGcjs.joinPaths.call(void 0, resolvedOptions.config.workspaceRoot, typeOutDir, `${entryPoint}.d.ts`))) {
109
110
  dtsPath = _chunkGHWCUMOGcjs.joinPaths.call(void 0, resolvedOptions.config.workspaceRoot, typeOutDir, `${entryPoint}.d.ts`);
110
- } else if (await _node.hfs.isFile(_chunkGHWCUMOGcjs.joinPaths.call(void 0, resolvedOptions.config.workspaceRoot, typeOutDir, `${entryPoint.replace(/^src\//, "")}.d.ts`))) {
111
+ } else if (_fs.existsSync.call(void 0, _chunkGHWCUMOGcjs.joinPaths.call(void 0, resolvedOptions.config.workspaceRoot, typeOutDir, `${entryPoint.replace(/^src\//, "")}.d.ts`))) {
111
112
  dtsPath = _chunkGHWCUMOGcjs.joinPaths.call(void 0, resolvedOptions.config.workspaceRoot, typeOutDir, `${entryPoint.replace(/^src\//, "")}.d.ts`);
112
113
  }
113
114
  const ext = resolvedOptions.outExtension.dts || resolvedOptions.format === "esm" ? "d.mts" : "d.ts";
114
115
  if (process.env.WATCH !== "true" && process.env.DEV !== "true") {
115
116
  bundleTypeDefinitions(dtsPath, bundlePath, _nullishCoalesce(resolvedOptions.external, () => ( [])), resolvedOptions);
116
- const dtsContents = await _node.hfs.text(`${bundlePath}.d.ts`);
117
- await _node.hfs.write(`${bundlePath}.${ext}`, dtsContents);
117
+ const dtsContents = await _promises2.default.readFile(`${bundlePath}.d.ts`, "utf8");
118
+ await _promises2.default.writeFile(`${bundlePath}.${ext}`, dtsContents);
118
119
  } else {
119
- await _node.hfs.write(`${bundlePath}.${ext}`, `export * from './${entryPoint}'`);
120
+ await _promises2.default.writeFile(`${bundlePath}.${ext}`, `export * from './${entryPoint}'`);
120
121
  }
121
122
  }
122
123
  });
@@ -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 _chunkUEYUN2J6cjs = require('./chunk-UEYUN2J6.cjs');
3
+ var _chunkV747733Rcjs = require('./chunk-V747733R.cjs');
4
4
 
5
5
 
6
6
 
@@ -14,7 +14,7 @@ var _chunkUEYUN2J6cjs = require('./chunk-UEYUN2J6.cjs');
14
14
 
15
15
 
16
16
 
17
- var _chunkCJ3YJPNCcjs = require('./chunk-CJ3YJPNC.cjs');
17
+ var _chunkU2QMMQDAcjs = require('./chunk-U2QMMQDA.cjs');
18
18
 
19
19
 
20
20
  var _chunkCNHHELK6cjs = require('./chunk-CNHHELK6.cjs');
@@ -36,7 +36,6 @@ var _chunkGHWCUMOGcjs = require('./chunk-GHWCUMOG.cjs');
36
36
  var _chunkBGYQAVKQcjs = require('./chunk-BGYQAVKQ.cjs');
37
37
 
38
38
  // src/build.ts
39
- var _node = require('@humanfs/node');
40
39
  var _devkit = require('@nx/devkit');
41
40
  var _chokidar = require('chokidar');
42
41
  var _defu = require('defu'); var _defu2 = _interopRequireDefault(_defu);
@@ -44,6 +43,8 @@ var _estoolkit = require('es-toolkit');
44
43
  var _compat = require('es-toolkit/compat');
45
44
  var _esbuild = require('esbuild'); var esbuild = _interopRequireWildcard(_esbuild);
46
45
  var _globby = require('globby');
46
+ var _fs = require('fs'); var _fs2 = _interopRequireDefault(_fs);
47
+ var _promises = require('fs/promises'); var _promises2 = _interopRequireDefault(_promises);
47
48
  var _findworkspaceroot = require('nx/src/utils/find-workspace-root');
48
49
 
49
50
  // src/base/renderer-engine.ts
@@ -51,7 +52,7 @@ var _path = require('path'); var _path2 = _interopRequireDefault(_path);
51
52
  var _sourcemap = require('source-map');
52
53
 
53
54
  // src/utilities/output-file.ts
54
- var _fs = require('fs'); var _fs2 = _interopRequireDefault(_fs);
55
+
55
56
 
56
57
  var outputFile = /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0, async (filepath, data, options) => {
57
58
  await _fs2.default.promises.mkdir(_path2.default.dirname(filepath), {
@@ -277,32 +278,34 @@ var resolveOptions = /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0, async
277
278
  if (!workspaceRoot) {
278
279
  throw new Error("Cannot find Nx workspace root");
279
280
  }
280
- const config = await _chunkCJ3YJPNCcjs.getConfig.call(void 0, workspaceRoot.dir);
281
+ const config = await _chunkU2QMMQDAcjs.getConfig.call(void 0, workspaceRoot.dir);
281
282
  _chunkMPZUORUAcjs.writeDebug.call(void 0, " \u2699\uFE0F Resolving build options", config);
282
283
  const stopwatch = _chunkMPZUORUAcjs.getStopwatch.call(void 0, "Build options resolution");
283
284
  const projectGraph = await _devkit.createProjectGraphAsync.call(void 0, {
284
285
  exitOnError: true
285
286
  });
286
287
  const projectJsonPath = _chunkGHWCUMOGcjs.joinPaths.call(void 0, workspaceRoot.dir, projectRoot, "project.json");
287
- if (!await _node.hfs.isFile(projectJsonPath)) {
288
+ if (!_fs.existsSync.call(void 0, projectJsonPath)) {
288
289
  throw new Error("Cannot find project.json configuration");
289
290
  }
290
- const projectJson = await _node.hfs.json(projectJsonPath);
291
+ const projectJsonFile = await _promises2.default.readFile(projectJsonPath, "utf8");
292
+ const projectJson = JSON.parse(projectJsonFile);
291
293
  const projectName = projectJson.name;
292
294
  const projectConfigurations = _devkit.readProjectsConfigurationFromProjectGraph.call(void 0, projectGraph);
293
295
  if (!_optionalChain([projectConfigurations, 'optionalAccess', _14 => _14.projects, 'optionalAccess', _15 => _15[projectName]])) {
294
296
  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
297
  }
296
- const options = _defu2.default.call(void 0, userOptions, _chunkCJ3YJPNCcjs.DEFAULT_BUILD_OPTIONS);
298
+ const options = _defu2.default.call(void 0, userOptions, _chunkU2QMMQDAcjs.DEFAULT_BUILD_OPTIONS);
297
299
  options.name ??= `${projectName}-${options.format}`;
298
- options.target ??= _chunkCJ3YJPNCcjs.DEFAULT_TARGET;
300
+ options.target ??= _chunkU2QMMQDAcjs.DEFAULT_TARGET;
299
301
  const packageJsonPath = _chunkGHWCUMOGcjs.joinPaths.call(void 0, workspaceRoot.dir, options.projectRoot, "package.json");
300
- if (!await _node.hfs.isFile(packageJsonPath)) {
302
+ if (!_fs.existsSync.call(void 0, packageJsonPath)) {
301
303
  throw new Error("Cannot find package.json configuration");
302
304
  }
303
- const packageJson = await _node.hfs.json(packageJsonPath);
304
- const outExtension = _chunkCJ3YJPNCcjs.getOutputExtensionMap.call(void 0, options, packageJson.type);
305
- const env = _chunkCJ3YJPNCcjs.getEnv.call(void 0, "esbuild", options);
305
+ const packageJsonFile = await _promises2.default.readFile(packageJsonPath, "utf8");
306
+ const packageJson = JSON.parse(packageJsonFile);
307
+ const outExtension = _chunkU2QMMQDAcjs.getOutputExtensionMap.call(void 0, options, packageJson.type);
308
+ const env = _chunkU2QMMQDAcjs.getEnv.call(void 0, "esbuild", options);
306
309
  const result = {
307
310
  ...options,
308
311
  config,
@@ -322,7 +325,7 @@ var resolveOptions = /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0, async
322
325
  ...userOptions,
323
326
  tsconfig: _chunkGHWCUMOGcjs.joinPaths.call(void 0, projectRoot, userOptions.tsconfig ? userOptions.tsconfig.replace(projectRoot, "") : "tsconfig.json"),
324
327
  format: options.format || "cjs",
325
- entryPoints: await _chunkCJ3YJPNCcjs.getEntryPoints.call(void 0, config, projectRoot, projectJson.sourceRoot, userOptions.entry || [
328
+ entryPoints: await _chunkU2QMMQDAcjs.getEntryPoints.call(void 0, config, projectRoot, projectJson.sourceRoot, userOptions.entry || [
326
329
  "./src/index.ts"
327
330
  ], userOptions.emitOnAll),
328
331
  outdir: userOptions.outputPath || _chunkGHWCUMOGcjs.joinPaths.call(void 0, "dist", projectRoot),
@@ -347,8 +350,8 @@ var resolveOptions = /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0, async
347
350
  outExtension,
348
351
  footer: userOptions.footer,
349
352
  banner: {
350
- js: options.banner || _chunkCJ3YJPNCcjs.DEFAULT_COMPILED_BANNER,
351
- css: options.banner || _chunkCJ3YJPNCcjs.DEFAULT_COMPILED_BANNER
353
+ js: options.banner || _chunkU2QMMQDAcjs.DEFAULT_COMPILED_BANNER,
354
+ css: options.banner || _chunkU2QMMQDAcjs.DEFAULT_COMPILED_BANNER
352
355
  },
353
356
  splitting: options.format === "iife" ? false : typeof options.splitting === "boolean" ? options.splitting : options.format === "esm",
354
357
  treeShaking: options.format === "esm",
@@ -374,27 +377,28 @@ var resolveOptions = /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0, async
374
377
  ..._nullishCoalesce(options.inject, () => ( []))
375
378
  ].filter(Boolean)
376
379
  };
377
- result.plugins = _nullishCoalesce(userOptions.plugins, () => ( _chunkCJ3YJPNCcjs.getDefaultBuildPlugins.call(void 0, userOptions, result)));
380
+ result.plugins = _nullishCoalesce(userOptions.plugins, () => ( _chunkU2QMMQDAcjs.getDefaultBuildPlugins.call(void 0, userOptions, result)));
378
381
  stopwatch();
379
382
  return result;
380
383
  }, "resolveOptions");
381
384
  async function generatePackageJson(context2) {
382
- if (context2.options.generatePackageJson !== false && await _node.hfs.isFile(_chunkGHWCUMOGcjs.joinPaths.call(void 0, context2.options.projectRoot, "package.json"))) {
385
+ if (context2.options.generatePackageJson !== false && _fs.existsSync.call(void 0, _chunkGHWCUMOGcjs.joinPaths.call(void 0, context2.options.projectRoot, "package.json"))) {
383
386
  _chunkMPZUORUAcjs.writeDebug.call(void 0, " \u270D\uFE0F Writing package.json file", context2.options.config);
384
387
  const stopwatch = _chunkMPZUORUAcjs.getStopwatch.call(void 0, "Write package.json file");
385
388
  const packageJsonPath = _chunkGHWCUMOGcjs.joinPaths.call(void 0, context2.options.projectRoot, "project.json");
386
- if (!await _node.hfs.isFile(packageJsonPath)) {
389
+ if (!_fs.existsSync.call(void 0, packageJsonPath)) {
387
390
  throw new Error("Cannot find package.json configuration");
388
391
  }
389
- let packageJson = await _node.hfs.json(_chunkGHWCUMOGcjs.joinPaths.call(void 0, context2.options.config.workspaceRoot, context2.options.projectRoot, "package.json"));
392
+ const packageJsonFile = await _promises2.default.readFile(_chunkGHWCUMOGcjs.joinPaths.call(void 0, context2.options.config.workspaceRoot, context2.options.projectRoot, "package.json"), "utf8");
393
+ let packageJson = JSON.parse(packageJsonFile);
390
394
  if (!packageJson) {
391
395
  throw new Error("Cannot find package.json configuration file");
392
396
  }
393
- packageJson = await _chunkCJ3YJPNCcjs.addPackageDependencies.call(void 0, context2.options.config.workspaceRoot, context2.options.projectRoot, context2.options.projectName, packageJson);
394
- packageJson = await _chunkCJ3YJPNCcjs.addWorkspacePackageJsonFields.call(void 0, context2.options.config, context2.options.projectRoot, context2.options.sourceRoot, context2.options.projectName, false, packageJson);
397
+ packageJson = await _chunkU2QMMQDAcjs.addPackageDependencies.call(void 0, context2.options.config.workspaceRoot, context2.options.projectRoot, context2.options.projectName, packageJson);
398
+ packageJson = await _chunkU2QMMQDAcjs.addWorkspacePackageJsonFields.call(void 0, context2.options.config, context2.options.projectRoot, context2.options.sourceRoot, context2.options.projectName, false, packageJson);
395
399
  packageJson.exports ??= {};
396
400
  packageJson.exports["./package.json"] ??= "./package.json";
397
- packageJson.exports["."] ??= _chunkCJ3YJPNCcjs.addPackageJsonExport.call(void 0, "index", packageJson.type, context2.options.sourceRoot);
401
+ packageJson.exports["."] ??= _chunkU2QMMQDAcjs.addPackageJsonExport.call(void 0, "index", packageJson.type, context2.options.sourceRoot);
398
402
  let entryPoints = [
399
403
  {
400
404
  in: "./src/index.ts",
@@ -412,7 +416,7 @@ async function generatePackageJson(context2) {
412
416
  const split = entryPoint.out.split(".");
413
417
  split.pop();
414
418
  const entry = split.join(".").replaceAll("\\", "/");
415
- packageJson.exports[`./${entry}`] ??= _chunkCJ3YJPNCcjs.addPackageJsonExport.call(void 0, entry, packageJson.type, context2.options.sourceRoot);
419
+ packageJson.exports[`./${entry}`] ??= _chunkU2QMMQDAcjs.addPackageJsonExport.call(void 0, entry, packageJson.type, context2.options.sourceRoot);
416
420
  }
417
421
  }
418
422
  packageJson.main = packageJson.type === "commonjs" ? "./dist/index.js" : "./dist/index.cjs";
@@ -459,7 +463,7 @@ async function executeEsBuild(context2) {
459
463
  const result = await esbuild.build(context2.options);
460
464
  if (result.metafile) {
461
465
  const metafilePath = `${context2.options.outdir}/${context2.options.name}.meta.json`;
462
- await _node.hfs.write(metafilePath, JSON.stringify(result.metafile));
466
+ await _promises2.default.writeFile(metafilePath, JSON.stringify(result.metafile));
463
467
  }
464
468
  stopwatch();
465
469
  return context2;
@@ -469,7 +473,7 @@ async function copyBuildAssets(context2) {
469
473
  if (_optionalChain([context2, 'access', _16 => _16.result, 'optionalAccess', _17 => _17.errors, 'access', _18 => _18.length]) === 0) {
470
474
  _chunkMPZUORUAcjs.writeDebug.call(void 0, ` \u{1F4CB} Copying asset files to output directory: ${context2.options.outdir}`, context2.options.config);
471
475
  const stopwatch = _chunkMPZUORUAcjs.getStopwatch.call(void 0, `${context2.options.name} asset copy`);
472
- await _chunkCJ3YJPNCcjs.copyAssets.call(void 0, context2.options.config, _nullishCoalesce(context2.options.assets, () => ( [])), context2.options.outdir, context2.options.projectRoot, context2.options.sourceRoot, true, false);
476
+ await _chunkU2QMMQDAcjs.copyAssets.call(void 0, context2.options.config, _nullishCoalesce(context2.options.assets, () => ( [])), context2.options.outdir, context2.options.projectRoot, context2.options.sourceRoot, true, false);
473
477
  stopwatch();
474
478
  }
475
479
  return context2;
@@ -516,7 +520,10 @@ async function dependencyCheck(options) {
516
520
  _chunkBGYQAVKQcjs.__name.call(void 0, dependencyCheck, "dependencyCheck");
517
521
  async function cleanOutputPath(context2) {
518
522
  if (context2.options.clean !== false && context2.options.outdir) {
519
- await _chunkUEYUN2J6cjs.clean.call(void 0, context2.options.name, context2.options.outdir, context2.options.config);
523
+ _chunkMPZUORUAcjs.writeDebug.call(void 0, ` \u{1F9F9} Cleaning ${context2.options.name} output path: ${context2.options.outdir}`, context2.options.config);
524
+ const stopwatch = _chunkMPZUORUAcjs.getStopwatch.call(void 0, `${context2.options.name} output clean`);
525
+ await _chunkV747733Rcjs.cleanDirectories.call(void 0, context2.options.name, context2.options.outdir, context2.options.config);
526
+ stopwatch();
520
527
  }
521
528
  return context2;
522
529
  }
@@ -579,4 +586,5 @@ var watch = /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0, (context2, opt
579
586
 
580
587
 
581
588
 
582
- exports.handle = handle; exports.skip = skip; exports.Filter = Filter; exports.Mapper = Mapper; exports.transduce = transduce; exports.pipe = pipe; exports.build = build2;
589
+
590
+ exports.handle = handle; exports.skip = skip; exports.Filter = Filter; exports.Mapper = Mapper; exports.transduce = transduce; exports.pipe = pipe; exports.cleanOutputPath = cleanOutputPath; exports.build = build2;
package/dist/clean.cjs CHANGED
@@ -1,9 +1,11 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkUEYUN2J6cjs = require('./chunk-UEYUN2J6.cjs');
3
+
4
+ var _chunkV747733Rcjs = require('./chunk-V747733R.cjs');
4
5
  require('./chunk-MPZUORUA.cjs');
5
6
  require('./chunk-GHWCUMOG.cjs');
6
7
  require('./chunk-BGYQAVKQ.cjs');
7
8
 
8
9
 
9
- exports.clean = _chunkUEYUN2J6cjs.clean;
10
+
11
+ exports.clean = _chunkV747733Rcjs.clean; exports.cleanDirectories = _chunkV747733Rcjs.cleanDirectories;
package/dist/clean.d.cts CHANGED
@@ -40,15 +40,15 @@ declare const StormConfigSchema: z.ZodObject<{
40
40
  build: z.ZodDefault<z.ZodString>;
41
41
  }, "strip", z.ZodTypeAny, {
42
42
  build: string;
43
- config?: string | undefined;
44
43
  cache?: string | undefined;
45
44
  data?: string | undefined;
45
+ config?: string | undefined;
46
46
  temp?: string | undefined;
47
47
  log?: string | undefined;
48
48
  }, {
49
- config?: string | undefined;
50
49
  cache?: string | undefined;
51
50
  data?: string | undefined;
51
+ config?: string | undefined;
52
52
  temp?: string | undefined;
53
53
  log?: string | undefined;
54
54
  build?: string | undefined;
@@ -794,8 +794,6 @@ declare const StormConfigSchema: z.ZodObject<{
794
794
  }>]>>]>]>;
795
795
  extensions: z.ZodDefault<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>>;
796
796
  }, "strip", z.ZodTypeAny, {
797
- logLevel: "debug" | "silent" | "fatal" | "error" | "warn" | "success" | "info" | "trace" | "all";
798
- env: "development" | "staging" | "production";
799
797
  organization: string;
800
798
  license: string;
801
799
  homepage: string;
@@ -807,20 +805,22 @@ declare const StormConfigSchema: z.ZodObject<{
807
805
  name: string;
808
806
  email: string;
809
807
  };
808
+ env: "development" | "staging" | "production";
810
809
  workspaceRoot: string;
811
810
  externalPackagePatterns: string[];
812
811
  skipCache: boolean;
813
812
  directories: {
814
813
  build: string;
815
- config?: string | undefined;
816
814
  cache?: string | undefined;
817
815
  data?: string | undefined;
816
+ config?: string | undefined;
818
817
  temp?: string | undefined;
819
818
  log?: string | undefined;
820
819
  };
821
820
  packageManager: "npm" | "yarn" | "pnpm" | "bun";
822
821
  timezone: string;
823
822
  locale: string;
823
+ logLevel: "silent" | "fatal" | "error" | "warn" | "success" | "info" | "debug" | "trace" | "all";
824
824
  registry: {
825
825
  npm?: string | undefined;
826
826
  github?: string | undefined;
@@ -977,9 +977,9 @@ declare const StormConfigSchema: z.ZodObject<{
977
977
  };
978
978
  }>;
979
979
  extensions: Record<string, any>;
980
- name?: string | undefined;
981
980
  $schema?: string | null | undefined;
982
981
  extends?: string | string[] | undefined;
982
+ name?: string | undefined;
983
983
  namespace?: string | undefined;
984
984
  repository?: string | undefined;
985
985
  preid?: string | undefined;
@@ -989,9 +989,9 @@ declare const StormConfigSchema: z.ZodObject<{
989
989
  email?: string | undefined;
990
990
  };
991
991
  directories: {
992
- config?: string | undefined;
993
992
  cache?: string | undefined;
994
993
  data?: string | undefined;
994
+ config?: string | undefined;
995
995
  temp?: string | undefined;
996
996
  log?: string | undefined;
997
997
  build?: string | undefined;
@@ -1143,11 +1143,9 @@ declare const StormConfigSchema: z.ZodObject<{
1143
1143
  background?: string | undefined;
1144
1144
  };
1145
1145
  }>;
1146
- logLevel?: "debug" | "silent" | "fatal" | "error" | "warn" | "success" | "info" | "trace" | "all" | undefined;
1147
- name?: string | undefined;
1148
- env?: "development" | "staging" | "production" | undefined;
1149
1146
  $schema?: string | null | undefined;
1150
1147
  extends?: string | string[] | undefined;
1148
+ name?: string | undefined;
1151
1149
  namespace?: string | undefined;
1152
1150
  organization?: string | undefined;
1153
1151
  repository?: string | undefined;
@@ -1158,12 +1156,14 @@ declare const StormConfigSchema: z.ZodObject<{
1158
1156
  branch?: string | undefined;
1159
1157
  preid?: string | undefined;
1160
1158
  owner?: string | undefined;
1159
+ env?: "development" | "staging" | "production" | undefined;
1161
1160
  workspaceRoot?: string | undefined;
1162
1161
  externalPackagePatterns?: string[] | undefined;
1163
1162
  skipCache?: boolean | undefined;
1164
1163
  packageManager?: "npm" | "yarn" | "pnpm" | "bun" | undefined;
1165
1164
  timezone?: string | undefined;
1166
1165
  locale?: string | undefined;
1166
+ logLevel?: "silent" | "fatal" | "error" | "warn" | "success" | "info" | "debug" | "trace" | "all" | undefined;
1167
1167
  registry?: {
1168
1168
  npm?: string | undefined;
1169
1169
  github?: string | undefined;
@@ -1190,5 +1190,13 @@ type StormConfig<TExtensionName extends keyof TStormConfig["extensions"] = keyof
1190
1190
  * @param config - The StormConfig object
1191
1191
  */
1192
1192
  declare function clean(name: string | undefined, directory: string, config?: StormConfig): Promise<void>;
1193
+ /**
1194
+ * Clean the ESBuild output path
1195
+ *
1196
+ * @param name - The name of the executor
1197
+ * @param directory - The directory to clean
1198
+ * @param config - The StormConfig object
1199
+ */
1200
+ declare function cleanDirectories(name: string | undefined, directory: string, config?: StormConfig): Promise<void>;
1193
1201
 
1194
- export { clean };
1202
+ export { clean, cleanDirectories };
package/dist/clean.d.ts CHANGED
@@ -40,15 +40,15 @@ declare const StormConfigSchema: z.ZodObject<{
40
40
  build: z.ZodDefault<z.ZodString>;
41
41
  }, "strip", z.ZodTypeAny, {
42
42
  build: string;
43
- config?: string | undefined;
44
43
  cache?: string | undefined;
45
44
  data?: string | undefined;
45
+ config?: string | undefined;
46
46
  temp?: string | undefined;
47
47
  log?: string | undefined;
48
48
  }, {
49
- config?: string | undefined;
50
49
  cache?: string | undefined;
51
50
  data?: string | undefined;
51
+ config?: string | undefined;
52
52
  temp?: string | undefined;
53
53
  log?: string | undefined;
54
54
  build?: string | undefined;
@@ -794,8 +794,6 @@ declare const StormConfigSchema: z.ZodObject<{
794
794
  }>]>>]>]>;
795
795
  extensions: z.ZodDefault<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>>;
796
796
  }, "strip", z.ZodTypeAny, {
797
- logLevel: "debug" | "silent" | "fatal" | "error" | "warn" | "success" | "info" | "trace" | "all";
798
- env: "development" | "staging" | "production";
799
797
  organization: string;
800
798
  license: string;
801
799
  homepage: string;
@@ -807,20 +805,22 @@ declare const StormConfigSchema: z.ZodObject<{
807
805
  name: string;
808
806
  email: string;
809
807
  };
808
+ env: "development" | "staging" | "production";
810
809
  workspaceRoot: string;
811
810
  externalPackagePatterns: string[];
812
811
  skipCache: boolean;
813
812
  directories: {
814
813
  build: string;
815
- config?: string | undefined;
816
814
  cache?: string | undefined;
817
815
  data?: string | undefined;
816
+ config?: string | undefined;
818
817
  temp?: string | undefined;
819
818
  log?: string | undefined;
820
819
  };
821
820
  packageManager: "npm" | "yarn" | "pnpm" | "bun";
822
821
  timezone: string;
823
822
  locale: string;
823
+ logLevel: "silent" | "fatal" | "error" | "warn" | "success" | "info" | "debug" | "trace" | "all";
824
824
  registry: {
825
825
  npm?: string | undefined;
826
826
  github?: string | undefined;
@@ -977,9 +977,9 @@ declare const StormConfigSchema: z.ZodObject<{
977
977
  };
978
978
  }>;
979
979
  extensions: Record<string, any>;
980
- name?: string | undefined;
981
980
  $schema?: string | null | undefined;
982
981
  extends?: string | string[] | undefined;
982
+ name?: string | undefined;
983
983
  namespace?: string | undefined;
984
984
  repository?: string | undefined;
985
985
  preid?: string | undefined;
@@ -989,9 +989,9 @@ declare const StormConfigSchema: z.ZodObject<{
989
989
  email?: string | undefined;
990
990
  };
991
991
  directories: {
992
- config?: string | undefined;
993
992
  cache?: string | undefined;
994
993
  data?: string | undefined;
994
+ config?: string | undefined;
995
995
  temp?: string | undefined;
996
996
  log?: string | undefined;
997
997
  build?: string | undefined;
@@ -1143,11 +1143,9 @@ declare const StormConfigSchema: z.ZodObject<{
1143
1143
  background?: string | undefined;
1144
1144
  };
1145
1145
  }>;
1146
- logLevel?: "debug" | "silent" | "fatal" | "error" | "warn" | "success" | "info" | "trace" | "all" | undefined;
1147
- name?: string | undefined;
1148
- env?: "development" | "staging" | "production" | undefined;
1149
1146
  $schema?: string | null | undefined;
1150
1147
  extends?: string | string[] | undefined;
1148
+ name?: string | undefined;
1151
1149
  namespace?: string | undefined;
1152
1150
  organization?: string | undefined;
1153
1151
  repository?: string | undefined;
@@ -1158,12 +1156,14 @@ declare const StormConfigSchema: z.ZodObject<{
1158
1156
  branch?: string | undefined;
1159
1157
  preid?: string | undefined;
1160
1158
  owner?: string | undefined;
1159
+ env?: "development" | "staging" | "production" | undefined;
1161
1160
  workspaceRoot?: string | undefined;
1162
1161
  externalPackagePatterns?: string[] | undefined;
1163
1162
  skipCache?: boolean | undefined;
1164
1163
  packageManager?: "npm" | "yarn" | "pnpm" | "bun" | undefined;
1165
1164
  timezone?: string | undefined;
1166
1165
  locale?: string | undefined;
1166
+ logLevel?: "silent" | "fatal" | "error" | "warn" | "success" | "info" | "debug" | "trace" | "all" | undefined;
1167
1167
  registry?: {
1168
1168
  npm?: string | undefined;
1169
1169
  github?: string | undefined;
@@ -1190,5 +1190,13 @@ type StormConfig<TExtensionName extends keyof TStormConfig["extensions"] = keyof
1190
1190
  * @param config - The StormConfig object
1191
1191
  */
1192
1192
  declare function clean(name: string | undefined, directory: string, config?: StormConfig): Promise<void>;
1193
+ /**
1194
+ * Clean the ESBuild output path
1195
+ *
1196
+ * @param name - The name of the executor
1197
+ * @param directory - The directory to clean
1198
+ * @param config - The StormConfig object
1199
+ */
1200
+ declare function cleanDirectories(name: string | undefined, directory: string, config?: StormConfig): Promise<void>;
1193
1201
 
1194
- export { clean };
1202
+ export { clean, cleanDirectories };
package/dist/clean.js CHANGED
@@ -1,9 +1,11 @@
1
1
  import {
2
- clean
3
- } from "./chunk-V7HJ2CJT.js";
2
+ clean,
3
+ cleanDirectories
4
+ } from "./chunk-JYZKDIZJ.js";
4
5
  import "./chunk-B2PY326H.js";
5
6
  import "./chunk-P4V2LVOO.js";
6
7
  import "./chunk-3GQAWCBQ.js";
7
8
  export {
8
- clean
9
+ clean,
10
+ cleanDirectories
9
11
  };
package/dist/config.cjs CHANGED
@@ -2,12 +2,12 @@
2
2
 
3
3
 
4
4
 
5
- var _chunkCJ3YJPNCcjs = require('./chunk-CJ3YJPNC.cjs');
5
+ var _chunkU2QMMQDAcjs = require('./chunk-U2QMMQDA.cjs');
6
6
  require('./chunk-S6M44SSZ.cjs');
7
7
  require('./chunk-WRBUO7H6.cjs');
8
8
  require('./chunk-AP5TC7E5.cjs');
9
9
  require('./chunk-5UODOOQA.cjs');
10
- require('./chunk-W6IC5BU4.cjs');
10
+ require('./chunk-YHAEJIC5.cjs');
11
11
  require('./chunk-MPZUORUA.cjs');
12
12
  require('./chunk-GHWCUMOG.cjs');
13
13
  require('./chunk-CGFDQ5AJ.cjs');
@@ -17,4 +17,4 @@ require('./chunk-BGYQAVKQ.cjs');
17
17
 
18
18
 
19
19
 
20
- exports.DEFAULT_BUILD_OPTIONS = _chunkCJ3YJPNCcjs.DEFAULT_BUILD_OPTIONS; exports.getDefaultBuildPlugins = _chunkCJ3YJPNCcjs.getDefaultBuildPlugins; exports.getOutputExtensionMap = _chunkCJ3YJPNCcjs.getOutputExtensionMap;
20
+ exports.DEFAULT_BUILD_OPTIONS = _chunkU2QMMQDAcjs.DEFAULT_BUILD_OPTIONS; exports.getDefaultBuildPlugins = _chunkU2QMMQDAcjs.getDefaultBuildPlugins; exports.getOutputExtensionMap = _chunkU2QMMQDAcjs.getOutputExtensionMap;
package/dist/config.js CHANGED
@@ -2,12 +2,12 @@ import {
2
2
  DEFAULT_BUILD_OPTIONS,
3
3
  getDefaultBuildPlugins,
4
4
  getOutputExtensionMap
5
- } from "./chunk-7N4NGXDE.js";
5
+ } from "./chunk-2STSOOUQ.js";
6
6
  import "./chunk-T5272PC2.js";
7
7
  import "./chunk-LYDEMC26.js";
8
8
  import "./chunk-5A3PLYYB.js";
9
9
  import "./chunk-XOY3T2ZQ.js";
10
- import "./chunk-XCY6RUA6.js";
10
+ import "./chunk-RIVOXICH.js";
11
11
  import "./chunk-B2PY326H.js";
12
12
  import "./chunk-P4V2LVOO.js";
13
13
  import "./chunk-YNQ45EAM.js";
package/dist/index.cjs CHANGED
@@ -6,20 +6,22 @@
6
6
 
7
7
 
8
8
 
9
- var _chunkMSCC7MGMcjs = require('./chunk-MSCC7MGM.cjs');
10
9
 
10
+ var _chunkZQYP5TTVcjs = require('./chunk-ZQYP5TTV.cjs');
11
11
 
12
- var _chunkUEYUN2J6cjs = require('./chunk-UEYUN2J6.cjs');
13
12
 
14
13
 
14
+ var _chunkV747733Rcjs = require('./chunk-V747733R.cjs');
15
15
 
16
16
 
17
- var _chunkCJ3YJPNCcjs = require('./chunk-CJ3YJPNC.cjs');
17
+
18
+
19
+ var _chunkU2QMMQDAcjs = require('./chunk-U2QMMQDA.cjs');
18
20
  require('./chunk-S6M44SSZ.cjs');
19
21
  require('./chunk-WRBUO7H6.cjs');
20
22
  require('./chunk-AP5TC7E5.cjs');
21
23
  require('./chunk-5UODOOQA.cjs');
22
- require('./chunk-W6IC5BU4.cjs');
24
+ require('./chunk-YHAEJIC5.cjs');
23
25
  require('./chunk-SFZRYJZ2.cjs');
24
26
  require('./chunk-CNHHELK6.cjs');
25
27
  require('./chunk-MPZUORUA.cjs');
@@ -39,4 +41,6 @@ require('./chunk-BGYQAVKQ.cjs');
39
41
 
40
42
 
41
43
 
42
- exports.DEFAULT_BUILD_OPTIONS = _chunkCJ3YJPNCcjs.DEFAULT_BUILD_OPTIONS; exports.Filter = _chunkMSCC7MGMcjs.Filter; exports.Mapper = _chunkMSCC7MGMcjs.Mapper; exports.build = _chunkMSCC7MGMcjs.build; exports.clean = _chunkUEYUN2J6cjs.clean; exports.getDefaultBuildPlugins = _chunkCJ3YJPNCcjs.getDefaultBuildPlugins; exports.getOutputExtensionMap = _chunkCJ3YJPNCcjs.getOutputExtensionMap; exports.handle = _chunkMSCC7MGMcjs.handle; exports.pipe = _chunkMSCC7MGMcjs.pipe; exports.skip = _chunkMSCC7MGMcjs.skip; exports.transduce = _chunkMSCC7MGMcjs.transduce;
44
+
45
+
46
+ exports.DEFAULT_BUILD_OPTIONS = _chunkU2QMMQDAcjs.DEFAULT_BUILD_OPTIONS; exports.Filter = _chunkZQYP5TTVcjs.Filter; exports.Mapper = _chunkZQYP5TTVcjs.Mapper; exports.build = _chunkZQYP5TTVcjs.build; exports.clean = _chunkV747733Rcjs.clean; exports.cleanDirectories = _chunkV747733Rcjs.cleanDirectories; exports.cleanOutputPath = _chunkZQYP5TTVcjs.cleanOutputPath; exports.getDefaultBuildPlugins = _chunkU2QMMQDAcjs.getDefaultBuildPlugins; exports.getOutputExtensionMap = _chunkU2QMMQDAcjs.getOutputExtensionMap; exports.handle = _chunkZQYP5TTVcjs.handle; exports.pipe = _chunkZQYP5TTVcjs.pipe; exports.skip = _chunkZQYP5TTVcjs.skip; exports.transduce = _chunkZQYP5TTVcjs.transduce;
package/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- export { build } from './build.cjs';
2
- export { clean } from './clean.cjs';
1
+ export { build, cleanOutputPath } from './build.cjs';
2
+ export { clean, cleanDirectories } from './clean.cjs';
3
3
  export { DEFAULT_BUILD_OPTIONS, getDefaultBuildPlugins, getOutputExtensionMap } from './config.cjs';
4
4
  export { AssetInfo, BuildEnd, BuildStart, ChunkInfo, ESBuildCLIOptions, ESBuildContext, ESBuildOptions, ESBuildResolvedOptions, ESBuildResult, MaybePromise, ModifyEsbuildOptions, OutExtensionFactory, OutExtensionObject, RenderChunk, Renderer, WrittenFile } from './types.cjs';
5
5
  import 'zod';
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- export { build } from './build.js';
2
- export { clean } from './clean.js';
1
+ export { build, cleanOutputPath } from './build.js';
2
+ export { clean, cleanDirectories } from './clean.js';
3
3
  export { DEFAULT_BUILD_OPTIONS, getDefaultBuildPlugins, getOutputExtensionMap } from './config.js';
4
4
  export { AssetInfo, BuildEnd, BuildStart, ChunkInfo, ESBuildCLIOptions, ESBuildContext, ESBuildOptions, ESBuildResolvedOptions, ESBuildResult, MaybePromise, ModifyEsbuildOptions, OutExtensionFactory, OutExtensionObject, RenderChunk, Renderer, WrittenFile } from './types.js';
5
5
  import 'zod';
package/dist/index.js CHANGED
@@ -2,24 +2,26 @@ import {
2
2
  Filter,
3
3
  Mapper,
4
4
  build,
5
+ cleanOutputPath,
5
6
  handle,
6
7
  pipe,
7
8
  skip,
8
9
  transduce
9
- } from "./chunk-57U4XU5O.js";
10
+ } from "./chunk-HXF5CHDH.js";
10
11
  import {
11
- clean
12
- } from "./chunk-V7HJ2CJT.js";
12
+ clean,
13
+ cleanDirectories
14
+ } from "./chunk-JYZKDIZJ.js";
13
15
  import {
14
16
  DEFAULT_BUILD_OPTIONS,
15
17
  getDefaultBuildPlugins,
16
18
  getOutputExtensionMap
17
- } from "./chunk-7N4NGXDE.js";
19
+ } from "./chunk-2STSOOUQ.js";
18
20
  import "./chunk-T5272PC2.js";
19
21
  import "./chunk-LYDEMC26.js";
20
22
  import "./chunk-5A3PLYYB.js";
21
23
  import "./chunk-XOY3T2ZQ.js";
22
- import "./chunk-XCY6RUA6.js";
24
+ import "./chunk-RIVOXICH.js";
23
25
  import "./chunk-GGNOJ77I.js";
24
26
  import "./chunk-4Q76YH6E.js";
25
27
  import "./chunk-B2PY326H.js";
@@ -33,6 +35,8 @@ export {
33
35
  Mapper,
34
36
  build,
35
37
  clean,
38
+ cleanDirectories,
39
+ cleanOutputPath,
36
40
  getDefaultBuildPlugins,
37
41
  getOutputExtensionMap,
38
42
  handle,
@@ -1,9 +1,9 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkW6IC5BU4cjs = require('../chunk-W6IC5BU4.cjs');
3
+ var _chunkYHAEJIC5cjs = require('../chunk-YHAEJIC5.cjs');
4
4
  require('../chunk-MPZUORUA.cjs');
5
5
  require('../chunk-GHWCUMOG.cjs');
6
6
  require('../chunk-BGYQAVKQ.cjs');
7
7
 
8
8
 
9
- exports.tscPlugin = _chunkW6IC5BU4cjs.tscPlugin;
9
+ exports.tscPlugin = _chunkYHAEJIC5cjs.tscPlugin;
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  tscPlugin
3
- } from "../chunk-XCY6RUA6.js";
3
+ } from "../chunk-RIVOXICH.js";
4
4
  import "../chunk-B2PY326H.js";
5
5
  import "../chunk-P4V2LVOO.js";
6
6
  import "../chunk-3GQAWCBQ.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@storm-software/esbuild",
3
- "version": "0.22.1",
3
+ "version": "0.22.4",
4
4
  "type": "module",
5
5
  "description": "A package containing `esbuild` utilities for building Storm Software libraries and applications",
6
6
  "repository": {
@@ -159,7 +159,6 @@
159
159
  "spdx-license-ids": { "optional": true }
160
160
  },
161
161
  "dependencies": {
162
- "@humanfs/node": "^0.16.6",
163
162
  "chokidar": "^4.0.3",
164
163
  "commander": "^12.1.0",
165
164
  "es-toolkit": "^1.30.1",
@@ -172,9 +171,9 @@
172
171
  "@microsoft/api-extractor": "^7.48.1",
173
172
  "@nx/devkit": "^20.3.1",
174
173
  "@nx/js": "^20.3.1",
175
- "@storm-software/build-tools": "0.137.1",
176
- "@storm-software/config": "1.100.1",
177
- "@storm-software/config-tools": "1.144.1",
174
+ "@storm-software/build-tools": "0.137.4",
175
+ "@storm-software/config": "1.100.4",
176
+ "@storm-software/config-tools": "1.144.4",
178
177
  "@types/node": "^22.10.2",
179
178
  "defu": "6.1.4",
180
179
  "esbuild": "^0.24.0",