Skip to content

Commit e25a5a3

Browse files
committed
Enable twoslash
1 parent 1691436 commit e25a5a3

File tree

8 files changed

+7327
-1569
lines changed

8 files changed

+7327
-1569
lines changed

.github/workflows/ci.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
lint-and-build:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout repository
15+
uses: actions/checkout@v4
16+
17+
- name: Setup Node.js
18+
uses: actions/setup-node@v4
19+
with:
20+
node-version: "20"
21+
22+
- name: Setup pnpm
23+
uses: pnpm/action-setup@v4
24+
with:
25+
version: 9
26+
run_install: false
27+
28+
- name: Get pnpm store directory
29+
shell: bash
30+
run: echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
31+
32+
- name: Setup pnpm cache
33+
uses: actions/cache@v4
34+
with:
35+
path: ${{ env.STORE_PATH }}
36+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
37+
restore-keys: |
38+
${{ runner.os }}-pnpm-store-
39+
40+
- name: Install dependencies
41+
run: pnpm install --frozen-lockfile
42+
43+
- name: Validate Twoslash code blocks
44+
run: pnpm validate-twoslash

CLAUDE.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,15 @@ The documentation covers three main products:
4747
- Key dependencies: React 18, Starknet libraries, Cartridge connector
4848
- Vocs alpha version (1.0.0-alpha.55)
4949

50+
### TypeScript Twoslash Integration
51+
The documentation site supports TypeScript Twoslash for enhanced code blocks that provide:
52+
- Type information on hover
53+
- IntelliSense-like features
54+
- Compile-time error checking in documentation
55+
56+
To use Twoslash in code blocks, add `twoslash` to the language identifier:
57+
```typescript twoslash
58+
// Your TypeScript code here with full type checking
59+
```
60+
5061
When editing content, maintain the existing markdown structure and follow the established sidebar navigation patterns in `vocs.config.ts`.

package.json

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,26 @@
55
"scripts": {
66
"dev": "vocs dev",
77
"build": "vocs build",
8-
"preview": "vocs preview"
8+
"preview": "vocs preview",
9+
"validate-twoslash": "node scripts/validate-twoslash.js"
910
},
1011
"dependencies": {
11-
"@cartridge/connector": "^0.3.46",
12-
"@starknet-react/chains": "^0.1.7",
12+
"@cartridge/connector": "^0.8.0",
13+
"@starknet-react/chains": "^3.1.3",
1314
"@starknet-react/core": "^3.5.0",
14-
"@types/react": "^18.3.12",
15-
"get-starknet-core": "^3.3.4",
16-
"react": "^18.3.1",
17-
"react-dom": "^18.3.1",
18-
"react-router-dom": "^6.28.0",
19-
"starknet": "^6.21.0",
20-
"vocs": "1.0.0-alpha.55",
15+
"@types/react": "^19",
16+
"react": "^19",
17+
"react-dom": "^19",
18+
"react-router-dom": "^7.6",
19+
"starknet": "^7.6",
20+
"vocs": "1.0.12",
2121
"yaml": "^2.6.0"
2222
},
2323
"devDependencies": {
24+
"@cartridge/controller": "0.8.0",
25+
"@shikijs/twoslash": "^3.7.0",
26+
"glob": "^11.0.3",
27+
"typescript": "^5.8.3",
2428
"vite-plugin-svgr": "^4.3.0"
2529
},
2630
"packageManager": "pnpm@9.12.1+sha512.e5a7e52a4183a02d5931057f7a0dbff9d5e9ce3161e33fa68ae392125b79282a8a8a470a51dfc8a0ed86221442eb2fb57019b0990ed24fab519bf0e1bc5ccfc4"

0 commit comments

Comments
 (0)