|
6 | 6 | "main": "dist/server.js", |
7 | 7 | "scripts": { |
8 | 8 | "dev": "tsx src/server.ts", |
9 | | - "clean": "rimraf dist .tsbuildinfo", |
| 9 | + "clean": "rimraf dist build .tsbuildinfo", |
10 | 10 | "typecheck": "tsc --noEmit", |
| 11 | + "lint": "eslint .", |
| 12 | + "lint:fix": "eslint . --fix", |
| 13 | + "lint:ci": "eslint . --max-warnings=0", |
| 14 | + "format": "prettier --write .", |
| 15 | + "format:check": "prettier --check .", |
11 | 16 | "build": "tsc -p tsconfig.json", |
| 17 | + "check:quick": "npm run typecheck && npm run lint:ci && npm run format:check", |
| 18 | + "check:deep": "npm run typecheck && npm run lint:fix && npm run lint:ci && npm run format && npm run format:check", |
| 19 | + "pipeline": "npm run clean && npm run typecheck && npm run lint:fix && npm run lint:ci && npm run format && npm run format:check && npm run build", |
| 20 | + "smoke:stdio": "node -e \"const {spawn}=require('child_process');try{const p=spawn('node',['dist/server.js'],{stdio:['ignore','pipe','pipe']});let exited=false;const timer=setTimeout(()=>{if(!exited){p.kill('SIGINT');}},900);p.on('exit',c=>{exited=true;clearTimeout(timer);if(c&&c!==0){process.exit(c);}console.log('smoke:stdio exit',c||0);});}catch(e){console.error(e);process.exit(1);} \"", |
| 21 | + "smoke:http": "node -e \"const http=require('http');const {spawn}=require('child_process');const ports=[3333,1453,1923];const s=spawn('node',['dist/server.js'],{stdio:'inherit'});let i=0,tries=0,ok=false;function hit(){if(i>=ports.length){if(!ok){s.kill('SIGINT');process.exit(1);}return;}const port=ports[i];tries++;http.get({host:'127.0.0.1',port,path:'/'},res=>{ok=true;console.log('HTTP status',res.statusCode,'on',port);s.kill('SIGINT');if(res.statusCode>=400)process.exit(1);}).on('error',()=>{if(tries<5){setTimeout(hit,300);}else{tries=0;i++;setTimeout(hit,200);} });}setTimeout(hit,600);\"", |
| 22 | + "smoke:auto": "node -e \"const http=require('http');const {spawn}=require('child_process');const ports=[3333,1453,1923];const s=spawn('node',['dist/server.js'],{stdio:'inherit'});let i=0,tries=0,ok=false;function hit(){if(i>=ports.length){if(!ok){console.log('No HTTP detected; assuming STDIO-style process.');setTimeout(()=>{s.kill('SIGINT');process.exit(0);},800);return;}return;}const port=ports[i];tries++;http.get({host:'127.0.0.1',port,path:'/'},res=>{ok=true;console.log('HTTP status',res.statusCode,'on',port);s.kill('SIGINT');if(res.statusCode>=400)process.exit(1);}).on('error',()=>{if(tries<5){setTimeout(hit,300);}else{tries=0;i++;setTimeout(hit,200);} });}setTimeout(hit,600);\"", |
| 23 | + "all": "npm run pipeline && npm run smoke:auto", |
12 | 24 | "start": "node dist/server.js", |
13 | 25 | "start:production": "NODE_ENV=production node dist/server.js", |
14 | 26 | "start:stateless": "node dist/server.js", |
15 | | - "lint": "eslint . --ext .ts,.tsx", |
16 | | - "lint:ci": "eslint . --ext .ts,.tsx --max-warnings=0", |
17 | | - "lint:fix": "eslint . --ext .ts,.tsx --fix", |
18 | | - "format": "prettier --write .", |
19 | | - "format:check": "prettier --check .", |
20 | 27 | "check": "npm run typecheck && npm run lint:ci && npm run format:check", |
21 | | - "ci": "npm run check && npm run build", |
| 28 | + "ci": "npm run all", |
22 | 29 | "docker:build": "docker-compose build", |
23 | 30 | "docker:up": "docker-compose up -d", |
24 | 31 | "docker:down": "docker-compose down", |
|
0 commit comments