@brainfish-ai/devdoc 0.1.25 → 0.1.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/README.md +2 -2
  2. package/dist/cli/commands/create.js +28 -9
  3. package/dist/cli/commands/dev.js +41 -77
  4. package/package.json +6 -6
  5. package/renderer/components/docs-viewer/index.tsx +41 -2
  6. package/renderer/components/docs-viewer/sidebar/collection-tree.tsx +20 -0
  7. package/templates/basic/README.md +0 -139
  8. package/templates/basic/assets/favicon.svg +0 -4
  9. package/templates/basic/assets/logo.svg +0 -9
  10. package/templates/basic/docs.json +0 -47
  11. package/templates/basic/guides/configuration.mdx +0 -149
  12. package/templates/basic/guides/overview.mdx +0 -96
  13. package/templates/basic/index.mdx +0 -39
  14. package/templates/basic/package.json +0 -14
  15. package/templates/basic/quickstart.mdx +0 -92
  16. package/templates/basic/vercel.json +0 -6
  17. package/templates/graphql/README.md +0 -139
  18. package/templates/graphql/api-reference/schema.graphql +0 -305
  19. package/templates/graphql/assets/favicon.svg +0 -4
  20. package/templates/graphql/assets/logo.svg +0 -9
  21. package/templates/graphql/docs.json +0 -54
  22. package/templates/graphql/guides/configuration.mdx +0 -149
  23. package/templates/graphql/guides/overview.mdx +0 -96
  24. package/templates/graphql/index.mdx +0 -39
  25. package/templates/graphql/package.json +0 -14
  26. package/templates/graphql/quickstart.mdx +0 -92
  27. package/templates/graphql/vercel.json +0 -6
  28. package/templates/openapi/README.md +0 -139
  29. package/templates/openapi/api-reference/openapi.json +0 -419
  30. package/templates/openapi/assets/favicon.svg +0 -4
  31. package/templates/openapi/assets/logo.svg +0 -9
  32. package/templates/openapi/docs.json +0 -61
  33. package/templates/openapi/guides/configuration.mdx +0 -149
  34. package/templates/openapi/guides/overview.mdx +0 -96
  35. package/templates/openapi/index.mdx +0 -39
  36. package/templates/openapi/package.json +0 -14
  37. package/templates/openapi/quickstart.mdx +0 -92
  38. package/templates/openapi/vercel.json +0 -6
@@ -77,6 +77,26 @@ export function CollectionTree({
77
77
  }
78
78
  return expanded
79
79
  })
80
+
81
+ // Re-expand all folders when collection folders change (e.g., tab switch)
82
+ // This ensures folders are expanded when switching between tabs with different folder sets
83
+ const folderIds = useMemo(() =>
84
+ collection.folders.map(f => f.id).sort().join(','),
85
+ [collection.folders]
86
+ )
87
+
88
+ useEffect(() => {
89
+ if (level === 0 && collection.folders.length > 0) {
90
+ setExpandedFolders(prev => {
91
+ const newExpanded = new Set(prev)
92
+ // Add all current folder IDs to expanded set
93
+ collection.folders.forEach((folder) => {
94
+ newExpanded.add(folder.id)
95
+ })
96
+ return newExpanded
97
+ })
98
+ }
99
+ }, [folderIds, level, collection.folders])
80
100
 
81
101
  // Auto-expand folder when selectedRequest changes (e.g., via agent navigation)
82
102
  useEffect(() => {
@@ -1,139 +0,0 @@
1
- # My Documentation
2
-
3
- Documentation site built with [DevDoc](https://github.com/brainfish-ai/devdoc).
4
-
5
- [![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https://github.com/brainfish-ai/devdoc-starter)
6
-
7
- ## Quick Start
8
-
9
- ### Prerequisites
10
-
11
- - [Node.js](https://nodejs.org/) 18.0 or later
12
- - npm, yarn, or pnpm
13
-
14
- ### Installation
15
-
16
- 1. **Clone this repository**
17
-
18
- ```bash
19
- git clone https://github.com/your-username/your-docs.git
20
- cd your-docs
21
- ```
22
-
23
- Or use the GitHub template button above.
24
-
25
- 2. **Install dependencies**
26
-
27
- ```bash
28
- npm install
29
- ```
30
-
31
- 3. **Start the development server**
32
-
33
- ```bash
34
- npm run dev
35
- ```
36
-
37
- 4. **Open your browser**
38
-
39
- Visit [http://localhost:3000](http://localhost:3000) to see your docs.
40
-
41
- ## Project Structure
42
-
43
- ```
44
- .
45
- ├── docs.json # Site configuration
46
- ├── index.mdx # Homepage
47
- ├── quickstart.mdx # Quickstart guide
48
- ├── guides/
49
- │ ├── overview.mdx # Overview page
50
- │ └── configuration.mdx # Configuration guide
51
- ├── public/
52
- │ ├── logo.svg # Site logo
53
- │ └── favicon.svg # Favicon
54
- ├── package.json
55
- ├── vercel.json # Vercel deployment config
56
- └── README.md
57
- ```
58
-
59
- ## Configuration
60
-
61
- Edit `docs.json` to customize your site:
62
-
63
- ```json
64
- {
65
- "name": "My Documentation",
66
- "logo": "/logo.svg",
67
- "navigation": {
68
- "tabs": [
69
- {
70
- "tab": "Documentation",
71
- "type": "docs",
72
- "groups": [
73
- {
74
- "group": "Getting Started",
75
- "pages": ["index", "quickstart"]
76
- }
77
- ]
78
- }
79
- ]
80
- }
81
- }
82
- ```
83
-
84
- ## Writing Content
85
-
86
- Create `.mdx` files with frontmatter:
87
-
88
- ```mdx
89
- ---
90
- title: Page Title
91
- description: Page description for SEO
92
- ---
93
-
94
- # Your Content Here
95
-
96
- Write Markdown with React components.
97
-
98
- <Note>
99
- Use components like Note, Card, Steps, and more.
100
- </Note>
101
- ```
102
-
103
- ## Available Commands
104
-
105
- | Command | Description |
106
- |---------|-------------|
107
- | `npm run dev` | Start development server |
108
- | `npm run build` | Build for production |
109
- | `npm run start` | Start production server |
110
- | `npm run check` | Validate configuration |
111
-
112
- ## Deployment
113
-
114
- ### Vercel (Recommended)
115
-
116
- Click the "Deploy with Vercel" button above, or:
117
-
118
- 1. Push your code to GitHub
119
- 2. Import the repository in [Vercel](https://vercel.com)
120
- 3. Deploy!
121
-
122
- ### Other Platforms
123
-
124
- ```bash
125
- # Build the site
126
- npm run build
127
-
128
- # Output is in the dist/ directory
129
- ```
130
-
131
- ## Learn More
132
-
133
- - [DevDoc Documentation](https://devdoc.sh/docs)
134
- - [MDX Documentation](https://mdxjs.com/)
135
- - [Vercel Documentation](https://vercel.com/docs)
136
-
137
- ## License
138
-
139
- MIT
@@ -1,4 +0,0 @@
1
- <svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
2
- <rect width="32" height="32" rx="8" fill="#10b981"/>
3
- <path d="M8 16L14 22L24 10" stroke="white" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"/>
4
- </svg>