diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100644 index 00000000..77492786 --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1 @@ +pnpm run format && cd ./apps/web && pnpm run lint:fix \ No newline at end of file diff --git a/apps/web/.prettierrc.yaml b/apps/web/.prettierrc.yaml new file mode 100644 index 00000000..734c71c1 --- /dev/null +++ b/apps/web/.prettierrc.yaml @@ -0,0 +1,3 @@ +trailingComma: "es5" +semi: false +singleQuote: true \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 1bf90dea..190320c5 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -8,6 +8,12 @@ services: - .:/usr/learnhouse environment: - LEARNHOUSE_COOKIE_DOMAIN=.localhost + depends_on: + db: + condition: service_healthy + redis: + condition: service_healthy + db: image: postgres:16-alpine restart: always @@ -17,11 +23,21 @@ services: - POSTGRES_USER=learnhouse - POSTGRES_PASSWORD=learnhouse - POSTGRES_DB=learnhouse + healthcheck: + test: ["CMD-SHELL", "pg_isready"] + interval: 5s + timeout: 4s + retries: 5 redis: image: redis:7.2.3 restart: always ports: - "6379:6379" + healthcheck: + test: [ "CMD", "redis-cli", "ping" ] + interval: 5s + timeout: 4s + retries: 5 mongo: image: mongo:5.0 restart: always @@ -29,4 +45,4 @@ services: - "27017:27017" environment: - MONGO_INITDB_ROOT_USERNAME=learnhouse - - MONGO_INITDB_ROOT_PASSWORD=learnhouse + - MONGO_INITDB_ROOT_PASSWORD=learnhous \ No newline at end of file diff --git a/package.json b/package.json index 347f7602..696528d4 100644 --- a/package.json +++ b/package.json @@ -4,12 +4,14 @@ "build": "turbo run build", "dev": "turbo run dev", "lint": "turbo run lint", - "format": "prettier --write \"**/*.{ts,tsx,md}\"" + "format": "prettier --write \"**/*.{ts,tsx,md}\"", + "prepare": "husky" }, "devDependencies": { "eslint": "^8.51.0", + "husky": "^9.0.10", "prettier": "^3.0.3", "turbo": "^1.10.15" }, "packageManager": "pnpm@8.6.10" -} \ No newline at end of file +} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 61aaae72..020429a3 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -11,6 +11,9 @@ importers: eslint: specifier: ^8.51.0 version: 8.51.0 + husky: + specifier: ^9.0.10 + version: 9.0.10 prettier: specifier: ^3.0.3 version: 3.0.3 @@ -4428,6 +4431,12 @@ packages: - supports-color dev: false + /husky@9.0.10: + resolution: {integrity: sha512-TQGNknoiy6bURzIO77pPRu+XHi6zI7T93rX+QnJsoYFf3xdjKOur+IlfqzJGMHIK/wXrLg+GsvMs8Op7vI2jVA==} + engines: {node: '>=18'} + hasBin: true + dev: true + /ieee754@1.2.1: resolution: {integrity: sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==} dev: false