@node-cli/bundlesize 4.5.1 → 4.5.2
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/dist/config.js +2 -2
- package/dist/config.js.map +1 -1
- package/package.json +10 -10
package/dist/config.js
CHANGED
package/dist/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/config.ts"],"sourcesContent":["import type { FooterProperties } from \"./utilities.js\";\n\n/**\n * Configuration for a single file size entry.\n */\nexport interface SizeEntry {\n\t/**\n\t * Path to the file to check. Supports glob patterns.\n\t * Special placeholders:\n\t * - `<hash>`: matches content hashes (e.g., `bundle-<hash>.js`)\n\t * - `<semver>`: matches semantic versions (e.g., `lib-<semver>.js`)\n\t */\n\tpath: string;\n\t/**\n\t * Maximum allowed size for the file (gzipped).\n\t * Format: number followed by unit (B, kB, KB, MB, GB, TB, PB)\n\t * @example \"10 kB\", \"1.5 MB\", \"500 B\"\n\t */\n\tlimit: string;\n\t/**\n\t * Optional alias for the file in reports.\n\t * Useful for giving meaningful names to files with hash patterns.\n\t */\n\talias?: string;\n}\n\n/**\n * Configuration for a header entry (group separator in reports).\n */\nexport interface HeaderEntry {\n\t/**\n\t * Header text to display as a group separator in reports.\n\t */\n\theader: string;\n}\n\n/**\n * Column definition for the report table.\n */\nexport interface ColumnDefinition {\n\t[key: string]: string;\n}\n\n/**\n * Configuration for generating comparison reports.\n */\nexport interface ReportConfiguration {\n\t/**\n\t * Path to the current stats JSON file (relative to config file).\n\t */\n\tcurrent: string;\n\t/**\n\t * Path to the previous stats JSON file for comparison (relative to config file).\n\t */\n\tprevious: string;\n\t/**\n\t * Custom header text for the report.\n\t * @default \"## Bundle Size\"\n\t */\n\theader?: string;\n\t/**\n\t * Custom footer function for the report.\n\t * Receives an object with limitReached, overallDiff, and totalGzipSize.\n\t */\n\tfooter?: (args: FooterProperties) => string;\n\t/**\n\t * Column definitions for the report table.\n\t * @default [{ status: \"Status\" }, { file: \"File\" }, { size: \"Size (Gzip)\" }, { limits: \"Limits\" }]\n\t */\n\tcolumns?: ColumnDefinition[];\n\t/**\n\t * Minimum gzip size change in bytes to consider as a change.\n\t * Changes below this threshold are treated as no change.\n\t * @default 0\n\t */\n\tthreshold?: number;\n}\n\n/**\n * Bundlesize configuration object.\n */\nexport interface BundlesizeConfig {\n\t/**\n\t * Array of file size entries to check.\n\t * Each entry can be either a SizeEntry (file to check) or HeaderEntry (group separator).\n\t */\n\tsizes?: (SizeEntry | HeaderEntry)[];\n\t/**\n\t * Configuration for generating comparison reports.\n\t */\n\treport?: ReportConfiguration;\n}\n\n/**\n * Helper function to define bundlesize configuration with full type support.\n * Provides IntelliSense and type checking for configuration files.\n *\n * @example\n * ```js\n * import { defineConfig } from \"@node-cli/bundlesize\";\n *\n * export default defineConfig({\n * sizes: [\n * { path: \"dist/bundle.js\", limit: \"10 kB\" }\n * ]\n * });\n * ```\n */\nexport function defineConfig(config: BundlesizeConfig): BundlesizeConfig {\n\treturn config;\n}\n"],"names":["defineConfig","config"],"mappings":"AA6FA;;;;;;;;;;;;;;CAcC,GACD,OAAO,SAASA,aAAaC,MAAwB;IACpD,OAAOA;AACR"}
|
|
1
|
+
{"version":3,"sources":["../src/config.ts"],"sourcesContent":["import type { FooterProperties } from \"./utilities.js\";\n\n/**\n * Configuration for a single file size entry.\n */\nexport interface SizeEntry {\n\t/**\n\t * Path to the file to check. Supports glob patterns.\n\t * Special placeholders:\n\t * - `<hash>`: matches content hashes (e.g., `bundle-<hash>.js`)\n\t * - `<semver>`: matches semantic versions (e.g., `lib-<semver>.js`)\n\t */\n\tpath: string;\n\t/**\n\t * Maximum allowed size for the file (gzipped).\n\t * Format: number followed by unit (B, kB, KB, MB, GB, TB, PB)\n\t * @example \"10 kB\", \"1.5 MB\", \"500 B\"\n\t */\n\tlimit: string;\n\t/**\n\t * Optional alias for the file in reports.\n\t * Useful for giving meaningful names to files with hash patterns.\n\t */\n\talias?: string;\n}\n\n/**\n * Configuration for a header entry (group separator in reports).\n */\nexport interface HeaderEntry {\n\t/**\n\t * Header text to display as a group separator in reports.\n\t */\n\theader: string;\n}\n\n/**\n * Column definition for the report table.\n */\nexport interface ColumnDefinition {\n\t[key: string]: string;\n}\n\n/**\n * Configuration for generating comparison reports.\n */\nexport interface ReportConfiguration {\n\t/**\n\t * Path to the current stats JSON file (relative to config file).\n\t */\n\tcurrent: string;\n\t/**\n\t * Path to the previous stats JSON file for comparison (relative to config file).\n\t */\n\tprevious: string;\n\t/**\n\t * Custom header text for the report.\n\t * @default \"## Bundle Size\"\n\t */\n\theader?: string;\n\t/**\n\t * Custom footer function for the report.\n\t * Receives an object with limitReached, overallDiff, and totalGzipSize.\n\t */\n\tfooter?: (args: FooterProperties) => string;\n\t/**\n\t * Column definitions for the report table.\n\t * @default [{ status: \"Status\" }, { file: \"File\" }, { size: \"Size (Gzip)\" }, { limits: \"Limits\" }]\n\t */\n\tcolumns?: ColumnDefinition[];\n\t/**\n\t * Minimum gzip size change in bytes to consider as a change.\n\t * Changes below this threshold are treated as no change.\n\t * @default 0\n\t */\n\tthreshold?: number;\n}\n\n/**\n * Bundlesize configuration object.\n */\nexport interface BundlesizeConfig {\n\t/**\n\t * Array of file size entries to check.\n\t * Each entry can be either a SizeEntry (file to check) or HeaderEntry (group separator).\n\t */\n\tsizes?: (SizeEntry | HeaderEntry)[];\n\t/**\n\t * Configuration for generating comparison reports.\n\t */\n\treport?: ReportConfiguration;\n}\n\n/**\n * Helper function to define bundlesize configuration with full type support.\n * Provides IntelliSense and type checking for configuration files.\n *\n * @example\n * ```js\n * import { defineConfig } from \"@node-cli/bundlesize\";\n *\n * export default defineConfig({\n * sizes: [\n * { path: \"dist/bundle.js\", limit: \"10 kB\" }\n * ]\n * });\n * ```\n */\n/* v8 ignore start */\nexport function defineConfig(config: BundlesizeConfig): BundlesizeConfig {\n\treturn config;\n}\n/* v8 ignore stop */\n"],"names":["defineConfig","config"],"mappings":"AA6FA;;;;;;;;;;;;;;CAcC,GACD,mBAAmB,GACnB,OAAO,SAASA,aAAaC,MAAwB;IACpD,OAAOA;AACR,EACA,kBAAkB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@node-cli/bundlesize",
|
|
3
|
-
"version": "4.5.
|
|
3
|
+
"version": "4.5.2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Arno Versini",
|
|
6
6
|
"description": "Simple CLI tool that checks file(s) size and report if limits have been reached",
|
|
@@ -35,20 +35,20 @@
|
|
|
35
35
|
"watch": "swc --strip-leading-paths --watch --out-dir dist src"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@node-cli/logger": "1.3.
|
|
39
|
-
"@node-cli/parser": "2.4.
|
|
38
|
+
"@node-cli/logger": "1.3.3",
|
|
39
|
+
"@node-cli/parser": "2.4.4",
|
|
40
40
|
"bytes": "3.1.2",
|
|
41
|
-
"fs-extra": "11.3.
|
|
42
|
-
"glob": "
|
|
43
|
-
"semver": "7.7.
|
|
41
|
+
"fs-extra": "11.3.3",
|
|
42
|
+
"glob": "13.0.0",
|
|
43
|
+
"semver": "7.7.3"
|
|
44
44
|
},
|
|
45
45
|
"publishConfig": {
|
|
46
46
|
"access": "public"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
|
-
"@node-cli/comments": "0.2.
|
|
50
|
-
"@vitest/coverage-v8": "
|
|
51
|
-
"vitest": "
|
|
49
|
+
"@node-cli/comments": "0.2.7",
|
|
50
|
+
"@vitest/coverage-v8": "4.0.16",
|
|
51
|
+
"vitest": "4.0.16"
|
|
52
52
|
},
|
|
53
|
-
"gitHead": "
|
|
53
|
+
"gitHead": "096003826471508d839f2ec3346bb12b1a73b7fe"
|
|
54
54
|
}
|