Skip to content

Commit b3736d8

Browse files
authored
chore(docs): minify api-typedoc generated json (#461)
1 parent 15fcd1b commit b3736d8

File tree

3 files changed

+9
-275347
lines changed

3 files changed

+9
-275347
lines changed

scripts/bump-website-version.mjs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* eslint-disable @typescript-eslint/restrict-template-expressions, @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access */
22
import { execSync } from 'node:child_process';
3-
import { readFile } from 'node:fs/promises';
3+
import { readFile, writeFile } from 'node:fs/promises';
44

55
const cwd = new URL('../website/', import.meta.url);
66
const json = JSON.parse(await readFile(new URL('../package.json', import.meta.url), { encoding: 'utf8' }));
@@ -10,4 +10,10 @@ console.log(`⌛ Creating website version for ${json.version}`);
1010
execSync(`npm run docusaurus docs:version ${json.version}`, { cwd, encoding: 'utf8' });
1111
execSync(`npm run docusaurus api:version ${json.version}`, { cwd, encoding: 'utf8' });
1212

13+
const bigJsonPath = new URL(`../website/versioned_docs/version-${json.version}/api-typedoc.json`, import.meta.url);
14+
15+
const parsed = JSON.parse(await readFile(bigJsonPath, { encoding: 'utf8' }));
16+
17+
await writeFile(bigJsonPath, JSON.stringify(parsed));
18+
1319
console.log(`✅ Done! Website version created for ${json.version}`);

website/docusaurus.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ const config = {
150150
{ name: 'twitter:card', content: 'summary_large_image' },
151151
{ name: 'twitter:creator', content: '@WolfgalVlad' },
152152
{ name: 'twitter:site', content: '@WolfgalVlad' },
153-
{ name: 'twitter:title', content: Title },
153+
{ name: 'twitter:title', content: 'discord-api-types - Imagine typings' },
154154
{ name: 'twitter:description', content: Description },
155155
{ name: 'url', content: BaseUrl },
156156
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },

0 commit comments

Comments
 (0)