@pnpm/cache.commands 1000.0.64 → 1100.0.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.
@@ -1,7 +1,7 @@
1
- import { type Config } from '@pnpm/config';
1
+ import { type Config, type ConfigContext } from '@pnpm/config.reader';
2
2
  export declare const rcOptionsTypes: typeof cliOptionsTypes;
3
3
  export declare function cliOptionsTypes(): Record<string, unknown>;
4
4
  export declare const commandNames: string[];
5
5
  export declare function help(): string;
6
- export type CacheCommandOptions = Pick<Config, 'cacheDir' | 'storeDir' | 'pnpmHomeDir' | 'cliOptions' | 'resolutionMode' | 'registrySupportsTimeField'>;
6
+ export type CacheCommandOptions = Pick<Config, 'cacheDir' | 'storeDir' | 'pnpmHomeDir' | 'resolutionMode' | 'registrySupportsTimeField'> & Pick<ConfigContext, 'cliOptions'>;
7
7
  export declare function handler(opts: CacheCommandOptions, params: string[]): Promise<string | undefined>;
package/lib/cache.cmd.js CHANGED
@@ -1,33 +1,24 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.commandNames = exports.rcOptionsTypes = void 0;
7
- exports.cliOptionsTypes = cliOptionsTypes;
8
- exports.help = help;
9
- exports.handler = handler;
10
- const path_1 = __importDefault(require("path"));
11
- const cli_utils_1 = require("@pnpm/cli-utils");
12
- const config_1 = require("@pnpm/config");
13
- const constants_1 = require("@pnpm/constants");
14
- const store_path_1 = require("@pnpm/store-path");
15
- const pick_1 = __importDefault(require("ramda/src/pick"));
16
- const render_help_1 = __importDefault(require("render-help"));
17
- const cache_api_1 = require("@pnpm/cache.api");
18
- const error_1 = require("@pnpm/error");
19
- exports.rcOptionsTypes = cliOptionsTypes;
20
- function cliOptionsTypes() {
1
+ import path from 'node:path';
2
+ import { cacheDelete, cacheList, cacheListRegistries, cacheView, } from '@pnpm/cache.api';
3
+ import { docsUrl } from '@pnpm/cli.utils';
4
+ import { types as allTypes } from '@pnpm/config.reader';
5
+ import { ABBREVIATED_META_DIR, FULL_FILTERED_META_DIR } from '@pnpm/constants';
6
+ import { PnpmError } from '@pnpm/error';
7
+ import { getStorePath } from '@pnpm/store.path';
8
+ import { pick } from 'ramda';
9
+ import { renderHelp } from 'render-help';
10
+ export const rcOptionsTypes = cliOptionsTypes;
11
+ export function cliOptionsTypes() {
21
12
  return {
22
- ...(0, pick_1.default)([
13
+ ...pick([
23
14
  'registry',
24
15
  'store-dir',
25
- ], config_1.types),
16
+ ], allTypes),
26
17
  };
27
18
  }
28
- exports.commandNames = ['cache'];
29
- function help() {
30
- return (0, render_help_1.default)({
19
+ export const commandNames = ['cache'];
20
+ export function help() {
21
+ return renderHelp({
31
22
  description: 'Inspect and manage the metadata cache',
32
23
  descriptionLists: [
33
24
  {
@@ -52,46 +43,46 @@ function help() {
52
43
  ],
53
44
  },
54
45
  ],
55
- url: (0, cli_utils_1.docsUrl)('cache'),
46
+ url: docsUrl('cache'),
56
47
  usages: ['pnpm cache <command>'],
57
48
  });
58
49
  }
59
- async function handler(opts, params) {
50
+ export async function handler(opts, params) {
60
51
  const cacheType = (opts.resolutionMode === 'time-based' && !opts.registrySupportsTimeField)
61
- ? constants_1.FULL_FILTERED_META_DIR
62
- : constants_1.ABBREVIATED_META_DIR;
63
- const cacheDir = path_1.default.join(opts.cacheDir, cacheType);
52
+ ? FULL_FILTERED_META_DIR
53
+ : ABBREVIATED_META_DIR;
54
+ const cacheDir = path.join(opts.cacheDir, cacheType);
64
55
  switch (params[0]) {
65
56
  case 'list-registries':
66
- return (0, cache_api_1.cacheListRegistries)({
57
+ return cacheListRegistries({
67
58
  ...opts,
68
59
  cacheDir,
69
60
  });
70
61
  case 'list':
71
- return (0, cache_api_1.cacheList)({
62
+ return cacheList({
72
63
  ...opts,
73
64
  cacheDir,
74
65
  registry: opts.cliOptions['registry'],
75
66
  }, params.slice(1));
76
67
  case 'delete':
77
- return (0, cache_api_1.cacheDelete)({
68
+ return cacheDelete({
78
69
  ...opts,
79
70
  cacheDir,
80
71
  registry: opts.cliOptions['registry'],
81
72
  }, params.slice(1));
82
73
  case 'view': {
83
74
  if (!params[1]) {
84
- throw new error_1.PnpmError('MISSING_PACKAGE_NAME', '`pnpm cache view` requires the package name');
75
+ throw new PnpmError('MISSING_PACKAGE_NAME', '`pnpm cache view` requires the package name');
85
76
  }
86
77
  if (params.length > 2) {
87
- throw new error_1.PnpmError('TOO_MANY_PARAMS', '`pnpm cache view` only accepts one package name');
78
+ throw new PnpmError('TOO_MANY_PARAMS', '`pnpm cache view` only accepts one package name');
88
79
  }
89
- const storeDir = await (0, store_path_1.getStorePath)({
80
+ const storeDir = await getStorePath({
90
81
  pkgRoot: process.cwd(),
91
82
  storePath: opts.storeDir,
92
83
  pnpmHomeDir: opts.pnpmHomeDir,
93
84
  });
94
- return (0, cache_api_1.cacheView)({
85
+ return cacheView({
95
86
  ...opts,
96
87
  cacheDir,
97
88
  storeDir,
package/lib/index.js CHANGED
@@ -1,29 +1,3 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.cache = void 0;
27
- const cache = __importStar(require("./cache.cmd.js"));
28
- exports.cache = cache;
1
+ import * as cache from './cache.cmd.js';
2
+ export { cache };
29
3
  //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@pnpm/cache.commands",
3
- "version": "1000.0.64",
3
+ "version": "1100.0.0",
4
4
  "description": "Commands for controlling the cache",
5
5
  "keywords": [
6
6
  "pnpm",
7
- "pnpm10",
7
+ "pnpm11",
8
8
  "cache"
9
9
  ],
10
10
  "license": "MIT",
@@ -14,7 +14,7 @@
14
14
  "bugs": {
15
15
  "url": "https://github.com/pnpm/pnpm/issues"
16
16
  },
17
- "type": "commonjs",
17
+ "type": "module",
18
18
  "main": "lib/index.js",
19
19
  "types": "lib/index.d.ts",
20
20
  "exports": {
@@ -26,36 +26,36 @@
26
26
  ],
27
27
  "dependencies": {
28
28
  "ramda": "npm:@pnpm/ramda@0.28.1",
29
- "render-help": "^1.0.3",
30
- "@pnpm/config": "1004.10.4",
31
- "@pnpm/cache.api": "1000.0.53",
32
- "@pnpm/error": "1000.0.5",
33
- "@pnpm/constants": "1001.3.1",
34
- "@pnpm/cli-utils": "1001.3.9",
35
- "@pnpm/store-path": "1000.0.5"
29
+ "render-help": "^2.0.0",
30
+ "@pnpm/cache.api": "1100.0.0",
31
+ "@pnpm/cli.utils": "1100.0.0",
32
+ "@pnpm/constants": "1100.0.0",
33
+ "@pnpm/config.reader": "1100.0.0",
34
+ "@pnpm/store.path": "1100.0.0",
35
+ "@pnpm/error": "1100.0.0"
36
36
  },
37
37
  "peerDependencies": {
38
- "@pnpm/logger": "^1001.0.1"
38
+ "@pnpm/logger": ">=1001.0.0 <1002.0.0"
39
39
  },
40
40
  "devDependencies": {
41
- "@pnpm/registry-mock": "5.2.0",
42
- "@types/ramda": "0.29.12",
43
- "@zkochan/rimraf": "^3.0.2",
44
- "execa": "npm:safe-execa@0.1.2",
45
- "@pnpm/cache.commands": "1000.0.64",
46
- "@pnpm/prepare": "1000.0.15",
47
- "@pnpm/logger": "1001.0.1"
41
+ "@pnpm/registry-mock": "6.0.0",
42
+ "@types/ramda": "0.31.1",
43
+ "@zkochan/rimraf": "^4.0.0",
44
+ "execa": "npm:safe-execa@0.3.0",
45
+ "@pnpm/cache.commands": "1100.0.0",
46
+ "@pnpm/logger": "1100.0.0",
47
+ "@pnpm/prepare": "1100.0.0"
48
48
  },
49
49
  "engines": {
50
- "node": ">=18.12"
50
+ "node": ">=22.13"
51
51
  },
52
52
  "jest": {
53
53
  "preset": "@pnpm/jest-config/with-registry"
54
54
  },
55
55
  "scripts": {
56
56
  "lint": "eslint \"src/**/*.ts\" \"test/**/*.ts\"",
57
- "_test": "jest",
58
- "test": "pnpm run compile && pnpm run _test",
59
- "compile": "tsc --build && pnpm run lint --fix"
57
+ "test": "pn compile && pn --filter=pnpm compile && pn .test",
58
+ "compile": "tsgo --build && pn lint --fix",
59
+ ".test": "cross-env NODE_OPTIONS=\"$NODE_OPTIONS --experimental-vm-modules --disable-warning=ExperimentalWarning --disable-warning=DEP0169\" jest"
60
60
  }
61
61
  }
@@ -1 +0,0 @@
1
- {"version":3,"file":"cache.cmd.js","sourceRoot":"","sources":["../src/cache.cmd.ts"],"names":[],"mappings":";;;;;;AAiBA,0CAOC;AAID,oBA8BC;AAID,0BA6CC;AA3GD,gDAAuB;AACvB,+CAAyC;AACzC,yCAA6D;AAC7D,+CAA8E;AAC9E,iDAA+C;AAC/C,0DAAiC;AACjC,8DAAoC;AACpC,+CAKwB;AACxB,uCAAuC;AAE1B,QAAA,cAAc,GAAG,eAAe,CAAA;AAE7C,SAAgB,eAAe;IAC7B,OAAO;QACL,GAAG,IAAA,cAAI,EAAC;YACN,UAAU;YACV,WAAW;SACZ,EAAE,cAAQ,CAAC;KACb,CAAA;AACH,CA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