From 931ecf5186e2c31ade21d5be6150815319a99d45 Mon Sep 17 00:00:00 2001 From: Pierre Brisorgueil Date: Sat, 21 Feb 2026 12:42:19 +0100 Subject: [PATCH] chore(scripts): align npm scripts and docs with Vue stack - Add `dev` alias for `start` (cross-stack consistency) - Add `test:unit` alias for `test` (one-shot, mirrors Vue naming) - Add `format` script (prettier already installed, script was missing) - Document `prod`, `format`, `test:unit`, `release` strategy in CLAUDE.md - Update README and copilot-instructions to reflect all scripts --- .github/copilot-instructions.md | 6 ++++-- CLAUDE.md | 30 ++++++++++++++++++------------ README.md | 6 ++++-- package.json | 3 +++ 4 files changed, 29 insertions(+), 16 deletions(-) diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index 4cdc446f9..88a68a955 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -7,14 +7,16 @@ ## Canonical commands -- Dev: `npm start` +- Dev: `npm start` (alias: `npm run dev`) - Debug: `npm run debug` -- Tests: `npm test` (watch: `npm run test:watch`) +- Tests: `npm test` / `npm run test:unit` (one-shot) or `npm run test:watch` (watch) - Coverage: `npm run test:coverage` - Lint: `npm run lint` - Lint fix: `npm run lint:fix` +- Format: `npm run format` - Seed: `npm run seed:dev` - Commit: `npm run commit` +- Release (CI): `npm run release:auto` ## Available prompts diff --git a/CLAUDE.md b/CLAUDE.md index ad99ab526..14c1e6076 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -12,18 +12,24 @@ The `.claude/` folder contains embedded settings, skills, and agents that are av ## Canonical commands -| Command | Script | Description | -| ------------- | ------------------------ | ---------------------------------------------- | -| **Dev** | `npm start` | Start dev server at `http://localhost:3000/` | -| **Debug** | `npm run debug` | Start with nodemon and inspector | -| **Test** | `npm test` | Run all tests | -| **Watch** | `npm run test:watch` | Run tests in watch mode | -| **Coverage** | `npm run test:coverage` | Generate test coverage | -| **Lint** | `npm run lint` | Check code quality | -| **Lint fix** | `npm run lint:fix` | Auto-fix linting issues | -| **Seed** | `npm run seed:dev` | Seed development database | -| **Commit** | `npm run commit` | Commit with commitizen | -| **Docker** | `docker-compose up` | Start with docker-compose | +| Command | Script | Description | +| ---------------- | ------------------------ | ---------------------------------------------- | +| **Dev** | `npm start` | Start dev server at `http://localhost:3000/` | +| **Dev (alias)** | `npm run dev` | Alias for `npm start` | +| **Debug** | `npm run debug` | Start with nodemon and inspector | +| **Prod** | `npm run prod` | Start in production mode | +| **Test** | `npm test` | Run all tests (one-shot) | +| **Unit test** | `npm run test:unit` | Run unit tests once (alias of `npm test`) | +| **Watch** | `npm run test:watch` | Run tests in watch mode | +| **Coverage** | `npm run test:coverage` | Generate test coverage | +| **Lint** | `npm run lint` | Check code quality | +| **Lint fix** | `npm run lint:fix` | Auto-fix linting issues | +| **Format** | `npm run format` | Format with Prettier | +| **Seed** | `npm run seed:dev` | Seed development database | +| **Commit** | `npm run commit` | Commit with commitizen | +| **Release** | `npm run release` | Manual release (standard-version) | +| **Release (CI)** | `npm run release:auto` | Semantic release for CI | +| **Docker** | `docker-compose up` | Start with docker-compose | ## Preflight diff --git a/README.md b/README.md index 90f4c271a..c56f1533b 100644 --- a/README.md +++ b/README.md @@ -60,7 +60,7 @@ npm install ### Development ```bash -npm start +npm start # or: npm run dev ``` Runs the server at `http://localhost:3000/`. For auto-reload during development, use `npm run debug` (nodemon). @@ -80,7 +80,8 @@ npm run prod ### Testing ```bash -npm test # Run all tests +npm test # Run all tests (one-shot) +npm run test:unit # Run unit tests once (alias of npm test) npm run test:watch # Run tests in watch mode npm run test:coverage # Generate coverage report ``` @@ -92,6 +93,7 @@ Tests are organized per module in `modules/*/tests/` ```bash npm run lint # Check code quality (read-only) npm run lint:fix # Auto-fix code quality issues +npm run format # Format code with Prettier ``` ### Database Seeding diff --git a/package.json b/package.json index c6deb5796..21e4e12fc 100644 --- a/package.json +++ b/package.json @@ -24,9 +24,11 @@ }, "scripts": { "start": "node server.js", + "dev": "npm run start", "debug": "nodemon --inspect server.js", "prod": "cross-env NODE_ENV=production node server.js --name=node", "test": "cross-env NODE_ENV=test NODE_OPTIONS=--experimental-vm-modules jest --runInBand", + "test:unit": "cross-env NODE_ENV=test NODE_OPTIONS=--experimental-vm-modules jest --runInBand", "test:watch": "cross-env NODE_ENV=test NODE_OPTIONS=--experimental-vm-modules jest --watch --runInBand", "test:coverage": "cross-env NODE_ENV=test NODE_OPTIONS=--experimental-vm-modules jest --coverage --runInBand", "lint": "eslint ./modules ./lib ./config ./scripts", @@ -38,6 +40,7 @@ "seed:mongodrop": "node scripts/seed.js drop", "generate:sllCerts": "scripts/generate-ssl-certs.sh", "lint:fix": "eslint --fix ./modules ./lib ./config ./scripts", + "format": "prettier --write .", "snyk-protect": "snyk protect", "commit": "npx cz", "release": "standard-version",