pruny 1.36.0 → 1.36.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/dist/index.js +43 -2
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -5,15 +5,29 @@ var __getProtoOf = Object.getPrototypeOf;
5
5
  var __defProp = Object.defineProperty;
6
6
  var __getOwnPropNames = Object.getOwnPropertyNames;
7
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ function __accessProp(key) {
9
+ return this[key];
10
+ }
11
+ var __toESMCache_node;
12
+ var __toESMCache_esm;
8
13
  var __toESM = (mod, isNodeMode, target) => {
14
+ var canCache = mod != null && typeof mod === "object";
15
+ if (canCache) {
16
+ var cache = isNodeMode ? __toESMCache_node ??= new WeakMap : __toESMCache_esm ??= new WeakMap;
17
+ var cached = cache.get(mod);
18
+ if (cached)
19
+ return cached;
20
+ }
9
21
  target = mod != null ? __create(__getProtoOf(mod)) : {};
10
22
  const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
11
23
  for (let key of __getOwnPropNames(mod))
12
24
  if (!__hasOwnProp.call(to, key))
13
25
  __defProp(to, key, {
14
- get: () => mod[key],
26
+ get: __accessProp.bind(mod, key),
15
27
  enumerable: true
16
28
  });
29
+ if (canCache)
30
+ cache.set(mod, to);
17
31
  return to;
18
32
  };
19
33
  var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
@@ -16671,7 +16685,10 @@ Analyzing cascading impact...`));
16671
16685
  const dryRunReport = {
16672
16686
  uniqueFiles: new Set(targetRoutes.map((r) => r.filePath)).size,
16673
16687
  routes: [],
16674
- exports: []
16688
+ exports: [],
16689
+ files: [],
16690
+ assets: [],
16691
+ missingAssets: []
16675
16692
  };
16676
16693
  if (selected === "routes" || selected === "dry-run-json" || action === "dry-run") {
16677
16694
  dryRunReport.routes = targetRoutes.map((r) => ({
@@ -16718,6 +16735,30 @@ Analyzing cascading impact...`));
16718
16735
  }));
16719
16736
  dryRunReport.uniqueFiles = new Set(servicesList.map((m) => m.file)).size;
16720
16737
  }
16738
+ if (selected === "files") {
16739
+ const filesList = result.unusedFiles?.files || [];
16740
+ dryRunReport.files = filesList.map((f) => ({
16741
+ path: f.path,
16742
+ size: f.size
16743
+ }));
16744
+ dryRunReport.uniqueFiles = filesList.length;
16745
+ }
16746
+ if (selected === "assets") {
16747
+ const assetsList = result.publicAssets?.assets.filter((a) => !a.used) || [];
16748
+ dryRunReport.assets = assetsList.map((a) => ({
16749
+ path: a.relativePath,
16750
+ references: a.references
16751
+ }));
16752
+ dryRunReport.uniqueFiles = assetsList.length;
16753
+ }
16754
+ if (selected === "missing-assets") {
16755
+ const missingList = result.missingAssets?.assets || [];
16756
+ dryRunReport.missingAssets = missingList.map((a) => ({
16757
+ path: a.path,
16758
+ references: a.references
16759
+ }));
16760
+ dryRunReport.uniqueFiles = missingList.length;
16761
+ }
16721
16762
  const reportPath = join10(process.cwd(), "pruny-dry-run.json");
16722
16763
  writeFileSync3(reportPath, JSON.stringify(dryRunReport, null, 2));
16723
16764
  console.log(source_default.green(`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pruny",
3
- "version": "1.36.0",
3
+ "version": "1.36.1",
4
4
  "description": "Find and remove unused Next.js API routes & Nest.js Controllers",
5
5
  "type": "module",
6
6
  "files": [