Skip to content

Create .gitattributes to exclude development files from releases - #94

Merged
JasonTheAdams merged 1 commit into
WordPress:trunkfrom
BrianHenryIE:add/gitattributes
Nov 17, 2025
Merged

JasonTheAdams merged 1 commit into
WordPress:trunkfrom
BrianHenryIE:add/gitattributes

Conversation

@BrianHenryIE

@BrianHenryIE BrianHenryIE commented Nov 17, 2025 •

Copy link
Copy Markdown
Contributor

Currently, composer install installs the package with all its development files, /tests/, .prettierrc.js etc. which are unnecessary when installing the package in another project.

This PR adds .gitattributes file in the project root with a list of files marked export-ignore.

Copilot AI review requested due to automatic review settings November 17, 2025 16:54
@github-actions

Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: BrianHenryIE <brianhenryie@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds a .gitattributes file to exclude development files from release archives and Composer installations using --prefer-dist. This reduces the package size by omitting unnecessary development dependencies, configuration files, and tests when the package is installed in production environments.

Key changes:

  • Added .gitattributes file with export-ignore declarations for development files
  • Excluded common development files like tests, docs, linter configs, and build tools
  • Added helpful comments explaining the purpose and usage

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@codecov

codecov Bot commented Nov 17, 2025 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.74%. Comparing base (48d7ffb) to head (e0b32fa).
⚠️ Report is 3 commits behind head on trunk.

Additional details and impacted files
@@            Coverage Diff            @@
##              trunk      #94   +/-   ##
=========================================
  Coverage     79.74%   79.74%           
  Complexity      858      858           
=========================================
  Files            46       46           
  Lines          3080     3080           
=========================================
  Hits           2456     2456           
  Misses          624      624           
Flag Coverage Δ
unit 79.74% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@JasonTheAdams JasonTheAdams left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this, @BrianHenryIE!

@JasonTheAdams
JasonTheAdams merged commit e436fd3 into WordPress:trunk Nov 17, 2025
25 checks passed
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.

3 participants