mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-06-22 23:01:48 +00:00
Compare commits
2 Commits
v3.0.22
...
b25eb18ea4
| Author | SHA1 | Date | |
|---|---|---|---|
| b25eb18ea4 | |||
| 8410d7c4a5 |
@@ -58,6 +58,7 @@ git rebase upstream/dev # or: git merge upstream/dev
|
|||||||
Working on a dedicated branch keeps your changes isolated and makes PRs easier to review:
|
Working on a dedicated branch keeps your changes isolated and makes PRs easier to review:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
# Create a new branch off of dev
|
||||||
git checkout -b fix/my-changes origin/dev
|
git checkout -b fix/my-changes origin/dev
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -70,47 +71,79 @@ Branch naming conventions:
|
|||||||
|
|
||||||
## 5. Install Dependencies
|
## 5. Install Dependencies
|
||||||
|
|
||||||
Install dependencies for both the client and server:
|
The repo is an npm workspace monorepo. One command at the root installs everything:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Client
|
npm ci
|
||||||
cd client
|
|
||||||
npm i
|
|
||||||
|
|
||||||
# Server
|
|
||||||
cd ../server
|
|
||||||
npm i
|
|
||||||
```
|
```
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## 6. Available Scripts
|
## 6. Available Scripts
|
||||||
|
|
||||||
|
### Root (`/`)
|
||||||
|
|
||||||
|
These commands run across all workspaces at once and are the recommended way to work:
|
||||||
|
|
||||||
|
| Command | Description |
|
||||||
|
|----------------------|---------------------------------------------------------------------|
|
||||||
|
| `npm run dev` | Build shared, then start shared (watch), server, and client together via `concurrently` |
|
||||||
|
| `npm run build` | Build shared → server → client in order |
|
||||||
|
| `npm test` | Run tests in shared, server, and client |
|
||||||
|
| `npm run test:cov` | Run coverage for server and client |
|
||||||
|
| `npm run test:e2e` | Run end-to-end tests (server) |
|
||||||
|
| `npm run lint` | Lint shared, server, and client |
|
||||||
|
| `npm run format` | Format shared, server, and client |
|
||||||
|
| `npm run format:check` | Check formatting across all workspaces |
|
||||||
|
|
||||||
|
### Shared (`/shared`)
|
||||||
|
|
||||||
|
The `@trek/shared` package is the single source of truth for code shared between the client and server. It currently holds **Zod schemas that define API contracts** (request/response shapes, common primitives, pagination). Both workspaces import from it so schema changes automatically propagate to both sides.
|
||||||
|
|
||||||
|
> **Upcoming:** the i18n translation layer will be migrated into this package so that translation keys and types are enforced across the stack from one place.
|
||||||
|
|
||||||
|
| Command | Description |
|
||||||
|
|------------------------|------------------------------------|
|
||||||
|
| `npm run build` | Compile shared package (tsup) |
|
||||||
|
| `npm run build:watch` | Compile in watch mode |
|
||||||
|
| `npm test` | Run tests |
|
||||||
|
| `npm run typecheck` | Type-check without emitting |
|
||||||
|
| `npm run lint` | Lint source |
|
||||||
|
| `npm run format` | Format source |
|
||||||
|
|
||||||
### Server (`/server`)
|
### Server (`/server`)
|
||||||
|
|
||||||
| Command | Description |
|
| Command | Description |
|
||||||
|----------------------------|------------------------------------------|
|
|----------------------------|------------------------------------------|
|
||||||
| `npm start` | Start the server (production) |
|
| `npm start` | Start the server (production) |
|
||||||
| `npm run dev` | Start the server in watch mode (tsx) |
|
| `npm run dev` | Start the server in watch mode |
|
||||||
|
| `npm run build` | Compile server |
|
||||||
|
| `npm run typecheck` | Type-check without emitting |
|
||||||
| `npm test` | Run all tests |
|
| `npm test` | Run all tests |
|
||||||
| `npm run test:unit` | Run unit tests only |
|
| `npm run test:unit` | Run unit tests only |
|
||||||
| `npm run test:integration` | Run integration tests |
|
| `npm run test:integration` | Run integration tests |
|
||||||
| `npm run test:ws` | Run WebSocket tests |
|
| `npm run test:ws` | Run WebSocket tests |
|
||||||
|
| `npm run test:parity` | Run parity tests |
|
||||||
|
| `npm run test:e2e` | Run end-to-end tests |
|
||||||
| `npm run test:watch` | Run tests in watch mode |
|
| `npm run test:watch` | Run tests in watch mode |
|
||||||
| `npm run test:coverage` | Run tests with coverage report |
|
| `npm run test:coverage` | Run tests with coverage report |
|
||||||
|
| `npm run lint` | Lint source |
|
||||||
|
| `npm run format` | Format source |
|
||||||
|
|
||||||
### Client (`/client`)
|
### Client (`/client`)
|
||||||
|
|
||||||
| Command | Description |
|
| Command | Description |
|
||||||
|--------------------------|------------------------------------------------------|
|
|----------------------------|------------------------------------------------------|
|
||||||
| `npm run dev` | Start the Vite dev server |
|
| `npm run dev` | Start the Vite dev server |
|
||||||
| `npm run build` | Build for production (runs icon generation first) |
|
| `npm run build` | Build for production (runs icon generation first) |
|
||||||
| `npm run preview` | Preview the production build locally |
|
| `npm run preview` | Preview the production build locally |
|
||||||
| `npm test` | Run all tests |
|
| `npm test` | Run all tests |
|
||||||
| `npm run test:unit` | Run unit tests only |
|
| `npm run test:unit` | Run unit tests only |
|
||||||
| `npm run test:integration` | Run integration tests |
|
| `npm run test:integration` | Run integration tests |
|
||||||
| `npm run test:watch` | Run tests in watch mode |
|
| `npm run test:watch` | Run tests in watch mode |
|
||||||
| `npm run test:coverage` | Run tests with coverage report |
|
| `npm run test:coverage` | Run tests with coverage report |
|
||||||
|
| `npm run lint` | Lint source |
|
||||||
|
| `npm run format` | Format source |
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -121,7 +154,7 @@ git add .
|
|||||||
git commit -m "fix: describe your change"
|
git commit -m "fix: describe your change"
|
||||||
|
|
||||||
# Push to your fork's dev branch
|
# Push to your fork's dev branch
|
||||||
git push origin fix/my-changes:dev
|
git push origin fix/my-changes
|
||||||
|
|
||||||
# Or if working directly on dev
|
# Or if working directly on dev
|
||||||
git push origin dev
|
git push origin dev
|
||||||
@@ -134,5 +167,5 @@ Then open a Pull Request from your fork to `mauriceboe/TREK` targeting the `dev`
|
|||||||
## Tips
|
## Tips
|
||||||
|
|
||||||
- Always branch off from an up-to-date `dev` — run `git fetch upstream && git rebase upstream/dev` before starting new work.
|
- Always branch off from an up-to-date `dev` — run `git fetch upstream && git rebase upstream/dev` before starting new work.
|
||||||
- Run tests before pushing: `npm run test` in both `client/` and `server/`.
|
- Run tests before pushing: `npm test` at the repo root runs all workspaces.
|
||||||
- Follow the commit message conventions described in the [[Contributing]] guidelines.
|
- Follow the commit message conventions described in the [[Contributing]] guidelines.
|
||||||
Reference in New Issue
Block a user