oh-langfuse 0.1.67 → 0.1.68

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": "oh-langfuse",
3
- "version": "0.1.67",
3
+ "version": "0.1.68",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "Use npm scripts to configure Claude Code / OpenCode / Codex with Langfuse tracing.",
@@ -6,9 +6,10 @@ import { fileURLToPath } from "node:url";
6
6
  import { extractVersionFromNpmMetadata, isNewerVersion } from "./update-utils.mjs";
7
7
  import { getRuntimeInstallRecord } from "./runtime-state-utils.mjs";
8
8
 
9
- const rootDir = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..");
10
- const packageJson = JSON.parse(fs.readFileSync(path.join(rootDir, "package.json"), "utf8"));
11
- const ALLOWED_TARGETS = new Set(["claude", "opencode", "codex"]);
9
+ const rootDir = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..");
10
+ const packageJson = JSON.parse(fs.readFileSync(path.join(rootDir, "package.json"), "utf8"));
11
+ const ALLOWED_TARGETS = new Set(["claude", "opencode", "codex"]);
12
+ const OFFICIAL_NPM_REGISTRY = "https://registry.npmjs.org/";
12
13
 
13
14
  const colorEnabled = process.stdout.isTTY && process.env.NO_COLOR !== "1";
14
15
  const ansi = (code) => (colorEnabled ? `\x1b[${code}m` : "");
@@ -39,7 +40,7 @@ function parseArgs(argv) {
39
40
  return args;
40
41
  }
41
42
 
42
- async function latestVersion(packageName, registry = "https://registry.npmjs.org") {
43
+ async function latestVersion(packageName, registry = OFFICIAL_NPM_REGISTRY) {
43
44
  const base = registry.replace(/\/+$/, "");
44
45
  const response = await fetch(`${base}/${packageName}`, { headers: { accept: "application/json" } });
45
46
  if (!response.ok) throw new Error(`npm registry ${response.status} ${response.statusText}`);
@@ -105,15 +106,15 @@ function printAlreadyCurrent(target, packageName, version) {
105
106
  console.log(paint(`[OK] ${label} Langfuse \u5df2\u662f\u6700\u65b0\uff1a${packageName}@${version}`, t.bold, t.green));
106
107
  }
107
108
 
108
- function updateCommandForPackage(packageName, target) {
109
- if (packageName === "oh-aicoding-tool") return `npx oh-aicoding-tool@latest langfuse update ${target}`;
110
- return `npx ${packageName}@latest update ${target}`;
111
- }
112
-
113
- function updateArgsForPackage(packageName, target) {
114
- if (packageName === "oh-aicoding-tool") return ["-y", "oh-aicoding-tool@latest", "langfuse", "update", target];
115
- return ["-y", `${packageName}@latest`, "update", target];
116
- }
109
+ function updateCommandForPackage(packageName, target) {
110
+ if (packageName === "oh-aicoding-tool") return `npx --registry=${OFFICIAL_NPM_REGISTRY} oh-aicoding-tool@latest langfuse update ${target}`;
111
+ return `npx --registry=${OFFICIAL_NPM_REGISTRY} ${packageName}@latest update ${target}`;
112
+ }
113
+
114
+ function updateArgsForPackage(packageName, target) {
115
+ if (packageName === "oh-aicoding-tool") return ["-y", `--registry=${OFFICIAL_NPM_REGISTRY}`, "oh-aicoding-tool@latest", "langfuse", "update", target];
116
+ return ["-y", `--registry=${OFFICIAL_NPM_REGISTRY}`, `${packageName}@latest`, "update", target];
117
+ }
117
118
 
118
119
  function runUpdate(target, packageName, args) {
119
120
  const updateArgs = updateArgsForPackage(packageName, target);
@@ -132,7 +132,7 @@ function writeAutoUpdateHelper(target) {
132
132
  const helperDir = autoUpdateHelperDir();
133
133
  ensureDir(helperDir);
134
134
  const runtimePath = autoUpdateRuntimePath();
135
- const fallbackArgs = ["-y", "oh-langfuse@latest", "auto-update", target, "--skip-check", "--startup-status"];
135
+ const fallbackArgs = ["-y", "--registry=https://registry.npmjs.org/", "oh-langfuse@latest", "auto-update", target, "--skip-check", "--startup-status"];
136
136
 
137
137
  if (process.platform === "win32") {
138
138
  const helper = path.join(helperDir, `oh-langfuse-auto-update-${target}.cmd`);
@@ -161,7 +161,7 @@ function writeAutoUpdateHelper(target) {
161
161
  const helperDir = autoUpdateHelperDir();
162
162
  ensureDir(helperDir);
163
163
  const runtimePath = autoUpdateRuntimePath();
164
- const fallbackArgs = ["-y", "oh-langfuse@latest", "auto-update", target, "--skip-check", "--startup-status"];
164
+ const fallbackArgs = ["-y", "--registry=https://registry.npmjs.org/", "oh-langfuse@latest", "auto-update", target, "--skip-check", "--startup-status"];
165
165
 
166
166
  if (process.platform === "win32") {
167
167
  const helper = path.join(helperDir, `oh-langfuse-auto-update-${target}.cmd`);
@@ -868,7 +868,7 @@ function writeAutoUpdateHelper(target) {
868
868
  const helperDir = autoUpdateHelperDir();
869
869
  ensureDir(helperDir);
870
870
  const runtimePath = autoUpdateRuntimePath();
871
- const fallbackArgs = ["-y", "oh-langfuse@latest", "auto-update", target, "--skip-check", "--startup-status"];
871
+ const fallbackArgs = ["-y", "--registry=https://registry.npmjs.org/", "oh-langfuse@latest", "auto-update", target, "--skip-check", "--startup-status"];
872
872
 
873
873
  if (process.platform === "win32") {
874
874
  const helper = path.join(helperDir, `oh-langfuse-auto-update-${target}.cmd`);