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.
- package/README.md +15 -0
- package/dist/{chunk-KZT4AFDW.js → chunk-5HZJX47M.js} +1 -1
- package/dist/{chunk-AQXTNLQD.js → chunk-6OI37OZX.js} +9 -1
- package/dist/chunk-R6ZYK4UX.js +128 -0
- package/dist/dev-LZASFXZZ.js +243 -0
- package/dist/{host-JBTJCWM2.js → host-BK6DYFWF.js} +2 -2
- package/dist/index.js +26 -5
- package/dist/{init-E6CL3UZQ.js → init-2UKYE2KV.js} +2 -2
- package/dist/{mcp-MWESK6UX.js → mcp-CH4SKZSX.js} +2 -2
- package/dist/postinstall.js +1 -1
- package/dist/{statusline-7D6YU5YM.js → statusline-ARI7I5YM.js} +1 -1
- package/dist/{update-IH3G4SN5.js → update-5A2OP6EY.js} +58 -37
- package/lib/learn-host/.prettierignore +3 -0
- package/lib/learn-host/.prettierrc +8 -0
- package/lib/learn-host/CHANGELOG.md +9 -0
- package/lib/learn-host/eslint.config.mjs +6 -0
- package/lib/learn-host/next-env.d.ts +1 -1
- package/lib/learn-host/next.config.ts +1 -0
- package/lib/learn-host/package-lock.json +6039 -391
- package/lib/learn-host/package.json +30 -15
- package/lib/learn-host/public/_pagefind/fragment/en_1172b3c.pf_fragment +0 -0
- package/lib/learn-host/public/_pagefind/fragment/en_118ad1c.pf_fragment +0 -0
- package/lib/learn-host/public/_pagefind/fragment/en_32ab3d8.pf_fragment +0 -0
- package/lib/learn-host/public/_pagefind/fragment/en_441f1e1.pf_fragment +0 -0
- package/lib/learn-host/public/_pagefind/fragment/en_4452de4.pf_fragment +0 -0
- package/lib/learn-host/public/_pagefind/fragment/en_4ae396d.pf_fragment +0 -0
- package/lib/learn-host/public/_pagefind/fragment/en_58ee89d.pf_fragment +0 -0
- package/lib/learn-host/public/_pagefind/fragment/en_6dd2225.pf_fragment +0 -0
- package/lib/learn-host/public/_pagefind/fragment/en_765a297.pf_fragment +0 -0
- package/lib/learn-host/public/_pagefind/fragment/en_7a4cc4a.pf_fragment +0 -0
- package/lib/learn-host/public/_pagefind/fragment/en_8050261.pf_fragment +0 -0
- package/lib/learn-host/public/_pagefind/fragment/en_83eaedf.pf_fragment +0 -0
- package/lib/learn-host/public/_pagefind/fragment/en_925bc5f.pf_fragment +0 -0
- package/lib/learn-host/public/_pagefind/fragment/en_95f3dd5.pf_fragment +0 -0
- package/lib/learn-host/public/_pagefind/fragment/en_96d7a02.pf_fragment +0 -0
- package/lib/learn-host/public/_pagefind/fragment/en_971f951.pf_fragment +0 -0
- package/lib/learn-host/public/_pagefind/fragment/en_a446c32.pf_fragment +0 -0
- package/lib/learn-host/public/_pagefind/fragment/en_a5ee367.pf_fragment +0 -0
- package/lib/learn-host/public/_pagefind/fragment/en_b11c248.pf_fragment +0 -0
- package/lib/learn-host/public/_pagefind/fragment/en_b13c52e.pf_fragment +0 -0
- package/lib/learn-host/public/_pagefind/fragment/en_b5bd69b.pf_fragment +0 -0
- package/lib/learn-host/public/_pagefind/fragment/en_b625d7d.pf_fragment +0 -0
- package/lib/learn-host/public/_pagefind/fragment/en_bf63915.pf_fragment +0 -0
- package/lib/learn-host/public/_pagefind/fragment/en_c52b25b.pf_fragment +0 -0
- package/lib/learn-host/public/_pagefind/fragment/en_c9db556.pf_fragment +0 -0
- package/lib/learn-host/public/_pagefind/fragment/en_d1537ee.pf_fragment +0 -0
- package/lib/learn-host/public/_pagefind/fragment/en_d2e6412.pf_fragment +0 -0
- package/lib/learn-host/public/_pagefind/fragment/en_d2f47a4.pf_fragment +0 -0
- package/lib/learn-host/public/_pagefind/fragment/en_d361292.pf_fragment +0 -0
- package/lib/learn-host/public/_pagefind/fragment/en_d727ec8.pf_fragment +0 -0
- package/lib/learn-host/public/_pagefind/fragment/en_e11cd8f.pf_fragment +0 -0
- package/lib/learn-host/public/_pagefind/fragment/en_e481f19.pf_fragment +0 -0
- package/lib/learn-host/public/_pagefind/fragment/en_eee2805.pf_fragment +0 -0
- package/lib/learn-host/public/_pagefind/fragment/en_f4de6c4.pf_fragment +0 -0
- package/lib/learn-host/public/_pagefind/index/en_1ecb9d5.pf_index +0 -0
- package/lib/learn-host/public/_pagefind/index/en_37e362b.pf_index +0 -0
- package/lib/learn-host/public/_pagefind/index/en_538eee7.pf_index +0 -0
- package/lib/learn-host/public/_pagefind/index/en_5751dc8.pf_index +0 -0
- package/lib/learn-host/public/_pagefind/index/en_67f794d.pf_index +0 -0
- package/lib/learn-host/public/_pagefind/index/en_7458f81.pf_index +0 -0
- package/lib/learn-host/public/_pagefind/index/en_e21f7e1.pf_index +0 -0
- package/lib/learn-host/public/_pagefind/pagefind-entry.json +1 -0
- package/lib/learn-host/public/_pagefind/pagefind-highlight.js +1064 -0
- package/lib/learn-host/public/_pagefind/pagefind-modular-ui.css +214 -0
- package/lib/learn-host/public/_pagefind/pagefind-modular-ui.js +8 -0
- package/lib/learn-host/public/_pagefind/pagefind-ui.css +1 -0
- package/lib/learn-host/public/_pagefind/pagefind-ui.js +2 -0
- package/lib/learn-host/public/_pagefind/pagefind.en_104569cceb.pf_meta +0 -0
- package/lib/learn-host/public/_pagefind/pagefind.en_1075df6f16.pf_meta +0 -0
- package/lib/learn-host/public/_pagefind/pagefind.en_139f35f6e5.pf_meta +0 -0
- package/lib/learn-host/public/_pagefind/pagefind.en_46bfc9f7e1.pf_meta +0 -0
- package/lib/learn-host/public/_pagefind/pagefind.en_76b8937bbc.pf_meta +0 -0
- package/lib/learn-host/public/_pagefind/pagefind.en_83cbfb0fd5.pf_meta +0 -0
- package/lib/learn-host/public/_pagefind/pagefind.en_b1d168d536.pf_meta +0 -0
- package/lib/learn-host/public/_pagefind/pagefind.js +6 -0
- package/lib/learn-host/public/_pagefind/wasm.en.pagefind +0 -0
- package/lib/learn-host/public/_pagefind/wasm.unknown.pagefind +0 -0
- package/lib/learn-host/public/logo.svg +1 -0
- package/lib/learn-host/src/app/[category]/[slug]/page.tsx +36 -32
- package/lib/learn-host/src/app/[category]/page.tsx +2 -3
- package/lib/learn-host/src/app/apple-icon.svg +1 -0
- package/lib/learn-host/src/app/globals.css +74 -14
- package/lib/learn-host/src/app/icon.svg +1 -0
- package/lib/learn-host/src/app/layout.tsx +29 -9
- package/lib/learn-host/src/app/page.tsx +9 -11
- package/lib/learn-host/src/components/Breadcrumbs.tsx +12 -4
- package/lib/learn-host/src/components/DocCard.tsx +28 -10
- package/lib/learn-host/src/components/MarkdownRenderer.tsx +6 -2
- package/lib/learn-host/src/components/MobileNav.tsx +43 -35
- package/lib/learn-host/src/components/PagefindSearch.tsx +177 -54
- package/lib/learn-host/src/components/Sidebar.tsx +27 -29
- package/lib/learn-host/src/components/TableOfContents.tsx +62 -0
- package/lib/learn-host/src/components/TagBadge.tsx +1 -1
- package/lib/learn-host/src/components/ThemeToggle.tsx +36 -9
- package/lib/learn-host/src/components/layout/Footer.tsx +41 -0
- package/lib/learn-host/src/components/layout/Header.tsx +117 -0
- package/lib/learn-host/src/lib/docs.ts +98 -8
- package/lib/learn-host/src/lib/types.ts +7 -1
- package/lib/learn-host/tsconfig.json +8 -2
- package/lib/learn-host/tsconfig.tsbuildinfo +1 -0
- package/lib/learn-mcp/CHANGELOG.md +7 -0
- package/lib/learn-mcp/package.json +1 -1
- package/package.json +13 -5
- package/dist/chunk-VHZQ6KEU.js +0 -73
- package/lib/learn-host/src/app/search/page.tsx +0 -19
- package/lib/learn-host/src/components/SearchBar.tsx +0 -36
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ensureShellCompletion
|
|
3
|
-
} from "./chunk-
|
|
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-
|
|
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
|
|
134
|
-
log.
|
|
142
|
+
} else if (!currentVersion) {
|
|
143
|
+
log.warn("Plugin not installed. Run: claude plugin install coding-friend@coding-friend-marketplace");
|
|
135
144
|
} else {
|
|
136
|
-
|
|
137
|
-
if (
|
|
138
|
-
log.
|
|
139
|
-
|
|
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(
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
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.
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
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.
|
|
162
|
-
|
|
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
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
if (
|
|
179
|
-
log.
|
|
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.
|
|
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,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
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="next" />
|
|
2
2
|
/// <reference types="next/image-types/global" />
|
|
3
|
-
|
|
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.
|