Skip to content

Packages: Stop publishing Markdown files other than README.md - #84307

Merged
t-hamano merged 7 commits into
trunkfrom
fix/npm-files-exclude-extra-markdown
Oct 8, 2026
Merged

t-hamano merged 7 commits into
trunkfrom
fix/npm-files-exclude-extra-markdown

Conversation

@t-hamano

@t-hamano t-hamano commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

What?

Follow-up to #73822

Stops publishing package-root Markdown files other than README.md and CHANGELOG.md to npm.

Update: Following the discussion, this PR now also stops publishing CHANGELOG.md. Only README.md remains among the package-root Markdown files.

Why?

This was already happening before #73822, but I noticed that Markdown files that are probably meaningless in an npm package are being published, for example AGENTS.md. These files sometimes reference resources outside the package, so there is no need to ship them in a standalone package.

Update: CHANGELOG.md adds significant size (for example, about 300KB in @wordpress/components), while tools such as Renovate and Dependabot fetch changelogs from the source repository rather than from the published tarball.

How?

Limits the published Markdown files to README.md and CHANGELOG.md. npm always includes README.md, so files now lists only CHANGELOG.md in place of *.md.

Update: Removes *.md from files. npm always includes README.md, so it is still published.

Note that Markdown files under src are still published through the src entry.

As a result, the following Markdown files are removed from the npm packages:

  • Update: CHANGELOG.md from all affected packages
  • @wordpress/components: AGENTS.md, CLAUDE.md, CONTRIBUTING.md, emotion-to-scss-modules.md
  • @wordpress/style-engine: CONTRIBUTING.md
  • @wordpress/sync: CODE.md
  • @wordpress/theme: AGENTS.md, CLAUDE.md
  • @wordpress/ui: AGENTS.md, CLAUDE.md, CONTRIBUTING.md

Testing Instructions

  1. Run a dry-run pack in an affected package and list the Markdown files it would publish:
    cd packages/components
    npm pack --dry-run --ignore-scripts 2>&1 | grep '\.md'
  2. On trunk, the output includes AGENTS.md, CLAUDE.md, CONTRIBUTING.md, and emotion-to-scss-modules.md. On this branch, only CHANGELOG.md and README.md are listed Update: only README.md is listed.
  3. Repeat for packages/style-engine, packages/sync, packages/theme, and packages/ui.

Use of AI Tools

Claude Code was used to find the affected files, update the package.json files, and verify the published file lists with npm pack --dry-run. I reviewed the changes.

🤖 Generated with Claude Code

@github-actions

github-actions Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

🤖 PR meta 🤖

🎉 Props

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: t-hamano <wildworks@git.wordpress.org>
Co-authored-by: manzoorwanijk <manzoorwanijk@git.wordpress.org>
Co-authored-by: mirka <0mirka00@git.wordpress.org>
Co-authored-by: Mamaduka <mamaduka@git.wordpress.org>

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

Updated as activity occurs, without notifying anyone named here. Add the props-bot label to refresh.

📦 Bundle size

Size Change: 0 B

Total Size: 8.31 MB

fdb5056 Run

⚡ Performance

Show the results

Client side metrics exclude the server response time.

front-end-block-theme

Metric 330fe59 trunk % Change
timeToFirstByte 57.6 ms +9.72% -4.95% 55.4 ms +11.1% -1.62% 3.97%
largestContentfulPaint 92 ms +8.7% -4.35% 92 ms +8.7% -4.35% 0%
lcpMinusTtfb 33.7 ms +2.37% -2.82% 33.8 ms +5.18% -1.48% -0.3%
wpBeforeTemplate 28.16 ms +16.12% -1.78% 28.16 ms +6.43% -1.63% 0%
wpTemplate 24.1 ms +3.69% -2.57% 23.48 ms +7.37% -1.36% 2.64%
wpTotal 53.86 ms +8.8% -4.86% 51.89 ms +10.97% -1.56% 3.8%
wpMemoryUsage 7.67 MB +0% -0% 7.64 MB +0% -0% 0.46%
wpDbQueries 17 +0% -0% 17 +0% -0% 0%

front-end-classic-theme

Metric 330fe59 trunk % Change
timeToFirstByte 47.5 ms +6.53% -2.95% 47.4 ms +8.76% -0.84% 0.21%
largestContentfulPaint 100 ms +6% -0% 104 ms +3.85% -3.85% -3.85%
lcpMinusTtfb 54.25 ms +2.58% -1.57% 54.2 ms +4.43% -1.75% 0.09%
wpBeforeTemplate 26.43 ms +10.63% -2.8% 26.29 ms +7.57% -0.61% 0.53%
wpTemplate 17.6 ms +2.1% -1.48% 18.1 ms +3.98% -3.37% -2.76%
wpTotal 44.48 ms +6.77% -3.21% 44.41 ms +8.87% -0.92% 0.16%
wpMemoryUsage 6.30 MB +0% -0% 6.25 MB +0% -0% 0.71%
wpDbQueries 14 +0% -0% 14 +0% -0% 0%

media-processing

Metric 330fe59 trunk % Change
mediaProcessingJpeg 397.64 ms +0.8% -0.58% 397.11 ms +1.24% -1.11% 0.13%
mediaProcessingAvif 6043.24 ms +0.2% -0.27% 6077.45 ms +0.26% -0.21% -0.56%
mediaProcessingJpegToAvif 4154.76 ms +0.07% -0.31% 4210.54 ms +0.16% -0.17% -1.32%

media-upload

Metric 330fe59 trunk % Change
jpegUploadProcessing 1441.94 ms +34.38% -1.14% 1412.72 ms +0.56% -0.71% 2.07%
pngUploadProcessing 208.52 ms +9.24% -14.16% 176.57 ms +20.16% -3.96% 18.09%
largeJpegUploadProcessing 1404.9 ms +0.76% -0.51% 1408.47 ms +1.32% -0.9% -0.25%
multipleImageUploadProcessing 1532.52 ms +2.51% -0.3% 1534.44 ms +1.35% -0.6% -0.13%

post-editor

Metric 330fe59 trunk % Change
serverResponse 328.51 ms +7.71% -7.34% 317.44 ms +5.38% -8.12% 3.49%
firstPaint 185.5 ms +14.41% -9.55% 196.16 ms +11.03% -7.88% -5.43%
domContentLoaded 873.88 ms +1.43% -1.62% 818.58 ms +2.61% -1.16% 6.76%
loaded 875.01 ms +1.42% -1.59% 819.57 ms +2.62% -1.16% 6.76%
firstContentfulPaint 373.45 ms +3.59% -4.96% 341.57 ms +4.13% -0.34% 9.33%
firstBlock 2582.27 ms +2.09% -0.81% 2445.34 ms +0.77% -0.39% 5.6%
type 16.86 ms +5.22% -1.13% 15.69 ms +6.25% -3.44% 7.46%
typeWithoutInspector 16.17 ms +2.84% -6.12% 15.09 ms +4.84% -2.52% 7.16%
typeWithTopToolbar 22.39 ms +7.37% -3.22% 19.34 ms +8.53% -0.31% 15.77%
typeContainer 7.62 ms +3.28% -3.28% 7.06 ms +4.82% -2.69% 7.93%
focus 96.84 ms +0.5% -4.04% 87.92 ms +5.38% -3.47% 10.15%
firstFocus 204 ms +0% -0% 165.47 ms +0% -0% 23.29%
selectAll 435.92 ms +5.79% -0.16% 434.01 ms +2% -2.41% 0.44%
listViewOpen 62.06 ms +2.18% -6.57% 55.57 ms +6.1% -3.87% 11.68%
inserterOpen 32.73 ms +6.51% -5.01% 32.37 ms +2.84% -8.9% 1.11%
inserterHover 10.15 ms +2.27% -6.31% 10.82 ms +8.13% -8.6% -6.19%
inserterSearch 7.17 ms +3.77% -10.32% 7.27 ms +11.14% -5.78% -1.38%
loadPatterns 503.11 ms +3.85% -4.73% 516.85 ms +1.15% -5.26% -2.66%
wpTotal 319.51 ms +7.97% -7.46% 308.62 ms +5.51% -8.43% 3.53%
wpMemoryUsage 13.23 MB +0% -0% 13.20 MB +0% -0% 0.29%
wpDbQueries 54 +0% -1.85% 54 +0% -0% 0%

site-editor

Metric 330fe59 trunk % Change
serverResponse 498.03 ms +1.44% -4.96% 506.55 ms +5.61% -3.51% -1.68%
firstPaint 339.58 ms +36.86% -24.55% 294.42 ms +20.03% -12.18% 15.34%
domContentLoaded 1196.45 ms +2.82% -2.53% 1247.01 ms +0.78% -3.35% -4.05%
loaded 1197.68 ms +2.82% -2.51% 1248.44 ms +0.78% -3.34% -4.07%
firstContentfulPaint 485.88 ms +0.76% -4.37% 499.79 ms +1.1% -3.57% -2.78%
firstBlock 4579.5 ms +1.16% -0.47% 4614.11 ms +1.47% -0.7% -0.75%
type 19.74 ms +4.1% -6.28% 20.6 ms +4.47% -4.37% -4.17%
navigate 136.61 ms +3.12% -6.21% 135.67 ms +10.35% -6.43% 0.69%
loadPatterns 1338.88 ms +5.98% -2.5% 1297.82 ms +8.07% -12.32% 3.16%
loadPages 1031.69 ms +0.75% -1.21% 1045.17 ms +2.81% -0.57% -1.29%
wpTotal 487.97 ms +1.46% -5.03% 496.64 ms +5.75% -3.65% -1.75%
wpMemoryUsage 12.27 MB +0% -0% 12.23 MB +0% -0% 0.31%
wpDbQueries 43 +2.33% -0% 43 +2.33% -0% 0%

fdb5056 Run

🏁 Flaky tests

Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

Navigates the items list via UP/DOWN arrow keys in /test/e2e/specs/site-editor/dataviews-list-layout-keyboard.spec.js, passed after 1 failed attempt.
Error: expect(locator).toBeFocused() failed

Locator:  getByLabel('Page Two')
Expected: focused
Received: inactive
Timeout:  5000ms

Call log:
  - Expect "toBeFocused" getByLabel('Page Two') with timeout 5000ms
  - waiting for getByLabel('Page Two')
    14 × locator resolved to <button type="button" tabindex="-1" aria-pressed="false" id="view-list-0-349-item-wrapper" class="dataviews-view-list__item" aria-labelledby="view-list-0-349-label" aria-describedby="view-list-0-349-description"></button>
       - unexpected value "inactive"

    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/site-editor/dataviews-list-layout-keyboard.spec.js:146:49
pushes earlier threads above the canvas to keep the selected one aligned in /test/e2e/specs/editor/various/block-notes-floating.spec.js, passed after 1 failed attempt.
Error: expect(locator).toBeVisible() failed

Locator: getByRole('region', { name: /^(Notes|Editor settings)$/ }).getByRole('treeitem', { name: 'Note: One: Comprehensive considerations regarding extraordinarily sophisticated implementation characteristics notwithstanding.' })
Expected: visible
Timeout: 5000ms
Error: element(s) not found

Call log:
  - Expect "toBeVisible" getByRole('region', { name: /^(Notes|Editor settings)$/ }).getByRole('treeitem', { name: 'Note: One: Comprehensive considerations regarding extraordinarily sophisticated implementation characteristics notwithstanding.' }) with timeout 5000ms
  - waiting for getByRole('region', { name: /^(Notes|Editor settings)$/ }).getByRole('treeitem', { name: 'Note: One: Comprehensive considerations regarding extraordinarily sophisticated implementation characteristics notwithstanding.' })

    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/various/block-notes-floating.spec.js:551:4

fdb5056 Run

@github-actions github-actions Bot added [Package] Element /packages/element [Package] Date /packages/date [Package] Data /packages/data [Package] Server Side Render /packages/server-side-render [Package] A11y /packages/a11y [Package] Autop /packages/autop [Package] DOM ready /packages/dom-ready [Package] Hooks /packages/hooks [Package] i18n /packages/i18n [Package] is-shallow-equal /packages/is-shallow-equal [Package] Url /packages/url [Package] Word count /packages/wordcount [Package] Deprecated packages/deprecated [Package] Blob /packages/blob [Package] Compose /packages/compose [Package] Core data /packages/core-data [Package] API fetch /packages/api-fetch [Package] HTML entities /packages/html-entities [Package] Viewport /packages/viewport [Package] DOM /packages/dom [Package] Keycodes /packages/keycodes [Package] Plugins /packages/plugins [Package] Components /packages/components [Package] Blocks /packages/blocks [Package] Editor /packages/editor [Package] Redux Routine /packages/redux-routine [Package] Block library /packages/block-library [Package] Notices /packages/notices [Package] Token List /packages/token-list labels Oct 8, 2026
@github-actions github-actions Bot added [Package] Fields /packages/fields [Package] Router /packages/router [Package] Theme /packages/theme [Package] UI /packages/ui [Package] Boot /packages/boot [Package] Image Cropper Related to packages/image-cropper [Package] Sync /packages/sync [Package] Admin UI /packages/admin-ui [Package] Abilities /packages/abilities [Package] Grid /packages/grid [Package] Widget primitives /packages/widget-primitives [Package] Widget Dashboard /packages/widget-dashboard [Package] Views /packages/views labels Oct 8, 2026
@t-hamano
t-hamano requested review from a team and manzoorwanijk October 8, 2026 10:02
@t-hamano t-hamano added [Type] Task Issues or PRs that have been broken down into an individual action to take npm Packages Related to npm packages labels Oct 8, 2026
t-hamano and others added 4 commits October 8, 2026 19:04
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Comment on lines -40 to -41
"./README.md": "./README.md",
"./CONTRIBUTING.md": "./CONTRIBUTING.md",

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

These exports seem to have been added in #72242, but they don't appear to serve any purpose, and that PR doesn't explain why they were added either.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I was wrong. These two are used by Storybook, so removing them causes CI to fail. I reverted it in b5d8dcd.

Storybook imports these files via the package exports.

Co-Authored-By: Claude <noreply@anthropic.com>
@Mamaduka

Mamaduka commented Oct 8, 2026

Copy link
Copy Markdown
Member

What's the common practice for similar files? Is CHANGELOG.md worth including? For example, the most active one is 300KB: packages/components/CHANGELOG.md.

P.S. I also remember seeing a request to trim plugins' changelog.txt, which is now around 5MB.

@t-hamano

t-hamano commented Oct 8, 2026

Copy link
Copy Markdown
Contributor Author

Is CHANGELOG.md worth including?

Good question. From what I found, tools like Renovate and Dependabot fetch changelogs from the source repository (via the repository field), not from the published tarball. On npmjs.com, the file is accessible through the Code tab, but I doubt many people read it there.

image

While the changelog matching the installed version is available offline in node_modules, I don't think that justifies the size, so I'll stop publishing CHANGELOG.md in this PR as well.

Co-Authored-By: Claude <noreply@anthropic.com>
@Mamaduka

Mamaduka commented Oct 8, 2026

Copy link
Copy Markdown
Member

Thanks, @t-hamano! Let's see what others think before merging this.

@manzoorwanijk manzoorwanijk 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.

Yes, this should reduce the package sizes. Thanks

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.

The sync README links to ./CODE.md, and the ui README links to ./CONTRIBUTING.md in two places. Can we change those to GitHub URLs so the links still work when these files are excluded from the installed packages?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Nice catch! Fixed in fdb5056

Co-Authored-By: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

npm Packages Related to npm packages [Package] A11y /packages/a11y [Package] Abilities /packages/abilities [Package] Admin UI /packages/admin-ui [Package] API fetch /packages/api-fetch [Package] Autop /packages/autop [Package] Blob /packages/blob [Package] Block editor /packages/block-editor [Package] Block library /packages/block-library [Package] Blocks /packages/blocks [Package] Boot /packages/boot [Package] Commands /packages/commands [Package] Components /packages/components [Package] Compose /packages/compose [Package] Core commands /packages/core-commands [Package] Core data /packages/core-data [Package] Data Controls /packages/data-controls [Package] Data /packages/data [Package] DataViews /packages/dataviews [Package] Date /packages/date [Package] Deprecated packages/deprecated [Package] DOM ready /packages/dom-ready [Package] DOM /packages/dom [Package] Edit Post /packages/edit-post [Package] Edit Site /packages/edit-site [Package] Edit Widgets /packages/edit-widgets [Package] Editor /packages/editor [Package] Element /packages/element [Package] Escape HTML /packages/escape-html [Package] Fields /packages/fields [Package] Format library /packages/format-library [Package] Grid /packages/grid [Package] Hooks /packages/hooks [Package] HTML entities /packages/html-entities [Package] i18n /packages/i18n [Package] Icons /packages/icons [Package] Image Cropper Related to packages/image-cropper [Package] Interactivity Router /packages/interactivity-router [Package] Interface /packages/interface [Package] is-shallow-equal /packages/is-shallow-equal [Package] Keyboard Shortcuts /packages/keyboard-shortcuts [Package] Keycodes /packages/keycodes [Package] Media Utils /packages/media-utils [Package] Notices /packages/notices [Package] Patterns /packages/patterns [Package] Plugins /packages/plugins [Package] Preferences /packages/preferences [Package] Primitives /packages/primitives [Package] Priority Queue /packages/priority-queue [Package] Private APIs /packages/private-apis [Package] React i18n /packages/react-i18n [Package] Redux Routine /packages/redux-routine [Package] Rich text /packages/rich-text [Package] Router /packages/router [Package] Server Side Render /packages/server-side-render [Package] Style Engine /packages/style-engine [Package] Sync /packages/sync [Package] Theme /packages/theme [Package] Token List /packages/token-list [Package] UI /packages/ui [Package] Url /packages/url [Package] Viewport /packages/viewport [Package] Views /packages/views [Package] Warning /packages/warning [Package] Widget Dashboard /packages/widget-dashboard [Package] Widget primitives /packages/widget-primitives [Package] Word count /packages/wordcount [Type] Task Issues or PRs that have been broken down into an individual action to take

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants