docgen-tool 6.3.0 → 6.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Binary file
package/dist/cli/cli.js CHANGED
@@ -1,8 +1,10 @@
1
1
  #!/usr/bin/env node
2
+ import { createRequire } from "node:module";
2
3
  import { program } from "commander";
3
4
  import path, { join, resolve } from "node:path";
4
5
  import { build, createServer } from "vite";
5
6
  import react from "@vitejs/plugin-react";
7
+ import { nodePolyfills } from "vite-plugin-node-polyfills";
6
8
  import dotenv from "dotenv";
7
9
  import pico from "picocolors";
8
10
  import path$1 from "path";
@@ -242,7 +244,7 @@ const deriveParameters = ({ rawParameters, setVersion, setReleaseDate }) => {
242
244
  } catch {}
243
245
  throw new Error(`template directory not found under ${root}`);
244
246
  }, styleVariablesPlugin = (appDir) => {
245
- const cssVirtualModuleId = "virtual:style-variables.css", jsVirtualModuleId = "virtual:style-variables.js", resolvedCssPath = path.join(appDir, "virtual-style-variables.css"), resolvedJsPath = path.join(appDir, "virtual-style-variables.js");
247
+ const cssVirtualModuleId = "virtual:style-variables.css", jsVirtualModuleId = "virtual:style-variables.js", resolvedCssPath = `\0${path.join(appDir, "virtual-style-variables.css")}`, resolvedJsPath = `\0${path.join(appDir, "virtual-style-variables.js")}`;
246
248
  return {
247
249
  name: "style-variables-plugin",
248
250
  enforce: "pre",
@@ -295,7 +297,7 @@ const deriveParameters = ({ rawParameters, setVersion, setReleaseDate }) => {
295
297
  };
296
298
  };
297
299
  dotenv.config({ path: path.resolve(process.cwd(), ".env") });
298
- const basePath = process.env.BASE_PATH || "/", generate = async (command, mode) => {
300
+ const require = createRequire(import.meta.url), basePath = process.env.BASE_PATH || "/", generate = async (command, mode) => {
299
301
  const inputDir = path.resolve(process.cwd(), command.input), outputDir = path.resolve(process.cwd(), command.output), inputs = await loadInputs({
300
302
  inputPath: inputDir,
301
303
  verbose: false
@@ -309,7 +311,13 @@ const basePath = process.env.BASE_PATH || "/", generate = async (command, mode)
309
311
  root: appPath,
310
312
  publicDir: inputDir,
311
313
  base: basePath,
314
+ resolve: { alias: {
315
+ "vite-plugin-node-polyfills/shims/process": require.resolve("vite-plugin-node-polyfills/shims/process"),
316
+ "vite-plugin-node-polyfills/shims/buffer": require.resolve("vite-plugin-node-polyfills/shims/buffer"),
317
+ "vite-plugin-node-polyfills/shims/global": require.resolve("vite-plugin-node-polyfills/shims/global")
318
+ } },
312
319
  plugins: [
320
+ nodePolyfills({ include: ["buffer"] }),
313
321
  styleVariablesPlugin(appPath),
314
322
  react({ exclude: /\/src\/app\/pdf\// }),
315
323
  htmlTransformPlugin(parameters.title ?? "DocGen"),
@@ -336,7 +344,7 @@ const basePath = process.env.BASE_PATH || "/", generate = async (command, mode)
336
344
  }, scaffold = async (command) => {
337
345
  const inputDir = findTemplateDir(import.meta.dirname), outputDir = path.normalize(command.output + "/"), verbose = command.verbose === true;
338
346
  console.log(pico.green("Creating scaffold template directory")), await copyDirectory(inputDir, outputDir, verbose);
339
- }, version = "6.3.0";
347
+ }, version = "6.3.1";
340
348
  if (program.version(version).usage("[command] [--option]"), program.command("scaffold").usage("[--option]").description("create a template input directory").option("-o, --output [path]", "path to the output directory (default: ./)", "./").option("-v, --verbose", "show verbose output including detailed errors").action((command) => {
341
349
  scaffold(command);
342
350
  }), program.command("dev").usage("[--option]").description("create a static website from an input directory").option("-i, --input [path]", "path to the input directory [default: ./]", "./").option("-o, --output [path]", "path to the output directory [default: ./output]", "./output").option("-p, --pdf", "create a PDF document").option("-s, --set-version [version]", "override parameters.version (useful for build tools) [default: false]", false).option("-R, --set-release-date [date]", "override parameters.date (useful for build tools) [default: false]", false).option("-v, --verbose", "show verbose output including detailed errors").action((command) => {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "docgen-tool",
3
3
  "type": "module",
4
- "version": "6.3.0",
4
+ "version": "6.3.1",
5
5
  "description": "A tool for creating HTML and PDF documentation",
6
6
  "bin": "./dist/cli/cli.js",
7
7
  "files": [
@@ -52,9 +52,10 @@
52
52
  "react-resize-detector": "^12.3.0",
53
53
  "rehype-raw": "^7.0.0",
54
54
  "remark-gfm": "^4.0.1",
55
- "rolldown-vite": "npm:rolldown-vite@latest",
55
+ "rolldown-vite": "^7.3.0",
56
56
  "style-dictionary": "^5.1.1",
57
57
  "vite": "npm:rolldown-vite@latest",
58
+ "vite-plugin-node-polyfills": "0.22.0",
58
59
  "z-schema": "^6.0.2"
59
60
  },
60
61
  "devDependencies": {
@@ -80,4 +81,4 @@
80
81
  "url": "https://github.com/mtmacdonald/docgen/issues"
81
82
  },
82
83
  "homepage": "https://mtmacdonald.github.io/docgen/docs/index.html"
83
- }
84
+ }