pro-visu 0.3.1 → 0.4.0

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.
package/dist/index.d.ts CHANGED
@@ -741,6 +741,19 @@ interface ServerSettingsInput {
741
741
  /** If a server is already reachable at the URL, use it as-is (don't start/stop one). */
742
742
  reuseExisting?: boolean;
743
743
  }
744
+ interface CaptureSettingsInput {
745
+ /** Query params appended to every URL-based asset, e.g. `{ capture: "1" }` → `?capture=1`. */
746
+ query?: Record<string, string>;
747
+ /** Cookies set on every capture context before navigation (scoped to the asset's origin). */
748
+ cookies?: {
749
+ name: string;
750
+ value: string;
751
+ }[];
752
+ /** localStorage entries seeded (per origin) before the page's own scripts run. */
753
+ localStorage?: Record<string, string>;
754
+ /** JS run in every page before its own scripts, e.g. `window.__PV_CAPTURE__ = true`. */
755
+ initScript?: string;
756
+ }
744
757
  interface ShowcaseSettingsInput {
745
758
  /** Output directory for generated assets, relative to the repo root (default "pro-visu"). */
746
759
  outDir?: string;
@@ -759,6 +772,8 @@ interface ShowcaseSettingsInput {
759
772
  browser?: BrowserSettingsInput;
760
773
  /** Build → start → wait → capture → stop a server automatically. */
761
774
  server?: ServerSettingsInput;
775
+ /** Capture-mode toggles applied to every URL-based asset (disable animations, hide cookie banner, …). */
776
+ capture?: CaptureSettingsInput;
762
777
  /** "draft" lowers fps/scale and speeds the encoder for fast iteration. */
763
778
  quality?: "draft" | "final";
764
779
  /** Skip assets whose inputs+options+tool fingerprint is unchanged (opt-in). */
@@ -815,4 +830,4 @@ interface ShowcaseUserConfig {
815
830
  /** Identity helper that gives `pro-visu.config.ts` full type-checking + autocomplete. */
816
831
  declare function defineConfig(config: ShowcaseUserConfig): ShowcaseUserConfig;
817
832
 
818
- export { type AssetSpecInput, type BrowserSettingsInput, type LogLevel, type ScreenshotsOptions, type ScrollReelOptions, type ServerSettingsInput, type ShowcaseSettingsInput, type ShowcaseUserConfig, type SpecimenOptions, type WallOptions, defineConfig };
833
+ export { type AssetSpecInput, type BrowserSettingsInput, type CaptureSettingsInput, type ImageOptions, type LogLevel, type PaletteOptions, type PaletteReelOptions, type ScreenshotsOptions, type ScrollReelOptions, type ServerSettingsInput, type ShowcaseSettingsInput, type ShowcaseUserConfig, type SpecimenOptions, type WallOptions, defineConfig };
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/config/define-config.ts"],"sourcesContent":["import type { ScrollReelOptions } from \"@/generators/scroll-reel/options\";\nimport type { ScreenshotsOptions } from \"@/generators/screenshots/options\";\nimport type { WallOptions } from \"@/generators/wall/options\";\nimport type { SpecimenOptions } from \"@/generators/specimen/options\";\nimport type { PaletteOptions } from \"@/generators/palette/options\";\nimport type { PaletteReelOptions } from \"@/generators/palette-reel/options\";\nimport type { ImageOptions } from \"@/generators/image/options\";\n\n/**\n * Author-facing config types. These power editor autocomplete in `pro-visu.config.ts`.\n * The runtime validator lives in `schema.ts`; each generator validates its own options.\n * When a new generator is added, extend `AssetSpecInput` and `defaults` here.\n */\n\nexport type LogLevel = \"silent\" | \"error\" | \"warn\" | \"info\" | \"debug\";\n\nexport interface BrowserSettingsInput {\n /** Run the browser without a visible window (default true). Set false to watch captures. */\n headless?: boolean;\n /** Browser channel, e.g. \"chrome\" or \"msedge\". Omit to use the managed Chromium. */\n channel?: string;\n /** Absolute path to a browser executable (overrides `channel` + managed Chromium). */\n executablePath?: string;\n /** Extra launch args, e.g. [\"--no-sandbox\"] on CI. */\n args?: string[];\n /** Browser launch timeout (ms). */\n timeout?: number;\n}\n\nexport interface ServerSettingsInput {\n /**\n * Command that starts the server, run via the shell. The tool sets PORT/HOST in its environment\n * to the readiness port/host, so frameworks that honor PORT (Next, Vite, …) bind it\n * automatically — `command: \"next start\"` is enough. An explicit flag still wins.\n */\n command: string;\n /** Optional one-shot build to run first, e.g. \"next build\". */\n build?: string;\n /** Health-check URL polled until it responds. Defaults to http://127.0.0.1:<port>. */\n url?: string;\n /**\n * Port the readiness check polls — also derives `url` when `url` is omitted, and is passed to\n * the command as PORT so it binds the same port automatically. Defaults to 3101.\n */\n port?: number;\n /** Working dir for build + command, relative to the config dir. Defaults to it. */\n cwd?: string;\n /** Max time to wait for the server to become reachable (ms). Default 120000. */\n readyTimeoutMs?: number;\n /** If a server is already reachable at the URL, use it as-is (don't start/stop one). */\n reuseExisting?: boolean;\n}\n\nexport interface ShowcaseSettingsInput {\n /** Output directory for generated assets, relative to the repo root (default \"pro-visu\"). */\n outDir?: string;\n /** How many assets to generate in parallel (shared browser, separate contexts). */\n concurrency?: number;\n /**\n * Raise the Node heap (V8 old-space) to this many MB. Heavy jobs — large frame-stepped walls\n * especially — can exceed Node's ~4 GB default and crash with \"JavaScript heap out of memory\".\n * When set above the current limit, the CLI re-execs itself with `--max-old-space-size`. This is\n * the Node process heap, not the browser's.\n */\n maxMemoryMB?: number;\n /** CLI log verbosity. */\n logLevel?: LogLevel;\n /** Playwright launch controls. */\n browser?: BrowserSettingsInput;\n /** Build → start → wait → capture → stop a server automatically. */\n server?: ServerSettingsInput;\n /** \"draft\" lowers fps/scale and speeds the encoder for fast iteration. */\n quality?: \"draft\" | \"final\";\n /** Skip assets whose inputs+options+tool fingerprint is unchanged (opt-in). */\n cache?: boolean;\n /** Per-generator option defaults, keyed by generator id, merged under each asset. */\n defaults?: {\n \"scroll-reel\"?: ScrollReelOptions;\n screenshots?: ScreenshotsOptions;\n specimen?: SpecimenOptions;\n palette?: PaletteOptions;\n \"palette-reel\"?: PaletteReelOptions;\n };\n}\n\n/** Fields common to every asset. */\nexport interface AssetBaseInput {\n /** Unique id for this asset — also the output filename (`<slug(name)>.mp4`) and manifest key. */\n name: string;\n /** Other assets this one consumes, as `{ slotName: assetName }`. Producers run first. */\n inputs?: Record<string, string>;\n}\n\n/**\n * Discriminated by `generator` so each asset gets the right `options` autocomplete. URL-based\n * generators take a `url` — absolute, or a `/path` resolved against the managed server; omit it\n * to capture the managed server's root. A local `scene` composites its `inputs` and needs none.\n */\nexport type AssetSpecInput =\n | (AssetBaseInput & { url?: string; generator: \"scroll-reel\"; options?: ScrollReelOptions })\n | (AssetBaseInput & { url?: string; generator: \"screenshots\"; options?: ScreenshotsOptions })\n | (AssetBaseInput & { generator: \"wall\"; options?: WallOptions })\n | (AssetBaseInput & { generator: \"specimen\"; options: SpecimenOptions })\n | (AssetBaseInput & { generator: \"palette\"; options: PaletteOptions })\n | (AssetBaseInput & { generator: \"palette-reel\"; options: PaletteReelOptions })\n | (AssetBaseInput & { generator: \"image\"; options: ImageOptions });\n\nexport interface ShowcaseUserConfig {\n settings?: ShowcaseSettingsInput;\n assets: AssetSpecInput[];\n}\n\n/** Identity helper that gives `pro-visu.config.ts` full type-checking + autocomplete. */\nexport function defineConfig(config: ShowcaseUserConfig): ShowcaseUserConfig {\n return config;\n}\n"],"mappings":";AAiHO,SAAS,aAAa,QAAgD;AAC3E,SAAO;AACT;","names":[]}
1
+ {"version":3,"sources":["../src/config/define-config.ts"],"sourcesContent":["import type { ScrollReelOptions } from \"@/generators/scroll-reel/options\";\nimport type { ScreenshotsOptions } from \"@/generators/screenshots/options\";\nimport type { WallOptions } from \"@/generators/wall/options\";\nimport type { SpecimenOptions } from \"@/generators/specimen/options\";\nimport type { PaletteOptions } from \"@/generators/palette/options\";\nimport type { PaletteReelOptions } from \"@/generators/palette-reel/options\";\nimport type { ImageOptions } from \"@/generators/image/options\";\n\n/**\n * Author-facing config types. These power editor autocomplete in `pro-visu.config.ts`.\n * The runtime validator lives in `schema.ts`; each generator validates its own options.\n * When a new generator is added, extend `AssetSpecInput` and `defaults` here.\n */\n\nexport type LogLevel = \"silent\" | \"error\" | \"warn\" | \"info\" | \"debug\";\n\nexport interface BrowserSettingsInput {\n /** Run the browser without a visible window (default true). Set false to watch captures. */\n headless?: boolean;\n /** Browser channel, e.g. \"chrome\" or \"msedge\". Omit to use the managed Chromium. */\n channel?: string;\n /** Absolute path to a browser executable (overrides `channel` + managed Chromium). */\n executablePath?: string;\n /** Extra launch args, e.g. [\"--no-sandbox\"] on CI. */\n args?: string[];\n /** Browser launch timeout (ms). */\n timeout?: number;\n}\n\nexport interface ServerSettingsInput {\n /**\n * Command that starts the server, run via the shell. The tool sets PORT/HOST in its environment\n * to the readiness port/host, so frameworks that honor PORT (Next, Vite, …) bind it\n * automatically — `command: \"next start\"` is enough. An explicit flag still wins.\n */\n command: string;\n /** Optional one-shot build to run first, e.g. \"next build\". */\n build?: string;\n /** Health-check URL polled until it responds. Defaults to http://127.0.0.1:<port>. */\n url?: string;\n /**\n * Port the readiness check polls — also derives `url` when `url` is omitted, and is passed to\n * the command as PORT so it binds the same port automatically. Defaults to 3101.\n */\n port?: number;\n /** Working dir for build + command, relative to the config dir. Defaults to it. */\n cwd?: string;\n /** Max time to wait for the server to become reachable (ms). Default 120000. */\n readyTimeoutMs?: number;\n /** If a server is already reachable at the URL, use it as-is (don't start/stop one). */\n reuseExisting?: boolean;\n}\n\nexport interface CaptureSettingsInput {\n /** Query params appended to every URL-based asset, e.g. `{ capture: \"1\" }` → `?capture=1`. */\n query?: Record<string, string>;\n /** Cookies set on every capture context before navigation (scoped to the asset's origin). */\n cookies?: { name: string; value: string }[];\n /** localStorage entries seeded (per origin) before the page's own scripts run. */\n localStorage?: Record<string, string>;\n /** JS run in every page before its own scripts, e.g. `window.__PV_CAPTURE__ = true`. */\n initScript?: string;\n}\n\nexport interface ShowcaseSettingsInput {\n /** Output directory for generated assets, relative to the repo root (default \"pro-visu\"). */\n outDir?: string;\n /** How many assets to generate in parallel (shared browser, separate contexts). */\n concurrency?: number;\n /**\n * Raise the Node heap (V8 old-space) to this many MB. Heavy jobs — large frame-stepped walls\n * especially — can exceed Node's ~4 GB default and crash with \"JavaScript heap out of memory\".\n * When set above the current limit, the CLI re-execs itself with `--max-old-space-size`. This is\n * the Node process heap, not the browser's.\n */\n maxMemoryMB?: number;\n /** CLI log verbosity. */\n logLevel?: LogLevel;\n /** Playwright launch controls. */\n browser?: BrowserSettingsInput;\n /** Build → start → wait → capture → stop a server automatically. */\n server?: ServerSettingsInput;\n /** Capture-mode toggles applied to every URL-based asset (disable animations, hide cookie banner, …). */\n capture?: CaptureSettingsInput;\n /** \"draft\" lowers fps/scale and speeds the encoder for fast iteration. */\n quality?: \"draft\" | \"final\";\n /** Skip assets whose inputs+options+tool fingerprint is unchanged (opt-in). */\n cache?: boolean;\n /** Per-generator option defaults, keyed by generator id, merged under each asset. */\n defaults?: {\n \"scroll-reel\"?: ScrollReelOptions;\n screenshots?: ScreenshotsOptions;\n specimen?: SpecimenOptions;\n palette?: PaletteOptions;\n \"palette-reel\"?: PaletteReelOptions;\n };\n}\n\n/** Fields common to every asset. */\nexport interface AssetBaseInput {\n /** Unique id for this asset — also the output filename (`<slug(name)>.mp4`) and manifest key. */\n name: string;\n /** Other assets this one consumes, as `{ slotName: assetName }`. Producers run first. */\n inputs?: Record<string, string>;\n}\n\n/**\n * Discriminated by `generator` so each asset gets the right `options` autocomplete. URL-based\n * generators take a `url` — absolute, or a `/path` resolved against the managed server; omit it\n * to capture the managed server's root. A local `scene` composites its `inputs` and needs none.\n */\nexport type AssetSpecInput =\n | (AssetBaseInput & { url?: string; generator: \"scroll-reel\"; options?: ScrollReelOptions })\n | (AssetBaseInput & { url?: string; generator: \"screenshots\"; options?: ScreenshotsOptions })\n | (AssetBaseInput & { generator: \"wall\"; options?: WallOptions })\n | (AssetBaseInput & { generator: \"specimen\"; options: SpecimenOptions })\n | (AssetBaseInput & { generator: \"palette\"; options: PaletteOptions })\n | (AssetBaseInput & { generator: \"palette-reel\"; options: PaletteReelOptions })\n | (AssetBaseInput & { generator: \"image\"; options: ImageOptions });\n\nexport interface ShowcaseUserConfig {\n settings?: ShowcaseSettingsInput;\n assets: AssetSpecInput[];\n}\n\n/** Identity helper that gives `pro-visu.config.ts` full type-checking + autocomplete. */\nexport function defineConfig(config: ShowcaseUserConfig): ShowcaseUserConfig {\n return config;\n}\n"],"mappings":";AA8HO,SAAS,aAAa,QAAgD;AAC3E,SAAO;AACT;","names":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pro-visu",
3
- "version": "0.3.1",
3
+ "version": "0.4.0",
4
4
  "description": "A portable CLI for generating showcase assets (scroll reels, and more) of the websites you build.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -49,7 +49,6 @@
49
49
  "c12": "^3.3.4",
50
50
  "cac": "^7.0.0",
51
51
  "consola": "^3.4.2",
52
- "ffmpeg-static": "^5.3.0",
53
52
  "image-size": "^2.0.2",
54
53
  "ink": "^7.0.6",
55
54
  "picocolors": "^1.1.1",