Replace prop drilling with React context providers. App.tsx shrinks from 427 lines to ~80 lines of pure layout. Components consume shared state directly via 7 context providers instead of threading 50+ props. Key changes: - 7 context providers wrapping existing hooks (encounter, bestiary, player characters, side panel, theme, bulk import, initiative rolls) - 2 coordinating hooks extracted from App.tsx (useInitiativeRolls, useAutoStatBlock) - All 9 affected components refactored from prop-based to context-based - 6 test files updated to use providers or context mocks - Prop count enforcement script (max 8 per component interface) - Constitution principle II-A added (context-based state flow) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
38 lines
1.2 KiB
JSON
38 lines
1.2 KiB
JSON
{
|
|
"private": true,
|
|
"packageManager": "pnpm@10.6.0",
|
|
"pnpm": {
|
|
"overrides": {
|
|
"undici": ">=7.24.0"
|
|
}
|
|
},
|
|
"devDependencies": {
|
|
"@biomejs/biome": "2.4.7",
|
|
"@vitest/coverage-v8": "^3.2.4",
|
|
"jscpd": "^4.0.8",
|
|
"knip": "^5.85.0",
|
|
"lefthook": "^1.11.0",
|
|
"oxlint": "^1.55.0",
|
|
"oxlint-tsgolint": "^0.16.0",
|
|
"typescript": "^5.8.0",
|
|
"vitest": "^3.0.0"
|
|
},
|
|
"scripts": {
|
|
"prepare": "lefthook install",
|
|
"format": "biome format --write .",
|
|
"format:check": "biome format .",
|
|
"lint": "biome lint .",
|
|
"lint:fix": "biome lint --write .",
|
|
"typecheck": "tsc --build",
|
|
"test": "vitest run",
|
|
"test:watch": "vitest",
|
|
"knip": "knip",
|
|
"jscpd": "jscpd",
|
|
"oxlint": "oxlint --tsconfig apps/web/tsconfig.json --type-aware",
|
|
"check:ignores": "node scripts/check-lint-ignores.mjs",
|
|
"check:classnames": "node scripts/check-cn-classnames.mjs",
|
|
"check:props": "node scripts/check-component-props.mjs",
|
|
"check": "pnpm audit --audit-level=high && knip && biome check . && oxlint --tsconfig apps/web/tsconfig.json --type-aware && node scripts/check-lint-ignores.mjs && node scripts/check-cn-classnames.mjs && node scripts/check-component-props.mjs && tsc --build && vitest run && jscpd"
|
|
}
|
|
}
|