ework-aio 0.5.8 → 0.5.9
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 +1 -1
- package/src/commands/upgrade.ts +1 -1
- package/src/preflight.ts +9 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ework-aio",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.9",
|
|
4
4
|
"description": "All-in-one installer for ework (issue tracker) + ework-daemon (AI bridge) + opencode-ework (plugin). One command: npm i -g ework-aio && ework-aio install.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
package/src/commands/upgrade.ts
CHANGED
|
@@ -6,7 +6,7 @@ import type { GlobalOptions } from "../types.ts";
|
|
|
6
6
|
function readInstalledVersion(): string {
|
|
7
7
|
try {
|
|
8
8
|
const pkg = JSON.parse(
|
|
9
|
-
readFileSync(new URL("
|
|
9
|
+
readFileSync(new URL("../../package.json", import.meta.url), "utf8")
|
|
10
10
|
);
|
|
11
11
|
return pkg.version ?? "unknown";
|
|
12
12
|
} catch {
|
package/src/preflight.ts
CHANGED
|
@@ -41,7 +41,15 @@ export function resolveCommand(cmd: string): string | null {
|
|
|
41
41
|
// the user to "install ework-web first" even though it was already bundled
|
|
42
42
|
// (B-1). Returns the absolute bin path, or null if not bundled.
|
|
43
43
|
export function resolveBundledBin(pkgName: string, binRelPath: string): string | null {
|
|
44
|
-
if (isDevRepo())
|
|
44
|
+
if (isDevRepo()) {
|
|
45
|
+
const r = spawnSync("npm", ["root", "-g"], { encoding: "utf8", stdio: ["ignore", "pipe", "ignore"], env: process.env });
|
|
46
|
+
const npmRoot = (r.stdout ?? "").trim();
|
|
47
|
+
if (npmRoot) {
|
|
48
|
+
const candidate = path.join(npmRoot, "ework-aio", "node_modules", pkgName, binRelPath);
|
|
49
|
+
if (fs.existsSync(candidate)) return candidate;
|
|
50
|
+
}
|
|
51
|
+
return null;
|
|
52
|
+
}
|
|
45
53
|
const root = process.env.AIO_PACKAGE_ROOT || DEFAULT_PACKAGE_ROOT;
|
|
46
54
|
const candidate = path.join(root, "node_modules", pkgName, binRelPath);
|
|
47
55
|
return fs.existsSync(candidate) ? candidate : null;
|