chore: deep-init

Signed-off-by: Dmytro Stanchiev <git@dmytros.dev>
This commit is contained in:
2026-04-21 20:46:29 -04:00
parent c58d614948
commit 86191e7a45
8 changed files with 154 additions and 867 deletions

View File

@@ -0,0 +1,31 @@
# packages/core
## Scope
- This package owns scraper behavior, parsing, result shapes, shared cookie handling, and shared HTTP utilities.
- Put marketplace-specific logic in `src/scrapers/*.ts`.
- Put reusable cross-marketplace helpers in `src/utils/*` only when at least two callers need them.
## Keep Stable
- Cookie loading order is a hard invariant: parameter > env var > file.
- Exported names in `src/index.ts` are the package contract for `api-server` and `mcp-server`.
- Keep result field semantics stable across refactors; adapter packages should not need to reinterpret core results.
## Editing Rules
- New marketplace behavior belongs here, not in route or protocol layers.
- Isolate marketplace-specific hacks/selectors inside the owning scraper file unless they are genuinely shared.
- If a new helper is scraper-local, keep it local. Do not promote it into `utils` early.
- If you change shared types or exports, check downstream imports in both adapter packages.
## Tests
- Tests live in `test/*.test.ts` and use `bun:test`.
- Mock network and file edges. Do not depend on live cookies, live HTTP, wall clock timing, or external sessions.
- Favor parser/extraction tests with fixture-like inline HTML/JSON over broad end-to-end behavior.
## Verify
- `bun test packages/core/test`
- `bun run ci`