pnpm_config/lib.rs
1use merge_it::*;
2#[cfg(feature = "schemars")]
3use schemars::JsonSchema;
4use serde::{Deserialize, Serialize};
5use serde_json::Value;
6use std::collections::{BTreeMap, BTreeSet};
7use std::path::PathBuf;
8
9mod pnpm_elements;
10
11pub use pnpm_elements::*;
12
13type JsonValueBTreeMap = BTreeMap<String, Value>;
14type StringBTreeMap = BTreeMap<String, String>;
15
16/// A struct representing a pnpm-workspace.yaml config.
17///
18/// See more: https://pnpm.io/settings
19#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Default, Eq, Merge)]
20#[cfg_attr(feature = "schemars", derive(JsonSchema))]
21#[serde(default)]
22#[serde(rename_all = "camelCase")]
23pub struct PnpmWorkspace {
24 /// Glob patterns for the directories containing the packages for this workspace.
25 #[serde(skip_serializing_if = "BTreeSet::is_empty")]
26 pub packages: BTreeSet<String>,
27
28 /// When set to true, pnpm will remove unused catalog entries during installation.
29 ///
30 /// See more: https://pnpm.io/settings#cleanupunusedcatalogs
31 #[serde(alias = "cleanup_unused_catalogs")]
32 #[serde(skip_serializing_if = "Option::is_none")]
33 pub cleanup_unused_catalogs: Option<bool>,
34
35 /// The dependencies to store in the unnamed (default) catalog.
36 #[serde(skip_serializing_if = "BTreeMap::is_empty")]
37 pub catalog: StringBTreeMap,
38
39 /// A map of named catalogs and the dependencies listed in them.
40 #[serde(skip_serializing_if = "BTreeMap::is_empty")]
41 #[merge(with = merge_btree_maps)]
42 pub catalogs: BTreeMap<String, StringBTreeMap>,
43
44 /// A list of package names that are allowed to be executed during installation. Only packages listed in this array will be able to run install scripts. If onlyBuiltDependenciesFile and neverBuiltDependencies are not set, this configuration option will default to blocking all install scripts.
45 ///
46 /// See more: https://pnpm.io/settings#onlybuiltdependencies
47 #[serde(alias = "only_built_dependencies")]
48 #[serde(default, skip_serializing_if = "BTreeSet::is_empty")]
49 pub only_built_dependencies: BTreeSet<String>,
50
51 /// Specifies a JSON file that lists the only packages permitted to run installation scripts during the pnpm install process.
52 ///
53 /// See more: https://pnpm.io/settings#onlybuiltdependenciesfile
54 #[serde(alias = "only_built_dependencies_file")]
55 #[serde(skip_serializing_if = "Option::is_none")]
56 pub only_built_dependencies_file: Option<PathBuf>,
57
58 /// A list of dependencies to run builds for. See more: https://pnpm.io/settings#neverbuiltdependencies
59 #[serde(alias = "never_built_dependencies")]
60 #[serde(default, skip_serializing_if = "BTreeSet::is_empty")]
61 pub never_built_dependencies: BTreeSet<String>,
62
63 /// A list of package names that should not be built during installation.
64 ///
65 /// See more: https://pnpm.io/settings#ignoredbuiltdependencies
66 #[serde(alias = "ignored_built_dependencies")]
67 #[serde(default, skip_serializing_if = "BTreeSet::is_empty")]
68 pub ignored_built_dependencies: BTreeSet<String>,
69
70 /// If set to true, all build scripts (e.g. preinstall, install, postinstall) from dependencies will run automatically, without requiring approval.
71 ///
72 /// See more: https://pnpm.io/settings#dangerouslyallowallbuilds
73 #[serde(alias = "dangerously_allow_all_builds")]
74 #[serde(skip_serializing_if = "Option::is_none")]
75 pub dangerously_allow_all_builds: Option<bool>,
76
77 /// This field allows you to instruct pnpm to override any dependency in the dependency graph. This is useful for enforcing all your packages to use a single version of a dependency, backporting a fix, replacing a dependency with a fork, or removing an unused dependency.
78 ///
79 /// See more: https://pnpm.io/settings#overrides
80 #[serde(default, skip_serializing_if = "BTreeMap::is_empty")]
81 pub overrides: StringBTreeMap,
82
83 /// Configuration for package updates.
84 ///
85 /// See more: https://pnpm.io/settings#updateconfig
86 #[serde(alias = "update_config")]
87 #[serde(skip_serializing_if = "Option::is_none")]
88 pub update_config: Option<UpdateConfig>,
89
90 /// It specifies the number of minutes that must pass after a version is published before pnpm will install it. For example, setting `minimumReleaseAge: 1440` ensures that only packages released at least one day ago can be installed.
91 ///
92 /// See more: https://pnpm.io/settings#minimumreleaseage
93 #[serde(alias = "minimum_release_age")]
94 #[serde(skip_serializing_if = "Option::is_none")]
95 pub minimum_release_age: Option<usize>,
96
97 /// If you set `minimumReleaseAge` but need to disable this restriction for certain dependencies, you can list them under the `minimumReleaseAgeExclude` setting.
98 ///
99 /// See more: https://pnpm.io/settings#minimumreleaseageexclude
100 #[serde(alias = "minimum_release_age_exclude")]
101 #[serde(default, skip_serializing_if = "BTreeSet::is_empty")]
102 pub minimum_release_age_exclude: BTreeSet<String>,
103
104 /// The packageExtensions fields offer a way to extend the existing package definitions with additional information. For example, if react-redux should have react-dom in its peerDependencies but it has not, it is possible to patch react-redux using packageExtensions.
105 ///
106 /// See more: https://pnpm.io/settings#packageextensions
107 #[serde(alias = "package_extensions")]
108 #[serde(default, skip_serializing_if = "BTreeMap::is_empty")]
109 pub package_extensions: BTreeMap<String, PackageExtension>,
110
111 /// Rules for peer dependencies.
112 ///
113 /// See more: https://pnpm.io/settings#peerdependencyrules
114 #[serde(alias = "peer_dependency_rules")]
115 #[serde(skip_serializing_if = "Option::is_none")]
116 pub peer_dependency_rules: Option<PeerDependencyRules>,
117
118 /// A list of deprecated versions that the warnings are suppressed.
119 ///
120 /// See more: https://pnpm.io/settings#alloweddeprecatedversions
121 #[serde(alias = "allowed_deprecated_versions")]
122 #[serde(default, skip_serializing_if = "BTreeMap::is_empty")]
123 pub allowed_deprecated_versions: StringBTreeMap,
124
125 /// A list of dependencies that are patched.
126 ///
127 /// See more: https://pnpm.io/settings#patcheddependencies
128 #[serde(alias = "patched_dependencies")]
129 #[serde(default, skip_serializing_if = "BTreeMap::is_empty")]
130 pub patched_dependencies: StringBTreeMap,
131
132 /// When true, installation won't fail if some of the patches from the `patchedDependencies` field were not applied. Previously named `allowNonAppliedPatches`.
133 ///
134 /// See more: https://pnpm.io/settings#allowunusedpatches
135 #[serde(alias = "allow_unused_patches")]
136 #[serde(skip_serializing_if = "Option::is_none")]
137 pub allow_unused_patches: Option<bool>,
138
139 /// Default is undefined. Errors out when a patch with an exact version or version range fails. Ignores failures from name-only patches. When true, prints a warning instead of failing when any patch cannot be applied. When false, errors out for any patch failure.
140 ///
141 /// See more: https://pnpm.io/settings#ignorepatchfailures
142 #[serde(alias = "ignore_patch_failures")]
143 #[serde(skip_serializing_if = "Option::is_none")]
144 pub ignore_patch_failures: Option<bool>,
145
146 /// Config dependencies allow you to share and centralize configuration files, settings, and hooks across multiple projects. They are installed before all regular dependencies ('dependencies', 'devDependencies', 'optionalDependencies'), making them ideal for setting up custom hooks, patches, and catalog entries.
147 ///
148 /// See more: https://pnpm.io/config-dependencies
149 #[serde(alias = "config_dependencies")]
150 #[serde(default, skip_serializing_if = "BTreeMap::is_empty")]
151 pub config_dependencies: StringBTreeMap,
152
153 /// Settings for the `pnpm audit` command.
154 ///
155 /// See more: https://pnpm.io/settings#auditconfig
156 #[serde(alias = "audit_config")]
157 #[serde(skip_serializing_if = "Option::is_none")]
158 pub audit_config: Option<AuditConfig>,
159
160 /// Scripts listed in this array will be required in each project of the workspace. Otherwise, pnpm -r run <script name> will fail.
161 ///
162 /// See more: https://pnpm.io/settings#requiredscripts
163 #[serde(alias = "required_scripts")]
164 #[serde(default, skip_serializing_if = "BTreeSet::is_empty")]
165 pub required_scripts: BTreeSet<String>,
166
167 /// Specifies architectures for which you'd like to install optional dependencies, even if they don't match the architecture of the system running the install.
168 ///
169 /// See more: https://pnpm.io/settings#supportedarchitectures
170 #[serde(alias = "supported_architectures")]
171 #[serde(skip_serializing_if = "Option::is_none")]
172 pub supported_architectures: Option<SupportedArchitectures>,
173
174 /// A list of optional dependencies that the install should be skipped.
175 ///
176 /// See more: https://pnpm.io/settings#ignoredoptionaldependencies
177 #[serde(alias = "ignored_optional_dependencies")]
178 #[serde(default, skip_serializing_if = "BTreeSet::is_empty")]
179 pub ignored_optional_dependencies: BTreeSet<String>,
180
181 /// Instructions for the runtime, such as the node version to use.
182 ///
183 /// See more: https://pnpm.io/settings#executionenvnodeversion
184 #[serde(alias = "execution_env")]
185 #[serde(skip_serializing_if = "Option::is_none")]
186 pub execution_env: Option<ExecutionEnv>,
187
188 /// When true, all dependencies are hoisted to node_modules/.pnpm/node_modules.
189 ///
190 /// See more: https://pnpm.io/settings#hoist
191 #[serde(alias = "hoist")]
192 #[serde(skip_serializing_if = "Option::is_none")]
193 pub hoist: Option<bool>,
194
195 /// When true, packages from the workspaces are symlinked to either <workspace_root>/node_modules/.pnpm/node_modules or to <workspace_root>/node_modules depending on other hoisting settings (hoistPattern and publicHoistPattern).
196 ///
197 /// See more: https://pnpm.io/settings#hoistworkspacepackages
198 #[serde(alias = "hoist_workspace_packages")]
199 #[serde(skip_serializing_if = "Option::is_none")]
200 pub hoist_workspace_packages: Option<bool>,
201
202 /// Tells pnpm which packages should be hoisted to node_modules/.pnpm/node_modules.
203 ///
204 /// See more: https://pnpm.io/settings#hoistpattern
205 #[serde(alias = "hoist_pattern")]
206 #[serde(default, skip_serializing_if = "BTreeSet::is_empty")]
207 pub hoist_pattern: BTreeSet<String>,
208
209 /// Unlike hoistPattern, which hoists dependencies to a hidden modules directory inside the virtual store, publicHoistPattern hoists dependencies matching the pattern to the root modules directory.
210 ///
211 /// See more: https://pnpm.io/settings#publichoistpattern
212 #[serde(alias = "public_hoist_pattern")]
213 #[serde(default, skip_serializing_if = "BTreeSet::is_empty")]
214 pub public_hoist_pattern: BTreeSet<String>,
215
216 /// By default, pnpm creates a semistrict node_modules, meaning dependencies have access to undeclared dependencies but modules outside of node_modules do not.
217 ///
218 /// See more: https://pnpm.io/settings#shamefullyhoist
219 #[serde(alias = "shamefully_hoist")]
220 #[serde(skip_serializing_if = "Option::is_none")]
221 pub shamefully_hoist: Option<bool>,
222
223 /// The directory in which dependencies will be installed (instead of node_modules).
224 ///
225 /// See more: https://pnpm.io/settings#modulesdir
226 #[serde(alias = "modules_dir")]
227 #[serde(skip_serializing_if = "Option::is_none")]
228 pub modules_dir: Option<PathBuf>,
229
230 /// Defines what linker should be used for installing Node packages.
231 ///
232 /// See more: https://pnpm.io/settings#nodelinker
233 #[serde(alias = "node_linker")]
234 #[serde(skip_serializing_if = "Option::is_none")]
235 pub node_linker: Option<NodeLinker>,
236
237 /// When symlink is set to false, pnpm creates a virtual store directory without any symlinks. It is a useful setting together with nodeLinker=pnp.
238 ///
239 /// See more: https://pnpm.io/settings#symlink
240 #[serde(skip_serializing_if = "Option::is_none")]
241 pub symlink: Option<bool>,
242
243 /// When false, pnpm will not write any files to the modules directory (node_modules).
244 ///
245 /// See more: https://pnpm.io/settings#enablemodulesdir
246 #[serde(alias = "enable_modules_dir")]
247 #[serde(skip_serializing_if = "Option::is_none")]
248 pub enable_modules_dir: Option<bool>,
249
250 /// The directory with links to the store.
251 ///
252 /// See more: https://pnpm.io/settings#virtualstoredir
253 #[serde(alias = "virtual_store_dir")]
254 #[serde(skip_serializing_if = "Option::is_none")]
255 pub virtual_store_dir: Option<PathBuf>,
256
257 /// Sets the maximum allowed length of directory names inside the virtual store directory (node_modules/.pnpm).
258 ///
259 /// See more: https://pnpm.io/settings#virtualstoredirmaxlength
260 #[serde(alias = "virtual_store_dir_max_length")]
261 #[serde(skip_serializing_if = "Option::is_none")]
262 pub virtual_store_dir_max_length: Option<usize>,
263
264 /// Controls the way packages are imported from the store (if you want to disable symlinks inside node_modules, then you need to change the nodeLinker setting, not this one).
265 ///
266 /// See more: https://pnpm.io/settings#packageimportmethod
267 #[serde(alias = "package_import_method")]
268 #[serde(skip_serializing_if = "Option::is_none")]
269 pub package_import_method: Option<PackageImportMethod>,
270
271 /// The time in minutes after which orphan packages from the modules directory should be removed.
272 ///
273 /// See more: https://pnpm.io/settings#modulescachemaxage
274 #[serde(alias = "modules_cache_max_age")]
275 #[serde(skip_serializing_if = "Option::is_none")]
276 pub modules_cache_max_age: Option<usize>,
277
278 /// The time in minutes after which dlx cache expires.
279 ///
280 /// See more: https://pnpm.io/settings#dlxcachemaxage
281 #[serde(alias = "dlx_cache_max_age")]
282 #[serde(skip_serializing_if = "Option::is_none")]
283 pub dlx_cache_max_age: Option<usize>,
284
285 /// The location where all the packages are saved on the disk.
286 ///
287 /// See more: https://pnpm.io/settings#storedir
288 #[serde(alias = "store_dir")]
289 #[serde(skip_serializing_if = "Option::is_none")]
290 pub store_dir: Option<PathBuf>,
291
292 /// By default, if a file in the store has been modified, the content of this file is checked before linking it to a project's node_modules.
293 ///
294 /// See more: https://pnpm.io/settings#verifystoreintegrity
295 #[serde(alias = "verify_store_integrity")]
296 #[serde(skip_serializing_if = "Option::is_none")]
297 pub verify_store_integrity: Option<bool>,
298
299 /// Some registries allow the exact same content to be published under different package names and/or versions.
300 ///
301 /// See more: https://pnpm.io/settings#strictstorepkgcontentcheck
302 #[serde(alias = "strict_store_pkg_content_check")]
303 #[serde(skip_serializing_if = "Option::is_none")]
304 pub strict_store_pkg_content_check: Option<bool>,
305
306 /// When enabled, node_modules contains only symlinks to a central virtual store, rather than to node_modules/.pnpm.
307 ///
308 /// See more: https://pnpm.io/settings#enableglobalvirtualstore
309 #[serde(alias = "enable_global_virtual_store")]
310 #[serde(skip_serializing_if = "Option::is_none")]
311 pub enable_global_virtual_store: Option<bool>,
312
313 /// When set to false, pnpm won't read or generate a pnpm-lock.yaml file.
314 ///
315 /// See more: https://pnpm.io/settings#lockfile
316 #[serde(alias = "lockfile")]
317 #[serde(skip_serializing_if = "Option::is_none")]
318 pub lockfile: Option<bool>,
319
320 /// When set to true and the available pnpm-lock.yaml satisfies the package.json dependencies directive, a headless installation is performed.
321 ///
322 /// See more: https://pnpm.io/settings#preferfrozenlockfile
323 #[serde(alias = "prefer_frozen_lockfile")]
324 #[serde(skip_serializing_if = "Option::is_none")]
325 pub prefer_frozen_lockfile: Option<bool>,
326
327 /// Add the full URL to the package's tarball to every entry in pnpm-lock.yaml.
328 ///
329 /// See more: https://pnpm.io/settings#lockfileincludetarballurl
330 #[serde(alias = "lockfile_include_tarball_url")]
331 #[serde(skip_serializing_if = "Option::is_none")]
332 pub lockfile_include_tarball_url: Option<bool>,
333
334 /// When set to true, the generated lockfile name after installation will be named based on the current branch name to completely avoid merge conflicts.
335 ///
336 /// See more: https://pnpm.io/settings#gitbranchlockfile
337 #[serde(alias = "git_branch_lockfile")]
338 #[serde(skip_serializing_if = "Option::is_none")]
339 pub git_branch_lockfile: Option<bool>,
340
341 /// This configuration matches the current branch name to determine whether to merge all git branch lockfile files.
342 ///
343 /// See more: https://pnpm.io/settings#mergegitbranchlockfilesbranchpattern
344 #[serde(alias = "merge_git_branch_lockfiles_branch_pattern")]
345 #[serde(default, skip_serializing_if = "BTreeSet::is_empty")]
346 pub merge_git_branch_lockfiles_branch_pattern: BTreeSet<String>,
347
348 /// Max length of the peer IDs suffix added to dependency keys in the lockfile. If the suffix is longer, it is replaced with a hash.
349 ///
350 /// See more: https://pnpm.io/settings#peerssuffixmaxlength
351 #[serde(alias = "peers_suffix_max_length")]
352 #[serde(skip_serializing_if = "Option::is_none")]
353 pub peers_suffix_max_length: Option<usize>,
354
355 /// The base URL of the npm package registry (trailing slash included).
356 ///
357 /// See more: https://pnpm.io/settings#registry
358 #[serde(skip_serializing_if = "Option::is_none")]
359 pub registry: Option<String>,
360
361 /// The Certificate Authority signing certificate that is trusted for SSL connections to the registry.
362 ///
363 /// See more: https://pnpm.io/settings#ca
364 #[serde(skip_serializing_if = "Option::is_none")]
365 pub ca: Option<String>,
366
367 /// A path to a file containing one or multiple Certificate Authority signing certificates.
368 ///
369 /// See more: https://pnpm.io/settings#cafile
370 #[serde(rename = "cafile", alias = "ca_file")]
371 #[serde(skip_serializing_if = "Option::is_none")]
372 pub ca_file: Option<PathBuf>,
373
374 /// A client certificate to pass when accessing the registry.
375 ///
376 /// See more: https://pnpm.io/settings#cert
377 #[serde(skip_serializing_if = "Option::is_none")]
378 pub cert: Option<String>,
379
380 /// A client key to pass when accessing the registry.
381 ///
382 /// See more: https://pnpm.io/settings#key
383 #[serde(skip_serializing_if = "Option::is_none")]
384 pub key: Option<String>,
385
386 /// When fetching dependencies that are Git repositories, if the host is listed in this setting, pnpm will use shallow cloning to fetch only the needed commit, not all the history.
387 ///
388 /// See more: https://pnpm.io/settings#gitshallowhosts
389 #[serde(alias = "git_shallow_hosts")]
390 #[serde(default, skip_serializing_if = "BTreeSet::is_empty")]
391 pub git_shallow_hosts: BTreeSet<String>,
392
393 /// A proxy to use for outgoing HTTPS requests. If the HTTPS_PROXY, https_proxy, HTTP_PROXY or http_proxy environment variables are set, their values will be used instead.
394 ///
395 /// See more: https://pnpm.io/settings#https-proxy
396 #[serde(alias = "https_proxy")]
397 #[serde(skip_serializing_if = "Option::is_none")]
398 pub https_proxy: Option<String>,
399
400 /// A proxy to use for outgoing http requests. If the HTTP_PROXY or http_proxy environment variables are set, proxy settings will be honored by the underlying request library.
401 ///
402 /// See more: https://pnpm.io/settings#proxy
403 #[serde(skip_serializing_if = "Option::is_none")]
404 pub proxy: Option<String>,
405
406 /// The IP address of the local interface to use when making connections to the npm registry.
407 ///
408 /// See more: https://pnpm.io/settings#local-address
409 #[serde(alias = "local_address")]
410 #[serde(skip_serializing_if = "Option::is_none")]
411 pub local_address: Option<String>,
412
413 /// The maximum number of connections to use per origin (protocol/host/port combination).
414 ///
415 /// See more: https://pnpm.io/settings#maxsockets
416 #[serde(rename = "maxsockets", alias = "max_sockets")]
417 #[serde(skip_serializing_if = "Option::is_none")]
418 pub max_sockets: Option<usize>,
419
420 /// A comma-separated string of domain extensions that a proxy should not be used for.
421 ///
422 /// See more: https://pnpm.io/settings#noproxy
423 #[serde(rename = "noproxy", alias = "no_proxy")]
424 #[serde(skip_serializing_if = "Option::is_none")]
425 pub no_proxy: Option<String>,
426
427 /// Whether or not to do SSL key validation when making requests to the registry via HTTPS.
428 ///
429 /// See more: https://pnpm.io/settings#strict-ssl
430 #[serde(alias = "strict_ssl")]
431 #[serde(skip_serializing_if = "Option::is_none")]
432 pub strict_ssl: Option<bool>,
433
434 /// Controls the maximum number of HTTP(S) requests to process simultaneously.
435 ///
436 /// See more: https://pnpm.io/settings#networkconcurrency
437 #[serde(alias = "network_concurrency")]
438 #[serde(skip_serializing_if = "Option::is_none")]
439 pub network_concurrency: Option<usize>,
440
441 /// How many times to retry if pnpm fails to fetch from the registry.
442 ///
443 /// See more: https://pnpm.io/settings#fetchretries
444 #[serde(alias = "fetch_retries")]
445 #[serde(skip_serializing_if = "Option::is_none")]
446 pub fetch_retries: Option<usize>,
447
448 /// The exponential factor for retry backoff.
449 ///
450 /// See more: https://pnpm.io/settings#fetchretryfactor
451 #[serde(alias = "fetch_retry_factor")]
452 #[serde(skip_serializing_if = "Option::is_none")]
453 pub fetch_retry_factor: Option<usize>,
454
455 /// The minimum (base) timeout for retrying requests.
456 ///
457 /// See more: https://pnpm.io/settings#fetchretrymintimeout
458 #[serde(alias = "fetch_retry_min_timeout")]
459 #[serde(skip_serializing_if = "Option::is_none")]
460 pub fetch_retry_min_timeout: Option<usize>,
461
462 /// The maximum fallback timeout to ensure the retry factor does not make requests too long.
463 ///
464 /// See more: https://pnpm.io/settings#fetchretrymaxtimeout
465 #[serde(alias = "fetch_retry_max_timeout")]
466 #[serde(skip_serializing_if = "Option::is_none")]
467 pub fetch_retry_max_timeout: Option<usize>,
468
469 /// The maximum amount of time to wait for HTTP requests to complete.
470 ///
471 /// See more: https://pnpm.io/settings#fetchtimeout
472 #[serde(alias = "fetch_timeout")]
473 #[serde(skip_serializing_if = "Option::is_none")]
474 pub fetch_timeout: Option<usize>,
475
476 /// When true, any missing non-optional peer dependencies are automatically installed.
477 ///
478 /// See more: https://pnpm.io/settings#autoinstallpeers
479 #[serde(alias = "auto_install_peers")]
480 #[serde(skip_serializing_if = "Option::is_none")]
481 pub auto_install_peers: Option<bool>,
482
483 /// When this setting is set to true, packages with peer dependencies will be deduplicated after peers resolution.
484 ///
485 /// See more: https://pnpm.io/settings#dedupepeerdependents
486 #[serde(alias = "dedupe_peer_dependents")]
487 #[serde(skip_serializing_if = "Option::is_none")]
488 pub dedupe_peer_dependents: Option<bool>,
489
490 /// If this is enabled, commands will fail if there is a missing or invalid peer dependency in the tree.
491 ///
492 /// See more: https://pnpm.io/settings#strictpeerdependencies
493 #[serde(alias = "strict_peer_dependencies")]
494 #[serde(skip_serializing_if = "Option::is_none")]
495 pub strict_peer_dependencies: Option<bool>,
496
497 /// When enabled, dependencies of the root workspace project are used to resolve peer dependencies of any projects in the workspace.
498 ///
499 /// See more: https://pnpm.io/settings#resolvepeersfromworkspaceroot
500 #[serde(alias = "resolve_peers_from_workspace_root")]
501 #[serde(skip_serializing_if = "Option::is_none")]
502 pub resolve_peers_from_workspace_root: Option<bool>,
503
504 /// Controls colors in the output.
505 ///
506 /// See more: https://pnpm.io/settings#no-color
507 #[serde(skip_serializing_if = "Option::is_none")]
508 pub color: Option<Color>,
509
510 /// Any logs at or higher than the given level will be shown.
511 ///
512 /// See more: https://pnpm.io/settings#loglevel
513 #[serde(rename = "loglevel", alias = "log_level")]
514 #[serde(skip_serializing_if = "Option::is_none")]
515 pub log_level: Option<LogLevel>,
516
517 /// Experimental option that enables beta features of the CLI.
518 ///
519 /// See more: https://pnpm.io/settings#usebetacli
520 #[serde(alias = "use_beta_cli")]
521 #[serde(skip_serializing_if = "Option::is_none")]
522 pub use_beta_cli: Option<bool>,
523
524 /// If this is enabled, the primary behaviour of pnpm install becomes that of pnpm install -r, meaning the install is performed on all workspace or subdirectory packages.
525 ///
526 /// See more: https://pnpm.io/settings#recursiveinstall
527 #[serde(alias = "recursive_install")]
528 #[serde(skip_serializing_if = "Option::is_none")]
529 pub recursive_install: Option<bool>,
530
531 /// If this is enabled, pnpm will not install any package that claims to not be compatible with the current Node version.
532 ///
533 /// See more: https://pnpm.io/settings#enginestrict
534 #[serde(alias = "engine_strict")]
535 #[serde(skip_serializing_if = "Option::is_none")]
536 pub engine_strict: Option<bool>,
537
538 /// The location of the npm binary that pnpm uses for some actions, like publishing.
539 ///
540 /// See more: https://pnpm.io/settings#npmpath
541 #[serde(alias = "npm_path")]
542 #[serde(skip_serializing_if = "Option::is_none")]
543 pub npm_path: Option<PathBuf>,
544
545 /// If this setting is disabled, pnpm will not fail if a different package manager is specified in the packageManager field of package.json. When enabled, only the package name is checked (since pnpm v9.2.0), so you can still run any version of pnpm regardless of the version specified in the packageManager field.
546 ///
547 /// See more: https://pnpm.io/settings#packagemanagerstrict
548 #[serde(alias = "package_manager_strict")]
549 #[serde(skip_serializing_if = "Option::is_none")]
550 pub package_manager_strict: Option<bool>,
551
552 /// When enabled, pnpm will fail if its version doesn't exactly match the version specified in the packageManager field of package.json.
553 ///
554 /// See more: https://pnpm.io/settings#packagemanagerstrictversion
555 #[serde(alias = "package_manager_strict_version")]
556 #[serde(skip_serializing_if = "Option::is_none")]
557 pub package_manager_strict_version: Option<bool>,
558
559 /// When enabled, pnpm will automatically download and run the version of pnpm specified in the packageManager field of package.json.
560 ///
561 /// See more: https://pnpm.io/settings#managepackagemanagerversions
562 #[serde(alias = "manage_package_manager_versions")]
563 #[serde(skip_serializing_if = "Option::is_none")]
564 pub manage_package_manager_versions: Option<bool>,
565
566 /// Do not execute any scripts defined in the project package.json and its dependencies.
567 ///
568 /// See more: https://pnpm.io/settings#ignorescripts
569 #[serde(alias = "ignore_scripts")]
570 #[serde(skip_serializing_if = "Option::is_none")]
571 pub ignore_scripts: Option<bool>,
572
573 /// Do not execute any scripts of the installed packages. Scripts of the projects are executed.
574 ///
575 /// See more: https://pnpm.io/settings#ignoredepscripts
576 #[serde(alias = "ignore_dep_scripts")]
577 #[serde(skip_serializing_if = "Option::is_none")]
578 pub ignore_dep_scripts: Option<bool>,
579
580 /// The maximum number of child processes to allocate simultaneously to build node_modules.
581 ///
582 /// See more: https://pnpm.io/settings#childconcurrency
583 #[serde(alias = "child_concurrency")]
584 #[serde(skip_serializing_if = "Option::is_none")]
585 pub child_concurrency: Option<usize>,
586
587 /// Use and cache the results of (pre/post)install hooks.
588 ///
589 /// See more: https://pnpm.io/settings#sideeffectscache
590 #[serde(alias = "size_effects_cache")]
591 #[serde(skip_serializing_if = "Option::is_none")]
592 pub size_effects_cache: Option<bool>,
593
594 /// Only use the side effects cache if present, do not create it for new packages.
595 ///
596 /// See more: https://pnpm.io/settings#sideeffectscachereadonly
597 #[serde(alias = "size_effects_cache_read_only")]
598 #[serde(skip_serializing_if = "Option::is_none")]
599 pub size_effects_cache_read_only: Option<bool>,
600
601 /// Set to true to enable UID/GID switching when running package scripts. If set explicitly to false, then installing as a non-root user will fail.
602 ///
603 /// See more: https://pnpm.io/settings#unsafeperm
604 #[serde(alias = "unsafe_perm")]
605 #[serde(skip_serializing_if = "Option::is_none")]
606 pub unsafe_perm: Option<bool>,
607
608 /// Options to pass through to Node.js via the NODE_OPTIONS environment variable.
609 ///
610 /// See more: https://pnpm.io/settings#nodeoptions
611 #[serde(alias = "node_options")]
612 #[serde(skip_serializing_if = "Option::is_none")]
613 pub node_options: Option<String>,
614
615 /// This setting allows the checking of the state of dependencies before running scripts.
616 ///
617 /// See more: https://pnpm.io/settings#verifydepsbeforerun
618 #[serde(alias = "verify_deps_before_run")]
619 #[serde(skip_serializing_if = "Option::is_none")]
620 pub verify_deps_before_run: Option<VerifyDepsBeforeRun>,
621
622 /// When strictDepBuilds is enabled, the installation will exit with a non-zero exit code if any dependencies have unreviewed build scripts (aka postinstall scripts).
623 ///
624 /// See more: https://pnpm.io/settings#strictdepbuilds
625 #[serde(alias = "strict_dep_builds")]
626 #[serde(skip_serializing_if = "Option::is_none")]
627 pub strict_dep_builds: Option<bool>,
628
629 /// Specifies which exact Node.js version should be used for the project's runtime.
630 ///
631 /// See more: https://pnpm.io/settings#usenodeversion
632 #[serde(alias = "use_node_version")]
633 #[serde(skip_serializing_if = "Option::is_none")]
634 pub use_node_version: Option<String>,
635
636 /// The Node.js version to use when checking a package's engines setting.
637 ///
638 /// See more: https://pnpm.io/settings#nodeversion
639 #[serde(alias = "node_version")]
640 #[serde(skip_serializing_if = "Option::is_none")]
641 pub node_version: Option<String>,
642
643 /// If this is enabled, locally available packages are linked to node_modules instead of being downloaded from the registry.
644 ///
645 /// See more: https://pnpm.io/settings#linkworkspacepackages
646 #[serde(alias = "link_workspace_packages")]
647 #[serde(skip_serializing_if = "Option::is_none")]
648 pub link_workspace_packages: Option<LinkWorkspacePackages>,
649
650 /// Enables hard-linking of all local workspace dependencies instead of symlinking them.
651 ///
652 /// See more: https://pnpm.io/settings#injectworkspacepackages
653 #[serde(alias = "inject_workspace_packages")]
654 #[serde(skip_serializing_if = "Option::is_none")]
655 pub inject_workspace_packages: Option<bool>,
656
657 /// Injected workspace dependencies are collections of hardlinks, which don't add or remove the files when their sources change.
658 ///
659 /// See more: https://pnpm.io/settings#syncinjecteddepsafterscripts
660 #[serde(alias = "sync_injected_deps_after_scripts")]
661 #[serde(default, skip_serializing_if = "BTreeSet::is_empty")]
662 pub sync_injected_deps_after_scripts: BTreeSet<String>,
663
664 /// If this is enabled, local packages from the workspace are preferred over packages from the registry, even if there is a newer version of the package in the registry.
665 ///
666 /// See more: https://pnpm.io/settings#preferworkspacepackages
667 #[serde(alias = "prefer_workspace_packages")]
668 #[serde(skip_serializing_if = "Option::is_none")]
669 pub prefer_workspace_packages: Option<bool>,
670
671 /// If this is enabled, pnpm creates a single pnpm-lock.yaml file in the root of the workspace.
672 ///
673 /// See more: https://pnpm.io/settings#sharedworkspacelockfile
674 #[serde(alias = "shared_workspace_lockfile")]
675 #[serde(skip_serializing_if = "Option::is_none")]
676 pub shared_workspace_lockfile: Option<bool>,
677
678 /// This setting controls how dependencies that are linked from the workspace are added to package.json.
679 ///
680 /// See more: https://pnpm.io/settings#saveworkspaceprotocol
681 #[serde(alias = "save_workspace_protocol")]
682 #[serde(skip_serializing_if = "Option::is_none")]
683 pub save_workspace_protocol: Option<SaveWorkspaceProtocol>,
684
685 /// When executing commands recursively in a workspace, execute them on the root workspace project as well.
686 ///
687 /// See more: https://pnpm.io/settings#includeworkspaceroot
688 #[serde(alias = "include_workspace_root")]
689 #[serde(skip_serializing_if = "Option::is_none")]
690 pub include_workspace_root: Option<bool>,
691
692 /// When set to true, no workspace cycle warnings will be printed.
693 ///
694 /// See more: https://pnpm.io/settings#ignoreworkspacecycles
695 #[serde(alias = "ignore_workspace_cycles")]
696 #[serde(skip_serializing_if = "Option::is_none")]
697 pub ignore_workspace_cycles: Option<bool>,
698
699 /// Adding a new dependency to the root workspace package fails, unless the --ignore-workspace-root-check or -w flag is used.
700 #[serde(alias = "ignore_workspace_root_check")]
701 #[serde(skip_serializing_if = "Option::is_none")]
702 pub ignore_workspace_root_check: Option<bool>,
703
704 /// When set to true, installation will fail if the workspace has cycles.
705 ///
706 /// See more: https://pnpm.io/settings#disallowworkspacecycles
707 #[serde(alias = "disallow_workspace_cycles")]
708 #[serde(skip_serializing_if = "Option::is_none")]
709 pub disallow_workspace_cycles: Option<bool>,
710
711 /// By default, pnpm deploy will try creating a dedicated lockfile from a shared lockfile for deployment. If this setting is set to true, the legacy deploy behavior will be used.
712 ///
713 /// See more: https://pnpm.io/settings#forcelegacydeploy
714 #[serde(alias = "force_legacy_deploy")]
715 #[serde(skip_serializing_if = "Option::is_none")]
716 pub force_legacy_deploy: Option<bool>,
717
718 /// Configure how versions of packages installed to a package.json file get prefixed.
719 ///
720 /// See more: https://pnpm.io/settings#saveprefix
721 #[serde(alias = "save_prefix")]
722 #[serde(skip_serializing_if = "Option::is_none")]
723 pub save_prefix: Option<SavePrefix>,
724
725 /// If you pnpm add a package and you don't provide a specific version, then it will install the package at the version registered under the tag from this setting.
726 ///
727 /// See more: https://pnpm.io/settings#tag
728 #[serde(skip_serializing_if = "Option::is_none")]
729 pub tag: Option<String>,
730
731 /// Specify a custom directory to store global packages.
732 ///
733 /// See more: https://pnpm.io/settings#globaldir
734 #[serde(alias = "global_dir")]
735 #[serde(skip_serializing_if = "Option::is_none")]
736 pub global_dir: Option<PathBuf>,
737
738 /// Allows to set the target directory for the bin files of globally installed packages.
739 ///
740 /// See more: https://pnpm.io/settings#globalbindir
741 #[serde(alias = "global_bin_dir")]
742 #[serde(skip_serializing_if = "Option::is_none")]
743 pub global_bin_dir: Option<PathBuf>,
744
745 /// The location where all the packages are saved on the disk.
746 ///
747 /// See more: https://pnpm.io/settings#statedir
748 #[serde(alias = "state_dir")]
749 #[serde(skip_serializing_if = "Option::is_none")]
750 pub state_dir: Option<PathBuf>,
751
752 /// The location of the cache (package metadata and dlx).
753 ///
754 /// See more: https://pnpm.io/settings#cachedir
755 #[serde(alias = "cache_dir")]
756 #[serde(skip_serializing_if = "Option::is_none")]
757 pub cache_dir: Option<PathBuf>,
758
759 /// When true, all the output is written to stderr.
760 ///
761 /// See more: https://pnpm.io/settings#usestderr
762 #[serde(alias = "use_stderr")]
763 #[serde(skip_serializing_if = "Option::is_none")]
764 pub use_stderr: Option<bool>,
765
766 /// When true, pnpm will check for updates to the installed packages and notify the user.
767 ///
768 /// See more: https://pnpm.io/settings#updatenotifier
769 #[serde(alias = "update_notifier")]
770 #[serde(skip_serializing_if = "Option::is_none")]
771 pub update_notifier: Option<bool>,
772
773 /// Create symlinks to executables in node_modules/.bin instead of command shims. This setting is ignored on Windows, where only command shims work.
774 ///
775 /// See more: https://pnpm.io/settings#prefersymlinkedexecutables
776 #[serde(alias = "prefer_symlinked_executabled")]
777 #[serde(skip_serializing_if = "Option::is_none")]
778 pub prefer_symlinked_executabled: Option<bool>,
779
780 /// During installation the dependencies of some packages are automatically patched. If you want to disable this, set this config to false.
781 ///
782 /// See more: https://pnpm.io/settings#ignorecompatibilitydb
783 #[serde(alias = "ignore_compatibility_db")]
784 #[serde(skip_serializing_if = "Option::is_none")]
785 pub ignore_compatibility_db: Option<bool>,
786
787 /// Determines how pnpm resolves dependencies.
788 ///
789 /// See more: https://pnpm.io/settings#resolutionmode
790 #[serde(alias = "resolution_mode")]
791 #[serde(skip_serializing_if = "Option::is_none")]
792 pub resolution_mode: Option<ResolutionMode>,
793
794 /// Set this to true if the registry that you are using returns the `time` field in the abbreviated metadata.
795 ///
796 /// See more: https://pnpm.io/settings#registrysupportstimefield
797 #[serde(alias = "registry_supports_time_field")]
798 #[serde(skip_serializing_if = "Option::is_none")]
799 pub registry_supports_time_field: Option<bool>,
800
801 /// When false, the NODE_PATH environment variable is not set in the command shims.
802 ///
803 /// See more: https://pnpm.io/settings#extendnodepath
804 #[serde(alias = "extend_node_path")]
805 #[serde(skip_serializing_if = "Option::is_none")]
806 pub extend_node_path: Option<bool>,
807
808 /// When deploying a package or installing a local package, all files of the package are copied.
809 ///
810 /// See more: https://pnpm.io/settings#deployallfiles
811 #[serde(alias = "deploy_all_files")]
812 #[serde(skip_serializing_if = "Option::is_none")]
813 pub deploy_all_files: Option<bool>,
814
815 /// When set to true, dependencies that are already symlinked to the root node_modules directory of the workspace will not be symlinked to subproject node_modules directories.
816 ///
817 /// See more: https://pnpm.io/settings#dedupedirectdeps
818 #[serde(alias = "dedupe_direct_deps")]
819 #[serde(skip_serializing_if = "Option::is_none")]
820 pub dedupe_direct_deps: Option<bool>,
821
822 /// When this setting is enabled, dependencies that are injected will be symlinked from the workspace whenever possible.
823 ///
824 /// See more: https://pnpm.io/settings#dedupeinjecteddeps
825 #[serde(alias = "dedupe_injected_deps")]
826 #[serde(skip_serializing_if = "Option::is_none")]
827 pub dedupe_injected_deps: Option<bool>,
828
829 /// When enabled, a fast check will be performed before proceeding to installation. This way a repeat install or an install on a project with everything up-to-date becomes a lot faster.
830 ///
831 /// See more: https://pnpm.io/settings#optimisticrepeatinstall
832 #[serde(alias = "optimistic_repeat_install")]
833 #[serde(skip_serializing_if = "Option::is_none")]
834 pub optimistic_repeat_install: Option<bool>,
835
836 /// Check if current branch is your publish branch, clean, and up-to-date with remote.
837 ///
838 /// See more: https://pnpm.io/cli/publish#configuration
839 #[serde(alias = "git_checks")]
840 #[serde(skip_serializing_if = "Option::is_none")]
841 pub git_checks: Option<bool>,
842
843 /// The primary branch of the repository which is used for publishing the latest changes.
844 ///
845 /// See more: https://pnpm.io/cli/publish#configuration
846 #[serde(alias = "publish_branch")]
847 #[serde(skip_serializing_if = "Option::is_none")]
848 pub publish_branch: Option<String>,
849
850 /// The location of the local pnpmfile.
851 ///
852 /// See more: https://pnpm.io/settings#pnpmfile
853 #[serde(rename = "pnpmfile", alias = "pnpm_file")]
854 #[serde(skip_serializing_if = "Option::is_none")]
855 pub pnpm_file: Option<PathBuf>,
856
857 /// The location of a global pnpmfile. A global pnpmfile is used by all projects during installation.
858 ///
859 /// See more: https://pnpm.io/settings#globalpnpmfile
860 #[serde(rename = "globalPnpmfile", alias = "global_pnpm_file")]
861 #[serde(skip_serializing_if = "Option::is_none")]
862 pub global_pnpm_file: Option<PathBuf>,
863
864 /// .pnpmfile.cjs will be ignored. Useful together with --ignore-scripts when you want to make sure that no script gets executed during install.
865 ///
866 /// See more: https://pnpm.io/settings#ignorepnpmfile
867 #[serde(rename = "ignorePnpmfile", alias = "ignore_pnpm_file")]
868 #[serde(skip_serializing_if = "Option::is_none")]
869 pub ignore_pnpm_file: Option<bool>,
870
871 /// The generated patch file will be saved to this directory.
872 ///
873 /// See more: https://pnpm.io/cli/patch-commit
874 #[serde(alias = "patches_dir")]
875 #[serde(skip_serializing_if = "Option::is_none")]
876 pub patches_dir: Option<PathBuf>,
877
878 /// When true, pnpm will run any pre/post scripts automatically.
879 ///
880 /// See more: https://pnpm.io/settings#enableprepostscripts
881 #[serde(alias = "enable_pre_post_scripts")]
882 #[serde(skip_serializing_if = "Option::is_none")]
883 pub enable_pre_post_scripts: Option<bool>,
884
885 /// The shell to use for scripts run with the pnpm run command.
886 ///
887 /// See more: https://pnpm.io/settings#scriptshell
888 #[serde(alias = "script_shell")]
889 #[serde(skip_serializing_if = "Option::is_none")]
890 pub script_shell: Option<String>,
891
892 /// When true, pnpm will use a JavaScript implementation of a bash-like shell to execute scripts.
893 ///
894 /// See more: https://pnpm.io/settings#shellemulator
895 #[serde(alias = "shell_emulator")]
896 #[serde(skip_serializing_if = "Option::is_none")]
897 pub shell_emulator: Option<bool>,
898
899 /// Saved dependencies will be configured with an exact version rather than using pnpm's default semver range operator.
900 ///
901 /// See more: https://pnpm.io/cli/add#--save-exact--e
902 #[serde(alias = "save_exact")]
903 #[serde(skip_serializing_if = "Option::is_none")]
904 pub save_exact: Option<bool>,
905
906 #[serde(flatten)]
907 #[serde(default, skip_serializing_if = "BTreeMap::is_empty")]
908 pub extra: JsonValueBTreeMap,
909}