feat(ci): integrate husky to pipe #1
1
.husky/commit-msg
Normal file
1
.husky/commit-msg
Normal file
@@ -0,0 +1 @@
|
|||||||
|
pnpm exec commitlint --edit "$1"
|
||||||
2
.husky/pre-commit
Normal file
2
.husky/pre-commit
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
pnpm run lint
|
||||||
|
pnpm run check
|
||||||
16
Dockerfile
16
Dockerfile
@@ -1,7 +1,8 @@
|
|||||||
|
ARG NODE_VERSION
|
||||||
ARG CADDY_VERSION
|
ARG CADDY_VERSION
|
||||||
|
|
||||||
# --- BUILD ---
|
# --- BUILD ---
|
||||||
FROM node:24-alpine AS build
|
FROM node:${NODE_VERSION}-alpine AS build
|
||||||
RUN corepack enable && corepack prepare pnpm@latest --activate
|
RUN corepack enable && corepack prepare pnpm@latest --activate
|
||||||
|
|
||||||
ENV ASTRO_TELEMETRY_DISABLED=1
|
ENV ASTRO_TELEMETRY_DISABLED=1
|
||||||
@@ -10,10 +11,19 @@ WORKDIR /app
|
|||||||
|
|
||||||
# Copy depedencies
|
# Copy depedencies
|
||||||
COPY package.json pnpm-lock.yaml ./
|
COPY package.json pnpm-lock.yaml ./
|
||||||
RUN pnpm install --frozen-lockfile
|
|
||||||
|
|
||||||
# Copy all and build
|
# Install pnpm with cache
|
||||||
|
RUN --mount=type=cache,id=pnpm,target=/pnpm/store \
|
||||||
|
PNPM_HOME="/pnpm" pnpm install --frozen-lockfile
|
||||||
|
|
||||||
|
# Copy all
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
|
# Check files
|
||||||
|
RUN pnpm run lint
|
||||||
|
RUN pnpm run check
|
||||||
|
|
||||||
|
# Build
|
||||||
RUN pnpm build
|
RUN pnpm build
|
||||||
|
|
||||||
# --- DEPLOY ---
|
# --- DEPLOY ---
|
||||||
|
|||||||
1
commitlint.config.js
Normal file
1
commitlint.config.js
Normal file
@@ -0,0 +1 @@
|
|||||||
|
export default { extends: ['@commitlint/config-conventional'] };
|
||||||
@@ -3,6 +3,7 @@ services:
|
|||||||
build:
|
build:
|
||||||
context: .
|
context: .
|
||||||
args:
|
args:
|
||||||
|
- NODE_VERSION=${NODE_VERSION}
|
||||||
- CADDY_VERSION=${CADDY_VERSION}
|
- CADDY_VERSION=${CADDY_VERSION}
|
||||||
image: portfolio:${PORTFOLIO_VERSION}
|
image: portfolio:${PORTFOLIO_VERSION}
|
||||||
container_name: portfolio
|
container_name: portfolio
|
||||||
|
|||||||
24
eslint.config.mjs
Normal file
24
eslint.config.mjs
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
import eslintPluginAstro from 'eslint-plugin-astro';
|
||||||
|
import tsParser from '@typescript-eslint/parser';
|
||||||
|
|
||||||
|
export default [
|
||||||
|
// Configuration pour les fichiers Astro
|
||||||
|
...eslintPluginAstro.configs.recommended,
|
||||||
|
{
|
||||||
|
files: ["**/*.astro"],
|
||||||
|
languageOptions: {
|
||||||
|
parser: eslintPluginAstro.parser,
|
||||||
|
parserOptions: {
|
||||||
|
parser: tsParser,
|
||||||
|
extraFileExtensions: [".astro"],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
rules: {
|
||||||
|
// Tes règles personnalisées ici
|
||||||
|
},
|
||||||
|
},
|
||||||
|
// On ignore le dossier de build
|
||||||
|
{
|
||||||
|
ignores: ["dist/*", ".astro/*"]
|
||||||
|
}
|
||||||
|
];
|
||||||
23
package.json
23
package.json
@@ -6,13 +6,34 @@
|
|||||||
"dev": "astro dev",
|
"dev": "astro dev",
|
||||||
"build": "astro build",
|
"build": "astro build",
|
||||||
"preview": "astro preview",
|
"preview": "astro preview",
|
||||||
"astro": "astro"
|
"astro": "astro",
|
||||||
|
"lint": "eslint .",
|
||||||
|
"check": "astro check",
|
||||||
|
"prepare": "husky"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"@astrojs/check": "^0.9.6",
|
||||||
"@astrojs/mdx": "^4.3.13",
|
"@astrojs/mdx": "^4.3.13",
|
||||||
"@astrojs/rss": "^4.0.14",
|
"@astrojs/rss": "^4.0.14",
|
||||||
"@astrojs/sitemap": "^3.6.0",
|
"@astrojs/sitemap": "^3.6.0",
|
||||||
"astro": "^5.16.6",
|
"astro": "^5.16.6",
|
||||||
"sharp": "^0.34.3"
|
"sharp": "^0.34.3"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@commitlint/cli": "^20.3.1",
|
||||||
|
"@commitlint/config-conventional": "^20.3.1",
|
||||||
|
"@typescript-eslint/eslint-plugin": "^8.52.0",
|
||||||
|
"@typescript-eslint/parser": "^8.52.0",
|
||||||
|
"astro-eslint-parser": "^1.2.2",
|
||||||
|
"eslint": "^9.39.2",
|
||||||
|
"eslint-plugin-astro": "^1.5.0",
|
||||||
|
"husky": "^9.1.7",
|
||||||
|
"typescript": "^5.9.3"
|
||||||
|
},
|
||||||
|
"pnpm": {
|
||||||
|
"onlyBuiltDependencies": [
|
||||||
|
"esbuild",
|
||||||
|
"sharp"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
2126
pnpm-lock.yaml
generated
2126
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
3
pnpm-workspace.yaml
Normal file
3
pnpm-workspace.yaml
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
ignoredBuiltDependencies:
|
||||||
|
- esbuild
|
||||||
|
- sharp
|
||||||
@@ -1,6 +1,5 @@
|
|||||||
{
|
{
|
||||||
"extends": "astro/tsconfigs/strict",
|
"extends": "astro/tsconfigs/strict",
|
||||||
"include": [".astro/types.d.ts", "**/*"],
|
|
||||||
"exclude": ["dist"],
|
"exclude": ["dist"],
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"strictNullChecks": true
|
"strictNullChecks": true
|
||||||
|
|||||||
Reference in New Issue
Block a user