Skip to content
Merged
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
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "docgen-tool",
"type": "module",
"version": "6.3.0",
"version": "6.3.1",
"description": "A tool for creating HTML and PDF documentation",
"bin": "./dist/cli/cli.js",
"files": [
Expand Down Expand Up @@ -52,9 +52,10 @@
"react-resize-detector": "^12.3.0",
"rehype-raw": "^7.0.0",
"remark-gfm": "^4.0.1",
"rolldown-vite": "npm:rolldown-vite@latest",
"rolldown-vite": "^7.3.0",
"style-dictionary": "^5.1.1",
"vite": "npm:rolldown-vite@latest",
"vite-plugin-node-polyfills": "0.22.0",
"z-schema": "^6.0.2"
},
"devDependencies": {
Expand All @@ -80,4 +81,4 @@
"url": "https://github.com/mtmacdonald/docgen/issues"
},
"homepage": "https://mtmacdonald.github.io/docgen/docs/index.html"
}
}
20 changes: 20 additions & 0 deletions src/cli/generate/generate.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import path from 'node:path';
import { createRequire } from 'node:module';
import { build, createServer } from 'vite';
import react from '@vitejs/plugin-react';
import { nodePolyfills } from 'vite-plugin-node-polyfills';
import dotenv from 'dotenv';
import { deriveParameters } from '../../docgen/meta/derive-parameters.ts';
import { loadInputs } from '../../docgen/fs/load-inputs.ts';
Expand All @@ -12,6 +14,7 @@ import { watchInputDirPlugin } from './plugins/watch-input-dir-plugin.ts';

dotenv.config({ path: path.resolve(process.cwd(), '.env') });

const require = createRequire(import.meta.url);
const basePath = process.env.BASE_PATH || '/';

export const generate = async (command, mode: string) => {
Expand Down Expand Up @@ -39,7 +42,24 @@ export const generate = async (command, mode: string) => {
root: appPath,
publicDir: inputDir,
base: basePath,
resolve: {
// Remove once github.com/davidmyersdev/vite-plugin-node-polyfills/issues/140 is fixed
alias: {
'vite-plugin-node-polyfills/shims/process': require.resolve(
'vite-plugin-node-polyfills/shims/process',
),
'vite-plugin-node-polyfills/shims/buffer': require.resolve(
'vite-plugin-node-polyfills/shims/buffer',
),
'vite-plugin-node-polyfills/shims/global': require.resolve(
'vite-plugin-node-polyfills/shims/global',
),
},
},
plugins: [
nodePolyfills({

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mtmacdonald In my codebase for a totally different project, we're calling this as:

      nodePolyfills({
        include: ['path'],
        globals: {
          Buffer: true,
        },
      }),

so, maybe you need to add:

        globals: {
          Buffer: true,
        },

so that you don't need to manually add the manual resolve alias?

include: ['buffer'],
}),
styleVariablesPlugin(appPath),
react({
// Exclude PRF worker from HMR (ReferenceError: window is not defined @react-refresh error caused by HMR)
Expand Down
4 changes: 2 additions & 2 deletions src/docs/parameters.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"title": "DocGen - a documentation tool",
"name": "DocGen",
"version": "6.3.0",
"date": "16/12/2025",
"version": "6.3.1",
"date": "06/01/2026",
"organization": {
"name": "Inkit Inc. and contributors",
"url": "https://www.inkit.com"
Expand Down
7 changes: 6 additions & 1 deletion src/docs/release-notes.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
## DocGen 6.3.0 16/12/2025
## DocGen 6.3.0 06/01/2026

- Fixed dev mode build error ([#179](https://github.com/mtmacdonald/docgen/issues/179))
- Fixed `buffer is not defined` warning in PDF ([#172](https://github.com/mtmacdonald/docgen/issues/172))

## DocGen 6.3.0 16/12/2025

- Remove SASS style preprocessor, migrate to plain CSS
- Lift [Style Dictionary](https://styledictionary.com) into the [Vite](https://vite.dev) build pipeline [#173](https://github.com/mtmacdonald/docgen/issues/143)
Expand Down
Loading