ework-aio 0.3.6 → 0.3.8
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 +2 -2
- package/src/cli.ts +3 -2
- package/src/commands/install.ts +5 -1
- package/src/preflight.ts +12 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ework-aio",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.8",
|
|
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",
|
|
@@ -46,8 +46,8 @@
|
|
|
46
46
|
"postinstall": "echo '\\n ework-aio installed. Run \\033[1mework-aio install\\033[0m to set up services.\\n Help: ework-aio --help\\n'"
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"ework-web": "^0.4.0",
|
|
50
49
|
"ework-daemon": "^0.2.0",
|
|
50
|
+
"ework-web": "^0.4.2",
|
|
51
51
|
"opencode-ework": "^0.1.0",
|
|
52
52
|
"zod": "^3.23.0"
|
|
53
53
|
},
|
package/src/cli.ts
CHANGED
|
@@ -49,7 +49,7 @@ Commands:
|
|
|
49
49
|
Add 'systemd' to also write+enable systemd
|
|
50
50
|
units. Without 'systemd', runs in pure
|
|
51
51
|
PID-file mode (no systemctl calls).
|
|
52
|
-
upgrade
|
|
52
|
+
upgrade | update Pull latest ework-aio from npm and restart
|
|
53
53
|
services. Use this to update — don't re-run
|
|
54
54
|
'install' for version bumps.
|
|
55
55
|
uninstall Stop services and remove units (data preserved)
|
|
@@ -434,7 +434,8 @@ export async function main(
|
|
|
434
434
|
await runInstall(opts, logger);
|
|
435
435
|
return 0;
|
|
436
436
|
}
|
|
437
|
-
case "upgrade":
|
|
437
|
+
case "upgrade":
|
|
438
|
+
case "update": {
|
|
438
439
|
await runUpgrade(opts, logger);
|
|
439
440
|
return 0;
|
|
440
441
|
}
|
package/src/commands/install.ts
CHANGED
|
@@ -24,7 +24,7 @@ import { resolvePaths, type PathConfig } from "../paths.ts";
|
|
|
24
24
|
import { type InstallContext } from "../config.ts";
|
|
25
25
|
import { ensureEnvFile, parseEnvFile, patchEnvKey } from "../env.ts";
|
|
26
26
|
import { startProcess, isProcessRunning, readPidFile } from "../pidfile.ts";
|
|
27
|
-
import { checkPreflight, resolveCommand, resolveBundledBin, ensureSelfBinSymlink, REQUIRED_COMMANDS } from "../preflight.ts";
|
|
27
|
+
import { checkPreflight, resolveCommand, resolveBundledBin, ensureSelfBinSymlink, isDevRepo, REQUIRED_COMMANDS } from "../preflight.ts";
|
|
28
28
|
import {
|
|
29
29
|
generateUnitFile,
|
|
30
30
|
writeUnitFile,
|
|
@@ -107,6 +107,10 @@ export async function runInstall(
|
|
|
107
107
|
|
|
108
108
|
ensureSelfBinSymlink(logger);
|
|
109
109
|
|
|
110
|
+
if (isDevRepo()) {
|
|
111
|
+
logger.warn("running from dev checkout — bundled deps may differ from published versions. For production use 'npm install -g ework-aio' instead.");
|
|
112
|
+
}
|
|
113
|
+
|
|
110
114
|
// 2. Resolve ework-web / ework-daemon binaries.
|
|
111
115
|
//
|
|
112
116
|
// ework-daemon ships TWO bins: `ework-daemon` (client CLI: status/issues/...)
|
package/src/preflight.ts
CHANGED
|
@@ -70,11 +70,23 @@ export function checkPreflight(
|
|
|
70
70
|
export const REQUIRED_COMMANDS: readonly string[] = ["bun", "npm", "opencode"];
|
|
71
71
|
export const OPTIONAL_COMMANDS: readonly string[] = ["systemctl", "sudo"];
|
|
72
72
|
|
|
73
|
+
export function isDevRepo(): boolean {
|
|
74
|
+
const pkgRoot = path.resolve(import.meta.dir, "..");
|
|
75
|
+
return fs.existsSync(path.join(pkgRoot, ".git"));
|
|
76
|
+
}
|
|
77
|
+
|
|
73
78
|
// Ensure `ework-aio` is reachable from PATH. npm puts the bin at its own
|
|
74
79
|
// global prefix's bin dir, which may differ from every dir on PATH (e.g.
|
|
75
80
|
// prefix changed after a node upgrade). Walk PATH in order and, at the
|
|
76
81
|
// first writable dir, create/repair a symlink to our actual bin.
|
|
82
|
+
//
|
|
83
|
+
// Skip when running from a dev checkout (detected via .git dir in package
|
|
84
|
+
// root). A dev-repo symlink would shadow the npm global install and pin the
|
|
85
|
+
// user to stale bundled deps — exactly the bug where `upgrade` pulls latest
|
|
86
|
+
// but `restart` still runs 0.1.0 from the dev repo's node_modules.
|
|
77
87
|
export function ensureSelfBinSymlink(logger: Logger): void {
|
|
88
|
+
if (isDevRepo()) return;
|
|
89
|
+
|
|
78
90
|
const ourBin = path.resolve(import.meta.dir, "..", "bin", "ework-aio");
|
|
79
91
|
if (!fs.existsSync(ourBin)) return;
|
|
80
92
|
const ourBinReal = fs.realpathSync(ourBin);
|