@storm-software/esbuild 0.35.8 → 0.35.10

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.35.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.35.9-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
@@ -12038,7 +12038,7 @@ var DEFAULT_BUILD_OPTIONS = {
12038
12038
  // src/plugins/resolve-paths.ts
12039
12039
  var import_correct_paths = require("@storm-software/config-tools/utilities/correct-paths");
12040
12040
  var import_node_path = __toESM(require("path"), 1);
12041
- function resolvePathsConfig(options, cwd) {
12041
+ function resolvePathsConfig(options, cwd, projectRoot) {
12042
12042
  if (options?.compilerOptions?.paths) {
12043
12043
  const paths = Object.entries(options.compilerOptions.paths);
12044
12044
  const resolvedPaths = paths.map(([key, paths2]) => {
@@ -12050,7 +12050,7 @@ function resolvePathsConfig(options, cwd) {
12050
12050
  return Object.fromEntries(resolvedPaths);
12051
12051
  }
12052
12052
  if (options.extends) {
12053
- const extendsPath = import_node_path.default.resolve(cwd, options.extends);
12053
+ const extendsPath = import_node_path.default.resolve(projectRoot ? (0, import_correct_paths.joinPaths)(cwd, projectRoot, options.extends) : (0, import_correct_paths.joinPaths)(cwd, options.extends));
12054
12054
  const extendsDir = import_node_path.default.dirname(extendsPath);
12055
12055
  const extendsConfig = require(extendsPath);
12056
12056
  return resolvePathsConfig(extendsConfig, extendsDir);
@@ -12062,7 +12062,7 @@ var resolvePathsPlugin = /* @__PURE__ */ __name((context) => ({
12062
12062
  name: "storm:resolve-paths",
12063
12063
  setup(build3) {
12064
12064
  const parentTsConfig = build3.initialOptions.tsconfig ? require((0, import_correct_paths.joinPaths)(context.workspaceConfig.workspaceRoot, build3.initialOptions.tsconfig.replace(context.workspaceConfig.workspaceRoot, ""))) : require((0, import_correct_paths.joinPaths)(context.workspaceConfig.workspaceRoot, "tsconfig.json"));
12065
- const resolvedTsPaths = resolvePathsConfig(parentTsConfig, context.workspaceConfig.workspaceRoot);
12065
+ const resolvedTsPaths = resolvePathsConfig(parentTsConfig, context.workspaceConfig.workspaceRoot, context.options.projectRoot);
12066
12066
  const packagesRegex = new RegExp(`^(${Object.keys(resolvedTsPaths).join("|")})$`);
12067
12067
  build3.onResolve({
12068
12068
  filter: packagesRegex
package/dist/build.cjs CHANGED
@@ -1,11 +1,11 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkG277DR3Ncjs = require('./chunk-G277DR3N.cjs');
3
+ var _chunkJS5GZ7ZEcjs = require('./chunk-JS5GZ7ZE.cjs');
4
4
  require('./chunk-N6KCNJOR.cjs');
5
5
  require('./chunk-KK2BGIRB.cjs');
6
6
  require('./chunk-IV2WE7RO.cjs');
7
- require('./chunk-VEN2NPFW.cjs');
8
- require('./chunk-E6GNR4XY.cjs');
7
+ require('./chunk-JZBM4QKF.cjs');
8
+ require('./chunk-YXJYZG6O.cjs');
9
9
  require('./chunk-ZDMKNQUW.cjs');
10
10
  require('./chunk-CY4KF2US.cjs');
11
11
  require('./chunk-B4NWTB7S.cjs');
@@ -15,4 +15,4 @@ require('./chunk-Q77NJNNL.cjs');
15
15
  require('./chunk-TKNLZW4V.cjs');
16
16
 
17
17
 
18
- exports.build = _chunkG277DR3Ncjs.build;
18
+ exports.build = _chunkJS5GZ7ZEcjs.build;
package/dist/build.js CHANGED
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  build
3
- } from "./chunk-A66EGME2.js";
3
+ } from "./chunk-DU5R4RJA.js";
4
4
  import "./chunk-GWGBQKRY.js";
5
5
  import "./chunk-CA7VVNV2.js";
6
6
  import "./chunk-GKAHDFNO.js";
7
- import "./chunk-GCKE6M7A.js";
8
- import "./chunk-SPVR557L.js";
7
+ import "./chunk-JHQYSHQ5.js";
8
+ import "./chunk-ZILTNBKJ.js";
9
9
  import "./chunk-JNDYTIRD.js";
10
10
  import "./chunk-EBZ4R3MW.js";
11
11
  import "./chunk-SAK5QFCE.js";
@@ -0,0 +1,6 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});// package.json
2
+ var version = "8.4.0";
3
+
4
+
5
+
6
+ exports.version = version;
@@ -9,7 +9,7 @@ import {
9
9
  } from "./chunk-GKAHDFNO.js";
10
10
  import {
11
11
  resolveContext
12
- } from "./chunk-GCKE6M7A.js";
12
+ } from "./chunk-JHQYSHQ5.js";
13
13
  import {
14
14
  generatePackageJson
15
15
  } from "./chunk-EBZ4R3MW.js";
@@ -0,0 +1,153 @@
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; } }
2
+
3
+ var _chunkBYH4XDRHjs = require('./chunk-BYH4XDRH.js');
4
+
5
+
6
+ var _chunkTWFEYLU4js = require('./chunk-TWFEYLU4.js');
7
+
8
+ // src/cli-main.ts
9
+ var _cac = require('cac');
10
+
11
+ // node_modules/.pnpm/flat@6.0.1/node_modules/flat/index.js
12
+ function isBuffer(obj) {
13
+ return obj && obj.constructor && typeof obj.constructor.isBuffer === "function" && obj.constructor.isBuffer(obj);
14
+ }
15
+ function keyIdentity(key) {
16
+ return key;
17
+ }
18
+ function flatten(target, opts) {
19
+ opts = opts || {};
20
+ const delimiter = opts.delimiter || ".";
21
+ const maxDepth = opts.maxDepth;
22
+ const transformKey = opts.transformKey || keyIdentity;
23
+ const output = {};
24
+ function step(object, prev, currentDepth) {
25
+ currentDepth = currentDepth || 1;
26
+ Object.keys(object).forEach(function(key) {
27
+ const value = object[key];
28
+ const isarray = opts.safe && Array.isArray(value);
29
+ const type = Object.prototype.toString.call(value);
30
+ const isbuffer = isBuffer(value);
31
+ const isobject = type === "[object Object]" || type === "[object Array]";
32
+ const newKey = prev ? prev + delimiter + transformKey(key) : transformKey(key);
33
+ if (!isarray && !isbuffer && isobject && Object.keys(value).length && (!opts.maxDepth || currentDepth < maxDepth)) {
34
+ return step(value, newKey, currentDepth + 1);
35
+ }
36
+ output[newKey] = value;
37
+ });
38
+ }
39
+ step(target);
40
+ return output;
41
+ }
42
+
43
+ // src/cli-main.ts
44
+ function ensureArray(input) {
45
+ return Array.isArray(input) ? input : input.split(",");
46
+ }
47
+ async function main(options = {}) {
48
+ const cli = _cac.cac.call(void 0, "tsup");
49
+ cli.command("[...files]", "Bundle files", {
50
+ ignoreOptionDefaultValue: true
51
+ }).option("--entry.* <file>", "Use a key-value pair as entry files").option("-d, --out-dir <dir>", "Output directory", { default: "dist" }).option("--format <format>", 'Bundle format, "cjs", "iife", "esm"', {
52
+ default: "cjs"
53
+ }).option("--minify [terser]", "Minify bundle").option("--minify-whitespace", "Minify whitespace").option("--minify-identifiers", "Minify identifiers").option("--minify-syntax", "Minify syntax").option(
54
+ "--keep-names",
55
+ "Keep original function and class names in minified code"
56
+ ).option("--target <target>", 'Bundle target, "es20XX" or "esnext"', {
57
+ default: "es2017"
58
+ }).option(
59
+ "--legacy-output",
60
+ "Output different formats to different folder instead of using different extensions"
61
+ ).option("--dts [entry]", "Generate declaration file").option("--dts-resolve", "Resolve externals types used for d.ts files").option("--dts-only", "Emit declaration files only").option(
62
+ "--experimental-dts [entry]",
63
+ "Generate declaration file (experimental)"
64
+ ).option(
65
+ "--sourcemap [inline]",
66
+ "Generate external sourcemap, or inline source: --sourcemap inline"
67
+ ).option(
68
+ "--watch [path]",
69
+ 'Watch mode, if path is not specified, it watches the current folder ".". Repeat "--watch" for more than one path'
70
+ ).option("--ignore-watch <path>", "Ignore custom paths in watch mode").option(
71
+ "--onSuccess <command>",
72
+ "Execute command after successful build, specially useful for watch mode"
73
+ ).option("--env.* <value>", "Define compile-time env variables").option(
74
+ "--inject <file>",
75
+ "Replace a global variable with an import from another file"
76
+ ).option("--define.* <value>", "Define compile-time constants").option(
77
+ "--external <name>",
78
+ "Mark specific packages / package.json (dependencies and peerDependencies) as external"
79
+ ).option("--global-name <name>", "Global variable name for iife format").option("--jsxFactory <jsxFactory>", "Name of JSX factory function", {
80
+ default: "React.createElement"
81
+ }).option("--jsxFragment <jsxFragment>", "Name of JSX fragment function", {
82
+ default: "React.Fragment"
83
+ }).option("--replaceNodeEnv", "Replace process.env.NODE_ENV").option("--no-splitting", "Disable code splitting").option("--clean", "Clean output directory").option(
84
+ "--silent",
85
+ 'Suppress non-error logs (excluding "onSuccess" process output)'
86
+ ).option("--pure <express>", "Mark specific expressions as pure").option("--metafile", "Emit esbuild metafile (a JSON file)").option("--platform <platform>", "Target platform", {
87
+ default: "node"
88
+ }).option("--loader <ext=loader>", "Specify the loader for a file extension").option("--tsconfig <filename>", "Use a custom tsconfig").option("--config <filename>", "Use a custom config file").option("--no-config", "Disable config file").option("--shims", "Enable cjs and esm shims").option("--inject-style", "Inject style tag to document head").option(
89
+ "--treeshake [strategy]",
90
+ 'Using Rollup for treeshaking instead, "recommended" or "smallest" or "safest"'
91
+ ).option("--publicDir [dir]", "Copy public directory to output directory").option(
92
+ "--killSignal <signal>",
93
+ 'Signal to kill child process, "SIGTERM" or "SIGKILL"'
94
+ ).option("--cjsInterop", "Enable cjs interop").action(async (files, flags) => {
95
+ const { build } = await Promise.resolve().then(() => _interopRequireWildcard(require("./index.js")));
96
+ Object.assign(options, {
97
+ ...flags
98
+ });
99
+ if (!options.entry && files.length > 0) {
100
+ options.entry = files.map(_chunkTWFEYLU4js.slash);
101
+ }
102
+ if (flags.format) {
103
+ const format = ensureArray(flags.format);
104
+ options.format = format;
105
+ }
106
+ if (flags.external) {
107
+ const external = ensureArray(flags.external);
108
+ options.external = external;
109
+ }
110
+ if (flags.target) {
111
+ options.target = flags.target.includes(",") ? flags.target.split(",") : flags.target;
112
+ }
113
+ if (flags.dts || flags.dtsResolve || flags.dtsOnly) {
114
+ options.dts = {};
115
+ if (typeof flags.dts === "string") {
116
+ options.dts.entry = flags.dts;
117
+ }
118
+ if (flags.dtsResolve) {
119
+ options.dts.resolve = flags.dtsResolve;
120
+ }
121
+ if (flags.dtsOnly) {
122
+ options.dts.only = true;
123
+ }
124
+ }
125
+ if (flags.inject) {
126
+ const inject = ensureArray(flags.inject);
127
+ options.inject = inject;
128
+ }
129
+ if (flags.define) {
130
+ const define = flatten(flags.define);
131
+ options.define = define;
132
+ }
133
+ if (flags.loader) {
134
+ const loader = ensureArray(flags.loader);
135
+ options.loader = loader.reduce((result, item) => {
136
+ const parts = item.split("=");
137
+ return {
138
+ ...result,
139
+ [parts[0]]: parts[1]
140
+ };
141
+ }, {});
142
+ }
143
+ await build(options);
144
+ });
145
+ cli.help();
146
+ cli.version(_chunkBYH4XDRHjs.version);
147
+ cli.parse(process.argv, { run: false });
148
+ await cli.runMatchedCommand();
149
+ }
150
+
151
+
152
+
153
+ exports.main = main;
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  resolvePathsPlugin
3
- } from "./chunk-SPVR557L.js";
3
+ } from "./chunk-ZILTNBKJ.js";
4
4
  import {
5
5
  DEFAULT_BUILD_OPTIONS
6
6
  } from "./chunk-JNDYTIRD.js";
@@ -9,7 +9,7 @@ var _chunkKK2BGIRBcjs = require('./chunk-KK2BGIRB.cjs');
9
9
  var _chunkIV2WE7ROcjs = require('./chunk-IV2WE7RO.cjs');
10
10
 
11
11
 
12
- var _chunkVEN2NPFWcjs = require('./chunk-VEN2NPFW.cjs');
12
+ var _chunkJZBM4QKFcjs = require('./chunk-JZBM4QKF.cjs');
13
13
 
14
14
 
15
15
  var _chunkCY4KF2UScjs = require('./chunk-CY4KF2US.cjs');
@@ -95,7 +95,7 @@ async function build2(options) {
95
95
  if (opts.length === 0) {
96
96
  throw new Error("No build options were provided");
97
97
  }
98
- const context = await _chunkVEN2NPFWcjs.resolveContext.call(void 0, options);
98
+ const context = await _chunkJZBM4QKFcjs.resolveContext.call(void 0, options);
99
99
  await cleanOutputPath(context);
100
100
  await Promise.all([
101
101
  dependencyCheck(context.options),
@@ -0,0 +1,42 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }// src/errors.ts
2
+ var _worker_threads = require('worker_threads');
3
+ var _picocolors = require('picocolors'); var _picocolors2 = _interopRequireDefault(_picocolors);
4
+ var PrettyError = class extends Error {
5
+ constructor(message) {
6
+ super(message);
7
+ this.name = this.constructor.name;
8
+ if (typeof Error.captureStackTrace === "function") {
9
+ Error.captureStackTrace(this, this.constructor);
10
+ } else {
11
+ this.stack = new Error(message).stack;
12
+ }
13
+ }
14
+ };
15
+ function handleError(error) {
16
+ if (error.loc) {
17
+ console.error(
18
+ _picocolors2.default.bold(
19
+ _picocolors2.default.red(
20
+ `Error parsing: ${error.loc.file}:${error.loc.line}:${error.loc.column}`
21
+ )
22
+ )
23
+ );
24
+ }
25
+ if (error.frame) {
26
+ console.error(_picocolors2.default.red(error.message));
27
+ console.error(_picocolors2.default.dim(error.frame));
28
+ } else if (error instanceof PrettyError) {
29
+ console.error(_picocolors2.default.red(error.message));
30
+ } else {
31
+ console.error(_picocolors2.default.red(error.stack));
32
+ }
33
+ process.exitCode = 1;
34
+ if (!_worker_threads.isMainThread && _worker_threads.parentPort) {
35
+ _worker_threads.parentPort.postMessage("error");
36
+ }
37
+ }
38
+
39
+
40
+
41
+
42
+ exports.PrettyError = PrettyError; exports.handleError = handleError;
@@ -1,6 +1,6 @@
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(); } } 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 _chunkE6GNR4XYcjs = require('./chunk-E6GNR4XY.cjs');
3
+ var _chunkYXJYZG6Ocjs = require('./chunk-YXJYZG6O.cjs');
4
4
 
5
5
 
6
6
  var _chunkZDMKNQUWcjs = require('./chunk-ZDMKNQUW.cjs');
@@ -92,7 +92,7 @@ async function resolveContext(userOptions) {
92
92
  minify: resolvedOptions.minify || resolvedOptions.mode === "production"
93
93
  };
94
94
  context.options.esbuildPlugins = [
95
- _chunkE6GNR4XYcjs.resolvePathsPlugin.call(void 0, context),
95
+ _chunkYXJYZG6Ocjs.resolvePathsPlugin.call(void 0, context),
96
96
  ..._nullishCoalesce(context.options.esbuildPlugins, () => ( []))
97
97
  ];
98
98
  return context;