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

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 (100) hide show
  1. package/CHANGELOG.md +214 -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 +161 -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 +1 -1
  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 +52 -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/markdown.tsx +10 -0
  44. package/stl-docs/components/index.ts +2 -0
  45. package/stl-docs/components/mintlify-compat/Accordion.astro +7 -38
  46. package/stl-docs/components/mintlify-compat/AccordionGroup.astro +9 -23
  47. package/stl-docs/components/mintlify-compat/Columns.astro +40 -42
  48. package/stl-docs/components/mintlify-compat/Frame.astro +16 -18
  49. package/stl-docs/components/mintlify-compat/Step.astro +30 -32
  50. package/stl-docs/components/mintlify-compat/Steps.astro +8 -10
  51. package/stl-docs/components/mintlify-compat/callouts/Callout.astro +10 -3
  52. package/stl-docs/components/mintlify-compat/callouts/Check.astro +7 -3
  53. package/stl-docs/components/mintlify-compat/callouts/Danger.astro +7 -3
  54. package/stl-docs/components/mintlify-compat/callouts/Info.astro +7 -3
  55. package/stl-docs/components/mintlify-compat/callouts/Note.astro +7 -3
  56. package/stl-docs/components/mintlify-compat/callouts/Tip.astro +7 -3
  57. package/stl-docs/components/mintlify-compat/callouts/Warning.astro +7 -3
  58. package/stl-docs/components/mintlify-compat/card.css +33 -35
  59. package/stl-docs/components/nav-tabs/NavDropdown.astro +1 -1
  60. package/stl-docs/components/nav-tabs/SecondaryNavTabs.astro +15 -7
  61. package/stl-docs/components/nav-tabs/buildNavLinks.ts +4 -3
  62. package/stl-docs/components/pagination/HomeLink.astro +10 -0
  63. package/stl-docs/components/pagination/Pagination.astro +173 -0
  64. package/stl-docs/components/pagination/PaginationLinkEmphasized.astro +22 -0
  65. package/stl-docs/components/pagination/PaginationLinkQuiet.astro +13 -0
  66. package/stl-docs/components/pagination/util.ts +71 -0
  67. package/stl-docs/components/{Sidebar.astro → sidebars/BaseSidebar.astro} +2 -3
  68. package/stl-docs/components/sidebars/SDKSelectSidebar.astro +8 -0
  69. package/stl-docs/disableCalloutSyntax.ts +36 -0
  70. package/stl-docs/index.ts +76 -26
  71. package/stl-docs/loadStlDocsConfig.ts +25 -3
  72. package/stl-docs/proseMarkdown/proseMarkdownIntegration.ts +64 -0
  73. package/stl-docs/proseMarkdown/proseMarkdownMiddleware.ts +34 -0
  74. package/stl-docs/proseMarkdown/toMarkdown.ts +158 -0
  75. package/stl-docs/tabsMiddleware.ts +12 -4
  76. package/styles/code.css +115 -127
  77. package/styles/fonts.css +32 -17
  78. package/styles/links.css +10 -49
  79. package/styles/overrides.css +54 -57
  80. package/styles/page.css +89 -59
  81. package/styles/sdk_select.css +6 -7
  82. package/styles/search.css +65 -67
  83. package/styles/sidebar.css +199 -128
  84. package/styles/toc.css +37 -33
  85. package/theme.css +9 -1
  86. package/tsconfig.json +2 -5
  87. package/virtual-module.d.ts +5 -1
  88. package/plugin/globalJs/ai-dropdown.ts +0 -57
  89. package/stl-docs/components/APIReferenceAIDropdown.tsx +0 -86
  90. package/stl-docs/components/content-panel/ProseAIDropdown.tsx +0 -64
  91. /package/{plugin/assets → assets}/fonts/geist/OFL.txt +0 -0
  92. /package/{plugin/assets → assets}/fonts/geist/geist-italic-latin-ext.woff2 +0 -0
  93. /package/{plugin/assets → assets}/fonts/geist/geist-italic-latin.woff2 +0 -0
  94. /package/{plugin/assets → assets}/fonts/geist/geist-latin-ext.woff2 +0 -0
  95. /package/{plugin/assets → assets}/fonts/geist/geist-latin.woff2 +0 -0
  96. /package/{plugin/assets → assets}/fonts/geist/geist-mono-italic-latin-ext.woff2 +0 -0
  97. /package/{plugin/assets → assets}/fonts/geist/geist-mono-italic-latin.woff2 +0 -0
  98. /package/{plugin/assets → assets}/fonts/geist/geist-mono-latin-ext.woff2 +0 -0
  99. /package/{plugin/assets → assets}/fonts/geist/geist-mono-latin.woff2 +0 -0
  100. /package/stl-docs/components/{content-panel/ContentBreadcrumbs.tsx → ContentBreadcrumbs.tsx} +0 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,219 @@
1
1
  # @stainless-api/docs
2
2
 
3
+ ## 0.1.0-beta.30
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [ab570bc]
8
+ - @stainless-api/docs-ui@0.1.0-beta.24
9
+
10
+ ## 0.1.0-beta.29
11
+
12
+ ### Patch Changes
13
+
14
+ - Updated dependencies [279fa0e]
15
+ - @stainless-api/docs-ui@0.1.0-beta.23
16
+
17
+ ## 0.1.0-beta.28
18
+
19
+ ### Minor Changes
20
+
21
+ - c635741: Updated worker and fixed docs-ui jsx issue
22
+
23
+ ### Patch Changes
24
+
25
+ - Updated dependencies [c635741]
26
+ - @stainless-api/docs-ui@0.1.0-beta.22
27
+ - @stainless-api/ui-primitives@0.1.0-beta.18
28
+
29
+ ## 0.1.0-beta.27
30
+
31
+ ### Patch Changes
32
+
33
+ - de189ee: remove max width on site title
34
+
35
+ ## 0.1.0-beta.26
36
+
37
+ ### Patch Changes
38
+
39
+ - 1517484: fixing font loading, updating nav bar height
40
+ - Updated dependencies [1517484]
41
+ - @stainless-api/docs-ui@0.1.0-beta.21
42
+ - @stainless-api/ui-primitives@0.1.0-beta.17
43
+
44
+ ## 0.1.0-beta.25
45
+
46
+ ### Patch Changes
47
+
48
+ - Updated dependencies [b9ce1b6]
49
+ - @stainless-api/docs-ui@0.1.0-beta.20
50
+
51
+ ## 0.1.0-beta.24
52
+
53
+ ### Patch Changes
54
+
55
+ - Updated dependencies [402222a]
56
+ - @stainless-api/docs-ui@0.1.0-beta.19
57
+
58
+ ## 0.1.0-beta.23
59
+
60
+ ### Patch Changes
61
+
62
+ - Updated dependencies [2150eee]
63
+ - @stainless-api/docs-ui@0.1.0-beta.18
64
+
65
+ ## 0.1.0-beta.22
66
+
67
+ ### Patch Changes
68
+
69
+ - Updated dependencies [f7ba067]
70
+ - @stainless-api/docs-ui@0.1.0-beta.17
71
+
72
+ ## 0.1.0-beta.21
73
+
74
+ ### Patch Changes
75
+
76
+ - 41e87cb: fix virtual module imports
77
+
78
+ ## 0.1.0-beta.20
79
+
80
+ ### Patch Changes
81
+
82
+ - 9cdb24d: Update pagination components, fix search modal
83
+ - Updated dependencies [9cdb24d]
84
+ - @stainless-api/docs-ui@0.1.0-beta.16
85
+ - @stainless-api/ui-primitives@0.1.0-beta.16
86
+
87
+ ## 0.1.0-beta.19
88
+
89
+ ### Patch Changes
90
+
91
+ - 15c003d: fix react peer dependencies
92
+ - Updated dependencies [15c003d]
93
+ - @stainless-api/docs-ui@0.1.0-beta.15
94
+ - @stainless-api/ui-primitives@0.1.0-beta.15
95
+
96
+ ## 0.1.0-beta.18
97
+
98
+ ### Patch Changes
99
+
100
+ - Updated dependencies [0572f60]
101
+ - @stainless-api/docs-ui@0.1.0-beta.14
102
+
103
+ ## 0.1.0-beta.17
104
+
105
+ ### Patch Changes
106
+
107
+ - a925bb4: fix markdown icon color in dark mode
108
+
109
+ ## 0.1.0-beta.16
110
+
111
+ ### Patch Changes
112
+
113
+ - 0618d05: Markdown rendering of prose pages, ai context menu, auth via cli, minor fixes
114
+ - Updated dependencies [0618d05]
115
+ - @stainless-api/docs-ui@0.1.0-beta.13
116
+ - @stainless-api/ui-primitives@0.1.0-beta.14
117
+
118
+ ## 0.1.0-beta.15
119
+
120
+ ### Patch Changes
121
+
122
+ - e35360f: include ui-primitive packages
123
+ - Updated dependencies [e35360f]
124
+ - @stainless-api/docs-ui@0.1.0-beta.12
125
+ - @stainless-api/ui-primitives@0.1.0-beta.13
126
+
127
+ ## 0.1.0-beta.14
128
+
129
+ ### Patch Changes
130
+
131
+ - a529fd4: fix: site title height
132
+ - Updated dependencies [a529fd4]
133
+ - @stainless-api/docs-ui@0.1.0-beta.11
134
+ - @stainless-api/ui-primitives@0.1.0-beta.12
135
+
136
+ ## 0.1.0-beta.13
137
+
138
+ ### Patch Changes
139
+
140
+ - 26a4786: fix: include missing starlight config options
141
+ - Updated dependencies [26a4786]
142
+ - @stainless-api/docs-ui@0.1.0-beta.10
143
+ - @stainless-api/ui-primitives@0.1.0-beta.11
144
+
145
+ ## 0.1.0-beta.12
146
+
147
+ ### Patch Changes
148
+
149
+ - Updated dependencies [3e44a9c]
150
+ - @stainless-api/ui-primitives@0.1.0-beta.10
151
+ - @stainless-api/docs-ui@0.1.0-beta.9
152
+
153
+ ## 0.1.0-beta.11
154
+
155
+ ### Patch Changes
156
+
157
+ - c96f895: Remove css layers, update sidebar styles, add new prose elements
158
+ - Updated dependencies [c96f895]
159
+ - @stainless-api/docs-ui@0.1.0-beta.8
160
+ - @stainless-api/ui-primitives@0.1.0-beta.9
161
+
162
+ ## 0.1.0-beta.10
163
+
164
+ ### Patch Changes
165
+
166
+ - dc059d2: should include option in stl-docs virtual module
167
+
168
+ ## 0.1.0-beta.9
169
+
170
+ ### Patch Changes
171
+
172
+ - d15a520: fix initialization of dropdown buttons
173
+ - Updated dependencies [d15a520]
174
+ - @stainless-api/ui-primitives@0.1.0-beta.8
175
+ - @stainless-api/docs-ui@0.1.0-beta.7
176
+
177
+ ## 0.1.0-beta.8
178
+
179
+ ### Minor Changes
180
+
181
+ - 917493d: move stainlessDocs into default export
182
+
183
+ ## 0.1.0-beta.7
184
+
185
+ ### Patch Changes
186
+
187
+ - Updated dependencies [34e7c61]
188
+ - @stainless-api/ui-primitives@0.1.0-beta.7
189
+ - @stainless-api/docs-ui@0.1.0-beta.6
190
+
191
+ ## 0.1.0-beta.6
192
+
193
+ ### Patch Changes
194
+
195
+ - 34cbd12: verify publishing
196
+ - Updated dependencies [f664b4d]
197
+ - Updated dependencies [34cbd12]
198
+ - @stainless-api/ui-primitives@0.1.0-beta.6
199
+ - @stainless-api/docs-ui@0.1.0-beta.5
200
+
201
+ ## 0.1.0-beta.5
202
+
203
+ ### Patch Changes
204
+
205
+ - Updated dependencies [e7a2a96]
206
+ - @stainless-api/ui-primitives@0.1.0-beta.5
207
+ - @stainless-api/docs-ui@0.1.0-beta.4
208
+
209
+ ## 0.1.0-beta.4
210
+
211
+ ### Patch Changes
212
+
213
+ - Updated dependencies [2853ae8]
214
+ - @stainless-api/ui-primitives@0.1.0-beta.4
215
+ - @stainless-api/docs-ui@0.1.0-beta.3
216
+
3
217
  ## 0.1.0-beta.3
4
218
 
5
219
  ### 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.30",
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.24",
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/sdk-json": "^0.1.0-beta.0",
69
+ "@stainless/eslint-config": "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
  }