@andyqiu/codeforge 0.4.0 → 0.5.0
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/bin/codeforge.mjs +4 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/bin/codeforge.mjs
CHANGED
|
@@ -70,7 +70,10 @@ function getVersion() {
|
|
|
70
70
|
// 上下文;process.argv[1] 保留用户实际调用路径,不会被解析。
|
|
71
71
|
function isFromNpm() {
|
|
72
72
|
const entry = process.argv[1] ?? ""
|
|
73
|
-
|
|
73
|
+
if (entry.includes(`${path.sep}node_modules${path.sep}`)) return true
|
|
74
|
+
// fallback:npm 包里没有 build-with-version.mjs(只有 dist/),检测它不存在即为 npm 场景
|
|
75
|
+
const buildScript = path.join(REPO_ROOT, "scripts", "build-with-version.mjs")
|
|
76
|
+
return !existsSync(buildScript)
|
|
74
77
|
}
|
|
75
78
|
|
|
76
79
|
// ────────────────────────────────────────────────────────────────────
|
package/dist/index.js
CHANGED
|
@@ -20596,7 +20596,7 @@ import * as zlib from "node:zlib";
|
|
|
20596
20596
|
// lib/version-injected.ts
|
|
20597
20597
|
function getInjectedVersion() {
|
|
20598
20598
|
try {
|
|
20599
|
-
const v = "0.
|
|
20599
|
+
const v = "0.5.0";
|
|
20600
20600
|
if (typeof v === "string" && /^\d+\.\d+\.\d+/.test(v)) {
|
|
20601
20601
|
return v;
|
|
20602
20602
|
}
|