mirror of
https://github.com/duckietm/Nitro-V3.git
synced 2026-06-19 15:06:20 +00:00
docs: reflect PR #126 cherry-pick + boot/asset infrastructure
CLAUDE.md - TL;DR mentions the duckietm PR #126 cherry-pick (UserAccountSettings, wear-badge popup fix) and the sirv-based dev asset serving so a fresh session knows what's living on top of upstream main. - New patterns section for the bootstrap.ts configuration pre-init and the nitroAssetsServer Vite plugin, with a pointer to the .gitignore note explaining why public/{nitro-assets,swf} symlinks are a trap. - "What's wired up" table gets two rows: Form Actions, and the PR #126 pickup. - "Where everything lives" gets entries for UserAccountSettingsView, the persistAccessTokenFromPayload helper, the asset middleware, and the bootstrap pre-init call. docs/ARCHITECTURE.md - Recently fixed: adds the useAvatarEditor PETS/MISC paletteID null-pointer that surfaced when the editor was opened. - New Bonus subsections describing the boot-time orchestration in bootstrap.ts, the dev asset serving via sirv (and why symlinking under public/ is the wrong move on Windows), and the upstream feature catch-up via PR #126. No code changes in this commit — pure documentation refresh. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -12,6 +12,18 @@ infrastructure (TanStack Query, Zustand, Vitest, React Compiler, error
|
||||
boundaries), split a few god-hooks, and audit logic bugs along the way.
|
||||
PR is **#2** on `simoleo89/Nitro-V3`.
|
||||
|
||||
On top of the modernization work this branch also picks up a couple of
|
||||
upstream feature commits that lived only on `duckietm/Nitro-V3` (PR #126):
|
||||
reset password / email / change username under user settings, and the
|
||||
wear-badge popup fix.
|
||||
|
||||
Local-dev game assets are served by a small Vite plugin (`sirv` middleware
|
||||
mounted on `/nitro-assets` and `/swf`, reading from
|
||||
`E:\Users\simol\Desktop\DEV\Nitro-Files`) — NOT by symlinking inside
|
||||
`public/`. The symlink path triggers chokidar on ~177k files and the dev
|
||||
server hangs for minutes on Windows. See `vite.config.mjs` and the
|
||||
`.gitignore` note.
|
||||
|
||||
Detailed status, decisions, and next steps live in **`docs/ARCHITECTURE.md`** —
|
||||
read that before starting anything non-trivial.
|
||||
|
||||
@@ -220,6 +232,25 @@ Login / Register / Forgot in `src/components/login/LoginView.tsx` use
|
||||
`src/components/login/components/{Register,Forgot}Dialog.tsx` and
|
||||
`shared.ts` have been **removed** (dead code).
|
||||
|
||||
### Configuration pre-init in bootstrap
|
||||
|
||||
`src/bootstrap.ts` calls `await GetConfiguration().init()` **before**
|
||||
importing `./index`. Otherwise the first paint dumps a flood of
|
||||
"Missing configuration key" warnings while components synchronously
|
||||
read `asset.url`, `login.endpoint`, … against an empty store before
|
||||
`prepare()`'s deferred init lands.
|
||||
|
||||
### Asset serving in dev
|
||||
|
||||
Game assets (`bundled/`, `c_images/`, `gamedata/`, `swf/...`) are NOT
|
||||
copied or symlinked under `public/`. They're served by a custom Vite
|
||||
plugin (`nitroAssetsServer` in `vite.config.mjs`) that mounts `sirv`
|
||||
on `/nitro-assets` and `/swf`, reading from
|
||||
`E:\Users\simol\Desktop\DEV\Nitro-Files\`. sirv is a connect-style
|
||||
middleware that bypasses chokidar entirely, so the ~177k asset files
|
||||
never enter the watch graph. The plugin also wires the same handler
|
||||
into `configurePreviewServer` so `yarn preview` keeps working.
|
||||
|
||||
## What's wired up and what isn't
|
||||
|
||||
| Adopted | Pilot sites |
|
||||
@@ -231,6 +262,8 @@ Login / Register / Forgot in `src/components/login/LoginView.tsx` use
|
||||
| God-hook split (`useBetween` singleton + state filter + actions filter + shim) | `wired-tools`, `translation`, `notification`, `friends` |
|
||||
| `WidgetErrorBoundary` | `RoomWidgetsView` umbrella |
|
||||
| Vitest | 113/113 cases on pure helpers + the Zustand store |
|
||||
| Form Actions | Login / Register / Forgot (LoginView.tsx) |
|
||||
| Cherry-picked from `duckietm` PR #126 | `UserAccountSettingsView` (reset password / email / username under user settings), plus the wear-badge popup `canShowWearButton` gating |
|
||||
|
||||
| Not yet | Notes |
|
||||
|---|---|
|
||||
@@ -283,3 +316,10 @@ Fix shapes documented; both are reasonable PRs on their own.
|
||||
`useMessageEventState`): `src/hooks/events/`
|
||||
- Wired-tools split (types/constants/helpers + 3 tab views):
|
||||
`src/components/wired-tools/`
|
||||
- User account settings (cherry-picked from upstream PR #126):
|
||||
`src/components/user-settings/UserAccountSettingsView.tsx`
|
||||
- Access-token persistence helper (used by login + remember + rotate):
|
||||
`src/api/auth/accessToken.ts` (`persistAccessTokenFromPayload`)
|
||||
- Asset middleware: `nitroAssetsServer()` in `vite.config.mjs`
|
||||
- Configuration pre-init: `src/bootstrap.ts` (`await GetConfiguration().init()`
|
||||
before `import('./index')`)
|
||||
|
||||
Reference in New Issue
Block a user