@ploaness/config 1.5.0 → 1.6.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.
Files changed (42) hide show
  1. package/biome-core.json +9 -3
  2. package/biome.json +1 -1
  3. package/dependency-cruiser-core.json +1 -4
  4. package/dist/a11y.d.ts +24 -9
  5. package/dist/a11y.d.ts.map +1 -1
  6. package/dist/a11y.js +58 -143
  7. package/dist/a11y.js.map +1 -1
  8. package/dist/access.d.ts.map +1 -1
  9. package/dist/access.js.map +1 -1
  10. package/dist/eslint-core.d.ts.map +1 -1
  11. package/dist/eslint-core.js +18 -16
  12. package/dist/eslint-core.js.map +1 -1
  13. package/dist/eslint-security.d.ts.map +1 -1
  14. package/dist/eslint-security.js +2 -6
  15. package/dist/eslint-security.js.map +1 -1
  16. package/dist/eslint.d.ts +2 -0
  17. package/dist/eslint.d.ts.map +1 -1
  18. package/dist/eslint.js +24 -11
  19. package/dist/eslint.js.map +1 -1
  20. package/dist/layout.d.ts +23 -0
  21. package/dist/layout.d.ts.map +1 -0
  22. package/dist/layout.js +168 -0
  23. package/dist/layout.js.map +1 -0
  24. package/dist/playwright.d.ts.map +1 -1
  25. package/dist/playwright.js +4 -3
  26. package/dist/playwright.js.map +1 -1
  27. package/dist/project-settings.d.ts.map +1 -1
  28. package/dist/project-settings.js +1 -1
  29. package/dist/project-settings.js.map +1 -1
  30. package/dist/settle.d.ts +13 -0
  31. package/dist/settle.d.ts.map +1 -0
  32. package/dist/settle.js +136 -0
  33. package/dist/settle.js.map +1 -0
  34. package/dist/vitest-core.d.ts.map +1 -1
  35. package/dist/vitest-core.js.map +1 -1
  36. package/dist/vitest-library.d.ts.map +1 -1
  37. package/dist/vitest-library.js +1 -1
  38. package/dist/vitest-library.js.map +1 -1
  39. package/dist/vitest-setup.js +1 -6
  40. package/dist/vitest-setup.js.map +1 -1
  41. package/package.json +7 -6
  42. package/pins.json +4 -4
@@ -1 +1 @@
1
- {"version":3,"file":"eslint.d.ts","sourceRoot":"","sources":["../src/eslint.ts"],"names":[],"mappings":";AAqEA,wBA2TC"}
1
+ {"version":3,"file":"eslint.d.ts","sourceRoot":"","sources":["../src/eslint.ts"],"names":[],"mappings":"AAgDA,yGAAyG;AACzG,eAAO,MAAM,qBAAqB,EAAE,SAAS,MAAM,EAIlD,CAAA;;AAoBD,wBAiUC"}
package/dist/eslint.js CHANGED
@@ -11,18 +11,25 @@
11
11
  // Philosophy: maximum-explicit. The build should be hard to satisfy by accident, so that code which
12
12
  // passes is verbose, explicit and readable by construction.
13
13
  import nextPlugin from '@next/eslint-plugin-next';
14
- import { APPLICATION_JSX_IGNORES, ENVIRONMENT_READ_EXEMPTIONS, REEXPORT_CONFIG_FILES, } from '@ploaness/governance';
14
+ import { APPLICATION_JSX_IGNORES, ENVIRONMENT_READ_EXEMPTIONS, REEXPORT_CONFIG_FILES } from '@ploaness/governance';
15
15
  //
16
16
  // The framework-neutral half - the caps, the explicitness rules, the naming ban, the suppression
17
17
  // discipline, the mock ban - lives in ./eslint-core.js and is shared with the ploaness repository's own
18
18
  // lint run. What stays here is what is genuinely about Payload and Next: the generated mount, the
19
19
  // collection configs, the environment module, the a11y layer, and the test-integrity block.
20
+ import playwright from 'eslint-plugin-playwright';
20
21
  import testingLibrary from 'eslint-plugin-testing-library';
21
22
  import { baseLayers, compose, guidelineRules, hookContextBlock, immutabilityBlock, NO_INHERITANCE, NO_MOCK_PROPERTIES, NO_NETWORK_GUARD_ESCAPE, prettierLast, processConfigBlock, specEnvironmentBlock, testIdiomRules, testIntegrityRules, testSuiteSyntaxRules, typeAwareParsing, vitestPlugin, withoutWarnings, } from './eslint-core.js';
22
23
  import { SECURITY_RESTRICTIONS } from './eslint-security.js';
23
24
  import { projectSettings as settings } from './project-settings.js';
24
25
  // Where a Payload project writes its hooks, and therefore the one place `req.context` is written.
25
26
  const PAYLOAD_HOOK_FILES = ['src/hooks/**'];
27
+ /** The assertion helpers `ploaness/a11y` ships, each of which fails the test it runs in on a finding. */
28
+ export const E2E_ASSERTION_HELPERS = [
29
+ 'expectSweptPage',
30
+ 'expectNoLayoutDefects',
31
+ 'expectNoAxeDefects',
32
+ ];
26
33
  const NO_INLINE_CONFIG_FUNCTIONS_SELECTOR = 'ArrowFunctionExpression, FunctionExpression';
27
34
  const NO_INLINE_CONFIG_FUNCTIONS_MESSAGE = 'No inline functions in collection/global/field/block configs. Define access and pure rules in ' +
28
35
  'src/access or src/lib, where the unit suite covers them, and a hook or validator that needs the ' +
@@ -186,12 +193,7 @@ hookContextBlock(PAYLOAD_HOOK_FILES),
186
193
  // the like) into src/access or src/lib, where unit tests cover it, and import it by reference.
187
194
  // Scoped by directory so a new config folder is governed automatically.
188
195
  {
189
- files: [
190
- 'src/collections/**/*.ts',
191
- 'src/globals/**/*.ts',
192
- 'src/fields/**/*.ts',
193
- 'src/blocks/**/*.ts',
194
- ],
196
+ files: ['src/collections/**/*.ts', 'src/globals/**/*.ts', 'src/fields/**/*.ts', 'src/blocks/**/*.ts'],
195
197
  rules: {
196
198
  'no-restricted-syntax': [
197
199
  ...NO_INHERITANCE,
@@ -313,13 +315,24 @@ hookContextBlock(PAYLOAD_HOOK_FILES),
313
315
  // Playwright has its own runner, but a spec body can still create an unguarded Node transport before
314
316
  // it asks the browser to do anything. The Vitest-specific integrity rules do not fit here; the network
315
317
  // escape ban does, and carries the same selectors rather than a second list.
318
+ //
319
+ // Every test must still assert. `sonarjs/assertions-in-tests` decided that by reading the body of the
320
+ // function a test calls, and ploaness ships its sweep helpers as declarations with no body, so a test
321
+ // whose one check is `expectSweptPage(page)` - the form the guide teaches - was reported as asserting
322
+ // nothing. Playwright's own rule takes the helpers by name instead: the three this harness ships, and a
323
+ // project's own helper named `expect` followed by a capital, the convention those three follow.
316
324
  {
317
325
  files: ['tests/e2e/**/*.ts', 'tests/e2e/**/*.tsx'],
326
+ plugins: { playwright },
318
327
  rules: {
319
- 'no-restricted-syntax': [
320
- ...NO_INHERITANCE,
321
- ...SECURITY_RESTRICTIONS,
322
- ...NO_NETWORK_GUARD_ESCAPE,
328
+ 'no-restricted-syntax': [...NO_INHERITANCE, ...SECURITY_RESTRICTIONS, ...NO_NETWORK_GUARD_ESCAPE],
329
+ 'sonarjs/assertions-in-tests': 'off',
330
+ 'playwright/expect-expect': [
331
+ 'error',
332
+ {
333
+ assertFunctionNames: [...E2E_ASSERTION_HELPERS],
334
+ assertFunctionPatterns: ['^expect[A-Z]'],
335
+ },
323
336
  ],
324
337
  },
325
338
  },
@@ -1 +1 @@
1
- {"version":3,"file":"eslint.js","sourceRoot":"","sources":["../src/eslint.ts"],"names":[],"mappings":"AAAA,YAAY;AACZ,EAAE;AACF,iFAAiF;AACjF,EAAE;AACF,+FAA+F;AAC/F,gGAAgG;AAChG,mGAAmG;AACnG,0FAA0F;AAC1F,4FAA4F;AAC5F,EAAE;AACF,oGAAoG;AACpG,4DAA4D;AAE5D,OAAO,UAAU,MAAM,0BAA0B,CAAA;AACjD,OAAO,EACL,uBAAuB,EACvB,2BAA2B,EAC3B,qBAAqB,GACtB,MAAM,sBAAsB,CAAA;AAC7B,EAAE;AACF,iGAAiG;AACjG,wGAAwG;AACxG,kGAAkG;AAClG,4FAA4F;AAC5F,OAAO,cAAc,MAAM,+BAA+B,CAAA;AAC1D,OAAO,EACL,UAAU,EACV,OAAO,EAEP,cAAc,EACd,gBAAgB,EAChB,iBAAiB,EACjB,cAAc,EACd,kBAAkB,EAClB,uBAAuB,EACvB,YAAY,EACZ,kBAAkB,EAClB,oBAAoB,EACpB,cAAc,EACd,kBAAkB,EAClB,oBAAoB,EACpB,gBAAgB,EAChB,YAAY,EACZ,eAAe,GAChB,MAAM,kBAAkB,CAAA;AACzB,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAA;AAC5D,OAAO,EAAE,eAAe,IAAI,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAEnE,kGAAkG;AAClG,MAAM,kBAAkB,GAAsB,CAAC,cAAc,CAAC,CAAA;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ACrG,uGAAuG;AACvG,6EAA6E;AAC7E,EAAE;AACF,sGAAsG;AACtG,sGAAsG;AACtG,sGAAsG;AACtG,wGAAwG;AACxG,gGAAgG;AAChG;IACE,KAAK,EAAE,CAAC,mBAAmB,EAAE,oBAAoB,CAAC;IAClD,OAAO,EAAE,EAAE,UAAU,EAAE;IACvB,KAAK,EAAE;QACL,sBAAsB,EAAE,CAAC,GAAG,cAAc,EAAE,GAAG,qBAAqB,EAAE,GAAG,uBAAuB,CAAC;QACjG,6BAA6B,EAAE,KAAK;QACpC,0BAA0B,EAAE;YAC1B,OAAO;YACP;gBACE,mBAAmB,EAAE,CAAC,GAAG,qBAAqB,CAAC;gBAC/C,sBAAsB,EAAE,CAAC,cAAc,CAAC;aACzC;SACF;KACF;CACF;AAED,gGAAgG;AAChG,mBAAmB,EACnB,YAAY,CACb,CAAA"}
@@ -0,0 +1,23 @@
1
+ import { type Page } from '@playwright/test';
2
+ import { type LayoutViewport } from '@ploaness/governance';
3
+ /** The viewports every layout scan runs at, the harness's own first. */
4
+ export declare const LAYOUT_SCAN_VIEWPORTS: readonly LayoutViewport[];
5
+ /**
6
+ * Measure the page as it stands at every required viewport, and report what is wrong with its layout.
7
+ *
8
+ * The page is resized in place rather than reloaded, so whatever state a spec drove it into - a
9
+ * signed-in view, an open dialog - is what gets measured. Its viewport is restored afterwards.
10
+ * @param page the page to measure, already on the route and in the state to judge.
11
+ * @returns one line per layout defect, empty when there is none.
12
+ */
13
+ export declare const layoutDefectsOf: (page: Page) => Promise<readonly string[]>;
14
+ /**
15
+ * Fail the calling test when the page has a layout defect at any required viewport.
16
+ *
17
+ * Call it in a project's own specification for a page the sweep cannot reach - one behind a sign-in,
18
+ * or one whose address exists only once a record does - after driving the page into the state to judge.
19
+ * @param page the page to measure.
20
+ * @returns nothing; it fails the test with one line per defect.
21
+ */
22
+ export declare const expectNoLayoutDefects: (page: Page) => Promise<void>;
23
+ //# sourceMappingURL=layout.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"layout.d.ts","sourceRoot":"","sources":["../src/layout.ts"],"names":[],"mappings":"AAYA,OAAO,EAAU,KAAK,IAAI,EAAE,MAAM,kBAAkB,CAAA;AACpD,OAAO,EAOL,KAAK,cAAc,EAEpB,MAAM,sBAAsB,CAAA;AAI7B,wEAAwE;AACxE,eAAO,MAAM,qBAAqB,EAAE,SAAS,cAAc,EAAyD,CAAA;AAsNpH;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe,GAAU,MAAM,IAAI,KAAG,OAAO,CAAC,SAAS,MAAM,EAAE,CAa3E,CAAA;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,qBAAqB,GAAU,MAAM,IAAI,KAAG,OAAO,CAAC,IAAI,CAEpE,CAAA"}
package/dist/layout.js ADDED
@@ -0,0 +1,168 @@
1
+ // The layout scan's measurement: what a page reports about its own geometry, and the call that judges it.
2
+ //
3
+ // Every rule lives in `@ploaness/governance`, which judges a plain snapshot. This module is the one piece
4
+ // that has to run inside the browser, and the one place the harness's viewports and the project's
5
+ // stricter settings meet a page.
6
+ //
7
+ // WHY THE PAGE CODE IS ASSEMBLED FROM SOURCE TEXT. Playwright ships a page function to the browser as
8
+ // its own source, so it can reach nothing at module scope. One function holding the whole measurement
9
+ // would pass the callable cap several times over. Each step is therefore a top-level function of its
10
+ // own, and `IN_PAGE_SOURCE` joins their texts into one expression that hands each step the others as
11
+ // `tools`. A step names another only through that parameter, never directly, because in the page no
12
+ // other binding exists.
13
+ import { expect } from '@playwright/test';
14
+ import { findLayoutDefects, layoutViewportsWith, } from '@ploaness/governance';
15
+ import { projectSettings } from './project-settings.js';
16
+ import { settleForScan } from './settle.js';
17
+ /** The viewports every layout scan runs at, the harness's own first. */
18
+ export const LAYOUT_SCAN_VIEWPORTS = layoutViewportsWith(projectSettings.layoutViewports);
19
+ const roundRects = (rects) => Array.from(rects, (rect) => ({
20
+ left: Math.round(rect.left + scrollX),
21
+ top: Math.round(rect.top + scrollY),
22
+ right: Math.round(rect.right + scrollX),
23
+ bottom: Math.round(rect.bottom + scrollY),
24
+ }));
25
+ const ownText = (element) => {
26
+ const textNodeType = 3;
27
+ return Array.from(element.childNodes).filter((child) => child.nodeType === textNodeType && (child.textContent ?? '').trim().length > 0);
28
+ };
29
+ const ownTextRects = (element, tools) => tools.ownText(element).flatMap((text) => {
30
+ const range = document.createRange();
31
+ range.selectNodeContents(text);
32
+ return tools.roundRects(range.getClientRects());
33
+ });
34
+ const bordersOf = (style) => {
35
+ const side = (name) => ({
36
+ // A computed border width is always a pixel length, `0px` for a side drawn with no border.
37
+ width: Number(style.getPropertyValue(`border-${name}-width`).replace('px', '')),
38
+ style: style.getPropertyValue(`border-${name}-style`),
39
+ color: style.getPropertyValue(`border-${name}-color`),
40
+ });
41
+ return { top: side('top'), right: side('right'), bottom: side('bottom'), left: side('left') };
42
+ };
43
+ // `normal` reads as NaN, which the rules take as 0: no line height to shrink a text rect to.
44
+ const lineHeightOf = (style) => {
45
+ const lineHeight = Number(style.getPropertyValue('line-height').replace('px', ''));
46
+ return Number.isFinite(lineHeight) ? lineHeight : 0;
47
+ };
48
+ // A tag, then the id or the first two classes, then the element's own text: `a.button "Sign in"`.
49
+ const labelOf = (element, tools) => {
50
+ const maxClasses = 2;
51
+ const maxText = 40;
52
+ const tag = element.tagName.toLowerCase();
53
+ const name = element.id.length > 0
54
+ ? `#${element.id}`
55
+ : Array.from(element.classList)
56
+ .slice(0, maxClasses)
57
+ .map((className) => `.${className}`)
58
+ .join('');
59
+ const text = tools
60
+ .ownText(element)
61
+ .map((node) => node.textContent ?? '')
62
+ .join(' ')
63
+ .replaceAll(/\s+/gu, ' ')
64
+ .trim();
65
+ return text.length === 0 ? `${tag}${name}` : `${tag}${name} "${text.slice(0, maxText)}"`;
66
+ };
67
+ const describe = (element, index, parent, tools) => {
68
+ const style = getComputedStyle(element);
69
+ const read = (property) => style.getPropertyValue(property);
70
+ const isClipping = ['hidden', 'clip'].some((value) => [read('overflow-x'), read('overflow-y')].includes(value));
71
+ return {
72
+ index,
73
+ parent,
74
+ label: tools.labelOf(element, tools),
75
+ tag: element.tagName.toLowerCase(),
76
+ rects: tools.roundRects(element.getClientRects()),
77
+ textRects: tools.ownTextRects(element, tools),
78
+ lineHeight: tools.lineHeightOf(style),
79
+ text: isClipping ? (element.textContent ?? '').trim() : '',
80
+ display: read('display'),
81
+ visibility: read('visibility'),
82
+ position: read('position'),
83
+ backgroundColor: read('background-color'),
84
+ backgroundImage: read('background-image'),
85
+ boxShadow: read('box-shadow'),
86
+ borders: tools.bordersOf(style),
87
+ isAriaHidden: element.getAttribute('aria-hidden') === 'true',
88
+ isClipped: read('clip-path') !== 'none' || !['auto', ''].includes(read('clip')),
89
+ overflowX: read('overflow-x'),
90
+ overflowY: read('overflow-y'),
91
+ textOverflow: read('text-overflow'),
92
+ lineClamp: read('-webkit-line-clamp'),
93
+ scrollWidth: element.scrollWidth,
94
+ clientWidth: element.clientWidth,
95
+ scrollHeight: element.scrollHeight,
96
+ clientHeight: element.clientHeight,
97
+ title: element.getAttribute('title') ?? '',
98
+ ariaLabel: element.getAttribute('aria-label') ?? '',
99
+ exemption: element.getAttribute('data-ploaness-layout') ?? undefined,
100
+ exemptionReason: (element.getAttribute('data-ploaness-layout-reason') ?? '').trim(),
101
+ };
102
+ };
103
+ // The element list in document order, from `<body>` down. An SVG's own drawing is not layout: the
104
+ // `<svg>` element is measured and what it draws inside is not.
105
+ const measureDocument = (tools) => {
106
+ const svgNamespace = 'http://www.w3.org/2000/svg';
107
+ const elements = [document.body, ...Array.from(document.body.querySelectorAll('*'))].filter((element) => element.namespaceURI !== svgNamespace || element.parentElement?.namespaceURI !== svgNamespace);
108
+ const positions = new Map(elements.map((element, index) => [element, index]));
109
+ const root = document.documentElement;
110
+ return {
111
+ viewportWidth: root.clientWidth,
112
+ viewportHeight: root.clientHeight,
113
+ scrollWidth: root.scrollWidth,
114
+ rootBackground: getComputedStyle(root).getPropertyValue('background-color'),
115
+ nodes: elements.map((element, index) => {
116
+ const parent = element.parentElement;
117
+ const parentIndex = parent === null ? -1 : (positions.get(parent) ?? -1);
118
+ return tools.describe(element, index, index === 0 ? -1 : parentIndex, tools);
119
+ }),
120
+ };
121
+ };
122
+ const STEPS = {
123
+ roundRects,
124
+ ownText,
125
+ ownTextRects,
126
+ bordersOf,
127
+ lineHeightOf,
128
+ labelOf,
129
+ describe,
130
+ };
131
+ const IN_PAGE_SOURCE = `(${String(measureDocument)})({${Object.entries(STEPS)
132
+ .map(([name, step]) => `${name}: ${String(step)}`)
133
+ .join(', ')}})`;
134
+ const routeOf = (page) => new URL(page.url()).pathname;
135
+ const measureAt = async (page, viewport) => {
136
+ await page.setViewportSize(viewport);
137
+ await settleForScan(page);
138
+ const measured = await page.evaluate(IN_PAGE_SOURCE);
139
+ return { ...measured, route: routeOf(page) };
140
+ };
141
+ /**
142
+ * Measure the page as it stands at every required viewport, and report what is wrong with its layout.
143
+ *
144
+ * The page is resized in place rather than reloaded, so whatever state a spec drove it into - a
145
+ * signed-in view, an open dialog - is what gets measured. Its viewport is restored afterwards.
146
+ * @param page the page to measure, already on the route and in the state to judge.
147
+ * @returns one line per layout defect, empty when there is none.
148
+ */
149
+ export const layoutDefectsOf = async (page) => {
150
+ const original = page.viewportSize();
151
+ const snapshots = await LAYOUT_SCAN_VIEWPORTS.reduce(async (measured, viewport) => [...(await measured), await measureAt(page, viewport)], Promise.resolve([]));
152
+ if (original !== null) {
153
+ await page.setViewportSize(original);
154
+ }
155
+ return findLayoutDefects(snapshots, projectSettings.layoutMinimumGap);
156
+ };
157
+ /**
158
+ * Fail the calling test when the page has a layout defect at any required viewport.
159
+ *
160
+ * Call it in a project's own specification for a page the sweep cannot reach - one behind a sign-in,
161
+ * or one whose address exists only once a record does - after driving the page into the state to judge.
162
+ * @param page the page to measure.
163
+ * @returns nothing; it fails the test with one line per defect.
164
+ */
165
+ export const expectNoLayoutDefects = async (page) => {
166
+ expect(await layoutDefectsOf(page), `layout defects on ${routeOf(page)}`).toE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G;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,KAAK,EAAE,IAAU,EAAiB,EAAE;IACvE,MAAM,CAAC,MAAM,eAAe,CAAC,IAAI,CAAC,EAAE,qBAAqB,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAA;AACvF,CAAC,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"playwright.d.ts","sourceRoot":"","sources":["../src/playwright.ts"],"names":[],"mappings":"AAsHA,QAAA,MAAM,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAmB,CAAA;AAEjE,eAAe,MAAM,CAAA"}
1
+ {"version":3,"file":"playwright.d.ts","sourceRoot":"","sources":["../src/playwright.ts"],"names":[],"mappings":"AAoHA,QAAA,MAAM,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAmB,CAAA;AAEjE,eAAe,MAAM,CAAA"}
@@ -11,7 +11,7 @@
11
11
  // and every threshold, ban and pinned spec above is the same whatever they say.
12
12
  import { existsSync } from 'node:fs';
13
13
  import { defineConfig, devices } from '@playwright/test';
14
- import { portOf, runEnvironmentFiles } from '@ploaness/governance';
14
+ import { canReuseBrowserServer, portOf, runEnvironmentFiles } from '@ploaness/governance';
15
15
  import { projectSettings } from './project-settings.js';
16
16
  // Read before anything else, because a spec module is what needs it. Playwright evaluates this config
17
17
  // in the runner and again in every worker, which makes it the one place a value reaches both the pass
@@ -24,6 +24,7 @@ for (const file of runEnvironmentFiles(existsSync)) {
24
24
  process.loadEnvFile(file);
25
25
  }
26
26
  const isContinuousIntegration = Boolean(process.env['CI']);
27
+ const isReuseExistingServer = canReuseBrowserServer(process.env);
27
28
  // The web server is `next dev`, which compiles a route on its first request. The first hit to the heavy
28
29
  // Payload admin bundle can exceed the 30s Playwright default on a cold runner, so the budget gives
29
30
  // compilation headroom instead of leaning on a retry to mask it.
@@ -77,7 +78,7 @@ const declared = defineConfig({
77
78
  ...projectSettings.auxiliaryServers.map((server) => ({
78
79
  command: server.command,
79
80
  url: server.url,
80
- reuseExistingServer: !isContinuousIntegration,
81
+ reuseExistingServer: isReuseExistingServer,
81
82
  // The same budget and the same reuse rule as the application: an auxiliary server is started by
82
83
  // the same runner on the same cold machine, so a shorter one would fail for the reason that one
83
84
  // is long.
@@ -92,7 +93,7 @@ const declared = defineConfig({
92
93
  // this member's `node_modules/.bin` - which is the member under test, so it is the right one.
93
94
  command: 'next dev',
94
95
  url: projectSettings.serverUrl,
95
- reuseExistingServer: !isContinuousIntegration,
96
+ reuseExistingServer: isReuseExistingServer,
96
97
  timeout: SERVER_TIMEOUT_MS,
97
98
  // The port comes from the declared origin. Without it the server started on the framework's
98
99
  // default while the runner waited on the origin the project declared, so the one setting that
@@ -1 +1 @@
1
- {"version":3,"file":"playwright.js","sourceRoot":"","sources":["../src/playwright.ts"],"names":[],"mappings":"AAAA,wGAAwG;AACxG,yFAAyF;AACzF,EAAE;AACF,mGAAmG;AACnG,wGAAwG;AACxG,mHAAmH;AACnH,uGAAuG;AACvG,sGAAsG;AACtG,sGAAsG;AACtG,wGAAwG;AACxG,gFAAgF;AAChF,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AACpC,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;AACxD,OAAO,EAAE,MAAM,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAA;AAClE,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAEvD,sGAAsG;AACtG,sGAAsG;AACtG,qGAAqG;AACrG,kGAAkG;AAClG,sGAAsG;AACtG,qGAAqG;AACrG,sEAAsE;AACtE,KAAK,MAAM,IAAI,IAAI,mBAAmB,CAAC,UAAU,CAAC,EAAE,CAAC;IACnD,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,CAAA;AAC3B,CAAC;AAED,MAAM,uBAAuB,GAAY,OAAO,C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YAChG,gGAAgG;YAChG,WAAW;YACX,OAAO,EAAE,iBAAiB;YAC1B,GAAG,CAAC,MAAM,CAAC,GAAG,KAAK,SAAS,IAAI,EAAE,GAAG,EAAE,MAAM,CAAC,GAAG,EAAE,CAAC;YACpD,GAAG,EAAE,QAAQ,CAAC,EAAE,YAAY,EAAE,kBAAkB,EAAE,EAAE,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;SACxE,CAAC,CAAC;QACH;YACE,kGAAkG;YAClG,gGAAgG;YAChG,kGAAkG;YAClG,8FAA8F;YAC9F,OAAO,EAAE,UAAU;YACnB,GAAG,EAAE,eAAe,CAAC,SAAS;YAC9B,mBAAmB,EAAE,qBAAqB;YAC1C,OAAO,EAAE,iBAAiB;YAC1B,4FAA4F;YAC5F,8FAA8F;YAC9F,2EAA2E;YAC3E,GAAG,EAAE,QAAQ,CAAC,EAAE,uBAAuB,EAAE,GAAG,EAAE,YAAY,EAAE,kBAAkB,EAAE,EAAE,YAAY,CAAC;SAChG;KACF;CACF,CAAC,CAAA;AAEF,mGAAmG;AACnG,mGAAmG;AACnG,MAAM,MAAM,GAAsC,EAAE,GAAG,QAAQ,EAAE,CAAA;AAEjE,eAAe,MAAM,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"project-settings.d.ts","sourceRoot":"","sources":["../src/project-settings.ts"],"names":[],"mappings":"AAGA,OAAO,EAIL,KAAK,QAAQ,EACd,MAAM,sBAAsB,CAAA;AA6C7B,eAAO,MAAM,eAAe,EAAE,QAAqC,CAAA"}
1
+ {"version":3,"file":"project-settings.d.ts","sourceRoot":"","sources":["../src/project-settings.ts"],"names":[],"mappings":"AAGA,OAAO,EAAmD,KAAK,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AA6CrG,eAAO,MAAM,eAAe,EAAE,QAAqC,CAAA"}
@@ -1,7 +1,7 @@
1
1
  // Read the consumer's settings from the working directory, where its tools are invoked.
2
2
  import { readFileSync } from 'node:fs';
3
3
  import path from 'node:path';
4
- import { ploanessBlock, readMemberSettings, readSettings, } from '@ploaness/governance';
4
+ import { ploanessBlock, readMemberSettings, readSettings } from '@ploaness/governance';
5
5
  // A project whose package.json cannot be read gets the defaults, which are the strict end of every
6
6
  // setting. Failing to parse must never be the thing that loosens a threshold.
7
7
  // `unknown` rather than the parse's own `any`: `readSettings` narrows every field it reads, so handing
@@ -1 +1 @@
1
- {"version":3,"file":"project-settings.js","sourceRoot":"","sources":["../src/project-settings.ts"],"names":[],"mappings":"AAAA,wFAAwF;AACxF,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AACtC,OAAO,IAAI,MAAM,WAAW,CAAA;AAC5B,OAAO,EACL,aAAa,EACb,kBAAkB,EAClB,YAAY,GAEb,MAAM,sBAAsB,CAAA;AAE7B,mGAAmG;AACnG,8EAA8E;AAC9E,uGAAuG;AACvG,yEAAyE;AACzE,MAAM,eAAe,GAAG,CAAC,SAAiB,EAAW,EAAE;IACrD,IAAI,CAAC;QACH,OAAO,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,cAAc,CAAC,EAAE,MAAM,CAAC,CAAC,CAAA;IAC/E,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,CAAA;IACX,CAAC;AACH,CAAC,CAAA;AAED,sGAAsG;AACtG,sGAAsG;AACtG,+FAA+F;AAC/F,MAAM,gBAAgB,GAAW,qBAAqB,CAAA;AAEtD,iGAAiG;AACjG,0FAA0F;AAC1F,MAAM,kBAAkB,GAAG,CAAC,SAAiB,EAAsB,EAAE;IACnE,MAAM,MAAM,GAAW,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAA;IAC9C,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;QACzB,OAAO,SAAS,CAAA;IAClB,CAAC;IACD,IAAI,CAAC;QACH,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,gBAAgB,CAAC,EAAE,MAAM,CAAC,C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sGAAsG;AACtG,+FAA+F;AAC/F,MAAM,gBAAgB,GAAW,qBAAqB,CAAA;AAEtD,iGAAiG;AACjG,0FAA0F;AAC1F,MAAM,kBAAkB,GAAG,CAAC,SAAiB,EAAsB,EAAE;IACnE,MAAM,MAAM,GAAW,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAA;IAC9C,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;QACzB,OAAO,SAAS,CAAA;IAClB,CAAC;IACD,IAAI,CAAC;QACH,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,gBAAgB,CAAC,EAAE,MAAM,CAAC,CAAA;QACzD,OAAO,MAAM,CAAA;IACf,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,kBAAkB,CAAC,MAAM,CAAC,CAAA;IACnC,CAAC;AACH,CAAC,CAAA;AAED,MAAM,WAAW,GAAG,CAAC,MAAc,EAAY,EAAE;IAC/C,MAAM,GAAG,GAAY,eAAe,CAAC,MAAM,CAAC,CAAA;IAC5C,MAAM,cAAc,GAAuB,kBAAkB,CAAC,MAAM,CAAC,CAAA;IACrE,IAAI,cAAc,KAAK,SAAS,EAAE,CAAC;QACjC,kGAAkG;QAClG,+EAA+E;QAC/E,OAAO,YAAY,CAAC,GAAG,CAAC,CAAA;IAC1B,CAAC;IACD,OAAO,kBAAkB,CAAC,aAAa,CAAC,eAAe,CAAC,cAAc,CAAC,CAAC,EAAE,aAAa,CAAC,GAAG,CAAC,CAAC,CAAA;AAC/F,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,eAAe,GAAa,WAAW,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAA"}
@@ -0,0 +1,13 @@
1
+ import type { Page } from '@playwright/test';
2
+ /**
3
+ * Wait for a page to finish rendering, before anything measures it.
4
+ *
5
+ * Call it after a navigation, and after a state change a scan is about to judge. A still document
6
+ * costs two animation frames; one that is animating costs however long its animations have left; a
7
+ * document that never stops changing costs the budget and no more, so a page nobody can settle slows
8
+ * the sweep rather than hanging it.
9
+ * @param page the page about to be scanned, left on whatever route it holds.
10
+ * @returns nothing. It resolves whether the page settled or the budget ran out.
11
+ */
12
+ export declare const settleForScan: (page: Page) => Promise<void>;
13
+ //# sourceMappingURL=settle.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"settle.d.ts","sourceRoot":"","sources":["../src/settle.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAA;AA8I5C;;;;;;;;;GASG;AACH,eAAO,MAAM,aAAa,GAAU,MAAM,IAAI,KAAG,OAAO,CAAC,IAAI,CAU5D,CAAA"}
package/dist/settle.js ADDED
@@ -0,0 +1,136 @@
1
+ // Why a scan needs a wait at all: `page.goto` resolves at the `load` event, and a React application
2
+ // hydrates after that. axe measured in between reads a tree still being assembled - a heading whose
3
+ // level has not resolved lands in `incomplete`, which a consuming project saw on one run in three -
4
+ // and reads contrast against text the final font has not laid out yet.
5
+ //
6
+ // WHAT IT WAITS FOR, in this order: the document's font set has answered; the element count has held
7
+ // steady across two consecutive animation frames; every animation that will ever end has ended; and
8
+ // the count has held steady once more. Fonts first, because contrast is measured on rendered pixels
9
+ // and a face that arrives late reflows the text being judged. The count before the animations rather
10
+ // than after, for the reason written beside it - an animation cannot be waited for until something has
11
+ // created it, and on a hydrating page the mount is what creates it. Two frames rather than one,
12
+ // because React yields between hydration segments and a
13
+ // yield that happens to straddle a frame boundary is indistinguishable from a finished render if only
14
+ // one frame is asked. A fixed count of frames was the first draft and was wrong in the direction that
15
+ // matters: it settles the pages that were never the problem and gives up on a heavy panel exactly
16
+ // where the defect lives.
17
+ //
18
+ // WHY ANIMATIONS ARE PART OF IT. An element count cannot see an opacity. A page that fades its content
19
+ // in changes no element while it does so, so the count was steady two frames after hydration and a
20
+ // scan then measured a half-transparent paragraph - and axe blends a partial opacity toward the
21
+ // background exactly as an eye does, so it reported a contrast this page never actually renders at
22
+ // rest. That is the harmless direction. The other one is why this is a correctness fix rather than a
23
+ // convenience: text animating TOWARDS a colour too pale to read was measured at its opening frame and
24
+ // PASSED, so the sweep built to catch contrast defects returned green on a page whose resting state is
25
+ // a defect. Waiting for the animations to end measures the state a reader is left looking at.
26
+ //
27
+ // An animation that never ends is excluded rather than waited on, and the distinction is the whole
28
+ // reason this does not simply cost the budget. A spinner has no resting state to wait for, so awaiting
29
+ // it would spend the ceiling below on every settle of every control of every route, in exchange for
30
+ // nothing. `finished` never resolves for one, which is a hang the ceiling would absorb silently. The
31
+ // test for it is `iterations`, which a spinner reports as `Infinity`; a paused or already-finished
32
+ // animation is excluded too, because it is showing the frame a reader is looking at right now.
33
+ //
34
+ // A cancelled animation REJECTS `finished` rather than resolving, and that rejection is swallowed. A
35
+ // cancellation is a state change like any other and the element-count check notices it; ending the
36
+ // whole settle over one cancelled transition would report nothing useful about the page.
37
+ //
38
+ // The two callbacks below are written inline rather than named, which is not a style preference: a
39
+ // named helper closing over nothing is one the shipped rules ask to be hoisted to the outer scope, and
40
+ // the outer scope is the one place this function may not reach.
41
+ //
42
+ // WHY NOT `networkidle`. Playwright's own documentation discourages it; it throws on expiry rather
43
+ // than resolving; and it answers a different question. A page can be network-idle and mid-hydration.
44
+ // It is also unusable here in particular: the sweep runs against `next dev`, whose every page holds a
45
+ // hot-reload socket open, so no page it ever visits goes idle.
46
+ //
47
+ // WHY THE CEILING IS A TIMER. `requestAnimationFrame` does not fire in a page the browser has
48
+ // backgrounded, so a frame-counted ceiling is not a ceiling. A throttled background timer still fires.
49
+ // The race is inside the page for the same reason the hit-target probe does its work in one
50
+ // `evaluate`: a Node-side race would leave the in-page promise pending against a context the next
51
+ // navigation destroys.
52
+ const SETTLE_BUDGET_MS = 1000;
53
+ // Everything this function needs is inside it. Playwright ships a page function to the browser as its
54
+ // own source text, so a reference to anything at module scope here would be a ReferenceError in the
55
+ // page rather than a compile error in this file - the one mistake this shape cannot be checked for.
56
+ // It is also why the animation wait below is written inline rather than as a helper of its own.
57
+ const settleInPage = async (budgetMs) => {
58
+ const quietFrames = 2;
59
+ // Recursive rather than a loop over a counter, because there is no mutable binding to count with:
60
+ // this repository bans `let` and in-place mutation in its own source as well as in a consumer's. Each
61
+ // step awaits a frame, so what grows is frames rather than stack - an awaited recursion returns to
62
+ // the microtask queue every time. The frame is awaited inline because this is its only caller.
63
+ const stable = async (previous, remaining) => {
64
+ await new Promise((resolve) => {
65
+ requestAnimationFrame(() => {
66
+ resolve();
67
+ });
68
+ });
69
+ const current = document.querySelectorAll('*').length;
70
+ if (current !== previous) {
71
+ await stable(current, quietFrames);
72
+ return;
73
+ }
74
+ if (remaining > 1) {
75
+ await stable(current, remaining - 1);
76
+ }
77
+ };
78
+ const settled = async () => {
79
+ // The optional call covers a document carrying no font set at all, which must skip the wait
80
+ // rather than fail the settle.
81
+ await document.fonts?.ready;
82
+ // The element count FIRST, and this order is the whole of it. An animation does not exist until
83
+ // something creates it, and on a hydrating page that something is the mount: measured before the
84
+ // framework has mounted, `getAnimations` answers an honest empty list, and a settle that believed
85
+ // it would scan the very frame the animation is about to start from. Waiting for the tree to stop
86
+ // changing is waiting for the mount, which is what puts the animations on the page to be found.
87
+ await stable(document.querySelectorAll('*').length, quietFrames);
88
+ await Promise.all((document.getAnimations?.() ?? [])
89
+ .filter((animation) => animation.playState === 'running' &&
90
+ animation.effect !== null &&
91
+ Number.isFinite(animation.effect.getComputedTiming().iterations))
92
+ .map(async (animation) => {
93
+ try {
94
+ await animation.finished;
95
+ }
96
+ catch {
97
+ // A cancelled animation rejects rather than resolving. The cancellation is a state change
98
+ // like any other and the count below is what notices it.
99
+ }
100
+ }));
101
+ // And again afterwards, because an animation that ends by revealing a panel adds elements as it
102
+ // finishes. This pass costs two frames on a page where nothing moved.
103
+ await stable(document.querySelectorAll('*').length, quietFrames);
104
+ };
105
+ const deadline = async () => {
106
+ await new Promise((resolve) => {
107
+ setTimeout(() => {
108
+ resolve();
109
+ }, budgetMs);
110
+ });
111
+ };
112
+ await Promise.race([settled(), deadline()]);
113
+ };
114
+ /**
115
+ * Wait for a page to finish rendering, before anything measures it.
116
+ *
117
+ * Call it after a navigation, and after a state change a scan is about to judge. A still document
118
+ * costs two animation frames; one that is animating costs however long its animations have left; a
119
+ * document that never stops changing costs the budget and no more, so a page nobody can settle slows
120
+ * the sweep rather than hanging it.
121
+ * @param page the page about to be scanned, left on whatever route it holds.
122
+ * @returns nothing. It resolves whether the page settled or the budget ran out.
123
+ */
124
+ export const settleForScan = async (page) => {
125
+ try {
126
+ await page.evaluate(settleInPage, SETTLE_BUDGET_MS);
127
+ }
128
+ catch {
129
+ // A route that redirects on mount destroys the execution context while this is in flight, and a
130
+ // closed page cannot be asked anything. Neither is an accessibility finding, and neither should end
131
+ // a sweep: the scan that follows then runs on whatever the page holds, which is what every call
132
+ // site did before this function existed. A page that is genuinely broken still fails at `analyze`,
133
+ // with an axe result to read rather than a protocol error naming no route.
134
+ }
135
+ };
136
+ //# sourceMappingURL=settle.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"settle.js","sourceRoot":"","sources":["../src/settle.ts"],"names":[],"mappings":"AAGA,oGAAoG;AACpG,oGAAoG;AACpG,oGAAoG;AACpG,uEAAuE;AACvE,EAAE;AACF,qGAAqG;AACrG,oGAAoG;AACpG,oGAAoG;AACpG,qGAAqG;AACrG,uGAAuG;AACvG,gGAAgG;AAChG,wDAAwD;AACxD,sGAAsG;AACtG,sGAAsG;AACtG,kGAAkG;AAClG,0BAA0B;AAC1B,EAAE;AACF,uGAAuG;AACvG,mGAAmG;AACnG,gGAAgG;AAChG,mGAAmG;AACnG,qGAAqG;AACrG,sGAAsG;AACtG,uGAAuG;AACvG,8FAA8F;AAC9F,EAAE;AACF,mGAAmG;AACnG,uGAAuG;AACvG,oGAAoG;AACpG,qGAAqG;AACrG,mGAAmG;AACnG,+FAA+F;AAC/F,EAAE;AACF,qGAAqG;AACrG,mGAAmG;AACnG,yFAAyF;AACzF,EAAE;AACF,mGAAmG;AACnG,uGAAuG;A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.ts","sourceRoot":"","sources":["../src/vitest-core.ts"],"names":[],"mappings":"AAUA;;;GAGG;AACH,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,OAAO,EAAE;QAAE,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;QAAC,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAA;KAAE,CAAA;IACtE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAA;IAC5B,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAA;IACvB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;CAC5B;AAWD;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,EAAE,MAAW,CAAA;AAE5C;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,EAAE,MAAsB,CAAA;AASvD;;;;;;GAMG;AACH,eAAO,MAAM,gBAAgB,QAAO,MAAoE,CAAA;AAExG;;;;;;;;GAQG;AACH,eAAO,MAAM,iBAAiB,QAAO,SAAS,MAAM,EACkC,CAAA;AAEtF;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,EAAE,qBAWnC,CAAA;AAEF;;;;;;GAMG;AACH,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,CAAC,gBAAgB,EAAE;IAAE,UAAU,EAAE;QAAE,OAAO,EAAE,KAAK,CAAA;KAAE,CAAA;CAAE,CAAC,CAAA;AAE9F;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,wBAAwB,EAAE,SAAS,aAAa,EAG5D,CAAA;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,aAAa,QAAO,SAAS,aAAa,EAC4B,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"vitest-core.js","sourceRoot":"","sources":["../src/vitest-core.ts"],"names":[],"mappings":"AAAA,2FAA2F;AAC3F,EAAE;AACF,wGAAwG;AACxG,oGAAoG;AACpG,+CAA+C;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM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GAQG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,GAAsB,EAAE,CACvD,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,kBAAkB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,EAAE,CAAA;AAEtF;;;;GAIG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAA0B,MAAM,CAAC,MAAM,CAAC;IACzE,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;IACpD,IAAI,EAAE,eAAe;IACrB,2FAA2F;IAC3F,4FAA4F;IAC5F,UAAU,EAAE,KAAK;IACjB,2FAA2F;IAC3F,KAAK,EAAE,OAAO;IACd,kGAAkG;IAClG,iGAAiG;IACjG,UAAU,EAAE,MAAM;CACnB,CAAC,CAAA;AAWF;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAA6B;IAChE,SAAS;IACT,CAAC,gBAAgB,EAAE,EAAE,UAAU,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,CAAC;CACvD,CAAA;AAED;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,GAA6B,EAAE,CAC1D,OAAO,CAAC,GAAG,CAAC,gBAAgB,CAAC,KAAK,MAAM,CAAC,CAAC,CAAC,wBAAwB,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"vitest-library.d.ts","sourceRoot":"","sources":["../src/vitest-library.ts"],"names":[],"mappings":"AAyCA,QAAA,MAAM,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAmB,CAAA;AAEjE,eAAe,MAAM,CAAA"}
1
+ {"version":3,"file":"vitest-library.d.ts","sourceRoot":"","sources":["../src/vitest-library.ts"],"names":[],"mappings":"AAoCA,QAAA,MAAM,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAmB,CAAA;AAEjE,eAAe,MAAM,CAAA"}
@@ -8,7 +8,7 @@
8
8
  import { COVERAGE_INCLUDE } from '@ploaness/governance';
9
9
  import { defineConfig } from 'vitest/config';
10
10
  import { projectSettings as settings } from './project-settings.js';
11
- import { COVERAGE_THRESHOLD, DETERMINISTIC_SEQUENCE, harnessSetupFile, projectSetupFiles, } from './vitest-core.js';
11
+ import { COVERAGE_THRESHOLD, DETERMINISTIC_SEQUENCE, harnessSetupFile, projectSetupFiles } from './vitest-core.js';
12
12
  const declared = defineConfig({
13
13
  resolve: { tsconfigPaths: true },
14
14
  test: {
@@ -1 +1 @@
1
- {"version":3,"file":"vitest-library.js","sourceRoot":"","sources":["../src/vitest-library.ts"],"names":[],"mappings":"AAAA,oEAAoE;AACpE,EAAE;AACF,uGAAuG;AACvG,oGAAoG;AACpG,uGAAuG;AACvG,sGAAsG;AACtG,qEAAqE;AACrE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAC5C,OAAO,EAAE,eAAe,IAAI,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AACnE,OAAO,EACL,kBAAkB,EAClB,sBAAsB,EACtB,gBAAgB,EAChB,iBAAiB,GAClB,MAAM,kBAAkB,CAAA;AAEzB,MAAM,QAAQ,GAAoC,YAAY,CAAC;IAC7D,OAAO,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE;IAChC,IAAI,EAAE;QACJ,WAAW,EAAE,MAAM;QACnB,OAAO,EAAE,CAAC,8BAA8B,EAAE,4BAA4B,CAAC;QACvE,UAAU,EAAE,CAAC,gBAAgB,EAAE,EAAE,GAAG,iBAAiB,EAAE,CAAC;QACxD,QAAQ,EAAE,sBAAsB;QAChC,QAAQ,EAAE;YACR,QAAQ,EAAE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