create-website-build-kit 0.1.18 → 0.1.20

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.
@@ -28,30 +28,36 @@ import { readFileSync, writeFileSync, mkdirSync, rmSync } from 'node:fs';
28
28
  import { dirname, basename, resolve } from 'node:path';
29
29
 
30
30
  /*
31
- * ⚠ puppeteer IS A TRANSITIVE DEPENDENCY, NOT A DECLARED ONE. The comment above
32
- * is true only while `pa11y-ci` is a devDependency of this project. Run pa11y
33
- * as `npx --yes pa11y-ci` instead which a project reasonably might and
34
- * puppeteer is never installed here at all.
31
+ * ⚠ puppeteer USED TO BE A TRANSITIVE DEPENDENCY, AND THIS BLOCK IS WHY IT IS
32
+ * NOT ANY MORE. It arrived under `pa11y-ci`, so it was installed here only
33
+ * while pa11y-ci was a devDependency and only while it was installed rather
34
+ * than run as `npx --yes pa11y-ci` — which a project reasonably might do.
35
35
  *
36
36
  * A fork that did exactly that compensated by hunting for a puppeteer inside
37
37
  * `~/.npm/_npx`, found a stale one whose bundled Chrome would not launch, and
38
38
  * timed out after thirty seconds with nothing pointing at the cause.
39
39
  *
40
- * So say it plainly rather than let a bare import throw ERR_MODULE_NOT_FOUND:
41
- * a script whose dependency is a side effect of how you happened to run a
42
- * different script is a script that breaks later, on someone else's machine,
43
- * for reasons that look unrelated.
40
+ * The note stayed here, correct and unacted on, until four scripts driving a
41
+ * browser got test cases and shipping them on an implicit dependency stopped
42
+ * being defensible. `puppeteer` is now declared in package.json. This guard
43
+ * stays, because a declaration is not an installation.
44
+ *
45
+ * ⚠ AND THE PACKAGE IS NOT THE BROWSER. puppeteer fetches Chrome in a
46
+ * postinstall, and npm 11 withholds install scripts pending approval, so a
47
+ * clean `npm ci` can leave the module present and the browser absent.
44
48
  */
45
49
  let puppeteer;
46
50
  try {
47
51
  puppeteer = (await import('puppeteer')).default;
48
52
  } catch {
49
53
  console.error(
50
- `\nmd-to-pdf needs puppeteer, which is not installed.\n\n` +
51
- ` It normally arrives with pa11y-ci, so this usually means pa11y-ci was\n` +
52
- ` removed from devDependencies, or is being run as \`npx --yes pa11y-ci\`\n` +
53
- ` rather than installed.\n\n` +
54
- ` Fix: npm install --save-dev puppeteer\n`,
54
+ `\nmd-to-pdf needs puppeteer, which is declared in package.json and is not\n` +
55
+ ` installed here.\n\n` +
56
+ ` Fix: npm install\n\n` +
57
+ ` If it installs and Chrome still will not launch, the postinstall that\n` +
58
+ ` fetches the browser was withheld — npm 11 holds install scripts until\n` +
59
+ ` they are approved:\n\n` +
60
+ ` npx puppeteer browsers install chrome\n`,
55
61
  );
56
62
  process.exit(1);
57
63
  }