coding-friend-cli 1.0.1 → 1.0.2
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/dist/{chunk-6CGGT2FD.js → chunk-UFGNO6CW.js} +4 -0
- package/dist/{host-3GAEZKKJ.js → host-4CEAT6TL.js} +1 -1
- package/dist/index.js +4 -4
- package/dist/{init-ONRXFOZ5.js → init-E6CL3UZQ.js} +1 -1
- package/dist/{mcp-LMMIFH4B.js → mcp-MWESK6UX.js} +1 -1
- package/dist/{update-K5PYOB52.js → update-6PPVL2KJ.js} +13 -7
- package/package.json +1 -1
|
@@ -21,6 +21,9 @@ function streamExec(cmd, args, opts) {
|
|
|
21
21
|
child.on("error", reject);
|
|
22
22
|
});
|
|
23
23
|
}
|
|
24
|
+
function sleepSync(ms) {
|
|
25
|
+
Atomics.wait(new Int32Array(new SharedArrayBuffer(4)), 0, 0, ms);
|
|
26
|
+
}
|
|
24
27
|
function commandExists(cmd) {
|
|
25
28
|
return run("which", [cmd]) !== null;
|
|
26
29
|
}
|
|
@@ -28,5 +31,6 @@ function commandExists(cmd) {
|
|
|
28
31
|
export {
|
|
29
32
|
run,
|
|
30
33
|
streamExec,
|
|
34
|
+
sleepSync,
|
|
31
35
|
commandExists
|
|
32
36
|
};
|
package/dist/index.js
CHANGED
|
@@ -12,15 +12,15 @@ var pkg = JSON.parse(
|
|
|
12
12
|
var program = new Command();
|
|
13
13
|
program.name("cf").description("coding-friend CLI \u2014 host learning docs, setup MCP, init projects").version(pkg.version);
|
|
14
14
|
program.command("init").description("Initialize coding-friend in current project").action(async () => {
|
|
15
|
-
const { initCommand } = await import("./init-
|
|
15
|
+
const { initCommand } = await import("./init-E6CL3UZQ.js");
|
|
16
16
|
await initCommand();
|
|
17
17
|
});
|
|
18
18
|
program.command("host").description("Build and serve learning docs as a static website").argument("[path]", "path to docs folder").option("-p, --port <port>", "port number", "3333").action(async (path, opts) => {
|
|
19
|
-
const { hostCommand } = await import("./host-
|
|
19
|
+
const { hostCommand } = await import("./host-4CEAT6TL.js");
|
|
20
20
|
await hostCommand(path, opts);
|
|
21
21
|
});
|
|
22
22
|
program.command("mcp").description("Setup MCP server for learning docs").argument("[path]", "path to docs folder").action(async (path) => {
|
|
23
|
-
const { mcpCommand } = await import("./mcp-
|
|
23
|
+
const { mcpCommand } = await import("./mcp-MWESK6UX.js");
|
|
24
24
|
await mcpCommand(path);
|
|
25
25
|
});
|
|
26
26
|
program.command("statusline").description("Setup coding-friend statusline in Claude Code").action(async () => {
|
|
@@ -28,7 +28,7 @@ program.command("statusline").description("Setup coding-friend statusline in Cla
|
|
|
28
28
|
await statuslineCommand();
|
|
29
29
|
});
|
|
30
30
|
program.command("update").description("Update coding-friend plugin and refresh statusline").action(async () => {
|
|
31
|
-
const { updateCommand } = await import("./update-
|
|
31
|
+
const { updateCommand } = await import("./update-6PPVL2KJ.js");
|
|
32
32
|
await updateCommand();
|
|
33
33
|
});
|
|
34
34
|
program.parse();
|
|
@@ -3,8 +3,9 @@ import {
|
|
|
3
3
|
} from "./chunk-VHZQ6KEU.js";
|
|
4
4
|
import {
|
|
5
5
|
commandExists,
|
|
6
|
-
run
|
|
7
|
-
|
|
6
|
+
run,
|
|
7
|
+
sleepSync
|
|
8
|
+
} from "./chunk-UFGNO6CW.js";
|
|
8
9
|
import {
|
|
9
10
|
claudeSettingsPath,
|
|
10
11
|
installedPluginsPath,
|
|
@@ -135,14 +136,19 @@ async function updateCommand() {
|
|
|
135
136
|
return;
|
|
136
137
|
}
|
|
137
138
|
log.success("Plugin updated!");
|
|
138
|
-
|
|
139
|
-
|
|
139
|
+
let newVersion = currentVersion;
|
|
140
|
+
for (let i = 0; i < 5; i++) {
|
|
141
|
+
newVersion = getInstalledVersion();
|
|
142
|
+
if (newVersion !== currentVersion) break;
|
|
143
|
+
if (i < 4) sleepSync(1e3);
|
|
144
|
+
}
|
|
145
|
+
if (newVersion !== currentVersion) {
|
|
146
|
+
log.success(`Updated to ${chalk.green(`v${newVersion}`)}`);
|
|
147
|
+
} else {
|
|
140
148
|
log.warn(
|
|
141
|
-
"Version
|
|
149
|
+
"Version in installed_plugins.json unchanged. Cache may still have been updated."
|
|
142
150
|
);
|
|
143
|
-
return;
|
|
144
151
|
}
|
|
145
|
-
log.success(`Updated to ${chalk.green(`v${newVersion}`)}`);
|
|
146
152
|
}
|
|
147
153
|
const targetVersion = findLatestCacheVersion();
|
|
148
154
|
if (targetVersion) {
|