All checks were successful
ci/woodpecker/push/publish_instable Pipeline was successful
111 lines
2.7 KiB
Makefile
Executable file
111 lines
2.7 KiB
Makefile
Executable file
set shell := ["fish", "-c"]
|
|
|
|
# Variables de chemins de configuration.
|
|
|
|
drizzleConfigFile := "src/db/drizzle.config.ts"
|
|
esLintConfigFile := "cfg/eslint.config.mts"
|
|
esLintCssConfigFile := "cfg/eslint-css.config.mts"
|
|
knipConfigFile := "cfg/knip.config.ts"
|
|
prettierConfigFile := "cfg/prettier.config.mjs"
|
|
prettierIgnoreFile := "cfg/.prettierignore"
|
|
stylelintConfigFile := "cfg/stylelint.config.mjs"
|
|
|
|
# Variables de cache.
|
|
|
|
cacheFolder := ".cache"
|
|
esLintCacheFile := "eslintcache"
|
|
prettierCacheFile := "prettiercache"
|
|
stylelintCacheFile := "stylelintcache"
|
|
|
|
# Variables de dossiers.
|
|
|
|
stylesFolder := "src/styles/"
|
|
|
|
###
|
|
|
|
# Liste toutes les recettes.
|
|
list:
|
|
@just --list --list-heading 'Recettes disponibles :'\n'' --unsorted
|
|
|
|
# Lance le mode de développement.
|
|
dev:
|
|
bun --bun vite dev
|
|
|
|
# Compile le projet.
|
|
build:
|
|
-bun --bun vue-tsc --build .
|
|
bun --bun vite build
|
|
|
|
# Génère l'image Docker.
|
|
build-docker:
|
|
docker build -t journal-media-vue --progress=plain .
|
|
|
|
# Lance la prévisualisation du mode de production.
|
|
preview:
|
|
just build
|
|
bun --bun vite preview
|
|
|
|
# Nettoie les dossiers de fichiers transients.
|
|
clean:
|
|
-rm -rf dist/
|
|
-rm -rf .cache/
|
|
-rm -rf node_modules
|
|
-rm -f bun.lock
|
|
|
|
# Met à jour les dépendances avec bun.
|
|
update:
|
|
bun update --latest
|
|
|
|
# Affiche les dépendances obsolètes avec bun.
|
|
outdated:
|
|
bun outdated --latest
|
|
|
|
# Génère un nouveau schéma de BDD.
|
|
db-generate-schema:
|
|
bun drizzle-kit --config {{ drizzleConfigFile }} generate
|
|
|
|
# Formate avec prettier puis dprint.
|
|
format:
|
|
bun --bun prettier \
|
|
--cache --cache-location "{{ cacheFolder }}/{{ prettierCacheFile }}" \
|
|
--config "{{ prettierConfigFile }}" \
|
|
--ignore-path ".gitignore" --ignore-path "{{ prettierIgnoreFile }}" \
|
|
--ignore-unknown \
|
|
--write \
|
|
.
|
|
dprint --config "cfg/dprint.json" fmt
|
|
|
|
watch-format:
|
|
watchexec dprint --config "cfg/dprint.json" fmt
|
|
|
|
# Vérifie le code CSS avec stylelint.
|
|
lint-css:
|
|
bun --bun stylelint \
|
|
--cache --cache-location "{{ cacheFolder }}/{{ stylelintCacheFile }}" \
|
|
--config "{{ stylelintConfigFile }}" \
|
|
--fix \
|
|
{{ stylesFolder }}
|
|
|
|
# Analyse le code TypeScript et Vue.
|
|
lint-js fix="":
|
|
bun --bun eslint \
|
|
--cache --cache-location "{{ cacheFolder }}/{{ esLintCacheFile }}" \
|
|
--config "{{ esLintConfigFile }}" \
|
|
{{ fix }}
|
|
|
|
# Analyse le code CSS avec ESLint.
|
|
lint-css-eslint fix="":
|
|
bun --bun eslint --config "{{ esLintCssConfigFile }}" {{ fix }}
|
|
|
|
# Analyse l'orthographe et la grammaire.
|
|
lint-spelling:
|
|
bun --bun cspell lint *
|
|
|
|
# Vérifie la présence de « code mort ».
|
|
lint-dead-code:
|
|
bun knip-bun --config "{{ knipConfigFile }}"
|
|
|
|
# Vérifie tous les fichiers.
|
|
lint-all:
|
|
just lint-css
|
|
just lint-js
|