Skip to content

Commit e79e275

Browse files
authored
feat: upgrade docs to VitePress 2.0.0-alpha.17 with agent skills and UX improvements (#363)
- Upgrade VitePress from 1.6.4 to 2.0.0-alpha.17 - Add vitepress-plugin-group-icons for package manager and IDE icons in code tabs - Add typedoc-plugin-frontmatter to suppress editLink/lastUpdated on generated API pages - Add editLink ("Suggest changes to this page"), lastUpdated timestamps, and enhanced local search config - Add "View as Markdown" / "Copy for LLM" buttons on all doc pages (aside on desktop, inline on mobile) - Custom HomeLayout with hero → install sections → features → packages ordering - New hero collage showing CLI, Agentforce Vibes, and Claude Code - Rewrite homepage hero text and features to align with Salesforce platform strategy - Rewrite agent-skills page: consolidated plugins table, Quick Start with marketplace install tabs for Agentforce Vibes, Claude Code, Copilot, Codex, and B2C CLI - Rewrite introduction page with CLI-first, skills-second messaging - Update SDK API docs: add operations/debug entry point, update package structure diagram, mark telemetry module as @internal - Copy source .md files to build output via buildEnd hook for raw markdown access
1 parent 3dedc05 commit e79e275

17 files changed

Lines changed: 1216 additions & 898 deletions

File tree

.changeset/vitepress-v2-upgrade.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
'@salesforce/b2c-dx-docs': patch
3+
---
4+
5+
Upgrade documentation site to VitePress 2.0.0-alpha. Adds package-manager
6+
icons in `::: code-group` tabs (npm, pnpm, yarn, Homebrew), "Edit this page
7+
on GitHub" links, git-based "Last updated" timestamps, and improved local
8+
search ranking. Generated SDK API pages under `/api/` have edit and
9+
last-updated UI suppressed since they are regenerated on every build.

docs/.vitepress/config.mts

Lines changed: 76 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,26 @@
1+
import fs from 'node:fs';
2+
import path from 'node:path';
13
import {defineConfig} from 'vitepress';
4+
import {groupIconMdPlugin, groupIconVitePlugin} from 'vitepress-plugin-group-icons';
25
import typedocSidebar from '../api/typedoc-sidebar.json';
36

7+
// Copy source .md files to the build output so pages can be fetched as raw
8+
// markdown (powers the "View as Markdown" / "Copy for LLM" buttons).
9+
function copyMarkdownSources(srcDir: string, outDir: string) {
10+
const entries = fs.readdirSync(srcDir, {withFileTypes: true});
11+
for (const entry of entries) {
12+
if (entry.name.startsWith('.') || entry.name === 'node_modules') continue;
13+
const src = path.join(srcDir, entry.name);
14+
const dest = path.join(outDir, entry.name);
15+
if (entry.isDirectory()) {
16+
fs.mkdirSync(dest, {recursive: true});
17+
copyMarkdownSources(src, dest);
18+
} else if (entry.isFile() && entry.name.endsWith('.md')) {
19+
fs.copyFileSync(src, dest);
20+
}
21+
}
22+
}
23+
424
// Build configuration from environment
525
const isDevBuild = process.env.IS_DEV_BUILD === 'true';
626

@@ -152,19 +172,64 @@ export default defineConfig({
152172

153173
head: [['script', {}, versionSwitchScript]],
154174

175+
// Git-based "Last updated" timestamps (overridable per-page via frontmatter)
176+
lastUpdated: true,
177+
155178
// Ignore dead links in api-readme.md (links are valid after TypeDoc generates the API docs)
156179
ignoreDeadLinks: [/^\.\/clients\//],
157180

158-
// Show deeper heading levels in the outline
181+
buildEnd(siteConfig) {
182+
copyMarkdownSources(siteConfig.srcDir, siteConfig.outDir);
183+
},
184+
185+
// Show deeper heading levels in the outline; register group-icons md plugin
159186
markdown: {
160187
toc: {level: [2, 3, 4]},
188+
config(md) {
189+
md.use(groupIconMdPlugin);
190+
},
191+
},
192+
193+
vite: {
194+
plugins: [
195+
groupIconVitePlugin({
196+
customIcon: {
197+
npx: 'vscode-icons:file-type-npm',
198+
homebrew: 'logos:homebrew',
199+
'agentforce vibes': {
200+
light:
201+
'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 36 56" fill="#333"><path d="M34 18h-7.9l6.8-15.2c0-.2.1-.5.1-.8 0-1.1-.9-2-2-2H9c-.9 0-1.7.6-1.9 1.5l-7 26c0 .2-.1.3-.1.5 0 1.1.9 2 2 2h7.5L4 53.5c0 .1-.1.3-.1.5 0 1.1.9 2 2 2 .6 0 1.2-.3 1.5-.7l28-34c.3-.4.5-.8.5-1.3.1-1.1-.8-2-1.9-2Z"/></svg>',
202+
dark: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 36 56" fill="#e8e8e8"><path d="M34 18h-7.9l6.8-15.2c0-.2.1-.5.1-.8 0-1.1-.9-2-2-2H9c-.9 0-1.7.6-1.9 1.5l-7 26c0 .2-.1.3-.1.5 0 1.1.9 2 2 2h7.5L4 53.5c0 .1-.1.3-.1.5 0 1.1.9 2 2 2 .6 0 1.2-.3 1.5-.7l28-34c.3-.4.5-.8.5-1.3.1-1.1-.8-2-1.9-2Z"/></svg>',
203+
},
204+
'claude code': 'logos:claude-icon',
205+
'copilot (vs code)': 'logos:visual-studio-code',
206+
'copilot cli': {
207+
light: 'logos:github-copilot',
208+
dark: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="#e8e8e8"><path d="M21.4 14.3A10 10 0 0 0 22 11C22 5.5 17.5 1 12 1S2 5.5 2 11c0 1.1.2 2.2.6 3.3A5 5 0 0 0 0 18.5C0 21 2 23 4.5 23H6a1 1 0 0 0 1-1v-4a1 1 0 0 0-1-1H5c-.3 0-.5-.2-.5-.5S4.7 16 5 16h1a3 3 0 0 1 3 3v3a1 1 0 0 0 1 1h4a1 1 0 0 0 1-1v-3a3 3 0 0 1 3-3h1c.3 0 .5.2.5.5s-.2.5-.5.5h-1a1 1 0 0 0-1 1v4a1 1 0 0 0 1 1h1.5c2.5 0 4.5-2 4.5-4.5a5 5 0 0 0-2.6-4.2zM8.5 12a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3zm7 0a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3z"/></svg>',
209+
},
210+
codex: {
211+
light: 'simple-icons:openai',
212+
dark: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="#e8e8e8"><path d="M22.3 8.6a5.8 5.8 0 0 0-.5-4.8 5.9 5.9 0 0 0-6.4-2.8A5.8 5.8 0 0 0 11 0a5.9 5.9 0 0 0-5.6 4A5.8 5.8 0 0 0 1.5 6.6a5.9 5.9 0 0 0 .7 6.8 5.8 5.8 0 0 0 .5 4.8 5.9 5.9 0 0 0 6.4 2.8A5.8 5.8 0 0 0 13 22a5.9 5.9 0 0 0 5.6-4 5.8 5.8 0 0 0 3.9-2.6 5.9 5.9 0 0 0-.7-6.8zM13 20.6a4.4 4.4 0 0 1-2.8-1l.2-.1 4.6-2.6a.7.7 0 0 0 .4-.7V10l2 1.1v5.7a4.4 4.4 0 0 1-4.4 3.8zm-9.4-3.5c-.6-1-.8-2.1-.5-3.2l.2.1 4.6 2.6a.7.7 0 0 0 .8 0l5.6-3.2v2.3l-4.7 2.7a4.4 4.4 0 0 1-6-1.3zM2.3 7.9A4.4 4.4 0 0 1 4.6 6v.2l.1 5.3a.7.7 0 0 0 .3.6l5.6 3.2-2 1.1L4 13.8A4.4 4.4 0 0 1 2.3 8zM18 10l-5.6-3.2 2-1.2 4.6 2.7a4.4 4.4 0 0 1-.7 7.9v-5.5a.7.7 0 0 0-.3-.6zm2-3.2-.2-.1-4.6-2.7a.7.7 0 0 0-.8 0L8.8 7.3V5l4.7-2.7a4.4 4.4 0 0 1 6.5 4.6zm-12 4L6 9.7V4a4.4 4.4 0 0 1 7.2-3.4l-.2.1L8.4 3.3a.7.7 0 0 0-.4.7zm1-2.2 2.5-1.4 2.5 1.4v2.9L9.5 13l-2.5-1.5z"/></svg>',
213+
},
214+
'b2c cli': 'logos:salesforce',
215+
},
216+
}),
217+
],
161218
},
162219

163220
themeConfig: {
164221
logo: '/logo.svg',
165222
outline: {
166223
level: [2, 3],
167224
},
225+
editLink: {
226+
pattern: 'https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/edit/main/docs/:path',
227+
text: 'Suggest changes to this page',
228+
},
229+
lastUpdated: {
230+
text: 'Last updated',
231+
formatOptions: {dateStyle: 'medium'},
232+
},
168233
nav: [
169234
{text: 'Guides', link: '/guide/'},
170235
{text: 'MCP', link: '/mcp/'},
@@ -199,6 +264,16 @@ export default defineConfig({
199264

200265
search: {
201266
provider: 'local',
267+
options: {
268+
detailedView: true,
269+
miniSearch: {
270+
searchOptions: {
271+
fuzzy: 0.2,
272+
prefix: true,
273+
boost: {title: 4, text: 2, titles: 1},
274+
},
275+
},
276+
},
202277
},
203278
},
204279
});
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
<script setup lang="ts">
2+
import VPHomeHero from 'vitepress/dist/client/theme-default/components/VPHomeHero.vue';
3+
import VPHomeFeatures from 'vitepress/dist/client/theme-default/components/VPHomeFeatures.vue';
4+
import VPHomeContent from 'vitepress/dist/client/theme-default/components/VPHomeContent.vue';
5+
import {useData} from 'vitepress';
6+
import HomePackages from './HomePackages.vue';
7+
8+
const {frontmatter, theme} = useData();
9+
</script>
10+
11+
<template>
12+
<div
13+
class="VPHome"
14+
:class="{'external-link-icon-enabled': theme.externalLinkIcon}"
15+
>
16+
<VPHomeHero />
17+
18+
<VPHomeContent v-if="frontmatter.markdownStyles !== false" class="home-install-section">
19+
<Content />
20+
</VPHomeContent>
21+
<Content v-else />
22+
23+
<VPHomeFeatures />
24+
25+
<HomePackages />
26+
</div>
27+
</template>
28+
29+
<style scoped>
30+
.VPHome {
31+
margin-bottom: 96px;
32+
}
33+
34+
@media (min-width: 768px) {
35+
.VPHome {
36+
margin-bottom: 128px;
37+
}
38+
}
39+
40+
.home-install-section {
41+
margin-top: 24px;
42+
margin-bottom: 48px;
43+
}
44+
45+
@media (min-width: 768px) {
46+
.home-install-section {
47+
margin-top: 32px;
48+
margin-bottom: 64px;
49+
}
50+
}
51+
52+
.home-install-section :deep(h2) {
53+
border-top: none;
54+
padding-top: 0;
55+
margin-top: 0;
56+
}
57+
58+
</style>
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
<template>
2+
<section class="home-packages">
3+
<div class="container vp-doc">
4+
<h2 id="packages">Packages</h2>
5+
<table>
6+
<thead>
7+
<tr><th>Package</th><th>Description</th></tr>
8+
</thead>
9+
<tbody>
10+
<tr>
11+
<td><a href="https://www.npmjs.com/package/@salesforce/b2c-cli"><code>@salesforce/b2c-cli</code></a></td>
12+
<td>Command-line tools for Salesforce B2C Commerce</td>
13+
</tr>
14+
<tr>
15+
<td><a href="https://www.npmjs.com/package/@salesforce/b2c-dx-mcp"><code>@salesforce/b2c-dx-mcp</code></a></td>
16+
<td>MCP Server for AI-assisted development</td>
17+
</tr>
18+
<tr>
19+
<td><a href="https://www.npmjs.com/package/@salesforce/b2c-tooling-sdk"><code>@salesforce/b2c-tooling-sdk</code></a></td>
20+
<td>SDK library for custom integrations</td>
21+
</tr>
22+
</tbody>
23+
</table>
24+
</div>
25+
</section>
26+
</template>
27+
28+
<style scoped>
29+
.home-packages {
30+
padding: 0 24px;
31+
margin-top: 64px;
32+
}
33+
34+
@media (min-width: 640px) {
35+
.home-packages {
36+
padding: 0 48px;
37+
}
38+
}
39+
40+
@media (min-width: 960px) {
41+
.home-packages {
42+
padding: 0 64px;
43+
}
44+
}
45+
46+
.container {
47+
margin: 0 auto;
48+
max-width: 1152px;
49+
}
50+
</style>

docs/.vitepress/theme/HomeQuickInstall.vue

Lines changed: 0 additions & 96 deletions
This file was deleted.

0 commit comments

Comments
 (0)