Skip to content

Commit e00b368

Browse files
committed
Enable twoslash
1 parent 1691436 commit e00b368

File tree

8 files changed

+4802
-839
lines changed

8 files changed

+4802
-839
lines changed

.github/workflows/ci.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
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+
run_install: false
26+
27+
- name: Get pnpm store directory
28+
shell: bash
29+
run: echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
30+
31+
- name: Setup pnpm cache
32+
uses: actions/cache@v4
33+
with:
34+
path: ${{ env.STORE_PATH }}
35+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
36+
restore-keys: |
37+
${{ runner.os }}-pnpm-store-
38+
39+
- name: Install dependencies
40+
run: pnpm install --frozen-lockfile
41+
42+
- name: Validate Twoslash code blocks
43+
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: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,12 @@
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+
"@cartridge/controller": "^0.8.0",
13+
"@cartridge/connector": "^0.8.0",
1214
"@starknet-react/chains": "^0.1.7",
1315
"@starknet-react/core": "^3.5.0",
1416
"@types/react": "^18.3.12",
@@ -21,6 +23,8 @@
2123
"yaml": "^2.6.0"
2224
},
2325
"devDependencies": {
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)