rerender-lens 0.4.0 → 0.5.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/CHANGELOG.md +78 -0
- package/README.md +192 -362
- package/dist/{budget-COBu7jBU.d.cts → budget-BnJlYwrV.d.ts} +20 -10
- package/dist/{budget-LkNjGtRc.d.ts → budget-CRswn-nC.d.cts} +20 -10
- package/dist/cli.cjs +248 -31
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +248 -31
- package/dist/cli.js.map +1 -1
- package/dist/{devtools-CZebzpF6.d.ts → devtools-BYWat7nQ.d.ts} +7 -1
- package/dist/{devtools-BkCct3cJ.d.cts → devtools-DJi_6AfJ.d.cts} +7 -1
- package/dist/index.cjs +439 -41
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +131 -8
- package/dist/index.d.ts +131 -8
- package/dist/index.js +424 -42
- package/dist/index.js.map +1 -1
- package/dist/jest-setup.cjs +1673 -0
- package/dist/jest-setup.cjs.map +1 -0
- package/dist/jest-setup.d.cts +8 -0
- package/dist/jest-setup.d.ts +8 -0
- package/dist/jest-setup.js +1671 -0
- package/dist/jest-setup.js.map +1 -0
- package/dist/jest.cjs +1760 -0
- package/dist/jest.cjs.map +1 -0
- package/dist/jest.d.cts +23 -0
- package/dist/jest.d.ts +23 -0
- package/dist/jest.js +1751 -0
- package/dist/jest.js.map +1 -0
- package/dist/{notifiers-BjjGSHpp.d.ts → notifiers-DwKlvv4H.d.cts} +8 -4
- package/dist/{notifiers-BGQtWKfX.d.cts → notifiers-FNzKHs0a.d.ts} +8 -4
- package/dist/playwright.cjs +230 -28
- package/dist/playwright.cjs.map +1 -1
- package/dist/playwright.d.cts +4 -4
- package/dist/playwright.d.ts +4 -4
- package/dist/playwright.js +230 -28
- package/dist/playwright.js.map +1 -1
- package/dist/relay.cjs +10 -2
- package/dist/relay.cjs.map +1 -1
- package/dist/relay.js +10 -2
- package/dist/relay.js.map +1 -1
- package/dist/rerender-lens.iife.js +356 -54
- package/dist/runner-report-B8Sc3FZO.d.cts +46 -0
- package/dist/runner-report-CW8X5RwK.d.ts +46 -0
- package/dist/setup.cjs +112 -27
- package/dist/setup.cjs.map +1 -1
- package/dist/setup.js +112 -27
- package/dist/setup.js.map +1 -1
- package/dist/{types-BzUEVkxJ.d.cts → types-DW5-N2XH.d.cts} +55 -2
- package/dist/{types-BzUEVkxJ.d.ts → types-DW5-N2XH.d.ts} +55 -2
- package/dist/vite.d.cts +1 -1
- package/dist/vite.d.ts +1 -1
- package/dist/vitest-setup.cjs +337 -41
- package/dist/vitest-setup.cjs.map +1 -1
- package/dist/vitest-setup.d.cts +4 -4
- package/dist/vitest-setup.d.ts +4 -4
- package/dist/vitest-setup.js +337 -41
- package/dist/vitest-setup.js.map +1 -1
- package/dist/vitest.cjs +400 -77
- package/dist/vitest.cjs.map +1 -1
- package/dist/vitest.d.cts +21 -39
- package/dist/vitest.d.ts +21 -39
- package/dist/vitest.js +401 -78
- package/dist/vitest.js.map +1 -1
- package/package.json +40 -4
- package/panel/panel.css +1 -0
- package/panel/panel.js +499 -309
package/dist/vitest.d.cts
CHANGED
|
@@ -1,44 +1,28 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
export { c as checkBudget, f as formatFixes } from './budget-
|
|
1
|
+
import { R as ReporterOptions } from './runner-report-B8Sc3FZO.cjs';
|
|
2
|
+
export { L as LensSetup, O as OUT_ENV, a as RunResult, S as SetupHooks, b as SetupOptions, r as readRun, s as setupRerenderLens } from './runner-report-B8Sc3FZO.cjs';
|
|
3
|
+
export { c as checkBudget, f as formatFixes } from './budget-CRswn-nC.cjs';
|
|
4
|
+
import './types-DW5-N2XH.cjs';
|
|
5
|
+
import './notifiers-DwKlvv4H.cjs';
|
|
4
6
|
|
|
5
|
-
declare const OUT_ENV = "RERENDER_LENS_OUT";
|
|
6
|
-
interface SetupOptions extends Omit<Options, 'notifier'> {
|
|
7
|
-
/** Also fail each test file that recorded avoidable re-renders (default false: the reporter decides). */
|
|
8
|
-
failFast?: boolean;
|
|
9
|
-
}
|
|
10
|
-
/** How the setup ties into the test runner (`{ afterAll }` from 'vitest'; `rerender-lens/vitest/setup` does this). */
|
|
11
|
-
interface SetupHooks {
|
|
12
|
-
afterAll?: (fn: () => void) => void;
|
|
13
|
-
/** Path of the current test file, for the reporter's output. */
|
|
14
|
-
testPath?: () => string | undefined;
|
|
15
|
-
}
|
|
16
|
-
interface LensSetup {
|
|
17
|
-
collector: Collector;
|
|
18
|
-
/** Append this file's reports to the shared output and clear the collector; registered with `afterAll` when given. */
|
|
19
|
-
flush(): void;
|
|
20
|
-
}
|
|
21
7
|
/**
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
8
|
+
* Vitest integration: one `setupFiles` line collects every avoidable re-render across the run,
|
|
9
|
+
* and a reporter prints the ranked fixes (and enforces a budget file) when the run ends.
|
|
10
|
+
*
|
|
11
|
+
* // vitest.config.ts
|
|
12
|
+
* test: {
|
|
13
|
+
* setupFiles: ['rerender-lens/vitest/setup'],
|
|
14
|
+
* reporters: ['default', ['rerender-lens/vitest', { budget: 'rerender-budget.json' }]],
|
|
15
|
+
* }
|
|
16
|
+
*
|
|
17
|
+
* Custom options: write your own setup file and call `setupRerenderLens(options, { afterAll })`.
|
|
18
|
+
*
|
|
19
|
+
* Everything that is not Vitest-specific lives in `src/runner-report.ts`, shared with
|
|
20
|
+
* `rerender-lens/jest`.
|
|
25
21
|
*/
|
|
26
|
-
|
|
27
|
-
interface ReporterOptions {
|
|
28
|
-
/** Path to a budget JSON (`{ "*": 0, "Row": 2 }`). When set, the run fails on violations. */
|
|
29
|
-
budget?: string;
|
|
30
|
-
/** Print at most this many fixes. Default 10. */
|
|
31
|
-
limit?: number;
|
|
32
|
-
/** Also write the collected reports here as a panel-compatible export (`Sessions > Import`). */
|
|
33
|
-
exportTo?: string;
|
|
34
|
-
/** Where the lines go. Default `process.stdout`. */
|
|
35
|
-
write?: (line: string) => void;
|
|
36
|
-
}
|
|
22
|
+
|
|
37
23
|
/** Vitest reporter (`reporters: [['rerender-lens/vitest', { budget }]]`). */
|
|
38
24
|
declare class RerenderLensReporter {
|
|
39
|
-
private
|
|
40
|
-
private file;
|
|
41
|
-
private done;
|
|
25
|
+
private core;
|
|
42
26
|
constructor(options?: ReporterOptions);
|
|
43
27
|
onInit(): void;
|
|
44
28
|
onTestRunEnd(): void;
|
|
@@ -46,7 +30,5 @@ declare class RerenderLensReporter {
|
|
|
46
30
|
onFinished(): void;
|
|
47
31
|
private finish;
|
|
48
32
|
}
|
|
49
|
-
/** Reports from every worker of a run. */
|
|
50
|
-
declare function readRun(file: string): RenderReport[];
|
|
51
33
|
|
|
52
|
-
export {
|
|
34
|
+
export { ReporterOptions, RerenderLensReporter as default };
|
package/dist/vitest.d.ts
CHANGED
|
@@ -1,44 +1,28 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
export { c as checkBudget, f as formatFixes } from './budget-
|
|
1
|
+
import { R as ReporterOptions } from './runner-report-CW8X5RwK.js';
|
|
2
|
+
export { L as LensSetup, O as OUT_ENV, a as RunResult, S as SetupHooks, b as SetupOptions, r as readRun, s as setupRerenderLens } from './runner-report-CW8X5RwK.js';
|
|
3
|
+
export { c as checkBudget, f as formatFixes } from './budget-BnJlYwrV.js';
|
|
4
|
+
import './types-DW5-N2XH.js';
|
|
5
|
+
import './notifiers-FNzKHs0a.js';
|
|
4
6
|
|
|
5
|
-
declare const OUT_ENV = "RERENDER_LENS_OUT";
|
|
6
|
-
interface SetupOptions extends Omit<Options, 'notifier'> {
|
|
7
|
-
/** Also fail each test file that recorded avoidable re-renders (default false: the reporter decides). */
|
|
8
|
-
failFast?: boolean;
|
|
9
|
-
}
|
|
10
|
-
/** How the setup ties into the test runner (`{ afterAll }` from 'vitest'; `rerender-lens/vitest/setup` does this). */
|
|
11
|
-
interface SetupHooks {
|
|
12
|
-
afterAll?: (fn: () => void) => void;
|
|
13
|
-
/** Path of the current test file, for the reporter's output. */
|
|
14
|
-
testPath?: () => string | undefined;
|
|
15
|
-
}
|
|
16
|
-
interface LensSetup {
|
|
17
|
-
collector: Collector;
|
|
18
|
-
/** Append this file's reports to the shared output and clear the collector; registered with `afterAll` when given. */
|
|
19
|
-
flush(): void;
|
|
20
|
-
}
|
|
21
7
|
/**
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
8
|
+
* Vitest integration: one `setupFiles` line collects every avoidable re-render across the run,
|
|
9
|
+
* and a reporter prints the ranked fixes (and enforces a budget file) when the run ends.
|
|
10
|
+
*
|
|
11
|
+
* // vitest.config.ts
|
|
12
|
+
* test: {
|
|
13
|
+
* setupFiles: ['rerender-lens/vitest/setup'],
|
|
14
|
+
* reporters: ['default', ['rerender-lens/vitest', { budget: 'rerender-budget.json' }]],
|
|
15
|
+
* }
|
|
16
|
+
*
|
|
17
|
+
* Custom options: write your own setup file and call `setupRerenderLens(options, { afterAll })`.
|
|
18
|
+
*
|
|
19
|
+
* Everything that is not Vitest-specific lives in `src/runner-report.ts`, shared with
|
|
20
|
+
* `rerender-lens/jest`.
|
|
25
21
|
*/
|
|
26
|
-
|
|
27
|
-
interface ReporterOptions {
|
|
28
|
-
/** Path to a budget JSON (`{ "*": 0, "Row": 2 }`). When set, the run fails on violations. */
|
|
29
|
-
budget?: string;
|
|
30
|
-
/** Print at most this many fixes. Default 10. */
|
|
31
|
-
limit?: number;
|
|
32
|
-
/** Also write the collected reports here as a panel-compatible export (`Sessions > Import`). */
|
|
33
|
-
exportTo?: string;
|
|
34
|
-
/** Where the lines go. Default `process.stdout`. */
|
|
35
|
-
write?: (line: string) => void;
|
|
36
|
-
}
|
|
22
|
+
|
|
37
23
|
/** Vitest reporter (`reporters: [['rerender-lens/vitest', { budget }]]`). */
|
|
38
24
|
declare class RerenderLensReporter {
|
|
39
|
-
private
|
|
40
|
-
private file;
|
|
41
|
-
private done;
|
|
25
|
+
private core;
|
|
42
26
|
constructor(options?: ReporterOptions);
|
|
43
27
|
onInit(): void;
|
|
44
28
|
onTestRunEnd(): void;
|
|
@@ -46,7 +30,5 @@ declare class RerenderLensReporter {
|
|
|
46
30
|
onFinished(): void;
|
|
47
31
|
private finish;
|
|
48
32
|
}
|
|
49
|
-
/** Reports from every worker of a run. */
|
|
50
|
-
declare function readRun(file: string): RenderReport[];
|
|
51
33
|
|
|
52
|
-
export {
|
|
34
|
+
export { ReporterOptions, RerenderLensReporter as default };
|