From 43aead62848113695c67884ec0ae67ba5e62b734 Mon Sep 17 00:00:00 2001 From: 4NK Dev Date: Thu, 2 Oct 2025 15:31:54 +0000 Subject: [PATCH] chore: doc updates [skip ci] --- .cursorignore | 26 ++++++++++++++++---- .dockerignore | 26 ++++++++++++++++---- .gitignore | 26 ++++++++++++++++---- scripts/sync-ignore-files.sh | 46 ++++++++++++++++++++++++++++++++++++ scripts/sync-vault-full.sh | 15 +++++++++++- 5 files changed, 123 insertions(+), 16 deletions(-) create mode 100755 scripts/sync-ignore-files.sh diff --git a/.cursorignore b/.cursorignore index d07058b..2d43d93 100644 --- a/.cursorignore +++ b/.cursorignore @@ -42,10 +42,18 @@ certs/ **/*.docker* # Cache et build -**/*.node_modules/ -**/*.dist/ -**/*build/ -**/*target/ +**/node_modules/ +**/dist/ +**/build/ +**/target/ +**/.next/ +**/.turbo/ +**/coverage/ +**/.pytest_cache/ +**/.cache/ +**/.pnpm-store/ +**/.venv/ +**/vendor/ **/*.*.o **/*.so **/*.dylib @@ -68,6 +76,8 @@ certs/ # Backup des projets existants **/*backup* +**/backups/ +**/*backups* **/*wallet* @@ -76,4 +86,10 @@ certs/ **/*node_modules* **/*cursor* **/*pid* -**/*next* \ No newline at end of file +**/*next* + +# Dossiers de logs communs +log/ +logs/ +**/log/ +**/logs/ \ No newline at end of file diff --git a/.dockerignore b/.dockerignore index d07058b..2d43d93 100644 --- a/.dockerignore +++ b/.dockerignore @@ -42,10 +42,18 @@ certs/ **/*.docker* # Cache et build -**/*.node_modules/ -**/*.dist/ -**/*build/ -**/*target/ +**/node_modules/ +**/dist/ +**/build/ +**/target/ +**/.next/ +**/.turbo/ +**/coverage/ +**/.pytest_cache/ +**/.cache/ +**/.pnpm-store/ +**/.venv/ +**/vendor/ **/*.*.o **/*.so **/*.dylib @@ -68,6 +76,8 @@ certs/ # Backup des projets existants **/*backup* +**/backups/ +**/*backups* **/*wallet* @@ -76,4 +86,10 @@ certs/ **/*node_modules* **/*cursor* **/*pid* -**/*next* \ No newline at end of file +**/*next* + +# Dossiers de logs communs +log/ +logs/ +**/log/ +**/logs/ \ No newline at end of file diff --git a/.gitignore b/.gitignore index d07058b..2d43d93 100644 --- a/.gitignore +++ b/.gitignore @@ -42,10 +42,18 @@ certs/ **/*.docker* # Cache et build -**/*.node_modules/ -**/*.dist/ -**/*build/ -**/*target/ +**/node_modules/ +**/dist/ +**/build/ +**/target/ +**/.next/ +**/.turbo/ +**/coverage/ +**/.pytest_cache/ +**/.cache/ +**/.pnpm-store/ +**/.venv/ +**/vendor/ **/*.*.o **/*.so **/*.dylib @@ -68,6 +76,8 @@ certs/ # Backup des projets existants **/*backup* +**/backups/ +**/*backups* **/*wallet* @@ -76,4 +86,10 @@ certs/ **/*node_modules* **/*cursor* **/*pid* -**/*next* \ No newline at end of file +**/*next* + +# Dossiers de logs communs +log/ +logs/ +**/log/ +**/logs/ \ No newline at end of file diff --git a/scripts/sync-ignore-files.sh b/scripts/sync-ignore-files.sh new file mode 100755 index 0000000..0c81a44 --- /dev/null +++ b/scripts/sync-ignore-files.sh @@ -0,0 +1,46 @@ +#!/usr/bin/env sh +set -euo pipefail + +# Synchronise .gitignore, .cursorignore, .dockerignore du root 4NK_env +# vers tous les 4NK_modules/ (sauf 4NK_vault) et les sous-projets sous projects/ + +SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" +ROOT_DIR="$(cd "$SCRIPT_DIR/../../../.." && pwd)" + +SRC_GITIGNORE="$ROOT_DIR/.gitignore" +SRC_CURSORIGNORE="$ROOT_DIR/.cursorignore" +SRC_DOCKERIGNORE="$ROOT_DIR/.dockerignore" + +copy_files() { + TARGET_DIR="$1" + [ -d "$TARGET_DIR" ] || return 0 + echo "[sync] $TARGET_DIR" + [ -f "$SRC_GITIGNORE" ] && cp -f "$SRC_GITIGNORE" "$TARGET_DIR/.gitignore" || true + [ -f "$SRC_CURSORIGNORE" ] && cp -f "$SRC_CURSORIGNORE" "$TARGET_DIR/.cursorignore" || true + [ -f "$SRC_DOCKERIGNORE" ] && cp -f "$SRC_DOCKERIGNORE" "$TARGET_DIR/.dockerignore" || true +} + +echo "[info] Root: $ROOT_DIR" +echo "[info] Sources: $SRC_GITIGNORE, $SRC_CURSORIGNORE, $SRC_DOCKERIGNORE" + +# 1) 4NK_modules/* sauf 4NK_vault +for d in "$ROOT_DIR"/4NK_modules/*; do + [ -d "$d" ] || continue + base="$(basename "$d")" + if [ "$base" = "4NK_vault" ]; then + echo "[skip] $d (excluded)" + continue + fi + copy_files "$d" +done + +# 2) Sous-projets sous projects/*/* (ex: projects/lecoffre/lecoffre_node, lecoffre-front, ...) +for p in "$ROOT_DIR"/projects/*; do + [ -d "$p" ] || continue + for sub in "$p"/*; do + [ -d "$sub" ] || continue + copy_files "$sub" + done +done + +echo "[done] Ignore files synchronised." diff --git a/scripts/sync-vault-full.sh b/scripts/sync-vault-full.sh index 83b8ff8..2d9d015 100644 --- a/scripts/sync-vault-full.sh +++ b/scripts/sync-vault-full.sh @@ -69,6 +69,13 @@ else else echo "[WARN] Script de sync SDK introuvable: $SYNC_JS" fi + # Si le SDK a synchronisé dans vault/confs2, propager vers CONFS_DIR + if [ -d "$VAULT_ROOT/confs2" ]; then + echo "[copy] Synchronisation fallback $VAULT_ROOT/confs2 -> $CONFS_DIR" + rm -rf "$CONFS_DIR" + mkdir -p "$CONFS_DIR" + cp -a "$VAULT_ROOT/confs2/." "$CONFS_DIR/" + fi fi # 4bis) Répliquer les fichiers synchronisés dans le dossier du projet lecoffre_node si requis @@ -76,6 +83,12 @@ LECOFFRE_NODE_CONFS_DIR="$ROOT_DIR/projects/lecoffre/lecoffre_node/confs" echo "[copy] Réplication vers $LECOFFRE_NODE_CONFS_DIR" rm -rf "$LECOFFRE_NODE_CONFS_DIR" mkdir -p "$LECOFFRE_NODE_CONFS_DIR" -cp -a "$CONFS_DIR/." "$LECOFFRE_NODE_CONFS_DIR/" + +# Si le dossier fallback existe, répliquer directement depuis celui-ci pour éviter les permissions sur $CONFS_DIR +if [ -d "$VAULT_ROOT/confs2" ]; then + cp -a "$VAULT_ROOT/confs2/." "$LECOFFRE_NODE_CONFS_DIR/" +else + cp -a "$CONFS_DIR/." "$LECOFFRE_NODE_CONFS_DIR/" +fi echo "[OK] Sync Vault terminée vers $CONFS_DIR et répliquée vers $LECOFFRE_NODE_CONFS_DIR"