Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .depcheckrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"ignores": [
"rimraf",
"@types/node",
"ts-node"
]
}
25 changes: 25 additions & 0 deletions .github/workflows/check-service.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Check Service

on:
pull_request:
branches: ['main', 'preprod']
types: [opened, synchronize, reopened]
push:
branches: ['main', 'preprod']

jobs:
check-service:
if: github.event_name == 'pull_request' || github.ref == 'refs/heads/main' || github.ref == 'refs/heads/preprod'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v3
with:
node-version: '24.x'

- name: Install dependencies
run: pnpm install

- name: Check service
run: pnpm run check
5 changes: 5 additions & 0 deletions .github/workflows/fly-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ on:
push:
branches:
- main
workflow_run: # Trigger deployment after successful check-service workflow and only for main branch
workflows: ["Check Service"]
types:
- completed

jobs:
deploy:
name: Deploy app
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/node_modules
/dist
.env
.env.dev
*.DS_Store
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Étape 1 : Build
FROM node:20-slim AS build
FROM node:24-slim AS build

WORKDIR /app

Expand Down Expand Up @@ -29,4 +29,4 @@ RUN npm ci --only=production
EXPOSE 8080

# Entrée du serveur (adapte selon ton fichier d’entrée réel)
CMD ["node", "src/index.js"]
CMD ["node", "dist/index.js"]
38 changes: 38 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import tsparser from '@typescript-eslint/parser';
import tseslint from 'typescript-eslint';
import prettierPlugin from 'eslint-plugin-prettier';
import prettierConfig from 'eslint-config-prettier';

export default [
...tseslint.configs.recommended,
{
ignores: ['node_modules', 'dist', '.dockerignore', '.gitignore'],
},
{
files: ['**/*.ts,js'],
},
{
languageOptions: {
parser: tsparser,
sourceType: 'module',
},
plugins: {
prettier: prettierPlugin,
},
rules: {
...prettierConfig.rules,
'prettier/prettier': [
'warn',
{
trailingComma: 'es5',
singleQuote: true,
semi: true,
endOfLine: 'auto',
},
],
'no-console': 'warn',
'@typescript-eslint/no-explicit-any': 'warn',
'@typescript-eslint/ban-ts-comment': ['warn'],
},
},
];
18 changes: 15 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,11 @@
"main": "index.js",
"scripts": {
"dev": "ts-node-dev --respawn --transpile-only src/index.ts",
"build": "tsc",
"start": "node dist/index.js"
"build": "rimraf dist && tsc",
"start": "node dist/index.js",
"lint": "eslint . --ext .ts",
"dependencies:check": "depcheck",
"check": "pnpm run build && pnpm run dependencies:check && pnpm run lint && pnpm audit"
},
"keywords": [],
"author": "",
Expand All @@ -25,8 +28,17 @@
},
"devDependencies": {
"@types/node": "^24.3.3",
"depcheck": "^1.4.7",
"rimraf": "^6.0.1",
"ts-node": "^10.9.2",
"ts-node-dev": "^2.0.0",
"typescript": "^5.9.2"
"typescript": "^5.9.2",
"eslint": "^9.21.0",
"eslint-config-prettier": "^10.0.2",
"eslint-plugin-prettier": "^5.2.3",
"prettier": "^3.5.3",
"typescript-eslint": "^8.26.0",
"@typescript-eslint/parser": "^8.26.0"

}
}
Loading