Skip to content

fix(bridge): exclude __tests__ from published package#4674

Merged
2heal1 merged 3 commits intomodule-federation:mainfrom
2heal1:fix/exclude-tests-from-build
Apr 23, 2026
Merged

fix(bridge): exclude __tests__ from published package#4674
2heal1 merged 3 commits intomodule-federation:mainfrom
2heal1:fix/exclude-tests-from-build

Conversation

@2heal1
Copy link
Copy Markdown
Member

@2heal1 2heal1 commented Apr 17, 2026

Add npm publish file lists for bridge packages to avoid shipping tests and test fixtures.

Description

Related Issue

#4668

Types of changes

  • Docs change / refactoring / dependency upgrade
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

Checklist

  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • I have updated the documentation.

Add npm publish file lists for bridge packages to avoid shipping __tests__ and test fixtures.
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 17, 2026

⚠️ No Changeset found

Latest commit: 82eeb80

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 17, 2026

Deploy Preview for module-federation-docs ready!

Name Link
🔨 Latest commit 82eeb80
🔍 Latest deploy log https://app.netlify.com/projects/module-federation-docs/deploys/69e986699f1afc000820dd90
😎 Deploy Preview https://deploy-preview-4674--module-federation-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Apr 17, 2026

Open in StackBlitz

@module-federation/devtools

pnpm add https://pkg.pr.new/@module-federation/devtools@82eeb80

@module-federation/cli

pnpm add https://pkg.pr.new/@module-federation/cli@82eeb80

create-module-federation

pnpm add https://pkg.pr.new/create-module-federation@82eeb80

@module-federation/data-prefetch

pnpm add https://pkg.pr.new/@module-federation/data-prefetch@82eeb80

@module-federation/dts-plugin

pnpm add https://pkg.pr.new/@module-federation/dts-plugin@82eeb80

@module-federation/enhanced

pnpm add https://pkg.pr.new/@module-federation/enhanced@82eeb80

@module-federation/error-codes

pnpm add https://pkg.pr.new/@module-federation/error-codes@82eeb80

@module-federation/esbuild

pnpm add https://pkg.pr.new/@module-federation/esbuild@82eeb80

@module-federation/managers

pnpm add https://pkg.pr.new/@module-federation/managers@82eeb80

@module-federation/manifest

pnpm add https://pkg.pr.new/@module-federation/manifest@82eeb80

@module-federation/metro

pnpm add https://pkg.pr.new/@module-federation/metro@82eeb80

@module-federation/metro-plugin-rnc-cli

pnpm add https://pkg.pr.new/@module-federation/metro-plugin-rnc-cli@82eeb80

@module-federation/metro-plugin-rnef

pnpm add https://pkg.pr.new/@module-federation/metro-plugin-rnef@82eeb80

@module-federation/modern-js

pnpm add https://pkg.pr.new/@module-federation/modern-js@82eeb80

@module-federation/modern-js-v3

pnpm add https://pkg.pr.new/@module-federation/modern-js-v3@82eeb80

@module-federation/native-federation-tests

pnpm add https://pkg.pr.new/@module-federation/native-federation-tests@82eeb80

@module-federation/native-federation-typescript

pnpm add https://pkg.pr.new/@module-federation/native-federation-typescript@82eeb80

@module-federation/nextjs-mf

pnpm add https://pkg.pr.new/@module-federation/nextjs-mf@82eeb80

@module-federation/node

pnpm add https://pkg.pr.new/@module-federation/node@82eeb80

@module-federation/retry-plugin

pnpm add https://pkg.pr.new/@module-federation/retry-plugin@82eeb80

@module-federation/rsbuild-plugin

pnpm add https://pkg.pr.new/@module-federation/rsbuild-plugin@82eeb80

@module-federation/rspack

pnpm add https://pkg.pr.new/@module-federation/rspack@82eeb80

@module-federation/rspress-plugin

pnpm add https://pkg.pr.new/@module-federation/rspress-plugin@82eeb80

@module-federation/runtime

pnpm add https://pkg.pr.new/@module-federation/runtime@82eeb80

@module-federation/runtime-core

pnpm add https://pkg.pr.new/@module-federation/runtime-core@82eeb80

@module-federation/runtime-tools

pnpm add https://pkg.pr.new/@module-federation/runtime-tools@82eeb80

@module-federation/sdk

pnpm add https://pkg.pr.new/@module-federation/sdk@82eeb80

@module-federation/storybook-addon

pnpm add https://pkg.pr.new/@module-federation/storybook-addon@82eeb80

@module-federation/third-party-dts-extractor

pnpm add https://pkg.pr.new/@module-federation/third-party-dts-extractor@82eeb80

@module-federation/treeshake-frontend

pnpm add https://pkg.pr.new/@module-federation/treeshake-frontend@82eeb80

@module-federation/treeshake-server

pnpm add https://pkg.pr.new/@module-federation/treeshake-server@82eeb80

@module-federation/typescript

pnpm add https://pkg.pr.new/@module-federation/typescript@82eeb80

@module-federation/utilities

pnpm add https://pkg.pr.new/@module-federation/utilities@82eeb80

@module-federation/webpack-bundler-runtime

pnpm add https://pkg.pr.new/@module-federation/webpack-bundler-runtime@82eeb80

@module-federation/bridge-react

pnpm add https://pkg.pr.new/@module-federation/bridge-react@82eeb80

@module-federation/bridge-react-webpack-plugin

pnpm add https://pkg.pr.new/@module-federation/bridge-react-webpack-plugin@82eeb80

@module-federation/bridge-shared

pnpm add https://pkg.pr.new/@module-federation/bridge-shared@82eeb80

@module-federation/bridge-vue3

pnpm add https://pkg.pr.new/@module-federation/bridge-vue3@82eeb80

@module-federation/inject-external-runtime-core-plugin

pnpm add https://pkg.pr.new/@module-federation/inject-external-runtime-core-plugin@82eeb80

commit: 82eeb80

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 17, 2026

Bundle Size Report

10 package(s) changed, 30 unchanged.

Package dist + ESM entry

Package Total dist (raw) Delta ESM gzip Delta
@module-federation/cli 26.3 kB no change 786 B no change
@module-federation/core 39.1 kB no change 173 B no change
@module-federation/devtools 481.4 kB no change 3.9 kB no change
@module-federation/enhanced 814.0 kB no change 672 B no change
@module-federation/managers 69.8 kB no change 334 B no change
@module-federation/manifest 138.0 kB no change 182 B no change
@module-federation/metro-plugin-rnc-cli 0 B no change 314 B no change
@module-federation/node 193.4 kB no change 217 B no change
@module-federation/storybook-addon 77.6 kB no change 100 B no change
@module-federation/utilities 110.6 kB no change 328 B no change

Bundle targets

Package Web bundle (gzip) Delta Node bundle (gzip) Delta
@module-federation/cli 2.3 kB -32 B (-1.3%) 2.3 kB -32 B (-1.3%)
@module-federation/core 1.1 kB -32 B (-2.9%) 1.0 kB -31 B (-2.9%)
@module-federation/devtools 21.3 kB -25 B (-0.1%) 21.3 kB -25 B (-0.1%)
@module-federation/enhanced 2.6 kB -44 B (-1.6%) 2.6 kB -44 B (-1.6%)
@module-federation/managers 2.4 kB -27 B (-1.1%) 2.4 kB -27 B (-1.1%)
@module-federation/manifest 6.2 kB -37 B (-0.6%) 6.2 kB -37 B (-0.6%)
@module-federation/metro-plugin-rnc-cli 411 B -26 B (-5.9%) 411 B -26 B (-5.9%)
@module-federation/node 9.2 kB -28 B (-0.3%) 9.2 kB -28 B (-0.3%)
@module-federation/storybook-addon 1.9 kB -24 B (-1.2%) 1.7 kB -24 B (-1.3%)
@module-federation/utilities 2.6 kB -31 B (-1.2%) 2.6 kB -31 B (-1.2%)

Consumer scenarios

Scenario Web output (gzip) Delta Node output (gzip) Delta Gap (node-web) Delta
Enhanced remoteEntry 19.8 kB -16 B (-0.1%) 20.8 kB -20 B (-0.1%) +1.0 kB -4 B

Total dist (raw): 6.32 MB (no change)
Total ESM gzip: 74.0 kB (no change)
Total web bundle (gzip): 179.5 kB (-306 B (-0.2%))
Total node bundle (gzip): 180.0 kB (-305 B (-0.2%))
Tracked ./bundler entry gzip: 556 B (no change)
Tracked ./bundler web bundle (gzip): 4.8 kB (no change)
Tracked ./bundler node bundle (gzip): 4.8 kB (no change)

Bundle sizes are generated with rslib (Rspack). Package-root metrics preserve the historical report. Tracked subpath exports such as ./bundler are measured separately so ENV_TARGET-driven tree-shaking is visible. Bare imports are externalized to keep package-level sizes consistent, and assets are emitted as resources.

},
"files": [
"dist/",
"src/",
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

question: Sorry to bump in here like that but I have a quick question:
Why are you publishing the files under src as well as the transpiled files under dist?
Is there some additional benefit to doing that? You should be already generating declarations.
Is this only done to allow consumers to jump to the "real" source code while developing?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Good catch! You are completely right.

To be honest, including src/ was a misjudgment made by the AI assistant I used to help configure this package. It's totally unnecessary since we already ship the compiled output and declarations in dist/.

I haven't merged this PR yet, so I will update it to remove src/ from the published files. Thanks for pointing it out!

@2heal1 2heal1 merged commit e53d104 into module-federation:main Apr 23, 2026
23 checks passed
@2heal1 2heal1 mentioned this pull request Apr 29, 2026
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.

2 participants