@pnpm/plugin-commands-listing 1000.0.34 → 1000.1.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/lib/list.d.ts +5 -2
- package/lib/list.js +13 -1
- package/lib/list.js.map +1 -1
- package/lib/why.js +3 -2
- package/lib/why.js.map +1 -1
- package/package.json +11 -11
package/lib/list.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type Config } from '@pnpm/config';
|
|
2
|
-
import { type IncludedDependencies } from '@pnpm/types';
|
|
2
|
+
import { type Finder, type IncludedDependencies } from '@pnpm/types';
|
|
3
3
|
export declare const EXCLUDE_PEERS_HELP: {
|
|
4
4
|
description: string;
|
|
5
5
|
name: string;
|
|
@@ -9,7 +9,7 @@ export declare const cliOptionsTypes: () => Record<string, unknown>;
|
|
|
9
9
|
export declare const shorthands: Record<string, string>;
|
|
10
10
|
export declare const commandNames: string[];
|
|
11
11
|
export declare function help(): string;
|
|
12
|
-
export type ListCommandOptions = Pick<Config, 'allProjects' | 'dev' | 'dir' | 'optional' | 'production' | 'selectedProjectsGraph' | 'modulesDir' | 'virtualStoreDirMaxLength'> & Partial<Pick<Config, 'cliOptions'>> & {
|
|
12
|
+
export type ListCommandOptions = Pick<Config, 'allProjects' | 'dev' | 'dir' | 'finders' | 'optional' | 'production' | 'selectedProjectsGraph' | 'modulesDir' | 'virtualStoreDirMaxLength'> & Partial<Pick<Config, 'cliOptions'>> & {
|
|
13
13
|
alwaysPrintRootPackage?: boolean;
|
|
14
14
|
depth?: number;
|
|
15
15
|
excludePeers?: boolean;
|
|
@@ -19,6 +19,7 @@ export type ListCommandOptions = Pick<Config, 'allProjects' | 'dev' | 'dir' | 'o
|
|
|
19
19
|
parseable?: boolean;
|
|
20
20
|
onlyProjects?: boolean;
|
|
21
21
|
recursive?: boolean;
|
|
22
|
+
findBy?: string[];
|
|
22
23
|
};
|
|
23
24
|
export declare function handler(opts: ListCommandOptions, params: string[]): Promise<string>;
|
|
24
25
|
export declare function render(prefixes: string[], params: string[], opts: {
|
|
@@ -33,4 +34,6 @@ export declare function render(prefixes: string[], params: string[], opts: {
|
|
|
33
34
|
parseable?: boolean;
|
|
34
35
|
modulesDir?: string;
|
|
35
36
|
virtualStoreDirMaxLength: number;
|
|
37
|
+
finders?: Record<string, Finder>;
|
|
38
|
+
findBy?: string[];
|
|
36
39
|
}): Promise<string>;
|
package/lib/list.js
CHANGED
|
@@ -8,6 +8,7 @@ exports.rcOptionsTypes = rcOptionsTypes;
|
|
|
8
8
|
exports.help = help;
|
|
9
9
|
exports.handler = handler;
|
|
10
10
|
exports.render = render;
|
|
11
|
+
const error_1 = require("@pnpm/error");
|
|
11
12
|
const cli_utils_1 = require("@pnpm/cli-utils");
|
|
12
13
|
const common_cli_options_help_1 = require("@pnpm/common-cli-options-help");
|
|
13
14
|
const config_1 = require("@pnpm/config");
|
|
@@ -38,6 +39,7 @@ const cliOptionsTypes = () => ({
|
|
|
38
39
|
'exclude-peers': Boolean,
|
|
39
40
|
'only-projects': Boolean,
|
|
40
41
|
recursive: Boolean,
|
|
42
|
+
'find-by': [String, Array],
|
|
41
43
|
});
|
|
42
44
|
exports.cliOptionsTypes = cliOptionsTypes;
|
|
43
45
|
exports.shorthands = {
|
|
@@ -141,6 +143,15 @@ async function handler(opts, params) {
|
|
|
141
143
|
});
|
|
142
144
|
}
|
|
143
145
|
async function render(prefixes, params, opts) {
|
|
146
|
+
const finders = [];
|
|
147
|
+
if (opts.findBy) {
|
|
148
|
+
for (const finderName of opts.findBy) {
|
|
149
|
+
if (opts.finders?.[finderName] == null) {
|
|
150
|
+
throw new error_1.PnpmError('FINDER_NOT_FOUND', `No finder with name ${finderName} is found`);
|
|
151
|
+
}
|
|
152
|
+
finders.push(opts.finders[finderName]);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
144
155
|
const listOpts = {
|
|
145
156
|
alwaysPrintRootPackage: opts.alwaysPrintRootPackage,
|
|
146
157
|
depth: opts.depth ?? 0,
|
|
@@ -153,8 +164,9 @@ async function render(prefixes, params, opts) {
|
|
|
153
164
|
showExtraneous: false,
|
|
154
165
|
modulesDir: opts.modulesDir,
|
|
155
166
|
virtualStoreDirMaxLength: opts.virtualStoreDirMaxLength,
|
|
167
|
+
finders,
|
|
156
168
|
};
|
|
157
|
-
return (params.length > 0)
|
|
169
|
+
return (params.length > 0) || listOpts.finders.length > 0
|
|
158
170
|
? (0, list_1.listForPackages)(params, prefixes, listOpts)
|
|
159
171
|
: (0, list_1.list)(prefixes, listOpts);
|
|
160
172
|
}
|
package/lib/list.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list.js","sourceRoot":"","sources":["../src/list.ts"],"names":[],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"list.js","sourceRoot":"","sources":["../src/list.ts"],"names":[],"mappings":";;;;;;AAeA,wCAaC;AAiBD,oBA6EC;AAyBD,0BAoBC;AAED,wBA6CC;AAtND,uCAAuC;AACvC,+CAAyC;AACzC,2EAAqF;AACrF,yCAA6D;AAC7D,qCAAkD;AAElD,0DAAiC;AACjC,8DAAoC;AACpC,iDAA8C;AAEjC,QAAA,kBAAkB,GAAG;IAChC,WAAW,EAAE,2BAA2B;IACxC,IAAI,EAAE,iBAAiB;CACxB,CAAA;AAED,SAAgB,cAAc;IAC5B,OAAO,IAAA,cAAI,EAAC;QACV,OAAO;QACP,KAAK;QACL,YAAY;QACZ,QAAQ;QACR,MAAM;QACN,MAAM;QACN,MAAM;QACN,UAAU;QACV,WAAW;QACX,YAAY;KACb,EAAE,cAAQ,CAAC,CAAA;AACd,CAAC;AAEM,MAAM,eAAe,GAAG,GAA4B,EAAE,CAAC,CAAC;IAC7D,GAAG,cAAc,EAAE;IACnB,eAAe,EAAE,OAAO;IACxB,eAAe,EAAE,OAAO;IACxB,SAAS,EAAE,OAAO;IAClB,SAAS,EAAE,CAAC,MAAM,EAAE,KAAK,CAAC;CAC3B,CAAC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CAAC,CAAA;AAC9B,CAAC"}
|
package/lib/why.js
CHANGED
|
@@ -32,6 +32,7 @@ const cliOptionsTypes = () => ({
|
|
|
32
32
|
...rcOptionsTypes(),
|
|
33
33
|
'exclude-peers': Boolean,
|
|
34
34
|
recursive: Boolean,
|
|
35
|
+
'find-by': [String, Array],
|
|
35
36
|
});
|
|
36
37
|
exports.cliOptionsTypes = cliOptionsTypes;
|
|
37
38
|
exports.shorthands = {
|
|
@@ -103,8 +104,8 @@ For options that may be used with `-r`, see "pnpm help recursive"',
|
|
|
103
104
|
});
|
|
104
105
|
}
|
|
105
106
|
async function handler(opts, params) {
|
|
106
|
-
if (params.length === 0) {
|
|
107
|
-
throw new error_1.PnpmError('MISSING_PACKAGE_NAME', '`pnpm why` requires the package name');
|
|
107
|
+
if (params.length === 0 && opts.findBy == null) {
|
|
108
|
+
throw new error_1.PnpmError('MISSING_PACKAGE_NAME', '`pnpm why` requires the package name or --find-by=<finder-name>');
|
|
108
109
|
}
|
|
109
110
|
return (0, list_js_1.handler)({
|
|
110
111
|
...opts,
|
package/lib/why.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"why.js","sourceRoot":"","sources":["../src/why.ts"],"names":[],"mappings":";;;;;;AAQA,wCAaC;
|
|
1
|
+
{"version":3,"file":"why.js","sourceRoot":"","sources":["../src/why.ts"],"names":[],"mappings":";;;;;;AAQA,wCAaC;AAgBD,oBA+DC;AAED,0BAcC;AApHD,+CAAyC;AACzC,2EAAqF;AACrF,yCAAgD;AAChD,uCAAuC;AACvC,0DAAiC;AACjC,8DAAoC;AACpC,uCAAwF;AAExF,SAAgB,cAAc;IAC5B,OAAO,IAAA,cAAI,EAAC;QACV,OAAO;QACP,KAAK;QACL,YAAY;QACZ,QAAQ;QACR,MAAM;QACN,MAAM;QACN,MAAM;QACN,UAAU;QACV,WAAW;QACX,YAAY;KACb,EAAE,cAAQ,CAAC,CAAA;AACd,CAAC;AAEM,MAAM,eAAe,GAAG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rB;aACF;YACD,mCAAS;SACV;QACD,GAAG,EAAE,IAAA,mBAAO,EAAC,KAAK,CAAC;QACnB,MAAM,EAAE;YACN,oBAAoB;SACrB;KACF,CAAC,CAAA;AACJ,CAAC;AAEM,KAAK,UAAU,OAAO,CAC3B,IAAwB,EACxB,MAAgB;IAEhB,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,IAAI,IAAI,CAAC,MAAM,IAAI,IAAI,EAAE,CAAC;QAC/C,MAAM,IAAI,iBAAS,CAAC,sBAAsB,EAAE,iEAAiE,CAAC,CAAA;IAChH,CAAC;IACD,OAAO,IAAA,iBAAI,EAAC;QACV,GAAG,IAAI;QACP,UAAU,EAAE;YACV,GAAG,CAAC,IAAI,CAAC,UAAU,IAAI,EAAE,CAAC;YAC1B,KAAK,EAAE,IAAI,CAAC,KAAK,IAAI,QAAQ;SAC9B;KACF,EAAE,MAAM,CAAC,CAAA;AACZ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pnpm/plugin-commands-listing",
|
|
3
|
-
"version": "1000.0
|
|
3
|
+
"version": "1000.1.0",
|
|
4
4
|
"description": "The list and why commands of pnpm",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pnpm",
|
|
@@ -26,12 +26,12 @@
|
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"ramda": "npm:@pnpm/ramda@0.28.1",
|
|
28
28
|
"render-help": "^1.0.3",
|
|
29
|
-
"@pnpm/cli-utils": "1001.
|
|
30
|
-
"@pnpm/config": "1004.2.1",
|
|
29
|
+
"@pnpm/cli-utils": "1001.2.0",
|
|
31
30
|
"@pnpm/common-cli-options-help": "1000.0.1",
|
|
32
|
-
"@pnpm/
|
|
33
|
-
"@pnpm/
|
|
34
|
-
"@pnpm/
|
|
31
|
+
"@pnpm/error": "1000.0.4",
|
|
32
|
+
"@pnpm/config": "1004.3.0",
|
|
33
|
+
"@pnpm/types": "1000.8.0",
|
|
34
|
+
"@pnpm/list": "1000.1.0"
|
|
35
35
|
},
|
|
36
36
|
"peerDependencies": {
|
|
37
37
|
"@pnpm/logger": ">=1001.0.0 <1002.0.0"
|
|
@@ -42,12 +42,12 @@
|
|
|
42
42
|
"execa": "npm:safe-execa@0.1.2",
|
|
43
43
|
"write-yaml-file": "^5.0.0",
|
|
44
44
|
"@pnpm/constants": "1001.3.0",
|
|
45
|
-
"@pnpm/filter-workspace-packages": "1000.0.
|
|
45
|
+
"@pnpm/filter-workspace-packages": "1000.0.35",
|
|
46
46
|
"@pnpm/logger": "1001.0.0",
|
|
47
|
-
"@pnpm/plugin-commands-
|
|
48
|
-
"@pnpm/
|
|
49
|
-
"@pnpm/
|
|
50
|
-
"@pnpm/
|
|
47
|
+
"@pnpm/plugin-commands-listing": "1000.1.0",
|
|
48
|
+
"@pnpm/plugin-commands-installation": "1004.6.0",
|
|
49
|
+
"@pnpm/prepare": "1000.0.1",
|
|
50
|
+
"@pnpm/workspace.filter-packages-from-dir": "1000.0.35"
|
|
51
51
|
},
|
|
52
52
|
"engines": {
|
|
53
53
|
"node": ">=18.12"
|