Ver código fonte

fix: update git-package verifier for scoped package name

verify-git-package.mjs hardcoded the unscoped package name for both
the manifest name assertion and the node_modules install path,
breaking verification after the rename to @bodicsek/codex-app-server-bridge.
Split PACKAGE_NAME (scoped, for manifest/path checks) from BIN_NAME
(unscoped, for the bin executable, which npm places by bin key not
package name).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
David Nabraczky-Hajos 3 dias atrás
pai
commit
06a151f0ca
1 arquivos alterados com 5 adições e 4 exclusões
  1. 5 4
      scripts/verify-git-package.mjs

+ 5 - 4
scripts/verify-git-package.mjs

@@ -9,7 +9,8 @@ import { isAbsolute, join, relative } from "node:path";
 import { promisify } from "node:util";
 
 const execFileAsync = promisify(execFile);
-const PACKAGE_NAME = "codex-app-server-bridge";
+const PACKAGE_NAME = "@bodicsek/codex-app-server-bridge";
+const BIN_NAME = "codex-app-server-bridge";
 const DEFAULT_CACHE = "/private/tmp/codex-app-server-bridge-npm-cache";
 const USAGE = "usage: npm run verify:git-package -- <git+https|git+ssh|git+file URL>#<vX.Y.Z|40-character-commit>";
 
@@ -57,7 +58,7 @@ async function installPackage(prefix, cache, packageSpec) {
 
 async function installedPackage(prefix, cache) {
   const packageRoot = join(prefix, "lib", "node_modules", PACKAGE_NAME);
-  const executable = join(prefix, "bin", PACKAGE_NAME);
+  const executable = join(prefix, "bin", BIN_NAME);
   await Promise.all([
     access(executable, constants.X_OK),
     access(join(packageRoot, "dist", "cli.js"), constants.R_OK),
@@ -84,7 +85,7 @@ async function installedPackage(prefix, cache) {
 
   const manifest = JSON.parse(await readFile(join(realPackage, "package.json"), "utf8"));
   assert.equal(manifest.name, PACKAGE_NAME);
-  assert.deepEqual(manifest.bin, { [PACKAGE_NAME]: `bin/${PACKAGE_NAME}.js` });
+  assert.deepEqual(manifest.bin, { [BIN_NAME]: `bin/${BIN_NAME}.js` });
   return { executable, version: String(manifest.version) };
 }
 
@@ -119,7 +120,7 @@ async function verify() {
       ok: true,
       package: `${PACKAGE_NAME}@${installed.version}`,
       revision,
-      executable: `bin/${PACKAGE_NAME}`,
+      executable: `bin/${BIN_NAME}`,
       storage: "isolated-prefix",
       invocation: "verified",
     })}\n`);