Add Prettier and ESLint tooling (Refs #77)
This commit is contained in:
+27
-12
@@ -10,7 +10,7 @@ does not require a Docker socket or direct access to host filesystems.
|
||||
|
||||
## Run locally
|
||||
|
||||
Use Node.js 22.12+ (the container uses Node.js 22), npm and Python 3.
|
||||
Use Node.js 22.13+ (the container uses Node.js 22), npm and Python 3.
|
||||
|
||||
```sh
|
||||
npm ci
|
||||
@@ -76,12 +76,27 @@ remove the generated fixture directory.
|
||||
## Checks and builds
|
||||
|
||||
```sh
|
||||
npm run lint
|
||||
npm run check
|
||||
npm test
|
||||
npm run test:agent
|
||||
npm run build
|
||||
```
|
||||
|
||||
Run `npm run format` to apply Prettier formatting before committing. It uses
|
||||
four-space indentation and a 100-column target for supported source, config and
|
||||
documentation files, including Svelte components. Python, shell and game scripts
|
||||
are outside Prettier's supported languages. Generated agent downloads and the npm
|
||||
lockfile keep their generator's formatting.
|
||||
|
||||
`npm run lint` checks formatting without changing files, then runs the recommended
|
||||
JavaScript, TypeScript and Svelte ESLint rules. Generated build output and local
|
||||
runtime data are excluded. Type checking remains part of `npm run check`.
|
||||
The ESLint config documents exceptions for existing Svelte navigation, list and
|
||||
reactivity patterns. Individual suppressions explain intentional validation and
|
||||
test fixtures. Node.js 22.13 is the minimum supported 22.x version for the lint
|
||||
toolchain.
|
||||
|
||||
The `package.json` overrides keep SvelteKit 2 on patched `devalue` 5.x (5.9.4 or
|
||||
newer) and `cookie` 0.7.x releases until its dependency ranges include those fixes.
|
||||
These dependencies ship in the server bundle even though SvelteKit is a
|
||||
@@ -103,17 +118,17 @@ T5/T6 server validation use the [host acceptance checklist](../guides/native-hos
|
||||
|
||||
Paths below are relative to the repository root.
|
||||
|
||||
| Path | Responsibility |
|
||||
| --- | --- |
|
||||
| `src/routes` | Pages and API endpoints |
|
||||
| `src/lib/ui` | Shared components, stores and [UI patterns](ui-patterns.md) |
|
||||
| `src/lib/server/hosts` | Enrollment, readiness and command transport |
|
||||
| `src/lib/server/backends` | Instance identity and remote file access |
|
||||
| `src/lib/server/provisioning/native.ts` | Lifecycle and campaign queues connected to agents |
|
||||
| `src/lib/server/game-files` | Immutable uploads and streaming distribution |
|
||||
| `src/lib/server/db` | SQLite schema, migrations and shared artifact storage |
|
||||
| `src/lib/server/reports` | Metrics, leaderboard and capacity workers |
|
||||
| `agent` | Python service, installer, packaging and tests |
|
||||
| Path | Responsibility |
|
||||
| --------------------------------------- | ----------------------------------------------------------- |
|
||||
| `src/routes` | Pages and API endpoints |
|
||||
| `src/lib/ui` | Shared components, stores and [UI patterns](ui-patterns.md) |
|
||||
| `src/lib/server/hosts` | Enrollment, readiness and command transport |
|
||||
| `src/lib/server/backends` | Instance identity and remote file access |
|
||||
| `src/lib/server/provisioning/native.ts` | Lifecycle and campaign queues connected to agents |
|
||||
| `src/lib/server/game-files` | Immutable uploads and streaming distribution |
|
||||
| `src/lib/server/db` | SQLite schema, migrations and shared artifact storage |
|
||||
| `src/lib/server/reports` | Metrics, leaderboard and capacity workers |
|
||||
| `agent` | Python service, installer, packaging and tests |
|
||||
|
||||
## Performance diagnostics
|
||||
|
||||
|
||||
@@ -74,16 +74,16 @@ logs. Static values use text or state colors; the accent marks links and control
|
||||
|
||||
### Product language
|
||||
|
||||
| Concept | Visible label |
|
||||
| --- | --- |
|
||||
| A managed game instance | Server; use the friendly map and lobby name |
|
||||
| Creating a server | Create server |
|
||||
| Removing a server | Remove server |
|
||||
| Favourite server | Pin |
|
||||
| Game does not answer | Not responding |
|
||||
| Games | Black Ops I / Black Ops II; BO1 / BO2 in compact labels |
|
||||
| Releasing file changes | Campaigns |
|
||||
| Player completion evidence | Present in final report / Not present in final report |
|
||||
| Concept | Visible label |
|
||||
| -------------------------- | ------------------------------------------------------- |
|
||||
| A managed game instance | Server; use the friendly map and lobby name |
|
||||
| Creating a server | Create server |
|
||||
| Removing a server | Remove server |
|
||||
| Favourite server | Pin |
|
||||
| Game does not answer | Not responding |
|
||||
| Games | Black Ops I / Black Ops II; BO1 / BO2 in compact labels |
|
||||
| Releasing file changes | Campaigns |
|
||||
| Player completion evidence | Present in final report / Not present in final report |
|
||||
|
||||
Keep internal values such as `t5`, `t6`, `destroy`, instance IDs, and filenames in
|
||||
API fields and technical details. User-facing actions use the labels above.
|
||||
|
||||
Reference in New Issue
Block a user