Skip to content

add Meta copyright headers to all source files - #2193

Merged
czarandy merged 2 commits into
mainfrom
add-copyright-headers
May 19, 2026
Merged

czarandy merged 2 commits into
mainfrom
add-copyright-headers

Conversation

@czarandy

Copy link
Copy Markdown
Collaborator

Summary

  • Add "Copyright (c) Meta Platforms, Inc. and affiliates." to all 2441 source files, with correct comment syntax per file type (JS/TS, CSS, YAML, HTML, shell, Python) and shebang preservation.
  • Add a reusable scripts/add-copyright.sh script (with --check mode) to apply or verify the header across all file types.
  • Add an @xds/copyright-header ESLint rule with autofix support, so missing headers are caught in the editor and fixed automatically by lint-staged on commit.
  • Add a CI step running ./scripts/add-copyright.sh --check to catch file types ESLint doesn't cover (CSS, YAML, HTML, shell, Python).

Test plan

  • scripts/add-copyright.sh --check reports all files have the notice
  • Script is idempotent — re-running produces no changes
  • ESLint rule unit tests pass (vitest run internal/eslint-plugin-xds/copyright-header.test.mjs)
  • ESLint reports error on files missing the header, autofix inserts it correctly
  • Shebangs are preserved (copyright inserted on line 2)

@vercel

vercel Bot commented May 18, 2026

Copy link
Copy Markdown

@czarandy must be a member of the Meta Open Source team on Vercel to deploy.
- Click here to add @czarandy to the team.
- If you initiated this build, request access.

Learn more about collaboration on Vercel and other options here.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label May 18, 2026
@czarandy czarandy changed the title chore: add Meta copyright headers to all source files add Meta copyright headers to all source files May 18, 2026
@czarandy
czarandy force-pushed the add-copyright-headers branch from 0287e1d to 7714b89 Compare May 18, 2026 23:45
@vercel

vercel Bot commented May 18, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
xds-sandbox Error Error May 19, 2026 1:54am

Request Review

@github-actions

github-actions Bot commented May 18, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

📚 Storybook Preview

View Storybook for this PR
GitHub Pages may take up to a minute to hydrate after deploy.

🧪 Sandbox Preview

View Sandbox for this PR
GitHub Pages may take up to a minute to hydrate after deploy.

No new or modified components detected.

Bundle Size Summary

Package Size (ESM) Size (CJS) Gzipped
@xds/core 18.4KB 28.5KB 4.3KB

Accessibility Audit

Status: No accessibility violations detected.


Generated by PR Enrichment workflow | Storybook | Sandbox | View full report

czarandy added 2 commits May 18, 2026 18:54
Add "Copyright (c) Meta Platforms, Inc. and affiliates." as the first
line of every source file (ts, tsx, js, mjs, cjs, jsx, css, sh, py,
yml, yaml, html). Includes a reusable script at scripts/add-copyright.sh
with a --check mode for CI verification.
Also updates all code generation scripts (sync-templates, generate-versions,
generate-changelog, generate-cli-registry, generate-token-docs) to include
the copyright header in their generated output files.
@czarandy
czarandy force-pushed the add-copyright-headers branch from bc531b8 to d1c6152 Compare May 19, 2026 01:54
@czarandy
czarandy merged commit 3331afb into main May 19, 2026
18 of 20 checks passed
@czarandy
czarandy deleted the add-copyright-headers branch May 19, 2026 02:06
zurfyx added a commit that referenced this pull request May 19, 2026
The docsite's prebuild step runs `generate-data.mjs` to emit 9 typed
TypeScript registries (packageRegistry.ts, componentRegistry.ts, etc.)
into apps/docsite/src/generated/. These files are not git-tracked, so
when #2193 added the @xds/copyright-header lint rule and back-filled all
checked-in source files, the generated files were missed. Every Vercel
deployment of the docsite has been red since with 9 identical errors:

  Error: File is missing the copyright header @xds/copyright-header

(The repro is local-invisible — the lint runs after `next build` in the
Vercel pipeline; CI's separate `test` job only checks committed files.)

Fix: prepend the copyright header inside writeRegistry() so every
generated file picks it up automatically. Verified by regenerating
locally and checking all 9 outputs.
cixzhang pushed a commit that referenced this pull request Jun 21, 2026
* chore: add copyright notice to all source files

Add "Copyright (c) Meta Platforms, Inc. and affiliates." as the first
line of every source file (ts, tsx, js, mjs, cjs, jsx, css, sh, py,
yml, yaml, html). Includes a reusable script at scripts/add-copyright.sh
with a --check mode for CI verification.

* chore: enforce copyright header via ESLint rule and CI check

Also updates all code generation scripts (sync-templates, generate-versions,
generate-changelog, generate-cli-registry, generate-token-docs) to include
the copyright header in their generated output files.
cixzhang pushed a commit that referenced this pull request Jun 21, 2026
* chore: add copyright notice to all source files

Add "Copyright (c) Meta Platforms, Inc. and affiliates." as the first
line of every source file (ts, tsx, js, mjs, cjs, jsx, css, sh, py,
yml, yaml, html). Includes a reusable script at scripts/add-copyright.sh
with a --check mode for CI verification.

* chore: enforce copyright header via ESLint rule and CI check

Also updates all code generation scripts (sync-templates, generate-versions,
generate-changelog, generate-cli-registry, generate-token-docs) to include
the copyright header in their generated output files.

This branch had an error being deployed

1 failed deployment
Preview — d1c61524 Deployed May 19, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants