Verwaltung von Urheberrechtsköpfen
Dieses Projekt fügt mit einem eigenen Skript automatisch Urheberrechtsköpfe zu allen TypeScript-/JavaScript-Quelldateien hinzu.
Urheberrechtskopf
Alle Quelldateien (.ts, .tsx, .js, .jsx) in frontend/src und backend/src erhalten automatisch diesen Kopf:
/*
* Libre WebUI
* Copyright (C) 2025 Kroonen AI, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
Verwendung
Automatisches Hinzufügen
Der Urheberrechtskopf wird automatisch hinzugefügt, wenn du Folgendes ausführst:
npm run format
Dieser Befehl:
- führt das Skript zum Hinzufügen der Köpfe aus;
- formatiert alle Dateien mit Prettier.
Manuelles Hinzufügen
Du kannst die Köpfe auch ohne Formatierung manuell hinzufügen:
npm run add-headers
Intelligente Erkennung
Das Skript:
- ✅ fügt Köpfe zu Dateien ohne Kopf hinzu;
- ✅ überspringt Dateien mit vorhandenem Urheberrechtskopf;
- ✅ ignoriert Konfigurationsdateien, Build-Ausgaben und Abhängigkeiten;
- ✅ verarbeitet nur TypeScript-/JavaScript-Quelldateien.
Ignorierte Dateien und Verzeichnisse
Folgende Elemente werden automatisch ignoriert:
node_modules/dist/build/coverage/public/- Konfigurationsdateien (
*.config.js,*.config.ts) - Typdefinitionsdateien (
vite-env.d.ts) - ESLint-Konfiguration (
eslint.config.js)
Implementierung
Die Verwaltung ist in /scripts/add-headers.js implementiert und in den Formatierungsablauf von package.json eingebunden.