diff --git a/PACKAGES.md b/PACKAGES.md index a42f9cb2f74f..6ceea4cfe116 100644 --- a/PACKAGES.md +++ b/PACKAGES.md @@ -195,7 +195,7 @@ The dependencies between layers are enforced by the layer-check command._ | Packages | Layer Dependencies | | --- | --- | -| - [@fluid-private/changelog-generator-wrapper](/packages/tools/changelog-generator-wrapper) (private)
- [@fluidframework/devtools](/packages/tools/devtools/devtools)
- [@fluid-internal/devtools-browser-extension](/packages/tools/devtools/devtools-browser-extension) (private)
- [@fluidframework/devtools-core](/packages/tools/devtools/devtools-core)
- [@fluid-private/devtools-test-app](/packages/tools/devtools/devtools-test-app) (private)
- [@fluid-internal/devtools-view](/packages/tools/devtools/devtools-view) (private)
- [@fluid-tools/fetch-tool](/packages/tools/fetch-tool)
- [@fluidframework/fluid-runner](/packages/tools/fluid-runner)
- [@fluid-internal/replay-tool](/packages/tools/replay-tool) (private)
- [@fluid-tools/markdown-magic](/tools/markdown-magic) (private)
- [@fluid-tools/build-cli](/build-tools/packages/build-cli)
- [@fluid-tools/build-infrastructure](/build-tools/packages/build-infrastructure)
- [@fluidframework/build-tools](/build-tools/packages/build-tools)
- [@fluidframework/bundle-size-tools](/build-tools/packages/bundle-size-tools)
- [@fluid-tools/version-tools](/build-tools/packages/version-tools)
- [@fluid-tools/api-markdown-documenter](/tools/api-markdown-documenter)
- [@fluid-internal/getkeys](/tools/getkeys) (private)
- [@fluidframework/test-tools](/tools/test-tools) | - [Core-Interfaces](#Core-Interfaces)
- [Driver-Definitions](#Driver-Definitions)
- [Container-Definitions](#Container-Definitions)
- [Core-Utils](#Core-Utils)
- [Client-Utils](#Client-Utils)
- [Telemetry-Utils](#Telemetry-Utils)
- [Other-Utils](#Other-Utils)
- [Tool-Utils](#Tool-Utils)
- [Driver](#Driver)
- [Loader](#Loader)
- [Runtime](#Runtime)
- [Framework](#Framework)
- [Routerlicious-Driver](#Routerlicious-Driver)
- [Test-Utils](#Test-Utils)
- [Examples](#Examples)
 
 
  | +| - [@fluid-private/changelog-generator-wrapper](/packages/tools/changelog-generator-wrapper) (private)
- [@fluidframework/devtools](/packages/tools/devtools/devtools)
- [@fluid-internal/devtools-browser-extension](/packages/tools/devtools/devtools-browser-extension) (private)
- [@fluidframework/devtools-core](/packages/tools/devtools/devtools-core)
- [@fluid-private/devtools-test-app](/packages/tools/devtools/devtools-test-app) (private)
- [@fluid-internal/devtools-view](/packages/tools/devtools/devtools-view) (private)
- [@fluid-tools/fetch-tool](/packages/tools/fetch-tool)
- [@fluidframework/fluid-runner](/packages/tools/fluid-runner)
- [@fluid-internal/replay-tool](/packages/tools/replay-tool) (private)
- [@fluid-tools/markdown-magic](/tools/markdown-magic) (private)
- [@fluid-tools/build-cli](/build-tools/packages/build-cli)
- [@fluid-tools/build-infrastructure](/build-tools/packages/build-infrastructure)
- [@fluidframework/build-tools](/build-tools/packages/build-tools)
- [@fluid-tools/version-tools](/build-tools/packages/version-tools)
- [@fluid-tools/api-markdown-documenter](/tools/api-markdown-documenter)
- [@fluid-internal/getkeys](/tools/getkeys) (private)
- [@fluidframework/test-tools](/tools/test-tools) | - [Core-Interfaces](#Core-Interfaces)
- [Driver-Definitions](#Driver-Definitions)
- [Container-Definitions](#Container-Definitions)
- [Core-Utils](#Core-Utils)
- [Client-Utils](#Client-Utils)
- [Telemetry-Utils](#Telemetry-Utils)
- [Other-Utils](#Other-Utils)
- [Tool-Utils](#Tool-Utils)
- [Driver](#Driver)
- [Loader](#Loader)
- [Runtime](#Runtime)
- [Framework](#Framework)
- [Routerlicious-Driver](#Routerlicious-Driver)
- [Test-Utils](#Test-Utils)
- [Examples](#Examples)
 
  | ### Tests diff --git a/build-tools/.github/copilot-instructions.md b/build-tools/.github/copilot-instructions.md index 2b69f391751b..1a9956991b10 100644 --- a/build-tools/.github/copilot-instructions.md +++ b/build-tools/.github/copilot-instructions.md @@ -16,7 +16,6 @@ This is the **build-tools** release group for the Fluid Framework monorepo. It c | `@fluidframework/build-tools` | Core build infrastructure, `fluid-build` CLI | `dist/` | CommonJS | | `@fluid-tools/build-infrastructure` | Workspace and release group abstractions | `lib/` (ESM), `dist/` (CJS) | Dual | | `@fluid-tools/version-tools` (fluv) | Semantic versioning utilities CLI | `lib/` | CommonJS | -| `@fluidframework/bundle-size-tools` | Bundle size analysis utilities | `dist/` | CommonJS | ## Build Commands @@ -54,8 +53,7 @@ Packages have workspace dependencies and must build in order: 1. `version-tools` (no internal deps) 2. `build-tools` (depends on version-tools) 3. `build-infrastructure` (depends on version-tools) -4. `bundle-size-tools` (no internal deps) -5. `build-cli` (depends on all above) +4. `build-cli` (depends on all above) The `fluid-build` task scheduler handles this automatically via `pnpm build`. @@ -141,7 +139,6 @@ build-tools/ │ ├── build-cli/ # flub CLI (ESM) │ ├── build-infrastructure/ # Workspace abstractions (dual ESM/CJS) │ ├── build-tools/ # fluid-build CLI (CommonJS) -│ ├── bundle-size-tools/ # Bundle analysis (CommonJS) │ └── version-tools/ # fluv CLI (CommonJS) ├── biome.jsonc # Formatter config ├── .syncpackrc.yml # Dep version rules diff --git a/build-tools/.syncpackrc.yml b/build-tools/.syncpackrc.yml index 4d406fd9c4a5..961c4be4beb5 100644 --- a/build-tools/.syncpackrc.yml +++ b/build-tools/.syncpackrc.yml @@ -145,7 +145,6 @@ semverGroups: - "@fluid-tools/build-infrastructure" - "@fluid-tools/version-tools" - "@fluidframework/build-tools" - - "@fluidframework/bundle-size-tools" - "@fluidframework/build-tools-bin" packages: - "**" diff --git a/build-tools/DEV.md b/build-tools/DEV.md index 418346649764..3eecb6e47733 100644 --- a/build-tools/DEV.md +++ b/build-tools/DEV.md @@ -108,7 +108,7 @@ The following dependencies are pinned to older major versions because newer vers - Latest: `^15.x` - Issue: Version 15 has incompatible type definitions and breaks bundle size analysis tools - Error: `Types have separate declarations of a private property` and `Type is missing properties` - - Used in: `build-cli`, `bundle-size-tools` + - Used in: `build-cli` - Note: Pinned at `^11.2.0` to maintain compatibility; upgrade blocked until type issues resolved #### API/Structure Breaking Changes diff --git a/build-tools/feeds/internal-build.txt b/build-tools/feeds/internal-build.txt index 596a9b73d47a..936d50cd84fa 100644 --- a/build-tools/feeds/internal-build.txt +++ b/build-tools/feeds/internal-build.txt @@ -1,5 +1,4 @@ @fluid-tools/version-tools -@fluidframework/bundle-size-tools @fluidframework/build-tools @fluid-tools/build-infrastructure @fluid-tools/build-cli \ No newline at end of file diff --git a/build-tools/feeds/internal-test.txt b/build-tools/feeds/internal-test.txt index 596a9b73d47a..936d50cd84fa 100644 --- a/build-tools/feeds/internal-test.txt +++ b/build-tools/feeds/internal-test.txt @@ -1,5 +1,4 @@ @fluid-tools/version-tools -@fluidframework/bundle-size-tools @fluidframework/build-tools @fluid-tools/build-infrastructure @fluid-tools/build-cli \ No newline at end of file diff --git a/build-tools/feeds/public.txt b/build-tools/feeds/public.txt index 596a9b73d47a..936d50cd84fa 100644 --- a/build-tools/feeds/public.txt +++ b/build-tools/feeds/public.txt @@ -1,5 +1,4 @@ @fluid-tools/version-tools -@fluidframework/bundle-size-tools @fluidframework/build-tools @fluid-tools/build-infrastructure @fluid-tools/build-cli \ No newline at end of file diff --git a/build-tools/packages/build-cli/README.md b/build-tools/packages/build-cli/README.md index f35fe168b4d2..ff37c120d012 100644 --- a/build-tools/packages/build-cli/README.md +++ b/build-tools/packages/build-cli/README.md @@ -82,8 +82,7 @@ For client that is: ``` "@fluid-tools/build-cli": "file:./build-tools/packages/build-cli", "@fluidframework/build-tools": "file:./build-tools/packages/build-tools", - "@fluid-tools/version-tools": "file:./build-tools/packages/version-tools", - "@fluidframework/bundle-size-tools": "file:./build-tools/packages/bundle-size-tools" + "@fluid-tools/version-tools": "file:./build-tools/packages/version-tools" ``` This approach can be used with `flub generate typetests` to ensure that the `--entrypoint` configuration, if any, from the scripts is included, and can be done from a JavaScript Debug console to debug, though breakpoints will need to be set in the `.js` files in `node_modules` (for example in `node_modules/.pnpm/file+build-tools+packages+build-cli_@types+node@18.19.1/node_modules/@fluid-tools/build-cli/lib/commands/generate/typetests.js`). @@ -93,8 +92,7 @@ Alternatively, `link:` overrides give similar results and are known to support s ``` "@fluid-tools/build-cli": "link:./build-tools/packages/build-cli", "@fluidframework/build-tools": "link:./build-tools/packages/build-tools", - "@fluid-tools/version-tools": "link:./build-tools/packages/version-tools", - "@fluidframework/bundle-size-tools": "link:./build-tools/packages/bundle-size-tools" + "@fluid-tools/version-tools": "link:./build-tools/packages/version-tools" ``` Either pattern requires `pnpm i --no-frozen-lockfile` after setting `overrides`. If any build-tools package `dependencies` are updated when using `file:`, be sure to rerun for both workspaces. diff --git a/build-tools/packages/build-cli/package.json b/build-tools/packages/build-cli/package.json index 2ddbc7b194f6..ec62d62465b8 100644 --- a/build-tools/packages/build-cli/package.json +++ b/build-tools/packages/build-cli/package.json @@ -89,7 +89,6 @@ "@fluid-tools/build-infrastructure": "workspace:~", "@fluid-tools/version-tools": "workspace:~", "@fluidframework/build-tools": "workspace:~", - "@fluidframework/bundle-size-tools": "workspace:~", "@github/copilot-sdk": "^0.2.2", "@inquirer/prompts": "^8.0.1", "@microsoft/api-extractor": "^7.58.1", @@ -168,6 +167,7 @@ "@types/semver": "^7.7.1", "@types/sort-json": "^2.0.3", "@types/unist": "^3.0.3", + "@types/webpack-bundle-analyzer": "^4.7.0", "@types/xml2js": "^0.4.14", "c8": "^10.1.3", "chai": "^6.2.1", diff --git a/build-tools/packages/build-cli/src/codeCoverage/codeCoveragePr.ts b/build-tools/packages/build-cli/src/codeCoverage/codeCoveragePr.ts index 6154f3c162ad..66ca974fc7d2 100644 --- a/build-tools/packages/build-cli/src/codeCoverage/codeCoveragePr.ts +++ b/build-tools/packages/build-cli/src/codeCoverage/codeCoveragePr.ts @@ -3,13 +3,13 @@ * Licensed under the MIT License. */ -import { getAzureDevopsApi } from "@fluidframework/bundle-size-tools"; import type { IAzureDevopsBuildCoverageConstants } from "../library/azureDevops/constants.js"; import { getBaselineBuildMetrics, getBuildArtifactForSpecificBuild, type IBuildMetrics, } from "../library/azureDevops/getBaselineBuildMetrics.js"; +import { getAzureDevopsApi } from "../library/bundleSizeDiff/index.js"; import type { CommandLogger } from "../logging.js"; import { type CodeCoverageComparison, compareCodeCoverage } from "./compareCodeCoverage.js"; import { getCoverageMetricsFromArtifact } from "./getCoverageMetrics.js"; diff --git a/build-tools/packages/build-cli/src/commands/generate/bundleSizeDiff.ts b/build-tools/packages/build-cli/src/commands/generate/bundleSizeDiff.ts index 6f2091bb05d8..c3693b4964a5 100644 --- a/build-tools/packages/build-cli/src/commands/generate/bundleSizeDiff.ts +++ b/build-tools/packages/build-cli/src/commands/generate/bundleSizeDiff.ts @@ -5,13 +5,13 @@ import { mkdir, rm, writeFile } from "node:fs/promises"; import path from "node:path"; +import { Flags } from "@oclif/core"; import { ADOSizeComparator, type BundleComparison, bundlesContainNoChanges, getAzureDevopsApi, -} from "@fluidframework/bundle-size-tools"; -import { Flags } from "@oclif/core"; +} from "../../library/bundleSizeDiff/index.js"; import { BaseCommand } from "../../library/commands/base.js"; diff --git a/build-tools/packages/build-cli/src/library/azureDevops/getBaselineBuildMetrics.ts b/build-tools/packages/build-cli/src/library/azureDevops/getBaselineBuildMetrics.ts index 0cce8af4a5e4..9159922e4627 100644 --- a/build-tools/packages/build-cli/src/library/azureDevops/getBaselineBuildMetrics.ts +++ b/build-tools/packages/build-cli/src/library/azureDevops/getBaselineBuildMetrics.ts @@ -4,12 +4,12 @@ */ import { strict as assert } from "node:assert"; -import { getZipObjectFromArtifact } from "@fluidframework/bundle-size-tools"; import type { WebApi } from "azure-devops-node-api"; import type { Build } from "azure-devops-node-api/interfaces/BuildInterfaces.js"; import { BuildResult } from "azure-devops-node-api/interfaces/BuildInterfaces.js"; import type JSZip from "jszip"; import type { CommandLogger } from "../../logging.js"; +import { getZipObjectFromArtifact } from "../bundleSizeDiff/index.js"; import type { IAzureDevopsBuildCoverageConstants } from "./constants.js"; import { getBuild, getBuilds } from "./utils.js"; diff --git a/build-tools/packages/build-cli/src/library/buildPerf/adoClient.ts b/build-tools/packages/build-cli/src/library/buildPerf/adoClient.ts index 54ec1b950446..60851876d3e5 100644 --- a/build-tools/packages/build-cli/src/library/buildPerf/adoClient.ts +++ b/build-tools/packages/build-cli/src/library/buildPerf/adoClient.ts @@ -7,7 +7,6 @@ * Utilities for interacting with ADO APIs to fetch build data. */ -import { getAzureDevopsApi } from "@fluidframework/bundle-size-tools"; import type { IBuildApi } from "azure-devops-node-api/BuildApi.js"; import type { Build, Timeline } from "azure-devops-node-api/interfaces/BuildInterfaces.js"; import { @@ -16,6 +15,7 @@ import { BuildResult, BuildStatus, } from "azure-devops-node-api/interfaces/BuildInterfaces.js"; +import { getAzureDevopsApi } from "../bundleSizeDiff/index.js"; import type { AdoBuildRecord, AdoTimeline, BuildPerfMode } from "./types.js"; /** diff --git a/build-tools/packages/bundle-size-tools/src/ADO/AdoArtifactFileProvider.ts b/build-tools/packages/build-cli/src/library/bundleSizeDiff/ADO/AdoArtifactFileProvider.ts similarity index 96% rename from build-tools/packages/bundle-size-tools/src/ADO/AdoArtifactFileProvider.ts rename to build-tools/packages/build-cli/src/library/bundleSizeDiff/ADO/AdoArtifactFileProvider.ts index 7fc6b66367fa..7f82ba85c936 100644 --- a/build-tools/packages/bundle-size-tools/src/ADO/AdoArtifactFileProvider.ts +++ b/build-tools/packages/build-cli/src/library/bundleSizeDiff/ADO/AdoArtifactFileProvider.ts @@ -8,11 +8,11 @@ import type { WebApi } from "azure-devops-node-api"; import type JSZip from "jszip"; import type { BundleAnalyzerPlugin } from "webpack-bundle-analyzer"; -import { unzipStream } from "../utilities"; +import { unzipStream } from "../utilities/index.js"; import { type BundleFileData, getAnalyzerFilePathsFromFolder, -} from "./getBundleFilePathsFromFolder"; +} from "./getBundleFilePathsFromFolder.js"; /** * Gets a list of `analyzer.json` paths from the zip archive (one per source package). diff --git a/build-tools/packages/bundle-size-tools/src/ADO/AdoSizeComparator.ts b/build-tools/packages/build-cli/src/library/bundleSizeDiff/ADO/AdoSizeComparator.ts similarity index 94% rename from build-tools/packages/bundle-size-tools/src/ADO/AdoSizeComparator.ts rename to build-tools/packages/build-cli/src/library/bundleSizeDiff/ADO/AdoSizeComparator.ts index c5a8bfbdcedd..149b18b868c2 100644 --- a/build-tools/packages/bundle-size-tools/src/ADO/AdoSizeComparator.ts +++ b/build-tools/packages/build-cli/src/library/bundleSizeDiff/ADO/AdoSizeComparator.ts @@ -4,24 +4,24 @@ */ import type { WebApi } from "azure-devops-node-api"; -import { BuildResult, BuildStatus } from "azure-devops-node-api/interfaces/BuildInterfaces"; +import { BuildResult, BuildStatus } from "azure-devops-node-api/interfaces/BuildInterfaces.js"; import type JSZip from "jszip"; import { join } from "path"; -import type { BundleComparison } from "../BundleBuddyTypes"; -import { compareBundles } from "../compareBundles"; -import { getBaselineCommit, getBuilds } from "../utilities"; +import type { BundleComparison } from "../BundleBuddyTypes.js"; +import { compareBundles } from "../compareBundles.js"; +import { getBaselineCommit, getBuilds } from "../utilities/index.js"; import { getAnalyzerJsonFromZip, getAnalyzerPathsFromZipObject, getZipObjectFromArtifact, -} from "./AdoArtifactFileProvider"; -import type { IADOConstants } from "./Constants"; +} from "./AdoArtifactFileProvider.js"; +import type { IADOConstants } from "./Constants.js"; import { getAnalyzerJsonFromFileSystem, getAnalyzerPathsFromFileSystem, -} from "./FileSystemBundleFileProvider"; -import { getBundleSummariesFromAnalyzer } from "./getBundleSummaries"; +} from "./FileSystemBundleFileProvider.js"; +import { getBundleSummariesFromAnalyzer } from "./getBundleSummaries.js"; /** * Result of a size comparison against a baseline build, discriminated by `kind`. diff --git a/build-tools/packages/bundle-size-tools/src/ADO/Constants.ts b/build-tools/packages/build-cli/src/library/bundleSizeDiff/ADO/Constants.ts similarity index 100% rename from build-tools/packages/bundle-size-tools/src/ADO/Constants.ts rename to build-tools/packages/build-cli/src/library/bundleSizeDiff/ADO/Constants.ts diff --git a/build-tools/packages/bundle-size-tools/src/ADO/FileSystemBundleFileProvider.ts b/build-tools/packages/build-cli/src/library/bundleSizeDiff/ADO/FileSystemBundleFileProvider.ts similarity index 91% rename from build-tools/packages/bundle-size-tools/src/ADO/FileSystemBundleFileProvider.ts rename to build-tools/packages/build-cli/src/library/bundleSizeDiff/ADO/FileSystemBundleFileProvider.ts index 4695cd44869a..64ad9da0c280 100644 --- a/build-tools/packages/bundle-size-tools/src/ADO/FileSystemBundleFileProvider.ts +++ b/build-tools/packages/build-cli/src/library/bundleSizeDiff/ADO/FileSystemBundleFileProvider.ts @@ -6,11 +6,11 @@ import { promises as fsPromises } from "fs"; import type { BundleAnalyzerPlugin } from "webpack-bundle-analyzer"; -import { getAllFilesInDirectory } from "../utilities"; +import { getAllFilesInDirectory } from "../utilities/index.js"; import { type BundleFileData, getAnalyzerFilePathsFromFolder, -} from "./getBundleFilePathsFromFolder"; +} from "./getBundleFilePathsFromFolder.js"; /** * Returns a list of `analyzer.json` paths from the given folder (one per source package). diff --git a/build-tools/packages/bundle-size-tools/src/ADO/getAzureDevopsApi.ts b/build-tools/packages/build-cli/src/library/bundleSizeDiff/ADO/getAzureDevopsApi.ts similarity index 100% rename from build-tools/packages/bundle-size-tools/src/ADO/getAzureDevopsApi.ts rename to build-tools/packages/build-cli/src/library/bundleSizeDiff/ADO/getAzureDevopsApi.ts diff --git a/build-tools/packages/bundle-size-tools/src/ADO/getBundleFilePathsFromFolder.ts b/build-tools/packages/build-cli/src/library/bundleSizeDiff/ADO/getBundleFilePathsFromFolder.ts similarity index 100% rename from build-tools/packages/bundle-size-tools/src/ADO/getBundleFilePathsFromFolder.ts rename to build-tools/packages/build-cli/src/library/bundleSizeDiff/ADO/getBundleFilePathsFromFolder.ts diff --git a/build-tools/packages/bundle-size-tools/src/ADO/getBundleSummaries.ts b/build-tools/packages/build-cli/src/library/bundleSizeDiff/ADO/getBundleSummaries.ts similarity index 98% rename from build-tools/packages/bundle-size-tools/src/ADO/getBundleSummaries.ts rename to build-tools/packages/build-cli/src/library/bundleSizeDiff/ADO/getBundleSummaries.ts index 7c0c2cb97fb8..c108b06fe0e4 100644 --- a/build-tools/packages/bundle-size-tools/src/ADO/getBundleSummaries.ts +++ b/build-tools/packages/build-cli/src/library/bundleSizeDiff/ADO/getBundleSummaries.ts @@ -5,8 +5,8 @@ import type { BundleAnalyzerPlugin } from "webpack-bundle-analyzer"; -import type { BundleMetricSet, BundleSummaries } from "../BundleBuddyTypes"; -import type { BundleFileData } from "./getBundleFilePathsFromFolder"; +import type { BundleMetricSet, BundleSummaries } from "../BundleBuddyTypes.js"; +import type { BundleFileData } from "./getBundleFilePathsFromFolder.js"; export interface GetBundleSummariesFromAnalyzerArgs { bundlePaths: BundleFileData[]; diff --git a/build-tools/packages/bundle-size-tools/src/ADO/index.ts b/build-tools/packages/build-cli/src/library/bundleSizeDiff/ADO/index.ts similarity index 63% rename from build-tools/packages/bundle-size-tools/src/ADO/index.ts rename to build-tools/packages/build-cli/src/library/bundleSizeDiff/ADO/index.ts index 2b7b364043ff..99b9a9aad907 100644 --- a/build-tools/packages/bundle-size-tools/src/ADO/index.ts +++ b/build-tools/packages/build-cli/src/library/bundleSizeDiff/ADO/index.ts @@ -7,19 +7,19 @@ export { getAnalyzerJsonFromZip, getAnalyzerPathsFromZipObject, getZipObjectFromArtifact, -} from "./AdoArtifactFileProvider"; -export { ADOSizeComparator, SizeComparison } from "./AdoSizeComparator"; -export { IADOConstants } from "./Constants"; +} from "./AdoArtifactFileProvider.js"; +export { ADOSizeComparator, SizeComparison } from "./AdoSizeComparator.js"; +export { IADOConstants } from "./Constants.js"; export { getAnalyzerJsonFromFileSystem, getAnalyzerPathsFromFileSystem, -} from "./FileSystemBundleFileProvider"; -export { getAzureDevopsApi } from "./getAzureDevopsApi"; +} from "./FileSystemBundleFileProvider.js"; +export { getAzureDevopsApi } from "./getAzureDevopsApi.js"; export { BundleFileData, getAnalyzerFilePathsFromFolder, -} from "./getBundleFilePathsFromFolder"; +} from "./getBundleFilePathsFromFolder.js"; export { GetBundleSummariesFromAnalyzerArgs, getBundleSummariesFromAnalyzer, -} from "./getBundleSummaries"; +} from "./getBundleSummaries.js"; diff --git a/build-tools/packages/bundle-size-tools/src/BundleBuddyTypes.ts b/build-tools/packages/build-cli/src/library/bundleSizeDiff/BundleBuddyTypes.ts similarity index 100% rename from build-tools/packages/bundle-size-tools/src/BundleBuddyTypes.ts rename to build-tools/packages/build-cli/src/library/bundleSizeDiff/BundleBuddyTypes.ts diff --git a/build-tools/packages/bundle-size-tools/src/compareBundles.ts b/build-tools/packages/build-cli/src/library/bundleSizeDiff/compareBundles.ts similarity index 99% rename from build-tools/packages/bundle-size-tools/src/compareBundles.ts rename to build-tools/packages/build-cli/src/library/bundleSizeDiff/compareBundles.ts index 42a30fcbe575..736bb3924697 100644 --- a/build-tools/packages/bundle-size-tools/src/compareBundles.ts +++ b/build-tools/packages/build-cli/src/library/bundleSizeDiff/compareBundles.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. */ -import type { BundleComparison, BundleSummaries } from "./BundleBuddyTypes"; +import type { BundleComparison, BundleSummaries } from "./BundleBuddyTypes.js"; /** * Compares all the bundle summaries for a "baseline" and a "compare" bundle. diff --git a/build-tools/packages/bundle-size-tools/src/index.ts b/build-tools/packages/build-cli/src/library/bundleSizeDiff/index.ts similarity index 87% rename from build-tools/packages/bundle-size-tools/src/index.ts rename to build-tools/packages/build-cli/src/library/bundleSizeDiff/index.ts index 0d4ed754f61a..0c0bdc03a972 100644 --- a/build-tools/packages/bundle-size-tools/src/index.ts +++ b/build-tools/packages/build-cli/src/library/bundleSizeDiff/index.ts @@ -17,18 +17,18 @@ export { getZipObjectFromArtifact, IADOConstants, SizeComparison, -} from "./ADO"; +} from "./ADO/index.js"; export { BundleComparison, BundleMetric, BundleMetricSet, BundleSummaries, -} from "./BundleBuddyTypes"; -export { bundlesContainNoChanges, compareBundles } from "./compareBundles"; +} from "./BundleBuddyTypes.js"; +export { bundlesContainNoChanges, compareBundles } from "./compareBundles.js"; export { GetBuildOptions, getAllFilesInDirectory, getBaselineCommit, getBuilds, unzipStream, -} from "./utilities"; +} from "./utilities/index.js"; diff --git a/build-tools/packages/bundle-size-tools/src/utilities/getAllFilesInDirectory.ts b/build-tools/packages/build-cli/src/library/bundleSizeDiff/utilities/getAllFilesInDirectory.ts similarity index 100% rename from build-tools/packages/bundle-size-tools/src/utilities/getAllFilesInDirectory.ts rename to build-tools/packages/build-cli/src/library/bundleSizeDiff/utilities/getAllFilesInDirectory.ts diff --git a/build-tools/packages/bundle-size-tools/src/utilities/getBuilds.ts b/build-tools/packages/build-cli/src/library/bundleSizeDiff/utilities/getBuilds.ts similarity index 98% rename from build-tools/packages/bundle-size-tools/src/utilities/getBuilds.ts rename to build-tools/packages/build-cli/src/library/bundleSizeDiff/utilities/getBuilds.ts index 2f07c7b2db32..4851adaabbbe 100644 --- a/build-tools/packages/bundle-size-tools/src/utilities/getBuilds.ts +++ b/build-tools/packages/build-cli/src/library/bundleSizeDiff/utilities/getBuilds.ts @@ -4,7 +4,7 @@ */ import type { WebApi } from "azure-devops-node-api"; -import type { Build } from "azure-devops-node-api/interfaces/BuildInterfaces"; +import type { Build } from "azure-devops-node-api/interfaces/BuildInterfaces.js"; export interface GetBuildOptions { // The ADO project name diff --git a/build-tools/packages/bundle-size-tools/src/utilities/gitCommands.ts b/build-tools/packages/build-cli/src/library/bundleSizeDiff/utilities/gitCommands.ts similarity index 100% rename from build-tools/packages/bundle-size-tools/src/utilities/gitCommands.ts rename to build-tools/packages/build-cli/src/library/bundleSizeDiff/utilities/gitCommands.ts diff --git a/build-tools/packages/bundle-size-tools/src/utilities/index.ts b/build-tools/packages/build-cli/src/library/bundleSizeDiff/utilities/index.ts similarity index 52% rename from build-tools/packages/bundle-size-tools/src/utilities/index.ts rename to build-tools/packages/build-cli/src/library/bundleSizeDiff/utilities/index.ts index 2212b04843ca..ce555069675c 100644 --- a/build-tools/packages/bundle-size-tools/src/utilities/index.ts +++ b/build-tools/packages/build-cli/src/library/bundleSizeDiff/utilities/index.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. */ -export { getAllFilesInDirectory } from "./getAllFilesInDirectory"; -export { GetBuildOptions, getBuilds } from "./getBuilds"; -export { getBaselineCommit } from "./gitCommands"; -export { unzipStream } from "./unzipStream"; +export { getAllFilesInDirectory } from "./getAllFilesInDirectory.js"; +export { GetBuildOptions, getBuilds } from "./getBuilds.js"; +export { getBaselineCommit } from "./gitCommands.js"; +export { unzipStream } from "./unzipStream.js"; diff --git a/build-tools/packages/bundle-size-tools/src/utilities/unzipStream.ts b/build-tools/packages/build-cli/src/library/bundleSizeDiff/utilities/unzipStream.ts similarity index 83% rename from build-tools/packages/bundle-size-tools/src/utilities/unzipStream.ts rename to build-tools/packages/build-cli/src/library/bundleSizeDiff/utilities/unzipStream.ts index 06c2842d5812..dd0df5b153fa 100644 --- a/build-tools/packages/bundle-size-tools/src/utilities/unzipStream.ts +++ b/build-tools/packages/build-cli/src/library/bundleSizeDiff/utilities/unzipStream.ts @@ -3,8 +3,7 @@ * Licensed under the MIT License. */ -import type JSZip from "jszip"; -import { loadAsync } from "jszip"; +import JSZip from "jszip"; function readStreamAsBuffer(stream: NodeJS.ReadableStream): Promise { return new Promise((resolve, reject) => { @@ -23,5 +22,5 @@ function readStreamAsBuffer(stream: NodeJS.ReadableStream): Promise { } export async function unzipStream(stream: NodeJS.ReadableStream): Promise { - return loadAsync(await readStreamAsBuffer(stream)); + return JSZip.loadAsync(await readStreamAsBuffer(stream)); } diff --git a/build-tools/packages/build-cli/src/test/commands/test-only-filter.test.ts b/build-tools/packages/build-cli/src/test/commands/test-only-filter.test.ts index dc3da805ef54..8c479cea7bcc 100644 --- a/build-tools/packages/build-cli/src/test/commands/test-only-filter.test.ts +++ b/build-tools/packages/build-cli/src/test/commands/test-only-filter.test.ts @@ -51,8 +51,8 @@ describe("flub test-only-filter", () => { ); const output: jsonOutput = JSON.parse(stdout) as jsonOutput; const { selected, filtered } = output; - expect(selected.length).to.equal(5); - expect(filtered.length).to.equal(5); + expect(selected.length).to.equal(4); + expect(filtered.length).to.equal(4); }); it(`--private filter`, async () => { diff --git a/build-tools/packages/build-cli/src/test/filter.test.ts b/build-tools/packages/build-cli/src/test/filter.test.ts index ae0822e22d6b..5fd12dc6006f 100644 --- a/build-tools/packages/build-cli/src/test/filter.test.ts +++ b/build-tools/packages/build-cli/src/test/filter.test.ts @@ -57,7 +57,6 @@ describe("filterPackages", () => { "@fluid-tools/build-cli", "@fluid-tools/build-infrastructure", "@fluidframework/build-tools", - "@fluidframework/bundle-size-tools", "@fluid-tools/version-tools", ]); }); @@ -90,7 +89,6 @@ describe("filterPackages", () => { "@fluid-tools/build-cli", "@fluid-tools/build-infrastructure", "@fluidframework/build-tools", - "@fluidframework/bundle-size-tools", "@fluid-tools/version-tools", ]); }); @@ -135,10 +133,7 @@ describe("filterPackages", () => { }; const actual = await filterPackages(packages, filters); const names = actual.map((p) => p.name); - expect(names).to.be.equalTo([ - "@fluidframework/build-tools", - "@fluidframework/bundle-size-tools", - ]); + expect(names).to.be.equalTo(["@fluidframework/build-tools"]); }); }); @@ -159,7 +154,6 @@ describe("selectAndFilterPackages", () => { "@fluid-tools/build-cli", "@fluid-tools/build-infrastructure", "@fluidframework/build-tools", - "@fluidframework/bundle-size-tools", "@fluid-tools/version-tools", ]); }); @@ -216,7 +210,6 @@ describe("selectAndFilterPackages", () => { "@fluid-tools/build-cli", "@fluid-tools/build-infrastructure", "@fluidframework/build-tools", - "@fluidframework/bundle-size-tools", "@fluid-tools/version-tools", ]); }); @@ -317,7 +310,6 @@ describe("selectAndFilterPackages", () => { "@fluid-tools/build-cli", "@fluid-tools/build-infrastructure", "@fluidframework/build-tools", - "@fluidframework/bundle-size-tools", "@fluid-tools/version-tools", ]); }); @@ -365,10 +357,7 @@ describe("selectAndFilterPackages", () => { const { filtered } = await selectAndFilterPackages(context, selectionOptions, filters); const names = filtered.map((p) => p.name); - expect(names).to.be.equalTo([ - "@fluidframework/build-tools", - "@fluidframework/bundle-size-tools", - ]); + expect(names).to.be.equalTo(["@fluidframework/build-tools"]); }); it("multiple selection flags", async () => { diff --git a/build-tools/packages/build-infrastructure/src/test/buildProject.test.ts b/build-tools/packages/build-infrastructure/src/test/buildProject.test.ts index d2ab1035854b..b6aefa0dd8bf 100644 --- a/build-tools/packages/build-infrastructure/src/test/buildProject.test.ts +++ b/build-tools/packages/build-infrastructure/src/test/buildProject.test.ts @@ -87,7 +87,7 @@ describe("loadBuildProject", () => { const buildTools = repo.workspaces.get("build-tools" as WorkspaceName); expect(buildTools).to.not.be.undefined; expect(buildTools?.packages.length).to.equal( - 6, + 5, "build-tools workspace has the wrong number of packages", ); expect(buildTools?.releaseGroups.size).to.equal( diff --git a/build-tools/packages/bundle-size-tools/.npmignore b/build-tools/packages/bundle-size-tools/.npmignore deleted file mode 100644 index e1430c52bec5..000000000000 --- a/build-tools/packages/bundle-size-tools/.npmignore +++ /dev/null @@ -1,14 +0,0 @@ -.eslintignore -.eslintrc.cjs -.mocharc.json -.prettierignore -*.log -**/_api-extractor-temp/** -**/*.tsbuildinfo -dist/test -docs -lib/test -nyc -packlist.txt -src -test \ No newline at end of file diff --git a/build-tools/packages/bundle-size-tools/LICENSE b/build-tools/packages/bundle-size-tools/LICENSE deleted file mode 100644 index 60af0a6a40e9..000000000000 --- a/build-tools/packages/bundle-size-tools/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -Copyright (c) Microsoft Corporation and contributors. All rights reserved. - -MIT License - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/build-tools/packages/bundle-size-tools/README.md b/build-tools/packages/bundle-size-tools/README.md deleted file mode 100644 index f57f973be886..000000000000 --- a/build-tools/packages/bundle-size-tools/README.md +++ /dev/null @@ -1,122 +0,0 @@ -# @fluidframework/bundle-size-tools - -This package contains utility for analyzing bundle sizes to help catch code size regressions at pull request time. This library is meant to be fully extensible to meet the unique needs of any repository, but is currently only being used in a few repositories, so additional work may be necessary in order to make the library more useful for others. - -## Features of bundle-size-tools - -- Accurate comparisons that enables you to see exactly how many bytes a PR adds to relevant bundles -- APIs for integrating with Azure devops workflows -- The ability to write comments on pull requests that call out bundle size regressions -- Extension points so that teams can write their own custom bundle reports -- Support for monorepos that build many packages with multiple interesting bundles -- The ability to define custom bundle metrics in a bundle's webpack config - -## Limitations - -- Bundle-size-tools currently only has APIs for working with Azure DevOps. Additional work will have to be done to support other source control providers like GitHub. Other tools can be used in conjunction with bundle-size-tools to support hybrid environments. -- Bundle-size-tools was designed to work with webpack; other bundlers are not supported. - -# How Bundle-size-tools works - -This section highlights some of the assumptions that bundle-size-tools makes and defines the pieces required to onboard a new repository. - -## Webpack stats files - -Bundle-size-tools uses [webpack stats files](https://webpack.js.org/configuration/stats/) as the foundation for bundle comparisons. To use bundle-size-tools, your build pipeline is expected to produce webpack stats files. Since webpack stats files tend to be very large, we recommend using the [@mixer/webpack-bundle-compare](https://github.com/mixer/webpack-bundle-compare) webpack plugin to generate the plugins in gzipped mspack format to reduce the size of the stats files on disk. - -Our recommended approach is to add this to the plugin section of your webpack configs that produce application bundles: - -```javascript -new BundleComparisonPlugin({ - // File to create, relative to the webpack build output path: - file: resolve(process.cwd(), "bundleAnalysis/bundleStats.msp.gz"), -}); -``` - -## Baseline builds - -In order to provide accurate metrics for bundle size regressions, Bundle-size-tools must have a baseline to compare against. For example, when submitting a pull request, bundle-size-tools should only report changes to bundle sizes that are directly related to the current pull request. If the pull request was targeting the main branch of the repository, we would consider the baseline to be the main commit the PR branch was based off. To use bundle-size-tools, you'll need a mechanism to get the webpack stats files for the baseline builds, such as generating webpack stats file for every commit to main using an automated build or providing a way to find a matching stats file from a different commit. - -## Bundle Comparisons - -Bundle-size-tool's comparisons are implemented using `WebpackStatsProcessors`, which are functions with the following signature: - -```typescript -export type WebpackStatsProcessor = ( - stats: Webpack.StatsCompilation, - config: BundleBuddyConfig | undefined, -) => BundleMetricSet | undefined; -``` - -A `WebpackStatsProcessor` takes a webpack stats object in as input and outputs a `BundleMetricSet`. In essence, `WebpackStatsProcessors` take in the complex stats object and outputs a simple list of metrics. There is also support for passing in a bundle-specific `BundleBuddyConfig` object that enables analysis on specific chunks in the bundle. The `BundleBuddyConfig` is provided in the bundle's webpack config using the `BundleBuddyConfigWebpackPlugin`. - -```typescript -export type BundleMetricSet = Map; - -export interface BundleMetric { - parsedSize: number; -} -``` - -Consumers of bundle-size-tools must configure one or more `WebpackStatsProcessors` for their projects. It is also possible to write and use custom `WebpackStatsProcessors`. - -Bundle-size-tools runs the same set of `WebpackStatsProcessors` on both the baseline commit and pull request commit. It then compares the metrics produces by the baseline commit and pull request commit and reports these differences in a comment in the pull request. - -### Default Stats Processors - -Bundle-size-tools provides the following basic set of `WebpackStatsProcessors`: - -- `entryStatsProcessor` - reports the size of the chunks generated for each of the webpack [entry points](https://webpack.js.org/concepts/entry-points/) specified in the webpack config -- `totalSizeProcessor` - reports the total size of all chunks in the webpack bundle. -- `bundleBuddyConfigProcessor` - enables analysis of a specific set of chunks for a given bundle. It is expected that a `BundleBuddyConfig` would be specified via the `BundleBuddyConfigWebpackPlugin` in the bundles webpack config - -# Sample Workflow - -This is the workflow the `fluidframework` repository uses for Bundle buddy. - -Assumptions - -- Monorepo that produces one or more packages. -- Packages in the repository only produce one bundle that is going to be analyzed by bundle-size-tools. -- CI builds run and store artifacts in Azure DevOps. - -## Bundles all generate compressed stats files - -Every single bundle in the repository is configured with the [@mixer/webpack-bundle-compare](https://github.com/mixer/webpack-bundle-compare) webpack plugin to generate a compressed stats file named `bundleStats.msp.gz` in a `bundleAnalysis` folder at the root of each package. As an example, say our repository has packages `package1`, `package2`, and `package3` all under a `packages` folder, our build process will generate -the following files: - -- `packages/package1/bundleAnalysis/bundle1/bundleStats.msp.gz` -- `packages/package1/bundleAnalysis/bundle2/bundleStats.msp.gz` -- `packages/package2/bundleAnalysis/bundleStats.msp.gz` -- `packages/package3/bundleAnalysis/bundleStats.msp.gz` - -## Main CI Generates Baseline stats files - -There is a continuous integration build that runs on every commit to main and generates the bundle stats files. It is important that this CI definition does not have the [batch](https://docs.microsoft.com/en-us/azure/devops/pipelines/yaml-schema?view=azure-devops&tabs=schema%2Cparameter-schema) option set, it should run for every single commit to main to ensure we have accurate baselines for every commit to main. It is also important to ensure the stats files used as baselines are generated from running webpack with the [mode](https://webpack.js.org/configuration/mode/) set to `production` and not `development` to get the best representation of what our users will download. - -The build process then runs a script that copies all the bundle stats files in the repository and copies them into a single `bundleAnalysis` folder in a temporary directory. - -- `/bundleAnalysis/package1/bundle1/bundleStats.msp.gz` -- `/bundleAnalysis/package1/bundle2/bundleStats.msp.gz` -- `/bundleAnalysis/package2/bundleStats.msp.gz` -- `/bundleAnalysis/package3/bundleStats.msp.gz` - -The build process then uploads this folder as an Azure DevOps build artifact names `bundle-analysis-reports`. - -## Pull Request Buddy Builds generate comparison stats files - -The buddy build that runs for every pull request runs the same process as the main build to generate the `bundleAnalysis` folder and `bundle-analysis-reports` build artifact. - -The buddy build will then determine the main commit that this PR was branched off of, using that commit as the "baseline" commit. If the main CI build has already created the `bundle-analysis-reports` artifact, the pull request buddy build will run bundle buddy and report the result as a comment in the pull request. - -If the artifacts are not available for the baseline commit, the buddy build adds an Azure Devops build tag with the format `bundle-size-tools-pending-` so that a later process can add the bundle analysis comment to this PR when the baseline artifacts are ready. - -## Build runs main CI completes to update pull requests pending baseline stats - -There is a separate build pipeline that runs after each successful main build and looks for all buddy builds with the `bundle-size-tools-pending-` corresponding to the `` of the main build. This build process will then run bundle-size-tools on all these PRs and post a comment. - -## Bundle metrics considered - -The repository is configured to run the `entryStatsProcessor` and `totalSizeProcessor` for all bundles, meaning that bundle buddy will report changes to total bundle size (sum of all chunks) and the size of each entry chunk. - -The repository also has a few bundles that we wish to analyze the size of some critical scenarios that are behind a dynamic import, meaning they are not entry chunks. This leverages the `bundleBuddyConfigProcessor`, which uses a config file to specify the names of chunks to analyze. These config files are specified using the `BundleBuddyConfigWebpackPlugin` and these config files are uploaded alongside the `bundleStats.msp.gz` file in the `bundle-analysis-reports` artifact. diff --git a/build-tools/packages/bundle-size-tools/api-extractor.json b/build-tools/packages/bundle-size-tools/api-extractor.json deleted file mode 100644 index a40932a7ac8b..000000000000 --- a/build-tools/packages/bundle-size-tools/api-extractor.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", - "extends": "../../api-extractor-base.json" -} diff --git a/build-tools/packages/bundle-size-tools/api-report/bundle-size-tools.api.md b/build-tools/packages/bundle-size-tools/api-report/bundle-size-tools.api.md deleted file mode 100644 index cbacdbd384d1..000000000000 --- a/build-tools/packages/bundle-size-tools/api-report/bundle-size-tools.api.md +++ /dev/null @@ -1,148 +0,0 @@ -## API Report File for "@fluidframework/bundle-size-tools" - -> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). - -```ts - -/// - -import type { Build } from 'azure-devops-node-api/interfaces/BuildInterfaces'; -import type { BundleAnalyzerPlugin } from 'webpack-bundle-analyzer'; -import type JSZip from 'jszip'; -import { WebApi } from 'azure-devops-node-api'; - -// @public (undocumented) -export class ADOSizeComparator { - constructor( - adoConstants: IADOConstants, - adoConnection: WebApi, - localReportPath: string, - targetBranch: string); - getSizeComparison(): Promise; -} - -// @public -export interface BundleComparison { - // (undocumented) - bundleName: string; - // (undocumented) - commonBundleMetrics: { - [key: string]: { - baseline: BundleMetric; - compare: BundleMetric; - }; - }; -} - -// @public (undocumented) -export interface BundleFileData { - // (undocumented) - bundleName: string; - // (undocumented) - relativePathToConfigFile: string | undefined; - // (undocumented) - relativePathToStatsFile: string; -} - -// @public -export interface BundleMetric { - // (undocumented) - parsedSize: number; -} - -// @public -export type BundleMetricSet = Map; - -// @public -export function bundlesContainNoChanges(comparisons: BundleComparison[]): boolean; - -// @public -export type BundleSummaries = Map; - -// @public -export function compareBundles(baseline: BundleSummaries, compare: BundleSummaries): BundleComparison[]; - -// @public -export function getAllFilesInDirectory(sourceFolder: string, partialPathPrefix?: string): Promise; - -// @public -export function getAnalyzerFilePathsFromFolder(relativePathsInFolder: string[]): BundleFileData[]; - -// @public -export function getAnalyzerJsonFromFileSystem(path: string): Promise; - -// @public -export function getAnalyzerJsonFromZip(jsZip: JSZip, relativePath: string): Promise; - -// @public -export function getAnalyzerPathsFromFileSystem(bundleReportPath: string): Promise; - -// @public -export function getAnalyzerPathsFromZipObject(jsZip: JSZip): BundleFileData[]; - -// @public -export function getAzureDevopsApi(accessToken: string | undefined, orgUrl: string): WebApi; - -// @public -export function getBaselineCommit(targetBranch: string): string; - -// @public (undocumented) -export interface GetBuildOptions { - // (undocumented) - definitions: number[]; - // (undocumented) - maxBuildsPerDefinition?: number; - // (undocumented) - project: string; - // (undocumented) - tagFilters?: string[]; -} - -// @public -export function getBuilds(adoConnection: WebApi, options: GetBuildOptions): Promise; - -// @public -export function getBundleSummariesFromAnalyzer(args: GetBundleSummariesFromAnalyzerArgs): Promise; - -// @public (undocumented) -export interface GetBundleSummariesFromAnalyzerArgs { - // (undocumented) - bundlePaths: BundleFileData[]; - // (undocumented) - getAnalyzerJson: (relativePath: string) => Promise; -} - -// @public -export function getZipObjectFromArtifact(adoConnection: WebApi, projectName: string, buildNumber: number, artifactName: string): Promise; - -// @public (undocumented) -export interface IADOConstants { - // (undocumented) - artifactName: string; - // (undocumented) - buildsToSearch?: number; - // (undocumented) - ciBuildDefinitionId: number; - // (undocumented) - orgUrl: string; - // (undocumented) - projectName: string; -} - -// @public -export type SizeComparison = { - kind: "success"; - baselineCommit: string; - comparison: BundleComparison[]; -} | { - kind: "error"; - baselineCommit: string | undefined; - error: string; -}; - -// @public (undocumented) -export function unzipStream(stream: NodeJS.ReadableStream): Promise; - -// (No @packageDocumentation comment for this package) - -``` diff --git a/build-tools/packages/bundle-size-tools/eslint.config.mts b/build-tools/packages/bundle-size-tools/eslint.config.mts deleted file mode 100644 index c155d2f962ca..000000000000 --- a/build-tools/packages/bundle-size-tools/eslint.config.mts +++ /dev/null @@ -1,8 +0,0 @@ -/*! - * Copyright (c) Microsoft Corporation and contributors. All rights reserved. - * Licensed under the MIT License. - */ - -import { baseConfig } from "../../eslint.config.base.mts"; - -export default baseConfig; diff --git a/build-tools/packages/bundle-size-tools/package.json b/build-tools/packages/bundle-size-tools/package.json deleted file mode 100644 index 0c7cc35803dd..000000000000 --- a/build-tools/packages/bundle-size-tools/package.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "name": "@fluidframework/bundle-size-tools", - "version": "0.66.0", - "description": "Utility for analyzing bundle size regressions", - "homepage": "https://fluidframework.com", - "repository": { - "type": "git", - "url": "https://github.com/microsoft/FluidFramework.git", - "directory": "build-tools/packages/bundle-size-tools" - }, - "license": "MIT", - "author": "Microsoft and contributors", - "exports": { - ".": { - "default": { - "types": "./dist/index.d.ts", - "default": "./dist/index.js" - } - } - }, - "main": "dist/index.js", - "types": "dist/index.d.ts", - "scripts": { - "build": "fluid-build --task build", - "build:compile": "fluid-build --task compile", - "build:copy": "copyfiles -u 1 \"src/**/*.fsl\" dist", - "build:docs": "api-extractor run --local", - "check:biome": "biome check .", - "check:format": "npm run check:biome", - "ci:build:docs": "api-extractor run", - "clean": "rimraf --glob dist \"*.tsbuildinfo\" _api-extractor-temp \"*.build.log\"", - "compile": "fluid-build . --task compile", - "eslint": "eslint --quiet --format stylish src", - "eslint:fix": "eslint --quiet --format stylish src --fix --fix-type problem,suggestion,layout", - "format": "npm run format:biome", - "format:biome": "biome check --write .", - "lint": "npm run eslint", - "lint:fix": "npm run eslint:fix", - "test": "echo \"Error: no test specified\" && exit 1", - "tsc": "tsc" - }, - "dependencies": { - "azure-devops-node-api": "^11.2.0", - "jszip": "^3.10.1", - "typescript": "~5.4.5" - }, - "devDependencies": { - "@biomejs/biome": "~2.4.5", - "@fluidframework/build-common": "^2.0.3", - "@fluidframework/build-tools-bin": "npm:@fluidframework/build-tools@~0.63.0", - "@microsoft/api-extractor": "^7.58.1", - "@types/node": "~22.19.17", - "@types/webpack-bundle-analyzer": "^4.7.0", - "copyfiles": "^2.4.1", - "eslint": "~9.39.2", - "rimraf": "^6.1.3" - } -} diff --git a/build-tools/packages/bundle-size-tools/packlist.txt b/build-tools/packages/bundle-size-tools/packlist.txt deleted file mode 100644 index 4de55361caf5..000000000000 --- a/build-tools/packages/bundle-size-tools/packlist.txt +++ /dev/null @@ -1,132 +0,0 @@ -LICENSE -README.md -api-extractor.json -eslint.config.mts -package.json -tsconfig.json -api-report/bundle-size-tools.api.md -dist/ADO/AdoArtifactFileProvider.d.ts -dist/ADO/AdoArtifactFileProvider.d.ts.map -dist/ADO/AdoArtifactFileProvider.js -dist/ADO/AdoArtifactFileProvider.js.map -dist/ADO/AdoSizeComparator.d.ts -dist/ADO/AdoSizeComparator.d.ts.map -dist/ADO/AdoSizeComparator.js -dist/ADO/AdoSizeComparator.js.map -dist/ADO/Constants.d.ts -dist/ADO/Constants.d.ts.map -dist/ADO/Constants.js -dist/ADO/Constants.js.map -dist/ADO/DefaultStatsProcessors.d.ts -dist/ADO/DefaultStatsProcessors.d.ts.map -dist/ADO/DefaultStatsProcessors.js -dist/ADO/DefaultStatsProcessors.js.map -dist/ADO/FileSystemBundleFileProvider.d.ts -dist/ADO/FileSystemBundleFileProvider.d.ts.map -dist/ADO/FileSystemBundleFileProvider.js -dist/ADO/FileSystemBundleFileProvider.js.map -dist/ADO/PrCommentsUtils.d.ts -dist/ADO/PrCommentsUtils.d.ts.map -dist/ADO/PrCommentsUtils.js -dist/ADO/PrCommentsUtils.js.map -dist/ADO/getAzureDevopsApi.d.ts -dist/ADO/getAzureDevopsApi.d.ts.map -dist/ADO/getAzureDevopsApi.js -dist/ADO/getAzureDevopsApi.js.map -dist/ADO/getBuildTagForCommit.d.ts -dist/ADO/getBuildTagForCommit.d.ts.map -dist/ADO/getBuildTagForCommit.js -dist/ADO/getBuildTagForCommit.js.map -dist/ADO/getBundleBuddyConfigMap.d.ts -dist/ADO/getBundleBuddyConfigMap.d.ts.map -dist/ADO/getBundleBuddyConfigMap.js -dist/ADO/getBundleBuddyConfigMap.js.map -dist/ADO/getBundleFilePathsFromFolder.d.ts -dist/ADO/getBundleFilePathsFromFolder.d.ts.map -dist/ADO/getBundleFilePathsFromFolder.js -dist/ADO/getBundleFilePathsFromFolder.js.map -dist/ADO/getBundleSummaries.d.ts -dist/ADO/getBundleSummaries.d.ts.map -dist/ADO/getBundleSummaries.js -dist/ADO/getBundleSummaries.js.map -dist/ADO/index.d.ts -dist/ADO/index.d.ts.map -dist/ADO/index.js -dist/ADO/index.js.map -dist/BundleBuddyConfigWebpackPlugin.d.ts -dist/BundleBuddyConfigWebpackPlugin.d.ts.map -dist/BundleBuddyConfigWebpackPlugin.js -dist/BundleBuddyConfigWebpackPlugin.js.map -dist/BundleBuddyTypes.d.ts -dist/BundleBuddyTypes.d.ts.map -dist/BundleBuddyTypes.js -dist/BundleBuddyTypes.js.map -dist/bannedModulesPlugin/bannedModulesPlugin.d.ts -dist/bannedModulesPlugin/bannedModulesPlugin.d.ts.map -dist/bannedModulesPlugin/bannedModulesPlugin.js -dist/bannedModulesPlugin/bannedModulesPlugin.js.map -dist/compareBundles.d.ts -dist/compareBundles.d.ts.map -dist/compareBundles.js -dist/compareBundles.js.map -dist/index.d.ts -dist/index.d.ts.map -dist/index.js -dist/index.js.map -dist/statsProcessors/bundleBuddyConfigProcessor.d.ts -dist/statsProcessors/bundleBuddyConfigProcessor.d.ts.map -dist/statsProcessors/bundleBuddyConfigProcessor.js -dist/statsProcessors/bundleBuddyConfigProcessor.js.map -dist/statsProcessors/entryStatsProcessor.d.ts -dist/statsProcessors/entryStatsProcessor.d.ts.map -dist/statsProcessors/entryStatsProcessor.js -dist/statsProcessors/entryStatsProcessor.js.map -dist/statsProcessors/index.d.ts -dist/statsProcessors/index.d.ts.map -dist/statsProcessors/index.js -dist/statsProcessors/index.js.map -dist/statsProcessors/totalSizeStatsProcessor.d.ts -dist/statsProcessors/totalSizeStatsProcessor.d.ts.map -dist/statsProcessors/totalSizeStatsProcessor.js -dist/statsProcessors/totalSizeStatsProcessor.js.map -dist/tsdoc-metadata.json -dist/utilities/decompressStatsFile.d.ts -dist/utilities/decompressStatsFile.d.ts.map -dist/utilities/decompressStatsFile.js -dist/utilities/decompressStatsFile.js.map -dist/utilities/getAllFilesInDirectory.d.ts -dist/utilities/getAllFilesInDirectory.d.ts.map -dist/utilities/getAllFilesInDirectory.js -dist/utilities/getAllFilesInDirectory.js.map -dist/utilities/getBuilds.d.ts -dist/utilities/getBuilds.d.ts.map -dist/utilities/getBuilds.js -dist/utilities/getBuilds.js.map -dist/utilities/getChunkAndDependenciesSizes.d.ts -dist/utilities/getChunkAndDependenciesSizes.d.ts.map -dist/utilities/getChunkAndDependenciesSizes.js -dist/utilities/getChunkAndDependenciesSizes.js.map -dist/utilities/getChunkParsedSize.d.ts -dist/utilities/getChunkParsedSize.d.ts.map -dist/utilities/getChunkParsedSize.js -dist/utilities/getChunkParsedSize.js.map -dist/utilities/getLastCommitHashFromPR.d.ts -dist/utilities/getLastCommitHashFromPR.d.ts.map -dist/utilities/getLastCommitHashFromPR.js -dist/utilities/getLastCommitHashFromPR.js.map -dist/utilities/gitCommands.d.ts -dist/utilities/gitCommands.d.ts.map -dist/utilities/gitCommands.js -dist/utilities/gitCommands.js.map -dist/utilities/index.d.ts -dist/utilities/index.d.ts.map -dist/utilities/index.js -dist/utilities/index.js.map -dist/utilities/runProcessorOnStatsFile.d.ts -dist/utilities/runProcessorOnStatsFile.d.ts.map -dist/utilities/runProcessorOnStatsFile.js -dist/utilities/runProcessorOnStatsFile.js.map -dist/utilities/unzipStream.d.ts -dist/utilities/unzipStream.d.ts.map -dist/utilities/unzipStream.js -dist/utilities/unzipStream.js.map \ No newline at end of file diff --git a/build-tools/packages/bundle-size-tools/tsconfig.json b/build-tools/packages/bundle-size-tools/tsconfig.json deleted file mode 100644 index ade3da577f6b..000000000000 --- a/build-tools/packages/bundle-size-tools/tsconfig.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "extends": "@fluidframework/build-common/ts-common-config.json", - "compilerOptions": { - "outDir": "./dist", - "rootDir": "./src", - "composite": true, - "noImplicitThis": true, - "noImplicitAny": true, - "target": "es2018", - "types": ["node"], - }, - "include": ["src/**/*.ts"], - "exclude": ["src/test/**/*", "dist", "node_modules"], -} diff --git a/build-tools/pnpm-lock.yaml b/build-tools/pnpm-lock.yaml index d8e49daceb1c..10961d6e9fda 100644 --- a/build-tools/pnpm-lock.yaml +++ b/build-tools/pnpm-lock.yaml @@ -127,9 +127,6 @@ importers: '@fluidframework/build-tools': specifier: workspace:~ version: link:../build-tools - '@fluidframework/bundle-size-tools': - specifier: workspace:~ - version: link:../bundle-size-tools '@github/copilot-sdk': specifier: ^0.2.2 version: 0.2.2 @@ -359,6 +356,9 @@ importers: '@types/unist': specifier: ^3.0.3 version: 3.0.3 + '@types/webpack-bundle-analyzer': + specifier: ^4.7.0 + version: 4.7.0 '@types/xml2js': specifier: ^0.4.14 version: 0.4.14 @@ -656,46 +656,6 @@ importers: specifier: ^11.7.5 version: 11.7.5 - packages/bundle-size-tools: - dependencies: - azure-devops-node-api: - specifier: ^11.2.0 - version: 11.2.0 - jszip: - specifier: ^3.10.1 - version: 3.10.1 - typescript: - specifier: ~5.4.5 - version: 5.4.5 - devDependencies: - '@biomejs/biome': - specifier: ~2.4.5 - version: 2.4.5 - '@fluidframework/build-common': - specifier: ^2.0.3 - version: 2.0.3 - '@fluidframework/build-tools-bin': - specifier: npm:@fluidframework/build-tools@~0.63.0 - version: '@fluidframework/build-tools@0.63.0(@types/node@22.19.17)' - '@microsoft/api-extractor': - specifier: ^7.58.1 - version: 7.58.2(@types/node@22.19.17) - '@types/node': - specifier: ~22.19.17 - version: 22.19.17 - '@types/webpack-bundle-analyzer': - specifier: ^4.7.0 - version: 4.7.0 - copyfiles: - specifier: ^2.4.1 - version: 2.4.1 - eslint: - specifier: ~9.39.2 - version: 9.39.2(jiti@2.6.1) - rimraf: - specifier: ^6.1.3 - version: 6.1.3 - packages/version-tools: dependencies: '@oclif/core': diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index d703646c8383..9f96be600570 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -50,7 +50,6 @@ catalogs: "@fluid-tools/build-cli": ^0.65.0 "@fluid-tools/version-tools": ^0.65.0 "@fluidframework/build-tools": ^0.65.0 - "@fluidframework/bundle-size-tools": ^0.65.0 # eslint and related packages eslint: "@fluidframework/eslint-config-fluid": "^9.0.0"