@node-cli/bundlesize 4.5.2 → 4.6.1

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.
Files changed (2) hide show
  1. package/README.md +63 -4
  2. package/package.json +7 -7
package/README.md CHANGED
@@ -215,16 +215,75 @@ export default {
215
215
 
216
216
  #### Simple report with custom columns
217
217
 
218
+ The `columns` option allows you to customize the report table columns. Each column is defined as an object with a key (column identifier) and value (column header text displayed in the table).
219
+
220
+ **Available column keys:**
221
+
222
+ | Key | Description | Default Header |
223
+ | -------- | ---------------------------------------------------- | -------------- |
224
+ | `status` | Shows ✅ if within limit, 🚫 if limit exceeded | "Status" |
225
+ | `file` | Displays the file name or alias | "File" |
226
+ | `size` | Shows the gzipped size with diff from previous stats | "Size (Gzip)" |
227
+ | `limits` | Displays the configured size limit | "Limits" |
228
+
229
+ **Default columns:**
230
+
231
+ ```js
232
+ columns: [
233
+ { status: "Status" },
234
+ { file: "File" },
235
+ { size: "Size (Gzip)" },
236
+ { limits: "Limits" }
237
+ ];
238
+ ```
239
+
240
+ **Customizing column headers:**
241
+
242
+ You can change the header text while keeping the same column:
243
+
244
+ ```js
245
+ export default {
246
+ report: {
247
+ columns: [
248
+ { status: "✓/✗" },
249
+ { file: "Bundle" },
250
+ { size: "Gzip Size" },
251
+ { limits: "Max" }
252
+ ],
253
+ previous: "stats/previous.json",
254
+ current: "stats/current.json"
255
+ }
256
+ };
257
+ ```
258
+
259
+ **Removing columns:**
260
+
261
+ You can remove columns by omitting them from the array:
262
+
263
+ ```js
264
+ export default {
265
+ report: {
266
+ columns: [{ file: "File" }, { size: "Size (Gzip)" }],
267
+ previous: "stats/previous.json",
268
+ current: "stats/current.json"
269
+ }
270
+ };
271
+ ```
272
+
273
+ **Reordering columns:**
274
+
275
+ You can change the column order by rearranging the array:
276
+
218
277
  ```js
219
278
  export default {
220
279
  report: {
221
280
  columns: [
222
- { status: "Status" },
223
281
  { file: "File" },
224
- { size: "Size" },
225
- { limits: "Limits" }
282
+ { status: "Status" },
283
+ { limits: "Limits" },
284
+ { size: "Size (Gzip)" }
226
285
  ],
227
- prev: "stats/previous.json",
286
+ previous: "stats/previous.json",
228
287
  current: "stats/current.json"
229
288
  }
230
289
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@node-cli/bundlesize",
3
- "version": "4.5.2",
3
+ "version": "4.6.1",
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,8 +35,8 @@
35
35
  "watch": "swc --strip-leading-paths --watch --out-dir dist src"
36
36
  },
37
37
  "dependencies": {
38
- "@node-cli/logger": "1.3.3",
39
- "@node-cli/parser": "2.4.4",
38
+ "@node-cli/logger": "1.3.4",
39
+ "@node-cli/parser": "2.4.5",
40
40
  "bytes": "3.1.2",
41
41
  "fs-extra": "11.3.3",
42
42
  "glob": "13.0.0",
@@ -46,9 +46,9 @@
46
46
  "access": "public"
47
47
  },
48
48
  "devDependencies": {
49
- "@node-cli/comments": "0.2.7",
50
- "@vitest/coverage-v8": "4.0.16",
51
- "vitest": "4.0.16"
49
+ "@node-cli/comments": "0.2.9",
50
+ "@vitest/coverage-v8": "4.0.18",
51
+ "vitest": "4.0.18"
52
52
  },
53
- "gitHead": "096003826471508d839f2ec3346bb12b1a73b7fe"
53
+ "gitHead": "06236497427f489176837d5f8274a3b2a4d4cf0d"
54
54
  }