Skip to content

Commit 2077026

Browse files
committed
Add helper to fetch SDK artifacts directly from Github
1 parent f424757 commit 2077026

File tree

6 files changed

+374
-2
lines changed

6 files changed

+374
-2
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import { withGithubSdks } from "@speakeasy-api/docs-md";
2+
3+
const sdkConfigs = await withGithubSdks(
4+
[
5+
{
6+
language: "typescript",
7+
owner: "gleanwork",
8+
repo: "api-client-typescript",
9+
version: "v0.11.2",
10+
tryItNow: {
11+
outDir: "./public/glean-try-it-now",
12+
urlPrefix: "/glean-try-it-now",
13+
},
14+
},
15+
{
16+
language: "curl",
17+
},
18+
],
19+
process.env.GITHUB_TOKEN
20+
);
21+
22+
export default {
23+
spec: "../specs/glean.yaml",
24+
output: {
25+
pageOutDir: "./docs/glean/api",
26+
embedOutDir: "./src/components/glean-embeds",
27+
framework: "docusaurus",
28+
},
29+
display: {
30+
maxNestingLevel: 2,
31+
},
32+
...sdkConfigs,
33+
};

package-lock.json

Lines changed: 215 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/compiler/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@
3636
"@microsoft/api-extractor": "^7.52.15",
3737
"@speakeasy-api/docs-md-react": "0.2.36",
3838
"@speakeasy-api/docs-md-shared": "0.2.36",
39+
"@octokit/request-error": "^6.1.8",
40+
"@octokit/rest": "^21.0.2",
3941
"arg": "^5.0.2",
4042
"chalk": "^5.3.0",
4143
"change-case": "^5.4.4",
@@ -54,4 +56,4 @@
5456
"globals": "^16.3.0",
5557
"typescript": "^5.8.3"
5658
}
57-
}
59+
}

packages/compiler/src/compiler.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
export { getSettings } from "./settings.ts";
22
export { escapeText } from "./renderers/util.ts";
3+
export { withGithubSdks } from "./fetchers/withGithub.ts";
34
export type { FrameworkConfig } from "./types/FrameworkConfig.ts";
45
export type { Settings } from "./settings.ts";

0 commit comments

Comments
 (0)