@jeremyckahn/farmhand 1.19.25 → 1.19.27
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.
- package/README.md +11 -0
- package/dist/assets/{index-CfrPf88Z.js → index--2AEoryv.js} +12 -12
- package/dist/assets/{index-CfrPf88Z.js.map → index--2AEoryv.js.map} +1 -1
- package/dist/index.html +1 -1
- package/dist/service-worker.js +1 -1
- package/dist/service-worker.js.map +1 -1
- package/package.json +7 -3
- package/src/components/CowCard/Subheader/Subheader.tsx +3 -0
- package/src/components/Farmhand/Farmhand.tsx +141 -1249
- package/src/components/Farmhand/{Farmhand.test.ts → FarmhandService.test.ts} +16 -12
- package/src/components/Farmhand/FarmhandService.ts +72 -0
- package/src/components/Farmhand/hooks/useFarmhandDayAdvancement.ts +167 -0
- package/src/components/Farmhand/hooks/useFarmhandNavigation.ts +58 -0
- package/src/components/Farmhand/hooks/useFarmhandNetwork.test.ts +195 -0
- package/src/components/Farmhand/hooks/useFarmhandNetwork.ts +400 -0
- package/src/components/Farmhand/hooks/useFarmhandNotifications.ts +54 -0
- package/src/components/Farmhand/useFarmhand.ts +738 -0
- package/src/components/Farmhand/useFarmhandReducers.ts +38 -0
- package/src/components/Farmhand/usePrevious.ts +11 -0
- package/src/handlers/ui-events.test.ts +2 -0
- package/src/handlers/ui-events.tsx +9 -6
- package/src/shell/achievement-concurrency.test.ts +62 -0
- package/src/shell/unmount-safety.test.ts +50 -0
- package/src/test-utils/stubs/farmhandStub.tsx +1 -1
package/README.md
CHANGED
|
@@ -59,6 +59,17 @@ Farmhand uses a [SemVer](https://semver.org/)-like versioning system. It differs
|
|
|
59
59
|
- This project uses [Vite](https://vitejs.dev/), so please refer to the documentation of that project to learn about the development toolchain.
|
|
60
60
|
- Farmhand uses [Piskel](https://www.piskelapp.com/) for the art assets.
|
|
61
61
|
|
|
62
|
+
## Debugging
|
|
63
|
+
|
|
64
|
+
Farmhand exposes its live game state on `window.farmhand` in the browser console, for ad hoc inspection and manipulation during development. This mirrors the game's internal state-management API:
|
|
65
|
+
|
|
66
|
+
```js
|
|
67
|
+
window.farmhand.state // read the current game state
|
|
68
|
+
window.farmhand.setState({ money: 999999 }) // merge a partial update into state
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Prefer this over editing `useState` values directly in the React DevTools components panel — DevTools' hook editor overwrites the rendered value without updating the hook's underlying update queue, so the edit gets silently discarded the next time any real `setState` call fires (which happens frequently, e.g. via the heartbeat timer or day-advancement effects). `window.farmhand.setState()` goes through the real state dispatch, so it persists.
|
|
72
|
+
|
|
62
73
|
## Running locally
|
|
63
74
|
|
|
64
75
|
Requires:
|