@storm-software/esbuild 0.28.1 → 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 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.28.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.28.2-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 -->
@@ -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 = defu(userOptions, DEFAULT_BUILD_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/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;
43
44
  cache?: string | undefined;
44
45
  data?: string | undefined;
45
- config?: string | undefined;
46
46
  temp?: string | undefined;
47
47
  log?: string | undefined;
48
48
  }, {
49
+ config?: string | undefined;
49
50
  cache?: string | undefined;
50
51
  data?: string | undefined;
51
- config?: string | undefined;
52
52
  temp?: string | undefined;
53
53
  log?: string | undefined;
54
54
  build?: string | undefined;
@@ -795,6 +795,8 @@ declare const StormConfigSchema: z.ZodObject<{
795
795
  }>]>>]>]>;
796
796
  extensions: z.ZodDefault<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>>;
797
797
  }, "strip", z.ZodTypeAny, {
798
+ logLevel: "debug" | "silent" | "fatal" | "error" | "warn" | "success" | "info" | "trace" | "all";
799
+ mode: "development" | "staging" | "production";
798
800
  organization: string;
799
801
  license: string;
800
802
  homepage: string;
@@ -806,22 +808,20 @@ declare const StormConfigSchema: z.ZodObject<{
806
808
  name: string;
807
809
  email: string;
808
810
  };
809
- mode: "development" | "staging" | "production";
810
811
  workspaceRoot: string;
811
812
  externalPackagePatterns: string[];
812
813
  skipCache: boolean;
813
814
  directories: {
814
815
  build: string;
816
+ config?: string | undefined;
815
817
  cache?: string | undefined;
816
818
  data?: string | undefined;
817
- config?: string | undefined;
818
819
  temp?: string | undefined;
819
820
  log?: string | undefined;
820
821
  };
821
822
  packageManager: "npm" | "yarn" | "pnpm" | "bun";
822
823
  timezone: string;
823
824
  locale: string;
824
- logLevel: "silent" | "fatal" | "error" | "warn" | "success" | "info" | "debug" | "trace" | "all";
825
825
  registry: {
826
826
  npm?: string | undefined;
827
827
  github?: string | undefined;
@@ -978,9 +978,9 @@ declare const StormConfigSchema: z.ZodObject<{
978
978
  };
979
979
  }>;
980
980
  extensions: Record<string, any>;
981
+ name?: string | undefined;
981
982
  $schema?: string | null | undefined;
982
983
  extends?: string | string[] | undefined;
983
- name?: string | undefined;
984
984
  namespace?: string | undefined;
985
985
  repository?: string | undefined;
986
986
  preid?: string | undefined;
@@ -991,9 +991,9 @@ declare const StormConfigSchema: z.ZodObject<{
991
991
  email?: string | undefined;
992
992
  };
993
993
  directories: {
994
+ config?: string | undefined;
994
995
  cache?: string | undefined;
995
996
  data?: string | undefined;
996
- config?: string | undefined;
997
997
  temp?: string | undefined;
998
998
  log?: string | undefined;
999
999
  build?: string | undefined;
@@ -1145,9 +1145,11 @@ declare const StormConfigSchema: z.ZodObject<{
1145
1145
  background?: string | undefined;
1146
1146
  };
1147
1147
  }>;
1148
+ logLevel?: "debug" | "silent" | "fatal" | "error" | "warn" | "success" | "info" | "trace" | "all" | undefined;
1149
+ name?: string | undefined;
1150
+ mode?: "development" | "staging" | "production" | undefined;
1148
1151
  $schema?: string | null | undefined;
1149
1152
  extends?: string | string[] | undefined;
1150
- name?: string | undefined;
1151
1153
  namespace?: string | undefined;
1152
1154
  organization?: string | undefined;
1153
1155
  repository?: string | undefined;
@@ -1158,14 +1160,12 @@ declare const StormConfigSchema: z.ZodObject<{
1158
1160
  branch?: string | undefined;
1159
1161
  preid?: string | undefined;
1160
1162
  owner?: string | undefined;
1161
- mode?: "development" | "staging" | "production" | undefined;
1162
1163
  workspaceRoot?: string | undefined;
1163
1164
  externalPackagePatterns?: string[] | undefined;
1164
1165
  skipCache?: boolean | undefined;
1165
1166
  packageManager?: "npm" | "yarn" | "pnpm" | "bun" | undefined;
1166
1167
  timezone?: string | undefined;
1167
1168
  locale?: string | undefined;
1168
- logLevel?: "silent" | "fatal" | "error" | "warn" | "success" | "info" | "debug" | "trace" | "all" | undefined;
1169
1169
  skipConfigLogging?: boolean | undefined;
1170
1170
  registry?: {
1171
1171
  npm?: string | undefined;
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;
43
44
  cache?: string | undefined;
44
45
  data?: string | undefined;
45
- config?: string | undefined;
46
46
  temp?: string | undefined;
47
47
  log?: string | undefined;
48
48
  }, {
49
+ config?: string | undefined;
49
50
  cache?: string | undefined;
50
51
  data?: string | undefined;
51
- config?: string | undefined;
52
52
  temp?: string | undefined;
53
53
  log?: string | undefined;
54
54
  build?: string | undefined;
@@ -795,6 +795,8 @@ declare const StormConfigSchema: z.ZodObject<{
795
795
  }>]>>]>]>;
796
796
  extensions: z.ZodDefault<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>>;
797
797
  }, "strip", z.ZodTypeAny, {
798
+ logLevel: "debug" | "silent" | "fatal" | "error" | "warn" | "success" | "info" | "trace" | "all";
799
+ mode: "development" | "staging" | "production";
798
800
  organization: string;
799
801
  license: string;
800
802
  homepage: string;
@@ -806,22 +808,20 @@ declare const StormConfigSchema: z.ZodObject<{
806
808
  name: string;
807
809
  email: string;
808
810
  };
809
- mode: "development" | "staging" | "production";
810
811
  workspaceRoot: string;
811
812
  externalPackagePatterns: string[];
812
813
  skipCache: boolean;
813
814
  directories: {
814
815
  build: string;
816
+ config?: string | undefined;
815
817
  cache?: string | undefined;
816
818
  data?: string | undefined;
817
- config?: string | undefined;
818
819
  temp?: string | undefined;
819
820
  log?: string | undefined;
820
821
  };
821
822
  packageManager: "npm" | "yarn" | "pnpm" | "bun";
822
823
  timezone: string;
823
824
  locale: string;
824
- logLevel: "silent" | "fatal" | "error" | "warn" | "success" | "info" | "debug" | "trace" | "all";
825
825
  registry: {
826
826
  npm?: string | undefined;
827
827
  github?: string | undefined;
@@ -978,9 +978,9 @@ declare const StormConfigSchema: z.ZodObject<{
978
978
  };
979
979
  }>;
980
980
  extensions: Record<string, any>;
981
+ name?: string | undefined;
981
982
  $schema?: string | null | undefined;
982
983
  extends?: string | string[] | undefined;
983
- name?: string | undefined;
984
984
  namespace?: string | undefined;
985
985
  repository?: string | undefined;
986
986
  preid?: string | undefined;
@@ -991,9 +991,9 @@ declare const StormConfigSchema: z.ZodObject<{
991
991
  email?: string | undefined;
992
992
  };
993
993
  directories: {
994
+ config?: string | undefined;
994
995
  cache?: string | undefined;
995
996
  data?: string | undefined;
996
- config?: string | undefined;
997
997
  temp?: string | undefined;
998
998
  log?: string | undefined;
999
999
  build?: string | undefined;
@@ -1145,9 +1145,11 @@ declare const StormConfigSchema: z.ZodObject<{
1145
1145
  background?: string | undefined;
1146
1146
  };
1147
1147
  }>;
1148
+ logLevel?: "debug" | "silent" | "fatal" | "error" | "warn" | "success" | "info" | "trace" | "all" | undefined;
1149
+ name?: string | undefined;
1150
+ mode?: "development" | "staging" | "production" | undefined;
1148
1151
  $schema?: string | null | undefined;
1149
1152
  extends?: string | string[] | undefined;
1150
- name?: string | undefined;
1151
1153
  namespace?: string | undefined;
1152
1154
  organization?: string | undefined;
1153
1155
  repository?: string | undefined;
@@ -1158,14 +1160,12 @@ declare const StormConfigSchema: z.ZodObject<{
1158
1160
  branch?: string | undefined;
1159
1161
  preid?: string | undefined;
1160
1162
  owner?: string | undefined;
1161
- mode?: "development" | "staging" | "production" | undefined;
1162
1163
  workspaceRoot?: string | undefined;
1163
1164
  externalPackagePatterns?: string[] | undefined;
1164
1165
  skipCache?: boolean | undefined;
1165
1166
  packageManager?: "npm" | "yarn" | "pnpm" | "bun" | undefined;
1166
1167
  timezone?: string | undefined;
1167
1168
  locale?: string | undefined;
1168
- logLevel?: "silent" | "fatal" | "error" | "warn" | "success" | "info" | "debug" | "trace" | "all" | undefined;
1169
1169
  skipConfigLogging?: boolean | undefined;
1170
1170
  registry?: {
1171
1171
  npm?: string | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@storm-software/esbuild",
3
- "version": "0.28.1",
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.24.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": "0.140.5",
174
- "@storm-software/config": "1.104.1",
175
- "@storm-software/config-tools": "1.156.1",
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"