@wtfalch/design-check 0.1.0 → 0.1.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/dist/browser.d.ts +6 -0
- package/dist/browser.js +6 -0
- package/dist/config.js +10 -1
- package/dist/freeze.js +2 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The arguments Chromium starts with, in the freeze and in the design check.
|
|
3
|
+
* Grey text smoothing everywhere: colour smoothing depends on how a page's
|
|
4
|
+
* layers are built, so a matching page and its still would differ on glyph edges.
|
|
5
|
+
*/
|
|
6
|
+
export declare const CHROMIUM_ARGS: readonly string[];
|
package/dist/browser.js
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The arguments Chromium starts with, in the freeze and in the design check.
|
|
3
|
+
* Grey text smoothing everywhere: colour smoothing depends on how a page's
|
|
4
|
+
* layers are built, so a matching page and its still would differ on glyph edges.
|
|
5
|
+
*/
|
|
6
|
+
export const CHROMIUM_ARGS = ['--disable-lcd-text'];
|
package/dist/config.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { defineConfig, devices } from '@playwright/test';
|
|
2
|
+
import { CHROMIUM_ARGS } from './browser.js';
|
|
2
3
|
/**
|
|
3
4
|
* The Playwright config of an app's design check: opens the app's named, fixed
|
|
4
5
|
* states (`design/states/`) and compares them with the frozen stills. The base
|
|
@@ -30,6 +31,14 @@ export function defineDesignConfig(options = {}) {
|
|
|
30
31
|
use: {
|
|
31
32
|
baseURL: process.env.DESIGN_BASE_URL ?? options.baseURL ?? 'http://localhost:3301',
|
|
32
33
|
},
|
|
33
|
-
projects: [
|
|
34
|
+
projects: [
|
|
35
|
+
{
|
|
36
|
+
name: 'chromium',
|
|
37
|
+
use: {
|
|
38
|
+
...devices['Desktop Chrome'],
|
|
39
|
+
launchOptions: { args: [...CHROMIUM_ARGS] },
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
],
|
|
34
43
|
});
|
|
35
44
|
}
|
package/dist/freeze.js
CHANGED
|
@@ -3,6 +3,7 @@ import { existsSync, mkdirSync, readFileSync, rmSync, writeFileSync } from 'node
|
|
|
3
3
|
import path from 'node:path';
|
|
4
4
|
import { chromium } from '@playwright/test';
|
|
5
5
|
import { z } from 'zod';
|
|
6
|
+
import { CHROMIUM_ARGS } from './browser.js';
|
|
6
7
|
import { blockOutside } from './compare.js';
|
|
7
8
|
import { installedVersion, verifyManifest } from './manifest.js';
|
|
8
9
|
import { repoRoot } from './repo.js';
|
|
@@ -88,7 +89,7 @@ export async function freezeFeature(requestPath, options) {
|
|
|
88
89
|
try {
|
|
89
90
|
mkdirSync(path.join(folder, 'frames'), { recursive: true });
|
|
90
91
|
mkdirSync(path.join(folder, 'stills'), { recursive: true });
|
|
91
|
-
browser = await chromium.launch();
|
|
92
|
+
browser = await chromium.launch({ args: [...CHROMIUM_ARGS] });
|
|
92
93
|
const frames = [];
|
|
93
94
|
for (const f of planned) {
|
|
94
95
|
const context = await browser.newContext({ viewport: { width: f.width, height: f.height } });
|
package/dist/index.d.ts
CHANGED
|
@@ -13,6 +13,7 @@ export { compareMotion, photographAt, sameEasing, start } from './motion.js';
|
|
|
13
13
|
export type { OpenFrame } from './motion.js';
|
|
14
14
|
export { CLOCK_START, FROZEN_AT, fontsLoaded, freezeClock, knownStates } from './open-state.js';
|
|
15
15
|
export type { DesignState, OpenState, OpenStateOptions } from './open-state.js';
|
|
16
|
+
export { CHROMIUM_ARGS } from './browser.js';
|
|
16
17
|
export { defineDesignConfig } from './config.js';
|
|
17
18
|
export type { DesignConfigOptions } from './config.js';
|
|
18
19
|
export { registerFrozenSpecs } from './register.js';
|
package/dist/index.js
CHANGED
|
@@ -6,5 +6,6 @@ export { describeFrozen } from './describe-frozen.js';
|
|
|
6
6
|
export { ManifestError, installedVersion, loadFrozen, readDesignImage, readManifest, verifyManifest, } from './manifest.js';
|
|
7
7
|
export { compareMotion, photographAt, sameEasing, start } from './motion.js';
|
|
8
8
|
export { CLOCK_START, FROZEN_AT, fontsLoaded, freezeClock, knownStates } from './open-state.js';
|
|
9
|
+
export { CHROMIUM_ARGS } from './browser.js';
|
|
9
10
|
export { defineDesignConfig } from './config.js';
|
|
10
11
|
export { registerFrozenSpecs } from './register.js';
|