@storm-software/esbuild 0.52.19 → 0.53.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. package/README.md +2 -1
  2. package/bin/esbuild.cjs +1 -1
  3. package/dist/assets.cjs +3 -6
  4. package/dist/assets.js +2 -5
  5. package/dist/build.cjs +9 -12
  6. package/dist/build.js +8 -11
  7. package/dist/chunk-3RG5ZIWI.js +10 -0
  8. package/dist/{chunk-FPIJK3XG.cjs → chunk-BXCOVK3I.cjs} +4 -9
  9. package/dist/{chunk-QHLRM4V5.cjs → chunk-CRFWMPZN.cjs} +13 -20
  10. package/dist/{chunk-QIPHFRC4.js → chunk-CZC4I6SL.js} +5 -12
  11. package/dist/{chunk-7RE7ZACR.js → chunk-D4DSKI5N.js} +9 -17
  12. package/dist/{chunk-AFDZZITE.cjs → chunk-DJNFLJSO.cjs} +6 -13
  13. package/dist/chunk-GGNOJ77I.js +0 -0
  14. package/dist/{chunk-GOWYVZG4.js → chunk-MTZGYTJP.js} +3 -10
  15. package/dist/{chunk-5RUFZI6I.cjs → chunk-MYIRPP4C.cjs} +4 -11
  16. package/dist/chunk-OBGZSXTJ.cjs +10 -0
  17. package/dist/{chunk-HYW4BAFZ.cjs → chunk-P3PATQE5.cjs} +19 -27
  18. package/dist/chunk-SFZRYJZ2.cjs +1 -0
  19. package/dist/{chunk-WPDQA5FY.js → chunk-SJ6BFZTX.js} +8 -12
  20. package/dist/{chunk-DUKUFYDF.js → chunk-TTW7MNRE.js} +1 -8
  21. package/dist/chunk-V7AFF6GW.cjs +25 -0
  22. package/dist/{chunk-2OWGB57Y.cjs → chunk-XAUXKCOD.cjs} +21 -25
  23. package/dist/{chunk-E6AGXX4I.js → chunk-XKSMSRQZ.js} +2 -7
  24. package/dist/chunk-ZH5YCT67.js +25 -0
  25. package/dist/clean.cjs +3 -4
  26. package/dist/clean.js +2 -3
  27. package/dist/config.cjs +3 -6
  28. package/dist/config.js +2 -5
  29. package/dist/context.cjs +4 -7
  30. package/dist/context.js +3 -6
  31. package/dist/index.cjs +10 -18
  32. package/dist/index.js +9 -17
  33. package/dist/package-json.cjs +3 -6
  34. package/dist/package-json.js +2 -5
  35. package/dist/plugins/deps-check.cjs +6 -8
  36. package/dist/plugins/deps-check.js +6 -8
  37. package/dist/plugins/resolve-paths.cjs +12 -38
  38. package/dist/plugins/resolve-paths.js +4 -30
  39. package/dist/tsup.cjs +3 -5
  40. package/dist/tsup.js +2 -4
  41. package/dist/types.cjs +1 -2
  42. package/dist/types.js +1 -2
  43. package/dist/watch.cjs +5 -9
  44. package/dist/watch.js +4 -8
  45. package/package.json +7 -7
  46. package/assets/cjs_shims.js +0 -11
  47. package/assets/esm_shims.js +0 -9
  48. package/dist/chunk-3F47E3CC.js +0 -2718
  49. package/dist/chunk-3K6UVBCV.js +0 -135
  50. package/dist/chunk-4ZXSQJXL.cjs +0 -2687
  51. package/dist/chunk-AU3V4AYC.cjs +0 -135
  52. package/dist/chunk-BM3ARHU6.cjs +0 -325
  53. package/dist/chunk-BYH4XDRH.cjs +0 -6
  54. package/dist/chunk-E327PFHD.js +0 -54
  55. package/dist/chunk-GZSSIGNC.cjs +0 -153
  56. package/dist/chunk-ICZAYSVN.js +0 -325
  57. package/dist/chunk-JZ25TPTY.cjs +0 -42
  58. package/dist/chunk-O53NX6NM.cjs +0 -6
  59. package/dist/chunk-TWFEYLU4.cjs +0 -352
  60. package/dist/chunk-UFQVX6NZ.js +0 -1906
  61. package/dist/chunk-UIKQCOC2.cjs +0 -1906
  62. package/dist/chunk-UIWBVEQL.js +0 -6
  63. package/dist/chunk-VGC3FXLU.cjs +0 -203
  64. package/dist/chunk-WWBRFML4.cjs +0 -47
  65. package/dist/rollup.cjs +0 -6906
@@ -1,6 +0,0 @@
1
- import {
2
- init_esm_shims
3
- } from "./chunk-E327PFHD.js";
4
-
5
- // src/types.ts
6
- init_esm_shims();
@@ -1,203 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 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
-
3
- var _chunkTWFEYLU4js = require('./chunk-TWFEYLU4.cjs');
4
-
5
- // src/load.ts
6
- var _fs = require('fs'); var _fs2 = _interopRequireDefault(_fs);
7
- var _path = require('path'); var _path2 = _interopRequireDefault(_path);
8
- var _joycon = require('joycon'); var _joycon2 = _interopRequireDefault(_joycon);
9
- var _bundlerequire = require('bundle-require');
10
- var joycon = new (0, _joycon2.default)();
11
- var loadJson = async (filepath, options) => {
12
- try {
13
- return _chunkTWFEYLU4js.jsoncParse.call(void 0, await _fs2.default.promises.readFile(filepath, "utf8"));
14
- } catch (error) {
15
- if (error instanceof Error) {
16
- throw new Error(
17
- `Failed to parse ${_path2.default.relative(options.workspaceConfig?.workspaceRoot || process.cwd(), filepath)}: ${error.message}`
18
- );
19
- } else {
20
- throw error;
21
- }
22
- }
23
- };
24
- var jsonLoader = {
25
- test: /\.json$/,
26
- load(filepath) {
27
- return loadJson(filepath);
28
- }
29
- };
30
- joycon.addLoader(jsonLoader);
31
- async function loadTsupConfig(cwd, configFile) {
32
- const configJoycon = new (0, _joycon2.default)();
33
- const configPath = await configJoycon.resolve({
34
- files: configFile ? [configFile] : [
35
- "tsup.config.ts",
36
- "tsup.config.cts",
37
- "tsup.config.mts",
38
- "tsup.config.js",
39
- "tsup.config.cjs",
40
- "tsup.config.mjs",
41
- "tsup.config.json",
42
- "package.json"
43
- ],
44
- cwd,
45
- stopDir: _path2.default.parse(cwd).root,
46
- packageKey: "tsup"
47
- });
48
- if (configPath) {
49
- if (configPath.endsWith(".json")) {
50
- let data = await loadJson(configPath);
51
- if (configPath.endsWith("package.json")) {
52
- data = data.tsup;
53
- }
54
- if (data) {
55
- return { path: configPath, data };
56
- }
57
- return {};
58
- }
59
- const config = await _bundlerequire.bundleRequire.call(void 0, {
60
- filepath: configPath
61
- });
62
- return {
63
- path: configPath,
64
- data: config.mod.tsup || config.mod.default || config.mod
65
- };
66
- }
67
- return {};
68
- }
69
- async function loadPkg(cwd, clearCache = false) {
70
- if (clearCache) {
71
- joycon.clearCache();
72
- }
73
- const { data } = await joycon.load(["package.json"], cwd, _path2.default.dirname(cwd));
74
- return data || {};
75
- }
76
- async function getProductionDeps(cwd, clearCache = false) {
77
- const data = await loadPkg(cwd, clearCache);
78
- const deps = Array.from(
79
- /* @__PURE__ */ new Set([
80
- ...Object.keys(data.dependencies || {}),
81
- ...Object.keys(data.peerDependencies || {})
82
- ])
83
- );
84
- return deps;
85
- }
86
- async function getAllDepsHash(cwd) {
87
- const data = await loadPkg(cwd, true);
88
- return JSON.stringify({
89
- ...data.dependencies,
90
- ...data.peerDependencies,
91
- ...data.devDependencies
92
- });
93
- }
94
-
95
- // src/log.ts
96
- var _util = require('util'); var _util2 = _interopRequireDefault(_util);
97
- var _worker_threads = require('worker_threads');
98
- var _picocolors = require('picocolors'); var _picocolors2 = _interopRequireDefault(_picocolors);
99
- var colorize = (type, data, onlyImportant = false) => {
100
- if (onlyImportant && (type === "info" || type === "success")) return data;
101
- const color = type === "info" ? "blue" : type === "error" ? "red" : type === "warn" ? "yellow" : "green";
102
- return _picocolors2.default[color](data);
103
- };
104
- var makeLabel = (name, input, type) => {
105
- return [
106
- name && `${_picocolors2.default.dim("[")}${name.toUpperCase()}${_picocolors2.default.dim("]")}`,
107
- colorize(type, input.toUpperCase())
108
- ].filter(Boolean).join(" ");
109
- };
110
- var silent = false;
111
- function setSilent(isSilent) {
112
- silent = !!isSilent;
113
- }
114
- function getSilent() {
115
- return silent;
116
- }
117
- var createLogger = (name) => {
118
- return {
119
- setName(_name) {
120
- name = _name;
121
- },
122
- success(label, ...args) {
123
- return this.log(label, "success", ...args);
124
- },
125
- info(label, ...args) {
126
- return this.log(label, "info", ...args);
127
- },
128
- error(label, ...args) {
129
- return this.log(label, "error", ...args);
130
- },
131
- warn(label, ...args) {
132
- return this.log(label, "warn", ...args);
133
- },
134
- log(label, type, ...data) {
135
- const args = [
136
- makeLabel(name, label, type),
137
- ...data.map((item) => colorize(type, item, true))
138
- ];
139
- switch (type) {
140
- case "error": {
141
- if (!_worker_threads.isMainThread) {
142
- _optionalChain([_worker_threads.parentPort, 'optionalAccess', _ => _.postMessage, 'call', _2 => _2({
143
- type: "error",
144
- text: _util2.default.format(...args)
145
- })]);
146
- return;
147
- }
148
- return console.error(...args);
149
- }
150
- default:
151
- if (silent) return;
152
- if (!_worker_threads.isMainThread) {
153
- _optionalChain([_worker_threads.parentPort, 'optionalAccess', _3 => _3.postMessage, 'call', _4 => _4({
154
- type: "log",
155
- text: _util2.default.format(...args)
156
- })]);
157
- return;
158
- }
159
- console.log(...args);
160
- }
161
- }
162
- };
163
- };
164
-
165
- // src/lib/report-size.ts
166
-
167
- var prettyBytes = (bytes) => {
168
- if (bytes === 0) return "0 B";
169
- const unit = ["B", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"];
170
- const exp = Math.floor(Math.log(bytes) / Math.log(1024));
171
- return `${(bytes / 1024 ** exp).toFixed(2)} ${unit[exp]}`;
172
- };
173
- var getLengthOfLongestString = (strings) => {
174
- return strings.reduce((max, str) => {
175
- return Math.max(max, str.length);
176
- }, 0);
177
- };
178
- var padRight = (str, maxLength) => {
179
- return str + " ".repeat(maxLength - str.length);
180
- };
181
- var reportSize = (logger, format, files) => {
182
- const filenames = Object.keys(files);
183
- const maxLength = getLengthOfLongestString(filenames) + 1;
184
- for (const name of filenames) {
185
- logger.success(
186
- format,
187
- `${_picocolors2.default.bold(padRight(name, maxLength))}${_picocolors2.default.green(
188
- prettyBytes(files[name])
189
- )}`
190
- );
191
- }
192
- };
193
-
194
-
195
-
196
-
197
-
198
-
199
-
200
-
201
-
202
-
203
- exports.loadTsupConfig = loadTsupConfig; exports.loadPkg = loadPkg; exports.getProductionDeps = getProductionDeps; exports.getAllDepsHash = getAllDepsHash; exports.setSilent = setSilent; exports.getSilent = getSilent; exports.createLogger = createLogger; exports.reportSize = reportSize;
@@ -1,47 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
8
- get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
9
- }) : x)(function(x) {
10
- if (typeof require !== "undefined") return require.apply(this, arguments);
11
- throw Error('Dynamic require of "' + x + '" is not supported');
12
- });
13
- var __esm = (fn, res) => function __init() {
14
- return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
15
- };
16
- var __commonJS = (cb, mod) => function __require2() {
17
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
18
- };
19
- var __copyProps = (to, from, except, desc) => {
20
- if (from && typeof from === "object" || typeof from === "function") {
21
- for (let key of __getOwnPropNames(from))
22
- if (!__hasOwnProp.call(to, key) && key !== except)
23
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
24
- }
25
- return to;
26
- };
27
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
28
- // If the importer is in node compatibility mode or this is not an ESM
29
- // file that has been converted to a CommonJS file using a Babel-
30
- // compatible transform (i.e. "__esModule" has not been set), then set
31
- // "default" to the CommonJS "module.exports" for node compatibility.
32
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
33
- mod
34
- ));
35
-
36
- // ../../node_modules/.pnpm/tsup@8.4.0_patch_hash=751a554d775c3572381af4e7e5fa22eeda6dd6856012fb1cf521d6806eb2dc74__e2bfae77dab123b3b7f92991a884d555/node_modules/tsup/assets/cjs_shims.js
37
- var init_cjs_shims = __esm({
38
- "../../node_modules/.pnpm/tsup@8.4.0_patch_hash=751a554d775c3572381af4e7e5fa22eeda6dd6856012fb1cf521d6806eb2dc74__e2bfae77dab123b3b7f92991a884d555/node_modules/tsup/assets/cjs_shims.js"() {
39
- }
40
- });
41
-
42
-
43
-
44
-
45
-
46
-
47
- exports.__require = __require; exports.__commonJS = __commonJS; exports.__toESM = __toESM; exports.init_cjs_shims = init_cjs_shims;