coding-friend-cli 1.1.1 → 1.2.0

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.
Files changed (106) hide show
  1. package/README.md +15 -0
  2. package/dist/{chunk-KZT4AFDW.js → chunk-5HZJX47M.js} +1 -1
  3. package/dist/{chunk-AQXTNLQD.js → chunk-6OI37OZX.js} +9 -1
  4. package/dist/chunk-R6ZYK4UX.js +128 -0
  5. package/dist/dev-LZASFXZZ.js +243 -0
  6. package/dist/{host-JBTJCWM2.js → host-BK6DYFWF.js} +2 -2
  7. package/dist/index.js +26 -5
  8. package/dist/{init-E6CL3UZQ.js → init-2UKYE2KV.js} +2 -2
  9. package/dist/{mcp-MWESK6UX.js → mcp-CH4SKZSX.js} +2 -2
  10. package/dist/postinstall.js +1 -1
  11. package/dist/{statusline-7D6YU5YM.js → statusline-ARI7I5YM.js} +1 -1
  12. package/dist/{update-IH3G4SN5.js → update-5A2OP6EY.js} +58 -37
  13. package/lib/learn-host/.prettierignore +3 -0
  14. package/lib/learn-host/.prettierrc +8 -0
  15. package/lib/learn-host/CHANGELOG.md +9 -0
  16. package/lib/learn-host/eslint.config.mjs +6 -0
  17. package/lib/learn-host/next-env.d.ts +1 -1
  18. package/lib/learn-host/next.config.ts +1 -0
  19. package/lib/learn-host/package-lock.json +6039 -391
  20. package/lib/learn-host/package.json +30 -15
  21. package/lib/learn-host/public/_pagefind/fragment/en_1172b3c.pf_fragment +0 -0
  22. package/lib/learn-host/public/_pagefind/fragment/en_118ad1c.pf_fragment +0 -0
  23. package/lib/learn-host/public/_pagefind/fragment/en_32ab3d8.pf_fragment +0 -0
  24. package/lib/learn-host/public/_pagefind/fragment/en_441f1e1.pf_fragment +0 -0
  25. package/lib/learn-host/public/_pagefind/fragment/en_4452de4.pf_fragment +0 -0
  26. package/lib/learn-host/public/_pagefind/fragment/en_4ae396d.pf_fragment +0 -0
  27. package/lib/learn-host/public/_pagefind/fragment/en_58ee89d.pf_fragment +0 -0
  28. package/lib/learn-host/public/_pagefind/fragment/en_6dd2225.pf_fragment +0 -0
  29. package/lib/learn-host/public/_pagefind/fragment/en_765a297.pf_fragment +0 -0
  30. package/lib/learn-host/public/_pagefind/fragment/en_7a4cc4a.pf_fragment +0 -0
  31. package/lib/learn-host/public/_pagefind/fragment/en_8050261.pf_fragment +0 -0
  32. package/lib/learn-host/public/_pagefind/fragment/en_83eaedf.pf_fragment +0 -0
  33. package/lib/learn-host/public/_pagefind/fragment/en_925bc5f.pf_fragment +0 -0
  34. package/lib/learn-host/public/_pagefind/fragment/en_95f3dd5.pf_fragment +0 -0
  35. package/lib/learn-host/public/_pagefind/fragment/en_96d7a02.pf_fragment +0 -0
  36. package/lib/learn-host/public/_pagefind/fragment/en_971f951.pf_fragment +0 -0
  37. package/lib/learn-host/public/_pagefind/fragment/en_a446c32.pf_fragment +0 -0
  38. package/lib/learn-host/public/_pagefind/fragment/en_a5ee367.pf_fragment +0 -0
  39. package/lib/learn-host/public/_pagefind/fragment/en_b11c248.pf_fragment +0 -0
  40. package/lib/learn-host/public/_pagefind/fragment/en_b13c52e.pf_fragment +0 -0
  41. package/lib/learn-host/public/_pagefind/fragment/en_b5bd69b.pf_fragment +0 -0
  42. package/lib/learn-host/public/_pagefind/fragment/en_b625d7d.pf_fragment +0 -0
  43. package/lib/learn-host/public/_pagefind/fragment/en_bf63915.pf_fragment +0 -0
  44. package/lib/learn-host/public/_pagefind/fragment/en_c52b25b.pf_fragment +0 -0
  45. package/lib/learn-host/public/_pagefind/fragment/en_c9db556.pf_fragment +0 -0
  46. package/lib/learn-host/public/_pagefind/fragment/en_d1537ee.pf_fragment +0 -0
  47. package/lib/learn-host/public/_pagefind/fragment/en_d2e6412.pf_fragment +0 -0
  48. package/lib/learn-host/public/_pagefind/fragment/en_d2f47a4.pf_fragment +0 -0
  49. package/lib/learn-host/public/_pagefind/fragment/en_d361292.pf_fragment +0 -0
  50. package/lib/learn-host/public/_pagefind/fragment/en_d727ec8.pf_fragment +0 -0
  51. package/lib/learn-host/public/_pagefind/fragment/en_e11cd8f.pf_fragment +0 -0
  52. package/lib/learn-host/public/_pagefind/fragment/en_e481f19.pf_fragment +0 -0
  53. package/lib/learn-host/public/_pagefind/fragment/en_eee2805.pf_fragment +0 -0
  54. package/lib/learn-host/public/_pagefind/fragment/en_f4de6c4.pf_fragment +0 -0
  55. package/lib/learn-host/public/_pagefind/index/en_1ecb9d5.pf_index +0 -0
  56. package/lib/learn-host/public/_pagefind/index/en_37e362b.pf_index +0 -0
  57. package/lib/learn-host/public/_pagefind/index/en_538eee7.pf_index +0 -0
  58. package/lib/learn-host/public/_pagefind/index/en_5751dc8.pf_index +0 -0
  59. package/lib/learn-host/public/_pagefind/index/en_67f794d.pf_index +0 -0
  60. package/lib/learn-host/public/_pagefind/index/en_7458f81.pf_index +0 -0
  61. package/lib/learn-host/public/_pagefind/index/en_e21f7e1.pf_index +0 -0
  62. package/lib/learn-host/public/_pagefind/pagefind-entry.json +1 -0
  63. package/lib/learn-host/public/_pagefind/pagefind-highlight.js +1064 -0
  64. package/lib/learn-host/public/_pagefind/pagefind-modular-ui.css +214 -0
  65. package/lib/learn-host/public/_pagefind/pagefind-modular-ui.js +8 -0
  66. package/lib/learn-host/public/_pagefind/pagefind-ui.css +1 -0
  67. package/lib/learn-host/public/_pagefind/pagefind-ui.js +2 -0
  68. package/lib/learn-host/public/_pagefind/pagefind.en_104569cceb.pf_meta +0 -0
  69. package/lib/learn-host/public/_pagefind/pagefind.en_1075df6f16.pf_meta +0 -0
  70. package/lib/learn-host/public/_pagefind/pagefind.en_139f35f6e5.pf_meta +0 -0
  71. package/lib/learn-host/public/_pagefind/pagefind.en_46bfc9f7e1.pf_meta +0 -0
  72. package/lib/learn-host/public/_pagefind/pagefind.en_76b8937bbc.pf_meta +0 -0
  73. package/lib/learn-host/public/_pagefind/pagefind.en_83cbfb0fd5.pf_meta +0 -0
  74. package/lib/learn-host/public/_pagefind/pagefind.en_b1d168d536.pf_meta +0 -0
  75. package/lib/learn-host/public/_pagefind/pagefind.js +6 -0
  76. package/lib/learn-host/public/_pagefind/wasm.en.pagefind +0 -0
  77. package/lib/learn-host/public/_pagefind/wasm.unknown.pagefind +0 -0
  78. package/lib/learn-host/public/logo.svg +1 -0
  79. package/lib/learn-host/src/app/[category]/[slug]/page.tsx +36 -32
  80. package/lib/learn-host/src/app/[category]/page.tsx +2 -3
  81. package/lib/learn-host/src/app/apple-icon.svg +1 -0
  82. package/lib/learn-host/src/app/globals.css +74 -14
  83. package/lib/learn-host/src/app/icon.svg +1 -0
  84. package/lib/learn-host/src/app/layout.tsx +29 -9
  85. package/lib/learn-host/src/app/page.tsx +9 -11
  86. package/lib/learn-host/src/components/Breadcrumbs.tsx +12 -4
  87. package/lib/learn-host/src/components/DocCard.tsx +28 -10
  88. package/lib/learn-host/src/components/MarkdownRenderer.tsx +6 -2
  89. package/lib/learn-host/src/components/MobileNav.tsx +43 -35
  90. package/lib/learn-host/src/components/PagefindSearch.tsx +177 -54
  91. package/lib/learn-host/src/components/Sidebar.tsx +27 -29
  92. package/lib/learn-host/src/components/TableOfContents.tsx +62 -0
  93. package/lib/learn-host/src/components/TagBadge.tsx +1 -1
  94. package/lib/learn-host/src/components/ThemeToggle.tsx +36 -9
  95. package/lib/learn-host/src/components/layout/Footer.tsx +41 -0
  96. package/lib/learn-host/src/components/layout/Header.tsx +117 -0
  97. package/lib/learn-host/src/lib/docs.ts +98 -8
  98. package/lib/learn-host/src/lib/types.ts +7 -1
  99. package/lib/learn-host/tsconfig.json +8 -2
  100. package/lib/learn-host/tsconfig.tsbuildinfo +1 -0
  101. package/lib/learn-mcp/CHANGELOG.md +7 -0
  102. package/lib/learn-mcp/package.json +1 -1
  103. package/package.json +13 -5
  104. package/dist/chunk-VHZQ6KEU.js +0 -73
  105. package/lib/learn-host/src/app/search/page.tsx +0 -19
  106. package/lib/learn-host/src/components/SearchBar.tsx +0 -36
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  ensureShellCompletion
3
- } from "./chunk-VHZQ6KEU.js";
3
+ } from "./chunk-R6ZYK4UX.js";
4
4
  import {
5
5
  commandExists,
6
6
  run,
@@ -10,7 +10,7 @@ import {
10
10
  claudeSettingsPath,
11
11
  installedPluginsPath,
12
12
  pluginCachePath
13
- } from "./chunk-AQXTNLQD.js";
13
+ } from "./chunk-6OI37OZX.js";
14
14
  import {
15
15
  log
16
16
  } from "./chunk-6DUFTBTO.js";
@@ -24,6 +24,15 @@ import { existsSync, readFileSync, readdirSync } from "fs";
24
24
  import { dirname, join } from "path";
25
25
  import { fileURLToPath } from "url";
26
26
  import chalk from "chalk";
27
+ function semverCompare(a, b) {
28
+ const pa = a.split(".").map(Number);
29
+ const pb = b.split(".").map(Number);
30
+ for (let i = 0; i < 3; i++) {
31
+ const diff = (pa[i] ?? 0) - (pb[i] ?? 0);
32
+ if (diff !== 0) return diff > 0 ? 1 : -1;
33
+ }
34
+ return 0;
35
+ }
27
36
  var __dirname = dirname(fileURLToPath(import.meta.url));
28
37
  function getCliVersion() {
29
38
  const pkg = JSON.parse(
@@ -130,37 +139,44 @@ async function updateCommand(opts) {
130
139
  log.warn(
131
140
  "Cannot check latest plugin version. Verify manually at https://github.com/dinhanhthi/coding-friend/releases"
132
141
  );
133
- } else if (currentVersion === latestVersion) {
134
- log.success(`Plugin already on the latest version (${chalk.green(`v${latestVersion}`)}).`);
142
+ } else if (!currentVersion) {
143
+ log.warn("Plugin not installed. Run: claude plugin install coding-friend@coding-friend-marketplace");
135
144
  } else {
136
- log.step(`Plugin update available: ${chalk.yellow(`v${currentVersion}`)} \u2192 ${chalk.green(`v${latestVersion}`)}`);
137
- if (!commandExists("claude")) {
138
- log.error(
139
- "Claude CLI not found. Install it first, or run: claude plugin update coding-friend@coding-friend-marketplace"
140
- );
145
+ const cmp = semverCompare(currentVersion, latestVersion);
146
+ if (cmp === 0) {
147
+ log.success(`Plugin already on the latest version (${chalk.green(`v${latestVersion}`)}).`);
148
+ } else if (cmp > 0) {
149
+ log.info(`Plugin is ahead of latest release (local: ${chalk.cyan(`v${currentVersion}`)}, latest: v${latestVersion}). Skipping.`);
141
150
  } else {
142
- log.step("Updating plugin...");
143
- const result = run("claude", [
144
- "plugin",
145
- "update",
146
- "coding-friend@coding-friend-marketplace"
147
- ]);
148
- if (result === null) {
149
- log.error("Plugin update failed. Try manually: claude plugin update coding-friend@coding-friend-marketplace");
151
+ log.step(`Plugin update available: ${chalk.yellow(`v${currentVersion}`)} \u2192 ${chalk.green(`v${latestVersion}`)}`);
152
+ if (!commandExists("claude")) {
153
+ log.error(
154
+ "Claude CLI not found. Install it first, or run: claude plugin update coding-friend@coding-friend-marketplace"
155
+ );
150
156
  } else {
151
- log.success("Plugin updated!");
152
- let newVersion = currentVersion;
153
- for (let i = 0; i < 5; i++) {
154
- newVersion = getInstalledVersion();
155
- if (newVersion !== currentVersion) break;
156
- if (i < 4) sleepSync(1e3);
157
- }
158
- if (newVersion !== currentVersion) {
159
- log.success(`Plugin updated to ${chalk.green(`v${newVersion}`)}`);
157
+ log.step("Updating plugin...");
158
+ const result = run("claude", [
159
+ "plugin",
160
+ "update",
161
+ "coding-friend@coding-friend-marketplace"
162
+ ]);
163
+ if (result === null) {
164
+ log.error("Plugin update failed. Try manually: claude plugin update coding-friend@coding-friend-marketplace");
160
165
  } else {
161
- log.warn(
162
- "Version in installed_plugins.json unchanged. Cache may still have been updated."
163
- );
166
+ log.success("Plugin updated!");
167
+ let newVersion = currentVersion;
168
+ for (let i = 0; i < 5; i++) {
169
+ newVersion = getInstalledVersion();
170
+ if (newVersion !== currentVersion) break;
171
+ if (i < 4) sleepSync(1e3);
172
+ }
173
+ if (newVersion !== currentVersion) {
174
+ log.success(`Plugin updated to ${chalk.green(`v${newVersion}`)}`);
175
+ } else {
176
+ log.warn(
177
+ "Version in installed_plugins.json unchanged. Cache may still have been updated."
178
+ );
179
+ }
164
180
  }
165
181
  }
166
182
  }
@@ -169,16 +185,21 @@ async function updateCommand(opts) {
169
185
  if (doCli) {
170
186
  if (!latestCliVersion) {
171
187
  log.warn("Cannot check latest CLI version from npm.");
172
- } else if (cliVersion === latestCliVersion) {
173
- log.success(`CLI already on the latest version (${chalk.green(`v${latestCliVersion}`)}).`);
174
188
  } else {
175
- log.step(`CLI update available: ${chalk.yellow(`v${cliVersion}`)} \u2192 ${chalk.green(`v${latestCliVersion}`)}`);
176
- log.step("Updating CLI...");
177
- const result = run("npm", ["install", "-g", "coding-friend-cli@latest"]);
178
- if (result === null) {
179
- log.error("CLI update failed. Try manually: npm install -g coding-friend-cli@latest");
189
+ const cmp = semverCompare(cliVersion, latestCliVersion);
190
+ if (cmp === 0) {
191
+ log.success(`CLI already on the latest version (${chalk.green(`v${latestCliVersion}`)}).`);
192
+ } else if (cmp > 0) {
193
+ log.info(`CLI is ahead of latest release (local: ${chalk.cyan(`v${cliVersion}`)}, latest: v${latestCliVersion}). Skipping.`);
180
194
  } else {
181
- log.success(`CLI updated to ${chalk.green(`v${latestCliVersion}`)}`);
195
+ log.step(`CLI update available: ${chalk.yellow(`v${cliVersion}`)} \u2192 ${chalk.green(`v${latestCliVersion}`)}`);
196
+ log.step("Updating CLI...");
197
+ const result = run("npm", ["install", "-g", "coding-friend-cli@latest"]);
198
+ if (result === null) {
199
+ log.error("CLI update failed. Try manually: npm install -g coding-friend-cli@latest");
200
+ } else {
201
+ log.success(`CLI updated to ${chalk.green(`v${latestCliVersion}`)}`);
202
+ }
182
203
  }
183
204
  }
184
205
  }
@@ -0,0 +1,3 @@
1
+ node_modules
2
+ .next
3
+ public/_pagefind
@@ -0,0 +1,8 @@
1
+ {
2
+ "semi": true,
3
+ "singleQuote": false,
4
+ "tabWidth": 2,
5
+ "trailingComma": "all",
6
+ "printWidth": 80,
7
+ "plugins": ["prettier-plugin-tailwindcss"]
8
+ }
@@ -0,0 +1,9 @@
1
+ # Changelog (Learn Host)
2
+
3
+ ## v0.0.1
4
+
5
+ - Next.js app for hosting learning docs at `localhost:3333`
6
+ - ISR (Incremental Static Regeneration) for auto-updating docs without rebuild
7
+ - Full-text search via Pagefind
8
+ - Modern UI with command palette, dark theme, and responsive layout
9
+ - Markdown rendering with syntax highlighting and GFM support
@@ -0,0 +1,6 @@
1
+ import nextConfig from "eslint-config-next";
2
+ import eslintConfigPrettier from "eslint-config-prettier";
3
+
4
+ const eslintConfig = [...nextConfig, eslintConfigPrettier];
5
+
6
+ export default eslintConfig;
@@ -1,6 +1,6 @@
1
1
  /// <reference types="next" />
2
2
  /// <reference types="next/image-types/global" />
3
- /// <reference path="./.next/types/routes.d.ts" />
3
+ import "./.next/types/routes.d.ts";
4
4
 
5
5
  // NOTE: This file should not be edited
6
6
  // see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
@@ -3,6 +3,7 @@ import type { NextConfig } from "next";
3
3
  const nextConfig: NextConfig = {
4
4
  trailingSlash: true,
5
5
  images: { unoptimized: true },
6
+ reactCompiler: true,
6
7
  };
7
8
 
8
9
  export default nextConfig;