メインコンテンツまでスキップ

著作権ヘッダーの管理

このプロジェクトでは、カスタムスクリプトを使用して、すべての TypeScript/JavaScript ソースファイルに著作権ヘッダーを自動追加します。

著作権ヘッダー

frontend/src および backend/src ディレクトリ内のすべてのソースファイル(.ts.tsx.js.jsx)には、次の著作権ヘッダーが自動的に追加されます。

/*
* 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.
*/

使用方法

ヘッダーの自動追加

次のコマンドを実行すると、著作権ヘッダーが自動的に追加されます。

npm run format

このコマンドは次を行います。

  1. ヘッダー追加スクリプトを実行する
  2. Prettier ですべてのファイルを整形する

ヘッダーの手動追加

整形を行わず、ヘッダーだけを手動で追加することもできます。

npm run add-headers

ヘッダーの自動判定

スクリプトは次のように動作します。

  • ✅ ヘッダーがないファイルに追加する
  • ✅ すでに著作権ヘッダーがあるファイルはスキップする
  • ✅ 設定ファイル、ビルド出力、依存関係を無視する
  • ✅ TypeScript/JavaScript ソースファイルだけを処理する

無視されるファイル/ディレクトリ

次の項目は自動的に無視されます。

  • node_modules/
  • dist/
  • build/
  • coverage/
  • public/
  • 設定ファイル(*.config.js*.config.ts
  • 型定義ファイル(vite-env.d.ts
  • ESLint 設定(eslint.config.js

実装

ヘッダー管理は /scripts/add-headers.js に実装され、package.json の整形ワークフローに統合されています。