jamdesk 1.1.37 → 1.1.39

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 (47) hide show
  1. package/dist/__tests__/integration/init.integration.test.js +44 -0
  2. package/dist/__tests__/integration/init.integration.test.js.map +1 -1
  3. package/dist/__tests__/unit/init.test.js +2 -1
  4. package/dist/__tests__/unit/init.test.js.map +1 -1
  5. package/package.json +1 -1
  6. package/templates/api-reference/openapi-example.mdx +55 -0
  7. package/templates/api-reference/request-response-examples.mdx +210 -0
  8. package/templates/components/callouts.mdx +56 -0
  9. package/templates/components/cards.mdx +80 -0
  10. package/templates/components/steps.mdx +39 -0
  11. package/templates/components/tabs-and-accordions.mdx +65 -0
  12. package/templates/docs.json +48 -0
  13. package/templates/introduction.mdx +40 -10
  14. package/templates/openapi/example-api.yaml +185 -0
  15. package/templates/quickstart.mdx +98 -9
  16. package/templates/writing/code-blocks.mdx +80 -0
  17. package/templates/writing/components.mdx +78 -0
  18. package/templates/writing/pages.mdx +59 -0
  19. package/vendored/app/[[...slug]]/page.tsx +26 -8
  20. package/vendored/app/api/chat/[project]/route.ts +53 -3
  21. package/vendored/app/api/docs-search/[project]/search/route.ts +48 -3
  22. package/vendored/app/layout.tsx +4 -4
  23. package/vendored/components/mdx/OpenApiEndpoint.tsx +2 -1
  24. package/vendored/components/navigation/Sidebar.tsx +9 -4
  25. package/vendored/components/search/SearchModal.tsx +13 -20
  26. package/vendored/hooks/useChat.ts +22 -4
  27. package/vendored/lib/chat-prompt.ts +1 -1
  28. package/vendored/lib/chat-tools.ts +3 -0
  29. package/vendored/lib/embedding-chunker.ts +18 -2
  30. package/vendored/lib/language-codes.json +27 -0
  31. package/vendored/lib/language-utils.ts +80 -5
  32. package/vendored/lib/link-rewriter.ts +67 -0
  33. package/vendored/lib/locale-helpers.ts +62 -0
  34. package/vendored/lib/openapi/code-examples.ts +5 -6
  35. package/vendored/lib/openapi/derive-auth.ts +46 -0
  36. package/vendored/lib/openapi/index.ts +7 -0
  37. package/vendored/lib/openapi/parser.ts +7 -2
  38. package/vendored/lib/openapi/resolve-server-url.ts +14 -0
  39. package/vendored/lib/openapi/types.ts +2 -0
  40. package/vendored/lib/path-safety.ts +96 -0
  41. package/vendored/lib/search-client.ts +117 -12
  42. package/vendored/lib/static-artifacts.ts +25 -1
  43. package/vendored/lib/static-file-route.ts +13 -0
  44. package/vendored/lib/vector-store.ts +70 -17
  45. package/vendored/scripts/build-search-index.cjs +91 -24
  46. package/vendored/themes/base.css +5 -0
  47. package/vendored/workspace-package-lock.json +6 -6
@@ -1,10 +1,58 @@
1
1
  {
2
2
  "name": "{{PROJECT_NAME}}",
3
+ "theme": "jam",
4
+ "colors": {
5
+ "primary": "#635BFF",
6
+ "light": "#7C75FF",
7
+ "dark": "#4F46E5"
8
+ },
9
+ "api": {
10
+ "openapi": [
11
+ "/openapi/example-api.yaml"
12
+ ],
13
+ "examples": {
14
+ "languages": [
15
+ "curl",
16
+ "python",
17
+ "javascript",
18
+ "go",
19
+ "ruby",
20
+ "csharp",
21
+ "java",
22
+ "rust",
23
+ "php"
24
+ ]
25
+ }
26
+ },
3
27
  "navigation": {
4
28
  "groups": [
5
29
  {
6
30
  "group": "Getting Started",
31
+ "icon": "rocket",
7
32
  "pages": ["introduction", "quickstart"]
33
+ },
34
+ {
35
+ "group": "Writing Content",
36
+ "icon": "pen",
37
+ "pages": ["writing/pages", "writing/components", "writing/code-blocks"]
38
+ },
39
+ {
40
+ "group": "Built-In Components",
41
+ "icon": "puzzle-piece",
42
+ "pages": [
43
+ "components/cards",
44
+ "components/callouts",
45
+ "components/tabs-and-accordions",
46
+ "components/steps"
47
+ ]
48
+ },
49
+ {
50
+ "group": "API Pages",
51
+ "icon": "plug",
52
+ "pages": [
53
+ { "page": "api-reference/openapi-example", "title": "OpenAPI Example" },
54
+ "api-reference/request-response-examples"
55
+ ]
8
56
  }
9
57
  ]
10
58
  }
@@ -1,19 +1,49 @@
1
1
  ---
2
2
  title: Introduction
3
- description: Welcome to your documentation
3
+ description: "Starter project with example pages, components, and API reference. Edit MDX, customize your theme, and ship docs in minutes — preview locally or auto-deploy from GitHub."
4
4
  ---
5
5
 
6
- # Welcome to {{PROJECT_NAME}}
6
+ Welcome to your Jamdesk starter project. Everything you need to ship a polished documentation site is in this repo — edit the MDX files, tweak `docs.json`, and you're live.
7
7
 
8
- This is your new documentation site powered by Jamdesk.
8
+ <Tip>
9
+ **Built-in AI search.** Click the sparkles button in the top-right corner of the header — chat is grounded on this site's pages and works out of the box.
10
+ </Tip>
9
11
 
10
- ## Getting Started
12
+ ## What's included
11
13
 
12
- Edit this file to customize your documentation. Add new MDX files and update `docs.json` to add them to the navigation.
14
+ <Columns cols={2}>
15
+ <Card title="Ready-made pages" icon="file-lines">
16
+ Example pages for getting started, writing content, and API references.
17
+ </Card>
18
+ <Card title="50+ components" icon="puzzle-piece" href="/components/cards">
19
+ Cards, callouts, tabs, steps, code groups, accordions — no imports needed.
20
+ </Card>
21
+ <Card title="OpenAPI rendering" icon="plug" href="/api-reference/openapi-example">
22
+ Auto-generate endpoint pages from a YAML or JSON spec.
23
+ </Card>
24
+ <Card title="Auto-deploy" icon="rocket">
25
+ Push to GitHub and your docs build and deploy in seconds.
26
+ </Card>
27
+ </Columns>
13
28
 
14
- ## Features
29
+ ## A minimal Jamdesk project
15
30
 
16
- - **MDX Support** - Write documentation with React components
17
- - **Hot Reload** - See changes instantly during development
18
- - **Search** - Full-text search built in
19
- - **Themes** - Choose from multiple themes
31
+ ```text
32
+ my-docs/
33
+ ├── docs.json # Site config: theme, colors, navigation
34
+ ├── introduction.mdx # This page
35
+ └── quickstart.mdx # Your getting-started guide
36
+ ```
37
+
38
+ That's all you need. Add more `.mdx` files to add more pages — the file path becomes the URL.
39
+
40
+ ## Next steps
41
+
42
+ <Columns cols={2}>
43
+ <Card title="Quickstart" icon="play" href="/quickstart">
44
+ Edit pages locally, customize, and deploy.
45
+ </Card>
46
+ <Card title="Components" icon="puzzle-piece" href="/components/cards">
47
+ Browse every built-in component with live examples.
48
+ </Card>
49
+ </Columns>
@@ -0,0 +1,185 @@
1
+ openapi: 3.0.3
2
+ info:
3
+ title: Acme Support API
4
+ version: "1.0.0"
5
+ description: |
6
+ The Acme Support API lets you create and track customer support tickets.
7
+ Use it to post new issues from your product and keep users updated on status.
8
+ servers:
9
+ - url: https://jamdesk-docs.jamdesk.app/api/playground/demo
10
+ security: []
11
+ paths:
12
+ /tickets:
13
+ get:
14
+ summary: List support tickets
15
+ description: Retrieve all open support tickets.
16
+ operationId: listTickets
17
+ responses:
18
+ "200":
19
+ description: Ticket list
20
+ content:
21
+ application/json:
22
+ schema:
23
+ type: object
24
+ properties:
25
+ tickets:
26
+ type: array
27
+ items:
28
+ $ref: "#/components/schemas/TicketSummary"
29
+ total:
30
+ type: integer
31
+ example:
32
+ tickets:
33
+ - id: "tkt_9S8L2"
34
+ customer_id: "cus_2X9W8"
35
+ subject: "Export stuck on step 3"
36
+ priority: "high"
37
+ status: "open"
38
+ created_at: "2026-02-04T16:12:00Z"
39
+ total: 1
40
+ post:
41
+ summary: Create a support ticket
42
+ description: Create a new ticket for a customer issue or request.
43
+ operationId: createTicket
44
+ requestBody:
45
+ required: true
46
+ content:
47
+ application/json:
48
+ schema:
49
+ $ref: "#/components/schemas/CreateTicketRequest"
50
+ example:
51
+ customer_id: "cus_2X9W8"
52
+ subject: "Export stuck on step 3"
53
+ priority: "high"
54
+ tags: ["export", "bug"]
55
+ message: "The export job fails with error 504 after 2 minutes."
56
+ responses:
57
+ "201":
58
+ description: Ticket created
59
+ content:
60
+ application/json:
61
+ schema:
62
+ $ref: "#/components/schemas/Ticket"
63
+ example:
64
+ id: "tkt_9S8L2"
65
+ customer_id: "cus_2X9W8"
66
+ subject: "Export stuck on step 3"
67
+ priority: "high"
68
+ status: "open"
69
+ created_at: "2026-02-04T16:12:00Z"
70
+ "400":
71
+ description: Invalid request
72
+ content:
73
+ application/json:
74
+ schema:
75
+ $ref: "#/components/schemas/Error"
76
+ example:
77
+ code: "invalid_request"
78
+ message: "subject is required"
79
+ /tickets/{ticket_id}:
80
+ get:
81
+ summary: Get a support ticket
82
+ description: Retrieve a specific support ticket by its ID.
83
+ operationId: getTicket
84
+ parameters:
85
+ - name: ticket_id
86
+ in: path
87
+ required: true
88
+ description: Unique ticket identifier
89
+ schema:
90
+ type: string
91
+ example: "tkt_9S8L2"
92
+ responses:
93
+ "200":
94
+ description: Ticket details
95
+ content:
96
+ application/json:
97
+ schema:
98
+ $ref: "#/components/schemas/Ticket"
99
+ example:
100
+ id: "tkt_9S8L2"
101
+ customer_id: "cus_2X9W8"
102
+ subject: "Export stuck on step 3"
103
+ priority: "high"
104
+ status: "open"
105
+ tags: ["export", "bug"]
106
+ message: "The export job fails with error 504 after 2 minutes."
107
+ created_at: "2026-02-04T16:12:00Z"
108
+ updated_at: "2026-02-04T16:12:00Z"
109
+ components:
110
+ schemas:
111
+ CreateTicketRequest:
112
+ type: object
113
+ required:
114
+ - customer_id
115
+ - subject
116
+ - message
117
+ properties:
118
+ customer_id:
119
+ type: string
120
+ description: Customer identifier in Acme.
121
+ subject:
122
+ type: string
123
+ description: Short summary of the issue.
124
+ priority:
125
+ type: string
126
+ enum: [low, normal, high, urgent]
127
+ tags:
128
+ type: array
129
+ items:
130
+ type: string
131
+ message:
132
+ type: string
133
+ description: Detailed problem description.
134
+ TicketSummary:
135
+ type: object
136
+ description: Abbreviated ticket for list responses (excludes message and tags).
137
+ properties:
138
+ id:
139
+ type: string
140
+ customer_id:
141
+ type: string
142
+ subject:
143
+ type: string
144
+ priority:
145
+ type: string
146
+ status:
147
+ type: string
148
+ enum: [open, pending, resolved]
149
+ created_at:
150
+ type: string
151
+ format: date-time
152
+ Ticket:
153
+ type: object
154
+ description: Full ticket detail including message and tags.
155
+ properties:
156
+ id:
157
+ type: string
158
+ customer_id:
159
+ type: string
160
+ subject:
161
+ type: string
162
+ priority:
163
+ type: string
164
+ status:
165
+ type: string
166
+ enum: [open, pending, resolved]
167
+ tags:
168
+ type: array
169
+ items:
170
+ type: string
171
+ message:
172
+ type: string
173
+ created_at:
174
+ type: string
175
+ format: date-time
176
+ updated_at:
177
+ type: string
178
+ format: date-time
179
+ Error:
180
+ type: object
181
+ properties:
182
+ code:
183
+ type: string
184
+ message:
185
+ type: string
@@ -1,20 +1,109 @@
1
1
  ---
2
2
  title: Quickstart
3
- description: Get up and running in minutes
3
+ description: "Edit MDX files, preview locally with the Jamdesk CLI, then connect a GitHub repo for automatic deploys. Customize colors, branding, and navigation in docs.json."
4
4
  ---
5
5
 
6
- # Quickstart
6
+ Your docs are built from MDX files in this repository. Edit them locally with the CLI, then connect to Jamdesk for automatic builds on every push.
7
7
 
8
- Follow these steps to get started with your documentation.
8
+ ## 1. Preview locally
9
9
 
10
- ## Step 1: Edit docs.json
10
+ Install the Jamdesk CLI:
11
11
 
12
- Configure your documentation settings in `docs.json`.
12
+ <CodeGroup>
13
+ ```bash npm
14
+ npm install -g jamdesk
15
+ ```
13
16
 
14
- ## Step 2: Add Pages
17
+ ```bash brew
18
+ brew install jamdesk/tap/jamdesk
19
+ ```
20
+ </CodeGroup>
15
21
 
16
- Create new `.mdx` files and add them to the navigation in `docs.json`.
22
+ Start the dev server with hot reload:
17
23
 
18
- ## Step 3: Deploy
24
+ ```bash
25
+ jamdesk dev
26
+ ```
19
27
 
20
- Push to your Git repository and your docs will be built automatically.
28
+ Open [http://localhost:3000](http://localhost:3000). Edits to MDX files appear instantly.
29
+
30
+ ## 2. Edit a page
31
+
32
+ Open any `.mdx` file and start writing. MDX supports standard Markdown plus Jamdesk components.
33
+
34
+ ```mdx
35
+ ---
36
+ title: My Page
37
+ description: A brief description for SEO
38
+ ---
39
+
40
+ # Heading
41
+
42
+ Regular markdown works — **bold**, *italic*, `code`, [links](https://example.com).
43
+
44
+ <Tip>
45
+ Jamdesk components like this Tip drop in without imports.
46
+ </Tip>
47
+ ```
48
+
49
+ ## 3. Add a new page
50
+
51
+ <Steps>
52
+ <Step title="Create an MDX file">
53
+ Add a new `.mdx` file anywhere in your project, for example `guides/deployment.mdx`.
54
+ </Step>
55
+ <Step title="Add it to navigation">
56
+ Open `docs.json` and add the page path to the `navigation` section:
57
+
58
+ ```json
59
+ {
60
+ "group": "Guides",
61
+ "pages": ["guides/deployment"]
62
+ }
63
+ ```
64
+ </Step>
65
+ </Steps>
66
+
67
+ ## 4. Customize your site
68
+
69
+ Everything is configured in `docs.json`:
70
+
71
+ | Setting | What it does |
72
+ |---------|-------------|
73
+ | `name` | Site name shown in the header |
74
+ | `colors` | Primary, light, and dark accent colors |
75
+ | `logo` | Light and dark mode logo images |
76
+ | `theme` | Visual theme (`jam`, `nebula`, or `pulsar`) |
77
+ | `navigation` | Sidebar tabs, groups, and page order |
78
+ | `navbar` | Top navigation links and buttons |
79
+
80
+ <Tip>
81
+ See the full configuration reference at [jamdesk.com/docs/config/docs-json-reference](https://jamdesk.com/docs/config/docs-json-reference).
82
+ </Tip>
83
+
84
+ ## 5. Connect GitHub for auto-deploy
85
+
86
+ Once your docs look right locally, hand off building and hosting to Jamdesk:
87
+
88
+ <Steps>
89
+ <Step title="Push your code to GitHub">
90
+ Create a repository and push your project.
91
+ </Step>
92
+ <Step title="Connect on the dashboard">
93
+ Sign in at [dashboard.jamdesk.com](https://dashboard.jamdesk.com), create a project, and connect your repository.
94
+ </Step>
95
+ <Step title="Push changes">
96
+ Every push triggers an automatic build. Your site is live in seconds at `<slug>.jamdesk.app` or your custom domain.
97
+ </Step>
98
+ </Steps>
99
+
100
+ ## What's next
101
+
102
+ <Columns cols={2}>
103
+ <Card title="Components" icon="puzzle-piece" href="/components/cards">
104
+ Cards, callouts, tabs, steps, and more — all ready to use.
105
+ </Card>
106
+ <Card title="API Pages" icon="plug" href="/api-reference/openapi-example">
107
+ Render endpoint pages from an OpenAPI spec, or hand-author with components.
108
+ </Card>
109
+ </Columns>
@@ -0,0 +1,80 @@
1
+ ---
2
+ title: Code Blocks
3
+ description: "Fenced code blocks with automatic syntax highlighting, optional file titles, and CodeGroup for multi-language examples side by side."
4
+ ---
5
+
6
+ Fenced code blocks are automatically syntax-highlighted.
7
+
8
+ ## Basic code block
9
+
10
+ ```javascript
11
+ function greet(name) {
12
+ return `Hello, ${name}!`;
13
+ }
14
+ ```
15
+
16
+ Add a language identifier after the opening fence for syntax highlighting:
17
+
18
+ ````mdx
19
+ ```javascript
20
+ function greet(name) {
21
+ return `Hello, ${name}!`;
22
+ }
23
+ ```
24
+ ````
25
+
26
+ ## With title
27
+
28
+ Add a title after the language:
29
+
30
+ ```javascript server.js
31
+ const express = require('express');
32
+ const app = express();
33
+
34
+ app.get('/', (req, res) => {
35
+ res.send('Hello World');
36
+ });
37
+
38
+ app.listen(3000);
39
+ ```
40
+
41
+ ````mdx
42
+ ```javascript server.js
43
+ const express = require('express');
44
+ const app = express();
45
+ app.listen(3000);
46
+ ```
47
+ ````
48
+
49
+ ## Code groups
50
+
51
+ Show the same example in multiple languages:
52
+
53
+ <CodeGroup>
54
+ ```javascript Node.js
55
+ const response = await fetch('https://api.example.com/data');
56
+ const data = await response.json();
57
+ ```
58
+
59
+ ```python Python
60
+ import requests
61
+ response = requests.get('https://api.example.com/data')
62
+ data = response.json()
63
+ ```
64
+
65
+ ```bash cURL
66
+ curl -X GET https://api.example.com/data
67
+ ```
68
+ </CodeGroup>
69
+
70
+ ````mdx
71
+ <CodeGroup>
72
+ ```javascript Node.js
73
+ const response = await fetch('https://api.example.com/data');
74
+ ```
75
+
76
+ ```python Python
77
+ response = requests.get('https://api.example.com/data')
78
+ ```
79
+ </CodeGroup>
80
+ ````
@@ -0,0 +1,78 @@
1
+ ---
2
+ title: Components
3
+ description: "Choose the right component for the job — when to use Cards, Callouts, Tabs, Steps, and more. Live examples for every component live in the Components tab."
4
+ ---
5
+
6
+ Jamdesk's MDX components are available in every page — no imports needed. This guide helps you pick the right one. For live examples of every component, see the **Components** tab in the sidebar.
7
+
8
+ ## Highlighting information
9
+
10
+ <Note>
11
+ **Note** — Helpful context that enhances understanding.
12
+ </Note>
13
+
14
+ <Info>
15
+ **Info** — Neutral facts or supplementary details.
16
+ </Info>
17
+
18
+ <Tip>
19
+ **Tip** — Best practices and "pro tips."
20
+ </Tip>
21
+
22
+ <Warning>
23
+ **Warning** — Important caveats or requirements.
24
+ </Warning>
25
+
26
+ <Danger>
27
+ **Danger** — Critical warnings (data loss, security).
28
+ </Danger>
29
+
30
+ <Check>
31
+ **Check** — Success confirmations.
32
+ </Check>
33
+
34
+ Use the lightest one that conveys the urgency. Reach for `Warning` and `Danger` sparingly so they keep their weight.
35
+
36
+ ## Linking to other pages
37
+
38
+ | Component | When to use |
39
+ |-----------|-------------|
40
+ | `<Card>` | A single feature or destination — title, icon, optional href. |
41
+ | `<Columns>` | A grid of cards (2, 3, or 4 columns). Wraps multiple `<Card>` children. |
42
+
43
+ ```mdx
44
+ <Columns cols={2}>
45
+ <Card title="Quickstart" icon="rocket" href="/quickstart">
46
+ Get up and running in minutes.
47
+ </Card>
48
+ <Card title="Components" icon="puzzle-piece" href="/components/cards">
49
+ See every built-in component.
50
+ </Card>
51
+ </Columns>
52
+ ```
53
+
54
+ ## Showing alternatives or steps
55
+
56
+ | Component | When to use |
57
+ |-----------|-------------|
58
+ | `<Tabs>` + `<Tab>` | Equal alternatives the reader chooses between (languages, platforms, OSes). |
59
+ | `<AccordionGroup>` + `<Accordion>` | Collapsed-by-default details (FAQs, advanced options). |
60
+ | `<Steps>` + `<Step>` | A linear sequence the reader walks through in order. |
61
+ | `<CodeGroup>` | Multi-language code blocks side by side with shared tab strip. |
62
+
63
+ If readers do all the work, use `<Steps>`. If they pick one path, use `<Tabs>`. If most readers skip it, use `<AccordionGroup>`.
64
+
65
+ ## Documenting APIs
66
+
67
+ | Component | When to use |
68
+ |-----------|-------------|
69
+ | `<ParamField>` | A request parameter (path, query, header, body). |
70
+ | `<ResponseField>` | A response field. |
71
+ | `<RequestExample>` | The request code samples panel. |
72
+ | `<ResponseExample>` | The response payload(s) panel. |
73
+
74
+ See the **API Pages** group for working examples.
75
+
76
+ <Tip>
77
+ For the full component reference (every prop, every variant) see [jamdesk.com/docs/components/overview](https://jamdesk.com/docs/components/overview).
78
+ </Tip>
@@ -0,0 +1,59 @@
1
+ ---
2
+ title: Pages
3
+ description: "How MDX files become pages, how frontmatter sets titles and descriptions, and how file paths map to URLs in your documentation site."
4
+ ---
5
+
6
+ Every `.mdx` file in your project becomes a page. The file path determines the URL.
7
+
8
+ ## Frontmatter
9
+
10
+ Each page starts with frontmatter — metadata between `---` fences:
11
+
12
+ ```mdx
13
+ ---
14
+ title: My Page Title
15
+ description: A short description for search engines
16
+ ---
17
+
18
+ Your content starts here.
19
+ ```
20
+
21
+ | Field | Required | Description |
22
+ |-------|----------|-------------|
23
+ | `title` | Yes | Page title shown in the browser tab and sidebar |
24
+ | `description` | No | Meta description for SEO |
25
+
26
+ ## File organization
27
+
28
+ Your file structure maps directly to URLs:
29
+
30
+ ```
31
+ introduction.mdx → /introduction
32
+ quickstart.mdx → /quickstart
33
+ guides/deployment.mdx → /guides/deployment
34
+ api/users/list.mdx → /api/users/list
35
+ ```
36
+
37
+ ## Markdown features
38
+
39
+ MDX supports all standard Markdown:
40
+
41
+ - **Bold**, *italic*, `inline code`, and [links](https://jamdesk.com).
42
+ - Ordered and unordered lists (you're reading one).
43
+ - Fenced code blocks with syntax highlighting.
44
+ - Tables, blockquotes, and headings (`##`, `###`, `####`).
45
+
46
+ Lists, tables, and blockquotes render natively:
47
+
48
+ | Format | Markdown | Renders as |
49
+ |--------|----------|-----------|
50
+ | Bold | `**bold**` | **bold** |
51
+ | Italic | `*italic*` | *italic* |
52
+ | Code | `` `code` `` | `code` |
53
+ | Link | `[text](url)` | [text](https://jamdesk.com) |
54
+
55
+ > Blockquotes pull a passage out of the flow. Use them sparingly.
56
+
57
+ <Note>
58
+ Headings on the page automatically appear in the right sidebar as a table of contents.
59
+ </Note>