@storm-software/esbuild 0.28.2 → 0.28.3
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 +1 -1
- package/assets/cjs_shims.js +11 -0
- package/assets/esm_shims.js +9 -0
- package/bin/esbuild.cjs +2 -74
- package/package.json +8 -8
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
|
-
[](https://prettier.io/) [](http://nx.dev/) [](https://nextjs.org/) [](http://commitizen.github.io/cz-cli/)  [](https://fumadocs.vercel.app/) 
|
|
25
25
|
|
|
26
26
|
<!-- prettier-ignore-start -->
|
|
27
27
|
<!-- markdownlint-disable -->
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// Shim globals in cjs bundle
|
|
2
|
+
// There's a weird bug that esbuild will always inject importMetaUrl
|
|
3
|
+
// if we export it as `const importMetaUrl = ... __filename ...`
|
|
4
|
+
// But using a function will not cause this issue
|
|
5
|
+
|
|
6
|
+
const getImportMetaUrl = () =>
|
|
7
|
+
typeof document === "undefined"
|
|
8
|
+
? new URL(`file:${__filename}`).href
|
|
9
|
+
: document.currentScript?.src || new URL("main.js", document.baseURI).href;
|
|
10
|
+
|
|
11
|
+
export const importMetaUrl = /* @__PURE__ */ getImportMetaUrl();
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// Shim globals in esm bundle
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
4
|
+
|
|
5
|
+
const getFilename = () => fileURLToPath(import.meta.url);
|
|
6
|
+
const getDirname = () => path.dirname(getFilename());
|
|
7
|
+
|
|
8
|
+
export const __dirname = /* @__PURE__ */ getDirname();
|
|
9
|
+
export const __filename = /* @__PURE__ */ getFilename();
|
package/bin/esbuild.cjs
CHANGED
|
@@ -38,79 +38,7 @@ var import_console2 = require("@storm-software/config-tools/logger/console");
|
|
|
38
38
|
var import_get_log_level = require("@storm-software/config-tools/logger/get-log-level");
|
|
39
39
|
var import_correct_paths2 = require("@storm-software/config-tools/utilities/correct-paths");
|
|
40
40
|
var import_chokidar = require("chokidar");
|
|
41
|
-
|
|
42
|
-
// ../../node_modules/.pnpm/defu@6.1.4/node_modules/defu/dist/defu.mjs
|
|
43
|
-
function isPlainObject(value) {
|
|
44
|
-
if (value === null || typeof value !== "object") {
|
|
45
|
-
return false;
|
|
46
|
-
}
|
|
47
|
-
const prototype = Object.getPrototypeOf(value);
|
|
48
|
-
if (prototype !== null && prototype !== Object.prototype && Object.getPrototypeOf(prototype) !== null) {
|
|
49
|
-
return false;
|
|
50
|
-
}
|
|
51
|
-
if (Symbol.iterator in value) {
|
|
52
|
-
return false;
|
|
53
|
-
}
|
|
54
|
-
if (Symbol.toStringTag in value) {
|
|
55
|
-
return Object.prototype.toString.call(value) === "[object Module]";
|
|
56
|
-
}
|
|
57
|
-
return true;
|
|
58
|
-
}
|
|
59
|
-
__name(isPlainObject, "isPlainObject");
|
|
60
|
-
function _defu(baseObject, defaults, namespace = ".", merger) {
|
|
61
|
-
if (!isPlainObject(defaults)) {
|
|
62
|
-
return _defu(baseObject, {}, namespace, merger);
|
|
63
|
-
}
|
|
64
|
-
const object = Object.assign({}, defaults);
|
|
65
|
-
for (const key in baseObject) {
|
|
66
|
-
if (key === "__proto__" || key === "constructor") {
|
|
67
|
-
continue;
|
|
68
|
-
}
|
|
69
|
-
const value = baseObject[key];
|
|
70
|
-
if (value === null || value === void 0) {
|
|
71
|
-
continue;
|
|
72
|
-
}
|
|
73
|
-
if (merger && merger(object, key, value, namespace)) {
|
|
74
|
-
continue;
|
|
75
|
-
}
|
|
76
|
-
if (Array.isArray(value) && Array.isArray(object[key])) {
|
|
77
|
-
object[key] = [...value, ...object[key]];
|
|
78
|
-
} else if (isPlainObject(value) && isPlainObject(object[key])) {
|
|
79
|
-
object[key] = _defu(
|
|
80
|
-
value,
|
|
81
|
-
object[key],
|
|
82
|
-
(namespace ? `${namespace}.` : "") + key.toString(),
|
|
83
|
-
merger
|
|
84
|
-
);
|
|
85
|
-
} else {
|
|
86
|
-
object[key] = value;
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
return object;
|
|
90
|
-
}
|
|
91
|
-
__name(_defu, "_defu");
|
|
92
|
-
function createDefu(merger) {
|
|
93
|
-
return (...arguments_) => (
|
|
94
|
-
// eslint-disable-next-line unicorn/no-array-reduce
|
|
95
|
-
arguments_.reduce((p, c) => _defu(p, c, "", merger), {})
|
|
96
|
-
);
|
|
97
|
-
}
|
|
98
|
-
__name(createDefu, "createDefu");
|
|
99
|
-
var defu = createDefu();
|
|
100
|
-
var defuFn = createDefu((object, key, currentValue) => {
|
|
101
|
-
if (object[key] !== void 0 && typeof currentValue === "function") {
|
|
102
|
-
object[key] = currentValue(object[key]);
|
|
103
|
-
return true;
|
|
104
|
-
}
|
|
105
|
-
});
|
|
106
|
-
var defuArrayFn = createDefu((object, key, currentValue) => {
|
|
107
|
-
if (Array.isArray(object[key]) && typeof currentValue === "function") {
|
|
108
|
-
object[key] = currentValue(object[key]);
|
|
109
|
-
return true;
|
|
110
|
-
}
|
|
111
|
-
});
|
|
112
|
-
|
|
113
|
-
// src/build.ts
|
|
41
|
+
var import_defu = __toESM(require("defu"), 1);
|
|
114
42
|
var import_es_toolkit = require("es-toolkit");
|
|
115
43
|
var import_compat = require("es-toolkit/compat");
|
|
116
44
|
var esbuild2 = __toESM(require("esbuild"), 1);
|
|
@@ -797,7 +725,7 @@ var resolveOptions = /* @__PURE__ */ __name(async (userOptions) => {
|
|
|
797
725
|
if (!projectConfigurations?.projects?.[projectName]) {
|
|
798
726
|
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.");
|
|
799
727
|
}
|
|
800
|
-
const options =
|
|
728
|
+
const options = (0, import_defu.default)(userOptions, DEFAULT_BUILD_OPTIONS);
|
|
801
729
|
options.name ??= `${projectName}-${options.format}`;
|
|
802
730
|
options.target ??= import_build_tools.DEFAULT_TARGET;
|
|
803
731
|
const packageJsonPath = (0, import_correct_paths2.joinPaths)(workspaceRoot.dir, options.projectRoot, "package.json");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storm-software/esbuild",
|
|
3
|
-
"version": "0.28.
|
|
3
|
+
"version": "0.28.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A package containing `esbuild` utilities for building Storm Software libraries and applications",
|
|
6
6
|
"repository": {
|
|
@@ -125,7 +125,7 @@
|
|
|
125
125
|
}
|
|
126
126
|
},
|
|
127
127
|
"types": "./dist/index.d.ts",
|
|
128
|
-
"files": ["dist/**/*"],
|
|
128
|
+
"files": ["assets/**/*", "bin/**/*", "dist/**/*"],
|
|
129
129
|
"keywords": [
|
|
130
130
|
"esbuild",
|
|
131
131
|
"monorepo",
|
|
@@ -140,7 +140,7 @@
|
|
|
140
140
|
"@nx/js": "^20.3.1",
|
|
141
141
|
"@storm-software/build-tools": "workspace:*",
|
|
142
142
|
"@storm-software/config-tools": "workspace:*",
|
|
143
|
-
"esbuild": "^0.
|
|
143
|
+
"esbuild": "^0.25.0",
|
|
144
144
|
"spdx-exceptions": "^2.5.0",
|
|
145
145
|
"spdx-license-ids": "^3.0.20"
|
|
146
146
|
},
|
|
@@ -157,7 +157,9 @@
|
|
|
157
157
|
"dependencies": {
|
|
158
158
|
"chokidar": "^4.0.3",
|
|
159
159
|
"commander": "^12.1.0",
|
|
160
|
+
"defu": "6.1.4",
|
|
160
161
|
"es-toolkit": "^1.30.1",
|
|
162
|
+
"esbuild": "^0.25.0",
|
|
161
163
|
"globby": "^14.0.2",
|
|
162
164
|
"nx": "^20.3.1",
|
|
163
165
|
"prettier-plugin-organize-imports": "^4.0.0",
|
|
@@ -170,12 +172,10 @@
|
|
|
170
172
|
"@microsoft/api-extractor": "^7.48.1",
|
|
171
173
|
"@nx/devkit": "^20.3.1",
|
|
172
174
|
"@nx/js": "^20.3.1",
|
|
173
|
-
"@storm-software/build-tools": "
|
|
174
|
-
"@storm-software/config": "
|
|
175
|
-
"@storm-software/config-tools": "
|
|
175
|
+
"@storm-software/build-tools": "workspace:*",
|
|
176
|
+
"@storm-software/config": "workspace:*",
|
|
177
|
+
"@storm-software/config-tools": "workspace:*",
|
|
176
178
|
"@types/node": "^22.10.2",
|
|
177
|
-
"defu": "6.1.4",
|
|
178
|
-
"esbuild": "^0.24.0",
|
|
179
179
|
"rollup": "4.29.1",
|
|
180
180
|
"spdx-exceptions": "^2.5.0",
|
|
181
181
|
"spdx-license-ids": "^3.0.20"
|