@mizchi/vlmkit-capture 0.8.1 → 0.9.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.
package/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  Playwright / Crater capture infrastructure for VRT — viewport discovery,
4
4
  multi-route capture, prescanner integration.
5
5
 
6
- Part of the [`vrt`](https://github.com/mizchi/vrt) monorepo.
6
+ Part of the [`vlmkit`](https://github.com/mizchi/vlmkit) monorepo.
7
7
 
8
8
  ## Install
9
9
 
@@ -24,7 +24,7 @@ const { viewports, breakpoints } = discoverViewports(html, {
24
24
 
25
25
  const routeSet = resolveCaptureRoutes({
26
26
  cwd: process.cwd(),
27
- configPath: "vrt.config.json",
27
+ configPath: "vlmkit.config.json",
28
28
  });
29
29
  ```
30
30
 
@@ -39,7 +39,7 @@ import { capturePage } from "@mizchi/vlmkit-capture/capturer.ts";
39
39
 
40
40
  | Module | Purpose |
41
41
  |---|---|
42
- | `capture-config` | `vrt.config.json` resolution + route schema. |
42
+ | `capture-config` | `vlmkit.config.json` resolution + route schema. |
43
43
  | `viewport-discovery` | Parse CSS media queries to suggest test viewports. |
44
44
  | `crater-client` | Bidi-protocol client for the Crater browser engine. |
45
45
  | `playwright-analyzer` | Auto-detect Playwright config from project. |
@@ -17,11 +17,11 @@ interface CaptureRouteSet {
17
17
  declare const DEFAULT_CAPTURE_BASE_URL = "http://127.0.0.1:4174";
18
18
  /**
19
19
  * Built-in fallback used when no config or env override is provided.
20
- * Kept for vrt's own development workflow; external projects should
21
- * supply their own routes via `vrt.config.json`.
20
+ * Kept for vlmkit's own development workflow; external projects should
21
+ * supply their own routes via `vlmkit.config.json`.
22
22
  */
23
23
  declare const DEFAULT_CAPTURE_ROUTES: CaptureRoute[];
24
- declare const DEFAULT_CAPTURE_CONFIG_FILE = "vrt.config.json";
24
+ declare const DEFAULT_CAPTURE_CONFIG_FILE = "vlmkit.config.json";
25
25
  declare function parseCaptureConfig(raw: string): CaptureConfig;
26
26
  declare function routeNameFromPath(path: string): string;
27
27
  interface LoadCaptureConfigOptions {
@@ -35,9 +35,9 @@ interface LoadCaptureConfigOptions {
35
35
  * Resolve the route set to use for a capture run.
36
36
  *
37
37
  * Precedence (highest first):
38
- * 1. `VRT_CAPTURE_ROUTES` env var (JSON-encoded array)
39
- * 2. Explicit config path (CLI / `VRT_CONFIG_PATH`)
40
- * 3. `vrt.config.json` discovered in `cwd`
38
+ * 1. `VLMKIT_CAPTURE_ROUTES` env var (JSON-encoded array)
39
+ * 2. Explicit config path (CLI / `VLMKIT_CONFIG_PATH`)
40
+ * 3. `vlmkit.config.json` discovered in `cwd`
41
41
  * 4. Built-in defaults
42
42
  */
43
43
  declare function resolveCaptureRoutes(options?: LoadCaptureConfigOptions): CaptureRouteSet;
@@ -2,17 +2,17 @@ import { existsSync, readFileSync } from "node:fs";
2
2
  import { dirname, isAbsolute, resolve } from "node:path";
3
3
  //#region src/capture-config.ts
4
4
  /**
5
- * Capture configuration loader for `vrt workflow init|capture`.
5
+ * Capture configuration loader for `vlmkit workflow init|capture`.
6
6
  *
7
7
  * Allows external projects to drive `e2e/vrt-capture.spec.ts` without
8
- * editing the spec by sourcing routes from `vrt.config.json` (or any
9
- * file pointed at by `--config` / `VRT_CONFIG_PATH`).
8
+ * editing the spec by sourcing routes from `vlmkit.config.json` (or any
9
+ * file pointed at by `--config` / `VLMKIT_CONFIG_PATH`).
10
10
  */
11
11
  const DEFAULT_CAPTURE_BASE_URL = "http://127.0.0.1:4174";
12
12
  /**
13
13
  * Built-in fallback used when no config or env override is provided.
14
- * Kept for vrt's own development workflow; external projects should
15
- * supply their own routes via `vrt.config.json`.
14
+ * Kept for vlmkit's own development workflow; external projects should
15
+ * supply their own routes via `vlmkit.config.json`.
16
16
  */
17
17
  const DEFAULT_CAPTURE_ROUTES = [
18
18
  {
@@ -41,7 +41,7 @@ const DEFAULT_CAPTURE_ROUTES = [
41
41
  waitFor: "main"
42
42
  }
43
43
  ];
44
- const DEFAULT_CAPTURE_CONFIG_FILE = "vrt.config.json";
44
+ const DEFAULT_CAPTURE_CONFIG_FILE = "vlmkit.config.json";
45
45
  function parseCaptureConfig(raw) {
46
46
  let parsed;
47
47
  try {
@@ -102,9 +102,9 @@ function routeNameFromPath(path) {
102
102
  * Resolve the route set to use for a capture run.
103
103
  *
104
104
  * Precedence (highest first):
105
- * 1. `VRT_CAPTURE_ROUTES` env var (JSON-encoded array)
106
- * 2. Explicit config path (CLI / `VRT_CONFIG_PATH`)
107
- * 3. `vrt.config.json` discovered in `cwd`
105
+ * 1. `VLMKIT_CAPTURE_ROUTES` env var (JSON-encoded array)
106
+ * 2. Explicit config path (CLI / `VLMKIT_CONFIG_PATH`)
107
+ * 3. `vlmkit.config.json` discovered in `cwd`
108
108
  * 4. Built-in defaults
109
109
  */
110
110
  function resolveCaptureRoutes(options = {}) {
@@ -33,7 +33,7 @@ interface ResolvedCaptureBackend {
33
33
  /**
34
34
  * Resolution order:
35
35
  * 1. Explicit `--backend` flag
36
- * 2. `VRT_CAPTURE_BACKEND` env var
36
+ * 2. `VLMKIT_CAPTURE_BACKEND` env var
37
37
  * 3. Default local
38
38
  *
39
39
  * For the Cloudflare backend, credentials come from env (`CLOUDFLARE_ACCOUNT_ID`
package/dist/capturer.mjs CHANGED
@@ -51,7 +51,7 @@ function maskAccount(id) {
51
51
  /**
52
52
  * Resolution order:
53
53
  * 1. Explicit `--backend` flag
54
- * 2. `VRT_CAPTURE_BACKEND` env var
54
+ * 2. `VLMKIT_CAPTURE_BACKEND` env var
55
55
  * 3. Default local
56
56
  *
57
57
  * For the Cloudflare backend, credentials come from env (`CLOUDFLARE_ACCOUNT_ID`
@@ -61,7 +61,7 @@ function maskAccount(id) {
61
61
  function resolveCaptureBackend(options = {}) {
62
62
  const env = options.env ?? process.env;
63
63
  const explicit = options.backendFlag?.trim().toLowerCase();
64
- const envChoice = env.VRT_CAPTURE_BACKEND?.trim().toLowerCase();
64
+ const envChoice = env.VLMKIT_CAPTURE_BACKEND?.trim().toLowerCase();
65
65
  const choice = explicit || envChoice || "local";
66
66
  const source = explicit ? "flag" : envChoice ? "env" : "default";
67
67
  switch (choice) {
@@ -264,6 +264,6 @@ async function main(argv = process.argv.slice(2)) {
264
264
  else console.log(formatCraterSmokeReport(report));
265
265
  if (report.status === "fail" || args.requireAvailable && report.status === "skip") process.exit(1);
266
266
  }
267
- if (process.env.__VRT_DISPATCHER_LEAF__ === "crater-smoke" || (process.argv[1] ? resolve(process.argv[1]) === fileURLToPath(import.meta.url) : false)) main().catch(handleCliError);
267
+ if (process.env.__VLMKIT_DISPATCHER_LEAF__ === "crater-smoke" || (process.argv[1] ? resolve(process.argv[1]) === fileURLToPath(import.meta.url) : false)) main().catch(handleCliError);
268
268
  //#endregion
269
269
  export { formatCraterSmokeReport, parseCraterSmokeArgs, runCraterBidiSmoke };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mizchi/vlmkit-capture",
3
- "version": "0.8.1",
3
+ "version": "0.9.1",
4
4
  "description": "Playwright + Crater capture infrastructure for VRT — viewport discovery, multi-route capture, prescanner.",
5
5
  "license": "MIT",
6
6
  "author": "mizchi",
@@ -36,10 +36,12 @@
36
36
  }
37
37
  },
38
38
  "dependencies": {
39
- "playwright": "^1.61.1",
40
39
  "pngjs": "^7.0.0",
41
40
  "ws": "^8.20.0",
42
- "@mizchi/vlmkit-core": "0.8.1"
41
+ "@mizchi/vlmkit-core": "0.9.1"
42
+ },
43
+ "peerDependencies": {
44
+ "playwright": ">=1.61 <2"
43
45
  },
44
46
  "scripts": {
45
47
  "build": "pnpm --dir ../.. exec tsdown --config tsdown.packages.config.ts --filter @mizchi/vlmkit-capture",