@cosmicdrift/kumiko-testing 0.310.0 → 0.312.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cosmicdrift/kumiko-testing",
3
- "version": "0.310.0",
3
+ "version": "0.312.0",
4
4
  "description": "Test template for Kumiko apps: per-flow seedTenant, app test stack, canonical test preloads, bunfig generator and integration runner.",
5
5
  "license": "BUSL-1.1",
6
6
  "author": "Marc Frost <marc@cosmicdriftgamestudio.com>",
@@ -63,9 +63,9 @@
63
63
  "kumiko-testing": "./bin/kumiko-testing.ts"
64
64
  },
65
65
  "dependencies": {
66
- "@cosmicdrift/kumiko-bundled-features": "0.310.0",
67
- "@cosmicdrift/kumiko-dev-server": "0.310.0",
68
- "@cosmicdrift/kumiko-framework": "0.310.0",
66
+ "@cosmicdrift/kumiko-bundled-features": "0.312.0",
67
+ "@cosmicdrift/kumiko-dev-server": "0.312.0",
68
+ "@cosmicdrift/kumiko-framework": "0.312.0",
69
69
  "zod": "^4.4.3"
70
70
  },
71
71
  "peerDependencies": {
package/src/changes.json CHANGED
@@ -1,4 +1,11 @@
1
1
  [
2
+ {
3
+ "version": "0.311.0",
4
+ "type": "breaking",
5
+ "title": "defineAppE2eConfig's chromium project renders screenshot runs at deviceScaleFactor 2",
6
+ "detail": "With SCREENSHOT_DIR set, the chromium project renders at 2x so runMatrix and\ncaptureScreenshot images stay sharp on HiDPI displays (desktop files are\n3840×2160). Plain e2e runs stay at 1x. Device projects keep their own scale.",
7
+ "migration": "Drop app-level deviceScaleFactor overrides (test.use or project use).\nCommitted screenshots taken in the chromium project regenerate at 2x."
8
+ },
2
9
  {
3
10
  "version": "0.310.0",
4
11
  "type": "improvement",
@@ -48,3 +48,7 @@ export const SEED_ROUTES = {
48
48
  // Chrome" device ships 1280×720: handbook and doc shots at 1280 visibly soften
49
49
  // on a HiDPI display, and a list next to a reading pane looks cramped.
50
50
  export const DESKTOP_VIEWPORT = { width: 1920, height: 1080 } as const;
51
+
52
+ // Screenshot runs (SCREENSHOT_DIR set) render at 2x so doc images stay sharp
53
+ // on HiDPI displays; plain e2e runs keep 1x. Device projects keep their own.
54
+ export const SCREENSHOT_DEVICE_SCALE_FACTOR = 2;
@@ -15,11 +15,12 @@ import {
15
15
  isRealProviderRun,
16
16
  PLAYWRIGHT_DEMO_ENV,
17
17
  PROD_BUNDLES_ENV,
18
+ SCREENSHOT_DEVICE_SCALE_FACTOR,
18
19
  SEED_ENABLE_ENV,
19
20
  SEED_TOKEN_ENV,
20
21
  STYLESHEET_WATCH_ENV,
21
22
  } from "./constants";
22
- import { screenshotSpecsIgnore } from "./screenshot-dir";
23
+ import { isScreenshotRun, screenshotSpecsIgnore } from "./screenshot-dir";
23
24
  import { E2E_TIMEOUT_MS } from "./timeouts";
24
25
 
25
26
  // Apps pick Meilisearch over their in-memory search adapter just because
@@ -170,7 +171,14 @@ export function defineAppE2eConfig(input: AppE2eConfigInput): PlaywrightTestConf
170
171
  navigationTimeout: E2E_TIMEOUT_MS.navigation,
171
172
  },
172
173
  projects: [
173
- { name: "chromium", use: { ...devices["Desktop Chrome"], viewport: DESKTOP_VIEWPORT } },
174
+ {
175
+ name: "chromium",
176
+ use: {
177
+ ...devices["Desktop Chrome"],
178
+ viewport: DESKTOP_VIEWPORT,
179
+ deviceScaleFactor: isScreenshotRun() ? SCREENSHOT_DEVICE_SCALE_FACTOR : 1,
180
+ },
181
+ },
174
182
  ...projects,
175
183
  ],
176
184
  webServer: {
@@ -8,7 +8,7 @@ const NORMAL_RUN_IGNORE: readonly string[] = [
8
8
 
9
9
  type Env = Readonly<Record<string, string | undefined>>;
10
10
 
11
- function isScreenshotRun(env: Env): boolean {
11
+ export function isScreenshotRun(env: Env = process.env): boolean {
12
12
  const dir = env[SCREENSHOT_DIR_ENV];
13
13
  return dir !== undefined && dir !== "";
14
14
  }
package/src/scaffold.ts CHANGED
@@ -36,6 +36,7 @@ const RULES_MARKDOWN = [
36
36
  "- Tests run in parallel by default. Timeouts, retries and workers live in the scripts, the bunfig files and `playwright.config.ts`; never raise them inside a test. The only exception carries a marker: `// @timeout-exception: #<issue> <reason>`.",
37
37
  "- Every flow seeds its own tenant: `seedTenant(stack)` in integration tests, the `seedTenant` fixture in e2e. No shared tenant, no widened seed helper.",
38
38
  "- Red or flaky? Diagnose the cause first (https://github.com/CosmicDriftGameStudio/kumiko-framework/blob/main/docs/guides/test-failures.md). A longer timeout, a retry or `serial` is not a fix.",
39
+ "- Why the setup looks this way, and the old-pattern → new-pattern table: https://github.com/CosmicDriftGameStudio/kumiko-framework/blob/main/docs/guides/testing-standard.md.",
39
40
  "- Run Playwright as `bunx --bun playwright`, as the scripts do.",
40
41
  `- Playwright configs and e2e files start with \`${TEST_RUNTIME_DIRECTIVE}\`; without it the runtime-isolation guard flags their import of the test package.`,
41
42
  "",