Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.
chore: remove test file and document Twoslash in CLAUDE.md
Sushmithamallesh committed
Jan 12, 2026 at 13:50 UTC
4311a17900940d3bc4c29637a71294f09394d008
2 files changed
+35
-41
fumadocs/CLAUDE.md
+35
@@ -40,6 +40,41 @@ CI auto-generates on changes to `ts/packages/core/src/**` or `python/composio/**
40
4. **Root directory on Vercel**: Set to `fumadocs` with "Include files outside root directory" DISABLED
41
5. **Mobile nav**: Always test CSS changes on mobile. Fumadocs uses different nav patterns (dropdown on mobile, horizontal on desktop). Avoid absolute positioning or pseudo-elements that assume horizontal layout.
42
43
+## Twoslash - Code Block Type Checking
44
+
45
+TypeScript code blocks can be type-checked at build time using Twoslash.
46
+
47
+### How to use
48
+Add `twoslash` to the code fence to enable type checking:
49
+
50
+````md
51
+```ts twoslash
52
+import { Composio } from "@composio/core";
53
+const composio = new Composio({ apiKey: "test" });
54
+// ^? - hover shows type info in rendered docs
55
+```
56
+````
57
+
58
+### Key features
59
+- **Build-time validation**: Code blocks are compiled during build. Type errors fail the build.
60
+- **Opt-in**: Only blocks with `twoslash` annotation are checked. Regular code blocks are unaffected.
61
+- **CI enforcement**: `.github/workflows/fumadocs-build.yml` runs on PRs to fumadocs/
62
+
63
+### Annotations
64
+- `// ^?` - Show type on hover at that position
65
+- `// @errors: 2322` - Expect specific error (won't fail build)
66
+- `// @noErrors` - Skip all type checking for this block
67
+- `// ---cut---` - Hide code above this line from output (but include for compilation)
68
+
69
+### Configuration
70
+- **Config**: `source.config.ts` - `transformerTwoslash({ explicitTrigger: true })`
71
+- **SDK packages**: Installed as devDependencies for import resolution
72
+
73
+### Troubleshooting
74
+- If imports fail, ensure the package is in `devDependencies`
75
+- Use `// @noErrors` for pseudocode or partial examples
76
+- Check CI logs for specific error codes (e.g., 2322 = type mismatch)
77
+
78
## Deployment
79
- Vercel project: `composio/fumadocs`
80
- Uses `bun install` and `bun run build`
fumadocs/content/docs/twoslash-test.mdx
deleted
-41
@@ -1,41 +0,0 @@
1
----
2
-title: Twoslash Test
3
-description: Testing Twoslash type checking
4
----
5
-
6
-## Test 1: Basic TypeScript (should work)
7
-
8
-```ts twoslash
9
-const message: string = "Hello, world!";
10
-console.log(message);
11
-// ^?
12
-```
13
-
14
-## Test 2: Intentional type error (using @errors annotation)
15
-
16
-```ts twoslash
17
-// @errors: 2322
18
-const num: number = "not a number";
19
-```
20
-
21
-## Test 3: Real Composio import
22
-
23
-```ts twoslash
24
-import { Composio } from "@composio/core";
25
-
26
-const composio = new Composio({ apiKey: "test-key" });
27
-// ^?
28
-```
29
-
30
-## Test 4: Anthropic example
31
-
32
-```ts twoslash
33
-import { Composio } from "@composio/core";
34
-import { AnthropicProvider } from "@composio/anthropic";
35
-
36
-const composio = new Composio({
37
- apiKey: "test-key",
38
- provider: new AnthropicProvider(),
39
-});
40
-```
41
-