xypriss 9.4.0 → 9.4.1

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
@@ -133,5 +133,5 @@
133
133
  "test:watch": "jest --watch"
134
134
  },
135
135
  "types": "./dist/index.d.ts",
136
- "version": "9.4.0"
136
+ "version": "9.4.1"
137
137
  }
@@ -172,7 +172,15 @@ async function installMemoryCLI() {
172
172
  }
173
173
 
174
174
  // Only run if this is the main module (not being imported)
175
- if (import.meta.url === `file://${process.argv[1]}`) {
175
+ const isMain =
176
+ process.argv[1] &&
177
+ (fileURLToPath(import.meta.url) === path.resolve(process.argv[1]) ||
178
+ import.meta.url === `file://${process.argv[1]}` ||
179
+ fileURLToPath(import.meta.url).endsWith(
180
+ process.argv[1].replace(/^\.\//, ""),
181
+ ));
182
+
183
+ if (isMain) {
176
184
  installMemoryCLI().catch((error) => {
177
185
  console.error("💥 Installation failed:", error);
178
186
  process.exit(0);
@@ -259,7 +259,15 @@ async function installXems() {
259
259
  // Entry Point
260
260
  // ─────────────────────────────────────────────
261
261
 
262
- if (import.meta.url === `file://${process.argv[1]}`) {
262
+ const isMain =
263
+ process.argv[1] &&
264
+ (fileURLToPath(import.meta.url) === path.resolve(process.argv[1]) ||
265
+ import.meta.url === `file://${process.argv[1]}` ||
266
+ fileURLToPath(import.meta.url).endsWith(
267
+ process.argv[1].replace(/^\.\//, ""),
268
+ ));
269
+
270
+ if (isMain) {
263
271
  installXems().catch((error) => {
264
272
  log.error(`Fatal error: ${error.message}`);
265
273
  process.exit(0);
@@ -267,3 +275,4 @@ if (import.meta.url === `file://${process.argv[1]}`) {
267
275
  }
268
276
 
269
277
  export { installXems };
278
+
@@ -7,11 +7,21 @@
7
7
  */
8
8
 
9
9
  import fs from "fs";
10
- import { join, dirname, basename } from "path";
10
+ import path from "path";
11
11
  import { platform, arch } from "os";
12
12
  import https from "https";
13
13
  import { fileURLToPath } from "url";
14
14
 
15
+ const isMain =
16
+ process.argv[1] &&
17
+ (fileURLToPath(import.meta.url) === path.resolve(process.argv[1]) ||
18
+ import.meta.url === `file://${process.argv[1]}` ||
19
+ fileURLToPath(import.meta.url).endsWith(
20
+ process.argv[1].replace(/^\.\//, ""),
21
+ ));
22
+
23
+ const { join, dirname, basename } = path;
24
+
15
25
  const __filename = fileURLToPath(import.meta.url);
16
26
  const __dirname = dirname(__filename);
17
27
 
@@ -222,12 +232,10 @@ async function installXsys() {
222
232
  log.blank();
223
233
  }
224
234
 
225
- // ─────────────────────────────────────────────
226
- // Entry Point - EP
227
- // ─────────────────────────────────────────────
228
-
229
- if (import.meta.url === `file://${process.argv[1]}`) {
235
+ // Entry point handled above
236
+ if (isMain) {
230
237
  installXsys().catch(() => process.exit(0));
231
238
  }
232
239
 
233
240
  export { installXsys };
241
+
@@ -5,10 +5,20 @@
5
5
  * Runs after `npm install` to set up all platform-specific binaries.
6
6
  */
7
7
 
8
+ import { fileURLToPath } from "url";
9
+ import path from "path";
8
10
  import { installMemoryCLI } from "./install-memory-cli.js";
9
11
  import { installXems } from "./install-xems.js";
10
12
  import { installXsys } from "./postinstall-xsys.js";
11
13
 
14
+ const isMain =
15
+ process.argv[1] &&
16
+ (fileURLToPath(import.meta.url) === path.resolve(process.argv[1]) ||
17
+ import.meta.url === `file://${process.argv[1]}` ||
18
+ fileURLToPath(import.meta.url).endsWith(
19
+ process.argv[1].replace(/^\.\//, ""),
20
+ ));
21
+
12
22
  // ─────────────────────────────────────────────
13
23
  // ANSI Color Palette
14
24
  // ─────────────────────────────────────────────
@@ -125,7 +135,7 @@ async function postInstall() {
125
135
  // ─────────────────────────────────────────────
126
136
  // Entry Point
127
137
  // ─────────────────────────────────────────────
128
- if (import.meta.url === `file://${process.argv[1]}`) {
138
+ if (isMain) {
129
139
  postInstall().catch((error) => {
130
140
  log.error(`Fatal error during post-install: ${error.message}`);
131
141
  process.exit(0); // Don't break `npm install`
@@ -133,3 +143,4 @@ if (import.meta.url === `file://${process.argv[1]}`) {
133
143
  }
134
144
 
135
145
  export { postInstall };
146
+