Skip to content

Commit e1365ef

Browse files
authored
Merge pull request #7 from EricLLLLLL/test
docs: improve website (i18n/seo) + install demo video
2 parents f5b5378 + 356d27c commit e1365ef

25 files changed

Lines changed: 3985 additions & 45 deletions

README.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
<p align="center">
1111
<a href="https://bvm-core.pages.dev"><strong>Official Website & Documentation »</strong></a>
1212
<br />
13+
<a href="https://bvm-core.pages.dev/zh/"><strong>中文网站 »</strong></a>
14+
<br />
1315
<br />
1416
<a href="./README.zh-CN.md">🇨🇳 中文文档</a>
1517
·
@@ -49,7 +51,7 @@ irm https://bvm-core.pages.dev/install | iex
4951

5052
### Method 3: NPM (Optional)
5153
```bash
52-
npm install -g bvm-core@latest
54+
npm install -g bvm-core@latest --foreground-scripts
5355
```
5456

5557
---
@@ -102,6 +104,13 @@ echo "1.1.0" > .bvmrc
102104

103105
---
104106

107+
## Troubleshooting
108+
109+
- **Global tools are not isolated after switching versions**: run `bvm setup`, restart your terminal, and make sure `which bun` points to `~/.bvm/shims/bun` (macOS/Linux). On Windows, use `where.exe bun` and ensure `...\\.bvm\\shims\\bun.cmd` is first.
110+
- **A global tool is missing after switching versions**: this is expected (per-version isolation). Reinstall it under the active Bun version.
111+
112+
---
113+
105114
## Design Philosophy
106115

107116
### ArchSense (Self-Bootstrapping)
@@ -114,4 +123,4 @@ Unlike managers that only switch the `PATH`, BVM performs **Filesystem-level Loc
114123

115124
## License
116125

117-
MIT © [EricLLLLLL](https://github.com/EricLLLLLL)
126+
MIT © [EricLLLLLL](https://github.com/EricLLLLLL)

README.zh-CN.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
<p align="center">
1111
<a href="https://bvm-core.pages.dev"><strong>官方网站与文档 »</strong></a>
1212
<br />
13+
<a href="https://bvm-core.pages.dev/"><strong>English Site »</strong></a>
14+
<br />
1315
<br />
1416
<a href="./README.md">🇺🇸 English Docs</a>
1517
·
@@ -49,7 +51,7 @@ irm https://bvm-core.pages.dev/install | iex
4951

5052
### 方式 3: NPM (可选)
5153
```bash
52-
npm install -g bvm-core@latest
54+
npm install -g bvm-core@latest --foreground-scripts
5355
```
5456

5557
---
@@ -112,6 +114,13 @@ BVM 不分发沉重的预编译二进制文件。相反,它利用 **Bun 管理
112114

113115
---
114116

117+
## 排障
118+
119+
- **切换版本后还存在 pm2/cowsay 等全局命令**:先执行 `bvm setup`,重启终端,再检查 `which bun`(macOS/Linux)是否指向 `~/.bvm/shims/bun`;Windows 用 `where.exe bun` 并确保 `...\\.bvm\\shims\\bun.cmd` 排第一。
120+
- **切换版本后找不到某个全局命令**:这是预期行为(按版本隔离),请在当前版本下重新 `bun install -g <pkg>`
121+
122+
---
123+
115124
## 开源协议
116125

117-
MIT © [EricLLLLLL](https://github.com/EricLLLLLL)
126+
MIT © [EricLLLLLL](https://github.com/EricLLLLLL)

website/docs/.vitepress/config.ts

Lines changed: 76 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,81 @@
1-
import { defineConfig } from 'vitepress'
1+
import { defineConfig } from 'vitepress';
2+
3+
const SITE_URL = 'https://bvm-core.pages.dev';
24

35
export default defineConfig({
4-
title: "BVM",
5-
description: "Bun Version Manager",
66
head: [
7-
['link', { rel: 'icon', type: 'image/svg+xml', href: '/logo.svg' }]
7+
['meta', { name: 'viewport', content: 'width=device-width,initial-scale=1' }],
8+
['link', { rel: 'icon', type: 'image/svg+xml', href: '/logo.svg' }],
9+
['meta', { property: 'og:site_name', content: 'BVM' }],
10+
['meta', { property: 'og:type', content: 'website' }],
11+
['meta', { property: 'og:image', content: `${SITE_URL}/logo.svg` }],
12+
['meta', { name: 'twitter:card', content: 'summary' }],
13+
['meta', { name: 'twitter:image', content: `${SITE_URL}/logo.svg` }],
814
],
9-
themeConfig: {
10-
logo: '/logo.svg',
11-
nav: [
12-
{ text: 'Guide', link: '/guide/getting-started' },
13-
{ text: 'Architecture', link: '/guide/architecture' },
14-
{
15-
text: 'Author',
16-
items: [
17-
{ text: '掘金 (Juejin)', link: 'https://juejin.cn/user/4072246800548999/posts' },
18-
{ text: '公众号 (WeChat)', link: 'https://mp.weixin.qq.com/s/CbO2wybwglEg6D5dh-tSCg' }
19-
]
15+
cleanUrls: true,
16+
lastUpdated: true,
17+
locales: {
18+
root: {
19+
label: 'English',
20+
lang: 'en-US',
21+
title: 'BVM',
22+
description: 'Bun Version Manager',
23+
themeConfig: {
24+
logo: '/logo.svg',
25+
nav: [
26+
{ text: 'Guide', link: '/guide/getting-started' },
27+
{ text: 'Troubleshooting', link: '/guide/troubleshooting' },
28+
{ text: 'Architecture (CN)', link: '/guide/architecture' },
29+
{ text: '中文', link: '/zh/' },
30+
{ text: 'GitHub', link: 'https://github.com/EricLLLLLL/bvm' },
31+
],
32+
sidebar: [
33+
{
34+
text: 'Guide',
35+
items: [
36+
{ text: 'Getting Started', link: '/guide/getting-started' },
37+
{ text: 'Troubleshooting', link: '/guide/troubleshooting' },
38+
{ text: 'Architecture (CN)', link: '/guide/architecture' },
39+
],
40+
},
41+
],
42+
socialLinks: [{ icon: 'github', link: 'https://github.com/EricLLLLLL/bvm' }],
43+
footer: {
44+
message: 'Released under the MIT License.',
45+
copyright: 'Copyright © 2024-present EricLLLLLL',
46+
},
47+
},
48+
},
49+
zh: {
50+
label: '简体中文',
51+
lang: 'zh-CN',
52+
title: 'BVM',
53+
description: 'Bun 版本管理器',
54+
themeConfig: {
55+
logo: '/logo.svg',
56+
nav: [
57+
{ text: '指南', link: '/zh/guide/getting-started' },
58+
{ text: '排障', link: '/zh/guide/troubleshooting' },
59+
{ text: '架构', link: '/zh/guide/architecture' },
60+
{ text: 'English', link: '/' },
61+
{ text: 'GitHub', link: 'https://github.com/EricLLLLLL/bvm' },
62+
],
63+
sidebar: [
64+
{
65+
text: '指南',
66+
items: [
67+
{ text: '快速开始', link: '/zh/guide/getting-started' },
68+
{ text: '排障', link: '/zh/guide/troubleshooting' },
69+
{ text: '架构', link: '/zh/guide/architecture' },
70+
],
71+
},
72+
],
73+
socialLinks: [{ icon: 'github', link: 'https://github.com/EricLLLLLL/bvm' }],
74+
footer: {
75+
message: '基于 MIT License 发布。',
76+
copyright: 'Copyright © 2024-present EricLLLLLL',
77+
},
2078
},
21-
{ text: 'GitHub', link: 'https://github.com/EricLLLLLL/bvm' }
22-
],
23-
sidebar: [
24-
{
25-
text: 'Introduction',
26-
items: [
27-
{ text: 'Getting Started', link: '/guide/getting-started' },
28-
{ text: '快速开始 (CN)', link: '/guide/getting-started-zh' },
29-
{ text: 'Architecture', link: '/guide/architecture' }
30-
]
31-
}
32-
],
33-
socialLinks: [
34-
{ icon: 'github', link: 'https://github.com/EricLLLLLL/bvm' }
35-
],
36-
footer: {
37-
message: 'Released under the MIT License.',
38-
copyright: 'Copyright © 2024-present EricLLLLLL'
39-
}
40-
}
41-
})
79+
},
80+
},
81+
});

website/docs/guide/getting-started-zh.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
<p align="center">
1111
<a href="https://bvm-core.pages.dev"><strong>官方网站与文档 »</strong></a>
1212
<br />
13+
<a href="https://bvm-core.pages.dev/"><strong>English Site »</strong></a>
14+
<br />
1315
<br />
1416
<a href="./README.md">🇺🇸 English Docs</a>
1517
·
@@ -49,7 +51,7 @@ irm https://bvm-core.pages.dev/install | iex
4951

5052
### 方式 3: NPM (可选)
5153
```bash
52-
npm install -g bvm-core@latest
54+
npm install -g bvm-core@latest --foreground-scripts
5355
```
5456

5557
---
@@ -112,6 +114,13 @@ BVM 不分发沉重的预编译二进制文件。相反,它利用 **Bun 管理
112114

113115
---
114116

117+
## 排障
118+
119+
- **切换版本后还存在 pm2/cowsay 等全局命令**:先执行 `bvm setup`,重启终端,再检查 `which bun`(macOS/Linux)是否指向 `~/.bvm/shims/bun`;Windows 用 `where.exe bun` 并确保 `...\\.bvm\\shims\\bun.cmd` 排第一。
120+
- **切换版本后找不到某个全局命令**:这是预期行为(按版本隔离),请在当前版本下重新 `bun install -g <pkg>`
121+
122+
---
123+
115124
## 开源协议
116125

117-
MIT © [EricLLLLLL](https://github.com/EricLLLLLL)
126+
MIT © [EricLLLLLL](https://github.com/EricLLLLLL)

website/docs/guide/getting-started.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
<p align="center">
1111
<a href="https://bvm-core.pages.dev"><strong>Official Website & Documentation »</strong></a>
1212
<br />
13+
<a href="https://bvm-core.pages.dev/zh/"><strong>中文网站 »</strong></a>
14+
<br />
1315
<br />
1416
<a href="./README.zh-CN.md">🇨🇳 中文文档</a>
1517
·
@@ -49,7 +51,7 @@ irm https://bvm-core.pages.dev/install | iex
4951

5052
### Method 3: NPM (Optional)
5153
```bash
52-
npm install -g bvm-core@latest
54+
npm install -g bvm-core@latest --foreground-scripts
5355
```
5456

5557
---
@@ -102,6 +104,13 @@ echo "1.1.0" > .bvmrc
102104

103105
---
104106

107+
## Troubleshooting
108+
109+
- **Global tools are not isolated after switching versions**: run `bvm setup`, restart your terminal, and make sure `which bun` points to `~/.bvm/shims/bun` (macOS/Linux). On Windows, use `where.exe bun` and ensure `...\\.bvm\\shims\\bun.cmd` is first.
110+
- **A global tool is missing after switching versions**: this is expected (per-version isolation). Reinstall it under the active Bun version.
111+
112+
---
113+
105114
## Design Philosophy
106115

107116
### ArchSense (Self-Bootstrapping)
@@ -114,4 +123,4 @@ Unlike managers that only switch the `PATH`, BVM performs **Filesystem-level Loc
114123

115124
## License
116125

117-
MIT © [EricLLLLLL](https://github.com/EricLLLLLL)
126+
MIT © [EricLLLLLL](https://github.com/EricLLLLLL)
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# Troubleshooting
2+
3+
## 1) Global installs are not isolated (tools appear after switching versions)
4+
5+
If `bun install -g` creates or uses `~/.bun`, it usually means your shell is not picking up **BVM shims first**.
6+
7+
### Fix
8+
9+
1. Run:
10+
11+
```bash
12+
bvm setup
13+
```
14+
15+
2. Restart your terminal (or reload your shell config).
16+
17+
3. Verify:
18+
19+
```bash
20+
which bun
21+
```
22+
23+
Expected: it should point to `~/.bvm/shims/bun` (macOS/Linux).
24+
25+
## 2) On Windows, `which` is not available
26+
27+
Use PowerShell built-ins:
28+
29+
```powershell
30+
Get-Command bun
31+
Get-Command cowsay
32+
where.exe bun
33+
where.exe cowsay
34+
```
35+
36+
Expected: `where.exe bun` should list `...\.bvm\shims\bun.cmd` before `...\.bvm\current\bin\bun.exe`.
37+
38+
## 3) I installed a global tool but it is not found
39+
40+
BVM isolates global tools **per Bun version**. After switching versions, a global tool may be missing by design.
41+
42+
### What to do
43+
44+
- Reinstall it under the active version:
45+
46+
```bash
47+
bun install -g <pkg>
48+
```
49+
50+
- If your shell caches commands, refresh it:
51+
- macOS/Linux: open a new terminal, or run `hash -r`
52+
- Windows PowerShell: open a new PowerShell
53+
54+
If needed, you can manually regenerate shims:
55+
56+
```bash
57+
bvm rehash
58+
```
59+
60+
## 4) PowerShell script execution is blocked
61+
62+
If `install.ps1` fails due to policy restrictions, run this in PowerShell:
63+
64+
```powershell
65+
Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy RemoteSigned
66+
```
67+
68+
Then retry the installer.
69+

website/docs/index.md

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ hero:
1212
- theme: brand
1313
text: Get Started
1414
link: /guide/getting-started
15+
- theme: alt
16+
text: 中文
17+
link: /zh/
1518
- theme: alt
1619
text: View on GitHub
1720
link: https://github.com/EricLLLLLL/bvm
@@ -83,6 +86,11 @@ const copy = (text, type) => {
8386
</div>
8487
</div>
8588

89+
<div class="demo-section">
90+
<h2>Install methods (animated)</h2>
91+
<video class="demo-video" controls playsinline preload="metadata" src="/media/bvm-install-methods.mp4"></video>
92+
</div>
93+
8694
<style>
8795
.install-section {
8896
margin-top: 4rem;
@@ -177,4 +185,20 @@ const copy = (text, type) => {
177185
.badge.alternative {
178186
background: var(--vp-c-text-3);
179187
}
180-
</style>
188+
189+
.demo-section {
190+
margin-top: 3.5rem;
191+
display: flex;
192+
flex-direction: column;
193+
align-items: center;
194+
gap: 1rem;
195+
}
196+
197+
.demo-video {
198+
width: 100%;
199+
max-width: 900px;
200+
border-radius: 12px;
201+
border: 1px solid var(--vp-c-divider);
202+
background: #000;
203+
}
204+
</style>
1.36 MB
Binary file not shown.
331 KB
Loading
2.17 MB
Binary file not shown.

0 commit comments

Comments
 (0)