Skip to content

Enable Docusaurus Faster build system with conditional API documentation #1956

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions babel.config.js

This file was deleted.

3 changes: 2 additions & 1 deletion content/docs/internals/management-api-zero.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ This guide walks you through creating your first route and policy with the Pomer

:::tip

Throughout this guide, you can refer to either the [**Zero API reference**](/docs/api) or the Zero API playground at `https://console.pomerium.app/openapi`.
Throughout this guide, you can refer to the Zero API playground at `https://console.pomerium.app/openapi`.
<!-- TODO: Restore link to [**Zero API reference**](/docs/api) when redocusaurus plugin is re-enabled -->

:::

Expand Down
34 changes: 23 additions & 11 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ const webpack = require('webpack');

dotenv.config();

// Check if we should include redocusaurus (disable in environments with network restrictions)
const includeRedocusaurus = process.env.DISABLE_REDOCUSAURUS !== 'true';

const config = {
title: 'Pomerium',
tagline: 'Documentation',
Expand All @@ -18,6 +21,12 @@ const config = {
projectName: 'documentation',
trailingSlash: false,

// Enable Docusaurus Faster (rspack + persistent caching)
future: {
experimental_faster: true,
v4: true,
},

markdown: {
mermaid: true,
},
Expand Down Expand Up @@ -73,17 +82,20 @@ const config = {
},
},
],
[
'redocusaurus',
{
specs: [
{
spec: 'https://console.pomerium.app/openapi.yaml',
route: '/docs/api/',
},
],
},
],
// Conditionally include redocusaurus based on environment
...(includeRedocusaurus ? [
[
'redocusaurus',
{
specs: [
{
spec: 'https://console.pomerium.app/openapi.yaml',
route: '/docs/api/',
},
],
},
],
] : []),
],

themeConfig: {
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
},
"dependencies": {
"@docusaurus/core": "^3.8.1",
"@docusaurus/faster": "^3.8.1",
"@docusaurus/preset-classic": "^3.8.1",
"@docusaurus/theme-common": "^3.8.1",
"@docusaurus/theme-mermaid": "^3.8.1",
Expand Down
Loading
Loading