Skip to content

Commit

Permalink
Move bundle-size-tools to new build-tools (#11717)
Browse files Browse the repository at this point in the history
bundle-size-tools have been moved from `tools\bundle-size-tools` to
`build-tools\packages\bundle-size-tools`. The intention for this move is
to have `bundle-size-tools` as part of the same release group.

`git mv` was used.

Co-authored-by: Tyler Butler <[email protected]>
  • Loading branch information
sonalivdeshpande and tylerbutler authored Sep 16, 2022
1 parent ce30e60 commit d95e046
Show file tree
Hide file tree
Showing 50 changed files with 1,400 additions and 1,620 deletions.
1,603 changes: 914 additions & 689 deletions build-tools/lerna-package-lock.json

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions build-tools/packages/build-cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ $ npm install -g @fluid-tools/build-cli
$ flub COMMAND
running command...
$ flub (--version)
@fluid-tools/build-cli/0.4.5000 linux-x64 node-v14.20.0
@fluid-tools/build-cli/0.4.5000 win32-x64 node-v14.18.1
$ flub --help [COMMAND]
USAGE
$ flub COMMAND
Expand Down Expand Up @@ -459,7 +459,8 @@ USAGE
FLAGS
-v, --verbose Verbose logging.
--dirname=<value> [default: /home/tylerbu/code/FluidFramework/build-tools/packages/build-cli/dist/commands/run]
--dirname=<value> [default:
C:\Users\sdeshpande\Documents\FluidFramework\build-tools\packages\build-cli\dist\commands\run]
Directory
DESCRIPTION
Expand Down
2 changes: 1 addition & 1 deletion build-tools/packages/build-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
"dependencies": {
"@fluid-tools/version-tools": "^0.4.6000",
"@fluidframework/build-tools": "^0.4.6000",
"@fluidframework/bundle-size-tools": "^0.0.8505",
"@fluidframework/bundle-size-tools": "^0.4.6000",
"@oclif/core": "~1.9.5",
"@oclif/plugin-commands": "^2.2.0",
"@oclif/plugin-help": "^5",
Expand Down
3 changes: 1 addition & 2 deletions build-tools/packages/build-tools/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
},
"dependencies": {
"@fluid-tools/version-tools": "^0.4.6000",
"@fluidframework/bundle-size-tools": "^0.0.8505",
"@fluidframework/bundle-size-tools": "^0.4.6000",
"async": "^3.2.0",
"chalk": "^2.4.2",
"commander": "^6.2.1",
Expand Down Expand Up @@ -87,7 +87,6 @@
"@types/rimraf": "^2.0.3",
"@types/semver": "^7.3.10",
"@types/shelljs": "^0.8.8",
"@types/webpack": "^4.41.22",
"@typescript-eslint/eslint-plugin": "~5.9.0",
"@typescript-eslint/parser": "~5.9.0",
"concurrently": "^6.2.0",
Expand Down
File renamed without changes.
File renamed without changes.
16 changes: 16 additions & 0 deletions build-tools/packages/bundle-size-tools/api-extractor.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
"extends": "@fluidframework/build-common/api-extractor-common-report.json",
"apiReport": {
"enabled": true,
"reportFolder": "<projectFolder>/api-report/"
},
"messages": {
"extractorMessageReporting": {
"ae-unresolved-link": {
"logLevel": "warning",
"addToApiReportFile": false
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,306 @@
## 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

/// <reference types="node" />

import { Build } from 'azure-devops-node-api/interfaces/BuildInterfaces';
import { CommentThreadStatus } from 'azure-devops-node-api/interfaces/GitInterfaces';
import { Compiler } from 'webpack';
import JSZip from 'jszip';
import { jszip } from 'jszip';
import { StatsCompilation } from 'webpack';
import { WebApi } from 'azure-devops-node-api';
import Webpack from 'webpack';

// @public (undocumented)
export class ADOSizeComparator {
constructor(
adoConstants: IADOConstants,
adoConnection: WebApi,
localReportPath: string,
adoBuildId: number | undefined,
getFallbackCommit?: ((startingCommit: string) => Generator<string>) | undefined);
createSizeComparisonMessage(tagWaiting: boolean): Promise<BundleComparisonResult>;
static naiveFallbackCommitGenerator(startingCommit: string): Generator<string>;
}

// @public
export interface AggregatedChunkAnalysis {
// (undocumented)
dependencies: ChunkSizeInfo[];
// (undocumented)
name: string;
// (undocumented)
size: number;
}

// @public (undocumented)
export interface BannedModule {
moduleName: string;
reason: string;
}

// @public
export class BannedModulesPlugin {
constructor(options: BannedModulesPluginOptions);
// (undocumented)
apply(compiler: Webpack.Compiler): void;
}

// @public (undocumented)
export interface BannedModulesPluginOptions {
// (undocumented)
bannedModules: BannedModule[];
}

// @public
export interface BundleBuddyConfig {
chunksToAnalyze: ChunkToAnalyze[];
}

// @public (undocumented)
export interface BundleBuddyConfigProcessorOptions {
// (undocumented)
metricNameProvider?: (chunk: ChunkToAnalyze) => string;
}

// @public
export class BundleBuddyConfigWebpackPlugin {
constructor(config: BundleBuddyPluginConfig);
// (undocumented)
apply(compiler: Compiler): void;
}

// @public (undocumented)
export interface BundleBuddyPluginConfig {
// (undocumented)
bundleBuddyConfig: BundleBuddyConfig;
// (undocumented)
outputFileName: string;
}

// @public
export interface BundleComparison {
// (undocumented)
bundleName: string;
// (undocumented)
commonBundleMetrics: {
[key: string]: {
baseline: BundleMetric;
compare: BundleMetric;
};
};
}

// @public
export type BundleComparisonResult = {
message: string;
comparison: BundleComparison[] | undefined;
};

// @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<string, BundleMetric>;

// @public
export function bundlesContainNoChanges(comparisons: BundleComparison[]): boolean;

// @public
export type BundleSummaries = Map<string, BundleMetricSet>;

// @public (undocumented)
export interface ChunkSizeInfo {
// (undocumented)
chunkId: number | string;
// (undocumented)
size: number;
}

// @public
export interface ChunkToAnalyze {
// (undocumented)
name: string;
}

// @public
export function compareBundles(baseline: BundleSummaries, compare: BundleSummaries): BundleComparison[];

// @public
export function decompressStatsFile(buffer: Buffer): StatsCompilation;

// @public
export const DefaultStatsProcessors: WebpackStatsProcessor[];

// @public (undocumented)
export interface EntryStatsProcessorOptions {
// (undocumented)
metricNameProvider?: (chunkName: string) => string;
}

// @public
export function getAllFilesInDirectory(sourceFolder: string, partialPathPrefix?: string): Promise<string[]>;

// @public (undocumented)
export function getAzureDevopsApi(accessToken: string, orgUrl: string): WebApi;

// @public
export function getBaselineCommit(): 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<Build[]>;

// @public
export function getBuildTagForCommit(commitHash: string): string;

// @public
export function getBundleBuddyConfigFileFromZip(jsZip: JSZip, relativePath: string): Promise<BundleBuddyConfig>;

// @public
export function getBundleBuddyConfigFromFileSystem(path: string): Promise<BundleBuddyConfig>;

// @public (undocumented)
export function getBundleBuddyConfigMap(args: GetBundleBuddyConfigMapArgs): Promise<Map<string, BundleBuddyConfig>>;

// @public (undocumented)
export interface GetBundleBuddyConfigMapArgs {
// (undocumented)
bundleFileData: BundleFileData[];
// (undocumented)
getBundleBuddyConfig: (relativePath: string) => Promise<BundleBuddyConfig>;
}

// @public
export function getBundleBuddyConfigProcessor(options: BundleBuddyConfigProcessorOptions): WebpackStatsProcessor;

// @public (undocumented)
export function getBundleFilePathsFromFolder(relativePathsInFolder: string[]): BundleFileData[];

// @public
export function getBundlePathsFromFileSystem(bundleReportPath: string): Promise<BundleFileData[]>;

// @public
export function getBundlePathsFromZipObject(jsZip: JSZip): BundleFileData[];

// @public (undocumented)
export function getBundleSummaries(args: GetBundleSummariesArgs): Promise<BundleSummaries>;

// @public (undocumented)
export interface GetBundleSummariesArgs {
// (undocumented)
bundlePaths: BundleFileData[];
// (undocumented)
getBundleBuddyConfigFile: (bundleName: string) => Promise<BundleBuddyConfig | undefined> | (BundleBuddyConfig | undefined);
// (undocumented)
getStatsFile: (relativePath: string) => Promise<StatsCompilation>;
// (undocumented)
statsProcessors: WebpackStatsProcessor[];
}

// @public
export function getChunkAndDependencySizes(stats: StatsCompilation, chunkName: string): AggregatedChunkAnalysis;

// @public
export function getChunkParsedSize(stats: StatsCompilation, chunkId: string | number): number;

// @public
export function getCommentForBundleDiff(bundleComparison: BundleComparison[], baselineCommit: string): string;

// @public
export function getEntryStatsProcessor(options: EntryStatsProcessorOptions): WebpackStatsProcessor;

// @public
export function getLastCommitHashFromPR(adoConnection: WebApi, prId: number, repoGuid: string): Promise<string | undefined>;

// @public (undocumented)
export function getPriorCommit(baseCommit: string): string;

// @public
export function getSimpleComment(message: string, baselineCommit: string): string;

// @public
export function getStatsFileFromFileSystem(path: string): Promise<StatsCompilation>;

// @public
export function getStatsFileFromZip(jsZip: JSZip, relativePath: string): Promise<StatsCompilation>;

// @public
export function getTotalSizeStatsProcessor(options: TotalSizeStatsProcessorOptions): WebpackStatsProcessor;

// @public
export function getZipObjectFromArtifact(adoConnection: WebApi, projectName: string, buildNumber: number, bundleAnalysisArtifactName: string): Promise<JSZip>;

// @public (undocumented)
export interface IADOConstants {
// (undocumented)
buildsToSearch?: number;
// (undocumented)
bundleAnalysisArtifactName: string;
// (undocumented)
ciBuildDefinitionId: number;
// (undocumented)
orgUrl: string;
// (undocumented)
prBuildDefinitionId?: number;
// (undocumented)
projectName: string;
// (undocumented)
projectRepoGuid?: string;
}

// @public (undocumented)
export class prCommentsUtils {
constructor(collectionUrl: string, pullRequestId: number, repoId: string, accessToken: string);
appendCommentToThread(message: string, threadType: string): Promise<void>;
createOrReplaceThread(message: string, threadType: string | undefined): Promise<void>;
createOrUpdateThread(message: string, threadType: string | undefined): Promise<void>;
updateThreadStatus(threadType: string, commentThreadStatus: CommentThreadStatus): Promise<void>;
}

// @public (undocumented)
export const totalSizeMetricName = "Total Size";

// @public (undocumented)
export interface TotalSizeStatsProcessorOptions {
// (undocumented)
metricName: string;
}

// @public (undocumented)
export function unzipStream(stream: NodeJS.ReadableStream): Promise<jszip>;

// @public
export type WebpackStatsProcessor = (stats: StatsCompilation, config: BundleBuddyConfig | undefined) => BundleMetricSet | undefined;

// (No @packageDocumentation comment for this package)

```
Loading

0 comments on commit d95e046

Please sign in to comment.