Skip to content

Commit 6c024b1

Browse files
committed
chore: delete dead code and unused deps
Repo-wide over-engineering audit. 43 unused ui components, dead use-media-query hook, scratch test.py, empty pyproject extras, redundant per-page timeout setup, and 3 unused web deps (zod, react-day-picker, tw-animate-css). No public behavior change; legacy-extras doc claim dropped since the empty extras are gone.
1 parent b099f62 commit 6c024b1

59 files changed

Lines changed: 20 additions & 7006 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -444,8 +444,7 @@ command = "webskrap-mcp"
444444
args = []
445445
```
446446

447-
The legacy extras `webskrap[mcp]` and `webskrap[stealth]` remain accepted for
448-
older install snippets, but MCP and Patchright are included by default.
447+
MCP and Patchright are included by default; no extras are needed.
449448

450449
## Performance benchmarks
451450

benchmarks.py

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,9 @@
4848

4949
def _build_page() -> str:
5050
images = "".join(f'<img src="/asset/img/{i}.png">' for i in range(N_IMAGES))
51-
styles = "".join(
52-
f'<link rel="stylesheet" href="/asset/css/{i}.css">' for i in range(N_STYLES)
53-
)
51+
styles = "".join(f'<link rel="stylesheet" href="/asset/css/{i}.css">' for i in range(N_STYLES))
5452
media = "".join(
55-
f'<video src="/asset/media/{i}.mp4" preload="auto"></video>'
56-
for i in range(N_MEDIA)
53+
f'<video src="/asset/media/{i}.mp4" preload="auto"></video>' for i in range(N_MEDIA)
5754
)
5855
return (
5956
"<!doctype html><html><head><title>Benchmark</title>"
@@ -151,9 +148,7 @@ async def bench_warm_session(session) -> None:
151148

152149
@benchmark
153150
async def bench_concurrent(session) -> None:
154-
await asyncio.gather(
155-
*(session.fetch(URL, wait_until="load") for _ in range(CONCURRENCY))
156-
)
151+
await asyncio.gather(*(session.fetch(URL, wait_until="load") for _ in range(CONCURRENCY)))
157152

158153

159154
def display(title: str, results: dict[str, float], baseline_key: str) -> None:
@@ -179,9 +174,7 @@ async def main() -> None:
179174
("LITE", ResourcePolicy.LITE),
180175
("DOCUMENTS", ResourcePolicy.DOCUMENTS),
181176
):
182-
session = await client.session(
183-
f"policy_{label}", config=_config(policy)
184-
)
177+
session = await client.session(f"policy_{label}", config=_config(policy))
185178
policy_results[label] = await bench_policy(session)
186179
display(
187180
"Resource routing (full page load with delayed assets)",

pyproject.toml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
44

55
[project]
66
name = "webskrap"
7-
version = "0.6.0"
7+
version = "0.6.1"
88
description = "A Playwright-based Python scraping framework with coherent browser profiles and session controls."
99
readme = "README.md"
1010
requires-python = ">=3.11"
@@ -38,10 +38,6 @@ dev = [
3838
"pytest-asyncio>=0.24",
3939
"ruff>=0.8",
4040
]
41-
stealth = [
42-
]
43-
mcp = [
44-
]
4541

4642
[project.scripts]
4743
webskrap = "webskrap.cli:app"

src/webskrap/cli.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,6 @@ async def _fetch(
346346
navigation_timeout_ms=timeout_ms,
347347
resource_policy=resource_policy,
348348
patchright_context_profile=patchright_context_profile,
349-
patchright_focus_control=None,
350349
reduce_fingerprint_surface=reduce_fingerprint_surface,
351350
mask_headless_user_agent=mask_headless_user_agent,
352351
launch_args=launch_args,

src/webskrap/client.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ async def fetch(
7878
started = time.perf_counter()
7979
page = await self.context.new_page()
8080
try:
81-
_configure_page_timeouts(page, self.config)
8281
response = await page.goto(
8382
url,
8483
wait_until=wait_until,
@@ -363,11 +362,6 @@ async def handle(route) -> None:
363362
return handle
364363

365364

366-
def _configure_page_timeouts(page: Page, config: SessionConfig) -> None:
367-
page.set_default_timeout(config.default_timeout_ms)
368-
page.set_default_navigation_timeout(config.navigation_timeout_ms)
369-
370-
371365
def _human_click_point(
372366
box: dict[str, float],
373367
position: dict[str, float] | None,

uv.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

web/bun.lock

Lines changed: 9 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

web/content/getting-started/installation.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@ webskrap profiles
2727
- Patchright stealth sessions.
2828
- The `webskrap-mcp` server.
2929

30-
The legacy extras `webskrap[stealth]` and `webskrap[mcp]` still install, but
31-
they are no longer required.
30+
No extras are needed; everything above ships with the base install.
3231

3332
Use machine-readable setup output in automation:
3433

web/package.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
"next": "16.2.9",
1818
"next-themes": "^0.4.6",
1919
"react": "19.2.4",
20-
"react-day-picker": "^10.0.1",
2120
"react-dom": "19.2.4",
2221
"rehype-pretty-code": "^0.14.3",
2322
"rehype-raw": "^7.0.0",
@@ -28,8 +27,7 @@
2827
"remark-rehype": "^11.1.2",
2928
"shiki": "^4.3.0",
3029
"tailwind-merge": "^3.6.0",
31-
"unified": "^11.0.5",
32-
"zod": "4.1.12"
30+
"unified": "^11.0.5"
3331
},
3432
"devDependencies": {
3533
"@tailwindcss/postcss": "^4.3.2",
@@ -39,7 +37,6 @@
3937
"eslint": "^9.39.4",
4038
"eslint-config-next": "16.2.9",
4139
"tailwindcss": "^4.3.2",
42-
"tw-animate-css": "^1.4.0",
4340
"typescript": "^5.9.3"
4441
},
4542
"ignoreScripts": [

web/src/app/docs/benchmarks/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ export default function BenchmarksPage() {
291291
Latest WebSkrap live summary: 24 passed, 2 failed, 1 skipped. Headed: 17
292292
passed, 1 failed. Headless: 7 passed, 1 failed, 1 skipped. The two failures
293293
were Sannysoft headed/headless networkidle timeouts; the headless skip was
294-
reCAPTCHA v3 not returning a score from Google's public demo.
294+
reCAPTCHA v3 not returning a score from Google&apos;s public demo.
295295
</FrameDescription>
296296
</FrameHeader>
297297
</Frame>

0 commit comments

Comments
 (0)