Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 18, 2026

Plan: Add MIT License Headers to All Source Files

  • Explore repository structure and understand the codebase
  • Create Node.js script to add license headers
    • Script recursively finds all .ts, .js, .tsx, .jsx, .vue files
    • Excludes node_modules, dist, build, .git, coverage directories
    • Checks first 10 lines for existing "Copyright" or "License" keywords
    • Handles shebang lines properly (keeps them at line 1)
    • Adds MIT license header at the top of files without existing headers
  • Run the script to add headers to all 215 source files
  • Fix shebang handling for executable scripts (validate-yaml.js, bin.ts)
  • Verify sample files to ensure headers are added correctly
  • Commit all changes with the license headers

Summary

Successfully added MIT license headers to 215 source files:

  • All .ts, .js, .tsx, .jsx, .vue files across the repository
  • Properly handled shebang lines in executable scripts
  • License headers placed at the very top (after shebang if present)
  • All files now have the required copyright notice and MIT license reference
Original prompt

我需要给我的开源项目 ObjectQL 的所有源代码文件添加 MIT 许可协议的头部注释。

请编写一个 Node.js 脚本(或者直接修改文件,如果你有权限)来完成以下任务:

  1. 目标文件:递归遍历项目中所有的 .ts, .js, .tsx, .jsx, .vue 文件。
  2. 排除目录:严格排除 node_modules, dist, build, .git, coverage 目录。
  3. 防止重复:读取每个文件,如果文件顶部前 10 行内已经包含 "Copyright" 或 "License" 关键词,则跳过该文件,不要重复添加。
  4. 插入位置:注释必须插在文件的最顶端(在所有的 import 语句之前)。
  5. 注释内容模板
    /**
     * ObjectQL
     * Copyright (c) 2024-present ObjectStack Inc.
     *
     * This source code is licensed under the MIT license found in the
     * LICENSE file in the root directory of this source tree.
     */

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI requested a review from huangyiirene January 18, 2026 03:45
Copilot stopped work on behalf of huangyiirene due to an error January 18, 2026 03:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants