gutterpress 0.11.10-alpha.2 → 0.11.10-alpha.6

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 (59) hide show
  1. package/README.md +24 -46
  2. package/dist/api/index.d.ts +1 -1
  3. package/dist/api/index.js +10 -6
  4. package/dist/{build-dfpvvhys.js → build-npxq1tvm.js} +7 -6
  5. package/dist/cdp-jg95s674.js +15 -0
  6. package/dist/cdp-smdx6mr3.js +16 -0
  7. package/dist/{cli-d8rdk1y7.js → cli-30j93gzt.js} +11 -335
  8. package/dist/{cli-pfczdbyd.js → cli-5qr3z0qa.js} +10 -404
  9. package/dist/{cli-c41yr7he.js → cli-7fkhgtfn.js} +3 -1
  10. package/dist/{cli-k2hwrp7s.js → cli-97bdz5k0.js} +1 -4
  11. package/dist/cli-kkzka31p.js +261 -0
  12. package/dist/{cli-p679pvce.js → cli-vbzkkcbv.js} +2 -2
  13. package/dist/{cli-4xksazfr.js → cli-z8ye91f0.js} +283 -1142
  14. package/dist/cli.js +12 -14
  15. package/dist/{doctor-hheax5yc.js → doctor-ykr6gtpv.js} +3 -3
  16. package/dist/engine/shared/cdp.d.ts +23 -19
  17. package/dist/engine-3gwctsty.js +24 -0
  18. package/dist/engine-mwshptgf.js +25 -0
  19. package/dist/{ext-q5024j6v.js → ext-bna9nr3v.js} +7 -6
  20. package/dist/{index-1a4rx87v.js → index-322fxk25.js} +344 -1130
  21. package/dist/{index-kqftehgy.js → index-dzp0hc2c.js} +4 -2
  22. package/dist/{index-fnhak0nh.js → index-qf7y4d85.js} +10 -404
  23. package/dist/index-r4wvy5v3.js +267 -0
  24. package/dist/{index-t43k5rq1.js → index-rzm1phg0.js} +23 -356
  25. package/dist/index.d.ts +0 -1
  26. package/dist/index.js +12 -87
  27. package/dist/lib/build-error.d.ts +4 -5
  28. package/dist/lib/build-preflight.d.ts +1 -35
  29. package/dist/lib/build-runner.d.ts +27 -44
  30. package/dist/lib/chromium.d.ts +5 -1
  31. package/dist/lib/engine.d.ts +3 -18
  32. package/dist/lib/extension-manager.d.ts +2 -2
  33. package/dist/lib/extension-manifest.d.ts +1 -1
  34. package/dist/lib/markdown/assemble.d.ts +2 -9
  35. package/dist/lib/markdown/index.d.ts +2 -4
  36. package/dist/lib/markdown/plugins.d.ts +0 -3
  37. package/dist/lib/npm-plugin-installer.d.ts +6 -1
  38. package/dist/lib/plugin-vendor.d.ts +10 -78
  39. package/dist/lib/source-provider.d.ts +1 -1
  40. package/dist/lib/validation-exec.d.ts +5 -6
  41. package/dist/{new-6xm4tdxb.js → new-0hv3nwqj.js} +9 -8
  42. package/dist/{preflight-ezt8rvg3.js → preflight-pk0k25fm.js} +7 -6
  43. package/dist/preview/file-watcher.d.ts +4 -43
  44. package/dist/preview/http-server.d.ts +1 -3
  45. package/dist/{preview-hehs46dd.js → preview-8b1fn59h.js} +7 -6
  46. package/dist/{preview-shell-gqnc5xxe.js → preview-shell-tqndvhbx.js} +5 -7
  47. package/dist/{publish-ha505ejq.js → publish-ba5h76tz.js} +7 -6
  48. package/dist/render.d.ts +1 -1
  49. package/dist/render.js +1 -9
  50. package/dist/{source-provider-ta09wegv.js → source-provider-pzmz0br9.js} +1 -1
  51. package/dist/{source-provider-7c2ww3bz.js → source-provider-qbthnmqw.js} +1 -1
  52. package/dist/{validate-je56vdbj.js → validate-4rq2r5b3.js} +7 -6
  53. package/package.json +1 -4
  54. package/dist/audit-v9594a72.js +0 -69
  55. package/dist/engine-qtfrfbpk.js +0 -41
  56. package/dist/engine-trte2tg2.js +0 -40
  57. package/dist/lib/browser-pool.d.ts +0 -35
  58. package/dist/lib/lint-runner.d.ts +0 -29
  59. package/dist/lint-tbywt66a.js +0 -68
package/dist/cli.js CHANGED
@@ -6,7 +6,7 @@ import {
6
6
  UsageError,
7
7
  package_default,
8
8
  rejectUnknownFlags
9
- } from "./cli-k2hwrp7s.js";
9
+ } from "./cli-97bdz5k0.js";
10
10
  import {
11
11
  EXIT_CODES
12
12
  } from "./cli-46ycxe6r.js";
@@ -18,16 +18,14 @@ import {
18
18
  import { defineCommand, parseArgs, runMain } from "citty";
19
19
  import { statSync } from "node:fs";
20
20
  var SUBCOMMANDS = {
21
- new: () => import("./new-6xm4tdxb.js").then((m) => m.default),
22
- preview: () => import("./preview-hehs46dd.js").then((m) => m.default),
23
- build: () => import("./build-dfpvvhys.js").then((m) => m.default),
24
- publish: () => import("./publish-ha505ejq.js").then((m) => m.default),
25
- lint: () => import("./lint-tbywt66a.js").then((m) => m.default),
26
- validate: () => import("./validate-je56vdbj.js").then((m) => m.default),
27
- audit: () => import("./audit-v9594a72.js").then((m) => m.default),
28
- preflight: () => import("./preflight-ezt8rvg3.js").then((m) => m.default),
29
- doctor: () => import("./doctor-hheax5yc.js").then((m) => m.default),
30
- ext: () => import("./ext-q5024j6v.js").then((m) => m.default)
21
+ new: () => import("./new-0hv3nwqj.js").then((m) => m.default),
22
+ preview: () => import("./preview-8b1fn59h.js").then((m) => m.default),
23
+ build: () => import("./build-npxq1tvm.js").then((m) => m.default),
24
+ publish: () => import("./publish-ba5h76tz.js").then((m) => m.default),
25
+ validate: () => import("./validate-4rq2r5b3.js").then((m) => m.default),
26
+ preflight: () => import("./preflight-pk0k25fm.js").then((m) => m.default),
27
+ doctor: () => import("./doctor-ykr6gtpv.js").then((m) => m.default),
28
+ ext: () => import("./ext-bna9nr3v.js").then((m) => m.default)
31
29
  };
32
30
  var VERSION = package_default.version;
33
31
  var main = defineCommand({
@@ -52,7 +50,7 @@ async function preflightRequiredInvocations(rawArgs) {
52
50
  const [command, ...commandArgs] = rawArgs;
53
51
  try {
54
52
  if (command === "new") {
55
- const { newArgs } = await import("./new-6xm4tdxb.js");
53
+ const { newArgs } = await import("./new-0hv3nwqj.js");
56
54
  rejectUnknownFlags(commandArgs, newArgs, "new");
57
55
  const parsed = parseArgs(commandArgs, {
58
56
  ...newArgs,
@@ -64,7 +62,7 @@ async function preflightRequiredInvocations(rawArgs) {
64
62
  return;
65
63
  }
66
64
  if (command === "preflight") {
67
- const { preflightArgs } = await import("./preflight-ezt8rvg3.js");
65
+ const { preflightArgs } = await import("./preflight-pk0k25fm.js");
68
66
  rejectUnknownFlags(commandArgs, preflightArgs, "preflight");
69
67
  const parsed = parseArgs(commandArgs, {
70
68
  ...preflightArgs,
@@ -84,7 +82,7 @@ async function preflightRequiredInvocations(rawArgs) {
84
82
  }
85
83
  if (subcommand.startsWith("-"))
86
84
  return;
87
- const { EXT_SUBCOMMANDS, extAddArgs, extRemoveArgs, extEnableArgs, extDisableArgs } = await import("./ext-q5024j6v.js");
85
+ const { EXT_SUBCOMMANDS, extAddArgs, extRemoveArgs, extEnableArgs, extDisableArgs } = await import("./ext-bna9nr3v.js");
88
86
  if (!EXT_SUBCOMMANDS.includes(subcommand)) {
89
87
  throw new UsageError(`gutterpress ext: unknown command "${subcommand}"`);
90
88
  }
@@ -1,14 +1,14 @@
1
1
  import {
2
2
  getSystemDiagnostics,
3
3
  log
4
- } from "./cli-p679pvce.js";
4
+ } from "./cli-vbzkkcbv.js";
5
5
  import {
6
6
  UsageError,
7
7
  rejectExtraPositionals,
8
8
  rejectUnknownFlags
9
- } from "./cli-k2hwrp7s.js";
10
- import"./cli-c41yr7he.js";
9
+ } from "./cli-97bdz5k0.js";
11
10
  import"./cli-46ycxe6r.js";
11
+ import"./cli-7fkhgtfn.js";
12
12
  import"./cli-37x76zdn.js";
13
13
 
14
14
  // src/commands/doctor.ts
@@ -1,4 +1,3 @@
1
- export declare function findChromium(): string;
2
1
  /**
3
2
  * Gutterpress targets exactly one engine.
4
3
  *
@@ -42,10 +41,13 @@ export declare function findChromium(): string;
42
41
  export declare const REQUIRED_MILESTONE = 148;
43
42
  /**
44
43
  * Refuse to paginate on a browser below the floor. The invariant belongs to
45
- * the `Browser` CONTRACT, not to any one way of obtaining a browser — the
46
- * launch/connect paths and the host-injected path (an Electron
47
- * `EngineBrowser`, `lib/engine.ts`) must enforce the identical rule with the
48
- * identical message, or the two drift (they already had once).
44
+ * the `Browser` CONTRACT, not to any one way of obtaining a browser — every
45
+ * producer of a `Browser` enforces it once, at construction: `launchChromium`
46
+ * below for the CLI's external Chromium, and the desktop's
47
+ * `createElectronEngineBrowser` (packages/desktop/electron/engine-browser.ts)
48
+ * for Electron's bundled one. Consumers (`lib/build-runner.ts`, the compiler)
49
+ * trust a `Browser` they are handed; a second check downstream is drift
50
+ * waiting to happen (the two messages had already diverged once).
49
51
  */
50
52
  export declare function assertMilestone(product: string, origin: string, hint?: string): void;
51
53
  /**
@@ -89,20 +91,22 @@ export interface Session {
89
91
  printToPDF(opts?: Record<string, unknown>): Promise<Uint8Array>;
90
92
  close(): Promise<void>;
91
93
  }
92
- export declare function launchChromium(opts?: {
93
- headless?: boolean;
94
- args?: string[];
95
- }): Promise<Browser>;
96
94
  /**
97
- * Attach to an ALREADY-RUNNING Chromium (a pooled/pre-warmed browser owned by
98
- * the caller, e.g. `browser-pool.ts`'s puppeteer instance via
99
- * `browser.wsEndpoint()`) instead of spawning a new process.
95
+ * Launch the system Chromium and verify it meets {@link REQUIRED_MILESTONE}.
96
+ *
97
+ * Binary resolution is `lib/chromium.ts`'s (`CHROMIUM_PATH`, then standard
98
+ * install locations, then a PATH probe) — the same resolver the preflight
99
+ * presence check and `gutterpress doctor` use, so what they report is what
100
+ * gets launched. Extra flags come from `GUTTERPRESS_CHROMIUM_ARGS`
101
+ * (containers/CI, e.g. `--disable-dev-shm-usage`; see docs/docker.md) and
102
+ * `opts.args`; `opts.ignoreDefaultArgs` removes entries from
103
+ * {@link DEFAULT_ARGS} for a test that needs a host WITHOUT one of them.
100
104
  *
101
- * Deliberately the mirror image of `launchChromium`: same version pin, same
102
- * `Session`/`newPage` machinery (`checkMilestoneAndWrap`, shared below), but
103
- * `close()` only drops OUR websocket connection — it never sends
104
- * `Browser.close`, kills a process, or removes a profile dir, because this
105
- * function didn't create any of those. Ownership of the underlying browser's
106
- * lifecycle stays entirely with whoever handed us `wsUrl`.
105
+ * The launch is also the one and only milestone check: a too-old browser is
106
+ * torn down and rejected here, with the override hint, before any caller
107
+ * gets a `Browser`.
107
108
  */
108
- export declare function connectChromium(wsUrl: string): Promise<Browser>;
109
+ export declare function launchChromium(opts?: {
110
+ args?: string[];
111
+ ignoreDefaultArgs?: string[];
112
+ }): Promise<Browser>;
@@ -0,0 +1,24 @@
1
+ import {
2
+ build
3
+ } from "./index-dzp0hc2c.js";
4
+ import {
5
+ BuildError
6
+ } from "./index-r4wvy5v3.js";
7
+ import"./index-rzm1phg0.js";
8
+ import"./index-37x76zdn.js";
9
+
10
+ // src/lib/engine.ts
11
+ import { writeFile } from "node:fs/promises";
12
+ async function buildNativePdf(htmlFile, outPdf, options, browser) {
13
+ let result;
14
+ try {
15
+ result = await build({ input: htmlFile, browser, ...options });
16
+ } catch (err) {
17
+ throw new BuildError(`PDF build failed: ${err instanceof Error ? err.message : String(err)}`);
18
+ }
19
+ await writeFile(outPdf, result.bytes);
20
+ return result.diagnostics;
21
+ }
22
+ export {
23
+ buildNativePdf
24
+ };
@@ -0,0 +1,25 @@
1
+ import {
2
+ build
3
+ } from "./cli-30j93gzt.js";
4
+ import {
5
+ BuildError
6
+ } from "./cli-46ycxe6r.js";
7
+ import"./cli-kkzka31p.js";
8
+ import"./cli-7fkhgtfn.js";
9
+ import"./cli-37x76zdn.js";
10
+
11
+ // src/lib/engine.ts
12
+ import { writeFile } from "node:fs/promises";
13
+ async function buildNativePdf(htmlFile, outPdf, options, browser) {
14
+ let result;
15
+ try {
16
+ result = await build({ input: htmlFile, browser, ...options });
17
+ } catch (err) {
18
+ throw new BuildError(`PDF build failed: ${err instanceof Error ? err.message : String(err)}`);
19
+ }
20
+ await writeFile(outPdf, result.bytes);
21
+ return result.diagnostics;
22
+ }
23
+ export {
24
+ buildNativePdf
25
+ };
@@ -10,21 +10,22 @@ import {
10
10
  removeExtension,
11
11
  searchNpmExtensions,
12
12
  setExtensionEnabled
13
- } from "./cli-4xksazfr.js";
14
- import"./cli-p679pvce.js";
13
+ } from "./cli-z8ye91f0.js";
14
+ import"./cli-vbzkkcbv.js";
15
15
  import {
16
16
  UsageError,
17
17
  exitForUsage,
18
18
  rejectExtraPositionals,
19
19
  rejectUnknownFlags,
20
20
  resolveProjectDir
21
- } from "./cli-k2hwrp7s.js";
22
- import"./cli-d8rdk1y7.js";
23
- import"./cli-c41yr7he.js";
21
+ } from "./cli-97bdz5k0.js";
22
+ import"./cli-30j93gzt.js";
24
23
  import {
25
24
  EXIT_CODES
26
25
  } from "./cli-46ycxe6r.js";
27
- import"./cli-pfczdbyd.js";
26
+ import"./cli-kkzka31p.js";
27
+ import"./cli-7fkhgtfn.js";
28
+ import"./cli-5qr3z0qa.js";
28
29
  import"./cli-v5mp7a6q.js";
29
30
  import"./cli-37x76zdn.js";
30
31