@nyex/nyex 0.1.2-beta → 0.1.2-beta.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.
Files changed (2) hide show
  1. package/bin/nyex.js +25 -22
  2. package/package.json +5 -5
package/bin/nyex.js CHANGED
@@ -4,8 +4,11 @@
4
4
  const path = require("path");
5
5
  const fs = require("fs");
6
6
  const crypto = require("crypto");
7
- const { spawn, execSync } = require("child_process");
8
- const pkg = require("../package.json");
7
+ const { spawn, execSync } = require("child_process");
8
+ const pkg = require("../package.json");
9
+ const META_PACKAGE = pkg.name || "@nyex/nyex";
10
+ const PLATFORM_PACKAGE = "@nyex/nyex-win32-x64-msvc";
11
+ const INSTALL_TAG = "beta";
9
12
 
10
13
  function candidateGlobalNodeModuleDirs() {
11
14
  const dirs = [];
@@ -42,15 +45,15 @@ function formatInstallHelp({ platform, arch, expectedPackage }) {
42
45
  lines.push(`Detected platform: ${platform}-${arch}`);
43
46
  lines.push(`Expected package: ${expectedPackage}`);
44
47
  lines.push("");
45
- lines.push("How to fix:");
46
- lines.push(" 1) Reinstall the meta package (this should pull the platform binary automatically):");
47
- lines.push(" npm i -g @corpai/nyex@alpha");
48
- lines.push(" 2) If that still doesn't install the platform binary, install it explicitly:");
49
- lines.push(` npm i -g ${expectedPackage}@alpha`);
48
+ lines.push("How to fix:");
49
+ lines.push(" 1) Reinstall the meta package (this should pull the platform binary automatically):");
50
+ lines.push(` npm i -g ${META_PACKAGE}@${INSTALL_TAG}`);
51
+ lines.push(" 2) If that still doesn't install the platform binary, install it explicitly:");
52
+ lines.push(` npm i -g ${expectedPackage}@${INSTALL_TAG}`);
50
53
  lines.push("");
51
54
  lines.push("If you are testing local .tgz files:");
52
55
  lines.push(" 1) Install the platform .tgz first");
53
- lines.push(" 2) Then install the @corpai/nyex .tgz");
56
+ lines.push(` 2) Then install the ${META_PACKAGE} .tgz`);
54
57
  return lines.join("\n");
55
58
  }
56
59
 
@@ -63,8 +66,8 @@ function resolveBinary() {
63
66
  const platform = process.platform;
64
67
  const arch = process.arch;
65
68
 
66
- if (platform === "win32" && arch === "x64") {
67
- const expectedPackage = "@corpai/nyex-win32-x64-msvc";
69
+ if (platform === "win32" && arch === "x64") {
70
+ const expectedPackage = PLATFORM_PACKAGE;
68
71
  const candidatePkgJsonPaths = [];
69
72
 
70
73
  // First, try normal Node resolution (works when the platform package is an optionalDependency).
@@ -125,9 +128,9 @@ function verifyBinaryIntegrity({ expectedPackage, binPath, shaPath }) {
125
128
  "",
126
129
  `Expected: ${shaPath}`,
127
130
  "",
128
- "How to fix:",
129
- ` npm uninstall -g ${expectedPackage}`,
130
- " npm i -g @corpai/nyex@alpha",
131
+ "How to fix:",
132
+ ` npm uninstall -g ${expectedPackage}`,
133
+ ` npm i -g ${META_PACKAGE}@${INSTALL_TAG}`,
131
134
  "",
132
135
  "If you are testing local .tgz files, re-run the staging script then reinstall:",
133
136
  " scripts\\npm\\stage-windows-binary.ps1 ...",
@@ -152,9 +155,9 @@ function verifyBinaryIntegrity({ expectedPackage, binPath, shaPath }) {
152
155
  "",
153
156
  `Path: ${shaPath}`,
154
157
  "",
155
- "How to fix:",
156
- ` npm uninstall -g ${expectedPackage}`,
157
- " npm i -g @corpai/nyex@alpha",
158
+ "How to fix:",
159
+ ` npm uninstall -g ${expectedPackage}`,
160
+ ` npm i -g ${META_PACKAGE}@${INSTALL_TAG}`,
158
161
  ].join("\n")
159
162
  );
160
163
  // Recoverable: a sibling global platform install may still be valid.
@@ -171,12 +174,12 @@ function verifyBinaryIntegrity({ expectedPackage, binPath, shaPath }) {
171
174
  `Expected: ${expected}`,
172
175
  `Actual: ${actual}`,
173
176
  "",
174
- "Remediation:",
175
- ` npm uninstall -g ${expectedPackage} @corpai/nyex`,
176
- " npm cache clean --force",
177
- " npm i -g @corpai/nyex@alpha",
178
- ].join("\n")
179
- );
177
+ "Remediation:",
178
+ ` npm uninstall -g ${expectedPackage} ${META_PACKAGE}`,
179
+ " npm cache clean --force",
180
+ ` npm i -g ${META_PACKAGE}@${INSTALL_TAG}`,
181
+ ].join("\n")
182
+ );
180
183
  // Fatal: we found a binary + checksum pair that disagree.
181
184
  err.nyex_fatal = true;
182
185
  throw err;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nyex/nyex",
3
- "version": "0.1.2-beta",
3
+ "version": "0.1.2-beta.1",
4
4
  "description": "Nyex CLI (private beta)",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "homepage": "https://nyex.ai",
@@ -18,11 +18,11 @@
18
18
  "nyex": "bin/nyex.js"
19
19
  },
20
20
  "optionalDependencies": {
21
- "@nyex/nyex-win32-x64-msvc": "0.1.2-beta"
21
+ "@nyex/nyex-win32-x64-msvc": "0.1.2-beta.1"
22
+ },
23
+ "engines": {
24
+ "node": ">=18"
22
25
  },
23
- "engines": {
24
- "node": ">=18"
25
- },
26
26
  "files": [
27
27
  "bin/nyex.js",
28
28
  "LICENSE",