@mui/internal-bundle-size-checker 1.0.9-canary.7 → 1.0.9-canary.71
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -2
- package/build/browser.d.ts +12 -0
- package/build/builder.d.ts +25 -0
- package/build/ciReport.d.ts +32 -0
- package/build/cli.d.ts +5 -0
- package/build/configLoader.d.ts +34 -0
- package/build/constants.d.ts +1 -0
- package/build/defineConfig.d.ts +12 -0
- package/build/fetchSnapshot.d.ts +7 -0
- package/build/fetchSnapshotWithFallback.d.ts +11 -0
- package/build/formatUtils.d.ts +6 -0
- package/build/git.d.ts +23 -0
- package/build/github.d.ts +2 -0
- package/build/index.d.ts +4 -0
- package/build/notifyPr.d.ts +12 -0
- package/build/renderMarkdownReport.d.ts +43 -0
- package/build/sizeDiff.d.ts +18 -0
- package/build/strings.d.ts +23 -0
- package/build/uploadSnapshot.d.ts +11 -0
- package/build/worker.d.ts +15 -0
- package/package.json +33 -32
- package/src/browser.js +8 -0
- package/src/{viteBuilder.js → builder.js} +108 -37
- package/src/ciReport.js +38 -0
- package/src/cli.js +183 -44
- package/src/configLoader.js +150 -45
- package/src/constants.js +1 -0
- package/src/defineConfig.js +4 -0
- package/src/fetchSnapshot.js +3 -61
- package/src/fetchSnapshotWithFallback.js +34 -0
- package/src/git.js +50 -0
- package/src/github.js +4 -1
- package/src/index.js +1 -9
- package/src/notifyPr.js +81 -0
- package/src/renderMarkdownReport.js +22 -27
- package/src/renderMarkdownReport.test.js +101 -80
- package/src/sizeDiff.js +5 -35
- package/src/strings.js +38 -0
- package/src/types.d.ts +61 -36
- package/src/uploadSnapshot.js +80 -16
- package/src/worker.js +18 -19
- package/tsconfig.build.json +15 -0
- package/tsconfig.json +2 -2
- package/src/browser.d.ts +0 -2
- package/src/webpackBuilder.js +0 -267
package/README.md
CHANGED
|
@@ -19,9 +19,12 @@ bundle-size-checker [options]
|
|
|
19
19
|
|
|
20
20
|
Options:
|
|
21
21
|
|
|
22
|
-
- `--analyze`: Creates a
|
|
23
|
-
- `--
|
|
22
|
+
- `--analyze`: Creates a report for each bundle (using rollup-plugin-visualizer)
|
|
23
|
+
- `--debug`: Build with readable output (no name mangling or whitespace collapse, but still tree-shake)
|
|
24
|
+
- `--verbose`: Show more detailed information during compilation
|
|
24
25
|
- `--output`, `-o`: Path to output the size snapshot JSON file
|
|
26
|
+
- `--filter`, `-F`: Filter entry points by glob pattern(s) applied to their IDs
|
|
27
|
+
- `--concurrency`, `-c`: Number of workers to use for parallel processing
|
|
25
28
|
|
|
26
29
|
### Configuration
|
|
27
30
|
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export { calculateSizeDiff } from './sizeDiff.js';
|
|
2
|
+
export { fetchSnapshot } from './fetchSnapshot.js';
|
|
3
|
+
export type Size = import('./types.js').Size;
|
|
4
|
+
export type SizeSnapshot = import('./types.js').SizeSnapshot;
|
|
5
|
+
export type ComparisonResult = import('./types.js').ComparisonResult;
|
|
6
|
+
export type SizeSnapshotEntry = import('./types.js').SizeSnapshotEntry;
|
|
7
|
+
/**
|
|
8
|
+
* @typedef {import('./types.js').Size} Size
|
|
9
|
+
* @typedef {import('./types.js').SizeSnapshot} SizeSnapshot
|
|
10
|
+
* @typedef {import('./types.js').ComparisonResult} ComparisonResult
|
|
11
|
+
* @typedef {import('./types.js').SizeSnapshotEntry} SizeSnapshotEntry
|
|
12
|
+
*/
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export type ObjectEntry = import('./types.js').ObjectEntry;
|
|
2
|
+
export type CommandLineArgs = import('./types.js').CommandLineArgs;
|
|
3
|
+
export type SizeSnapshotEntry = import('./types.js').SizeSnapshotEntry;
|
|
4
|
+
export type ManifestChunk = {
|
|
5
|
+
file: string;
|
|
6
|
+
name?: string;
|
|
7
|
+
src?: string;
|
|
8
|
+
css?: string[];
|
|
9
|
+
isEntry?: boolean;
|
|
10
|
+
isDynamicEntry?: boolean;
|
|
11
|
+
imports?: string[];
|
|
12
|
+
dynamicImports?: string[];
|
|
13
|
+
};
|
|
14
|
+
export type Manifest = Record<string, ManifestChunk>;
|
|
15
|
+
/**
|
|
16
|
+
* Get sizes for a vite bundle
|
|
17
|
+
* @param {ObjectEntry} entry - The entry configuration
|
|
18
|
+
* @param {CommandLineArgs} args - Command line arguments
|
|
19
|
+
* @param {Record<string, string>} [replacements] - String replacements to apply
|
|
20
|
+
* @returns {Promise<{ sizes: Map<string, SizeSnapshotEntry>, treemapPath: string }>}
|
|
21
|
+
*/
|
|
22
|
+
export declare function getBundleSizes(entry: ObjectEntry, args: CommandLineArgs, replacements?: Record<string, string>): Promise<{
|
|
23
|
+
sizes: Map<string, SizeSnapshotEntry>;
|
|
24
|
+
treemapPath: string;
|
|
25
|
+
}>;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { z } from 'zod/v4';
|
|
2
|
+
/**
|
|
3
|
+
* Creates a CI report upload schema for a specific report type.
|
|
4
|
+
* Common fields (commitSha, repo, branch, prNumber) are shared across all report types.
|
|
5
|
+
* @param {string} type - The report type literal (e.g. 'size-snapshot')
|
|
6
|
+
* @param {number} version - The schema version number
|
|
7
|
+
* @param {z.ZodType} reportSchema - Zod schema for the report payload
|
|
8
|
+
*/
|
|
9
|
+
export declare function ciReportUploadSchema(type: string, version: number, reportSchema: z.ZodType): z.ZodObject<{
|
|
10
|
+
version: z.ZodLiteral<number>;
|
|
11
|
+
timestamp: z.ZodNumber;
|
|
12
|
+
commitSha: z.ZodString;
|
|
13
|
+
repo: z.ZodString;
|
|
14
|
+
reportType: z.ZodLiteral<string>;
|
|
15
|
+
prNumber: z.ZodOptional<z.ZodNumber>;
|
|
16
|
+
branch: z.ZodString;
|
|
17
|
+
report: z.ZodType<any, any, z.core.$ZodTypeInternals<any, any>>;
|
|
18
|
+
}, z.core.$strip>;
|
|
19
|
+
export declare const sizeSnapshotUploadSchema: z.ZodObject<{
|
|
20
|
+
version: z.ZodLiteral<number>;
|
|
21
|
+
timestamp: z.ZodNumber;
|
|
22
|
+
commitSha: z.ZodString;
|
|
23
|
+
repo: z.ZodString;
|
|
24
|
+
reportType: z.ZodLiteral<string>;
|
|
25
|
+
prNumber: z.ZodOptional<z.ZodNumber>;
|
|
26
|
+
branch: z.ZodString;
|
|
27
|
+
report: z.ZodType<any, any, z.core.$ZodTypeInternals<any, any>>;
|
|
28
|
+
}, z.core.$strip>;
|
|
29
|
+
export type SizeSnapshotUpload = z.infer<typeof sizeSnapshotUploadSchema>;
|
|
30
|
+
/**
|
|
31
|
+
* @typedef {z.infer<typeof sizeSnapshotUploadSchema>} SizeSnapshotUpload
|
|
32
|
+
*/
|
package/build/cli.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export type CommandLineArgs = import('./types.js').CommandLineArgs;
|
|
2
|
+
export type NormalizedBundleSizeCheckerConfig = import('./types.js').NormalizedBundleSizeCheckerConfig;
|
|
3
|
+
export type SizeSnapshotEntry = import('./types.js').SizeSnapshotEntry;
|
|
4
|
+
export type ReportCommandArgs = import('./types.js').ReportCommandArgs;
|
|
5
|
+
export type SizeSnapshot = import('./sizeDiff.js').SizeSnapshot;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Utility to load the bundle-size-checker configuration
|
|
3
|
+
*/
|
|
4
|
+
export type BundleSizeCheckerConfigObject = import('./types.js').BundleSizeCheckerConfigObject;
|
|
5
|
+
export type UploadConfig = import('./types.js').UploadConfig;
|
|
6
|
+
export type NormalizedUploadConfig = import('./types.js').NormalizedUploadConfig;
|
|
7
|
+
export type EntryPoint = import('./types.js').EntryPoint;
|
|
8
|
+
export type ObjectEntry = import('./types.js').ObjectEntry;
|
|
9
|
+
export type NormalizedBundleSizeCheckerConfig = import('./types.js').NormalizedBundleSizeCheckerConfig;
|
|
10
|
+
/**
|
|
11
|
+
* Validates and normalizes an upload configuration object
|
|
12
|
+
* @param {UploadConfig} uploadConfig - The upload configuration to normalize
|
|
13
|
+
* @param {Object} ciInfo - CI environment information
|
|
14
|
+
* @param {string} [ciInfo.branch] - Branch name from CI environment
|
|
15
|
+
* @param {boolean} [ciInfo.isPr] - Whether this is a pull request from CI environment
|
|
16
|
+
* @param {string} [ciInfo.prBranch] - PR branch name from CI environment
|
|
17
|
+
* @param {string} [ciInfo.slug] - Repository slug from CI environment
|
|
18
|
+
* @param {string} [ciInfo.pr] - Pull request number from CI environment
|
|
19
|
+
* @returns {NormalizedUploadConfig} - Normalized upload config
|
|
20
|
+
* @throws {Error} If required fields are missing
|
|
21
|
+
*/
|
|
22
|
+
export declare function applyUploadConfigDefaults(uploadConfig: UploadConfig, ciInfo: {
|
|
23
|
+
branch?: string;
|
|
24
|
+
isPr?: boolean;
|
|
25
|
+
prBranch?: string;
|
|
26
|
+
slug?: string;
|
|
27
|
+
pr?: string;
|
|
28
|
+
}): NormalizedUploadConfig;
|
|
29
|
+
/**
|
|
30
|
+
* Attempts to load the config file from the given directory
|
|
31
|
+
* @param {string} rootDir - The directory to search for the config file
|
|
32
|
+
* @returns {Promise<NormalizedBundleSizeCheckerConfig>} A promise that resolves to the normalized config object
|
|
33
|
+
*/
|
|
34
|
+
export declare function loadConfig(rootDir: string): Promise<NormalizedBundleSizeCheckerConfig>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const DASHBOARD_ORIGIN = "https://frontend-public.mui.com";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @typedef {import('./types.js').BundleSizeCheckerConfig} BundleSizeCheckerConfig
|
|
3
|
+
*/
|
|
4
|
+
export type BundleSizeCheckerConfig = import('./types.js').BundleSizeCheckerConfig;
|
|
5
|
+
/**
|
|
6
|
+
* Define a configuration for the bundle size checker.
|
|
7
|
+
* This is just a pass-through function for better TypeScript typing.
|
|
8
|
+
*
|
|
9
|
+
* @param {BundleSizeCheckerConfig} config - Configuration object
|
|
10
|
+
* @returns {BundleSizeCheckerConfig} The configuration object
|
|
11
|
+
*/
|
|
12
|
+
export default function defineConfig(config: BundleSizeCheckerConfig): BundleSizeCheckerConfig;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* @param {string} repo - The name of the repository e.g. 'mui/material-ui'
|
|
4
|
+
* @param {string} sha - The commit SHA
|
|
5
|
+
* @returns {Promise<import('./sizeDiff.js').SizeSnapshot>} - The size snapshot data
|
|
6
|
+
*/
|
|
7
|
+
export declare function fetchSnapshot(repo: string, sha: string): Promise<import('./sizeDiff.js').SizeSnapshot>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Attempts to fetch a snapshot with fallback to parent commits
|
|
3
|
+
* @param {string} repo - Repository name
|
|
4
|
+
* @param {string} commit - The commit SHA to start from
|
|
5
|
+
* @param {number} [fallbackDepth=3] - How many parent commits to try as fallback
|
|
6
|
+
* @returns {Promise<{snapshot: import('./sizeDiff.js').SizeSnapshot | null, actualCommit: string | null}>}
|
|
7
|
+
*/
|
|
8
|
+
export declare function fetchSnapshotWithFallback(repo: string, commit: string, fallbackDepth?: number): Promise<{
|
|
9
|
+
snapshot: import('./sizeDiff.js').SizeSnapshot | null;
|
|
10
|
+
actualCommit: string | null;
|
|
11
|
+
}>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Format utilities for consistent display of sizes and percentages
|
|
3
|
+
*/
|
|
4
|
+
export declare const byteSizeFormatter: Intl.NumberFormat;
|
|
5
|
+
export declare const byteSizeChangeFormatter: Intl.NumberFormat;
|
|
6
|
+
export declare const displayPercentFormatter: Intl.NumberFormat;
|
package/build/git.d.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Gets parent commits for a given commit SHA using git CLI
|
|
3
|
+
* @param {string} repo - Repository name (e.g., 'mui/material-ui') - ignored for git CLI
|
|
4
|
+
* @param {string} commit - The commit SHA to start from
|
|
5
|
+
* @param {number} depth - How many commits to retrieve (including the starting commit)
|
|
6
|
+
* @returns {Promise<string[]>} Array of commit SHAs in chronological order (excluding the starting commit)
|
|
7
|
+
*/
|
|
8
|
+
export declare function getParentCommits(repo: string, commit: string, depth?: number): Promise<string[]>;
|
|
9
|
+
/**
|
|
10
|
+
* Compares two commits and returns merge base information using git CLI
|
|
11
|
+
* @param {string} base - Base commit SHA
|
|
12
|
+
* @param {string} head - Head commit SHA
|
|
13
|
+
* @returns {Promise<string>} Object with merge base commit info
|
|
14
|
+
*/
|
|
15
|
+
export declare function getMergeBase(base: string, head: string): Promise<string>;
|
|
16
|
+
/**
|
|
17
|
+
* Gets the current repository owner and name from git remote
|
|
18
|
+
* @returns {Promise<{owner: string | null, name: string | null}>}
|
|
19
|
+
*/
|
|
20
|
+
export declare function getCurrentRepoInfo(): Promise<{
|
|
21
|
+
owner: string | null;
|
|
22
|
+
name: string | null;
|
|
23
|
+
}>;
|
package/build/index.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Creates or updates a comment on a pull request with the specified content.
|
|
3
|
+
* Uses an HTML comment marker to identify and update existing comments.
|
|
4
|
+
* Searches page-by-page (newest first) and stops early when comment is found.
|
|
5
|
+
*
|
|
6
|
+
* @param {string} repo - The repository in format "owner/repo"
|
|
7
|
+
* @param {number} prNumber - The pull request number
|
|
8
|
+
* @param {string} id - Unique identifier to mark the comment for future updates
|
|
9
|
+
* @param {string} content - The content to post or update in the comment
|
|
10
|
+
* @returns {Promise<void>}
|
|
11
|
+
*/
|
|
12
|
+
export declare function notifyPr(repo: string, prNumber: number, id: string, content: string): Promise<void>;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @typedef {import('./types.js').Size} Size
|
|
3
|
+
* @typedef {import('./types.js').SizeSnapshot} SizeSnapshot
|
|
4
|
+
* @typedef {import('./types.js').ComparisonResult} ComparisonResult
|
|
5
|
+
* @typedef {import('./types.js').PrInfo} PrInfo
|
|
6
|
+
*/
|
|
7
|
+
export type Size = import('./types.js').Size;
|
|
8
|
+
export type SizeSnapshot = import('./types.js').SizeSnapshot;
|
|
9
|
+
export type ComparisonResult = import('./types.js').ComparisonResult;
|
|
10
|
+
export type PrInfo = import('./types.js').PrInfo;
|
|
11
|
+
export type ColumnDefinition = {
|
|
12
|
+
field: string;
|
|
13
|
+
header?: string;
|
|
14
|
+
align?: 'left' | 'center' | 'right';
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Generates a Markdown report for bundle size changes
|
|
18
|
+
* @param {ComparisonResult} comparison - Comparison result from calculateSizeDiff
|
|
19
|
+
* @param {Object} [options] - Additional options
|
|
20
|
+
* @param {string[]} [options.track] - Array of bundle IDs to track. If specified, totals will only include tracked bundles and all tracked bundles will be shown prominently
|
|
21
|
+
* @param {number} [options.maxDetailsLines=100] - Maximum number of bundles to show in details section
|
|
22
|
+
* @returns {string} Markdown report
|
|
23
|
+
*/
|
|
24
|
+
export declare function renderMarkdownReportContent(comparison: ComparisonResult, { track, maxDetailsLines }?: {
|
|
25
|
+
track?: string[];
|
|
26
|
+
maxDetailsLines?: number;
|
|
27
|
+
}): string;
|
|
28
|
+
/**
|
|
29
|
+
*
|
|
30
|
+
* @param {PrInfo} prInfo
|
|
31
|
+
* @param {Object} [options] - Additional options
|
|
32
|
+
* @param {string[]} [options.track] - Array of bundle IDs to track
|
|
33
|
+
* @param {number} [options.fallbackDepth=3] - How many parent commits to try as fallback when base snapshot is missing
|
|
34
|
+
* @param {number} [options.maxDetailsLines=100] - Maximum number of bundles to show in details section
|
|
35
|
+
* @param {(base: string, head: string) => Promise<string>} [options.getMergeBase] - Custom function to get merge base commit
|
|
36
|
+
* @returns {Promise<string>} Markdown report
|
|
37
|
+
*/
|
|
38
|
+
export declare function renderMarkdownReport(prInfo: PrInfo, options?: {
|
|
39
|
+
track?: string[];
|
|
40
|
+
fallbackDepth?: number;
|
|
41
|
+
maxDetailsLines?: number;
|
|
42
|
+
getMergeBase?: (base: string, head: string) => Promise<string>;
|
|
43
|
+
}): Promise<string>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @typedef {import('./types.js').SizeSnapshotEntry} SizeSnapshotEntry
|
|
3
|
+
* @typedef {import('./types.js').Size} Size
|
|
4
|
+
* @typedef {import('./types.js').SizeSnapshot} SizeSnapshot
|
|
5
|
+
* @typedef {import('./types.js').ComparisonResult} ComparisonResult
|
|
6
|
+
*/
|
|
7
|
+
export type SizeSnapshotEntry = import('./types.js').SizeSnapshotEntry;
|
|
8
|
+
export type Size = import('./types.js').Size;
|
|
9
|
+
export type SizeSnapshot = import('./types.js').SizeSnapshot;
|
|
10
|
+
export type ComparisonResult = import('./types.js').ComparisonResult;
|
|
11
|
+
/**
|
|
12
|
+
* Calculates size difference between two snapshots
|
|
13
|
+
*
|
|
14
|
+
* @param {SizeSnapshot} baseSnapshot - Base snapshot (previous)
|
|
15
|
+
* @param {SizeSnapshot} targetSnapshot - Target snapshot (current)
|
|
16
|
+
* @returns {ComparisonResult} Comparison result with entries, totals, and file counts
|
|
17
|
+
*/
|
|
18
|
+
export declare function calculateSizeDiff(baseSnapshot: SizeSnapshot, targetSnapshot: SizeSnapshot): ComparisonResult;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Inspired by https://github.com/parshap/node-sanitize-filename
|
|
3
|
+
*
|
|
4
|
+
* Replaces characters in strings that are illegal/unsafe for filenames.
|
|
5
|
+
* Unsafe characters are either removed or replaced by a substitute set
|
|
6
|
+
* in the optional `options` object.
|
|
7
|
+
*
|
|
8
|
+
* Illegal Characters on Various Operating Systems
|
|
9
|
+
* / ? < > \ : * | "
|
|
10
|
+
* https://kb.acronis.com/content/39790
|
|
11
|
+
*
|
|
12
|
+
* Unicode Control codes
|
|
13
|
+
* C0 0x00-0x1f & C1 (0x80-0x9f)
|
|
14
|
+
* http://en.wikipedia.org/wiki/C0_and_C1_control_codes
|
|
15
|
+
*
|
|
16
|
+
* Reserved filenames on Unix-based systems (".", "..")
|
|
17
|
+
* Reserved filenames in Windows ("CON", "PRN", "AUX", "NUL", "COM1",
|
|
18
|
+
* "COM2", "COM3", "COM4", "COM5", "COM6", "COM7", "COM8", "COM9",
|
|
19
|
+
* "LPT1", "LPT2", "LPT3", "LPT4", "LPT5", "LPT6", "LPT7", "LPT8", and
|
|
20
|
+
* "LPT9") case-insesitively and with or without filename extensions.
|
|
21
|
+
* @param {string} input
|
|
22
|
+
*/
|
|
23
|
+
export declare function escapeFilename(input: string, replacement?: string): string;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export type NormalizedUploadConfig = import('./types.js').NormalizedUploadConfig;
|
|
2
|
+
/**
|
|
3
|
+
* Uploads the size snapshot to S3
|
|
4
|
+
* @param {string} snapshotPath - The path to the size snapshot JSON file
|
|
5
|
+
* @param {NormalizedUploadConfig} uploadConfig - The normalized upload configuration
|
|
6
|
+
* @param {string} [commitSha] - Optional commit SHA (defaults to current Git HEAD)
|
|
7
|
+
* @returns {Promise<{key:string}>}
|
|
8
|
+
*/
|
|
9
|
+
export declare function uploadSnapshot(snapshotPath: string, uploadConfig: NormalizedUploadConfig, commitSha?: string): Promise<{
|
|
10
|
+
key: string;
|
|
11
|
+
}>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export type ObjectEntry = import('./types.js').ObjectEntry;
|
|
2
|
+
export type CommandLineArgs = import('./types.js').CommandLineArgs;
|
|
3
|
+
export type SizeSnapshotEntry = import('./types.js').SizeSnapshotEntry;
|
|
4
|
+
/**
|
|
5
|
+
* Get sizes for a bundle
|
|
6
|
+
* @param {{ entry: ObjectEntry, args: CommandLineArgs, index: number, total: number, replace?: Record<string, string> }} options
|
|
7
|
+
* @returns {Promise<Array<[string, SizeSnapshotEntry]>>}
|
|
8
|
+
*/
|
|
9
|
+
export default function getSizes({ entry, args, index, total, replace }: {
|
|
10
|
+
entry: ObjectEntry;
|
|
11
|
+
args: CommandLineArgs;
|
|
12
|
+
index: number;
|
|
13
|
+
total: number;
|
|
14
|
+
replace?: Record<string, string>;
|
|
15
|
+
}): Promise<Array<[string, SizeSnapshotEntry]>>;
|
package/package.json
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mui/internal-bundle-size-checker",
|
|
3
|
-
"version": "1.0.9-canary.
|
|
3
|
+
"version": "1.0.9-canary.71",
|
|
4
4
|
"description": "Bundle size checker for MUI packages.",
|
|
5
|
+
"license": "MIT",
|
|
5
6
|
"type": "module",
|
|
6
7
|
"main": "./src/index.js",
|
|
8
|
+
"types": "./build/index.d.ts",
|
|
7
9
|
"bin": {
|
|
8
10
|
"bundle-size-checker": "./bin/bundle-size-checker.js"
|
|
9
11
|
},
|
|
@@ -14,45 +16,44 @@
|
|
|
14
16
|
},
|
|
15
17
|
"sideEffects": false,
|
|
16
18
|
"exports": {
|
|
17
|
-
".":
|
|
19
|
+
".": {
|
|
20
|
+
"types": "./build/index.d.ts",
|
|
21
|
+
"default": "./src/index.js"
|
|
22
|
+
},
|
|
18
23
|
"./package.json": "./package.json",
|
|
19
|
-
"./browser":
|
|
24
|
+
"./browser": {
|
|
25
|
+
"types": "./build/browser.d.ts",
|
|
26
|
+
"default": "./src/browser.js"
|
|
27
|
+
},
|
|
28
|
+
"./ciReport": {
|
|
29
|
+
"types": "./build/ciReport.d.ts",
|
|
30
|
+
"default": "./src/ciReport.js"
|
|
31
|
+
}
|
|
20
32
|
},
|
|
21
33
|
"dependencies": {
|
|
22
|
-
"@aws-sdk/client-s3": "^3.
|
|
23
|
-
"@aws-sdk/credential-providers": "^3.
|
|
24
|
-
"@
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"babel-loader": "^10.0.0",
|
|
29
|
-
"chalk": "^5.4.1",
|
|
30
|
-
"compression-webpack-plugin": "^10.0.0",
|
|
31
|
-
"css-loader": "^7.1.2",
|
|
32
|
-
"env-ci": "^11.1.0",
|
|
33
|
-
"execa": "^7.2.0",
|
|
34
|
-
"fast-glob": "^3.3.2",
|
|
35
|
-
"file-loader": "^6.2.0",
|
|
34
|
+
"@aws-sdk/client-s3": "^3.1008.0",
|
|
35
|
+
"@aws-sdk/credential-providers": "^3.1008.0",
|
|
36
|
+
"@octokit/rest": "^22.0.1",
|
|
37
|
+
"chalk": "^5.6.2",
|
|
38
|
+
"env-ci": "^11.2.0",
|
|
39
|
+
"execa": "^9.6.1",
|
|
36
40
|
"git-url-parse": "^16.1.0",
|
|
37
41
|
"micromatch": "^4.0.8",
|
|
38
|
-
"piscina": "^
|
|
39
|
-
"rollup-plugin-visualizer": "^
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"webpack-bundle-analyzer": "^4.10.1",
|
|
44
|
-
"yargs": "^17.7.2"
|
|
42
|
+
"piscina": "^5.1.4",
|
|
43
|
+
"rollup-plugin-visualizer": "^7.0.1",
|
|
44
|
+
"vite": "^8.0.2",
|
|
45
|
+
"yargs": "^18.0.0",
|
|
46
|
+
"zod": "^4.3.6"
|
|
45
47
|
},
|
|
46
48
|
"devDependencies": {
|
|
47
|
-
"@types/env-ci": "
|
|
48
|
-
"@types/micromatch": "
|
|
49
|
-
"@types/
|
|
50
|
-
"@types/webpack-bundle-analyzer": "^4.7.0",
|
|
51
|
-
"@types/yargs": "^17.0.33"
|
|
49
|
+
"@types/env-ci": "3.1.4",
|
|
50
|
+
"@types/micromatch": "4.0.10",
|
|
51
|
+
"@types/yargs": "17.0.35"
|
|
52
52
|
},
|
|
53
|
-
"gitSha": "
|
|
53
|
+
"gitSha": "cddfbe44fdd8895ff4ffcd9eaaa75320b873a893",
|
|
54
54
|
"scripts": {
|
|
55
|
-
"
|
|
56
|
-
"test": "pnpm -w test --project @mui/internal-bundle-size-checker"
|
|
55
|
+
"build": "tsgo -p tsconfig.build.json",
|
|
56
|
+
"test": "pnpm -w test --project @mui/internal-bundle-size-checker",
|
|
57
|
+
"typescript": "tsgo -noEmit"
|
|
57
58
|
}
|
|
58
59
|
}
|
package/src/browser.js
CHANGED
|
@@ -1,2 +1,10 @@
|
|
|
1
1
|
export { calculateSizeDiff } from './sizeDiff.js';
|
|
2
2
|
export { fetchSnapshot } from './fetchSnapshot.js';
|
|
3
|
+
|
|
4
|
+
// Re-export types for consumers
|
|
5
|
+
/**
|
|
6
|
+
* @typedef {import('./types.js').Size} Size
|
|
7
|
+
* @typedef {import('./types.js').SizeSnapshot} SizeSnapshot
|
|
8
|
+
* @typedef {import('./types.js').ComparisonResult} ComparisonResult
|
|
9
|
+
* @typedef {import('./types.js').SizeSnapshotEntry} SizeSnapshotEntry
|
|
10
|
+
*/
|