Skip to content

Commit 08d504c

Browse files
committed
feat: buildGuides
1 parent 0257acf commit 08d504c

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

scripts/buildClients.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { getLanguageFolder } from './config.js';
33
import { createSpinner } from './spinners.js';
44
import type { Generator, Language } from './types.js';
55

6-
type BuildType = 'client' | 'playground' | 'snippets';
6+
type BuildType = 'client' | 'guides' | 'playground' | 'snippets';
77

88
/**
99
* Build code for a specific language.
@@ -90,3 +90,7 @@ export async function buildPlaygrounds(languages: Language[]): Promise<void> {
9090
export async function buildSnippets(languages: Language[]): Promise<void> {
9191
await Promise.all(languages.map((lang) => buildLanguage(lang, [], 'snippets')));
9292
}
93+
94+
export async function buildGuides(languages: Language[]): Promise<void> {
95+
await Promise.all(languages.map((lang) => buildLanguage(lang, [], 'guides')));
96+
}

scripts/cli/index.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Argument, program } from 'commander';
22
import semver from 'semver';
33

4-
import { buildClients, buildPlaygrounds, buildSnippets } from '../buildClients.js';
4+
import { buildClients, buildPlaygrounds, buildSnippets, buildGuides } from '../buildClients.js';
55
import { CI, CLIENTS, LANGUAGES, run, setVerbose } from '../common.js';
66
import { getLanguageFolder } from '../config.js';
77
import { ctsGenerateMany } from '../cts/generate.js';
@@ -107,6 +107,17 @@ buildCommand
107107
await buildSnippets(langArg === ALL || langArg === undefined ? LANGUAGES : [langArg]);
108108
});
109109

110+
buildCommand
111+
.command('guides')
112+
.description('Build a specified guides')
113+
.addArgument(args.language)
114+
.option(flags.verbose.flag, flags.verbose.description)
115+
.action(async (langArg: LangArg, { verbose }) => {
116+
setVerbose(Boolean(verbose));
117+
118+
await buildGuides(langArg === ALL || langArg === undefined ? LANGUAGES : [langArg]);
119+
});
120+
110121
buildCommand
111122
.command('specs')
112123
.description('Build a specified spec')

0 commit comments

Comments
 (0)