Add file headers, tidy the stylesheet and document the conventions

Headers:
- Every JavaScript file (sources, front, scripts, tests) starts with a
  /** @file … */ header, in the three levels used by sokko-g: a short
  description for simple files; Utilisé par / Attention / @see for
  shared modules; a full header (context, entry points, callers,
  dependencies, pitfalls) for index.js, the music queue, the web
  server, the storage manager and the jukebox page script.
- No @author, @version or @since: git already knows.
- test/fileHeaders.test.js fails `npm run check` when a header is
  missing or a central file's header is incomplete.

Stylesheet (no visual change, checked by comparing every element's
computed styles in Chromium at 1280, 800 and 400 px, hover included):
- Role header and section comments.
- Transparent shades derive from the colour variables with
  color-mix() instead of copied rgba() values; new tokens for repeated
  values (text, text on accent, accent gradient, white veils, shadow).
- Native nesting for buttons, the live indicator, upload rows and
  home cards; drop the unused .hero__visual--large and redundant rules.
- Utility classes move to the end so they win over components. The
  library list's u-mt-1, which never applied (.list reset it), is
  removed to keep the layout as it was.

Docs: CONTRIBUTING.md describes the language, header and stylesheet
conventions; CLAUDE.md points to it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Shinuwa 2026-12-01 21:05:59 +01:00
parent e08dba41a3
commit 3795ee06cb
65 changed files with 843 additions and 163 deletions

View file

@ -1,3 +1,11 @@
/**
* @file Complète au démarrage la durée et l'artiste des morceaux de la bibliothèque ajoutés avant que
* l'envoi ne les relève.
*
* Utilisé par : web/server.js (startWebServer).
* Attention : un fichier illisible est ignoré et retenté au démarrage suivant.
*/
import { probeAudioFile } from "../../media/validateAudioFile.js";
import { getPermanentLibrary, updatePermanentTracks } from "./storageManager.js";

View file

@ -1,3 +1,22 @@
/**
* @file Stockage des fichiers audio : storage/temp pour les morceaux joués une seule fois,
* storage/permanent et sa liste storage/runtime/library.json pour la bibliothèque.
*
* Contexte : seul module qui crée, déplace ou supprime les fichiers audio et la liste de la
* bibliothèque.
* Points d'entrée : registerUploadedFile (nouveau fichier), getPermanentLibrary,
* createQueueTrackFromLibrary, cleanupTemporaryFiles, deleteTrackFile.
* Utilisé par : music/ (ajout, file), web/routes/library.js et queue.js, /play, web/server.js.
* Attention :
* - Les dossiers sont fixés au chargement d'après le répertoire de travail : le bot se lance depuis
* la racine du projet, et les tests changent de répertoire avant d'importer ce module.
* - library.json ne garde que les noms de fichiers ; le chemin complet est recalculé à la lecture,
* pour que le dossier puisse être déplacé.
* - La bibliothèque est limitée à 2 Go. Les fichiers temporaires de plus de 24 h sont supprimés,
* sauf ceux encore dans la file.
* @see README.md#données-persistantes
*/
import fs from "fs";
import path from "path";
import { randomUUID } from "node:crypto";