@clubnet/seedclub 0.2.1 → 0.2.3
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/cli.js +11 -2
- package/package.json +1 -1
- package/postinstall.js +11 -18
package/bin/cli.js
CHANGED
|
@@ -158,13 +158,22 @@ if (cmd !== "setup-auth") {
|
|
|
158
158
|
|
|
159
159
|
let piBin;
|
|
160
160
|
try {
|
|
161
|
-
const piPkgPath =
|
|
162
|
-
|
|
161
|
+
const piPkgPath = join(
|
|
162
|
+
__dirname,
|
|
163
|
+
"..",
|
|
164
|
+
"node_modules",
|
|
165
|
+
"@mariozechner",
|
|
166
|
+
"pi-coding-agent",
|
|
167
|
+
"package.json",
|
|
163
168
|
);
|
|
169
|
+
if (!existsSync(piPkgPath)) {
|
|
170
|
+
throw new Error("pi package.json not found in package-local node_modules");
|
|
171
|
+
}
|
|
164
172
|
const piPkg = JSON.parse(readFileSync(piPkgPath, "utf-8"));
|
|
165
173
|
const binEntry = piPkg.bin && (piPkg.bin.pi || Object.values(piPkg.bin)[0]);
|
|
166
174
|
if (!binEntry) throw new Error("No bin entry in pi package.json");
|
|
167
175
|
piBin = join(dirname(piPkgPath), binEntry);
|
|
176
|
+
if (!existsSync(piBin)) throw new Error(`pi bin not found at ${piBin}`);
|
|
168
177
|
} catch (err) {
|
|
169
178
|
console.error("seedclub: could not locate pi runtime. Reinstall with:");
|
|
170
179
|
console.error(" npm install -g @clubnet/seedclub");
|
package/package.json
CHANGED
package/postinstall.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
const { existsSync, mkdirSync, readFileSync, writeFileSync, cpSync, rmSync } = require("fs");
|
|
4
4
|
const { join, dirname } = require("path");
|
|
5
5
|
const { homedir } = require("os");
|
|
6
|
-
const {
|
|
6
|
+
const { execFileSync } = require("child_process");
|
|
7
7
|
|
|
8
8
|
const HOME = homedir();
|
|
9
9
|
const SC_HOME = join(HOME, ".seedclub");
|
|
@@ -22,6 +22,10 @@ const RESET = "\x1b[0m";
|
|
|
22
22
|
function ok(msg) { console.log(`${GREEN}\u2713${RESET} ${msg}`); }
|
|
23
23
|
function info(msg) { console.log(`${CYAN}\u25b8${RESET} ${msg}`); }
|
|
24
24
|
function warn(msg) { console.log(`${YELLOW}\u26a0${RESET} ${msg}`); }
|
|
25
|
+
function fail(msg) {
|
|
26
|
+
console.error(`\x1b[31m\u2717${RESET} ${msg}`);
|
|
27
|
+
process.exit(1);
|
|
28
|
+
}
|
|
25
29
|
|
|
26
30
|
// ── 1. Create directory structure ───────────────────────────────────────
|
|
27
31
|
|
|
@@ -60,28 +64,17 @@ if (existsSync(extPkgJson)) {
|
|
|
60
64
|
info("Installing extension dependencies...");
|
|
61
65
|
const extDir = join(SC_DIR, "extensions", "seedclub");
|
|
62
66
|
const hasLock = existsSync(join(extDir, "package-lock.json"));
|
|
63
|
-
const
|
|
64
|
-
let installed = false;
|
|
67
|
+
const npmArgs = hasLock ? ["ci", "--omit=dev"] : ["install", "--omit=dev"];
|
|
65
68
|
try {
|
|
66
|
-
|
|
69
|
+
execFileSync("npm", npmArgs, {
|
|
67
70
|
cwd: extDir,
|
|
68
|
-
stdio:
|
|
71
|
+
stdio: "inherit",
|
|
69
72
|
});
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
// Retry without --silent so errors are visible
|
|
73
|
-
try {
|
|
74
|
-
execSync(npmCmd, {
|
|
75
|
-
cwd: extDir,
|
|
76
|
-
stdio: "inherit",
|
|
77
|
-
});
|
|
78
|
-
installed = true;
|
|
79
|
-
} catch {
|
|
80
|
-
warn("Extension dependencies failed to install (non-fatal)");
|
|
81
|
-
}
|
|
73
|
+
} catch (err) {
|
|
74
|
+
fail("Extension dependencies failed to install. Aborting installation.");
|
|
82
75
|
}
|
|
83
76
|
if (!hasLock) warn("No lockfile for extension deps; installs may vary over time");
|
|
84
|
-
|
|
77
|
+
ok("Extension dependencies installed");
|
|
85
78
|
}
|
|
86
79
|
|
|
87
80
|
// ── 5. Create settings.json (only if missing) ──────────────────────────
|