qcobjects-cli 2.5.135-beta → 2.5.137-beta

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/VERSION CHANGED
@@ -1 +1 @@
1
- 2.5.135-beta
1
+ 2.5.137-beta
package/build-esbuild.js CHANGED
@@ -160,13 +160,34 @@ const baseSettings = {
160
160
 
161
161
  const cjsSettings = {
162
162
  ...baseSettings,
163
- outdir: "public/cjs", // Output dir
164
- format: "cjs", // or "esm" depending on your module system
165
- platform: "node", // or "browser" depending on your target environment
163
+ outdir: "public/cjs",
164
+ format: "cjs",
165
+ platform: "node",
166
166
  outExtension: {
167
167
  ".js": ".cjs"
168
168
  },
169
169
  plugins: [
170
+ ignorePlugin,
171
+ {
172
+ name: 'transform-dynamic-imports',
173
+ setup(build) {
174
+ // Transform dynamic imports in the final output
175
+ build.onEnd(() => {
176
+ const files = glob.sync('public/cjs/**/*.cjs');
177
+ for (const file of files) {
178
+ let content = readFileSync(file, 'utf8');
179
+
180
+ // Transform dynamic imports to requires
181
+ content = content.replace(
182
+ /await\s+import\(['"]([^'"]+)['"]\)/g,
183
+ '__toESM(require("$1"), true)'
184
+ );
185
+
186
+ writeFileSync(file, content, 'utf8');
187
+ }
188
+ });
189
+ }
190
+ },
170
191
  {
171
192
  name: 'add-extensions',
172
193
  setup(build) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qcobjects-cli",
3
- "version": "2.5.135-beta",
3
+ "version": "2.5.137-beta",
4
4
  "description": "qcobjects cli command line tool",
5
5
  "main": "public/cjs/index.cjs",
6
6
  "module": "public/esm/index.mjs",
@@ -24,11 +24,11 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
24
24
  ));
25
25
  var import_common_pipelog = require("../common-pipelog.cjs");
26
26
  (async () => {
27
- const fs = await import("node:fs");
28
- const os = await import("node:os");
29
- const { exec, execSync } = await import("node:child_process");
30
- const { Package, BackendMicroservice, logger, CONFIG, Class } = await import("qcobjects");
31
- const path = await import("node:path");
27
+ const fs = __toESM(require("node:fs"), true);
28
+ const os = __toESM(require("node:os"), true);
29
+ const { exec, execSync } = __toESM(require("node:child_process"), true);
30
+ const { Package, BackendMicroservice, logger, CONFIG, Class } = __toESM(require("qcobjects"), true);
31
+ const path = __toESM(require("node:path"), true);
32
32
  const absolutePath = path.resolve(__dirname, "./");
33
33
  const fixWinCmd = /* @__PURE__ */ __name(function(commandline) {
34
34
  if (!process.platform.toLowerCase().startsWith("win")) {
@@ -37,7 +37,7 @@ var import_qcobjects = require("qcobjects");
37
37
  const isMac = /* @__PURE__ */ __name(() => {
38
38
  return import_node_os.default.platform().toLowerCase().startsWith("darwin");
39
39
  }, "isMac");
40
- const { execSync } = await import("node:child_process");
40
+ const { execSync } = __toESM(require("node:child_process"), true);
41
41
  class Main extends import_qcobjects.InheritClass {
42
42
  static {
43
43
  __name(this, "Main");
@@ -28,10 +28,10 @@ var import_main_http_server = require("./main-http-server.cjs");
28
28
  var import_main_http2_server = require("./main-http2-server.cjs");
29
29
  (async () => {
30
30
  "use strict";
31
- const path = await import("path");
31
+ const path = __toESM(require("path"), true);
32
32
  const absolutePath = path.resolve(__dirname, "./");
33
- await import("qcobjects");
34
- const { CONFIG, InheritClass, New, logger } = await import("qcobjects");
33
+ __toESM(require("qcobjects"), true);
34
+ const { CONFIG, InheritClass, New, logger } = __toESM(require("qcobjects"), true);
35
35
  class Main extends InheritClass {
36
36
  static {
37
37
  __name(this, "Main");