Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 18, 2026

Adds MIT license headers to all TypeScript, JavaScript, and related source files in the repository per project licensing requirements.

Implementation

  • Automated script: Created Node.js script to recursively process .ts, .tsx, .js, .jsx, .vue, .mjs files
  • Directory exclusions: Skips node_modules, dist, build, .git, coverage, .next
  • Duplicate prevention: Checks first 10 lines for existing "Copyright" or "License" keywords
  • Shebang handling: Preserves shebang lines at line 1, inserts header immediately after

Changes

Modified 23 files:

  • 8 TypeScript files (.ts)
  • 8 TSX files (.tsx)
  • 7 JavaScript modules (.mjs)

Header Format

/**
 * ObjectDocs
 * Copyright (c) 2026-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.
 */

Headers are inserted before all imports and module code. Auto-generated files in .source directory are excluded per .gitignore.

Original prompt

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

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

  1. 目标文件:递归遍历项目中所有的 .ts, .js, .tsx, .jsx, .vue 文件。
  2. 排除目录:严格排除 node_modules, dist, build, .git, coverage 目录。
  3. 防止重复:读取每个文件,如果文件顶部前 10 行内已经包含 "Copyright" 或 "License" 关键词,则跳过该文件,不要重复添加。
  4. 插入位置:注释必须插在文件的最顶端(在所有的 import 语句之前)。
  5. 注释内容模板
    /**
     * ObjectDocs
     * Copyright (c) 2026-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.
     */

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

@vercel
Copy link

vercel bot commented Jan 18, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
objectdocs-site Ready Ready Preview, Comment Jan 18, 2026 5:27am

Request Review

@github-actions
Copy link

🚀 Preview Deployment

This pull request will be automatically deployed to Vercel.

Preview Links

  • 📝 Documentation: Will be available once Vercel deployment completes
  • 🌍 Languages: English (/en/docs) and Chinese (/cn/docs)

Build Status

Check the CI workflow for build status and any errors.


Automated preview information for PR #16

Copilot AI changed the title [WIP] Add MIT license header to all source code files Add MIT license headers to all source files Jan 18, 2026
Copilot AI requested a review from huangyiirene January 18, 2026 05:03
@github-actions
Copy link

🚀 Preview Deployment

This pull request will be automatically deployed to Vercel.

Preview Links

  • 📝 Documentation: Will be available once Vercel deployment completes
  • 🌍 Languages: English (/en/docs) and Chinese (/cn/docs)

Build Status

Check the CI workflow for build status and any errors.


Automated preview information for PR #16

@github-actions
Copy link

🚀 Preview Deployment

This pull request will be automatically deployed to Vercel.

Preview Links

  • 📝 Documentation: Will be available once Vercel deployment completes
  • 🌍 Languages: English (/en/docs) and Chinese (/cn/docs)

Build Status

Check the CI workflow for build status and any errors.


Automated preview information for PR #16

@huangyiirene huangyiirene marked this pull request as ready for review January 18, 2026 05:27
@huangyiirene huangyiirene merged commit 16a40cb into main Jan 18, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants