@stainless-api/docs 0.1.0-beta.80 → 0.1.0-beta.82
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.
- package/CHANGELOG.md +12 -0
- package/package.json +1 -1
- package/plugin/index.ts +3 -3
- package/plugin/loadPluginConfig.ts +7 -0
- package/plugin/routes/markdown.ts +0 -2
- package/stl-docs/index.ts +10 -6
- package/stl-docs/loadStlDocsConfig.ts +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @stainless-api/docs
|
|
2
2
|
|
|
3
|
+
## 0.1.0-beta.82
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 29089a7: add experimental support for prerender flag
|
|
8
|
+
|
|
9
|
+
## 0.1.0-beta.81
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- 5c257e2: separate steelie into separate packages
|
|
14
|
+
|
|
3
15
|
## 0.1.0-beta.80
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/package.json
CHANGED
package/plugin/index.ts
CHANGED
|
@@ -208,20 +208,20 @@ async function stlStarlightAstroIntegration(
|
|
|
208
208
|
injectRoute({
|
|
209
209
|
pattern: `${pluginConfig.basePath}/[...slug]/index.md`,
|
|
210
210
|
entrypoint: resolveSrcFile('/plugin/routes/markdown.ts'),
|
|
211
|
-
prerender: command === 'build',
|
|
211
|
+
prerender: pluginConfig.experimentalPrerender ? command === 'build' : false,
|
|
212
212
|
});
|
|
213
213
|
|
|
214
214
|
const astroFile = command === 'build' ? 'DocsStatic' : 'Docs';
|
|
215
215
|
injectRoute({
|
|
216
216
|
pattern: `${pluginConfig.basePath}/[...slug]`,
|
|
217
217
|
entrypoint: resolveSrcFile(`/plugin/routes/${astroFile}.astro`),
|
|
218
|
-
prerender: command === 'build',
|
|
218
|
+
prerender: pluginConfig.experimentalPrerender ? command === 'build' : false,
|
|
219
219
|
});
|
|
220
220
|
|
|
221
221
|
injectRoute({
|
|
222
222
|
pattern: pluginConfig.basePath,
|
|
223
223
|
entrypoint: resolveSrcFile('/plugin/routes/Overview.astro'),
|
|
224
|
-
prerender: command === 'build',
|
|
224
|
+
prerender: pluginConfig.experimentalPrerender ? command === 'build' : false,
|
|
225
225
|
});
|
|
226
226
|
|
|
227
227
|
updateConfig({
|
|
@@ -140,6 +140,12 @@ export type StainlessStarlightUserConfig = {
|
|
|
140
140
|
|
|
141
141
|
/** When set to true, enables the experimental request builder interface for testing API endpoints. */
|
|
142
142
|
experimentalRequestBuilder?: boolean;
|
|
143
|
+
|
|
144
|
+
/** Whether to prerender the api reference pages.
|
|
145
|
+
*
|
|
146
|
+
* @default true
|
|
147
|
+
*/
|
|
148
|
+
experimentalPrerender?: boolean;
|
|
143
149
|
};
|
|
144
150
|
|
|
145
151
|
export type ExternalSpecServerUserConfig = Omit<StainlessStarlightUserConfig, 'stainlessProject'> & {
|
|
@@ -276,6 +282,7 @@ function normalizeConfig(partial: SomeStainlessStarlightUserConfig, command: Ast
|
|
|
276
282
|
contextMenu: partial.contextMenu ?? true,
|
|
277
283
|
experimentalPlaygrounds: partial.experimentalPlaygrounds ?? undefined,
|
|
278
284
|
experimentalRequestBuilder: partial.experimentalRequestBuilder ?? false,
|
|
285
|
+
experimentalPrerender: partial.experimentalPrerender ?? true,
|
|
279
286
|
};
|
|
280
287
|
|
|
281
288
|
function getSpecRetrieverConfig(): SpecRetrieverConfig {
|
package/stl-docs/index.ts
CHANGED
|
@@ -73,6 +73,10 @@ function stainlessDocsStarlightIntegration(config: NormalizedStainlessDocsConfig
|
|
|
73
73
|
stainlessStarlight({
|
|
74
74
|
...config.apiReference,
|
|
75
75
|
contextMenu: config.contextMenu,
|
|
76
|
+
experimentalPrerender:
|
|
77
|
+
config.apiReference.experimentalPrerender === undefined
|
|
78
|
+
? config.starlightPassThrough.prerender
|
|
79
|
+
: config.apiReference.experimentalPrerender,
|
|
76
80
|
}),
|
|
77
81
|
);
|
|
78
82
|
componentOverrides.Sidebar = resolveSrcFile(COMPONENTS_FOLDER, './sidebars/SDKSelectSidebar.astro');
|
|
@@ -208,12 +212,12 @@ function stainlessDocsIntegration(
|
|
|
208
212
|
optimizeDeps: {
|
|
209
213
|
include: config.aiChat
|
|
210
214
|
? [
|
|
211
|
-
'@stainless-api/docs-ai-chat > lucide-react',
|
|
212
|
-
'@stainless-api/docs-ai-chat > motion',
|
|
213
|
-
'@stainless-api/docs-ai-chat > motion > framer-motion',
|
|
214
|
-
'@stainless-api/docs-ai-chat > react-markdown',
|
|
215
|
-
'@stainless-api/docs-ai-chat > react-syntax-highlighter',
|
|
216
|
-
'@stainless-api/docs-ai-chat > remark-gfm',
|
|
215
|
+
'@stainless-api/docs-ai-chat > @stainless-api/ai-chat > lucide-react',
|
|
216
|
+
'@stainless-api/docs-ai-chat > @stainless-api/ai-chat > motion',
|
|
217
|
+
'@stainless-api/docs-ai-chat > @stainless-api/ai-chat > motion > framer-motion',
|
|
218
|
+
'@stainless-api/docs-ai-chat > @stainless-api/ai-chat > react-markdown',
|
|
219
|
+
'@stainless-api/docs-ai-chat > @stainless-api/ai-chat > react-syntax-highlighter',
|
|
220
|
+
'@stainless-api/docs-ai-chat > @stainless-api/ai-chat > remark-gfm',
|
|
217
221
|
]
|
|
218
222
|
: [],
|
|
219
223
|
},
|
|
@@ -37,7 +37,7 @@ type PassThroughStarlightConfigOptions = Pick<
|
|
|
37
37
|
|
|
38
38
|
type ExperimentalStarlightCompatibilityConfig = Pick<
|
|
39
39
|
StarlightConfigDefined,
|
|
40
|
-
'components' | 'routeMiddleware' | 'plugins'
|
|
40
|
+
'components' | 'routeMiddleware' | 'plugins' | 'prerender'
|
|
41
41
|
>;
|
|
42
42
|
|
|
43
43
|
export type Tabs = {
|
|
@@ -152,6 +152,7 @@ function normalizeConfig(userConfig: StainlessDocsUserConfig) {
|
|
|
152
152
|
locales: userConfig.locales,
|
|
153
153
|
lastUpdated: userConfig.lastUpdated,
|
|
154
154
|
pagination: userConfig.pagination,
|
|
155
|
+
prerender: userConfig.experimental?.starlightCompat?.prerender ?? true,
|
|
155
156
|
},
|
|
156
157
|
starlightCompat: {
|
|
157
158
|
components: userConfig.experimental?.starlightCompat?.components ?? {},
|