@heyo-sh/create-heyo-docs 1.0.0 → 2.0.0

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 (122) hide show
  1. package/deployments/cloudflare/astro/package.json +2 -1
  2. package/deployments/cloudflare/astro/src/env.d.ts +8 -0
  3. package/deployments/cloudflare/astro/src/pages/heyo-docs-internal/ai-chat.ts +32 -0
  4. package/deployments/cloudflare/next/app/heyo-docs-internal/ai-chat/route.ts +27 -0
  5. package/deployments/cloudflare/next/cloudflare-env.d.ts +7 -0
  6. package/deployments/cloudflare/react-router/app/cloudflare-env.d.ts +7 -0
  7. package/deployments/cloudflare/react-router/app/lib/cloudflare-context.ts +4 -0
  8. package/deployments/cloudflare/react-router/app/routes/ai-chat.ts +31 -0
  9. package/deployments/cloudflare/react-router/package.json +2 -1
  10. package/deployments/cloudflare/react-router/workers/app.ts +6 -2
  11. package/deployments/vercel/astro/package.json +1 -0
  12. package/dist/index.js +37 -16
  13. package/dist/project-name.d.ts +1 -1
  14. package/dist/project-name.d.ts.map +1 -1
  15. package/dist/scaffold.d.ts.map +1 -1
  16. package/dist/utils.d.ts.map +1 -1
  17. package/package.json +2 -2
  18. package/templates/astro/content/index.mdx +8 -0
  19. package/templates/astro/heyo-docs.config.ts +4 -48
  20. package/templates/astro/src/components/docs-app.tsx +30 -130
  21. package/templates/astro/src/heyo-docs-icons.tsx +3 -1
  22. package/templates/astro/src/layouts/docs-layout.astro +20 -504
  23. package/templates/astro/src/lib/docs.ts +3 -2
  24. package/templates/astro/src/lib/openapi-request.ts +6 -146
  25. package/templates/astro/src/pages/[...slug].astro +7 -15
  26. package/templates/astro/src/pages/[...slug].md.ts +4 -1
  27. package/templates/astro/src/pages/heyo-docs-internal/ai-chat.ts +10 -3
  28. package/templates/astro/src/pages/heyo-docs-internal/openapi-request.ts +6 -0
  29. package/templates/astro/src/pages/index.astro +18 -9
  30. package/templates/astro/src/pages/llms-full.txt.ts +1 -1
  31. package/templates/astro/src/pages/llms.txt.ts +1 -1
  32. package/templates/astro/src/pages/rss.xml.ts +1 -1
  33. package/templates/astro/src/pages/sitemap.xml.ts +2 -2
  34. package/templates/astro/src/virtual.d.ts +5 -5
  35. package/templates/next/app/[[...slug]]/page.tsx +10 -9
  36. package/templates/next/app/components/docs-app.tsx +28 -120
  37. package/templates/next/app/heyo-docs-icons.tsx +1 -1
  38. package/templates/next/app/heyo-docs-internal/ai-chat/route.ts +9 -2
  39. package/templates/next/app/heyo-docs-internal/markdown/[[...slug]]/route.ts +1 -1
  40. package/templates/next/app/layout.tsx +25 -444
  41. package/templates/next/app/lib/docs.ts +3 -3
  42. package/templates/next/app/lib/openapi-request.ts +4 -136
  43. package/templates/next/app/llms-full.txt/route.ts +1 -1
  44. package/templates/next/app/llms.txt/route.ts +1 -1
  45. package/templates/next/app/rss.xml/route.ts +1 -1
  46. package/templates/next/app/sitemap.xml/route.ts +1 -1
  47. package/templates/next/content/index.mdx +8 -0
  48. package/templates/next/heyo-docs.config.ts +3 -47
  49. package/templates/next/next.config.ts +7 -1
  50. package/templates/react-router/app/heyo-docs-icons.tsx +3 -1
  51. package/templates/react-router/app/root.tsx +28 -465
  52. package/templates/react-router/app/routes/ai-chat.ts +6 -2
  53. package/templates/react-router/app/routes/docs.tsx +22 -63
  54. package/templates/react-router/app/routes/home.tsx +6 -1
  55. package/templates/react-router/app/routes/llms-full.ts +1 -1
  56. package/templates/react-router/app/routes/llms.ts +1 -1
  57. package/templates/react-router/app/routes/markdown.ts +4 -1
  58. package/templates/react-router/app/routes/openapi-request.ts +11 -144
  59. package/templates/react-router/app/routes/rss.ts +1 -1
  60. package/templates/react-router/app/routes/sitemap.ts +5 -8
  61. package/templates/react-router/app/virtual.d.ts +5 -5
  62. package/templates/react-router/content/index.mdx +8 -0
  63. package/templates/react-router/heyo-docs.config.ts +4 -48
  64. package/templates/astro/content/api-overview.mdx +0 -20
  65. package/templates/astro/content/assets/local-architecture.svg +0 -22
  66. package/templates/astro/content/assets/quick-reference.txt +0 -5
  67. package/templates/astro/content/changelog.mdx +0 -38
  68. package/templates/astro/content/configuration.mdx +0 -117
  69. package/templates/astro/content/deploying.mdx +0 -57
  70. package/templates/astro/content/essentials/callouts.mdx +0 -34
  71. package/templates/astro/content/essentials/code-blocks.mdx +0 -43
  72. package/templates/astro/content/essentials/lists.mdx +0 -36
  73. package/templates/astro/content/essentials/tables.mdx +0 -30
  74. package/templates/astro/content/essentials/tabs.mdx +0 -40
  75. package/templates/astro/content/essentials/text-styling.mdx +0 -43
  76. package/templates/astro/content/getting-started.mdx +0 -16
  77. package/templates/astro/content/mdx-components.mdx +0 -44
  78. package/templates/astro/content/openapi-petstore.json +0 -160
  79. package/templates/astro/content/openapi.json +0 -278
  80. package/templates/astro/content/quickstart.mdx +0 -60
  81. package/templates/astro/src/components/theme-provider.tsx +0 -106
  82. package/templates/astro/src/lib/seo.ts +0 -221
  83. package/templates/astro/src/lib/theme.ts +0 -74
  84. package/templates/next/app/components/theme-provider.tsx +0 -93
  85. package/templates/next/app/lib/seo.ts +0 -189
  86. package/templates/next/app/lib/theme.ts +0 -61
  87. package/templates/next/content/api-overview.mdx +0 -20
  88. package/templates/next/content/assets/local-architecture.svg +0 -22
  89. package/templates/next/content/assets/quick-reference.txt +0 -5
  90. package/templates/next/content/changelog.mdx +0 -38
  91. package/templates/next/content/configuration.mdx +0 -117
  92. package/templates/next/content/deploying.mdx +0 -57
  93. package/templates/next/content/essentials/callouts.mdx +0 -34
  94. package/templates/next/content/essentials/code-blocks.mdx +0 -43
  95. package/templates/next/content/essentials/lists.mdx +0 -36
  96. package/templates/next/content/essentials/tables.mdx +0 -30
  97. package/templates/next/content/essentials/tabs.mdx +0 -40
  98. package/templates/next/content/essentials/text-styling.mdx +0 -43
  99. package/templates/next/content/getting-started.mdx +0 -16
  100. package/templates/next/content/mdx-components.mdx +0 -41
  101. package/templates/next/content/openapi-petstore.json +0 -160
  102. package/templates/next/content/openapi.json +0 -278
  103. package/templates/next/content/quickstart.mdx +0 -60
  104. package/templates/react-router/app/components/theme-provider.tsx +0 -106
  105. package/templates/react-router/app/lib/theme.ts +0 -74
  106. package/templates/react-router/content/api-overview.mdx +0 -20
  107. package/templates/react-router/content/assets/local-architecture.svg +0 -22
  108. package/templates/react-router/content/assets/quick-reference.txt +0 -5
  109. package/templates/react-router/content/changelog.mdx +0 -38
  110. package/templates/react-router/content/configuration.mdx +0 -117
  111. package/templates/react-router/content/deploying.mdx +0 -57
  112. package/templates/react-router/content/essentials/callouts.mdx +0 -34
  113. package/templates/react-router/content/essentials/code-blocks.mdx +0 -43
  114. package/templates/react-router/content/essentials/lists.mdx +0 -36
  115. package/templates/react-router/content/essentials/tables.mdx +0 -30
  116. package/templates/react-router/content/essentials/tabs.mdx +0 -40
  117. package/templates/react-router/content/essentials/text-styling.mdx +0 -43
  118. package/templates/react-router/content/getting-started.mdx +0 -16
  119. package/templates/react-router/content/mdx-components.mdx +0 -293
  120. package/templates/react-router/content/openapi-petstore.json +0 -160
  121. package/templates/react-router/content/openapi.json +0 -278
  122. package/templates/react-router/content/quickstart.mdx +0 -60
@@ -1,293 +0,0 @@
1
- ---
2
- title: MDX components
3
- description: Every built-in MDX component, its variants, and its usage.
4
- ---
5
-
6
- # MDX components
7
-
8
- Every component below is available without an import. The examples show every visual variant, so this page is also the reference for the documentation theme.
9
-
10
- ## Button
11
-
12
- `Button` uses the same shadcn component as the theme. It accepts `variant` and `size`, and uses `href` when the button should navigate. Use `align="left"`, `"center"`, or `"right"` to position it in the documentation column. Available variants are `default`, `secondary`, `outline`, `ghost`, `destructive`, and `link`; sizes are `xs`, `sm`, `default`, and `lg`.
13
-
14
- <Button href="/getting-started" variant="default" size="lg">
15
- Get started
16
- </Button>
17
-
18
- <Button align="center" href="/mdx-components" variant="outline" size="sm">
19
- Centred outline button
20
- </Button>
21
-
22
- <Button
23
- align="right"
24
- href="https://github.com/heyo-sh/heyo-docs"
25
- target="_blank"
26
- variant="ghost"
27
- size="xs"
28
- >
29
- View on GitHub
30
- </Button>
31
-
32
- ## Tabs
33
-
34
- `Tabs` supports the `default` and `line` variants. Each `Tab` needs a title and can have a stable `value`.
35
-
36
- <Tabs defaultValue="npm" variant="default">
37
- <Tab title="npm" value="npm">
38
- Install the package with npm.
39
- </Tab>
40
- <Tab title="Bun" value="bun">
41
- Bun works with the same Vite plugin.
42
- </Tab>
43
- </Tabs>
44
-
45
- <Tabs defaultValue="npm" variant="line">
46
- <Tab title="npm" value="npm">
47
- The line treatment is useful for compact comparisons.
48
- </Tab>
49
- <Tab title="Bun" value="bun">
50
- Use the variant that fits the surrounding content.
51
- </Tab>
52
- </Tabs>
53
-
54
- ## Accordion
55
-
56
- `Accordion` works as a group of `AccordionItem` elements or as a concise, one-item disclosure. Set `multiple` to keep more than one item open.
57
-
58
- <Accordion multiple>
59
- <AccordionItem title="Multiple items" value="multiple">
60
- Several items can be open at the same time.
61
- </AccordionItem>
62
- <AccordionItem title="Individual item" value="item">
63
- Give each item its own `value` when the state needs to be stable.
64
- </AccordionItem>
65
- </Accordion>
66
-
67
- <Accordion title="Concise Accordion" defaultOpen>
68
- Use `title` directly on Accordion for one disclosure, and `defaultOpen` to
69
- reveal it initially.
70
- </Accordion>
71
-
72
- ## CodeBlock
73
-
74
- `CodeBlock` uses GitHub syntax highlighting and preserves every newline as a
75
- hard code line. Use `showLineNumbers` when a reader may need to reference a
76
- line.
77
-
78
- <CodeBlock language="ts" showLineNumbers title="config.ts">
79
- {`export const theme = "github";
80
- export const showLineNumbers = true;`}
81
- </CodeBlock>
82
-
83
- ## CodeSnippet
84
-
85
- `CodeSnippet` pairs a rendered preview with its implementation. Source longer than three lines is collapsed behind a gradient; select **View Code** to reveal a scrollable code pane and copy it. Pass the preview as children and the source through `code`.
86
-
87
- <CodeSnippet
88
- code={`const title = "Keep examples compact"
89
- const details = [
90
- "Readers can reveal the implementation when they need it.",
91
- "The open code pane keeps long examples within the page.",
92
- "Use the copy button to take the complete snippet.",
93
- ]
94
-
95
- export function CompactExample() {
96
- return (
97
- <Callout
98
- type="tip"
99
- title={title}
100
- description={details.join(" ")}
101
- />
102
- )
103
- }`}
104
- language="tsx"
105
- showLineNumbers
106
- >
107
- <Callout
108
- type="tip"
109
- title="Keep examples compact"
110
- description="Readers can reveal the implementation when they need it."
111
- />
112
- </CodeSnippet>
113
-
114
- ## CodeBlockGroup
115
-
116
- `CodeBlockGroup` groups code blocks into tabs. It supports the same `default` and `line` tab variants as `Tabs`.
117
-
118
- <CodeBlockGroup variant="default">
119
- <CodeBlock language="bash" title="npm">
120
- {"npm install your-package"}
121
- </CodeBlock>
122
- <CodeBlock language="bash" title="Bun">
123
- {"bun add your-package"}
124
- </CodeBlock>
125
- </CodeBlockGroup>
126
-
127
- <CodeBlockGroup variant="line">
128
- <CodeBlock language="bash" title="npm">
129
- {"npm run dev"}
130
- </CodeBlock>
131
- <CodeBlock language="bash" title="Bun">
132
- {"bun run dev"}
133
- </CodeBlock>
134
- </CodeBlockGroup>
135
-
136
- ## Callout
137
-
138
- `Callout` supports `note`, `warning`, `info`, `tip`, `check`, and `danger`. Each type has a matching icon and colour accent. Use `title` and `description` for a concise callout, or provide richer MDX content as children.
139
-
140
- <Callout type="note" description="Use a note for supporting context." />
141
-
142
- <Callout
143
- type="warning"
144
- title="Check your configuration"
145
- description="This value affects every deployed environment."
146
- />
147
-
148
- <Callout
149
- type="info"
150
- description="This guide assumes React Router Framework Mode."
151
- />
152
-
153
- <Callout
154
- type="tip"
155
- description="Keep stable values when an accordion state must persist."
156
- />
157
-
158
- <Callout type="check" description="Your project is ready to publish." />
159
-
160
- <Callout
161
- type="danger"
162
- title="Irreversible action"
163
- description="This action permanently removes the deployment."
164
- />
165
-
166
- ## Columns
167
-
168
- `Columns` supports two or three columns, while `Column` supports `card` and `plain` variants. A `href` makes a card linkable.
169
-
170
- <Columns columns={2} variant="card">
171
- <Column title="Card column">
172
- The default card surface works well for grouped links.
173
- </Column>
174
- <Column href="https://ui.shadcn.com" title="Linked card">
175
- This card is a link.
176
- </Column>
177
- </Columns>
178
-
179
- <Columns columns={3} variant="plain">
180
- <Column title="Plain one">Use plain columns for lighter layouts.</Column>
181
- <Column title="Plain two">
182
- Individual items may override the parent variant.
183
- </Column>
184
- <Column title="Card override" variant="card">
185
- This column restores the card surface.
186
- </Column>
187
- </Columns>
188
-
189
- ## Related topics
190
-
191
- `RelatedTopics` creates a compact list of nearby documentation. Each `RelatedTopic` takes an `icon`, `name`, and `src` destination.
192
-
193
- <RelatedTopics>
194
- <RelatedTopic icon="book" name="Getting started" src="/getting-started" />
195
- <RelatedTopic
196
- icon="code"
197
- name="Code snippets"
198
- src="/mdx-components#codesnippet"
199
- />
200
- <RelatedTopic
201
- icon="globe"
202
- name="shadcn documentation"
203
- src="https://ui.shadcn.com/docs/components/base/hover-card"
204
- />
205
- </RelatedTopics>
206
-
207
- ## Hover Card
208
-
209
- `HoverCard` is the shadcn Hover Card primitive. It opens instantly by default; pass `delay` or `closeDelay` to `HoverCardTrigger` when a particular preview needs different timing. Its trigger can sit directly in a sentence: hover or focus <HoverCard><HoverCardTrigger href="#hover-card">this inline link</HoverCardTrigger><HoverCardContent>Preview content without navigating away from the page.</HoverCardContent></HoverCard> to open it.
210
-
211
- <HoverCard>
212
- <HoverCardTrigger
213
- href="https://github.com/shadcn-ui"
214
- target="_blank"
215
- rel="noreferrer"
216
- className="inline-flex font-medium underline underline-offset-4"
217
- >
218
- <span>@shadcn</span>
219
- </HoverCardTrigger>
220
- <HoverCardContent className="w-80 p-4">
221
- <div className="flex justify-between gap-4">
222
- <img
223
- src="https://github.com/shadcn-ui.png?size=96"
224
- alt="shadcn"
225
- width="48"
226
- height="48"
227
- className="size-12 rounded-full"
228
- />
229
- <div className="min-w-0 space-y-1.5">
230
- <p className="font-semibold text-popover-foreground">shadcn/ui</p>
231
- <p className="text-muted-foreground">
232
- Beautifully designed components that you can copy, own, and build on.
233
- </p>
234
- <div className="flex flex-wrap gap-x-3 gap-y-1 pt-1 text-[0.6875rem] text-muted-foreground">
235
- <span>127k GitHub stars</span>
236
- <span>Open source</span>
237
- </div>
238
- </div>
239
- </div>
240
- </HoverCardContent>
241
- </HoverCard>
242
-
243
- ## Tree
244
-
245
- `Tree` contains `Folder` and `File`. Folders are open by default; set `defaultOpen={false}` for a collapsed branch.
246
-
247
- <Tree>
248
- <Folder name="app">
249
- <File name="routes.ts" />
250
- <Folder name="components" defaultOpen={false}>
251
- <File name="theme-provider.tsx" />
252
- </Folder>
253
- </Folder>
254
- <File name="heyo-docs.config.ts" />
255
- </Tree>
256
-
257
- ## GitHub
258
-
259
- `GitHub` only needs a GitHub URL in `href`; it fetches the public description, star count, and fork count in the browser. `simple` is the default one-card presentation. Use `inset` for a nested repository summary with the statistics below it.
260
-
261
- <GitHub href="https://github.com/shadcn-ui/ui" />
262
-
263
- <GitHub href="https://github.com/react/react" variant="inset" />
264
-
265
- <GitHub href="https://github.com/heyo-sh/heyo-docs" />
266
-
267
- ## Steps
268
-
269
- `Steps` automatically numbers each `Step`. Pass `number` to a step when the sequence needs an explicit number.
270
-
271
- <Steps>
272
- <Step title="Create content">
273
- Add an `.mdx` file to the configured content directory.
274
- </Step>
275
- <Step title="Use a component">
276
- Write `Callout`, `GitHub`, or `Mermaid` directly in the file.
277
- </Step>
278
- <Step number={4} title="Ship">
279
- Override the number only when the sequence continues elsewhere.
280
- </Step>
281
- </Steps>
282
-
283
- ## Mermaid
284
-
285
- `Mermaid` renders client-side with the active shadcn color tokens. SVG is the default output; use `variant="ascii"` for Unicode terminal-style output.
286
-
287
- <Mermaid>{`flowchart LR
288
- Content --> Build
289
- Build --> Documentation`}</Mermaid>
290
-
291
- <Mermaid variant="ascii">{`flowchart LR
292
- Content --> Build
293
- Build --> Documentation`}</Mermaid>
@@ -1,160 +0,0 @@
1
- {
2
- "openapi": "3.0.4",
3
- "info": {
4
- "title": "Swagger Petstore - OpenAPI 3.0",
5
- "description": "A small, read-only extract of the public Swagger Petstore schema for debugging Heyo Docs. Source: https://petstore3.swagger.io/api/v3/openapi.json",
6
- "version": "1.0.27",
7
- "license": {
8
- "name": "Apache 2.0",
9
- "url": "https://www.apache.org/licenses/LICENSE-2.0.html"
10
- }
11
- },
12
- "servers": [
13
- {
14
- "url": "https://petstore3.swagger.io/api/v3",
15
- "description": "Swagger Petstore public server"
16
- }
17
- ],
18
- "paths": {
19
- "/pet/findByStatus": {
20
- "get": {
21
- "tags": ["pet"],
22
- "summary": "Finds Pets by status.",
23
- "description": "Multiple status values can be provided with comma separated strings.",
24
- "operationId": "findPetsByStatus",
25
- "parameters": [
26
- {
27
- "name": "status",
28
- "in": "query",
29
- "description": "Status values that need to be considered for filter",
30
- "required": true,
31
- "explode": true,
32
- "schema": {
33
- "type": "string",
34
- "default": "available",
35
- "enum": ["available", "pending", "sold"]
36
- }
37
- }
38
- ],
39
- "responses": {
40
- "200": {
41
- "description": "successful operation",
42
- "content": {
43
- "application/json": {
44
- "schema": {
45
- "type": "array",
46
- "items": { "$ref": "#/components/schemas/Pet" }
47
- }
48
- }
49
- }
50
- },
51
- "400": {
52
- "description": "Invalid status value"
53
- },
54
- "default": {
55
- "description": "Unexpected error"
56
- }
57
- }
58
- }
59
- },
60
- "/store/order/{orderId}": {
61
- "get": {
62
- "tags": ["store"],
63
- "summary": "Find purchase order by ID.",
64
- "description": "For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions.",
65
- "operationId": "getOrderById",
66
- "parameters": [
67
- {
68
- "name": "orderId",
69
- "in": "path",
70
- "description": "ID of order that needs to be fetched.",
71
- "required": true,
72
- "schema": {
73
- "type": "integer",
74
- "format": "int64"
75
- }
76
- }
77
- ],
78
- "responses": {
79
- "200": {
80
- "description": "successful operation",
81
- "content": {
82
- "application/json": {
83
- "schema": { "$ref": "#/components/schemas/Order" }
84
- }
85
- }
86
- },
87
- "400": {
88
- "description": "Invalid ID supplied"
89
- },
90
- "404": {
91
- "description": "Order not found"
92
- },
93
- "default": {
94
- "description": "Unexpected error"
95
- }
96
- }
97
- }
98
- }
99
- },
100
- "components": {
101
- "schemas": {
102
- "Order": {
103
- "type": "object",
104
- "properties": {
105
- "id": { "type": "integer", "format": "int64", "example": 10 },
106
- "petId": {
107
- "type": "integer",
108
- "format": "int64",
109
- "example": 198772
110
- },
111
- "quantity": { "type": "integer", "format": "int32", "example": 7 },
112
- "shipDate": { "type": "string", "format": "date-time" },
113
- "status": {
114
- "type": "string",
115
- "description": "Order Status",
116
- "example": "approved",
117
- "enum": ["placed", "approved", "delivered"]
118
- },
119
- "complete": { "type": "boolean" }
120
- }
121
- },
122
- "Category": {
123
- "type": "object",
124
- "properties": {
125
- "id": { "type": "integer", "format": "int64", "example": 1 },
126
- "name": { "type": "string", "example": "Dogs" }
127
- }
128
- },
129
- "Tag": {
130
- "type": "object",
131
- "properties": {
132
- "id": { "type": "integer", "format": "int64" },
133
- "name": { "type": "string" }
134
- }
135
- },
136
- "Pet": {
137
- "required": ["name", "photoUrls"],
138
- "type": "object",
139
- "properties": {
140
- "id": { "type": "integer", "format": "int64", "example": 10 },
141
- "name": { "type": "string", "example": "doggie" },
142
- "category": { "$ref": "#/components/schemas/Category" },
143
- "photoUrls": {
144
- "type": "array",
145
- "items": { "type": "string" }
146
- },
147
- "tags": {
148
- "type": "array",
149
- "items": { "$ref": "#/components/schemas/Tag" }
150
- },
151
- "status": {
152
- "type": "string",
153
- "description": "pet status in the store",
154
- "enum": ["available", "pending", "sold"]
155
- }
156
- }
157
- }
158
- }
159
- }
160
- }