Skip to content

Commit dcd77bb

Browse files
committed
chore: align Fallow with docs workspace
1 parent 6b6dcf0 commit dcd77bb

6 files changed

Lines changed: 5190 additions & 8027 deletions

File tree

‎.fallowrc.json‎

Lines changed: 55 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
{
22
"$schema": "https://raw.githubusercontent.com/fallow-rs/fallow/main/schema.json",
33
"entry": [
4-
"fixtures/react-compat/rsbuild.config.mjs",
5-
"storybook/stories/**/*.mdx"
4+
"apps/docs/blume.config.ts",
5+
"apps/docs/components.ts",
6+
"apps/docs/docs/**/*.mdx",
7+
"apps/docs/docs/**/meta.ts",
8+
"apps/docs/islands/ObserverDemo.tsx",
9+
"apps/storybook/stories/**/*.mdx",
10+
"packages/react-intersection-observer/fixtures/react-compat/rsbuild.config.mjs"
611
],
712
"ignoreDependencies": [
813
"@rsbuild/core",
@@ -33,25 +38,69 @@
3338
"maxCognitive": 15,
3439
"maxCrap": 30,
3540
"maxUnitSize": 60,
36-
"coverage": "coverage/coverage-final.json",
41+
"coverage": "packages/react-intersection-observer/coverage/coverage-final.json",
3742
"thresholdOverrides": [
3843
{
39-
"files": ["storybook/stories/elements.tsx"],
44+
"files": ["apps/storybook/stories/elements.tsx"],
4045
"functions": ["EntryDetails", "ScrollWrapper"],
4146
"maxCrap": 31,
4247
"reason": "Interactive Storybook demos are intentionally excluded from unit coverage; retain the default structural complexity limits while allowing these two estimated CRAP scores."
4348
},
4449
{
45-
"files": ["storybook/stories/useInView.story.tsx"],
50+
"files": ["apps/storybook/stories/useInView.story.tsx"],
4651
"functions": ["HooksRender"],
4752
"maxCrap": 43,
4853
"reason": "This interactive Storybook demo is intentionally excluded from unit coverage; retain the default structural complexity limits while allowing its estimated CRAP score."
4954
},
5055
{
51-
"files": ["storybook/stories/useOnInView.story.tsx"],
56+
"files": ["apps/storybook/stories/useOnInView.story.tsx"],
5257
"functions": ["UseOnInViewRender"],
5358
"maxCrap": 57,
5459
"reason": "This interactive Storybook demo is intentionally excluded from unit coverage; retain the default structural complexity limits while allowing its measured CRAP score of 56."
60+
},
61+
{
62+
"files": ["apps/docs/components/Logo.astro"],
63+
"functions": ["<template>"],
64+
"maxCrap": 157,
65+
"reason": "The documentation logo has template-only conditional rendering and no unit-test harness; retain the default complexity limits while allowing its estimated CRAP score of 156."
66+
},
67+
{
68+
"files": ["apps/docs/islands/ObserverDemo.tsx"],
69+
"functions": ["LiveObserverDemo"],
70+
"maxCognitive": 23,
71+
"maxCrap": 421,
72+
"reason": "The interactive docs demo deliberately combines the selected threshold, observer result, and visible custom-root feed in one copyable example; it has no unit-test harness, so retain explicit complexity and CRAP ceilings for this single renderer."
73+
},
74+
{
75+
"files": ["apps/docs/islands/ObserverDemo.tsx"],
76+
"functions": ["ThresholdButton"],
77+
"maxCrap": 57,
78+
"reason": "The threshold-button renderer is part of the interactive documentation example and has no unit-test harness; retain its estimated CRAP score without relaxing the file globally."
79+
},
80+
{
81+
"files": ["apps/docs/islands/RecipeDemo.tsx"],
82+
"functions": ["LazyImageDemo"],
83+
"maxCrap": 91,
84+
"reason": "This interactive lazy-image recipe is exercised in the documentation site rather than a unit-test harness; retain its estimated CRAP score without relaxing the file globally."
85+
},
86+
{
87+
"files": ["apps/docs/islands/RecipeDemo.tsx"],
88+
"functions": ["RevealDemo"],
89+
"maxCrap": 183,
90+
"reason": "This interactive reveal recipe is exercised in the documentation site rather than a unit-test harness; retain its estimated CRAP score without relaxing the file globally."
91+
},
92+
{
93+
"files": ["apps/docs/islands/RecipeDemo.tsx"],
94+
"functions": ["InfiniteListDemo"],
95+
"maxCognitive": 20,
96+
"maxCrap": 111,
97+
"reason": "This interactive infinite-list recipe combines retry and loading state in one visible example and has no unit-test harness; retain its measured complexity without relaxing the file globally."
98+
},
99+
{
100+
"files": ["apps/docs/islands/RecipeDemo.tsx"],
101+
"functions": ["RecipeDemo", "DemoStatus"],
102+
"maxCrap": 31,
103+
"reason": "These small recipe-dispatch and status renderers are exercised in the documentation site rather than a unit-test harness; retain their estimated CRAP scores without relaxing the file globally."
55104
}
56105
],
57106
"suggestInlineSuppression": false

‎.github/workflows/test.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
CI: true
3333
- name: Fallow audit
3434
if: github.event_name == 'pull_request'
35-
run: pnpm fallow audit --base "origin/${{ github.base_ref }}"
35+
run: pnpm fallow audit --base "origin/${{ github.base_ref }}" --coverage packages/react-intersection-observer/coverage/coverage-final.json
3636
- name: Build
3737
run: pnpm build:all
3838

‎apps/docs/islands/ObserverDemo.tsx‎

Lines changed: 43 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -247,35 +247,12 @@ function LiveObserverDemo() {
247247
style={{ display: "flex", gap: "0.4rem", marginTop: "0.5rem" }}
248248
>
249249
{thresholds.map((value) => (
250-
<button
251-
aria-pressed={threshold === value}
252-
aria-label={`Trigger when ${value === 0 ? "any part" : `${value * 100}%`} of the card is visible`}
250+
<ThresholdButton
253251
key={value}
254-
onClick={() => setThreshold(value)}
255-
style={{
256-
background:
257-
threshold === value
258-
? "var(--blume-action)"
259-
: "var(--color-background)",
260-
border:
261-
threshold === value
262-
? "1px solid color-mix(in srgb, var(--blume-action) 72%, var(--color-foreground))"
263-
: "1px solid color-mix(in srgb, var(--color-foreground) 24%, transparent)",
264-
borderRadius: "0.4rem",
265-
color:
266-
threshold === value
267-
? "var(--blume-action-foreground)"
268-
: "var(--color-foreground)",
269-
cursor: "pointer",
270-
flex: 1,
271-
font: "inherit",
272-
fontWeight: threshold === value ? 700 : 500,
273-
padding: "0.55rem 0.2rem",
274-
}}
275-
type="button"
276-
>
277-
{value === 0 ? "Any" : `${value * 100}%`}
278-
</button>
252+
onSelect={setThreshold}
253+
selected={threshold === value}
254+
value={value}
255+
/>
279256
))}
280257
</div>
281258
</div>
@@ -374,6 +351,44 @@ function LiveObserverDemo() {
374351
);
375352
}
376353

354+
function ThresholdButton({
355+
onSelect,
356+
selected,
357+
value,
358+
}: {
359+
onSelect: (value: (typeof thresholds)[number]) => void;
360+
selected: boolean;
361+
value: (typeof thresholds)[number];
362+
}) {
363+
return (
364+
<button
365+
aria-label={`Trigger when ${value === 0 ? "any part" : `${value * 100}%`} of the card is visible`}
366+
aria-pressed={selected}
367+
onClick={() => onSelect(value)}
368+
style={{
369+
background: selected
370+
? "var(--blume-action)"
371+
: "var(--color-background)",
372+
border: selected
373+
? "1px solid color-mix(in srgb, var(--blume-action) 72%, var(--color-foreground))"
374+
: "1px solid color-mix(in srgb, var(--color-foreground) 24%, transparent)",
375+
borderRadius: "0.4rem",
376+
color: selected
377+
? "var(--blume-action-foreground)"
378+
: "var(--color-foreground)",
379+
cursor: "pointer",
380+
flex: 1,
381+
font: "inherit",
382+
fontWeight: selected ? 700 : 500,
383+
padding: "0.55rem 0.2rem",
384+
}}
385+
type="button"
386+
>
387+
{value === 0 ? "Any" : `${value * 100}%`}
388+
</button>
389+
);
390+
}
391+
377392
function FeedTeaser({ label, tone }: { label: string; tone: "cool" | "warm" }) {
378393
return (
379394
<div

‎apps/docs/islands/RecipeDemo.tsx‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ import {
66
} from "react";
77
import { useInView, useOnInView } from "react-intersection-observer";
88

9-
export const client = "load";
10-
119
export type Recipe = "lazy-image" | "reveal" | "impression" | "infinite-list";
1210

1311
export default function RecipeDemo({ recipe }: { recipe: Recipe }) {

‎packages/react-intersection-observer/package.json‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,6 @@
128128
"@vitest/browser-playwright": "^4.0.16",
129129
"@vitest/coverage-istanbul": "^4.0.16",
130130
"bumpp": "^10.3.2",
131-
"microbundle": "^0.15.1",
132131
"npm-run-all": "^4.1.5",
133132
"playwright": "^1.57.0",
134133
"publint": "^0.3.16",

0 commit comments

Comments
 (0)