Skip to content

Commit f1f039d

Browse files
committed
Fix Swagger documentation at /api/
The swagger-ui based system has been replaced with @astro-openapi/gui-swagger. This has fewer dependencies than the original, removed a few hundred lines from our codebase and halved our build time. I had to make some CSS changes for it to work properly, including removing PurgeCSS. It doesn't seem to affect the size of the built size at all, so it should be fine. Squashed commit of the following: commit fc106bbdef82e1289cca193298f8b67b7738f2cc Author: Southpaw <git@southpaw1496.dev> Date: Fri Jan 23 09:10:18 2026 +0000 Fix styles commit 5da4ed0344f922fee7cc346536d33598a78b8e7c Author: Southpaw <git@southpaw1496.dev> Date: Fri Jan 23 09:09:16 2026 +0000 Remove PurgeCSS It was messing up the Swagger CSS and doesn’t actually seem to affect the bundle size commit a7988d5372c639860a577ec73c7615a3e3416dea Author: Southpaw <git@southpaw1496.dev> Date: Fri Jan 23 08:19:27 2026 +0000 Fix styles commit 0bc32d91ffbdbb11de7269695f956f157a9f367e Author: Southpaw <git@southpaw1496.dev> Date: Fri Jan 23 08:13:26 2026 +0000 Fix styling commit d905c284fc32f827a7e17f9df9510e4e1ba5856a Author: Southpaw <git@southpaw1496.dev> Date: Fri Jan 23 07:55:26 2026 +0000 Change OpenAPI docs title commit 61e80222b16eebd5b55b2ccd1c5d381fd11b7209 Author: Southpaw <git@southpaw1496.dev> Date: Fri Jan 23 07:12:48 2026 +0000 Add Swagger GUI from astro-openapi commit 4c9efd3b03b91893aecd372a39a14758cea253c6 Author: Southpaw <git@southpaw1496.dev> Date: Fri Jan 23 07:08:38 2026 +0000 Remove swagger-ui
1 parent cd61687 commit f1f039d

6 files changed

Lines changed: 40 additions & 2577 deletions

File tree

astro.config.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { defineConfig } from "astro/config";
22
import mdx from "@astrojs/mdx";
33
import astroI18next from "astro-i18next";
44
import sitemap from "@astrojs/sitemap";
5-
import purgecss from "astro-purgecss";
65
import rehypeAutolinkHeadings from 'rehype-autolink-headings';
76
import { fromHtml } from 'hast-util-from-html';
87
import icon from "astro-icon"
@@ -19,7 +18,6 @@ export default defineConfig({
1918
mdx(),
2019
astroI18next(),
2120
sitemap(),
22-
purgecss(),
2321
compress({ SVG: false, }),
2422
searchIndex(),
2523
icon(),

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@
4242
"rollup": "^4.55.1",
4343
"sass": "^1.97.2",
4444
"semver-compare": "^1.0.0",
45-
"swagger-ui": "^5.31.0",
4645
"typescript": "^5.9.3"
4746
},
4847
"dependencies": {
48+
"@astro-openapi/gui-swagger": "^0.0.5",
4949
"@astrojs/cloudflare": "^12.6.12",
5050
"@babel/traverse": "^7.28.6",
5151
"@iconify-json/cib": "^1.2.3",
@@ -56,7 +56,6 @@
5656
"@tsndr/cloudflare-worker-jwt": "^3.2.1",
5757
"astro-compress": "^2.3.9",
5858
"astro-icon": "^1.1.5",
59-
"astro-purgecss": "5.3.0",
6059
"fast-xml-parser": "^5.3.3",
6160
"semver": "^7.7.3"
6261
},

0 commit comments

Comments
 (0)