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.
@@ -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
  };
@@ -6,7 +6,7 @@ import "./chunk-HRVSKMNA.js";
6
6
  import {
7
7
  run,
8
8
  streamExec
9
- } from "./chunk-6CGGT2FD.js";
9
+ } from "./chunk-UFGNO6CW.js";
10
10
  import "./chunk-AQXTNLQD.js";
11
11
  import {
12
12
  log
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-ONRXFOZ5.js");
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-3GAEZKKJ.js");
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-LMMIFH4B.js");
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-K5PYOB52.js");
31
+ const { updateCommand } = await import("./update-6PPVL2KJ.js");
32
32
  await updateCommand();
33
33
  });
34
34
  program.parse();
@@ -7,7 +7,7 @@ import {
7
7
  } from "./chunk-VHZQ6KEU.js";
8
8
  import {
9
9
  run
10
- } from "./chunk-6CGGT2FD.js";
10
+ } from "./chunk-UFGNO6CW.js";
11
11
  import {
12
12
  claudeSettingsPath,
13
13
  globalConfigPath,
@@ -5,7 +5,7 @@ import {
5
5
  import "./chunk-HRVSKMNA.js";
6
6
  import {
7
7
  run
8
- } from "./chunk-6CGGT2FD.js";
8
+ } from "./chunk-UFGNO6CW.js";
9
9
  import "./chunk-AQXTNLQD.js";
10
10
  import {
11
11
  log
@@ -3,8 +3,9 @@ import {
3
3
  } from "./chunk-VHZQ6KEU.js";
4
4
  import {
5
5
  commandExists,
6
- run
7
- } from "./chunk-6CGGT2FD.js";
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
- const newVersion = getInstalledVersion();
139
- if (newVersion === currentVersion) {
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 unchanged after update. Restart Claude Code and try cf update again."
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) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "coding-friend-cli",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "CLI for coding-friend — host learning docs, setup MCP server, initialize projects",
5
5
  "type": "module",
6
6
  "bin": {