hdoc-tools 0.56.0 → 0.56.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.
Files changed (2) hide show
  1. package/hdoc.js +15 -0
  2. package/package.json +1 -1
package/hdoc.js CHANGED
@@ -3,6 +3,21 @@
3
3
  const preRun = require("./validateNodeVer.js");
4
4
  const fs = require("node:fs");
5
5
  const path = require("node:path");
6
+
7
+ // Point Puppeteer at the browser cache provisioned by hdoc-install-browser.js.
8
+ // Puppeteer discovers .puppeteerrc.cjs via cosmiconfig searching up from
9
+ // process.cwd(), which at runtime is the user's docbook repo — never the
10
+ // global node_modules where our config (and cache) live. So the pinned
11
+ // cacheDir there is invisible at launch and Puppeteer falls back to
12
+ // ~/.cache/puppeteer, which is empty (browser is under the package dir). The
13
+ // PUPPETEER_CACHE_DIR env var IS honored at launch regardless of cwd, so set
14
+ // it here from the same shared config. An explicit override always wins.
15
+ if (!process.env.PUPPETEER_CACHE_DIR) {
16
+ process.env.PUPPETEER_CACHE_DIR = require(
17
+ path.join(__dirname, ".puppeteerrc.cjs"),
18
+ ).cacheDir;
19
+ }
20
+
6
21
  const hdoc = require(path.join(__dirname, "hdoc-module.js"));
7
22
 
8
23
  const packageFile = path.join(__dirname, "package.json");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hdoc-tools",
3
- "version": "0.56.0",
3
+ "version": "0.56.1",
4
4
  "description": "Hornbill HDocBook Development Support Tool",
5
5
  "main": "hdoc.js",
6
6
  "bin": {