@stainless-api/docs 0.1.0-beta.3 → 0.1.0-beta.31

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 (102) hide show
  1. package/CHANGELOG.md +222 -0
  2. package/components/variables.css +1 -27
  3. package/eslint-suppressions.json +47 -0
  4. package/locals.d.ts +14 -0
  5. package/package.json +30 -27
  6. package/plugin/buildAlgoliaIndex.ts +29 -4
  7. package/plugin/cms/server.ts +97 -54
  8. package/plugin/cms/sidebar-builder.ts +6 -25
  9. package/plugin/cms/worker.ts +2 -2
  10. package/plugin/components/SnippetCode.tsx +7 -4
  11. package/plugin/components/search/SearchAlgolia.astro +0 -7
  12. package/plugin/components/search/SearchIsland.tsx +30 -17
  13. package/plugin/generateAPIReferenceLink.ts +1 -1
  14. package/plugin/globalJs/ai-dropdown-options.ts +233 -0
  15. package/plugin/globalJs/navigation.ts +0 -23
  16. package/plugin/helpers/getPageLoadEvent.ts +1 -1
  17. package/plugin/index.ts +48 -18
  18. package/plugin/languages.ts +1 -1
  19. package/plugin/loadPluginConfig.ts +100 -13
  20. package/plugin/react/Routing.tsx +30 -33
  21. package/plugin/referencePlaceholderUtils.ts +1 -1
  22. package/plugin/replaceSidebarPlaceholderMiddleware.ts +4 -0
  23. package/plugin/routes/Docs.astro +59 -85
  24. package/plugin/routes/Overview.astro +9 -15
  25. package/plugin/routes/markdown.ts +3 -3
  26. package/plugin/vendor/preview.worker.docs.js +7566 -6784
  27. package/resolveSrcFile.ts +10 -0
  28. package/shared/getSharedLogger.ts +15 -0
  29. package/shared/terminalUtils.ts +3 -0
  30. package/src/content.config.ts +9 -0
  31. package/stl-docs/components/AIDropdown.tsx +63 -0
  32. package/stl-docs/components/Head.astro +16 -0
  33. package/stl-docs/components/Header.astro +3 -2
  34. package/stl-docs/components/PageTitle.astro +64 -0
  35. package/stl-docs/components/TableOfContents.astro +34 -0
  36. package/stl-docs/components/ThemeSelect.astro +4 -2
  37. package/stl-docs/components/content-panel/ContentPanel.astro +9 -39
  38. package/stl-docs/components/headers/DefaultHeader.astro +1 -1
  39. package/stl-docs/components/headers/HeaderLinks.astro +1 -1
  40. package/stl-docs/components/headers/StackedHeader.astro +29 -24
  41. package/stl-docs/components/icons/chat-gpt.tsx +17 -0
  42. package/stl-docs/components/icons/claude.tsx +10 -0
  43. package/stl-docs/components/icons/cursor.tsx +46 -0
  44. package/stl-docs/components/icons/gemini.tsx +30 -0
  45. package/stl-docs/components/icons/markdown.tsx +10 -0
  46. package/stl-docs/components/index.ts +2 -0
  47. package/stl-docs/components/mintlify-compat/Accordion.astro +7 -38
  48. package/stl-docs/components/mintlify-compat/AccordionGroup.astro +9 -23
  49. package/stl-docs/components/mintlify-compat/Columns.astro +40 -42
  50. package/stl-docs/components/mintlify-compat/Frame.astro +16 -18
  51. package/stl-docs/components/mintlify-compat/Step.astro +30 -32
  52. package/stl-docs/components/mintlify-compat/Steps.astro +8 -10
  53. package/stl-docs/components/mintlify-compat/callouts/Callout.astro +10 -3
  54. package/stl-docs/components/mintlify-compat/callouts/Check.astro +7 -3
  55. package/stl-docs/components/mintlify-compat/callouts/Danger.astro +7 -3
  56. package/stl-docs/components/mintlify-compat/callouts/Info.astro +7 -3
  57. package/stl-docs/components/mintlify-compat/callouts/Note.astro +7 -3
  58. package/stl-docs/components/mintlify-compat/callouts/Tip.astro +7 -3
  59. package/stl-docs/components/mintlify-compat/callouts/Warning.astro +7 -3
  60. package/stl-docs/components/mintlify-compat/card.css +33 -35
  61. package/stl-docs/components/nav-tabs/NavDropdown.astro +1 -1
  62. package/stl-docs/components/nav-tabs/SecondaryNavTabs.astro +15 -7
  63. package/stl-docs/components/nav-tabs/buildNavLinks.ts +4 -3
  64. package/stl-docs/components/pagination/HomeLink.astro +10 -0
  65. package/stl-docs/components/pagination/Pagination.astro +173 -0
  66. package/stl-docs/components/pagination/PaginationLinkEmphasized.astro +22 -0
  67. package/stl-docs/components/pagination/PaginationLinkQuiet.astro +13 -0
  68. package/stl-docs/components/pagination/util.ts +71 -0
  69. package/stl-docs/components/{Sidebar.astro → sidebars/BaseSidebar.astro} +2 -3
  70. package/stl-docs/components/sidebars/SDKSelectSidebar.astro +8 -0
  71. package/stl-docs/disableCalloutSyntax.ts +36 -0
  72. package/stl-docs/index.ts +76 -26
  73. package/stl-docs/loadStlDocsConfig.ts +25 -3
  74. package/stl-docs/proseMarkdown/proseMarkdownIntegration.ts +64 -0
  75. package/stl-docs/proseMarkdown/proseMarkdownMiddleware.ts +34 -0
  76. package/stl-docs/proseMarkdown/toMarkdown.ts +158 -0
  77. package/stl-docs/tabsMiddleware.ts +12 -4
  78. package/styles/code.css +115 -127
  79. package/styles/fonts.css +32 -17
  80. package/styles/links.css +10 -49
  81. package/styles/overrides.css +54 -57
  82. package/styles/page.css +89 -59
  83. package/styles/sdk_select.css +6 -7
  84. package/styles/search.css +65 -67
  85. package/styles/sidebar.css +199 -128
  86. package/styles/toc.css +37 -33
  87. package/theme.css +9 -1
  88. package/tsconfig.json +2 -5
  89. package/virtual-module.d.ts +5 -1
  90. package/plugin/globalJs/ai-dropdown.ts +0 -57
  91. package/stl-docs/components/APIReferenceAIDropdown.tsx +0 -86
  92. package/stl-docs/components/content-panel/ProseAIDropdown.tsx +0 -64
  93. /package/{plugin/assets → assets}/fonts/geist/OFL.txt +0 -0
  94. /package/{plugin/assets → assets}/fonts/geist/geist-italic-latin-ext.woff2 +0 -0
  95. /package/{plugin/assets → assets}/fonts/geist/geist-italic-latin.woff2 +0 -0
  96. /package/{plugin/assets → assets}/fonts/geist/geist-latin-ext.woff2 +0 -0
  97. /package/{plugin/assets → assets}/fonts/geist/geist-latin.woff2 +0 -0
  98. /package/{plugin/assets → assets}/fonts/geist/geist-mono-italic-latin-ext.woff2 +0 -0
  99. /package/{plugin/assets → assets}/fonts/geist/geist-mono-italic-latin.woff2 +0 -0
  100. /package/{plugin/assets → assets}/fonts/geist/geist-mono-latin-ext.woff2 +0 -0
  101. /package/{plugin/assets → assets}/fonts/geist/geist-mono-latin.woff2 +0 -0
  102. /package/stl-docs/components/{content-panel/ContentBreadcrumbs.tsx → ContentBreadcrumbs.tsx} +0 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,227 @@
1
1
  # @stainless-api/docs
2
2
 
3
+ ## 0.1.0-beta.31
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [afd1f8e]
8
+ - Updated dependencies [279fa0e]
9
+ - @stainless-api/docs-ui@0.1.0-beta.25
10
+
11
+ ## 0.1.0-beta.30
12
+
13
+ ### Patch Changes
14
+
15
+ - Updated dependencies [ab570bc]
16
+ - @stainless-api/docs-ui@0.1.0-beta.24
17
+
18
+ ## 0.1.0-beta.29
19
+
20
+ ### Patch Changes
21
+
22
+ - Updated dependencies [279fa0e]
23
+ - @stainless-api/docs-ui@0.1.0-beta.23
24
+
25
+ ## 0.1.0-beta.28
26
+
27
+ ### Minor Changes
28
+
29
+ - c635741: Updated worker and fixed docs-ui jsx issue
30
+
31
+ ### Patch Changes
32
+
33
+ - Updated dependencies [c635741]
34
+ - @stainless-api/docs-ui@0.1.0-beta.22
35
+ - @stainless-api/ui-primitives@0.1.0-beta.18
36
+
37
+ ## 0.1.0-beta.27
38
+
39
+ ### Patch Changes
40
+
41
+ - de189ee: remove max width on site title
42
+
43
+ ## 0.1.0-beta.26
44
+
45
+ ### Patch Changes
46
+
47
+ - 1517484: fixing font loading, updating nav bar height
48
+ - Updated dependencies [1517484]
49
+ - @stainless-api/docs-ui@0.1.0-beta.21
50
+ - @stainless-api/ui-primitives@0.1.0-beta.17
51
+
52
+ ## 0.1.0-beta.25
53
+
54
+ ### Patch Changes
55
+
56
+ - Updated dependencies [b9ce1b6]
57
+ - @stainless-api/docs-ui@0.1.0-beta.20
58
+
59
+ ## 0.1.0-beta.24
60
+
61
+ ### Patch Changes
62
+
63
+ - Updated dependencies [402222a]
64
+ - @stainless-api/docs-ui@0.1.0-beta.19
65
+
66
+ ## 0.1.0-beta.23
67
+
68
+ ### Patch Changes
69
+
70
+ - Updated dependencies [2150eee]
71
+ - @stainless-api/docs-ui@0.1.0-beta.18
72
+
73
+ ## 0.1.0-beta.22
74
+
75
+ ### Patch Changes
76
+
77
+ - Updated dependencies [f7ba067]
78
+ - @stainless-api/docs-ui@0.1.0-beta.17
79
+
80
+ ## 0.1.0-beta.21
81
+
82
+ ### Patch Changes
83
+
84
+ - 41e87cb: fix virtual module imports
85
+
86
+ ## 0.1.0-beta.20
87
+
88
+ ### Patch Changes
89
+
90
+ - 9cdb24d: Update pagination components, fix search modal
91
+ - Updated dependencies [9cdb24d]
92
+ - @stainless-api/docs-ui@0.1.0-beta.16
93
+ - @stainless-api/ui-primitives@0.1.0-beta.16
94
+
95
+ ## 0.1.0-beta.19
96
+
97
+ ### Patch Changes
98
+
99
+ - 15c003d: fix react peer dependencies
100
+ - Updated dependencies [15c003d]
101
+ - @stainless-api/docs-ui@0.1.0-beta.15
102
+ - @stainless-api/ui-primitives@0.1.0-beta.15
103
+
104
+ ## 0.1.0-beta.18
105
+
106
+ ### Patch Changes
107
+
108
+ - Updated dependencies [0572f60]
109
+ - @stainless-api/docs-ui@0.1.0-beta.14
110
+
111
+ ## 0.1.0-beta.17
112
+
113
+ ### Patch Changes
114
+
115
+ - a925bb4: fix markdown icon color in dark mode
116
+
117
+ ## 0.1.0-beta.16
118
+
119
+ ### Patch Changes
120
+
121
+ - 0618d05: Markdown rendering of prose pages, ai context menu, auth via cli, minor fixes
122
+ - Updated dependencies [0618d05]
123
+ - @stainless-api/docs-ui@0.1.0-beta.13
124
+ - @stainless-api/ui-primitives@0.1.0-beta.14
125
+
126
+ ## 0.1.0-beta.15
127
+
128
+ ### Patch Changes
129
+
130
+ - e35360f: include ui-primitive packages
131
+ - Updated dependencies [e35360f]
132
+ - @stainless-api/docs-ui@0.1.0-beta.12
133
+ - @stainless-api/ui-primitives@0.1.0-beta.13
134
+
135
+ ## 0.1.0-beta.14
136
+
137
+ ### Patch Changes
138
+
139
+ - a529fd4: fix: site title height
140
+ - Updated dependencies [a529fd4]
141
+ - @stainless-api/docs-ui@0.1.0-beta.11
142
+ - @stainless-api/ui-primitives@0.1.0-beta.12
143
+
144
+ ## 0.1.0-beta.13
145
+
146
+ ### Patch Changes
147
+
148
+ - 26a4786: fix: include missing starlight config options
149
+ - Updated dependencies [26a4786]
150
+ - @stainless-api/docs-ui@0.1.0-beta.10
151
+ - @stainless-api/ui-primitives@0.1.0-beta.11
152
+
153
+ ## 0.1.0-beta.12
154
+
155
+ ### Patch Changes
156
+
157
+ - Updated dependencies [3e44a9c]
158
+ - @stainless-api/ui-primitives@0.1.0-beta.10
159
+ - @stainless-api/docs-ui@0.1.0-beta.9
160
+
161
+ ## 0.1.0-beta.11
162
+
163
+ ### Patch Changes
164
+
165
+ - c96f895: Remove css layers, update sidebar styles, add new prose elements
166
+ - Updated dependencies [c96f895]
167
+ - @stainless-api/docs-ui@0.1.0-beta.8
168
+ - @stainless-api/ui-primitives@0.1.0-beta.9
169
+
170
+ ## 0.1.0-beta.10
171
+
172
+ ### Patch Changes
173
+
174
+ - dc059d2: should include option in stl-docs virtual module
175
+
176
+ ## 0.1.0-beta.9
177
+
178
+ ### Patch Changes
179
+
180
+ - d15a520: fix initialization of dropdown buttons
181
+ - Updated dependencies [d15a520]
182
+ - @stainless-api/ui-primitives@0.1.0-beta.8
183
+ - @stainless-api/docs-ui@0.1.0-beta.7
184
+
185
+ ## 0.1.0-beta.8
186
+
187
+ ### Minor Changes
188
+
189
+ - 917493d: move stainlessDocs into default export
190
+
191
+ ## 0.1.0-beta.7
192
+
193
+ ### Patch Changes
194
+
195
+ - Updated dependencies [34e7c61]
196
+ - @stainless-api/ui-primitives@0.1.0-beta.7
197
+ - @stainless-api/docs-ui@0.1.0-beta.6
198
+
199
+ ## 0.1.0-beta.6
200
+
201
+ ### Patch Changes
202
+
203
+ - 34cbd12: verify publishing
204
+ - Updated dependencies [f664b4d]
205
+ - Updated dependencies [34cbd12]
206
+ - @stainless-api/ui-primitives@0.1.0-beta.6
207
+ - @stainless-api/docs-ui@0.1.0-beta.5
208
+
209
+ ## 0.1.0-beta.5
210
+
211
+ ### Patch Changes
212
+
213
+ - Updated dependencies [e7a2a96]
214
+ - @stainless-api/ui-primitives@0.1.0-beta.5
215
+ - @stainless-api/docs-ui@0.1.0-beta.4
216
+
217
+ ## 0.1.0-beta.4
218
+
219
+ ### Patch Changes
220
+
221
+ - Updated dependencies [2853ae8]
222
+ - @stainless-api/ui-primitives@0.1.0-beta.4
223
+ - @stainless-api/docs-ui@0.1.0-beta.3
224
+
3
225
  ## 0.1.0-beta.3
4
226
 
5
227
  ### Patch Changes
@@ -1,7 +1,4 @@
1
1
  :root {
2
- --sl-font: 'Geist', system-ui, sans-serif;
3
- --sl-font-mono: 'Geist Mono', ui-monospace, monospace;
4
-
5
2
  --stldocs-font: var(--sl-font, system-ui, sans-serif);
6
3
  --stldocs-font-mono: var(--sl-font-mono, ui-monospace, monospace);
7
4
 
@@ -28,6 +25,7 @@
28
25
 
29
26
  --stldocs-color-bg: var(--sl-color-bg);
30
27
  --stldocs-color-bg-nav: var(--sl-color-bg-nav);
28
+ --stldocs-color-selected: var(--sl-color-gray-6);
31
29
  --stldocs-color-bg-ui: var(--sl-color-bg-ui);
32
30
 
33
31
  --stldocs-color-bg-inline-code: var(--sl-color-bg-inline-code);
@@ -74,30 +72,6 @@
74
72
  --stldocs-expander-right-margin: 8px;
75
73
  --stldocs-font-size-body: 14px;
76
74
  --stldocs-font-size-body-xs: 12px;
77
-
78
- /* UI Overrides */
79
- --stl-ui-button-border-radius: var(--sl-button-border-radius);
80
- --stl-ui-text-body: var(--sl-text-sm);
81
- --stl-ui-font-family: var(--sl-font);
82
- --stl-ui-button-size: var(--sl-button-size);
83
-
84
- --stl-ui-color-accent-low: var(--sl-color-accent-low);
85
- --stl-ui-color-accent: var(--sl-color-accent);
86
- --stl-ui-color-accent-high: var(--sl-color-accent-high);
87
-
88
- --stl-ui-color-text: var(--sl-color-text);
89
- --stl-ui-color-text-secondary: var(--sl-color-text-secondary);
90
- --stl-ui-color-text-tertiary: var(--sl-color-text-tertiary);
91
- --stl-ui-color-text-invert: var(--sl-color-text-invert);
92
- --stl-ui-color-text-accent: var(--sl-color-text-accent);
93
-
94
- --stl-ui-color-bg: var(--sl-color-bg);
95
- --stl-ui-color-bg-ui: var(--sl-color-bg-ui);
96
- --stl-ui-color-bg-inline-code: var(--sl-color-bg-inline-code);
97
-
98
- --stl-ui-color-hairline-light: var(--sl-color-hairline-light);
99
- --stl-ui-color-hairline: var(--sl-color-hairline);
100
- --stl-ui-color-hairline-shade: var(--sl-color-hairline-shade);
101
75
  }
102
76
 
103
77
  /* These are the theme overrides - we need to come up with a good way to do this in starlight */
@@ -0,0 +1,47 @@
1
+ {
2
+ "plugin/buildAlgoliaIndex.ts": {
3
+ "@typescript-eslint/no-explicit-any": {
4
+ "count": 2
5
+ }
6
+ },
7
+ "plugin/cms/client.ts": {
8
+ "@typescript-eslint/no-explicit-any": {
9
+ "count": 1
10
+ }
11
+ },
12
+ "plugin/cms/server.ts": {
13
+ "@typescript-eslint/no-explicit-any": {
14
+ "count": 4
15
+ }
16
+ },
17
+ "plugin/cms/sidebar-builder.ts": {
18
+ "@typescript-eslint/no-explicit-any": {
19
+ "count": 1
20
+ }
21
+ },
22
+ "plugin/cms/worker.ts": {
23
+ "@typescript-eslint/no-explicit-any": {
24
+ "count": 4
25
+ }
26
+ },
27
+ "plugin/components/SnippetCode.tsx": {
28
+ "@typescript-eslint/no-explicit-any": {
29
+ "count": 1
30
+ }
31
+ },
32
+ "plugin/index.ts": {
33
+ "@typescript-eslint/no-explicit-any": {
34
+ "count": 1
35
+ }
36
+ },
37
+ "plugin/languages.ts": {
38
+ "@typescript-eslint/no-explicit-any": {
39
+ "count": 1
40
+ }
41
+ },
42
+ "shared/virtualModule.ts": {
43
+ "@typescript-eslint/no-explicit-any": {
44
+ "count": 1
45
+ }
46
+ }
47
+ }
package/locals.d.ts ADDED
@@ -0,0 +1,14 @@
1
+ type SidebarEntry = App.Locals['starlightRoute']['sidebar'][number];
2
+
3
+ /**
4
+ * Extending Astro’s `App.Locals` interface
5
+ */
6
+ declare namespace App {
7
+ interface Locals {
8
+ _stlStarlightPage?: {
9
+ skipRenderingStarlightTitle?: boolean;
10
+ hasMarkdownRoute?: boolean;
11
+ fullSidebar?: SidebarEntry[];
12
+ };
13
+ }
14
+ }
package/package.json CHANGED
@@ -1,31 +1,20 @@
1
1
  {
2
2
  "name": "@stainless-api/docs",
3
- "version": "0.1.0-beta.3",
3
+ "version": "0.1.0-beta.31",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
7
7
  "description": "",
8
8
  "type": "module",
9
9
  "exports": {
10
+ ".": "./stl-docs/index.ts",
10
11
  "./plugin": "./plugin/index.ts",
11
- "./OverviewRoute": "./plugin/routes/Overview.astro",
12
- "./DocsRoute": "./plugin/routes/Docs.astro",
13
- "./DocsStaticRoute": "./plugin/routes/DocsStatic.astro",
14
- "./MarkdownRoute": "./plugin/routes/markdown.ts",
15
- "./Search": "./plugin/components/search/Search.astro",
16
- "./replaceSidebarPlaceholderMiddleware": "./plugin/replaceSidebarPlaceholderMiddleware.ts",
17
12
  "./plugin/middleware": "./plugin/middlewareBuilder/stlStarlightMiddleware.ts",
18
13
  "./plugin/MiddlewareTypes": "./plugin/middlewareBuilder/stainlessMiddleware.d.ts",
19
- "./stainless-docs": "./stl-docs/index.ts",
20
- "./Header": "./stl-docs/components/Header.astro",
21
- "./ThemeSelect": "./stl-docs/components/ThemeSelect.astro",
22
- "./Sidebar": "./stl-docs/components/Sidebar.astro",
23
- "./ContentPanel": "./stl-docs/components/content-panel/ContentPanel.astro",
24
- "./tabsMiddleware": "./stl-docs/tabsMiddleware.ts",
25
14
  "./stainless-docs/mintlify-compat": "./stl-docs/components/mintlify-compat/index.ts",
26
- "./theme": "./theme.css",
27
15
  "./mintlify-compat.css": "./styles/mintlify-compat.css",
28
- "./font-imports": "./styles/fonts.css"
16
+ "./font-imports": "./styles/fonts.css",
17
+ "./components": "./stl-docs/components/index.ts"
29
18
  },
30
19
  "keywords": [],
31
20
  "author": "",
@@ -34,41 +23,55 @@
34
23
  "node": ">=18.17.1"
35
24
  },
36
25
  "peerDependencies": {
37
- "@astrojs/starlight": ">=0.34.0",
38
- "astro": ">=5.5.0"
26
+ "@astrojs/starlight": ">=0.36.1",
27
+ "astro": ">=5.15.3",
28
+ "vite": ">=6.2.1",
29
+ "react": ">=19.0.0",
30
+ "react-dom": ">=19.0.0"
39
31
  },
40
32
  "dependencies": {
41
33
  "@astrojs/markdown-remark": "^6.3.2",
42
- "@astrojs/react": "^4.3.1",
34
+ "@astrojs/react": "^4.4.1",
43
35
  "@stainless-api/sdk": "0.1.0-alpha.12",
44
36
  "cheerio": "^1.1.2",
45
37
  "clsx": "^2.1.1",
46
- "dotenv": "17.2.2",
38
+ "dotenv": "17.2.3",
47
39
  "get-port": "^7.1.0",
48
40
  "highlight.js": "^11.11.1",
49
41
  "lucide-react": "^0.544.0",
50
42
  "marked": "^16.0.0",
51
- "react": "^19.1.1",
52
- "react-dom": "^19.1.1",
53
43
  "remark-github-alerts": "^0.1.1",
54
44
  "shiki": "^3.9.2",
55
45
  "web-worker": "^1.5.0",
56
46
  "yaml": "^2.8.0",
57
- "@stainless-api/ui-primitives": "0.1.0-beta.3",
58
- "@stainless-api/docs-ui": "0.1.0-beta.2"
47
+ "node-html-parser": "^7.0.1",
48
+ "rehype-parse": "^9.0.1",
49
+ "rehype-remark": "^10.0.1",
50
+ "remark-gfm": "^4.0.1",
51
+ "remark-stringify": "^11.0.0",
52
+ "unified": "^11.0.5",
53
+ "@stainless-api/docs-ui": "0.1.0-beta.25",
54
+ "@stainless-api/ui-primitives": "0.1.0-beta.18"
59
55
  },
60
56
  "devDependencies": {
57
+ "@astrojs/check": "^0.9.5",
61
58
  "@markdoc/markdoc": "^0.5.2",
62
59
  "@types/node": "^24.4.0",
63
- "@types/react": "^19.1.13",
64
- "@types/react-dom": "^19.1.9",
60
+ "@types/react": "^19.2.2",
61
+ "@types/react-dom": "^19.2.2",
62
+ "react": "^19.2.0",
63
+ "react-dom": "^19.2.0",
65
64
  "tsx": "^4.20.3",
65
+ "typescript": "5.9.3",
66
+ "vite": "^6.3.6",
66
67
  "zod": "^4.0.0",
67
- "@stainless/eslint-config": "0.0.0"
68
+ "@stainless/eslint-config": "0.1.0-beta.0",
69
+ "@stainless/sdk-json": "^0.1.0-beta.0"
68
70
  },
69
71
  "scripts": {
70
72
  "vendor-deps": "pnpm tsx scripts/vendor_deps.ts",
71
73
  "lint": "eslint . --max-warnings 0",
72
- "sync": "astro sync"
74
+ "sync": "astro sync",
75
+ "check:types": "astro check"
73
76
  }
74
77
  }
@@ -1,10 +1,11 @@
1
1
  import Markdoc from '@markdoc/markdoc';
2
2
  import Stainless from '@stainless-api/sdk';
3
3
  import { createSDKJSON, parseInputs, transformOAS } from './cms/worker';
4
- import type * as SDKJSON from '~/lib/json-spec-v2/types';
4
+ import type * as SDKJSON from '@stainless/sdk-json';
5
5
  import { Languages } from '@stainless-api/docs-ui/src/routing';
6
6
  import { buildIndex } from '@stainless-api/docs-ui/src/search/providers/algolia';
7
7
  import type { VersionUserConfig } from './loadPluginConfig';
8
+ import type { AstroIntegrationLogger } from 'astro';
8
9
 
9
10
  const markdocConfig = {
10
11
  nodes: {
@@ -20,7 +21,31 @@ function renderMarkdown(content?: string) {
20
21
  return Markdoc.renderers.html(transformed);
21
22
  }
22
23
 
23
- export async function buildAlgoliaIndex({ version, apiKey }: { version: VersionUserConfig; apiKey: string }) {
24
+ export async function buildAlgoliaIndex({
25
+ version,
26
+ apiKey,
27
+ logger,
28
+ }: {
29
+ version: VersionUserConfig;
30
+ apiKey: string;
31
+ logger?: AstroIntegrationLogger;
32
+ }) {
33
+ function warnLog(message: string) {
34
+ if (logger) {
35
+ logger.warn(message);
36
+ } else {
37
+ console.warn(message);
38
+ }
39
+ }
40
+
41
+ function infoLog(message: string) {
42
+ if (logger) {
43
+ logger.info(message);
44
+ } else {
45
+ console.log(message);
46
+ }
47
+ }
48
+
24
49
  const client = new Stainless({ apiKey });
25
50
  const configs = await client.projects.configs.retrieve({
26
51
  project: version.stainlessProject,
@@ -64,9 +89,9 @@ export async function buildAlgoliaIndex({ version, apiKey }: { version: VersionU
64
89
  !indexName && 'PUBLIC_ALGOLIA_INDEX',
65
90
  !algoliaWriteKey && 'PRIVATE_ALGOLIA_WRITE_KEY',
66
91
  ].filter(Boolean);
67
- console.warn(`⚠️ Skipping Algolia indexing due to missing environment variables: ${missing.join(', ')}`);
92
+ warnLog(`Skipping Algolia indexing due to missing environment variables: ${missing.join(', ')}`);
68
93
  return;
69
94
  }
70
95
  await buildIndex(appId, indexName, algoliaWriteKey, sdkJson, renderMarkdown);
71
- console.log('Indexing complete.');
96
+ infoLog('Indexing complete.');
72
97
  }