mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-06-19 21:31:46 +00:00
c130ed41be
* chore: fix monorepo build pipeline and migrate shared to built package
- Root package.json: add workspace scripts (dev, build, test, test:cov, test:e2e)
that delegate to actual scripts in shared/server/client workspaces
- shared: add tsup build step (CJS + ESM dual output, .d.ts); consumers now import
from the built dist instead of raw TS source via path aliases
- server: replace tsc-alias with tsconfig-paths (tsc-alias mangled node_modules
paths); fix MCP SDK path aliases to point to root node_modules (../node_modules)
- server/scripts/dev.mjs: delay node --watch until tsc -w signals first-pass done,
eliminating the spurious restart on every dev startup
- client/vite.config.js + vitest.config.ts: remove @trek/shared path alias (no longer
needed now that shared is a proper package)
- Consolidate package-lock.json at the workspace root; drop per-workspace lock files
* chore: fix test script to reflect root package.json
* chore: add missing lint and prettier script in root package.json
* fix(ci): build shared before tests; fix vitest MCP SDK alias paths
vitest.config.ts aliases pointed at ./node_modules/ (server-local) but
packages are hoisted to the root node_modules/ in the npm workspace —
changed to ../node_modules/.
CI jobs now install and build shared before running server/client tests
so that @trek/shared's dist/ exists when vitest resolves the package.
* fix(docker): update Dockerfile and CI for monorepo workspace structure
Dockerfile:
- Add shared-builder stage that produces @trek/shared dist before
client and server stages need it
- Each build stage carries root package.json + package-lock.json so npm
can resolve @trek/shared as a workspace dependency
- Production stage installs via workspace context (npm ci --workspace=server
--omit=dev) so node_modules/@trek/shared symlinks to shared/dist correctly
- Copy server/tsconfig.json into the image so tsconfig-paths/register can
find the MCP SDK path aliases at runtime
- CMD cds into /app/server before starting node so tsconfig-paths baseUrl
resolves and ../node_modules points to /app/node_modules
- Remove mkdir for /app/server (now a real dir); keep symlinks for uploads/data
docker.yml version-bump:
- Replace manual per-workspace cd+npm-version calls with single:
npm version --workspaces --include-workspace-root --no-git-tag-version
(mirrors the version:* scripts in root package.json)
- git add now references root package-lock.json; adds shared/package.json
.dockerignore: add shared/dist
package.json: fix version:prerelease preid (alpha → pre)
* fix(tests): use in-memory SQLite per worker in test mode
vitest pool:forks spawns parallel worker processes that all called
initDb() on the same data/travel.db, causing SQLite "database is locked"
and "duplicate column name" races.
When NODE_ENV=test each fork now gets an isolated :memory: DB so migrations
run independently with no file contention.
* chore(ci): add ACT guards to skip DockerHub steps in local act runs
act sets ACT=true automatically. Guards added:
- docker login: if: ${{ !env.ACT }}
- build outputs: type=docker (local load) when ACT, push-by-digest when CI
- digest export/upload: if: ${{ !env.ACT }}
- merge job: if: ${{ !env.ACT }}
- release-helm job (docker.yml): if: ${{ !env.ACT }}
- version-bump git push (docker.yml): wrapped in [ -z "$ACT" ] shell guard
Run locally with:
./bin/act -j build -W .github/workflows/docker.yml \
-P ubuntu-latest=catthehacker/ubuntu:act-latest
* fix(ci): move ACT guards to step level; add guards to security.yml
env context is invalid in job-level if conditions — moved all ACT
guards down to individual steps. Also guards docker login + scout
in security.yml so act can run the build-only part of that workflow.
* fix(ci): skip git fetch and tag logic in act (no remote access in local containers)
* Revert "fix(ci): skip git fetch and tag logic in act (no remote access in local containers)"
This reverts commit 67cf290cda.
* Revert "fix(ci): move ACT guards to step level; add guards to security.yml"
This reverts commit f92b95e054.
* Revert "chore(ci): add ACT guards to skip DockerHub steps in local act runs"
This reverts commit 797183de08.
* fix(docker): add musl optional deps so alpine builds find native rollup/sharp binaries
npm prunes libc-constrained optional deps to the host libc (glibc) when
generating the lockfile, leaving no musl entry for Alpine containers.
Declaring the x64/arm64 musl variants as explicit root optionalDependencies
forces them into the lockfile so npm ci on Alpine can install them.
Covers shared-builder (tsup/rollup) and client-builder (vite/rollup + sharp
icon generation) for both linux/amd64 and linux/arm64 CI targets.
* fix(docker): copy client dist into server/public so the server resolves static files correctly
The server runs from /app/server and serves static files relative to that
directory, so the client build output must land at /app/server/public, not /app/public.
102 lines
3.1 KiB
JSON
102 lines
3.1 KiB
JSON
{
|
|
"name": "@trek/server",
|
|
"version": "3.0.22",
|
|
"main": "src/index.ts",
|
|
"scripts": {
|
|
"start": "node --require tsconfig-paths/register dist/index.js",
|
|
"dev": "node scripts/dev.mjs",
|
|
"build": "node scripts/build.mjs",
|
|
"start:prod": "node --require tsconfig-paths/register dist/index.js",
|
|
"typecheck": "tsc --noEmit",
|
|
"format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
|
|
"format:check": "prettier --check \"src/**/*.ts\" \"test/**/*.ts\"",
|
|
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
|
|
"test": "vitest run",
|
|
"test:watch": "vitest",
|
|
"test:unit": "vitest run tests/unit",
|
|
"test:integration": "vitest run tests/integration",
|
|
"test:ws": "vitest run tests/websocket",
|
|
"test:parity": "vitest run tests/parity",
|
|
"test:e2e": "vitest run tests/e2e",
|
|
"test:coverage": "vitest run --coverage"
|
|
},
|
|
"dependencies": {
|
|
"@trek/shared": "*",
|
|
"tsconfig-paths": "^4.2.0",
|
|
"@modelcontextprotocol/sdk": "^1.28.0",
|
|
"@nestjs/common": "^11.1.24",
|
|
"@nestjs/core": "^11.1.24",
|
|
"@nestjs/platform-express": "^11.1.24",
|
|
"archiver": "^6.0.1",
|
|
"bcryptjs": "^2.4.3",
|
|
"better-sqlite3": "^12.8.0",
|
|
"cookie-parser": "^1.4.7",
|
|
"cors": "^2.8.5",
|
|
"dotenv": "^16.4.1",
|
|
"express": "^4.18.3",
|
|
"fast-xml-parser": "^5.5.10",
|
|
"helmet": "^8.1.0",
|
|
"jimp": "^1.6.1",
|
|
"jsonwebtoken": "^9.0.2",
|
|
"multer": "^2.1.1",
|
|
"node-cron": "^4.2.1",
|
|
"nodemailer": "^8.0.5",
|
|
"otplib": "^12.0.1",
|
|
"qrcode": "^1.5.4",
|
|
"reflect-metadata": "^0.2.2",
|
|
"rxjs": "^7.8.2",
|
|
"semver": "^7.7.4",
|
|
"tsx": "^4.21.0",
|
|
"typescript": "^6.0.2",
|
|
"undici": "^7.0.0",
|
|
"unzipper": "^0.12.3",
|
|
"uuid": "^14.0.0",
|
|
"ws": "^8.21.0",
|
|
"zod": "^4.3.6"
|
|
},
|
|
"overrides": {
|
|
"hono": "^4.12.16",
|
|
"@hono/node-server": "^1.19.13",
|
|
"picomatch": "^4.0.4",
|
|
"ip-address": "^10.1.1",
|
|
"multer": "^2.1.1",
|
|
"ws": "^8.21.0",
|
|
"qs": "^6.15.2",
|
|
"file-type": "^21.3.4"
|
|
},
|
|
"devDependencies": {
|
|
"@trivago/prettier-plugin-sort-imports": "^6.0.2",
|
|
"eslint-config-prettier": "^10.0.1",
|
|
"eslint-plugin-prettier": "^5.2.2",
|
|
"prettier": "^3.8.3",
|
|
"prettier-plugin-organize-imports": "^4.3.0",
|
|
"eslint": "^9.18.0",
|
|
"eslint-config-flat-gitignore": "^2.3.0",
|
|
"@nestjs/testing": "^11.1.24",
|
|
"@swc/core": "^1.15.40",
|
|
"@types/archiver": "^7.0.0",
|
|
"@types/bcryptjs": "^2.4.6",
|
|
"@types/better-sqlite3": "^7.6.13",
|
|
"@types/cookie-parser": "^1.4.10",
|
|
"@types/cors": "^2.8.19",
|
|
"@types/express": "^4.17.25",
|
|
"@types/jsonwebtoken": "^9.0.10",
|
|
"@types/multer": "^2.1.0",
|
|
"@types/node": "^25.5.0",
|
|
"@types/node-cron": "^3.0.11",
|
|
"@types/nodemailer": "^7.0.11",
|
|
"@types/qrcode": "^1.5.5",
|
|
"@types/semver": "^7.7.1",
|
|
"@types/supertest": "^6.0.3",
|
|
"@types/unzipper": "^0.10.11",
|
|
"@types/uuid": "^10.0.0",
|
|
"@types/ws": "^8.18.1",
|
|
"@vitest/coverage-v8": "^3.2.4",
|
|
"nodemon": "^3.1.0",
|
|
"supertest": "^7.2.2",
|
|
"tz-lookup": "^6.1.25",
|
|
"unplugin-swc": "^1.5.9",
|
|
"vitest": "^3.2.4"
|
|
}
|
|
}
|