@storm-software/esbuild 0.34.0 → 0.34.1

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.33.7-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.34.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)
25
25
 
26
26
  <!-- prettier-ignore-start -->
27
27
  <!-- markdownlint-disable -->
package/bin/esbuild.cjs CHANGED
@@ -78,6 +78,7 @@ var DEFAULT_BUILD_OPTIONS = {
78
78
  keepNames: true,
79
79
  metafile: false,
80
80
  treeshake: true,
81
+ splitting: true,
81
82
  shims: false,
82
83
  watch: false,
83
84
  bundle: true,
@@ -232,19 +233,18 @@ async function resolveContext(userOptions) {
232
233
  throw new Error("Cannot find package.json configuration");
233
234
  }
234
235
  const env = (0, import_build_tools2.getEnv)("esbuild", options);
236
+ const define = (0, import_defu.default)(options.define ?? {}, env ?? {});
235
237
  const resolvedOptions = {
236
238
  name: projectName,
237
239
  ...options,
238
240
  tsconfig: (0, import_correct_paths.joinPaths)(projectRoot, userOptions.tsconfig ? userOptions.tsconfig.replace(projectRoot, "") : "tsconfig.json"),
239
241
  metafile: userOptions.mode === "development",
240
242
  clean: false,
241
- splitting: options.format === "iife" ? false : options.treeshake === void 0 ? options.splitting : true,
242
243
  env,
243
244
  define: {
244
245
  STORM_FORMAT: JSON.stringify(options.format),
245
- ...options.define,
246
- ...Object.keys(env || {}).reduce((res, key) => {
247
- const value = JSON.stringify(env[key]);
246
+ ...Object.keys(define).filter((key) => define[key] !== void 0).reduce((res, key) => {
247
+ const value = JSON.stringify(define[key]);
248
248
  const safeKey = key.replaceAll("(", "").replaceAll(")", "");
249
249
  return {
250
250
  ...res,
package/dist/build.cjs CHANGED
@@ -1,9 +1,9 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
3
 
4
- var _chunkE5AAO2PHcjs = require('./chunk-E5AAO2PH.cjs');
4
+ var _chunkRVMQBDDKcjs = require('./chunk-RVMQBDDK.cjs');
5
5
  require('./chunk-Y4XWI6JJ.cjs');
6
- require('./chunk-AXEZCHZS.cjs');
6
+ require('./chunk-DZPLKD6O.cjs');
7
7
  require('./chunk-EZGTDCYM.cjs');
8
8
  require('./chunk-S6M44SSZ.cjs');
9
9
  require('./chunk-WRBUO7H6.cjs');
@@ -18,4 +18,4 @@ require('./chunk-BGYQAVKQ.cjs');
18
18
 
19
19
 
20
20
 
21
- exports.build = _chunkE5AAO2PHcjs.build; exports.watch = _chunkE5AAO2PHcjs.watch;
21
+ exports.build = _chunkRVMQBDDKcjs.build; exports.watch = _chunkRVMQBDDKcjs.watch;
package/dist/build.js CHANGED
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  build,
3
3
  watch
4
- } from "./chunk-X6OXFNDR.js";
4
+ } from "./chunk-7A6JPBG7.js";
5
5
  import "./chunk-35YNFZCF.js";
6
- import "./chunk-KGKL7VDG.js";
6
+ import "./chunk-RTDGFM3J.js";
7
7
  import "./chunk-GWG4HOQ6.js";
8
8
  import "./chunk-T5272PC2.js";
9
9
  import "./chunk-LYDEMC26.js";
@@ -8,7 +8,7 @@ import {
8
8
  copyAssets,
9
9
  getEnv,
10
10
  getWorkspaceConfig
11
- } from "./chunk-KGKL7VDG.js";
11
+ } from "./chunk-RTDGFM3J.js";
12
12
  import {
13
13
  depsCheckPlugin
14
14
  } from "./chunk-IX6DNVUR.js";
@@ -145,19 +145,18 @@ async function resolveContext(userOptions) {
145
145
  throw new Error("Cannot find package.json configuration");
146
146
  }
147
147
  const env = getEnv("esbuild", options);
148
+ const define = defu(options.define ?? {}, env ?? {});
148
149
  const resolvedOptions = {
149
150
  name: projectName,
150
151
  ...options,
151
152
  tsconfig: joinPaths(projectRoot, userOptions.tsconfig ? userOptions.tsconfig.replace(projectRoot, "") : "tsconfig.json"),
152
153
  metafile: userOptions.mode === "development",
153
154
  clean: false,
154
- splitting: options.format === "iife" ? false : options.treeshake === void 0 ? options.splitting : true,
155
155
  env,
156
156
  define: {
157
157
  STORM_FORMAT: JSON.stringify(options.format),
158
- ...options.define,
159
- ...Object.keys(env || {}).reduce((res, key) => {
160
- const value = JSON.stringify(env[key]);
158
+ ...Object.keys(define).filter((key) => define[key] !== void 0).reduce((res, key) => {
159
+ const value = JSON.stringify(define[key]);
161
160
  const safeKey = key.replaceAll("(", "").replaceAll(")", "");
162
161
  return {
163
162
  ...res,
@@ -886,6 +886,7 @@ var DEFAULT_BUILD_OPTIONS = {
886
886
  keepNames: true,
887
887
  metafile: false,
888
888
  treeshake: true,
889
+ splitting: true,
889
890
  shims: false,
890
891
  watch: false,
891
892
  bundle: true,
@@ -886,6 +886,7 @@ var DEFAULT_BUILD_OPTIONS = {
886
886
  keepNames: true,
887
887
  metafile: false,
888
888
  treeshake: true,
889
+ splitting: true,
889
890
  shims: false,
890
891
  watch: false,
891
892
  bundle: true,
@@ -8,7 +8,7 @@ var _chunkY4XWI6JJcjs = require('./chunk-Y4XWI6JJ.cjs');
8
8
 
9
9
 
10
10
 
11
- var _chunkAXEZCHZScjs = require('./chunk-AXEZCHZS.cjs');
11
+ var _chunkDZPLKD6Ocjs = require('./chunk-DZPLKD6O.cjs');
12
12
 
13
13
 
14
14
  var _chunkMWGFCZF4cjs = require('./chunk-MWGFCZF4.cjs');
@@ -120,7 +120,7 @@ async function resolveContext(userOptions) {
120
120
  if (!workspaceRoot) {
121
121
  throw new Error("Cannot find Nx workspace root");
122
122
  }
123
- const workspaceConfig = await _chunkAXEZCHZScjs.getWorkspaceConfig.call(void 0, true, {
123
+ const workspaceConfig = await _chunkDZPLKD6Ocjs.getWorkspaceConfig.call(void 0, true, {
124
124
  workspaceRoot: workspaceRoot.dir
125
125
  });
126
126
  _chunkY3LXNK5Ccjs.writeDebug.call(void 0, " \u2699\uFE0F Resolving build options", workspaceConfig);
@@ -139,25 +139,24 @@ async function resolveContext(userOptions) {
139
139
  if (!_optionalChain([projectConfigurations, 'optionalAccess', _5 => _5.projects, 'optionalAccess', _6 => _6[projectName]])) {
140
140
  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.");
141
141
  }
142
- const options = _defu2.default.call(void 0, userOptions, _chunkAXEZCHZScjs.DEFAULT_BUILD_OPTIONS);
142
+ const options = _defu2.default.call(void 0, userOptions, _chunkDZPLKD6Ocjs.DEFAULT_BUILD_OPTIONS);
143
143
  const packageJsonPath = _chunkXITTOHOGcjs.joinPaths.call(void 0, workspaceRoot.dir, options.projectRoot, "package.json");
144
144
  if (!_fs.existsSync.call(void 0, packageJsonPath)) {
145
145
  throw new Error("Cannot find package.json configuration");
146
146
  }
147
- const env = _chunkAXEZCHZScjs.getEnv.call(void 0, "esbuild", options);
147
+ const env = _chunkDZPLKD6Ocjs.getEnv.call(void 0, "esbuild", options);
148
+ const define = _defu2.default.call(void 0, _nullishCoalesce(options.define, () => ( {})), _nullishCoalesce(env, () => ( {})));
148
149
  const resolvedOptions = {
149
150
  name: projectName,
150
151
  ...options,
151
152
  tsconfig: _chunkXITTOHOGcjs.joinPaths.call(void 0, projectRoot, userOptions.tsconfig ? userOptions.tsconfig.replace(projectRoot, "") : "tsconfig.json"),
152
153
  metafile: userOptions.mode === "development",
153
154
  clean: false,
154
- splitting: options.format === "iife" ? false : options.treeshake === void 0 ? options.splitting : true,
155
155
  env,
156
156
  define: {
157
157
  STORM_FORMAT: JSON.stringify(options.format),
158
- ...options.define,
159
- ...Object.keys(env || {}).reduce((res, key) => {
160
- const value = JSON.stringify(env[key]);
158
+ ...Object.keys(define).filter((key) => define[key] !== void 0).reduce((res, key) => {
159
+ const value = JSON.stringify(define[key]);
161
160
  const safeKey = key.replaceAll("(", "").replaceAll(")", "");
162
161
  return {
163
162
  ...res,
@@ -194,8 +193,8 @@ async function generatePackageJson(context) {
194
193
  if (!packageJson) {
195
194
  throw new Error("Cannot find package.json configuration file");
196
195
  }
197
- packageJson = await _chunkAXEZCHZScjs.addPackageDependencies.call(void 0, context.workspaceConfig.workspaceRoot, context.options.projectRoot, context.projectName, packageJson);
198
- packageJson = await _chunkAXEZCHZScjs.addWorkspacePackageJsonFields.call(void 0, context.workspaceConfig, context.options.projectRoot, context.sourceRoot, context.projectName, false, packageJson);
196
+ packageJson = await _chunkDZPLKD6Ocjs.addPackageDependencies.call(void 0, context.workspaceConfig.workspaceRoot, context.options.projectRoot, context.projectName, packageJson);
197
+ packageJson = await _chunkDZPLKD6Ocjs.addWorkspacePackageJsonFields.call(void 0, context.workspaceConfig, context.options.projectRoot, context.sourceRoot, context.projectName, false, packageJson);
199
198
  if (context.options.entry) {
200
199
  packageJson.exports ??= {};
201
200
  packageJson.exports["./package.json"] ??= "./package.json";
@@ -295,7 +294,7 @@ async function copyBuildAssets(context) {
295
294
  if (_optionalChain([context, 'access', _7 => _7.result, 'optionalAccess', _8 => _8.errors, 'access', _9 => _9.length]) === 0) {
296
295
  _chunkY3LXNK5Ccjs.writeDebug.call(void 0, ` \u{1F4CB} Copying asset files to output directory: ${context.outputPath}`, context.workspaceConfig);
297
296
  const stopwatch = _chunkY3LXNK5Ccjs.getStopwatch.call(void 0, `${context.options.name} asset copy`);
298
- await _chunkAXEZCHZScjs.copyAssets.call(void 0, context.workspaceConfig, _nullishCoalesce(context.options.assets, () => ( [])), context.outputPath, context.options.projectRoot, context.sourceRoot, true, false);
297
+ await _chunkDZPLKD6Ocjs.copyAssets.call(void 0, context.workspaceConfig, _nullishCoalesce(context.options.assets, () => ( [])), context.outputPath, context.options.projectRoot, context.sourceRoot, true, false);
299
298
  stopwatch();
300
299
  }
301
300
  return context;
package/dist/config.cjs CHANGED
@@ -1,7 +1,7 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
3
 
4
- var _chunkAXEZCHZScjs = require('./chunk-AXEZCHZS.cjs');
4
+ var _chunkDZPLKD6Ocjs = require('./chunk-DZPLKD6O.cjs');
5
5
  require('./chunk-EZGTDCYM.cjs');
6
6
  require('./chunk-S6M44SSZ.cjs');
7
7
  require('./chunk-WRBUO7H6.cjs');
@@ -15,4 +15,4 @@ require('./chunk-BGYQAVKQ.cjs');
15
15
 
16
16
 
17
17
 
18
- exports.DEFAULT_BUILD_OPTIONS = _chunkAXEZCHZScjs.DEFAULT_BUILD_OPTIONS; exports.getDefaultBuildPlugins = _chunkAXEZCHZScjs.getDefaultBuildPlugins;
18
+ exports.DEFAULT_BUILD_OPTIONS = _chunkDZPLKD6Ocjs.DEFAULT_BUILD_OPTIONS; exports.getDefaultBuildPlugins = _chunkDZPLKD6Ocjs.getDefaultBuildPlugins;
package/dist/config.d.cts CHANGED
@@ -7,6 +7,6 @@ import 'zod';
7
7
  import 'tsup';
8
8
 
9
9
  declare const getDefaultBuildPlugins: (options: ESBuildOptions, context: ESBuildContext) => esbuild.Plugin[];
10
- declare const DEFAULT_BUILD_OPTIONS: Required<Pick<ESBuildOptions, "assets" | "format" | "platform" | "target" | "tsconfig" | "mode" | "includeSrc" | "generatePackageJson" | "keepNames" | "metafile" | "treeshake" | "shims" | "watch" | "bundle" | "loader" | "banner" | "distDir">>;
10
+ declare const DEFAULT_BUILD_OPTIONS: Required<Pick<ESBuildOptions, "assets" | "format" | "platform" | "target" | "tsconfig" | "mode" | "includeSrc" | "generatePackageJson" | "keepNames" | "metafile" | "treeshake" | "splitting" | "shims" | "watch" | "bundle" | "loader" | "banner" | "distDir">>;
11
11
 
12
12
  export { DEFAULT_BUILD_OPTIONS, getDefaultBuildPlugins };
package/dist/config.d.ts CHANGED
@@ -7,6 +7,6 @@ import 'zod';
7
7
  import 'tsup';
8
8
 
9
9
  declare const getDefaultBuildPlugins: (options: ESBuildOptions, context: ESBuildContext) => esbuild.Plugin[];
10
- declare const DEFAULT_BUILD_OPTIONS: Required<Pick<ESBuildOptions, "assets" | "format" | "platform" | "target" | "tsconfig" | "mode" | "includeSrc" | "generatePackageJson" | "keepNames" | "metafile" | "treeshake" | "shims" | "watch" | "bundle" | "loader" | "banner" | "distDir">>;
10
+ declare const DEFAULT_BUILD_OPTIONS: Required<Pick<ESBuildOptions, "assets" | "format" | "platform" | "target" | "tsconfig" | "mode" | "includeSrc" | "generatePackageJson" | "keepNames" | "metafile" | "treeshake" | "splitting" | "shims" | "watch" | "bundle" | "loader" | "banner" | "distDir">>;
11
11
 
12
12
  export { DEFAULT_BUILD_OPTIONS, getDefaultBuildPlugins };
package/dist/config.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  DEFAULT_BUILD_OPTIONS,
3
3
  getDefaultBuildPlugins
4
- } from "./chunk-KGKL7VDG.js";
4
+ } from "./chunk-RTDGFM3J.js";
5
5
  import "./chunk-GWG4HOQ6.js";
6
6
  import "./chunk-T5272PC2.js";
7
7
  import "./chunk-LYDEMC26.js";
package/dist/index.cjs CHANGED
@@ -7,7 +7,7 @@
7
7
 
8
8
 
9
9
 
10
- var _chunkE5AAO2PHcjs = require('./chunk-E5AAO2PH.cjs');
10
+ var _chunkRVMQBDDKcjs = require('./chunk-RVMQBDDK.cjs');
11
11
 
12
12
 
13
13
 
@@ -15,7 +15,7 @@ var _chunkY4XWI6JJcjs = require('./chunk-Y4XWI6JJ.cjs');
15
15
 
16
16
 
17
17
 
18
- var _chunkAXEZCHZScjs = require('./chunk-AXEZCHZS.cjs');
18
+ var _chunkDZPLKD6Ocjs = require('./chunk-DZPLKD6O.cjs');
19
19
  require('./chunk-EZGTDCYM.cjs');
20
20
  require('./chunk-S6M44SSZ.cjs');
21
21
  require('./chunk-WRBUO7H6.cjs');
@@ -53,4 +53,4 @@ require('./chunk-BGYQAVKQ.cjs');
53
53
 
54
54
 
55
55
 
56
- exports.DEFAULT_BUILD_OPTIONS = _chunkAXEZCHZScjs.DEFAULT_BUILD_OPTIONS; exports.Filter = _chunkE5AAO2PHcjs.Filter; exports.Mapper = _chunkE5AAO2PHcjs.Mapper; exports.build = _chunkE5AAO2PHcjs.build; exports.clean = _chunkY4XWI6JJcjs.clean; exports.cleanDirectories = _chunkY4XWI6JJcjs.cleanDirectories; exports.emitDts = _chunkETTFFUNGcjs.emitDts; exports.emitDtsFiles = _chunkETTFFUNGcjs.emitDtsFiles; exports.ensureTempDeclarationDir = _chunkETTFFUNGcjs.ensureTempDeclarationDir; exports.getDefaultBuildPlugins = _chunkAXEZCHZScjs.getDefaultBuildPlugins; exports.handle = _chunkE5AAO2PHcjs.handle; exports.pipe = _chunkE5AAO2PHcjs.pipe; exports.skip = _chunkE5AAO2PHcjs.skip; exports.slash = _chunkETTFFUNGcjs.slash; exports.toAbsolutePath = _chunkETTFFUNGcjs.toAbsolutePath; exports.transduce = _chunkE5AAO2PHcjs.transduce; exports.watch = _chunkE5AAO2PHcjs.watch;
56
+ exports.DEFAULT_BUILD_OPTIONS = _chunkDZPLKD6Ocjs.DEFAULT_BUILD_OPTIONS; exports.Filter = _chunkRVMQBDDKcjs.Filter; exports.Mapper = _chunkRVMQBDDKcjs.Mapper; exports.build = _chunkRVMQBDDKcjs.build; exports.clean = _chunkY4XWI6JJcjs.clean; exports.cleanDirectories = _chunkY4XWI6JJcjs.cleanDirectories; exports.emitDts = _chunkETTFFUNGcjs.emitDts; exports.emitDtsFiles = _chunkETTFFUNGcjs.emitDtsFiles; exports.ensureTempDeclarationDir = _chunkETTFFUNGcjs.ensureTempDeclarationDir; exports.getDefaultBuildPlugins = _chunkDZPLKD6Ocjs.getDefaultBuildPlugins; exports.handle = _chunkRVMQBDDKcjs.handle; exports.pipe = _chunkRVMQBDDKcjs.pipe; exports.skip = _chunkRVMQBDDKcjs.skip; exports.slash = _chunkETTFFUNGcjs.slash; exports.toAbsolutePath = _chunkETTFFUNGcjs.toAbsolutePath; exports.transduce = _chunkRVMQBDDKcjs.transduce; exports.watch = _chunkRVMQBDDKcjs.watch;
package/dist/index.js CHANGED
@@ -7,7 +7,7 @@ import {
7
7
  skip,
8
8
  transduce,
9
9
  watch
10
- } from "./chunk-X6OXFNDR.js";
10
+ } from "./chunk-7A6JPBG7.js";
11
11
  import {
12
12
  clean,
13
13
  cleanDirectories
@@ -15,7 +15,7 @@ import {
15
15
  import {
16
16
  DEFAULT_BUILD_OPTIONS,
17
17
  getDefaultBuildPlugins
18
- } from "./chunk-KGKL7VDG.js";
18
+ } from "./chunk-RTDGFM3J.js";
19
19
  import "./chunk-GWG4HOQ6.js";
20
20
  import "./chunk-T5272PC2.js";
21
21
  import "./chunk-LYDEMC26.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@storm-software/esbuild",
3
- "version": "0.34.0",
3
+ "version": "0.34.1",
4
4
  "type": "module",
5
5
  "description": "A package containing `esbuild` utilities for building Storm Software libraries and applications",
6
6
  "repository": {