coding-friend-cli 1.3.0 → 1.5.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 +4 -0
- package/dist/chunk-5OALHHKR.js +77 -0
- package/dist/{chunk-CSF4FAHL.js → chunk-DDISNOEK.js} +15 -1
- package/dist/{update-GGCBM7U4.js → chunk-GTTSBOHM.js} +6 -2
- package/dist/{chunk-HRVSKMNA.js → chunk-JWAJ4XPK.js} +11 -0
- package/dist/chunk-MRTR7TJ4.js +27 -0
- package/dist/{chunk-6OI37OZX.js → chunk-WHCJT7E2.js} +25 -1
- package/dist/{chunk-Q4DKU5IG.js → chunk-X645ACZJ.js} +1 -1
- package/dist/{dev-VMN2JHA6.js → dev-WINMWRZK.js} +5 -13
- package/dist/{host-2WINWEW7.js → host-VR5POAVU.js} +3 -3
- package/dist/index.js +18 -10
- package/dist/{init-CTCDQKIQ.js → init-K4EVPAHK.js} +30 -4
- package/dist/install-BEFMUMKE.js +93 -0
- package/dist/{mcp-43HCE2KD.js → mcp-JCQUGUPJ.js} +3 -3
- package/dist/postinstall.js +1 -1
- package/dist/statusline-3MQQDRCI.js +55 -0
- package/dist/uninstall-BHYS52L3.js +202 -0
- package/dist/update-TALQ7TAO.js +17 -0
- package/lib/learn-host/CHANGELOG.md +6 -0
- package/lib/learn-host/package.json +1 -1
- package/lib/learn-host/src/app/globals.css +34 -4
- package/lib/learn-host/src/app/layout.tsx +2 -13
- package/lib/learn-host/src/app/page.tsx +45 -15
- package/lib/learn-host/src/components/Breadcrumbs.tsx +2 -5
- package/lib/learn-host/src/components/CodeBlock.tsx +56 -0
- package/lib/learn-host/src/components/DocCard.tsx +4 -6
- package/lib/learn-host/src/components/LayoutShell.tsx +39 -0
- package/lib/learn-host/src/components/MarkdownRenderer.tsx +2 -0
- package/lib/learn-host/src/components/MobileNav.tsx +1 -1
- package/lib/learn-host/src/components/Sidebar.tsx +1 -1
- package/lib/learn-host/src/components/TableOfContents.tsx +2 -2
- package/lib/learn-host/src/components/TagBadge.tsx +1 -1
- package/lib/learn-host/src/components/layout/Footer.tsx +8 -4
- package/lib/learn-host/src/components/layout/Header.tsx +2 -2
- package/lib/learn-host/src/lib/docs.ts +11 -2
- package/lib/learn-mcp/CHANGELOG.md +4 -0
- package/lib/learn-mcp/README.md +18 -0
- package/lib/learn-mcp/package.json +1 -1
- package/lib/learn-mcp/src/index.ts +1 -1
- package/package.json +1 -1
- package/dist/statusline-ARI7I5YM.js +0 -64
- package/lib/learn-host/next-env.d.ts +0 -6
|
@@ -89,7 +89,7 @@ export default function Header({ categories }: { categories: CategoryInfo[] }) {
|
|
|
89
89
|
key={cat.name}
|
|
90
90
|
href={`/${cat.name}/`}
|
|
91
91
|
onClick={() => setMobileOpen(false)}
|
|
92
|
-
className="flex items-center justify-between px-3 py-2 text-sm font-medium text-slate-600 capitalize hover:text-
|
|
92
|
+
className="flex items-center justify-between px-3 py-2 text-sm font-medium text-slate-600 capitalize hover:text-amber-600 dark:text-slate-400 dark:hover:text-amber-400"
|
|
93
93
|
>
|
|
94
94
|
<span>{cat.name.replace(/[_-]/g, " ")}</span>
|
|
95
95
|
<span className="text-xs text-slate-400 dark:text-slate-500">
|
|
@@ -102,7 +102,7 @@ export default function Header({ categories }: { categories: CategoryInfo[] }) {
|
|
|
102
102
|
href="https://github.com/dinhanhthi/coding-friend"
|
|
103
103
|
target="_blank"
|
|
104
104
|
rel="noopener noreferrer"
|
|
105
|
-
className="flex cursor-pointer items-center gap-2 text-sm font-medium text-slate-500 hover:text-
|
|
105
|
+
className="flex cursor-pointer items-center gap-2 text-sm font-medium text-slate-500 hover:text-amber-600 dark:text-slate-400 dark:hover:text-amber-400"
|
|
106
106
|
>
|
|
107
107
|
<svg className="h-4 w-4" viewBox="0 0 24 24" fill="currentColor">
|
|
108
108
|
<path d="M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z" />
|
|
@@ -102,8 +102,17 @@ function parseFrontmatter(raw: matter.GrayMatterFile<string>): DocFrontmatter {
|
|
|
102
102
|
|
|
103
103
|
function makeExcerpt(content: string, maxLen = 160): string {
|
|
104
104
|
const text = content
|
|
105
|
-
.replace(/^#+\s.*/gm, "")
|
|
106
|
-
.replace(/```[\s\S]*?```/g, "")
|
|
105
|
+
.replace(/^#+\s.*/gm, "") // headings
|
|
106
|
+
.replace(/```[\s\S]*?```/g, "") // fenced code blocks
|
|
107
|
+
.replace(/\[([^\]]*)\]\([^)]*\)/g, "$1") // [text](url) → text
|
|
108
|
+
.replace(/!\[([^\]]*)\]\([^)]*\)/g, "") // images
|
|
109
|
+
.replace(/(\*\*|__)(.*?)\1/g, "$2") // bold
|
|
110
|
+
.replace(/(\*|_)(.*?)\1/g, "$2") // italic
|
|
111
|
+
.replace(/~~(.*?)~~/g, "$1") // strikethrough
|
|
112
|
+
.replace(/`([^`]+)`/g, "$1") // inline code
|
|
113
|
+
.replace(/^>\s?/gm, "") // blockquotes
|
|
114
|
+
.replace(/^[-*+]\s/gm, "") // unordered list markers
|
|
115
|
+
.replace(/^\d+\.\s/gm, "") // ordered list markers
|
|
107
116
|
.replace(/\n{2,}/g, " ")
|
|
108
117
|
.replace(/\n/g, " ")
|
|
109
118
|
.trim();
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# Changelog (Learn MCP)
|
|
2
2
|
|
|
3
|
+
## v0.0.3 (2026-03-03)
|
|
4
|
+
|
|
5
|
+
- Add Claude Desktop config documentation for compiled output ([#d37a6b9](https://github.com/dinhanhthi/coding-friend/commit/d37a6b9))
|
|
6
|
+
|
|
3
7
|
## v0.0.2 (2026-03-01)
|
|
4
8
|
|
|
5
9
|
- Add support for coding-friend-cli integration
|
package/lib/learn-mcp/README.md
CHANGED
|
@@ -93,6 +93,24 @@ npm run build
|
|
|
93
93
|
node dist/index.js /path/to/docs/learn
|
|
94
94
|
```
|
|
95
95
|
|
|
96
|
+
For Claude Desktop with the compiled version:
|
|
97
|
+
|
|
98
|
+
```json
|
|
99
|
+
{
|
|
100
|
+
"mcpServers": {
|
|
101
|
+
"coding-friend-learn": {
|
|
102
|
+
"command": "node",
|
|
103
|
+
"args": [
|
|
104
|
+
"/path/to/coding-friend/cli/lib/learn-mcp/dist/index.js",
|
|
105
|
+
"/path/to/your/docs/learn"
|
|
106
|
+
]
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
> **Note:** The path must include `/cli/lib/learn-mcp/`, not `/lib/learn-mcp/`. Run `npm run build` first to generate `dist/`.
|
|
113
|
+
|
|
96
114
|
## Docs Directory Structure
|
|
97
115
|
|
|
98
116
|
```
|
package/package.json
CHANGED
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
claudeSettingsPath,
|
|
3
|
-
pluginCachePath
|
|
4
|
-
} from "./chunk-6OI37OZX.js";
|
|
5
|
-
import {
|
|
6
|
-
log
|
|
7
|
-
} from "./chunk-6DUFTBTO.js";
|
|
8
|
-
import {
|
|
9
|
-
readJson,
|
|
10
|
-
writeJson
|
|
11
|
-
} from "./chunk-IUTXHCP7.js";
|
|
12
|
-
|
|
13
|
-
// src/commands/statusline.ts
|
|
14
|
-
import { existsSync, readdirSync } from "fs";
|
|
15
|
-
import { confirm } from "@inquirer/prompts";
|
|
16
|
-
import chalk from "chalk";
|
|
17
|
-
function findLatestVersion(cachePath) {
|
|
18
|
-
if (!existsSync(cachePath)) return null;
|
|
19
|
-
const versions = readdirSync(cachePath, { withFileTypes: true }).filter((e) => e.isDirectory()).map((e) => e.name).sort().reverse();
|
|
20
|
-
return versions[0] ?? null;
|
|
21
|
-
}
|
|
22
|
-
async function statuslineCommand() {
|
|
23
|
-
console.log("=== \u{1F33F} Coding Friend Statusline \u{1F33F} ===");
|
|
24
|
-
console.log();
|
|
25
|
-
const cachePath = pluginCachePath();
|
|
26
|
-
const version = findLatestVersion(cachePath);
|
|
27
|
-
if (!version) {
|
|
28
|
-
log.error(
|
|
29
|
-
"coding-friend plugin not found in cache. Install it first via Claude Code."
|
|
30
|
-
);
|
|
31
|
-
return;
|
|
32
|
-
}
|
|
33
|
-
const hookPath = `${cachePath}/${version}/hooks/statusline.sh`;
|
|
34
|
-
if (!existsSync(hookPath)) {
|
|
35
|
-
log.error(`Statusline hook not found: ${hookPath}`);
|
|
36
|
-
return;
|
|
37
|
-
}
|
|
38
|
-
log.info(`Found plugin ${chalk.green(`v${version}`)}`);
|
|
39
|
-
const settingsPath = claudeSettingsPath();
|
|
40
|
-
const settings = readJson(settingsPath) ?? {};
|
|
41
|
-
const existing = settings.statusLine;
|
|
42
|
-
if (existing?.command) {
|
|
43
|
-
log.warn(`Statusline already configured: ${existing.command}`);
|
|
44
|
-
const overwrite = await confirm({
|
|
45
|
-
message: "Overwrite existing statusline config?",
|
|
46
|
-
default: true
|
|
47
|
-
});
|
|
48
|
-
if (!overwrite) {
|
|
49
|
-
log.dim("Skipped.");
|
|
50
|
-
return;
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
settings.statusLine = {
|
|
54
|
-
type: "command",
|
|
55
|
-
command: `bash ${hookPath}`
|
|
56
|
-
};
|
|
57
|
-
writeJson(settingsPath, settings);
|
|
58
|
-
log.success("Statusline configured!");
|
|
59
|
-
log.dim("Restart Claude Code (or start a new session) to see it.");
|
|
60
|
-
log.dim("Shows: plugin name, active model, and git branch.");
|
|
61
|
-
}
|
|
62
|
-
export {
|
|
63
|
-
statuslineCommand
|
|
64
|
-
};
|