From a3ca657ebf9abf5e11855991377e372684b67b28 Mon Sep 17 00:00:00 2001 From: Jordan Violet <8886650+jtviolet@users.noreply.github.com> Date: Mon, 8 Sep 2025 09:20:01 -0400 Subject: [PATCH 1/4] added cross-env, simple per-product build --- package.json | 5 ++++- src/config/products.js | 8 +++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 1e25ae0306..0596179f0a 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,10 @@ "scripts": { "docusaurus": "npx docusaurus", "start": "cross-env NODE_OPTIONS=--max-old-space-size=16384 CHOKIDAR_USEPOLLING=false npx docusaurus start --port=4500 --no-open", - "build": "NODE_OPTIONS=--max-old-space-size=16384 npx docusaurus build", + "start-chok": "cross-env NODE_OPTIONS=--max-old-space-size=16384 CHOKIDAR_USEPOLLING=true npx docusaurus start --port=4500 --no-open", + "start-product": "cross-env NODE_OPTIONS=--max-old-space-size=16384 CHOKIDAR_USEPOLLING=false npx docusaurus start --port=4500 --no-open", + "start-product-chok": "cross-env NODE_OPTIONS=--max-old-space-size=16384 CHOKIDAR_USEPOLLING=true npx docusaurus start --port=4500 --no-open", + "build": "cross-env NODE_OPTIONS=--max-old-space-size=16384 npx docusaurus build", "swizzle": "npx docusaurus swizzle", "clear": "npx docusaurus clear", "serve": "npx serve -s build -l 8080", diff --git a/src/config/products.js b/src/config/products.js index 30630eab48..7cabcdc8fd 100644 --- a/src/config/products.js +++ b/src/config/products.js @@ -666,8 +666,14 @@ export function getDefaultProduct() { */ export function generateDocusaurusPlugins() { const plugins = []; + + // Filter products if DOCS_PRODUCT environment variable is set + const targetProduct = process.env.DOCS_PRODUCT; + const productsToProcess = targetProduct + ? PRODUCTS.filter(product => product.id === targetProduct) + : PRODUCTS; - PRODUCTS.forEach((product) => { + productsToProcess.forEach((product) => { product.versions.forEach((version) => { const pluginId = generatePluginId(product.id, version.version); const routeBasePath = generateRouteBasePath(product.path, version.version); From 50bdbd7bdcda8d30c9bf37a5aea585123ad5b75c Mon Sep 17 00:00:00 2001 From: Joe Dibley Date: Mon, 8 Sep 2025 21:26:32 +0100 Subject: [PATCH 2/4] Update readme with new help info --- README.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/README.md b/README.md index f4b24182de..cf80c4a933 100644 --- a/README.md +++ b/README.md @@ -91,6 +91,7 @@ npm run start ```bash # Development npm run start # Start development server +npm run start-chok # Start development server with polling (for network drives) # Building & Testing npm run build # Full production build @@ -100,6 +101,24 @@ npm run clear # Clear Docusaurus cache npm run serve # Serve production build after `npm run build` ``` +### Building/Running Specific Products + +You can build or run the documentation for a single product using the `DOCS_PRODUCT` environment variable: + +**Windows (PowerShell):** +```powershell +$ENV:DOCS_PRODUCT="pingcastle" +npm run start +``` + +**Unix/Linux/macOS:** +```bash +export DOCS_PRODUCT="pingcastle" +npm run start +``` + +This works with any command (`start`, `start-chok`, `build`) and speeds up development when working on a single product. Available product IDs can be found in `src/config/products.js`. + ### Development Workflow The centralized system makes development simple: From 074210418f4c80f22705506f251449bedbb0a3bc Mon Sep 17 00:00:00 2001 From: Joe Dibley Date: Mon, 8 Sep 2025 21:27:08 +0100 Subject: [PATCH 3/4] Remove the start-product and start-product-chok as they are the same as start and start-chok --- package.json | 2 -- 1 file changed, 2 deletions(-) diff --git a/package.json b/package.json index 0596179f0a..8724d199af 100644 --- a/package.json +++ b/package.json @@ -7,8 +7,6 @@ "docusaurus": "npx docusaurus", "start": "cross-env NODE_OPTIONS=--max-old-space-size=16384 CHOKIDAR_USEPOLLING=false npx docusaurus start --port=4500 --no-open", "start-chok": "cross-env NODE_OPTIONS=--max-old-space-size=16384 CHOKIDAR_USEPOLLING=true npx docusaurus start --port=4500 --no-open", - "start-product": "cross-env NODE_OPTIONS=--max-old-space-size=16384 CHOKIDAR_USEPOLLING=false npx docusaurus start --port=4500 --no-open", - "start-product-chok": "cross-env NODE_OPTIONS=--max-old-space-size=16384 CHOKIDAR_USEPOLLING=true npx docusaurus start --port=4500 --no-open", "build": "cross-env NODE_OPTIONS=--max-old-space-size=16384 npx docusaurus build", "swizzle": "npx docusaurus swizzle", "clear": "npx docusaurus clear", From 741c035e8410a504d2afda48e7108ee0bd5af3b9 Mon Sep 17 00:00:00 2001 From: Joe Dibley Date: Tue, 9 Sep 2025 10:52:28 +0100 Subject: [PATCH 4/4] Add note about warning on first run MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index cf80c4a933..bbd4e4443b 100644 --- a/README.md +++ b/README.md @@ -119,6 +119,8 @@ npm run start This works with any command (`start`, `start-chok`, `build`) and speeds up development when working on a single product. Available product IDs can be found in `src/config/products.js`. +*Note: you may get a warning when you first run this. This warning doesn't seem to appear again and the site worked as expected* + ### Development Workflow The centralized system makes development simple: