@oxog/react-check 1.1.6 → 1.3.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 (64) hide show
  1. package/CHANGELOG.md +115 -1
  2. package/README.md +149 -51
  3. package/dist/browser-inject.global.js +705 -158
  4. package/dist/chain.cjs +8 -531
  5. package/dist/chain.cjs.map +1 -1
  6. package/dist/chain.d.cts +2 -2
  7. package/dist/chain.d.ts +2 -2
  8. package/dist/chain.js +2 -533
  9. package/dist/chain.js.map +1 -1
  10. package/dist/chunk-27R56V2S.js +473 -0
  11. package/dist/chunk-27R56V2S.js.map +1 -0
  12. package/dist/chunk-3K2AER5M.cjs +356 -0
  13. package/dist/chunk-3K2AER5M.cjs.map +1 -0
  14. package/dist/chunk-7R4KKJTW.cjs +255 -0
  15. package/dist/chunk-7R4KKJTW.cjs.map +1 -0
  16. package/dist/chunk-7YYMP3PP.js +723 -0
  17. package/dist/chunk-7YYMP3PP.js.map +1 -0
  18. package/dist/chunk-DWM55ACO.cjs +294 -0
  19. package/dist/chunk-DWM55ACO.cjs.map +1 -0
  20. package/dist/chunk-G7YVIPS7.cjs +475 -0
  21. package/dist/chunk-G7YVIPS7.cjs.map +1 -0
  22. package/dist/chunk-GE2ZX7I7.cjs +727 -0
  23. package/dist/chunk-GE2ZX7I7.cjs.map +1 -0
  24. package/dist/chunk-GS7T56RP.cjs +9 -0
  25. package/dist/chunk-GS7T56RP.cjs.map +1 -0
  26. package/dist/chunk-IM6OG2IC.js +338 -0
  27. package/dist/chunk-IM6OG2IC.js.map +1 -0
  28. package/dist/chunk-RQYHXWUC.js +292 -0
  29. package/dist/chunk-RQYHXWUC.js.map +1 -0
  30. package/dist/chunk-WLN7ZVO4.js +253 -0
  31. package/dist/chunk-WLN7ZVO4.js.map +1 -0
  32. package/dist/cli.js +1443 -207
  33. package/dist/cli.js.map +1 -1
  34. package/dist/detect.cjs +22 -324
  35. package/dist/detect.cjs.map +1 -1
  36. package/dist/detect.d.cts +8 -2
  37. package/dist/detect.d.ts +8 -2
  38. package/dist/detect.js +1 -324
  39. package/dist/detect.js.map +1 -1
  40. package/dist/{event-emitter-CxKUDo9q.d.cts → event-emitter-BVYUPYLd.d.cts} +3 -2
  41. package/dist/{event-emitter-CxKUDo9q.d.ts → event-emitter-BVYUPYLd.d.ts} +3 -2
  42. package/dist/fix.cjs +6 -715
  43. package/dist/fix.cjs.map +1 -1
  44. package/dist/fix.d.cts +2 -2
  45. package/dist/fix.d.ts +2 -2
  46. package/dist/fix.js +2 -719
  47. package/dist/fix.js.map +1 -1
  48. package/dist/index.cjs +2380 -3308
  49. package/dist/index.cjs.map +1 -1
  50. package/dist/index.d.cts +255 -88
  51. package/dist/index.d.ts +255 -88
  52. package/dist/index.js +2289 -3290
  53. package/dist/index.js.map +1 -1
  54. package/dist/{scanner-CTBraprQ.d.ts → scanner-D0mBQGTx.d.ts} +23 -3
  55. package/dist/{scanner-5j2LEM-q.d.cts → scanner-DUBgwztZ.d.cts} +23 -3
  56. package/dist/scanner.cjs +8 -1652
  57. package/dist/scanner.cjs.map +1 -1
  58. package/dist/scanner.d.cts +3 -3
  59. package/dist/scanner.d.ts +3 -3
  60. package/dist/scanner.js +4 -1656
  61. package/dist/scanner.js.map +1 -1
  62. package/dist/{types-xAXT9cir.d.cts → types-BZ3OeZ-5.d.cts} +28 -10
  63. package/dist/{types-xAXT9cir.d.ts → types-BZ3OeZ-5.d.ts} +28 -10
  64. package/package.json +20 -11
@@ -1,5 +1,5 @@
1
- import { h as ComponentStats, f as Severity, l as ThresholdOptions, R as RenderInfo, j as SessionSummary, d as RenderChainInfo, g as FixSuggestion, c as ScannerConfig } from './types-xAXT9cir.js';
2
- import { E as EventEmitter } from './event-emitter-CxKUDo9q.js';
1
+ import { h as ComponentStats, f as Severity, l as ThresholdOptions, R as RenderInfo, j as SessionSummary, c as RenderChainInfo, g as FixSuggestion, d as ScannerConfig, o as RuleOptions } from './types-BZ3OeZ-5.js';
2
+ import { E as EventEmitter } from './event-emitter-BVYUPYLd.js';
3
3
 
4
4
  /**
5
5
  * Statistics collector for component render data
@@ -230,6 +230,8 @@ declare class Scanner extends EventEmitter<ScannerEvents> {
230
230
  constructor(options?: {
231
231
  config?: Partial<ScannerConfig>;
232
232
  thresholds?: Partial<ThresholdOptions>;
233
+ /** Fix-suggestion rule levels by rule id (`off` disables a rule) */
234
+ rules?: RuleOptions;
233
235
  });
234
236
  /**
235
237
  * Set up event forwarding from sub-modules
@@ -254,9 +256,27 @@ declare class Scanner extends EventEmitter<ScannerEvents> {
254
256
  */
255
257
  addRender(render: RenderInfo, parent?: string): void;
256
258
  /**
257
- * Record a frame for FPS calculation
259
+ * Check a component name against the configured include/exclude patterns
260
+ * @param name - Component name
261
+ * @returns true if renders of this component should be tracked
262
+ */
263
+ isComponentIncluded(name: string): boolean;
264
+ /**
265
+ * Record a painted frame for FPS calculation (the scanner derives FPS from
266
+ * frames recorded during each one-second window)
258
267
  */
259
268
  recordFrame(): void;
269
+ /**
270
+ * Record an FPS sample measured elsewhere (e.g. by requestAnimationFrame in
271
+ * the browser)
272
+ * @param fps - Frames per second
273
+ */
274
+ recordFps(fps: number): void;
275
+ /**
276
+ * FPS threshold below which `fps-drop` is emitted
277
+ * @returns Threshold
278
+ */
279
+ private getFpsThreshold;
260
280
  /**
261
281
  * Schedule batch processing
262
282
  */
@@ -1,5 +1,5 @@
1
- import { h as ComponentStats, f as Severity, l as ThresholdOptions, R as RenderInfo, j as SessionSummary, d as RenderChainInfo, g as FixSuggestion, c as ScannerConfig } from './types-xAXT9cir.cjs';
2
- import { E as EventEmitter } from './event-emitter-CxKUDo9q.cjs';
1
+ import { h as ComponentStats, f as Severity, l as ThresholdOptions, R as RenderInfo, j as SessionSummary, c as RenderChainInfo, g as FixSuggestion, d as ScannerConfig, o as RuleOptions } from './types-BZ3OeZ-5.cjs';
2
+ import { E as EventEmitter } from './event-emitter-BVYUPYLd.cjs';
3
3
 
4
4
  /**
5
5
  * Statistics collector for component render data
@@ -230,6 +230,8 @@ declare class Scanner extends EventEmitter<ScannerEvents> {
230
230
  constructor(options?: {
231
231
  config?: Partial<ScannerConfig>;
232
232
  thresholds?: Partial<ThresholdOptions>;
233
+ /** Fix-suggestion rule levels by rule id (`off` disables a rule) */
234
+ rules?: RuleOptions;
233
235
  });
234
236
  /**
235
237
  * Set up event forwarding from sub-modules
@@ -254,9 +256,27 @@ declare class Scanner extends EventEmitter<ScannerEvents> {
254
256
  */
255
257
  addRender(render: RenderInfo, parent?: string): void;
256
258
  /**
257
- * Record a frame for FPS calculation
259
+ * Check a component name against the configured include/exclude patterns
260
+ * @param name - Component name
261
+ * @returns true if renders of this component should be tracked
262
+ */
263
+ isComponentIncluded(name: string): boolean;
264
+ /**
265
+ * Record a painted frame for FPS calculation (the scanner derives FPS from
266
+ * frames recorded during each one-second window)
258
267
  */
259
268
  recordFrame(): void;
269
+ /**
270
+ * Record an FPS sample measured elsewhere (e.g. by requestAnimationFrame in
271
+ * the browser)
272
+ * @param fps - Frames per second
273
+ */
274
+ recordFps(fps: number): void;
275
+ /**
276
+ * FPS threshold below which `fps-drop` is emitted
277
+ * @returns Threshold
278
+ */
279
+ private getFpsThreshold;
260
280
  /**
261
281
  * Schedule batch processing
262
282
  */