Skip to content

chore(bundle-size-tools): fold into build-cli#27253

Open
ChumpChief wants to merge 2 commits intomicrosoft:mainfrom
ChumpChief:bundle-size-tools-fold-into-build-cli
Open

chore(bundle-size-tools): fold into build-cli#27253
ChumpChief wants to merge 2 commits intomicrosoft:mainfrom
ChumpChief:bundle-size-tools-fold-into-build-cli

Conversation

@ChumpChief
Copy link
Copy Markdown
Contributor

Description

Continuation of the bundle-size-tools cleanup arc started by #27224. Folds the @fluidframework/bundle-size-tools package into build-cli and deletes the package shell.

After the prior PRs in this arc, bundle-size-tools' only consumer in the repo is build-cli itself (the bundle-size-tests example dropped its dependency in #27242 when BannedModulesPlugin was replaced with webpack's native resolve.fallback). With no remaining external consumers and the package being effectively build-tools-internal, the publish-as-its-own-npm-package pretense isn't earning anything. Folding it in eliminates a package boundary that's outlived its purpose.

This PR is intentionally a relocation — no type renames, no logic refactors, no behavioral changes. The diff shows up almost entirely as renames in git's view; reviewers can verify the move is faithful by spot-checking a few files.

Changes

The move itself.

  • bundle-size-tools/src/**build-cli/src/library/bundleSizeDiff/** (16 source files moved verbatim, directory structure preserved).
  • bundle-size-tools/ package shell deleted: package.json, README.md, LICENSE, api-extractor.json, api-report/, .npmignore, eslint.config.mts, packlist.txt, tsconfig.json.

Mechanical adjustments required by the move.

  • Append .js extensions to relative imports inside the moved files (build-cli's tsconfig uses node16 module resolution; bundle-size-tools' node resolution didn't require them).
  • unzipStream.ts: switch import { loadAsync } from "jszip" to a default import (import JSZip from "jszip"; JSZip.loadAsync(…)). build-cli is ESM and jszip is CJS, so named imports are unsupported there.
  • build-cli import sites updated from @fluidframework/bundle-size-tools to relative paths into ./library/bundleSizeDiff/: bundleSizeDiff.ts, codeCoveragePr.ts, getBaselineBuildMetrics.ts, buildPerf/adoClient.ts.
  • build-cli/test/filter.test.ts: drop the @fluidframework/bundle-size-tools entries from the expected-package-list fixtures.
  • build-cli/test/commands/test-only-filter.test.ts: bump expected counts (5→4) since the workspace has one fewer release-group package.
  • build-cli/package.json: drop @fluidframework/bundle-size-tools dep, add @types/webpack-bundle-analyzer devDep (the moved code imports BundleAnalyzerPlugin.JsonReport).

Workspace-level references to the deleted package: feeds (internal-build.txt, internal-test.txt, public.txt), build-tools/.syncpackrc.yml, root pnpm-workspace.yaml catalog, PACKAGES.md, build-tools/DEV.md, build-tools/.github/copilot-instructions.md, build-cli/README.md dev-mode override examples.

Reviewer Guidance

The review process is outlined on this wiki page.

The diff renders as renames + a handful of import-path edits + the package shell deletion. The cleanest review pass is probably: confirm the rename detection covers the source moves, then spot-check the import-path edits and the four other touched build-cli files. Compile and the existing test suite (489 tests) pass on the rebased branch.

bundle-size-tools is a build-tools-internal package whose only consumer
since the BannedModulesPlugin removal is build-cli itself. Move its
sources verbatim into build-cli at src/library/bundleSizeDiff/ and
delete the package shell. No type renames, no logic refactors, no
behavioral changes — just relocation.

Mechanical adjustments required by the move:
- Append .js extensions to relative imports (build-cli's tsconfig uses
  node16 module resolution; bundle-size-tools' didn't).
- Switch unzipStream's `import { loadAsync } from "jszip"` to a default
  import (build-cli is ESM and jszip is CJS, so named imports are
  unsupported).
- Update build-cli's import sites (bundleSizeDiff command,
  codeCoveragePr, getBaselineBuildMetrics, buildPerf/adoClient) to point
  at the new local path.
- Remove `@fluidframework/bundle-size-tools` from build-cli's deps and
  add `@types/webpack-bundle-analyzer` as a devDep (the moved code
  imports the JsonReport type).
- Update workspace-level references to the deleted package: feeds,
  syncpackrc, pnpm-workspace catalog, PACKAGES.md, DEV.md, build-tools
  copilot-instructions, build-cli README dev-mode override examples,
  and the filter test fixtures (which enumerate workspace packages).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 6, 2026

Hi! Thank you for opening this PR. Want me to review it?

Based on the diff (687 lines, 43 files), I've queued these reviewers:

  • Correctness — logic errors, race conditions, lifecycle issues
  • Security — vulnerabilities, secret exposure, injection
  • API Compatibility — breaking changes, release tags, type design
  • Performance — algorithmic regressions, memory leaks
  • Testing — coverage gaps, hollow tests

How this works

  • Adjust the reviewer set by ticking/unticking boxes above. Reviewer toggles alone don't trigger anything.

  • Tick Start review below to dispatch the review fleet.

  • After review finishes, tick Start review again to request another run — it auto-resets after each dispatch.

  • This comment updates as new commits land; your reviewer selections are preserved.

  • Start review

@ChumpChief ChumpChief marked this pull request as ready for review May 6, 2026 23:46
Copilot AI review requested due to automatic review settings May 6, 2026 23:46
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 folds the former @fluidframework/bundle-size-tools implementation into @fluid-tools/build-cli (src/library/bundleSizeDiff/**) and removes the standalone package, updating workspace references and build-cli import sites accordingly.

Changes:

  • Relocated bundle-size diff / ADO comparator implementation into build-cli and removed the bundle-size-tools package shell.
  • Updated build-cli call sites to use the new internal module paths and added @types/webpack-bundle-analyzer to build-cli.
  • Updated workspace metadata/docs/feeds and adjusted build-cli tests to account for the removed package.

Reviewed changes

Copilot reviewed 35 out of 42 changed files in this pull request and generated no comments.

Show a summary per file
File Description
pnpm-workspace.yaml Removes @fluidframework/bundle-size-tools from the root catalog.
PACKAGES.md Removes bundle-size-tools from the build-tools package list.
build-tools/pnpm-lock.yaml Drops workspace link to bundle-size-tools; adds @types/webpack-bundle-analyzer under build-cli.
build-tools/packages/bundle-size-tools/tsconfig.json Deletes the old package shell config.
build-tools/packages/bundle-size-tools/README.md Deletes the old package README.
build-tools/packages/bundle-size-tools/packlist.txt Deletes the old package packlist.
build-tools/packages/bundle-size-tools/package.json Deletes the old package manifest.
build-tools/packages/bundle-size-tools/LICENSE Deletes the old package license file (package removed).
build-tools/packages/bundle-size-tools/eslint.config.mts Deletes old package-specific eslint config.
build-tools/packages/bundle-size-tools/api-report/bundle-size-tools.api.md Deletes old generated API report for the removed package.
build-tools/packages/bundle-size-tools/api-extractor.json Deletes old API Extractor config for the removed package.
build-tools/packages/bundle-size-tools/.npmignore Deletes old publish ignore list for the removed package.
build-tools/packages/build-cli/src/test/filter.test.ts Updates expected package lists to remove bundle-size-tools.
build-tools/packages/build-cli/src/test/commands/test-only-filter.test.ts Updates expected selected/filtered counts after package removal.
build-tools/packages/build-cli/src/library/bundleSizeDiff/utilities/unzipStream.ts Adjusts JSZip import for ESM/CJS interop (default import).
build-tools/packages/build-cli/src/library/bundleSizeDiff/utilities/index.ts Updates internal exports to include .js extensions for Node16 resolution.
build-tools/packages/build-cli/src/library/bundleSizeDiff/utilities/gitCommands.ts Introduces baseline merge-base computation helper (now inside build-cli).
build-tools/packages/build-cli/src/library/bundleSizeDiff/utilities/getBuilds.ts Updates ADO types import to include .js extension.
build-tools/packages/build-cli/src/library/bundleSizeDiff/utilities/getAllFilesInDirectory.ts Adds recursive file enumeration utility under build-cli.
build-tools/packages/build-cli/src/library/bundleSizeDiff/index.ts Re-exports the relocated bundle-size diff API surface for internal use.
build-tools/packages/build-cli/src/library/bundleSizeDiff/compareBundles.ts Updates internal imports to .js-suffixed paths.
build-tools/packages/build-cli/src/library/bundleSizeDiff/BundleBuddyTypes.ts Provides types for bundle summaries/metrics/comparisons under build-cli.
build-tools/packages/build-cli/src/library/bundleSizeDiff/ADO/index.ts Updates ADO barrel exports to .js-suffixed paths.
build-tools/packages/build-cli/src/library/bundleSizeDiff/ADO/getBundleSummaries.ts Updates internal type imports to .js-suffixed paths.
build-tools/packages/build-cli/src/library/bundleSizeDiff/ADO/getBundleFilePathsFromFolder.ts Adds analyzer.json path filtering + bundle name derivation under build-cli.
build-tools/packages/build-cli/src/library/bundleSizeDiff/ADO/getAzureDevopsApi.ts Adds ADO client constructor with anonymous-read fallback under build-cli.
build-tools/packages/build-cli/src/library/bundleSizeDiff/ADO/FileSystemBundleFileProvider.ts Updates internal imports to relocated utilities and .js-suffixed paths.
build-tools/packages/build-cli/src/library/bundleSizeDiff/ADO/Constants.ts Defines ADO constants shape under build-cli.
build-tools/packages/build-cli/src/library/bundleSizeDiff/ADO/AdoSizeComparator.ts Updates internal imports to relocated modules + .js extensions.
build-tools/packages/build-cli/src/library/bundleSizeDiff/ADO/AdoArtifactFileProvider.ts Updates internal imports to relocated utilities + .js extensions.
build-tools/packages/build-cli/src/library/buildPerf/adoClient.ts Switches to build-cli’s internal getAzureDevopsApi export.
build-tools/packages/build-cli/src/library/azureDevops/getBaselineBuildMetrics.ts Switches to build-cli’s internal getZipObjectFromArtifact export.
build-tools/packages/build-cli/src/commands/generate/bundleSizeDiff.ts Switches to build-cli’s internal bundleSizeDiff exports.
build-tools/packages/build-cli/src/codeCoverage/codeCoveragePr.ts Switches to build-cli’s internal getAzureDevopsApi export.
build-tools/packages/build-cli/README.md Removes dev override examples referencing deleted package.
build-tools/packages/build-cli/package.json Drops dependency on bundle-size-tools; adds @types/webpack-bundle-analyzer.
build-tools/feeds/public.txt Removes bundle-size-tools from the public feed list.
build-tools/feeds/internal-test.txt Removes bundle-size-tools from the internal-test feed list.
build-tools/feeds/internal-build.txt Removes bundle-size-tools from the internal-build feed list.
build-tools/DEV.md Updates dependency pin note to reflect bundle-size-tools removal.
build-tools/.syncpackrc.yml Removes bundle-size-tools from build-tools semver group.
build-tools/.github/copilot-instructions.md Removes references to bundle-size-tools from workspace docs and build order.
Files not reviewed (1)
  • build-tools/pnpm-lock.yaml: Language not supported
Comments suppressed due to low confidence (3)

build-tools/packages/build-cli/src/library/bundleSizeDiff/ADO/AdoSizeComparator.ts:10

  • Node built-ins should be imported using the node: protocol (repo enforces unicorn/prefer-node-protocol). import { join } from "path" should be updated to node:path to avoid eslint failures.
    build-tools/packages/build-cli/src/library/bundleSizeDiff/ADO/FileSystemBundleFileProvider.ts:8
  • Node built-ins should be imported using the node: protocol (repo enforces unicorn/prefer-node-protocol). Update the fs import here to node:fs to avoid eslint failures.
    build-tools/packages/build-cli/src/library/bundleSizeDiff/ADO/AdoArtifactFileProvider.ts:9
  • Node built-ins should be imported using the node: protocol (repo enforces unicorn/prefer-node-protocol). Update the assert import here to node:assert to avoid eslint failures.

- buildProject.test.ts: update the FluidFramework backCompat config-loading
  test to expect 5 packages in the build-tools workspace (was 6 before
  bundle-size-tools was deleted).
- PACKAGES.md: regenerate via `flub check layers --md .` to drop a stale
  trailing `&nbsp;</br>` padding row that my manual edit left behind. The
  CI "Check for extraneous modified files" guard caught the diff.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 7, 2026

🔗 No broken links found! ✅

Your attention to detail is admirable.

linkcheck output


> fluid-framework-docs-site@0.0.0 ci:check-links /home/runner/work/FluidFramework/FluidFramework/docs
> start-server-and-test "npm run serve -- --no-open" 3000 check-links

1: starting server using command "npm run serve -- --no-open"
and when url "[ 'http://127.0.0.1:3000' ]" is responding with HTTP status code 200
running tests using command "npm run check-links"


> fluid-framework-docs-site@0.0.0 serve
> docusaurus serve --no-open

[SUCCESS] Serving "build" directory at: http://localhost:3000/

> fluid-framework-docs-site@0.0.0 check-links
> linkcheck http://localhost:3000 --skip-file skipped-urls.txt

Crawling...

Stats:
  288641 links
    1922 destination URLs
    2172 URLs ignored
       0 warnings
       0 errors


@ChumpChief ChumpChief requested a review from tylerbutler May 7, 2026 01:03
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