cynx-lib 1.3.94 → 1.3.96

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cynx-lib",
3
- "version": "1.3.94",
3
+ "version": "1.3.96",
4
4
  "type": "module",
5
5
  "main": "./index.cjs",
6
6
  "module": "./index.js",
package/utils/index.cjs CHANGED
@@ -32,7 +32,6 @@ __export(index_exports, {
32
32
  durationUtil: () => import_duration.default,
33
33
  oidcUtil: () => import_oidc.default,
34
34
  realtimeUtil: () => import_realtime.default,
35
- serverUtil: () => import_server.default,
36
35
  sessionManagerUtil: () => import_session_manager.default,
37
36
  sessionUtil: () => import_session.default,
38
37
  storageUtil: () => import_storage.default,
@@ -61,15 +60,12 @@ var import_session = __toESM(require("./utils/session.cjs"), 1);
61
60
  var import_session_manager = __toESM(require("./utils/session_manager.cjs"), 1);
62
61
  var import_ui = __toESM(require("./utils/ui.cjs"), 1);
63
62
  var import_db = __toESM(require("./utils/db.cjs"), 1);
64
- __reExport(index_exports, require("./utils/server.cjs"), module.exports);
65
- var import_server = __toESM(require("./utils/server.cjs"), 1);
66
63
  // Annotate the CommonJS export names for ESM import in node:
67
64
  0 && (module.exports = {
68
65
  dbUtil,
69
66
  durationUtil,
70
67
  oidcUtil,
71
68
  realtimeUtil,
72
- serverUtil,
73
69
  sessionManagerUtil,
74
70
  sessionUtil,
75
71
  storageUtil,
@@ -85,6 +81,5 @@ var import_server = __toESM(require("./utils/server.cjs"), 1);
85
81
  ...require("./utils/session.cjs"),
86
82
  ...require("./utils/session_manager.cjs"),
87
83
  ...require("./utils/ui.cjs"),
88
- ...require("./utils/db.cjs"),
89
- ...require("./utils/server.cjs")
84
+ ...require("./utils/db.cjs")
90
85
  });
package/utils/index.js CHANGED
@@ -20,5 +20,3 @@ export { default as sessionUtil } from './utils/session.js';
20
20
  export { default as sessionManagerUtil } from './utils/session_manager.js';
21
21
  export { default as uiUtil } from './utils/ui.js';
22
22
  export { default as dbUtil } from './utils/db.js';
23
- export * from './utils/server.js';
24
- export { default as serverUtil } from './utils/server.js';
@@ -42,13 +42,14 @@ var import_fs = __toESM(require("fs"), 1);
42
42
  var import_path = __toESM(require("path"), 1);
43
43
  var import_os = __toESM(require("os"), 1);
44
44
  var import_http = __toESM(require("http"), 1);
45
- var import_child_process = require("child_process");
46
45
  let cachedCommit = null;
47
46
  let cachedBuildInfo = null;
48
47
  const bootTime = (/* @__PURE__ */ new Date()).toISOString();
49
48
  function execGit(cmd, cwd) {
50
49
  try {
51
- const stdout = (0, import_child_process.execSync)(cmd, {
50
+ const execSyncFn = typeof require !== "undefined" ? require("child_process").execSync : null;
51
+ if (!execSyncFn) return "";
52
+ const stdout = execSyncFn(cmd, {
52
53
  cwd: cwd || process.cwd(),
53
54
  stdio: ["ignore", "pipe", "ignore"],
54
55
  timeout: 2e3,
@@ -111,10 +112,10 @@ function printServerBanner({
111
112
  commit,
112
113
  shouldSyncDb = false,
113
114
  isSynced = false,
114
- networkIp = null
115
+ networkIp = void 0
115
116
  }) {
116
117
  const commitTag = commit ? " \x1B[32m" + commit + "\x1B[0m" : "";
117
- const resolvedIp = networkIp !== void 0 ? networkIp : getNetworkIp();
118
+ const resolvedIp = networkIp !== void 0 && networkIp !== null ? networkIp : getNetworkIp();
118
119
  console.log("\n \x1B[32m\x1B[1mSERVER\x1B[0m" + commitTag + " \x1B[90mready in " + elapsed + " ms\x1B[0m\n");
119
120
  console.log(" \x1B[32m\u279C\x1B[0m \x1B[1mLocal:\x1B[0m \x1B[36mhttp://localhost:" + port + "/\x1B[0m");
120
121
  if (resolvedIp) {
@@ -17,7 +17,7 @@ import fs from 'fs';
17
17
  import path from 'path';
18
18
  import os from 'os';
19
19
  import http from 'http';
20
- import { execSync } from 'child_process';
20
+
21
21
 
22
22
  let cachedCommit = null;
23
23
  let cachedBuildInfo = null;
@@ -28,7 +28,9 @@ const bootTime = new Date().toISOString();
28
28
  */
29
29
  export function execGit(cmd, cwd) {
30
30
  try {
31
- const stdout = execSync(cmd, {
31
+ const execSyncFn = typeof require !== 'undefined' ? require('child_process').execSync : null;
32
+ if (!execSyncFn) return '';
33
+ const stdout = execSyncFn(cmd, {
32
34
  cwd: cwd || process.cwd(),
33
35
  stdio: ['ignore', 'pipe', 'ignore'],
34
36
  timeout: 2000,
@@ -125,10 +127,10 @@ export function printServerBanner({
125
127
  commit,
126
128
  shouldSyncDb = false,
127
129
  isSynced = false,
128
- networkIp = null,
130
+ networkIp = undefined,
129
131
  }) {
130
132
  const commitTag = commit ? ' \x1b[32m' + commit + '\x1b[0m' : '';
131
- const resolvedIp = networkIp !== undefined ? networkIp : getNetworkIp();
133
+ const resolvedIp = (networkIp !== undefined && networkIp !== null) ? networkIp : getNetworkIp();
132
134
 
133
135
  console.log('\n \x1b[32m\x1b[1mSERVER\x1b[0m' + commitTag + ' \x1b[90mready in ' + elapsed + ' ms\x1b[0m\n');
134
136
  console.log(' \x1b[32m➜\x1b[0m \x1b[1mLocal:\x1b[0m \x1b[36mhttp://localhost:' + port + '/\x1b[0m');