@stainless-api/docs 0.1.0-beta.131 → 0.1.0-beta.133

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 CHANGED
@@ -1,5 +1,21 @@
1
1
  # @stainless-api/docs
2
2
 
3
+ ## 0.1.0-beta.133
4
+
5
+ ### Patch Changes
6
+
7
+ - db5d00d: Fix for go version in install string
8
+
9
+ ## 0.1.0-beta.132
10
+
11
+ ### Patch Changes
12
+
13
+ - 53772cd: Improve handling of invalid refs
14
+ - 6091b54: Allow local files for builds
15
+ - Updated dependencies [53772cd]
16
+ - @stainless-api/docs-ui@0.1.0-beta.95
17
+ - @stainless-api/docs-search@0.1.0-beta.48
18
+
3
19
  ## 0.1.0-beta.131
4
20
 
5
21
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stainless-api/docs",
3
- "version": "0.1.0-beta.131",
3
+ "version": "0.1.0-beta.133",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -64,8 +64,8 @@
64
64
  "unified": "^11.0.5",
65
65
  "vite-plugin-prebundle-workers": "^0.2.0",
66
66
  "web-worker": "^1.5.0",
67
- "@stainless-api/docs-search": "0.1.0-beta.47",
68
- "@stainless-api/docs-ui": "0.1.0-beta.94",
67
+ "@stainless-api/docs-search": "0.1.0-beta.48",
68
+ "@stainless-api/docs-ui": "0.1.0-beta.95",
69
69
  "@stainless-api/ui-primitives": "0.1.0-beta.53"
70
70
  },
71
71
  "devDependencies": {
@@ -203,11 +203,7 @@ function resolvePath(inputPath: string) {
203
203
  return path.resolve(process.cwd(), inputPath);
204
204
  }
205
205
 
206
- function getLocalFilePaths(command: AstroCommand) {
207
- if (command !== 'dev') {
208
- return null;
209
- }
210
-
206
+ function getLocalFilePaths() {
211
207
  // eslint-disable-next-line turbo/no-undeclared-env-vars
212
208
  const oasPath = process.env.OPENAPI_PATH;
213
209
  // eslint-disable-next-line turbo/no-undeclared-env-vars
@@ -295,10 +291,7 @@ type ResolvedAPIConfigEntry = {
295
291
  loadSpecs: () => Promise<SpecCacheResult[]>;
296
292
  };
297
293
 
298
- function makeSimpleAPIConfig(
299
- partial: SomeStainlessStarlightUserConfig,
300
- astroOptions: AstroOptions,
301
- ): ResolvedAPIConfigEntry {
294
+ function makeSimpleAPIConfig(partial: SomeStainlessStarlightUserConfig): ResolvedAPIConfigEntry {
302
295
  if (!('stainlessProject' in partial)) {
303
296
  throw new Error('You must provide a stainlessProject when using Stainless Starlight');
304
297
  }
@@ -308,7 +301,7 @@ function makeSimpleAPIConfig(
308
301
  const apiKey = loadApiKey(partial.apiKey);
309
302
 
310
303
  function getResolver() {
311
- const localFilePaths = getLocalFilePaths(astroOptions.command);
304
+ const localFilePaths = getLocalFilePaths();
312
305
  if (localFilePaths) {
313
306
  return resolveSpec.fromFiles({
314
307
  oasPath: localFilePaths.oasPath,
@@ -357,10 +350,7 @@ function makeSimpleAPIConfig(
357
350
  };
358
351
  }
359
352
 
360
- function loadAPIConfig(
361
- partial: SomeStainlessStarlightUserConfig,
362
- astroOptions: AstroOptions,
363
- ): ResolvedAPIConfigEntry {
353
+ function loadAPIConfig(partial: SomeStainlessStarlightUserConfig): ResolvedAPIConfigEntry {
364
354
  if (partial.advanced?.overrideSpecs) {
365
355
  const overrides = partial.advanced.overrideSpecs;
366
356
  const apiKey = loadApiKey(partial.apiKey);
@@ -375,7 +365,7 @@ function loadAPIConfig(
375
365
  },
376
366
  };
377
367
  }
378
- return makeSimpleAPIConfig(partial, astroOptions);
368
+ return makeSimpleAPIConfig(partial);
379
369
  }
380
370
 
381
371
  function normalizeConfig(partial: SomeStainlessStarlightUserConfig, astroOptions: AstroOptions) {
@@ -418,7 +408,7 @@ function normalizeConfig(partial: SomeStainlessStarlightUserConfig, astroOptions
418
408
  },
419
409
  };
420
410
 
421
- const api = loadAPIConfig(partial, astroOptions);
411
+ const api = loadAPIConfig(partial);
422
412
 
423
413
  return {
424
414
  ...configWithDefaults,
@@ -85,6 +85,10 @@ async function generateSpecFromStrings({
85
85
  if (versionInfo) {
86
86
  for (const [lang, version] of Object.entries(versionInfo)) {
87
87
  const meta = sdkJson.metadata[lang as SDKJSON.SpecLanguage];
88
+ if (meta?.install && meta?.version) {
89
+ meta.install = meta.install.replace(meta.version, version);
90
+ }
91
+
88
92
  if (meta?.version) meta.version = version;
89
93
  }
90
94
  }