@pnpm/cache.commands 1100.0.28 → 1100.0.29

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/CHANGELOG.md CHANGED
@@ -1,5 +1,16 @@
1
1
  # @pnpm/cache.commands
2
2
 
3
+ ## 1100.0.29
4
+
5
+ ### Patch Changes
6
+
7
+ - `pnpm cache delete` now removes a package's metadata from every metadata cache directory (`metadata`, `metadata-full`, and `metadata-full-filtered`), instead of only the one the current resolution mode reads. Previously a package cached under a different mode (e.g. `metadata-full-filtered`) was left behind. Closes pnpm/pnpm#12753.
8
+
9
+ - Updated dependencies:
10
+ - @pnpm/cache.api@1100.0.28
11
+ - @pnpm/cli.utils@1101.0.14
12
+ - @pnpm/config.reader@1101.12.0
13
+
3
14
  ## 1100.0.28
4
15
 
5
16
  ### Patch Changes
package/lib/cache.cmd.js CHANGED
@@ -2,7 +2,7 @@ import path from 'node:path';
2
2
  import { cacheDelete, cacheList, cacheListRegistries, cacheView, } from '@pnpm/cache.api';
3
3
  import { docsUrl } from '@pnpm/cli.utils';
4
4
  import { types as allTypes } from '@pnpm/config.reader';
5
- import { ABBREVIATED_META_DIR, FULL_FILTERED_META_DIR } from '@pnpm/constants';
5
+ import { ABBREVIATED_META_DIR, FULL_FILTERED_META_DIR, FULL_META_DIR } from '@pnpm/constants';
6
6
  import { PnpmError } from '@pnpm/error';
7
7
  import { getStorePath } from '@pnpm/store.path';
8
8
  import { pick } from 'ramda';
@@ -64,12 +64,16 @@ export async function handler(opts, params) {
64
64
  cacheDir,
65
65
  registry: opts.cliOptions['registry'],
66
66
  }, params.slice(1));
67
- case 'delete':
68
- return cacheDelete({
67
+ case 'delete': {
68
+ // A package's metadata can be cached under any of the metadata directories
69
+ // depending on the resolution mode used when it was fetched.
70
+ const deleted = await Promise.all([ABBREVIATED_META_DIR, FULL_META_DIR, FULL_FILTERED_META_DIR].map((metaDir) => cacheDelete({
69
71
  ...opts,
70
- cacheDir,
72
+ cacheDir: path.join(opts.cacheDir, metaDir),
71
73
  registry: opts.cliOptions['registry'],
72
- }, params.slice(1));
74
+ }, params.slice(1))));
75
+ return [...new Set(deleted.flatMap((result) => result.split('\n')).filter(Boolean))].sort().join('\n');
76
+ }
73
77
  case 'view': {
74
78
  if (!params[1]) {
75
79
  throw new PnpmError('MISSING_PACKAGE_NAME', '`pnpm cache view` requires the package name');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pnpm/cache.commands",
3
- "version": "1100.0.28",
3
+ "version": "1100.0.29",
4
4
  "description": "Commands for controlling the cache",
5
5
  "keywords": [
6
6
  "pnpm",
@@ -28,9 +28,9 @@
28
28
  "!*.map"
29
29
  ],
30
30
  "dependencies": {
31
- "@pnpm/cache.api": "1100.0.27",
32
- "@pnpm/cli.utils": "1101.0.13",
33
- "@pnpm/config.reader": "1101.11.2",
31
+ "@pnpm/cache.api": "1100.0.28",
32
+ "@pnpm/cli.utils": "1101.0.14",
33
+ "@pnpm/config.reader": "1101.12.0",
34
34
  "@pnpm/constants": "1100.0.0",
35
35
  "@pnpm/error": "1100.0.1",
36
36
  "@pnpm/store.path": "1100.0.2",
@@ -42,10 +42,10 @@
42
42
  },
43
43
  "devDependencies": {
44
44
  "@jest/globals": "30.4.1",
45
- "@pnpm/cache.commands": "1100.0.28",
45
+ "@pnpm/cache.commands": "1100.0.29",
46
46
  "@pnpm/logger": "1100.0.0",
47
- "@pnpm/prepare": "1100.0.18",
48
- "@pnpm/testing.registry-mock": "1100.0.8",
47
+ "@pnpm/prepare": "1100.0.19",
48
+ "@pnpm/testing.registry-mock": "1100.0.9",
49
49
  "@types/ramda": "0.31.1",
50
50
  "@zkochan/rimraf": "^4.0.0",
51
51
  "execa": "npm:safe-execa@0.3.0"