/
index.ts
145 lines (142 loc) · 6.09 KB
/
index.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
export const OPTIONS = {
globalDir: {
description: 'Specify a custom directory to store global packages',
name: '--global-dir',
},
ignoreScripts: {
description: "Don't run lifecycle scripts",
name: '--ignore-scripts',
},
offline: {
description: 'Trigger an error if any required dependencies are not available in local store',
name: '--offline',
},
preferOffline: {
description: 'Skip staleness checks for cached data, but request missing data from the server',
name: '--prefer-offline',
},
storeDir: {
description: 'The directory in which all the packages are saved on the disk',
name: '--store-dir <dir>',
},
virtualStoreDir: {
description: 'The directory with links to the store (default is node_modules/.pnpm). All direct and indirect dependencies of the project are linked into this directory',
name: '--virtual-store-dir <dir>',
},
}
export const UNIVERSAL_OPTIONS = [
{
description: 'Controls colors in the output. By default, output is always colored when it goes directly to a terminal',
name: '--[no-]color',
},
{
description: 'Output usage information',
name: '--help',
shortAlias: '-h',
},
{
description: `Change to directory <dir> (default: ${process.cwd()})`,
name: '--dir <dir>',
shortAlias: '-C',
},
{
description: 'Run the command on the root workspace project',
name: '--workspace-root',
shortAlias: '-w',
},
{
description: 'What level of logs to report. Any logs at or higher than the given level will be shown. Levels (lowest to highest): debug, info, warn, error. Or use "--silent" to turn off all logging.',
name: '--loglevel <level>',
},
{
description: 'Stream output from child processes immediately, prefixed with the originating package directory. This allows output from different packages to be interleaved.',
name: '--stream',
},
{
description: 'Aggregate output from child processes that are run in parallel, and only print output when child process is finished. It makes reading large logs after running `pnpm recursive` with `--parallel` or with `--workspace-concurrency` much easier (especially on CI). Only `--reporter=append-only` is supported.',
name: '--aggregate-output',
},
{
description: 'Divert all output to stderr',
name: '--use-stderr',
},
]
export const FILTERING = {
list: [
{
description: 'Restricts the scope to package names matching the given pattern. E.g.: foo, "@bar/*"',
name: '--filter <pattern>',
},
{
description: 'Includes all direct and indirect dependencies of the matched packages. E.g.: foo...',
name: '--filter <pattern>...',
},
{
description: 'Includes only the direct and indirect dependencies of the matched packages without including the matched packages themselves. ^ must be doubled at the Windows Command Prompt. E.g.: foo^... (foo^^... in Command Prompt)',
name: '--filter <pattern>^...',
},
{
description: 'Includes all direct and indirect dependents of the matched packages. E.g.: ...foo, "...@bar/*"',
name: '--filter ...<pattern>',
},
{
description: 'Includes only the direct and indirect dependents of the matched packages without including the matched packages themselves. ^ must be doubled at the Windows Command Prompt. E.g.: ...^foo (...^^foo in Command Prompt)',
name: '--filter ...^<pattern>',
},
{
description: 'Includes all packages that are inside a given subdirectory. E.g.: ./components',
name: '--filter ./<dir>',
},
{
description: 'Includes all packages that are under the current working directory',
name: '--filter .',
},
{
description: 'Includes all projects that are under the specified directory. It may be used with "..." to select dependents/dependencies as well. It also may be combined with "[<since>]". For instance, all changed projects inside a directory: "{packages}[origin/master]"',
name: '--filter {<dir>}',
},
{
description: 'Includes all packages changed since the specified commit/branch. E.g.: "[master]", "[HEAD~2]". It may be used together with "...". So, for instance, "...[HEAD~1]" selects all packages changed in the last commit and their dependents',
name: '--filter "[<since>]"',
},
{
description: 'If a selector starts with ! (or \\! in zsh), it means the packages matching the selector must be excluded. E.g., "pnpm --filter !foo" selects all packages except "foo"',
name: '--filter !<selector>',
},
{
description: 'Defines files related to tests. Useful with the changed since filter. When selecting only changed packages and their dependent packages, the dependent packages will be ignored in case a package has changes only in tests. Usage example: pnpm --filter="...[origin/master]" --test-pattern="test/*" test',
name: '--test-pattern <pattern>',
},
{
description: 'Defines files to ignore when filtering for changed projects since the specified commit/branch. Usage example: pnpm --filter="...[origin/master]" --changed-files-ignore-pattern="**/README.md" build',
name: '--changed-files-ignore-pattern <pattern>',
},
{
description: 'Restricts the scope to package names matching the given pattern similar to --filter, but it ignores devDependencies when searching for dependencies and dependents.',
name: '--filter-prod <pattern>',
},
],
title: 'Filtering options (run the command only on packages that satisfy at least one of the selectors)',
}
export const OUTPUT_OPTIONS = {
title: 'Output',
list: [
{
description: 'No output is logged to the console, except fatal errors',
name: '--silent, --reporter silent',
shortAlias: '-s',
},
{
description: 'The default reporter when the stdout is TTY',
name: '--reporter default',
},
{
description: 'The output is always appended to the end. No cursor manipulations are performed',
name: '--reporter append-only',
},
{
description: 'The most verbose reporter. Prints all logs in ndjson format',
name: '--reporter ndjson',
},
],
}