chore(bundle-size-tools): fold into build-cli#27253
chore(bundle-size-tools): fold into build-cli#27253ChumpChief wants to merge 2 commits intomicrosoft:mainfrom
Conversation
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>
|
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:
How this works
|
There was a problem hiding this comment.
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-cliand removed thebundle-size-toolspackage shell. - Updated
build-clicall sites to use the new internal module paths and added@types/webpack-bundle-analyzertobuild-cli. - Updated workspace metadata/docs/feeds and adjusted
build-clitests 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 enforcesunicorn/prefer-node-protocol).import { join } from "path"should be updated tonode:pathto 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 enforcesunicorn/prefer-node-protocol). Update thefsimport here tonode:fsto 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 enforcesunicorn/prefer-node-protocol). Update theassertimport here tonode:assertto 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 ` </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>
|
🔗 No broken links found! ✅ Your attention to detail is admirable. linkcheck output |
Description
Continuation of the bundle-size-tools cleanup arc started by #27224. Folds the
@fluidframework/bundle-size-toolspackage intobuild-cliand deletes the package shell.After the prior PRs in this arc, bundle-size-tools' only consumer in the repo is
build-cliitself (the bundle-size-tests example dropped its dependency in #27242 whenBannedModulesPluginwas replaced with webpack's nativeresolve.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.
.jsextensions to relative imports inside the moved files (build-cli'stsconfigusesnode16module resolution; bundle-size-tools'noderesolution didn't require them).unzipStream.ts: switchimport { 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-cliimport sites updated from@fluidframework/bundle-size-toolsto 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-toolsentries 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-toolsdep, add@types/webpack-bundle-analyzerdevDep (the moved code importsBundleAnalyzerPlugin.JsonReport).Workspace-level references to the deleted package: feeds (
internal-build.txt,internal-test.txt,public.txt),build-tools/.syncpackrc.yml, rootpnpm-workspace.yamlcatalog,PACKAGES.md,build-tools/DEV.md,build-tools/.github/copilot-instructions.md,build-cli/README.mddev-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.