rollup-plugin-stats 2.0.0 → 2.1.0-beta.0
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/extract.cjs +2 -2
- package/dist/extract.d.cts +1 -1
- package/dist/extract.d.mts +1 -1
- package/dist/extract.mjs +2 -2
- package/dist/index.cjs +2 -2
- package/dist/index.d.cts +2 -2
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +2 -2
- package/dist/src/types.d.cts.map +1 -0
- package/dist/src/types.d.mts.map +1 -0
- package/dist/src/utils/check-exclude-filepath.cjs.map +1 -0
- package/dist/src/utils/check-exclude-filepath.d.cts.map +1 -0
- package/dist/src/utils/check-exclude-filepath.d.mts.map +1 -0
- package/dist/src/utils/check-exclude-filepath.mjs.map +1 -0
- package/dist/src/utils/format-file-size.cjs.map +1 -0
- package/dist/src/utils/format-file-size.mjs.map +1 -0
- package/dist/src/utils/omit.cjs.map +1 -0
- package/dist/src/utils/omit.mjs.map +1 -0
- package/dist/src/utils/round.cjs.map +1 -0
- package/dist/src/utils/round.mjs.map +1 -0
- package/dist/{write.cjs → src/write.cjs} +1 -1
- package/dist/src/write.cjs.map +1 -0
- package/dist/src/write.d.cts.map +1 -0
- package/dist/src/write.d.mts.map +1 -0
- package/dist/src/write.mjs.map +1 -0
- package/package.json +10 -10
- package/dist/types.d.cts.map +0 -1
- package/dist/types.d.mts.map +0 -1
- package/dist/utils/check-exclude-filepath.cjs.map +0 -1
- package/dist/utils/check-exclude-filepath.d.cts.map +0 -1
- package/dist/utils/check-exclude-filepath.d.mts.map +0 -1
- package/dist/utils/check-exclude-filepath.mjs.map +0 -1
- package/dist/utils/format-file-size.cjs.map +0 -1
- package/dist/utils/format-file-size.mjs.map +0 -1
- package/dist/utils/omit.cjs.map +0 -1
- package/dist/utils/omit.mjs.map +0 -1
- package/dist/utils/round.cjs.map +0 -1
- package/dist/utils/round.mjs.map +0 -1
- package/dist/write.cjs.map +0 -1
- package/dist/write.d.cts.map +0 -1
- package/dist/write.d.mts.map +0 -1
- package/dist/write.mjs.map +0 -1
- /package/dist/{types.d.cts → src/types.d.cts} +0 -0
- /package/dist/{types.d.mts → src/types.d.mts} +0 -0
- /package/dist/{utils → src/utils}/check-exclude-filepath.cjs +0 -0
- /package/dist/{utils → src/utils}/check-exclude-filepath.d.cts +0 -0
- /package/dist/{utils → src/utils}/check-exclude-filepath.d.mts +0 -0
- /package/dist/{utils → src/utils}/check-exclude-filepath.mjs +0 -0
- /package/dist/{utils → src/utils}/format-file-size.cjs +0 -0
- /package/dist/{utils → src/utils}/format-file-size.mjs +0 -0
- /package/dist/{utils → src/utils}/omit.cjs +0 -0
- /package/dist/{utils → src/utils}/omit.mjs +0 -0
- /package/dist/{utils → src/utils}/round.cjs +0 -0
- /package/dist/{utils → src/utils}/round.mjs +0 -0
- /package/dist/{write.d.cts → src/write.d.cts} +0 -0
- /package/dist/{write.d.mts → src/write.d.mts} +0 -0
- /package/dist/{write.mjs → src/write.mjs} +0 -0
package/dist/extract.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const require_omit = require('./utils/omit.cjs');
|
|
2
|
-
const require_check_exclude_filepath = require('./utils/check-exclude-filepath.cjs');
|
|
1
|
+
const require_omit = require('./src/utils/omit.cjs');
|
|
2
|
+
const require_check_exclude_filepath = require('./src/utils/check-exclude-filepath.cjs');
|
|
3
3
|
|
|
4
4
|
//#region src/extract.ts
|
|
5
5
|
/**
|
package/dist/extract.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ExcludeFilepathPatterns } from "./utils/check-exclude-filepath.cjs";
|
|
1
|
+
import { ExcludeFilepathPatterns } from "./src/utils/check-exclude-filepath.cjs";
|
|
2
2
|
import { OutputAsset, OutputBundle, OutputChunk, RenderedModule } from "rollup";
|
|
3
3
|
|
|
4
4
|
//#region src/extract.d.ts
|
package/dist/extract.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ExcludeFilepathPatterns } from "./utils/check-exclude-filepath.mjs";
|
|
1
|
+
import { ExcludeFilepathPatterns } from "./src/utils/check-exclude-filepath.mjs";
|
|
2
2
|
import { OutputAsset, OutputBundle, OutputChunk, RenderedModule } from "rollup";
|
|
3
3
|
|
|
4
4
|
//#region src/extract.d.ts
|
package/dist/extract.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { omit } from "./utils/omit.mjs";
|
|
2
|
-
import { checkExcludeFilepath } from "./utils/check-exclude-filepath.mjs";
|
|
1
|
+
import { omit } from "./src/utils/omit.mjs";
|
|
2
|
+
import { checkExcludeFilepath } from "./src/utils/check-exclude-filepath.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/extract.ts
|
|
5
5
|
/**
|
package/dist/index.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const require_runtime = require('./_virtual/_rolldown/runtime.cjs');
|
|
2
2
|
const require_extract = require('./extract.cjs');
|
|
3
|
-
const require_write = require('./write.cjs');
|
|
4
|
-
const require_format_file_size = require('./utils/format-file-size.cjs');
|
|
3
|
+
const require_write = require('./src/write.cjs');
|
|
4
|
+
const require_format_file_size = require('./src/utils/format-file-size.cjs');
|
|
5
5
|
let node_path = require("node:path");
|
|
6
6
|
node_path = require_runtime.__toESM(node_path);
|
|
7
7
|
let node_process = require("node:process");
|
package/dist/index.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { StatsOptions } from "./extract.cjs";
|
|
2
|
-
import { RollupStatsWrite } from "./write.cjs";
|
|
3
|
-
import { OutputOptions, Plugin } from "./types.cjs";
|
|
2
|
+
import { RollupStatsWrite } from "./src/write.cjs";
|
|
3
|
+
import { OutputOptions, Plugin } from "./src/types.cjs";
|
|
4
4
|
|
|
5
5
|
//#region src/index.d.ts
|
|
6
6
|
type RollupStatsOptions = {
|
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { StatsOptions } from "./extract.mjs";
|
|
2
|
-
import { RollupStatsWrite } from "./write.mjs";
|
|
3
|
-
import { OutputOptions, Plugin } from "./types.mjs";
|
|
2
|
+
import { RollupStatsWrite } from "./src/write.mjs";
|
|
3
|
+
import { OutputOptions, Plugin } from "./src/types.mjs";
|
|
4
4
|
|
|
5
5
|
//#region src/index.d.ts
|
|
6
6
|
type RollupStatsOptions = {
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import extractRollupStats from "./extract.mjs";
|
|
2
|
-
import { rollupStatsWrite } from "./write.mjs";
|
|
3
|
-
import { formatFileSize } from "./utils/format-file-size.mjs";
|
|
2
|
+
import { rollupStatsWrite } from "./src/write.mjs";
|
|
3
|
+
import { formatFileSize } from "./src/utils/format-file-size.mjs";
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
import process from "node:process";
|
|
6
6
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.cts","names":[],"sources":["../../src/types.ts"],"mappings":";;;;KAOY,QAAA,GAAS,QAAA,GAAa,MAAA;AAAA,KACtB,eAAA,GAAgB,aAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.mts","names":[],"sources":["../../src/types.ts"],"mappings":";;;;KAOY,QAAA,GAAS,QAAA,GAAa,MAAA;AAAA,KACtB,eAAA,GAAgB,aAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check-exclude-filepath.cjs","names":[],"sources":["../../../src/utils/check-exclude-filepath.ts"],"sourcesContent":["type ExcludeFilepathParam = string | RegExp | ((filepath: string) => boolean);\n\nexport type ExcludeFilepathPatterns =\n | ExcludeFilepathParam\n | Array<ExcludeFilepathParam>;\n\n/**\n * Check if filepath should be excluded based on patterns\n */\nexport function checkExcludeFilepath(\n filepath: string,\n patterns?: ExcludeFilepathPatterns\n): boolean {\n if (!patterns) {\n return false;\n }\n\n if (Array.isArray(patterns)) {\n let res = false;\n\n for (let i = 0; i <= patterns.length - 1 && res === false; i++) {\n res = checkExcludeFilepath(filepath, patterns[i]);\n }\n\n return res;\n }\n\n if (typeof patterns === 'function') {\n return patterns(filepath);\n }\n\n if (typeof patterns === 'string') {\n return Boolean(filepath.match(patterns));\n }\n\n if ('test' in patterns) {\n return patterns.test(filepath);\n }\n\n return false;\n}\n"],"mappings":";;;;;AASA,SAAgB,qBACd,UACA,UACS;AACT,KAAI,CAAC,SACH,QAAO;AAGT,KAAI,MAAM,QAAQ,SAAS,EAAE;EAC3B,IAAI,MAAM;AAEV,OAAK,IAAI,IAAI,GAAG,KAAK,SAAS,SAAS,KAAK,QAAQ,OAAO,IACzD,OAAM,qBAAqB,UAAU,SAAS,GAAG;AAGnD,SAAO;;AAGT,KAAI,OAAO,aAAa,WACtB,QAAO,SAAS,SAAS;AAG3B,KAAI,OAAO,aAAa,SACtB,QAAO,QAAQ,SAAS,MAAM,SAAS,CAAC;AAG1C,KAAI,UAAU,SACZ,QAAO,SAAS,KAAK,SAAS;AAGhC,QAAO"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check-exclude-filepath.d.cts","names":[],"sources":["../../../src/utils/check-exclude-filepath.ts"],"mappings":";KAAK,oBAAA,YAAgC,MAAA,KAAW,QAAA;AAAA,KAEpC,uBAAA,GACR,oBAAA,GACA,KAAA,CAAM,oBAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check-exclude-filepath.d.mts","names":[],"sources":["../../../src/utils/check-exclude-filepath.ts"],"mappings":";KAAK,oBAAA,YAAgC,MAAA,KAAW,QAAA;AAAA,KAEpC,uBAAA,GACR,oBAAA,GACA,KAAA,CAAM,oBAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check-exclude-filepath.mjs","names":[],"sources":["../../../src/utils/check-exclude-filepath.ts"],"sourcesContent":["type ExcludeFilepathParam = string | RegExp | ((filepath: string) => boolean);\n\nexport type ExcludeFilepathPatterns =\n | ExcludeFilepathParam\n | Array<ExcludeFilepathParam>;\n\n/**\n * Check if filepath should be excluded based on patterns\n */\nexport function checkExcludeFilepath(\n filepath: string,\n patterns?: ExcludeFilepathPatterns\n): boolean {\n if (!patterns) {\n return false;\n }\n\n if (Array.isArray(patterns)) {\n let res = false;\n\n for (let i = 0; i <= patterns.length - 1 && res === false; i++) {\n res = checkExcludeFilepath(filepath, patterns[i]);\n }\n\n return res;\n }\n\n if (typeof patterns === 'function') {\n return patterns(filepath);\n }\n\n if (typeof patterns === 'string') {\n return Boolean(filepath.match(patterns));\n }\n\n if ('test' in patterns) {\n return patterns.test(filepath);\n }\n\n return false;\n}\n"],"mappings":";;;;AASA,SAAgB,qBACd,UACA,UACS;AACT,KAAI,CAAC,SACH,QAAO;AAGT,KAAI,MAAM,QAAQ,SAAS,EAAE;EAC3B,IAAI,MAAM;AAEV,OAAK,IAAI,IAAI,GAAG,KAAK,SAAS,SAAS,KAAK,QAAQ,OAAO,IACzD,OAAM,qBAAqB,UAAU,SAAS,GAAG;AAGnD,SAAO;;AAGT,KAAI,OAAO,aAAa,WACtB,QAAO,SAAS,SAAS;AAG3B,KAAI,OAAO,aAAa,SACtB,QAAO,QAAQ,SAAS,MAAM,SAAS,CAAC;AAG1C,KAAI,UAAU,SACZ,QAAO,SAAS,KAAK,SAAS;AAGhC,QAAO"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format-file-size.cjs","names":["round"],"sources":["../../../src/utils/format-file-size.ts"],"sourcesContent":["import { round } from './round';\n\nconst FILE_SIZE = {\n BYTE: {\n symbol: 'B',\n multiplier: 1,\n },\n KILO: {\n symbol: 'KiB',\n multiplier: 1024,\n },\n MEGA: {\n symbol: 'MiB',\n multiplier: 1024 * 1024,\n },\n};\n\nexport function formatFileSize(value?: number | null): string {\n let unit = FILE_SIZE.BYTE;\n\n if (typeof value !== 'number') {\n return `0${unit.symbol}`;\n }\n\n if (value < FILE_SIZE.KILO.multiplier) {\n unit = FILE_SIZE.BYTE;\n } else if (value < FILE_SIZE.MEGA.multiplier) {\n unit = FILE_SIZE.KILO;\n } else {\n unit = FILE_SIZE.MEGA;\n }\n\n return `${round(value / unit.multiplier, 2)}${unit.symbol}`;\n}\n"],"mappings":";;;AAEA,MAAM,YAAY;CAChB,MAAM;EACJ,QAAQ;EACR,YAAY;EACb;CACD,MAAM;EACJ,QAAQ;EACR,YAAY;EACb;CACD,MAAM;EACJ,QAAQ;EACR,YAAY,OAAO;EACpB;CACF;AAED,SAAgB,eAAe,OAA+B;CAC5D,IAAI,OAAO,UAAU;AAErB,KAAI,OAAO,UAAU,SACnB,QAAO,IAAI,KAAK;AAGlB,KAAI,QAAQ,UAAU,KAAK,WACzB,QAAO,UAAU;UACR,QAAQ,UAAU,KAAK,WAChC,QAAO,UAAU;KAEjB,QAAO,UAAU;AAGnB,QAAO,GAAGA,oBAAM,QAAQ,KAAK,YAAY,EAAE,GAAG,KAAK"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format-file-size.mjs","names":[],"sources":["../../../src/utils/format-file-size.ts"],"sourcesContent":["import { round } from './round';\n\nconst FILE_SIZE = {\n BYTE: {\n symbol: 'B',\n multiplier: 1,\n },\n KILO: {\n symbol: 'KiB',\n multiplier: 1024,\n },\n MEGA: {\n symbol: 'MiB',\n multiplier: 1024 * 1024,\n },\n};\n\nexport function formatFileSize(value?: number | null): string {\n let unit = FILE_SIZE.BYTE;\n\n if (typeof value !== 'number') {\n return `0${unit.symbol}`;\n }\n\n if (value < FILE_SIZE.KILO.multiplier) {\n unit = FILE_SIZE.BYTE;\n } else if (value < FILE_SIZE.MEGA.multiplier) {\n unit = FILE_SIZE.KILO;\n } else {\n unit = FILE_SIZE.MEGA;\n }\n\n return `${round(value / unit.multiplier, 2)}${unit.symbol}`;\n}\n"],"mappings":";;;AAEA,MAAM,YAAY;CAChB,MAAM;EACJ,QAAQ;EACR,YAAY;EACb;CACD,MAAM;EACJ,QAAQ;EACR,YAAY;EACb;CACD,MAAM;EACJ,QAAQ;EACR,YAAY,OAAO;EACpB;CACF;AAED,SAAgB,eAAe,OAA+B;CAC5D,IAAI,OAAO,UAAU;AAErB,KAAI,OAAO,UAAU,SACnB,QAAO,IAAI,KAAK;AAGlB,KAAI,QAAQ,UAAU,KAAK,WACzB,QAAO,UAAU;UACR,QAAQ,UAAU,KAAK,WAChC,QAAO,UAAU;KAEjB,QAAO,UAAU;AAGnB,QAAO,GAAG,MAAM,QAAQ,KAAK,YAAY,EAAE,GAAG,KAAK"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"omit.cjs","names":[],"sources":["../../../src/utils/omit.ts"],"sourcesContent":["export function omit<D extends object, K extends keyof D = keyof D>(\n data: D,\n keys: K[]\n): Omit<D, K> {\n const result = {} as D;\n const objectKeys = Object.keys(data) as Array<K>;\n\n objectKeys.forEach((key) => {\n if (!keys.includes(key)) {\n result[key] = data[key];\n }\n });\n\n return result;\n}\n"],"mappings":";;AAAA,SAAgB,KACd,MACA,MACY;CACZ,MAAM,SAAS,EAAE;AAGjB,CAFmB,OAAO,KAAK,KAAK,CAEzB,SAAS,QAAQ;AAC1B,MAAI,CAAC,KAAK,SAAS,IAAI,CACrB,QAAO,OAAO,KAAK;GAErB;AAEF,QAAO"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"omit.mjs","names":[],"sources":["../../../src/utils/omit.ts"],"sourcesContent":["export function omit<D extends object, K extends keyof D = keyof D>(\n data: D,\n keys: K[]\n): Omit<D, K> {\n const result = {} as D;\n const objectKeys = Object.keys(data) as Array<K>;\n\n objectKeys.forEach((key) => {\n if (!keys.includes(key)) {\n result[key] = data[key];\n }\n });\n\n return result;\n}\n"],"mappings":";AAAA,SAAgB,KACd,MACA,MACY;CACZ,MAAM,SAAS,EAAE;AAGjB,CAFmB,OAAO,KAAK,KAAK,CAEzB,SAAS,QAAQ;AAC1B,MAAI,CAAC,KAAK,SAAS,IAAI,CACrB,QAAO,OAAO,KAAK;GAErB;AAEF,QAAO"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"round.cjs","names":[],"sources":["../../../src/utils/round.ts"],"sourcesContent":["export function round(value: number, precision = 2): number {\n const multiplier = 10 ** precision;\n return Math.round(value * multiplier) / multiplier;\n}\n"],"mappings":";;AAAA,SAAgB,MAAM,OAAe,YAAY,GAAW;CAC1D,MAAM,aAAa,MAAM;AACzB,QAAO,KAAK,MAAM,QAAQ,WAAW,GAAG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"round.mjs","names":[],"sources":["../../../src/utils/round.ts"],"sourcesContent":["export function round(value: number, precision = 2): number {\n const multiplier = 10 ** precision;\n return Math.round(value * multiplier) / multiplier;\n}\n"],"mappings":";AAAA,SAAgB,MAAM,OAAe,YAAY,GAAW;CAC1D,MAAM,aAAa,MAAM;AACzB,QAAO,KAAK,MAAM,QAAQ,WAAW,GAAG"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_runtime = require('
|
|
1
|
+
const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
|
|
2
2
|
let node_path = require("node:path");
|
|
3
3
|
node_path = require_runtime.__toESM(node_path);
|
|
4
4
|
let node_fs_promises = require("node:fs/promises");
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"write.cjs","names":["fs","path"],"sources":["../../src/write.ts"],"sourcesContent":["import path from 'node:path';\nimport fs from 'node:fs/promises';\n\nexport type RollupStatsWriteResponse = {\n filepath: string;\n content: string;\n};\n\nexport type RollupStatsWrite = (\n filepath: string,\n stats: Record<string, unknown>\n) => RollupStatsWriteResponse;\n\nexport async function rollupStatsWrite<\n T extends Record<string, unknown> = Record<string, unknown>,\n>(filepath: string, stats: T): Promise<RollupStatsWriteResponse> {\n const content = JSON.stringify(stats, null, 2);\n\n // Create base directory if it does not exist\n await fs.mkdir(path.dirname(filepath), { recursive: true });\n\n await fs.writeFile(filepath, content);\n\n return {\n filepath,\n content,\n };\n}\n"],"mappings":";;;;;;;AAaA,eAAsB,iBAEpB,UAAkB,OAA6C;CAC/D,MAAM,UAAU,KAAK,UAAU,OAAO,MAAM,EAAE;AAG9C,OAAMA,yBAAG,MAAMC,kBAAK,QAAQ,SAAS,EAAE,EAAE,WAAW,MAAM,CAAC;AAE3D,OAAMD,yBAAG,UAAU,UAAU,QAAQ;AAErC,QAAO;EACL;EACA;EACD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"write.d.cts","names":[],"sources":["../../src/write.ts"],"mappings":";KAGY,wBAAA;EACV,QAAA;EACA,OAAA;AAAA;AAAA,KAGU,gBAAA,IACV,QAAA,UACA,KAAA,EAAO,MAAA,sBACJ,wBAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"write.d.mts","names":[],"sources":["../../src/write.ts"],"mappings":";KAGY,wBAAA;EACV,QAAA;EACA,OAAA;AAAA;AAAA,KAGU,gBAAA,IACV,QAAA,UACA,KAAA,EAAO,MAAA,sBACJ,wBAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"write.mjs","names":[],"sources":["../../src/write.ts"],"sourcesContent":["import path from 'node:path';\nimport fs from 'node:fs/promises';\n\nexport type RollupStatsWriteResponse = {\n filepath: string;\n content: string;\n};\n\nexport type RollupStatsWrite = (\n filepath: string,\n stats: Record<string, unknown>\n) => RollupStatsWriteResponse;\n\nexport async function rollupStatsWrite<\n T extends Record<string, unknown> = Record<string, unknown>,\n>(filepath: string, stats: T): Promise<RollupStatsWriteResponse> {\n const content = JSON.stringify(stats, null, 2);\n\n // Create base directory if it does not exist\n await fs.mkdir(path.dirname(filepath), { recursive: true });\n\n await fs.writeFile(filepath, content);\n\n return {\n filepath,\n content,\n };\n}\n"],"mappings":";;;;AAaA,eAAsB,iBAEpB,UAAkB,OAA6C;CAC/D,MAAM,UAAU,KAAK,UAAU,OAAO,MAAM,EAAE;AAG9C,OAAM,GAAG,MAAM,KAAK,QAAQ,SAAS,EAAE,EAAE,WAAW,MAAM,CAAC;AAE3D,OAAM,GAAG,UAAU,UAAU,QAAQ;AAErC,QAAO;EACL;EACA;EACD"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rollup-plugin-stats",
|
|
3
3
|
"description": "Vite/Rolldown/Rollup plugin to generate bundle stats JSON file",
|
|
4
|
-
"version": "2.0.0",
|
|
4
|
+
"version": "2.1.0-beta.0",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"private": false,
|
|
7
7
|
"repository": {
|
|
@@ -73,30 +73,30 @@
|
|
|
73
73
|
},
|
|
74
74
|
"devDependencies": {
|
|
75
75
|
"@eslint/js": "10.0.1",
|
|
76
|
-
"@release-it/conventional-changelog": "10.0.
|
|
76
|
+
"@release-it/conventional-changelog": "10.0.6",
|
|
77
77
|
"@types/deep-freeze-strict": "1.1.2",
|
|
78
|
-
"@types/node": "25.
|
|
78
|
+
"@types/node": "25.5.0",
|
|
79
79
|
"deep-freeze-strict": "1.1.1",
|
|
80
|
-
"eslint": "10.0.
|
|
80
|
+
"eslint": "10.0.3",
|
|
81
81
|
"eslint-config-prettier": "10.1.8",
|
|
82
82
|
"globals": "17.4.0",
|
|
83
83
|
"husky": "9.1.7",
|
|
84
|
-
"lint-staged": "16.3.
|
|
85
|
-
"memfs": "4.56.
|
|
84
|
+
"lint-staged": "16.3.3",
|
|
85
|
+
"memfs": "4.56.11",
|
|
86
86
|
"prettier": "3.8.1",
|
|
87
87
|
"release-it": "19.2.4",
|
|
88
88
|
"rimraf": "6.1.3",
|
|
89
89
|
"rollup": "4.59.0",
|
|
90
|
-
"tsdown": "0.
|
|
90
|
+
"tsdown": "0.21.2",
|
|
91
91
|
"typescript": "5.9.3",
|
|
92
|
-
"typescript-eslint": "8.
|
|
92
|
+
"typescript-eslint": "8.57.0",
|
|
93
93
|
"vite": "7.3.1",
|
|
94
|
-
"vitest": "4.0
|
|
94
|
+
"vitest": "4.1.0"
|
|
95
95
|
},
|
|
96
96
|
"peerDependencies": {
|
|
97
97
|
"rolldown": "^1.0.0-beta.0",
|
|
98
98
|
"rollup": "^3.0.0 || ^4.0.0",
|
|
99
|
-
"vite": "^5.0.0 || ^6.0.0 || ^7.0.0"
|
|
99
|
+
"vite": "^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0"
|
|
100
100
|
},
|
|
101
101
|
"peerDependenciesMeta": {
|
|
102
102
|
"vite": {
|
package/dist/types.d.cts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.cts","names":[],"sources":["../src/types.ts"],"mappings":";;;;KAOY,QAAA,GAAS,QAAA,GAAa,MAAA;AAAA,KACtB,eAAA,GAAgB,aAAA"}
|
package/dist/types.d.mts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.mts","names":[],"sources":["../src/types.ts"],"mappings":";;;;KAOY,QAAA,GAAS,QAAA,GAAa,MAAA;AAAA,KACtB,eAAA,GAAgB,aAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"check-exclude-filepath.cjs","names":[],"sources":["../../src/utils/check-exclude-filepath.ts"],"sourcesContent":["type ExcludeFilepathParam = string | RegExp | ((filepath: string) => boolean);\n\nexport type ExcludeFilepathPatterns =\n | ExcludeFilepathParam\n | Array<ExcludeFilepathParam>;\n\n/**\n * Check if filepath should be excluded based on patterns\n */\nexport function checkExcludeFilepath(\n filepath: string,\n patterns?: ExcludeFilepathPatterns\n): boolean {\n if (!patterns) {\n return false;\n }\n\n if (Array.isArray(patterns)) {\n let res = false;\n\n for (let i = 0; i <= patterns.length - 1 && res === false; i++) {\n res = checkExcludeFilepath(filepath, patterns[i]);\n }\n\n return res;\n }\n\n if (typeof patterns === 'function') {\n return patterns(filepath);\n }\n\n if (typeof patterns === 'string') {\n return Boolean(filepath.match(patterns));\n }\n\n if ('test' in patterns) {\n return patterns.test(filepath);\n }\n\n return false;\n}\n"],"mappings":";;;;;AASA,SAAgB,qBACd,UACA,UACS;AACT,KAAI,CAAC,SACH,QAAO;AAGT,KAAI,MAAM,QAAQ,SAAS,EAAE;EAC3B,IAAI,MAAM;AAEV,OAAK,IAAI,IAAI,GAAG,KAAK,SAAS,SAAS,KAAK,QAAQ,OAAO,IACzD,OAAM,qBAAqB,UAAU,SAAS,GAAG;AAGnD,SAAO;;AAGT,KAAI,OAAO,aAAa,WACtB,QAAO,SAAS,SAAS;AAG3B,KAAI,OAAO,aAAa,SACtB,QAAO,QAAQ,SAAS,MAAM,SAAS,CAAC;AAG1C,KAAI,UAAU,SACZ,QAAO,SAAS,KAAK,SAAS;AAGhC,QAAO"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"check-exclude-filepath.d.cts","names":[],"sources":["../../src/utils/check-exclude-filepath.ts"],"mappings":";KAAK,oBAAA,YAAgC,MAAA,KAAW,QAAA;AAAA,KAEpC,uBAAA,GACR,oBAAA,GACA,KAAA,CAAM,oBAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"check-exclude-filepath.d.mts","names":[],"sources":["../../src/utils/check-exclude-filepath.ts"],"mappings":";KAAK,oBAAA,YAAgC,MAAA,KAAW,QAAA;AAAA,KAEpC,uBAAA,GACR,oBAAA,GACA,KAAA,CAAM,oBAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"check-exclude-filepath.mjs","names":[],"sources":["../../src/utils/check-exclude-filepath.ts"],"sourcesContent":["type ExcludeFilepathParam = string | RegExp | ((filepath: string) => boolean);\n\nexport type ExcludeFilepathPatterns =\n | ExcludeFilepathParam\n | Array<ExcludeFilepathParam>;\n\n/**\n * Check if filepath should be excluded based on patterns\n */\nexport function checkExcludeFilepath(\n filepath: string,\n patterns?: ExcludeFilepathPatterns\n): boolean {\n if (!patterns) {\n return false;\n }\n\n if (Array.isArray(patterns)) {\n let res = false;\n\n for (let i = 0; i <= patterns.length - 1 && res === false; i++) {\n res = checkExcludeFilepath(filepath, patterns[i]);\n }\n\n return res;\n }\n\n if (typeof patterns === 'function') {\n return patterns(filepath);\n }\n\n if (typeof patterns === 'string') {\n return Boolean(filepath.match(patterns));\n }\n\n if ('test' in patterns) {\n return patterns.test(filepath);\n }\n\n return false;\n}\n"],"mappings":";;;;AASA,SAAgB,qBACd,UACA,UACS;AACT,KAAI,CAAC,SACH,QAAO;AAGT,KAAI,MAAM,QAAQ,SAAS,EAAE;EAC3B,IAAI,MAAM;AAEV,OAAK,IAAI,IAAI,GAAG,KAAK,SAAS,SAAS,KAAK,QAAQ,OAAO,IACzD,OAAM,qBAAqB,UAAU,SAAS,GAAG;AAGnD,SAAO;;AAGT,KAAI,OAAO,aAAa,WACtB,QAAO,SAAS,SAAS;AAG3B,KAAI,OAAO,aAAa,SACtB,QAAO,QAAQ,SAAS,MAAM,SAAS,CAAC;AAG1C,KAAI,UAAU,SACZ,QAAO,SAAS,KAAK,SAAS;AAGhC,QAAO"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"format-file-size.cjs","names":["round"],"sources":["../../src/utils/format-file-size.ts"],"sourcesContent":["import { round } from './round';\n\nconst FILE_SIZE = {\n BYTE: {\n symbol: 'B',\n multiplier: 1,\n },\n KILO: {\n symbol: 'KiB',\n multiplier: 1024,\n },\n MEGA: {\n symbol: 'MiB',\n multiplier: 1024 * 1024,\n },\n};\n\nexport function formatFileSize(value?: number | null): string {\n let unit = FILE_SIZE.BYTE;\n\n if (typeof value !== 'number') {\n return `0${unit.symbol}`;\n }\n\n if (value < FILE_SIZE.KILO.multiplier) {\n unit = FILE_SIZE.BYTE;\n } else if (value < FILE_SIZE.MEGA.multiplier) {\n unit = FILE_SIZE.KILO;\n } else {\n unit = FILE_SIZE.MEGA;\n }\n\n return `${round(value / unit.multiplier, 2)}${unit.symbol}`;\n}\n"],"mappings":";;;AAEA,MAAM,YAAY;CAChB,MAAM;EACJ,QAAQ;EACR,YAAY;EACb;CACD,MAAM;EACJ,QAAQ;EACR,YAAY;EACb;CACD,MAAM;EACJ,QAAQ;EACR,YAAY,OAAO;EACpB;CACF;AAED,SAAgB,eAAe,OAA+B;CAC5D,IAAI,OAAO,UAAU;AAErB,KAAI,OAAO,UAAU,SACnB,QAAO,IAAI,KAAK;AAGlB,KAAI,QAAQ,UAAU,KAAK,WACzB,QAAO,UAAU;UACR,QAAQ,UAAU,KAAK,WAChC,QAAO,UAAU;KAEjB,QAAO,UAAU;AAGnB,QAAO,GAAGA,oBAAM,QAAQ,KAAK,YAAY,EAAE,GAAG,KAAK"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"format-file-size.mjs","names":[],"sources":["../../src/utils/format-file-size.ts"],"sourcesContent":["import { round } from './round';\n\nconst FILE_SIZE = {\n BYTE: {\n symbol: 'B',\n multiplier: 1,\n },\n KILO: {\n symbol: 'KiB',\n multiplier: 1024,\n },\n MEGA: {\n symbol: 'MiB',\n multiplier: 1024 * 1024,\n },\n};\n\nexport function formatFileSize(value?: number | null): string {\n let unit = FILE_SIZE.BYTE;\n\n if (typeof value !== 'number') {\n return `0${unit.symbol}`;\n }\n\n if (value < FILE_SIZE.KILO.multiplier) {\n unit = FILE_SIZE.BYTE;\n } else if (value < FILE_SIZE.MEGA.multiplier) {\n unit = FILE_SIZE.KILO;\n } else {\n unit = FILE_SIZE.MEGA;\n }\n\n return `${round(value / unit.multiplier, 2)}${unit.symbol}`;\n}\n"],"mappings":";;;AAEA,MAAM,YAAY;CAChB,MAAM;EACJ,QAAQ;EACR,YAAY;EACb;CACD,MAAM;EACJ,QAAQ;EACR,YAAY;EACb;CACD,MAAM;EACJ,QAAQ;EACR,YAAY,OAAO;EACpB;CACF;AAED,SAAgB,eAAe,OAA+B;CAC5D,IAAI,OAAO,UAAU;AAErB,KAAI,OAAO,UAAU,SACnB,QAAO,IAAI,KAAK;AAGlB,KAAI,QAAQ,UAAU,KAAK,WACzB,QAAO,UAAU;UACR,QAAQ,UAAU,KAAK,WAChC,QAAO,UAAU;KAEjB,QAAO,UAAU;AAGnB,QAAO,GAAG,MAAM,QAAQ,KAAK,YAAY,EAAE,GAAG,KAAK"}
|
package/dist/utils/omit.cjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"omit.cjs","names":[],"sources":["../../src/utils/omit.ts"],"sourcesContent":["export function omit<D extends object, K extends keyof D = keyof D>(\n data: D,\n keys: K[]\n): Omit<D, K> {\n const result = {} as D;\n const objectKeys = Object.keys(data) as Array<K>;\n\n objectKeys.forEach((key) => {\n if (!keys.includes(key)) {\n result[key] = data[key];\n }\n });\n\n return result;\n}\n"],"mappings":";;AAAA,SAAgB,KACd,MACA,MACY;CACZ,MAAM,SAAS,EAAE;AAGjB,CAFmB,OAAO,KAAK,KAAK,CAEzB,SAAS,QAAQ;AAC1B,MAAI,CAAC,KAAK,SAAS,IAAI,CACrB,QAAO,OAAO,KAAK;GAErB;AAEF,QAAO"}
|
package/dist/utils/omit.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"omit.mjs","names":[],"sources":["../../src/utils/omit.ts"],"sourcesContent":["export function omit<D extends object, K extends keyof D = keyof D>(\n data: D,\n keys: K[]\n): Omit<D, K> {\n const result = {} as D;\n const objectKeys = Object.keys(data) as Array<K>;\n\n objectKeys.forEach((key) => {\n if (!keys.includes(key)) {\n result[key] = data[key];\n }\n });\n\n return result;\n}\n"],"mappings":";AAAA,SAAgB,KACd,MACA,MACY;CACZ,MAAM,SAAS,EAAE;AAGjB,CAFmB,OAAO,KAAK,KAAK,CAEzB,SAAS,QAAQ;AAC1B,MAAI,CAAC,KAAK,SAAS,IAAI,CACrB,QAAO,OAAO,KAAK;GAErB;AAEF,QAAO"}
|
package/dist/utils/round.cjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"round.cjs","names":[],"sources":["../../src/utils/round.ts"],"sourcesContent":["export function round(value: number, precision = 2): number {\n const multiplier = 10 ** precision;\n return Math.round(value * multiplier) / multiplier;\n}\n"],"mappings":";;AAAA,SAAgB,MAAM,OAAe,YAAY,GAAW;CAC1D,MAAM,aAAa,MAAM;AACzB,QAAO,KAAK,MAAM,QAAQ,WAAW,GAAG"}
|
package/dist/utils/round.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"round.mjs","names":[],"sources":["../../src/utils/round.ts"],"sourcesContent":["export function round(value: number, precision = 2): number {\n const multiplier = 10 ** precision;\n return Math.round(value * multiplier) / multiplier;\n}\n"],"mappings":";AAAA,SAAgB,MAAM,OAAe,YAAY,GAAW;CAC1D,MAAM,aAAa,MAAM;AACzB,QAAO,KAAK,MAAM,QAAQ,WAAW,GAAG"}
|
package/dist/write.cjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"write.cjs","names":["fs","path"],"sources":["../src/write.ts"],"sourcesContent":["import path from 'node:path';\nimport fs from 'node:fs/promises';\n\nexport type RollupStatsWriteResponse = {\n filepath: string;\n content: string;\n};\n\nexport type RollupStatsWrite = (\n filepath: string,\n stats: Record<string, unknown>\n) => RollupStatsWriteResponse;\n\nexport async function rollupStatsWrite<\n T extends Record<string, unknown> = Record<string, unknown>,\n>(filepath: string, stats: T): Promise<RollupStatsWriteResponse> {\n const content = JSON.stringify(stats, null, 2);\n\n // Create base directory if it does not exist\n await fs.mkdir(path.dirname(filepath), { recursive: true });\n\n await fs.writeFile(filepath, content);\n\n return {\n filepath,\n content,\n };\n}\n"],"mappings":";;;;;;;AAaA,eAAsB,iBAEpB,UAAkB,OAA6C;CAC/D,MAAM,UAAU,KAAK,UAAU,OAAO,MAAM,EAAE;AAG9C,OAAMA,yBAAG,MAAMC,kBAAK,QAAQ,SAAS,EAAE,EAAE,WAAW,MAAM,CAAC;AAE3D,OAAMD,yBAAG,UAAU,UAAU,QAAQ;AAErC,QAAO;EACL;EACA;EACD"}
|
package/dist/write.d.cts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"write.d.cts","names":[],"sources":["../src/write.ts"],"mappings":";KAGY,wBAAA;EACV,QAAA;EACA,OAAA;AAAA;AAAA,KAGU,gBAAA,IACV,QAAA,UACA,KAAA,EAAO,MAAA,sBACJ,wBAAA"}
|
package/dist/write.d.mts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"write.d.mts","names":[],"sources":["../src/write.ts"],"mappings":";KAGY,wBAAA;EACV,QAAA;EACA,OAAA;AAAA;AAAA,KAGU,gBAAA,IACV,QAAA,UACA,KAAA,EAAO,MAAA,sBACJ,wBAAA"}
|
package/dist/write.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"write.mjs","names":[],"sources":["../src/write.ts"],"sourcesContent":["import path from 'node:path';\nimport fs from 'node:fs/promises';\n\nexport type RollupStatsWriteResponse = {\n filepath: string;\n content: string;\n};\n\nexport type RollupStatsWrite = (\n filepath: string,\n stats: Record<string, unknown>\n) => RollupStatsWriteResponse;\n\nexport async function rollupStatsWrite<\n T extends Record<string, unknown> = Record<string, unknown>,\n>(filepath: string, stats: T): Promise<RollupStatsWriteResponse> {\n const content = JSON.stringify(stats, null, 2);\n\n // Create base directory if it does not exist\n await fs.mkdir(path.dirname(filepath), { recursive: true });\n\n await fs.writeFile(filepath, content);\n\n return {\n filepath,\n content,\n };\n}\n"],"mappings":";;;;AAaA,eAAsB,iBAEpB,UAAkB,OAA6C;CAC/D,MAAM,UAAU,KAAK,UAAU,OAAO,MAAM,EAAE;AAG9C,OAAM,GAAG,MAAM,KAAK,QAAQ,SAAS,EAAE,EAAE,WAAW,MAAM,CAAC;AAE3D,OAAM,GAAG,UAAU,UAAU,QAAQ;AAErC,QAAO;EACL;EACA;EACD"}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|